{"version":3,"file":"static/chunks/82d4688a-153853b5af44d2a9.js","mappings":"ycAwEA,EACA,EAm1FA,oBA55FA,wBACA,+BACA,kCACA,wCACA,yBAA8E,kDAA6D,SAC3I,UACA,sBAA+B,CAC/B,aACA,YACA,KACA,kBACA,aACA,YAEA,QACA,EACA,WACA,oBACA,UACA,IACA,YACA,CAAQ,SACR,IACA,CACA,EACA,MACA,IACA,aACA,CAAQ,SACR,IACA,CACA,EACA,0DACA,0BACA,CAAG,EAIH,4FACA,GACA,mCACA,2CACA,8CACA,IAEA,OADA,SACA,EACA,CAAM,SACN,QACA,CACA,CAAG,GACH,wBACA,6BACA,EAsBA,cAIA,GAHA,oBACA,cAEA,6CACA,mEAEA,sBACA,CACA,cAIA,MAHA,oBACA,cAEA,CACA,CACA,cACA,OACA,gBACA,gBACA,OAAe,wBACf,CACA,EAMA,OALA,YACA,+BACA,QACA,GAEA,CACA,CACA,cACA,YACA,eACA,wBACA,gBACA,CAAK,OACD,iBACJ,sBACA,sBACA,CAAK,OACD,GACJ,kDACA,mBACA,CAAK,MAEL,CAmDA,cACA,cACA,gDAEA,cACA,CACA,cACA,iCACA,oBACA,WACA,EACA,qBACA,UACA,CACA,CAAG,CACH,CACA,cACA,qBACA,OAEA,OADA,uBACA,CACA,CAeA,cACA,WACA,kBAEA,mCAEA,OADA,yBACA,SAGA,aA6FA,OA5FA,iBACA,2BAGA,GAFA,4BACA,iBACA,GAEM,sBACN,sBACM,2CACN,sBACM,mDACN,0BACM,8DACN,gCACM,KAhLN,CAgLM,yBAhLN,EAgLM,IA/KN,qCAgLA,kCACA,kDACM,8DACN,2BAEA,kDACA,OAhBA,iBAiBA,qCACA,mBACA,4CAAqD,gBAC7C,oCACR,qDACQ,4DACR,mEAA4E,gBAG5E,EACA,SACA,qBACA,cACA,KACA,SAEA,kBACA,uCACQ,yBACR,0DACQ,uBAGR,kDAFA,oDAIA,EACA,mCACA,sBACA,UAIA,0CACA,gBACA,mCACA,iCACA,oEAIA,wCAGA,mBAEA,GAEA,qBACA,IA9FA,EACA,EACA,EA4FA,UACA,KACA,SAEA,kBACA,OAnGA,EAmGA,eAjGA,IADA,kBAEA,gBACA,EAgGM,yBACN,uBA/FA,YAGA,QAFA,oBACA,kBACA,IAAkB,WAAiB,IACnC,+BAEA,iBACA,EAwFA,wBACM,uBAGN,sCAFA,oDAIA,EACA,YACA,0BACA,0BACA,GAEA,qBACA,mCACA,EACA,IACA,CA5PA,gBACA,GACA,qBACA,sBACA,6BACA,sBACA,uBACA,sBACA,uBACA,wBACA,wBACA,CACA,kCACA,yDACA,GAiDA,iCACA,OACA,OACA,kBACA,wBACA,EACA,+BACA,uBAEA,4BAEA,OADA,OACA,4BACA,EACA,4BACA,oCACA,EACA,8BACA,mBACA,EACA,kCACA,sBACA,4BACA,4BAGA,EACA,4BACA,SAIA,OAHA,2BACA,SACA,CAAG,EACH,IACA,EACA,8BACA,SAIA,OAHA,yBACA,SACA,CAAG,EACH,IACA,EACA,+BACA,SAIA,OAHA,2BACA,aACA,CAAG,EACH,IACA,EACA,YACA,mDA8IA,qDAKA,gBACA,wBACA,8GAGA,IATA,EACA,EAQA,EADA,UACA,KACA,mBACA,cACA,+BAEA,gBACA,+BACA,WACA,gCAEA,qBACA,iBACA,qBACA,uBACA,cACA,cAEA,EAAI,IACJ,mBAUA,GARA,gEACA,4BACA,gCAEA,aAhCA,GADA,EAiCA,8BAhCA,cACA,qBAgCA,kCACA,kCACA,mBACA,+CACA,6DAGA,GADA,kBACA,6CACA,8CACA,sBACA,iBACA,yDAGA,WADA,KACA,iDAEA,CAEA,CAIA,cACA,mBASA,OARA,wCACA,MACA,mBACA,+BACA,iCACA,qDACA,CACA,CAAG,EACH,CACA,CAiBA,gBACA,wBACA,8GAEA,GACA,OAEA,oBACA,2CACA,0CACA,yDACA,8BACA,mBACA,iBACA,CA7CA,6BACA,mBAA6B,oBAAsB,CACnD,EA4BA,oBAgBA,oBACA,6BACA,6BACA,mBACA,2BACA,4BACA,aACG,CACH,EACA,mBACA,kBAAsC,uBAA2B,EAEjE,OADA,eACA,CACA,EACA,4BACA,yBACA,qBACA,wCAEA,0BAA8B,WAAmB,YAAiB,CAClE,EACA,qBACA,IACA,KACA,CAAE,SACF,iBACA,eACA,YACA,cACA,oBACA,EACA,yCACA,yBACA,CACA,gBACA,iCACA,iBACA,8BACA,wCAEA,yBACA,aACA,SACA,CACA,oBACA,IA5EA,EACA,EA2EA,GACA,gBACA,wBACA,SA/EA,EA+EA,8BA9EA,QACA,8BACA,4BACA,iDACA,CAAG,sBACH,mBACA,mBACA,MACA,yBACA,aACA,CACA,CAAG,EACH,EAmEA,CACA,sEACA,+CACA,sBACA,aACA,CAAO,GACP,EACA,qBACA,sBACA,sCACA,CAAO,GACP,EACA,uBACA,sBACA,sCACA,CAAO,GACP,EACA,qBACA,sBACA,gCACA,CAAO,GACP,EAQA,yBAPA,GACA,IACA,+CACA,CAAQ,SACR,QACA,CACA,EACA,WACA,0BACA,qBACM,wBACN,uBAEA,qBACA,OACA,sBACQ,sHACR,gCAGA,uDAKA,gCACA,uBACA,CAAO,EANP,0DACA,qCACA,CAAO,EAMP,WACA,qCACA,gCACA,kBACA,uCAEA,GAEA,6CACA,CAAG,CACH,CACA,cACA,UACA,UACA,YACA,YACA,cAIA,8BACA,0BACA,qBAAwB,EACxB,IAD8B,UAC9B,0CACA,wDAEA,6BADA,qEAEA,OACA,SAEA,OADA,yBACA,EACA,CAAC,IACD,qBAA+B,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,OAC/E,mCACA,yHACA,4DACA,uCAYA,oBAAkE,EAAM,oCAXxE,IACA,iBACA,aACA,YAAkB,YAAgB,CAClC,mFACA,2CAEA,KADA,kBACA,sCAEA,4CACA,EAEA,OAA4C,EAAM,+BAElD,SACA,uBAAkC,IAAO,GAFzC,KAGA,mCAHA,QAKA,oBACA,EACA,MACA,eACA,sBACA,2FACA,CACA,CADI,GACJ,6DACA,mEAEA,EACA,kDACA,oBACA,OAAkC,EAAM,iEACxC,2BACA,iDAA6D,EAAE,wBAAwB,EAAE,GACzF,MACA,iBACA,OACA,0GACA,0CACA,QACA,6EACA,SACA,oDACA,CACA,EACA,oBAaA,wBAA4E,EAAM,oCAZlF,IAEA,GADA,uBACA,WACA,qCACA,8BACA,eACA,YAAkB,YAAgB,EAClC,uFACA,gFAEA,QACA,EAEA,UAAiD,EAAM,gEACvD,QAAkC,EAAM,mEACxC,8CACA,gBAGA,mBACA,YAAuD,SAAI,EAAQ,KAEnE,GADA,cAA0C,YAC1C,oCACA,kFACA,wBACA,8BAEA,CAeA,OAdA,2CACA,sCAEA,iDACA,+CAEA,mCACA,cACA,mBAEA,CAAG,EACH,GACA,WAEA,CACA,CAGA,aACA,mBACA,iBACA,gBACA,gBACA,CAEA,kBAAuC,EAEvC,cAEA,kCAHA,eAGA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,iBAAsC,EAEtC,cAEA,kCAHA,cAGA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,sBAA+C,EAC/C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,cAIA,GACA,gBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,gCAA8F,EAC9F,WACA,wEAGA,cACA,kBACA,oBACA,SACA,sBAAwC,EACxC,sCANA,iCAMA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,iCAA+F,EAC/F,WACA,wEAGA,cACA,kBACA,oBACA,SACA,sBAAwC,EACxC,sCANA,kCAMA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,iCAA+F,EAC/F,WACA,wEAGA,cACA,kBACA,oBACA,SACA,sBAAwC,EACxC,sCANA,kCAMA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,gCAA8F,EAC9F,WACA,wEAGA,cACA,kBACA,oBACA,SACA,sBAAwC,EACxC,sCANA,iCAMA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qCAAuG,EACvG,WACA,wEAGA,cACA,kBACA,oBACA,gBACA,SACA,sBAAwC,EACxC,sCAPA,oCAOA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,8CAA4G,EAC5G,WACA,wEAGA,cACA,kBACA,oBACA,SACA,sBAAwC,EACxC,sCANA,+CAMA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qCAAmG,EACnG,WACA,wEAGA,cACA,kBACA,oBACA,SACA,sBAAwC,EACxC,sCANA,sCAMA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,iCAA+F,EAC/F,WACA,wEAGA,cACA,kBACA,oBACA,SACA,sBAAwC,EACxC,sCANA,kCAMA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kCAAoG,EACpG,WACA,wEAGA,cACA,kBACA,oBACA,gBACA,SACA,sBAAwC,EACxC,sCAPA,iCAOA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kBAA2C,EAC3C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,yBAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,mBAA4C,EAC5C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,0BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,mBAA4C,EAC5C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,0BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kBAA2C,EAC3C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,yBAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,uBAAoD,EACpD,WACA,wEAGA,cACA,gBACA,SACA,sBAAwC,EACxC,sCALA,4BAKA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,gCAAyD,EACzD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,uCAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,uBAAgD,EAChD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,8BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,mBAA4C,EAC5C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,0BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kBAA2C,EAC3C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,yBAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,yBAAyE,EACzE,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,8BAIA,GACA,iBAEA,OADA,4CACA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,oBAA6C,EAC7C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,2BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qBAA8C,EAC9C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,4BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qBAA8C,EAC9C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,4BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,oBAA6C,EAC7C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,2BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,uBAAgD,EAChD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,8BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kCAA2D,EAC3D,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,yCAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,yBAAkD,EAClD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,gCAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qBAA8C,EAC9C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,4BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,oBAA6C,EAC7C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,2BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kCAAkF,EAClF,WACA,6EAEA,oBAAkC,UAAU,YAAY,UAAU,iCAClE,UACA,iBACA,mBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,cAAuC,EACvC,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,YAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,wBAAyD,EAEzD,cACA,eACA,qBAEA,sCALA,aAKA,GACA,gBAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,wBAA6D,EAE7D,cACA,iBACA,iBACA,kBAEA,sCANA,aAMA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qBAAsD,EAEtD,cACA,eACA,qBAEA,sCALA,aAKA,GACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,uBAAwD,EAExD,cACA,eACA,qBAEA,sCALA,mBAKA,GACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,gCAA8D,EAC9D,WACA,wEAGA,cACA,iBACA,SACA,sBAAwC,EACxC,sCALA,sBAKA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,6BAA2D,EAC3D,WACA,wEAGA,cACA,iBACA,SACA,sBAAwC,EACxC,sCALA,mBAKA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,6BAAmF,EAEnF,cACA,gBACA,kBACA,iBACA,oBACA,mBACA,gBAEA,sCATA,YASA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,oBAA6C,EAC7C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,YAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,oBAAgD,EAChD,WACA,2EAEA,kBAAgC,QAAQ,YAAY,QAAQ,iCAC5D,UAEA,uCACA,gBAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,sBAAsD,EACtD,WACA,2EAEA,WACA,wEAEA,kBAAgC,QAAQ,YAAY,QAAQ,iCAC5D,UACA,KACA,sBAAwC,EACxC,2CACA,gBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,wBAA2D,EAC3D,WACA,2EAEA,kBAAgC,QAAQ,gBAAgB,QAAQ,iCAChE,UACA,oBAEA,2CACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,wBAA2D,EAC3D,WACA,2EAEA,kBAAgC,QAAQ,gBAAgB,QAAQ,iCAChE,UACA,oBAEA,2CACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,2BAA8D,EAC9D,WACA,2EAEA,WACA,2EAEA,kBAAgC,QAAQ,mBAAmB,QAAQ,iCACnE,UACA,oBAEA,2CACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kBAA8C,EAC9C,WACA,2EAEA,kBAAgC,QAAQ,iBAAiB,QAAQ,iCACjE,UAEA,uCACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,yBAA4D,EAC5D,WACA,2EAEA,kBAAgC,QAAQ,iBAAiB,QAAQ,iCACjE,UACA,oBAEA,2CACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,mBAA+C,EAC/C,WACA,2EAEA,kBAAgC,QAAQ,kBAAkB,QAAQ,iCAClE,UAEA,uCACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,4BAA+D,EAC/D,WACA,2EAEA,kBAAgC,QAAQ,oBAAoB,QAAQ,iCACpE,UACA,oBAEA,2CACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,6BAAyE,EACzE,WACA,2EAEA,kBAAgC,QAAQ,iBAAiB,QAAQ,iCACjE,UACA,iBACA,iBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,8BAAuD,EACvD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,yBAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,+BAAwD,EACxD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,0BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,+BAAwD,EACxD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,0BAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,gCAAkE,EAClE,WACA,iFAEA,wBAAsC,cAAc,YAAY,cAAc,iCAC9E,UAEA,uCACA,gBAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,uCAAkG,EAClG,WACA,iFAEA,wBAAsC,cAAc,YAAY,cAAc,iCAC9E,UACA,qBACA,iBACA,kBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,iCAAuE,EACvE,WACA,iFAEA,WACA,wEAEA,wBAAsC,cAAc,YAAY,cAAc,iCAC9E,UACA,KACA,sBAAwC,EACxC,2CACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,gDAAoG,EACpG,WACA,iFAEA,WACA,2EAEA,wBAAsC,cAAc,QAAQ,QAAQ,YAAY,cAAc,2CAAwD,QAAQ,iCAC9J,UACA,iBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,8BAA6F,EAE7F,cACA,iBACA,yBACA,iBACA,oBACA,oBACA,iBAEA,sCATA,YASA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,4BAAoD,EAEpD,cACA,eAEA,sCAJA,mBAIA,GACA,gBAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,4BAAqE,EAErE,cACA,iBACA,4BAEA,sCALA,mBAKA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qBAA0D,EAC1D,WACA,sEAEA,gBAA8B,GAAG,YAAY,GAAG,iCAChD,UACA,mBACA,oBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,oBAAsD,EACtD,WACA,sEAEA,WACA,wEAEA,gBAA8B,GAAG,YAAY,GAAG,iCAChD,UACA,oBACA,SACA,sBAAwC,EACxC,2CACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,sBAA+C,EAC/C,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,qBAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,2BAAoD,EACpD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,cAIA,GACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,4BAAqD,EACrD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,cAIA,GACA,gBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,6BAAsD,EACtD,WACA,wEAGA,cACA,KACA,sBAAwC,EACxC,sCAJA,qBAIA,GACA,gBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,iCAAiF,EACjF,WACA,8EAEA,oBAAkC,WAAW,YAAY,WAAW,iCACpE,UACA,mBACA,iBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kCAAkF,EAClF,WACA,8EAEA,WACA,0EAEA,oBAAkC,WAAW,EAAE,OAAO,YAAY,WAAW,2CAAqD,OAAO,iCACzI,UACA,iBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,kCAA0G,EAE1G,cACA,0BACA,wBACA,sBACA,oBACA,iBACA,kBAEA,sCATA,iBASA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,sCAAgG,EAChG,WACA,gFAEA,uBAAqC,aAAa,YAAY,aAAa,iCAC3E,UACA,qBACA,iBACA,kBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,iCAAsE,EACtE,WACA,gFAEA,WACA,wEAEA,uBAAqC,aAAa,YAAY,aAAa,iCAC3E,UACA,KACA,sBAAwC,EACxC,2CACA,iBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,gCAAqE,EACrE,WACA,gFAEA,WACA,wEAEA,uBAAqC,aAAa,YAAY,aAAa,iCAC3E,UACA,KACA,sBAAwC,EACxC,2CACA,gBAIA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,uBAAwD,EACxD,WACA,gFAEA,uBAAqC,aAAa,iBAAiB,aAAa,iCAChF,UAEA,uCACA,cAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,+CAAkG,EAClG,WACA,gFAEA,WACA,2EAEA,uBAAqC,aAAa,QAAQ,QAAQ,YAAY,aAAa,2CAAuD,QAAQ,iCAC1J,UACA,iBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,qBAAiE,EAEjE,cACA,eACA,qBACA,wBAEA,sCANA,WAMA,GACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CAEA,6BAAwE,EACxE,WACA,0EAEA,iBAA+B,OAAO,kBAAkB,OAAO,iCAC/D,UACA,iBACA,iBACA,kBAEA,2CACA,aAFA,IAMA,OAHA,GACA,sCAEA,cACA,oBACA,iBACA,SACU,+BACV,eAEA,QAEA,CAAO,EACP,YACA,0DAEA,CACA,CACA,oBACA,cACA,iBACA,mBACA,mBACA,sDACS,IAET,SACA,yDAIA,QACA,CACA,EAGA,SACA,mBACA,eACA,aACA,qBACA,qDACA,gBACA,CACA,aACA,0BACA,CACA,oBACA,kCACA,CACA,YACA,mBACA,eACA,yBAEA,2BACA,8BACA,MACA,mBACA,eACA,iCAGA,0BADA,qBACA,KACA,2BACA,oBACA,CACA,aACA,kBACA,oBACA,mBACA,gBAEA,oBACA,qBACA,CACA,EAGA,sEACA,yDACA,QAAY,YAAkB,IAC9B,uBAGA,mBACA,0CACA,QAAc,IAAS,KACvB,eACA,6BACA,gCACA,iBAOA,OALA,OACA,gCACI,QACJ,mCAEA,CACA,EACA,eACA,2CACA,uBACA,IACA,qBACA,KAGA,6CACA,QAAc,IAAS,KACvB,sBACA,wBACA,wBACA,wBACA,iBACA,sBACA,qBAEA,QACA,EAGA,SACA,cACA,4BAEA,eACA,sBACA,CACA,cACA,4BAEA,eACA,sBACA,CACA,gBACA,8BAEA,iBACA,EACA,2BACA,wBACA,iCACA,wDACU,iCACV,0DAEA,IACA,EAEA,MAEA,CACA,aACA,2BAEA,cACA,qBACA,CACA,SACA,MACA,mEAEA,mBACA,SAAmB,EAAO,EAAE,EAAK,GAAG,EAAK,qBAAqB,iCAA4C,SAAS,sBAA0B,EAC7I,6BACA,CACA,QACA,qBACA,mBACA,CACA,QACA,sBACA,+DACA,6BACA,2BACA,oCACQ,GACR,6BAEA,EAAM,0BACN,+DACA,6BACA,2BACA,oCACQ,GACR,6BAEA,CACA,oCACA,CACA,EAGA,SACA,8DACA,YACA,YACA,cACA,eACA,eACA,qBACA,aACA,eACA,sDAEA,cACA,8BAEA,MADA,eACA,CACA,CACA,6CACA,yBACA,0BAEA,mCA0EA,OAzEA,sDACA,yBACA,oBACA,EACA,yBACA,eACA,EACA,2BAIA,GAHA,sCACA,8CAEA,MA8CQ,CACR,uBACA,OACA,sCACA,uDAEA,MACA,CACA,wBACA,QACA,kBAEA,YAEA,MA3DA,gBACA,0CACA,iDACA,sBACA,CAAW,EACD,cACV,oDACA,gCACU,uBACV,6CACU,oBACV,6CACU,qBACV,+CACU,wBACV,+CACU,wBACV,+CACU,cACV,iCACU,mBACV,gEACA,0CACU,yBACV,iDACU,cACV,oDACA,gCACU,cACV,iCACU,qBACV,8CACU,eACV,mCACU,0BACV,wDACU,uBACV,6CACU,QACV,sBAEA,sCACA,kDAkBA,EACA,oBACA,wBACA,sCACA,eAEA,gBACA,IACA,EACA,yBACA,KACA,oBACA,EACA,gBACA,iDACA,CAAO,GACP,CAAK,CACL,CACA,iBACA,uBACA,qBAEA,GACA,oBAA0B,CAE1B,CACA,yBACA,0BACA,CACA,wBACA,gCAEA,gBACA,sCACA,cAEA,CACA,WACA,sCACA,cAEA,CACA,oBACA,sCACA,cAEA,CACA,qBACA,sCACA,cAEA,CACA,kBACA,sCACA,cAEA,CACA,eACA,sCACA,cAEA,CACA,mBACA,sCACA,cAEA,CACA,sBACA,sCACA,cAEA,CACA,uBACA,sCACA,cAEA,CACA,WACA,sCACA,cAEA,CACA,gBACA,sCACA,+BAEA,CACA,sBACA,sCACA,cAEA,CACA,eACA,sCACA,cAEA,CACA,iBACA,sCACA,cAEA,CACA,2BACA,sCACA,cAEA,CACA,mBACA,sCACA,cAEA,CACA,oBACA,sCACA,cAEA,CACA,oBACA,sCACA,cAEA,CACA,gBACA,sCACA,cAEA,CACA,qBACA,sCACA,iCAEA,CACA,kCAEA,2BACA,0BAGA,qBACA,kBANA,GAOA,SACU,qBACV,kBATA,GAUA,QACU,CACV,uBACA,8EACY,0BACZ,CAfA,EAeA,8CAfA,EAeA,iCAEA,wBACA,uBAA6B,YAC7B,gBACA,uDACA,CAAW,IACX,QACA,kBAvBA,EAwBA,OArBA,qDAuBA,yCACA,UAA+C,CA3B/C,EA4BA,2CACA,kDACU,2CACV,oDAEA,iDACA,CACA,CAAK,CACL,CACA,uBACA,kBAAuB,cAAgB,uBAAsB,CAC7D,CACA,yBACA,+BAUA,OATA,iBACA,gBACA,YACA,YACA,QACA,oBACA,oBACA,CACA,EAAO,EACP,kBACK,CACL,CACA,gCACA,+BAWA,OAVA,iBACA,sBACA,WACA,YACA,YACA,QACA,oBACA,oBACA,CACA,EAAO,EACP,wBACK,CACL,CACA,cACA,+BACA,wBAA+B,sBAAe,GAAY,CAC1D,CAAK,CACL,CACA,eACA,+BAEA,MADA,kBAAyC,mBAAgB,IAAQ,EACjE,MACK,CACL,CACA,iBACA,+BAEA,MADA,kBAAyC,mBAAgB,eAAkB,EAC3E,MACK,CACL,CACA,eACA,+BAEA,OADA,iBAAyC,eAAiB,aAAqB,EAC/E,OACK,CACL,CACA,kBACA,+BAWA,MAVA,iBACA,CACA,cACA,SACA,OACA,cACA,QACA,CACA,EACA,EACA,QACK,CACL,CACA,iBACA,+BACA,OAAqB,qBAAc,IAOnC,OANA,EACA,qBAEA,wBAGA,CADA,oBACA,MACK,CACL,CACA,aACA,+BACA,wBAA+B,qBAAc,GAAY,CACzD,CAAK,CACL,CACA,aACA,kBAAuB,0BAAiB,GAAc,CACtD,CACA,cACA,kBAAuB,aAAe,YAAqB,CAC3D,CACA,cACA,kBAAuB,aAAe,YAAY,CAClD,CACA,yBACA,+BAEA,OADA,iBAAyC,kCAA2B,IAAY,EAChF,mBACK,CACL,CACA,wBACA,+BAEA,OADA,iBAAyC,wBAAiB,eAAoC,EAC9F,aACK,CACL,CACA,uBACA,+BASA,MARA,iBACA,CACA,wBACA,aACA,YACA,CACA,EACA,EACA,mBACA,CAAK,CACL,CACA,oBACA,kBAAuB,0BAAqB,GAAU,CACtD,CACA,2BACA,iBACA,CACA,yBACA,WACA,QACA,CACA,EAEA,CACA,uBACA,+BACA,kBAAyB,cACzB,WACA,UACA,EAAS,CACT,CAAK,CACL,CACA,WACA,+BAUA,MATA,iBACA,CACA,KACA,KACA,UACA,UACA,CACA,EACA,EACA,GACA,CAAK,CACL,CACA,0BACA,+BACA,iBACA,CACA,iBACA,WACA,UACA,OACA,uBACA,UACA,CACA,EAEA,CAAK,CACL,CACA,qBACA,kBAAuB,0BAAmB,oBAA2B,CACrE,CACA,iBACA,kBAAuB,0BAAmB,GAAY,CACtD,CACA,yBACA,+BAEA,OADA,iBAAyC,mCAA0B,2BAAmC,EACtG,oBACK,CACL,CACA,gBACA,kBAAuB,eAAiB,UAAU,CAClD,CACA,sBACA,+BAEA,OADA,iBAAyC,iCAAwB,cAAuB,EACxF,oBACK,CACL,CACA,WACA,+BACA,0BAGA,IACA,iBAA0B,QAAU,0BACpC,CAAQ,SACR,wBACA,wBACA,oDAEA,0BACA,sBAEA,MACA,CACA,yDACA,CAAK,CACL,CACA,CAEA,CADA,GACA,8BADA,GAEA,yBAFA,GAGA,4BAQA,aACA,cAJA,YAIA,GANA,WAMA,GALA,MAKA,QAHA,GAGA,OACA,iBACA,YACA,YACA,cACA,eACA,0BAEA,uBAVA,IAYA,SAAwB,EADxB,qBAC+B,EAAE,EAAK,GAAG,EAAK,EAC9C,4BACA,CAEA,qBACA,+BAIA,OAHA,gGACA,+BAEA,kDACA,WAEA,CAAK,CACL,CAEA,kBACA,+BAIA,OAHA,gGACA,+BAEA,+CACA,WAEA,CAAK,CACL,CAEA,yBACA,4CAAiF,KAAc,EAK/F,0DAJA,CACA,QACA,MACA,EACA,eACA,sDAEA,CAAK,CACL,CAEA,6BAAoD,KAAc,EAKlE,2DAJA,CACA,KACA,MACA,EACA,eACA,sDAEA,CAEA,4BAKA,2DAJA,CACA,KACA,MACA,EACA,aACA,sDAEA,CAEA,6BAMA,0DALA,CACA,QACA,WACA,MACA,EACA,aACA,sDAEA,CAEA,4CAAwF,EAKxF,sDACA,eACA,GACA,CAAQ,mBANR,EAMQ,KALR,CAKQ,CAAoE,CAC5E,EACA,EACA,GACA,QACA,sDAEA,CAEA,mCAAwE,EAKxE,6DAJA,CACA,QACA,MACA,EACA,iBACA,sDAEA,CAEA,4BACA,8CAA0F,EAK1F,8CACA,eACA,GANA,CACA,QACA,MACA,EAKA,EACA,EACA,GAEA,cACA,YACA,oBACA,cAEA,CAAK,CACL,CAEA,0CACA,wDAAiJ,EAUjJ,kDACA,eACA,GAXA,CACA,YACA,YACA,iBACA,OACA,YACA,oBACA,MACA,EAKA,EACA,EACA,GAEA,cACA,YACA,oBACA,cAEA,CAAK,CACL,CAEA,6BACA,+BAMA,0DALA,CACA,QACA,OACA,MACA,EACA,aACA,sDAEA,CAAK,CACL,CAEA,qBACA,+BAIA,OAHA,gGACA,+BAEA,kDACA,WAEA,CAAK,CACL,CAEA,oBACA,+BAIA,OAHA,gGACA,+BAEA,iDACA,2BAEA,CAAK,CACL,CAEA,iBACA,+BAIA,OAHA,gGACA,+BAEA,8CACA,iBACA,wBACA,0BACA,wBACA,0BACA,+CACA,QACA,oBACA,4CACA,kDACA,YACA,YACA,0BACS,EAET,CAAK,CACL,CAEA,2DACA,WAnOA,GAmOA,4BACA,CAEA,qBACA,+BAIA,OAHA,gGACA,+BAEA,kDACA,WAEA,CAAK,CACL,CAEA,iBACA,+BAIA,OAHA,gGACA,+BAEA,8CACA,WAEA,CAAK,CACL,CAEA,yBACA,+BAIA,OAHA,gGACA,+BAEA,sDACA,2BAEA,CAAK,CACL,CAEA,0BACA,+BAIA,OAHA,gGACA,+BAEA,uDACA,2BAEA,CAAK,CACL,CAEA,wBACA,+BAIA,OAHA,gGACA,+BAEA,qDACA,2BAEA,CAAK,CACL,CAEA,eACA,+BAIA,OAHA,gGACA,+BAEA,wCACA,2BAEA,CAAK,CACL,CAEA,cACA,+BAIA,OAHA,gGACA,+BAEA,kCACA,CAAK,CACL,CAEA,2BACA,+BAIA,OAHA,gGACA,+BAEA,wDACA,WAEA,CAAK,CACL,CAEA,0BACA,+BAIA,OAHA,gGACA,+BAEA,uDACA,WAEA,CAAK,CACL,CAEA,kBACA,+BAIA,OAHA,gGACA,+BAEA,gDACA,OACA,iBAEA,eAGA,oBACA,cACA,wBACA,0BACA,4BACA,+CACA,0BACA,8BACA,sBACA,QACA,oBACA,oBACA,gBACA,oBACA,oBACA,0BACA,oBACA,iDACA,CAAW,CACX,CAAS,EArBT,kBAuBA,CAAO,CACP,CAAK,CACL,CAEA,eACA,+BAIA,OAHA,gGACA,+BAEA,qCAAgE,UAChE,WAEA,CAAK,CACL,CACA,oBACA,+BAIA,OAHA,gGACA,+BAEA,0CAA0E,UAC1E,WAEA,CAAK,CACL,CAEA,sBACA,+BAIA,OAHA,gGACA,+BAEA,mDACA,2BAEA,CAAK,CACL,CAEA,gBACA,+BAIA,OAHA,gGACA,+BAEA,sCAAiE,UACjE,WAEA,CAAK,CACL,CAEA,+BACA,+BAIA,OAHA,gGACA,+BAEA,6DACA,OACA,YACA,0BACA,0BACA,4CAEA,kBAGA,uBACA,iBACA,wBACA,6BACA,0BACA,wBACA,wBACA,sBACA,0BACA,oBACA,+CACA,oBACA,sBACA,0BACA,0BACW,CACX,CAAS,EAlBT,kBAoBA,CAAO,CACP,CAAK,CACL,CAEA,0BACA,+BAIA,OAHA,gGACA,+BAEA,wDACA,OACA,eACA,wBAEA,qBAGA,0BACA,oBACA,MACA,6BACA,+BACA,iCACA,yDACA,+BACA,mCACA,2BACA,aACA,yBACA,yBACA,qBACA,yBACA,yBACA,+BACA,yBACA,2DACA,CAAa,CACb,+BACA,CAAW,CACX,CAAS,EAxBT,kBA0BA,CAAO,CACP,CAAK,CACL,CAEA,0BACA,+BAIA,OAHA,gGACA,+BAEA,wDACA,OACA,eACA,wBAEA,qBAGA,0BACA,oBACA,OACA,8BACA,gCACA,8BACA,gCACA,2DACA,cACA,0BACA,4BACA,8DACA,kBACA,kBACA,gCACa,CACb,+BACA,CAAW,CACX,CAAS,EApBT,kBAsBA,CAAO,CACP,CAAK,CACL,CAEA,oBACA,+BAIA,OAHA,gGACA,+BAEA,kDACA,OACA,kBAEA,iBAGA,kBACA,qBACA,eACA,wBACA,0BACA,wBACA,0BACA,+CACA,QACA,oBACA,sBACA,kDACA,YACA,YACA,0BACW,CACX,CAAS,GAlBT,kBAoBA,CAAO,CACP,CAAK,CACL,CAEA,eACA,+BAIA,OAHA,gGACA,+BAEA,4CACA,WAEA,CAAK,CACL,CAEA,gBACA,+BAIA,OAHA,gGACA,+BAEA,6CACA,WAEA,CAAK,CACL,CAEA,gBACA,+BAIA,OAHA,gGACA,+BAEA,6CACA,WAEA,CAAK,CACL,CAEA,eACA,+BAIA,OAHA,gGACA,+BAEA,4CACA,WAEA,CAAK,CACL,CAEA,kBACA,+BAIA,OAHA,gGACA,+BAEA,+CACA,WAEA,CAAK,CACL,CAEA,6BACA,+BAIA,OAHA,gGACA,+BAEA,0DACA,WAEA,CAAK,CACL,CAEA,gBACA,+BAIA,OAHA,gGACA,+BAEA,6CACA,WAEA,CAAK,CACL,CAEA,oBACA,+BAIA,OAHA,gGACA,+BAEA,iDACA,WAEA,CAAK,CACL,CAEA,eACA,+BAIA,OAHA,gGACA,+BAEA,4CACA,WAEA,CAAK,CACL,CAEA,qBACA,+BAIA,OAHA,gGACA,+BAEA,mDACA,OACA,WACA,wBAEA,iBAGA,sBACA,gBACA,MACA,6BACA,+BACA,iCACA,yDACA,+BACA,mCACA,2BACA,aACA,yBACA,yBACA,qBACA,yBACA,yBACA,+BACA,yBACA,4DACA,yDACa,CACb,cACW,CACX,CAAS,EAzBT,kBA2BA,CAAO,CACP,CAAK,CACL,CAEA,oCACA,+BAIA,OAHA,gGACA,+BAEA,kEACA,OACA,0BACA,0BACA,iBACA,UACA,EAmCA,OAlCA,uBACA,4BACA,sBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,iBACA,sBACA,gBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,kBACA,CAAO,CACP,CAAK,CACL,CACA,6CACA,+BAIA,OAHA,gGACA,+BAEA,2EACA,OACA,0BACA,0BACA,iBACA,YAoCA,OAlCA,uBACA,4BACA,sBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,iBACA,sBACA,gBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,kBACA,CAAO,CACP,CAAK,CACL,CAEA,2BACA,+BAIA,OAHA,gGACA,+BAEA,+CACA,CAAK,CACL,CAEA,yBACA,+BAIA,OAHA,gGACA,+BAEA,uDACA,OACA,oCACA,yBAEA,uBAGA,4BACA,sBACA,6BACA,0BACA,QACA,wBACA,sBACA,kBACA,8CACA,CAAW,CACX,CAAS,EAZT,kBAcA,CAAO,CACP,CAAK,CACL,CAEA,8BACA,+BAIA,OAHA,gGACA,+BAEA,4DACA,OACA,WACA,wBAEA,iBAGA,sBACA,gBACA,wBACA,UACA,8DACA,iEACA,yCACA,kBACA,kBACA,0BACA,0BACW,CACX,CAAS,EAdT,kBAgBA,CAAO,CACP,CAAK,CACL,CAEA,+BACA,+BAIA,OAHA,gGACA,+BAEA,6DACA,OACA,gBACA,gBAyBA,OAvBA,qBACA,0BACA,oBACA,QACA,cACA,0BACA,yCACA,yCACA,+CACA,6BACA,yCACA,wDACA,sBACA,+CACA,+CACA,kDACA,0BACA,wBACA,oBACA,4BACa,CACb,CAAW,EAEX,kBACA,CAAO,CACP,CAAK,CACL,CAEA,mCACA,+BAIA,OAHA,gGACA,+BAEA,iEACA,OACA,0BACA,0BACA,iBACA,YAoCA,OAlCA,uBACA,4BACA,sBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,iBACA,sBACA,gBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,kBACA,CAAO,CACP,CAAK,CACL,CAEA,4CACA,+BAIA,OAHA,gGACA,+BAEA,0EACA,OACA,0BACA,0BACA,iBACA,YAoCA,OAlCA,uBACA,4BACA,sBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,iBACA,sBACA,gBACA,0BACA,gCACA,kDACA,4CACA,oBACA,6BACA,gCACA,yCACA,0BACA,oBACA,uDACA,CAAa,CACb,CAAW,EAEX,kBACA,CAAO,CACP,CAAK,CACL,CAEA,yBACA,+BAIA,OAHA,gGACA,+BAEA,6CACA,CAAK,CACL,CAEA,wBACA,+BAIA,OAHA,gGACA,+BAEA,sDACA,OAAuB,mBACvB,iBAGA,sBACA,gBACA,wBACA,UACA,8DACA,iEACA,yCACA,kBACA,kBACA,0BACA,0BACW,CACX,CAAS,EAdT,kBAgBA,CAAO,CACP,CAAK,CACL,CAEA,WACA,+BAIA,OAHA,gGACA,+BAEA,4DACA,iBACA,QACA,8CACA,CAAS,EAET,CAAK,CACL,CAEA,kBACA,+BACA,wEACA,iBACA,QACA,8CACA,CAAS,GACF,UACP,OACA,CAAO,CACP,CAAK,CACL,CAEA,qBACA,+BAIA,OAHA,gGACA,+BAEA,sCAA2D,wBAAoC,UAC/F,WAEA,CAAK,CACL,CAEA,kBACA,wCAAiE,EACjE,MAEA,OADA,gDACA,CAEA,0CACA,2MAEA,mDACA,2NAEA,6DAAmF,6BAAoC,EAEvH,OADA,kCACA,CACA,CAAK,CACL,CAEA,iBACA,+BAIA,OAHA,gGACA,+BAEA,8CACA,WAEA,CAAK,CACL,CAEA,kBACA,+BAIA,OAHA,gGACA,+BAEA,+CACA,WAEA,CAAK,CACL,CAEA,kBACA,+BAIA,OAHA,gGACA,+BAEA,+CACA,WAEA,CAAK,CACL,CAEA,iBACA,+BAIA,OAHA,gGACA,+BAEA,8CACA,WAEA,CAAK,CACL,CAEA,oBACA,+BAIA,OAHA,gGACA,+BAEA,iDACA,WAEA,CAAK,CACL,CAEA,+BACA,+BAIA,OAHA,gGACA,+BAEA,4DACA,WAEA,CAAK,CACL,CAEA,kBACA,+BAIA,OAHA,gGACA,+BAEA,+CACA,WAEA,CAAK,CACL,CAEA,sBACA,+BAIA,OAHA,gGACA,+BAEA,mDACA,WAEA,CAAK,CACL,CAEA,iBACA,+BAIA,OAHA,gGACA,+BAEA,8CACA,WAEA,CAAK,CACL,CAEA,mBACA,+BAIA,OAHA,gGACA,+BAEA,gDACA,WAEA,CAAK,CACL,CAEA,mBACA,+BAIA,OAHA,gGACA,+BAEA,gDACA,WAEA,CAAK,CACL,CAEA,2BACA,+BAIA,OAHA,gGACA,+BAEA,sDAAmE,EAAS,CAC5E,CAAK,CACL,CAEA,4BACA,+BAIA,OAHA,gGACA,+BAEA,+CAAoE,WAAU,CAC9E,CAAK,CACL,CAEA,8BACA,+BAIA,OAHA,gGACA,+BAEA,wDAAoE,cAAqB,CACzF,CAAK,CACL,CAEA,8BACA,+BAIA,OAHA,gGACA,+BAEA,iDACA,sDACA,cACA,mBACA,CAAO,UACP,iBACA,0BACA,gCACA,kDACA,4CACA,oBACA,gCACA,yCACA,0BACA,oBACA,wDACA,4BACA,CAAS,EAET,CAAK,CACL,CAEA,yBACA,+BACA,gGACA,+BAEA,OAAsB,YAWtB,OAVA,cACA,gBACA,wBACA,UACA,kCACA,oCACA,8BACA,kBACS,CACT,CAAO,EACP,6CACA,CAAK,CACL,CAEA,6BACA,+BACA,uDACA,sDACA,cACA,oBACO,UACP,iBACA,0BACA,gCACA,kDACA,4CACA,oBACA,gCACA,yCACA,0BACA,oBACA,wDACA,4BACA,CAAS,EAET,CAAK,CACL,CACA","sources":["webpack://_N_E/./node_modules/.pnpm/@heroiclabs+nakama-js@2.7.1/node_modules/@heroiclabs/nakama-js/dist/nakama-js.esm.mjs"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\n\n// ../../node_modules/whatwg-fetch/fetch.js\nvar global = typeof globalThis !== \"undefined\" && globalThis || typeof self !== \"undefined\" && self || typeof global !== \"undefined\" && global;\nvar support = {\n searchParams: \"URLSearchParams\" in global,\n iterable: \"Symbol\" in global && \"iterator\" in Symbol,\n blob: \"FileReader\" in global && \"Blob\" in global && function() {\n try {\n new Blob();\n return true;\n } catch (e) {\n return false;\n }\n }(),\n formData: \"FormData\" in global,\n arrayBuffer: \"ArrayBuffer\" in global\n};\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj);\n}\nif (support.arrayBuffer) {\n viewClasses = [\n \"[object Int8Array]\",\n \"[object Uint8Array]\",\n \"[object Uint8ClampedArray]\",\n \"[object Int16Array]\",\n \"[object Uint16Array]\",\n \"[object Int32Array]\",\n \"[object Uint32Array]\",\n \"[object Float32Array]\",\n \"[object Float64Array]\"\n ];\n isArrayBufferView = ArrayBuffer.isView || function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;\n };\n}\nvar viewClasses;\nvar isArrayBufferView;\nfunction normalizeName(name) {\n if (typeof name !== \"string\") {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === \"\") {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"');\n }\n return name.toLowerCase();\n}\nfunction normalizeValue(value) {\n if (typeof value !== \"string\") {\n value = String(value);\n }\n return value;\n}\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return { done: value === void 0, value };\n }\n };\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator;\n };\n }\n return iterator;\n}\nfunction Headers(headers) {\n this.map = {};\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n}\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + \", \" + value : value;\n};\nHeaders.prototype[\"delete\"] = function(name) {\n delete this.map[normalizeName(name)];\n};\nHeaders.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null;\n};\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name));\n};\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n};\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n};\nHeaders.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items);\n};\nHeaders.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items);\n};\nHeaders.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items);\n};\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n}\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError(\"Already read\"));\n }\n body.bodyUsed = true;\n}\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n });\n}\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise;\n}\nfunction readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise;\n}\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars2 = new Array(view.length);\n for (var i = 0; i < view.length; i++) {\n chars2[i] = String.fromCharCode(view[i]);\n }\n return chars2.join(\"\");\n}\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0);\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer;\n }\n}\nfunction Body() {\n this.bodyUsed = false;\n this._initBody = function(body) {\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._bodyText = \"\";\n } else if (typeof body === \"string\") {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n if (!this.headers.get(\"content-type\")) {\n if (typeof body === \"string\") {\n this.headers.set(\"content-type\", \"text/plain;charset=UTF-8\");\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set(\"content-type\", this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set(\"content-type\", \"application/x-www-form-urlencoded;charset=UTF-8\");\n }\n }\n };\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected;\n }\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob);\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]));\n } else if (this._bodyFormData) {\n throw new Error(\"could not read FormData body as blob\");\n } else {\n return Promise.resolve(new Blob([this._bodyText]));\n }\n };\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed;\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n );\n } else {\n return Promise.resolve(this._bodyArrayBuffer);\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer);\n }\n };\n }\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected;\n }\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob);\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));\n } else if (this._bodyFormData) {\n throw new Error(\"could not read FormData body as text\");\n } else {\n return Promise.resolve(this._bodyText);\n }\n };\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode);\n };\n }\n this.json = function() {\n return this.text().then(JSON.parse);\n };\n return this;\n}\nvar methods = [\"DELETE\", \"GET\", \"HEAD\", \"OPTIONS\", \"POST\", \"PUT\"];\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method;\n}\nfunction Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.');\n }\n options = options || {};\n var body = options.body;\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError(\"Already read\");\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n this.credentials = options.credentials || this.credentials || \"same-origin\";\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || \"GET\");\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n if ((this.method === \"GET\" || this.method === \"HEAD\") && body) {\n throw new TypeError(\"Body not allowed for GET or HEAD requests\");\n }\n this._initBody(body);\n if (this.method === \"GET\" || this.method === \"HEAD\") {\n if (options.cache === \"no-store\" || options.cache === \"no-cache\") {\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n this.url = this.url.replace(reParamSearch, \"$1_=\" + (/* @__PURE__ */ new Date()).getTime());\n } else {\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? \"&\" : \"?\") + \"_=\" + (/* @__PURE__ */ new Date()).getTime();\n }\n }\n }\n}\nRequest.prototype.clone = function() {\n return new Request(this, { body: this._bodyInit });\n};\nfunction decode(body) {\n var form = new FormData();\n body.trim().split(\"&\").forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split(\"=\");\n var name = split.shift().replace(/\\+/g, \" \");\n var value = split.join(\"=\").replace(/\\+/g, \" \");\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form;\n}\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers();\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, \" \");\n preProcessedHeaders.split(\"\\r\").map(function(header) {\n return header.indexOf(\"\\n\") === 0 ? header.substr(1, header.length) : header;\n }).forEach(function(line) {\n var parts = line.split(\":\");\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(\":\").trim();\n headers.append(key, value);\n }\n });\n return headers;\n}\nBody.call(Request.prototype);\nfunction Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.');\n }\n if (!options) {\n options = {};\n }\n this.type = \"default\";\n this.status = options.status === void 0 ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = options.statusText === void 0 ? \"\" : \"\" + options.statusText;\n this.headers = new Headers(options.headers);\n this.url = options.url || \"\";\n this._initBody(bodyInit);\n}\nBody.call(Response.prototype);\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n });\n};\nResponse.error = function() {\n var response = new Response(null, { status: 0, statusText: \"\" });\n response.type = \"error\";\n return response;\n};\nvar redirectStatuses = [301, 302, 303, 307, 308];\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError(\"Invalid status code\");\n }\n return new Response(null, { status, headers: { location: url } });\n};\nvar DOMException = global.DOMException;\ntry {\n new DOMException();\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n DOMException.prototype = Object.create(Error.prototype);\n DOMException.prototype.constructor = DOMException;\n}\nfunction fetch2(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException(\"Aborted\", \"AbortError\"));\n }\n var xhr = new XMLHttpRequest();\n function abortXhr() {\n xhr.abort();\n }\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || \"\")\n };\n options.url = \"responseURL\" in xhr ? xhr.responseURL : options.headers.get(\"X-Request-URL\");\n var body = \"response\" in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError(\"Network request failed\"));\n }, 0);\n };\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError(\"Network request failed\"));\n }, 0);\n };\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n }, 0);\n };\n function fixUrl(url) {\n try {\n return url === \"\" && global.location.href ? global.location.href : url;\n } catch (e) {\n return url;\n }\n }\n xhr.open(request.method, fixUrl(request.url), true);\n if (request.credentials === \"include\") {\n xhr.withCredentials = true;\n } else if (request.credentials === \"omit\") {\n xhr.withCredentials = false;\n }\n if (\"responseType\" in xhr) {\n if (support.blob) {\n xhr.responseType = \"blob\";\n } else if (support.arrayBuffer && request.headers.get(\"Content-Type\") && request.headers.get(\"Content-Type\").indexOf(\"application/octet-stream\") !== -1) {\n xhr.responseType = \"arraybuffer\";\n }\n }\n if (init && typeof init.headers === \"object\" && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n if (request.signal) {\n request.signal.addEventListener(\"abort\", abortXhr);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n request.signal.removeEventListener(\"abort\", abortXhr);\n }\n };\n }\n xhr.send(typeof request._bodyInit === \"undefined\" ? null : request._bodyInit);\n });\n}\nfetch2.polyfill = true;\nif (!global.fetch) {\n global.fetch = fetch2;\n global.Headers = Headers;\n global.Request = Request;\n global.Response = Response;\n}\n\n// ../../node_modules/js-base64/base64.mjs\nvar _hasatob = typeof atob === \"function\";\nvar _hasbtoa = typeof btoa === \"function\";\nvar _hasBuffer = typeof Buffer === \"function\";\nvar _TD = typeof TextDecoder === \"function\" ? new TextDecoder() : void 0;\nvar _TE = typeof TextEncoder === \"function\" ? new TextEncoder() : void 0;\nvar b64ch = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar b64chs = Array.prototype.slice.call(b64ch);\nvar b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nvar b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nvar _fromCC = String.fromCharCode.bind(String);\nvar _U8Afrom = typeof Uint8Array.from === \"function\" ? Uint8Array.from.bind(Uint8Array) : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nvar _mkUriSafe = (src) => src.replace(/=/g, \"\").replace(/[+\\/]/g, (m0) => m0 == \"+\" ? \"-\" : \"_\");\nvar _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, \"\");\nvar btoaPolyfill = (bin) => {\n let u32, c0, c1, c2, asc = \"\";\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length; ) {\n if ((c0 = bin.charCodeAt(i++)) > 255 || (c1 = bin.charCodeAt(i++)) > 255 || (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError(\"invalid character found\");\n u32 = c0 << 16 | c1 << 8 | c2;\n asc += b64chs[u32 >> 18 & 63] + b64chs[u32 >> 12 & 63] + b64chs[u32 >> 6 & 63] + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\nvar _btoa = _hasbtoa ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, \"binary\").toString(\"base64\") : btoaPolyfill;\nvar _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString(\"base64\") : (u8a) => {\n const maxargs = 4096;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(\"\"));\n};\nvar cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 128 ? c : cc < 2048 ? _fromCC(192 | cc >>> 6) + _fromCC(128 | cc & 63) : _fromCC(224 | cc >>> 12 & 15) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);\n } else {\n var cc = 65536 + (c.charCodeAt(0) - 55296) * 1024 + (c.charCodeAt(1) - 56320);\n return _fromCC(240 | cc >>> 18 & 7) + _fromCC(128 | cc >>> 12 & 63) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);\n }\n};\nvar re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\nvar utob = (u) => u.replace(re_utob, cb_utob);\nvar _encode = _hasBuffer ? (s) => Buffer.from(s, \"utf8\").toString(\"base64\") : _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));\nvar encode = (src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode(src)) : _encode(src);\nvar re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nvar cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset = cp - 65536;\n return _fromCC((offset >>> 10) + 55296) + _fromCC((offset & 1023) + 56320);\n case 3:\n return _fromCC((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2));\n default:\n return _fromCC((31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1));\n }\n};\nvar btou = (b) => b.replace(re_btou, cb_btou);\nvar atobPolyfill = (asc) => {\n asc = asc.replace(/\\s+/g, \"\");\n if (!b64re.test(asc))\n throw new TypeError(\"malformed base64.\");\n asc += \"==\".slice(2 - (asc.length & 3));\n let u24, bin = \"\", r1, r2;\n for (let i = 0; i < asc.length; ) {\n u24 = b64tab[asc.charAt(i++)] << 18 | b64tab[asc.charAt(i++)] << 12 | (r1 = b64tab[asc.charAt(i++)]) << 6 | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\nvar _atob = _hasatob ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, \"base64\").toString(\"binary\") : atobPolyfill;\nvar _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, \"base64\")) : (a) => _U8Afrom(_atob(a).split(\"\").map((c) => c.charCodeAt(0)));\nvar _decode = _hasBuffer ? (a) => Buffer.from(a, \"base64\").toString(\"utf8\") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));\nvar _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == \"-\" ? \"+\" : \"/\"));\nvar decode2 = (src) => _decode(_unURI(src));\n\n// utils.ts\nfunction buildFetchOptions(method, options, bodyJson) {\n const fetchOptions = __spreadValues(__spreadValues({}, { method }), options);\n fetchOptions.headers = __spreadValues({}, options.headers);\n if (typeof XMLHttpRequest !== \"undefined\") {\n const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, \"withCredentials\");\n if (!(descriptor == null ? void 0 : descriptor.set)) {\n fetchOptions.credentials = \"cocos-ignore\";\n }\n }\n if (!Object.keys(fetchOptions.headers).includes(\"Accept\")) {\n fetchOptions.headers[\"Accept\"] = \"application/json\";\n }\n if (!Object.keys(fetchOptions.headers).includes(\"Content-Type\")) {\n fetchOptions.headers[\"Content-Type\"] = \"application/json\";\n }\n Object.keys(fetchOptions.headers).forEach((key) => {\n if (!fetchOptions.headers[key]) {\n delete fetchOptions.headers[key];\n }\n });\n if (bodyJson) {\n fetchOptions.body = bodyJson;\n }\n return fetchOptions;\n}\n\n// api.gen.ts\nvar NakamaApi = class {\n constructor(serverKey, basePath, timeoutMs) {\n this.serverKey = serverKey;\n this.basePath = basePath;\n this.timeoutMs = timeoutMs;\n }\n /** A healthcheck which load balancers can use to check the service. */\n healthcheck(bearerToken, options = {}) {\n const urlPath = \"/healthcheck\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Fetch the current user's account. */\n getAccount(bearerToken, options = {}) {\n const urlPath = \"/v2/account\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Update fields in the current user's account. */\n updateAccount(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"PUT\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with an Apple ID against the server. */\n authenticateApple(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/apple\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with a custom id against the server. */\n authenticateCustom(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/custom\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with a device id against the server. */\n authenticateDevice(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/device\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with an email+password against the server. */\n authenticateEmail(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/email\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with a Facebook OAuth token against the server. */\n authenticateFacebook(basicAuthUsername, basicAuthPassword, body, create, username, sync, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/facebook\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n queryParams.set(\"sync\", sync);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with a Facebook Instant Game token against the server. */\n authenticateFacebookInstantGame(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/facebookinstantgame\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with Apple's GameCenter against the server. */\n authenticateGameCenter(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/gamecenter\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with Google against the server. */\n authenticateGoogle(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/google\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Authenticate a user with Steam against the server. */\n authenticateSteam(basicAuthUsername, basicAuthPassword, body, create, username, sync, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/steam\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n queryParams.set(\"sync\", sync);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add an Apple ID to the social profiles on the current user's account. */\n linkApple(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/apple\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add a custom ID to the social profiles on the current user's account. */\n linkCustom(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/custom\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add a device ID to the social profiles on the current user's account. */\n linkDevice(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/device\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add an email+password to the social profiles on the current user's account. */\n linkEmail(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/email\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add Facebook to the social profiles on the current user's account. */\n linkFacebook(bearerToken, body, sync, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/facebook\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"sync\", sync);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add Facebook Instant Game to the social profiles on the current user's account. */\n linkFacebookInstantGame(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/facebookinstantgame\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add Apple's GameCenter to the social profiles on the current user's account. */\n linkGameCenter(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/gamecenter\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add Google to the social profiles on the current user's account. */\n linkGoogle(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/google\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add Steam to the social profiles on the current user's account. */\n linkSteam(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/link/steam\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Refresh a user's session using a refresh token retrieved from a previous authentication request. */\n sessionRefresh(basicAuthUsername, basicAuthPassword, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/session/refresh\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove the Apple ID from the social profiles on the current user's account. */\n unlinkApple(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/apple\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove the custom ID from the social profiles on the current user's account. */\n unlinkCustom(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/custom\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove the device ID from the social profiles on the current user's account. */\n unlinkDevice(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/device\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove the email+password from the social profiles on the current user's account. */\n unlinkEmail(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/email\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove Facebook from the social profiles on the current user's account. */\n unlinkFacebook(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/facebook\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove Facebook Instant Game profile from the social profiles on the current user's account. */\n unlinkFacebookInstantGame(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/facebookinstantgame\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove Apple's GameCenter from the social profiles on the current user's account. */\n unlinkGameCenter(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/gamecenter\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove Google from the social profiles on the current user's account. */\n unlinkGoogle(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/google\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Remove Steam from the social profiles on the current user's account. */\n unlinkSteam(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/unlink/steam\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List a channel's message history. */\n listChannelMessages(bearerToken, channelId, limit, forward, cursor, options = {}) {\n if (channelId === null || channelId === void 0) {\n throw new Error(\"'channelId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/channel/{channelId}\".replace(\"{channelId}\", encodeURIComponent(String(channelId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"forward\", forward);\n queryParams.set(\"cursor\", cursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Submit an event for processing in the server's registered runtime custom events handler. */\n event(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/event\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Delete one or more users by ID or username. */\n deleteFriends(bearerToken, ids, usernames, options = {}) {\n const urlPath = \"/v2/friend\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"ids\", ids);\n queryParams.set(\"usernames\", usernames);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"DELETE\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List all friends for the current user. */\n listFriends(bearerToken, limit, state, cursor, options = {}) {\n const urlPath = \"/v2/friend\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"state\", state);\n queryParams.set(\"cursor\", cursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add friends by ID or username to a user's account. */\n addFriends(bearerToken, ids, usernames, options = {}) {\n const urlPath = \"/v2/friend\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"ids\", ids);\n queryParams.set(\"usernames\", usernames);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Block one or more users by ID or username. */\n blockFriends(bearerToken, ids, usernames, options = {}) {\n const urlPath = \"/v2/friend/block\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"ids\", ids);\n queryParams.set(\"usernames\", usernames);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Import Facebook friends and add them to a user's account. */\n importFacebookFriends(bearerToken, body, reset, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/friend/facebook\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"reset\", reset);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Import Steam friends and add them to a user's account. */\n importSteamFriends(bearerToken, body, reset, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/friend/steam\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"reset\", reset);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List groups based on given filters. */\n listGroups(bearerToken, name, cursor, limit, langTag, members, open, options = {}) {\n const urlPath = \"/v2/group\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"name\", name);\n queryParams.set(\"cursor\", cursor);\n queryParams.set(\"limit\", limit);\n queryParams.set(\"lang_tag\", langTag);\n queryParams.set(\"members\", members);\n queryParams.set(\"open\", open);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Create a new group with the current user as the owner. */\n createGroup(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Delete a group by ID. */\n deleteGroup(bearerToken, groupId, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"DELETE\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Update fields in a given group. */\n updateGroup(bearerToken, groupId, body, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"PUT\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Add users to a group. */\n addGroupUsers(bearerToken, groupId, userIds, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/add\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"user_ids\", userIds);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Ban a set of users from a group. */\n banGroupUsers(bearerToken, groupId, userIds, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/ban\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"user_ids\", userIds);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Demote a set of users in a group to the next role down. */\n demoteGroupUsers(bearerToken, groupId, userIds, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n if (userIds === null || userIds === void 0) {\n throw new Error(\"'userIds' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/demote\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"user_ids\", userIds);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Immediately join an open group, or request to join a closed one. */\n joinGroup(bearerToken, groupId, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/join\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Kick a set of users from a group. */\n kickGroupUsers(bearerToken, groupId, userIds, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/kick\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"user_ids\", userIds);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Leave a group the user is a member of. */\n leaveGroup(bearerToken, groupId, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/leave\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Promote a set of users in a group to the next role up. */\n promoteGroupUsers(bearerToken, groupId, userIds, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/promote\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"user_ids\", userIds);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List all users that are part of a group. */\n listGroupUsers(bearerToken, groupId, limit, state, cursor, options = {}) {\n if (groupId === null || groupId === void 0) {\n throw new Error(\"'groupId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/group/{groupId}/user\".replace(\"{groupId}\", encodeURIComponent(String(groupId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"state\", state);\n queryParams.set(\"cursor\", cursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Validate Apple IAP Receipt */\n validatePurchaseApple(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/iap/purchase/apple\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Validate Google IAP Receipt */\n validatePurchaseGoogle(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/iap/purchase/google\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Validate Huawei IAP Receipt */\n validatePurchaseHuawei(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/iap/purchase/huawei\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Delete a leaderboard record. */\n deleteLeaderboardRecord(bearerToken, leaderboardId, options = {}) {\n if (leaderboardId === null || leaderboardId === void 0) {\n throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/leaderboard/{leaderboardId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"DELETE\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List leaderboard records. */\n listLeaderboardRecords(bearerToken, leaderboardId, ownerIds, limit, cursor, expiry, options = {}) {\n if (leaderboardId === null || leaderboardId === void 0) {\n throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/leaderboard/{leaderboardId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"owner_ids\", ownerIds);\n queryParams.set(\"limit\", limit);\n queryParams.set(\"cursor\", cursor);\n queryParams.set(\"expiry\", expiry);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Write a record to a leaderboard. */\n writeLeaderboardRecord(bearerToken, leaderboardId, body, options = {}) {\n if (leaderboardId === null || leaderboardId === void 0) {\n throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n }\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/leaderboard/{leaderboardId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List leaderboard records that belong to a user. */\n listLeaderboardRecordsAroundOwner(bearerToken, leaderboardId, ownerId, limit, expiry, options = {}) {\n if (leaderboardId === null || leaderboardId === void 0) {\n throw new Error(\"'leaderboardId' is a required parameter but is null or undefined.\");\n }\n if (ownerId === null || ownerId === void 0) {\n throw new Error(\"'ownerId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/leaderboard/{leaderboardId}/owner/{ownerId}\".replace(\"{leaderboardId}\", encodeURIComponent(String(leaderboardId))).replace(\"{ownerId}\", encodeURIComponent(String(ownerId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"expiry\", expiry);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Fetch list of running matches. */\n listMatches(bearerToken, limit, authoritative, label, minSize, maxSize, query, options = {}) {\n const urlPath = \"/v2/match\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"authoritative\", authoritative);\n queryParams.set(\"label\", label);\n queryParams.set(\"min_size\", minSize);\n queryParams.set(\"max_size\", maxSize);\n queryParams.set(\"query\", query);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Delete one or more notifications for the current user. */\n deleteNotifications(bearerToken, ids, options = {}) {\n const urlPath = \"/v2/notification\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"ids\", ids);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"DELETE\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Fetch list of notifications. */\n listNotifications(bearerToken, limit, cacheableCursor, options = {}) {\n const urlPath = \"/v2/notification\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"cacheable_cursor\", cacheableCursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Execute a Lua function on the server. */\n rpcFunc2(bearerToken, id, payload, httpKey, options = {}) {\n if (id === null || id === void 0) {\n throw new Error(\"'id' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/rpc/{id}\".replace(\"{id}\", encodeURIComponent(String(id)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"payload\", payload);\n queryParams.set(\"http_key\", httpKey);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Execute a Lua function on the server. */\n rpcFunc(bearerToken, id, body, httpKey, options = {}) {\n if (id === null || id === void 0) {\n throw new Error(\"'id' is a required parameter but is null or undefined.\");\n }\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/rpc/{id}\".replace(\"{id}\", encodeURIComponent(String(id)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"http_key\", httpKey);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */\n sessionLogout(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/session/logout\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Get storage objects. */\n readStorageObjects(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/storage\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Write objects into the storage engine. */\n writeStorageObjects(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/storage\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"PUT\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Delete one or more objects by ID or username. */\n deleteStorageObjects(bearerToken, body, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/storage/delete\";\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"PUT\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List publicly readable storage objects in a given collection. */\n listStorageObjects(bearerToken, collection, userId, limit, cursor, options = {}) {\n if (collection === null || collection === void 0) {\n throw new Error(\"'collection' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/storage/{collection}\".replace(\"{collection}\", encodeURIComponent(String(collection)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"user_id\", userId);\n queryParams.set(\"limit\", limit);\n queryParams.set(\"cursor\", cursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List publicly readable storage objects in a given collection. */\n listStorageObjects2(bearerToken, collection, userId, limit, cursor, options = {}) {\n if (collection === null || collection === void 0) {\n throw new Error(\"'collection' is a required parameter but is null or undefined.\");\n }\n if (userId === null || userId === void 0) {\n throw new Error(\"'userId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/storage/{collection}/{userId}\".replace(\"{collection}\", encodeURIComponent(String(collection))).replace(\"{userId}\", encodeURIComponent(String(userId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"cursor\", cursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List current or upcoming tournaments. */\n listTournaments(bearerToken, categoryStart, categoryEnd, startTime, endTime, limit, cursor, options = {}) {\n const urlPath = \"/v2/tournament\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"category_start\", categoryStart);\n queryParams.set(\"category_end\", categoryEnd);\n queryParams.set(\"start_time\", startTime);\n queryParams.set(\"end_time\", endTime);\n queryParams.set(\"limit\", limit);\n queryParams.set(\"cursor\", cursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List tournament records. */\n listTournamentRecords(bearerToken, tournamentId, ownerIds, limit, cursor, expiry, options = {}) {\n if (tournamentId === null || tournamentId === void 0) {\n throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/tournament/{tournamentId}\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"owner_ids\", ownerIds);\n queryParams.set(\"limit\", limit);\n queryParams.set(\"cursor\", cursor);\n queryParams.set(\"expiry\", expiry);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Write a record to a tournament. */\n writeTournamentRecord2(bearerToken, tournamentId, body, options = {}) {\n if (tournamentId === null || tournamentId === void 0) {\n throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n }\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/tournament/{tournamentId}\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Write a record to a tournament. */\n writeTournamentRecord(bearerToken, tournamentId, body, options = {}) {\n if (tournamentId === null || tournamentId === void 0) {\n throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n }\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/tournament/{tournamentId}\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"PUT\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Attempt to join an open and running tournament. */\n joinTournament(bearerToken, tournamentId, options = {}) {\n if (tournamentId === null || tournamentId === void 0) {\n throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/tournament/{tournamentId}/join\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId)));\n const queryParams = /* @__PURE__ */ new Map();\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List tournament records for a given owner. */\n listTournamentRecordsAroundOwner(bearerToken, tournamentId, ownerId, limit, expiry, options = {}) {\n if (tournamentId === null || tournamentId === void 0) {\n throw new Error(\"'tournamentId' is a required parameter but is null or undefined.\");\n }\n if (ownerId === null || ownerId === void 0) {\n throw new Error(\"'ownerId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/tournament/{tournamentId}/owner/{ownerId}\".replace(\"{tournamentId}\", encodeURIComponent(String(tournamentId))).replace(\"{ownerId}\", encodeURIComponent(String(ownerId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"expiry\", expiry);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** Fetch zero or more users by ID and/or username. */\n getUsers(bearerToken, ids, usernames, facebookIds, options = {}) {\n const urlPath = \"/v2/user\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"ids\", ids);\n queryParams.set(\"usernames\", usernames);\n queryParams.set(\"facebook_ids\", facebookIds);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n /** List groups the current user belongs to. */\n listUserGroups(bearerToken, userId, limit, state, cursor, options = {}) {\n if (userId === null || userId === void 0) {\n throw new Error(\"'userId' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/user/{userId}/group\".replace(\"{userId}\", encodeURIComponent(String(userId)));\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"limit\", limit);\n queryParams.set(\"state\", state);\n queryParams.set(\"cursor\", cursor);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"GET\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }\n buildFullUrl(basePath, fragment, queryParams) {\n let fullPath = basePath + fragment + \"?\";\n for (let [k, v] of queryParams) {\n if (v instanceof Array) {\n fullPath += v.reduce((prev, curr) => {\n return prev + encodeURIComponent(k) + \"=\" + encodeURIComponent(curr) + \"&\";\n }, \"\");\n } else {\n if (v != null) {\n fullPath += encodeURIComponent(k) + \"=\" + encodeURIComponent(v) + \"&\";\n }\n }\n }\n return fullPath;\n }\n};\n\n// session.ts\nvar Session = class {\n constructor(token, refresh_token, created) {\n this.created = created;\n this.token = token;\n this.refresh_token = refresh_token;\n this.created_at = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);\n this.update(token, refresh_token);\n }\n isexpired(currenttime) {\n return this.expires_at - currenttime < 0;\n }\n isrefreshexpired(currenttime) {\n return this.refresh_expires_at - currenttime < 0;\n }\n update(token, refreshToken) {\n const tokenParts = token.split(\".\");\n if (tokenParts.length != 3) {\n throw \"jwt is not valid.\";\n }\n const tokenDecoded = JSON.parse(_atob(tokenParts[1]));\n const tokenExpiresAt = Math.floor(parseInt(tokenDecoded[\"exp\"]));\n if (refreshToken) {\n const refreshTokenParts = refreshToken.split(\".\");\n if (refreshTokenParts.length != 3) {\n throw \"refresh jwt is not valid.\";\n }\n const refreshTokenDecoded = JSON.parse(_atob(refreshTokenParts[1]));\n const refreshTokenExpiresAt = Math.floor(parseInt(refreshTokenDecoded[\"exp\"]));\n this.refresh_expires_at = refreshTokenExpiresAt;\n this.refresh_token = refreshToken;\n }\n this.token = token;\n this.expires_at = tokenExpiresAt;\n this.username = tokenDecoded[\"usn\"];\n this.user_id = tokenDecoded[\"uid\"];\n this.vars = tokenDecoded[\"vrs\"];\n }\n static restore(token, refreshToken) {\n return new Session(token, refreshToken, false);\n }\n};\n\n// ../../node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar lookup = typeof Uint8Array === \"undefined\" ? [] : new Uint8Array(256);\nfor (i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nvar i;\nvar encode2 = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = \"\";\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n return base64;\n};\nvar decode3 = function(base64) {\n var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return arraybuffer;\n};\n\n// web_socket_adapter.ts\nvar WebSocketAdapterText = class {\n get onClose() {\n return this._socket.onclose;\n }\n set onClose(value) {\n this._socket.onclose = value;\n }\n get onError() {\n return this._socket.onerror;\n }\n set onError(value) {\n this._socket.onerror = value;\n }\n get onMessage() {\n return this._socket.onmessage;\n }\n set onMessage(value) {\n if (value) {\n this._socket.onmessage = (evt) => {\n const message = JSON.parse(evt.data);\n if (message.match_data && message.match_data.data) {\n message.match_data.data = new Uint8Array(decode3(message.match_data.data));\n } else if (message.party_data && message.party_data.data) {\n message.party_data.data = new Uint8Array(decode3(message.party_data.data));\n }\n value(message);\n };\n } else {\n value = null;\n }\n }\n get onOpen() {\n return this._socket.onopen;\n }\n set onOpen(value) {\n this._socket.onopen = value;\n }\n isOpen() {\n var _a;\n return ((_a = this._socket) == null ? void 0 : _a.readyState) == WebSocket.OPEN;\n }\n connect(scheme, host, port, createStatus, token) {\n const url = `${scheme}${host}:${port}/ws?lang=en&status=${encodeURIComponent(createStatus.toString())}&token=${encodeURIComponent(token)}`;\n this._socket = new WebSocket(url);\n }\n close() {\n this._socket.close();\n this._socket = void 0;\n }\n send(msg) {\n if (msg.match_data_send) {\n msg.match_data_send.op_code = msg.match_data_send.op_code.toString();\n let payload = msg.match_data_send.data;\n if (payload && payload instanceof Uint8Array) {\n msg.match_data_send.data = encode2(payload.buffer);\n } else if (payload) {\n msg.match_data_send.data = _btoa(payload);\n }\n } else if (msg.party_data_send) {\n msg.party_data_send.op_code = msg.party_data_send.op_code.toString();\n let payload = msg.party_data_send.data;\n if (payload && payload instanceof Uint8Array) {\n msg.party_data_send.data = encode2(payload.buffer);\n } else if (payload) {\n msg.party_data_send.data = _btoa(payload);\n }\n }\n this._socket.send(JSON.stringify(msg));\n }\n};\n\n// socket.ts\nvar _DefaultSocket = class {\n constructor(host, port, useSSL = false, verbose = false, adapter = new WebSocketAdapterText(), sendTimeoutMs = _DefaultSocket.DefaultSendTimeoutMs) {\n this.host = host;\n this.port = port;\n this.useSSL = useSSL;\n this.verbose = verbose;\n this.adapter = adapter;\n this.sendTimeoutMs = sendTimeoutMs;\n this.cIds = {};\n this.nextCid = 1;\n this._heartbeatTimeoutMs = _DefaultSocket.DefaultHeartbeatTimeoutMs;\n }\n generatecid() {\n const cid = this.nextCid.toString();\n ++this.nextCid;\n return cid;\n }\n connect(session, createStatus = false, connectTimeoutMs = _DefaultSocket.DefaultConnectTimeoutMs) {\n if (this.adapter.isOpen()) {\n return Promise.resolve(session);\n }\n const scheme = this.useSSL ? \"wss://\" : \"ws://\";\n this.adapter.connect(scheme, this.host, this.port, createStatus, session.token);\n this.adapter.onClose = (evt) => {\n this.ondisconnect(evt);\n };\n this.adapter.onError = (evt) => {\n this.onerror(evt);\n };\n this.adapter.onMessage = (message) => {\n if (this.verbose && window && window.console) {\n console.log(\"Response: %o\", JSON.stringify(message));\n }\n if (!message.cid) {\n if (message.notifications) {\n message.notifications.notifications.forEach((n) => {\n n.content = n.content ? JSON.parse(n.content) : void 0;\n this.onnotification(n);\n });\n } else if (message.match_data) {\n message.match_data.op_code = parseInt(message.match_data.op_code);\n this.onmatchdata(message.match_data);\n } else if (message.match_presence_event) {\n this.onmatchpresence(message.match_presence_event);\n } else if (message.matchmaker_ticket) {\n this.onmatchmakerticket(message.matchmaker_ticket);\n } else if (message.matchmaker_matched) {\n this.onmatchmakermatched(message.matchmaker_matched);\n } else if (message.status_presence_event) {\n this.onstatuspresence(message.status_presence_event);\n } else if (message.stream_presence_event) {\n this.onstreampresence(message.stream_presence_event);\n } else if (message.stream_data) {\n this.onstreamdata(message.stream_data);\n } else if (message.channel_message) {\n message.channel_message.content = JSON.parse(message.channel_message.content);\n this.onchannelmessage(message.channel_message);\n } else if (message.channel_presence_event) {\n this.onchannelpresence(message.channel_presence_event);\n } else if (message.party_data) {\n message.party_data.op_code = parseInt(message.party_data.op_code);\n this.onpartydata(message.party_data);\n } else if (message.party_close) {\n this.onpartyclose(message.party_close);\n } else if (message.party_join_request) {\n this.onpartyjoinrequest(message.party_join_request);\n } else if (message.party_leader) {\n this.onpartyleader(message.party_leader);\n } else if (message.party_matchmaker_ticket) {\n this.onpartymatchmakerticket(message.party_matchmaker_ticket);\n } else if (message.party_presence_event) {\n this.onpartypresence(message.party_presence_event);\n } else if (message.party) {\n this.onparty(message.party);\n } else {\n if (this.verbose && window && window.console) {\n console.log(\"Unrecognized message received: %o\", message);\n }\n }\n } else {\n const executor = this.cIds[message.cid];\n if (!executor) {\n if (this.verbose && window && window.console) {\n console.error(\"No promise executor for message: %o\", message);\n }\n return;\n }\n delete this.cIds[message.cid];\n if (message.error) {\n executor.reject(message.error);\n } else {\n executor.resolve(message);\n }\n }\n };\n return new Promise((resolve, reject) => {\n this.adapter.onOpen = (evt) => {\n if (this.verbose && window && window.console) {\n console.log(evt);\n }\n this.pingPong();\n resolve(session);\n };\n this.adapter.onError = (evt) => {\n reject(evt);\n this.adapter.close();\n };\n setTimeout(() => {\n reject(\"The socket timed out when trying to connect.\");\n }, connectTimeoutMs);\n });\n }\n disconnect(fireDisconnectEvent = true) {\n if (this.adapter.isOpen()) {\n this.adapter.close();\n }\n if (fireDisconnectEvent) {\n this.ondisconnect({});\n }\n }\n setHeartbeatTimeoutMs(ms) {\n this._heartbeatTimeoutMs = ms;\n }\n getHeartbeatTimeoutMs() {\n return this._heartbeatTimeoutMs;\n }\n ondisconnect(evt) {\n if (this.verbose && window && window.console) {\n console.log(evt);\n }\n }\n onerror(evt) {\n if (this.verbose && window && window.console) {\n console.log(evt);\n }\n }\n onchannelmessage(channelMessage) {\n if (this.verbose && window && window.console) {\n console.log(channelMessage);\n }\n }\n onchannelpresence(channelPresence) {\n if (this.verbose && window && window.console) {\n console.log(channelPresence);\n }\n }\n onnotification(notification) {\n if (this.verbose && window && window.console) {\n console.log(notification);\n }\n }\n onmatchdata(matchData) {\n if (this.verbose && window && window.console) {\n console.log(matchData);\n }\n }\n onmatchpresence(matchPresence) {\n if (this.verbose && window && window.console) {\n console.log(matchPresence);\n }\n }\n onmatchmakerticket(matchmakerTicket) {\n if (this.verbose && window && window.console) {\n console.log(matchmakerTicket);\n }\n }\n onmatchmakermatched(matchmakerMatched) {\n if (this.verbose && window && window.console) {\n console.log(matchmakerMatched);\n }\n }\n onparty(party) {\n if (this.verbose && window && window.console) {\n console.log(party);\n }\n }\n onpartyclose(close) {\n if (this.verbose && window && window.console) {\n console.log(\"Party closed: \" + close);\n }\n }\n onpartyjoinrequest(partyJoinRequest) {\n if (this.verbose && window && window.console) {\n console.log(partyJoinRequest);\n }\n }\n onpartydata(partyData) {\n if (this.verbose && window && window.console) {\n console.log(partyData);\n }\n }\n onpartyleader(partyLeader) {\n if (this.verbose && window && window.console) {\n console.log(partyLeader);\n }\n }\n onpartymatchmakerticket(partyMatched) {\n if (this.verbose && window && window.console) {\n console.log(partyMatched);\n }\n }\n onpartypresence(partyPresence) {\n if (this.verbose && window && window.console) {\n console.log(partyPresence);\n }\n }\n onstatuspresence(statusPresence) {\n if (this.verbose && window && window.console) {\n console.log(statusPresence);\n }\n }\n onstreampresence(streamPresence) {\n if (this.verbose && window && window.console) {\n console.log(streamPresence);\n }\n }\n onstreamdata(streamData) {\n if (this.verbose && window && window.console) {\n console.log(streamData);\n }\n }\n onheartbeattimeout() {\n if (this.verbose && window && window.console) {\n console.log(\"Heartbeat timeout.\");\n }\n }\n send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {\n const untypedMessage = message;\n return new Promise((resolve, reject) => {\n if (!this.adapter.isOpen()) {\n reject(\"Socket connection has not been established yet.\");\n } else {\n if (untypedMessage.match_data_send) {\n this.adapter.send(untypedMessage);\n resolve();\n } else if (untypedMessage.party_data_send) {\n this.adapter.send(untypedMessage);\n resolve();\n } else {\n if (untypedMessage.channel_message_send) {\n untypedMessage.channel_message_send.content = JSON.stringify(untypedMessage.channel_message_send.content);\n } else if (untypedMessage.channel_message_update) {\n untypedMessage.channel_message_update.content = JSON.stringify(untypedMessage.channel_message_update.content);\n }\n const cid = this.generatecid();\n this.cIds[cid] = { resolve, reject };\n setTimeout(() => {\n reject(\"The socket timed out while waiting for a response.\");\n }, sendTimeout);\n untypedMessage.cid = cid;\n this.adapter.send(untypedMessage);\n }\n }\n if (this.verbose && window && window.console) {\n const loggedMessage = __spreadValues({}, untypedMessage);\n if (loggedMessage.match_data_send && loggedMessage.match_data_send.data) {\n loggedMessage.match_data_send.data = decode2(loggedMessage.match_data_send.data);\n } else if (loggedMessage.party_data_send && loggedMessage.party_data_send.data) {\n loggedMessage.party_data_send.data = decode2(loggedMessage.party_data_send.data);\n }\n console.log(\"Sent message: %o\", JSON.stringify(loggedMessage));\n }\n });\n }\n acceptPartyMember(party_id, presence) {\n return this.send({ party_accept: { party_id, presence } });\n }\n addMatchmaker(query, min_count, max_count, string_properties, numeric_properties) {\n return __async(this, null, function* () {\n const response = yield this.send({\n \"matchmaker_add\": {\n min_count,\n max_count,\n query,\n string_properties,\n numeric_properties\n }\n });\n return response.matchmaker_ticket;\n });\n }\n addMatchmakerParty(party_id, query, min_count, max_count, string_properties, numeric_properties) {\n return __async(this, null, function* () {\n const response = yield this.send({\n party_matchmaker_add: {\n party_id,\n min_count,\n max_count,\n query,\n string_properties,\n numeric_properties\n }\n });\n return response.party_matchmaker_ticket;\n });\n }\n closeParty(party_id) {\n return __async(this, null, function* () {\n return yield this.send({ party_close: { party_id } });\n });\n }\n createMatch(name) {\n return __async(this, null, function* () {\n const response = yield this.send({ match_create: { name } });\n return response.match;\n });\n }\n createParty(open, max_size) {\n return __async(this, null, function* () {\n const response = yield this.send({ party_create: { open, max_size } });\n return response.party;\n });\n }\n followUsers(userIds) {\n return __async(this, null, function* () {\n const response = yield this.send({ status_follow: { user_ids: userIds } });\n return response.status;\n });\n }\n joinChat(target, type, persistence, hidden) {\n return __async(this, null, function* () {\n const response = yield this.send(\n {\n channel_join: {\n target,\n type,\n persistence,\n hidden\n }\n }\n );\n return response.channel;\n });\n }\n joinMatch(match_id, token, metadata) {\n return __async(this, null, function* () {\n const join = { match_join: { metadata } };\n if (token) {\n join.match_join.token = token;\n } else {\n join.match_join.match_id = match_id;\n }\n const response = yield this.send(join);\n return response.match;\n });\n }\n joinParty(party_id) {\n return __async(this, null, function* () {\n return yield this.send({ party_join: { party_id } });\n });\n }\n leaveChat(channel_id) {\n return this.send({ channel_leave: { channel_id } });\n }\n leaveMatch(matchId) {\n return this.send({ match_leave: { match_id: matchId } });\n }\n leaveParty(party_id) {\n return this.send({ party_leave: { party_id } });\n }\n listPartyJoinRequests(party_id) {\n return __async(this, null, function* () {\n const response = yield this.send({ party_join_request_list: { party_id } });\n return response.party_join_request;\n });\n }\n promotePartyMember(party_id, party_member) {\n return __async(this, null, function* () {\n const response = yield this.send({ party_promote: { party_id, presence: party_member } });\n return response.party_leader;\n });\n }\n removeChatMessage(channel_id, message_id) {\n return __async(this, null, function* () {\n const response = yield this.send(\n {\n channel_message_remove: {\n channel_id,\n message_id\n }\n }\n );\n return response.channel_message_ack;\n });\n }\n removeMatchmaker(ticket) {\n return this.send({ matchmaker_remove: { ticket } });\n }\n removeMatchmakerParty(party_id, ticket) {\n return this.send(\n {\n party_matchmaker_remove: {\n party_id,\n ticket\n }\n }\n );\n }\n removePartyMember(party_id, member) {\n return __async(this, null, function* () {\n return this.send({ party_remove: {\n party_id,\n presence: member\n } });\n });\n }\n rpc(id, payload, http_key) {\n return __async(this, null, function* () {\n const response = yield this.send(\n {\n rpc: {\n id,\n payload,\n http_key\n }\n }\n );\n return response.rpc;\n });\n }\n sendMatchState(matchId, opCode, data, presences, reliable) {\n return __async(this, null, function* () {\n return this.send(\n {\n match_data_send: {\n match_id: matchId,\n op_code: opCode,\n data,\n presences: presences != null ? presences : [],\n reliable\n }\n }\n );\n });\n }\n sendPartyData(party_id, op_code, data) {\n return this.send({ party_data_send: { party_id, op_code, data } });\n }\n unfollowUsers(user_ids) {\n return this.send({ status_unfollow: { user_ids } });\n }\n updateChatMessage(channel_id, message_id, content) {\n return __async(this, null, function* () {\n const response = yield this.send({ channel_message_update: { channel_id, message_id, content } });\n return response.channel_message_ack;\n });\n }\n updateStatus(status) {\n return this.send({ status_update: { status } });\n }\n writeChatMessage(channel_id, content) {\n return __async(this, null, function* () {\n const response = yield this.send({ channel_message_send: { channel_id, content } });\n return response.channel_message_ack;\n });\n }\n pingPong() {\n return __async(this, null, function* () {\n if (!this.adapter.isOpen()) {\n return;\n }\n try {\n yield this.send({ ping: {} }, this._heartbeatTimeoutMs);\n } catch (e) {\n if (this.adapter.isOpen()) {\n if (window && window.console) {\n console.error(\"Server unreachable from heartbeat.\");\n }\n this.onheartbeattimeout();\n this.adapter.close();\n }\n return;\n }\n setTimeout(() => this.pingPong(), this._heartbeatTimeoutMs);\n });\n }\n};\nvar DefaultSocket = _DefaultSocket;\nDefaultSocket.DefaultHeartbeatTimeoutMs = 1e4;\nDefaultSocket.DefaultSendTimeoutMs = 1e4;\nDefaultSocket.DefaultConnectTimeoutMs = 3e4;\n\n// client.ts\nvar DEFAULT_HOST = \"127.0.0.1\";\nvar DEFAULT_PORT = \"7350\";\nvar DEFAULT_SERVER_KEY = \"defaultkey\";\nvar DEFAULT_TIMEOUT_MS = 7e3;\nvar DEFAULT_EXPIRED_TIMESPAN_MS = 5 * 60 * 1e3;\nvar Client = class {\n constructor(serverkey = DEFAULT_SERVER_KEY, host = DEFAULT_HOST, port = DEFAULT_PORT, useSSL = false, timeout = DEFAULT_TIMEOUT_MS, autoRefreshSession = true) {\n this.serverkey = serverkey;\n this.host = host;\n this.port = port;\n this.useSSL = useSSL;\n this.timeout = timeout;\n this.autoRefreshSession = autoRefreshSession;\n /** The expired timespan used to check session lifetime. */\n this.expiredTimespanMs = DEFAULT_EXPIRED_TIMESPAN_MS;\n const scheme = useSSL ? \"https://\" : \"http://\";\n const basePath = `${scheme}${host}:${port}`;\n this.apiClient = new NakamaApi(serverkey, basePath, timeout);\n }\n /** Add users to a group, or accept their join requests. */\n addGroupUsers(session, groupId, ids) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.addGroupUsers(session.token, groupId, ids).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add friends by ID or username to a user's account. */\n addFriends(session, ids, usernames) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.addFriends(session.token, ids, usernames).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Authenticate a user with an Apple ID against the server. */\n authenticateApple(_0, _1, _2) {\n return __async(this, arguments, function* (token, create, username, vars = {}, options = {}) {\n const request = {\n \"token\": token,\n \"vars\": vars\n };\n return this.apiClient.authenticateApple(this.serverkey, \"\", request, create, username, options).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n });\n }\n /** Authenticate a user with a custom id against the server. */\n authenticateCustom(id, create, username, vars = {}, options = {}) {\n const request = {\n \"id\": id,\n \"vars\": vars\n };\n return this.apiClient.authenticateCustom(this.serverkey, \"\", request, create, username, options).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n }\n /** Authenticate a user with a device id against the server. */\n authenticateDevice(id, create, username, vars) {\n const request = {\n \"id\": id,\n \"vars\": vars\n };\n return this.apiClient.authenticateDevice(this.serverkey, \"\", request, create, username).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n }\n /** Authenticate a user with an email+password against the server. */\n authenticateEmail(email, password, create, username, vars) {\n const request = {\n \"email\": email,\n \"password\": password,\n \"vars\": vars\n };\n return this.apiClient.authenticateEmail(this.serverkey, \"\", request, create, username).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n }\n /** Authenticate a user with a Facebook Instant Game token against the server. */\n authenticateFacebookInstantGame(signedPlayerInfo, create, username, vars, options = {}) {\n const request = {\n \"signed_player_info\": signedPlayerInfo,\n \"vars\": vars\n };\n return this.apiClient.authenticateFacebookInstantGame(\n this.serverkey,\n \"\",\n { signed_player_info: request.signed_player_info, vars: request.vars },\n create,\n username,\n options\n ).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n }\n /** Authenticate a user with a Facebook OAuth token against the server. */\n authenticateFacebook(token, create, username, sync, vars, options = {}) {\n const request = {\n \"token\": token,\n \"vars\": vars\n };\n return this.apiClient.authenticateFacebook(this.serverkey, \"\", request, create, username, sync, options).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n }\n /** Authenticate a user with Google against the server. */\n authenticateGoogle(_0, _1, _2, _3) {\n return __async(this, arguments, function* (token, create, username, vars, options = {}) {\n const request = {\n token,\n vars\n };\n const apiSession = yield this.apiClient.authenticateGoogle(\n this.serverkey,\n \"\",\n request,\n create,\n username,\n options\n );\n return new Session(\n apiSession.token || \"\",\n apiSession.refresh_token || \"\",\n apiSession.created || false\n );\n });\n }\n /** Authenticate a user with GameCenter against the server. */\n authenticateGameCenter(_0, _1, _2, _3, _4, _5, _6, _7, _8) {\n return __async(this, arguments, function* (bundleId, playerId, publicKeyUrl, salt, signature, timestamp, username, create, vars, options = {}) {\n const request = {\n bundle_id: bundleId,\n player_id: playerId,\n public_key_url: publicKeyUrl,\n salt,\n signature,\n timestamp_seconds: timestamp,\n vars\n };\n const apiSession = yield this.apiClient.authenticateGameCenter(\n this.serverkey,\n \"\",\n request,\n create,\n username,\n options\n );\n return new Session(\n apiSession.token || \"\",\n apiSession.refresh_token || \"\",\n apiSession.created || false\n );\n });\n }\n /** Authenticate a user with Steam against the server. */\n authenticateSteam(token, create, username, sync, vars) {\n return __async(this, null, function* () {\n const request = {\n \"token\": token,\n \"vars\": vars,\n \"sync\": sync\n };\n return this.apiClient.authenticateSteam(this.serverkey, \"\", request, create, username).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n });\n }\n /** Ban users from a group. */\n banGroupUsers(session, groupId, ids) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.banGroupUsers(session.token, groupId, ids).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Block one or more users by ID or username. */\n blockFriends(session, ids, usernames) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.blockFriends(session.token, ids, usernames).then((response) => {\n return Promise.resolve(response != void 0);\n });\n });\n }\n /** Create a new group with the current user as the creator and superadmin. */\n createGroup(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.createGroup(session.token, request).then((response) => {\n return Promise.resolve({\n avatar_url: response.avatar_url,\n create_time: response.create_time,\n creator_id: response.creator_id,\n description: response.description,\n edge_count: response.edge_count ? Number(response.edge_count) : 0,\n id: response.id,\n lang_tag: response.lang_tag,\n max_count: response.max_count ? Number(response.max_count) : 0,\n metadata: response.metadata ? JSON.parse(response.metadata) : void 0,\n name: response.name,\n open: response.open,\n update_time: response.update_time\n });\n });\n });\n }\n /** A socket created with the client's configuration. */\n createSocket(useSSL = false, verbose = false, adapter = new WebSocketAdapterText(), sendTimeoutMs = DefaultSocket.DefaultSendTimeoutMs) {\n return new DefaultSocket(this.host, this.port, useSSL, verbose, adapter, sendTimeoutMs);\n }\n /** Delete one or more users by ID or username. */\n deleteFriends(session, ids, usernames) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.deleteFriends(session.token, ids, usernames).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Delete a group the user is part of and has permissions to delete. */\n deleteGroup(session, groupId) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.deleteGroup(session.token, groupId).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Delete one or more notifications */\n deleteNotifications(session, ids) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.deleteNotifications(session.token, ids).then((response) => {\n return Promise.resolve(response != void 0);\n });\n });\n }\n /** Delete one or more storage objects */\n deleteStorageObjects(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.deleteStorageObjects(session.token, request).then((response) => {\n return Promise.resolve(response != void 0);\n });\n });\n }\n /** Demote a set of users in a group to the next role down. */\n demoteGroupUsers(session, groupId, ids) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.demoteGroupUsers(session.token, groupId, ids).then((response) => {\n return Promise.resolve(response != void 0);\n });\n });\n }\n /** Submit an event for processing in the server's registered runtime custom events handler. */\n emitEvent(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.event(session.token, request).then((response) => {\n return Promise.resolve(response != void 0);\n });\n });\n }\n /** Fetch the current user's account. */\n getAccount(session) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.getAccount(session.token);\n });\n }\n /** Import Facebook friends and add them to a user's account. */\n importFacebookFriends(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.importFacebookFriends(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Import Steam friends and add them to a user's account. */\n importSteamFriends(session, request, reset) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.importSteamFriends(session.token, request, reset).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Fetch zero or more users by ID and/or username. */\n getUsers(session, ids, usernames, facebookIds) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.getUsers(session.token, ids, usernames, facebookIds).then((response) => {\n var result = {\n users: []\n };\n if (response.users == null) {\n return Promise.resolve(result);\n }\n response.users.forEach((u) => {\n result.users.push({\n avatar_url: u.avatar_url,\n create_time: u.create_time,\n display_name: u.display_name,\n edge_count: u.edge_count ? Number(u.edge_count) : 0,\n facebook_id: u.facebook_id,\n gamecenter_id: u.gamecenter_id,\n google_id: u.google_id,\n id: u.id,\n lang_tag: u.lang_tag,\n location: u.location,\n online: u.online,\n steam_id: u.steam_id,\n timezone: u.timezone,\n update_time: u.update_time,\n username: u.username,\n metadata: u.metadata ? JSON.parse(u.metadata) : void 0\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** Join a group that's open, or send a request to join a group that is closed. */\n joinGroup(session, groupId) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.joinGroup(session.token, groupId, {}).then((response) => {\n return response !== void 0;\n });\n });\n }\n joinTournament(session, tournamentId) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.joinTournament(session.token, tournamentId, {}).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Kick users from a group, or decline their join requests. */\n kickGroupUsers(session, groupId, ids) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.kickGroupUsers(session.token, groupId, ids).then((response) => {\n return Promise.resolve(response != void 0);\n });\n });\n }\n /** Leave a group the user is part of. */\n leaveGroup(session, groupId) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.leaveGroup(session.token, groupId, {}).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** List a channel's message history. */\n listChannelMessages(session, channelId, limit, forward, cursor) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listChannelMessages(session.token, channelId, limit, forward, cursor).then((response) => {\n var result = {\n messages: [],\n next_cursor: response.next_cursor,\n prev_cursor: response.prev_cursor,\n cacheable_cursor: response.cacheable_cursor\n };\n if (response.messages == null) {\n return Promise.resolve(result);\n }\n response.messages.forEach((m) => {\n result.messages.push({\n channel_id: m.channel_id,\n code: m.code ? Number(m.code) : 0,\n create_time: m.create_time,\n message_id: m.message_id,\n persistent: m.persistent,\n sender_id: m.sender_id,\n update_time: m.update_time,\n username: m.username,\n content: m.content ? JSON.parse(m.content) : void 0,\n group_id: m.group_id,\n room_name: m.room_name,\n user_id_one: m.user_id_one,\n user_id_two: m.user_id_two\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** List a group's users. */\n listGroupUsers(session, groupId, state, limit, cursor) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listGroupUsers(session.token, groupId, limit, state, cursor).then((response) => {\n var result = {\n group_users: [],\n cursor: response.cursor\n };\n if (response.group_users == null) {\n return Promise.resolve(result);\n }\n response.group_users.forEach((gu) => {\n result.group_users.push({\n user: {\n avatar_url: gu.user.avatar_url,\n create_time: gu.user.create_time,\n display_name: gu.user.display_name,\n edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,\n facebook_id: gu.user.facebook_id,\n gamecenter_id: gu.user.gamecenter_id,\n google_id: gu.user.google_id,\n id: gu.user.id,\n lang_tag: gu.user.lang_tag,\n location: gu.user.location,\n online: gu.user.online,\n steam_id: gu.user.steam_id,\n timezone: gu.user.timezone,\n update_time: gu.user.update_time,\n username: gu.user.username,\n metadata: gu.user.metadata ? JSON.parse(gu.user.metadata) : void 0\n },\n state: gu.state ? Number(gu.state) : 0\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** List a user's groups. */\n listUserGroups(session, userId, state, limit, cursor) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listUserGroups(session.token, userId, state, limit, cursor).then((response) => {\n var result = {\n user_groups: [],\n cursor: response.cursor\n };\n if (response.user_groups == null) {\n return Promise.resolve(result);\n }\n response.user_groups.forEach((ug) => {\n result.user_groups.push({\n group: {\n avatar_url: ug.group.avatar_url,\n create_time: ug.group.create_time,\n creator_id: ug.group.creator_id,\n description: ug.group.description,\n edge_count: ug.group.edge_count ? Number(ug.group.edge_count) : 0,\n id: ug.group.id,\n lang_tag: ug.group.lang_tag,\n max_count: ug.group.max_count,\n metadata: ug.group.metadata ? JSON.parse(ug.group.metadata) : void 0,\n name: ug.group.name,\n open: ug.group.open,\n update_time: ug.group.update_time\n },\n state: ug.state ? Number(ug.state) : 0\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** List groups based on given filters. */\n listGroups(session, name, cursor, limit) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listGroups(session.token, name, cursor, limit).then((response) => {\n var result = {\n groups: []\n };\n if (response.groups == null) {\n return Promise.resolve(result);\n }\n result.cursor = response.cursor;\n response.groups.forEach((ug) => {\n result.groups.push({\n avatar_url: ug.avatar_url,\n create_time: ug.create_time,\n creator_id: ug.creator_id,\n description: ug.description,\n edge_count: ug.edge_count ? Number(ug.edge_count) : 0,\n id: ug.id,\n lang_tag: ug.lang_tag,\n max_count: ug.max_count,\n metadata: ug.metadata ? JSON.parse(ug.metadata) : void 0,\n name: ug.name,\n open: ug.open,\n update_time: ug.update_time\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** Add an Apple ID to the social profiles on the current user's account. */\n linkApple(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkApple(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add a custom ID to the social profiles on the current user's account. */\n linkCustom(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkCustom(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add a device ID to the social profiles on the current user's account. */\n linkDevice(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkDevice(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add an email+password to the social profiles on the current user's account. */\n linkEmail(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkEmail(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add Facebook to the social profiles on the current user's account. */\n linkFacebook(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkFacebook(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add Facebook Instant to the social profiles on the current user's account. */\n linkFacebookInstantGame(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkFacebookInstantGame(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add Google to the social profiles on the current user's account. */\n linkGoogle(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkGoogle(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add GameCenter to the social profiles on the current user's account. */\n linkGameCenter(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkGameCenter(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Add Steam to the social profiles on the current user's account. */\n linkSteam(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.linkSteam(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** List all friends for the current user. */\n listFriends(session, state, limit, cursor) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listFriends(session.token, limit, state, cursor).then((response) => {\n var result = {\n friends: [],\n cursor: response.cursor\n };\n if (response.friends == null) {\n return Promise.resolve(result);\n }\n response.friends.forEach((f) => {\n result.friends.push({\n user: {\n avatar_url: f.user.avatar_url,\n create_time: f.user.create_time,\n display_name: f.user.display_name,\n edge_count: f.user.edge_count ? Number(f.user.edge_count) : 0,\n facebook_id: f.user.facebook_id,\n gamecenter_id: f.user.gamecenter_id,\n google_id: f.user.google_id,\n id: f.user.id,\n lang_tag: f.user.lang_tag,\n location: f.user.location,\n online: f.user.online,\n steam_id: f.user.steam_id,\n timezone: f.user.timezone,\n update_time: f.user.update_time,\n username: f.user.username,\n metadata: f.user.metadata ? JSON.parse(f.user.metadata) : void 0,\n facebook_instant_game_id: f.user.facebook_instant_game_id\n },\n state: f.state\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** List leaderboard records */\n listLeaderboardRecords(session, leaderboardId, ownerIds, limit, cursor, expiry) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listLeaderboardRecords(session.token, leaderboardId, ownerIds, limit, cursor, expiry).then((response) => {\n var list = {\n next_cursor: response.next_cursor,\n prev_cursor: response.prev_cursor,\n owner_records: [],\n records: []\n };\n if (response.owner_records != null) {\n response.owner_records.forEach((o) => {\n list.owner_records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n if (response.records != null) {\n response.records.forEach((o) => {\n list.records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n return Promise.resolve(list);\n });\n });\n }\n listLeaderboardRecordsAroundOwner(session, leaderboardId, ownerId, limit, expiry) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listLeaderboardRecordsAroundOwner(session.token, leaderboardId, ownerId, limit, expiry).then((response) => {\n var list = {\n next_cursor: response.next_cursor,\n prev_cursor: response.prev_cursor,\n owner_records: [],\n records: []\n };\n if (response.owner_records != null) {\n response.owner_records.forEach((o) => {\n list.owner_records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n if (response.records != null) {\n response.records.forEach((o) => {\n list.records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n return Promise.resolve(list);\n });\n });\n }\n /** Fetch list of running matches. */\n listMatches(session, limit, authoritative, label, minSize, maxSize, query) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listMatches(session.token, limit, authoritative, label, minSize, maxSize, query);\n });\n }\n /** Fetch list of notifications. */\n listNotifications(session, limit, cacheableCursor) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listNotifications(session.token, limit, cacheableCursor).then((response) => {\n var result = {\n cacheable_cursor: response.cacheable_cursor,\n notifications: []\n };\n if (response.notifications == null) {\n return Promise.resolve(result);\n }\n response.notifications.forEach((n) => {\n result.notifications.push({\n code: n.code ? Number(n.code) : 0,\n create_time: n.create_time,\n id: n.id,\n persistent: n.persistent,\n sender_id: n.sender_id,\n subject: n.subject,\n content: n.content ? JSON.parse(n.content) : void 0\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** List storage objects. */\n listStorageObjects(session, collection, userId, limit, cursor) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listStorageObjects(session.token, collection, userId, limit, cursor).then((response) => {\n var result = {\n objects: [],\n cursor: response.cursor\n };\n if (response.objects == null) {\n return Promise.resolve(result);\n }\n response.objects.forEach((o) => {\n result.objects.push({\n collection: o.collection,\n key: o.key,\n permission_read: o.permission_read ? Number(o.permission_read) : 0,\n permission_write: o.permission_write ? Number(o.permission_write) : 0,\n value: o.value ? JSON.parse(o.value) : void 0,\n version: o.version,\n user_id: o.user_id,\n create_time: o.create_time,\n update_time: o.update_time\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** List current or upcoming tournaments. */\n listTournaments(session, categoryStart, categoryEnd, startTime, endTime, limit, cursor) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listTournaments(session.token, categoryStart, categoryEnd, startTime, endTime, limit, cursor).then((response) => {\n var list = {\n cursor: response.cursor,\n tournaments: []\n };\n if (response.tournaments != null) {\n response.tournaments.forEach((o) => {\n list.tournaments.push({\n id: o.id,\n title: o.title,\n description: o.description,\n duration: o.duration ? Number(o.duration) : 0,\n category: o.category ? Number(o.category) : 0,\n sort_order: o.sort_order ? Number(o.sort_order) : 0,\n size: o.size ? Number(o.size) : 0,\n max_size: o.max_size ? Number(o.max_size) : 0,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0,\n can_enter: o.can_enter,\n end_active: o.end_active ? Number(o.end_active) : 0,\n next_reset: o.next_reset ? Number(o.next_reset) : 0,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n create_time: o.create_time,\n start_time: o.start_time,\n end_time: o.end_time,\n start_active: o.start_active\n });\n });\n }\n return Promise.resolve(list);\n });\n });\n }\n /** List tournament records from a given tournament. */\n listTournamentRecords(session, tournamentId, ownerIds, limit, cursor, expiry) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listTournamentRecords(session.token, tournamentId, ownerIds, limit, cursor, expiry).then((response) => {\n var list = {\n next_cursor: response.next_cursor,\n prev_cursor: response.prev_cursor,\n owner_records: [],\n records: []\n };\n if (response.owner_records != null) {\n response.owner_records.forEach((o) => {\n list.owner_records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n if (response.records != null) {\n response.records.forEach((o) => {\n list.records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n return Promise.resolve(list);\n });\n });\n }\n /** List tournament records from a given tournament around the owner. */\n listTournamentRecordsAroundOwner(session, tournamentId, ownerId, limit, expiry) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.listTournamentRecordsAroundOwner(session.token, tournamentId, ownerId, limit, expiry).then((response) => {\n var list = {\n next_cursor: response.next_cursor,\n prev_cursor: response.prev_cursor,\n owner_records: [],\n records: []\n };\n if (response.owner_records != null) {\n response.owner_records.forEach((o) => {\n list.owner_records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n if (response.records != null) {\n response.records.forEach((o) => {\n list.records.push({\n expiry_time: o.expiry_time,\n leaderboard_id: o.leaderboard_id,\n metadata: o.metadata ? JSON.parse(o.metadata) : void 0,\n num_score: o.num_score ? Number(o.num_score) : 0,\n owner_id: o.owner_id,\n rank: o.rank ? Number(o.rank) : 0,\n score: o.score ? Number(o.score) : 0,\n subscore: o.subscore ? Number(o.subscore) : 0,\n update_time: o.update_time,\n username: o.username,\n max_num_score: o.max_num_score ? Number(o.max_num_score) : 0\n });\n });\n }\n return Promise.resolve(list);\n });\n });\n }\n /** Promote users in a group to the next role up. */\n promoteGroupUsers(session, groupId, ids) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.promoteGroupUsers(session.token, groupId, ids);\n });\n }\n /** Fetch storage objects. */\n readStorageObjects(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.readStorageObjects(session.token, request).then((response) => {\n var result = { objects: [] };\n if (response.objects == null) {\n return Promise.resolve(result);\n }\n response.objects.forEach((o) => {\n result.objects.push({\n collection: o.collection,\n key: o.key,\n permission_read: o.permission_read ? Number(o.permission_read) : 0,\n permission_write: o.permission_write ? Number(o.permission_write) : 0,\n value: o.value ? JSON.parse(o.value) : void 0,\n version: o.version,\n user_id: o.user_id,\n create_time: o.create_time,\n update_time: o.update_time\n });\n });\n return Promise.resolve(result);\n });\n });\n }\n /** Execute an RPC function on the server. */\n rpc(session, id, input) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.rpcFunc(session.token, id, JSON.stringify(input)).then((response) => {\n return Promise.resolve({\n id: response.id,\n payload: !response.payload ? void 0 : JSON.parse(response.payload)\n });\n });\n });\n }\n /** Execute an RPC function on the server. */\n rpcHttpKey(httpKey, id, input) {\n return __async(this, null, function* () {\n return this.apiClient.rpcFunc2(\"\", id, input && JSON.stringify(input) || \"\", httpKey).then((response) => {\n return Promise.resolve({\n id: response.id,\n payload: !response.payload ? void 0 : JSON.parse(response.payload)\n });\n }).catch((err) => {\n throw err;\n });\n });\n }\n /** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */\n sessionLogout(session, token, refreshToken) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.sessionLogout(session.token, { refresh_token: refreshToken, token }).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Refresh a user's session using a refresh token retrieved from a previous authentication request. */\n sessionRefresh(_0) {\n return __async(this, arguments, function* (session, vars = {}) {\n if (!session) {\n console.error(\"Cannot refresh a null session.\");\n return session;\n }\n if (session.created && session.expires_at - session.created_at < 70) {\n console.warn(\"Session lifetime too short, please set '--session.token_expiry_sec' option. See the documentation for more info: https://heroiclabs.com/docs/nakama/getting-started/configuration/#session\");\n }\n if (session.created && session.refresh_expires_at - session.created_at < 3700) {\n console.warn(\"Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://heroiclabs.com/docs/nakama/getting-started/configuration/#session\");\n }\n const apiSession = yield this.apiClient.sessionRefresh(this.serverkey, \"\", { token: session.refresh_token, vars });\n session.update(apiSession.token, apiSession.refresh_token);\n return session;\n });\n }\n /** Remove the Apple ID from the social profiles on the current user's account. */\n unlinkApple(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkApple(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove custom ID from the social profiles on the current user's account. */\n unlinkCustom(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkCustom(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove a device ID from the social profiles on the current user's account. */\n unlinkDevice(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkDevice(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove an email+password from the social profiles on the current user's account. */\n unlinkEmail(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkEmail(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove Facebook from the social profiles on the current user's account. */\n unlinkFacebook(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkFacebook(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove Facebook Instant social profiles from the current user's account. */\n unlinkFacebookInstantGame(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkFacebookInstantGame(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove Google from the social profiles on the current user's account. */\n unlinkGoogle(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkGoogle(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove GameCenter from the social profiles on the current user's account. */\n unlinkGameCenter(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkGameCenter(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Remove Steam from the social profiles on the current user's account. */\n unlinkSteam(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.unlinkSteam(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Update fields in the current user's account. */\n updateAccount(session, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.updateAccount(session.token, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Update a group the user is part of and has permissions to update. */\n updateGroup(session, groupId, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.updateGroup(session.token, groupId, request).then((response) => {\n return response !== void 0;\n });\n });\n }\n /** Validate an Apple IAP receipt. */\n validatePurchaseApple(session, receipt) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.validatePurchaseApple(session.token, { receipt });\n });\n }\n /** Validate a Google IAP receipt. */\n validatePurchaseGoogle(session, purchase) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.validatePurchaseGoogle(session.token, { purchase });\n });\n }\n /** Validate a Huawei IAP receipt. */\n validatePurchaseHuawei(session, purchase, signature) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.validatePurchaseHuawei(session.token, { purchase, signature });\n });\n }\n /** Write a record to a leaderboard. */\n writeLeaderboardRecord(session, leaderboardId, request) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n return this.apiClient.writeLeaderboardRecord(session.token, leaderboardId, {\n metadata: request.metadata ? JSON.stringify(request.metadata) : void 0,\n score: request.score,\n subscore: request.subscore\n }).then((response) => {\n return Promise.resolve({\n expiry_time: response.expiry_time,\n leaderboard_id: response.leaderboard_id,\n metadata: response.metadata ? JSON.parse(response.metadata) : void 0,\n num_score: response.num_score ? Number(response.num_score) : 0,\n owner_id: response.owner_id,\n score: response.score ? Number(response.score) : 0,\n subscore: response.subscore ? Number(response.subscore) : 0,\n update_time: response.update_time,\n username: response.username,\n max_num_score: response.max_num_score ? Number(response.max_num_score) : 0,\n rank: response.rank ? Number(response.rank) : 0\n });\n });\n });\n }\n /** Write storage objects. */\n writeStorageObjects(session, objects) {\n return __async(this, null, function* () {\n if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {\n yield this.sessionRefresh(session);\n }\n var request = { objects: [] };\n objects.forEach((o) => {\n request.objects.push({\n collection: o.collection,\n key: o.key,\n permission_read: o.permission_read,\n permission_write: o.permission_write,\n value: JSON.stringify(o.value),\n version: o.version\n });\n });\n return this.apiClient.writeStorageObjects(session.token, request);\n });\n }\n /** Write a record to a tournament. */\n writeTournamentRecord(session, tournamentId, request) {\n return __async(this, null, function* () {\n return this.apiClient.writeTournamentRecord(session.token, tournamentId, {\n metadata: request.metadata ? JSON.stringify(request.metadata) : void 0,\n score: request.score,\n subscore: request.subscore\n }).then((response) => {\n return Promise.resolve({\n expiry_time: response.expiry_time,\n leaderboard_id: response.leaderboard_id,\n metadata: response.metadata ? JSON.parse(response.metadata) : void 0,\n num_score: response.num_score ? Number(response.num_score) : 0,\n owner_id: response.owner_id,\n score: response.score ? Number(response.score) : 0,\n subscore: response.subscore ? Number(response.subscore) : 0,\n update_time: response.update_time,\n username: response.username,\n max_num_score: response.max_num_score ? Number(response.max_num_score) : 0,\n rank: response.rank ? Number(response.rank) : 0\n });\n });\n });\n }\n};\nexport {\n Client,\n DefaultSocket,\n Session,\n WebSocketAdapterText\n};\n"],"names":[],"sourceRoot":"","ignoreList":[0]}