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tB,kVC5Fak8B,qCAAAA,KAAN,IAAMA,EACY,YAAvB,OAAOC,YAEH,YAECp8B,IACCE,OAAOH,OAAO,CAACC,KAAK,CAACA,EACvB,qVCCO0F,qCAAAA,wBALuB,WACF,WACI,eAClB,QAEPA,EAA6D,CACxE1F,EACAk8B,KAGA,IAAMG,EAAQnnB,CAAAA,EAAAA,EAAAA,OAAAA,EAAQlV,IAAU,UAAWA,EAAQA,EAAMq8B,KAAK,CAAGr8B,EAC3Ds8B,EAAgB/a,CAAAA,EAAAA,EAAAA,qBAAAA,EAAsB8a,GAMxCxB,CAAAA,EAAAA,EAAAA,mBAAAA,EAAoBwB,IAExBF,CAAAA,EAAAA,CAFgC,CAEhCA,iBAAAA,EAAkBG,EACpB,sPCnBO,SAAS/C,EAAez7B,CAAY,SAQPA,CAKpC,2FAbgBy7B,qCAAAA,OAJY,0PCW5B,gBACA,eAEA,IADA,UACY,KAAW,CACvB,GADuB,CACvB,UACA,OACA,YACA,uBACA,KACA,CACA,CACA,cACA,8BAEA,cACA,4BACA,WACA,UACA,UACA,OACA,IACA,2BACA,KAEA,CACA,gBACA,OACA,MACA,OACA,YACA,cACA,QACA,OACA,KACA,QACA,OACA,UACA,iBACA,uBACA,KACA,CACA,CACA,QACA,CACA,gBACA,8BACA,yBAGA,GADA,cAAoB,QACpB,kEACA,IA0HA,EA1HA,cACE,cAAoB,YACtB,cACA,CACA,EAAE,IACF,WACA,UACE,cAAoB,YACtB,gBACA,CACA,CACA,SACA,KACA,IACA,OACA,IACA,KACA,KACA,KACA,gDACA,oDACA,qDACA,cACA,eAAqC,UAAgB,CACrD,GADqD,OACrD,qBACA,kBACA,KACA,6BACA,YACA,MACA,MACA,CACA,CACA,cAGA,GAFA,KACA,KACA,IACA,eACA,aACA,CACA,UACA,WACA,kBACA,EACA,CACA,SACA,KACA,IACA,KACA,aACA,6BACA,CACA,aACA,MACA,uBACA,IACA,SACA,IACA,GACA,KACA,GACA,MACA,KACA,MACA,KACA,QACA,IACA,GAEA,IADA,KAEA,OACA,UACA,CACA,2BAGA,CACA,iBACA,yBACA,gBACA,kBACA,QACA,qBAGA,GADA,mBACA,sBACA,aACA,KACA,KACA,OACA,CACA,eACA,IACA,EAAgB,SAChB,MACA,CACA,qBACA,CACA,UACA,WACA,EACA,EACA,eAEA,IACA,CACA,CACA,OACA,EAAU,OACV,OACA,IACA,IACA,CACA,QACA,CACA,EAAM,OACN,EACA,IACA,IACA,CACA,CACA,CAEA,wBACA,aACA,IACA,OACA,uCACA,yBACA,UACA,oBACA,aACA,mBACA,CACA,EAAE,IACF,aACA,MACA,EACA,aACA,GACA,UACA,CACA,gBACA,eACA,mBACA,CAAG,GACH,CACA,uBAA6B,GAC7B,4BAAkC,GAClC,sBAA4B,GAC5B,yBAA+B,GAC/B,oBAA0B,MAC1B,+BAAqC,GACrC,yBAA+B,aAC/B,eACA,EACA,4BAAkC,YAClC,GACA,GACA,UACA,EACA,yBAA+B,aAC/B,WACA,cACA,mHAEA,yBACA,EACA,kCAAwC,YACxC,QACA,EACA,+BAAqC,YACrC,WACA,EACA,eAAqB,aACrB,UACA,OACA,OACA,OACA,QACA,KACA,SACA,GACA,CACA,QACA,IACA,IACA,UACA,EAAI,OACJ,GACA,CACA,EACA,yBAA+B,cAC/B,uBAA6B,cAC7B,0BAAgC,eAChC,UACA,OACA,OACA,OACA,OACA,OACA,KACA,SACA,GACA,CACA,QACA,IACA,IACA,UACA,EAAI,OACJ,GACA,CACA,EACA,2BAAiC,UACjC,EACA,EACA,GAEA,uBAQA,OALA,EAFA,8BAGA,gBAFA,aAEA,IACA,IACA,EAEA,GACA,OACA,SACA,KACA,QACA,MACA,KACA,QACA,aACA,KACA,QACA,MACA,KACA,SACA,KACA,CAwBA,OAvBA,MACA,GACA,OACA,WACA,gBACA,YACA,iBACA,YACA,EACA,IACA,eACA,OACA,aACA,UACA,GACA,YACA,KACA,WACA,eACA,OACA,GACA,GACA,YACA,CACA,EACA,sBAA4B,GAC5B,uBAA6B,aAC7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IALsB,CAAChnB,KAAK,CAAC,gBAIqB,SC7C9D,GD8CgC,CAACA,GC9CjC,ED8CsC,CAAC,GAAkC,QC9CzE,gBAA6C,CAC7C,QACA,CAAC,EAYD,SANA,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,kCACA,QACA,CAAK,CACL,gCACA,QACA,CAAK,CACL,kCACA,QACA,CACA,CAAC,EACD,mCACA,+BACA,0EC3BA,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAOF,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,0BACA,QACA,CAAK,CACL,6BACA,QACA,CAAK,CACL,8BACA,QACA,CAAK,CACL,yCACA,QACA,CACA,CAAC,EACD,UAOA,4BAIY,EAAO,WAEnB,CAAK,CACL,EACA,MAIA,eAEA,EACA,aACA,2BACA,CACA,aAIA,sCAEA,8BC5DA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,sCAAqD,CACrD,cACA,eACA,4BAEA,CAAC,EAAC,IACF,EAAoC,EAAQ,KAAiC,YAAlC,mBCW3C,qCAA6C,CAC7C,QACA,CAAC,EAgCD,SANA,KACA,0CACA,cACA,QACA,CAAK,CACL,EACA,GACA,oBACA,QACA,CAAK,CACL,uDACA,QACA,CAAK,CACL,8CACA,QACA,CAAK,CACL,+BACA,QACA,CAAK,CACL,iCACA,QACA,CAAK,CACL,gCACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,wCACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,oCACA,QACA,CAAK,CACL,iCACA,QACA,CAAK,CACL,6BACA,QACA,CAAK,CACL,uCACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,gCACA,QACA,CAAK,CACL,oCACA,QACA,CAAK,CACL,4CACA,QACA,CAAK,CACL,qCACA,QACA,CAAK,CACL,2CACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,iDACA,QACA,CAAK,CACL,kDACA,QACA,CAAK,CACL,iCACA,QACA,CACA,CAAC,EACD,eAOA,GACA,0BACA,SACA,CACA,EAXsD,EAAQ,IAAO,GACrE,EAA4B,EAAQ,KAA8C,CADrB,CAE7D,EAAiC,EAAQ,KAAmD,CADzD,CAEnC,EAAsC,EAAQ,KAAoC,CAD1C,CAExC,EAAkC,EAAQ,KAA2C,CADxC,CAE7C,EAA+B,EAAQ,IAA4B,EAD1B,EAEd,EAAQ,GAAuC,EAM1E,YANkC,EAMlC,mCACA,cACA,OACA,yBACA,mBACA,6BACA,8BACA,CACA,CACA,aACA,OACA,uBACA,sBACA,sBACA,wBACA,iBAEA,CACA,cACA,MACA,0DAEA,kBACA,QACA,2CADA,IAWA,gCACA,wBACA,2CAA0E,SAAa,+EAA+E,EAAW,+HAEjL,MACA,4BACA,oCACU,gCACV,eAEA,wCAA4E,SAAa,kDAAkD,EAAW,6EAGtJ,OAFA,4BACA,4BACA,CACA,EAAU,CAIV,CACA,OALmB,EAKnB,OACA,wCACA,6BACA,8BACA,CACA,kBAEA,wCAAoE,SAAa,oDAAoD,EAAW,+EAIhJ,OAHA,eACA,4BACA,4BACA,CACA,CACA,gBACA,GACA,6CAMA,qDACA,gBAMA,CAIA,kBAEA,QADA,SAA4B,GAAO,kEAAkE,EAAW,IAEhH,sBACA,wBACA,GACA,wBAGA,oDACA,YACA,CAAS,CAET,CACA,oBACA,wBAOA,OANA,GACA,qCACA,0BACA,+BAGA,QACA,CACA,cAGA,mBACA,CACA,oBACA,8BACA,GACA,qCACA,0BACA,8BACA,mBAGA,0BAIA,SACA,WAAmD,GAAO,kEAAkE,EAAW,GACvI,CACA,QACA,mBAAoB,UAAe,EACnC,wCAEA,MADA,mDAEA,CACA,kBACA,IACA,GACA,wBAGA,oDACA,YACA,CAAS,EAET,mCACA,CACA,gBACA,eAAoB,GAAO,kEAAkE,EAAW,oKAExG,oBACA,0DACA,YAGA,CACA,cACA,iKACA,CACA,0BACA,sGAEA,mCACA,cACA,eAEA,OADA,WACA,CACA,CACA,cACA,+FACA,CACA,cACA,iBACA,CACA,gBAKA,OADA,6CACA,iBACA,CACA,cACA,gFAAgH,UAAmB,IACnI,gBAGA,qBAEA,kCAIA,8BAIA,wBAIS,WACT,6BAA4C,EAAW;AAAA,EAAK,EAAM,GAElE,CACA,aACA,MACA,+IAEA,CACA,cACA,IACA,0BAEA,IACA,8BACA,CAAM,SACN,UACA,CACA,gBAEA,gBACA,wBACA,GACA,wBACA,oDACA,YACA,CAAS,CAET,CACA,cACA,+BACA,oCACA,iFAGA,wCACA,IAEA,qBAIA,0DACkB,yBAElB,+BACkB,6BAClB,SAGA,CACA,CACA,CACA,yCACA,sBAAiD,yBAA0C,WAC3F,sBAAiD,yBAA0C,WAC3F,sBAA+C,uBAAwC,WACvF,sBACA,eAGM,cACN,wBACA,MACA,CAAM,cACN,wBACA,MACA,CAAM,cACN,yBACA,MACA,CAAM,6DACN,0BACA,MACA,EAAM,IAEN,eAKA,KACA,eAEA,OADA,sBACA,CACA,EAVA,UAAkC,EAAM,iVACxC,GACA,wBACA,MACA,EACA,CAMA,wBACA,EACA,EACA,EAcA,GAbA,6BACA,8BACA,0BACA,4BACM,6BACN,8BACA,0BACA,6BAEA,OACA,SACA,MAEA,0BAOA,MANA,GAGA,iBAGA,4BAEA,sBACA,aACA,YAAuB,WAA0B,IACjD,mBAEA,mCAEA,2BACA,yBACA,KAEA,MADA,iBACA,sCAAmF,EAAM,sEAAsE,GAAgB,gFAE/K,6CAA+E,EAAM,gdACrF,CAAU,yBACV,KAEA,MADA,iBACA,sCAAmF,EAAM,sEAAsE,GAAgB,gFAE/K,6CAA+E,EAAM,gdACrF,CACA,CACA,gCCvdA,qCAA6C,CAC7C,QACA,CAAC,EACD,0CAAkD,CAClD,cACA,eACA,QACA,CACA,CAAC,EAAC,IACF,EAA4B,EAAQ,KAA4B,EAChE,UADmC,CACnC,GACA,kEAMA,CAHA,GACA,sBAEA,yCACA,CAGA,yBACA,mBACA,EAEA,sCACA,CACA,yCACA,mBACA,EAEA,mCACA,CACA,uCACA,mBACA,EAEA,IACA,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,sCAAqD,CACrD,cACA,eACA,QACA,CACA,CAAC,EAAC,8BCdF,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAMF,KACA,0CACA,cACA,QACA,CAAK,CACL,EACA,GACA,sCACA,QACA,CAAK,CACL,+CACA,QACA,CAAK,CACL,sCACA,QACA,CACA,CAAC,EACD,MAAkB,EAAQ,KAAyC,EACnE,GACA,OAFyB,IAGzB,MACA,OACA,QACA,CACA,cAEA,gEACA,CACA,cACA,UACA,0BAEA,GADA,6BACA,CACA,mBACA,KACA,CAEA,cACA,2CAAuD,EAAK,oFAI5D,OAFA,4BAEA,GACA,UAGA,EADA,QACA,IAAuC,EAAiB,EAExD,QAEA,KACA,YAEA,WACA,2CAA+D,EAAK,+DAEpE,+CACA,KACA,aAEA,QACA,KACA,gBAEA,mBACA,eACA,2CAA+D,EAAK,kEAEpE,oCACA,KACA,SACA,2CACA,CACA,OACA,oBACA,kBACA,CACA,8BCrFA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,8BAA6C,CAC7C,cACA,eACA,QACA,CACA,CAAC,EAAC,IACF,+BACA,cACA,kDACA,gCCZA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,gDAA+D,CAC/D,cACA,eACA,QACA,CACA,CAAC,EAAC,EACuB,IAAwC,EACzC,EAAQ,KAAkC,EADlE,EAAwB,EAExB,EAAe,EAAQ,EADQ,GACC,EAChC,UADsB,CACtB,GAIA,gBAIA,GACA,eACA,KACA,SAEA,yBAUA,OATA,WACA,2BACA,8BAIA,WAEA,CAAK,EACL,CACA,EApBA,EAEA,CACA,gDCnBA,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAQF,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,kCACA,QACA,CAAK,CACL,iDACA,QACA,CAAK,CACL,yCACA,QACA,CAAK,CACL,sCACA,QACA,CAAK,CACL,8CACA,QACA,CACA,CAAC,EACgB,EAAQ,IAAwC,EAAjE,IACA,EAA0B,EAAQ,GADV,CAC2C,EAC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A,SAqBA,KACA,eACA,KACA,SAEA,gEACA,eACA,WACA,sBAIA,mCAEA,UACA,WAIA,MADA,4BADA,wDACA,GACA,2BAEA,cAIA,MADA,4BADA,yDACA,GACA,2BAGA,sBACA,oBACA,2BACA,eACA,cACA,qBAGA,YACA,cAGA,aACA,eACA,iBAIA,kCAEA,SAEA,uBACA,2DACA,SACA,0DACA,CACA,kCAEA,CACA,CAAS,CACT,SAKA,uBACA,gEACA,SACA,0DACA,CACA,gCACA,CAAS,CACT,UACA,SAAkC,gBAAgB,4CAClD,SACA,0DACA,CACA,CAAK,EAEL,OADA,WACA,CACA,EApGA,WAqGA,cACA,eACA,KACA,SAMA,sBAJA,IAKA,eACA,WACA,sBAIA,mCAEA,UAEA,qBACA,oBACA,2BACA,eACA,cACA,qBAGA,YACA,cAGA,aACA,eACA,iBAIA,kCAEA,YACA,CACA,6DACA,sBACA,uEAC0B,yBAE1B,wDAGA,8CAEA,MACA,CACA,aACA,CACA,8DACA,sBACA,uEAC0B,yBAE1B,wDAGA,8CAEA,MACA,CACA,QAEA,uBACA,0DACA,sBACA,uEAC8B,yBAE9B,wDAGA,6CAEA,CACA,kCAEA,CACA,CAAS,CACT,SAKA,uBACA,gEAUA,OATA,qBACA,uEACkB,yBAElB,wDAGA,8CAEA,EACA,CACA,gCACA,CAAS,CACT,UACA,SAAkC,gBAAgB,2CAClD,sBACA,uEACc,yBAEd,wDAGA,6CAEA,CACA,CAAK,EAEL,OADA,WACA,CACA,EAzNA,IACA,CACA,uBACA,cAGA,kBAAiC,EAoNjC,cACA,eACA,KACA,SAKA,yBAgDA,OA/CA,WACA,2BACA,UAEA,qBACA,oBACA,2BACA,eACA,cACA,qBAGA,WACA,YACA,cAGA,aAGA,aACA,eACA,iBAEA,KAEA,SAEA,2BACA,MACA,wCAEA,MADA,2CACA,KACyB,CACzB,OACA,2BACA,QACA,YACA,aACA,CAA6B,CAC7B,CAAyB,CACzB,cACA,eACA,CAAqB,CAErB,CACA,CAAK,EACL,C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sBACA,EACA,GACA,OACA,KACA,WACA,EACA,aAAmB,aACnB,4BACA,EACA,SAAe,eACf,iDACA,WACA,qBACA,EACA,gDACA,EACA,iCACA,gBACA,MACA,aACA,MACA,EACA,kDACA,CACA,cACA,YACA,eACA,GAEA,cACA,SACA,cACA,YACA,gBACA,6CACA,CAAS,CACT,CACA,EACA,eAAqB,eACrB,uBACA,gCACA,iCACA,QACA,KACA,eAEA,SACA,cACA,UACA,gDACA,6CACA,CAAS,CACT,OACM,kBACN,EACA,SAAe,eACf,GACA,oBACA,oBACA,UACA,sBACA,CACA,WACA,qBACA,WACA,cACA,UACA,gDACA,8CACA,2CACA,cACA,iCACA,gBACA,OACA,eACA,kCACA,iBACA,OACA,YACA,oDACA,WACA,kDACA,6CACA,CAAK,CACL,CACA,EACA,eAAqB,eACrB,uBACA,MACA,4BACA,SACA,GACA,uCACA,KACA,OACA,cACA,UACA,+CACA,CAAO,CACP,EAAM,aACN,EACA,kBAAwB,aACxB,QACA,EACA,yBAA+B,eAC/B,WACA,EACA,cAAoB,iBACpB,8BACA,EACA,eAAqB,YACrB,oCACA,EACA,SAAe,8DC/Mf,aAEA,GACA,oDACA,2DAcA,IAEA,0CACA,CAAI,SAGJ,gBACA,CACA,IAME,kBAAgE,gCCDlE,SA/BA,IAEA,GACA,oDACA,2DAcA,IAEA,0CACA,CAAI,SAGJ,gBACA,CACA,IAME,kBAAyD,+BCvB3D,MAAe,EAAQ,KAAW,EAClC,GAAqB,WA0CrB,UACA,cACA,MAAgB,EAAmB,SACnC,QADmC,IACnC,sCACA,MACA,OACA,YACA,qBACA,SACA,CAAK,CACL,YACA,oBACA,UACA,GAEA,EACA,CACA,cACA,cACA,wBAAuD,YAAmB,CAC1E,aACA,SACA,UACA,YACA,YACA,EAAyB,GAAsB,IAC/C,UACA,uBACA,YACA,YACA,mBACA,CACA,oBACA,aACA,QACA,+BACA,cACA,CAAS,EACT,WACA,eACA,IACA,CACA,cACA,MAAsB,EAAmB,MACzC,WADyC,IACzC,6BACA,0BACA,eACA,eACA,iBACA,EACA,UACA,aACA,UACA,EACA,QAEA,cACA,EAA4B,EAAmB,EAC/C,EAAmB,aAD4B,CAE/C,GADmB,CACnB,WACA,kBACA,EACA,IACA,EACA,MACA,+DACA,2CACA,2BACA,kBAQA,uBACA,gBACA,wBACA,mBACA,cAsYA,oBACA,cACA,aACA,cACA,gBACA,CAyBA,cACA,iBACA,qBACA,KACA,KACA,uBACA,IACA,CACA,iBACA,gBACA,mBACA,UACA,cACA,OACA,SACA,cACA,CACA,CACA,cACA,mCACA,CACA,gBACA,YAAkB,WAAsB,eACxC,CACA,kBACA,iBACA,gBACA,aACA,KACA,eACA,cACA,WACA,YAAwB,WAA6B,IACrD,wBACA,UACA,YACA,MACA,IACA,IACA,WACA,IAEA,yBACQ,WACR,KACA,gBACA,gBACA,CACA,CACA,gBACA,8CACA,sBACA,CACA,eACA,oBACA,WACA,gBACA,CACA,CACA,kBACA,aACA,iBACA,KAAc,wBAA0B,4BAAoC,EAC5E,KACA,EAEA,CACA,kBACA,EACA,EACA,KAAc,wBAA0B,4BAAoC,EAE5E,CACA,gBACA,qDACA,CACA,cACA,WACA,0BACA,UACA,UACA,MACA,SACA,CACA,CACA,gBACA,+CACA,cACA,WACA,2BACA,UACA,UACA,MACA,SACA,CACA,CAvHA,6CACA,+BACA,oBACA,qBACA,QACA,KACA,uBACA,OACA,CACA,oBACA,gBACA,cACA,KACA,eACA,cACA,GACA,wDACA,GACA,2DACA,KACA,SACA,iBACA,CACA,EAiGA,WACA,cACA,QACA,OACA,cACA,mBACA,aACA,cACA,IACA,0CACA,UAKA,GAJA,UACA,cACA,cACA,QACA,UACA,2BACA,aACA,UACA,UACA,MACA,CACA,CACA,qBACA,SACA,CAAI,SACJ,8BACA,EAAI,OACJ,GACA,CACA,CACA,cACA,IACA,gBACA,sBACA,SACA,CAAI,SACJ,8BACA,CACA,CACA,gBACA,8BACA,4BACA,CAAG,CACH,CACA,cACA,OAAW,8BACX,CACA,gBACA,gBACA,WAEA,OADA,uBACA,CACA,CACA,WACA,EACA,EACA,EACA,EACA,EACA,GAsCA,cACA,eACA,aACA,UACA,qBACA,GACA,sBACA,MACA,CACA,CACA,MACA,OACA,SACA,EAAI,IACJ,KACA,YACA,WACA,WACA,OACA,UACA,EAEA,OADA,OAzDA,cACA,YAAoB,WAAiB,KACrC,KAAa,gBACb,cADiD,EACjD,YACA,eACA,wCACA,CACA,gBACA,YACA,MACA,CACA,UAEA,aACA,OACA,oCAEA,UACA,0BACA,gBACA,uBAEA,oBAEA,YAEA,SACA,YAEA,OADA,aAEA,sBACA,WACA,qBACA,gBACA,uBACA,EAsBA,GACA,IACA,CACA,oBACA,6BACA,gBA1QA,KACA,aACA,4CACA,SACA,uBACA,uBACA,oCACA,uBACA,CAAW,EACX,MACA,CACA,IAdA,EAcA,OACA,UAEA,OAjBA,EAgBA,CAAoC,aAAsB,CAf1D,MAeA,EAfA,GAgBA,CACA,EA2PA,iBACA,MAruBA,cACA,SACA,OACA,kBACA,CACA,yBAIA,GAHA,QACA,gBACA,mBACA,GACA,YACA,8BACA,EACA,iGAEA,CACA,eACA,oBACA,mBAotBA,yBACA,MAEA,UACA,2CACA,YACA,YADA,2BAEA,MACA,OACA,SACA,EAAI,IACJ,KACA,YACA,WACA,WACA,OACA,UACA,EA0CA,OAzCA,OACA,WACA,WACA,YACA,6BACA,gBACA,mBACA,CACA,OACA,oCAEA,UACA,0BACA,gBACA,uBAEA,oBAEA,YAEA,SACA,YAEA,OADA,aAEA,sBACA,WACA,qBACA,gBACA,uBACA,CAAK,CACL,YACA,eACA,aACA,UACA,qBACA,GACA,sBACA,MACA,CACA,GAEA,IACA,CACA,sBAEA,eADA,gBACA,QAEA,OADA,WACA,QACA,qBACA,KACA,KACA,uBACA,IACA,CACA,iBACA,gBACA,cACA,QAAmB,WAAuB,KAC1C,KAAe,gBACf,cADmD,GACnD,sBAGA,SACA,EACA,EACA,EACA,EACA,EACA,mBARA,UAUA,UAEA,iBACA,eACA,cACA,qBACA,SACA,OACA,EACA,cACA,kBACA,GACA,YACA,WACA,eACA,OACA,UACA,CAAa,CACb,IAEA,CACA,CACA,gBACA,iBACA,CACA,gBACA,iBACA,CACA,gBACA,4BAAoC,UAAgB,CACpD,CACA,gBACA,eACA,YAAkB,WAAkB,IACpC,0BACA,QACA,CACA,gBACA,2BACA,CACA,gBACA,QACA,CAkGA,aACA,YACA,oHAEA,CACA,WACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEA,IAuaA,EAvaA,SACA,uBACA,8BACA,sBACA,gCACA,yBACA,cACA,eACA,oCACA,oBACA,0DACA,gBACA,iBACA,gBA0ZA,EA1ZA,KA2ZA,cACA,sBACA,OAzhBA,kBACA,eACA,WACA,OACA,UACA,SACA,IACA,SACA,WACA,WACA,OACA,UACA,GACA,EAEA,aACA,QACA,iBACA,SACA,OACA,EACA,MADA,2BAIA,SACA,+CAAiE,EAEjE,WADA,0BAEA,SACA,6BACA,SACA,OAEA,EACA,EAFA,aAIA,EACA,EACA,EAGA,SAGA,GAFA,iBAEA,MADA,gBAEA,YACA,sKAEA,eACA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,UACA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,UACA,SACA,uBACA,SACA,UACA,SACA,MACA,SACA,uCACA,SACA,yBACA,SACA,OAEA,IADA,aACA,MAEA,CACA,CACA,QACA,EAybA,YACA,iCACA,YACA,IACA,GACA,WACA,UACA,SACA,SACA,WACW,CACX,UAEA,GACA,EACA,CADA,KACA,OACA,UAGA,IADA,yCAEA,aACA,YACA,UACA,KACA,KACA,EAEA,WACA,UACA,MACA,QACQ,IACR,QACA,CACA,QACA,EA/bA,CACA,kBACA,gBACA,UACA,yBACA,yBACA,oCACA,CA6BA,oBACA,gBACA,UACA,GACA,sBACA,WACA,qBACA,UACA,WACA,wBACA,MACA,EACA,yBAEA,CACA,kBACA,WACA,sBACA,OACA,kBACA,GACA,CACA,CAAG,EACH,WACA,SACA,yBACA,SACA,aACA,kBACA,YACA,CAAW,CACX,CAAK,CACL,yBACA,aACA,uCACA,KACA,uBACA,mBACA,QACA,YACA,mBACA,CAAe,CACf,YACA,iBACA,GAEA,IACA,EAAQ,IACR,IACA,WACA,OACA,YACA,mBACA,CAAW,CACX,YACA,iBACA,GAEA,IACA,kBACA,gBACA,MACA,CAAS,CACT,CACA,CAAK,CACL,iBACA,0BACA,CACA,QACA,OACA,kBACA,gBACA,CAAS,CACT,CACA,CAAK,CACL,kBACA,2BACA,CACA,QACA,OACA,kBACA,iBACA,CAAS,CACT,CACA,CACA,CAAG,CACH,CACA,aACA,YAOA,kBACA,SACA,KACA,IACA,IAEA,iBACA,IAZA,EAYA,IACA,MAZA,IAAW,KADX,EAaA,YACA,cACA,YACA,oFAEA,iBACA,KACA,aACA,YACA,CAAgB,qBAAyB,CACzC,KACA,EAEA,UACA,CACA,cA3BW,EACX,MACA,CA2BA,CAAK,CAEL,EACA,EACA,EACA,WACA,CACA,yBACA,gBACA,WACA,YACA,CAAc,gBAAwB,CACtC,KACA,OAEA,CACA,WACA,UACA,WACA,qBACA,SAA0B,iBAC1B,UACA,QACA,CACA,GACA,CAAO,CACP,yBACA,aACA,OACA,EACA,EACA,IAEA,aACA,GACA,CAAO,CACP,kBASA,IARA,KACA,aACA,OACA,EACA,EACA,IAEA,aACA,IAA+B,YAAgC,EAE/D,OACA,eACA,GAEA,CAAO,CACP,kBAEA,IADA,KAEA,cACA,YACA,YAGA,WACA,CACA,EAEA,CACA,aACA,YACA,wQAGA,OADA,4BACA,CACA,CACA,iBACA,kCAAoE,IAAO,IAC3E,mBACA,oBACA,cAA2B,IAAU,KACrC,WACA,WACA,gBAGA,OADA,WACA,CACA,CACA,YACA,EACA,EACA,EACA,EACA,EACA,GAWA,MALA,QACA,CALA,EACA,gCACA,EACA,SAEA,OACA,aACA,gBAGA,CA+LA,eACA,aACA,KACA,KACA,KACA,oCACA,OACA,OACA,yBACA,sBACA,OAEA,CACA,iBAqFA,cACA,MACA,CACA,oBACA,cAxFA,cACA,cACA,+CACA,CACA,QACA,cACA,WACA,IACA,gBACA,eACA,YACA,WACA,KAEA,CACA,SACA,UACA,OAEA,KADA,WAEA,IACA,EACA,sBACA,QACA,QAEA,KADA,UAEA,QACA,QACA,SACA,QACA,QACA,SACA,QACA,SACA,QACA,SACA,QACA,SACA,OACA,cACA,YACA,QACA,SACA,QACA,cACA,UACA,QACA,QAEA,KADA,WAEA,IACA,EACA,KACA,iBACA,QACA,QACA,kBACA,KACA,QACA,wBACA,CACA,qBACA,QACA,CA5QA,oBACA,UACA,QACA,sBACA,MACA,SACA,wBACA,MACA,UACA,EACA,EACA,EACA,wBAEA,MACA,SACA,gCACA,MACA,SACA,yBACA,MACA,UACA,0BACA,MACA,SACA,yBACA,MACA,UACA,0BACA,MACA,SACA,2BACA,MACA,UACA,2BACA,MACA,SACA,4BACA,MACA,UACA,6BACA,MACA,SACA,uBACA,MACA,CACA,IACA,gCACA,WACA,IAEA,oBAEA,OADA,iBACA,GACA,SACA,SAlTA,OACA,gBACA,WACA,4BACA,eAvgCA,KACA,MACA,cACA,gBACA,aACA,CAEA,IADA,cAEA,YACA,8BACA,KACA,2GAEA,OAEA,oBACA,oBACA,iBACA,CACA,QACA,EAm/BA,oBACA,WACA,MACA,OACA,mBACA,EAAM,IACN,+BACA,WACA,OACA,WACA,aACA,CAAO,CACP,YACA,aACA,EAEA,EAAI,IACJ,EACA,OACA,MACA,EACA,kCAEA,EAuRA,OACA,KACA,SAKA,OAJA,OAEA,aADA,aACA,aACA,MACA,GACA,QACA,OACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,OACA,OACA,aACA,cACA,SACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,mBACA,OACA,IACA,KACA,qBACA,0BAEA,KACA,SACA,mBACA,OACA,cACA,CACA,KACA,SACA,gBACA,QACA,gBAEA,IADA,aACA,QACA,OACA,oCACA,KACA,SAEA,GADA,cACA,8BACA,yBACA,qCACA,KACA,SACA,QACA,YACA,kMAEA,SACA,cACA,KACA,UACA,eACA,KACA,SACA,UACA,KACA,UACA,UACA,KACA,SACA,sBACA,wBACA,wCACA,KACA,SAEA,GADA,cACA,QACA,OACA,MACA,EACA,iCAEA,EACA,EAwHA,QADA,kCAEA,IACA,WACA,UACA,eACA,CACA,4CACA,UACA,gBACA,KACA,CACA,CAKA,OAJA,cACA,WACA,YACA,eACA,yBACA,CACA,GAKA,QACA,CACA,iBAAuB,eACvB,YASA,OARA,OACA,YACA,YACA,CAAK,CACL,YACA,MACA,GAEA,MACA,EACA,0BAAgC,eAGhC,OADA,GADA,QACA,GACA,MACA,EACA,uBAA6B,mBAzkC7B,EA0kCA,aACA,4CACA,aACA,CAEA,OA/kCA,EA8kCA,CAAoC,gBAAqB,CA7kCzD,MA6kCA,EA7kCA,GA8kCA,CACA,EACA,6BAAmC,YACnC,cACA,EACA,aAAmB,eACnB,iCACA,MA77CA,SACA,EACA,EACA,EACA,EACA,GAEA,gBACA,YACA,eACA,SACA,aACA,cAEA,EACA,UAGA,OAFA,2BACA,SA86CA,GA96CA,KACA,oBACA,CAsFA,gBACA,wBACA,uBACA,mBACA,OACA,oCACA,IAtIA,EAgGA,IAyBA,EAEA,EAWA,cACA,cACA,OACA,iBACA,IAEA,CACA,YACA,qJAEA,QACA,aACA,qBACA,oBACA,IACA,IACA,WACA,MACA,SAEA,OADA,iBACA,kBACA,CAAY,SACZ,GACA,oBACA,UACA,0BACA,CACA,IACA,UAaA,OAZA,aACA,IACA,aACA,IACA,SA+yCA,GA/yCA,KACA,IACA,WACA,CAAkB,SAClB,IACA,CACA,EACA,YACA,kBACA,CAEA,OADA,KACA,IACA,EAAY,OACZ,GACA,CACA,CACA,8BACA,2BACA,IACA,UAYA,OAXA,mBACA,IACA,aACA,MACA,cACA,IACA,WACA,CAAY,SACZ,IACA,CACA,CAAS,IACT,mBACA,CAEA,YADA,cAEA,SACA,SADA,YAGA,qBAEA,SADA,iBAEA,WACA,WACA,YACA,YACA,iBACA,0BACA,2BACA,QAEA,IADA,QACA,IAIA,OAHA,wBACA,eACA,CAAS,EACT,mBACA,CACA,oBACA,OACA,MACA,qBACA,2BACA,gBACA,oBAEA,oBACA,OACA,MACA,qBACA,2BACA,gBACA,oBAEA,4BACA,OACA,gBACA,MACA,2BACA,gBACA,oBAEA,0CACA,2CACA,kCACA,gBACA,2CACA,4CACA,2CACA,4CACA,6CACA,6CACA,8BACA,gBACA,+BACA,gBACA,yCACA,8CACA,OACA,2BACA,MACA,gBACA,oBAEA,KA5QA,QADA,EA6QA,IA5QA,wBAIA,kBAHA,GACA,SACA,iBACA,OAyQA,MACA,gBACA,EACA,OACA,IACA,cACA,GAEA,2BACA,gBACA,qBACA,cAEA,GACA,mCACA,4BAEA,gBAvMA,GACA,IACA,IAxBA,EAgBA,EAEA,EAzCA,EAgBA,EAEA,EACA,EA4BA,eAA4C,YAAc,CAC1D,CAAM,SACN,OA1BA,EA0BA,cAXA,2BACA,IACA,IACA,MACA,cAlBA,cACA,UACA,kBAEA,kBAEA,IACA,gCACA,gBACA,kBACA,CAAU,SACV,IACA,CACA,EAKA,GACA,mBAOA,CACA,OAnDA,EAmDA,EApCA,2BACA,IACA,IACA,MACA,KACA,kCAnBA,cACA,OACA,OACA,0BACA,SACA,IACA,0BAEA,kBAEA,cACA,iBACA,uCACA,EAMA,GACA,mBA+BA,EAgMA,GAEA,qBADA,SAEA,OAlMA,EAkMA,EAlMA,EAkMA,UA1KA,2BACA,IACA,IACA,MACA,QACA,cA5BA,cACA,WACA,oBACA,uBAEA,IACA,gCACA,mBACA,CAAY,SACZ,KACA,MACA,CAEA,YACA,EAAQ,IACR,IACA,gCACA,gBACA,kBACA,CAAU,SACV,IACA,CACA,EAMA,GACA,+BAsKA,GADA,WAEA,GACA,wBACA,CACA,cACA,YACA,2HAEA,UACA,CACA,QACA,CACA,4BACA,4CACA,OACA,qBAGA,gCACA,6BA1SA,gBA0SA,GAzSA,IAySA,GAzSA,QAySA,EAxSA,MAwSA,EAtSA,MAsSA,EArSA,YACA,OAoSA,EAnSA,aACA,OAmSA,iCACA,yBAEA,YADA,aAEA,OACA,sBACA,2BACA,MACA,aACA,oBAEA,GACA,YACA,qBACA,KACA,IADA,gBAGA,OACA,qBAEA,aACA,kIAEA,CACA,uBACA,GACA,YACA,qBACA,KACA,IADA,gBAGA,OACA,qBAEA,aACA,gIAEA,CACA,+CACA,aACA,QACA,SACA,yDAEA,CACA,gBAOA,MANA,oBACA,UACA,sBACA,WACA,wBACA,IACA,mBACA,CACA,QACA,IACA,OACA,cACA,IACA,SAKA,OAJA,SACA,KACA,gBACA,aACA,WACA,KACA,KACA,mBACA,CACA,EAwlCA,EACA,GACA,yBACA,sBACA,OACA,EACA,GAEA,gBACA,eACA,6BACA,CACA,iBACA,YACA,gCACA,EACA,6BACA,CACA,CACA,CAAG,CACH,gCCjmDE,kBAAuF,6BCDzF,kBAA4C,6BCS5C,+CACA,+BACA,kBACA,WAGA,GAFA,qBACA,6BACA,UAEA,aADA,KACA,EACA,4BACI,IAEJ,OACA,WACA,OACA,MACA,aALA,UAKA,OACA,OACA,CACA,CACA,UAAgB,GAChB,KAAW,GACX,MAAY,gDCtBZ,2CACA,6BACA,+BACA,kCACA,+BACA,+BACA,8BACA,kCACA,+BACA,2BACA,2BACA,kBAQA,GACA,qBACA,QACA,CAAK,CACL,+BAAsC,CACtC,gCAAuC,CACvC,4BACA,CAAG,CACH,gBACA,KACA,kBACA,aACA,eACA,YACA,iBACA,CAgBA,cAEA,kBACA,aACA,eACA,YACA,iBACA,CAtBA,gCACA,mCACA,GACA,oBACA,sBACA,QAEA,YACA,0GAEA,iDACA,EACA,oCACA,qDACA,EAEA,wBAOA,wBACA,gBACA,iBACA,0BACA,oBACA,GAA2B,4BAAoC,CAC/D,kCACA,wBAEA,OACA,WACA,OACA,MACA,aALA,UAKA,OACA,OACA,CACA,CAWA,cACA,MACA,oBACA,UACA,cAEA,CAUA,aACA,oBAVA,EACA,EAUA,iDAXA,EAYA,SAXA,GAAwB,mBAExB,IACA,8BACA,WACA,CAAK,GAOL,cACA,CACA,cA8IA,kBACA,oBACA,SACA,IAIA,OApHA,sBACA,IAlEA,IA/DA,EAiIA,WACA,2CACA,SACA,sBAEA,UACA,aACA,aACA,aACA,KACA,KACA,cACA,mBACA,OACA,OACA,KACA,KACA,QACA,OACA,cAEA,YACA,EACA,EACA,EACA,EAGA,CACA,CACA,KACA,OACA,OACA,EACA,oBACA,KACA,MACA,SACA,GACA,wBACA,uBACA,QACA,EAAW,EACX,SACA,QA9GA,EAgHA,EAhHA,EAiHA,EACA,cACA,iBACA,GACA,mBACA,EACA,OACA,KACA,EAVA,EA9GA,EACA,OACA,EACA,OACA,OACA,OACA,UAoHA,WACA,EAEA,IACA,uBACA,QACA,YAAoB,WAAqB,IACzC,EACA,IADA,OACA,GACA,KACA,EACA,EACA,EACA,EACA,QAEA,wBAzMA,QADA,EA0MA,IAzMA,wBAIA,kBAHA,GACA,SACA,iBACA,MAqMA,EACA,IACA,gBACA,oBAGA,EACA,IADA,UACA,KACA,KACA,EACA,EACA,EACA,EACA,QAEA,iBACA,6BACA,SACA,SA5HA,GACA,iBACA,gBACA,mBACA,WACA,uBAEA,OACA,0BACA,YACA,oBACA,OACA,YACA,sBACA,sBACA,UACA,CAAe,CACf,YACA,sBACA,gCACA,EACA,EACA,UAEA,gBACA,mBACA,WACA,cACA,CACA,CACA,OACA,EA6FA,GACA,EACA,EACA,EACA,EAGA,aACA,kDACA,qBAHA,cAIA,mBAA+B,8BAAyC,EACxE,GACA,4EAEA,CACA,QACA,EAKA,sBACA,sBACA,CAAG,EACH,CACA,CACA,cACA,mBACA,gBACA,QACA,KACA,YACA,iCACA,yBACA,CAAO,CACP,YACA,iCACA,yBACA,GAEA,yCACA,CACA,gDACA,UAEA,MACA,+BACA,YACA,YACA,GACA,yBACA,qCACA,CACA,qCACA,WACA,cACA,QACA,oBACA,UACA,2BACA,kBACA,UACA,OACA,CAAW,EACX,kCACA,EAAU,OACV,iBAA8B,GAC9B,IADqC,QACrC,OAAgC,EAAO,MAE7B,EAAO,4BACjB,MACA,CACA,gBACA,EACA,cACA,UAAgB,EAChB,MACA,wBACA,EACA,EACA,WACA,uBACA,CAAO,CACP,EAEA,CAAG,CACH,kBACA,QAIA,OAHA,eACA,GACA,CAAK,EACL,CACA,CAAG,CACH,oBACA,OACA,gBACA,QACA,CAAO,MAEJ,CACH,iBACA,SACA,YACA,yEAEA,QACA,CACA,EACA,WAAiB,GACjB,UAAgB,GAChB,UAAgB,GAChB,eAAqB,GACrB,YAAkB,GAClB,UAAgB,GAChB,iEAAuE,CACvE,EACA,KAAW,YACX,uEACA,EACA,OAAa,aACb,kBACA,8BACA,CACA,EACA,cAAoB,iBACpB,WACA,YACA,+DAEA,UAAuB,UACvB,QACA,SACA,WACA,oCACA,6BACA,EACA,aACA,WACA,cACA,gBACA,6BACA,YACA,yBACA,2BACA,QACA,uBAAkD,IAAc,IAChE,oBACA,YACA,CACA,oCACA,EACA,eAAqB,aAcrB,MALA,CARA,GACA,WACA,gBACA,iBACA,eACA,cACA,aACA,GACA,WACA,YACA,WACA,UACA,EACA,CACA,EACA,eAAqB,iBACrB,MACA,IAAc,CACd,OACA,WACA,wCACA,aACA,WACA,cACA,gBACA,YACA,yBACA,2BACA,QACA,uBAAwD,IAAoB,IAC5E,oBACA,YACA,CACA,qBACA,0BACA,eACA,YACA,kCACA,EACA,WAAiB,YACjB,OAAW,aACX,EACA,YAAkB,aAClB,OAAW,oBACX,EACA,gBAAsB,GACtB,MAAY,aACZ,OACA,WACA,UAAgB,qBAA4B,CAC5C,OACA,CACA,EACA,MAAY,eACZ,OACA,WACA,OACA,yBACA,CACA,EACA,iBAAuB,aACvB,UACA,IACA,OACA,IACA,UACA,aACA,GACA,OACA,oBACA,UACA,2BACA,WACA,CAAI,SACJ,IACA,EAAI,OACJ,KACA,CACA,EACA,0BAAgC,YAChC,4BACA,EACA,KAAW,aACX,iBACA,EACA,gBAAsB,iBACtB,gCACA,EACA,aAAmB,eACnB,2BACA,EACA,YAAkB,aAClB,wBACA,EACA,eAAqB,cACrB,kBAAwB,eACxB,gCACA,EACA,WAAiB,eACjB,yBACA,EACA,OAAa,YACb,kBACA,EACA,qBAA2B,iBAC3B,qCACA,EACA,oBAA0B,eAC1B,kCACA,EACA,iBAAuB,eACvB,+BACA,EACA,SAAe,eACf,uBACA,EACA,eAAqB,eACrB,6BACA,EACA,YAAkB,iBAClB,4BACA,EACA,QAAc,aACd,oBACA,EACA,UAAgB,aAChB,sBACA,EACA,sBAA4B,UAC5B,EACA,EACA,GAEA,gCACA,EACA,EACA,EAEA,EACA,eAAqB,YACrB,0BACA,EACA,SAAe,4DCthBb,kBAAqD,+BCArD,kBAAiE,+BCFnE,qCAA6C,CAC7C,QACA,CAAC,EACD,6CAAqD,CACrD,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,KAD2B,EAAQ,KAAuB,EAC1D,UADkC,aAClC,gCCVA,qCAA6C,CAC7C,QACA,CAAC,EAAC,SAMF,KACA,0CACA,cACA,SACK,CACL,EACA,GACA,wBACA,QACA,CAAK,CACL,mCACA,QACA,CAAK,CACL,0BACA,QACA,CACA,CAAC,EACD,yFACA,SACA,UACA,OACA,CACA,WAGA,CACA,MACA,OACA,CACA,OACA,OACA,CACA,YACA,OACA,CACA,eACA,QACA,CACA,CACA,mEACA,oBACA,EACA,MAEA,KACA,CACA,qBACA,EACA,UAEA,SACA,CACA,oBACA,EACA,aAEA,iBACA,cACA,CACA,+BCnEA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,oCAAmD,CACnD,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,OADmC,KAAuB,EAC1D,UADkC,aAClC,kCCVA,qCAA6C,CAC7C,QACA,CAAC,EAAC,OACF,wCAAuD,CACvD,cACA,eACA,QACA,CACA,CAAC,EAAC,IAEF,KAD2B,EAAQ,KAAuB,EAC1D,UADkC,aAClC,eCVA,IAOA,EACA,EAkFA,EA1FA,eAUA,aACA,8CACA,CACA,aACA,gDACA,CAqBA,cACA,kBAEA,uBAGA,2BAEA,OADA,aACA,gBAEA,IAEA,aACA,CAAM,SACN,IAEA,uBACA,CAAU,SAEV,uBACA,CACA,CAGA,EA5CA,WACA,IAEA,EADA,8BACA,WAEA,CAEA,CAAM,SACN,GACA,CACA,IAEA,EADA,gCACA,aAEA,CAEA,CAAM,SACN,GACA,CACA,EAAE,EAqDF,SACA,KAEA,KAEA,aACA,OAGA,KACA,SACA,cAEA,KAEA,UACA,IAEA,CAEA,aACA,OAGA,WACA,KAGA,IADA,eACA,IAGA,IAFA,IACA,KACA,OACA,GACA,WAGA,KACA,UACA,CACA,OACA,KACA,SApEA,GACA,oBAEA,uBAGA,6BAEA,OADA,eACA,gBAEA,IAEA,IACA,CAAM,SACN,IAEA,qBACA,CAAU,SAGV,qBACA,CACA,CAIA,EA0CA,GACA,CAgBA,gBACA,WACA,YACA,CAWA,cA5BA,uBACA,gCACA,sBACA,YAAwB,mBAAsB,IAC9C,oBAGA,mBACA,iBACA,IAEA,EAOA,2BACA,+BACA,EACA,kBACA,aACA,SACA,UACA,aACA,CADsB,CACtB,YAIA,OACA,gBACA,SACA,QACA,mBACA,uBACA,SACA,oBACA,wBAEA,wBAAsC,UAEtC,sBACA,+CACA,EAEA,iBAA4B,WAC5B,oBACA,6CACA,EACA,mBAA6B,wCCvL7B,gBACA,8CACA,kEAGA,QACA,+ECNA,QAEA,cACA,4BACA,gCCJA,cACA,0BAA2C,UAC3C,uDCFA,cACA,0CAEA,kBACA,cAEA,qBACA,YACA,EAAK,GACL,CACA,gBACA,gCACA,6DAAuF,WAEvF,WAEA,+BAEA,OAAmB,gBACnB,yDAEA,eACA,6DACA,iDACA,gDACA,UAQA,OAJA,YAEA,cAEA,CACA","sources":["webpack://_N_E/../../node_modules/next/dist/build/deployment-id.js?d2b7","webpack://_N_E/../../node_modules/next/dist/build/polyfills/polyfill-module.js?1142","webpack://_N_E/../../src/client/add-base-path.ts","webpack://_N_E/../../src/client/app-bootstrap.ts","webpack://_N_E/../../src/client/app-call-server.ts","webpack://_N_E/../../src/client/app-find-source-map-url.ts","webpack://_N_E/../../src/client/app-index.tsx","webpack://_N_E/../../src/client/app-next.ts","webpack://_N_E/../../src/client/app-webpack.ts","webpack://_N_E/../../src/client/assign-location.ts","webpack://_N_E/../../../src/client/components/app-router-announcer.tsx","webpack://_N_E/../../../src/client/components/app-router-headers.ts","webpack://_N_E/../../../src/client/components/app-router.tsx","webpack://_N_E/../../../src/client/components/bailout-to-client-rendering.ts","webpack://_N_E/../../../src/client/components/client-page.tsx","webpack://_N_E/../../../src/client/components/client-segment.tsx","webpack://_N_E/../../../src/client/components/error-boundary.tsx","webpack://_N_E/../../../client/components/globals/handle-global-errors.ts","webpack://_N_E/../../../client/components/globals/intercept-console-error.ts","webpack://_N_E/../../../client/components/globals/patch-console.ts","webpack://_N_E/../../../src/client/components/hooks-server-context.ts","webpack://_N_E/../../../src/client/components/is-hydration-error.ts","webpack://_N_E/../../../src/client/components/is-next-router-error.ts","webpack://_N_E/../../../src/client/components/layout-router.tsx","webpack://_N_E/../../../src/client/components/match-segments.ts","webpack://_N_E/../../../src/client/components/nav-failure-handler.ts","webpack://_N_E/../../../src/client/components/navigation-untracked.ts","webpack://_N_E/../../../src/client/components/navigation.ts","webpack://_N_E/../../../src/client/components/navigation.react-server.ts","webpack://_N_E/../../../src/client/components/not-found-boundary.tsx","webpack://_N_E/../../../src/client/components/not-found.ts","webpack://_N_E/../../../src/client/components/promise-queue.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/attach-hydration-error-state.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/capture-stack-trace.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/console-error.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/enqueue-client-error.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/hydration-error-info.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/stitched-error.ts","webpack://_N_E/../../../../../../src/client/components/react-dev-overlay/internal/helpers/use-error-handler.ts","webpack://_N_E/../../../src/client/components/redirect-boundary.tsx","webpack://_N_E/../../../src/client/components/redirect-status-code.ts","webpack://_N_E/../../../src/client/components/redirect.ts","webpack://_N_E/../../../src/client/components/render-from-template-context.tsx","webpack://_N_E/../../../client/components/router-reducer/aliased-prefetch-navigations.ts","webpack://_N_E/../../../client/components/router-reducer/apply-flight-data.ts","webpack://_N_E/../../../client/components/router-reducer/apply-router-state-patch-to-tree.ts","webpack://_N_E/../../../client/components/router-reducer/clear-cache-node-data-for-segment-path.ts","webpack://_N_E/../../../client/components/router-reducer/compute-changed-path.ts","webpack://_N_E/../../../client/components/router-reducer/create-href-from-url.ts","webpack://_N_E/../../../client/components/router-reducer/create-initial-router-state.ts","webpack://_N_E/../../../client/components/router-reducer/create-router-cache-key.ts","webpack://_N_E/../../../client/components/router-reducer/fetch-server-response.ts","webpack://_N_E/../../../client/components/router-reducer/fill-cache-with-new-subtree-data.ts","webpack://_N_E/../../../client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts","webpack://_N_E/../../../client/components/router-reducer/handle-mutable.ts","webpack://_N_E/../../../client/components/router-reducer/handle-segment-mismatch.ts","webpack://_N_E/../../../client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts","webpack://_N_E/../../../client/components/router-reducer/invalidate-cache-by-router-state.ts","webpack://_N_E/../../../client/components/router-reducer/is-navigating-to-new-root-layout.ts","webpack://_N_E/../../../client/components/router-reducer/ppr-navigations.ts","webpack://_N_E/../../../client/components/router-reducer/prefetch-cache-utils.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/find-head-in-cache.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/get-segment-value.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/has-interception-route-in-current-tree.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/hmr-refresh-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/navigate-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/prefetch-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/refresh-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/restore-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/server-action-reducer.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/server-patch-reducer.ts","webpack://_N_E/../../../client/components/router-reducer/refetch-inactive-parallel-segments.ts","webpack://_N_E/../../../client/components/router-reducer/router-reducer-types.ts","webpack://_N_E/../../../client/components/router-reducer/router-reducer.ts","webpack://_N_E/../../../client/components/router-reducer/should-hard-navigate.ts","webpack://_N_E/../../../src/client/components/static-generation-bailout.ts","webpack://_N_E/../../../src/client/components/unresolved-thenable.ts","webpack://_N_E/../../../src/client/components/unstable-rethrow.ts","webpack://_N_E/../../../src/client/components/use-reducer.ts","webpack://_N_E/../../src/client/flight-data-helpers.ts","webpack://_N_E/../../src/client/has-base-path.ts","webpack://_N_E/../../../src/client/lib/console.ts","webpack://_N_E/../../src/client/normalize-trailing-slash.ts","webpack://_N_E/../../../src/client/react-client-callbacks/app-router.ts","webpack://_N_E/../../../src/client/react-client-callbacks/report-global-error.ts","webpack://_N_E/../../../src/client/react-client-callbacks/shared.ts","webpack://_N_E/../../src/client/remove-base-path.ts","webpack://_N_E/../../node_modules/next/dist/compiled/scheduler/cjs/scheduler.production.js","webpack://_N_E/../../node_modules/next/dist/compiled/scheduler/index.js","webpack://_N_E/../../node_modules/next/dist/export/helpers/is-dynamic-usage-error.js","webpack://_N_E/../../node_modules/next/dist/lib/is-error.js?0024","webpack://_N_E/../../../src/lib/metadata/metadata-boundary.tsx","webpack://_N_E/../../node_modules/next/dist/lib/metadata/metadata-constants.js","webpack://_N_E/../../node_modules/next/dist/lib/scheduler.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/action-async-storage.external.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/dynamic-rendering.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/get-segment-param.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/work-async-storage.external.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","webpack://_N_E/../../node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js","webpack://_N_E/../../node_modules/next/dist/server/dynamic-rendering-utils.js","webpack://_N_E/../../node_modules/next/dist/server/lib/interception-routes.js?ba2a","webpack://_N_E/../../node_modules/next/dist/server/lib/router-utils/is-postpone.js","webpack://_N_E/../../node_modules/next/dist/server/request/params.browser.js","webpack://_N_E/../../node_modules/next/dist/server/request/params.js","webpack://_N_E/../../node_modules/next/dist/server/request/search-params.browser.js","webpack://_N_E/../../node_modules/next/dist/server/request/search-params.js","webpack://_N_E/../../node_modules/next/dist/server/request/utils.js","webpack://_N_E/../../node_modules/next/dist/server/web/spec-extension/adapters/reflect.js","webpack://_N_E/../../../src/shared/lib/app-router-context.shared-runtime.ts","webpack://_N_E/../../../src/shared/lib/encode-uri-path.ts","webpack://_N_E/../../../src/shared/lib/hash.ts","webpack://_N_E/../../../src/shared/lib/head-manager-context.shared-runtime.ts","webpack://_N_E/../../../src/shared/lib/hooks-client-context.shared-runtime.ts","webpack://_N_E/../../../src/shared/lib/invariant-error.ts","webpack://_N_E/../../../src/shared/lib/is-plain-object.ts","webpack://_N_E/../../../src/shared/lib/is-thenable.ts","webpack://_N_E/../../../shared/lib/lazy-dynamic/bailout-to-csr.ts","webpack://_N_E/../../../shared/lib/page-path/ensure-leading-slash.ts","webpack://_N_E/../../../shared/lib/router/action-queue.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-path-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/app-paths.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/handle-smooth-scroll.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/is-bot.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/parse-path.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/path-has-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/remove-trailing-slash.ts","webpack://_N_E/../../../src/shared/lib/segment.ts","webpack://_N_E/../../../src/shared/lib/server-inserted-html.shared-runtime.tsx","webpack://_N_E/../../../shared/lib/utils/warn-once.ts","webpack://_N_E/../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.js","webpack://_N_E/../../node_modules/next/dist/compiled/react-dom/client.js","webpack://_N_E/../../node_modules/next/dist/compiled/react-dom/index.js","webpack://_N_E/../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js","webpack://_N_E/../../node_modules/next/dist/compiled/react-server-dom-webpack/client.browser.js","webpack://_N_E/../../node_modules/next/dist/compiled/react-server-dom-webpack/client.js","webpack://_N_E/../../node_modules/next/dist/compiled/react/cjs/react-jsx-runtime.production.js","webpack://_N_E/../../node_modules/next/dist/compiled/react/cjs/react.production.js","webpack://_N_E/../../node_modules/next/dist/compiled/react/index.js","webpack://_N_E/../../node_modules/next/dist/compiled/react/jsx-runtime.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/async-local-storage.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","webpack://_N_E/../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","webpack://_N_E/../../node_modules/process/browser.js?923d","webpack://_N_E/../../node_modules/@swc/helpers/esm/_class_private_field_loose_base.js","webpack://_N_E/../../node_modules/@swc/helpers/esm/_class_private_field_loose_key.js","webpack://_N_E/../../node_modules/@swc/helpers/esm/_interop_require_default.js?0335","webpack://_N_E/../../node_modules/@swc/helpers/esm/_interop_require_wildcard.js?92ad"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"getDeploymentIdQueryOrEmptyString\", {\n enumerable: true,\n get: function() {\n return getDeploymentIdQueryOrEmptyString;\n }\n});\nfunction getDeploymentIdQueryOrEmptyString() {\n if (process.env.NEXT_DEPLOYMENT_ID) {\n return `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`;\n }\n return '';\n}\n\n//# sourceMappingURL=deployment-id.js.map","\"trimStart\"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),\"trimEnd\"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),\"description\"in Symbol.prototype||Object.defineProperty(Symbol.prototype,\"description\",{configurable:!0,get:function(){var t=/\\((.*)\\)/.exec(this.toString());return t?t[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(t,r){return r=this.concat.apply([],this),t>1&&r.some(Array.isArray)?r.flat(t-1):r},Array.prototype.flatMap=function(t,r){return this.map(t,r).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if(\"function\"!=typeof t)return this.then(t,t);var r=this.constructor||Promise;return this.then(function(n){return r.resolve(t()).then(function(){return n})},function(n){return r.resolve(t()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(t){return Array.from(t).reduce(function(t,r){return t[r[0]]=r[1],t},{})}),Array.prototype.at||(Array.prototype.at=function(t){var r=Math.trunc(t)||0;if(r<0&&(r+=this.length),!(r<0||r>=this.length))return this[r]}),Object.hasOwn||(Object.hasOwn=function(t,r){if(null==t)throw new TypeError(\"Cannot convert undefined or null to object\");return Object.prototype.hasOwnProperty.call(Object(t),r)}),\"canParse\"in URL||(URL.canParse=function(t,r){try{return!!new URL(t,r)}catch(t){return!1}});\n","import { addPathPrefix } from '../shared/lib/router/utils/add-path-prefix'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function addBasePath(path: string, required?: boolean): string {\n return normalizePathTrailingSlash(\n process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required\n ? path\n : addPathPrefix(path, basePath)\n )\n}\n","/**\n * Before starting the Next.js runtime and requiring any module, we need to make\n * sure the following scripts are executed in the correct order:\n * - Polyfills\n * - next/script with `beforeInteractive` strategy\n */\n\nconst version = process.env.__NEXT_VERSION\n\nwindow.next = {\n version,\n appDir: true,\n}\n\nfunction loadScriptsInSequence(\n scripts: [src: string, props: { [prop: string]: any }][],\n hydrate: () => void\n) {\n if (!scripts || !scripts.length) {\n return hydrate()\n }\n\n return scripts\n .reduce((promise, [src, props]) => {\n return promise.then(() => {\n return new Promise((resolve, reject) => {\n const el = document.createElement('script')\n\n if (props) {\n for (const key in props) {\n if (key !== 'children') {\n el.setAttribute(key, props[key])\n }\n }\n }\n\n if (src) {\n el.src = src\n el.onload = () => resolve()\n el.onerror = reject\n } else if (props) {\n el.innerHTML = props.children\n setTimeout(resolve)\n }\n\n document.head.appendChild(el)\n })\n })\n }, Promise.resolve())\n .catch((err: Error) => {\n console.error(err)\n // Still try to hydrate even if there's an error.\n })\n .then(() => {\n hydrate()\n })\n}\n\nexport function appBootstrap(callback: () => void) {\n loadScriptsInSequence((self as any).__next_s, () => {\n callback()\n })\n}\n","import { startTransition, useCallback } from 'react'\nimport {\n ACTION_SERVER_ACTION,\n type ReducerActions,\n type ServerActionDispatcher,\n} from './components/router-reducer/router-reducer-types'\n\nlet globalServerActionDispatcher = null as ServerActionDispatcher | null\n\nexport function useServerActionDispatcher(\n dispatch: React.Dispatch\n) {\n const serverActionDispatcher: ServerActionDispatcher = useCallback(\n (actionPayload) => {\n startTransition(() => {\n dispatch({\n ...actionPayload,\n type: ACTION_SERVER_ACTION,\n })\n })\n },\n [dispatch]\n )\n globalServerActionDispatcher = serverActionDispatcher\n}\n\nexport async function callServer(actionId: string, actionArgs: any[]) {\n const actionDispatcher = globalServerActionDispatcher\n\n if (!actionDispatcher) {\n throw new Error('Invariant: missing action dispatcher.')\n }\n\n return new Promise((resolve, reject) => {\n actionDispatcher({\n actionId,\n actionArgs,\n resolve,\n reject,\n })\n })\n}\n","const basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\nconst pathname = `${basePath}/__nextjs_source-map`\n\nexport const findSourceMapURL =\n process.env.NODE_ENV === 'development'\n ? function findSourceMapURL(filename: string): string | null {\n if (filename === '') {\n return null\n }\n\n const url = new URL(pathname, document.location.origin)\n\n url.searchParams.set(\n 'filename',\n filename.replace(\n new RegExp(`^${document.location.origin}${basePath}`),\n ''\n )\n )\n\n return url.href\n }\n : undefined\n","// imports polyfill from `@next/polyfill-module` after build.\nimport '../build/polyfills/polyfill-module'\n\nimport './components/globals/patch-console'\nimport './components/globals/handle-global-errors'\n\nimport ReactDOMClient from 'react-dom/client'\nimport React, { use } from 'react'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromReadableStream } from 'react-server-dom-webpack/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/shared'\nimport {\n onCaughtError,\n onUncaughtError,\n} from './react-client-callbacks/app-router'\nimport { callServer } from './app-call-server'\nimport { findSourceMapURL } from './app-find-source-map-url'\nimport {\n type AppRouterActionQueue,\n createMutableActionQueue,\n} from '../shared/lib/router/action-queue'\nimport AppRouter from './components/app-router'\nimport type { InitialRSCPayload } from '../server/app-render/types'\nimport { createInitialRouterState } from './components/router-reducer/create-initial-router-state'\nimport { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'\n\n/// \n\nconst appElement: HTMLElement | Document | null = document\n\nconst encoder = new TextEncoder()\n\nlet initialServerDataBuffer: (string | Uint8Array)[] | undefined = undefined\nlet initialServerDataWriter: ReadableStreamDefaultController | undefined =\n undefined\nlet initialServerDataLoaded = false\nlet initialServerDataFlushed = false\n\nlet initialFormStateData: null | any = null\n\nfunction nextServerDataCallback(\n seg:\n | [isBootStrap: 0]\n | [isNotBootstrap: 1, responsePartial: string]\n | [isFormState: 2, formState: any]\n | [isBinary: 3, responseBase64Partial: string]\n): void {\n if (seg[0] === 0) {\n initialServerDataBuffer = []\n } else if (seg[0] === 1) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(encoder.encode(seg[1]))\n } else {\n initialServerDataBuffer.push(seg[1])\n }\n } else if (seg[0] === 2) {\n initialFormStateData = seg[1]\n } else if (seg[0] === 3) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n // Decode the base64 string back to binary data.\n const binaryString = atob(seg[1])\n const decodedChunk = new Uint8Array(binaryString.length)\n for (var i = 0; i < binaryString.length; i++) {\n decodedChunk[i] = binaryString.charCodeAt(i)\n }\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(decodedChunk)\n } else {\n initialServerDataBuffer.push(decodedChunk)\n }\n }\n}\n\nfunction isStreamErrorOrUnfinished(ctr: ReadableStreamDefaultController) {\n // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.\n return ctr.desiredSize === null || ctr.desiredSize < 0\n}\n\n// There might be race conditions between `nextServerDataRegisterWriter` and\n// `DOMContentLoaded`. The former will be called when React starts to hydrate\n// the root, the latter will be called when the DOM is fully loaded.\n// For streaming, the former is called first due to partial hydration.\n// For non-streaming, the latter can be called first.\n// Hence, we use two variables `initialServerDataLoaded` and\n// `initialServerDataFlushed` to make sure the writer will be closed and\n// `initialServerDataBuffer` will be cleared in the right time.\nfunction nextServerDataRegisterWriter(ctr: ReadableStreamDefaultController) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val) => {\n ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val)\n })\n if (initialServerDataLoaded && !initialServerDataFlushed) {\n if (isStreamErrorOrUnfinished(ctr)) {\n ctr.error(\n new Error(\n 'The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'\n )\n )\n } else {\n ctr.close()\n }\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n }\n\n initialServerDataWriter = ctr\n}\n\n// When `DOMContentLoaded`, we can close all pending writers to finish hydration.\nconst DOMContentLoaded = function () {\n if (initialServerDataWriter && !initialServerDataFlushed) {\n initialServerDataWriter.close()\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n initialServerDataLoaded = true\n}\n\n// It's possible that the DOM is already loaded.\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', DOMContentLoaded, false)\n} else {\n // Delayed in marco task to ensure it's executed later than hydration\n setTimeout(DOMContentLoaded)\n}\n\nconst nextServerDataLoadingGlobal = ((self as any).__next_f =\n (self as any).__next_f || [])\nnextServerDataLoadingGlobal.forEach(nextServerDataCallback)\nnextServerDataLoadingGlobal.push = nextServerDataCallback\n\nconst readable = new ReadableStream({\n start(controller) {\n nextServerDataRegisterWriter(controller)\n },\n})\n\nconst initialServerResponse = createFromReadableStream(\n readable,\n { callServer, findSourceMapURL }\n)\n\n// React overrides `.then` and doesn't return a new promise chain,\n// so we wrap the action queue in a promise to ensure that its value\n// is defined when the promise resolves.\n// https://github.com/facebook/react/blob/163365a07872337e04826c4f501565d43dbd2fd4/packages/react-client/src/ReactFlightClient.js#L189-L190\nconst pendingActionQueue: Promise = new Promise(\n (resolve, reject) => {\n initialServerResponse.then(\n (initialRSCPayload) => {\n resolve(\n createMutableActionQueue(\n createInitialRouterState({\n buildId: initialRSCPayload.b,\n initialFlightData: initialRSCPayload.f,\n initialCanonicalUrlParts: initialRSCPayload.c,\n initialParallelRoutes: new Map(),\n location: window.location,\n couldBeIntercepted: initialRSCPayload.i,\n postponed: initialRSCPayload.s,\n prerendered: initialRSCPayload.S,\n })\n )\n )\n },\n (err: Error) => reject(err)\n )\n }\n)\n\nfunction ServerRoot(): React.ReactNode {\n const initialRSCPayload = use(initialServerResponse)\n const actionQueue = use(pendingActionQueue)\n\n const router = (\n \n )\n\n if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {\n // We provide missing slot information in a context provider only during development\n // as we log some additional information about the missing slots in the console.\n return (\n \n {router}\n \n )\n }\n\n return router\n}\n\nconst StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP\n ? React.StrictMode\n : React.Fragment\n\nfunction Root({ children }: React.PropsWithChildren<{}>) {\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n window.__NEXT_HYDRATED_CB?.()\n }, [])\n }\n\n return children\n}\n\nconst reactRootOptions = {\n onRecoverableError,\n onCaughtError,\n onUncaughtError,\n} satisfies ReactDOMClient.RootOptions\n\nexport function hydrate() {\n const reactEl = (\n \n \n \n \n \n \n \n )\n\n const rootLayoutMissingTags = window.__next_root_layout_missing_tags\n const hasMissingTags = !!rootLayoutMissingTags?.length\n\n const isError =\n document.documentElement.id === '__next_error__' || hasMissingTags\n\n if (isError) {\n if (process.env.NODE_ENV !== 'production') {\n const createDevOverlayElement =\n require('./components/react-dev-overlay/client-entry').createDevOverlayElement\n const errorTree = createDevOverlayElement(reactEl)\n ReactDOMClient.createRoot(appElement as any, reactRootOptions).render(\n errorTree\n )\n } else {\n ReactDOMClient.createRoot(appElement as any, reactRootOptions).render(\n reactEl\n )\n }\n } else {\n React.startTransition(() =>\n (ReactDOMClient as any).hydrateRoot(appElement, reactEl, {\n ...reactRootOptions,\n formState: initialFormStateData,\n })\n )\n }\n\n // TODO-APP: Remove this logic when Float has GC built-in in development.\n if (process.env.NODE_ENV !== 'production') {\n const { linkGc } =\n require('./app-link-gc') as typeof import('./app-link-gc')\n linkGc()\n }\n}\n","// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nappBootstrap(() => {\n const { hydrate } = require('./app-index')\n // Include app-router and layout-router in the main chunk\n require('next/dist/client/components/app-router')\n require('next/dist/client/components/layout-router')\n hydrate()\n})\n","// Override chunk URL mapping in the webpack runtime\n// https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/lib/RuntimeGlobals.js#L204\n\nimport { getDeploymentIdQueryOrEmptyString } from '../build/deployment-id'\nimport { encodeURIPath } from '../shared/lib/encode-uri-path'\n\ndeclare const __webpack_require__: any\n\n// If we have a deployment ID, we need to append it to the webpack chunk names\n// I am keeping the process check explicit so this can be statically optimized\nif (process.env.NEXT_DEPLOYMENT_ID) {\n const suffix = getDeploymentIdQueryOrEmptyString()\n // eslint-disable-next-line no-undef\n const getChunkScriptFilename = __webpack_require__.u\n // eslint-disable-next-line no-undef\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args)) + suffix\n\n // eslint-disable-next-line no-undef\n const getChunkCssFilename = __webpack_require__.k\n // eslint-disable-next-line no-undef\n __webpack_require__.k = (...args: any[]) =>\n getChunkCssFilename(...args) + suffix\n\n // eslint-disable-next-line no-undef\n const getMiniCssFilename = __webpack_require__.miniCssF\n // eslint-disable-next-line no-undef\n __webpack_require__.miniCssF = (...args: any[]) =>\n getMiniCssFilename(...args) + suffix\n} else {\n // eslint-disable-next-line no-undef\n const getChunkScriptFilename = __webpack_require__.u\n // eslint-disable-next-line no-undef\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args))\n\n // We don't need to override __webpack_require__.k because we don't modify\n // the css chunk name when not using deployment id suffixes\n\n // WE don't need to override __webpack_require__.miniCssF because we don't modify\n // the mini css chunk name when not using deployment id suffixes\n}\n\nexport {}\n","import { addBasePath } from './add-base-path'\n\n/**\n * Function to correctly assign location to URL\n *\n * The method will add basePath, and will also correctly add location (including if it is a relative path)\n * @param location Location that should be added to the url\n * @param url Base URL to which the location should be assigned\n */\nexport function assignLocation(location: string, url: URL): URL {\n if (location.startsWith('.')) {\n const urlBase = url.origin + url.pathname\n return new URL(\n // In order for a relative path to be added to the current url correctly, the current url must end with a slash\n // new URL('./relative', 'https://example.com/subdir').href -> 'https://example.com/relative'\n // new URL('./relative', 'https://example.com/subdir/').href -> 'https://example.com/subdir/relative'\n (urlBase.endsWith('/') ? urlBase : urlBase + '/') + location\n )\n }\n\n return new URL(addBasePath(location), url.href)\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { FlightRouterState } from '../../server/app-render/types'\n\nconst ANNOUNCER_TYPE = 'next-route-announcer'\nconst ANNOUNCER_ID = '__next-route-announcer__'\n\nfunction getAnnouncerNode() {\n const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0]\n if (existingAnnouncer?.shadowRoot?.childNodes[0]) {\n return existingAnnouncer.shadowRoot.childNodes[0] as HTMLElement\n } else {\n const container = document.createElement(ANNOUNCER_TYPE)\n container.style.cssText = 'position:absolute'\n const announcer = document.createElement('div')\n announcer.ariaLive = 'assertive'\n announcer.id = ANNOUNCER_ID\n announcer.role = 'alert'\n announcer.style.cssText =\n 'position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal'\n\n // Use shadow DOM here to avoid any potential CSS bleed\n const shadow = container.attachShadow({ mode: 'open' })\n shadow.appendChild(announcer)\n document.body.appendChild(container)\n return announcer\n }\n}\n\nexport function AppRouterAnnouncer({ tree }: { tree: FlightRouterState }) {\n const [portalNode, setPortalNode] = useState(null)\n\n useEffect(() => {\n const announcer = getAnnouncerNode()\n setPortalNode(announcer)\n return () => {\n const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0]\n if (container?.isConnected) {\n document.body.removeChild(container)\n }\n }\n }, [])\n\n const [routeAnnouncement, setRouteAnnouncement] = useState('')\n const previousTitle = useRef(undefined)\n\n useEffect(() => {\n let currentTitle = ''\n if (document.title) {\n currentTitle = document.title\n } else {\n const pageHeader = document.querySelector('h1')\n if (pageHeader) {\n currentTitle = pageHeader.innerText || pageHeader.textContent || ''\n }\n }\n\n // Only announce the title change, but not for the first load because screen\n // readers do that automatically.\n if (\n previousTitle.current !== undefined &&\n previousTitle.current !== currentTitle\n ) {\n setRouteAnnouncement(currentTitle)\n }\n previousTitle.current = currentTitle\n }, [tree])\n\n return portalNode ? createPortal(routeAnnouncement, portalNode) : null\n}\n","export const RSC_HEADER = 'RSC' as const\nexport const ACTION_HEADER = 'Next-Action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'Next-Router-State-Tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'Next-Router-Prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change Next-Router-State-Tree to be a segment path, we can use\n// that instead. Then Next-Router-Prefetch and Next-Router-Segment-Prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'Next-Router-Segment-Prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'Next-HMR-Refresh' as const\nexport const NEXT_URL = 'Next-Url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\n","'use client'\n\nimport React, {\n use,\n useEffect,\n useMemo,\n useCallback,\n startTransition,\n useInsertionEffect,\n useDeferredValue,\n} from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n CacheNode,\n AppRouterInstance,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n ACTION_HMR_REFRESH,\n ACTION_NAVIGATE,\n ACTION_PREFETCH,\n ACTION_REFRESH,\n ACTION_RESTORE,\n ACTION_SERVER_PATCH,\n PrefetchKind,\n} from './router-reducer/router-reducer-types'\nimport type {\n AppRouterState,\n ReducerActions,\n RouterChangeByServerResponse,\n RouterNavigate,\n} from './router-reducer/router-reducer-types'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { useReducer, useUnwrapState } from './use-reducer'\nimport { ErrorBoundary, type ErrorComponent } from './error-boundary'\nimport { isBot } from '../../shared/lib/router/utils/is-bot'\nimport { addBasePath } from '../add-base-path'\nimport { AppRouterAnnouncer } from './app-router-announcer'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { findHeadInCache } from './router-reducer/reducers/find-head-in-cache'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { removeBasePath } from '../remove-base-path'\nimport { hasBasePath } from '../has-base-path'\nimport { getSelectedParams } from './router-reducer/compute-changed-path'\nimport type { FlightRouterState } from '../../server/app-render/types'\nimport { useNavFailureHandler } from './nav-failure-handler'\nimport { useServerActionDispatcher } from '../app-call-server'\nimport type { AppRouterActionQueue } from '../../shared/lib/router/action-queue'\nimport {\n getRedirectTypeFromError,\n getURLFromRedirectError,\n isRedirectError,\n RedirectType,\n} from './redirect'\n\nconst globalMutable: {\n pendingMpaPath?: string\n} = {}\n\nfunction isExternalURL(url: URL) {\n return url.origin !== window.location.origin\n}\n\nfunction HistoryUpdater({\n appRouterState,\n}: {\n appRouterState: AppRouterState\n}) {\n useInsertionEffect(() => {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // clear pending URL as navigation is no longer\n // in flight\n window.next.__pendingUrl = undefined\n }\n\n const { tree, pushRef, canonicalUrl } = appRouterState\n const historyState = {\n ...(pushRef.preserveCustomHistoryState ? window.history.state : {}),\n // Identifier is shortened intentionally.\n // __NA is used to identify if the history entry can be handled by the app-router.\n // __N is used to identify if the history entry can be handled by the old router.\n __NA: true,\n __PRIVATE_NEXTJS_INTERNALS_TREE: tree,\n }\n if (\n pushRef.pendingPush &&\n // Skip pushing an additional history entry if the canonicalUrl is the same as the current url.\n // This mirrors the browser behavior for normal navigation.\n createHrefFromUrl(new URL(window.location.href)) !== canonicalUrl\n ) {\n // This intentionally mutates React state, pushRef is overwritten to ensure additional push/replace calls do not trigger an additional history entry.\n pushRef.pendingPush = false\n window.history.pushState(historyState, '', canonicalUrl)\n } else {\n window.history.replaceState(historyState, '', canonicalUrl)\n }\n }, [appRouterState])\n return null\n}\n\nexport function createEmptyCacheNode(): CacheNode {\n return {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n}\n\n/**\n * Server response that only patches the cache and tree.\n */\nfunction useChangeByServerResponse(\n dispatch: React.Dispatch\n): RouterChangeByServerResponse {\n return useCallback(\n ({ previousTree, serverResponse }) => {\n startTransition(() => {\n dispatch({\n type: ACTION_SERVER_PATCH,\n previousTree,\n serverResponse,\n })\n })\n },\n [dispatch]\n )\n}\n\nfunction useNavigate(dispatch: React.Dispatch): RouterNavigate {\n return useCallback(\n (href, navigateType, shouldScroll) => {\n const url = new URL(addBasePath(href), location.href)\n\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n return dispatch({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n shouldScroll: shouldScroll ?? true,\n navigateType,\n allowAliasing: true,\n })\n },\n [dispatch]\n )\n}\n\nfunction copyNextJsInternalHistoryState(data: any) {\n if (data == null) data = {}\n const currentState = window.history.state\n const __NA = currentState?.__NA\n if (__NA) {\n data.__NA = __NA\n }\n const __PRIVATE_NEXTJS_INTERNALS_TREE =\n currentState?.__PRIVATE_NEXTJS_INTERNALS_TREE\n if (__PRIVATE_NEXTJS_INTERNALS_TREE) {\n data.__PRIVATE_NEXTJS_INTERNALS_TREE = __PRIVATE_NEXTJS_INTERNALS_TREE\n }\n\n return data\n}\n\nfunction Head({\n headCacheNode,\n}: {\n headCacheNode: CacheNode | null\n}): React.ReactNode {\n // If this segment has a `prefetchHead`, it's the statically prefetched data.\n // We should use that on initial render instead of `head`. Then we'll switch\n // to `head` when the dynamic response streams in.\n const head = headCacheNode !== null ? headCacheNode.head : null\n const prefetchHead =\n headCacheNode !== null ? headCacheNode.prefetchHead : null\n\n // If no prefetch data is available, then we go straight to rendering `head`.\n const resolvedPrefetchRsc = prefetchHead !== null ? prefetchHead : head\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n //\n // @ts-expect-error The second argument to `useDeferredValue` is only\n // available in the experimental builds. When its disabled, it will always\n // return `head`.\n return useDeferredValue(head, resolvedPrefetchRsc)\n}\n\n/**\n * The global router that wraps the application components.\n */\nfunction Router({\n actionQueue,\n assetPrefix,\n}: {\n actionQueue: AppRouterActionQueue\n assetPrefix: string\n}) {\n const [state, dispatch] = useReducer(actionQueue)\n const { canonicalUrl } = useUnwrapState(state)\n // Add memoized pathname/query for useSearchParams and usePathname.\n const { searchParams, pathname } = useMemo(() => {\n const url = new URL(\n canonicalUrl,\n typeof window === 'undefined' ? 'http://n' : window.location.href\n )\n\n return {\n // This is turned into a readonly class in `useSearchParams`\n searchParams: url.searchParams,\n pathname: hasBasePath(url.pathname)\n ? removeBasePath(url.pathname)\n : url.pathname,\n }\n }, [canonicalUrl])\n\n const changeByServerResponse = useChangeByServerResponse(dispatch)\n const navigate = useNavigate(dispatch)\n useServerActionDispatcher(dispatch)\n\n /**\n * The app router that is exposed through `useRouter`. It's only concerned with dispatching actions to the reducer, does not hold state.\n */\n const appRouter = useMemo(() => {\n const routerInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch: (href, options) => {\n // Don't prefetch for bots as they don't navigate.\n if (isBot(window.navigator.userAgent)) {\n return\n }\n\n let url: URL\n try {\n url = new URL(addBasePath(href), window.location.href)\n } catch (_) {\n throw new Error(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n }\n\n // Don't prefetch during development (improves compilation performance)\n if (process.env.NODE_ENV === 'development') {\n return\n }\n\n // External urls can't be prefetched in the same way.\n if (isExternalURL(url)) {\n return\n }\n startTransition(() => {\n dispatch({\n type: ACTION_PREFETCH,\n url,\n kind: options?.kind ?? PrefetchKind.FULL,\n })\n })\n },\n replace: (href, options = {}) => {\n startTransition(() => {\n navigate(href, 'replace', options.scroll ?? true)\n })\n },\n push: (href, options = {}) => {\n startTransition(() => {\n navigate(href, 'push', options.scroll ?? true)\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatch({\n type: ACTION_REFRESH,\n origin: window.location.origin,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n startTransition(() => {\n dispatch({\n type: ACTION_HMR_REFRESH,\n origin: window.location.origin,\n })\n })\n }\n },\n }\n\n return routerInstance\n }, [dispatch, navigate])\n\n useEffect(() => {\n // Exists for debugging purposes. Don't use in application code.\n if (window.next) {\n window.next.router = appRouter\n }\n }, [appRouter])\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const { cache, prefetchCache, tree } = useUnwrapState(state)\n\n // This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n // Add `window.nd` for debugging purposes.\n // This is not meant for use in applications as concurrent rendering will affect the cache/tree/router.\n // @ts-ignore this is for debugging\n window.nd = {\n router: appRouter,\n cache,\n prefetchCache,\n tree,\n }\n }, [appRouter, cache, prefetchCache, tree])\n }\n\n useEffect(() => {\n // If the app is restored from bfcache, it's possible that\n // pushRef.mpaNavigation is true, which would mean that any re-render of this component\n // would trigger the mpa navigation logic again from the lines below.\n // This will restore the router to the initial state in the event that the app is restored from bfcache.\n function handlePageShow(event: PageTransitionEvent) {\n if (\n !event.persisted ||\n !window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n ) {\n return\n }\n\n // Clear the pendingMpaPath value so that a subsequent MPA navigation to the same URL can be triggered.\n // This is necessary because if the browser restored from bfcache, the pendingMpaPath would still be set to the value\n // of the last MPA navigation.\n globalMutable.pendingMpaPath = undefined\n\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(window.location.href),\n tree: window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE,\n })\n }\n\n window.addEventListener('pageshow', handlePageShow)\n\n return () => {\n window.removeEventListener('pageshow', handlePageShow)\n }\n }, [dispatch])\n\n useEffect(() => {\n // Ensure that any redirect errors that bubble up outside of the RedirectBoundary\n // are caught and handled by the router.\n function handleUnhandledRedirect(\n event: ErrorEvent | PromiseRejectionEvent\n ) {\n const error = 'reason' in event ? event.reason : event.error\n if (isRedirectError(error)) {\n event.preventDefault()\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n if (redirectType === RedirectType.push) {\n appRouter.push(url, {})\n } else {\n appRouter.replace(url, {})\n }\n }\n }\n window.addEventListener('error', handleUnhandledRedirect)\n window.addEventListener('unhandledrejection', handleUnhandledRedirect)\n\n return () => {\n window.removeEventListener('error', handleUnhandledRedirect)\n window.removeEventListener('unhandledrejection', handleUnhandledRedirect)\n }\n }, [appRouter])\n\n // When mpaNavigation flag is set do a hard navigation to the new url.\n // Infinitely suspend because we don't actually want to rerender any child\n // components with the new URL and any entangled state updates shouldn't\n // commit either (eg: useTransition isPending should stay true until the page\n // unloads).\n //\n // This is a side effect in render. Don't try this at home, kids. It's\n // probably safe because we know this is a singleton component and it's never\n // in . At least I hope so. (It will run twice in dev strict mode,\n // but that's... fine?)\n const { pushRef } = useUnwrapState(state)\n if (pushRef.mpaNavigation) {\n // if there's a re-render, we don't want to trigger another redirect if one is already in flight to the same URL\n if (globalMutable.pendingMpaPath !== canonicalUrl) {\n const location = window.location\n if (pushRef.pendingPush) {\n location.assign(canonicalUrl)\n } else {\n location.replace(canonicalUrl)\n }\n\n globalMutable.pendingMpaPath = canonicalUrl\n }\n // TODO-APP: Should we listen to navigateerror here to catch failed\n // navigations somehow? And should we call window.stop() if a SPA navigation\n // should interrupt an MPA one?\n use(unresolvedThenable)\n }\n\n useEffect(() => {\n const originalPushState = window.history.pushState.bind(window.history)\n const originalReplaceState = window.history.replaceState.bind(\n window.history\n )\n\n // Ensure the canonical URL in the Next.js Router is updated when the URL is changed so that `usePathname` and `useSearchParams` hold the pushed values.\n const applyUrlFromHistoryPushReplace = (\n url: string | URL | null | undefined\n ) => {\n const href = window.location.href\n const tree: FlightRouterState | undefined =\n window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n\n startTransition(() => {\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(url ?? href, href),\n tree,\n })\n })\n }\n\n /**\n * Patch pushState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.pushState = function pushState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalPushState(data, _unused, url)\n }\n\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n\n return originalPushState(data, _unused, url)\n }\n\n /**\n * Patch replaceState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.replaceState = function replaceState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalReplaceState(data, _unused, url)\n }\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n return originalReplaceState(data, _unused, url)\n }\n\n /**\n * Handle popstate event, this is used to handle back/forward in the browser.\n * By default dispatches ACTION_RESTORE, however if the history entry was not pushed/replaced by app-router it will reload the page.\n * That case can happen when the old router injected the history entry.\n */\n const onPopState = (event: PopStateEvent) => {\n if (!event.state) {\n // TODO-APP: this case only happens when pushState/replaceState was called outside of Next.js. It should probably reload the page in this case.\n return\n }\n\n // This case happens when the history entry was pushed by the `pages` router.\n if (!event.state.__NA) {\n window.location.reload()\n return\n }\n\n // TODO-APP: Ideally the back button should not use startTransition as it should apply the updates synchronously\n // Without startTransition works if the cache is there for this path\n startTransition(() => {\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(window.location.href),\n tree: event.state.__PRIVATE_NEXTJS_INTERNALS_TREE,\n })\n })\n }\n\n // Register popstate event to call onPopstate.\n window.addEventListener('popstate', onPopState)\n return () => {\n window.history.pushState = originalPushState\n window.history.replaceState = originalReplaceState\n window.removeEventListener('popstate', onPopState)\n }\n }, [dispatch])\n\n const { cache, tree, nextUrl, focusAndScrollRef, buildId } =\n useUnwrapState(state)\n\n const matchingHead = useMemo(() => {\n return findHeadInCache(cache, tree[1])\n }, [cache, tree])\n\n // Add memoized pathParams for useParams.\n const pathParams = useMemo(() => {\n return getSelectedParams(tree)\n }, [tree])\n\n const layoutRouterContext = useMemo(() => {\n return {\n childNodes: cache.parallelRoutes,\n tree,\n // Root node always has `url`\n // Provided in AppTreeContext to ensure it can be overwritten in layout-router\n url: canonicalUrl,\n loading: cache.loading,\n }\n }, [cache.parallelRoutes, tree, canonicalUrl, cache.loading])\n\n const globalLayoutRouterContext = useMemo(() => {\n return {\n buildId,\n changeByServerResponse,\n tree,\n focusAndScrollRef,\n nextUrl,\n }\n }, [buildId, changeByServerResponse, tree, focusAndScrollRef, nextUrl])\n\n let head\n if (matchingHead !== null) {\n // The head is wrapped in an extra component so we can use\n // `useDeferredValue` to swap between the prefetched and final versions of\n // the head. (This is what LayoutRouter does for segment data, too.)\n //\n // The `key` is used to remount the component whenever the head moves to\n // a different segment.\n const [headCacheNode, headKey] = matchingHead\n head = \n } else {\n head = null\n }\n\n let content = (\n \n {head}\n {cache.rsc}\n \n \n )\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window !== 'undefined') {\n const DevRootNotFoundBoundary: typeof import('./dev-root-not-found-boundary').DevRootNotFoundBoundary =\n require('./dev-root-not-found-boundary').DevRootNotFoundBoundary\n content = {content}\n }\n const HotReloader: typeof import('./react-dev-overlay/app/hot-reloader-client').default =\n require('./react-dev-overlay/app/hot-reloader-client').default\n\n content = {content}\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n {content}\n \n \n \n \n \n \n \n )\n}\n\nexport default function AppRouter({\n actionQueue,\n globalErrorComponentAndStyles: [globalErrorComponent, globalErrorStyles],\n assetPrefix,\n}: {\n actionQueue: AppRouterActionQueue\n globalErrorComponentAndStyles: [ErrorComponent, React.ReactNode | undefined]\n assetPrefix: string\n}) {\n useNavFailureHandler()\n\n return (\n \n \n \n )\n}\n\nconst runtimeStyles = new Set()\nlet runtimeStyleChanged = new Set<() => void>()\n\nglobalThis._N_E_STYLE_LOAD = function (href: string) {\n let len = runtimeStyles.size\n runtimeStyles.add(href)\n if (runtimeStyles.size !== len) {\n runtimeStyleChanged.forEach((cb) => cb())\n }\n // TODO figure out how to get a promise here\n // But maybe it's not necessary as react would block rendering until it's loaded\n return Promise.resolve()\n}\n\nfunction RuntimeStyles() {\n const [, forceUpdate] = React.useState(0)\n const renderedStylesSize = runtimeStyles.size\n useEffect(() => {\n const changed = () => forceUpdate((c) => c + 1)\n runtimeStyleChanged.add(changed)\n if (renderedStylesSize !== runtimeStyles.size) {\n changed()\n }\n return () => {\n runtimeStyleChanged.delete(changed)\n }\n }, [renderedStylesSize, forceUpdate])\n\n const dplId = process.env.NEXT_DEPLOYMENT_ID\n ? `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`\n : ''\n return [...runtimeStyles].map((href, i) => (\n \n ))\n}\n","import { BailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { workAsyncStorage } from '../../server/app-render/work-async-storage.external'\n\nexport function bailoutToClientRendering(reason: string): void | never {\n const workStore = workAsyncStorage.getStore()\n\n if (workStore?.forceStatic) return\n\n if (workStore?.isStaticGeneration) throw new BailoutToCSRError(reason)\n}\n","'use client'\n\nimport type { ParsedUrlQuery } from 'querystring'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport type { Params } from '../../server/request/params'\n\n/**\n * When the Page is a client component we send the params and searchParams to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Page component.\n *\n * additionally we may send promises representing the params and searchParams. We don't ever use these passed\n * values but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations.\n * It is up to the caller to decide if the promises are needed.\n */\nexport function ClientPageRoot({\n Component,\n searchParams,\n params,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n promises,\n}: {\n Component: React.ComponentType\n searchParams: ParsedUrlQuery\n params: Params\n promises?: Array>\n}) {\n if (typeof window === 'undefined') {\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n let clientSearchParams: Promise\n let clientParams: Promise\n // We are going to instrument the searchParams prop with tracking for the\n // appropriate context. We wrap differently in prerendering vs rendering\n const store = workAsyncStorage.getStore()\n if (!store) {\n throw new InvariantError(\n 'Expected workStore to exist when handling searchParams in a client Page.'\n )\n }\n\n const { createSearchParamsFromClient } =\n require('../../server/request/search-params') as typeof import('../../server/request/search-params')\n clientSearchParams = createSearchParamsFromClient(searchParams, store)\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params, store)\n\n return \n } else {\n const { createRenderSearchParamsFromClient } =\n require('../../server/request/search-params.browser') as typeof import('../../server/request/search-params.browser')\n const clientSearchParams = createRenderSearchParamsFromClient(searchParams)\n const { createRenderParamsFromClient } =\n require('../../server/request/params.browser') as typeof import('../../server/request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n\n return \n }\n}\n","'use client'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport type { Params } from '../../server/request/params'\n\n/**\n * When the Page is a client component we send the params to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Segment component.\n *\n * additionally we may send a promise representing params. We don't ever use this passed\n * value but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations\n * such as when dynamicIO is enabled. It is up to the caller to decide if the promises are needed.\n */\nexport function ClientSegmentRoot({\n Component,\n slots,\n params,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n promise,\n}: {\n Component: React.ComponentType\n slots: { [key: string]: React.ReactNode }\n params: Params\n promise?: Promise\n}) {\n if (typeof window === 'undefined') {\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n let clientParams: Promise\n // We are going to instrument the searchParams prop with tracking for the\n // appropriate context. We wrap differently in prerendering vs rendering\n const store = workAsyncStorage.getStore()\n if (!store) {\n throw new InvariantError(\n 'Expected workStore to exist when handling params in a client segment such as a Layout or Template.'\n )\n }\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params, store)\n\n return \n } else {\n const { createRenderParamsFromClient } =\n require('../../server/request/params.browser') as typeof import('../../server/request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n return \n }\n}\n","'use client'\n\nimport React, { type JSX } from 'react'\nimport { useUntrackedPathname } from './navigation-untracked'\nimport { isNextRouterError } from './is-next-router-error'\nimport { handleHardNavError } from './nav-failure-handler'\nimport { workAsyncStorage } from '../../server/app-render/work-async-storage.external'\n\nconst styles = {\n error: {\n // https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52\n fontFamily:\n 'system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"',\n height: '100vh',\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n text: {\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '28px',\n margin: '0 8px',\n },\n} as const\n\nexport type ErrorComponent = React.ComponentType<{\n error: Error\n reset: () => void\n}>\n\nexport interface ErrorBoundaryProps {\n children?: React.ReactNode\n errorComponent: ErrorComponent | undefined\n errorStyles?: React.ReactNode | undefined\n errorScripts?: React.ReactNode | undefined\n}\n\ninterface ErrorBoundaryHandlerProps extends ErrorBoundaryProps {\n pathname: string | null\n errorComponent: ErrorComponent\n}\n\ninterface ErrorBoundaryHandlerState {\n error: Error | null\n previousPathname: string | null\n}\n\n// if we are revalidating we want to re-throw the error so the\n// function crashes so we can maintain our previous cache\n// instead of caching the error page\nfunction HandleISRError({ error }: { error: any }) {\n const store = workAsyncStorage.getStore()\n if (store?.isRevalidate || store?.isStaticGeneration) {\n console.error(error)\n throw error\n }\n\n return null\n}\n\nexport class ErrorBoundaryHandler extends React.Component<\n ErrorBoundaryHandlerProps,\n ErrorBoundaryHandlerState\n> {\n constructor(props: ErrorBoundaryHandlerProps) {\n super(props)\n this.state = { error: null, previousPathname: this.props.pathname }\n }\n\n static getDerivedStateFromError(error: Error) {\n if (isNextRouterError(error)) {\n // Re-throw if an expected internal Next.js router error occurs\n // this means it should be handled by a different boundary (such as a NotFound boundary in a parent segment)\n throw error\n }\n\n return { error }\n }\n\n static getDerivedStateFromProps(\n props: ErrorBoundaryHandlerProps,\n state: ErrorBoundaryHandlerState\n ): ErrorBoundaryHandlerState | null {\n const { error } = state\n\n // if we encounter an error while\n // a navigation is pending we shouldn't render\n // the error boundary and instead should fallback\n // to a hard navigation to attempt recovering\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n if (error && handleHardNavError(error)) {\n // clear error so we don't render anything\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n }\n\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.error) {\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n return {\n error: state.error,\n previousPathname: props.pathname,\n }\n }\n\n reset = () => {\n this.setState({ error: null })\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n if (this.state.error) {\n return (\n <>\n \n {this.props.errorStyles}\n {this.props.errorScripts}\n \n \n )\n }\n\n return this.props.children\n }\n}\n\nexport function GlobalError({ error }: { error: any }) {\n const digest: string | undefined = error?.digest\n return (\n \n \n \n \n
\n
\n

\n {`Application error: a ${\n digest ? 'server' : 'client'\n }-side exception has occurred (see the ${\n digest ? 'server logs' : 'browser console'\n } for more information).`}\n

\n {digest ?

{`Digest: ${digest}`}

: null}\n
\n
\n \n \n )\n}\n\n// Exported so that the import signature in the loaders can be identical to user\n// supplied custom global error signatures.\nexport default GlobalError\n\n/**\n * Handles errors through `getDerivedStateFromError`.\n * Renders the provided error component and provides a way to `reset` the error boundary state.\n */\n\n/**\n * Renders error boundary with the provided \"errorComponent\" property as the fallback.\n * If no \"errorComponent\" property is provided it renders the children without an error boundary.\n */\nexport function ErrorBoundary({\n errorComponent,\n errorStyles,\n errorScripts,\n children,\n}: ErrorBoundaryProps & {\n children: React.ReactNode\n}): JSX.Element {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these errors can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n if (errorComponent) {\n return (\n \n {children}\n \n )\n }\n\n return <>{children}\n}\n","import { handleGlobalErrors } from '../react-dev-overlay/internal/helpers/use-error-handler'\n\nhandleGlobalErrors()\n","import isError from '../../../lib/is-error'\nimport { isNextRouterError } from '../is-next-router-error'\nimport { captureStackTrace } from '../react-dev-overlay/internal/helpers/capture-stack-trace'\nimport { handleClientError } from '../react-dev-overlay/internal/helpers/use-error-handler'\n\nexport const originConsoleError = window.console.error\n\n// Patch console.error to collect information about hydration errors\nexport function patchConsoleError() {\n // Ensure it's only patched once\n if (typeof window === 'undefined') {\n return\n }\n window.console.error = function error(...args: any[]) {\n let maybeError: unknown\n let isReplayedError = false\n\n if (process.env.NODE_ENV !== 'production') {\n const replayedError = matchReplayedError(...args)\n if (replayedError) {\n isReplayedError = true\n maybeError = replayedError\n } else {\n // See https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78\n maybeError = args[1]\n }\n } else {\n maybeError = args[0]\n }\n\n if (!isNextRouterError(maybeError)) {\n if (process.env.NODE_ENV !== 'production') {\n // Create an origin stack that pointing to the origin location of the error\n if (!isReplayedError && isError(maybeError)) {\n captureStackTrace(maybeError)\n }\n\n handleClientError(\n // replayed errors have their own complex format string that should be used,\n // but if we pass the error directly, `handleClientError` will ignore it\n maybeError,\n args\n )\n }\n\n originConsoleError.apply(window.console, args)\n }\n }\n}\n\nfunction matchReplayedError(...args: unknown[]): Error | null {\n // See\n // https://github.com/facebook/react/blob/65a56d0e99261481c721334a3ec4561d173594cd/packages/react-devtools-shared/src/backend/flight/renderer.js#L88-L93\n //\n // Logs replayed from the server look like this:\n // [\n // \"%c%s%c %o\\n\\n%s\\n\\n%s\\n\",\n // \"background: #e6e6e6; ...\",\n // \" Server \", // can also be e.g. \" Prerender \"\n // \"\",\n // Error\n // \"The above error occurred in the component.\"\n // ...\n // ]\n if (\n args.length > 3 &&\n typeof args[0] === 'string' &&\n args[0].startsWith('%c%s%c ') &&\n typeof args[1] === 'string' &&\n typeof args[2] === 'string' &&\n typeof args[3] === 'string'\n ) {\n const maybeError = args[4]\n if (isError(maybeError)) {\n return maybeError\n }\n }\n\n return null\n}\n","import { patchConsoleError } from './intercept-console-error'\n\npatchConsoleError()\n","const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE'\n\nexport class DynamicServerError extends Error {\n digest: typeof DYNAMIC_ERROR_CODE = DYNAMIC_ERROR_CODE\n\n constructor(public readonly description: string) {\n super(`Dynamic server usage: ${description}`)\n }\n}\n\nexport function isDynamicServerError(err: unknown): err is DynamicServerError {\n if (\n typeof err !== 'object' ||\n err === null ||\n !('digest' in err) ||\n typeof err.digest !== 'string'\n ) {\n return false\n }\n\n return err.digest === DYNAMIC_ERROR_CODE\n}\n","import isError from '../../lib/is-error'\n\nconst hydrationErrorRegex =\n /hydration failed|while hydrating|content does not match|did not match|HTML didn't match/i\n\nconst reactUnifiedMismatchWarning = `Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used`\n\nconst reactHydrationStartMessages = [\n reactUnifiedMismatchWarning,\n `A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:`,\n]\n\nconst reactHydrationErrorDocLink = 'https://react.dev/link/hydration-mismatch'\n\nexport const getDefaultHydrationErrorMessage = () => {\n return reactUnifiedMismatchWarning\n}\n\nexport function isHydrationError(error: unknown): boolean {\n return isError(error) && hydrationErrorRegex.test(error.message)\n}\n\nexport function isReactHydrationErrorMessage(msg: string): boolean {\n return reactHydrationStartMessages.some((prefix) => msg.startsWith(prefix))\n}\n\nexport function getHydrationErrorStackInfo(rawMessage: string): {\n message: string | null\n link?: string\n stack?: string\n diff?: string\n} {\n rawMessage = rawMessage.replace(/^Error: /, '')\n if (!isReactHydrationErrorMessage(rawMessage)) {\n return { message: null }\n }\n const firstLineBreak = rawMessage.indexOf('\\n')\n rawMessage = rawMessage.slice(firstLineBreak + 1).trim()\n\n const [message, trailing] = rawMessage.split(`${reactHydrationErrorDocLink}`)\n const trimmedMessage = message.trim()\n // React built-in hydration diff starts with a newline, checking if length is > 1\n if (trailing && trailing.length > 1) {\n const stacks: string[] = []\n const diffs: string[] = []\n trailing.split('\\n').forEach((line) => {\n if (line.trim() === '') return\n if (line.trim().startsWith('at ')) {\n stacks.push(line)\n } else {\n diffs.push(line)\n }\n })\n\n return {\n message: trimmedMessage,\n link: reactHydrationErrorDocLink,\n diff: diffs.join('\\n'),\n stack: stacks.join('\\n'),\n }\n } else {\n return {\n message: trimmedMessage,\n link: reactHydrationErrorDocLink,\n stack: trailing, // without hydration diff\n }\n }\n}\n","import { isNotFoundError, type NotFoundError } from './not-found'\nimport { isRedirectError, type RedirectError } from './redirect'\n\n/**\n * Returns true if the error is a navigation signal error. These errors are\n * thrown by user code to perform navigation operations and interrupt the React\n * render.\n */\nexport function isNextRouterError(\n error: unknown\n): error is RedirectError | NotFoundError {\n return isRedirectError(error) || isNotFoundError(error)\n}\n","'use client'\n\nimport type {\n ChildSegmentMap,\n LazyCacheNode,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../../server/app-render/types'\nimport type { ErrorComponent } from './error-boundary'\nimport type { FocusAndScrollRef } from './router-reducer/router-reducer-types'\n\nimport React, {\n useContext,\n use,\n startTransition,\n Suspense,\n useDeferredValue,\n type JSX,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport {\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n TemplateContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { fetchServerResponse } from './router-reducer/fetch-server-response'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { ErrorBoundary } from './error-boundary'\nimport { matchSegment } from './match-segments'\nimport { handleSmoothScroll } from '../../shared/lib/router/utils/handle-smooth-scroll'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { NotFoundBoundary } from './not-found-boundary'\nimport { getSegmentValue } from './router-reducer/reducers/get-segment-value'\nimport { createRouterCacheKey } from './router-reducer/create-router-cache-key'\nimport { hasInterceptionRouteInCurrentTree } from './router-reducer/reducers/has-interception-route-in-current-tree'\n\n/**\n * Add refetch marker to router state at the point of the current layout segment.\n * This ensures the response returned is not further down than the current layout segment.\n */\nfunction walkAddRefetch(\n segmentPathToWalk: FlightSegmentPath | undefined,\n treeToRecreate: FlightRouterState\n): FlightRouterState {\n if (segmentPathToWalk) {\n const [segment, parallelRouteKey] = segmentPathToWalk\n const isLast = segmentPathToWalk.length === 2\n\n if (matchSegment(treeToRecreate[0], segment)) {\n if (treeToRecreate[1].hasOwnProperty(parallelRouteKey)) {\n if (isLast) {\n const subTree = walkAddRefetch(\n undefined,\n treeToRecreate[1][parallelRouteKey]\n )\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: [\n subTree[0],\n subTree[1],\n subTree[2],\n 'refetch',\n ],\n },\n ]\n }\n\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: walkAddRefetch(\n segmentPathToWalk.slice(2),\n treeToRecreate[1][parallelRouteKey]\n ),\n },\n ]\n }\n }\n }\n\n return treeToRecreate\n}\n\nconst __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = (\n ReactDOM as any\n).__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE\n\n// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available\n/**\n * Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning\n */\nfunction findDOMNode(\n instance: React.ReactInstance | null | undefined\n): Element | Text | null {\n // Tree-shake for server bundle\n if (typeof window === 'undefined') return null\n\n // __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init.\n // We need to lazily reference it.\n const internal_reactDOMfindDOMNode =\n __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode\n return internal_reactDOMfindDOMNode(instance)\n}\n\nconst rectProperties = [\n 'bottom',\n 'height',\n 'left',\n 'right',\n 'top',\n 'width',\n 'x',\n 'y',\n] as const\n/**\n * Check if a HTMLElement is hidden or fixed/sticky position\n */\nfunction shouldSkipElement(element: HTMLElement) {\n // we ignore fixed or sticky positioned elements since they'll likely pass the \"in-viewport\" check\n // and will result in a situation we bail on scroll because of something like a fixed nav,\n // even though the actual page content is offscreen\n if (['sticky', 'fixed'].includes(getComputedStyle(element).position)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:',\n element\n )\n }\n return true\n }\n\n // Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`\n // because `offsetParent` doesn't consider document/body\n const rect = element.getBoundingClientRect()\n return rectProperties.every((item) => rect[item] === 0)\n}\n\n/**\n * Check if the top corner of the HTMLElement is in the viewport.\n */\nfunction topOfElementInViewport(element: HTMLElement, viewportHeight: number) {\n const rect = element.getBoundingClientRect()\n return rect.top >= 0 && rect.top <= viewportHeight\n}\n\n/**\n * Find the DOM node for a hash fragment.\n * If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.\n * If the hash fragment is an id, the page has to scroll to the element with that id.\n * If the hash fragment is a name, the page has to scroll to the first element with that name.\n */\nfunction getHashFragmentDomNode(hashFragment: string) {\n // If the hash fragment is `top` the page has to scroll to the top of the page.\n if (hashFragment === 'top') {\n return document.body\n }\n\n // If the hash fragment is an id, the page has to scroll to the element with that id.\n return (\n document.getElementById(hashFragment) ??\n // If the hash fragment is a name, the page has to scroll to the first element with that name.\n document.getElementsByName(hashFragment)[0]\n )\n}\ninterface ScrollAndFocusHandlerProps {\n focusAndScrollRef: FocusAndScrollRef\n children: React.ReactNode\n segmentPath: FlightSegmentPath\n}\nclass InnerScrollAndFocusHandler extends React.Component {\n handlePotentialScroll = () => {\n // Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed.\n const { focusAndScrollRef, segmentPath } = this.props\n\n if (focusAndScrollRef.apply) {\n // segmentPaths is an array of segment paths that should be scrolled to\n // if the current segment path is not in the array, the scroll is not applied\n // unless the array is empty, in which case the scroll is always applied\n if (\n focusAndScrollRef.segmentPaths.length !== 0 &&\n !focusAndScrollRef.segmentPaths.some((scrollRefSegmentPath) =>\n segmentPath.every((segment, index) =>\n matchSegment(segment, scrollRefSegmentPath[index])\n )\n )\n ) {\n return\n }\n\n let domNode:\n | ReturnType\n | ReturnType = null\n const hashFragment = focusAndScrollRef.hashFragment\n\n if (hashFragment) {\n domNode = getHashFragmentDomNode(hashFragment)\n }\n\n // `findDOMNode` is tricky because it returns just the first child if the component is a fragment.\n // This already caused a bug where the first child was a in head.\n if (!domNode) {\n domNode = findDOMNode(this)\n }\n\n // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.\n if (!(domNode instanceof Element)) {\n return\n }\n\n // Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.\n // If the element is skipped, try to select the next sibling and try again.\n while (!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)) {\n // No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.\n if (domNode.nextElementSibling === null) {\n return\n }\n domNode = domNode.nextElementSibling\n }\n\n // State is mutated to ensure that the focus and scroll is applied only once.\n focusAndScrollRef.apply = false\n focusAndScrollRef.hashFragment = null\n focusAndScrollRef.segmentPaths = []\n\n handleSmoothScroll(\n () => {\n // In case of hash scroll, we only need to scroll the element into view\n if (hashFragment) {\n ;(domNode as HTMLElement).scrollIntoView()\n\n return\n }\n // Store the current viewport height because reading `clientHeight` causes a reflow,\n // and it won't change during this function.\n const htmlElement = document.documentElement\n const viewportHeight = htmlElement.clientHeight\n\n // If the element's top edge is already in the viewport, exit early.\n if (topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n return\n }\n\n // Otherwise, try scrolling go the top of the document to be backward compatible with pages\n // scrollIntoView() called on `` element scrolls horizontally on chrome and firefox (that shouldn't happen)\n // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left\n // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically\n htmlElement.scrollTop = 0\n\n // Scroll to domNode if domNode is not in viewport when scrolled to top of document\n if (!topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n // Scroll into view doesn't scroll horizontally by default when not needed\n ;(domNode as HTMLElement).scrollIntoView()\n }\n },\n {\n // We will force layout by querying domNode position\n dontForceLayout: true,\n onlyHashChange: focusAndScrollRef.onlyHashChange,\n }\n )\n\n // Mutate after scrolling so that it can be read by `handleSmoothScroll`\n focusAndScrollRef.onlyHashChange = false\n\n // Set focus on the element\n domNode.focus()\n }\n }\n\n componentDidMount() {\n this.handlePotentialScroll()\n }\n\n componentDidUpdate() {\n // Because this property is overwritten in handlePotentialScroll it's fine to always run it when true as it'll be set to false for subsequent renders.\n if (this.props.focusAndScrollRef.apply) {\n this.handlePotentialScroll()\n }\n }\n\n render() {\n return this.props.children\n }\n}\n\nfunction ScrollAndFocusHandler({\n segmentPath,\n children,\n}: {\n segmentPath: FlightSegmentPath\n children: React.ReactNode\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n return (\n \n {children}\n \n )\n}\n\n/**\n * InnerLayoutRouter handles rendering the provided segment based on the cache.\n */\nfunction InnerLayoutRouter({\n parallelRouterKey,\n url,\n childNodes,\n segmentPath,\n tree,\n // TODO-APP: implement `` when available.\n // isActive,\n cacheKey,\n}: {\n parallelRouterKey: string\n url: string\n childNodes: ChildSegmentMap\n segmentPath: FlightSegmentPath\n tree: FlightRouterState\n isActive: boolean\n cacheKey: ReturnType\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n const { buildId, changeByServerResponse, tree: fullTree } = context\n\n // Read segment path from the parallel router cache node.\n let childNode = childNodes.get(cacheKey)\n\n // When data is not available during rendering client-side we need to fetch\n // it from the server.\n if (childNode === undefined) {\n const newLazyCacheNode: LazyCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n\n /**\n * Flight data fetch kicked off during render and put into the cache.\n */\n childNode = newLazyCacheNode\n childNodes.set(cacheKey, newLazyCacheNode)\n }\n\n // `rsc` represents the renderable node for this segment.\n\n // If this segment has a `prefetchRsc`, it's the statically prefetched data.\n // We should use that on initial render instead of `rsc`. Then we'll switch\n // to `rsc` when the dynamic response streams in.\n //\n // If no prefetch data is available, then we go straight to rendering `rsc`.\n const resolvedPrefetchRsc =\n childNode.prefetchRsc !== null ? childNode.prefetchRsc : childNode.rsc\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n //\n // @ts-expect-error The second argument to `useDeferredValue` is only\n // available in the experimental builds. When its disabled, it will always\n // return `rsc`.\n const rsc: any = useDeferredValue(childNode.rsc, resolvedPrefetchRsc)\n\n // `rsc` is either a React node or a promise for a React node, except we\n // special case `null` to represent that this segment's data is missing. If\n // it's a promise, we need to unwrap it so we can determine whether or not the\n // data is missing.\n const resolvedRsc: React.ReactNode =\n typeof rsc === 'object' && rsc !== null && typeof rsc.then === 'function'\n ? use(rsc)\n : rsc\n\n if (!resolvedRsc) {\n // The data for this segment is not available, and there's no pending\n // navigation that will be able to fulfill it. We need to fetch more from\n // the server and patch the cache.\n\n // Check if there's already a pending request.\n let lazyData = childNode.lazyData\n if (lazyData === null) {\n /**\n * Router state with refetch marker added\n */\n // TODO-APP: remove ''\n const refetchTree = walkAddRefetch(['', ...segmentPath], fullTree)\n const includeNextUrl = hasInterceptionRouteInCurrentTree(fullTree)\n childNode.lazyData = lazyData = fetchServerResponse(\n new URL(url, location.origin),\n {\n flightRouterState: refetchTree,\n nextUrl: includeNextUrl ? context.nextUrl : null,\n buildId,\n }\n ).then((serverResponse) => {\n startTransition(() => {\n changeByServerResponse({\n previousTree: fullTree,\n serverResponse,\n })\n })\n\n return serverResponse\n })\n }\n // Suspend infinitely as `changeByServerResponse` will cause a different part of the tree to be rendered.\n // A falsey `resolvedRsc` indicates missing data -- we should not commit that branch, and we need to wait for the data to arrive.\n use(unresolvedThenable) as never\n }\n\n // If we get to this point, then we know we have something we can render.\n const subtree = (\n // The layout router context narrows down tree and childNodes at each level.\n \n {resolvedRsc}\n \n )\n // Ensure root layout is not wrapped in a div as the root layout renders ``\n return subtree\n}\n\n/**\n * Renders suspense boundary with the provided \"loading\" property as the fallback.\n * If no loading property is provided it renders the children without a suspense boundary.\n */\nfunction LoadingBoundary({\n children,\n hasLoading,\n loading,\n loadingStyles,\n loadingScripts,\n}: {\n children: React.ReactNode\n hasLoading: boolean\n loading?: React.ReactNode\n loadingStyles?: React.ReactNode\n loadingScripts?: React.ReactNode\n}): JSX.Element {\n // We have an explicit prop for checking if `loading` is provided, to disambiguate between a loading\n // component that returns `null` / `undefined`, vs not having a loading component at all.\n if (hasLoading) {\n return (\n \n {loadingStyles}\n {loadingScripts}\n {loading}\n \n }\n >\n {children}\n \n )\n }\n\n return <>{children}\n}\n\n/**\n * OuterLayoutRouter handles the current segment as well as rendering of other segments.\n * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.\n */\nexport default function OuterLayoutRouter({\n parallelRouterKey,\n segmentPath,\n error,\n errorStyles,\n errorScripts,\n templateStyles,\n templateScripts,\n template,\n notFound,\n notFoundStyles,\n}: {\n parallelRouterKey: string\n segmentPath: FlightSegmentPath\n error: ErrorComponent | undefined\n errorStyles: React.ReactNode | undefined\n errorScripts: React.ReactNode | undefined\n templateStyles: React.ReactNode | undefined\n templateScripts: React.ReactNode | undefined\n template: React.ReactNode\n notFound: React.ReactNode | undefined\n notFoundStyles: React.ReactNode | undefined\n}) {\n const context = useContext(LayoutRouterContext)\n if (!context) {\n throw new Error('invariant expected layout router to be mounted')\n }\n\n const { childNodes, tree, url, loading } = context\n\n // Get the current parallelRouter cache node\n let childNodesForParallelRouter = childNodes.get(parallelRouterKey)\n // If the parallel router cache node does not exist yet, create it.\n // This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.\n if (!childNodesForParallelRouter) {\n childNodesForParallelRouter = new Map()\n childNodes.set(parallelRouterKey, childNodesForParallelRouter)\n }\n\n // Get the active segment in the tree\n // The reason arrays are used in the data format is that these are transferred from the server to the browser so it's optimized to save bytes.\n const treeSegment = tree[1][parallelRouterKey][0]\n\n // If segment is an array it's a dynamic route and we want to read the dynamic route value as the segment to get from the cache.\n const currentChildSegmentValue = getSegmentValue(treeSegment)\n\n /**\n * Decides which segments to keep rendering, all segments that are not active will be wrapped in ``.\n */\n // TODO-APP: Add handling of `` when it's available.\n const preservedSegments: Segment[] = [treeSegment]\n\n return (\n <>\n {preservedSegments.map((preservedSegment) => {\n const preservedSegmentValue = getSegmentValue(preservedSegment)\n const cacheKey = createRouterCacheKey(preservedSegment)\n\n return (\n /*\n - Error boundary\n - Only renders error boundary if error component is provided.\n - Rendered for each segment to ensure they have their own error state.\n - Loading boundary\n - Only renders suspense boundary if loading components is provided.\n - Rendered for each segment to ensure they have their own loading state.\n - Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.\n */\n \n \n \n \n \n \n \n \n \n \n \n }\n >\n {templateStyles}\n {templateScripts}\n {template}\n \n )\n })}\n \n )\n}\n","import { getSegmentParam } from '../../server/app-render/get-segment-param'\nimport type { Segment } from '../../server/app-render/types'\n\nexport const matchSegment = (\n existingSegment: Segment,\n segment: Segment\n): boolean => {\n // segment is either Array or string\n if (typeof existingSegment === 'string') {\n if (typeof segment === 'string') {\n // Common case: segment is just a string\n return existingSegment === segment\n }\n return false\n }\n\n if (typeof segment === 'string') {\n return false\n }\n return existingSegment[0] === segment[0] && existingSegment[1] === segment[1]\n}\n\n/*\n * This function is used to determine if an existing segment can be overridden by the incoming segment.\n */\nexport const canSegmentBeOverridden = (\n existingSegment: Segment,\n segment: Segment\n): boolean => {\n if (Array.isArray(existingSegment) || !Array.isArray(segment)) {\n return false\n }\n\n return getSegmentParam(existingSegment)?.param === segment[0]\n}\n","import { useEffect } from 'react'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\n\nexport function handleHardNavError(error: unknown): boolean {\n if (\n error &&\n typeof window !== 'undefined' &&\n window.next.__pendingUrl &&\n createHrefFromUrl(new URL(window.location.href)) !==\n createHrefFromUrl(window.next.__pendingUrl)\n ) {\n console.error(\n `Error occurred during navigation, falling back to hard navigation`,\n error\n )\n window.location.href = window.next.__pendingUrl.toString()\n return true\n }\n return false\n}\n\nexport function useNavFailureHandler() {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // this if is only for DCE of the feature flag not conditional\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n const uncaughtExceptionHandler = (\n evt: ErrorEvent | PromiseRejectionEvent\n ) => {\n const error = 'reason' in evt ? evt.reason : evt.error\n // if we have an unhandled exception/rejection during\n // a navigation we fall back to a hard navigation to\n // attempt recovering to a good state\n handleHardNavError(error)\n }\n window.addEventListener('unhandledrejection', uncaughtExceptionHandler)\n window.addEventListener('error', uncaughtExceptionHandler)\n return () => {\n window.removeEventListener('error', uncaughtExceptionHandler)\n window.removeEventListener(\n 'unhandledrejection',\n uncaughtExceptionHandler\n )\n }\n }, [])\n }\n}\n","import { useContext } from 'react'\nimport { PathnameContext } from '../../shared/lib/hooks-client-context.shared-runtime'\n\n/**\n * This checks to see if the current render has any unknown route parameters.\n * It's used to trigger a different render path in the error boundary.\n *\n * @returns true if there are any unknown route parameters, false otherwise\n */\nfunction hasFallbackRouteParams() {\n if (typeof window === 'undefined') {\n // AsyncLocalStorage should not be included in the client bundle.\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) return false\n\n const { fallbackRouteParams } = workStore\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) return false\n\n return true\n }\n\n return false\n}\n\n/**\n * This returns a `null` value if there are any unknown route parameters, and\n * otherwise returns the pathname from the context. This is an alternative to\n * `usePathname` that is used in the error boundary to avoid rendering the\n * error boundary when there are unknown route parameters. This doesn't throw\n * when accessed with unknown route parameters.\n *\n * @returns\n *\n * @internal\n */\nexport function useUntrackedPathname(): string | null {\n // If there are any unknown route parameters we would typically throw\n // an error, but this internal method allows us to return a null value instead\n // for components that do not propagate the pathname to the static shell (like\n // the error boundary).\n if (hasFallbackRouteParams()) {\n return null\n }\n\n // This shouldn't cause any issues related to conditional rendering because\n // the environment will be consistent for the render.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(PathnameContext)\n}\n","import type { FlightRouterState } from '../../server/app-render/types'\nimport type { Params } from '../../server/request/params'\n\nimport { useContext, useMemo } from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n type AppRouterInstance,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { getSegmentValue } from './router-reducer/reducers/get-segment-value'\nimport { PAGE_SEGMENT_KEY, DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'\nimport { ReadonlyURLSearchParams } from './navigation.react-server'\nimport { useDynamicRouteParams } from '../../server/app-render/dynamic-rendering'\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you *read* the current URL's search parameters.\n *\n * Learn more about [`URLSearchParams` on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useSearchParams } from 'next/navigation'\n *\n * export default function Page() {\n * const searchParams = useSearchParams()\n * searchParams.get('foo') // returns 'bar' when ?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSearchParams`](https://nextjs.org/docs/app/api-reference/functions/use-search-params)\n */\n// Client components API\nexport function useSearchParams(): ReadonlyURLSearchParams {\n const searchParams = useContext(SearchParamsContext)\n\n // In the case where this is `null`, the compat types added in\n // `next-env.d.ts` will add a new overload that changes the return type to\n // include `null`.\n const readonlySearchParams = useMemo(() => {\n if (!searchParams) {\n // When the router is not ready in pages, we won't have the search params\n // available.\n return null\n }\n\n return new ReadonlyURLSearchParams(searchParams)\n }, [searchParams]) as ReadonlyURLSearchParams\n\n if (typeof window === 'undefined') {\n // AsyncLocalStorage should not be included in the client bundle.\n const { bailoutToClientRendering } =\n require('./bailout-to-client-rendering') as typeof import('./bailout-to-client-rendering')\n // TODO-APP: handle dynamic = 'force-static' here and on the client\n bailoutToClientRendering('useSearchParams()')\n }\n\n return readonlySearchParams\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the current URL's pathname.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { usePathname } from 'next/navigation'\n *\n * export default function Page() {\n * const pathname = usePathname() // returns \"/dashboard\" on /dashboard?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname)\n */\n// Client components API\nexport function usePathname(): string {\n useDynamicRouteParams('usePathname()')\n\n // In the case where this is `null`, the compat types added in `next-env.d.ts`\n // will add a new overload that changes the return type to include `null`.\n return useContext(PathnameContext) as string\n}\n\n// Client components API\nexport {\n ServerInsertedHTMLContext,\n useServerInsertedHTML,\n} from '../../shared/lib/server-inserted-html.shared-runtime'\n\n/**\n *\n * This hook allows you to programmatically change routes inside [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components).\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useRouter } from 'next/navigation'\n *\n * export default function Page() {\n * const router = useRouter()\n * // ...\n * router.push('/dashboard') // Navigate to /dashboard\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/app/api-reference/functions/use-router)\n */\n// Client components API\nexport function useRouter(): AppRouterInstance {\n const router = useContext(AppRouterContext)\n if (router === null) {\n throw new Error('invariant expected app router to be mounted')\n }\n\n return router\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read a route's dynamic params filled in by the current URL.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useParams } from 'next/navigation'\n *\n * export default function Page() {\n * // on /dashboard/[team] where pathname is /dashboard/nextjs\n * const { team } = useParams() // team === \"nextjs\"\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useParams`](https://nextjs.org/docs/app/api-reference/functions/use-params)\n */\n// Client components API\nexport function useParams(): T {\n useDynamicRouteParams('useParams()')\n\n return useContext(PathParamsContext) as T\n}\n\n/** Get the canonical parameters from the current level to the leaf node. */\n// Client components API\nfunction getSelectedLayoutSegmentPath(\n tree: FlightRouterState,\n parallelRouteKey: string,\n first = true,\n segmentPath: string[] = []\n): string[] {\n let node: FlightRouterState\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey]\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1]\n node = parallelRoutes.children ?? Object.values(parallelRoutes)[0]\n }\n\n if (!node) return segmentPath\n const segment = node[0]\n\n let segmentValue = getSegmentValue(segment)\n\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) {\n return segmentPath\n }\n\n segmentPath.push(segmentValue)\n\n return getSelectedLayoutSegmentPath(\n node,\n parallelRouteKey,\n false,\n segmentPath\n )\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segments **below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n *\n * import { useSelectedLayoutSegments } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segments = useSelectedLayoutSegments()\n *\n * return (\n *
    \n * {segments.map((segment, index) => (\n *
  • {segment}
  • \n * ))}\n *
\n * )\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegments`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segments)\n */\n// Client components API\nexport function useSelectedLayoutSegments(\n parallelRouteKey: string = 'children'\n): string[] {\n useDynamicRouteParams('useSelectedLayoutSegments()')\n\n const context = useContext(LayoutRouterContext)\n // @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts\n if (!context) return null\n\n return getSelectedLayoutSegmentPath(context.tree, parallelRouteKey)\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segment **one level below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n * import { useSelectedLayoutSegment } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segment = useSelectedLayoutSegment()\n *\n * return

Active segment: {segment}

\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment)\n */\n// Client components API\nexport function useSelectedLayoutSegment(\n parallelRouteKey: string = 'children'\n): string | null {\n useDynamicRouteParams('useSelectedLayoutSegment()')\n\n const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey)\n\n if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) {\n return null\n }\n\n const selectedLayoutSegment =\n parallelRouteKey === 'children'\n ? selectedLayoutSegments[0]\n : selectedLayoutSegments[selectedLayoutSegments.length - 1]\n\n // if the default slot is showing, we return null since it's not technically \"selected\" (it's a fallback)\n // and returning an internal value like `__DEFAULT__` would be confusing.\n return selectedLayoutSegment === DEFAULT_SEGMENT_KEY\n ? null\n : selectedLayoutSegment\n}\n\n// Shared components APIs\nexport {\n notFound,\n redirect,\n permanentRedirect,\n RedirectType,\n ReadonlyURLSearchParams,\n unstable_rethrow,\n} from './navigation.react-server'\n","/** @internal */\nclass ReadonlyURLSearchParamsError extends Error {\n constructor() {\n super(\n 'Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams'\n )\n }\n}\n\nclass ReadonlyURLSearchParams extends URLSearchParams {\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n append() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n delete() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n set() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n sort() {\n throw new ReadonlyURLSearchParamsError()\n }\n}\n\nexport { redirect, permanentRedirect, RedirectType } from './redirect'\nexport { notFound } from './not-found'\nexport { unstable_rethrow } from './unstable-rethrow'\nexport { ReadonlyURLSearchParams }\n","'use client'\n\nimport React, { useContext } from 'react'\nimport { useUntrackedPathname } from './navigation-untracked'\nimport { isNotFoundError } from './not-found'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport { MissingSlotContext } from '../../shared/lib/app-router-context.shared-runtime'\n\ninterface NotFoundBoundaryProps {\n notFound?: React.ReactNode\n notFoundStyles?: React.ReactNode\n asNotFound?: boolean\n children: React.ReactNode\n missingSlots?: Set\n}\n\ninterface NotFoundErrorBoundaryProps extends NotFoundBoundaryProps {\n pathname: string | null\n missingSlots?: Set\n}\n\ninterface NotFoundErrorBoundaryState {\n notFoundTriggered: boolean\n previousPathname: string | null\n}\n\nclass NotFoundErrorBoundary extends React.Component<\n NotFoundErrorBoundaryProps,\n NotFoundErrorBoundaryState\n> {\n constructor(props: NotFoundErrorBoundaryProps) {\n super(props)\n this.state = {\n notFoundTriggered: !!props.asNotFound,\n previousPathname: props.pathname,\n }\n }\n\n componentDidCatch(): void {\n if (\n process.env.NODE_ENV === 'development' &&\n this.props.missingSlots &&\n // A missing children slot is the typical not-found case, so no need to warn\n !this.props.missingSlots.has('children')\n ) {\n let warningMessage =\n 'No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs\\n\\n'\n\n if (this.props.missingSlots.size > 0) {\n const formattedSlots = Array.from(this.props.missingSlots)\n .sort((a, b) => a.localeCompare(b))\n .map((slot) => `@${slot}`)\n .join(', ')\n\n warningMessage += 'Missing slots: ' + formattedSlots\n }\n\n warnOnce(warningMessage)\n }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isNotFoundError(error)) {\n return {\n notFoundTriggered: true,\n }\n }\n // Re-throw if error is not for 404\n throw error\n }\n\n static getDerivedStateFromProps(\n props: NotFoundErrorBoundaryProps,\n state: NotFoundErrorBoundaryState\n ): NotFoundErrorBoundaryState | null {\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.notFoundTriggered) {\n return {\n notFoundTriggered: false,\n previousPathname: props.pathname,\n }\n }\n return {\n notFoundTriggered: state.notFoundTriggered,\n previousPathname: props.pathname,\n }\n }\n\n render() {\n if (this.state.notFoundTriggered) {\n return (\n <>\n \n {process.env.NODE_ENV === 'development' && (\n \n )}\n {this.props.notFoundStyles}\n {this.props.notFound}\n \n )\n }\n\n return this.props.children\n }\n}\n\nexport function NotFoundBoundary({\n notFound,\n notFoundStyles,\n asNotFound,\n children,\n}: NotFoundBoundaryProps) {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these error can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n const missingSlots = useContext(MissingSlotContext)\n\n if (notFound) {\n return (\n \n {children}\n \n )\n }\n\n return <>{children}\n}\n","const NOT_FOUND_ERROR_CODE = 'NEXT_NOT_FOUND'\n\nexport type NotFoundError = Error & { digest: typeof NOT_FOUND_ERROR_CODE }\n\n/**\n * This function allows you to render the [not-found.js file](https://nextjs.org/docs/app/api-reference/file-conventions/not-found)\n * within a route segment as well as inject a tag.\n *\n * `notFound()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a `` meta tag and set the status code to 404.\n * - In a Route Handler or Server Action, it will serve a 404 to the caller.\n *\n * Read more: [Next.js Docs: `notFound`](https://nextjs.org/docs/app/api-reference/functions/not-found)\n */\nexport function notFound(): never {\n // eslint-disable-next-line no-throw-literal\n const error = new Error(NOT_FOUND_ERROR_CODE)\n ;(error as NotFoundError).digest = NOT_FOUND_ERROR_CODE\n throw error\n}\n\n/**\n * Checks an error to determine if it's an error generated by the `notFound()`\n * helper.\n *\n * @param error the error that may reference a not found error\n * @returns true if the error is a not found error\n */\nexport function isNotFoundError(error: unknown): error is NotFoundError {\n if (typeof error !== 'object' || error === null || !('digest' in error)) {\n return false\n }\n\n return error.digest === NOT_FOUND_ERROR_CODE\n}\n","/*\n This is a simple promise queue that allows you to limit the number of concurrent promises\n that are running at any given time. It's used to limit the number of concurrent\n prefetch requests that are being made to the server but could be used for other\n things as well.\n*/\nexport class PromiseQueue {\n #maxConcurrency: number\n #runningCount: number\n #queue: Array<{\n promiseFn: Promise\n task: () => void\n }>\n\n constructor(maxConcurrency = 5) {\n this.#maxConcurrency = maxConcurrency\n this.#runningCount = 0\n this.#queue = []\n }\n\n enqueue(promiseFn: () => Promise): Promise {\n let taskResolve: (value: T | PromiseLike) => void\n let taskReject: (reason?: any) => void\n\n const taskPromise = new Promise((resolve, reject) => {\n taskResolve = resolve\n taskReject = reject\n }) as Promise\n\n const task = async () => {\n try {\n this.#runningCount++\n const result = await promiseFn()\n taskResolve(result)\n } catch (error) {\n taskReject(error)\n } finally {\n this.#runningCount--\n this.#processNext()\n }\n }\n\n const enqueueResult = { promiseFn: taskPromise, task }\n // wonder if we should take a LIFO approach here\n this.#queue.push(enqueueResult)\n this.#processNext()\n\n return taskPromise\n }\n\n bump(promiseFn: Promise) {\n const index = this.#queue.findIndex((item) => item.promiseFn === promiseFn)\n\n if (index > -1) {\n const bumpedItem = this.#queue.splice(index, 1)[0]\n this.#queue.unshift(bumpedItem)\n this.#processNext(true)\n }\n }\n\n #processNext(forced = false) {\n if (\n (this.#runningCount < this.#maxConcurrency || forced) &&\n this.#queue.length > 0\n ) {\n this.#queue.shift()?.task()\n }\n }\n}\n","import {\n isHydrationError,\n getDefaultHydrationErrorMessage,\n} from '../../../is-hydration-error'\nimport {\n hydrationErrorState,\n getReactHydrationDiffSegments,\n} from './hydration-error-info'\n\nexport function attachHydrationErrorState(error: Error) {\n if (\n isHydrationError(error) &&\n !error.message.includes(\n 'https://nextjs.org/docs/messages/react-hydration-error'\n )\n ) {\n const reactHydrationDiffSegments = getReactHydrationDiffSegments(\n error.message\n )\n let parsedHydrationErrorState: typeof hydrationErrorState = {}\n if (reactHydrationDiffSegments) {\n parsedHydrationErrorState = {\n ...(error as any).details,\n ...hydrationErrorState,\n warning: hydrationErrorState.warning || [\n getDefaultHydrationErrorMessage(),\n ],\n notes: reactHydrationDiffSegments[0],\n reactOutputComponentDiff: reactHydrationDiffSegments[1],\n }\n } else {\n // If there's any extra information in the error message to display,\n // append it to the error message details property\n if (hydrationErrorState.warning) {\n // The patched console.error found hydration errors logged by React\n // Append the logged warning to the error message\n parsedHydrationErrorState = {\n ...(error as any).details,\n // It contains the warning, component stack, server and client tag names\n ...hydrationErrorState,\n }\n }\n }\n ;(error as any).details = parsedHydrationErrorState\n }\n}\n","// Polyfill for `Error.captureStackTrace` in browsers\nexport function captureStackTrace(obj: any) {\n const container = new Error()\n Object.defineProperty(obj, 'stack', {\n configurable: true,\n get() {\n const { stack } = container\n Object.defineProperty(this, 'stack', { value: stack })\n return stack\n },\n })\n}\n","// Represent non Error shape unhandled promise rejections or console.error errors.\n// Those errors will be captured and displayed in Error Overlay.\ntype UnhandledError = Error & { digest: 'NEXT_UNHANDLED_ERROR' }\n\nexport function createUnhandledError(message: string): UnhandledError {\n const error = new Error(message) as UnhandledError\n error.digest = 'NEXT_UNHANDLED_ERROR'\n return error\n}\n\nexport const isUnhandledConsoleOrRejection = (\n error: any\n): error is UnhandledError => {\n return error && error.digest === 'NEXT_UNHANDLED_ERROR'\n}\n","import { isHydrationError } from '../../../is-hydration-error'\n\n// Dedupe the two consecutive errors: If the previous one is same as current one, ignore the current one.\nexport function enqueueConsecutiveDedupedError(\n queue: Array,\n error: Error\n) {\n const isFront = isHydrationError(error)\n const previousError = isFront ? queue[0] : queue[queue.length - 1]\n // Compare the error stack to dedupe the consecutive errors\n if (previousError && previousError.stack === error.stack) {\n return\n }\n // TODO: change all to push error into errorQueue,\n // currently there's a async api error is always erroring while hydration error showing up.\n // Move hydration error to the front of the queue to unblock.\n if (isFront) {\n queue.unshift(error)\n } else {\n queue.push(error)\n }\n}\n","import { getHydrationErrorStackInfo } from '../../../is-hydration-error'\n\nexport type HydrationErrorState = {\n // Hydration warning template format: \n warning?: [string, string, string]\n componentStack?: string\n serverContent?: string\n clientContent?: string\n // React 19 hydration diff format: \n notes?: string\n reactOutputComponentDiff?: string\n}\n\ntype NullableText = string | null | undefined\n\nexport const hydrationErrorState: HydrationErrorState = {}\n\n// https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference\nconst htmlTagsWarnings = new Set([\n 'Warning: In HTML, %s cannot be a child of <%s>.%s\\nThis will cause a hydration error.%s',\n 'Warning: In HTML, %s cannot be a descendant of <%s>.\\nThis will cause a hydration error.%s',\n 'Warning: In HTML, text nodes cannot be a child of <%s>.\\nThis will cause a hydration error.',\n \"Warning: In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\\nThis will cause a hydration error.\",\n 'Warning: Expected server HTML to contain a matching <%s> in <%s>.%s',\n 'Warning: Did not expect server HTML to contain a <%s> in <%s>.%s',\n])\nconst textAndTagsMismatchWarnings = new Set([\n 'Warning: Expected server HTML to contain a matching text node for \"%s\" in <%s>.%s',\n 'Warning: Did not expect server HTML to contain the text node \"%s\" in <%s>.%s',\n])\nconst textMismatchWarning =\n 'Warning: Text content did not match. Server: \"%s\" Client: \"%s\"%s'\n\nexport const getHydrationWarningType = (\n message: NullableText\n): 'tag' | 'text' | 'text-in-tag' => {\n if (typeof message !== 'string') {\n // TODO: Doesn't make sense to treat no message as a hydration error message.\n // We should bail out somewhere earlier.\n return 'text'\n }\n\n const normalizedMessage = message.startsWith('Warning: ')\n ? message\n : `Warning: ${message}`\n\n if (isHtmlTagsWarning(normalizedMessage)) return 'tag'\n if (isTextInTagsMismatchWarning(normalizedMessage)) return 'text-in-tag'\n\n return 'text'\n}\n\nconst isHtmlTagsWarning = (message: string) => htmlTagsWarnings.has(message)\n\nconst isTextMismatchWarning = (message: string) =>\n textMismatchWarning === message\nconst isTextInTagsMismatchWarning = (msg: string) =>\n textAndTagsMismatchWarnings.has(msg)\n\nconst isKnownHydrationWarning = (message: NullableText) => {\n if (typeof message !== 'string') {\n return false\n }\n // React 18 has the `Warning: ` prefix.\n // React 19 does not.\n const normalizedMessage = message.startsWith('Warning: ')\n ? message\n : `Warning: ${message}`\n\n return (\n isHtmlTagsWarning(normalizedMessage) ||\n isTextInTagsMismatchWarning(normalizedMessage) ||\n isTextMismatchWarning(normalizedMessage)\n )\n}\n\nexport const getReactHydrationDiffSegments = (msg: NullableText) => {\n if (msg) {\n const { message, diff } = getHydrationErrorStackInfo(msg)\n if (message) return [message, diff]\n }\n return undefined\n}\n\n/**\n * Patch console.error to capture hydration errors.\n * If any of the knownHydrationWarnings are logged, store the message and component stack.\n * When the hydration runtime error is thrown, the message and component stack are added to the error.\n * This results in a more helpful error message in the error overlay.\n */\n\nexport function storeHydrationErrorStateFromConsoleArgs(...args: any[]) {\n const [msg, serverContent, clientContent, componentStack] = args\n if (isKnownHydrationWarning(msg)) {\n hydrationErrorState.warning = [\n // remove the last %s from the message\n msg,\n serverContent,\n clientContent,\n ]\n hydrationErrorState.componentStack = componentStack\n hydrationErrorState.serverContent = serverContent\n hydrationErrorState.clientContent = clientContent\n }\n}\n","import React from 'react'\nimport isError from '../../../../../lib/is-error'\n\nconst REACT_ERROR_STACK_BOTTOM_FRAME = 'react-stack-bottom-frame'\nconst REACT_ERROR_STACK_BOTTOM_FRAME_REGEX = new RegExp(\n `(at ${REACT_ERROR_STACK_BOTTOM_FRAME} )|(${REACT_ERROR_STACK_BOTTOM_FRAME}\\\\@)`\n)\n\nconst captureOwnerStack = (React as any).captureOwnerStack\n ? (React as any).captureOwnerStack\n : () => ''\n\nexport function getReactStitchedError(err: T): Error | T {\n if (typeof (React as any).captureOwnerStack !== 'function') {\n return err\n }\n const isErrorInstance = isError(err)\n const originStack = isErrorInstance ? err.stack || '' : ''\n const originMessage = isErrorInstance ? err.message : ''\n const stackLines = originStack.split('\\n')\n const indexOfSplit = stackLines.findIndex((line) =>\n REACT_ERROR_STACK_BOTTOM_FRAME_REGEX.test(line)\n )\n const isOriginalReactError = indexOfSplit >= 0 // has the react-stack-bottom-frame\n let newStack = isOriginalReactError\n ? stackLines.slice(0, indexOfSplit).join('\\n')\n : originStack\n\n const newError = new Error(originMessage)\n // Copy all enumerable properties, e.g. digest\n Object.assign(newError, err)\n newError.stack = newStack\n\n // Avoid duplicate overriding stack frames\n appendOwnerStack(newError)\n\n return newError\n}\n\nfunction appendOwnerStack(error: Error) {\n let stack = error.stack || ''\n // Avoid duplicate overriding stack frames\n const ownerStack = captureOwnerStack()\n if (ownerStack && stack.endsWith(ownerStack) === false) {\n stack += ownerStack\n // Override stack\n error.stack = stack\n }\n}\n","import { useEffect } from 'react'\nimport { attachHydrationErrorState } from './attach-hydration-error-state'\nimport { isNextRouterError } from '../../../is-next-router-error'\nimport { storeHydrationErrorStateFromConsoleArgs } from './hydration-error-info'\nimport { formatConsoleArgs } from '../../../../lib/console'\nimport isError from '../../../../../lib/is-error'\nimport { createUnhandledError } from './console-error'\nimport { enqueueConsecutiveDedupedError } from './enqueue-client-error'\nimport { getReactStitchedError } from './stitched-error'\n\nexport type ErrorHandler = (error: Error) => void\n\nconst errorQueue: Array = []\nconst errorHandlers: Array = []\nconst rejectionQueue: Array = []\nconst rejectionHandlers: Array = []\n\nexport function handleClientError(\n originError: unknown,\n consoleErrorArgs: any[]\n) {\n let error: Error\n if (!originError || !isError(originError)) {\n // If it's not an error, format the args into an error\n const formattedErrorMessage = formatConsoleArgs(consoleErrorArgs)\n error = getReactStitchedError(createUnhandledError(formattedErrorMessage))\n } else {\n error = originError\n }\n\n storeHydrationErrorStateFromConsoleArgs(...consoleErrorArgs)\n attachHydrationErrorState(error)\n\n enqueueConsecutiveDedupedError(errorQueue, error)\n for (const handler of errorHandlers) {\n handler(error)\n }\n}\n\nexport function useErrorHandler(\n handleOnUnhandledError: ErrorHandler,\n handleOnUnhandledRejection: ErrorHandler\n) {\n useEffect(() => {\n // Handle queued errors.\n errorQueue.forEach(handleOnUnhandledError)\n rejectionQueue.forEach(handleOnUnhandledRejection)\n\n // Listen to new errors.\n errorHandlers.push(handleOnUnhandledError)\n rejectionHandlers.push(handleOnUnhandledRejection)\n\n return () => {\n // Remove listeners.\n errorHandlers.splice(errorHandlers.indexOf(handleOnUnhandledError), 1)\n rejectionHandlers.splice(\n rejectionHandlers.indexOf(handleOnUnhandledRejection),\n 1\n )\n }\n }, [handleOnUnhandledError, handleOnUnhandledRejection])\n}\n\nfunction onUnhandledError(event: WindowEventMap['error']): void | boolean {\n if (isNextRouterError(event.error)) {\n event.preventDefault()\n return false\n }\n handleClientError(event.error, [])\n}\n\nfunction onUnhandledRejection(ev: WindowEventMap['unhandledrejection']): void {\n const reason = ev?.reason\n if (isNextRouterError(reason)) {\n ev.preventDefault()\n return\n }\n\n let error = reason\n if (error && !isError(error)) {\n error = createUnhandledError(error + '')\n }\n\n rejectionQueue.push(error)\n for (const handler of rejectionHandlers) {\n handler(error)\n }\n}\n\nexport function handleGlobalErrors() {\n if (typeof window !== 'undefined') {\n try {\n // Increase the number of stack frames on the client\n Error.stackTraceLimit = 50\n } catch {}\n\n window.addEventListener('error', onUnhandledError)\n window.addEventListener('unhandledrejection', onUnhandledRejection)\n }\n}\n","'use client'\nimport React, { useEffect } from 'react'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useRouter } from './navigation'\nimport {\n RedirectType,\n getRedirectTypeFromError,\n getURLFromRedirectError,\n isRedirectError,\n} from './redirect'\n\ninterface RedirectBoundaryProps {\n router: AppRouterInstance\n children: React.ReactNode\n}\n\nfunction HandleRedirect({\n redirect,\n reset,\n redirectType,\n}: {\n redirect: string\n redirectType: RedirectType\n reset: () => void\n}) {\n const router = useRouter()\n\n useEffect(() => {\n React.startTransition(() => {\n if (redirectType === RedirectType.push) {\n router.push(redirect, {})\n } else {\n router.replace(redirect, {})\n }\n reset()\n })\n }, [redirect, redirectType, reset, router])\n\n return null\n}\n\nexport class RedirectErrorBoundary extends React.Component<\n RedirectBoundaryProps,\n { redirect: string | null; redirectType: RedirectType | null }\n> {\n constructor(props: RedirectBoundaryProps) {\n super(props)\n this.state = { redirect: null, redirectType: null }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isRedirectError(error)) {\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n return { redirect: url, redirectType }\n }\n // Re-throw if error is not for redirect\n throw error\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n const { redirect, redirectType } = this.state\n if (redirect !== null && redirectType !== null) {\n return (\n this.setState({ redirect: null })}\n />\n )\n }\n\n return this.props.children\n }\n}\n\nexport function RedirectBoundary({ children }: { children: React.ReactNode }) {\n const router = useRouter()\n return (\n {children}\n )\n}\n","export enum RedirectStatusCode {\n SeeOther = 303,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n}\n","import { actionAsyncStorage } from '../../server/app-render/action-async-storage.external'\nimport { RedirectStatusCode } from './redirect-status-code'\n\nconst REDIRECT_ERROR_CODE = 'NEXT_REDIRECT'\n\nexport enum RedirectType {\n push = 'push',\n replace = 'replace',\n}\n\nexport type RedirectError = Error & {\n digest: `${typeof REDIRECT_ERROR_CODE};${RedirectType};${string};${RedirectStatusCode};`\n}\n\nexport function getRedirectError(\n url: string,\n type: RedirectType,\n statusCode: RedirectStatusCode = RedirectStatusCode.TemporaryRedirect\n): RedirectError {\n const error = new Error(REDIRECT_ERROR_CODE) as RedirectError\n error.digest = `${REDIRECT_ERROR_CODE};${type};${url};${statusCode};`\n return error\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 307/303 to the caller.\n * - In a Server Action, type defaults to 'push' and 'replace' elsewhere.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function redirect(\n /** The URL to redirect to */\n url: string,\n type?: RedirectType\n): never {\n const actionStore = actionAsyncStorage.getStore()\n const redirectType =\n type || (actionStore?.isAction ? RedirectType.push : RedirectType.replace)\n throw getRedirectError(\n url,\n redirectType,\n RedirectStatusCode.TemporaryRedirect\n )\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 308/303 to the caller.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function permanentRedirect(\n /** The URL to redirect to */\n url: string,\n type: RedirectType = RedirectType.replace\n): never {\n throw getRedirectError(url, type, RedirectStatusCode.PermanentRedirect)\n}\n\n/**\n * Checks an error to determine if it's an error generated by the\n * `redirect(url)` helper.\n *\n * @param error the error that may reference a redirect error\n * @returns true if the error is a redirect error\n */\nexport function isRedirectError(error: unknown): error is RedirectError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n\n const digest = error.digest.split(';')\n const [errorCode, type] = digest\n const destination = digest.slice(2, -2).join(';')\n const status = digest.at(-2)\n\n const statusCode = Number(status)\n\n return (\n errorCode === REDIRECT_ERROR_CODE &&\n (type === 'replace' || type === 'push') &&\n typeof destination === 'string' &&\n !isNaN(statusCode) &&\n statusCode in RedirectStatusCode\n )\n}\n\n/**\n * Returns the encoded URL from the error if it's a RedirectError, null\n * otherwise. Note that this does not validate the URL returned.\n *\n * @param error the error that may be a redirect error\n * @return the url if the error was a redirect error\n */\nexport function getURLFromRedirectError(error: RedirectError): string\nexport function getURLFromRedirectError(error: unknown): string | null {\n if (!isRedirectError(error)) return null\n\n // Slices off the beginning of the digest that contains the code and the\n // separating ';'.\n return error.digest.split(';').slice(2, -2).join(';')\n}\n\nexport function getRedirectTypeFromError(error: RedirectError): RedirectType {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return error.digest.split(';', 2)[1] as RedirectType\n}\n\nexport function getRedirectStatusCodeFromError(error: RedirectError): number {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return Number(error.digest.split(';').at(-2))\n}\n","'use client'\n\nimport React, { useContext, type JSX } from 'react'\nimport { TemplateContext } from '../../shared/lib/app-router-context.shared-runtime'\n\nexport default function RenderFromTemplateContext(): JSX.Element {\n const children = useContext(TemplateContext)\n return <>{children}\n}\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n} from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport {\n addSearchParamsIfPageSegment,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { createEmptyCacheNode } from '../app-router'\nimport { applyRouterStatePatchToTree } from './apply-router-state-patch-to-tree'\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport { fillCacheWithNewSubTreeDataButOnlyLoading } from './fill-cache-with-new-subtree-data'\nimport { handleMutable } from './handle-mutable'\nimport type { Mutable, ReadonlyReducerState } from './router-reducer-types'\n\n/**\n * This is a stop-gap until per-segment caching is implemented. It leverages the `aliased` flag that is added\n * to prefetch entries when it's determined that the loading state from that entry should be used for this navigation.\n * This function takes the aliased entry and only applies the loading state to the updated cache node.\n * We should remove this once per-segment fetching is implemented as ideally the prefetch cache will contain a\n * more granular segment map and so the router will be able to simply re-use the loading segment for the new navigation.\n */\nexport function handleAliasedPrefetchEntry(\n state: ReadonlyReducerState,\n flightData: NormalizedFlightData[],\n url: URL,\n mutable: Mutable\n) {\n let currentTree = state.tree\n let currentCache = state.cache\n const href = createHrefFromUrl(url)\n let applied\n\n for (const normalizedFlightData of flightData) {\n // If the segment doesn't have a loading component, we don't need to do anything.\n if (!hasLoadingComponentInSeedData(normalizedFlightData.seedData)) {\n continue\n }\n\n let treePatch = normalizedFlightData.tree\n // Segments are keyed by searchParams (e.g. __PAGE__?{\"foo\":\"bar\"}). We might return a less specific, param-less entry,\n // so we ensure that the final tree contains the correct searchParams (reflected in the URL) are provided in the updated FlightRouterState tree.\n // We only do this on the first read, as otherwise we'd be overwriting the searchParams that may have already been set\n treePatch = addSearchParamsToPageSegments(\n treePatch,\n Object.fromEntries(url.searchParams)\n )\n\n const { seedData, isRootRender, pathToSegment } = normalizedFlightData\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = ['', ...pathToSegment]\n\n // Segments are keyed by searchParams (e.g. __PAGE__?{\"foo\":\"bar\"}). We might return a less specific, param-less entry,\n // so we ensure that the final tree contains the correct searchParams (reflected in the URL) are provided in the updated FlightRouterState tree.\n // We only do this on the first read, as otherwise we'd be overwriting the searchParams that may have already been set\n treePatch = addSearchParamsToPageSegments(\n treePatch,\n Object.fromEntries(url.searchParams)\n )\n\n let newTree = applyRouterStatePatchToTree(\n flightSegmentPathWithLeadingEmpty,\n currentTree,\n treePatch,\n href\n )\n\n const newCache = createEmptyCacheNode()\n\n // The prefetch cache entry was aliased -- this signals that we only fill in the cache with the\n // loading state and not the actual parallel route seed data.\n if (isRootRender && seedData) {\n // Fill in the cache with the new loading / rsc data\n const rsc = seedData[1]\n const loading = seedData[3]\n newCache.loading = loading\n newCache.rsc = rsc\n\n // Construct a new tree and apply the aliased loading state for each parallel route\n fillNewTreeWithOnlyLoadingSegments(\n newCache,\n currentCache,\n treePatch,\n seedData\n )\n } else {\n // Copy rsc for the root node of the cache.\n newCache.rsc = currentCache.rsc\n newCache.prefetchRsc = currentCache.prefetchRsc\n newCache.loading = currentCache.loading\n newCache.parallelRoutes = new Map(currentCache.parallelRoutes)\n\n // copy the loading state only into the leaf node (the part that changed)\n fillCacheWithNewSubTreeDataButOnlyLoading(\n newCache,\n currentCache,\n normalizedFlightData\n )\n }\n\n // If we don't have an updated tree, there's no reason to update the cache, as the tree\n // dictates what cache nodes to render.\n if (newTree) {\n currentTree = newTree\n currentCache = newCache\n applied = true\n }\n }\n\n if (!applied) {\n return false\n }\n\n mutable.patchedTree = currentTree\n mutable.cache = currentCache\n mutable.canonicalUrl = href\n mutable.hashFragment = url.hash\n\n return handleMutable(state, mutable)\n}\n\nfunction hasLoadingComponentInSeedData(seedData: CacheNodeSeedData | null) {\n if (!seedData) return false\n\n const parallelRoutes = seedData[2]\n const loading = seedData[3]\n\n if (loading) {\n return true\n }\n\n for (const key in parallelRoutes) {\n if (hasLoadingComponentInSeedData(parallelRoutes[key])) {\n return true\n }\n }\n\n return false\n}\n\nfunction fillNewTreeWithOnlyLoadingSegments(\n newCache: CacheNode,\n existingCache: CacheNode,\n routerState: FlightRouterState,\n cacheNodeSeedData: CacheNodeSeedData | null\n) {\n const isLastSegment = Object.keys(routerState[1]).length === 0\n if (isLastSegment) {\n return\n }\n\n for (const key in routerState[1]) {\n const parallelRouteState = routerState[1][key]\n const segmentForParallelRoute = parallelRouteState[0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n\n const parallelSeedData =\n cacheNodeSeedData !== null && cacheNodeSeedData[2][key] !== undefined\n ? cacheNodeSeedData[2][key]\n : null\n\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const rsc = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n // copy the layout but null the page segment as that's not meant to be used\n rsc: segmentForParallelRoute.includes(PAGE_SEGMENT_KEY) ? null : rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n }\n\n const existingParallelRoutes = newCache.parallelRoutes.get(key)\n if (existingParallelRoutes) {\n existingParallelRoutes.set(cacheKey, newCacheNode)\n } else {\n newCache.parallelRoutes.set(key, new Map([[cacheKey, newCacheNode]]))\n }\n\n fillNewTreeWithOnlyLoadingSegments(\n newCacheNode,\n existingCache,\n parallelRouteState,\n parallelSeedData\n )\n }\n}\n\n/**\n * Add search params to the page segments in the flight router state\n * Page segments that are associated with search params have a page segment key\n * followed by a query string. This function will add those params to the page segment.\n * This is useful if we return an aliased prefetch entry (ie, won't have search params)\n * but the canonical router URL has search params.\n */\nexport function addSearchParamsToPageSegments(\n flightRouterState: FlightRouterState,\n searchParams: Record\n): FlightRouterState {\n const [segment, parallelRoutes, ...rest] = flightRouterState\n\n // If it's a page segment, modify the segment by adding search params\n if (segment.includes(PAGE_SEGMENT_KEY)) {\n const newSegment = addSearchParamsIfPageSegment(segment, searchParams)\n return [newSegment, parallelRoutes, ...rest]\n }\n\n // Otherwise, recurse through the parallel routes and return a new tree\n const updatedParallelRoutes: { [key: string]: FlightRouterState } = {}\n\n for (const [key, parallelRoute] of Object.entries(parallelRoutes)) {\n updatedParallelRoutes[key] = addSearchParamsToPageSegments(\n parallelRoute,\n searchParams\n )\n }\n\n return [segment, updatedParallelRoutes, ...rest]\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data'\nimport type { PrefetchCacheEntry } from './router-reducer-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\n\nexport function applyFlightData(\n existingCache: CacheNode,\n cache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): boolean {\n // The one before last item is the router state tree patch\n const { tree: treePatch, seedData, head, isRootRender } = flightData\n\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (seedData === null) {\n return false\n }\n\n if (isRootRender) {\n const rsc = seedData[1]\n const loading = seedData[3]\n cache.loading = loading\n cache.rsc = rsc\n // This is a PPR-only field. When PPR is enabled, we shouldn't hit\n // this path during a navigation, but until PPR is fully implemented\n // yet it's possible the existing node does have a non-null\n // `prefetchRsc`. As an incremental step, we'll just de-opt to the\n // old behavior — no PPR value.\n cache.prefetchRsc = null\n fillLazyItemsTillLeafWithHead(\n cache,\n existingCache,\n treePatch,\n seedData,\n head,\n prefetchEntry\n )\n } else {\n // Copy rsc for the root node of the cache.\n cache.rsc = existingCache.rsc\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n cache.prefetchRsc = existingCache.prefetchRsc\n cache.parallelRoutes = new Map(existingCache.parallelRoutes)\n cache.loading = existingCache.loading\n // Create a copy of the existing cache with the rsc applied.\n fillCacheWithNewSubTreeData(cache, existingCache, flightData, prefetchEntry)\n }\n\n return true\n}\n","import type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport { DEFAULT_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { matchSegment } from '../match-segments'\nimport { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'\n\n/**\n * Deep merge of the two router states. Parallel route keys are preserved if the patch doesn't have them.\n */\nfunction applyPatch(\n initialTree: FlightRouterState,\n patchTree: FlightRouterState\n): FlightRouterState {\n const [initialSegment, initialParallelRoutes] = initialTree\n const [patchSegment, patchParallelRoutes] = patchTree\n\n // if the applied patch segment is __DEFAULT__ then it can be ignored in favor of the initial tree\n // this is because the __DEFAULT__ segment is used as a placeholder on navigation\n if (\n patchSegment === DEFAULT_SEGMENT_KEY &&\n initialSegment !== DEFAULT_SEGMENT_KEY\n ) {\n return initialTree\n }\n\n if (matchSegment(initialSegment, patchSegment)) {\n const newParallelRoutes: FlightRouterState[1] = {}\n for (const key in initialParallelRoutes) {\n const isInPatchTreeParallelRoutes =\n typeof patchParallelRoutes[key] !== 'undefined'\n if (isInPatchTreeParallelRoutes) {\n newParallelRoutes[key] = applyPatch(\n initialParallelRoutes[key],\n patchParallelRoutes[key]\n )\n } else {\n newParallelRoutes[key] = initialParallelRoutes[key]\n }\n }\n\n for (const key in patchParallelRoutes) {\n if (newParallelRoutes[key]) {\n continue\n }\n\n newParallelRoutes[key] = patchParallelRoutes[key]\n }\n\n const tree: FlightRouterState = [initialSegment, newParallelRoutes]\n\n // Copy over the existing tree\n if (initialTree[2]) {\n tree[2] = initialTree[2]\n }\n\n if (initialTree[3]) {\n tree[3] = initialTree[3]\n }\n\n if (initialTree[4]) {\n tree[4] = initialTree[4]\n }\n\n return tree\n }\n\n return patchTree\n}\n\n/**\n * Apply the router state from the Flight response, but skip patching default segments.\n * Useful for patching the router cache when navigating, where we persist the existing default segment if there isn't a new one.\n * Creates a new router state tree.\n */\nexport function applyRouterStatePatchToTree(\n flightSegmentPath: FlightSegmentPath,\n flightRouterState: FlightRouterState,\n treePatch: FlightRouterState,\n path: string\n): FlightRouterState | null {\n const [segment, parallelRoutes, url, refetch, isRootLayout] =\n flightRouterState\n\n // Root refresh\n if (flightSegmentPath.length === 1) {\n const tree: FlightRouterState = applyPatch(flightRouterState, treePatch)\n\n addRefreshMarkerToActiveParallelSegments(tree, path)\n\n return tree\n }\n\n const [currentSegment, parallelRouteKey] = flightSegmentPath\n\n // Tree path returned from the server should always match up with the current tree in the browser\n if (!matchSegment(currentSegment, segment)) {\n return null\n }\n\n const lastSegment = flightSegmentPath.length === 2\n\n let parallelRoutePatch\n if (lastSegment) {\n parallelRoutePatch = applyPatch(parallelRoutes[parallelRouteKey], treePatch)\n } else {\n parallelRoutePatch = applyRouterStatePatchToTree(\n getNextFlightSegmentPath(flightSegmentPath),\n parallelRoutes[parallelRouteKey],\n treePatch,\n path\n )\n\n if (parallelRoutePatch === null) {\n return null\n }\n }\n\n const tree: FlightRouterState = [\n flightSegmentPath[0],\n {\n ...parallelRoutes,\n [parallelRouteKey]: parallelRoutePatch,\n },\n url,\n refetch,\n ]\n\n // Current segment is the root layout\n if (isRootLayout) {\n tree[4] = true\n }\n\n addRefreshMarkerToActiveParallelSegments(tree, path)\n\n return tree\n}\n","import type { FlightSegmentPath } from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { createRouterCacheKey } from './create-router-cache-key'\n\n/**\n * This will clear the CacheNode data for a particular segment path. This will cause a lazy-fetch in layout router to fill in new data.\n */\nexport function clearCacheNodeDataForSegmentPath(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightSegmentPath: FlightSegmentPath\n): void {\n const isLastEntry = flightSegmentPath.length <= 2\n\n const [parallelRouteKey, segment] = flightSegmentPath\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCache.parallelRoutes.get(parallelRouteKey)\n\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey)\n\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n const existingChildCacheNode = existingChildSegmentMap?.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n // In case of last segment start off the fetch at this level and don't copy further down.\n if (isLastEntry) {\n if (\n !childCacheNode ||\n !childCacheNode.lazyData ||\n childCacheNode === existingChildCacheNode\n ) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n })\n }\n return\n }\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Start fetch in the place where the existing cache doesn't have the data yet.\n if (!childCacheNode) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n })\n }\n return\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n loading: childCacheNode.loading,\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n return clearCacheNodeDataForSegmentPath(\n childCacheNode,\n existingChildCacheNode,\n getNextFlightSegmentPath(flightSegmentPath)\n )\n}\n","import type {\n FlightRouterState,\n Segment,\n} from '../../../server/app-render/types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../server/lib/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n","export function createHrefFromUrl(\n url: Pick,\n includeHash: boolean = true\n): string {\n return url.pathname + url.search + (includeHash ? url.hash : '')\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightDataPath } from '../../../server/app-render/types'\n\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { extractPathFromFlightRouterState } from './compute-changed-path'\nimport { createSeededPrefetchCacheEntry } from './prefetch-cache-utils'\nimport { PrefetchKind, type PrefetchCacheEntry } from './router-reducer-types'\nimport { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'\nimport { getFlightDataPartsFromPath } from '../../flight-data-helpers'\n\nexport interface InitialRouterStateParameters {\n buildId: string\n initialCanonicalUrlParts: string[]\n initialParallelRoutes: CacheNode['parallelRoutes']\n initialFlightData: FlightDataPath[]\n location: Location | null\n couldBeIntercepted: boolean\n postponed: boolean\n prerendered: boolean\n}\n\nexport function createInitialRouterState({\n buildId,\n initialFlightData,\n initialCanonicalUrlParts,\n initialParallelRoutes,\n location,\n couldBeIntercepted,\n postponed,\n prerendered,\n}: InitialRouterStateParameters) {\n // When initialized on the server, the canonical URL is provided as an array of parts.\n // This is to ensure that when the RSC payload streamed to the client, crawlers don't interpret it\n // as a URL that should be crawled.\n const initialCanonicalUrl = initialCanonicalUrlParts.join('/')\n const normalizedFlightData = getFlightDataPartsFromPath(initialFlightData[0])\n const {\n tree: initialTree,\n seedData: initialSeedData,\n head: initialHead,\n } = normalizedFlightData\n const isServer = !location\n // For the SSR render, seed data should always be available (we only send back a `null` response\n // in the case of a `loading` segment, pre-PPR.)\n const rsc = initialSeedData?.[1]\n const loading = initialSeedData?.[3] ?? null\n\n const cache: CacheNode = {\n lazyData: null,\n rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n // The cache gets seeded during the first render. `initialParallelRoutes` ensures the cache from the first render is there during the second render.\n parallelRoutes: isServer ? new Map() : initialParallelRoutes,\n loading,\n }\n\n const canonicalUrl =\n // location.href is read as the initial value for canonicalUrl in the browser\n // This is safe to do as canonicalUrl can't be rendered, it's only used to control the history updates in the useEffect further down in this file.\n location\n ? // window.location does not have the same type as URL but has all the fields createHrefFromUrl needs.\n createHrefFromUrl(location)\n : initialCanonicalUrl\n\n addRefreshMarkerToActiveParallelSegments(initialTree, canonicalUrl)\n\n const prefetchCache = new Map()\n\n // When the cache hasn't been seeded yet we fill the cache with the head.\n if (initialParallelRoutes === null || initialParallelRoutes.size === 0) {\n fillLazyItemsTillLeafWithHead(\n cache,\n undefined,\n initialTree,\n initialSeedData,\n initialHead\n )\n }\n\n const initialState = {\n buildId,\n tree: initialTree,\n cache,\n prefetchCache,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // First render needs to preserve the previous window.history.state\n // to avoid it being overwritten on navigation back/forward with MPA Navigation.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: {\n apply: false,\n onlyHashChange: false,\n hashFragment: null,\n segmentPaths: [],\n },\n canonicalUrl,\n nextUrl:\n // the || operator is intentional, the pathname can be an empty string\n (extractPathFromFlightRouterState(initialTree) || location?.pathname) ??\n null,\n }\n\n if (process.env.NODE_ENV !== 'development' && location) {\n // Seed the prefetch cache with this page's data.\n // This is to prevent needlessly re-prefetching a page that is already reusable,\n // and will avoid triggering a loading state/data fetch stall when navigating back to the page.\n // We don't currently do this in development because links aren't prefetched in development\n // so having a mismatch between prefetch/no prefetch provides inconsistent behavior based on which page\n // was loaded first.\n const url = new URL(\n `${location.pathname}${location.search}`,\n location.origin\n )\n\n createSeededPrefetchCacheEntry({\n url,\n data: {\n flightData: [normalizedFlightData],\n canonicalUrl: undefined,\n couldBeIntercepted: !!couldBeIntercepted,\n prerendered,\n postponed,\n // TODO: The initial RSC payload includes both static and dynamic data\n // in the same response, even if PPR is enabled. So if there's any\n // dynamic data at all, we can't set a stale time. In the future we may\n // add a way to split a single Flight stream into static and dynamic\n // parts. But in the meantime we should at least make this work for\n // fully static pages.\n staleTime: -1,\n },\n tree: initialState.tree,\n prefetchCache: initialState.prefetchCache,\n nextUrl: initialState.nextUrl,\n kind: prerendered ? PrefetchKind.FULL : PrefetchKind.AUTO,\n })\n }\n\n return initialState\n}\n","import type { Segment } from '../../../server/app-render/types'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\nexport function createRouterCacheKey(\n segment: Segment,\n withoutSearchParameters: boolean = false\n) {\n // if the segment is an array, it means it's a dynamic segment\n // for example, ['lang', 'en', 'd']. We need to convert it to a string to store it as a cache node key.\n if (Array.isArray(segment)) {\n return `${segment[0]}|${segment[1]}|${segment[2]}`\n }\n\n // Page segments might have search parameters, ie __PAGE__?foo=bar\n // When `withoutSearchParameters` is true, we only want to return the page segment\n if (withoutSearchParameters && segment.startsWith(PAGE_SEGMENT_KEY)) {\n return PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n","'use client'\n\n// @ts-ignore\n// eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromReadableStream } from 'react-server-dom-webpack/client'\nconst { createFromReadableStream } = (\n !!process.env.NEXT_RUNTIME\n ? // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client.edge')\n : // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client')\n) as typeof import('react-server-dom-webpack/client')\n\nimport type {\n FlightRouterState,\n NavigationFlightResponse,\n} from '../../../server/app-render/types'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_RSC_UNION_QUERY,\n NEXT_URL,\n RSC_HEADER,\n RSC_CONTENT_TYPE_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_DID_POSTPONE_HEADER,\n NEXT_ROUTER_STALE_TIME_HEADER,\n} from '../app-router-headers'\nimport { callServer } from '../../app-call-server'\nimport { findSourceMapURL } from '../../app-find-source-map-url'\nimport { PrefetchKind } from './router-reducer-types'\nimport { hexHash } from '../../../shared/lib/hash'\nimport {\n normalizeFlightData,\n type NormalizedFlightData,\n} from '../../flight-data-helpers'\n\nexport interface FetchServerResponseOptions {\n readonly flightRouterState: FlightRouterState\n readonly nextUrl: string | null\n readonly buildId: string\n readonly prefetchKind?: PrefetchKind\n readonly isHmrRefresh?: boolean\n}\n\nexport type FetchServerResponseResult = {\n flightData: NormalizedFlightData[] | string\n canonicalUrl: URL | undefined\n couldBeIntercepted: boolean\n prerendered: boolean\n postponed: boolean\n staleTime: number\n}\n\nfunction urlToUrlWithoutFlightMarker(url: string): URL {\n const urlWithoutFlightParameters = new URL(url, location.origin)\n urlWithoutFlightParameters.searchParams.delete(NEXT_RSC_UNION_QUERY)\n if (process.env.NODE_ENV === 'production') {\n if (\n process.env.__NEXT_CONFIG_OUTPUT === 'export' &&\n urlWithoutFlightParameters.pathname.endsWith('.txt')\n ) {\n const { pathname } = urlWithoutFlightParameters\n const length = pathname.endsWith('/index.txt') ? 10 : 4\n // Slice off `/index.txt` or `.txt` from the end of the pathname\n urlWithoutFlightParameters.pathname = pathname.slice(0, -length)\n }\n }\n return urlWithoutFlightParameters\n}\n\nfunction doMpaNavigation(url: string): FetchServerResponseResult {\n return {\n flightData: urlToUrlWithoutFlightMarker(url).toString(),\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n staleTime: -1,\n }\n}\n\n/**\n * Fetch the flight data for the provided url. Takes in the current router state\n * to decide what to render server-side.\n */\nexport async function fetchServerResponse(\n url: URL,\n options: FetchServerResponseOptions\n): Promise {\n const { flightRouterState, nextUrl, buildId, prefetchKind } = options\n\n const headers: {\n [RSC_HEADER]: '1'\n [NEXT_ROUTER_STATE_TREE_HEADER]: string\n [NEXT_URL]?: string\n [NEXT_ROUTER_PREFETCH_HEADER]?: '1'\n 'x-deployment-id'?: string\n [NEXT_HMR_REFRESH_HEADER]?: '1'\n // A header that is only added in test mode to assert on fetch priority\n 'Next-Test-Fetch-Priority'?: RequestInit['priority']\n } = {\n // Enable flight response\n [RSC_HEADER]: '1',\n // Provide the current router state\n [NEXT_ROUTER_STATE_TREE_HEADER]: encodeURIComponent(\n JSON.stringify(flightRouterState)\n ),\n }\n\n /**\n * Three cases:\n * - `prefetchKind` is `undefined`, it means it's a normal navigation, so we want to prefetch the page data fully\n * - `prefetchKind` is `full` - we want to prefetch the whole page so same as above\n * - `prefetchKind` is `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully\n */\n if (prefetchKind === PrefetchKind.AUTO) {\n headers[NEXT_ROUTER_PREFETCH_HEADER] = '1'\n }\n\n if (process.env.NODE_ENV === 'development' && options.isHmrRefresh) {\n headers[NEXT_HMR_REFRESH_HEADER] = '1'\n }\n\n if (nextUrl) {\n headers[NEXT_URL] = nextUrl\n }\n\n if (process.env.NEXT_DEPLOYMENT_ID) {\n headers['x-deployment-id'] = process.env.NEXT_DEPLOYMENT_ID\n }\n\n const uniqueCacheQuery = hexHash(\n [\n headers[NEXT_ROUTER_PREFETCH_HEADER] || '0',\n headers[NEXT_ROUTER_STATE_TREE_HEADER],\n headers[NEXT_URL],\n ].join(',')\n )\n\n try {\n let fetchUrl = new URL(url)\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n if (fetchUrl.pathname.endsWith('/')) {\n fetchUrl.pathname += 'index.txt'\n } else {\n fetchUrl.pathname += '.txt'\n }\n }\n }\n\n // Add unique cache query to avoid caching conflicts on CDN which don't respect the Vary header\n fetchUrl.searchParams.set(NEXT_RSC_UNION_QUERY, uniqueCacheQuery)\n\n // When creating a \"temporary\" prefetch (the \"on-demand\" prefetch that gets created on navigation, if one doesn't exist)\n // we send the request with a \"high\" priority as it's in response to a user interaction that could be blocking a transition.\n // Otherwise, all other prefetches are sent with a \"low\" priority.\n // We use \"auto\" for in all other cases to match the existing default, as this function is shared outside of prefetching.\n const fetchPriority = prefetchKind\n ? prefetchKind === PrefetchKind.TEMPORARY\n ? 'high'\n : 'low'\n : 'auto'\n\n if (process.env.__NEXT_TEST_MODE) {\n headers['Next-Test-Fetch-Priority'] = fetchPriority\n }\n\n const res = await fetch(fetchUrl, {\n // Backwards compat for older browsers. `same-origin` is the default in modern browsers.\n credentials: 'same-origin',\n headers,\n priority: fetchPriority,\n })\n\n const responseUrl = urlToUrlWithoutFlightMarker(res.url)\n const canonicalUrl = res.redirected ? responseUrl : undefined\n\n const contentType = res.headers.get('content-type') || ''\n const interception = !!res.headers.get('vary')?.includes(NEXT_URL)\n const postponed = !!res.headers.get(NEXT_DID_POSTPONE_HEADER)\n const staleTimeHeader = res.headers.get(NEXT_ROUTER_STALE_TIME_HEADER)\n const staleTime =\n staleTimeHeader !== null ? parseInt(staleTimeHeader, 10) : -1\n let isFlightResponse = contentType.startsWith(RSC_CONTENT_TYPE_HEADER)\n\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n if (!isFlightResponse) {\n isFlightResponse = contentType.startsWith('text/plain')\n }\n }\n }\n\n // If fetch returns something different than flight response handle it like a mpa navigation\n // If the fetch was not 200, we also handle it like a mpa navigation\n if (!isFlightResponse || !res.ok || !res.body) {\n // in case the original URL came with a hash, preserve it before redirecting to the new URL\n if (url.hash) {\n responseUrl.hash = url.hash\n }\n\n return doMpaNavigation(responseUrl.toString())\n }\n\n // We may navigate to a page that requires a different Webpack runtime.\n // In prod, every page will have the same Webpack runtime.\n // In dev, the Webpack runtime is minimal for each page.\n // We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.\n if (process.env.NODE_ENV !== 'production' && !process.env.TURBOPACK) {\n await require('../react-dev-overlay/app/hot-reloader-client').waitForWebpackRuntimeHotUpdate()\n }\n\n // Handle the `fetch` readable stream that can be unwrapped by `React.use`.\n const flightStream = postponed\n ? createUnclosingPrefetchStream(res.body)\n : res.body\n const response: NavigationFlightResponse = await createFromReadableStream(\n flightStream,\n { callServer, findSourceMapURL }\n )\n\n if (buildId !== response.b) {\n return doMpaNavigation(res.url)\n }\n\n return {\n flightData: normalizeFlightData(response.f),\n canonicalUrl: canonicalUrl,\n couldBeIntercepted: interception,\n prerendered: response.S,\n postponed,\n staleTime,\n }\n } catch (err) {\n console.error(\n `Failed to fetch RSC payload for ${url}. Falling back to browser navigation.`,\n err\n )\n // If fetch fails handle it like a mpa navigation\n // TODO-APP: Add a test for the case where a CORS request fails, e.g. external url redirect coming from the response.\n // See https://github.com/vercel/next.js/issues/43605#issuecomment-1451617521 for a reproduction.\n return {\n flightData: url.toString(),\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n staleTime: -1,\n }\n }\n}\n\nfunction createUnclosingPrefetchStream(\n originalFlightStream: ReadableStream\n): ReadableStream {\n // When PPR is enabled, prefetch streams may contain references that never\n // resolve, because that's how we encode dynamic data access. In the decoded\n // object returned by the Flight client, these are reified into hanging\n // promises that suspend during render, which is effectively what we want.\n // The UI resolves when it switches to the dynamic data stream\n // (via useDeferredValue(dynamic, static)).\n //\n // However, the Flight implementation currently errors if the server closes\n // the response before all the references are resolved. As a cheat to work\n // around this, we wrap the original stream in a new stream that never closes,\n // and therefore doesn't error.\n const reader = originalFlightStream.getReader()\n return new ReadableStream({\n async pull(controller) {\n while (true) {\n const { done, value } = await reader.read()\n if (!done) {\n // Pass to the target stream and keep consuming the Flight response\n // from the server.\n controller.enqueue(value)\n continue\n }\n // The server stream has closed. Exit, but intentionally do not close\n // the target stream.\n return\n }\n },\n })\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { Segment } from '../../../server/app-render/types'\nimport { invalidateCacheByRouterState } from './invalidate-cache-by-router-state'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport type { PrefetchCacheEntry } from './router-reducer-types'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\n\n/**\n * Common logic for filling cache with new sub tree data.\n */\nfunction fillCacheHelper(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry: PrefetchCacheEntry | undefined,\n fillLazyItems: boolean\n): void {\n const {\n segmentPath,\n seedData: cacheNodeSeedData,\n tree: treePatch,\n head,\n } = flightData\n let newCacheNode = newCache\n let existingCacheNode = existingCache\n\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: Segment = segmentPath[i + 1]\n\n // segmentPath is a repeating tuple of parallelRouteKey and segment\n // we know we've hit the last entry we've reached our final pair\n const isLastEntry = i === segmentPath.length - 2\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCacheNode.parallelRoutes.get(parallelRouteKey)\n\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n continue\n }\n\n let childSegmentMap = newCacheNode.parallelRoutes.get(parallelRouteKey)\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCacheNode.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n if (isLastEntry) {\n if (\n cacheNodeSeedData &&\n (!childCacheNode ||\n !childCacheNode.lazyData ||\n childCacheNode === existingChildCacheNode)\n ) {\n const incomingSegment = cacheNodeSeedData[0]\n const rsc = cacheNodeSeedData[1]\n const loading = cacheNodeSeedData[3]\n\n childCacheNode = {\n lazyData: null,\n // When `fillLazyItems` is false, we only want to fill the RSC data for the layout,\n // not the page segment.\n rsc:\n fillLazyItems || incomingSegment !== PAGE_SEGMENT_KEY ? rsc : null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n parallelRoutes:\n fillLazyItems && existingChildCacheNode\n ? new Map(existingChildCacheNode.parallelRoutes)\n : new Map(),\n }\n\n if (existingChildCacheNode && fillLazyItems) {\n invalidateCacheByRouterState(\n childCacheNode,\n existingChildCacheNode,\n treePatch\n )\n }\n if (fillLazyItems) {\n fillLazyItemsTillLeafWithHead(\n childCacheNode,\n existingChildCacheNode,\n treePatch,\n cacheNodeSeedData,\n head,\n prefetchEntry\n )\n }\n\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n continue\n }\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n continue\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n loading: childCacheNode.loading,\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n // Move deeper into the cache nodes\n newCacheNode = childCacheNode\n existingCacheNode = existingChildCacheNode\n }\n}\n\n/**\n * Fill cache with rsc based on flightDataPath\n */\nexport function fillCacheWithNewSubTreeData(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n fillCacheHelper(newCache, existingCache, flightData, prefetchEntry, true)\n}\n\nexport function fillCacheWithNewSubTreeDataButOnlyLoading(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n fillCacheHelper(newCache, existingCache, flightData, prefetchEntry, false)\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n CacheNodeSeedData,\n} from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport {\n PrefetchCacheEntryStatus,\n type PrefetchCacheEntry,\n} from './router-reducer-types'\n\nexport function fillLazyItemsTillLeafWithHead(\n newCache: CacheNode,\n existingCache: CacheNode | undefined,\n routerState: FlightRouterState,\n cacheNodeSeedData: CacheNodeSeedData | null,\n head: React.ReactNode,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n const isLastSegment = Object.keys(routerState[1]).length === 0\n if (isLastSegment) {\n newCache.head = head\n return\n }\n // Remove segment that we got data for so that it is filled in during rendering of rsc.\n for (const key in routerState[1]) {\n const parallelRouteState = routerState[1][key]\n const segmentForParallelRoute = parallelRouteState[0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n\n // TODO: We should traverse the cacheNodeSeedData tree instead of the router\n // state tree. Ideally, they would always be the same shape, but because of\n // the loading.js pattern, cacheNodeSeedData sometimes only represents a\n // partial tree. That's why this node is sometimes null. Once PPR lands,\n // loading.js will no longer have special behavior and we can traverse the\n // data tree instead.\n //\n // We should also consider merging the router state tree and the data tree\n // in the response format, so that we don't have to send the keys twice.\n // Then the client can convert them into separate representations.\n const parallelSeedData =\n cacheNodeSeedData !== null && cacheNodeSeedData[2][key] !== undefined\n ? cacheNodeSeedData[2][key]\n : null\n if (existingCache) {\n const existingParallelRoutesCacheNode =\n existingCache.parallelRoutes.get(key)\n if (existingParallelRoutesCacheNode) {\n const hasReusablePrefetch =\n prefetchEntry?.kind === 'auto' &&\n prefetchEntry.status === PrefetchCacheEntryStatus.reusable\n\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode)\n const existingCacheNode = parallelRouteCacheNode.get(cacheKey)\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n // This is a PPR-only field. When PPR is enabled, we shouldn't hit\n // this path during a navigation, but until PPR is fully implemented\n // yet it's possible the existing node does have a non-null\n // `prefetchRsc`. As an incremental step, we'll just de-opt to the\n // old behavior — no PPR value.\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n }\n } else if (hasReusablePrefetch && existingCacheNode) {\n // No new data was sent from the server, but the existing cache node\n // was prefetched, so we should reuse that.\n newCacheNode = {\n lazyData: existingCacheNode.lazyData,\n rsc: existingCacheNode.rsc,\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n prefetchRsc: existingCacheNode.prefetchRsc,\n head: existingCacheNode.head,\n prefetchHead: existingCacheNode.prefetchHead,\n parallelRoutes: new Map(existingCacheNode.parallelRoutes),\n loading: existingCacheNode.loading,\n } as CacheNode\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n loading: null,\n }\n }\n\n // Overrides the cache key with the new cache node.\n parallelRouteCacheNode.set(cacheKey, newCacheNode)\n // Traverse deeper to apply the head / fill lazy items till the head.\n fillLazyItemsTillLeafWithHead(\n newCacheNode,\n existingCacheNode,\n parallelRouteState,\n parallelSeedData ? parallelSeedData : null,\n head,\n prefetchEntry\n )\n\n newCache.parallelRoutes.set(key, parallelRouteCacheNode)\n continue\n }\n }\n\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n }\n\n const existingParallelRoutes = newCache.parallelRoutes.get(key)\n if (existingParallelRoutes) {\n existingParallelRoutes.set(cacheKey, newCacheNode)\n } else {\n newCache.parallelRoutes.set(key, new Map([[cacheKey, newCacheNode]]))\n }\n\n fillLazyItemsTillLeafWithHead(\n newCacheNode,\n undefined,\n parallelRouteState,\n parallelSeedData,\n head,\n prefetchEntry\n )\n }\n}\n","import { computeChangedPath } from './compute-changed-path'\nimport type {\n Mutable,\n ReadonlyReducerState,\n ReducerState,\n} from './router-reducer-types'\n\nfunction isNotUndefined(value: T): value is Exclude {\n return typeof value !== 'undefined'\n}\n\nexport function handleMutable(\n state: ReadonlyReducerState,\n mutable: Mutable\n): ReducerState {\n // shouldScroll is true by default, can override to false.\n const shouldScroll = mutable.shouldScroll ?? true\n\n let nextUrl = state.nextUrl\n\n if (isNotUndefined(mutable.patchedTree)) {\n // If we received a patched tree, we need to compute the changed path.\n const changedPath = computeChangedPath(state.tree, mutable.patchedTree)\n if (changedPath) {\n // If the tree changed, we need to update the nextUrl\n nextUrl = changedPath\n } else if (!nextUrl) {\n // if the tree ends up being the same (ie, no changed path), and we don't have a nextUrl, then we should use the canonicalUrl\n nextUrl = state.canonicalUrl\n }\n // otherwise this will be a no-op and continue to use the existing nextUrl\n }\n\n return {\n buildId: state.buildId,\n // Set href.\n canonicalUrl: isNotUndefined(mutable.canonicalUrl)\n ? mutable.canonicalUrl === state.canonicalUrl\n ? state.canonicalUrl\n : mutable.canonicalUrl\n : state.canonicalUrl,\n pushRef: {\n pendingPush: isNotUndefined(mutable.pendingPush)\n ? mutable.pendingPush\n : state.pushRef.pendingPush,\n mpaNavigation: isNotUndefined(mutable.mpaNavigation)\n ? mutable.mpaNavigation\n : state.pushRef.mpaNavigation,\n preserveCustomHistoryState: isNotUndefined(\n mutable.preserveCustomHistoryState\n )\n ? mutable.preserveCustomHistoryState\n : state.pushRef.preserveCustomHistoryState,\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: shouldScroll\n ? isNotUndefined(mutable?.scrollableSegments)\n ? true\n : state.focusAndScrollRef.apply\n : // If shouldScroll is false then we should not apply scroll and focus management.\n false,\n onlyHashChange: mutable.onlyHashChange || false,\n hashFragment: shouldScroll\n ? // Empty hash should trigger default behavior of scrolling layout into view.\n // #top is handled in layout-router.\n mutable.hashFragment && mutable.hashFragment !== ''\n ? // Remove leading # and decode hash to make non-latin hashes work.\n decodeURIComponent(mutable.hashFragment.slice(1))\n : state.focusAndScrollRef.hashFragment\n : // If shouldScroll is false then we should not apply scroll and focus management.\n null,\n segmentPaths: shouldScroll\n ? mutable?.scrollableSegments ?? state.focusAndScrollRef.segmentPaths\n : // If shouldScroll is false then we should not apply scroll and focus management.\n [],\n },\n // Apply cache.\n cache: mutable.cache ? mutable.cache : state.cache,\n prefetchCache: mutable.prefetchCache\n ? mutable.prefetchCache\n : state.prefetchCache,\n // Apply patched router state.\n tree: isNotUndefined(mutable.patchedTree)\n ? mutable.patchedTree\n : state.tree,\n nextUrl,\n }\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\nimport { handleExternalUrl } from './reducers/navigate-reducer'\nimport type {\n ReadonlyReducerState,\n ReducerActions,\n} from './router-reducer-types'\n\n/**\n * Handles the case where the client router attempted to patch the tree but, due to a mismatch, the patch failed.\n * This will perform an MPA navigation to return the router to a valid state.\n */\nexport function handleSegmentMismatch(\n state: ReadonlyReducerState,\n action: ReducerActions,\n treePatch: FlightRouterState\n) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Performing hard navigation because your application experienced an unrecoverable error. If this keeps occurring, please file a Next.js issue.\\n\\n' +\n 'Reason: Segment mismatch\\n' +\n `Last Action: ${action.type}\\n\\n` +\n `Current Tree: ${JSON.stringify(state.tree)}\\n\\n` +\n `Tree Patch Payload: ${JSON.stringify(treePatch)}`\n )\n }\n\n return handleExternalUrl(state, {}, state.canonicalUrl, true)\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightSegmentPath } from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\n\n/**\n * Fill cache up to the end of the flightSegmentPath, invalidating anything below it.\n */\nexport function invalidateCacheBelowFlightSegmentPath(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightSegmentPath: FlightSegmentPath\n): void {\n const isLastEntry = flightSegmentPath.length <= 2\n const [parallelRouteKey, segment] = flightSegmentPath\n\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCache.parallelRoutes.get(parallelRouteKey)\n\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return\n }\n\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey)\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n // In case of last entry don't copy further down.\n if (isLastEntry) {\n childSegmentMap.delete(cacheKey)\n return\n }\n\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n invalidateCacheBelowFlightSegmentPath(\n childCacheNode,\n existingChildCacheNode,\n getNextFlightSegmentPath(flightSegmentPath)\n )\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightRouterState } from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\n\n/**\n * Invalidate cache one level down from the router state.\n */\nexport function invalidateCacheByRouterState(\n newCache: CacheNode,\n existingCache: CacheNode,\n routerState: FlightRouterState\n): void {\n // Remove segment that we got data for so that it is filled in during rendering of rsc.\n for (const key in routerState[1]) {\n const segmentForParallelRoute = routerState[1][key][0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n const existingParallelRoutesCacheNode =\n existingCache.parallelRoutes.get(key)\n if (existingParallelRoutesCacheNode) {\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode)\n parallelRouteCacheNode.delete(cacheKey)\n newCache.parallelRoutes.set(key, parallelRouteCacheNode)\n }\n }\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\n\nexport function isNavigatingToNewRootLayout(\n currentTree: FlightRouterState,\n nextTree: FlightRouterState\n): boolean {\n // Compare segments\n const currentTreeSegment = currentTree[0]\n const nextTreeSegment = nextTree[0]\n\n // If any segment is different before we find the root layout, the root layout has changed.\n // E.g. /same/(group1)/layout.js -> /same/(group2)/layout.js\n // First segment is 'same' for both, keep looking. (group1) changed to (group2) before the root layout was found, it must have changed.\n if (Array.isArray(currentTreeSegment) && Array.isArray(nextTreeSegment)) {\n // Compare dynamic param name and type but ignore the value, different values would not affect the current root layout\n // /[name] - /slug1 and /slug2, both values (slug1 & slug2) still has the same layout /[name]/layout.js\n if (\n currentTreeSegment[0] !== nextTreeSegment[0] ||\n currentTreeSegment[2] !== nextTreeSegment[2]\n ) {\n return true\n }\n } else if (currentTreeSegment !== nextTreeSegment) {\n return true\n }\n\n // Current tree root layout found\n if (currentTree[4]) {\n // If the next tree doesn't have the root layout flag, it must have changed.\n return !nextTree[4]\n }\n // Current tree didn't have its root layout here, must have changed.\n if (nextTree[4]) {\n return true\n }\n // We can't assume it's `parallelRoutes.children` here in case the root layout is `app/@something/layout.js`\n // But it's not possible to be more than one parallelRoutes before the root layout is found\n // TODO-APP: change to traverse all parallel routes\n const currentTreeChild = Object.values(currentTree[1])[0]\n const nextTreeChild = Object.values(nextTree[1])[0]\n if (!currentTreeChild || !nextTreeChild) return true\n return isNavigatingToNewRootLayout(currentTreeChild, nextTreeChild)\n}\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../../../server/app-render/types'\nimport type {\n CacheNode,\n ChildSegmentMap,\n ReadyCacheNode,\n} from '../../../shared/lib/app-router-context.shared-runtime'\nimport { DEFAULT_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\n// This is yet another tree type that is used to track pending promises that\n// need to be fulfilled once the dynamic data is received. The terminal nodes of\n// this tree represent the new Cache Node trees that were created during this\n// request. We can't use the Cache Node tree or Route State tree directly\n// because those include reused nodes, too. This tree is discarded as soon as\n// the navigation response is received.\ntype Task = {\n // The router state that corresponds to the tree that this Task represents.\n route: FlightRouterState\n // This is usually non-null. It represents a brand new Cache Node tree whose\n // data is still pending. If it's null, it means there's no pending data but\n // the client patched the router state.\n node: CacheNode | null\n children: Map | null\n}\n\n// Creates a new Cache Node tree (i.e. copy-on-write) that represents the\n// optimistic result of a navigation, using both the current Cache Node tree and\n// data that was prefetched prior to navigation.\n//\n// At the moment we call this function, we haven't yet received the navigation\n// response from the server. It could send back something completely different\n// from the tree that was prefetched — due to rewrites, default routes, parallel\n// routes, etc.\n//\n// But in most cases, it will return the same tree that we prefetched, just with\n// the dynamic holes filled in. So we optimistically assume this will happen,\n// and accept that the real result could be arbitrarily different.\n//\n// We'll reuse anything that was already in the previous tree, since that's what\n// the server does.\n//\n// New segments (ones that don't appear in the old tree) are assigned an\n// unresolved promise. The data for these promises will be fulfilled later, when\n// the navigation response is received.\n//\n// The tree can be rendered immediately after it is created (that's why this is\n// a synchronous function). Any new trees that do not have prefetch data will\n// suspend during rendering, until the dynamic data streams in.\n//\n// Returns a Task object, which contains both the updated Cache Node and a path\n// to the pending subtrees that need to be resolved by the navigation response.\n//\n// A return value of `null` means there were no changes, and the previous tree\n// can be reused without initiating a server request.\nexport function updateCacheNodeOnNavigation(\n oldCacheNode: CacheNode,\n oldRouterState: FlightRouterState,\n newRouterState: FlightRouterState,\n prefetchData: CacheNodeSeedData,\n prefetchHead: React.ReactNode\n): Task | null {\n // Diff the old and new trees to reuse the shared layouts.\n const oldRouterStateChildren = oldRouterState[1]\n const newRouterStateChildren = newRouterState[1]\n const prefetchDataChildren = prefetchData[2]\n\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n\n // Clone the current set of segment children, even if they aren't active in\n // the new tree.\n // TODO: We currently retain all the inactive segments indefinitely, until\n // there's an explicit refresh, or a parent layout is lazily refreshed. We\n // rely on this for popstate navigations, which update the Router State Tree\n // but do not eagerly perform a data fetch, because they expect the segment\n // data to already be in the Cache Node tree. For highly static sites that\n // are mostly read-only, this may happen only rarely, causing memory to\n // leak. We should figure out a better model for the lifetime of inactive\n // segments, so we can maintain instant back/forward navigations without\n // leaking memory indefinitely.\n const prefetchParallelRoutes = new Map(oldParallelRoutes)\n\n // As we diff the trees, we may sometimes modify (copy-on-write, not mutate)\n // the Route Tree that was returned by the server — for example, in the case\n // of default parallel routes, we preserve the currently active segment. To\n // avoid mutating the original tree, we clone the router state children along\n // the return path.\n let patchedRouterStateChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n let taskChildren = null\n\n // For most navigations, we need to issue a \"dynamic\" request to fetch the\n // full RSC data from the server since during rendering, we'll only serve\n // the prefetch shell. For some navigations, we re-use the existing cache node\n // (via `spawnReusedTask`), and don't actually need fresh data from the server.\n // In those cases, we use this `needsDynamicRequest` flag to return a `null`\n // cache node, which signals to the caller that we don't need to issue a\n // dynamic request. We start off with a `false` value, and then for each parallel\n // route, we set it to `true` if we encounter a segment that needs a dynamic request.\n let needsDynamicRequest = false\n\n for (let parallelRouteKey in newRouterStateChildren) {\n const newRouterStateChild: FlightRouterState =\n newRouterStateChildren[parallelRouteKey]\n const oldRouterStateChild: FlightRouterState | void =\n oldRouterStateChildren[parallelRouteKey]\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n const prefetchDataChild: CacheNodeSeedData | void | null =\n prefetchDataChildren[parallelRouteKey]\n\n const newSegmentChild = newRouterStateChild[0]\n const newSegmentKeyChild = createRouterCacheKey(newSegmentChild)\n\n const oldSegmentChild =\n oldRouterStateChild !== undefined ? oldRouterStateChild[0] : undefined\n\n const oldCacheNodeChild =\n oldSegmentMapChild !== undefined\n ? oldSegmentMapChild.get(newSegmentKeyChild)\n : undefined\n\n let taskChild: Task | null\n if (newSegmentChild === DEFAULT_SEGMENT_KEY) {\n // This is another kind of leaf segment — a default route.\n //\n // Default routes have special behavior. When there's no matching segment\n // for a parallel route, Next.js preserves the currently active segment\n // during a client navigation — but not for initial render. The server\n // leaves it to the client to account for this. So we need to handle\n // it here.\n if (oldRouterStateChild !== undefined) {\n // Reuse the existing Router State for this segment. We spawn a \"task\"\n // just to keep track of the updated router state; unlike most, it's\n // already fulfilled and won't be affected by the dynamic response.\n taskChild = spawnReusedTask(oldRouterStateChild)\n } else {\n // There's no currently active segment. Switch to the \"create\" path.\n taskChild = spawnPendingTask(\n newRouterStateChild,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead\n )\n }\n } else if (\n oldSegmentChild !== undefined &&\n matchSegment(newSegmentChild, oldSegmentChild)\n ) {\n if (\n oldCacheNodeChild !== undefined &&\n oldRouterStateChild !== undefined\n ) {\n // This segment exists in both the old and new trees.\n if (prefetchDataChild !== undefined && prefetchDataChild !== null) {\n // Recursively update the children.\n taskChild = updateCacheNodeOnNavigation(\n oldCacheNodeChild,\n oldRouterStateChild,\n newRouterStateChild,\n prefetchDataChild,\n prefetchHead\n )\n } else {\n // The server didn't send any prefetch data for this segment. This\n // shouldn't happen because the Route Tree and the Seed Data tree\n // should always be the same shape, but until we unify those types\n // it's still possible. For now we're going to deopt and trigger a\n // lazy fetch during render.\n taskChild = spawnTaskForMissingData(newRouterStateChild)\n }\n } else {\n // Either there's no existing Cache Node for this segment, or this\n // segment doesn't exist in the old Router State tree. Switch to the\n // \"create\" path.\n taskChild = spawnPendingTask(\n newRouterStateChild,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead\n )\n }\n } else {\n // This is a new tree. Switch to the \"create\" path.\n taskChild = spawnPendingTask(\n newRouterStateChild,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead\n )\n }\n\n if (taskChild !== null) {\n // Something changed in the child tree. Keep track of the child task.\n if (taskChildren === null) {\n taskChildren = new Map()\n }\n taskChildren.set(parallelRouteKey, taskChild)\n const newCacheNodeChild = taskChild.node\n if (newCacheNodeChild !== null) {\n const newSegmentMapChild: ChildSegmentMap = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(newSegmentKeyChild, newCacheNodeChild)\n prefetchParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n // a non-null taskChild.node means we're waiting for a dynamic request to\n // fill in the missing data\n needsDynamicRequest = true\n }\n\n // The child tree's route state may be different from the prefetched\n // route sent by the server. We need to clone it as we traverse back up\n // the tree.\n patchedRouterStateChildren[parallelRouteKey] = taskChild.route\n } else {\n // The child didn't change. We can use the prefetched router state.\n patchedRouterStateChildren[parallelRouteKey] = newRouterStateChild\n }\n }\n\n if (taskChildren === null) {\n // No new tasks were spawned.\n return null\n }\n\n const newCacheNode: ReadyCacheNode = {\n lazyData: null,\n rsc: oldCacheNode.rsc,\n // We intentionally aren't updating the prefetchRsc field, since this node\n // is already part of the current tree, because it would be weird for\n // prefetch data to be newer than the final data. It probably won't ever be\n // observable anyway, but it could happen if the segment is unmounted then\n // mounted again, because LayoutRouter will momentarily switch to rendering\n // prefetchRsc, via useDeferredValue.\n prefetchRsc: oldCacheNode.prefetchRsc,\n head: oldCacheNode.head,\n prefetchHead: oldCacheNode.prefetchHead,\n loading: oldCacheNode.loading,\n\n // Everything is cloned except for the children, which we computed above.\n parallelRoutes: prefetchParallelRoutes,\n }\n\n return {\n // Return a cloned copy of the router state with updated children.\n route: patchRouterStateWithNewChildren(\n newRouterState,\n patchedRouterStateChildren\n ),\n // Only return the new cache node if there are pending tasks that need to be resolved\n // by the dynamic data from the server. If they don't, we don't need to trigger a dynamic request.\n node: needsDynamicRequest ? newCacheNode : null,\n children: taskChildren,\n }\n}\n\nfunction patchRouterStateWithNewChildren(\n baseRouterState: FlightRouterState,\n newChildren: { [parallelRouteKey: string]: FlightRouterState }\n): FlightRouterState {\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n\nfunction spawnPendingTask(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: React.ReactNode\n): Task {\n // Create a task that will later be fulfilled by data from the server.\n const pendingCacheNode = createPendingCacheNode(\n routerState,\n prefetchData,\n prefetchHead\n )\n return {\n route: routerState,\n node: pendingCacheNode,\n children: null,\n }\n}\n\nfunction spawnReusedTask(reusedRouterState: FlightRouterState): Task {\n // Create a task that reuses an existing segment, e.g. when reusing\n // the current active segment in place of a default route.\n return {\n route: reusedRouterState,\n node: null,\n children: null,\n }\n}\n\nfunction spawnTaskForMissingData(routerState: FlightRouterState): Task {\n // Create a task for a new subtree that wasn't prefetched by the server.\n // This shouldn't really ever happen but it's here just in case the Seed Data\n // Tree and the Router State Tree disagree unexpectedly.\n const pendingCacheNode = createPendingCacheNode(routerState, null, null)\n return {\n route: routerState,\n node: pendingCacheNode,\n children: null,\n }\n}\n\n// Writes a dynamic server response into the tree created by\n// updateCacheNodeOnNavigation. All pending promises that were spawned by the\n// navigation will be resolved, either with dynamic data from the server, or\n// `null` to indicate that the data is missing.\n//\n// A `null` value will trigger a lazy fetch during render, which will then patch\n// up the tree using the same mechanism as the non-PPR implementation\n// (serverPatchReducer).\n//\n// Usually, the server will respond with exactly the subset of data that we're\n// waiting for — everything below the nearest shared layout. But technically,\n// the server can return anything it wants.\n//\n// This does _not_ create a new tree; it modifies the existing one in place.\n// Which means it must follow the Suspense rules of cache safety.\nexport function listenForDynamicRequest(\n task: Task,\n responsePromise: Promise\n) {\n responsePromise.then(\n ({ flightData }: FetchServerResponseResult) => {\n for (const normalizedFlightData of flightData) {\n if (typeof normalizedFlightData === 'string') {\n // Happens when navigating to page in `pages` from `app`. We shouldn't\n // get here because should have already handled this during\n // the prefetch.\n continue\n }\n\n const {\n segmentPath,\n tree: serverRouterState,\n seedData: dynamicData,\n head: dynamicHead,\n } = normalizedFlightData\n\n if (!dynamicData) {\n // This shouldn't happen. PPR should always send back a response.\n // However, `FlightDataPath` is a shared type and the pre-PPR handling of\n // this might return null.\n continue\n }\n\n writeDynamicDataIntoPendingTask(\n task,\n segmentPath,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n }\n\n // Now that we've exhausted all the data we received from the server, if\n // there are any remaining pending tasks in the tree, abort them now.\n // If there's any missing data, it will trigger a lazy fetch.\n abortTask(task, null)\n },\n (error: any) => {\n // This will trigger an error during render\n abortTask(task, error)\n }\n )\n}\n\nfunction writeDynamicDataIntoPendingTask(\n rootTask: Task,\n segmentPath: FlightSegmentPath,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: React.ReactNode\n) {\n // The data sent by the server represents only a subtree of the app. We need\n // to find the part of the task tree that matches the server response, and\n // fulfill it using the dynamic data.\n //\n // segmentPath represents the parent path of subtree. It's a repeating pattern\n // of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // Iterate through the path and finish any tasks that match this payload.\n let task = rootTask\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: Segment = segmentPath[i + 1]\n const taskChildren = task.children\n if (taskChildren !== null) {\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (matchSegment(segment, taskSegment)) {\n // Found a match for this task. Keep traversing down the task tree.\n task = taskChild\n continue\n }\n }\n }\n // We didn't find a child task that matches the server data. Exit. We won't\n // abort the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n return\n }\n\n finishTaskUsingDynamicDataPayload(\n task,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n}\n\nfunction finishTaskUsingDynamicDataPayload(\n task: Task,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: React.ReactNode\n) {\n // dynamicData may represent a larger subtree than the task. Before we can\n // finish the task, we need to line them up.\n const taskChildren = task.children\n const taskNode = task.node\n if (taskChildren === null) {\n // We've reached the leaf node of the pending task. The server data tree\n // lines up the pending Cache Node tree. We can now switch to the\n // normal algorithm.\n if (taskNode !== null) {\n finishPendingCacheNode(\n taskNode,\n task.route,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n // Null this out to indicate that the task is complete.\n task.node = null\n }\n return\n }\n // The server returned more data than we need to finish the task. Skip over\n // the extra segments until we reach the leaf task node.\n const serverChildren = serverRouterState[1]\n const dynamicDataChildren = dynamicData[2]\n\n for (const parallelRouteKey in serverRouterState) {\n const serverRouterStateChild: FlightRouterState =\n serverChildren[parallelRouteKey]\n const dynamicDataChild: CacheNodeSeedData | null | void =\n dynamicDataChildren[parallelRouteKey]\n\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (\n matchSegment(serverRouterStateChild[0], taskSegment) &&\n dynamicDataChild !== null &&\n dynamicDataChild !== undefined\n ) {\n // Found a match for this task. Keep traversing down the task tree.\n return finishTaskUsingDynamicDataPayload(\n taskChild,\n serverRouterStateChild,\n dynamicDataChild,\n dynamicHead\n )\n }\n }\n // We didn't find a child task that matches the server data. We won't abort\n // the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n }\n}\n\nfunction createPendingCacheNode(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: React.ReactNode\n): ReadyCacheNode {\n const routerStateChildren = routerState[1]\n const prefetchDataChildren = prefetchData !== null ? prefetchData[2] : null\n\n const parallelRoutes = new Map()\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const prefetchDataChild: CacheNodeSeedData | null | void =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n\n const newCacheNodeChild = createPendingCacheNode(\n routerStateChild,\n prefetchDataChild === undefined ? null : prefetchDataChild,\n prefetchHead\n )\n\n const newSegmentMapChild: ChildSegmentMap = new Map()\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n parallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n\n // The head is assigned to every leaf segment delivered by the server. Based\n // on corresponding logic in fill-lazy-items-till-leaf-with-head.ts\n const isLeafSegment = parallelRoutes.size === 0\n\n const maybePrefetchRsc = prefetchData !== null ? prefetchData[1] : null\n const maybePrefetchLoading = prefetchData !== null ? prefetchData[3] : null\n return {\n lazyData: null,\n parallelRoutes: parallelRoutes,\n\n prefetchRsc: maybePrefetchRsc !== undefined ? maybePrefetchRsc : null,\n prefetchHead: isLeafSegment ? prefetchHead : null,\n loading: maybePrefetchLoading !== undefined ? maybePrefetchLoading : null,\n\n // Create a deferred promise. This will be fulfilled once the dynamic\n // response is received from the server.\n rsc: createDeferredRsc() as React.ReactNode,\n head: isLeafSegment ? (createDeferredRsc() as React.ReactNode) : null,\n }\n}\n\nfunction finishPendingCacheNode(\n cacheNode: CacheNode,\n taskState: FlightRouterState,\n serverState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: React.ReactNode\n): void {\n // Writes a dynamic response into an existing Cache Node tree. This does _not_\n // create a new tree, it updates the existing tree in-place. So it must follow\n // the Suspense rules of cache safety — it can resolve pending promises, but\n // it cannot overwrite existing data. It can add segments to the tree (because\n // a missing segment will cause the layout router to suspend).\n // but it cannot delete them.\n //\n // We must resolve every promise in the tree, or else it will suspend\n // indefinitely. If we did not receive data for a segment, we will resolve its\n // data promise to `null` to trigger a lazy fetch during render.\n const taskStateChildren = taskState[1]\n const serverStateChildren = serverState[1]\n const dataChildren = dynamicData[2]\n\n // The router state that we traverse the tree with (taskState) is the same one\n // that we used to construct the pending Cache Node tree. That way we're sure\n // to resolve all the pending promises.\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in taskStateChildren) {\n const taskStateChild: FlightRouterState =\n taskStateChildren[parallelRouteKey]\n const serverStateChild: FlightRouterState | void =\n serverStateChildren[parallelRouteKey]\n const dataChild: CacheNodeSeedData | null | void =\n dataChildren[parallelRouteKey]\n\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n const taskSegmentChild = taskStateChild[0]\n const taskSegmentKeyChild = createRouterCacheKey(taskSegmentChild)\n\n const cacheNodeChild =\n segmentMapChild !== undefined\n ? segmentMapChild.get(taskSegmentKeyChild)\n : undefined\n\n if (cacheNodeChild !== undefined) {\n if (\n serverStateChild !== undefined &&\n matchSegment(taskSegmentChild, serverStateChild[0])\n ) {\n if (dataChild !== undefined && dataChild !== null) {\n // This is the happy path. Recursively update all the children.\n finishPendingCacheNode(\n cacheNodeChild,\n taskStateChild,\n serverStateChild,\n dataChild,\n dynamicHead\n )\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render. This shouldn't happen because the Route Tree\n // and the Seed Data tree sent by the server should always be the same\n // shape when part of the same server response.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null)\n }\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null)\n }\n } else {\n // The server response matches what was expected to receive, but there's\n // no matching Cache Node in the task tree. This is a bug in the\n // implementation because we should have created a node for every\n // segment in the tree that's associated with this task.\n }\n }\n\n // Use the dynamic data from the server to fulfill the deferred RSC promise\n // on the Cache Node.\n const rsc = cacheNode.rsc\n const dynamicSegmentData = dynamicData[1]\n if (rsc === null) {\n // This is a lazy cache node. We can overwrite it. This is only safe\n // because we know that the LayoutRouter suspends if `rsc` is `null`.\n cacheNode.rsc = dynamicSegmentData\n } else if (isDeferredRsc(rsc)) {\n // This is a deferred RSC promise. We can fulfill it with the data we just\n // received from the server. If it was already resolved by a different\n // navigation, then this does nothing because we can't overwrite data.\n rsc.resolve(dynamicSegmentData)\n } else {\n // This is not a deferred RSC promise, nor is it empty, so it must have\n // been populated by a different navigation. We must not overwrite it.\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved with the dynamic head from\n // the server.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(dynamicHead)\n }\n}\n\nexport function abortTask(task: Task, error: any): void {\n const cacheNode = task.node\n if (cacheNode === null) {\n // This indicates the task is already complete.\n return\n }\n\n const taskChildren = task.children\n if (taskChildren === null) {\n // Reached the leaf task node. This is the root of a pending cache\n // node tree.\n abortPendingCacheNode(task.route, cacheNode, error)\n } else {\n // This is an intermediate task node. Keep traversing until we reach a\n // task node with no children. That will be the root of the cache node tree\n // that needs to be resolved.\n for (const taskChild of taskChildren.values()) {\n abortTask(taskChild, error)\n }\n }\n\n // Null this out to indicate that the task is complete.\n task.node = null\n}\n\nfunction abortPendingCacheNode(\n routerState: FlightRouterState,\n cacheNode: CacheNode,\n error: any\n): void {\n // For every pending segment in the tree, resolve its `rsc` promise to `null`\n // to trigger a lazy fetch during render.\n //\n // Or, if an error object is provided, it will error instead.\n const routerStateChildren = routerState[1]\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n if (segmentMapChild === undefined) {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n continue\n }\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const cacheNodeChild = segmentMapChild.get(segmentKeyChild)\n if (cacheNodeChild !== undefined) {\n abortPendingCacheNode(routerStateChild, cacheNodeChild, error)\n } else {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n }\n }\n const rsc = cacheNode.rsc\n if (isDeferredRsc(rsc)) {\n if (error === null) {\n // This will trigger a lazy fetch during render.\n rsc.resolve(null)\n } else {\n // This will trigger an error during rendering.\n rsc.reject(error)\n }\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved. If an error was provided, we\n // will not resolve it with an error, since this is rendered at the root of\n // the app. We want the segment to error, not the entire app.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(null)\n }\n}\n\nexport function updateCacheNodeOnPopstateRestoration(\n oldCacheNode: CacheNode,\n routerState: FlightRouterState\n) {\n // A popstate navigation reads data from the local cache. It does not issue\n // new network requests (unless the cache entries have been evicted). So, we\n // update the cache to drop the prefetch data for any segment whose dynamic\n // data was already received. This prevents an unnecessary flash back to PPR\n // state during a back/forward navigation.\n //\n // This function clones the entire cache node tree and sets the `prefetchRsc`\n // field to `null` to prevent it from being rendered. We can't mutate the node\n // in place because this is a concurrent data structure.\n\n const routerStateChildren = routerState[1]\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n const newParallelRoutes = new Map(oldParallelRoutes)\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n if (oldSegmentMapChild !== undefined) {\n const oldCacheNodeChild = oldSegmentMapChild.get(segmentKeyChild)\n if (oldCacheNodeChild !== undefined) {\n const newCacheNodeChild = updateCacheNodeOnPopstateRestoration(\n oldCacheNodeChild,\n routerStateChild\n )\n const newSegmentMapChild = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n newParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n }\n }\n\n // Only show prefetched data if the dynamic data is still pending.\n //\n // Tehnically, what we're actually checking is whether the dynamic network\n // response was received. But since it's a streaming response, this does not\n // mean that all the dynamic data has fully streamed in. It just means that\n // _some_ of the dynamic data was received. But as a heuristic, we assume that\n // the rest dynamic data will stream in quickly, so it's still better to skip\n // the prefetch state.\n const rsc = oldCacheNode.rsc\n const shouldUsePrefetch = isDeferredRsc(rsc) && rsc.status === 'pending'\n\n return {\n lazyData: null,\n rsc,\n head: oldCacheNode.head,\n\n prefetchHead: shouldUsePrefetch ? oldCacheNode.prefetchHead : null,\n prefetchRsc: shouldUsePrefetch ? oldCacheNode.prefetchRsc : null,\n loading: oldCacheNode.loading,\n\n // These are the cloned children we computed above\n parallelRoutes: newParallelRoutes,\n }\n}\n\nconst DEFERRED = Symbol()\n\ntype PendingDeferredRsc = Promise & {\n status: 'pending'\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype FulfilledDeferredRsc = Promise & {\n status: 'fulfilled'\n value: React.ReactNode\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype RejectedDeferredRsc = Promise & {\n status: 'rejected'\n reason: any\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype DeferredRsc =\n | PendingDeferredRsc\n | FulfilledDeferredRsc\n | RejectedDeferredRsc\n\n// This type exists to distinguish a DeferredRsc from a Flight promise. It's a\n// compromise to avoid adding an extra field on every Cache Node, which would be\n// awkward because the pre-PPR parts of codebase would need to account for it,\n// too. We can remove it once type Cache Node type is more settled.\nfunction isDeferredRsc(value: any): value is DeferredRsc {\n return value && value.tag === DEFERRED\n}\n\nfunction createDeferredRsc(): PendingDeferredRsc {\n let resolve: any\n let reject: any\n const pendingRsc = new Promise((res, rej) => {\n resolve = res\n reject = rej\n }) as PendingDeferredRsc\n pendingRsc.status = 'pending'\n pendingRsc.resolve = (value: React.ReactNode) => {\n if (pendingRsc.status === 'pending') {\n const fulfilledRsc: FulfilledDeferredRsc = pendingRsc as any\n fulfilledRsc.status = 'fulfilled'\n fulfilledRsc.value = value\n resolve(value)\n }\n }\n pendingRsc.reject = (error: any) => {\n if (pendingRsc.status === 'pending') {\n const rejectedRsc: RejectedDeferredRsc = pendingRsc as any\n rejectedRsc.status = 'rejected'\n rejectedRsc.reason = error\n reject(error)\n }\n }\n pendingRsc.tag = DEFERRED\n return pendingRsc\n}\n","import {\n fetchServerResponse,\n type FetchServerResponseResult,\n} from './fetch-server-response'\nimport {\n PrefetchCacheEntryStatus,\n type PrefetchCacheEntry,\n PrefetchKind,\n type ReadonlyReducerState,\n} from './router-reducer-types'\nimport { prefetchQueue } from './reducers/prefetch-reducer'\n\nconst INTERCEPTION_CACHE_KEY_MARKER = '%'\n\nexport type AliasedPrefetchCacheEntry = PrefetchCacheEntry & {\n /** This is a special property that indicates a prefetch entry associated with a different URL\n * was returned rather than the requested URL. This signals to the router that it should only\n * apply the part that doesn't depend on searchParams (specifically the loading state).\n */\n aliased?: boolean\n}\n\n/**\n * Creates a cache key for the router prefetch cache\n *\n * @param url - The URL being navigated to\n * @param nextUrl - an internal URL, primarily used for handling rewrites. Defaults to '/'.\n * @return The generated prefetch cache key.\n */\nfunction createPrefetchCacheKeyImpl(\n url: URL,\n includeSearchParams: boolean,\n prefix?: string | null\n) {\n // Initially we only use the pathname as the cache key. We don't want to include\n // search params so that multiple URLs with the same search parameter can re-use\n // loading states.\n let pathnameFromUrl = url.pathname\n\n // RSC responses can differ based on search params, specifically in the case where we aren't\n // returning a partial response (ie with `PrefetchKind.AUTO`).\n // In the auto case, since loading.js & layout.js won't have access to search params,\n // we can safely re-use that cache entry. But for full prefetches, we should not\n // re-use the cache entry as the response may differ.\n if (includeSearchParams) {\n // if we have a full prefetch, we can include the search param in the key,\n // as we'll be getting back a full response. The server might have read the search\n // params when generating the full response.\n pathnameFromUrl += url.search\n }\n\n if (prefix) {\n return `${prefix}${INTERCEPTION_CACHE_KEY_MARKER}${pathnameFromUrl}`\n }\n\n return pathnameFromUrl\n}\n\nfunction createPrefetchCacheKey(\n url: URL,\n kind: PrefetchKind | undefined,\n nextUrl?: string | null\n) {\n return createPrefetchCacheKeyImpl(url, kind === PrefetchKind.FULL, nextUrl)\n}\n\nfunction getExistingCacheEntry(\n url: URL,\n kind: PrefetchKind = PrefetchKind.TEMPORARY,\n nextUrl: string | null,\n prefetchCache: Map,\n allowAliasing: boolean\n): AliasedPrefetchCacheEntry | undefined {\n // We first check if there's a more specific interception route prefetch entry\n // This is because when we detect a prefetch that corresponds with an interception route, we prefix it with nextUrl (see `createPrefetchCacheKey`)\n // to avoid conflicts with other pages that may have the same URL but render different things depending on the `Next-URL` header.\n for (const maybeNextUrl of [nextUrl, null]) {\n const cacheKeyWithParams = createPrefetchCacheKeyImpl(\n url,\n true,\n maybeNextUrl\n )\n const cacheKeyWithoutParams = createPrefetchCacheKeyImpl(\n url,\n false,\n maybeNextUrl\n )\n\n // First, we check if we have a cache entry that exactly matches the URL\n const cacheKeyToUse = url.search\n ? cacheKeyWithParams\n : cacheKeyWithoutParams\n\n const existingEntry = prefetchCache.get(cacheKeyToUse)\n if (existingEntry && allowAliasing) {\n // We know we're returning an aliased entry when the pathname matches but the search params don't,\n const isAliased =\n existingEntry.url.pathname === url.pathname &&\n existingEntry.url.search !== url.search\n\n if (isAliased) {\n return {\n ...existingEntry,\n aliased: true,\n }\n }\n\n return existingEntry\n }\n\n // If the request contains search params, and we're not doing a full prefetch, we can return the\n // param-less entry if it exists.\n // This is technically covered by the check at the bottom of this function, which iterates over cache entries,\n // but lets us arrive there quicker in the param-full case.\n const entryWithoutParams = prefetchCache.get(cacheKeyWithoutParams)\n if (\n process.env.NODE_ENV !== 'development' &&\n allowAliasing &&\n url.search &&\n kind !== PrefetchKind.FULL &&\n entryWithoutParams &&\n // We shouldn't return the aliased entry if it was relocated to a new cache key.\n // Since it's rewritten, it could respond with a completely different loading state.\n !entryWithoutParams.key.includes(INTERCEPTION_CACHE_KEY_MARKER)\n ) {\n return { ...entryWithoutParams, aliased: true }\n }\n }\n\n // If we've gotten to this point, we didn't find a specific cache entry that matched\n // the request URL.\n // We attempt a partial match by checking if there's a cache entry with the same pathname.\n // Regardless of what we find, since it doesn't correspond with the requested URL, we'll mark it \"aliased\".\n // This will signal to the router that it should only apply the loading state on the prefetched data.\n if (\n process.env.NODE_ENV !== 'development' &&\n kind !== PrefetchKind.FULL &&\n allowAliasing\n ) {\n for (const cacheEntry of prefetchCache.values()) {\n if (\n cacheEntry.url.pathname === url.pathname &&\n // We shouldn't return the aliased entry if it was relocated to a new cache key.\n // Since it's rewritten, it could respond with a completely different loading state.\n !cacheEntry.key.includes(INTERCEPTION_CACHE_KEY_MARKER)\n ) {\n return { ...cacheEntry, aliased: true }\n }\n }\n }\n\n return undefined\n}\n\n/**\n * Returns a prefetch cache entry if one exists. Otherwise creates a new one and enqueues a fetch request\n * to retrieve the prefetch data from the server.\n */\nexport function getOrCreatePrefetchCacheEntry({\n url,\n nextUrl,\n tree,\n buildId,\n prefetchCache,\n kind,\n allowAliasing = true,\n}: Pick<\n ReadonlyReducerState,\n 'nextUrl' | 'prefetchCache' | 'tree' | 'buildId'\n> & {\n url: URL\n kind?: PrefetchKind\n allowAliasing: boolean\n}): AliasedPrefetchCacheEntry {\n const existingCacheEntry = getExistingCacheEntry(\n url,\n kind,\n nextUrl,\n prefetchCache,\n allowAliasing\n )\n\n if (existingCacheEntry) {\n // Grab the latest status of the cache entry and update it\n existingCacheEntry.status = getPrefetchEntryCacheStatus(existingCacheEntry)\n\n // when `kind` is provided, an explicit prefetch was requested.\n // if the requested prefetch is \"full\" and the current cache entry wasn't, we want to re-prefetch with the new intent\n const switchedToFullPrefetch =\n existingCacheEntry.kind !== PrefetchKind.FULL &&\n kind === PrefetchKind.FULL\n\n if (switchedToFullPrefetch) {\n // If we switched to a full prefetch, validate that the existing cache entry contained partial data.\n // It's possible that the cache entry was seeded with full data but has a cache type of \"auto\" (ie when cache entries\n // are seeded but without a prefetch intent)\n existingCacheEntry.data.then((prefetchResponse) => {\n const isFullPrefetch =\n Array.isArray(prefetchResponse.flightData) &&\n prefetchResponse.flightData.some((flightData) => {\n // If we started rendering from the root and we returned RSC data (seedData), we already had a full prefetch.\n return flightData.isRootRender && flightData.seedData !== null\n })\n\n if (!isFullPrefetch) {\n return createLazyPrefetchEntry({\n tree,\n url,\n buildId,\n nextUrl,\n prefetchCache,\n // If we didn't get an explicit prefetch kind, we want to set a temporary kind\n // rather than assuming the same intent as the previous entry, to be consistent with how we\n // lazily create prefetch entries when intent is left unspecified.\n kind: kind ?? PrefetchKind.TEMPORARY,\n })\n }\n })\n }\n\n // If the existing cache entry was marked as temporary, it means it was lazily created when attempting to get an entry,\n // where we didn't have the prefetch intent. Now that we have the intent (in `kind`), we want to update the entry to the more accurate kind.\n if (kind && existingCacheEntry.kind === PrefetchKind.TEMPORARY) {\n existingCacheEntry.kind = kind\n }\n\n // We've determined that the existing entry we found is still valid, so we return it.\n return existingCacheEntry\n }\n\n // If we didn't return an entry, create a new one.\n return createLazyPrefetchEntry({\n tree,\n url,\n buildId,\n nextUrl,\n prefetchCache,\n kind: kind || PrefetchKind.TEMPORARY,\n })\n}\n\n/*\n * Used to take an existing cache entry and prefix it with the nextUrl, if it exists.\n * This ensures that we don't have conflicting cache entries for the same URL (as is the case with route interception).\n */\nfunction prefixExistingPrefetchCacheEntry({\n url,\n nextUrl,\n prefetchCache,\n existingCacheKey,\n}: Pick & {\n url: URL\n existingCacheKey: string\n}) {\n const existingCacheEntry = prefetchCache.get(existingCacheKey)\n if (!existingCacheEntry) {\n // no-op -- there wasn't an entry to move\n return\n }\n\n const newCacheKey = createPrefetchCacheKey(\n url,\n existingCacheEntry.kind,\n nextUrl\n )\n prefetchCache.set(newCacheKey, { ...existingCacheEntry, key: newCacheKey })\n prefetchCache.delete(existingCacheKey)\n\n return newCacheKey\n}\n\n/**\n * Use to seed the prefetch cache with data that has already been fetched.\n */\nexport function createSeededPrefetchCacheEntry({\n nextUrl,\n tree,\n prefetchCache,\n url,\n data,\n kind,\n}: Pick & {\n url: URL\n data: FetchServerResponseResult\n kind: PrefetchKind\n}) {\n // The initial cache entry technically includes full data, but it isn't explicitly prefetched -- we just seed the\n // prefetch cache so that we can skip an extra prefetch request later, since we already have the data.\n // if the prefetch corresponds with an interception route, we use the nextUrl to prefix the cache key\n const prefetchCacheKey = data.couldBeIntercepted\n ? createPrefetchCacheKey(url, kind, nextUrl)\n : createPrefetchCacheKey(url, kind)\n\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data: Promise.resolve(data),\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: Date.now(),\n staleTime: -1,\n key: prefetchCacheKey,\n status: PrefetchCacheEntryStatus.fresh,\n url,\n } satisfies PrefetchCacheEntry\n\n prefetchCache.set(prefetchCacheKey, prefetchEntry)\n\n return prefetchEntry\n}\n\n/**\n * Creates a prefetch entry entry and enqueues a fetch request to retrieve the data.\n */\nfunction createLazyPrefetchEntry({\n url,\n kind,\n tree,\n nextUrl,\n buildId,\n prefetchCache,\n}: Pick<\n ReadonlyReducerState,\n 'nextUrl' | 'tree' | 'buildId' | 'prefetchCache'\n> & {\n url: URL\n kind: PrefetchKind\n}): PrefetchCacheEntry {\n const prefetchCacheKey = createPrefetchCacheKey(url, kind)\n\n // initiates the fetch request for the prefetch and attaches a listener\n // to the promise to update the prefetch cache entry when the promise resolves (if necessary)\n const data = prefetchQueue.enqueue(() =>\n fetchServerResponse(url, {\n flightRouterState: tree,\n nextUrl,\n buildId,\n prefetchKind: kind,\n }).then((prefetchResponse) => {\n // TODO: `fetchServerResponse` should be more tighly coupled to these prefetch cache operations\n // to avoid drift between this cache key prefixing logic\n // (which is currently directly influenced by the server response)\n let newCacheKey\n\n if (prefetchResponse.couldBeIntercepted) {\n // Determine if we need to prefix the cache key with the nextUrl\n newCacheKey = prefixExistingPrefetchCacheEntry({\n url,\n existingCacheKey: prefetchCacheKey,\n nextUrl,\n prefetchCache,\n })\n }\n\n // If the prefetch was a cache hit, we want to update the existing cache entry to reflect that it was a full prefetch.\n // This is because we know that a static response will contain the full RSC payload, and can be updated to respect the `static`\n // staleTime.\n if (prefetchResponse.prerendered) {\n const existingCacheEntry = prefetchCache.get(\n // if we prefixed the cache key due to route interception, we want to use the new key. Otherwise we use the original key\n newCacheKey ?? prefetchCacheKey\n )\n if (existingCacheEntry) {\n existingCacheEntry.kind = PrefetchKind.FULL\n if (prefetchResponse.staleTime !== -1) {\n // This is the stale time that was collected by the server during\n // static generation. Use this in place of the default stale time.\n existingCacheEntry.staleTime = prefetchResponse.staleTime\n }\n }\n }\n\n return prefetchResponse\n })\n )\n\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data,\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: null,\n staleTime: -1,\n key: prefetchCacheKey,\n status: PrefetchCacheEntryStatus.fresh,\n url,\n }\n\n prefetchCache.set(prefetchCacheKey, prefetchEntry)\n\n return prefetchEntry\n}\n\nexport function prunePrefetchCache(\n prefetchCache: ReadonlyReducerState['prefetchCache']\n) {\n for (const [href, prefetchCacheEntry] of prefetchCache) {\n if (\n getPrefetchEntryCacheStatus(prefetchCacheEntry) ===\n PrefetchCacheEntryStatus.expired\n ) {\n prefetchCache.delete(href)\n }\n }\n}\n\n// These values are set by `define-env-plugin` (based on `nextConfig.experimental.staleTimes`)\n// and default to 5 minutes (static) / 0 seconds (dynamic)\nconst DYNAMIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME) * 1000\n\nconst STATIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME) * 1000\n\nfunction getPrefetchEntryCacheStatus({\n kind,\n prefetchTime,\n lastUsedTime,\n staleTime,\n}: PrefetchCacheEntry): PrefetchCacheEntryStatus {\n if (staleTime !== -1) {\n // `staleTime` is the value sent by the server during static generation.\n // When this is available, it takes precedence over any of the heuristics\n // that follow.\n //\n // TODO: When PPR is enabled, the server will *always* return a stale time\n // when prefetching. We should never use a prefetch entry that hasn't yet\n // received data from the server. So the only two cases should be 1) we use\n // the server-generated stale time 2) the unresolved entry is discarded.\n return Date.now() < prefetchTime + staleTime\n ? PrefetchCacheEntryStatus.fresh\n : PrefetchCacheEntryStatus.stale\n }\n\n // We will re-use the cache entry data for up to the `dynamic` staletime window.\n if (Date.now() < (lastUsedTime ?? prefetchTime) + DYNAMIC_STALETIME_MS) {\n return lastUsedTime\n ? PrefetchCacheEntryStatus.reusable\n : PrefetchCacheEntryStatus.fresh\n }\n\n // For \"auto\" prefetching, we'll re-use only the loading boundary for up to `static` staletime window.\n // A stale entry will only re-use the `loading` boundary, not the full data.\n // This will trigger a \"lazy fetch\" for the full data.\n if (kind === PrefetchKind.AUTO) {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return PrefetchCacheEntryStatus.stale\n }\n }\n\n // for \"full\" prefetching, we'll re-use the cache entry data for up to `static` staletime window.\n if (kind === PrefetchKind.FULL) {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return PrefetchCacheEntryStatus.reusable\n }\n }\n\n return PrefetchCacheEntryStatus.expired\n}\n","import type { FlightRouterState } from '../../../../server/app-render/types'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createRouterCacheKey } from '../create-router-cache-key'\n\nexport function findHeadInCache(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1]\n): [CacheNode, string] | null {\n return findHeadInCacheImpl(cache, parallelRoutes, '')\n}\n\nfunction findHeadInCacheImpl(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1],\n keyPrefix: string\n): [CacheNode, string] | null {\n const isLastItem = Object.keys(parallelRoutes).length === 0\n if (isLastItem) {\n // Returns the entire Cache Node of the segment whose head we will render.\n return [cache, keyPrefix]\n }\n for (const key in parallelRoutes) {\n const [segment, childParallelRoutes] = parallelRoutes[key]\n const childSegmentMap = cache.parallelRoutes.get(key)\n if (!childSegmentMap) {\n continue\n }\n\n const cacheKey = createRouterCacheKey(segment)\n\n const cacheNode = childSegmentMap.get(cacheKey)\n if (!cacheNode) {\n continue\n }\n\n const item = findHeadInCacheImpl(\n cacheNode,\n childParallelRoutes,\n keyPrefix + '/' + cacheKey\n )\n if (item) {\n return item\n }\n }\n\n return null\n}\n","import type { Segment } from '../../../../server/app-render/types'\n\nexport function getSegmentValue(segment: Segment) {\n return Array.isArray(segment) ? segment[1] : segment\n}\n","import type { FlightRouterState } from '../../../../server/app-render/types'\nimport { isInterceptionRouteAppPath } from '../../../../server/lib/interception-routes'\n\nexport function hasInterceptionRouteInCurrentTree([\n segment,\n parallelRoutes,\n]: FlightRouterState): boolean {\n // If we have a dynamic segment, it's marked as an interception route by the presence of the `i` suffix.\n if (Array.isArray(segment) && (segment[2] === 'di' || segment[2] === 'ci')) {\n return true\n }\n\n // If segment is not an array, apply the existing string-based check\n if (typeof segment === 'string' && isInterceptionRouteAppPath(segment)) {\n return true\n }\n\n // Iterate through parallelRoutes if they exist\n if (parallelRoutes) {\n for (const key in parallelRoutes) {\n if (hasInterceptionRouteInCurrentTree(parallelRoutes[key])) {\n return true\n }\n }\n }\n\n return false\n}\n","import { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n ReadonlyReducerState,\n ReducerState,\n HmrRefreshAction,\n Mutable,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { handleMutable } from '../handle-mutable'\nimport { applyFlightData } from '../apply-flight-data'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\n\n// A version of refresh reducer that keeps the cache around instead of wiping all of it.\nfunction hmrRefreshReducerImpl(\n state: ReadonlyReducerState,\n action: HmrRefreshAction\n): ReducerState {\n const { origin } = action\n const mutable: Mutable = {}\n const href = state.canonicalUrl\n\n mutable.preserveCustomHistoryState = false\n\n const cache: CacheNode = createEmptyCacheNode()\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = hasInterceptionRouteInCurrentTree(state.tree)\n\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = fetchServerResponse(new URL(href, origin), {\n flightRouterState: [state.tree[0], state.tree[1], state.tree[2], 'refetch'],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n buildId: state.buildId,\n isHmrRefresh: true,\n })\n\n return cache.lazyData.then(\n ({ flightData, canonicalUrl: canonicalUrlOverride }) => {\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null\n\n let currentTree = state.tree\n let currentCache = state.cache\n\n for (const normalizedFlightData of flightData) {\n const { tree: treePatch, isRootRender } = normalizedFlightData\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED')\n return state\n }\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n if (newTree === null) {\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n href,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n const applied = applyFlightData(\n currentCache,\n cache,\n normalizedFlightData\n )\n\n if (applied) {\n mutable.cache = cache\n currentCache = cache\n }\n\n mutable.patchedTree = newTree\n mutable.canonicalUrl = href\n\n currentTree = newTree\n }\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n\nfunction hmrRefreshReducerNoop(\n state: ReadonlyReducerState,\n _action: HmrRefreshAction\n): ReducerState {\n return state\n}\n\nexport const hmrRefreshReducer =\n process.env.NODE_ENV === 'production'\n ? hmrRefreshReducerNoop\n : hmrRefreshReducerImpl\n","import type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../../server/app-render/types'\nimport { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { invalidateCacheBelowFlightSegmentPath } from '../invalidate-cache-below-flight-segmentpath'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { shouldHardNavigate } from '../should-hard-navigate'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport {\n PrefetchCacheEntryStatus,\n type Mutable,\n type NavigateAction,\n type ReadonlyReducerState,\n type ReducerState,\n} from '../router-reducer-types'\nimport { handleMutable } from '../handle-mutable'\nimport { applyFlightData } from '../apply-flight-data'\nimport { prefetchQueue } from './prefetch-reducer'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { DEFAULT_SEGMENT_KEY } from '../../../../shared/lib/segment'\nimport {\n listenForDynamicRequest,\n updateCacheNodeOnNavigation,\n} from '../ppr-navigations'\nimport {\n getOrCreatePrefetchCacheEntry,\n prunePrefetchCache,\n} from '../prefetch-cache-utils'\nimport { clearCacheNodeDataForSegmentPath } from '../clear-cache-node-data-for-segment-path'\nimport { handleAliasedPrefetchEntry } from '../aliased-prefetch-navigations'\n\nexport function handleExternalUrl(\n state: ReadonlyReducerState,\n mutable: Mutable,\n url: string,\n pendingPush: boolean\n) {\n mutable.mpaNavigation = true\n mutable.canonicalUrl = url\n mutable.pendingPush = pendingPush\n mutable.scrollableSegments = undefined\n\n return handleMutable(state, mutable)\n}\n\nfunction generateSegmentsFromPatch(\n flightRouterPatch: FlightRouterState\n): FlightSegmentPath[] {\n const segments: FlightSegmentPath[] = []\n const [segment, parallelRoutes] = flightRouterPatch\n\n if (Object.keys(parallelRoutes).length === 0) {\n return [[segment]]\n }\n\n for (const [parallelRouteKey, parallelRoute] of Object.entries(\n parallelRoutes\n )) {\n for (const childSegment of generateSegmentsFromPatch(parallelRoute)) {\n // If the segment is empty, it means we are at the root of the tree\n if (segment === '') {\n segments.push([parallelRouteKey, ...childSegment])\n } else {\n segments.push([segment, parallelRouteKey, ...childSegment])\n }\n }\n }\n\n return segments\n}\n\nfunction triggerLazyFetchForLeafSegments(\n newCache: CacheNode,\n currentCache: CacheNode,\n flightSegmentPath: FlightSegmentPath,\n treePatch: FlightRouterState\n) {\n let appliedPatch = false\n\n newCache.rsc = currentCache.rsc\n newCache.prefetchRsc = currentCache.prefetchRsc\n newCache.loading = currentCache.loading\n newCache.parallelRoutes = new Map(currentCache.parallelRoutes)\n\n const segmentPathsToFill = generateSegmentsFromPatch(treePatch).map(\n (segment) => [...flightSegmentPath, ...segment]\n )\n\n for (const segmentPaths of segmentPathsToFill) {\n clearCacheNodeDataForSegmentPath(newCache, currentCache, segmentPaths)\n\n appliedPatch = true\n }\n\n return appliedPatch\n}\n\nexport function navigateReducer(\n state: ReadonlyReducerState,\n action: NavigateAction\n): ReducerState {\n const { url, isExternalUrl, navigateType, shouldScroll, allowAliasing } =\n action\n const mutable: Mutable = {}\n const { hash } = url\n const href = createHrefFromUrl(url)\n const pendingPush = navigateType === 'push'\n // we want to prune the prefetch cache on every navigation to avoid it growing too large\n prunePrefetchCache(state.prefetchCache)\n\n mutable.preserveCustomHistoryState = false\n mutable.pendingPush = pendingPush\n\n if (isExternalUrl) {\n return handleExternalUrl(state, mutable, url.toString(), pendingPush)\n }\n\n // Handles case where `` tag is present,\n // which will trigger an MPA navigation.\n if (document.getElementById('__next-page-redirect')) {\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n\n const prefetchValues = getOrCreatePrefetchCacheEntry({\n url,\n nextUrl: state.nextUrl,\n tree: state.tree,\n buildId: state.buildId,\n prefetchCache: state.prefetchCache,\n allowAliasing,\n })\n const { treeAtTimeOfPrefetch, data } = prefetchValues\n\n prefetchQueue.bump(data)\n\n return data.then(\n ({ flightData, canonicalUrl: canonicalUrlOverride, postponed }) => {\n let isFirstRead = false\n // we only want to mark this once\n if (!prefetchValues.lastUsedTime) {\n // important: we should only mark the cache node as dirty after we unsuspend from the call above\n prefetchValues.lastUsedTime = Date.now()\n isFirstRead = true\n }\n\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(state, mutable, flightData, pendingPush)\n }\n\n const updatedCanonicalUrl = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : href\n\n const onlyHashChange =\n !!hash &&\n state.canonicalUrl.split('#', 1)[0] ===\n updatedCanonicalUrl.split('#', 1)[0]\n\n // If only the hash has changed, the server hasn't sent us any new data. We can just update\n // the mutable properties responsible for URL and scroll handling and return early.\n if (onlyHashChange) {\n mutable.onlyHashChange = true\n mutable.canonicalUrl = updatedCanonicalUrl\n mutable.shouldScroll = shouldScroll\n mutable.hashFragment = hash\n mutable.scrollableSegments = []\n return handleMutable(state, mutable)\n }\n\n if (prefetchValues.aliased) {\n const result = handleAliasedPrefetchEntry(\n state,\n flightData,\n url,\n mutable\n )\n\n // We didn't return new router state because we didn't apply the aliased entry for some reason.\n // We'll re-invoke the navigation handler but ensure that we don't attempt to use the aliased entry. This\n // will create an on-demand prefetch entry.\n if (result === false) {\n return navigateReducer(state, { ...action, allowAliasing: false })\n }\n\n return result\n }\n\n let currentTree = state.tree\n let currentCache = state.cache\n let scrollableSegments: FlightSegmentPath[] = []\n for (const normalizedFlightData of flightData) {\n const {\n pathToSegment: flightSegmentPath,\n seedData,\n head,\n isRootRender,\n } = normalizedFlightData\n let treePatch = normalizedFlightData.tree\n\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = ['', ...flightSegmentPath]\n\n // Create new tree based on the flightSegmentPath and router state patch\n let newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n currentTree,\n treePatch,\n href\n )\n\n // If the tree patch can't be applied to the current tree then we use the tree at time of prefetch\n // TODO-APP: This should instead fill in the missing pieces in `currentTree` with the data from `treeAtTimeOfPrefetch`, then apply the patch.\n if (newTree === null) {\n newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n treeAtTimeOfPrefetch,\n treePatch,\n href\n )\n }\n\n if (newTree !== null) {\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n\n if (\n // This is just a paranoid check. When a route is PPRed, the server\n // will send back a static response that's rendered from\n // the root. If for some reason it doesn't, we fall back to the\n // non-PPR implementation.\n // TODO: We should get rid of the else branch and do all navigations\n // via updateCacheNodeOnNavigation. The current structure is just\n // an incremental step.\n seedData &&\n isRootRender &&\n postponed\n ) {\n const task = updateCacheNodeOnNavigation(\n currentCache,\n currentTree,\n treePatch,\n seedData,\n head\n )\n\n if (task !== null) {\n // We've created a new Cache Node tree that contains a prefetched\n // version of the next page. This can be rendered instantly.\n\n // Use the tree computed by updateCacheNodeOnNavigation instead\n // of the one computed by applyRouterStatePatchToTree.\n // TODO: We should remove applyRouterStatePatchToTree\n // from the PPR path entirely.\n const patchedRouterState: FlightRouterState = task.route\n newTree = patchedRouterState\n\n // It's possible that `updateCacheNodeOnNavigation` only spawned tasks to reuse the existing cache,\n // in which case `task.node` will be null, signaling we don't need to wait for a dynamic request\n // and can simply apply the patched `FlightRouterState`.\n if (task.node !== null) {\n const newCache = task.node\n\n // The prefetched tree has dynamic holes in it. We initiate a\n // dynamic request to fill them in.\n //\n // Do not block on the result. We'll immediately render the Cache\n // Node tree and suspend on the dynamic parts. When the request\n // comes in, we'll fill in missing data and ping React to\n // re-render. Unlike the lazy fetching model in the non-PPR\n // implementation, this is modeled as a single React update +\n // streaming, rather than multiple top-level updates. (However,\n // even in the new model, we'll still need to sometimes update the\n // root multiple times per navigation, like if the server sends us\n // a different response than we expected. For now, we revert back\n // to the lazy fetching mechanism in that case.)\n const dynamicRequest = fetchServerResponse(url, {\n flightRouterState: currentTree,\n nextUrl: state.nextUrl,\n buildId: state.buildId,\n })\n\n listenForDynamicRequest(task, dynamicRequest)\n // We store the dynamic request on the `lazyData` property of the CacheNode\n // because we're not going to await the dynamic request here. Since we're not blocking\n // on the dynamic request, `layout-router` will\n // task.node.lazyData = dynamicRequest\n\n mutable.cache = newCache\n }\n } else {\n // Nothing changed, so reuse the old cache.\n // TODO: What if the head changed but not any of the segment data?\n // Is that possible? If so, we should clone the whole tree and\n // update the head.\n newTree = treePatch\n }\n } else {\n // The static response does not include any dynamic holes, so\n // there's no need to do a second request.\n // TODO: As an incremental step this just reverts back to the\n // non-PPR implementation. We can simplify this branch further,\n // given that PPR prefetches are always static and return the whole\n // tree. Or in the meantime we could factor it out into a\n // separate function.\n const cache: CacheNode = createEmptyCacheNode()\n let applied = false\n\n if (\n prefetchValues.status === PrefetchCacheEntryStatus.stale &&\n !isFirstRead\n ) {\n // When we have a stale prefetch entry, we only want to re-use the loading state of the route we're navigating to, to support instant loading navigations\n // this will trigger a lazy fetch for the actual page data by nulling the `rsc` and `prefetchRsc` values for page data,\n // while copying over the `loading` for the segment that contains the page data.\n // We only do this on subsequent reads, as otherwise there'd be no loading data to re-use.\n\n // We skip this branch if only the hash fragment has changed, as we don't want to trigger a lazy fetch in that case\n applied = triggerLazyFetchForLeafSegments(\n cache,\n currentCache,\n flightSegmentPath,\n treePatch\n )\n // since we re-used the stale cache's loading state & refreshed the data,\n // update the `lastUsedTime` so that it can continue to be re-used for the next 30s\n prefetchValues.lastUsedTime = Date.now()\n } else {\n applied = applyFlightData(\n currentCache,\n cache,\n normalizedFlightData,\n prefetchValues\n )\n }\n\n const hardNavigate = shouldHardNavigate(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n currentTree\n )\n\n if (hardNavigate) {\n // Copy rsc for the root node of the cache.\n cache.rsc = currentCache.rsc\n cache.prefetchRsc = currentCache.prefetchRsc\n\n invalidateCacheBelowFlightSegmentPath(\n cache,\n currentCache,\n flightSegmentPath\n )\n // Ensure the existing cache value is used when the cache was not invalidated.\n mutable.cache = cache\n } else if (applied) {\n mutable.cache = cache\n // If we applied the cache, we update the \"current cache\" value so any other\n // segments in the FlightDataPath will be able to reference the updated cache.\n currentCache = cache\n }\n }\n\n currentTree = newTree\n\n for (const subSegment of generateSegmentsFromPatch(treePatch)) {\n const scrollableSegmentPath = [...flightSegmentPath, ...subSegment]\n // Filter out the __DEFAULT__ paths as they shouldn't be scrolled to in this case.\n if (\n scrollableSegmentPath[scrollableSegmentPath.length - 1] !==\n DEFAULT_SEGMENT_KEY\n ) {\n scrollableSegments.push(scrollableSegmentPath)\n }\n }\n }\n }\n\n mutable.patchedTree = currentTree\n mutable.canonicalUrl = updatedCanonicalUrl\n mutable.scrollableSegments = scrollableSegments\n mutable.hashFragment = hash\n mutable.shouldScroll = shouldScroll\n\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n","import type {\n PrefetchAction,\n ReducerState,\n ReadonlyReducerState,\n} from '../router-reducer-types'\nimport { NEXT_RSC_UNION_QUERY } from '../../app-router-headers'\nimport { PromiseQueue } from '../../promise-queue'\nimport {\n getOrCreatePrefetchCacheEntry,\n prunePrefetchCache,\n} from '../prefetch-cache-utils'\n\nexport const prefetchQueue = new PromiseQueue(5)\n\nexport function prefetchReducer(\n state: ReadonlyReducerState,\n action: PrefetchAction\n): ReducerState {\n // let's prune the prefetch cache before we do anything else\n prunePrefetchCache(state.prefetchCache)\n\n const { url } = action\n url.searchParams.delete(NEXT_RSC_UNION_QUERY)\n\n getOrCreatePrefetchCacheEntry({\n url,\n nextUrl: state.nextUrl,\n prefetchCache: state.prefetchCache,\n kind: action.kind,\n tree: state.tree,\n buildId: state.buildId,\n allowAliasing: true,\n })\n\n return state\n}\n","import { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n Mutable,\n ReadonlyReducerState,\n ReducerState,\n RefreshAction,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { handleMutable } from '../handle-mutable'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\nimport { refreshInactiveParallelSegments } from '../refetch-inactive-parallel-segments'\n\nexport function refreshReducer(\n state: ReadonlyReducerState,\n action: RefreshAction\n): ReducerState {\n const { origin } = action\n const mutable: Mutable = {}\n const href = state.canonicalUrl\n\n let currentTree = state.tree\n\n mutable.preserveCustomHistoryState = false\n\n const cache: CacheNode = createEmptyCacheNode()\n\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = hasInterceptionRouteInCurrentTree(state.tree)\n\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = fetchServerResponse(new URL(href, origin), {\n flightRouterState: [\n currentTree[0],\n currentTree[1],\n currentTree[2],\n 'refetch',\n ],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n buildId: state.buildId,\n })\n\n return cache.lazyData.then(\n async ({ flightData, canonicalUrl: canonicalUrlOverride }) => {\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null\n\n for (const normalizedFlightData of flightData) {\n const {\n tree: treePatch,\n seedData: cacheNodeSeedData,\n head,\n isRootRender,\n } = normalizedFlightData\n\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED')\n return state\n }\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n if (newTree === null) {\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n href,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (cacheNodeSeedData !== null) {\n const rsc = cacheNodeSeedData[1]\n const loading = cacheNodeSeedData[3]\n cache.rsc = rsc\n cache.prefetchRsc = null\n cache.loading = loading\n fillLazyItemsTillLeafWithHead(\n cache,\n // Existing cache is not passed in as `router.refresh()` has to invalidate the entire cache.\n undefined,\n treePatch,\n cacheNodeSeedData,\n head\n )\n mutable.prefetchCache = new Map()\n }\n\n await refreshInactiveParallelSegments({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl,\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl,\n })\n\n mutable.cache = cache\n mutable.patchedTree = newTree\n\n currentTree = newTree\n }\n\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n","import { createHrefFromUrl } from '../create-href-from-url'\nimport type {\n ReadonlyReducerState,\n ReducerState,\n RestoreAction,\n} from '../router-reducer-types'\nimport { extractPathFromFlightRouterState } from '../compute-changed-path'\nimport { updateCacheNodeOnPopstateRestoration } from '../ppr-navigations'\n\nexport function restoreReducer(\n state: ReadonlyReducerState,\n action: RestoreAction\n): ReducerState {\n const { url, tree } = action\n const href = createHrefFromUrl(url)\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n const treeToRestore = tree || state.tree\n\n const oldCache = state.cache\n const newCache = process.env.__NEXT_PPR\n ? // When PPR is enabled, we update the cache to drop the prefetch\n // data for any segment whose dynamic data was already received. This\n // prevents an unnecessary flash back to PPR state during a\n // back/forward navigation.\n updateCacheNodeOnPopstateRestoration(oldCache, treeToRestore)\n : oldCache\n\n return {\n buildId: state.buildId,\n // Set canonical url\n canonicalUrl: href,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache: newCache,\n prefetchCache: state.prefetchCache,\n // Restore provided tree\n tree: treeToRestore,\n nextUrl: extractPathFromFlightRouterState(treeToRestore) ?? url.pathname,\n }\n}\n","import type {\n ActionFlightResponse,\n ActionResult,\n} from '../../../../server/app-render/types'\nimport { callServer } from '../../../app-call-server'\nimport { findSourceMapURL } from '../../../app-find-source-map-url'\nimport {\n ACTION_HEADER,\n NEXT_IS_PRERENDER_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_URL,\n RSC_CONTENT_TYPE_HEADER,\n} from '../../app-router-headers'\n\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromFetch } from 'react-server-dom-webpack/client'\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { encodeReply } from 'react-server-dom-webpack/client'\nconst { createFromFetch, createTemporaryReferenceSet, encodeReply } = (\n !!process.env.NEXT_RUNTIME\n ? // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client.edge')\n : // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client')\n) as typeof import('react-server-dom-webpack/client')\n\nimport {\n PrefetchKind,\n type ReadonlyReducerState,\n type ReducerState,\n type ServerActionAction,\n type ServerActionMutable,\n} from '../router-reducer-types'\nimport { assignLocation } from '../../../assign-location'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { handleMutable } from '../handle-mutable'\nimport { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { refreshInactiveParallelSegments } from '../refetch-inactive-parallel-segments'\nimport {\n normalizeFlightData,\n type NormalizedFlightData,\n} from '../../../flight-data-helpers'\nimport { getRedirectError, RedirectType } from '../../redirect'\nimport { createSeededPrefetchCacheEntry } from '../prefetch-cache-utils'\nimport { removeBasePath } from '../../../remove-base-path'\nimport { hasBasePath } from '../../../has-base-path'\n\ntype FetchServerActionResult = {\n redirectLocation: URL | undefined\n redirectType: RedirectType | undefined\n actionResult?: ActionResult\n actionFlightData?: NormalizedFlightData[] | string\n isPrerender: boolean\n revalidatedParts: {\n tag: boolean\n cookie: boolean\n paths: string[]\n }\n}\n\nasync function fetchServerAction(\n state: ReadonlyReducerState,\n nextUrl: ReadonlyReducerState['nextUrl'],\n { actionId, actionArgs }: ServerActionAction\n): Promise {\n const temporaryReferences = createTemporaryReferenceSet()\n const body = await encodeReply(actionArgs, { temporaryReferences })\n\n const res = await fetch('', {\n method: 'POST',\n headers: {\n Accept: RSC_CONTENT_TYPE_HEADER,\n [ACTION_HEADER]: actionId,\n [NEXT_ROUTER_STATE_TREE_HEADER]: encodeURIComponent(\n JSON.stringify(state.tree)\n ),\n ...(process.env.NEXT_DEPLOYMENT_ID\n ? {\n 'x-deployment-id': process.env.NEXT_DEPLOYMENT_ID,\n }\n : {}),\n ...(nextUrl\n ? {\n [NEXT_URL]: nextUrl,\n }\n : {}),\n },\n body,\n })\n\n const redirectHeader = res.headers.get('x-action-redirect')\n const [location, _redirectType] = redirectHeader?.split(';') || []\n let redirectType: RedirectType | undefined\n switch (_redirectType) {\n case 'push':\n redirectType = RedirectType.push\n break\n case 'replace':\n redirectType = RedirectType.replace\n break\n default:\n redirectType = undefined\n }\n\n const isPrerender = !!res.headers.get(NEXT_IS_PRERENDER_HEADER)\n let revalidatedParts: FetchServerActionResult['revalidatedParts']\n try {\n const revalidatedHeader = JSON.parse(\n res.headers.get('x-action-revalidated') || '[[],0,0]'\n )\n revalidatedParts = {\n paths: revalidatedHeader[0] || [],\n tag: !!revalidatedHeader[1],\n cookie: revalidatedHeader[2],\n }\n } catch (e) {\n revalidatedParts = {\n paths: [],\n tag: false,\n cookie: false,\n }\n }\n\n const redirectLocation = location\n ? assignLocation(\n location,\n new URL(state.canonicalUrl, window.location.href)\n )\n : undefined\n\n const contentType = res.headers.get('content-type')\n\n if (contentType?.startsWith(RSC_CONTENT_TYPE_HEADER)) {\n const response: ActionFlightResponse = await createFromFetch(\n Promise.resolve(res),\n { callServer, findSourceMapURL, temporaryReferences }\n )\n\n if (location) {\n // if it was a redirection, then result is just a regular RSC payload\n return {\n actionFlightData: normalizeFlightData(response.f),\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n }\n\n return {\n actionResult: response.a,\n actionFlightData: normalizeFlightData(response.f),\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n }\n\n // Handle invalid server action responses\n if (res.status >= 400) {\n // The server can respond with a text/plain error message, but we'll fallback to something generic\n // if there isn't one.\n const error =\n contentType === 'text/plain'\n ? await res.text()\n : 'An unexpected response was received from the server.'\n\n throw new Error(error)\n }\n\n return {\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n}\n\n/*\n * This reducer is responsible for calling the server action and processing any side-effects from the server action.\n * It does not mutate the state by itself but rather delegates to other reducers to do the actual mutation.\n */\nexport function serverActionReducer(\n state: ReadonlyReducerState,\n action: ServerActionAction\n): ReducerState {\n const { resolve, reject } = action\n const mutable: ServerActionMutable = {}\n const href = state.canonicalUrl\n\n let currentTree = state.tree\n\n mutable.preserveCustomHistoryState = false\n\n // only pass along the `nextUrl` param (used for interception routes) if the current route was intercepted.\n // If the route has been intercepted, the action should be as well.\n // Otherwise the server action might be intercepted with the wrong action id\n // (ie, one that corresponds with the intercepted route)\n const nextUrl =\n state.nextUrl && hasInterceptionRouteInCurrentTree(state.tree)\n ? state.nextUrl\n : null\n\n return fetchServerAction(state, nextUrl, action).then(\n async ({\n actionResult,\n actionFlightData: flightData,\n redirectLocation,\n redirectType,\n isPrerender,\n revalidatedParts,\n }) => {\n // honor the redirect type instead of defaulting to push in case of server actions.\n if (redirectLocation) {\n if (redirectType === RedirectType.replace) {\n state.pushRef.pendingPush = false\n mutable.pendingPush = false\n } else {\n state.pushRef.pendingPush = true\n mutable.pendingPush = true\n }\n }\n\n if (!flightData) {\n resolve(actionResult)\n\n // If there is a redirect but no flight data we need to do a mpaNavigation.\n if (redirectLocation) {\n return handleExternalUrl(\n state,\n mutable,\n redirectLocation.href,\n state.pushRef.pendingPush\n )\n }\n return state\n }\n\n if (typeof flightData === 'string') {\n // Handle case when navigating to page in `pages` from `app`\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n const actionRevalidated =\n revalidatedParts.paths.length > 0 ||\n revalidatedParts.tag ||\n revalidatedParts.cookie\n\n for (const normalizedFlightData of flightData) {\n const {\n tree: treePatch,\n seedData: cacheNodeSeedData,\n head,\n isRootRender,\n } = normalizedFlightData\n\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('SERVER ACTION APPLY FAILED')\n return state\n }\n\n // Given the path can only have two items the items are only the router state and rsc for the root.\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n redirectLocation\n ? createHrefFromUrl(redirectLocation)\n : state.canonicalUrl\n )\n\n if (newTree === null) {\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n href,\n state.pushRef.pendingPush\n )\n }\n\n // The server sent back RSC data for the server action, so we need to apply it to the cache.\n if (cacheNodeSeedData !== null) {\n const rsc = cacheNodeSeedData[1]\n const cache: CacheNode = createEmptyCacheNode()\n cache.rsc = rsc\n cache.prefetchRsc = null\n cache.loading = cacheNodeSeedData[3]\n fillLazyItemsTillLeafWithHead(\n cache,\n // Existing cache is not passed in as server actions have to invalidate the entire cache.\n undefined,\n treePatch,\n cacheNodeSeedData,\n head\n )\n\n mutable.cache = cache\n mutable.prefetchCache = new Map()\n\n if (actionRevalidated) {\n await refreshInactiveParallelSegments({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl: Boolean(nextUrl),\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl,\n })\n }\n }\n\n mutable.patchedTree = newTree\n currentTree = newTree\n }\n\n if (redirectLocation) {\n const newHref = createHrefFromUrl(redirectLocation, false)\n mutable.canonicalUrl = newHref\n\n // Because the RedirectBoundary will trigger a navigation, we need to seed the prefetch cache\n // with the FlightData that we got from the server action for the target page, so that it's\n // available when the page is navigated to and doesn't need to be re-fetched.\n // We only do this if the server action didn't revalidate any data, as in that case the\n // client cache will be cleared and the data will be re-fetched anyway.\n if (!actionRevalidated) {\n createSeededPrefetchCacheEntry({\n url: redirectLocation,\n data: {\n flightData,\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n // TODO: We should be able to set this if the server action\n // returned a fully static response.\n staleTime: -1,\n },\n tree: state.tree,\n prefetchCache: state.prefetchCache,\n nextUrl: state.nextUrl,\n kind: isPrerender ? PrefetchKind.FULL : PrefetchKind.AUTO,\n })\n mutable.prefetchCache = state.prefetchCache\n }\n\n // If the action triggered a redirect, the action promise promise will be rejected with\n // a redirect so that it's handled by RedirectBoundary as we won't have a valid\n // action result to resolve the promise with. This will effectively reset the state of\n // the component that called the action as the error boundary will remount the tree.\n // The status code doesn't matter here as the action handler will have already sent\n // a response with the correct status code.\n reject(\n getRedirectError(\n hasBasePath(newHref) ? removeBasePath(newHref) : newHref,\n redirectType || RedirectType.push\n )\n )\n } else {\n resolve(actionResult)\n }\n\n return handleMutable(state, mutable)\n },\n (e: any) => {\n // When the server action is rejected we don't update the state and instead call the reject handler of the promise.\n reject(e)\n\n return state\n }\n )\n}\n","import { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n ServerPatchAction,\n ReducerState,\n ReadonlyReducerState,\n Mutable,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { applyFlightData } from '../apply-flight-data'\nimport { handleMutable } from '../handle-mutable'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createEmptyCacheNode } from '../../app-router'\n\nexport function serverPatchReducer(\n state: ReadonlyReducerState,\n action: ServerPatchAction\n): ReducerState {\n const {\n serverResponse: { flightData, canonicalUrl: canonicalUrlOverride },\n } = action\n\n const mutable: Mutable = {}\n\n mutable.preserveCustomHistoryState = false\n\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n let currentTree = state.tree\n let currentCache = state.cache\n\n for (const normalizedFlightData of flightData) {\n const { segmentPath: flightSegmentPath, tree: treePatch } =\n normalizedFlightData\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n ['', ...flightSegmentPath],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n // `applyRouterStatePatchToTree` returns `null` when it determined that the server response is not applicable to the current tree.\n // In other words, the server responded with a tree that doesn't match what the client is currently rendering.\n // This can happen if the server patch action took longer to resolve than a subsequent navigation which would have changed the tree.\n // Previously this case triggered an MPA navigation but it should be safe to simply discard the server response rather than forcing\n // the entire page to reload.\n if (newTree === null) {\n return state\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n state.canonicalUrl,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n\n const cache: CacheNode = createEmptyCacheNode()\n applyFlightData(currentCache, cache, normalizedFlightData)\n\n mutable.patchedTree = newTree\n mutable.cache = cache\n\n currentCache = cache\n currentTree = newTree\n }\n\n return handleMutable(state, mutable)\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { AppRouterState } from './router-reducer-types'\nimport { applyFlightData } from './apply-flight-data'\nimport { fetchServerResponse } from './fetch-server-response'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\ninterface RefreshInactiveParallelSegments {\n state: AppRouterState\n updatedTree: FlightRouterState\n updatedCache: CacheNode\n includeNextUrl: boolean\n canonicalUrl: string\n}\n\n/**\n * Refreshes inactive segments that are still in the current FlightRouterState.\n * A segment is considered \"inactive\" when the server response indicates it didn't match to a page component.\n * This happens during a soft-navigation, where the server will want to patch in the segment\n * with the \"default\" component, but we explicitly ignore the server in this case\n * and keep the existing state for that segment. New data for inactive segments are inherently\n * not part of the server response when we patch the tree, because they were associated with a response\n * from an earlier navigation/request. For each segment, once it becomes \"active\", we encode the URL that provided\n * the data for it. This function traverses parallel routes looking for these markers so that it can re-fetch\n * and patch the new data into the tree.\n */\nexport async function refreshInactiveParallelSegments(\n options: RefreshInactiveParallelSegments\n) {\n const fetchedSegments = new Set()\n await refreshInactiveParallelSegmentsImpl({\n ...options,\n rootTree: options.updatedTree,\n fetchedSegments,\n })\n}\n\nasync function refreshInactiveParallelSegmentsImpl({\n state,\n updatedTree,\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree = updatedTree,\n canonicalUrl,\n}: RefreshInactiveParallelSegments & {\n fetchedSegments: Set\n rootTree: FlightRouterState\n}) {\n const [, parallelRoutes, refetchPath, refetchMarker] = updatedTree\n const fetchPromises = []\n\n if (\n refetchPath &&\n refetchPath !== canonicalUrl &&\n refetchMarker === 'refresh' &&\n // it's possible for the tree to contain multiple segments that contain data at the same URL\n // we keep track of them so we can dedupe the requests\n !fetchedSegments.has(refetchPath)\n ) {\n fetchedSegments.add(refetchPath) // Mark this URL as fetched\n\n // Eagerly kick off the fetch for the refetch path & the parallel routes. This should be fine to do as they each operate\n // independently on their own cache nodes, and `applyFlightData` will copy anything it doesn't care about from the existing cache.\n const fetchPromise = fetchServerResponse(\n new URL(refetchPath, location.origin),\n {\n // refetch from the root of the updated tree, otherwise it will be scoped to the current segment\n // and might not contain the data we need to patch in interception route data (such as dynamic params from a previous segment)\n flightRouterState: [rootTree[0], rootTree[1], rootTree[2], 'refetch'],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n buildId: state.buildId,\n }\n ).then(({ flightData }) => {\n if (typeof flightData !== 'string') {\n for (const flightDataPath of flightData) {\n // we only pass the new cache as this function is called after clearing the router cache\n // and filling in the new page data from the server. Meaning the existing cache is actually the cache that's\n // just been created & has been written to, but hasn't been \"committed\" yet.\n applyFlightData(updatedCache, updatedCache, flightDataPath)\n }\n } else {\n // When flightData is a string, it suggests that the server response should have triggered an MPA navigation\n // I'm not 100% sure of this decision, but it seems unlikely that we'd want to introduce a redirect side effect\n // when refreshing on-screen data, so handling this has been ommitted.\n }\n })\n\n fetchPromises.push(fetchPromise)\n }\n\n for (const key in parallelRoutes) {\n const parallelFetchPromise = refreshInactiveParallelSegmentsImpl({\n state,\n updatedTree: parallelRoutes[key],\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree,\n canonicalUrl,\n })\n\n fetchPromises.push(parallelFetchPromise)\n }\n\n await Promise.all(fetchPromises)\n}\n\n/**\n * Walks the current parallel segments to determine if they are \"active\".\n * An active parallel route will have a `__PAGE__` segment in the FlightRouterState.\n * As opposed to a `__DEFAULT__` segment, which means there was no match for that parallel route.\n * We add a special marker here so that we know how to refresh its data when the router is revalidated.\n */\nexport function addRefreshMarkerToActiveParallelSegments(\n tree: FlightRouterState,\n path: string\n) {\n const [segment, parallelRoutes, , refetchMarker] = tree\n // a page segment might also contain concatenated search params, so we do a partial match on the key\n if (segment.includes(PAGE_SEGMENT_KEY) && refetchMarker !== 'refresh') {\n tree[2] = path\n tree[3] = 'refresh'\n }\n\n for (const key in parallelRoutes) {\n addRefreshMarkerToActiveParallelSegments(parallelRoutes[key], path)\n }\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\nexport const ACTION_REFRESH = 'refresh'\nexport const ACTION_NAVIGATE = 'navigate'\nexport const ACTION_RESTORE = 'restore'\nexport const ACTION_SERVER_PATCH = 'server-patch'\nexport const ACTION_PREFETCH = 'prefetch'\nexport const ACTION_HMR_REFRESH = 'hmr-refresh'\nexport const ACTION_SERVER_ACTION = 'server-action'\n\nexport type RouterChangeByServerResponse = ({\n previousTree,\n serverResponse,\n}: {\n previousTree: FlightRouterState\n serverResponse: FetchServerResponseResult\n}) => void\n\nexport type RouterNavigate = (\n href: string,\n navigateType: 'push' | 'replace',\n shouldScroll: boolean\n) => void\n\nexport interface Mutable {\n mpaNavigation?: boolean\n patchedTree?: FlightRouterState\n canonicalUrl?: string\n scrollableSegments?: FlightSegmentPath[]\n pendingPush?: boolean\n cache?: CacheNode\n prefetchCache?: AppRouterState['prefetchCache']\n hashFragment?: string\n shouldScroll?: boolean\n preserveCustomHistoryState?: boolean\n onlyHashChange?: boolean\n}\n\nexport interface ServerActionMutable extends Mutable {\n inFlightServerAction?: Promise | null\n}\n\n/**\n * Refresh triggers a refresh of the full page data.\n * - fetches the Flight data and fills rsc at the root of the cache.\n * - The router state is updated at the root.\n */\nexport interface RefreshAction {\n type: typeof ACTION_REFRESH\n origin: Location['origin']\n}\n\nexport interface HmrRefreshAction {\n type: typeof ACTION_HMR_REFRESH\n origin: Location['origin']\n}\n\nexport type ServerActionDispatcher = (\n args: Omit<\n ServerActionAction,\n 'type' | 'mutable' | 'navigate' | 'changeByServerResponse' | 'cache'\n >\n) => void\n\nexport interface ServerActionAction {\n type: typeof ACTION_SERVER_ACTION\n actionId: string\n actionArgs: any[]\n resolve: (value: any) => void\n reject: (reason?: any) => void\n}\n\n/**\n * Navigate triggers a navigation to the provided url. It supports two types: `push` and `replace`.\n *\n * `navigateType`:\n * - `push` - pushes a new history entry in the browser history\n * - `replace` - replaces the current history entry in the browser history\n *\n * Navigate has multiple cache heuristics:\n * - page was prefetched\n * - Apply router state tree from prefetch\n * - Apply Flight data from prefetch to the cache\n * - If Flight data is a string, it's a redirect and the state is updated to trigger a redirect\n * - Check if hard navigation is needed\n * - Hard navigation happens when a dynamic parameter below the common layout changed\n * - When hard navigation is needed the cache is invalidated below the flightSegmentPath\n * - The missing cache nodes of the page will be fetched in layout-router and trigger the SERVER_PATCH action\n * - If hard navigation is not needed\n * - The cache is reused\n * - If any cache nodes are missing they'll be fetched in layout-router and trigger the SERVER_PATCH action\n * - page was not prefetched\n * - The navigate was called from `next/router` (`router.push()` / `router.replace()`) / `next/link` without prefetched data available (e.g. the prefetch didn't come back from the server before clicking the link)\n * - Flight data is fetched in the reducer (suspends the reducer)\n * - Router state tree is created based on Flight data\n * - Cache is filled based on the Flight data\n *\n * Above steps explain 3 cases:\n * - `soft` - Reuses the existing cache and fetches missing nodes in layout-router.\n * - `hard` - Creates a new cache where cache nodes are removed below the common layout and fetches missing nodes in layout-router.\n * - `optimistic` (explicit no prefetch) - Creates a new cache and kicks off the data fetch in the reducer. The data fetch is awaited in the layout-router.\n */\nexport interface NavigateAction {\n type: typeof ACTION_NAVIGATE\n url: URL\n isExternalUrl: boolean\n locationSearch: Location['search']\n navigateType: 'push' | 'replace'\n shouldScroll: boolean\n allowAliasing: boolean\n}\n\n/**\n * Restore applies the provided router state.\n * - Used for `popstate` (back/forward navigation) where a known router state has to be applied.\n * - Also used when syncing the router state with `pushState`/`replaceState` calls.\n * - Router state is applied as-is from the history state, if available.\n * - If the history state does not contain the router state, the existing router state is used.\n * - If any cache node is missing it will be fetched in layout-router during rendering and the server-patch case.\n * - If existing cache nodes match these are used.\n */\nexport interface RestoreAction {\n type: typeof ACTION_RESTORE\n url: URL\n tree: FlightRouterState | undefined\n}\n\n/**\n * Server-patch applies the provided Flight data to the cache and router tree.\n * - Only triggered in layout-router.\n * - Creates a new cache and router state with the Flight data applied.\n */\nexport interface ServerPatchAction {\n type: typeof ACTION_SERVER_PATCH\n serverResponse: FetchServerResponseResult\n previousTree: FlightRouterState\n}\n\n/**\n * PrefetchKind defines the type of prefetching that should be done.\n * - `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully.\n * - `full` - prefetch the page data fully.\n * - `temporary` - a temporary prefetch entry is added to the cache, this is used when prefetch={false} is used in next/link or when you push a route programmatically.\n */\n\nexport enum PrefetchKind {\n AUTO = 'auto',\n FULL = 'full',\n TEMPORARY = 'temporary',\n}\n\n/**\n * Prefetch adds the provided FlightData to the prefetch cache\n * - Creates the router state tree based on the patch in FlightData\n * - Adds the FlightData to the prefetch cache\n * - In ACTION_NAVIGATE the prefetch cache is checked and the router state tree and FlightData are applied.\n */\nexport interface PrefetchAction {\n type: typeof ACTION_PREFETCH\n url: URL\n kind: PrefetchKind\n}\n\nexport interface PushRef {\n /**\n * If the app-router should push a new history entry in app-router's useEffect()\n */\n pendingPush: boolean\n /**\n * Multi-page navigation through location.href.\n */\n mpaNavigation: boolean\n /**\n * Skip applying the router state to the browser history state.\n */\n preserveCustomHistoryState: boolean\n}\n\nexport type FocusAndScrollRef = {\n /**\n * If focus and scroll should be set in the layout-router's useEffect()\n */\n apply: boolean\n /**\n * The hash fragment that should be scrolled to.\n */\n hashFragment: string | null\n /**\n * The paths of the segments that should be focused.\n */\n segmentPaths: FlightSegmentPath[]\n /**\n * If only the URLs hash fragment changed\n */\n onlyHashChange: boolean\n}\n\nexport type PrefetchCacheEntry = {\n treeAtTimeOfPrefetch: FlightRouterState\n data: Promise\n kind: PrefetchKind\n prefetchTime: number\n staleTime: number\n lastUsedTime: number | null\n key: string\n status: PrefetchCacheEntryStatus\n url: URL\n}\n\nexport enum PrefetchCacheEntryStatus {\n fresh = 'fresh',\n reusable = 'reusable',\n expired = 'expired',\n stale = 'stale',\n}\n\n/**\n * Handles keeping the state of app-router.\n */\nexport type AppRouterState = {\n /**\n * The buildId is used to do a mpaNavigation when the server returns a different buildId.\n * It is used to avoid issues where an older version of the app is loaded in the browser while the server has a new version.\n */\n buildId: string\n /**\n * The router state, this is written into the history state in app-router using replaceState/pushState.\n * - Has to be serializable as it is written into the history state.\n * - Holds which segments and parallel routes are shown on the screen.\n */\n tree: FlightRouterState\n /**\n * The cache holds React nodes for every segment that is shown on screen as well as previously shown segments.\n * It also holds in-progress data requests.\n * Prefetched data is stored separately in `prefetchCache`, that is applied during ACTION_NAVIGATE.\n */\n cache: CacheNode\n /**\n * Cache that holds prefetched Flight responses keyed by url.\n */\n prefetchCache: Map\n /**\n * Decides if the update should create a new history entry and if the navigation has to trigger a browser navigation.\n */\n pushRef: PushRef\n /**\n * Decides if the update should apply scroll and focus management.\n */\n focusAndScrollRef: FocusAndScrollRef\n /**\n * The canonical url that is pushed/replaced.\n * - This is the url you see in the browser.\n */\n canonicalUrl: string\n /**\n * The underlying \"url\" representing the UI state, which is used for intercepting routes.\n */\n nextUrl: string | null\n}\n\nexport type ReadonlyReducerState = Readonly\nexport type ReducerState = Promise | AppRouterState\nexport type ReducerActions = Readonly<\n | RefreshAction\n | NavigateAction\n | RestoreAction\n | ServerPatchAction\n | PrefetchAction\n | HmrRefreshAction\n | ServerActionAction\n>\n","import {\n ACTION_NAVIGATE,\n ACTION_SERVER_PATCH,\n ACTION_RESTORE,\n ACTION_REFRESH,\n ACTION_PREFETCH,\n ACTION_HMR_REFRESH,\n ACTION_SERVER_ACTION,\n} from './router-reducer-types'\nimport type {\n ReducerActions,\n ReducerState,\n ReadonlyReducerState,\n} from './router-reducer-types'\nimport { navigateReducer } from './reducers/navigate-reducer'\nimport { serverPatchReducer } from './reducers/server-patch-reducer'\nimport { restoreReducer } from './reducers/restore-reducer'\nimport { refreshReducer } from './reducers/refresh-reducer'\nimport { prefetchReducer } from './reducers/prefetch-reducer'\nimport { hmrRefreshReducer } from './reducers/hmr-refresh-reducer'\nimport { serverActionReducer } from './reducers/server-action-reducer'\n\n/**\n * Reducer that handles the app-router state updates.\n */\nfunction clientReducer(\n state: ReadonlyReducerState,\n action: ReducerActions\n): ReducerState {\n switch (action.type) {\n case ACTION_NAVIGATE: {\n return navigateReducer(state, action)\n }\n case ACTION_SERVER_PATCH: {\n return serverPatchReducer(state, action)\n }\n case ACTION_RESTORE: {\n return restoreReducer(state, action)\n }\n case ACTION_REFRESH: {\n return refreshReducer(state, action)\n }\n case ACTION_HMR_REFRESH: {\n return hmrRefreshReducer(state, action)\n }\n case ACTION_PREFETCH: {\n return prefetchReducer(state, action)\n }\n case ACTION_SERVER_ACTION: {\n return serverActionReducer(state, action)\n }\n // This case should never be hit as dispatch is strongly typed.\n default:\n throw new Error('Unknown action')\n }\n}\n\nfunction serverReducer(\n state: ReadonlyReducerState,\n _action: ReducerActions\n): ReducerState {\n return state\n}\n\n// we don't run the client reducer on the server, so we use a noop function for better tree shaking\nexport const reducer =\n typeof window === 'undefined' ? serverReducer : clientReducer\n","import type {\n FlightRouterState,\n FlightDataPath,\n Segment,\n} from '../../../server/app-render/types'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { matchSegment } from '../match-segments'\n\n// TODO-APP: flightSegmentPath will be empty in case of static response, needs to be handled.\nexport function shouldHardNavigate(\n flightSegmentPath: FlightDataPath,\n flightRouterState: FlightRouterState\n): boolean {\n const [segment, parallelRoutes] = flightRouterState\n // TODO-APP: Check if `as` can be replaced.\n const [currentSegment, parallelRouteKey] = flightSegmentPath as [\n Segment,\n string,\n ]\n\n // Check if current segment matches the existing segment.\n if (!matchSegment(currentSegment, segment)) {\n // If dynamic parameter in tree doesn't match up with segment path a hard navigation is triggered.\n if (Array.isArray(currentSegment)) {\n return true\n }\n\n // If the existing segment did not match soft navigation is triggered.\n return false\n }\n const lastSegment = flightSegmentPath.length <= 2\n\n if (lastSegment) {\n return false\n }\n\n return shouldHardNavigate(\n getNextFlightSegmentPath(flightSegmentPath),\n parallelRoutes[parallelRouteKey]\n )\n}\n","const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT'\n\nexport class StaticGenBailoutError extends Error {\n public readonly code = NEXT_STATIC_GEN_BAILOUT\n}\n\nexport function isStaticGenBailoutError(\n error: unknown\n): error is StaticGenBailoutError {\n if (typeof error !== 'object' || error === null || !('code' in error)) {\n return false\n }\n\n return error.code === NEXT_STATIC_GEN_BAILOUT\n}\n","/**\n * Create a \"Thenable\" that does not resolve. This is used to suspend indefinitely when data is not available yet.\n */\nexport const unresolvedThenable = {\n then: () => {},\n} as PromiseLike\n","import { isDynamicUsageError } from '../../export/helpers/is-dynamic-usage-error'\nimport { isPostpone } from '../../server/lib/router-utils/is-postpone'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { isNextRouterError } from './is-next-router-error'\n\n/**\n * This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.\n * When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.\n * This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.\n *\n * Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)\n */\nexport function unstable_rethrow(error: unknown): void {\n if (\n isNextRouterError(error) ||\n isBailoutToCSRError(error) ||\n isDynamicUsageError(error) ||\n isPostpone(error)\n ) {\n throw error\n }\n\n if (error instanceof Error && 'cause' in error) {\n unstable_rethrow(error.cause)\n }\n}\n","import type { Dispatch } from 'react'\nimport React, { use } from 'react'\nimport { useCallback } from 'react'\nimport type {\n AppRouterState,\n ReducerActions,\n ReducerState,\n} from './router-reducer/router-reducer-types'\nimport type { AppRouterActionQueue } from '../../shared/lib/router/action-queue'\nimport { isThenable } from '../../shared/lib/is-thenable'\n\nexport function useUnwrapState(state: ReducerState): AppRouterState {\n // reducer actions can be async, so sometimes we need to suspend until the state is resolved\n if (isThenable(state)) {\n const result = use(state)\n return result\n }\n\n return state\n}\n\nexport function useReducer(\n actionQueue: AppRouterActionQueue\n): [ReducerState, Dispatch] {\n const [state, setState] = React.useState(actionQueue.state)\n\n const dispatch = useCallback(\n (action: ReducerActions) => {\n actionQueue.dispatch(action, setState)\n },\n [actionQueue]\n )\n\n return [state, dispatch]\n}\n","import type {\n CacheNodeSeedData,\n FlightData,\n FlightDataPath,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../server/app-render/types'\n\nexport type NormalizedFlightData = {\n /**\n * The full `FlightSegmentPath` inclusive of the final `Segment`\n */\n segmentPath: FlightSegmentPath\n /**\n * The `FlightSegmentPath` exclusive of the final `Segment`\n */\n pathToSegment: FlightSegmentPath\n segment: Segment\n tree: FlightRouterState\n seedData: CacheNodeSeedData | null\n head: React.ReactNode | null\n isRootRender: boolean\n}\n\n// TODO: We should only have to export `normalizeFlightData`, however because the initial flight data\n// that gets passed to `createInitialRouterState` doesn't conform to the `FlightDataPath` type (it's missing the root segment)\n// we're currently exporting it so we can use it directly. This should be fixed as part of the unification of\n// the different ways we express `FlightSegmentPath`.\nexport function getFlightDataPartsFromPath(\n flightDataPath: FlightDataPath\n): NormalizedFlightData {\n // tree, seedData, and head are *always* the last three items in the `FlightDataPath`.\n const [tree, seedData, head] = flightDataPath.slice(-3)\n // The `FlightSegmentPath` is everything except the last three items. For a root render, it won't be present.\n const segmentPath = flightDataPath.slice(0, -3)\n\n return {\n // TODO: Unify these two segment path helpers. We are inconsistently pushing an empty segment (\"\")\n // to the start of the segment path in some places which makes it hard to use solely the segment path.\n // Look for \"// TODO-APP: remove ''\" in the codebase.\n pathToSegment: segmentPath.slice(0, -1),\n segmentPath,\n // if the `FlightDataPath` corresponds with the root, there'll be no segment path,\n // in which case we default to ''.\n segment: segmentPath[segmentPath.length - 1] ?? '',\n tree,\n seedData,\n head,\n isRootRender: flightDataPath.length === 3,\n }\n}\n\nexport function getNextFlightSegmentPath(\n flightSegmentPath: FlightSegmentPath\n): FlightSegmentPath {\n // Since `FlightSegmentPath` is a repeated tuple of `Segment` and `ParallelRouteKey`, we slice off two items\n // to get the next segment path.\n return flightSegmentPath.slice(2)\n}\n\nexport function normalizeFlightData(\n flightData: FlightData\n): NormalizedFlightData[] | string {\n // FlightData can be a string when the server didn't respond with a proper flight response,\n // or when a redirect happens, to signal to the client that it needs to perform an MPA navigation.\n if (typeof flightData === 'string') {\n return flightData\n }\n\n return flightData.map(getFlightDataPartsFromPath)\n}\n","import { pathHasPrefix } from '../shared/lib/router/utils/path-has-prefix'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function hasBasePath(path: string): boolean {\n return pathHasPrefix(path, basePath)\n}\n","function formatObject(arg: unknown, depth: number) {\n switch (typeof arg) {\n case 'object':\n if (arg === null) {\n return 'null'\n } else if (Array.isArray(arg)) {\n let result = '['\n if (depth < 1) {\n for (let i = 0; i < arg.length; i++) {\n if (result !== '[') {\n result += ','\n }\n if (Object.prototype.hasOwnProperty.call(arg, i)) {\n result += formatObject(arg[i], depth + 1)\n }\n }\n } else {\n result += arg.length > 0 ? '...' : ''\n }\n result += ']'\n return result\n } else if (arg instanceof Error) {\n return arg + ''\n } else {\n const keys = Object.keys(arg)\n let result = '{'\n if (depth < 1) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n const desc = Object.getOwnPropertyDescriptor(arg, 'key')\n if (desc && !desc.get && !desc.set) {\n const jsonKey = JSON.stringify(key)\n if (jsonKey !== '\"' + key + '\"') {\n result += jsonKey + ': '\n } else {\n result += key + ': '\n }\n result += formatObject(desc.value, depth + 1)\n }\n }\n } else {\n result += keys.length > 0 ? '...' : ''\n }\n result += '}'\n return result\n }\n case 'string':\n return JSON.stringify(arg)\n default:\n return String(arg)\n }\n}\n\nexport function formatConsoleArgs(args: unknown[]): string {\n let message: string\n let idx: number\n if (typeof args[0] === 'string') {\n message = args[0]\n idx = 1\n } else {\n message = ''\n idx = 0\n }\n let result = ''\n let startQuote = false\n for (let i = 0; i < message.length; ++i) {\n const char = message[i]\n if (char !== '%' || i === message.length - 1 || idx >= args.length) {\n result += char\n continue\n }\n\n const code = message[++i]\n switch (code) {\n case 'c': {\n // TODO: We should colorize with HTML instead of turning into a string.\n // Ignore for now.\n result = startQuote ? `${result}]` : `[${result}`\n startQuote = !startQuote\n idx++\n break\n }\n case 'O':\n case 'o': {\n result += formatObject(args[idx++], 0)\n break\n }\n case 'd':\n case 'i': {\n result += parseInt(args[idx++] as any, 10)\n break\n }\n case 'f': {\n result += parseFloat(args[idx++] as any)\n break\n }\n case 's': {\n result += String(args[idx++])\n break\n }\n default:\n result += '%' + code\n }\n }\n\n for (; idx < args.length; idx++) {\n result += (idx > 0 ? ' ' : '') + formatObject(args[idx], 0)\n }\n\n return result\n}\n","import { removeTrailingSlash } from '../shared/lib/router/utils/remove-trailing-slash'\nimport { parsePath } from '../shared/lib/router/utils/parse-path'\n\n/**\n * Normalizes the trailing slash of a path according to the `trailingSlash` option\n * in `next.config.js`.\n */\nexport const normalizePathTrailingSlash = (path: string) => {\n if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n if (process.env.__NEXT_TRAILING_SLASH) {\n if (/\\.[^/]+\\/?$/.test(pathname)) {\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n } else if (pathname.endsWith('/')) {\n return `${pathname}${query}${hash}`\n } else {\n return `${pathname}/${query}${hash}`\n }\n }\n\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n}\n","// This file is only used in app router due to the specific error state handling.\n\nimport type { HydrationOptions } from 'react-dom/client'\nimport { getReactStitchedError } from '../components/react-dev-overlay/internal/helpers/stitched-error'\nimport { handleClientError } from '../components/react-dev-overlay/internal/helpers/use-error-handler'\nimport { isNextRouterError } from '../components/is-next-router-error'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { reportGlobalError } from './report-global-error'\nimport { originConsoleError } from '../components/globals/intercept-console-error'\n\nexport const onCaughtError: HydrationOptions['onCaughtError'] = (\n err,\n errorInfo\n) => {\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(err) || isNextRouterError(err)) return\n\n if (process.env.NODE_ENV !== 'production') {\n const errorBoundaryComponent = errorInfo?.errorBoundary?.constructor\n const errorBoundaryName =\n // read react component displayName\n (errorBoundaryComponent as any)?.displayName ||\n errorBoundaryComponent?.name ||\n 'Unknown'\n\n const componentThatErroredFrame = errorInfo?.componentStack?.split('\\n')[1]\n\n // Match chrome or safari stack trace\n const matches =\n // regex to match the function name in the stack trace\n // example 1: at Page (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1631600000000:2:1)\n // example 2: Page@http://localhost:3000/_next/static/chunks/pages/index.js?ts=1631600000000:2:1\n componentThatErroredFrame?.match(/\\s+at (\\w+)\\s+|(\\w+)@/) ?? []\n const componentThatErroredName = matches[1] || matches[2] || 'Unknown'\n\n // Create error location with errored component and error boundary, to match the behavior of default React onCaughtError handler.\n const errorBoundaryMessage = `It was handled by the <${errorBoundaryName}> error boundary.`\n const componentErrorMessage = componentThatErroredName\n ? `The above error occurred in the <${componentThatErroredName}> component.`\n : `The above error occurred in one of your components.`\n\n const errorLocation = `${componentErrorMessage} ${errorBoundaryMessage}`\n\n const stitchedError = getReactStitchedError(err)\n // TODO: change to passing down errorInfo later\n // In development mode, pass along the component stack to the error\n if (errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n\n // Log and report the error with location but without modifying the error stack\n originConsoleError('%o\\n\\n%s', err, errorLocation)\n\n handleClientError(stitchedError, [])\n } else {\n originConsoleError(err)\n }\n}\n\nexport const onUncaughtError: HydrationOptions['onUncaughtError'] = (\n err,\n errorInfo\n) => {\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(err) || isNextRouterError(err)) return\n\n if (process.env.NODE_ENV !== 'production') {\n const componentThatErroredFrame = errorInfo?.componentStack?.split('\\n')[1]\n\n // Match chrome or safari stack trace\n const matches =\n componentThatErroredFrame?.match(/\\s+at (\\w+)\\s+|(\\w+)@/) ?? []\n const componentThatErroredName = matches[1] || matches[2] || 'Unknown'\n\n // Create error location with errored component and error boundary, to match the behavior of default React onCaughtError handler.\n const errorLocation = componentThatErroredName\n ? `The above error occurred in the <${componentThatErroredName}> component.`\n : `The above error occurred in one of your components.`\n\n const stitchedError = getReactStitchedError(err)\n // TODO: change to passing down errorInfo later\n // In development mode, pass along the component stack to the error\n if (errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n\n // Log and report the error with location but without modifying the error stack\n originConsoleError('%o\\n\\n%s', err, errorLocation)\n reportGlobalError(stitchedError)\n } else {\n reportGlobalError(err)\n }\n}\n","export const reportGlobalError =\n typeof reportError === 'function'\n ? // In modern browsers, reportError will dispatch an error event,\n // emulating an uncaught JavaScript error.\n reportError\n : (error: unknown) => {\n window.console.error(error)\n }\n","// This module can be shared between both pages router and app router\n\nimport type { HydrationOptions } from 'react-dom/client'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { reportGlobalError } from './report-global-error'\nimport { getReactStitchedError } from '../components/react-dev-overlay/internal/helpers/stitched-error'\nimport isError from '../../lib/is-error'\n\nexport const onRecoverableError: HydrationOptions['onRecoverableError'] = (\n error,\n errorInfo\n) => {\n // x-ref: https://github.com/facebook/react/pull/28736\n const cause = isError(error) && 'cause' in error ? error.cause : error\n const stitchedError = getReactStitchedError(cause)\n // In development mode, pass along the component stack to the error\n if (process.env.NODE_ENV === 'development' && errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(cause)) return\n\n reportGlobalError(stitchedError)\n}\n","import { hasBasePath } from './has-base-path'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function removeBasePath(path: string): string {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!hasBasePath(path)) {\n return path\n }\n }\n\n // Can't trim the basePath if it has zero length!\n if (basePath.length === 0) return path\n\n path = path.slice(basePath.length)\n if (!path.startsWith('/')) path = `/${path}`\n return path\n}\n","/**\n * @license React\n * scheduler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);\n else break a;\n }\n}\nfunction peek(heap) {\n return 0 === heap.length ? null : heap[0];\n}\nfunction pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);\n else break a;\n }\n }\n return first;\n}\nfunction compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n}\nexports.unstable_now = void 0;\nif (\"object\" === typeof performance && \"function\" === typeof performance.now) {\n var localPerformance = performance;\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date,\n initialTime = localDate.now();\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n}\nvar taskQueue = [],\n timerQueue = [],\n taskIdCounter = 1,\n currentTask = null,\n currentPriorityLevel = 3,\n isPerformingWork = !1,\n isHostCallbackScheduled = !1,\n isHostTimeoutScheduled = !1,\n localSetTimeout = \"function\" === typeof setTimeout ? setTimeout : null,\n localClearTimeout = \"function\" === typeof clearTimeout ? clearTimeout : null,\n localSetImmediate = \"undefined\" !== typeof setImmediate ? setImmediate : null;\nfunction advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer; ) {\n if (null === timer.callback) pop(timerQueue);\n else if (timer.startTime <= currentTime)\n pop(timerQueue),\n (timer.sortIndex = timer.expirationTime),\n push(taskQueue, timer);\n else break;\n timer = peek(timerQueue);\n }\n}\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = !1;\n advanceTimers(currentTime);\n if (!isHostCallbackScheduled)\n if (null !== peek(taskQueue))\n (isHostCallbackScheduled = !0), requestHostCallback();\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n}\nvar isMessageLoopRunning = !1,\n taskTimeoutID = -1,\n frameInterval = 5,\n startTime = -1;\nfunction shouldYieldToHost() {\n return exports.unstable_now() - startTime < frameInterval ? !1 : !0;\n}\nfunction performWorkUntilDeadline() {\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime && shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n}\nvar schedulePerformWorkUntilDeadline;\nif (\"function\" === typeof localSetImmediate)\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\nelse if (\"undefined\" !== typeof MessageChannel) {\n var channel = new MessageChannel(),\n port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\nfunction requestHostCallback() {\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());\n}\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\nexports.unstable_IdlePriority = 5;\nexports.unstable_ImmediatePriority = 1;\nexports.unstable_LowPriority = 4;\nexports.unstable_NormalPriority = 3;\nexports.unstable_Profiling = null;\nexports.unstable_UserBlockingPriority = 2;\nexports.unstable_cancelCallback = function (task) {\n task.callback = null;\n};\nexports.unstable_continueExecution = function () {\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0), requestHostCallback());\n};\nexports.unstable_forceFrameRate = function (fps) {\n 0 > fps || 125 < fps\n ? console.error(\n \"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"\n )\n : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);\n};\nexports.unstable_getCurrentPriorityLevel = function () {\n return currentPriorityLevel;\n};\nexports.unstable_getFirstCallbackNode = function () {\n return peek(taskQueue);\n};\nexports.unstable_next = function (eventHandler) {\n switch (currentPriorityLevel) {\n case 1:\n case 2:\n case 3:\n var priorityLevel = 3;\n break;\n default:\n priorityLevel = currentPriorityLevel;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_pauseExecution = function () {};\nexports.unstable_requestPaint = function () {};\nexports.unstable_runWithPriority = function (priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n default:\n priorityLevel = 3;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_scheduleCallback = function (\n priorityLevel,\n callback,\n options\n) {\n var currentTime = exports.unstable_now();\n \"object\" === typeof options && null !== options\n ? ((options = options.delay),\n (options =\n \"number\" === typeof options && 0 < options\n ? currentTime + options\n : currentTime))\n : (options = currentTime);\n switch (priorityLevel) {\n case 1:\n var timeout = -1;\n break;\n case 2:\n timeout = 250;\n break;\n case 5:\n timeout = 1073741823;\n break;\n case 4:\n timeout = 1e4;\n break;\n default:\n timeout = 5e3;\n }\n timeout = options + timeout;\n priorityLevel = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: options,\n expirationTime: timeout,\n sortIndex: -1\n };\n options > currentTime\n ? ((priorityLevel.sortIndex = options),\n push(timerQueue, priorityLevel),\n null === peek(taskQueue) &&\n priorityLevel === peek(timerQueue) &&\n (isHostTimeoutScheduled\n ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))\n : (isHostTimeoutScheduled = !0),\n requestHostTimeout(handleTimeout, options - currentTime)))\n : ((priorityLevel.sortIndex = timeout),\n push(taskQueue, priorityLevel),\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0), requestHostCallback()));\n return priorityLevel;\n};\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = function (callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isDynamicUsageError\", {\n enumerable: true,\n get: function() {\n return isDynamicUsageError;\n }\n});\nconst _hooksservercontext = require(\"../../client/components/hooks-server-context\");\nconst _bailouttocsr = require(\"../../shared/lib/lazy-dynamic/bailout-to-csr\");\nconst _isnextroutererror = require(\"../../client/components/is-next-router-error\");\nconst _dynamicrendering = require(\"../../server/app-render/dynamic-rendering\");\nconst isDynamicUsageError = (err)=>(0, _hooksservercontext.isDynamicServerError)(err) || (0, _bailouttocsr.isBailoutToCSRError)(err) || (0, _isnextroutererror.isNextRouterError)(err) || (0, _dynamicrendering.isDynamicPostpone)(err);\n\n//# sourceMappingURL=is-dynamic-usage-error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n default: null,\n getProperError: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n /**\n * Checks whether the given value is a NextError.\n * This can be used to print a more detailed error message with properties like `code` & `digest`.\n */ default: function() {\n return isError;\n },\n getProperError: function() {\n return getProperError;\n }\n});\nconst _isplainobject = require(\"../shared/lib/is-plain-object\");\nfunction isError(err) {\n return typeof err === 'object' && err !== null && 'name' in err && 'message' in err;\n}\nfunction safeStringify(obj) {\n const seen = new WeakSet();\n return JSON.stringify(obj, (_key, value)=>{\n // If value is an object and already seen, replace with \"[Circular]\"\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return '[Circular]';\n }\n seen.add(value);\n }\n return value;\n });\n}\nfunction getProperError(err) {\n if (isError(err)) {\n return err;\n }\n if (process.env.NODE_ENV === 'development') {\n // provide better error for case where `throw undefined`\n // is called in development\n if (typeof err === 'undefined') {\n return new Error('An undefined error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined');\n }\n if (err === null) {\n return new Error('A null error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined');\n }\n }\n return new Error((0, _isplainobject.isPlainObject)(err) ? safeStringify(err) : err + '');\n}\n\n//# sourceMappingURL=is-error.js.map","'use client'\n\nimport {\n METADATA_BOUNDARY_NAME,\n VIEWPORT_BOUNDARY_NAME,\n OUTLET_BOUNDARY_NAME,\n} from './metadata-constants'\n\n// We use a namespace object to allow us to recover the name of the function\n// at runtime even when production bundling/minification is used.\nconst NameSpace = {\n [METADATA_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n [VIEWPORT_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n [OUTLET_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n}\n\nexport const MetadataBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[METADATA_BOUNDARY_NAME.slice(0) as typeof METADATA_BOUNDARY_NAME]\n\nexport const ViewportBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[VIEWPORT_BOUNDARY_NAME.slice(0) as typeof VIEWPORT_BOUNDARY_NAME]\n\nexport const OutletBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[OUTLET_BOUNDARY_NAME.slice(0) as typeof OUTLET_BOUNDARY_NAME]\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n METADATA_BOUNDARY_NAME: null,\n OUTLET_BOUNDARY_NAME: null,\n VIEWPORT_BOUNDARY_NAME: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n METADATA_BOUNDARY_NAME: function() {\n return METADATA_BOUNDARY_NAME;\n },\n OUTLET_BOUNDARY_NAME: function() {\n return OUTLET_BOUNDARY_NAME;\n },\n VIEWPORT_BOUNDARY_NAME: function() {\n return VIEWPORT_BOUNDARY_NAME;\n }\n});\nconst METADATA_BOUNDARY_NAME = '__next_metadata_boundary__';\nconst VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__';\nconst OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__';\n\n//# sourceMappingURL=metadata-constants.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n atLeastOneTask: null,\n scheduleImmediate: null,\n scheduleOnNextTick: null,\n waitAtLeastOneReactRenderTask: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n atLeastOneTask: function() {\n return atLeastOneTask;\n },\n scheduleImmediate: function() {\n return scheduleImmediate;\n },\n scheduleOnNextTick: function() {\n return scheduleOnNextTick;\n },\n waitAtLeastOneReactRenderTask: function() {\n return waitAtLeastOneReactRenderTask;\n }\n});\nconst scheduleOnNextTick = (cb)=>{\n // We use Promise.resolve().then() here so that the operation is scheduled at\n // the end of the promise job queue, we then add it to the next process tick\n // to ensure it's evaluated afterwards.\n //\n // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255\n //\n Promise.resolve().then(()=>{\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0);\n } else {\n process.nextTick(cb);\n }\n });\n};\nconst scheduleImmediate = (cb)=>{\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0);\n } else {\n setImmediate(cb);\n }\n};\nfunction atLeastOneTask() {\n return new Promise((resolve)=>scheduleImmediate(resolve));\n}\nfunction waitAtLeastOneReactRenderTask() {\n if (process.env.NEXT_RUNTIME === 'edge') {\n return new Promise((r)=>setTimeout(r, 0));\n } else {\n return new Promise((r)=>setImmediate(r));\n }\n}\n\n//# sourceMappingURL=scheduler.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"actionAsyncStorage\", {\n enumerable: true,\n get: function() {\n return _actionasyncstorageinstance.actionAsyncStorage;\n }\n});\nconst _actionasyncstorageinstance = require(\"./action-async-storage-instance\");\n\n//# sourceMappingURL=action-async-storage.external.js.map","/**\n * The functions provided by this module are used to communicate certain properties\n * about the currently running code so that Next.js can make decisions on how to handle\n * the current execution in different rendering modes such as pre-rendering, resuming, and SSR.\n *\n * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.\n * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts\n * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of\n * Dynamic indications.\n *\n * The first is simply an intention to be dynamic. unstable_noStore is an example of this where\n * the currently executing code simply declares that the current scope is dynamic but if you use it\n * inside unstable_cache it can still be cached. This type of indication can be removed if we ever\n * make the default dynamic to begin with because the only way you would ever be static is inside\n * a cache scope which this indication does not affect.\n *\n * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic\n * because it means that it is inappropriate to cache this at all. using a dynamic data source inside\n * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should\n * read that data outside the cache and pass it in as an argument to the cached function.\n */ \"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n Postpone: null,\n abortAndThrowOnSynchronousRequestDataAccess: null,\n abortOnSynchronousPlatformIOAccess: null,\n accessedDynamicData: null,\n annotateDynamicAccess: null,\n consumeDynamicAccess: null,\n createDynamicTrackingState: null,\n createDynamicValidationState: null,\n createPostponedAbortSignal: null,\n formatDynamicAPIAccesses: null,\n getFirstDynamicReason: null,\n isDynamicPostpone: null,\n isPrerenderInterruptedError: null,\n markCurrentScopeAsDynamic: null,\n postponeWithTracking: null,\n throwIfDisallowedDynamic: null,\n throwToInterruptStaticGeneration: null,\n trackAllowedDynamicAccess: null,\n trackDynamicDataInDynamicRender: null,\n trackFallbackParamAccessed: null,\n trackSynchronousPlatformIOAccessInDev: null,\n trackSynchronousRequestDataAccessInDev: null,\n useDynamicRouteParams: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n Postpone: function() {\n return Postpone;\n },\n abortAndThrowOnSynchronousRequestDataAccess: function() {\n return abortAndThrowOnSynchronousRequestDataAccess;\n },\n abortOnSynchronousPlatformIOAccess: function() {\n return abortOnSynchronousPlatformIOAccess;\n },\n accessedDynamicData: function() {\n return accessedDynamicData;\n },\n annotateDynamicAccess: function() {\n return annotateDynamicAccess;\n },\n consumeDynamicAccess: function() {\n return consumeDynamicAccess;\n },\n createDynamicTrackingState: function() {\n return createDynamicTrackingState;\n },\n createDynamicValidationState: function() {\n return createDynamicValidationState;\n },\n createPostponedAbortSignal: function() {\n return createPostponedAbortSignal;\n },\n formatDynamicAPIAccesses: function() {\n return formatDynamicAPIAccesses;\n },\n getFirstDynamicReason: function() {\n return getFirstDynamicReason;\n },\n isDynamicPostpone: function() {\n return isDynamicPostpone;\n },\n isPrerenderInterruptedError: function() {\n return isPrerenderInterruptedError;\n },\n markCurrentScopeAsDynamic: function() {\n return markCurrentScopeAsDynamic;\n },\n postponeWithTracking: function() {\n return postponeWithTracking;\n },\n throwIfDisallowedDynamic: function() {\n return throwIfDisallowedDynamic;\n },\n throwToInterruptStaticGeneration: function() {\n return throwToInterruptStaticGeneration;\n },\n trackAllowedDynamicAccess: function() {\n return trackAllowedDynamicAccess;\n },\n trackDynamicDataInDynamicRender: function() {\n return trackDynamicDataInDynamicRender;\n },\n trackFallbackParamAccessed: function() {\n return trackFallbackParamAccessed;\n },\n trackSynchronousPlatformIOAccessInDev: function() {\n return trackSynchronousPlatformIOAccessInDev;\n },\n trackSynchronousRequestDataAccessInDev: function() {\n return trackSynchronousRequestDataAccessInDev;\n },\n useDynamicRouteParams: function() {\n return useDynamicRouteParams;\n }\n});\nconst _react = /*#__PURE__*/ _interop_require_default(require(\"react\"));\nconst _hooksservercontext = require(\"../../client/components/hooks-server-context\");\nconst _staticgenerationbailout = require(\"../../client/components/static-generation-bailout\");\nconst _workunitasyncstorageexternal = require(\"./work-unit-async-storage.external\");\nconst _workasyncstorageexternal = require(\"../app-render/work-async-storage.external\");\nconst _dynamicrenderingutils = require(\"../dynamic-rendering-utils\");\nconst _metadataconstants = require(\"../../lib/metadata/metadata-constants\");\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst hasPostpone = typeof _react.default.unstable_postpone === 'function';\nfunction createDynamicTrackingState(isDebugDynamicAccesses) {\n return {\n isDebugDynamicAccesses,\n dynamicAccesses: [],\n syncDynamicExpression: undefined,\n syncDynamicErrorWithStack: null\n };\n}\nfunction createDynamicValidationState() {\n return {\n hasSuspendedDynamic: false,\n hasDynamicMetadata: false,\n hasDynamicViewport: false,\n hasSyncDynamicErrors: false,\n dynamicErrors: []\n };\n}\nfunction getFirstDynamicReason(trackingState) {\n var _trackingState_dynamicAccesses_;\n return (_trackingState_dynamicAccesses_ = trackingState.dynamicAccesses[0]) == null ? void 0 : _trackingState_dynamicAccesses_.expression;\n}\nfunction markCurrentScopeAsDynamic(store, workUnitStore, expression) {\n if (workUnitStore) {\n if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {\n // inside cache scopes marking a scope as dynamic has no effect because the outer cache scope\n // creates a cache boundary. This is subtly different from reading a dynamic data source which is\n // forbidden inside a cache scope.\n return;\n }\n }\n // If we're forcing dynamic rendering or we're forcing static rendering, we\n // don't need to do anything here because the entire page is already dynamic\n // or it's static and it should not throw or postpone here.\n if (store.forceDynamic || store.forceStatic) return;\n if (store.dynamicShouldError) {\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n }\n if (workUnitStore) {\n if (workUnitStore.type === 'prerender-ppr') {\n postponeWithTracking(store.route, expression, workUnitStore.dynamicTracking);\n } else if (workUnitStore.type === 'prerender-legacy') {\n workUnitStore.revalidate = 0;\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);\n store.dynamicUsageDescription = expression;\n store.dynamicUsageStack = err.stack;\n throw err;\n } else if (process.env.NODE_ENV === 'development' && workUnitStore && workUnitStore.type === 'request') {\n workUnitStore.usedDynamic = true;\n }\n }\n}\nfunction trackFallbackParamAccessed(store, expression) {\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (!prerenderStore || prerenderStore.type !== 'prerender-ppr') return;\n postponeWithTracking(store.route, expression, prerenderStore.dynamicTracking);\n}\nfunction throwToInterruptStaticGeneration(expression, store, prerenderStore) {\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);\n prerenderStore.revalidate = 0;\n store.dynamicUsageDescription = expression;\n store.dynamicUsageStack = err.stack;\n throw err;\n}\nfunction trackDynamicDataInDynamicRender(_store, workUnitStore) {\n if (workUnitStore) {\n if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {\n // inside cache scopes marking a scope as dynamic has no effect because the outer cache scope\n // creates a cache boundary. This is subtly different from reading a dynamic data source which is\n // forbidden inside a cache scope.\n return;\n }\n if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-legacy') {\n workUnitStore.revalidate = 0;\n }\n if (process.env.NODE_ENV === 'development' && workUnitStore.type === 'request') {\n workUnitStore.usedDynamic = true;\n }\n }\n}\n// Despite it's name we don't actually abort unless we have a controller to call abort on\n// There are times when we let a prerender run long to discover caches where we want the semantics\n// of tracking dynamic access without terminating the prerender early\nfunction abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) {\n const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`;\n const error = createPrerenderInterruptedError(reason);\n prerenderStore.controller.abort(error);\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n}\nfunction abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicExpression = expression;\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack;\n }\n }\n return abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);\n}\nfunction trackSynchronousPlatformIOAccessInDev(requestStore) {\n // We don't actually have a controller to abort but we do the semantic equivalent by\n // advancing the request store out of prerender mode\n requestStore.prerenderPhase = false;\n}\nfunction abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicExpression = expression;\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack;\n if (prerenderStore.validating === true) {\n // We always log Request Access in dev at the point of calling the function\n // So we mark the dynamic validation as not requiring it to be printed\n dynamicTracking.syncDynamicLogged = true;\n }\n }\n }\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);\n throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`);\n}\nconst trackSynchronousRequestDataAccessInDev = trackSynchronousPlatformIOAccessInDev;\nfunction Postpone({ reason, route }) {\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n const dynamicTracking = prerenderStore && prerenderStore.type === 'prerender-ppr' ? prerenderStore.dynamicTracking : null;\n postponeWithTracking(route, reason, dynamicTracking);\n}\nfunction postponeWithTracking(route, expression, dynamicTracking) {\n assertPostpone();\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n _react.default.unstable_postpone(createPostponeReason(route, expression));\n}\nfunction createPostponeReason(route, expression) {\n return `Route ${route} needs to bail out of prerendering at this point because it used ${expression}. ` + `React throws this special object to indicate where. It should not be caught by ` + `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;\n}\nfunction isDynamicPostpone(err) {\n if (typeof err === 'object' && err !== null && typeof err.message === 'string') {\n return isDynamicPostponeReason(err.message);\n }\n return false;\n}\nfunction isDynamicPostponeReason(reason) {\n return reason.includes('needs to bail out of prerendering at this point because it used') && reason.includes('Learn more: https://nextjs.org/docs/messages/ppr-caught-error');\n}\nif (isDynamicPostponeReason(createPostponeReason('%%%', '^^^')) === false) {\n throw new Error('Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js');\n}\nconst NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED';\nfunction createPrerenderInterruptedError(message) {\n const error = new Error(message);\n error.digest = NEXT_PRERENDER_INTERRUPTED;\n return error;\n}\nfunction isPrerenderInterruptedError(error) {\n return typeof error === 'object' && error !== null && error.digest === NEXT_PRERENDER_INTERRUPTED && 'name' in error && 'message' in error && error instanceof Error;\n}\nfunction accessedDynamicData(dynamicAccesses) {\n return dynamicAccesses.length > 0;\n}\nfunction consumeDynamicAccess(serverDynamic, clientDynamic) {\n // We mutate because we only call this once we are no longer writing\n // to the dynamicTrackingState and it's more efficient than creating a new\n // array.\n serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses);\n return serverDynamic.dynamicAccesses;\n}\nfunction formatDynamicAPIAccesses(dynamicAccesses) {\n return dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{\n stack = stack.split('\\n')// Remove the \"Error: \" prefix from the first line of the stack trace as\n // well as the first 4 lines of the stack trace which is the distance\n // from the user code and the `new Error().stack` call.\n .slice(4).filter((line)=>{\n // Exclude Next.js internals from the stack trace.\n if (line.includes('node_modules/next/')) {\n return false;\n }\n // Exclude anonymous functions from the stack trace.\n if (line.includes(' ()')) {\n return false;\n }\n // Exclude Node.js internals from the stack trace.\n if (line.includes(' (node:')) {\n return false;\n }\n return true;\n }).join('\\n');\n return `Dynamic API Usage Debug - ${expression}:\\n${stack}`;\n });\n}\nfunction assertPostpone() {\n if (!hasPostpone) {\n throw new Error(`Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`);\n }\n}\nfunction createPostponedAbortSignal(reason) {\n assertPostpone();\n const controller = new AbortController();\n // We get our hands on a postpone instance by calling postpone and catching the throw\n try {\n _react.default.unstable_postpone(reason);\n } catch (x) {\n controller.abort(x);\n }\n return controller.signal;\n}\nfunction annotateDynamicAccess(expression, prerenderStore) {\n const dynamicTracking = prerenderStore.dynamicTracking;\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,\n expression\n });\n }\n}\nfunction useDynamicRouteParams(expression) {\n if (typeof window === 'undefined') {\n const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();\n if (workStore && workStore.isStaticGeneration && workStore.fallbackRouteParams && workStore.fallbackRouteParams.size > 0) {\n // There are fallback route params, we should track these as dynamic\n // accesses.\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n // We're prerendering with dynamicIO or PPR or both\n if (workUnitStore.type === 'prerender') {\n // We are in a prerender with dynamicIO semantics\n // We are going to hang here and never resolve. This will cause the currently\n // rendering component to effectively be a dynamic hole\n _react.default.use((0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, expression));\n } else if (workUnitStore.type === 'prerender-ppr') {\n // We're prerendering with PPR\n postponeWithTracking(workStore.route, expression, workUnitStore.dynamicTracking);\n } else if (workUnitStore.type === 'prerender-legacy') {\n throwToInterruptStaticGeneration(expression, workStore, workUnitStore);\n }\n }\n }\n }\n}\nconst hasSuspenseRegex = /\\n\\s+at Suspense \\(\\)/;\nconst hasMetadataRegex = new RegExp(`\\\\n\\\\s+at ${_metadataconstants.METADATA_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst hasViewportRegex = new RegExp(`\\\\n\\\\s+at ${_metadataconstants.VIEWPORT_BOUNDARY_NAME}[\\\\n\\\\s]`);\nconst hasOutletRegex = new RegExp(`\\\\n\\\\s+at ${_metadataconstants.OUTLET_BOUNDARY_NAME}[\\\\n\\\\s]`);\nfunction trackAllowedDynamicAccess(route, componentStack, dynamicValidation, serverDynamic, clientDynamic) {\n if (hasOutletRegex.test(componentStack)) {\n // We don't need to track that this is dynamic. It is only so when something else is also dynamic.\n return;\n } else if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.hasDynamicMetadata = true;\n return;\n } else if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.hasDynamicViewport = true;\n return;\n } else if (hasSuspenseRegex.test(componentStack)) {\n dynamicValidation.hasSuspendedDynamic = true;\n return;\n } else if (serverDynamic.syncDynamicErrorWithStack || clientDynamic.syncDynamicErrorWithStack) {\n dynamicValidation.hasSyncDynamicErrors = true;\n return;\n } else {\n const message = `Route \"${route}\": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a \"use cache\" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`;\n const error = createErrorWithComponentStack(message, componentStack);\n dynamicValidation.dynamicErrors.push(error);\n return;\n }\n}\nfunction createErrorWithComponentStack(message, componentStack) {\n const error = new Error(message);\n error.stack = 'Error: ' + message + componentStack;\n return error;\n}\nfunction throwIfDisallowedDynamic(route, dynamicValidation, serverDynamic, clientDynamic) {\n let syncError;\n let syncExpression;\n let syncLogged;\n if (serverDynamic.syncDynamicErrorWithStack) {\n syncError = serverDynamic.syncDynamicErrorWithStack;\n syncExpression = serverDynamic.syncDynamicExpression;\n syncLogged = serverDynamic.syncDynamicLogged === true;\n } else if (clientDynamic.syncDynamicErrorWithStack) {\n syncError = clientDynamic.syncDynamicErrorWithStack;\n syncExpression = clientDynamic.syncDynamicExpression;\n syncLogged = clientDynamic.syncDynamicLogged === true;\n } else {\n syncError = null;\n syncExpression = undefined;\n syncLogged = false;\n }\n if (dynamicValidation.hasSyncDynamicErrors && syncError) {\n if (!syncLogged) {\n // In dev we already log errors about sync dynamic access. But during builds we need to ensure\n // the offending sync error is logged before we exit the build\n console.error(syncError);\n }\n // The actual error should have been logged when the sync access ocurred\n throw new _staticgenerationbailout.StaticGenBailoutError();\n }\n const dynamicErrors = dynamicValidation.dynamicErrors;\n if (dynamicErrors.length) {\n for(let i = 0; i < dynamicErrors.length; i++){\n console.error(dynamicErrors[i]);\n }\n throw new _staticgenerationbailout.StaticGenBailoutError();\n }\n if (!dynamicValidation.hasSuspendedDynamic) {\n if (dynamicValidation.hasDynamicMetadata) {\n if (syncError) {\n console.error(syncError);\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateMetadata\\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`);\n }\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateMetadata\\` that depends on Request data (\\`cookies()\\`, etc...) or external data (\\`fetch(...)\\`, etc...) but the rest of the route was static or only used cached data (\\`\"use cache\"\\`). If you expected this route to be prerenderable update your \\`generateMetadata\\` to not use Request data and only use cached external data. Otherwise, add \\`await connection()\\` somewhere within this route to indicate explicitly it should not be prerendered.`);\n } else if (dynamicValidation.hasDynamicViewport) {\n if (syncError) {\n console.error(syncError);\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateViewport\\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`);\n }\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route \"${route}\" has a \\`generateViewport\\` that depends on Request data (\\`cookies()\\`, etc...) or external data (\\`fetch(...)\\`, etc...) but the rest of the route was static or only used cached data (\\`\"use cache\"\\`). If you expected this route to be prerenderable update your \\`generateViewport\\` to not use Request data and only use cached external data. Otherwise, add \\`await connection()\\` somewhere within this route to indicate explicitly it should not be prerendered.`);\n }\n }\n}\n\n//# sourceMappingURL=dynamic-rendering.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"getSegmentParam\", {\n enumerable: true,\n get: function() {\n return getSegmentParam;\n }\n});\nconst _interceptionroutes = require(\"../lib/interception-routes\");\nfunction getSegmentParam(segment) {\n const interceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((marker)=>segment.startsWith(marker));\n // if an interception marker is part of the path segment, we need to jump ahead\n // to the relevant portion for param parsing\n if (interceptionMarker) {\n segment = segment.slice(interceptionMarker.length);\n }\n if (segment.startsWith('[[...') && segment.endsWith(']]')) {\n return {\n // TODO-APP: Optional catchall does not currently work with parallel routes,\n // so for now aren't handling a potential interception marker.\n type: 'optional-catchall',\n param: segment.slice(5, -2)\n };\n }\n if (segment.startsWith('[...') && segment.endsWith(']')) {\n return {\n type: interceptionMarker ? 'catchall-intercepted' : 'catchall',\n param: segment.slice(4, -1)\n };\n }\n if (segment.startsWith('[') && segment.endsWith(']')) {\n return {\n type: interceptionMarker ? 'dynamic-intercepted' : 'dynamic',\n param: segment.slice(1, -1)\n };\n }\n return null;\n}\n\n//# sourceMappingURL=get-segment-param.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"workAsyncStorage\", {\n enumerable: true,\n get: function() {\n return _workasyncstorageinstance.workAsyncStorage;\n }\n});\nconst _workasyncstorageinstance = require(\"./work-async-storage-instance\");\n\n//# sourceMappingURL=work-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n getExpectedRequestStore: null,\n getPrerenderResumeDataCache: null,\n getRenderResumeDataCache: null,\n workUnitAsyncStorage: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n getExpectedRequestStore: function() {\n return getExpectedRequestStore;\n },\n getPrerenderResumeDataCache: function() {\n return getPrerenderResumeDataCache;\n },\n getRenderResumeDataCache: function() {\n return getRenderResumeDataCache;\n },\n workUnitAsyncStorage: function() {\n return _workunitasyncstorageinstance.workUnitAsyncStorage;\n }\n});\nconst _workunitasyncstorageinstance = require(\"./work-unit-async-storage-instance\");\nfunction getExpectedRequestStore(callingExpression) {\n const workUnitStore = _workunitasyncstorageinstance.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n if (workUnitStore.type === 'request') {\n return workUnitStore;\n }\n if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-ppr' || workUnitStore.type === 'prerender-legacy') {\n // This should not happen because we should have checked it already.\n throw new Error(`\\`${callingExpression}\\` cannot be called inside a prerender. This is a bug in Next.js.`);\n }\n if (workUnitStore.type === 'cache') {\n throw new Error(`\\`${callingExpression}\\` cannot be called inside \"use cache\". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`);\n } else if (workUnitStore.type === 'unstable-cache') {\n throw new Error(`\\`${callingExpression}\\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);\n }\n }\n throw new Error(`\\`${callingExpression}\\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`);\n}\nfunction getPrerenderResumeDataCache(workUnitStore) {\n if (workUnitStore.type !== 'prerender-legacy' && workUnitStore.type !== 'cache' && workUnitStore.type !== 'unstable-cache') {\n if (workUnitStore.type === 'request') {\n return workUnitStore.devWarmupPrerenderResumeDataCache;\n }\n return workUnitStore.prerenderResumeDataCache;\n }\n return null;\n}\nfunction getRenderResumeDataCache(workUnitStore) {\n if (workUnitStore.type !== 'prerender-legacy' && workUnitStore.type !== 'cache' && workUnitStore.type !== 'unstable-cache') {\n if (workUnitStore.type === 'request') {\n return workUnitStore.renderResumeDataCache;\n }\n // We return the mutable resume data cache here as an immutable version of\n // the cache as it can also be used for reading.\n return workUnitStore.prerenderResumeDataCache;\n }\n return null;\n}\n\n//# sourceMappingURL=work-unit-async-storage.external.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createDedupedByCallsiteServerErrorLoggerDev\", {\n enumerable: true,\n get: function() {\n return createDedupedByCallsiteServerErrorLoggerDev;\n }\n});\nconst _react = /*#__PURE__*/ _interop_require_wildcard(require(\"react\"));\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) {\n return obj;\n }\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n var cache = _getRequireWildcardCache(nodeInterop);\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n var newObj = {\n __proto__: null\n };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for(var key in obj){\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n newObj.default = obj;\n if (cache) {\n cache.set(obj, newObj);\n }\n return newObj;\n}\nconst errorRef = {\n current: null\n};\n// React.cache is currently only available in canary/experimental React channels.\nconst cache = typeof _react.cache === 'function' ? _react.cache : (fn)=>fn;\n// When Dynamic IO is enabled, we record these as errors so that they\n// are captured by the dev overlay as it's more critical to fix these\n// when enabled.\nconst logErrorOrWarn = process.env.__NEXT_DYNAMIC_IO ? console.error : console.warn;\n// We don't want to dedupe across requests.\n// The developer might've just attempted to fix the warning so we should warn again if it still happens.\nconst flushCurrentErrorIfNew = cache(// eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key\n(key)=>{\n try {\n logErrorOrWarn(errorRef.current);\n } finally{\n errorRef.current = null;\n }\n});\nfunction createDedupedByCallsiteServerErrorLoggerDev(getMessage) {\n return function logDedupedError(...args) {\n const message = getMessage(...args);\n if (process.env.NODE_ENV !== 'production') {\n var _stack;\n const callStackFrames = (_stack = new Error().stack) == null ? void 0 : _stack.split('\\n');\n if (callStackFrames === undefined || callStackFrames.length < 4) {\n logErrorOrWarn(message);\n } else {\n // Error:\n // logDedupedError\n // asyncApiBeingAccessedSynchronously\n // \n // TODO: This breaks if sourcemaps with ignore lists are enabled.\n const key = callStackFrames[4];\n errorRef.current = message;\n flushCurrentErrorIfNew(key);\n }\n } else {\n logErrorOrWarn(message);\n }\n };\n}\n\n//# sourceMappingURL=create-deduped-by-callsite-server-error-logger.js.map","/**\n * This function constructs a promise that will never resolve. This is primarily\n * useful for dynamicIO where we use promise resolution timing to determine which\n * parts of a render can be included in a prerender.\n *\n * @internal\n */ \"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"makeHangingPromise\", {\n enumerable: true,\n get: function() {\n return makeHangingPromise;\n }\n});\nfunction makeHangingPromise(signal, expression) {\n const hangingPromise = new Promise((_, reject)=>{\n signal.addEventListener('abort', ()=>{\n reject(new Error(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \\`setTimeout\\`, \\`unstable_after\\`, or similar functions you may observe this error and you should handle it in that context.`));\n }, {\n once: true\n });\n });\n // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so\n // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct\n // your own promise out of it you'll need to ensure you handle the error when it rejects.\n hangingPromise.catch(ignoreReject);\n return hangingPromise;\n}\nfunction ignoreReject() {}\n\n//# sourceMappingURL=dynamic-rendering-utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n INTERCEPTION_ROUTE_MARKERS: null,\n extractInterceptionRouteInformation: null,\n isInterceptionRouteAppPath: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n INTERCEPTION_ROUTE_MARKERS: function() {\n return INTERCEPTION_ROUTE_MARKERS;\n },\n extractInterceptionRouteInformation: function() {\n return extractInterceptionRouteInformation;\n },\n isInterceptionRouteAppPath: function() {\n return isInterceptionRouteAppPath;\n }\n});\nconst _apppaths = require(\"../../shared/lib/router/utils/app-paths\");\nconst INTERCEPTION_ROUTE_MARKERS = [\n '(..)(..)',\n '(.)',\n '(..)',\n '(...)'\n];\nfunction isInterceptionRouteAppPath(path) {\n // TODO-APP: add more serious validation\n return path.split('/').find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;\n}\nfunction extractInterceptionRouteInformation(path) {\n let interceptingRoute, marker, interceptedRoute;\n for (const segment of path.split('/')){\n marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n if (marker) {\n [interceptingRoute, interceptedRoute] = path.split(marker, 2);\n break;\n }\n }\n if (!interceptingRoute || !marker || !interceptedRoute) {\n throw new Error(`Invalid interception route: ${path}. Must be in the format //(..|...|..)(..)/`);\n }\n interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed\n ;\n switch(marker){\n case '(.)':\n // (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route\n if (interceptingRoute === '/') {\n interceptedRoute = `/${interceptedRoute}`;\n } else {\n interceptedRoute = interceptingRoute + '/' + interceptedRoute;\n }\n break;\n case '(..)':\n // (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route\n if (interceptingRoute === '/') {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);\n }\n interceptedRoute = interceptingRoute.split('/').slice(0, -1).concat(interceptedRoute).join('/');\n break;\n case '(...)':\n // (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route\n interceptedRoute = '/' + interceptedRoute;\n break;\n case '(..)(..)':\n // (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route\n const splitInterceptingRoute = interceptingRoute.split('/');\n if (splitInterceptingRoute.length <= 2) {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);\n }\n interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join('/');\n break;\n default:\n throw new Error('Invariant: unexpected marker');\n }\n return {\n interceptingRoute,\n interceptedRoute\n };\n}\n\n//# sourceMappingURL=interception-routes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isPostpone\", {\n enumerable: true,\n get: function() {\n return isPostpone;\n }\n});\nconst REACT_POSTPONE_TYPE = Symbol.for('react.postpone');\nfunction isPostpone(error) {\n return typeof error === 'object' && error !== null && error.$$typeof === REACT_POSTPONE_TYPE;\n}\n\n//# sourceMappingURL=is-postpone.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createRenderParamsFromClient\", {\n enumerable: true,\n get: function() {\n return createRenderParamsFromClient;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _invarianterror = require(\"../../shared/lib/invariant-error\");\nconst _utils = require(\"./utils\");\nfunction createRenderParamsFromClient(underlyingParams) {\n if (process.env.NODE_ENV === 'development') {\n return makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams);\n } else {\n return makeUntrackedExoticParams(underlyingParams);\n }\n}\nconst CachedParams = new WeakMap();\nfunction makeUntrackedExoticParams(underlyingParams) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n const promise = Promise.resolve(underlyingParams);\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n promise[prop] = underlyingParams[prop];\n }\n });\n return promise;\n}\nfunction makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingParams);\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n proxiedProperties.add(prop);\n promise[prop] = underlyingParams[prop];\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (typeof prop === 'string') {\n if (// We are accessing a property that was proxied to the promise instance\n proxiedProperties.has(prop)) {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n warnForSyncAccess(expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return _reflect.ReflectAdapter.set(target, prop, value, receiver);\n },\n ownKeys (target) {\n warnForEnumeration(unproxiedProperties);\n return Reflect.ownKeys(target);\n }\n });\n CachedParams.set(underlyingParams, proxiedPromise);\n return proxiedPromise;\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForSyncAccess(expression) {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n console.error(`A param property was accessed directly with ${expression}. \\`params\\` is now a Promise and should be unwrapped with \\`React.use()\\` before accessing properties of the underlying params object. In this version of Next.js direct access to param properties is still supported to facilitate migration but in a future version you will be required to unwrap \\`params\\` with \\`React.use()\\`.`);\n};\nconst warnForEnumeration = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForEnumeration(missingProperties) {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n if (missingProperties.length) {\n const describedMissingProperties = describeListOfPropertyNames(missingProperties);\n console.error(`params are being enumerated incompletely missing these properties: ${describedMissingProperties}. ` + `\\`params\\` should be unwrapped with \\`React.use()\\` before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n } else {\n console.error(`params are being enumerated. ` + `\\`params\\` should be unwrapped with \\`React.use()\\` before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n }\n};\nfunction describeListOfPropertyNames(properties) {\n switch(properties.length){\n case 0:\n throw new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.');\n case 1:\n return `\\`${properties[0]}\\``;\n case 2:\n return `\\`${properties[0]}\\` and \\`${properties[1]}\\``;\n default:\n {\n let description = '';\n for(let i = 0; i < properties.length - 1; i++){\n description += `\\`${properties[i]}\\`, `;\n }\n description += `, and \\`${properties[properties.length - 1]}\\``;\n return description;\n }\n }\n}\n\n//# sourceMappingURL=params.browser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n createParamsFromClient: null,\n createPrerenderParamsForClientSegment: null,\n createServerParamsForMetadata: null,\n createServerParamsForRoute: null,\n createServerParamsForServerSegment: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n createParamsFromClient: function() {\n return createParamsFromClient;\n },\n createPrerenderParamsForClientSegment: function() {\n return createPrerenderParamsForClientSegment;\n },\n createServerParamsForMetadata: function() {\n return createServerParamsForMetadata;\n },\n createServerParamsForRoute: function() {\n return createServerParamsForRoute;\n },\n createServerParamsForServerSegment: function() {\n return createServerParamsForServerSegment;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _dynamicrendering = require(\"../app-render/dynamic-rendering\");\nconst _workunitasyncstorageexternal = require(\"../app-render/work-unit-async-storage.external\");\nconst _invarianterror = require(\"../../shared/lib/invariant-error\");\nconst _utils = require(\"./utils\");\nconst _dynamicrenderingutils = require(\"../dynamic-rendering-utils\");\nconst _creatededupedbycallsiteservererrorlogger = require(\"../create-deduped-by-callsite-server-error-logger\");\nconst _scheduler = require(\"../../lib/scheduler\");\nfunction createParamsFromClient(underlyingParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderParams(underlyingParams, workStore, workUnitStore);\n default:\n }\n }\n return createRenderParams(underlyingParams, workStore);\n}\nconst createServerParamsForMetadata = createServerParamsForServerSegment;\nfunction createServerParamsForRoute(underlyingParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderParams(underlyingParams, workStore, workUnitStore);\n default:\n }\n }\n return createRenderParams(underlyingParams, workStore);\n}\nfunction createServerParamsForServerSegment(underlyingParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderParams(underlyingParams, workStore, workUnitStore);\n default:\n }\n }\n return createRenderParams(underlyingParams, workStore);\n}\nfunction createPrerenderParamsForClientSegment(underlyingParams, workStore) {\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (prerenderStore && prerenderStore.type === 'prerender') {\n const fallbackParams = workStore.fallbackRouteParams;\n if (fallbackParams) {\n for(let key in underlyingParams){\n if (fallbackParams.has(key)) {\n // This params object has one of more fallback params so we need to consider\n // the awaiting of this params object \"dynamic\". Since we are in dynamicIO mode\n // we encode this as a promise that never resolves\n return (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`params`');\n }\n }\n }\n }\n // We're prerendering in a mode that does not abort. We resolve the promise without\n // any tracking because we're just transporting a value from server to client where the tracking\n // will be applied.\n return Promise.resolve(underlyingParams);\n}\nfunction createPrerenderParams(underlyingParams, workStore, prerenderStore) {\n const fallbackParams = workStore.fallbackRouteParams;\n if (fallbackParams) {\n let hasSomeFallbackParams = false;\n for(const key in underlyingParams){\n if (fallbackParams.has(key)) {\n hasSomeFallbackParams = true;\n break;\n }\n }\n if (hasSomeFallbackParams) {\n // params need to be treated as dynamic because we have at least one fallback param\n if (prerenderStore.type === 'prerender') {\n // We are in a dynamicIO (PPR or otherwise) prerender\n return makeAbortingExoticParams(underlyingParams, workStore.route, prerenderStore);\n }\n // remaining cases are prender-ppr and prerender-legacy\n // We aren't in a dynamicIO prerender but we do have fallback params at this\n // level so we need to make an erroring exotic params object which will postpone\n // if you access the fallback params\n return makeErroringExoticParams(underlyingParams, fallbackParams, workStore, prerenderStore);\n }\n }\n // We don't have any fallback params so we have an entirely static safe params object\n return makeUntrackedExoticParams(underlyingParams);\n}\nfunction createRenderParams(underlyingParams, workStore) {\n if (process.env.NODE_ENV === 'development' && !workStore.isPrefetchRequest) {\n return makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams, workStore);\n } else {\n return makeUntrackedExoticParams(underlyingParams);\n }\n}\nconst CachedParams = new WeakMap();\nfunction makeAbortingExoticParams(underlyingParams, route, prerenderStore) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`params`');\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n Object.defineProperty(promise, prop, {\n get () {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n const error = createParamsAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n },\n set (newValue) {\n Object.defineProperty(promise, prop, {\n value: newValue,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n }\n });\n return promise;\n}\nfunction makeErroringExoticParams(underlyingParams, fallbackParams, workStore, prerenderStore) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n const augmentedUnderlying = {\n ...underlyingParams\n };\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(augmentedUnderlying);\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n if (fallbackParams.has(prop)) {\n Object.defineProperty(augmentedUnderlying, prop, {\n get () {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n // In most dynamic APIs we also throw if `dynamic = \"error\"` however\n // for params is only dynamic when we're generating a fallback shell\n // and even when `dynamic = \"error\"` we still support generating dynamic\n // fallback shells\n // TODO remove this comment when dynamicIO is the default since there\n // will be no `dynamic = \"error\"`\n if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n },\n enumerable: true\n });\n Object.defineProperty(promise, prop, {\n get () {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n // In most dynamic APIs we also throw if `dynamic = \"error\"` however\n // for params is only dynamic when we're generating a fallback shell\n // and even when `dynamic = \"error\"` we still support generating dynamic\n // fallback shells\n // TODO remove this comment when dynamicIO is the default since there\n // will be no `dynamic = \"error\"`\n if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n },\n set (newValue) {\n Object.defineProperty(promise, prop, {\n value: newValue,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n } else {\n promise[prop] = underlyingParams[prop];\n }\n }\n });\n return promise;\n}\nfunction makeUntrackedExoticParams(underlyingParams) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingParams);\n CachedParams.set(underlyingParams, promise);\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n promise[prop] = underlyingParams[prop];\n }\n });\n return promise;\n}\nfunction makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams, store) {\n const cachedParams = CachedParams.get(underlyingParams);\n if (cachedParams) {\n return cachedParams;\n }\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingParams)));\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n Object.keys(underlyingParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n unproxiedProperties.push(prop);\n } else {\n proxiedProperties.add(prop);\n promise[prop] = underlyingParams[prop];\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (typeof prop === 'string') {\n if (// We are accessing a property that was proxied to the promise instance\n proxiedProperties.has(prop)) {\n const expression = (0, _utils.describeStringPropertyAccess)('params', prop);\n syncIODev(store.route, expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return _reflect.ReflectAdapter.set(target, prop, value, receiver);\n },\n ownKeys (target) {\n const expression = '`...params` or similar expression';\n syncIODev(store.route, expression, unproxiedProperties);\n return Reflect.ownKeys(target);\n }\n });\n CachedParams.set(underlyingParams, proxiedPromise);\n return proxiedPromise;\n}\nfunction syncIODev(route, expression, missingProperties) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {\n // When we're rendering dynamically in dev we need to advance out of the\n // Prerender environment when we read Request data synchronously\n const requestStore = workUnitStore;\n (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);\n }\n // In all cases we warn normally\n if (missingProperties && missingProperties.length > 0) {\n warnForIncompleteEnumeration(route, expression, missingProperties);\n } else {\n warnForSyncAccess(route, expression);\n }\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createParamsAccessError);\nconst warnForIncompleteEnumeration = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createIncompleteEnumerationError);\nfunction createParamsAccessError(route, expression) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`params\\` should be awaited before using its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction createIncompleteEnumerationError(route, expression, missingProperties) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`params\\` should be awaited before using its properties. ` + `The following properties were not available through enumeration ` + `because they conflict with builtin property names: ` + `${describeListOfPropertyNames(missingProperties)}. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction describeListOfPropertyNames(properties) {\n switch(properties.length){\n case 0:\n throw new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.');\n case 1:\n return `\\`${properties[0]}\\``;\n case 2:\n return `\\`${properties[0]}\\` and \\`${properties[1]}\\``;\n default:\n {\n let description = '';\n for(let i = 0; i < properties.length - 1; i++){\n description += `\\`${properties[i]}\\`, `;\n }\n description += `, and \\`${properties[properties.length - 1]}\\``;\n return description;\n }\n }\n}\n\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createRenderSearchParamsFromClient\", {\n enumerable: true,\n get: function() {\n return createRenderSearchParamsFromClient;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _utils = require(\"./utils\");\nfunction createRenderSearchParamsFromClient(underlyingSearchParams) {\n if (process.env.NODE_ENV === 'development') {\n return makeUntrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams);\n } else {\n return makeUntrackedExoticSearchParams(underlyingSearchParams);\n }\n}\nconst CachedSearchParams = new WeakMap();\nfunction makeUntrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n const promise = Promise.resolve(underlyingSearchParams);\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n unproxiedProperties.push(prop);\n } else {\n proxiedProperties.add(prop);\n promise[prop] = underlyingSearchParams[prop];\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n warnForSyncAccess(expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return Reflect.set(target, prop, value, receiver);\n },\n has (target, prop) {\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n warnForSyncAccess(expression);\n }\n }\n return Reflect.has(target, prop);\n },\n ownKeys (target) {\n warnForSyncSpread();\n return Reflect.ownKeys(target);\n }\n });\n CachedSearchParams.set(underlyingSearchParams, proxiedPromise);\n return proxiedPromise;\n}\nfunction makeUntrackedExoticSearchParams(underlyingSearchParams) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n // We don't use makeResolvedReactPromise here because searchParams\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingSearchParams);\n CachedSearchParams.set(underlyingSearchParams, promise);\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n promise[prop] = underlyingSearchParams[prop];\n }\n });\n return promise;\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForSyncAccess(expression) {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n console.error(`A searchParam property was accessed directly with ${expression}. ` + `\\`searchParams\\` should be unwrapped with \\`React.use()\\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n};\nconst warnForSyncSpread = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : function warnForSyncSpread() {\n if (process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS) {\n return;\n }\n console.error(`The keys of \\`searchParams\\` were accessed directly. ` + `\\`searchParams\\` should be unwrapped with \\`React.use()\\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n};\n\n//# sourceMappingURL=search-params.browser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n createPrerenderSearchParamsForClientPage: null,\n createSearchParamsFromClient: null,\n createServerSearchParamsForMetadata: null,\n createServerSearchParamsForServerPage: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n createPrerenderSearchParamsForClientPage: function() {\n return createPrerenderSearchParamsForClientPage;\n },\n createSearchParamsFromClient: function() {\n return createSearchParamsFromClient;\n },\n createServerSearchParamsForMetadata: function() {\n return createServerSearchParamsForMetadata;\n },\n createServerSearchParamsForServerPage: function() {\n return createServerSearchParamsForServerPage;\n }\n});\nconst _reflect = require(\"../web/spec-extension/adapters/reflect\");\nconst _dynamicrendering = require(\"../app-render/dynamic-rendering\");\nconst _workunitasyncstorageexternal = require(\"../app-render/work-unit-async-storage.external\");\nconst _invarianterror = require(\"../../shared/lib/invariant-error\");\nconst _dynamicrenderingutils = require(\"../dynamic-rendering-utils\");\nconst _creatededupedbycallsiteservererrorlogger = require(\"../create-deduped-by-callsite-server-error-logger\");\nconst _utils = require(\"./utils\");\nconst _scheduler = require(\"../../lib/scheduler\");\nfunction createSearchParamsFromClient(underlyingSearchParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderSearchParams(workStore, workUnitStore);\n default:\n }\n }\n return createRenderSearchParams(underlyingSearchParams, workStore);\n}\nconst createServerSearchParamsForMetadata = createServerSearchParamsForServerPage;\nfunction createServerSearchParamsForServerPage(underlyingSearchParams, workStore) {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderSearchParams(workStore, workUnitStore);\n default:\n }\n }\n return createRenderSearchParams(underlyingSearchParams, workStore);\n}\nfunction createPrerenderSearchParamsForClientPage(workStore) {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({});\n }\n const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (prerenderStore && prerenderStore.type === 'prerender') {\n // dynamicIO Prerender\n // We're prerendering in a mode that aborts (dynamicIO) and should stall\n // the promise to ensure the RSC side is considered dynamic\n return (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`searchParams`');\n }\n // We're prerendering in a mode that does not aborts. We resolve the promise without\n // any tracking because we're just transporting a value from server to client where the tracking\n // will be applied.\n return Promise.resolve({});\n}\nfunction createPrerenderSearchParams(workStore, prerenderStore) {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({});\n }\n if (prerenderStore.type === 'prerender') {\n // We are in a dynamicIO (PPR or otherwise) prerender\n return makeAbortingExoticSearchParams(workStore.route, prerenderStore);\n }\n // The remaining cases are prerender-ppr and prerender-legacy\n // We are in a legacy static generation and need to interrupt the prerender\n // when search params are accessed.\n return makeErroringExoticSearchParams(workStore, prerenderStore);\n}\nfunction createRenderSearchParams(underlyingSearchParams, workStore) {\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // dictionary object.\n return Promise.resolve({});\n } else {\n if (process.env.NODE_ENV === 'development' && !workStore.isPrefetchRequest) {\n return makeDynamicallyTrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams, workStore);\n } else {\n return makeUntrackedExoticSearchParams(underlyingSearchParams, workStore);\n }\n }\n}\nconst CachedSearchParams = new WeakMap();\nfunction makeAbortingExoticSearchParams(route, prerenderStore) {\n const cachedSearchParams = CachedSearchParams.get(prerenderStore);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`searchParams`');\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (Object.hasOwn(promise, prop)) {\n // The promise has this property directly. we must return it.\n // We know it isn't a dynamic access because it can only be something\n // that was previously written to the promise and thus not an underlying searchParam value\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n switch(prop){\n case 'then':\n {\n const expression = '`await searchParams`, `searchParams.then`, or similar';\n (0, _dynamicrendering.annotateDynamicAccess)(expression, prerenderStore);\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n case 'status':\n {\n const expression = '`use(searchParams)`, `searchParams.status`, or similar';\n (0, _dynamicrendering.annotateDynamicAccess)(expression, prerenderStore);\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n // Object prototype\n case 'hasOwnProperty':\n case 'isPrototypeOf':\n case 'propertyIsEnumerable':\n case 'toString':\n case 'valueOf':\n case 'toLocaleString':\n // Promise prototype\n // fallthrough\n case 'catch':\n case 'finally':\n // Common tested properties\n // fallthrough\n case 'toJSON':\n case '$$typeof':\n case '__esModule':\n {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n default:\n {\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n const error = createSearchAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n }\n },\n has (target, prop) {\n // We don't expect key checking to be used except for testing the existence of\n // searchParams so we make all has tests trigger dynamic. this means that `promise.then`\n // can resolve to the then function on the Promise prototype but 'then' in promise will assume\n // you are testing whether the searchParams has a 'then' property.\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n const error = createSearchAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n }\n return _reflect.ReflectAdapter.has(target, prop);\n },\n ownKeys () {\n const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';\n const error = createSearchAccessError(route, expression);\n (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);\n }\n });\n CachedSearchParams.set(prerenderStore, proxiedPromise);\n return proxiedPromise;\n}\nfunction makeErroringExoticSearchParams(workStore, prerenderStore) {\n const cachedSearchParams = CachedSearchParams.get(workStore);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const underlyingSearchParams = {};\n // For search params we don't construct a ReactPromise because we want to interrupt\n // rendering on any property access that was not set from outside and so we only want\n // to have properties like value and status if React sets them.\n const promise = Promise.resolve(underlyingSearchParams);\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (Object.hasOwn(promise, prop)) {\n // The promise has this property directly. we must return it.\n // We know it isn't a dynamic access because it can only be something\n // that was previously written to the promise and thus not an underlying searchParam value\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n switch(prop){\n // Object prototype\n case 'hasOwnProperty':\n case 'isPrototypeOf':\n case 'propertyIsEnumerable':\n case 'toString':\n case 'valueOf':\n case 'toLocaleString':\n // Promise prototype\n // fallthrough\n case 'catch':\n case 'finally':\n // Common tested properties\n // fallthrough\n case 'toJSON':\n case '$$typeof':\n case '__esModule':\n {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n case 'then':\n {\n const expression = '`await searchParams`, `searchParams.then`, or similar';\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n return;\n }\n case 'status':\n {\n const expression = '`use(searchParams)`, `searchParams.status`, or similar';\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n return;\n }\n default:\n {\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n }\n },\n has (target, prop) {\n // We don't expect key checking to be used except for testing the existence of\n // searchParams so we make all has tests trigger dynamic. this means that `promise.then`\n // can resolve to the then function on the Promise prototype but 'then' in promise will assume\n // you are testing whether the searchParams has a 'then' property.\n if (typeof prop === 'string') {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n return false;\n }\n return _reflect.ReflectAdapter.has(target, prop);\n },\n ownKeys () {\n const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';\n if (workStore.dynamicShouldError) {\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);\n } else if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);\n } else {\n // Legacy Prerender\n (0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);\n }\n }\n });\n CachedSearchParams.set(workStore, proxiedPromise);\n return proxiedPromise;\n}\nfunction makeUntrackedExoticSearchParams(underlyingSearchParams, store) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n // We don't use makeResolvedReactPromise here because searchParams\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingSearchParams);\n CachedSearchParams.set(underlyingSearchParams, promise);\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n switch(prop){\n // Object prototype\n case 'hasOwnProperty':\n case 'isPrototypeOf':\n case 'propertyIsEnumerable':\n case 'toString':\n case 'valueOf':\n case 'toLocaleString':\n // Promise prototype\n // fallthrough\n case 'then':\n case 'catch':\n case 'finally':\n // React Promise extension\n // fallthrough\n case 'status':\n // Common tested properties\n // fallthrough\n case 'toJSON':\n case '$$typeof':\n case '__esModule':\n {\n break;\n }\n default:\n {\n Object.defineProperty(promise, prop, {\n get () {\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n (0, _dynamicrendering.trackDynamicDataInDynamicRender)(store, workUnitStore);\n return underlyingSearchParams[prop];\n },\n set (value) {\n Object.defineProperty(promise, prop, {\n value,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n }\n }\n });\n return promise;\n}\nfunction makeDynamicallyTrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams, store) {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);\n if (cachedSearchParams) {\n return cachedSearchParams;\n }\n const proxiedProperties = new Set();\n const unproxiedProperties = [];\n // We have an unfortunate sequence of events that requires this initialization logic. We want to instrument the underlying\n // searchParams object to detect if you are accessing values in dev. This is used for warnings and for things like the static prerender\n // indicator. However when we pass this proxy to our Promise.resolve() below the VM checks if the resolved value is a promise by looking\n // at the `.then` property. To our dynamic tracking logic this is indistinguishable from a `then` searchParam and so we would normally trigger\n // dynamic tracking. However we know that this .then is not real dynamic access, it's just how thenables resolve in sequence. So we introduce\n // this initialization concept so we omit the dynamic check until after we've constructed our resolved promise.\n let promiseInitialized = false;\n const proxiedUnderlying = new Proxy(underlyingSearchParams, {\n get (target, prop, receiver) {\n if (typeof prop === 'string' && promiseInitialized) {\n if (store.dynamicShouldError) {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n (0, _dynamicrendering.trackDynamicDataInDynamicRender)(store, workUnitStore);\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n has (target, prop) {\n if (typeof prop === 'string') {\n if (store.dynamicShouldError) {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n }\n return Reflect.has(target, prop);\n },\n ownKeys (target) {\n if (store.dynamicShouldError) {\n const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n return Reflect.ownKeys(target);\n }\n });\n // We don't use makeResolvedReactPromise here because searchParams\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingSearchParams)));\n promise.then(()=>{\n promiseInitialized = true;\n });\n Object.keys(underlyingSearchParams).forEach((prop)=>{\n if (_utils.wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n unproxiedProperties.push(prop);\n } else {\n proxiedProperties.add(prop);\n Object.defineProperty(promise, prop, {\n get () {\n return proxiedUnderlying[prop];\n },\n set (newValue) {\n Object.defineProperty(promise, prop, {\n value: newValue,\n writable: true,\n enumerable: true\n });\n },\n enumerable: true,\n configurable: true\n });\n }\n });\n const proxiedPromise = new Proxy(promise, {\n get (target, prop, receiver) {\n if (prop === 'then' && store.dynamicShouldError) {\n const expression = '`searchParams.then`';\n (0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);\n }\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeStringPropertyAccess)('searchParams', prop);\n syncIODev(store.route, expression);\n }\n }\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'string') {\n proxiedProperties.delete(prop);\n }\n return Reflect.set(target, prop, value, receiver);\n },\n has (target, prop) {\n if (typeof prop === 'string') {\n if (!_utils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor\n // the underlying searchParams.\n Reflect.has(target, prop) === false)) {\n const expression = (0, _utils.describeHasCheckingStringProperty)('searchParams', prop);\n syncIODev(store.route, expression);\n }\n }\n return Reflect.has(target, prop);\n },\n ownKeys (target) {\n const expression = '`Object.keys(searchParams)` or similar';\n syncIODev(store.route, expression, unproxiedProperties);\n return Reflect.ownKeys(target);\n }\n });\n CachedSearchParams.set(underlyingSearchParams, proxiedPromise);\n return proxiedPromise;\n}\nfunction syncIODev(route, expression, missingProperties) {\n // In all cases we warn normally\n if (missingProperties && missingProperties.length > 0) {\n warnForIncompleteEnumeration(route, expression, missingProperties);\n } else {\n warnForSyncAccess(route, expression);\n }\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {\n // When we're rendering dynamically in dev we need to advance out of the\n // Prerender environment when we read Request data synchronously\n const requestStore = workUnitStore;\n (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);\n }\n}\nconst noop = ()=>{};\nconst warnForSyncAccess = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createSearchAccessError);\nconst warnForIncompleteEnumeration = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? noop : (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createIncompleteEnumerationError);\nfunction createSearchAccessError(route, expression) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`searchParams\\` should be awaited before using its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction createIncompleteEnumerationError(route, expression, missingProperties) {\n const prefix = route ? `Route \"${route}\" ` : 'This route ';\n return new Error(`${prefix}used ${expression}. ` + `\\`searchParams\\` should be awaited before using its properties. ` + `The following properties were not available through enumeration ` + `because they conflict with builtin or well-known property names: ` + `${describeListOfPropertyNames(missingProperties)}. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);\n}\nfunction describeListOfPropertyNames(properties) {\n switch(properties.length){\n case 0:\n throw new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.');\n case 1:\n return `\\`${properties[0]}\\``;\n case 2:\n return `\\`${properties[0]}\\` and \\`${properties[1]}\\``;\n default:\n {\n let description = '';\n for(let i = 0; i < properties.length - 1; i++){\n description += `\\`${properties[i]}\\`, `;\n }\n description += `, and \\`${properties[properties.length - 1]}\\``;\n return description;\n }\n }\n}\n\n//# sourceMappingURL=search-params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n describeHasCheckingStringProperty: null,\n describeStringPropertyAccess: null,\n throwWithStaticGenerationBailoutError: null,\n throwWithStaticGenerationBailoutErrorWithDynamicError: null,\n wellKnownProperties: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n describeHasCheckingStringProperty: function() {\n return describeHasCheckingStringProperty;\n },\n describeStringPropertyAccess: function() {\n return describeStringPropertyAccess;\n },\n throwWithStaticGenerationBailoutError: function() {\n return throwWithStaticGenerationBailoutError;\n },\n throwWithStaticGenerationBailoutErrorWithDynamicError: function() {\n return throwWithStaticGenerationBailoutErrorWithDynamicError;\n },\n wellKnownProperties: function() {\n return wellKnownProperties;\n }\n});\nconst _staticgenerationbailout = require(\"../../client/components/static-generation-bailout\");\n// This regex will have fast negatives meaning valid identifiers may not pass\n// this test. However this is only used during static generation to provide hints\n// about why a page bailed out of some or all prerendering and we can use bracket notation\n// for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']`\n// even if this would have been fine too `searchParams.ಠ_ಠ`\nconst isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\nfunction describeStringPropertyAccess(target, prop) {\n if (isDefinitelyAValidIdentifier.test(prop)) {\n return `\\`${target}.${prop}\\``;\n }\n return `\\`${target}[${JSON.stringify(prop)}]\\``;\n}\nfunction describeHasCheckingStringProperty(target, prop) {\n const stringifiedProp = JSON.stringify(prop);\n return `\\`Reflect.has(${target}, ${stringifiedProp})\\`, \\`${stringifiedProp} in ${target}\\`, or similar`;\n}\nfunction throwWithStaticGenerationBailoutError(route, expression) {\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route ${route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n}\nfunction throwWithStaticGenerationBailoutErrorWithDynamicError(route, expression) {\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n}\nconst wellKnownProperties = new Set([\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toString',\n 'valueOf',\n 'toLocaleString',\n // Promise prototype\n // fallthrough\n 'then',\n 'catch',\n 'finally',\n // React Promise extension\n // fallthrough\n 'status',\n // React introspection\n 'displayName',\n // Common tested properties\n // fallthrough\n 'toJSON',\n '$$typeof',\n '__esModule'\n]);\n\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"ReflectAdapter\", {\n enumerable: true,\n get: function() {\n return ReflectAdapter;\n }\n});\nclass ReflectAdapter {\n static get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n }\n static set(target, prop, value, receiver) {\n return Reflect.set(target, prop, value, receiver);\n }\n static has(target, prop) {\n return Reflect.has(target, prop);\n }\n static deleteProperty(target, prop) {\n return Reflect.deleteProperty(target, prop);\n }\n}\n\n//# sourceMappingURL=reflect.js.map","'use client'\n\nimport type { FetchServerResponseResult } from '../../client/components/router-reducer/fetch-server-response'\nimport type {\n FocusAndScrollRef,\n PrefetchKind,\n RouterChangeByServerResponse,\n} from '../../client/components/router-reducer/router-reducer-types'\nimport type { FlightRouterState } from '../../server/app-render/types'\nimport React from 'react'\n\nexport type ChildSegmentMap = Map\n\n/**\n * Cache node used in app-router / layout-router.\n */\nexport type CacheNode = ReadyCacheNode | LazyCacheNode\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nexport type LazyCacheNode = {\n /**\n * When rsc is null, this is a lazily-initialized cache node.\n *\n * If the app attempts to render it, it triggers a lazy data fetch,\n * postpones the render, and schedules an update to a new tree.\n *\n * TODO: This mechanism should not be used when PPR is enabled, though it\n * currently is in some cases until we've implemented partial\n * segment fetching.\n */\n rsc: null\n\n /**\n * A prefetched version of the segment data. See explanation in corresponding\n * field of ReadyCacheNode (below).\n *\n * Since LazyCacheNode mostly only exists in the non-PPR implementation, this\n * will usually be null, but it could have been cloned from a previous\n * CacheNode that was created by the PPR implementation. Eventually we want\n * to migrate everything away from LazyCacheNode entirely.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * A pending response for the lazy data fetch. If this is not present\n * during render, it is lazily created.\n */\n lazyData: Promise | null\n\n prefetchHead: React.ReactNode\n head: React.ReactNode\n\n loading: LoadingModuleData\n\n /**\n * Child parallel routes.\n */\n parallelRoutes: Map\n}\n\nexport type ReadyCacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * component, we can use `null` to represent empty.\n *\n * TODO: For additional type safety, update this type to\n * Exclude. Need to update createEmptyCacheNode to\n * accept rsc as an argument, or just inline the callers.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * There should never be a lazy data request in this case.\n */\n lazyData: null\n prefetchHead: React.ReactNode\n head: React.ReactNode\n\n loading: LoadingModuleData\n\n parallelRoutes: Map\n}\n\nexport interface NavigateOptions {\n scroll?: boolean\n}\n\nexport interface PrefetchOptions {\n kind: PrefetchKind\n}\n\nexport interface AppRouterInstance {\n /**\n * Navigate to the previous history entry.\n */\n back(): void\n /**\n * Navigate to the next history entry.\n */\n forward(): void\n /**\n * Refresh the current page.\n */\n refresh(): void\n /**\n * Refresh the current page. Use in development only.\n * @internal\n */\n hmrRefresh(): void\n /**\n * Navigate to the provided href.\n * Pushes a new history entry.\n */\n push(href: string, options?: NavigateOptions): void\n /**\n * Navigate to the provided href.\n * Replaces the current history entry.\n */\n replace(href: string, options?: NavigateOptions): void\n /**\n * Prefetch the provided href.\n */\n prefetch(href: string, options?: PrefetchOptions): void\n}\n\nexport const AppRouterContext = React.createContext(\n null\n)\nexport const LayoutRouterContext = React.createContext<{\n childNodes: CacheNode['parallelRoutes']\n tree: FlightRouterState\n url: string\n loading: LoadingModuleData\n} | null>(null)\n\nexport const GlobalLayoutRouterContext = React.createContext<{\n buildId: string\n tree: FlightRouterState\n changeByServerResponse: RouterChangeByServerResponse\n focusAndScrollRef: FocusAndScrollRef\n nextUrl: string | null\n}>(null as any)\n\nexport const TemplateContext = React.createContext(null as any)\n\nif (process.env.NODE_ENV !== 'production') {\n AppRouterContext.displayName = 'AppRouterContext'\n LayoutRouterContext.displayName = 'LayoutRouterContext'\n GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext'\n TemplateContext.displayName = 'TemplateContext'\n}\n\nexport const MissingSlotContext = React.createContext>(new Set())\n","export function encodeURIPath(file: string) {\n return file\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')\n}\n","// http://www.cse.yorku.ca/~oz/hash.html\n// More specifically, 32-bit hash via djbxor\n// (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765)\n// This is due to number type differences between rust for turbopack to js number types,\n// where rust does not have easy way to repreesnt js's 53-bit float number type for the matching\n// overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation\n// as can gaurantee determinstic output from 32bit hash.\nexport function djb2Hash(str: string) {\n let hash = 5381\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = ((hash << 5) + hash + char) & 0xffffffff\n }\n return hash >>> 0\n}\n\nexport function hexHash(str: string) {\n return djb2Hash(str).toString(36).slice(0, 5)\n}\n","import React from 'react'\n\nexport const HeadManagerContext: React.Context<{\n updateHead?: (state: any) => void\n mountedInstances?: any\n updateScripts?: (state: any) => void\n scripts?: any\n getIsSsr?: () => boolean\n\n // Used in app directory, to render script tags as server components.\n appDir?: boolean\n nonce?: string\n}> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext'\n}\n","'use client'\n\nimport { createContext } from 'react'\nimport type { Params } from '../../server/request/params'\n\nexport const SearchParamsContext = createContext(null)\nexport const PathnameContext = createContext(null)\nexport const PathParamsContext = createContext(null)\n\nif (process.env.NODE_ENV !== 'production') {\n SearchParamsContext.displayName = 'SearchParamsContext'\n PathnameContext.displayName = 'PathnameContext'\n PathParamsContext.displayName = 'PathParamsContext'\n}\n","export class InvariantError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(\n `Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`,\n options\n )\n this.name = 'InvariantError'\n }\n}\n","export function getObjectClassLabel(value: any): string {\n return Object.prototype.toString.call(value)\n}\n\nexport function isPlainObject(value: any): boolean {\n if (getObjectClassLabel(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n\n /**\n * this used to be previously:\n *\n * `return prototype === null || prototype === Object.prototype`\n *\n * but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.\n *\n * It was changed to the current implementation since it's resilient to serialization.\n */\n return prototype === null || prototype.hasOwnProperty('isPrototypeOf')\n}\n","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */\nexport function isThenable(\n promise: Promise | T\n): promise is Promise {\n return (\n promise !== null &&\n typeof promise === 'object' &&\n 'then' in promise &&\n typeof promise.then === 'function'\n )\n}\n","// This has to be a shared module which is shared between client component error boundary and dynamic component\nconst BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING'\n\n/** An error that should be thrown when we want to bail out to client-side rendering. */\nexport class BailoutToCSRError extends Error {\n public readonly digest = BAILOUT_TO_CSR\n\n constructor(public readonly reason: string) {\n super(`Bail out to client-side rendering: ${reason}`)\n }\n}\n\n/** Checks if a passed argument is an error that is thrown if we want to bail out to client-side rendering. */\nexport function isBailoutToCSRError(err: unknown): err is BailoutToCSRError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === BAILOUT_TO_CSR\n}\n","/**\n * For a given page path, this function ensures that there is a leading slash.\n * If there is not a leading slash, one is added, otherwise it is noop.\n */\nexport function ensureLeadingSlash(path: string) {\n return path.startsWith('/') ? path : `/${path}`\n}\n","import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n} from '../../../client/components/router-reducer/router-reducer-types'\nimport { reducer } from '../../../client/components/router-reducer/router-reducer'\nimport { startTransition } from 'react'\nimport { isThenable } from '../is-thenable'\n\nexport type DispatchStatePromise = React.Dispatch\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n last: ActionQueueNode | null\n}\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n } else {\n // No more actions are pending, check if a refresh is needed\n if (actionQueue.needsRefresh) {\n actionQueue.needsRefresh = false\n actionQueue.dispatch(\n {\n type: ACTION_REFRESH,\n origin: window.location.origin,\n },\n setState\n )\n }\n }\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n // if the pending action was a server action, mark the queue as needing a refresh once events are processed\n if (actionQueue.pending.payload.type === ACTION_SERVER_ACTION) {\n actionQueue.needsRefresh = true\n }\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nexport function createMutableActionQueue(\n initialState: AppRouterState\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n }\n\n return actionQueue\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */\nexport function addPathPrefix(path: string, prefix?: string) {\n if (!path.startsWith('/') || !prefix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${prefix}${pathname}${query}${hash}`\n}\n","import { ensureLeadingSlash } from '../../page-path/ensure-leading-slash'\nimport { isGroupSegment } from '../../segment'\n\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */\nexport function normalizeAppPath(route: string) {\n return ensureLeadingSlash(\n route.split('/').reduce((pathname, segment, index, segments) => {\n // Empty segments are ignored.\n if (!segment) {\n return pathname\n }\n\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname\n }\n\n // Parallel segments are ignored.\n if (segment[0] === '@') {\n return pathname\n }\n\n // The last segment (if it's a leaf) should be ignored.\n if (\n (segment === 'page' || segment === 'route') &&\n index === segments.length - 1\n ) {\n return pathname\n }\n\n return `${pathname}/${segment}`\n }, '')\n )\n}\n\n/**\n * Strips the `.rsc` extension if it's in the pathname.\n * Since this function is used on full urls it checks `?` for searchParams handling.\n */\nexport function normalizeRscURL(url: string) {\n return url.replace(\n /\\.rsc($|\\?)/,\n // $1 ensures `?` is preserved\n '$1'\n )\n}\n","/**\n * Run function with `scroll-behavior: auto` applied to ``.\n * This css change will be reverted after the function finishes.\n */\nexport function handleSmoothScroll(\n fn: () => void,\n options: { dontForceLayout?: boolean; onlyHashChange?: boolean } = {}\n) {\n // if only the hash is changed, we don't need to disable smooth scrolling\n // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX\n if (options.onlyHashChange) {\n fn()\n return\n }\n const htmlElement = document.documentElement\n const existing = htmlElement.style.scrollBehavior\n htmlElement.style.scrollBehavior = 'auto'\n if (!options.dontForceLayout) {\n // In Chrome-based browsers we need to force reflow before calling `scrollTo`.\n // Otherwise it will not pickup the change in scrollBehavior\n // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042\n htmlElement.getClientRects()\n }\n fn()\n htmlElement.style.scrollBehavior = existing\n}\n","const BOT_UA_RE =\n /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i\n\nexport function isBot(userAgent: string): boolean {\n return BOT_UA_RE.test(userAgent)\n}\n","/**\n * Given a path this function will find the pathname, query and hash and return\n * them. This is useful to parse full paths on the client side.\n * @param path A path to parse e.g. /foo/bar?id=1#hash\n */\nexport function parsePath(path: string) {\n const hashIndex = path.indexOf('#')\n const queryIndex = path.indexOf('?')\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex)\n\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery\n ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined)\n : '',\n hash: hashIndex > -1 ? path.slice(hashIndex) : '',\n }\n }\n\n return { pathname: path, query: '', hash: '' }\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Checks if a given path starts with a given prefix. It ensures it matches\n * exactly without containing extra chars. e.g. prefix /docs should replace\n * for /docs, /docs/, /docs/a but not /docsss\n * @param path The path to check.\n * @param prefix The prefix to check against.\n */\nexport function pathHasPrefix(path: string, prefix: string) {\n if (typeof path !== 'string') {\n return false\n }\n\n const { pathname } = parsePath(path)\n return pathname === prefix || pathname.startsWith(prefix + '/')\n}\n","/**\n * Removes the trailing slash for a given route or page path. Preserves the\n * root page. Examples:\n * - `/foo/bar/` -> `/foo/bar`\n * - `/foo/bar` -> `/foo/bar`\n * - `/` -> `/`\n */\nexport function removeTrailingSlash(route: string) {\n return route.replace(/\\/$/, '') || '/'\n}\n","import type { Segment } from '../../server/app-render/types'\n\nexport function isGroupSegment(segment: string) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')')\n}\n\nexport function addSearchParamsIfPageSegment(\n segment: Segment,\n searchParams: Record\n) {\n const isPageSegment = segment.includes(PAGE_SEGMENT_KEY)\n\n if (isPageSegment) {\n const stringifiedQuery = JSON.stringify(searchParams)\n return stringifiedQuery !== '{}'\n ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery\n : PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n\nexport const PAGE_SEGMENT_KEY = '__PAGE__'\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__'\n","'use client'\n\nimport React, { useContext } from 'react'\n\nexport type ServerInsertedHTMLHook = (callbacks: () => React.ReactNode) => void\n\n// Use `React.createContext` to avoid errors from the RSC checks because\n// it can't be imported directly in Server Components:\n//\n// import { createContext } from 'react'\n//\n// More info: https://github.com/vercel/next.js/pull/40686\nexport const ServerInsertedHTMLContext =\n React.createContext(null as any)\n\nexport function useServerInsertedHTML(callback: () => React.ReactNode): void {\n const addInsertedServerHTMLCallback = useContext(ServerInsertedHTMLContext)\n // Should have no effects on client where there's no flush effects provider\n if (addInsertedServerHTMLCallback) {\n addInsertedServerHTMLCallback(callback)\n }\n}\n","let warnOnce = (_: string) => {}\nif (process.env.NODE_ENV !== 'production') {\n const warnings = new Set()\n warnOnce = (msg: string) => {\n if (!warnings.has(msg)) {\n console.warn(msg)\n }\n warnings.add(msg)\n }\n}\n\nexport { warnOnce }\n","/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"next/dist/compiled/react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.0.0-rc-66855b96-20241106\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom-client.production.js');\n} else {\n module.exports = require('./cjs/react-dom-client.development.js');\n}\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","/**\n * @license React\n * react-server-dom-webpack-client.browser.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar ReactDOM = require(\"react-dom\"),\n decoderOptions = { stream: !0 };\nfunction resolveClientReference(bundlerConfig, metadata) {\n if (bundlerConfig) {\n var moduleExports = bundlerConfig[metadata[0]];\n if ((bundlerConfig = moduleExports && moduleExports[metadata[2]]))\n moduleExports = bundlerConfig.name;\n else {\n bundlerConfig = moduleExports && moduleExports[\"*\"];\n if (!bundlerConfig)\n throw Error(\n 'Could not find the module \"' +\n metadata[0] +\n '\" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.'\n );\n moduleExports = metadata[2];\n }\n return 4 === metadata.length\n ? [bundlerConfig.id, bundlerConfig.chunks, moduleExports, 1]\n : [bundlerConfig.id, bundlerConfig.chunks, moduleExports];\n }\n return metadata;\n}\nfunction resolveServerReference(bundlerConfig, id) {\n var name = \"\",\n resolvedModuleData = bundlerConfig[id];\n if (resolvedModuleData) name = resolvedModuleData.name;\n else {\n var idx = id.lastIndexOf(\"#\");\n -1 !== idx &&\n ((name = id.slice(idx + 1)),\n (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));\n if (!resolvedModuleData)\n throw Error(\n 'Could not find the module \"' +\n id +\n '\" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'\n );\n }\n return resolvedModuleData.async\n ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]\n : [resolvedModuleData.id, resolvedModuleData.chunks, name];\n}\nvar chunkCache = new Map();\nfunction requireAsyncModule(id) {\n var promise = __webpack_require__(id);\n if (\"function\" !== typeof promise.then || \"fulfilled\" === promise.status)\n return null;\n promise.then(\n function (value) {\n promise.status = \"fulfilled\";\n promise.value = value;\n },\n function (reason) {\n promise.status = \"rejected\";\n promise.reason = reason;\n }\n );\n return promise;\n}\nfunction ignoreReject() {}\nfunction preloadModule(metadata) {\n for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {\n var chunkId = chunks[i++],\n chunkFilename = chunks[i++],\n entry = chunkCache.get(chunkId);\n void 0 === entry\n ? (chunkMap.set(chunkId, chunkFilename),\n (chunkFilename = __webpack_chunk_load__(chunkId)),\n promises.push(chunkFilename),\n (entry = chunkCache.set.bind(chunkCache, chunkId, null)),\n chunkFilename.then(entry, ignoreReject),\n chunkCache.set(chunkId, chunkFilename))\n : null !== entry && promises.push(entry);\n }\n return 4 === metadata.length\n ? 0 === promises.length\n ? requireAsyncModule(metadata[0])\n : Promise.all(promises).then(function () {\n return requireAsyncModule(metadata[0]);\n })\n : 0 < promises.length\n ? Promise.all(promises)\n : null;\n}\nfunction requireModule(metadata) {\n var moduleExports = __webpack_require__(metadata[0]);\n if (4 === metadata.length && \"function\" === typeof moduleExports.then)\n if (\"fulfilled\" === moduleExports.status)\n moduleExports = moduleExports.value;\n else throw moduleExports.reason;\n return \"*\" === metadata[2]\n ? moduleExports\n : \"\" === metadata[2]\n ? moduleExports.__esModule\n ? moduleExports.default\n : moduleExports\n : moduleExports[metadata[2]];\n}\nvar chunkMap = new Map(),\n webpackGetChunkFilename = __webpack_require__.u;\n__webpack_require__.u = function (chunkId) {\n var flightChunk = chunkMap.get(chunkId);\n return void 0 !== flightChunk\n ? flightChunk\n : webpackGetChunkFilename(chunkId);\n};\nvar ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ASYNC_ITERATOR = Symbol.asyncIterator,\n isArrayImpl = Array.isArray,\n getPrototypeOf = Object.getPrototypeOf,\n ObjectPrototype = Object.prototype,\n knownServerReferences = new WeakMap();\nfunction serializeNumber(number) {\n return Number.isFinite(number)\n ? 0 === number && -Infinity === 1 / number\n ? \"$-0\"\n : number\n : Infinity === number\n ? \"$Infinity\"\n : -Infinity === number\n ? \"$-Infinity\"\n : \"$NaN\";\n}\nfunction processReply(\n root,\n formFieldPrefix,\n temporaryReferences,\n resolve,\n reject\n) {\n function serializeTypedArray(tag, typedArray) {\n typedArray = new Blob([\n new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n )\n ]);\n var blobId = nextPartId++;\n null === formData && (formData = new FormData());\n formData.append(formFieldPrefix + blobId, typedArray);\n return \"$\" + tag + blobId.toString(16);\n }\n function serializeBinaryReader(reader) {\n function progress(entry) {\n entry.done\n ? ((entry = nextPartId++),\n data.append(formFieldPrefix + entry, new Blob(buffer)),\n data.append(\n formFieldPrefix + streamId,\n '\"$o' + entry.toString(16) + '\"'\n ),\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data))\n : (buffer.push(entry.value),\n reader.read(new Uint8Array(1024)).then(progress, reject));\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++,\n buffer = [];\n reader.read(new Uint8Array(1024)).then(progress, reject);\n return \"$r\" + streamId.toString(16);\n }\n function serializeReader(reader) {\n function progress(entry) {\n if (entry.done)\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data);\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON);\n reader.read().then(progress, reject);\n } catch (x) {\n reject(x);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n reader.read().then(progress, reject);\n return \"$R\" + streamId.toString(16);\n }\n function serializeReadableStream(stream) {\n try {\n var binaryReader = stream.getReader({ mode: \"byob\" });\n } catch (x) {\n return serializeReader(stream.getReader());\n }\n return serializeBinaryReader(binaryReader);\n }\n function serializeAsyncIterable(iterable, iterator) {\n function progress(entry) {\n if (entry.done) {\n if (void 0 === entry.value)\n data.append(formFieldPrefix + streamId, \"C\");\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, \"C\" + partJSON);\n } catch (x) {\n reject(x);\n return;\n }\n pendingParts--;\n 0 === pendingParts && resolve(data);\n } else\n try {\n var partJSON$22 = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON$22);\n iterator.next().then(progress, reject);\n } catch (x$23) {\n reject(x$23);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n iterable = iterable === iterator;\n iterator.next().then(progress, reject);\n return \"$\" + (iterable ? \"x\" : \"X\") + streamId.toString(16);\n }\n function resolveToJSON(key, value) {\n if (null === value) return null;\n if (\"object\" === typeof value) {\n switch (value.$$typeof) {\n case REACT_ELEMENT_TYPE:\n if (void 0 !== temporaryReferences && -1 === key.indexOf(\":\")) {\n var parentReference = writtenObjects.get(this);\n if (void 0 !== parentReference)\n return (\n temporaryReferences.set(parentReference + \":\" + key, value),\n \"$T\"\n );\n }\n throw Error(\n \"React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n case REACT_LAZY_TYPE:\n parentReference = value._payload;\n var init = value._init;\n null === formData && (formData = new FormData());\n pendingParts++;\n try {\n var resolvedModel = init(parentReference),\n lazyId = nextPartId++,\n partJSON = serializeModel(resolvedModel, lazyId);\n formData.append(formFieldPrefix + lazyId, partJSON);\n return \"$\" + lazyId.toString(16);\n } catch (x) {\n if (\n \"object\" === typeof x &&\n null !== x &&\n \"function\" === typeof x.then\n ) {\n pendingParts++;\n var lazyId$24 = nextPartId++;\n parentReference = function () {\n try {\n var partJSON$25 = serializeModel(value, lazyId$24),\n data$26 = formData;\n data$26.append(formFieldPrefix + lazyId$24, partJSON$25);\n pendingParts--;\n 0 === pendingParts && resolve(data$26);\n } catch (reason) {\n reject(reason);\n }\n };\n x.then(parentReference, parentReference);\n return \"$\" + lazyId$24.toString(16);\n }\n reject(x);\n return null;\n } finally {\n pendingParts--;\n }\n }\n if (\"function\" === typeof value.then) {\n null === formData && (formData = new FormData());\n pendingParts++;\n var promiseId = nextPartId++;\n value.then(function (partValue) {\n try {\n var partJSON$28 = serializeModel(partValue, promiseId);\n partValue = formData;\n partValue.append(formFieldPrefix + promiseId, partJSON$28);\n pendingParts--;\n 0 === pendingParts && resolve(partValue);\n } catch (reason) {\n reject(reason);\n }\n }, reject);\n return \"$@\" + promiseId.toString(16);\n }\n parentReference = writtenObjects.get(value);\n if (void 0 !== parentReference)\n if (modelRoot === value) modelRoot = null;\n else return parentReference;\n else\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference &&\n ((key = parentReference + \":\" + key),\n writtenObjects.set(value, key),\n void 0 !== temporaryReferences &&\n temporaryReferences.set(key, value)));\n if (isArrayImpl(value)) return value;\n if (value instanceof FormData) {\n null === formData && (formData = new FormData());\n var data$32 = formData;\n key = nextPartId++;\n var prefix = formFieldPrefix + key + \"_\";\n value.forEach(function (originalValue, originalKey) {\n data$32.append(prefix + originalKey, originalValue);\n });\n return \"$K\" + key.toString(16);\n }\n if (value instanceof Map)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$Q\" + key.toString(16)\n );\n if (value instanceof Set)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$W\" + key.toString(16)\n );\n if (value instanceof ArrayBuffer)\n return (\n (key = new Blob([value])),\n (parentReference = nextPartId++),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + parentReference, key),\n \"$A\" + parentReference.toString(16)\n );\n if (value instanceof Int8Array) return serializeTypedArray(\"O\", value);\n if (value instanceof Uint8Array) return serializeTypedArray(\"o\", value);\n if (value instanceof Uint8ClampedArray)\n return serializeTypedArray(\"U\", value);\n if (value instanceof Int16Array) return serializeTypedArray(\"S\", value);\n if (value instanceof Uint16Array) return serializeTypedArray(\"s\", value);\n if (value instanceof Int32Array) return serializeTypedArray(\"L\", value);\n if (value instanceof Uint32Array) return serializeTypedArray(\"l\", value);\n if (value instanceof Float32Array) return serializeTypedArray(\"G\", value);\n if (value instanceof Float64Array) return serializeTypedArray(\"g\", value);\n if (value instanceof BigInt64Array)\n return serializeTypedArray(\"M\", value);\n if (value instanceof BigUint64Array)\n return serializeTypedArray(\"m\", value);\n if (value instanceof DataView) return serializeTypedArray(\"V\", value);\n if (\"function\" === typeof Blob && value instanceof Blob)\n return (\n null === formData && (formData = new FormData()),\n (key = nextPartId++),\n formData.append(formFieldPrefix + key, value),\n \"$B\" + key.toString(16)\n );\n if ((key = getIteratorFn(value)))\n return (\n (parentReference = key.call(value)),\n parentReference === value\n ? ((key = nextPartId++),\n (parentReference = serializeModel(\n Array.from(parentReference),\n key\n )),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$i\" + key.toString(16))\n : Array.from(parentReference)\n );\n if (\n \"function\" === typeof ReadableStream &&\n value instanceof ReadableStream\n )\n return serializeReadableStream(value);\n key = value[ASYNC_ITERATOR];\n if (\"function\" === typeof key)\n return serializeAsyncIterable(value, key.call(value));\n key = getPrototypeOf(value);\n if (\n key !== ObjectPrototype &&\n (null === key || null !== getPrototypeOf(key))\n ) {\n if (void 0 === temporaryReferences)\n throw Error(\n \"Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported.\"\n );\n return \"$T\";\n }\n return value;\n }\n if (\"string\" === typeof value) {\n if (\"Z\" === value[value.length - 1] && this[key] instanceof Date)\n return \"$D\" + value;\n key = \"$\" === value[0] ? \"$\" + value : value;\n return key;\n }\n if (\"boolean\" === typeof value) return value;\n if (\"number\" === typeof value) return serializeNumber(value);\n if (\"undefined\" === typeof value) return \"$undefined\";\n if (\"function\" === typeof value) {\n parentReference = knownServerReferences.get(value);\n if (void 0 !== parentReference)\n return (\n (key = JSON.stringify(parentReference, resolveToJSON)),\n null === formData && (formData = new FormData()),\n (parentReference = nextPartId++),\n formData.set(formFieldPrefix + parentReference, key),\n \"$F\" + parentReference.toString(16)\n );\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.\"\n );\n }\n if (\"symbol\" === typeof value) {\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n }\n if (\"bigint\" === typeof value) return \"$n\" + value.toString(10);\n throw Error(\n \"Type \" +\n typeof value +\n \" is not supported as an argument to a Server Function.\"\n );\n }\n function serializeModel(model, id) {\n \"object\" === typeof model &&\n null !== model &&\n ((id = \"$\" + id.toString(16)),\n writtenObjects.set(model, id),\n void 0 !== temporaryReferences && temporaryReferences.set(id, model));\n modelRoot = model;\n return JSON.stringify(model, resolveToJSON);\n }\n var nextPartId = 1,\n pendingParts = 0,\n formData = null,\n writtenObjects = new WeakMap(),\n modelRoot = root,\n json = serializeModel(root, 0);\n null === formData\n ? resolve(json)\n : (formData.set(formFieldPrefix + \"0\", json),\n 0 === pendingParts && resolve(formData));\n return function () {\n 0 < pendingParts &&\n ((pendingParts = 0),\n null === formData ? resolve(json) : resolve(formData));\n };\n}\nfunction registerServerReference(proxy, reference) {\n knownServerReferences.set(proxy, reference);\n}\nfunction createBoundServerReference(metaData, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return bound\n ? \"fulfilled\" === bound.status\n ? callServer(id, bound.value.concat(args))\n : Promise.resolve(bound).then(function (boundArgs) {\n return callServer(id, boundArgs.concat(args));\n })\n : callServer(id, args);\n }\n var id = metaData.id,\n bound = metaData.bound;\n registerServerReference(action, { id: id, bound: bound });\n return action;\n}\nfunction ReactPromise(status, value, reason, response) {\n this.status = status;\n this.value = value;\n this.reason = reason;\n this._response = response;\n}\nReactPromise.prototype = Object.create(Promise.prototype);\nReactPromise.prototype.then = function (resolve, reject) {\n switch (this.status) {\n case \"resolved_model\":\n initializeModelChunk(this);\n break;\n case \"resolved_module\":\n initializeModuleChunk(this);\n }\n switch (this.status) {\n case \"fulfilled\":\n resolve(this.value);\n break;\n case \"pending\":\n case \"blocked\":\n resolve &&\n (null === this.value && (this.value = []), this.value.push(resolve));\n reject &&\n (null === this.reason && (this.reason = []), this.reason.push(reject));\n break;\n default:\n reject && reject(this.reason);\n }\n};\nfunction readChunk(chunk) {\n switch (chunk.status) {\n case \"resolved_model\":\n initializeModelChunk(chunk);\n break;\n case \"resolved_module\":\n initializeModuleChunk(chunk);\n }\n switch (chunk.status) {\n case \"fulfilled\":\n return chunk.value;\n case \"pending\":\n case \"blocked\":\n throw chunk;\n default:\n throw chunk.reason;\n }\n}\nfunction createPendingChunk(response) {\n return new ReactPromise(\"pending\", null, null, response);\n}\nfunction wakeChunk(listeners, value) {\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);\n}\nfunction wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {\n switch (chunk.status) {\n case \"fulfilled\":\n wakeChunk(resolveListeners, chunk.value);\n break;\n case \"pending\":\n case \"blocked\":\n if (chunk.value)\n for (var i = 0; i < resolveListeners.length; i++)\n chunk.value.push(resolveListeners[i]);\n else chunk.value = resolveListeners;\n if (chunk.reason) {\n if (rejectListeners)\n for (\n resolveListeners = 0;\n resolveListeners < rejectListeners.length;\n resolveListeners++\n )\n chunk.reason.push(rejectListeners[resolveListeners]);\n } else chunk.reason = rejectListeners;\n break;\n case \"rejected\":\n rejectListeners && wakeChunk(rejectListeners, chunk.reason);\n }\n}\nfunction triggerErrorOnChunk(chunk, error) {\n if (\"pending\" !== chunk.status && \"blocked\" !== chunk.status)\n chunk.reason.error(error);\n else {\n var listeners = chunk.reason;\n chunk.status = \"rejected\";\n chunk.reason = error;\n null !== listeners && wakeChunk(listeners, error);\n }\n}\nfunction createResolvedIteratorResultChunk(response, value, done) {\n return new ReactPromise(\n \"resolved_model\",\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\",\n null,\n response\n );\n}\nfunction resolveIteratorResultChunk(chunk, value, done) {\n resolveModelChunk(\n chunk,\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\"\n );\n}\nfunction resolveModelChunk(chunk, value) {\n if (\"pending\" !== chunk.status) chunk.reason.enqueueModel(value);\n else {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_model\";\n chunk.value = value;\n null !== resolveListeners &&\n (initializeModelChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nfunction resolveModuleChunk(chunk, value) {\n if (\"pending\" === chunk.status || \"blocked\" === chunk.status) {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_module\";\n chunk.value = value;\n null !== resolveListeners &&\n (initializeModuleChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nvar initializingHandler = null;\nfunction initializeModelChunk(chunk) {\n var prevHandler = initializingHandler;\n initializingHandler = null;\n var resolvedModel = chunk.value;\n chunk.status = \"blocked\";\n chunk.value = null;\n chunk.reason = null;\n try {\n var value = JSON.parse(resolvedModel, chunk._response._fromJSON),\n resolveListeners = chunk.value;\n null !== resolveListeners &&\n ((chunk.value = null),\n (chunk.reason = null),\n wakeChunk(resolveListeners, value));\n if (null !== initializingHandler) {\n if (initializingHandler.errored) throw initializingHandler.value;\n if (0 < initializingHandler.deps) {\n initializingHandler.value = value;\n initializingHandler.chunk = chunk;\n return;\n }\n }\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n } finally {\n initializingHandler = prevHandler;\n }\n}\nfunction initializeModuleChunk(chunk) {\n try {\n var value = requireModule(chunk.value);\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n }\n}\nfunction reportGlobalError(response, error) {\n response._chunks.forEach(function (chunk) {\n \"pending\" === chunk.status && triggerErrorOnChunk(chunk, error);\n });\n}\nfunction createLazyChunkWrapper(chunk) {\n return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };\n}\nfunction getChunk(response, id) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk || ((chunk = createPendingChunk(response)), chunks.set(id, chunk));\n return chunk;\n}\nfunction waitForReference(\n referencedChunk,\n parentObject,\n key,\n response,\n map,\n path\n) {\n function fulfill(value) {\n for (var i = 1; i < path.length; i++) {\n for (; value.$$typeof === REACT_LAZY_TYPE; )\n if (((value = value._payload), value === handler.chunk))\n value = handler.value;\n else if (\"fulfilled\" === value.status) value = value.value;\n else {\n path.splice(0, i - 1);\n value.then(fulfill, reject);\n return;\n }\n value = value[path[i]];\n }\n i = map(response, value, parentObject, key);\n parentObject[key] = i;\n \"\" === key && null === handler.value && (handler.value = i);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((value = handler.value), key)) {\n case \"3\":\n value.props = i;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((i = handler.chunk),\n null !== i &&\n \"blocked\" === i.status &&\n ((value = i.value),\n (i.status = \"fulfilled\"),\n (i.value = handler.value),\n null !== value && wakeChunk(value, handler.value)));\n }\n function reject(error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = error;\n var chunk = handler.chunk;\n null !== chunk &&\n \"blocked\" === chunk.status &&\n triggerErrorOnChunk(chunk, error);\n }\n }\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n deps: 1,\n errored: !1\n };\n referencedChunk.then(fulfill, reject);\n return null;\n}\nfunction loadServerReference(response, metaData, parentObject, key) {\n if (!response._serverReferenceConfig)\n return createBoundServerReference(metaData, response._callServer);\n var serverReference = resolveServerReference(\n response._serverReferenceConfig,\n metaData.id\n );\n if ((response = preloadModule(serverReference)))\n metaData.bound && (response = Promise.all([response, metaData.bound]));\n else if (metaData.bound) response = Promise.resolve(metaData.bound);\n else return requireModule(serverReference);\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n deps: 1,\n errored: !1\n };\n response.then(\n function () {\n var resolvedValue = requireModule(serverReference);\n if (metaData.bound) {\n var boundArgs = metaData.bound.value.slice(0);\n boundArgs.unshift(null);\n resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs);\n }\n parentObject[key] = resolvedValue;\n \"\" === key && null === handler.value && (handler.value = resolvedValue);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((boundArgs = handler.value), key)) {\n case \"3\":\n boundArgs.props = resolvedValue;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((resolvedValue = handler.chunk),\n null !== resolvedValue &&\n \"blocked\" === resolvedValue.status &&\n ((boundArgs = resolvedValue.value),\n (resolvedValue.status = \"fulfilled\"),\n (resolvedValue.value = handler.value),\n null !== boundArgs && wakeChunk(boundArgs, handler.value)));\n },\n function (error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = error;\n var chunk = handler.chunk;\n null !== chunk &&\n \"blocked\" === chunk.status &&\n triggerErrorOnChunk(chunk, error);\n }\n }\n );\n return null;\n}\nfunction getOutlinedModel(response, reference, parentObject, key, map) {\n reference = reference.split(\":\");\n var id = parseInt(reference[0], 16);\n id = getChunk(response, id);\n switch (id.status) {\n case \"resolved_model\":\n initializeModelChunk(id);\n break;\n case \"resolved_module\":\n initializeModuleChunk(id);\n }\n switch (id.status) {\n case \"fulfilled\":\n var value = id.value;\n for (id = 1; id < reference.length; id++) {\n for (; value.$$typeof === REACT_LAZY_TYPE; )\n if (((value = value._payload), \"fulfilled\" === value.status))\n value = value.value;\n else\n return waitForReference(\n value,\n parentObject,\n key,\n response,\n map,\n reference.slice(id - 1)\n );\n value = value[reference[id]];\n }\n return map(response, value, parentObject, key);\n case \"pending\":\n case \"blocked\":\n return waitForReference(id, parentObject, key, response, map, reference);\n default:\n return (\n initializingHandler\n ? ((initializingHandler.errored = !0),\n (initializingHandler.value = id.reason))\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: id.reason,\n deps: 0,\n errored: !0\n }),\n null\n );\n }\n}\nfunction createMap(response, model) {\n return new Map(model);\n}\nfunction createSet(response, model) {\n return new Set(model);\n}\nfunction createBlob(response, model) {\n return new Blob(model.slice(1), { type: model[0] });\n}\nfunction createFormData(response, model) {\n response = new FormData();\n for (var i = 0; i < model.length; i++)\n response.append(model[i][0], model[i][1]);\n return response;\n}\nfunction extractIterator(response, model) {\n return model[Symbol.iterator]();\n}\nfunction createModel(response, model) {\n return model;\n}\nfunction parseModelString(response, parentObject, key, value) {\n if (\"$\" === value[0]) {\n if (\"$\" === value)\n return (\n null !== initializingHandler &&\n \"0\" === key &&\n (initializingHandler = {\n parent: initializingHandler,\n chunk: null,\n value: null,\n deps: 0,\n errored: !1\n }),\n REACT_ELEMENT_TYPE\n );\n switch (value[1]) {\n case \"$\":\n return value.slice(1);\n case \"L\":\n return (\n (parentObject = parseInt(value.slice(2), 16)),\n (response = getChunk(response, parentObject)),\n createLazyChunkWrapper(response)\n );\n case \"@\":\n if (2 === value.length) return new Promise(function () {});\n parentObject = parseInt(value.slice(2), 16);\n return getChunk(response, parentObject);\n case \"S\":\n return Symbol.for(value.slice(2));\n case \"F\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(\n response,\n value,\n parentObject,\n key,\n loadServerReference\n )\n );\n case \"T\":\n parentObject = \"$\" + value.slice(2);\n response = response._tempRefs;\n if (null == response)\n throw Error(\n \"Missing a temporary reference set but the RSC response returned a temporary reference. Pass a temporaryReference option with the set that was used with the reply.\"\n );\n return response.get(parentObject);\n case \"Q\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createMap)\n );\n case \"W\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createSet)\n );\n case \"B\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createBlob)\n );\n case \"K\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createFormData)\n );\n case \"Z\":\n return resolveErrorProd();\n case \"i\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, extractIterator)\n );\n case \"I\":\n return Infinity;\n case \"-\":\n return \"$-0\" === value ? -0 : -Infinity;\n case \"N\":\n return NaN;\n case \"u\":\n return;\n case \"D\":\n return new Date(Date.parse(value.slice(2)));\n case \"n\":\n return BigInt(value.slice(2));\n default:\n return (\n (value = value.slice(1)),\n getOutlinedModel(response, value, parentObject, key, createModel)\n );\n }\n }\n return value;\n}\nfunction missingCall() {\n throw Error(\n 'Trying to call a function from \"use server\" but the callServer option was not implemented in your router runtime.'\n );\n}\nfunction ResponseInstance(\n bundlerConfig,\n serverReferenceConfig,\n moduleLoading,\n callServer,\n encodeFormAction,\n nonce,\n temporaryReferences\n) {\n var chunks = new Map();\n this._bundlerConfig = bundlerConfig;\n this._serverReferenceConfig = serverReferenceConfig;\n this._moduleLoading = moduleLoading;\n this._callServer = void 0 !== callServer ? callServer : missingCall;\n this._encodeFormAction = encodeFormAction;\n this._nonce = nonce;\n this._chunks = chunks;\n this._stringDecoder = new TextDecoder();\n this._fromJSON = null;\n this._rowLength = this._rowTag = this._rowID = this._rowState = 0;\n this._buffer = [];\n this._tempRefs = temporaryReferences;\n this._fromJSON = createFromJSONCallback(this);\n}\nfunction resolveBuffer(response, id, buffer) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk && \"pending\" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : chunks.set(id, new ReactPromise(\"fulfilled\", buffer, null, response));\n}\nfunction resolveModule(response, id, model) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n model = JSON.parse(model, response._fromJSON);\n var clientReference = resolveClientReference(response._bundlerConfig, model);\n if ((model = preloadModule(clientReference))) {\n if (chunk) {\n var blockedChunk = chunk;\n blockedChunk.status = \"blocked\";\n } else\n (blockedChunk = new ReactPromise(\"blocked\", null, null, response)),\n chunks.set(id, blockedChunk);\n model.then(\n function () {\n return resolveModuleChunk(blockedChunk, clientReference);\n },\n function (error) {\n return triggerErrorOnChunk(blockedChunk, error);\n }\n );\n } else\n chunk\n ? resolveModuleChunk(chunk, clientReference)\n : chunks.set(\n id,\n new ReactPromise(\"resolved_module\", clientReference, null, response)\n );\n}\nfunction resolveStream(response, id, stream, controller) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk\n ? \"pending\" === chunk.status &&\n ((response = chunk.value),\n (chunk.status = \"fulfilled\"),\n (chunk.value = stream),\n (chunk.reason = controller),\n null !== response && wakeChunk(response, chunk.value))\n : chunks.set(\n id,\n new ReactPromise(\"fulfilled\", stream, controller, response)\n );\n}\nfunction startReadableStream(response, id, type) {\n var controller = null;\n type = new ReadableStream({\n type: type,\n start: function (c) {\n controller = c;\n }\n });\n var previousBlockedChunk = null;\n resolveStream(response, id, type, {\n enqueueValue: function (value) {\n null === previousBlockedChunk\n ? controller.enqueue(value)\n : previousBlockedChunk.then(function () {\n controller.enqueue(value);\n });\n },\n enqueueModel: function (json) {\n if (null === previousBlockedChunk) {\n var chunk = new ReactPromise(\"resolved_model\", json, null, response);\n initializeModelChunk(chunk);\n \"fulfilled\" === chunk.status\n ? controller.enqueue(chunk.value)\n : (chunk.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n ),\n (previousBlockedChunk = chunk));\n } else {\n chunk = previousBlockedChunk;\n var chunk$52 = createPendingChunk(response);\n chunk$52.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n );\n previousBlockedChunk = chunk$52;\n chunk.then(function () {\n previousBlockedChunk === chunk$52 && (previousBlockedChunk = null);\n resolveModelChunk(chunk$52, json);\n });\n }\n },\n close: function () {\n if (null === previousBlockedChunk) controller.close();\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.close();\n });\n }\n },\n error: function (error) {\n if (null === previousBlockedChunk) controller.error(error);\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.error(error);\n });\n }\n }\n });\n}\nfunction asyncIterator() {\n return this;\n}\nfunction createIterator(next) {\n next = { next: next };\n next[ASYNC_ITERATOR] = asyncIterator;\n return next;\n}\nfunction startAsyncIterable(response, id, iterator) {\n var buffer = [],\n closed = !1,\n nextWriteIndex = 0,\n $jscomp$compprop0 = {};\n $jscomp$compprop0 =\n (($jscomp$compprop0[ASYNC_ITERATOR] = function () {\n var nextReadIndex = 0;\n return createIterator(function (arg) {\n if (void 0 !== arg)\n throw Error(\n \"Values cannot be passed to next() of AsyncIterables passed to Client Components.\"\n );\n if (nextReadIndex === buffer.length) {\n if (closed)\n return new ReactPromise(\n \"fulfilled\",\n { done: !0, value: void 0 },\n null,\n response\n );\n buffer[nextReadIndex] = createPendingChunk(response);\n }\n return buffer[nextReadIndex++];\n });\n }),\n $jscomp$compprop0);\n resolveStream(\n response,\n id,\n iterator ? $jscomp$compprop0[ASYNC_ITERATOR]() : $jscomp$compprop0,\n {\n enqueueValue: function (value) {\n if (nextWriteIndex === buffer.length)\n buffer[nextWriteIndex] = new ReactPromise(\n \"fulfilled\",\n { done: !1, value: value },\n null,\n response\n );\n else {\n var chunk = buffer[nextWriteIndex],\n resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"fulfilled\";\n chunk.value = { done: !1, value: value };\n null !== resolveListeners &&\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners);\n }\n nextWriteIndex++;\n },\n enqueueModel: function (value) {\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !1\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);\n nextWriteIndex++;\n },\n close: function (value) {\n closed = !0;\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !0\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);\n for (nextWriteIndex++; nextWriteIndex < buffer.length; )\n resolveIteratorResultChunk(\n buffer[nextWriteIndex++],\n '\"$undefined\"',\n !0\n );\n },\n error: function (error) {\n closed = !0;\n for (\n nextWriteIndex === buffer.length &&\n (buffer[nextWriteIndex] = createPendingChunk(response));\n nextWriteIndex < buffer.length;\n\n )\n triggerErrorOnChunk(buffer[nextWriteIndex++], error);\n }\n }\n );\n}\nfunction resolveErrorProd() {\n var error = Error(\n \"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.\"\n );\n error.stack = \"Error: \" + error.message;\n return error;\n}\nfunction mergeBuffer(buffer, lastChunk) {\n for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)\n byteLength += buffer[i].byteLength;\n byteLength = new Uint8Array(byteLength);\n for (var i$53 = (i = 0); i$53 < l; i$53++) {\n var chunk = buffer[i$53];\n byteLength.set(chunk, i);\n i += chunk.byteLength;\n }\n byteLength.set(lastChunk, i);\n return byteLength;\n}\nfunction resolveTypedArray(\n response,\n id,\n buffer,\n lastChunk,\n constructor,\n bytesPerElement\n) {\n buffer =\n 0 === buffer.length && 0 === lastChunk.byteOffset % bytesPerElement\n ? lastChunk\n : mergeBuffer(buffer, lastChunk);\n constructor = new constructor(\n buffer.buffer,\n buffer.byteOffset,\n buffer.byteLength / bytesPerElement\n );\n resolveBuffer(response, id, constructor);\n}\nfunction processFullBinaryRow(response, id, tag, buffer, chunk) {\n switch (tag) {\n case 65:\n resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);\n return;\n case 79:\n resolveTypedArray(response, id, buffer, chunk, Int8Array, 1);\n return;\n case 111:\n resolveBuffer(\n response,\n id,\n 0 === buffer.length ? chunk : mergeBuffer(buffer, chunk)\n );\n return;\n case 85:\n resolveTypedArray(response, id, buffer, chunk, Uint8ClampedArray, 1);\n return;\n case 83:\n resolveTypedArray(response, id, buffer, chunk, Int16Array, 2);\n return;\n case 115:\n resolveTypedArray(response, id, buffer, chunk, Uint16Array, 2);\n return;\n case 76:\n resolveTypedArray(response, id, buffer, chunk, Int32Array, 4);\n return;\n case 108:\n resolveTypedArray(response, id, buffer, chunk, Uint32Array, 4);\n return;\n case 71:\n resolveTypedArray(response, id, buffer, chunk, Float32Array, 4);\n return;\n case 103:\n resolveTypedArray(response, id, buffer, chunk, Float64Array, 8);\n return;\n case 77:\n resolveTypedArray(response, id, buffer, chunk, BigInt64Array, 8);\n return;\n case 109:\n resolveTypedArray(response, id, buffer, chunk, BigUint64Array, 8);\n return;\n case 86:\n resolveTypedArray(response, id, buffer, chunk, DataView, 1);\n return;\n }\n for (\n var stringDecoder = response._stringDecoder, row = \"\", i = 0;\n i < buffer.length;\n i++\n )\n row += stringDecoder.decode(buffer[i], decoderOptions);\n buffer = row += stringDecoder.decode(chunk);\n switch (tag) {\n case 73:\n resolveModule(response, id, buffer);\n break;\n case 72:\n id = buffer[0];\n buffer = buffer.slice(1);\n response = JSON.parse(buffer, response._fromJSON);\n buffer = ReactDOMSharedInternals.d;\n switch (id) {\n case \"D\":\n buffer.D(response);\n break;\n case \"C\":\n \"string\" === typeof response\n ? buffer.C(response)\n : buffer.C(response[0], response[1]);\n break;\n case \"L\":\n id = response[0];\n tag = response[1];\n 3 === response.length\n ? buffer.L(id, tag, response[2])\n : buffer.L(id, tag);\n break;\n case \"m\":\n \"string\" === typeof response\n ? buffer.m(response)\n : buffer.m(response[0], response[1]);\n break;\n case \"X\":\n \"string\" === typeof response\n ? buffer.X(response)\n : buffer.X(response[0], response[1]);\n break;\n case \"S\":\n \"string\" === typeof response\n ? buffer.S(response)\n : buffer.S(\n response[0],\n 0 === response[1] ? void 0 : response[1],\n 3 === response.length ? response[2] : void 0\n );\n break;\n case \"M\":\n \"string\" === typeof response\n ? buffer.M(response)\n : buffer.M(response[0], response[1]);\n }\n break;\n case 69:\n tag = JSON.parse(buffer);\n buffer = resolveErrorProd();\n buffer.digest = tag.digest;\n tag = response._chunks;\n (chunk = tag.get(id))\n ? triggerErrorOnChunk(chunk, buffer)\n : tag.set(id, new ReactPromise(\"rejected\", null, buffer, response));\n break;\n case 84:\n tag = response._chunks;\n (chunk = tag.get(id)) && \"pending\" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : tag.set(id, new ReactPromise(\"fulfilled\", buffer, null, response));\n break;\n case 68:\n case 87:\n throw Error(\n \"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client.\"\n );\n case 82:\n startReadableStream(response, id, void 0);\n break;\n case 114:\n startReadableStream(response, id, \"bytes\");\n break;\n case 88:\n startAsyncIterable(response, id, !1);\n break;\n case 120:\n startAsyncIterable(response, id, !0);\n break;\n case 67:\n (response = response._chunks.get(id)) &&\n \"fulfilled\" === response.status &&\n response.reason.close(\"\" === buffer ? '\"$undefined\"' : buffer);\n break;\n default:\n (tag = response._chunks),\n (chunk = tag.get(id))\n ? resolveModelChunk(chunk, buffer)\n : tag.set(\n id,\n new ReactPromise(\"resolved_model\", buffer, null, response)\n );\n }\n}\nfunction createFromJSONCallback(response) {\n return function (key, value) {\n if (\"string\" === typeof value)\n return parseModelString(response, this, key, value);\n if (\"object\" === typeof value && null !== value) {\n if (value[0] === REACT_ELEMENT_TYPE) {\n if (\n ((key = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: value[1],\n key: value[2],\n ref: null,\n props: value[3]\n }),\n null !== initializingHandler)\n )\n if (\n ((value = initializingHandler),\n (initializingHandler = value.parent),\n value.errored)\n )\n (key = new ReactPromise(\"rejected\", null, value.value, response)),\n (key = createLazyChunkWrapper(key));\n else if (0 < value.deps) {\n var blockedChunk = new ReactPromise(\n \"blocked\",\n null,\n null,\n response\n );\n value.value = key;\n value.chunk = blockedChunk;\n key = createLazyChunkWrapper(blockedChunk);\n }\n } else key = value;\n return key;\n }\n return value;\n };\n}\nfunction createResponseFromOptions(options) {\n return new ResponseInstance(\n null,\n null,\n null,\n options && options.callServer ? options.callServer : void 0,\n void 0,\n void 0,\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0\n );\n}\nfunction startReadingFromStream(response, stream) {\n function progress(_ref) {\n var value = _ref.value;\n if (_ref.done) reportGlobalError(response, Error(\"Connection closed.\"));\n else {\n var i = 0,\n rowState = response._rowState;\n _ref = response._rowID;\n for (\n var rowTag = response._rowTag,\n rowLength = response._rowLength,\n buffer = response._buffer,\n chunkLength = value.length;\n i < chunkLength;\n\n ) {\n var lastIdx = -1;\n switch (rowState) {\n case 0:\n lastIdx = value[i++];\n 58 === lastIdx\n ? (rowState = 1)\n : (_ref =\n (_ref << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 1:\n rowState = value[i];\n 84 === rowState ||\n 65 === rowState ||\n 79 === rowState ||\n 111 === rowState ||\n 85 === rowState ||\n 83 === rowState ||\n 115 === rowState ||\n 76 === rowState ||\n 108 === rowState ||\n 71 === rowState ||\n 103 === rowState ||\n 77 === rowState ||\n 109 === rowState ||\n 86 === rowState\n ? ((rowTag = rowState), (rowState = 2), i++)\n : (64 < rowState && 91 > rowState) ||\n 35 === rowState ||\n 114 === rowState ||\n 120 === rowState\n ? ((rowTag = rowState), (rowState = 3), i++)\n : ((rowTag = 0), (rowState = 3));\n continue;\n case 2:\n lastIdx = value[i++];\n 44 === lastIdx\n ? (rowState = 4)\n : (rowLength =\n (rowLength << 4) |\n (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 3:\n lastIdx = value.indexOf(10, i);\n break;\n case 4:\n (lastIdx = i + rowLength), lastIdx > value.length && (lastIdx = -1);\n }\n var offset = value.byteOffset + i;\n if (-1 < lastIdx)\n (rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),\n processFullBinaryRow(response, _ref, rowTag, buffer, rowLength),\n (i = lastIdx),\n 3 === rowState && i++,\n (rowLength = _ref = rowTag = rowState = 0),\n (buffer.length = 0);\n else {\n value = new Uint8Array(value.buffer, offset, value.byteLength - i);\n buffer.push(value);\n rowLength -= value.byteLength;\n break;\n }\n }\n response._rowState = rowState;\n response._rowID = _ref;\n response._rowTag = rowTag;\n response._rowLength = rowLength;\n return reader.read().then(progress).catch(error);\n }\n }\n function error(e) {\n reportGlobalError(response, e);\n }\n var reader = stream.getReader();\n reader.read().then(progress).catch(error);\n}\nexports.createFromFetch = function (promiseForResponse, options) {\n var response = createResponseFromOptions(options);\n promiseForResponse.then(\n function (r) {\n startReadingFromStream(response, r.body);\n },\n function (e) {\n reportGlobalError(response, e);\n }\n );\n return getChunk(response, 0);\n};\nexports.createFromReadableStream = function (stream, options) {\n options = createResponseFromOptions(options);\n startReadingFromStream(options, stream);\n return getChunk(options, 0);\n};\nexports.createServerReference = function (id, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return callServer(id, args);\n }\n registerServerReference(action, { id: id, bound: null });\n return action;\n};\nexports.createTemporaryReferenceSet = function () {\n return new Map();\n};\nexports.encodeReply = function (value, options) {\n return new Promise(function (resolve, reject) {\n var abort = processReply(\n value,\n \"\",\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0,\n resolve,\n reject\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(signal.reason);\n else {\n var listener = function () {\n abort(signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n });\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-server-dom-webpack-client.browser.production.js');\n} else {\n module.exports = require('./cjs/react-server-dom-webpack-client.browser.development.js');\n}\n","'use strict';\n\nmodule.exports = require('./client.browser');\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray,\n ReactSharedInternals = { H: null, A: null, T: null, S: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, self, source, owner, props) {\n self = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== self ? self : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(\n oldElement.type,\n newKey,\n void 0,\n void 0,\n void 0,\n oldElement.props\n );\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction noop$1() {}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop$1, noop$1)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n };\nfunction noop() {}\nexports.Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n};\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.act = function () {\n throw Error(\"act(...) is not supported in production builds of React.\");\n};\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key,\n owner = void 0;\n if (null != config)\n for (propName in (void 0 !== config.ref && (owner = void 0),\n void 0 !== config.key && (key = \"\" + config.key),\n config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, void 0, void 0, owner, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, void 0, void 0, null, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n ReactSharedInternals.T = prevTransition;\n }\n};\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, deps) {\n return ReactSharedInternals.H.useEffect(create, deps);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = function (passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n};\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.0.0-rc-66855b96-20241106\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"actionAsyncStorage\", {\n enumerable: true,\n get: function() {\n return actionAsyncStorage;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst actionAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=action-async-storage-instance.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n bindSnapshot: null,\n createAsyncLocalStorage: null,\n createSnapshot: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n bindSnapshot: function() {\n return bindSnapshot;\n },\n createAsyncLocalStorage: function() {\n return createAsyncLocalStorage;\n },\n createSnapshot: function() {\n return createSnapshot;\n }\n});\nconst sharedAsyncLocalStorageNotAvailableError = new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available');\nclass FakeAsyncLocalStorage {\n disable() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n getStore() {\n // This fake implementation of AsyncLocalStorage always returns `undefined`.\n return undefined;\n }\n run() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n exit() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n enterWith() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n static bind(fn) {\n return fn;\n }\n}\nconst maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;\nfunction createAsyncLocalStorage() {\n if (maybeGlobalAsyncLocalStorage) {\n return new maybeGlobalAsyncLocalStorage();\n }\n return new FakeAsyncLocalStorage();\n}\nfunction bindSnapshot(fn) {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.bind(fn);\n }\n return FakeAsyncLocalStorage.bind(fn);\n}\nfunction createSnapshot() {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.snapshot();\n }\n return function(fn, ...args) {\n return fn(...args);\n };\n}\n\n//# sourceMappingURL=async-local-storage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"workAsyncStorage\", {\n enumerable: true,\n get: function() {\n return workAsyncStorage;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst workAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=work-async-storage-instance.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"workUnitAsyncStorage\", {\n enumerable: true,\n get: function() {\n return workUnitAsyncStorage;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst workUnitAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=work-unit-async-storage-instance.js.map","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","function _class_private_field_loose_base(receiver, privateKey) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError(\"attempted to use private field on non-instance\");\n }\n\n return receiver;\n}\nexport { _class_private_field_loose_base as _ };\n","var id = 0;\n\nfunction _class_private_field_loose_key(name) {\n return \"__private_\" + id++ + \"_\" + name;\n}\nexport { _class_private_field_loose_key as _ };\n","function _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nexport { _interop_require_default as _ };\n","function _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexport { _interop_require_wildcard as _ };\n"],"names":["addBasePath","path","required","normalizePathTrailingSlash","addPathPrefix","basePath","appBootstrap","callback","scripts","self","__next_s","hydrate","length","reduce","promise","src","props","then","Promise","resolve","reject","el","document","createElement","key","setAttribute","onload","onerror","innerHTML","children","setTimeout","head","appendChild","catch","console","error","err","window","next","version","process","env","appDir","callServer","useServerActionDispatcher","globalServerActionDispatcher","dispatch","useCallback","startTransition","serverActionDispatcher","actionPayload","type","ACTION_SERVER_ACTION","actionId","actionArgs","actionDispatcher","findSourceMapURL","undefined","initialServerDataBuffer","initialServerDataWriter","appElement","encoder","TextEncoder","initialServerDataLoaded","initialServerDataFlushed","initialFormStateData","nextServerDataCallback","seg","enqueue","encode","push","binaryString","atob","decodedChunk","Uint8Array","i","charCodeAt","DOMContentLoaded","close","readyState","addEventListener","nextServerDataLoadingGlobal","__next_f","forEach","readable","ReadableStream","start","controller","ctr","val","desiredSize","initialServerResponse","createFromReadableStream","pendingActionQueue","createMutableActionQueue","createInitialRouterState","buildId","initialRSCPayload","b","initialFlightData","f","initialCanonicalUrlParts","c","initialParallelRoutes","Map","location","couldBeIntercepted","postponed","s","prerendered","S","ServerRoot","use","actionQueue","router","AppRouter","globalErrorComponentAndStyles","G","assetPrefix","p","StrictModeIfEnabled","React","Fragment","Root","reactRootOptions","onRecoverableError","onCaughtError","onUncaughtError","reactEl","HeadManagerContext","Provider","value","rootLayoutMissingTags","__next_root_layout_missing_tags","hasMissingTags","documentElement","id","ReactDOMClient","createRoot","render","hydrateRoot","formState","require","getChunkScriptFilename","__webpack_require__","u","args","encodeURIPath","assignLocation","url","startsWith","urlBase","origin","pathname","URL","endsWith","href","AppRouterAnnouncer","ANNOUNCER_TYPE","tree","portalNode","setPortalNode","useState","useEffect","getAnnouncerNode","announcer","existingAnnouncer","getElementsByName","shadowRoot","childNodes","container","style","cssText","ariaLive","ANNOUNCER_ID","role","attachShadow","mode","body","getElementsByTagName","isConnected","removeChild","routeAnnouncement","setRouteAnnouncement","previousTitle","useRef","currentTitle","title","pageHeader","querySelector","innerText","textContent","current","createPortal","ACTION_HEADER","FLIGHT_HEADERS","NEXT_DID_POSTPONE_HEADER","NEXT_HMR_REFRESH_HEADER","NEXT_IS_PRERENDER_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_RSC_UNION_QUERY","NEXT_URL","RSC_CONTENT_TYPE_HEADER","RSC_HEADER","createEmptyCacheNode","globalMutable","isExternalURL","appRouterState","useInsertionEffect","__NEXT_APP_NAV_FAIL_HANDLING","historyState","pushRef","preserveCustomHistoryState","__PRIVATE_NEXTJS_INTERNALS_TREE","history","pushState","lazyData","rsc","prefetchRsc","prefetchHead","parallelRoutes","loading","data","currentState","__NA","headCacheNode","matchingHead","state","useReducer","canonicalUrl","useUnwrapState","hasBasePath","navigate","previousTree","serverResponse","ACTION_SERVER_PATCH","ACTION_NAVIGATE","isExternalUrl","locationSearch","search","shouldScroll","navigateType","routerInstance","forward","prefetch","options","_","kind","replace","refresh","ACTION_REFRESH","hmrRefresh","appRouter","event","persisted","ACTION_RESTORE","removeEventListener","isRedirectError","preventDefault","getURLFromRedirectError","redirectType","getRedirectTypeFromError","RedirectType","handleUnhandledRedirect","mpaNavigation","pendingPush","assign","originalPushState","originalReplaceState","replaceState","bind","_unused","applyUrlFromHistoryPushReplace","reload","useMemo","findHeadInCache","cache","getSelectedParams","changeByServerResponse","focusAndScrollRef","nextUrl","headKey","PathParamsContext","pathParams","searchParams","globalLayoutRouterContext","layoutRouterContext","content","useNavFailureHandler","errorComponent","globalErrorComponent","ErrorBoundary","errorStyles","globalErrorStyles","runtimeStyleChanged","Set","_N_E_STYLE_LOAD","renderedStylesSize","runtimeStyles","size","changed","forceUpdate","add","rel","dplId","len","cb","bailoutToClientRendering","reason","workStore","workAsyncStorage","getStore","forceStatic","isStaticGeneration","BailoutToCSRError","ClientPageRoot","Component","promises","clientParams","clientSearchParams","store","createSearchParamsFromClient","createParamsFromClient","params","createRenderSearchParamsFromClient","createRenderParamsFromClient","ClientSegmentRoot","slots","ErrorBoundaryHandler","GlobalError","styles","height","textAlign","display","flexDirection","alignItems","justifyContent","text","fontSize","fontWeight","lineHeight","margin","isRevalidate","getDerivedStateFromError","isNextRouterError","previousPathname","errorScripts","reset","constructor","setState","digest","html","handleGlobalErrors","originConsoleError","patchConsoleError","maybeError","apply","DynamicServerError","isDynamicServerError","DYNAMIC_ERROR_CODE","Error","description","getDefaultHydrationErrorMessage","getHydrationErrorStackInfo","isHydrationError","isReactHydrationErrorMessage","hydrationErrorRegex","reactUnifiedMismatchWarning","reactHydrationStartMessages","reactHydrationErrorDocLink","isError","test","message","msg","some","prefix","rawMessage","firstLineBreak","indexOf","trailing","slice","trim","split","trimmedMessage","link","stack","stacks","diffs","line","diff","join","isNotFoundError","OuterLayoutRouter","rect","getBoundingClientRect","element","top","viewportHeight","componentDidMount","handlePotentialScroll","componentDidUpdate","hashFragment","domNode","getHashFragmentDomNode","findDOMNode","instance","includes","getComputedStyle","NODE_ENV","rectProperties","every","item","handleSmoothScroll","scrollIntoView","htmlElement","clientHeight","onlyHashChange","segmentPath","context","useContext","parallelRouterKey","cacheKey","newLazyCacheNode","set","resolvedRsc","segmentPathToWalk","parallelRouteKey","isLast","matchSegment","treeToRecreate","hasOwnProperty","subTree","walkAddRefetch","fullTree","includeNextUrl","fetchServerResponse","flightRouterState","refetchTree","LayoutRouterContext","childNode","hasLoading","fallback","loadingStyles","loadingScripts","childNodesForParallelRouter","treeSegment","preservedSegments","preservedSegment","map","preservedSegmentValue","getSegmentValue","createRouterCacheKey","ScrollAndFocusHandler","Boolean","NotFoundBoundary","notFound","notFoundStyles","InnerLayoutRouter","isActive","currentChildSegmentValue","templateStyles","templateScripts","template","canSegmentBeOverridden","existingSegment","segment","getSegmentParam","Array","isArray","param","handleHardNavError","__pendingUrl","createHrefFromUrl","toString","useUntrackedPathname","hasFallbackRouteParams","fallbackRouteParams","PathnameContext","ReadonlyURLSearchParams","ServerInsertedHTMLContext","permanentRedirect","redirect","unstable_rethrow","useParams","usePathname","useRouter","useSearchParams","useSelectedLayoutSegment","useSelectedLayoutSegments","useServerInsertedHTML","SearchParamsContext","readonlySearchParams","useDynamicRouteParams","AppRouterContext","getSelectedLayoutSegmentPath","first","node","Object","values","segmentValue","PAGE_SEGMENT_KEY","selectedLayoutSegments","selectedLayoutSegment","DEFAULT_SEGMENT_KEY","ReadonlyURLSearchParamsError","URLSearchParams","append","delete","sort","NotFoundErrorBoundary","componentDidCatch","notFoundTriggered","missingSlots","MissingSlotContext","asNotFound","NOT_FOUND_ERROR_CODE","PromiseQueue","promiseFn","taskResolve","taskReject","taskPromise","task","result","enqueueResult","bump","index","findIndex","bumpedItem","splice","unshift","maxConcurrency","forced","shift","attachHydrationErrorState","reactHydrationDiffSegments","getReactHydrationDiffSegments","parsedHydrationErrorState","details","hydrationErrorState","warning","notes","reactOutputComponentDiff","captureStackTrace","obj","defineProperty","configurable","get","createUnhandledError","isUnhandledConsoleOrRejection","enqueueConsecutiveDedupedError","queue","isFront","previousError","getHydrationWarningType","storeHydrationErrorStateFromConsoleArgs","htmlTagsWarnings","textAndTagsMismatchWarnings","normalizedMessage","isHtmlTagsWarning","isTextInTagsMismatchWarning","has","isTextMismatchWarning","textMismatchWarning","isKnownHydrationWarning","serverContent","clientContent","componentStack","getReactStitchedError","REACT_ERROR_STACK_BOTTOM_FRAME","REACT_ERROR_STACK_BOTTOM_FRAME_REGEX","captureOwnerStack","isErrorInstance","originStack","originMessage","stackLines","indexOfSplit","newStack","isOriginalReactError","newError","appendOwnerStack","ownerStack","handleClientError","useErrorHandler","errorQueue","errorHandlers","rejectionQueue","rejectionHandlers","originError","consoleErrorArgs","formattedErrorMessage","formatConsoleArgs","handler","handleOnUnhandledError","handleOnUnhandledRejection","onUnhandledError","onUnhandledRejection","ev","stackTraceLimit","RedirectBoundary","RedirectErrorBoundary","HandleRedirect","RedirectStatusCode","getRedirectError","getRedirectStatusCodeFromError","REDIRECT_ERROR_CODE","statusCode","TemporaryRedirect","actionStore","actionAsyncStorage","isAction","PermanentRedirect","errorCode","destination","Number","at","isNaN","RenderFromTemplateContext","addSearchParamsToPageSegments","handleAliasedPrefetchEntry","flightData","mutable","applied","currentTree","currentCache","normalizedFlightData","hasLoadingComponentInSeedData","seedData","treePatch","fromEntries","isRootRender","pathToSegment","flightSegmentPathWithLeadingEmpty","newTree","applyRouterStatePatchToTree","newCache","fillNewTreeWithOnlyLoadingSegments","existingCache","routerState","cacheNodeSeedData","isLastSegment","keys","newCacheNode","parallelRouteState","segmentForParallelRoute","parallelSeedData","existingParallelRoutes","fillCacheWithNewSubTreeDataButOnlyLoading","patchedTree","hash","handleMutable","rest","addSearchParamsIfPageSegment","updatedParallelRoutes","parallelRoute","entries","applyFlightData","prefetchEntry","fillLazyItemsTillLeafWithHead","fillCacheWithNewSubTreeData","flightSegmentPath","parallelRoutePatch","refetch","isRootLayout","applyPatch","addRefreshMarkerToActiveParallelSegments","currentSegment","lastSegment","getNextFlightSegmentPath","initialTree","patchTree","initialSegment","patchSegment","patchParallelRoutes","newParallelRoutes","clearCacheNodeDataForSegmentPath","isLastEntry","existingChildSegmentMap","childSegmentMap","existingChildCacheNode","childCacheNode","computeChangedPath","extractPathFromFlightRouterState","isDynamicParameter","removeLeadingSlash","segmentToPathname","normalizeSegments","segments","acc","isGroupSegment","INTERCEPTION_ROUTE_MARKERS","m","childrenPath","childPath","treeA","treeB","changedPath","computeChangedPathImpl","segmentA","parallelRoutesA","segmentB","parallelRoutesB","normalizedSegmentA","normalizedSegmentB","includeHash","initialSeedData","initialCanonicalUrl","getFlightDataPartsFromPath","initialHead","isServer","prefetchCache","initialState","segmentPaths","createSeededPrefetchCacheEntry","staleTime","PrefetchKind","FULL","AUTO","withoutSearchParameters","urlToUrlWithoutFlightMarker","urlWithoutFlightParameters","prefetchKind","headers","fetchUrl","__NEXT_TEST_MODE","priority","res","responseUrl","redirected","contentType","interception","staleTimeHeader","parseInt","isFlightResponse","response","flightStream","pull","done","doMpaNavigation","fillCacheHelper","fillLazyItems","existingCacheNode","incomingSegment","invalidateCacheByRouterState","existingParallelRoutesCacheNode","hasReusablePrefetch","status","PrefetchCacheEntryStatus","reusable","parallelRouteCacheNode","seedNode","isNotUndefined","scrollableSegments","decodeURIComponent","handleSegmentMismatch","action","handleExternalUrl","invalidateCacheBelowFlightSegmentPath","isNavigatingToNewRootLayout","nextTree","currentTreeSegment","nextTreeSegment","currentTreeChild","nextTreeChild","abortTask","listenForDynamicRequest","updateCacheNodeOnNavigation","oldCacheNode","oldRouterState","newRouterState","prefetchData","oldRouterStateChildren","newRouterStateChildren","prefetchDataChildren","oldParallelRoutes","prefetchParallelRoutes","patchedRouterStateChildren","taskChildren","needsDynamicRequest","taskChild","newRouterStateChild","oldRouterStateChild","oldSegmentMapChild","prefetchDataChild","newSegmentChild","newSegmentKeyChild","oldSegmentChild","oldCacheNodeChild","spawnReusedTask","route","reusedRouterState","spawnPendingTask","spawnTaskForMissingData","pendingCacheNode","createPendingCacheNode","newCacheNodeChild","newSegmentMapChild","patchRouterStateWithNewChildren","newChildren","clone","baseRouterState","updateCacheNodeOnPopstateRestoration","routerStateChildren","routerStateChild","segmentChild","segmentKeyChild","shouldUsePrefetch","isDeferredRsc","responsePromise","serverRouterState","dynamicData","dynamicHead","writeDynamicDataIntoPendingTask","rootTask","taskSegment","finishTaskUsingDynamicDataPayload","taskNode","finishPendingCacheNode","cacheNode","taskState","serverState","taskStateChildren","serverStateChildren","dataChildren","taskStateChild","serverStateChild","dataChild","segmentMapChild","taskSegmentChild","taskSegmentKeyChild","cacheNodeChild","abortPendingCacheNode","dynamicSegmentData","serverChildren","dynamicDataChildren","serverRouterStateChild","dynamicDataChild","isLeafSegment","maybePrefetchRsc","maybePrefetchLoading","createDeferredRsc","DEFERRED","Symbol","tag","pendingRsc","rej","fulfilledRsc","rejectedRsc","getOrCreatePrefetchCacheEntry","prunePrefetchCache","createPrefetchCacheKeyImpl","includeSearchParams","pathnameFromUrl","INTERCEPTION_CACHE_KEY_MARKER","createPrefetchCacheKey","allowAliasing","existingCacheEntry","getExistingCacheEntry","maybeNextUrl","TEMPORARY","cacheKeyWithParams","cacheKeyWithoutParams","cacheKeyToUse","existingEntry","isAliased","aliased","entryWithoutParams","cacheEntry","getPrefetchEntryCacheStatus","isFullPrefetch","prefetchResponse","createLazyPrefetchEntry","prefetchCacheKey","treeAtTimeOfPrefetch","prefetchTime","Date","now","lastUsedTime","fresh","prefetchQueue","newCacheKey","prefixExistingPrefetchCacheEntry","existingCacheKey","prefetchCacheEntry","expired","DYNAMIC_STALETIME_MS","STATIC_STALETIME_MS","stale","findHeadInCacheImpl","keyPrefix","isLastItem","childParallelRoutes","hasInterceptionRouteInCurrentTree","isInterceptionRouteAppPath","hmrRefreshReducer","_action","hmrRefreshReducerNoop","hmrRefreshReducerImpl","navigateReducer","getElementById","prefetchValues","canonicalUrlOverride","isFirstRead","updatedCanonicalUrl","patchedRouterState","dynamicRequest","triggerLazyFetchForLeafSegments","appliedPatch","generateSegmentsFromPatch","shouldHardNavigate","subSegment","scrollableSegmentPath","flightRouterPatch","childSegment","prefetchReducer","refreshReducer","log","canonicalUrlOverrideHref","refreshInactiveParallelSegments","updatedTree","updatedCache","restoreReducer","treeToRestore","oldCache","serverActionReducer","createFromFetch","createTemporaryReferenceSet","encodeReply","fetchServerAction","revalidatedParts","temporaryReferences","fetch","method","Accept","encodeURIComponent","JSON","stringify","redirectHeader","_redirectType","isPrerender","revalidatedHeader","parse","paths","cookie","e","redirectLocation","actionFlightData","normalizeFlightData","actionResult","a","actionRevalidated","newHref","removeBasePath","serverPatchReducer","refetchMarker","fetchedSegments","refreshInactiveParallelSegmentsImpl","rootTree","refetchPath","fetchPromises","fetchPromise","flightDataPath","parallelFetchPromise","all","ACTION_HMR_REFRESH","ACTION_PREFETCH","reducer","serverReducer","clientReducer","StaticGenBailoutError","isStaticGenBailoutError","NEXT_STATIC_GEN_BAILOUT","code","unresolvedThenable","isBailoutToCSRError","isDynamicUsageError","isPostpone","isThenable","pathHasPrefix","formatObject","arg","depth","prototype","call","desc","getOwnPropertyDescriptor","jsonKey","String","idx","startQuote","char","parseFloat","query","parsePath","removeTrailingSlash","errorInfo","reportGlobalError","reportError","cause","stitchedError","MetadataBoundary","OutletBoundary","ViewportBoundary","METADATA_BOUNDARY_NAME","VIEWPORT_BOUNDARY_NAME","OUTLET_BOUNDARY_NAME","NameSpace","GlobalLayoutRouterContext","TemplateContext","createContext","file","djb2Hash","str","hexHash","InvariantError","name","getObjectClassLabel","isPlainObject","getPrototypeOf","BAILOUT_TO_CSR","ensureLeadingSlash","runRemainingActions","pending","runAction","needsRefresh","prevState","payload","handleResult","nextState","discarded","dispatchAction","resolvers","deferredPromise","newAction","last","normalizeAppPath","normalizeRscURL","fn","existing","scrollBehavior","dontForceLayout","getClientRects","isBot","BOT_UA_RE","userAgent","hashIndex","queryIndex","hasQuery","substring","isPageSegment","stringifiedQuery","addInsertedServerHTMLCallback","warnOnce"],"sourceRoot":"","ignoreList":[0,1,87,88,89,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148]}