@multiplatform.one/keycloak 0.1.10 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/esm/Authenticated.mjs +25 -0
  2. package/dist/esm/Authenticated.mjs.map +7 -0
  3. package/dist/esm/authConfig.mjs +10 -0
  4. package/dist/esm/authConfig.mjs.map +7 -0
  5. package/dist/esm/hooks/index.mjs +4 -0
  6. package/dist/esm/hooks/index.mjs.map +7 -0
  7. package/dist/esm/hooks/useAuthConfig.mjs +9 -0
  8. package/dist/esm/hooks/useAuthConfig.mjs.map +7 -0
  9. package/dist/esm/hooks/useCurrentRouteName/index.mjs +17 -0
  10. package/dist/esm/hooks/useCurrentRouteName/index.mjs.map +7 -0
  11. package/dist/esm/hooks/useCurrentRouteName/index.native.mjs +12 -0
  12. package/dist/esm/hooks/useCurrentRouteName/index.native.mjs.map +7 -0
  13. package/dist/esm/hooks/useKeycloak/index.mjs +2 -0
  14. package/dist/esm/hooks/useKeycloak/index.mjs.map +7 -0
  15. package/dist/esm/hooks/useKeycloak/useKeycloak.mjs +81 -0
  16. package/dist/esm/hooks/useKeycloak/useKeycloak.mjs.map +7 -0
  17. package/dist/esm/hooks/useKeycloak/useKeycloak.native.mjs +108 -0
  18. package/dist/esm/hooks/useKeycloak/useKeycloak.native.mjs.map +7 -0
  19. package/dist/esm/hooks/useLogin.mjs +35 -0
  20. package/dist/esm/hooks/useLogin.mjs.map +7 -0
  21. package/dist/esm/index.mjs +5 -0
  22. package/dist/esm/index.mjs.map +7 -0
  23. package/dist/esm/provider/afterAuth.mjs +29 -0
  24. package/dist/esm/provider/afterAuth.mjs.map +7 -0
  25. package/dist/esm/provider/index.mjs +73 -0
  26. package/dist/esm/provider/index.mjs.map +7 -0
  27. package/dist/esm/provider/keycloakProvider.mjs +273 -0
  28. package/dist/esm/provider/keycloakProvider.mjs.map +7 -0
  29. package/dist/esm/provider/keycloakProvider.native.mjs +69 -0
  30. package/dist/esm/provider/keycloakProvider.native.mjs.map +7 -0
  31. package/dist/esm/state/index.mjs +14 -0
  32. package/dist/esm/state/index.mjs.map +7 -0
  33. package/dist/esm/types.mjs +5 -0
  34. package/dist/esm/types.mjs.map +7 -0
  35. package/dist/jsx/Authenticated.mjs +20 -0
  36. package/dist/jsx/Authenticated.mjs.map +7 -0
  37. package/dist/jsx/authConfig.mjs +10 -0
  38. package/dist/jsx/authConfig.mjs.map +7 -0
  39. package/dist/jsx/hooks/index.mjs +4 -0
  40. package/dist/jsx/hooks/index.mjs.map +7 -0
  41. package/dist/jsx/hooks/useAuthConfig.mjs +9 -0
  42. package/dist/jsx/hooks/useAuthConfig.mjs.map +7 -0
  43. package/dist/jsx/hooks/useCurrentRouteName/index.mjs +17 -0
  44. package/dist/jsx/hooks/useCurrentRouteName/index.mjs.map +7 -0
  45. package/dist/jsx/hooks/useCurrentRouteName/index.native.mjs +12 -0
  46. package/dist/jsx/hooks/useCurrentRouteName/index.native.mjs.map +7 -0
  47. package/dist/jsx/hooks/useKeycloak/index.mjs +2 -0
  48. package/dist/jsx/hooks/useKeycloak/index.mjs.map +7 -0
  49. package/dist/jsx/hooks/useKeycloak/useKeycloak.mjs +25 -0
  50. package/dist/jsx/hooks/useKeycloak/useKeycloak.mjs.map +7 -0
  51. package/dist/jsx/hooks/useKeycloak/useKeycloak.native.mjs +58 -0
  52. package/dist/jsx/hooks/useKeycloak/useKeycloak.native.mjs.map +7 -0
  53. package/dist/jsx/hooks/useLogin.mjs +33 -0
  54. package/dist/jsx/hooks/useLogin.mjs.map +7 -0
  55. package/dist/jsx/index.mjs +5 -0
  56. package/dist/jsx/index.mjs.map +7 -0
  57. package/dist/jsx/provider/afterAuth.mjs +28 -0
  58. package/dist/jsx/provider/afterAuth.mjs.map +7 -0
  59. package/dist/jsx/provider/index.mjs +20 -0
  60. package/dist/jsx/provider/index.mjs.map +7 -0
  61. package/dist/jsx/provider/keycloakProvider.mjs +158 -0
  62. package/dist/jsx/provider/keycloakProvider.mjs.map +7 -0
  63. package/dist/jsx/provider/keycloakProvider.native.mjs +14 -0
  64. package/dist/jsx/provider/keycloakProvider.native.mjs.map +7 -0
  65. package/dist/jsx/state/index.mjs +17 -0
  66. package/dist/jsx/state/index.mjs.map +7 -0
  67. package/dist/jsx/types.mjs +5 -0
  68. package/dist/jsx/types.mjs.map +7 -0
  69. package/{lib → dist/lib}/Authenticated.d.ts +1 -1
  70. package/dist/lib/Authenticated.js +60 -0
  71. package/dist/lib/Authenticated.js.map +7 -0
  72. package/dist/lib/authConfig.js +35 -0
  73. package/dist/lib/authConfig.js.map +7 -0
  74. package/{lib → dist/lib}/hooks/index.d.ts +3 -3
  75. package/dist/lib/hooks/index.js +27 -0
  76. package/dist/lib/hooks/index.js.map +7 -0
  77. package/dist/lib/hooks/useAuthConfig.js +33 -0
  78. package/dist/lib/hooks/useAuthConfig.js.map +7 -0
  79. package/{lib/hooks/useCurrentRouteName.d.ts → dist/lib/hooks/useCurrentRouteName/index.d.ts} +5 -5
  80. package/dist/lib/hooks/useCurrentRouteName/index.js +41 -0
  81. package/dist/lib/hooks/useCurrentRouteName/index.js.map +7 -0
  82. package/{esm/types.js → dist/lib/hooks/useCurrentRouteName/index.native.d.ts} +5 -7
  83. package/dist/lib/hooks/useCurrentRouteName/index.native.js +36 -0
  84. package/dist/lib/hooks/useCurrentRouteName/index.native.js.map +7 -0
  85. package/{lib → dist/lib}/hooks/useKeycloak/index.d.ts +11 -4
  86. package/dist/lib/hooks/useKeycloak/index.js +23 -0
  87. package/dist/lib/hooks/useKeycloak/index.js.map +7 -0
  88. package/{lib → dist/lib}/hooks/useKeycloak/useKeycloak.d.ts +2 -2
  89. package/dist/lib/hooks/useKeycloak/useKeycloak.js +63 -0
  90. package/dist/lib/hooks/useKeycloak/useKeycloak.js.map +7 -0
  91. package/{lib → dist/lib}/hooks/useKeycloak/useKeycloak.native.d.ts +4 -4
  92. package/dist/lib/hooks/useKeycloak/useKeycloak.native.js +93 -0
  93. package/dist/lib/hooks/useKeycloak/useKeycloak.native.js.map +7 -0
  94. package/{lib → dist/lib}/hooks/useLogin.d.ts +1 -1
  95. package/dist/lib/hooks/useLogin.js +57 -0
  96. package/dist/lib/hooks/useLogin.js.map +7 -0
  97. package/{lib → dist/lib}/index.d.ts +4 -4
  98. package/dist/lib/index.js +29 -0
  99. package/dist/lib/index.js.map +7 -0
  100. package/{lib → dist/lib}/provider/afterAuth.d.ts +1 -1
  101. package/dist/lib/provider/afterAuth.js +53 -0
  102. package/dist/lib/provider/afterAuth.js.map +7 -0
  103. package/{lib → dist/lib}/provider/index.d.ts +4 -4
  104. package/dist/lib/provider/index.js +62 -0
  105. package/dist/lib/provider/index.js.map +7 -0
  106. package/{lib → dist/lib}/provider/keycloakProvider.d.ts +2 -2
  107. package/dist/lib/provider/keycloakProvider.js +212 -0
  108. package/dist/lib/provider/keycloakProvider.js.map +7 -0
  109. package/{lib → dist/lib}/provider/keycloakProvider.native.d.ts +2 -2
  110. package/dist/lib/provider/keycloakProvider.native.js +55 -0
  111. package/dist/lib/provider/keycloakProvider.native.js.map +7 -0
  112. package/{esm/state/index.js → dist/lib/state/index.d.ts} +8 -13
  113. package/dist/lib/state/index.js +41 -0
  114. package/dist/lib/state/index.js.map +7 -0
  115. package/dist/lib/tsconfig.build.tsbuildinfo +1 -0
  116. package/dist/lib/types.js +25 -0
  117. package/dist/lib/types.js.map +7 -0
  118. package/package.json +44 -63
  119. package/src/@types/coreJsPure.d.ts +2 -2
  120. package/src/@types/expoKeycloakAuth.d.ts +1 -1
  121. package/src/Authenticated.tsx +5 -8
  122. package/src/authConfig.ts +1 -1
  123. package/src/hooks/index.ts +3 -3
  124. package/src/hooks/useAuthConfig.ts +2 -2
  125. package/{esm/hooks/useCurrentRouteName.js → src/hooks/useCurrentRouteName/index.native.ts} +8 -13
  126. package/src/hooks/{useCurrentRouteName.ts → useCurrentRouteName/index.ts} +8 -8
  127. package/src/hooks/useKeycloak/index.ts +12 -8
  128. package/src/hooks/useKeycloak/useKeycloak.native.ts +18 -32
  129. package/src/hooks/useKeycloak/useKeycloak.ts +7 -7
  130. package/src/hooks/useLogin.ts +7 -7
  131. package/src/index.ts +4 -4
  132. package/src/provider/afterAuth.tsx +10 -11
  133. package/src/provider/index.tsx +9 -12
  134. package/src/provider/keycloakProvider.native.tsx +8 -10
  135. package/src/provider/keycloakProvider.tsx +44 -61
  136. package/src/state/index.ts +13 -10
  137. package/esm/Authenticated.js +0 -42
  138. package/esm/Authenticated.js.map +0 -1
  139. package/esm/authConfig.js +0 -30
  140. package/esm/authConfig.js.map +0 -1
  141. package/esm/hooks/index.js +0 -28
  142. package/esm/hooks/index.js.map +0 -1
  143. package/esm/hooks/useAuthConfig.js +0 -30
  144. package/esm/hooks/useAuthConfig.js.map +0 -1
  145. package/esm/hooks/useCurrentRouteName.js.map +0 -1
  146. package/esm/hooks/useKeycloak/index.js +0 -27
  147. package/esm/hooks/useKeycloak/index.js.map +0 -1
  148. package/esm/hooks/useKeycloak/useKeycloak.js +0 -55
  149. package/esm/hooks/useKeycloak/useKeycloak.js.map +0 -1
  150. package/esm/hooks/useKeycloak/useKeycloak.native.js +0 -91
  151. package/esm/hooks/useKeycloak/useKeycloak.native.js.map +0 -1
  152. package/esm/hooks/useLogin.js +0 -50
  153. package/esm/hooks/useLogin.js.map +0 -1
  154. package/esm/index.js +0 -29
  155. package/esm/index.js.map +0 -1
  156. package/esm/package.json +0 -1
  157. package/esm/provider/afterAuth.js +0 -58
  158. package/esm/provider/afterAuth.js.map +0 -1
  159. package/esm/provider/index.js +0 -43
  160. package/esm/provider/index.js.map +0 -1
  161. package/esm/provider/keycloakProvider.js +0 -175
  162. package/esm/provider/keycloakProvider.js.map +0 -1
  163. package/esm/provider/keycloakProvider.native.js +0 -41
  164. package/esm/provider/keycloakProvider.native.js.map +0 -1
  165. package/esm/state/index.js.map +0 -1
  166. package/esm/types.js.map +0 -1
  167. package/lib/Authenticated.js +0 -64
  168. package/lib/Authenticated.js.map +0 -1
  169. package/lib/authConfig.js +0 -51
  170. package/lib/authConfig.js.map +0 -1
  171. package/lib/hooks/index.js +0 -50
  172. package/lib/hooks/index.js.map +0 -1
  173. package/lib/hooks/useAuthConfig.js +0 -48
  174. package/lib/hooks/useAuthConfig.js.map +0 -1
  175. package/lib/hooks/useCurrentRouteName.js +0 -54
  176. package/lib/hooks/useCurrentRouteName.js.map +0 -1
  177. package/lib/hooks/useKeycloak/index.js +0 -30
  178. package/lib/hooks/useKeycloak/index.js.map +0 -1
  179. package/lib/hooks/useKeycloak/useKeycloak.js +0 -71
  180. package/lib/hooks/useKeycloak/useKeycloak.js.map +0 -1
  181. package/lib/hooks/useKeycloak/useKeycloak.native.js +0 -112
  182. package/lib/hooks/useKeycloak/useKeycloak.native.js.map +0 -1
  183. package/lib/hooks/useLogin.js +0 -65
  184. package/lib/hooks/useLogin.js.map +0 -1
  185. package/lib/index.js +0 -60
  186. package/lib/index.js.map +0 -1
  187. package/lib/package.json +0 -1
  188. package/lib/provider/afterAuth.js +0 -78
  189. package/lib/provider/afterAuth.js.map +0 -1
  190. package/lib/provider/index.js +0 -77
  191. package/lib/provider/index.js.map +0 -1
  192. package/lib/provider/keycloakProvider.js +0 -193
  193. package/lib/provider/keycloakProvider.js.map +0 -1
  194. package/lib/provider/keycloakProvider.native.js +0 -61
  195. package/lib/provider/keycloakProvider.native.js.map +0 -1
  196. package/lib/state/index.d.ts +0 -34
  197. package/lib/state/index.js +0 -55
  198. package/lib/state/index.js.map +0 -1
  199. package/lib/tsconfig.build.tsbuildinfo +0 -1
  200. package/lib/types.js +0 -46
  201. package/lib/types.js.map +0 -1
  202. /package/{lib → dist/lib}/authConfig.d.ts +0 -0
  203. /package/{lib → dist/lib}/hooks/useAuthConfig.d.ts +0 -0
  204. /package/{lib → dist/lib}/types.d.ts +0 -0
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { useLogin, useKeycloak } from "./hooks/index.mjs";
3
+ var Authenticated = function Authenticated2(props) {
4
+ var _useKeycloak = useKeycloak(), authenticated = _useKeycloak.authenticated;
5
+ var login = useLogin(props.loginRoute);
6
+ if (!props.disabled && !authenticated) {
7
+ if (authenticated === false)
8
+ login();
9
+ var LoggedOutComponent = props.loggedOutComponent || function() {
10
+ return null;
11
+ };
12
+ return /* @__PURE__ */ React.createElement(LoggedOutComponent, null);
13
+ }
14
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, props.children);
15
+ };
16
+ function withAuthenticated(Component) {
17
+ return function(props) {
18
+ return /* @__PURE__ */ React.createElement(Authenticated, null, /* @__PURE__ */ React.createElement(Component, props));
19
+ };
20
+ }
21
+ export {
22
+ Authenticated,
23
+ withAuthenticated
24
+ };
25
+ //# sourceMappingURL=Authenticated.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Authenticated.tsx"],
4
+ "sourcesContent": ["/**\n * File: /auth/Authenticated.tsx\n * Project: app\n * File Created: 08-11-2022 05:58:23\n * Author: Clay Risser\n * -----\n * Last Modified: 22-11-2022 06:26:38\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useLogin, useKeycloak } from \"./hooks/index.mjs\";\nexport var Authenticated = function Authenticated(props) {\n var _useKeycloak = useKeycloak(),\n authenticated = _useKeycloak.authenticated;\n var login = useLogin(props.loginRoute);\n if (!props.disabled && !authenticated) {\n if (authenticated === false) login();\n var LoggedOutComponent = props.loggedOutComponent || function () {\n return null;\n };\n return /*#__PURE__*/React.createElement(LoggedOutComponent, null);\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);\n};\nexport function withAuthenticated(Component) {\n return function (props) {\n return /*#__PURE__*/React.createElement(Authenticated, null, /*#__PURE__*/React.createElement(Component, props));\n };\n}"],
5
+ "mappings": "AAwBA,OAAO,WAAW;AAClB,SAAS,UAAU,mBAAmB;AAC/B,IAAI,gBAAgB,SAASA,eAAc,OAAO;AACvD,MAAI,eAAe,YAAY,GAC7B,gBAAgB,aAAa;AAC/B,MAAI,QAAQ,SAAS,MAAM,UAAU;AACrC,MAAI,CAAC,MAAM,YAAY,CAAC,eAAe;AACrC,QAAI,kBAAkB;AAAO,YAAM;AACnC,QAAI,qBAAqB,MAAM,sBAAsB,WAAY;AAC/D,aAAO;AAAA,IACT;AACA,WAAoB,sBAAM,cAAc,oBAAoB,IAAI;AAAA,EAClE;AACA,SAAoB,sBAAM,cAAc,MAAM,UAAU,MAAM,MAAM,QAAQ;AAC9E;AACO,SAAS,kBAAkB,WAAW;AAC3C,SAAO,SAAU,OAAO;AACtB,WAAoB,sBAAM,cAAc,eAAe,MAAmB,sBAAM,cAAc,WAAW,KAAK,CAAC;AAAA,EACjH;AACF;",
6
+ "names": ["Authenticated"]
7
+ }
@@ -0,0 +1,10 @@
1
+ import { createContext } from "react";
2
+ var defaultAuthConfig = {
3
+ ssr: true
4
+ };
5
+ var AuthConfigContext = /* @__PURE__ */ createContext(defaultAuthConfig);
6
+ export {
7
+ AuthConfigContext,
8
+ defaultAuthConfig
9
+ };
10
+ //# sourceMappingURL=authConfig.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/authConfig.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/authConfig.ts\n * Project: app\n * File Created: 08-11-2022 09:21:15\n * Author: Clay Risser\n * -----\n * Last Modified: 25-11-2022 10:29:29\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createContext } from 'react';\nexport var defaultAuthConfig = {\n ssr: true\n};\nexport var AuthConfigContext = /*#__PURE__*/createContext(defaultAuthConfig);"],
5
+ "mappings": "AAwBA,SAAS,qBAAqB;AACvB,IAAI,oBAAoB;AAAA,EAC7B,KAAK;AACP;AACO,IAAI,oBAAiC,8BAAc,iBAAiB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./useCurrentRouteName/index.mjs";
2
+ export * from "./useKeycloak/index.mjs";
3
+ export * from "./useLogin.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/index.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/hooks/index.ts\n * Project: app\n * File Created: 08-11-2022 06:34:56\n * Author: Clay Risser\n * -----\n * Last Modified: 25-11-2022 09:52:31\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from \"./useCurrentRouteName/index.mjs\";\nexport * from \"./useKeycloak/index.mjs\";\nexport * from \"./useLogin.mjs\";"],
5
+ "mappings": "AAuBA,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import { useContext } from "react";
2
+ import { AuthConfigContext } from "../authConfig.mjs";
3
+ function useAuthConfig() {
4
+ return useContext(AuthConfigContext);
5
+ }
6
+ export {
7
+ useAuthConfig
8
+ };
9
+ //# sourceMappingURL=useAuthConfig.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useAuthConfig.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/hooks/useAuthConfig.ts\n * Project: app\n * File Created: 08-11-2022 09:20:41\n * Author: Clay Risser\n * -----\n * Last Modified: 25-11-2022 09:52:31\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useContext } from 'react';\nimport { AuthConfigContext } from \"../authConfig.mjs\";\nexport function useAuthConfig() {\n return useContext(AuthConfigContext);\n}"],
5
+ "mappings": "AAwBA,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAC3B,SAAS,gBAAgB;AAC9B,SAAO,WAAW,iBAAiB;AACrC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,17 @@
1
+ import { MultiPlatform } from "multiplatform.one";
2
+ import { useRoute } from "@react-navigation/native";
3
+ import { useRouter } from "next/router";
4
+ function useCurrentRouteName() {
5
+ if (MultiPlatform.isStorybook)
6
+ return null;
7
+ if (MultiPlatform.isNext) {
8
+ var router = useRouter();
9
+ return router.route;
10
+ }
11
+ var route = useRoute();
12
+ return route.name;
13
+ }
14
+ export {
15
+ useCurrentRouteName
16
+ };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/hooks/useCurrentRouteName/index.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/hooks/useCurrentRouteName/index.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 24-02-2023 06:30:32\n * Author: Clay Risser\n * -----\n * Last Modified: 24-02-2023 06:30:54\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022 - 2023\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useRoute } from '@react-navigation/native';\nimport { useRouter } from 'next/router';\nexport function useCurrentRouteName() {\n if (MultiPlatform.isStorybook) return null;\n if (MultiPlatform.isNext) {\n var router = useRouter();\n return router.route;\n }\n var route = useRoute();\n return route.name;\n}"],
5
+ "mappings": "AAwBA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AACnB,SAAS,sBAAsB;AACpC,MAAI,cAAc;AAAa,WAAO;AACtC,MAAI,cAAc,QAAQ;AACxB,QAAI,SAAS,UAAU;AACvB,WAAO,OAAO;AAAA,EAChB;AACA,MAAI,QAAQ,SAAS;AACrB,SAAO,MAAM;AACf;",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ import { MultiPlatform } from "multiplatform.one";
2
+ import { useRoute } from "@react-navigation/native";
3
+ function useCurrentRouteName() {
4
+ if (MultiPlatform.isStorybook)
5
+ return null;
6
+ var route = useRoute();
7
+ return route.name;
8
+ }
9
+ export {
10
+ useCurrentRouteName
11
+ };
12
+ //# sourceMappingURL=index.native.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/hooks/useCurrentRouteName/index.native.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/hooks/useCurrentRouteName/index.native.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 24-02-2023 06:30:36\n * Author: Clay Risser\n * -----\n * Last Modified: 24-02-2023 06:31:25\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022 - 2023\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useRoute } from '@react-navigation/native';\nexport function useCurrentRouteName() {\n if (MultiPlatform.isStorybook) return null;\n var route = useRoute();\n return route.name;\n}"],
5
+ "mappings": "AAwBA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AAClB,SAAS,sBAAsB;AACpC,MAAI,cAAc;AAAa,WAAO;AACtC,MAAI,QAAQ,SAAS;AACrB,SAAO,MAAM;AACf;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./useKeycloak.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/hooks/useKeycloak/index.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/hooks/useKeycloak/index.ts\n * Project: app\n * File Created: 08-11-2022 14:10:44\n * Author: Clay Risser\n * -----\n * Last Modified: 17-04-2023 19:14:28\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from \"./useKeycloak.mjs\";\nexport {};"],
5
+ "mappings": "AAuBA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,81 @@
1
+ function _typeof(obj) {
2
+ "@babel/helpers - typeof";
3
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
4
+ return typeof obj2;
5
+ } : function(obj2) {
6
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
7
+ }, _typeof(obj);
8
+ }
9
+ function ownKeys(object, enumerableOnly) {
10
+ var keys = Object.keys(object);
11
+ if (Object.getOwnPropertySymbols) {
12
+ var symbols = Object.getOwnPropertySymbols(object);
13
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
14
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
15
+ })), keys.push.apply(keys, symbols);
16
+ }
17
+ return keys;
18
+ }
19
+ function _objectSpread(target) {
20
+ for (var i = 1; i < arguments.length; i++) {
21
+ var source = null != arguments[i] ? arguments[i] : {};
22
+ i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
23
+ _defineProperty(target, key, source[key]);
24
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
25
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ function _defineProperty(obj, key, value) {
31
+ key = _toPropertyKey(key);
32
+ if (key in obj) {
33
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
34
+ } else {
35
+ obj[key] = value;
36
+ }
37
+ return obj;
38
+ }
39
+ function _toPropertyKey(arg) {
40
+ var key = _toPrimitive(arg, "string");
41
+ return _typeof(key) === "symbol" ? key : String(key);
42
+ }
43
+ function _toPrimitive(input, hint) {
44
+ if (_typeof(input) !== "object" || input === null)
45
+ return input;
46
+ var prim = input[Symbol.toPrimitive];
47
+ if (prim !== void 0) {
48
+ var res = prim.call(input, hint || "default");
49
+ if (_typeof(res) !== "object")
50
+ return res;
51
+ throw new TypeError("@@toPrimitive must return a primitive value.");
52
+ }
53
+ return (hint === "string" ? String : Number)(input);
54
+ }
55
+ import { MultiPlatform } from "multiplatform.one";
56
+ import { useAuthConfig } from "../useAuthConfig.mjs";
57
+ import { useKeycloak as useReactKeycloak } from "@react-keycloak/web";
58
+ import { useKeycloak as useSsrKeycloak } from "@react-keycloak/ssr";
59
+ function useKeycloak() {
60
+ var authConfig = useAuthConfig();
61
+ if (MultiPlatform.isStorybook)
62
+ return {
63
+ authenticated: true
64
+ };
65
+ if (MultiPlatform.isNext && authConfig.ssr) {
66
+ var _useSsrKeycloak = useSsrKeycloak(), ssrKeycloak = _useSsrKeycloak.keycloak, _initialized = _useSsrKeycloak.initialized;
67
+ var _keycloak = _objectSpread({}, ssrKeycloak);
68
+ if (!_initialized)
69
+ _keycloak.authenticated = void 0;
70
+ return _keycloak;
71
+ }
72
+ var _useReactKeycloak = useReactKeycloak(), reactKeycloak = _useReactKeycloak.keycloak, initialized = _useReactKeycloak.initialized;
73
+ var keycloak = _objectSpread({}, reactKeycloak);
74
+ if (!initialized)
75
+ keycloak.authenticated = void 0;
76
+ return keycloak;
77
+ }
78
+ export {
79
+ useKeycloak
80
+ };
81
+ //# sourceMappingURL=useKeycloak.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/hooks/useKeycloak/useKeycloak.ts"],
4
+ "sourcesContent": ["function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * File: /src/hooks/useKeycloak/useKeycloak.ts\n * Project: app\n * File Created: 08-11-2022 06:04:59\n * Author: Clay Risser\n * -----\n * Last Modified: 24-02-2023 06:22:07\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useAuthConfig } from \"../useAuthConfig.mjs\";\nimport { useKeycloak as useReactKeycloak } from '@react-keycloak/web';\nimport { useKeycloak as useSsrKeycloak } from '@react-keycloak/ssr';\nexport function useKeycloak() {\n var authConfig = useAuthConfig();\n if (MultiPlatform.isStorybook) return {\n authenticated: true\n };\n if (MultiPlatform.isNext && authConfig.ssr) {\n var _useSsrKeycloak = useSsrKeycloak(),\n ssrKeycloak = _useSsrKeycloak.keycloak,\n _initialized = _useSsrKeycloak.initialized;\n var _keycloak = _objectSpread({}, ssrKeycloak);\n if (!_initialized) _keycloak.authenticated = undefined;\n return _keycloak;\n }\n var _useReactKeycloak = useReactKeycloak(),\n reactKeycloak = _useReactKeycloak.keycloak,\n initialized = _useReactKeycloak.initialized;\n var keycloak = _objectSpread({}, reactKeycloak);\n if (!initialized) keycloak.authenticated = undefined;\n return keycloak;\n}"],
5
+ "mappings": "AAAA,SAAS,QAAQ,KAAK;AAAE;AAA2B,SAAO,UAAU,cAAc,OAAO,UAAU,YAAY,OAAO,OAAO,WAAW,SAAUA,MAAK;AAAE,WAAO,OAAOA;AAAA,EAAK,IAAI,SAAUA,MAAK;AAAE,WAAOA,QAAO,cAAc,OAAO,UAAUA,KAAI,gBAAgB,UAAUA,SAAQ,OAAO,YAAY,WAAW,OAAOA;AAAA,EAAK,GAAG,QAAQ,GAAG;AAAG;AAC/U,SAAS,QAAQ,QAAQ,gBAAgB;AAAE,MAAI,OAAO,OAAO,KAAK,MAAM;AAAG,MAAI,OAAO,uBAAuB;AAAE,QAAI,UAAU,OAAO,sBAAsB,MAAM;AAAG,uBAAmB,UAAU,QAAQ,OAAO,SAAU,KAAK;AAAE,aAAO,OAAO,yBAAyB,QAAQ,GAAG,EAAE;AAAA,IAAY,CAAC,IAAI,KAAK,KAAK,MAAM,MAAM,OAAO;AAAA,EAAG;AAAE,SAAO;AAAM;AACpV,SAAS,cAAc,QAAQ;AAAE,WAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAAE,QAAI,SAAS,QAAQ,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC;AAAG,QAAI,IAAI,QAAQ,OAAO,MAAM,GAAG,IAAE,EAAE,QAAQ,SAAU,KAAK;AAAE,sBAAgB,QAAQ,KAAK,OAAO,GAAG,CAAC;AAAA,IAAG,CAAC,IAAI,OAAO,4BAA4B,OAAO,iBAAiB,QAAQ,OAAO,0BAA0B,MAAM,CAAC,IAAI,QAAQ,OAAO,MAAM,CAAC,EAAE,QAAQ,SAAU,KAAK;AAAE,aAAO,eAAe,QAAQ,KAAK,OAAO,yBAAyB,QAAQ,GAAG,CAAC;AAAA,IAAG,CAAC;AAAA,EAAG;AAAE,SAAO;AAAQ;AACzf,SAAS,gBAAgB,KAAK,KAAK,OAAO;AAAE,QAAM,eAAe,GAAG;AAAG,MAAI,OAAO,KAAK;AAAE,WAAO,eAAe,KAAK,KAAK,EAAE,OAAc,YAAY,MAAM,cAAc,MAAM,UAAU,KAAK,CAAC;AAAA,EAAG,OAAO;AAAE,QAAI,GAAG,IAAI;AAAA,EAAO;AAAE,SAAO;AAAK;AAC3O,SAAS,eAAe,KAAK;AAAE,MAAI,MAAM,aAAa,KAAK,QAAQ;AAAG,SAAO,QAAQ,GAAG,MAAM,WAAW,MAAM,OAAO,GAAG;AAAG;AAC5H,SAAS,aAAa,OAAO,MAAM;AAAE,MAAI,QAAQ,KAAK,MAAM,YAAY,UAAU;AAAM,WAAO;AAAO,MAAI,OAAO,MAAM,OAAO,WAAW;AAAG,MAAI,SAAS,QAAW;AAAE,QAAI,MAAM,KAAK,KAAK,OAAO,QAAQ,SAAS;AAAG,QAAI,QAAQ,GAAG,MAAM;AAAU,aAAO;AAAK,UAAM,IAAI,UAAU,8CAA8C;AAAA,EAAG;AAAE,UAAQ,SAAS,WAAW,SAAS,QAAQ,KAAK;AAAG;AAyB5X,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,eAAe,wBAAwB;AAChD,SAAS,eAAe,sBAAsB;AACvC,SAAS,cAAc;AAC5B,MAAI,aAAa,cAAc;AAC/B,MAAI,cAAc;AAAa,WAAO;AAAA,MACpC,eAAe;AAAA,IACjB;AACA,MAAI,cAAc,UAAU,WAAW,KAAK;AAC1C,QAAI,kBAAkB,eAAe,GACnC,cAAc,gBAAgB,UAC9B,eAAe,gBAAgB;AACjC,QAAI,YAAY,cAAc,CAAC,GAAG,WAAW;AAC7C,QAAI,CAAC;AAAc,gBAAU,gBAAgB;AAC7C,WAAO;AAAA,EACT;AACA,MAAI,oBAAoB,iBAAiB,GACvC,gBAAgB,kBAAkB,UAClC,cAAc,kBAAkB;AAClC,MAAI,WAAW,cAAc,CAAC,GAAG,aAAa;AAC9C,MAAI,CAAC;AAAa,aAAS,gBAAgB;AAC3C,SAAO;AACT;",
6
+ "names": ["obj"]
7
+ }
@@ -0,0 +1,108 @@
1
+ function _typeof(obj) {
2
+ "@babel/helpers - typeof";
3
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
4
+ return typeof obj2;
5
+ } : function(obj2) {
6
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
7
+ }, _typeof(obj);
8
+ }
9
+ function _defineProperties(target, props) {
10
+ for (var i = 0; i < props.length; i++) {
11
+ var descriptor = props[i];
12
+ descriptor.enumerable = descriptor.enumerable || false;
13
+ descriptor.configurable = true;
14
+ if ("value" in descriptor)
15
+ descriptor.writable = true;
16
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
17
+ }
18
+ }
19
+ function _createClass(Constructor, protoProps, staticProps) {
20
+ if (protoProps)
21
+ _defineProperties(Constructor.prototype, protoProps);
22
+ if (staticProps)
23
+ _defineProperties(Constructor, staticProps);
24
+ Object.defineProperty(Constructor, "prototype", { writable: false });
25
+ return Constructor;
26
+ }
27
+ function _toPropertyKey(arg) {
28
+ var key = _toPrimitive(arg, "string");
29
+ return _typeof(key) === "symbol" ? key : String(key);
30
+ }
31
+ function _toPrimitive(input, hint) {
32
+ if (_typeof(input) !== "object" || input === null)
33
+ return input;
34
+ var prim = input[Symbol.toPrimitive];
35
+ if (prim !== void 0) {
36
+ var res = prim.call(input, hint || "default");
37
+ if (_typeof(res) !== "object")
38
+ return res;
39
+ throw new TypeError("@@toPrimitive must return a primitive value.");
40
+ }
41
+ return (hint === "string" ? String : Number)(input);
42
+ }
43
+ function _classCallCheck(instance, Constructor) {
44
+ if (!(instance instanceof Constructor)) {
45
+ throw new TypeError("Cannot call a class as a function");
46
+ }
47
+ }
48
+ import atob from "core-js-pure/stable/atob";
49
+ import escape from "core-js-pure/stable/escape";
50
+ import { MultiPlatform } from "multiplatform.one";
51
+ import { useKeycloak as useExpoKeycloak } from "expo-keycloak-auth";
52
+ function useKeycloak() {
53
+ if (MultiPlatform.isStorybook)
54
+ return {
55
+ authenticated: true
56
+ };
57
+ var _useExpoKeycloak = useExpoKeycloak(), ready = _useExpoKeycloak.ready, login = _useExpoKeycloak.login, isLoggedIn = _useExpoKeycloak.isLoggedIn, token = _useExpoKeycloak.token, logout = _useExpoKeycloak.logout, refreshToken = _useExpoKeycloak.refreshToken;
58
+ var keycloak = new ExpoKeycloak(ready, isLoggedIn, login, logout, token || void 0, refreshToken || void 0);
59
+ return keycloak;
60
+ }
61
+ var ExpoKeycloak = /* @__PURE__ */ _createClass(function ExpoKeycloak2(ready, isLoggedIn, login, logout, token, refreshToken) {
62
+ _classCallCheck(this, ExpoKeycloak2);
63
+ this.logout = logout;
64
+ this.token = token;
65
+ this.refreshToken = refreshToken;
66
+ if (ready)
67
+ this.authenticated = isLoggedIn;
68
+ if (this.authenticated) {
69
+ if (this.token)
70
+ this.tokenParsed = decodeToken(this.token);
71
+ if (this.refreshToken) {
72
+ this.refreshTokenParsed = decodeToken(this.refreshToken);
73
+ }
74
+ if (this.tokenParsed) {
75
+ this.subject = this.tokenParsed.sub;
76
+ this.realmAccess = this.tokenParsed.realm_access;
77
+ this.resourceAccess = this.tokenParsed.resource_access;
78
+ }
79
+ }
80
+ this.login = function() {
81
+ return login();
82
+ };
83
+ });
84
+ function decodeToken(str) {
85
+ str = str.split(".")[1];
86
+ str = str.replace(/-/g, "+");
87
+ str = str.replace(/_/g, "/");
88
+ switch (str.length % 4) {
89
+ case 0:
90
+ break;
91
+ case 2:
92
+ str += "==";
93
+ break;
94
+ case 3:
95
+ str += "=";
96
+ break;
97
+ default:
98
+ throw "Invalid token";
99
+ }
100
+ str = decodeURIComponent(escape(atob(str)));
101
+ str = JSON.parse(str);
102
+ return str;
103
+ }
104
+ export {
105
+ ExpoKeycloak,
106
+ useKeycloak
107
+ };
108
+ //# sourceMappingURL=useKeycloak.native.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/hooks/useKeycloak/useKeycloak.native.ts"],
4
+ "sourcesContent": ["function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n/**\n * File: /src/hooks/useKeycloak/useKeycloak.native.ts\n * Project: app\n * File Created: 08-11-2022 14:10:25\n * Author: Clay Risser\n * -----\n * Last Modified: 24-02-2023 06:29:25\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport atob from 'core-js-pure/stable/atob';\nimport escape from 'core-js-pure/stable/escape';\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useKeycloak as useExpoKeycloak } from 'expo-keycloak-auth';\nexport function useKeycloak() {\n if (MultiPlatform.isStorybook) return {\n authenticated: true\n };\n var _useExpoKeycloak = useExpoKeycloak(),\n ready = _useExpoKeycloak.ready,\n login = _useExpoKeycloak.login,\n isLoggedIn = _useExpoKeycloak.isLoggedIn,\n token = _useExpoKeycloak.token,\n logout = _useExpoKeycloak.logout,\n refreshToken = _useExpoKeycloak.refreshToken;\n var keycloak = new ExpoKeycloak(ready, isLoggedIn, login, logout, token || undefined, refreshToken || undefined);\n return keycloak;\n}\nexport var ExpoKeycloak = /*#__PURE__*/_createClass(function ExpoKeycloak(ready, isLoggedIn, login, logout, token, refreshToken) {\n _classCallCheck(this, ExpoKeycloak);\n this.logout = logout;\n this.token = token;\n this.refreshToken = refreshToken;\n if (ready) this.authenticated = isLoggedIn;\n if (this.authenticated) {\n if (this.token) this.tokenParsed = decodeToken(this.token);\n if (this.refreshToken) {\n this.refreshTokenParsed = decodeToken(this.refreshToken);\n }\n if (this.tokenParsed) {\n this.subject = this.tokenParsed.sub;\n this.realmAccess = this.tokenParsed.realm_access;\n this.resourceAccess = this.tokenParsed.resource_access;\n }\n }\n this.login = function () {\n return login();\n };\n});\nfunction decodeToken(str) {\n str = str.split('.')[1];\n str = str.replace(/-/g, '+');\n str = str.replace(/_/g, '/');\n switch (str.length % 4) {\n case 0:\n break;\n case 2:\n str += '==';\n break;\n case 3:\n str += '=';\n break;\n default:\n throw 'Invalid token';\n }\n str = decodeURIComponent(escape(atob(str)));\n str = JSON.parse(str);\n return str;\n}"],
5
+ "mappings": "AAAA,SAAS,QAAQ,KAAK;AAAE;AAA2B,SAAO,UAAU,cAAc,OAAO,UAAU,YAAY,OAAO,OAAO,WAAW,SAAUA,MAAK;AAAE,WAAO,OAAOA;AAAA,EAAK,IAAI,SAAUA,MAAK;AAAE,WAAOA,QAAO,cAAc,OAAO,UAAUA,KAAI,gBAAgB,UAAUA,SAAQ,OAAO,YAAY,WAAW,OAAOA;AAAA,EAAK,GAAG,QAAQ,GAAG;AAAG;AAC/U,SAAS,kBAAkB,QAAQ,OAAO;AAAE,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AAAE,QAAI,aAAa,MAAM,CAAC;AAAG,eAAW,aAAa,WAAW,cAAc;AAAO,eAAW,eAAe;AAAM,QAAI,WAAW;AAAY,iBAAW,WAAW;AAAM,WAAO,eAAe,QAAQ,eAAe,WAAW,GAAG,GAAG,UAAU;AAAA,EAAG;AAAE;AAC5U,SAAS,aAAa,aAAa,YAAY,aAAa;AAAE,MAAI;AAAY,sBAAkB,YAAY,WAAW,UAAU;AAAG,MAAI;AAAa,sBAAkB,aAAa,WAAW;AAAG,SAAO,eAAe,aAAa,aAAa,EAAE,UAAU,MAAM,CAAC;AAAG,SAAO;AAAa;AAC5R,SAAS,eAAe,KAAK;AAAE,MAAI,MAAM,aAAa,KAAK,QAAQ;AAAG,SAAO,QAAQ,GAAG,MAAM,WAAW,MAAM,OAAO,GAAG;AAAG;AAC5H,SAAS,aAAa,OAAO,MAAM;AAAE,MAAI,QAAQ,KAAK,MAAM,YAAY,UAAU;AAAM,WAAO;AAAO,MAAI,OAAO,MAAM,OAAO,WAAW;AAAG,MAAI,SAAS,QAAW;AAAE,QAAI,MAAM,KAAK,KAAK,OAAO,QAAQ,SAAS;AAAG,QAAI,QAAQ,GAAG,MAAM;AAAU,aAAO;AAAK,UAAM,IAAI,UAAU,8CAA8C;AAAA,EAAG;AAAE,UAAQ,SAAS,WAAW,SAAS,QAAQ,KAAK;AAAG;AAC5X,SAAS,gBAAgB,UAAU,aAAa;AAAE,MAAI,EAAE,oBAAoB,cAAc;AAAE,UAAM,IAAI,UAAU,mCAAmC;AAAA,EAAG;AAAE;AAyBxJ,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,SAAS,qBAAqB;AAC9B,SAAS,eAAe,uBAAuB;AACxC,SAAS,cAAc;AAC5B,MAAI,cAAc;AAAa,WAAO;AAAA,MACpC,eAAe;AAAA,IACjB;AACA,MAAI,mBAAmB,gBAAgB,GACrC,QAAQ,iBAAiB,OACzB,QAAQ,iBAAiB,OACzB,aAAa,iBAAiB,YAC9B,QAAQ,iBAAiB,OACzB,SAAS,iBAAiB,QAC1B,eAAe,iBAAiB;AAClC,MAAI,WAAW,IAAI,aAAa,OAAO,YAAY,OAAO,QAAQ,SAAS,QAAW,gBAAgB,MAAS;AAC/G,SAAO;AACT;AACO,IAAI,eAA4B,6BAAa,SAASC,cAAa,OAAO,YAAY,OAAO,QAAQ,OAAO,cAAc;AAC/H,kBAAgB,MAAMA,aAAY;AAClC,OAAK,SAAS;AACd,OAAK,QAAQ;AACb,OAAK,eAAe;AACpB,MAAI;AAAO,SAAK,gBAAgB;AAChC,MAAI,KAAK,eAAe;AACtB,QAAI,KAAK;AAAO,WAAK,cAAc,YAAY,KAAK,KAAK;AACzD,QAAI,KAAK,cAAc;AACrB,WAAK,qBAAqB,YAAY,KAAK,YAAY;AAAA,IACzD;AACA,QAAI,KAAK,aAAa;AACpB,WAAK,UAAU,KAAK,YAAY;AAChC,WAAK,cAAc,KAAK,YAAY;AACpC,WAAK,iBAAiB,KAAK,YAAY;AAAA,IACzC;AAAA,EACF;AACA,OAAK,QAAQ,WAAY;AACvB,WAAO,MAAM;AAAA,EACf;AACF,CAAC;AACD,SAAS,YAAY,KAAK;AACxB,QAAM,IAAI,MAAM,GAAG,EAAE,CAAC;AACtB,QAAM,IAAI,QAAQ,MAAM,GAAG;AAC3B,QAAM,IAAI,QAAQ,MAAM,GAAG;AAC3B,UAAQ,IAAI,SAAS,GAAG;AAAA,IACtB,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AACP;AAAA,IACF,KAAK;AACH,aAAO;AACP;AAAA,IACF;AACE,YAAM;AAAA,EACV;AACA,QAAM,mBAAmB,OAAO,KAAK,GAAG,CAAC,CAAC;AAC1C,QAAM,KAAK,MAAM,GAAG;AACpB,SAAO;AACT;",
6
+ "names": ["obj", "ExpoKeycloak"]
7
+ }
@@ -0,0 +1,35 @@
1
+ import { MultiPlatform } from "multiplatform.one";
2
+ import { useAuthConfig } from "./useAuthConfig.mjs";
3
+ import { useCurrentRouteName } from "./useCurrentRouteName/index.mjs";
4
+ import { useKeycloak } from "./useKeycloak/useKeycloak.mjs";
5
+ import { useRouter } from "solito/router";
6
+ function useLogin(loginRoute) {
7
+ if (MultiPlatform.isStorybook)
8
+ return function() {
9
+ return null;
10
+ };
11
+ var keycloak = useKeycloak();
12
+ var authConfig = useAuthConfig();
13
+ var currentRouteName = useCurrentRouteName();
14
+ var router = useRouter();
15
+ return function() {
16
+ if (!loginRoute)
17
+ loginRoute = authConfig.loginRoute;
18
+ if (!loginRoute) {
19
+ keycloak.login();
20
+ return;
21
+ }
22
+ var url = new URL("x://".concat(loginRoute));
23
+ var searchParams = new URLSearchParams(url.search);
24
+ if (currentRouteName)
25
+ searchParams.append("backTo", currentRouteName);
26
+ var query = searchParams.toString();
27
+ if (query.length)
28
+ query = "?".concat(query);
29
+ router.push("".concat(url.pathname.substring(2)).concat(query));
30
+ };
31
+ }
32
+ export {
33
+ useLogin
34
+ };
35
+ //# sourceMappingURL=useLogin.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useLogin.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/hooks/useLogin.ts\n * Project: app\n * File Created: 08-11-2022 08:49:14\n * Author: Clay Risser\n * -----\n * Last Modified: 24-02-2023 06:22:27\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useAuthConfig } from \"./useAuthConfig.mjs\";\nimport { useCurrentRouteName } from \"./useCurrentRouteName/index.mjs\";\nimport { useKeycloak } from \"./useKeycloak/useKeycloak.mjs\";\nimport { useRouter } from 'solito/router';\nexport function useLogin(loginRoute) {\n if (MultiPlatform.isStorybook) return function () {\n return null;\n };\n var keycloak = useKeycloak();\n var authConfig = useAuthConfig();\n var currentRouteName = useCurrentRouteName();\n var router = useRouter();\n return function () {\n if (!loginRoute) loginRoute = authConfig.loginRoute;\n if (!loginRoute) {\n keycloak.login();\n return;\n }\n var url = new URL(\"x://\".concat(loginRoute));\n var searchParams = new URLSearchParams(url.search);\n if (currentRouteName) searchParams.append('backTo', currentRouteName);\n var query = searchParams.toString();\n if (query.length) query = \"?\".concat(query);\n router.push(\"\".concat(url.pathname.substring(2)).concat(query));\n };\n}"],
5
+ "mappings": "AAwBA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AACnB,SAAS,SAAS,YAAY;AACnC,MAAI,cAAc;AAAa,WAAO,WAAY;AAChD,aAAO;AAAA,IACT;AACA,MAAI,WAAW,YAAY;AAC3B,MAAI,aAAa,cAAc;AAC/B,MAAI,mBAAmB,oBAAoB;AAC3C,MAAI,SAAS,UAAU;AACvB,SAAO,WAAY;AACjB,QAAI,CAAC;AAAY,mBAAa,WAAW;AACzC,QAAI,CAAC,YAAY;AACf,eAAS,MAAM;AACf;AAAA,IACF;AACA,QAAI,MAAM,IAAI,IAAI,OAAO,OAAO,UAAU,CAAC;AAC3C,QAAI,eAAe,IAAI,gBAAgB,IAAI,MAAM;AACjD,QAAI;AAAkB,mBAAa,OAAO,UAAU,gBAAgB;AACpE,QAAI,QAAQ,aAAa,SAAS;AAClC,QAAI,MAAM;AAAQ,cAAQ,IAAI,OAAO,KAAK;AAC1C,WAAO,KAAK,GAAG,OAAO,IAAI,SAAS,UAAU,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC;AAAA,EAChE;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./Authenticated.mjs";
2
+ export * from "./authConfig.mjs";
3
+ export * from "./hooks/index.mjs";
4
+ export * from "./provider/index.mjs";
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["/**\n * File: /src/index.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 25-11-2022 09:51:55\n * Author: Clay Risser\n * -----\n * Last Modified: 25-11-2022 09:52:06\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from \"./Authenticated.mjs\";\nexport * from \"./authConfig.mjs\";\nexport * from \"./hooks/index.mjs\";\nexport * from \"./provider/index.mjs\";"],
5
+ "mappings": "AAuBA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,29 @@
1
+ import React, { useEffect } from "react";
2
+ import { useAuthConfig } from "../hooks/useAuthConfig.mjs";
3
+ import { useAuthState } from "../state/index.mjs";
4
+ import { useKeycloak } from "../hooks/index.mjs";
5
+ var logger = console;
6
+ var AfterAuth = function AfterAuth2(_ref) {
7
+ var children = _ref.children;
8
+ var authConfig = useAuthConfig();
9
+ var _useKeycloak = useKeycloak(), token = _useKeycloak.token, refreshToken = _useKeycloak.refreshToken, authenticated = _useKeycloak.authenticated;
10
+ var authState = useAuthState();
11
+ useEffect(function() {
12
+ if (!authenticated)
13
+ return;
14
+ if (token) {
15
+ authState.setToken(token);
16
+ if (refreshToken)
17
+ authState.setRefreshToken(refreshToken);
18
+ }
19
+ }, [token, refreshToken]);
20
+ if (authConfig.debug) {
21
+ logger.debug("authenticated", authenticated);
22
+ logger.debug("token", token);
23
+ }
24
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
25
+ };
26
+ export {
27
+ AfterAuth
28
+ };
29
+ //# sourceMappingURL=afterAuth.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/provider/afterAuth.tsx"],
4
+ "sourcesContent": ["/**\n * File: /auth/provider/afterAuth.tsx\n * Project: app\n * File Created: 22-11-2022 17:49:58\n * Author: Clay Risser\n * -----\n * Last Modified: 22-11-2022 18:00:39\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect } from 'react';\nimport { useAuthConfig } from \"../hooks/useAuthConfig.mjs\";\nimport { useAuthState } from \"../state/index.mjs\";\nimport { useKeycloak } from \"../hooks/index.mjs\";\nvar logger = console;\nexport var AfterAuth = function AfterAuth(_ref) {\n var children = _ref.children;\n var authConfig = useAuthConfig();\n var _useKeycloak = useKeycloak(),\n token = _useKeycloak.token,\n refreshToken = _useKeycloak.refreshToken,\n authenticated = _useKeycloak.authenticated;\n var authState = useAuthState();\n useEffect(function () {\n if (!authenticated) return;\n if (token) {\n authState.setToken(token);\n if (refreshToken) authState.setRefreshToken(refreshToken);\n }\n }, [token, refreshToken]);\n if (authConfig.debug) {\n logger.debug('authenticated', authenticated);\n logger.debug('token', token);\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, children);\n};"],
5
+ "mappings": "AAwBA,OAAO,SAAS,iBAAiB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,IAAI,SAAS;AACN,IAAI,YAAY,SAASA,WAAU,MAAM;AAC9C,MAAI,WAAW,KAAK;AACpB,MAAI,aAAa,cAAc;AAC/B,MAAI,eAAe,YAAY,GAC7B,QAAQ,aAAa,OACrB,eAAe,aAAa,cAC5B,gBAAgB,aAAa;AAC/B,MAAI,YAAY,aAAa;AAC7B,YAAU,WAAY;AACpB,QAAI,CAAC;AAAe;AACpB,QAAI,OAAO;AACT,gBAAU,SAAS,KAAK;AACxB,UAAI;AAAc,kBAAU,gBAAgB,YAAY;AAAA,IAC1D;AAAA,EACF,GAAG,CAAC,OAAO,YAAY,CAAC;AACxB,MAAI,WAAW,OAAO;AACpB,WAAO,MAAM,iBAAiB,aAAa;AAC3C,WAAO,MAAM,SAAS,KAAK;AAAA,EAC7B;AACA,SAAoB,sBAAM,cAAc,MAAM,UAAU,MAAM,QAAQ;AACxE;",
6
+ "names": ["AfterAuth"]
7
+ }
@@ -0,0 +1,73 @@
1
+ function _typeof(obj) {
2
+ "@babel/helpers - typeof";
3
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
4
+ return typeof obj2;
5
+ } : function(obj2) {
6
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
7
+ }, _typeof(obj);
8
+ }
9
+ function ownKeys(object, enumerableOnly) {
10
+ var keys = Object.keys(object);
11
+ if (Object.getOwnPropertySymbols) {
12
+ var symbols = Object.getOwnPropertySymbols(object);
13
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
14
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
15
+ })), keys.push.apply(keys, symbols);
16
+ }
17
+ return keys;
18
+ }
19
+ function _objectSpread(target) {
20
+ for (var i = 1; i < arguments.length; i++) {
21
+ var source = null != arguments[i] ? arguments[i] : {};
22
+ i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
23
+ _defineProperty(target, key, source[key]);
24
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
25
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ function _defineProperty(obj, key, value) {
31
+ key = _toPropertyKey(key);
32
+ if (key in obj) {
33
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
34
+ } else {
35
+ obj[key] = value;
36
+ }
37
+ return obj;
38
+ }
39
+ function _toPropertyKey(arg) {
40
+ var key = _toPrimitive(arg, "string");
41
+ return _typeof(key) === "symbol" ? key : String(key);
42
+ }
43
+ function _toPrimitive(input, hint) {
44
+ if (_typeof(input) !== "object" || input === null)
45
+ return input;
46
+ var prim = input[Symbol.toPrimitive];
47
+ if (prim !== void 0) {
48
+ var res = prim.call(input, hint || "default");
49
+ if (_typeof(res) !== "object")
50
+ return res;
51
+ throw new TypeError("@@toPrimitive must return a primitive value.");
52
+ }
53
+ return (hint === "string" ? String : Number)(input);
54
+ }
55
+ import React, { useMemo } from "react";
56
+ import { AuthConfigContext, defaultAuthConfig } from "../authConfig.mjs";
57
+ import { KeycloakProvider } from "./keycloakProvider.mjs";
58
+ var AuthProvider = function AuthProvider2(props) {
59
+ var authConfig = props.authConfig, debug = props.debug;
60
+ var authConfigValue = useMemo(function() {
61
+ return _objectSpread(_objectSpread(_objectSpread({}, defaultAuthConfig), authConfig), {}, {
62
+ debug: !!debug
63
+ });
64
+ }, []);
65
+ return /* @__PURE__ */ React.createElement(AuthConfigContext.Provider, {
66
+ value: authConfigValue
67
+ }, /* @__PURE__ */ React.createElement(KeycloakProvider, props));
68
+ };
69
+ export * from "./keycloakProvider.mjs";
70
+ export {
71
+ AuthProvider
72
+ };
73
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/provider/index.tsx"],
4
+ "sourcesContent": ["function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * File: /auth/provider/index.tsx\n * Project: app\n * File Created: 08-11-2022 06:33:07\n * Author: Clay Risser\n * -----\n * Last Modified: 22-11-2022 18:00:13\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useMemo } from 'react';\nimport { AuthConfigContext, defaultAuthConfig } from \"../authConfig.mjs\";\nimport { KeycloakProvider } from \"./keycloakProvider.mjs\";\nexport var AuthProvider = function AuthProvider(props) {\n var authConfig = props.authConfig,\n debug = props.debug;\n var authConfigValue = useMemo(function () {\n return _objectSpread(_objectSpread(_objectSpread({}, defaultAuthConfig), authConfig), {}, {\n debug: !!debug\n });\n }, []);\n return /*#__PURE__*/React.createElement(AuthConfigContext.Provider, {\n value: authConfigValue\n }, /*#__PURE__*/React.createElement(KeycloakProvider, props));\n};\nexport * from \"./keycloakProvider.mjs\";"],
5
+ "mappings": "AAAA,SAAS,QAAQ,KAAK;AAAE;AAA2B,SAAO,UAAU,cAAc,OAAO,UAAU,YAAY,OAAO,OAAO,WAAW,SAAUA,MAAK;AAAE,WAAO,OAAOA;AAAA,EAAK,IAAI,SAAUA,MAAK;AAAE,WAAOA,QAAO,cAAc,OAAO,UAAUA,KAAI,gBAAgB,UAAUA,SAAQ,OAAO,YAAY,WAAW,OAAOA;AAAA,EAAK,GAAG,QAAQ,GAAG;AAAG;AAC/U,SAAS,QAAQ,QAAQ,gBAAgB;AAAE,MAAI,OAAO,OAAO,KAAK,MAAM;AAAG,MAAI,OAAO,uBAAuB;AAAE,QAAI,UAAU,OAAO,sBAAsB,MAAM;AAAG,uBAAmB,UAAU,QAAQ,OAAO,SAAU,KAAK;AAAE,aAAO,OAAO,yBAAyB,QAAQ,GAAG,EAAE;AAAA,IAAY,CAAC,IAAI,KAAK,KAAK,MAAM,MAAM,OAAO;AAAA,EAAG;AAAE,SAAO;AAAM;AACpV,SAAS,cAAc,QAAQ;AAAE,WAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAAE,QAAI,SAAS,QAAQ,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC;AAAG,QAAI,IAAI,QAAQ,OAAO,MAAM,GAAG,IAAE,EAAE,QAAQ,SAAU,KAAK;AAAE,sBAAgB,QAAQ,KAAK,OAAO,GAAG,CAAC;AAAA,IAAG,CAAC,IAAI,OAAO,4BAA4B,OAAO,iBAAiB,QAAQ,OAAO,0BAA0B,MAAM,CAAC,IAAI,QAAQ,OAAO,MAAM,CAAC,EAAE,QAAQ,SAAU,KAAK;AAAE,aAAO,eAAe,QAAQ,KAAK,OAAO,yBAAyB,QAAQ,GAAG,CAAC;AAAA,IAAG,CAAC;AAAA,EAAG;AAAE,SAAO;AAAQ;AACzf,SAAS,gBAAgB,KAAK,KAAK,OAAO;AAAE,QAAM,eAAe,GAAG;AAAG,MAAI,OAAO,KAAK;AAAE,WAAO,eAAe,KAAK,KAAK,EAAE,OAAc,YAAY,MAAM,cAAc,MAAM,UAAU,KAAK,CAAC;AAAA,EAAG,OAAO;AAAE,QAAI,GAAG,IAAI;AAAA,EAAO;AAAE,SAAO;AAAK;AAC3O,SAAS,eAAe,KAAK;AAAE,MAAI,MAAM,aAAa,KAAK,QAAQ;AAAG,SAAO,QAAQ,GAAG,MAAM,WAAW,MAAM,OAAO,GAAG;AAAG;AAC5H,SAAS,aAAa,OAAO,MAAM;AAAE,MAAI,QAAQ,KAAK,MAAM,YAAY,UAAU;AAAM,WAAO;AAAO,MAAI,OAAO,MAAM,OAAO,WAAW;AAAG,MAAI,SAAS,QAAW;AAAE,QAAI,MAAM,KAAK,KAAK,OAAO,QAAQ,SAAS;AAAG,QAAI,QAAQ,GAAG,MAAM;AAAU,aAAO;AAAK,UAAM,IAAI,UAAU,8CAA8C;AAAA,EAAG;AAAE,UAAQ,SAAS,WAAW,SAAS,QAAQ,KAAK;AAAG;AAyB5X,OAAO,SAAS,eAAe;AAC/B,SAAS,mBAAmB,yBAAyB;AACrD,SAAS,wBAAwB;AAC1B,IAAI,eAAe,SAASC,cAAa,OAAO;AACrD,MAAI,aAAa,MAAM,YACrB,QAAQ,MAAM;AAChB,MAAI,kBAAkB,QAAQ,WAAY;AACxC,WAAO,cAAc,cAAc,cAAc,CAAC,GAAG,iBAAiB,GAAG,UAAU,GAAG,CAAC,GAAG;AAAA,MACxF,OAAO,CAAC,CAAC;AAAA,IACX,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AACL,SAAoB,sBAAM,cAAc,kBAAkB,UAAU;AAAA,IAClE,OAAO;AAAA,EACT,GAAgB,sBAAM,cAAc,kBAAkB,KAAK,CAAC;AAC9D;AACA,cAAc;",
6
+ "names": ["obj", "AuthProvider"]
7
+ }