@blimu/react 1.1.0 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/index.cjs +5 -1
  3. package/dist/_virtual/index.cjs.map +1 -1
  4. package/dist/_virtual/index.js +3 -3
  5. package/dist/_virtual/index2.cjs +4 -1
  6. package/dist/_virtual/index2.cjs.map +1 -1
  7. package/dist/_virtual/index2.js +2 -2
  8. package/dist/_virtual/use-sync-external-store-shim.development.cjs +4 -1
  9. package/dist/_virtual/use-sync-external-store-shim.development.cjs.map +1 -1
  10. package/dist/_virtual/use-sync-external-store-shim.development.js +2 -2
  11. package/dist/_virtual/use-sync-external-store-shim.production.cjs +4 -1
  12. package/dist/_virtual/use-sync-external-store-shim.production.cjs.map +1 -1
  13. package/dist/_virtual/use-sync-external-store-shim.production.js +2 -2
  14. package/dist/client/auth.service.cjs +248 -1
  15. package/dist/client/auth.service.cjs.map +1 -1
  16. package/dist/client/auth.service.d.ts.map +1 -1
  17. package/dist/client/auth.service.js +193 -96
  18. package/dist/client/auth.service.js.map +1 -1
  19. package/dist/client/external-store.cjs +26 -1
  20. package/dist/client/external-store.cjs.map +1 -1
  21. package/dist/client/external-store.js +22 -8
  22. package/dist/client/external-store.js.map +1 -1
  23. package/dist/client/runtime-client.cjs +136 -1
  24. package/dist/client/runtime-client.cjs.map +1 -1
  25. package/dist/client/runtime-client.d.ts +1 -1
  26. package/dist/client/runtime-client.d.ts.map +1 -1
  27. package/dist/client/runtime-client.js +85 -51
  28. package/dist/client/runtime-client.js.map +1 -1
  29. package/dist/components/index.cjs +13 -0
  30. package/dist/components/index.cjs.map +1 -0
  31. package/dist/components/index.d.ts +6 -6
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components/index.js +13 -0
  34. package/dist/components/index.js.map +1 -0
  35. package/dist/components/members-list.cjs +132 -1
  36. package/dist/components/members-list.cjs.map +1 -1
  37. package/dist/components/members-list.d.ts.map +1 -1
  38. package/dist/components/members-list.js +69 -64
  39. package/dist/components/members-list.js.map +1 -1
  40. package/dist/components/redirect-to-sign-in.cjs +34 -1
  41. package/dist/components/redirect-to-sign-in.cjs.map +1 -1
  42. package/dist/components/redirect-to-sign-in.js +28 -20
  43. package/dist/components/redirect-to-sign-in.js.map +1 -1
  44. package/dist/components/sign-in-button.cjs +36 -1
  45. package/dist/components/sign-in-button.cjs.map +1 -1
  46. package/dist/components/sign-in-button.d.ts.map +1 -1
  47. package/dist/components/sign-in-button.js +25 -21
  48. package/dist/components/sign-in-button.js.map +1 -1
  49. package/dist/components/ui/avatar.cjs +42 -1
  50. package/dist/components/ui/avatar.cjs.map +1 -1
  51. package/dist/components/ui/avatar.d.ts +2 -2
  52. package/dist/components/ui/avatar.d.ts.map +1 -1
  53. package/dist/components/ui/avatar.js +23 -23
  54. package/dist/components/ui/avatar.js.map +1 -1
  55. package/dist/components/ui/badge.d.ts +2 -2
  56. package/dist/components/ui/badge.d.ts.map +1 -1
  57. package/dist/components/ui/dropdown-menu.cjs +148 -1
  58. package/dist/components/ui/dropdown-menu.cjs.map +1 -1
  59. package/dist/components/ui/dropdown-menu.d.ts +2 -2
  60. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  61. package/dist/components/ui/dropdown-menu.js +83 -81
  62. package/dist/components/ui/dropdown-menu.js.map +1 -1
  63. package/dist/components/ui/popover.d.ts +2 -2
  64. package/dist/components/ui/popover.d.ts.map +1 -1
  65. package/dist/components/ui/separator.d.ts +1 -1
  66. package/dist/components/ui/separator.d.ts.map +1 -1
  67. package/dist/components/user-avatar.cjs +22 -1
  68. package/dist/components/user-avatar.cjs.map +1 -1
  69. package/dist/components/user-avatar.d.ts +5 -5
  70. package/dist/components/user-avatar.d.ts.map +1 -1
  71. package/dist/components/user-avatar.js +16 -16
  72. package/dist/components/user-avatar.js.map +1 -1
  73. package/dist/components/user-button/styles.cjs +39 -1
  74. package/dist/components/user-button/styles.cjs.map +1 -1
  75. package/dist/components/user-button/styles.js +6 -5
  76. package/dist/components/user-button/styles.js.map +1 -1
  77. package/dist/components/user-button/user-button.cjs +98 -1
  78. package/dist/components/user-button/user-button.cjs.map +1 -1
  79. package/dist/components/user-button/user-button.d.ts +1 -1
  80. package/dist/components/user-button/user-button.d.ts.map +1 -1
  81. package/dist/components/user-button/user-button.js +64 -58
  82. package/dist/components/user-button/user-button.js.map +1 -1
  83. package/dist/hooks/index.cjs +14 -0
  84. package/dist/hooks/index.cjs.map +1 -0
  85. package/dist/hooks/index.d.ts +3 -2
  86. package/dist/hooks/index.d.ts.map +1 -1
  87. package/dist/hooks/index.js +14 -0
  88. package/dist/hooks/index.js.map +1 -0
  89. package/dist/hooks/use-auth.cjs +44 -1
  90. package/dist/hooks/use-auth.cjs.map +1 -1
  91. package/dist/hooks/use-auth.d.ts +13 -15
  92. package/dist/hooks/use-auth.d.ts.map +1 -1
  93. package/dist/hooks/use-auth.js +30 -26
  94. package/dist/hooks/use-auth.js.map +1 -1
  95. package/dist/hooks/use-client.cjs +9 -1
  96. package/dist/hooks/use-client.cjs.map +1 -1
  97. package/dist/hooks/use-client.d.ts +1 -1
  98. package/dist/hooks/use-client.d.ts.map +1 -1
  99. package/dist/hooks/use-client.js +6 -5
  100. package/dist/hooks/use-client.js.map +1 -1
  101. package/dist/hooks/use-members.cjs +60 -1
  102. package/dist/hooks/use-members.cjs.map +1 -1
  103. package/dist/hooks/use-members.d.ts +5 -5
  104. package/dist/hooks/use-members.d.ts.map +1 -1
  105. package/dist/hooks/use-members.js +53 -41
  106. package/dist/hooks/use-members.js.map +1 -1
  107. package/dist/hooks/use-store.cjs +17 -1
  108. package/dist/hooks/use-store.cjs.map +1 -1
  109. package/dist/hooks/use-store.js +7 -7
  110. package/dist/hooks/use-store.js.map +1 -1
  111. package/dist/index.cjs +37 -1
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.d.ts +5 -5
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +35 -35
  116. package/dist/lib/utils.cjs +8 -1
  117. package/dist/lib/utils.cjs.map +1 -1
  118. package/dist/lib/utils.js +5 -5
  119. package/dist/lib/utils.js.map +1 -1
  120. package/dist/lib/variants.cjs +46 -1
  121. package/dist/lib/variants.cjs.map +1 -1
  122. package/dist/lib/variants.d.ts +1 -1
  123. package/dist/lib/variants.js +6 -5
  124. package/dist/lib/variants.js.map +1 -1
  125. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +721 -1
  126. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs.map +1 -1
  127. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +571 -377
  128. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
  129. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +625 -1
  130. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs.map +1 -1
  131. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +539 -316
  132. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -1
  133. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +313 -1
  134. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.map +1 -1
  135. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +261 -172
  136. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -1
  137. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +154 -1
  138. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs.map +1 -1
  139. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +173 -1
  140. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.map +1 -1
  141. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +144 -107
  142. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
  143. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +111 -87
  144. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -1
  145. package/dist/node_modules/@radix-ui/primitive/dist/index.cjs +11 -1
  146. package/dist/node_modules/@radix-ui/primitive/dist/index.cjs.map +1 -1
  147. package/dist/node_modules/@radix-ui/primitive/dist/index.js +7 -5
  148. package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
  149. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs +42 -1
  150. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -1
  151. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +17 -16
  152. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -1
  153. package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs +140 -1
  154. package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs.map +1 -1
  155. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +105 -57
  156. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js.map +1 -1
  157. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs +80 -1
  158. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
  159. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js +49 -41
  160. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  161. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs +56 -1
  162. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
  163. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js +17 -10
  164. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
  165. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs +119 -1
  166. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
  167. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js +86 -42
  168. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  169. package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs +70 -1
  170. package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs.map +1 -1
  171. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +57 -37
  172. package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
  173. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +56 -1
  174. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs.map +1 -1
  175. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -19
  176. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
  177. package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +79 -1
  178. package/dist/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
  179. package/dist/node_modules/@radix-ui/react-context/dist/index.js +48 -39
  180. package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  181. package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs +27 -1
  182. package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs.map +1 -1
  183. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +6 -6
  184. package/dist/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -1
  185. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +229 -1
  186. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +1 -1
  187. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +182 -97
  188. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
  189. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +296 -1
  190. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs.map +1 -1
  191. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +232 -167
  192. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -1
  193. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +46 -1
  194. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs.map +1 -1
  195. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +23 -11
  196. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
  197. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +224 -1
  198. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
  199. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +169 -98
  200. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
  201. package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +31 -1
  202. package/dist/node_modules/@radix-ui/react-id/dist/index.cjs.map +1 -1
  203. package/dist/node_modules/@radix-ui/react-id/dist/index.js +11 -10
  204. package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
  205. package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs +845 -1
  206. package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs.map +1 -1
  207. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +662 -442
  208. package/dist/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -1
  209. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +308 -1
  210. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -1
  211. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +209 -137
  212. package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
  213. package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs +34 -1
  214. package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs.map +1 -1
  215. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +14 -12
  216. package/dist/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
  217. package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs +145 -1
  218. package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs.map +1 -1
  219. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +103 -45
  220. package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
  221. package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +61 -1
  222. package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
  223. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +21 -14
  224. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
  225. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +244 -1
  226. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs.map +1 -1
  227. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +179 -135
  228. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
  229. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +105 -1
  230. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
  231. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +74 -35
  232. package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  233. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +28 -1
  234. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
  235. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +8 -7
  236. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
  237. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +86 -1
  238. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +1 -1
  239. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +57 -40
  240. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
  241. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +34 -1
  242. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs.map +1 -1
  243. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +13 -10
  244. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
  245. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +15 -1
  246. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs.map +1 -1
  247. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +8 -8
  248. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js.map +1 -1
  249. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +23 -1
  250. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs.map +1 -1
  251. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +3 -3
  252. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
  253. package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs +56 -1
  254. package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs.map +1 -1
  255. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +34 -22
  256. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
  257. package/dist/node_modules/aria-hidden/dist/es2015/index.cjs +122 -1
  258. package/dist/node_modules/aria-hidden/dist/es2015/index.cjs.map +1 -1
  259. package/dist/node_modules/aria-hidden/dist/es2015/index.js +111 -41
  260. package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -1
  261. package/dist/node_modules/class-variance-authority/dist/index.cjs +45 -1
  262. package/dist/node_modules/class-variance-authority/dist/index.cjs.map +1 -1
  263. package/dist/node_modules/class-variance-authority/dist/index.js +40 -30
  264. package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -1
  265. package/dist/node_modules/clsx/dist/clsx.cjs +17 -1
  266. package/dist/node_modules/clsx/dist/clsx.cjs.map +1 -1
  267. package/dist/node_modules/clsx/dist/clsx.js +13 -13
  268. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  269. package/dist/node_modules/get-nonce/dist/es2015/index.cjs +9 -1
  270. package/dist/node_modules/get-nonce/dist/es2015/index.cjs.map +1 -1
  271. package/dist/node_modules/get-nonce/dist/es2015/index.js +5 -3
  272. package/dist/node_modules/get-nonce/dist/es2015/index.js.map +1 -1
  273. package/dist/node_modules/js-cookie/dist/js.cookie.cjs +99 -1
  274. package/dist/node_modules/js-cookie/dist/js.cookie.cjs.map +1 -1
  275. package/dist/node_modules/js-cookie/dist/js.cookie.js +69 -43
  276. package/dist/node_modules/js-cookie/dist/js.cookie.js.map +1 -1
  277. package/dist/node_modules/jwt-decode/build/esm/index.cjs +58 -1
  278. package/dist/node_modules/jwt-decode/build/esm/index.cjs.map +1 -1
  279. package/dist/node_modules/jwt-decode/build/esm/index.js +36 -30
  280. package/dist/node_modules/jwt-decode/build/esm/index.js.map +1 -1
  281. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +35 -1
  282. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
  283. package/dist/node_modules/lucide-react/dist/esm/Icon.js +25 -25
  284. package/dist/node_modules/lucide-react/dist/esm/Icon.js.map +1 -1
  285. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +22 -1
  286. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
  287. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +16 -15
  288. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js.map +1 -1
  289. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +14 -1
  290. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +1 -1
  291. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +2 -2
  292. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js.map +1 -1
  293. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +7 -1
  294. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
  295. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +5 -4
  296. package/dist/node_modules/lucide-react/dist/esm/icons/check.js.map +1 -1
  297. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +7 -1
  298. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.map +1 -1
  299. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +5 -4
  300. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js.map +1 -1
  301. package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs +7 -1
  302. package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs.map +1 -1
  303. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +5 -4
  304. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js.map +1 -1
  305. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs +11 -1
  306. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs.map +1 -1
  307. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js +6 -5
  308. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js.map +1 -1
  309. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +26 -1
  310. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +1 -1
  311. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +22 -14
  312. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js.map +1 -1
  313. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +28 -1
  314. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs.map +1 -1
  315. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +8 -8
  316. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
  317. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +197 -4
  318. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs.map +1 -1
  319. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +163 -98
  320. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
  321. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs +55 -1
  322. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs.map +1 -1
  323. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -24
  324. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
  325. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +19 -1
  326. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs.map +1 -1
  327. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +12 -9
  328. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -1
  329. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +102 -1
  330. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs.map +1 -1
  331. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +85 -51
  332. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
  333. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs +5 -1
  334. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs.map +1 -1
  335. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +3 -3
  336. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -1
  337. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +7 -1
  338. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs.map +1 -1
  339. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +5 -5
  340. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -1
  341. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +62 -36
  342. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs.map +1 -1
  343. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +41 -65
  344. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
  345. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +10 -1
  346. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs.map +1 -1
  347. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -5
  348. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -1
  349. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +37 -1
  350. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs.map +1 -1
  351. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +28 -16
  352. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -1
  353. package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs +13 -1
  354. package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs.map +1 -1
  355. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +9 -7
  356. package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -1
  357. package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs +33 -1
  358. package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs.map +1 -1
  359. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +11 -10
  360. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -1
  361. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs +48 -1
  362. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs.map +1 -1
  363. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +35 -17
  364. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -1
  365. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs +3014 -1
  366. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.map +1 -1
  367. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +804 -555
  368. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  369. package/dist/node_modules/tailwindcss/dist/plugin.cjs +13 -1
  370. package/dist/node_modules/tailwindcss/dist/plugin.cjs.map +1 -1
  371. package/dist/node_modules/tailwindcss/dist/plugin.js +8 -8
  372. package/dist/node_modules/tailwindcss/dist/plugin.js.map +1 -1
  373. package/dist/node_modules/tslib/tslib.es6.cjs +38 -1
  374. package/dist/node_modules/tslib/tslib.es6.cjs.map +1 -1
  375. package/dist/node_modules/tslib/tslib.es6.js +33 -21
  376. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  377. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +11 -1
  378. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs.map +1 -1
  379. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +8 -3
  380. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -1
  381. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +52 -1
  382. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs.map +1 -1
  383. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +28 -19
  384. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
  385. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs +29 -1
  386. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs.map +1 -1
  387. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +15 -11
  388. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
  389. package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs +38 -1
  390. package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs.map +1 -1
  391. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +15 -12
  392. package/dist/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -1
  393. package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs +88 -1
  394. package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs.map +1 -1
  395. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +64 -43
  396. package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  397. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +68 -1
  398. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs.map +1 -1
  399. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +49 -39
  400. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
  401. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +53 -1
  402. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs.map +1 -1
  403. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +39 -32
  404. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -1
  405. package/dist/node_modules/use-sync-external-store/shim/index.cjs +17 -1
  406. package/dist/node_modules/use-sync-external-store/shim/index.cjs.map +1 -1
  407. package/dist/node_modules/use-sync-external-store/shim/index.js +14 -7
  408. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -1
  409. package/dist/providers/auth/auth.context.cjs +5 -1
  410. package/dist/providers/auth/auth.context.cjs.map +1 -1
  411. package/dist/providers/auth/auth.context.js +3 -3
  412. package/dist/providers/auth/auth.context.js.map +1 -1
  413. package/dist/providers/auth/auth.hook.cjs +12 -1
  414. package/dist/providers/auth/auth.hook.cjs.map +1 -1
  415. package/dist/providers/auth/auth.hook.js +8 -7
  416. package/dist/providers/auth/auth.hook.js.map +1 -1
  417. package/dist/providers/auth/auth.provider.cjs +37 -1
  418. package/dist/providers/auth/auth.provider.cjs.map +1 -1
  419. package/dist/providers/auth/auth.provider.js +31 -22
  420. package/dist/providers/auth/auth.provider.js.map +1 -1
  421. package/dist/providers/blimu/blimu.context.cjs +5 -1
  422. package/dist/providers/blimu/blimu.context.cjs.map +1 -1
  423. package/dist/providers/blimu/blimu.context.d.ts +4 -4
  424. package/dist/providers/blimu/blimu.context.d.ts.map +1 -1
  425. package/dist/providers/blimu/blimu.context.js +3 -3
  426. package/dist/providers/blimu/blimu.context.js.map +1 -1
  427. package/dist/providers/blimu/blimu.hook.cjs +12 -1
  428. package/dist/providers/blimu/blimu.hook.cjs.map +1 -1
  429. package/dist/providers/blimu/blimu.hook.js +8 -7
  430. package/dist/providers/blimu/blimu.hook.js.map +1 -1
  431. package/dist/providers/blimu/blimu.provider.cjs +71 -1
  432. package/dist/providers/blimu/blimu.provider.cjs.map +1 -1
  433. package/dist/providers/blimu/blimu.provider.d.ts +1 -1
  434. package/dist/providers/blimu/blimu.provider.d.ts.map +1 -1
  435. package/dist/providers/blimu/blimu.provider.js +32 -27
  436. package/dist/providers/blimu/blimu.provider.js.map +1 -1
  437. package/dist/providers/index.cjs +13 -0
  438. package/dist/providers/index.cjs.map +1 -0
  439. package/dist/providers/index.d.ts +3 -3
  440. package/dist/providers/index.d.ts.map +1 -1
  441. package/dist/providers/index.js +13 -0
  442. package/dist/providers/index.js.map +1 -0
  443. package/dist/providers/theme/index.d.ts +2 -2
  444. package/dist/providers/theme/index.d.ts.map +1 -1
  445. package/dist/providers/theme/theme.context.cjs +5 -1
  446. package/dist/providers/theme/theme.context.cjs.map +1 -1
  447. package/dist/providers/theme/theme.context.js +3 -3
  448. package/dist/providers/theme/theme.context.js.map +1 -1
  449. package/dist/providers/theme/theme.hook.cjs +12 -1
  450. package/dist/providers/theme/theme.hook.cjs.map +1 -1
  451. package/dist/providers/theme/theme.hook.js +8 -7
  452. package/dist/providers/theme/theme.hook.js.map +1 -1
  453. package/dist/providers/theme/theme.provider.cjs +104 -1
  454. package/dist/providers/theme/theme.provider.cjs.map +1 -1
  455. package/dist/providers/theme/theme.provider.d.ts.map +1 -1
  456. package/dist/providers/theme/theme.provider.js +85 -48
  457. package/dist/providers/theme/theme.provider.js.map +1 -1
  458. package/dist/styles/styles.css +34 -40
  459. package/dist/styles/tw-styles.css +34 -40
  460. package/dist/tailwind.cjs +200 -0
  461. package/dist/tailwind.cjs.map +1 -0
  462. package/dist/{tailwind.plugin.js → tailwind.js} +43 -43
  463. package/dist/tailwind.js.map +1 -0
  464. package/dist/types/index.cjs +11 -1
  465. package/dist/types/index.cjs.map +1 -1
  466. package/dist/types/index.d.ts +22 -8
  467. package/dist/types/index.d.ts.map +1 -1
  468. package/dist/types/index.js +8 -8
  469. package/dist/types/index.js.map +1 -1
  470. package/dist/utils/publishable-key.cjs +62 -1
  471. package/dist/utils/publishable-key.cjs.map +1 -1
  472. package/dist/utils/publishable-key.js +52 -27
  473. package/dist/utils/publishable-key.js.map +1 -1
  474. package/package.json +68 -53
  475. package/dist/components.cjs +0 -2
  476. package/dist/components.cjs.map +0 -1
  477. package/dist/components.js +0 -13
  478. package/dist/components.js.map +0 -1
  479. package/dist/hooks.cjs +0 -2
  480. package/dist/hooks.cjs.map +0 -1
  481. package/dist/hooks.js +0 -14
  482. package/dist/hooks.js.map +0 -1
  483. package/dist/providers.cjs +0 -2
  484. package/dist/providers.cjs.map +0 -1
  485. package/dist/providers.js +0 -13
  486. package/dist/providers.js.map +0 -1
  487. package/dist/tailwind.plugin.cjs +0 -2
  488. package/dist/tailwind.plugin.cjs.map +0 -1
  489. package/dist/tailwind.plugin.js.map +0 -1
package/README.md CHANGED
@@ -269,7 +269,7 @@ function Component() {
269
269
  isLoading, // Boolean
270
270
  login, // (returnUrl?) => void
271
271
  logout, // () => Promise<void>
272
- getToken, // (options) => Promise<string | null>
272
+ getToken, // (options) => Promise<string | undefined>
273
273
  } = useAuth();
274
274
  }
275
275
  ```
@@ -1,2 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../node_modules/use-sync-external-store/shim/index.cjs");var r=e.__require();exports.shimExports=r;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const index = require("../node_modules/use-sync-external-store/shim/index.cjs");
4
+ var shimExports = index.__require();
5
+ exports.shimExports = shimExports;
2
6
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1,6 +1,6 @@
1
- import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
2
- var i = r();
1
+ import { __require as requireShim } from "../node_modules/use-sync-external-store/shim/index.js";
2
+ var shimExports = requireShim();
3
3
  export {
4
- i as s
4
+ shimExports as s
5
5
  };
6
6
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var shim = { exports: {} };
4
+ exports.__module = shim;
2
5
  //# sourceMappingURL=index2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,5 +1,5 @@
1
- var e = { exports: {} };
1
+ var shim = { exports: {} };
2
2
  export {
3
- e as __module
3
+ shim as __module
4
4
  };
5
5
  //# sourceMappingURL=index2.js.map
@@ -1,2 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var useSyncExternalStoreShim_development = {};
4
+ exports.__exports = useSyncExternalStoreShim_development;
2
5
  //# sourceMappingURL=use-sync-external-store-shim.development.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-sync-external-store-shim.development.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"use-sync-external-store-shim.development.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,5 +1,5 @@
1
- var e = {};
1
+ var useSyncExternalStoreShim_development = {};
2
2
  export {
3
- e as __exports
3
+ useSyncExternalStoreShim_development as __exports
4
4
  };
5
5
  //# sourceMappingURL=use-sync-external-store-shim.development.js.map
@@ -1,2 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var useSyncExternalStoreShim_production = {};
4
+ exports.__exports = useSyncExternalStoreShim_production;
2
5
  //# sourceMappingURL=use-sync-external-store-shim.production.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-sync-external-store-shim.production.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"use-sync-external-store-shim.production.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,5 +1,5 @@
1
- var r = {};
1
+ var useSyncExternalStoreShim_production = {};
2
2
  export {
3
- r as __exports
3
+ useSyncExternalStoreShim_production as __exports
4
4
  };
5
5
  //# sourceMappingURL=use-sync-external-store-shim.production.js.map
@@ -1,2 +1,249 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@blimu/client"),o=require("../node_modules/js-cookie/dist/js.cookie.cjs"),A=require("../node_modules/jwt-decode/build/esm/index.cjs"),a="__bli_session",d="__lh_jwt",c="__lh_jwt",S=10,_=1e3,m=n=>Math.floor(n*_),O=n=>Math.floor(n/_),C=()=>O(Date.now()),T=n=>m(n),P=(n,e)=>{const s=T(n),r=m(e),t=Date.now();return Math.max(s-r-t,0)},u=(n,e)=>{const s=C();return n-e<s};class b{constructor(e,s,r,t,l){this.isLive=e,this.client=s,this.store=r,this.pendingRefresher=null,this.refreshPromise=null,this.refreshingSignals=new Set,this.refreshingSignalAbortController=null,this.localClient=new E.Blimu({baseURL:t,credentials:"include",headers:{"x-blimu-publishable-key":l}}),this.handleRequestError=this.handleRequestError.bind(this)}setCookie(e,s,r={}){const t={secure:this.isLive,sameSite:"lax",path:"/"};r.maxAge!==void 0&&(t.expires=r.maxAge/(1440*60)),o.set(e,s,t)}getSessionPayload(){const e=o.get(a);return e?A.jwtDecode(e):null}async getSessionToken(){const e=this.getSessionPayload();if(e)return this.refreshPromise?(await this.refreshPromise,o.get(a)):(u(e.exp,0)&&await this.refreshSession(),o.get(a))}async handleRequestError(e){return e instanceof E.BlimuError&&[401,500].includes(e.status)?(o.remove(a),o.remove(c),{error:e.message,user:null}):e instanceof DOMException?{error:e.message,user:null}:e instanceof Error?{error:e.message,user:null}:{error:"unknown error",user:null}}async initialize({signal:e}={}){const s=new URL(window.location.href),r=s.searchParams.get(d)??void 0;r&&(s.searchParams.delete(d),window.history.replaceState({},"",s.toString())),r&&this.setCookie(c,r,{maxAge:720*60*60});const t=o.get(c);if(console.log("localhostJWTCookie",t),t&&!o.get(a)){const i=await this.refreshSession({signal:e}).catch(this.handleRequestError);if("error"in i)return i}const l=this.getSessionPayload();if(!l)return{error:null,user:null};if(u(l.exp,S)){const i=await this.refreshSession().catch(this.handleRequestError);if("error"in i)return i}const h=await this.client.auth.getSession().catch(this.handleRequestError);return"error"in h?h:{error:null,user:h.user}}scheduleRefresh(){const e=new AbortController;let s=!0,r=null;const t=()=>{s=!0,this.pendingRefresher&&(this.pendingRefresher(),this.pendingRefresher=null)},l=()=>{s=!1};window.addEventListener("online",t),window.addEventListener("offline",l);const h=()=>{r!==null&&(window.clearTimeout(r),r=null);const i=this.getSessionPayload();if(!i||u(i.exp,0))return;const g=P(i.exp,S);if(g<0)return;const w=async()=>{if(r=null,!s){this.pendingRefresher=w;return}const f=await this.refreshSession({signal:e.signal});if("error"in f){if(f.error==="aborted")return;this.store.setState({status:"error",user:null,error:f.error});return}else h()};r=window.setTimeout(w,g)};return h(),()=>{r&&window.clearTimeout(r),e.abort(),window.removeEventListener("online",t),window.removeEventListener("offline",l)}}async refreshSession({signal:e}={}){if(e&&(this.refreshingSignals.add(e),e.addEventListener("abort",()=>{this.refreshingSignals.delete(e),this.refreshingSignals.size===0&&this.refreshingSignalAbortController?.abort()})),this.refreshPromise)return this.refreshPromise;this.refreshingSignalAbortController=new AbortController,this.refreshingSignalAbortController.signal.addEventListener("abort",()=>{this.refreshPromise=null,this.refreshingSignalAbortController=null,this.refreshingSignals.clear()});const s=this.isLive?void 0:o.get(c),r={};s&&(r.__lh_jwt=s),this.refreshPromise=this.localClient.auth.refresh(r,{signal:this.refreshingSignalAbortController.signal}).then(t=>(this.isLive||this.setCookie(a,t.sessionToken,{maxAge:720*60*60}),t)).catch(this.handleRequestError);try{return await this.refreshPromise}finally{this.refreshPromise=null,this.refreshingSignalAbortController=null,this.refreshingSignals.clear()}}}exports.AuthSessionService=b;exports.LOCALHOST_JWT_COOKIE_NAME=c;exports.LOCALHOST_JWT_URL_PARAM_NAME=d;exports.SESSION_COOKIE_NAME=a;exports.SESSION_EXPIRATION_BUFFER=S;exports.isExpiredIn=u;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const client = require("@blimu/client");
4
+ const js_cookie = require("../node_modules/js-cookie/dist/js.cookie.cjs");
5
+ const index = require("../node_modules/jwt-decode/build/esm/index.cjs");
6
+ const SESSION_COOKIE_NAME = "__bli_session";
7
+ const LOCALHOST_JWT_URL_PARAM_NAME = "__lh_jwt";
8
+ const LOCALHOST_JWT_COOKIE_NAME = "__lh_jwt";
9
+ const SESSION_EXPIRATION_BUFFER = 10;
10
+ const SECONDS_TO_MS = 1e3;
11
+ const secondsToMilliseconds = (seconds) => Math.floor(seconds * SECONDS_TO_MS);
12
+ const millisecondsToSeconds = (ms) => Math.floor(ms / SECONDS_TO_MS);
13
+ const nowInSeconds = () => millisecondsToSeconds(Date.now());
14
+ const jwtExpToMilliseconds = (exp) => secondsToMilliseconds(exp);
15
+ const calculateTimeoutDelay = (expirationSeconds, bufferSeconds) => {
16
+ const expirationMS = jwtExpToMilliseconds(expirationSeconds);
17
+ const bufferMS = secondsToMilliseconds(bufferSeconds);
18
+ const nowMS = Date.now();
19
+ return Math.max(expirationMS - bufferMS - nowMS, 0);
20
+ };
21
+ const isExpiredIn = (expiration, buffer) => {
22
+ const now = nowInSeconds();
23
+ return expiration - buffer < now;
24
+ };
25
+ class AuthSessionService {
26
+ constructor(isLive, client$1, store, baseURL, publishableKey) {
27
+ this.isLive = isLive;
28
+ this.client = client$1;
29
+ this.store = store;
30
+ this.pendingRefresher = null;
31
+ this.refreshPromise = null;
32
+ this.refreshingSignals = /* @__PURE__ */ new Set();
33
+ this.refreshingSignalAbortController = null;
34
+ this.localClient = new client.Blimu({
35
+ baseURL,
36
+ credentials: "include",
37
+ headers: { "x-blimu-publishable-key": publishableKey }
38
+ });
39
+ this.handleRequestError = this.handleRequestError.bind(this);
40
+ }
41
+ /**
42
+ * Set cookie with appropriate security settings based on environment
43
+ */
44
+ setCookie(name, value, options = {}) {
45
+ const cookieOptions = {
46
+ secure: this.isLive,
47
+ // true for live environments, false for localhost
48
+ sameSite: "lax",
49
+ path: "/"
50
+ };
51
+ if (options.maxAge !== void 0) {
52
+ cookieOptions.expires = options.maxAge / (24 * 60 * 60);
53
+ }
54
+ js_cookie.default.set(name, value, cookieOptions);
55
+ }
56
+ getSessionPayload() {
57
+ const token = js_cookie.default.get(SESSION_COOKIE_NAME);
58
+ if (!token) {
59
+ return null;
60
+ }
61
+ const decoded = index.jwtDecode(token);
62
+ return decoded;
63
+ }
64
+ async getSessionToken() {
65
+ const sessionPayload = this.getSessionPayload();
66
+ if (!sessionPayload) {
67
+ return void 0;
68
+ }
69
+ if (this.refreshPromise) {
70
+ await this.refreshPromise;
71
+ return js_cookie.default.get(SESSION_COOKIE_NAME);
72
+ }
73
+ if (isExpiredIn(sessionPayload.exp, 0)) {
74
+ await this.refreshSession();
75
+ }
76
+ return js_cookie.default.get(SESSION_COOKIE_NAME);
77
+ }
78
+ async handleRequestError(error) {
79
+ if (error instanceof client.BlimuError && [401, 500].includes(error.status)) {
80
+ js_cookie.default.remove(SESSION_COOKIE_NAME);
81
+ js_cookie.default.remove(LOCALHOST_JWT_COOKIE_NAME);
82
+ return {
83
+ error: error.message,
84
+ user: null
85
+ };
86
+ }
87
+ if (error instanceof DOMException)
88
+ return {
89
+ error: error.message,
90
+ user: null
91
+ };
92
+ if (error instanceof Error) {
93
+ return {
94
+ error: error.message,
95
+ user: null
96
+ };
97
+ }
98
+ return {
99
+ error: "unknown error",
100
+ user: null
101
+ };
102
+ }
103
+ async initialize({ signal } = {}) {
104
+ const url = new URL(window.location.href);
105
+ const localhostJWT = url.searchParams.get(LOCALHOST_JWT_URL_PARAM_NAME) ?? void 0;
106
+ if (localhostJWT) {
107
+ url.searchParams.delete(LOCALHOST_JWT_URL_PARAM_NAME);
108
+ window.history.replaceState({}, "", url.toString());
109
+ }
110
+ if (localhostJWT) {
111
+ this.setCookie(LOCALHOST_JWT_COOKIE_NAME, localhostJWT, {
112
+ maxAge: 30 * 24 * 60 * 60
113
+ // 30 days
114
+ });
115
+ }
116
+ const localhostJWTCookie = js_cookie.default.get(LOCALHOST_JWT_COOKIE_NAME);
117
+ if (localhostJWTCookie && !js_cookie.default.get(SESSION_COOKIE_NAME)) {
118
+ const result2 = await this.refreshSession({ signal }).catch(this.handleRequestError);
119
+ if ("error" in result2) return result2;
120
+ }
121
+ const sessionPayload = this.getSessionPayload();
122
+ if (!sessionPayload) {
123
+ return {
124
+ error: null,
125
+ user: null
126
+ };
127
+ }
128
+ if (isExpiredIn(sessionPayload.exp, SESSION_EXPIRATION_BUFFER)) {
129
+ const result2 = await this.refreshSession().catch(this.handleRequestError);
130
+ if ("error" in result2) return result2;
131
+ }
132
+ const result = await this.client.auth.getSession().catch(this.handleRequestError);
133
+ if ("error" in result) return result;
134
+ return {
135
+ error: null,
136
+ user: result.user
137
+ };
138
+ }
139
+ scheduleRefresh() {
140
+ const abortController = new AbortController();
141
+ let isOnline = true;
142
+ let timeoutId = null;
143
+ const onlineHandler = () => {
144
+ isOnline = true;
145
+ if (this.pendingRefresher) {
146
+ this.pendingRefresher();
147
+ this.pendingRefresher = null;
148
+ }
149
+ };
150
+ const offlineHandler = () => {
151
+ isOnline = false;
152
+ };
153
+ window.addEventListener("online", onlineHandler);
154
+ window.addEventListener("offline", offlineHandler);
155
+ const refresh = () => {
156
+ if (timeoutId !== null) {
157
+ window.clearTimeout(timeoutId);
158
+ timeoutId = null;
159
+ }
160
+ const sessionPayload = this.getSessionPayload();
161
+ if (!sessionPayload || isExpiredIn(sessionPayload.exp, 0)) return;
162
+ const timeoutDelayMS = calculateTimeoutDelay(sessionPayload.exp, SESSION_EXPIRATION_BUFFER);
163
+ if (timeoutDelayMS < 0) {
164
+ return;
165
+ }
166
+ const refresher = async () => {
167
+ timeoutId = null;
168
+ if (!isOnline) {
169
+ this.pendingRefresher = refresher;
170
+ return;
171
+ }
172
+ const result = await this.refreshSession({ signal: abortController.signal });
173
+ if ("error" in result) {
174
+ if (result.error === "aborted") {
175
+ return;
176
+ }
177
+ this.store.setState({
178
+ status: "error",
179
+ user: null,
180
+ error: result.error
181
+ });
182
+ return;
183
+ } else {
184
+ refresh();
185
+ }
186
+ };
187
+ timeoutId = window.setTimeout(refresher, timeoutDelayMS);
188
+ };
189
+ refresh();
190
+ return () => {
191
+ if (timeoutId) {
192
+ window.clearTimeout(timeoutId);
193
+ }
194
+ abortController.abort();
195
+ window.removeEventListener("online", onlineHandler);
196
+ window.removeEventListener("offline", offlineHandler);
197
+ };
198
+ }
199
+ async refreshSession({ signal } = {}) {
200
+ if (signal) {
201
+ this.refreshingSignals.add(signal);
202
+ signal.addEventListener("abort", () => {
203
+ this.refreshingSignals.delete(signal);
204
+ if (this.refreshingSignals.size === 0) {
205
+ this.refreshingSignalAbortController?.abort();
206
+ }
207
+ });
208
+ }
209
+ if (this.refreshPromise) {
210
+ return this.refreshPromise;
211
+ }
212
+ this.refreshingSignalAbortController = new AbortController();
213
+ this.refreshingSignalAbortController.signal.addEventListener("abort", () => {
214
+ this.refreshPromise = null;
215
+ this.refreshingSignalAbortController = null;
216
+ this.refreshingSignals.clear();
217
+ });
218
+ const localhostJWT = !this.isLive ? js_cookie.default.get(LOCALHOST_JWT_COOKIE_NAME) : void 0;
219
+ const queryParams = {};
220
+ if (localhostJWT) {
221
+ queryParams.__lh_jwt = localhostJWT;
222
+ }
223
+ this.refreshPromise = this.localClient.auth.refresh(queryParams, {
224
+ signal: this.refreshingSignalAbortController.signal
225
+ }).then((response) => {
226
+ if (!this.isLive) {
227
+ this.setCookie(SESSION_COOKIE_NAME, response.sessionToken, {
228
+ maxAge: 30 * 24 * 60 * 60
229
+ // 30 days
230
+ });
231
+ }
232
+ return response;
233
+ }).catch(this.handleRequestError);
234
+ try {
235
+ return await this.refreshPromise;
236
+ } finally {
237
+ this.refreshPromise = null;
238
+ this.refreshingSignalAbortController = null;
239
+ this.refreshingSignals.clear();
240
+ }
241
+ }
242
+ }
243
+ exports.AuthSessionService = AuthSessionService;
244
+ exports.LOCALHOST_JWT_COOKIE_NAME = LOCALHOST_JWT_COOKIE_NAME;
245
+ exports.LOCALHOST_JWT_URL_PARAM_NAME = LOCALHOST_JWT_URL_PARAM_NAME;
246
+ exports.SESSION_COOKIE_NAME = SESSION_COOKIE_NAME;
247
+ exports.SESSION_EXPIRATION_BUFFER = SESSION_EXPIRATION_BUFFER;
248
+ exports.isExpiredIn = isExpiredIn;
2
249
  //# sourceMappingURL=auth.service.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.service.cjs","sources":["../../src/client/auth.service.ts"],"sourcesContent":["import { Blimu, BlimuError } from '@blimu/client';\nimport type { RefreshResponse } from '@blimu/client/schema';\nimport Cookies from 'js-cookie';\nimport { jwtDecode } from 'jwt-decode';\n\nimport type { AuthState, User } from '../types';\nimport { ExternalStore } from './external-store';\n\nexport const SESSION_COOKIE_NAME = '__bli_session';\nexport const LOCALHOST_JWT_URL_PARAM_NAME = '__lh_jwt';\nexport const LOCALHOST_JWT_COOKIE_NAME = '__lh_jwt';\nexport const SESSION_EXPIRATION_BUFFER = 10;\n\n/**\n * Time conversion utilities\n * JWT tokens use seconds (Unix timestamp), JavaScript Date uses milliseconds\n */\nconst SECONDS_TO_MS = 1000;\n\n/**\n * Convert seconds to milliseconds\n */\nconst secondsToMilliseconds = (seconds: number): number => Math.floor(seconds * SECONDS_TO_MS);\n\n/**\n * Convert milliseconds to seconds\n */\nconst millisecondsToSeconds = (ms: number): number => Math.floor(ms / SECONDS_TO_MS);\n\n/**\n * Get current time in seconds (Unix timestamp)\n */\nconst nowInSeconds = (): number => millisecondsToSeconds(Date.now());\n\n/**\n * Convert JWT expiration time (seconds) to milliseconds\n */\nconst jwtExpToMilliseconds = (exp: number): number => secondsToMilliseconds(exp);\n\n/**\n * Calculate timeout delay in milliseconds for refreshing before expiration\n * @param expirationSeconds - JWT exp claim in seconds\n * @param bufferSeconds - Buffer time in seconds before expiration\n * @returns Timeout delay in milliseconds\n */\nconst calculateTimeoutDelay = (expirationSeconds: number, bufferSeconds: number): number => {\n const expirationMS = jwtExpToMilliseconds(expirationSeconds);\n const bufferMS = secondsToMilliseconds(bufferSeconds);\n const nowMS = Date.now();\n return Math.max(expirationMS - bufferMS - nowMS, 0);\n};\n\n/**\n * Check if a JWT expiration time (in seconds) is expired or will expire within the buffer\n * @param expiration - JWT exp claim in seconds (Unix timestamp)\n * @param buffer - Buffer time in seconds before expiration to consider it expired\n * @returns true if expired or will expire within buffer\n */\nexport const isExpiredIn = (expiration: number, buffer: number): boolean => {\n const now = nowInSeconds();\n return expiration - buffer < now;\n};\n\nexport class AuthSessionService {\n private pendingRefresher: (() => void) | null = null;\n private refreshPromise: Promise<RefreshResponse | { error: string; user: null }> | null = null;\n private refreshingSignals: Set<AbortSignal> = new Set();\n private refreshingSignalAbortController: AbortController | null = null;\n // A local client that doesn't call getSessionToken() which calls refreshSession().\n private localClient: Blimu;\n\n constructor(\n private readonly isLive: boolean,\n private readonly client: Blimu,\n private readonly store: ExternalStore<AuthState>,\n baseURL: string,\n publishableKey: string,\n ) {\n this.localClient = new Blimu({\n baseURL,\n credentials: 'include',\n headers: { 'x-blimu-publishable-key': publishableKey },\n });\n this.handleRequestError = this.handleRequestError.bind(this);\n }\n\n /**\n * Set cookie with appropriate security settings based on environment\n */\n private setCookie(name: string, value: string, options: { maxAge?: number } = {}): void {\n const cookieOptions: Cookies.CookieAttributes = {\n secure: this.isLive, // true for live environments, false for localhost\n sameSite: 'lax',\n path: '/',\n };\n\n if (options.maxAge !== undefined) {\n cookieOptions.expires = options.maxAge / (24 * 60 * 60); // Convert seconds to days\n }\n\n Cookies.set(name, value, cookieOptions);\n }\n\n getSessionPayload(): {\n sub: string;\n environmentId: string;\n type: string;\n iat: number;\n exp: number;\n } | null {\n const token = Cookies.get(SESSION_COOKIE_NAME);\n\n if (!token) {\n return null;\n }\n\n const decoded = jwtDecode<{\n sub: string;\n environmentId: string;\n type: string;\n iat: number;\n exp: number;\n }>(token);\n\n return decoded;\n }\n\n async getSessionToken(): Promise<string | undefined> {\n const sessionPayload = this.getSessionPayload();\n\n if (!sessionPayload) {\n return undefined;\n }\n\n // If a refresh is already in progress, wait for it to complete\n // This prevents infinite recursion when refreshSession() calls client.auth.refresh()\n // which triggers accessToken() which calls getSessionToken()\n if (this.refreshPromise) {\n await this.refreshPromise;\n // After refresh completes, return the updated token from cookie\n return Cookies.get(SESSION_COOKIE_NAME);\n }\n\n if (isExpiredIn(sessionPayload.exp, 0)) {\n await this.refreshSession();\n }\n\n return Cookies.get(SESSION_COOKIE_NAME);\n }\n\n async handleRequestError(error: unknown): Promise<{ error: string; user: null }> {\n if (error instanceof BlimuError && [401, 500].includes(error.status)) {\n Cookies.remove(SESSION_COOKIE_NAME);\n Cookies.remove(LOCALHOST_JWT_COOKIE_NAME);\n\n return {\n error: error.message,\n user: null,\n };\n }\n\n if (error instanceof DOMException)\n return {\n error: error.message,\n user: null,\n };\n\n if (error instanceof Error) {\n return {\n error: error.message,\n user: null,\n };\n }\n\n return {\n error: 'unknown error',\n user: null,\n };\n }\n\n async initialize({ signal }: { signal?: AbortSignal } = {}): Promise<{\n error: string | null;\n user: User | null;\n }> {\n const url = new URL(window.location.href);\n const localhostJWT = url.searchParams.get(LOCALHOST_JWT_URL_PARAM_NAME) ?? undefined;\n\n // Clean up URL parameters immediately to prevent re-processing on re-renders\n if (localhostJWT) {\n url.searchParams.delete(LOCALHOST_JWT_URL_PARAM_NAME);\n window.history.replaceState({}, '', url.toString());\n }\n\n // Handle localhost JWT from URL parameter\n if (localhostJWT) {\n // Set localhost JWT cookie on customer app domain\n this.setCookie(LOCALHOST_JWT_COOKIE_NAME, localhostJWT, {\n maxAge: 30 * 24 * 60 * 60, // 30 days\n });\n }\n\n const localhostJWTCookie = Cookies.get(LOCALHOST_JWT_COOKIE_NAME);\n\n console.log('localhostJWTCookie', localhostJWTCookie);\n\n if (localhostJWTCookie && !Cookies.get(SESSION_COOKIE_NAME)) {\n const result = await this.refreshSession({ signal }).catch(this.handleRequestError);\n if ('error' in result) return result;\n }\n\n const sessionPayload = this.getSessionPayload();\n\n if (!sessionPayload) {\n return {\n error: null,\n user: null,\n };\n }\n\n if (isExpiredIn(sessionPayload.exp, SESSION_EXPIRATION_BUFFER)) {\n const result = await this.refreshSession().catch(this.handleRequestError);\n if ('error' in result) return result;\n }\n\n const result = await this.client.auth.getSession().catch(this.handleRequestError);\n if ('error' in result) return result;\n\n return {\n error: null,\n user: result.user,\n };\n }\n\n scheduleRefresh() {\n const abortController = new AbortController();\n let isOnline = true;\n let timeoutId: number | null = null;\n\n const onlineHandler = () => {\n isOnline = true;\n if (this.pendingRefresher) {\n this.pendingRefresher();\n this.pendingRefresher = null;\n }\n };\n const offlineHandler = () => {\n isOnline = false;\n };\n\n window.addEventListener('online', onlineHandler);\n window.addEventListener('offline', offlineHandler);\n\n const refresh = () => {\n // Clear any existing timeout before scheduling a new one\n // This prevents infinite loops when refresh() is called recursively\n if (timeoutId !== null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n const sessionPayload = this.getSessionPayload();\n\n if (!sessionPayload || isExpiredIn(sessionPayload.exp, 0)) return;\n\n // Calculate timeout delay: refresh SESSION_EXPIRATION_BUFFER seconds before expiration\n const timeoutDelayMS = calculateTimeoutDelay(sessionPayload.exp, SESSION_EXPIRATION_BUFFER);\n\n // Prevent scheduling if timeout is negative (token already expired)\n // Allow 0ms delays to handle edge cases where we're exactly at the refresh point\n // This prevents immediate re-scheduling that could cause infinite loops\n if (timeoutDelayMS < 0) {\n return;\n }\n\n // Having this function outside timeout, allows us to call refresh immediately when back online\n const refresher = async () => {\n // Clear timeoutId since we're executing now\n timeoutId = null;\n\n if (!isOnline) {\n // Keep closure of refresh function alive\n this.pendingRefresher = refresher;\n return;\n }\n\n const result = await this.refreshSession({ signal: abortController.signal });\n\n if ('error' in result) {\n // If the refresh was aborted (e.g., due to React strict mode unmounting),\n // don't treat it as an error - just return and let the component remount handle it\n if (result.error === 'aborted') {\n return;\n }\n // For real errors, update the store\n this.store.setState({\n status: 'error',\n user: null,\n error: result.error,\n });\n return;\n } else {\n // After successful refresh, schedule the next refresh with the new token\n refresh();\n }\n };\n\n timeoutId = window.setTimeout(refresher, timeoutDelayMS);\n };\n\n refresh();\n\n return () => {\n if (timeoutId) {\n window.clearTimeout(timeoutId);\n }\n abortController.abort();\n window.removeEventListener('online', onlineHandler);\n window.removeEventListener('offline', offlineHandler);\n };\n }\n\n private async refreshSession({ signal }: { signal?: AbortSignal } = {}) {\n if (signal) {\n // Add signal to tracking set (was using .has() instead of .add() - bug fix)\n this.refreshingSignals.add(signal);\n\n signal.addEventListener('abort', () => {\n this.refreshingSignals.delete(signal);\n\n if (this.refreshingSignals.size === 0) {\n this.refreshingSignalAbortController?.abort();\n }\n });\n }\n\n if (this.refreshPromise) {\n return this.refreshPromise;\n }\n\n this.refreshingSignalAbortController = new AbortController();\n\n this.refreshingSignalAbortController.signal.addEventListener('abort', () => {\n this.refreshPromise = null;\n this.refreshingSignalAbortController = null;\n this.refreshingSignals.clear();\n });\n\n // Get localhost_jwt from cookie to send as query parameter (only for non-live environments)\n const localhostJWT = !this.isLive ? Cookies.get(LOCALHOST_JWT_COOKIE_NAME) : undefined;\n\n // Build query parameters - only include __lh_jwt for non-live environments when cookie exists\n const queryParams: { __lh_jwt?: string } = {};\n if (localhostJWT) {\n queryParams.__lh_jwt = localhostJWT;\n }\n\n // Use local client to avoid infinite recursion. Regular client calls getSessionToken() which calls refreshSession().\n // There are hacks to avoid infinite recursion, but they are not reliable.\n // The localhost_jwt is sent as a query parameter only in non-live environments\n // Note: Type assertion needed because the generated SDK type doesn't include 'query' in RequestInit,\n // but the underlying CoreClient.request() method does support it\n this.refreshPromise = this.localClient.auth\n .refresh(queryParams, {\n signal: this.refreshingSignalAbortController.signal,\n })\n .then((response) => {\n // Update cookie with new session token from response body\n // Server also sets it via Set-Cookie header on auth domain, but we set it manually on customer domain\n if (!this.isLive) {\n this.setCookie(SESSION_COOKIE_NAME, response.sessionToken, {\n maxAge: 30 * 24 * 60 * 60, // 30 days\n });\n }\n return response;\n })\n .catch(this.handleRequestError);\n\n try {\n return await this.refreshPromise;\n } finally {\n this.refreshPromise = null;\n this.refreshingSignalAbortController = null;\n this.refreshingSignals.clear();\n }\n }\n}\n"],"names":["SESSION_COOKIE_NAME","LOCALHOST_JWT_URL_PARAM_NAME","LOCALHOST_JWT_COOKIE_NAME","SESSION_EXPIRATION_BUFFER","SECONDS_TO_MS","secondsToMilliseconds","seconds","millisecondsToSeconds","ms","nowInSeconds","jwtExpToMilliseconds","exp","calculateTimeoutDelay","expirationSeconds","bufferSeconds","expirationMS","bufferMS","nowMS","isExpiredIn","expiration","buffer","now","AuthSessionService","isLive","client","store","baseURL","publishableKey","Blimu","name","value","options","cookieOptions","Cookies","token","jwtDecode","sessionPayload","error","BlimuError","signal","url","localhostJWT","localhostJWTCookie","result","abortController","isOnline","timeoutId","onlineHandler","offlineHandler","refresh","timeoutDelayMS","refresher","queryParams","response"],"mappings":"uOAQaA,EAAsB,gBACtBC,EAA+B,WAC/BC,EAA4B,WAC5BC,EAA4B,GAMnCC,EAAgB,IAKhBC,EAAyBC,GAA4B,KAAK,MAAMA,EAAUF,CAAa,EAKvFG,EAAyBC,GAAuB,KAAK,MAAMA,EAAKJ,CAAa,EAK7EK,EAAe,IAAcF,EAAsB,KAAK,KAAK,EAK7DG,EAAwBC,GAAwBN,EAAsBM,CAAG,EAQzEC,EAAwB,CAACC,EAA2BC,IAAkC,CAC1F,MAAMC,EAAeL,EAAqBG,CAAiB,EACrDG,EAAWX,EAAsBS,CAAa,EAC9CG,EAAQ,KAAK,IAAA,EACnB,OAAO,KAAK,IAAIF,EAAeC,EAAWC,EAAO,CAAC,CACpD,EAQaC,EAAc,CAACC,EAAoBC,IAA4B,CAC1E,MAAMC,EAAMZ,EAAA,EACZ,OAAOU,EAAaC,EAASC,CAC/B,EAEO,MAAMC,CAAmB,CAQ9B,YACmBC,EACAC,EACAC,EACjBC,EACAC,EACA,CALiB,KAAA,OAAAJ,EACA,KAAA,OAAAC,EACA,KAAA,MAAAC,EAVnB,KAAQ,iBAAwC,KAChD,KAAQ,eAAkF,KAC1F,KAAQ,sBAA0C,IAClD,KAAQ,gCAA0D,KAWhE,KAAK,YAAc,IAAIG,QAAM,CAC3B,QAAAF,EACA,YAAa,UACb,QAAS,CAAE,0BAA2BC,CAAA,CAAe,CACtD,EACD,KAAK,mBAAqB,KAAK,mBAAmB,KAAK,IAAI,CAC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,IAAU,GAAK,EAAA,CACxB,EAEIA,EACR,EACA,MAAM,KAAK,kBAAkB,EAEhC,GAAI,CACF,OAAO,MAAM,KAAK,cACpB,QAAA,CACE,KAAK,eAAiB,KACtB,KAAK,gCAAkC,KACvC,KAAK,kBAAkB,MAAA,CACzB,CACF,CACF"}
1
+ {"version":3,"file":"auth.service.cjs","sources":["../../src/client/auth.service.ts"],"sourcesContent":["import { Blimu, BlimuError } from '@blimu/client';\nimport type { RefreshResponse } from '@blimu/client/schema';\nimport Cookies from 'js-cookie';\nimport { jwtDecode } from 'jwt-decode';\n\nimport type { AuthState, User } from '../types';\nimport { ExternalStore } from './external-store';\n\nexport const SESSION_COOKIE_NAME = '__bli_session';\nexport const LOCALHOST_JWT_URL_PARAM_NAME = '__lh_jwt';\nexport const LOCALHOST_JWT_COOKIE_NAME = '__lh_jwt';\nexport const SESSION_EXPIRATION_BUFFER = 10;\n\n/**\n * Time conversion utilities\n * JWT tokens use seconds (Unix timestamp), JavaScript Date uses milliseconds\n */\nconst SECONDS_TO_MS = 1000;\n\n/**\n * Convert seconds to milliseconds\n */\nconst secondsToMilliseconds = (seconds: number): number => Math.floor(seconds * SECONDS_TO_MS);\n\n/**\n * Convert milliseconds to seconds\n */\nconst millisecondsToSeconds = (ms: number): number => Math.floor(ms / SECONDS_TO_MS);\n\n/**\n * Get current time in seconds (Unix timestamp)\n */\nconst nowInSeconds = (): number => millisecondsToSeconds(Date.now());\n\n/**\n * Convert JWT expiration time (seconds) to milliseconds\n */\nconst jwtExpToMilliseconds = (exp: number): number => secondsToMilliseconds(exp);\n\n/**\n * Calculate timeout delay in milliseconds for refreshing before expiration\n * @param expirationSeconds - JWT exp claim in seconds\n * @param bufferSeconds - Buffer time in seconds before expiration\n * @returns Timeout delay in milliseconds\n */\nconst calculateTimeoutDelay = (expirationSeconds: number, bufferSeconds: number): number => {\n const expirationMS = jwtExpToMilliseconds(expirationSeconds);\n const bufferMS = secondsToMilliseconds(bufferSeconds);\n const nowMS = Date.now();\n return Math.max(expirationMS - bufferMS - nowMS, 0);\n};\n\n/**\n * Check if a JWT expiration time (in seconds) is expired or will expire within the buffer\n * @param expiration - JWT exp claim in seconds (Unix timestamp)\n * @param buffer - Buffer time in seconds before expiration to consider it expired\n * @returns true if expired or will expire within buffer\n */\nexport const isExpiredIn = (expiration: number, buffer: number): boolean => {\n const now = nowInSeconds();\n return expiration - buffer < now;\n};\n\nexport class AuthSessionService {\n private pendingRefresher: (() => void) | null = null;\n private refreshPromise: Promise<RefreshResponse | { error: string; user: null }> | null = null;\n private refreshingSignals: Set<AbortSignal> = new Set();\n private refreshingSignalAbortController: AbortController | null = null;\n // A local client that doesn't call getSessionToken() which calls refreshSession().\n private localClient: Blimu;\n\n constructor(\n private readonly isLive: boolean,\n private readonly client: Blimu,\n private readonly store: ExternalStore<AuthState>,\n baseURL: string,\n publishableKey: string,\n ) {\n this.localClient = new Blimu({\n baseURL,\n credentials: 'include',\n headers: { 'x-blimu-publishable-key': publishableKey },\n });\n this.handleRequestError = this.handleRequestError.bind(this);\n }\n\n /**\n * Set cookie with appropriate security settings based on environment\n */\n private setCookie(name: string, value: string, options: { maxAge?: number } = {}): void {\n const cookieOptions: Cookies.CookieAttributes = {\n secure: this.isLive, // true for live environments, false for localhost\n sameSite: 'lax',\n path: '/',\n };\n\n if (options.maxAge !== undefined) {\n cookieOptions.expires = options.maxAge / (24 * 60 * 60); // Convert seconds to days\n }\n\n Cookies.set(name, value, cookieOptions);\n }\n\n getSessionPayload(): {\n sub: string;\n environmentId: string;\n type: string;\n iat: number;\n exp: number;\n } | null {\n const token = Cookies.get(SESSION_COOKIE_NAME);\n\n if (!token) {\n return null;\n }\n\n const decoded = jwtDecode<{\n sub: string;\n environmentId: string;\n type: string;\n iat: number;\n exp: number;\n }>(token);\n\n return decoded;\n }\n\n async getSessionToken(): Promise<string | undefined> {\n const sessionPayload = this.getSessionPayload();\n\n if (!sessionPayload) {\n return undefined;\n }\n\n // If a refresh is already in progress, wait for it to complete\n // This prevents infinite recursion when refreshSession() calls client.auth.refresh()\n // which triggers accessToken() which calls getSessionToken()\n if (this.refreshPromise) {\n await this.refreshPromise;\n // After refresh completes, return the updated token from cookie\n return Cookies.get(SESSION_COOKIE_NAME);\n }\n\n if (isExpiredIn(sessionPayload.exp, 0)) {\n await this.refreshSession();\n }\n\n return Cookies.get(SESSION_COOKIE_NAME);\n }\n\n async handleRequestError(error: unknown): Promise<{ error: string; user: null }> {\n if (error instanceof BlimuError && [401, 500].includes(error.status)) {\n Cookies.remove(SESSION_COOKIE_NAME);\n Cookies.remove(LOCALHOST_JWT_COOKIE_NAME);\n\n return {\n error: error.message,\n user: null,\n };\n }\n\n if (error instanceof DOMException)\n return {\n error: error.message,\n user: null,\n };\n\n if (error instanceof Error) {\n return {\n error: error.message,\n user: null,\n };\n }\n\n return {\n error: 'unknown error',\n user: null,\n };\n }\n\n async initialize({ signal }: { signal?: AbortSignal } = {}): Promise<{\n error: string | null;\n user: User | null;\n }> {\n const url = new URL(window.location.href);\n const localhostJWT = url.searchParams.get(LOCALHOST_JWT_URL_PARAM_NAME) ?? undefined;\n\n // Clean up URL parameters immediately to prevent re-processing on re-renders\n if (localhostJWT) {\n url.searchParams.delete(LOCALHOST_JWT_URL_PARAM_NAME);\n window.history.replaceState({}, '', url.toString());\n }\n\n // Handle localhost JWT from URL parameter\n if (localhostJWT) {\n // Set localhost JWT cookie on customer app domain\n this.setCookie(LOCALHOST_JWT_COOKIE_NAME, localhostJWT, {\n maxAge: 30 * 24 * 60 * 60, // 30 days\n });\n }\n\n const localhostJWTCookie = Cookies.get(LOCALHOST_JWT_COOKIE_NAME);\n\n if (localhostJWTCookie && !Cookies.get(SESSION_COOKIE_NAME)) {\n const result = await this.refreshSession({ signal }).catch(this.handleRequestError);\n if ('error' in result) return result;\n }\n\n const sessionPayload = this.getSessionPayload();\n\n if (!sessionPayload) {\n return {\n error: null,\n user: null,\n };\n }\n\n if (isExpiredIn(sessionPayload.exp, SESSION_EXPIRATION_BUFFER)) {\n const result = await this.refreshSession().catch(this.handleRequestError);\n if ('error' in result) return result;\n }\n\n const result = await this.client.auth.getSession().catch(this.handleRequestError);\n if ('error' in result) return result;\n\n return {\n error: null,\n user: result.user,\n };\n }\n\n scheduleRefresh() {\n const abortController = new AbortController();\n let isOnline = true;\n let timeoutId: number | null = null;\n\n const onlineHandler = () => {\n isOnline = true;\n if (this.pendingRefresher) {\n this.pendingRefresher();\n this.pendingRefresher = null;\n }\n };\n const offlineHandler = () => {\n isOnline = false;\n };\n\n window.addEventListener('online', onlineHandler);\n window.addEventListener('offline', offlineHandler);\n\n const refresh = () => {\n // Clear any existing timeout before scheduling a new one\n // This prevents infinite loops when refresh() is called recursively\n if (timeoutId !== null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n const sessionPayload = this.getSessionPayload();\n\n if (!sessionPayload || isExpiredIn(sessionPayload.exp, 0)) return;\n\n // Calculate timeout delay: refresh SESSION_EXPIRATION_BUFFER seconds before expiration\n const timeoutDelayMS = calculateTimeoutDelay(sessionPayload.exp, SESSION_EXPIRATION_BUFFER);\n\n // Prevent scheduling if timeout is negative (token already expired)\n // Allow 0ms delays to handle edge cases where we're exactly at the refresh point\n // This prevents immediate re-scheduling that could cause infinite loops\n if (timeoutDelayMS < 0) {\n return;\n }\n\n // Having this function outside timeout, allows us to call refresh immediately when back online\n const refresher = async () => {\n // Clear timeoutId since we're executing now\n timeoutId = null;\n\n if (!isOnline) {\n // Keep closure of refresh function alive\n this.pendingRefresher = refresher;\n return;\n }\n\n const result = await this.refreshSession({ signal: abortController.signal });\n\n if ('error' in result) {\n // If the refresh was aborted (e.g., due to React strict mode unmounting),\n // don't treat it as an error - just return and let the component remount handle it\n if (result.error === 'aborted') {\n return;\n }\n // For real errors, update the store\n this.store.setState({\n status: 'error',\n user: null,\n error: result.error,\n });\n return;\n } else {\n // After successful refresh, schedule the next refresh with the new token\n refresh();\n }\n };\n\n timeoutId = window.setTimeout(refresher, timeoutDelayMS);\n };\n\n refresh();\n\n return () => {\n if (timeoutId) {\n window.clearTimeout(timeoutId);\n }\n abortController.abort();\n window.removeEventListener('online', onlineHandler);\n window.removeEventListener('offline', offlineHandler);\n };\n }\n\n private async refreshSession({ signal }: { signal?: AbortSignal | undefined } = {}) {\n if (signal) {\n // Add signal to tracking set (was using .has() instead of .add() - bug fix)\n this.refreshingSignals.add(signal);\n\n signal.addEventListener('abort', () => {\n this.refreshingSignals.delete(signal);\n\n if (this.refreshingSignals.size === 0) {\n this.refreshingSignalAbortController?.abort();\n }\n });\n }\n\n if (this.refreshPromise) {\n return this.refreshPromise;\n }\n\n this.refreshingSignalAbortController = new AbortController();\n\n this.refreshingSignalAbortController.signal.addEventListener('abort', () => {\n this.refreshPromise = null;\n this.refreshingSignalAbortController = null;\n this.refreshingSignals.clear();\n });\n\n // Get localhost_jwt from cookie to send as query parameter (only for non-live environments)\n const localhostJWT = !this.isLive ? Cookies.get(LOCALHOST_JWT_COOKIE_NAME) : undefined;\n\n // Build query parameters - only include __lh_jwt for non-live environments when cookie exists\n const queryParams: { __lh_jwt?: string } = {};\n if (localhostJWT) {\n queryParams.__lh_jwt = localhostJWT;\n }\n\n // Use local client to avoid infinite recursion. Regular client calls getSessionToken() which calls refreshSession().\n // There are hacks to avoid infinite recursion, but they are not reliable.\n // The localhost_jwt is sent as a query parameter only in non-live environments\n // Note: Type assertion needed because the generated SDK type doesn't include 'query' in RequestInit,\n // but the underlying CoreClient.request() method does support it\n this.refreshPromise = this.localClient.auth\n .refresh(queryParams, {\n signal: this.refreshingSignalAbortController.signal,\n })\n .then((response) => {\n // Update cookie with new session token from response body\n // Server also sets it via Set-Cookie header on auth domain, but we set it manually on customer domain\n if (!this.isLive) {\n this.setCookie(SESSION_COOKIE_NAME, response.sessionToken, {\n maxAge: 30 * 24 * 60 * 60, // 30 days\n });\n }\n return response;\n })\n .catch(this.handleRequestError);\n\n try {\n return await this.refreshPromise;\n } finally {\n this.refreshPromise = null;\n this.refreshingSignalA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