@cabin-id/nextjs 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/cjs/api/getUserInfo.js +42 -0
  2. package/dist/cjs/api/getUserInfo.js.map +1 -0
  3. package/dist/cjs/client/provider.js +57 -0
  4. package/dist/cjs/client/provider.js.map +1 -0
  5. package/dist/cjs/component.client.js +2 -0
  6. package/dist/cjs/component.client.js.map +1 -0
  7. package/dist/cjs/component.server.js +29 -0
  8. package/dist/cjs/component.server.js.map +1 -0
  9. package/dist/cjs/components/SignInButton.js +58 -0
  10. package/dist/cjs/components/SignInButton.js.map +1 -0
  11. package/dist/cjs/components/index.js +29 -0
  12. package/dist/cjs/components/index.js.map +1 -0
  13. package/dist/cjs/constants.js +121 -0
  14. package/dist/cjs/constants.js.map +1 -0
  15. package/dist/cjs/global.d.js +17 -0
  16. package/dist/cjs/global.d.js.map +1 -0
  17. package/dist/cjs/hooks/index.js +29 -0
  18. package/dist/cjs/hooks/index.js.map +1 -0
  19. package/dist/cjs/hooks/useUser.js +48 -0
  20. package/dist/cjs/hooks/useUser.js.map +1 -0
  21. package/dist/cjs/icons/logo.js +98 -0
  22. package/dist/cjs/icons/logo.js.map +1 -0
  23. package/dist/cjs/index.js +44 -0
  24. package/dist/cjs/index.js.map +1 -0
  25. package/dist/cjs/server/auth.js +37 -0
  26. package/dist/cjs/server/auth.js.map +1 -0
  27. package/dist/cjs/server/createRedirect.js +89 -0
  28. package/dist/cjs/server/createRedirect.js.map +1 -0
  29. package/dist/cjs/server/getCurrentUser.js +43 -0
  30. package/dist/cjs/server/getCurrentUser.js.map +1 -0
  31. package/dist/cjs/server/middleware.js +185 -0
  32. package/dist/cjs/server/middleware.js.map +1 -0
  33. package/dist/cjs/server/routeMatcher.js +42 -0
  34. package/dist/cjs/server/routeMatcher.js.map +1 -0
  35. package/dist/cjs/server/serverRedirectWithAuth.js +39 -0
  36. package/dist/cjs/server/serverRedirectWithAuth.js.map +1 -0
  37. package/dist/cjs/server/type.js +17 -0
  38. package/dist/cjs/server/type.js.map +1 -0
  39. package/dist/cjs/server/utils.js +107 -0
  40. package/dist/cjs/server/utils.js.map +1 -0
  41. package/dist/cjs/styles/global.css +334 -0
  42. package/dist/cjs/styles/global.css.map +1 -0
  43. package/dist/cjs/types.js +17 -0
  44. package/dist/cjs/types.js.map +1 -0
  45. package/dist/cjs/utils/assertValidSecretKey.js +35 -0
  46. package/dist/cjs/utils/assertValidSecretKey.js.map +1 -0
  47. package/dist/cjs/utils/isomorphicAtob.js +36 -0
  48. package/dist/cjs/utils/isomorphicAtob.js.map +1 -0
  49. package/dist/cjs/utils/isomorphicBtoa.js +36 -0
  50. package/dist/cjs/utils/isomorphicBtoa.js.map +1 -0
  51. package/dist/cjs/utils/key.js +49 -0
  52. package/dist/cjs/utils/key.js.map +1 -0
  53. package/dist/cjs/utils/path.js +33 -0
  54. package/dist/cjs/utils/path.js.map +1 -0
  55. package/dist/cjs/utils/response.js +76 -0
  56. package/dist/cjs/utils/response.js.map +1 -0
  57. package/dist/cjs/utils.js +42 -0
  58. package/dist/cjs/utils.js.map +1 -0
  59. package/dist/esm/api/getUserInfo.js +18 -0
  60. package/dist/esm/api/getUserInfo.js.map +1 -0
  61. package/dist/esm/client/provider.js +22 -0
  62. package/dist/esm/client/provider.js.map +1 -0
  63. package/dist/esm/component.client.js +1 -0
  64. package/dist/esm/component.client.js.map +1 -0
  65. package/dist/esm/component.server.js +5 -0
  66. package/dist/esm/component.server.js.map +1 -0
  67. package/dist/esm/components/SignInButton.js +24 -0
  68. package/dist/esm/components/SignInButton.js.map +1 -0
  69. package/dist/esm/components/index.js +5 -0
  70. package/dist/esm/components/index.js.map +1 -0
  71. package/dist/esm/constants.js +87 -0
  72. package/dist/esm/constants.js.map +1 -0
  73. package/dist/esm/global.d.js +1 -0
  74. package/dist/esm/global.d.js.map +1 -0
  75. package/dist/esm/hooks/index.js +5 -0
  76. package/dist/esm/hooks/index.js.map +1 -0
  77. package/dist/esm/hooks/useUser.js +14 -0
  78. package/dist/esm/hooks/useUser.js.map +1 -0
  79. package/dist/esm/icons/logo.js +64 -0
  80. package/dist/esm/icons/logo.js.map +1 -0
  81. package/dist/esm/index.js +15 -0
  82. package/dist/esm/index.js.map +1 -0
  83. package/dist/esm/server/auth.js +13 -0
  84. package/dist/esm/server/auth.js.map +1 -0
  85. package/dist/esm/server/createRedirect.js +65 -0
  86. package/dist/esm/server/createRedirect.js.map +1 -0
  87. package/dist/esm/server/getCurrentUser.js +19 -0
  88. package/dist/esm/server/getCurrentUser.js.map +1 -0
  89. package/dist/esm/server/middleware.js +166 -0
  90. package/dist/esm/server/middleware.js.map +1 -0
  91. package/dist/esm/server/routeMatcher.js +18 -0
  92. package/dist/esm/server/routeMatcher.js.map +1 -0
  93. package/dist/esm/server/serverRedirectWithAuth.js +15 -0
  94. package/dist/esm/server/serverRedirectWithAuth.js.map +1 -0
  95. package/dist/esm/server/type.js +1 -0
  96. package/dist/esm/server/type.js.map +1 -0
  97. package/dist/esm/server/utils.js +79 -0
  98. package/dist/esm/server/utils.js.map +1 -0
  99. package/dist/esm/styles/global.css +334 -0
  100. package/dist/esm/styles/global.css.map +1 -0
  101. package/dist/esm/types.js +1 -0
  102. package/dist/esm/types.js.map +1 -0
  103. package/dist/esm/utils/assertValidSecretKey.js +11 -0
  104. package/dist/esm/utils/assertValidSecretKey.js.map +1 -0
  105. package/dist/esm/utils/isomorphicAtob.js +12 -0
  106. package/dist/esm/utils/isomorphicAtob.js.map +1 -0
  107. package/dist/esm/utils/isomorphicBtoa.js +12 -0
  108. package/dist/esm/utils/isomorphicBtoa.js.map +1 -0
  109. package/dist/esm/utils/key.js +24 -0
  110. package/dist/esm/utils/key.js.map +1 -0
  111. package/dist/esm/utils/path.js +9 -0
  112. package/dist/esm/utils/path.js.map +1 -0
  113. package/dist/esm/utils/response.js +49 -0
  114. package/dist/esm/utils/response.js.map +1 -0
  115. package/dist/esm/utils.js +18 -0
  116. package/dist/esm/utils.js.map +1 -0
  117. package/dist/types/api/getUserInfo.d.ts.map +1 -0
  118. package/dist/types/client/provider.d.ts.map +1 -0
  119. package/dist/types/component.client.d.ts.map +1 -0
  120. package/dist/types/component.server.d.ts.map +1 -0
  121. package/dist/types/components/SignInButton.d.ts.map +1 -0
  122. package/dist/types/components/index.d.ts.map +1 -0
  123. package/dist/types/constants.d.ts.map +1 -0
  124. package/dist/types/hooks/index.d.ts.map +1 -0
  125. package/dist/types/hooks/useUser.d.ts.map +1 -0
  126. package/dist/types/icons/logo.d.ts.map +1 -0
  127. package/dist/types/index.d.ts.map +1 -0
  128. package/dist/types/server/auth.d.ts.map +1 -0
  129. package/dist/types/server/createRedirect.d.ts.map +1 -0
  130. package/dist/types/server/getCurrentUser.d.ts.map +1 -0
  131. package/dist/types/server/middleware.d.ts.map +1 -0
  132. package/dist/types/server/routeMatcher.d.ts.map +1 -0
  133. package/dist/types/server/serverRedirectWithAuth.d.ts.map +1 -0
  134. package/dist/types/server/type.d.ts.map +1 -0
  135. package/dist/types/server/utils.d.ts.map +1 -0
  136. package/dist/types/types.d.ts.map +1 -0
  137. package/dist/types/utils/assertValidSecretKey.d.ts.map +1 -0
  138. package/dist/types/utils/isomorphicAtob.d.ts.map +1 -0
  139. package/dist/types/utils/isomorphicBtoa.d.ts.map +1 -0
  140. package/dist/types/utils/key.d.ts.map +1 -0
  141. package/dist/types/utils/path.d.ts.map +1 -0
  142. package/dist/types/utils/response.d.ts.map +1 -0
  143. package/dist/types/utils.d.ts.map +1 -0
  144. package/package.json +60 -0
@@ -0,0 +1,334 @@
1
+ *,
2
+ ::before,
3
+ ::after {
4
+ box-sizing: border-box;
5
+ border-width: 0;
6
+ border-style: solid;
7
+ border-color: #e5e7eb;
8
+ }
9
+ ::before,
10
+ ::after {
11
+ --tw-content: "";
12
+ }
13
+ html,
14
+ :host {
15
+ line-height: 1.5;
16
+ -webkit-text-size-adjust: 100%;
17
+ -moz-tab-size: 4;
18
+ -o-tab-size: 4;
19
+ tab-size: 4;
20
+ font-family:
21
+ ui-sans-serif,
22
+ system-ui,
23
+ sans-serif,
24
+ "Apple Color Emoji",
25
+ "Segoe UI Emoji",
26
+ "Segoe UI Symbol",
27
+ "Noto Color Emoji";
28
+ font-feature-settings: normal;
29
+ font-variation-settings: normal;
30
+ -webkit-tap-highlight-color: transparent;
31
+ }
32
+ body {
33
+ margin: 0;
34
+ line-height: inherit;
35
+ }
36
+ hr {
37
+ height: 0;
38
+ color: inherit;
39
+ border-top-width: 1px;
40
+ }
41
+ abbr:where([title]) {
42
+ -webkit-text-decoration: underline dotted;
43
+ text-decoration: underline dotted;
44
+ }
45
+ h1,
46
+ h2,
47
+ h3,
48
+ h4,
49
+ h5,
50
+ h6 {
51
+ font-size: inherit;
52
+ font-weight: inherit;
53
+ }
54
+ a {
55
+ color: inherit;
56
+ text-decoration: inherit;
57
+ }
58
+ b,
59
+ strong {
60
+ font-weight: bolder;
61
+ }
62
+ code,
63
+ kbd,
64
+ samp,
65
+ pre {
66
+ font-family:
67
+ ui-monospace,
68
+ SFMono-Regular,
69
+ Menlo,
70
+ Monaco,
71
+ Consolas,
72
+ "Liberation Mono",
73
+ "Courier New",
74
+ monospace;
75
+ font-feature-settings: normal;
76
+ font-variation-settings: normal;
77
+ font-size: 1em;
78
+ }
79
+ small {
80
+ font-size: 80%;
81
+ }
82
+ sub,
83
+ sup {
84
+ font-size: 75%;
85
+ line-height: 0;
86
+ position: relative;
87
+ vertical-align: baseline;
88
+ }
89
+ sub {
90
+ bottom: -0.25em;
91
+ }
92
+ sup {
93
+ top: -0.5em;
94
+ }
95
+ table {
96
+ text-indent: 0;
97
+ border-color: inherit;
98
+ border-collapse: collapse;
99
+ }
100
+ button,
101
+ input,
102
+ optgroup,
103
+ select,
104
+ textarea {
105
+ font-family: inherit;
106
+ font-feature-settings: inherit;
107
+ font-variation-settings: inherit;
108
+ font-size: 100%;
109
+ font-weight: inherit;
110
+ line-height: inherit;
111
+ letter-spacing: inherit;
112
+ color: inherit;
113
+ margin: 0;
114
+ padding: 0;
115
+ }
116
+ button,
117
+ select {
118
+ text-transform: none;
119
+ }
120
+ button,
121
+ input:where([type=button]),
122
+ input:where([type=reset]),
123
+ input:where([type=submit]) {
124
+ -webkit-appearance: button;
125
+ background-color: transparent;
126
+ background-image: none;
127
+ }
128
+ :-moz-focusring {
129
+ outline: auto;
130
+ }
131
+ :-moz-ui-invalid {
132
+ box-shadow: none;
133
+ }
134
+ progress {
135
+ vertical-align: baseline;
136
+ }
137
+ ::-webkit-inner-spin-button,
138
+ ::-webkit-outer-spin-button {
139
+ height: auto;
140
+ }
141
+ [type=search] {
142
+ -webkit-appearance: textfield;
143
+ outline-offset: -2px;
144
+ }
145
+ ::-webkit-search-decoration {
146
+ -webkit-appearance: none;
147
+ }
148
+ ::-webkit-file-upload-button {
149
+ -webkit-appearance: button;
150
+ font: inherit;
151
+ }
152
+ summary {
153
+ display: list-item;
154
+ }
155
+ blockquote,
156
+ dl,
157
+ dd,
158
+ h1,
159
+ h2,
160
+ h3,
161
+ h4,
162
+ h5,
163
+ h6,
164
+ hr,
165
+ figure,
166
+ p,
167
+ pre {
168
+ margin: 0;
169
+ }
170
+ fieldset {
171
+ margin: 0;
172
+ padding: 0;
173
+ }
174
+ legend {
175
+ padding: 0;
176
+ }
177
+ ol,
178
+ ul,
179
+ menu {
180
+ list-style: none;
181
+ margin: 0;
182
+ padding: 0;
183
+ }
184
+ dialog {
185
+ padding: 0;
186
+ }
187
+ textarea {
188
+ resize: vertical;
189
+ }
190
+ input::-moz-placeholder,
191
+ textarea::-moz-placeholder {
192
+ opacity: 1;
193
+ color: #9ca3af;
194
+ }
195
+ input::placeholder,
196
+ textarea::placeholder {
197
+ opacity: 1;
198
+ color: #9ca3af;
199
+ }
200
+ button,
201
+ [role=button] {
202
+ cursor: pointer;
203
+ }
204
+ :disabled {
205
+ cursor: default;
206
+ }
207
+ img,
208
+ svg,
209
+ video,
210
+ canvas,
211
+ audio,
212
+ iframe,
213
+ embed,
214
+ object {
215
+ display: block;
216
+ vertical-align: middle;
217
+ }
218
+ img,
219
+ video {
220
+ max-width: 100%;
221
+ height: auto;
222
+ }
223
+ [hidden] {
224
+ display: none;
225
+ }
226
+ *,
227
+ ::before,
228
+ ::after {
229
+ --tw-border-spacing-x: 0;
230
+ --tw-border-spacing-y: 0;
231
+ --tw-translate-x: 0;
232
+ --tw-translate-y: 0;
233
+ --tw-rotate: 0;
234
+ --tw-skew-x: 0;
235
+ --tw-skew-y: 0;
236
+ --tw-scale-x: 1;
237
+ --tw-scale-y: 1;
238
+ --tw-pan-x: ;
239
+ --tw-pan-y: ;
240
+ --tw-pinch-zoom: ;
241
+ --tw-scroll-snap-strictness: proximity;
242
+ --tw-gradient-from-position: ;
243
+ --tw-gradient-via-position: ;
244
+ --tw-gradient-to-position: ;
245
+ --tw-ordinal: ;
246
+ --tw-slashed-zero: ;
247
+ --tw-numeric-figure: ;
248
+ --tw-numeric-spacing: ;
249
+ --tw-numeric-fraction: ;
250
+ --tw-ring-inset: ;
251
+ --tw-ring-offset-width: 0px;
252
+ --tw-ring-offset-color: #fff;
253
+ --tw-ring-color: rgb(59 130 246 / 0.5);
254
+ --tw-ring-offset-shadow: 0 0 #0000;
255
+ --tw-ring-shadow: 0 0 #0000;
256
+ --tw-shadow: 0 0 #0000;
257
+ --tw-shadow-colored: 0 0 #0000;
258
+ --tw-blur: ;
259
+ --tw-brightness: ;
260
+ --tw-contrast: ;
261
+ --tw-grayscale: ;
262
+ --tw-hue-rotate: ;
263
+ --tw-invert: ;
264
+ --tw-saturate: ;
265
+ --tw-sepia: ;
266
+ --tw-drop-shadow: ;
267
+ --tw-backdrop-blur: ;
268
+ --tw-backdrop-brightness: ;
269
+ --tw-backdrop-contrast: ;
270
+ --tw-backdrop-grayscale: ;
271
+ --tw-backdrop-hue-rotate: ;
272
+ --tw-backdrop-invert: ;
273
+ --tw-backdrop-opacity: ;
274
+ --tw-backdrop-saturate: ;
275
+ --tw-backdrop-sepia: ;
276
+ --tw-contain-size: ;
277
+ --tw-contain-layout: ;
278
+ --tw-contain-paint: ;
279
+ --tw-contain-style: ;
280
+ }
281
+ ::backdrop {
282
+ --tw-border-spacing-x: 0;
283
+ --tw-border-spacing-y: 0;
284
+ --tw-translate-x: 0;
285
+ --tw-translate-y: 0;
286
+ --tw-rotate: 0;
287
+ --tw-skew-x: 0;
288
+ --tw-skew-y: 0;
289
+ --tw-scale-x: 1;
290
+ --tw-scale-y: 1;
291
+ --tw-pan-x: ;
292
+ --tw-pan-y: ;
293
+ --tw-pinch-zoom: ;
294
+ --tw-scroll-snap-strictness: proximity;
295
+ --tw-gradient-from-position: ;
296
+ --tw-gradient-via-position: ;
297
+ --tw-gradient-to-position: ;
298
+ --tw-ordinal: ;
299
+ --tw-slashed-zero: ;
300
+ --tw-numeric-figure: ;
301
+ --tw-numeric-spacing: ;
302
+ --tw-numeric-fraction: ;
303
+ --tw-ring-inset: ;
304
+ --tw-ring-offset-width: 0px;
305
+ --tw-ring-offset-color: #fff;
306
+ --tw-ring-color: rgb(59 130 246 / 0.5);
307
+ --tw-ring-offset-shadow: 0 0 #0000;
308
+ --tw-ring-shadow: 0 0 #0000;
309
+ --tw-shadow: 0 0 #0000;
310
+ --tw-shadow-colored: 0 0 #0000;
311
+ --tw-blur: ;
312
+ --tw-brightness: ;
313
+ --tw-contrast: ;
314
+ --tw-grayscale: ;
315
+ --tw-hue-rotate: ;
316
+ --tw-invert: ;
317
+ --tw-saturate: ;
318
+ --tw-sepia: ;
319
+ --tw-drop-shadow: ;
320
+ --tw-backdrop-blur: ;
321
+ --tw-backdrop-brightness: ;
322
+ --tw-backdrop-contrast: ;
323
+ --tw-backdrop-grayscale: ;
324
+ --tw-backdrop-hue-rotate: ;
325
+ --tw-backdrop-invert: ;
326
+ --tw-backdrop-opacity: ;
327
+ --tw-backdrop-saturate: ;
328
+ --tw-backdrop-sepia: ;
329
+ --tw-contain-size: ;
330
+ --tw-contain-layout: ;
331
+ --tw-contain-paint: ;
332
+ --tw-contain-style: ;
333
+ }
334
+ /*# sourceMappingURL=global.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/styles/global.css"],"sourcesContent":["/*\n! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n"],"mappings":"AAOA;AACA;AACA;AACE,cAAY;AACZ,gBAAc;AACd,gBAAc;AACd,gBAAc;AAChB;AAEA;AACA;AACE,gBAAc;AAChB;AAYA;AACA;AACE,eAAa;AACb,4BAA0B;AAC1B,iBAAe;AACf,eAAa;AACV,YAAU;AACb;AAAA,IAAa,aAAa;AAAA,IAAE,SAAS;AAAA,IAAE,UAAU;AAAA,IAAE,mBAAmB;AAAA,IAAE,gBAAgB;AAAA,IAAE,iBAAiB;AAAA,IAAE;AAC7G,yBAAuB;AACvB,2BAAyB;AACzB,+BAA6B;AAC/B;AAOA;AACE,UAAQ;AACR,eAAa;AACf;AAQA;AACE,UAAQ;AACR,SAAO;AACP,oBAAkB;AACpB;AAMA,IAAI,OAAO,CAAC;AACV,2BAAyB,UAAU;AAC3B,mBAAiB,UAAU;AACrC;AAMA;AACA;AACA;AACA;AACA;AACA;AACE,aAAW;AACX,eAAa;AACf;AAMA;AACE,SAAO;AACP,mBAAiB;AACnB;AAMA;AACA;AACE,eAAa;AACf;AASA;AACA;AACA;AACA;AACE;AAAA,IAAa,YAAY;AAAA,IAAE,cAAc;AAAA,IAAE,KAAK;AAAA,IAAE,MAAM;AAAA,IAAE,QAAQ;AAAA,IAAE,iBAAiB;AAAA,IAAE,aAAa;AAAA,IAAE;AACtG,yBAAuB;AACvB,2BAAyB;AACzB,aAAW;AACb;AAMA;AACE,aAAW;AACb;AAMA;AACA;AACE,aAAW;AACX,eAAa;AACb,YAAU;AACV,kBAAgB;AAClB;AAEA;AACE,UAAQ;AACV;AAEA;AACE,OAAK;AACP;AAQA;AACE,eAAa;AACb,gBAAc;AACd,mBAAiB;AACnB;AAQA;AACA;AACA;AACA;AACA;AACE,eAAa;AACb,yBAAuB;AACvB,2BAAyB;AACzB,aAAW;AACX,eAAa;AACb,eAAa;AACb,kBAAgB;AAChB,SAAO;AACP,UAAQ;AACR,WAAS;AACX;AAMA;AACA;AACE,kBAAgB;AAClB;AAOA;AACA,KAAK,OAAO,CAAC;AACb,KAAK,OAAO,CAAC;AACb,KAAK,OAAO,CAAC;AACX,sBAAoB;AACpB,oBAAkB;AAClB,oBAAkB;AACpB;AAMA;AACE,WAAS;AACX;AAMA;AACE,cAAY;AACd;AAMA;AACE,kBAAgB;AAClB;AAMA;AACA;AACE,UAAQ;AACV;AAOA,CAAC;AACC,sBAAoB;AACpB,kBAAgB;AAClB;AAMA;AACE,sBAAoB;AACtB;AAOA;AACE,sBAAoB;AACpB,QAAM;AACR;AAMA;AACE,WAAS;AACX;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE,UAAQ;AACV;AAEA;AACE,UAAQ;AACR,WAAS;AACX;AAEA;AACE,WAAS;AACX;AAEA;AACA;AACA;AACE,cAAY;AACZ,UAAQ;AACR,WAAS;AACX;AAKA;AACE,WAAS;AACX;AAMA;AACE,UAAQ;AACV;AAOA,KAAK;AAAoB,QAAQ;AAC/B,WAAS;AACT,SAAO;AACT;AAEA,KAAK;AACL,QAAQ;AACN,WAAS;AACT,SAAO;AACT;AAMA;AACA,CAAC;AACC,UAAQ;AACV;AAKA;AACE,UAAQ;AACV;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE,WAAS;AACT,kBAAgB;AAClB;AAMA;AACA;AACE,aAAW;AACX,UAAQ;AACV;AAGA,CAAC;AACC,WAAS;AACX;AAEA;AAAG;AAAU;AACX,yBAAuB;AACvB,yBAAuB;AACvB,oBAAkB;AAClB,oBAAkB;AAClB,eAAa;AACb,eAAa;AACb,eAAa;AACb,gBAAc;AACd,gBAAc;AACd;AACA;AACA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAwB;AACxB,0BAAwB;AACxB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAClC,2BAAyB,EAAE,EAAE;AAC7B,oBAAkB,EAAE,EAAE;AACtB,eAAa,EAAE,EAAE;AACjB,uBAAqB,EAAE,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF;AAEA;AACE,yBAAuB;AACvB,yBAAuB;AACvB,oBAAkB;AAClB,oBAAkB;AAClB,eAAa;AACb,eAAa;AACb,eAAa;AACb,gBAAc;AACd,gBAAc;AACd;AACA;AACA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAwB;AACxB,0BAAwB;AACxB,mBAAiB,IAAI,GAAG,IAAI,IAAI,EAAE;AAClC,2BAAyB,EAAE,EAAE;AAC7B,oBAAkB,EAAE,EAAE;AACtB,eAAa,EAAE,EAAE;AACjB,uBAAqB,EAAE,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF;","names":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types.ts"],"sourcesContent":["import type { NextRequest } from 'next/server';\n\nexport type CabinIDUser = {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n phoneNumber: string;\n createdAt: string;\n updatedAt: string;\n};\n\nexport type CabinIDProviderProps = {\n user: CabinIDUser | null;\n signInUrl: string;\n};\n\nexport type LogoutParams = {\n redirectUrl?: string;\n};\n\nexport type ResponseDataType<T> = {\n data?: T;\n error: any;\n loading: boolean;\n};\n\n/**\n * Enables autocompletion for a union type, while keeping the ability to use any string\n * or type of `T`\n */\nexport type Autocomplete<U extends T, T = string> =\n | U\n | (T & Record<never, never>);\n\n/**\n * Omit without union flattening\n * */\nexport type Without<T, W> = {\n [P in keyof T as Exclude<P, W>]: T[P];\n};\n\nexport type IgnoredRoutesParam =\n | Array<RegExp | string>\n | RegExp\n | string\n | ((req: NextRequest) => boolean);\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var assertValidSecretKey_exports = {};
20
+ __export(assertValidSecretKey_exports, {
21
+ assertValidSecretKey: () => assertValidSecretKey
22
+ });
23
+ module.exports = __toCommonJS(assertValidSecretKey_exports);
24
+ function assertValidSecretKey(val) {
25
+ if (!val || typeof val !== "string") {
26
+ throw Error(
27
+ "Missing Clerk Secret Key. Go to https://cabinid.dev and get your key for your instance."
28
+ );
29
+ }
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ assertValidSecretKey
34
+ });
35
+ //# sourceMappingURL=assertValidSecretKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/assertValidSecretKey.ts"],"sourcesContent":["export function assertValidSecretKey(val: unknown): asserts val is string {\n if (!val || typeof val !== 'string') {\n throw Error(\n 'Missing Clerk Secret Key. Go to https://cabinid.dev and get your key for your instance.'\n );\n }\n\n //TODO: Check if the key is invalid and throw error\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,qBAAqB,KAAqC;AACxE,MAAI,CAAC,OAAO,OAAO,QAAQ,UAAU;AACnC,UAAM;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AAGF;","names":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var isomorphicAtob_exports = {};
20
+ __export(isomorphicAtob_exports, {
21
+ isomorphicAtob: () => isomorphicAtob
22
+ });
23
+ module.exports = __toCommonJS(isomorphicAtob_exports);
24
+ const isomorphicAtob = (data) => {
25
+ if (typeof atob !== "undefined" && typeof atob === "function") {
26
+ return atob(data);
27
+ } else if (typeof global !== "undefined" && global.Buffer) {
28
+ return new global.Buffer(data, "base64").toString();
29
+ }
30
+ return data;
31
+ };
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ isomorphicAtob
35
+ });
36
+ //# sourceMappingURL=isomorphicAtob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/isomorphicAtob.ts"],"sourcesContent":["/**\n * A function that decodes a string of data which has been encoded using base-64 encoding.\n * Uses `atob` if available, otherwise uses `Buffer` from `global`. If neither are available, returns the data as-is.\n */\nexport const isomorphicAtob = (data: string) => {\n if (typeof atob !== 'undefined' && typeof atob === 'function') {\n return atob(data);\n } else if (typeof global !== 'undefined' && global.Buffer) {\n return new global.Buffer(data, 'base64').toString();\n }\n return data;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,iBAAiB,CAAC,SAAiB;AAC9C,MAAI,OAAO,SAAS,eAAe,OAAO,SAAS,YAAY;AAC7D,WAAO,KAAK,IAAI;AAAA,EAClB,WAAW,OAAO,WAAW,eAAe,OAAO,QAAQ;AACzD,WAAO,IAAI,OAAO,OAAO,MAAM,QAAQ,EAAE,SAAS;AAAA,EACpD;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var isomorphicBtoa_exports = {};
20
+ __export(isomorphicBtoa_exports, {
21
+ isomorphicBtoa: () => isomorphicBtoa
22
+ });
23
+ module.exports = __toCommonJS(isomorphicBtoa_exports);
24
+ const isomorphicBtoa = (data) => {
25
+ if (typeof btoa !== "undefined" && typeof btoa === "function") {
26
+ return btoa(data);
27
+ } else if (typeof global !== "undefined" && global.Buffer) {
28
+ return new global.Buffer(data).toString("base64");
29
+ }
30
+ return data;
31
+ };
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ isomorphicBtoa
35
+ });
36
+ //# sourceMappingURL=isomorphicBtoa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/isomorphicBtoa.ts"],"sourcesContent":["export const isomorphicBtoa = (data: string) => {\n if (typeof btoa !== 'undefined' && typeof btoa === 'function') {\n return btoa(data);\n } else if (typeof global !== 'undefined' && global.Buffer) {\n return new global.Buffer(data).toString('base64');\n }\n return data;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,iBAAiB,CAAC,SAAiB;AAC9C,MAAI,OAAO,SAAS,eAAe,OAAO,SAAS,YAAY;AAC7D,WAAO,KAAK,IAAI;AAAA,EAClB,WAAW,OAAO,WAAW,eAAe,OAAO,QAAQ;AACzD,WAAO,IAAI,OAAO,OAAO,IAAI,EAAE,SAAS,QAAQ;AAAA,EAClD;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var key_exports = {};
20
+ __export(key_exports, {
21
+ isPublishableKey: () => isPublishableKey,
22
+ parsePublishableKey: () => parsePublishableKey
23
+ });
24
+ module.exports = __toCommonJS(key_exports);
25
+ var import_isomorphicAtob = require("./isomorphicAtob");
26
+ const PUBLISHABLE_KEY_PREFIX = "cabin_pk_";
27
+ function isPublishableKey(key) {
28
+ key = key || "";
29
+ const hasValidPrefix = key.startsWith(PUBLISHABLE_KEY_PREFIX);
30
+ const hasValidFrontendApiPostfix = (0, import_isomorphicAtob.isomorphicAtob)(
31
+ key.split("_")[2] || ""
32
+ ).endsWith("$");
33
+ return hasValidPrefix && hasValidFrontendApiPostfix;
34
+ }
35
+ function parsePublishableKey(key) {
36
+ key = key || "";
37
+ if (!key || !isPublishableKey(key)) {
38
+ return null;
39
+ }
40
+ let frontendApi = (0, import_isomorphicAtob.isomorphicAtob)(key.split("_")[2]);
41
+ frontendApi = frontendApi.slice(0, -1);
42
+ return frontendApi;
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ isPublishableKey,
47
+ parsePublishableKey
48
+ });
49
+ //# sourceMappingURL=key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/key.ts"],"sourcesContent":["import { isomorphicAtob } from './isomorphicAtob';\n\ntype PublishableKey = string;\n\nconst PUBLISHABLE_KEY_PREFIX = 'cabin_pk_';\n\nexport function isPublishableKey(key: string) {\n key = key || '';\n\n const hasValidPrefix = key.startsWith(PUBLISHABLE_KEY_PREFIX);\n\n const hasValidFrontendApiPostfix = isomorphicAtob(\n key.split('_')[2] || ''\n ).endsWith('$');\n\n return hasValidPrefix && hasValidFrontendApiPostfix;\n}\n\nexport function parsePublishableKey(\n key: string | undefined\n): PublishableKey | null {\n key = key || '';\n\n if (!key || !isPublishableKey(key)) {\n return null;\n }\n\n let frontendApi = isomorphicAtob(key.split('_')[2]);\n\n // TODO(@dimkl): validate packages/clerk-js/src/utils/instance.ts\n frontendApi = frontendApi.slice(0, -1);\n\n return frontendApi;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAI/B,MAAM,yBAAyB;AAExB,SAAS,iBAAiB,KAAa;AAC5C,QAAM,OAAO;AAEb,QAAM,iBAAiB,IAAI,WAAW,sBAAsB;AAE5D,QAAM,iCAA6B;AAAA,IACjC,IAAI,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,EACvB,EAAE,SAAS,GAAG;AAEd,SAAO,kBAAkB;AAC3B;AAEO,SAAS,oBACd,KACuB;AACvB,QAAM,OAAO;AAEb,MAAI,CAAC,OAAO,CAAC,iBAAiB,GAAG,GAAG;AAClC,WAAO;AAAA,EACT;AAEA,MAAI,kBAAc,sCAAe,IAAI,MAAM,GAAG,EAAE,CAAC,CAAC;AAGlD,gBAAc,YAAY,MAAM,GAAG,EAAE;AAErC,SAAO;AACT;","names":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var path_exports = {};
20
+ __export(path_exports, {
21
+ joinPaths: () => joinPaths
22
+ });
23
+ module.exports = __toCommonJS(path_exports);
24
+ const SEPARATOR = "/";
25
+ const MULTIPLE_SEPARATOR_REGEX = new RegExp("(?<!:)" + SEPARATOR + "{1,}", "g");
26
+ function joinPaths(...args) {
27
+ return args.filter((p) => p).join(SEPARATOR).replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ joinPaths
32
+ });
33
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/path.ts"],"sourcesContent":["const SEPARATOR = '/';\nconst MULTIPLE_SEPARATOR_REGEX = new RegExp('(?<!:)' + SEPARATOR + '{1,}', 'g');\n\ntype PathString = string | null | undefined;\n\nexport function joinPaths(...args: PathString[]): string {\n return args\n .filter(p => p)\n .join(SEPARATOR)\n .replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,YAAY;AAClB,MAAM,2BAA2B,IAAI,OAAO,WAAW,YAAY,QAAQ,GAAG;AAIvE,SAAS,aAAa,MAA4B;AACvD,SAAO,KACJ,OAAO,OAAK,CAAC,EACb,KAAK,SAAS,EACd,QAAQ,0BAA0B,SAAS;AAChD;","names":[]}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var response_exports = {};
20
+ __export(response_exports, {
21
+ isRedirect: () => isRedirect,
22
+ mergeResponses: () => mergeResponses,
23
+ setHeader: () => setHeader,
24
+ stringifyHeaders: () => stringifyHeaders
25
+ });
26
+ module.exports = __toCommonJS(response_exports);
27
+ var import_server = require("next/server");
28
+ var import_constants = require("../constants");
29
+ const mergeResponses = (...responses) => {
30
+ const normalisedResponses = responses.filter(Boolean).map((res) => {
31
+ if (res instanceof import_server.NextResponse) {
32
+ return res;
33
+ }
34
+ return new import_server.NextResponse(res.body, res);
35
+ });
36
+ if (normalisedResponses.length === 0) {
37
+ return;
38
+ }
39
+ const lastResponse = normalisedResponses[normalisedResponses.length - 1];
40
+ const finalResponse = new import_server.NextResponse(lastResponse.body, lastResponse);
41
+ for (const response of normalisedResponses) {
42
+ response.headers.forEach((value, name) => {
43
+ finalResponse.headers.set(name, value);
44
+ });
45
+ response.cookies.getAll().forEach((cookie) => {
46
+ const { name, value, ...options } = cookie;
47
+ finalResponse.cookies.set(name, value, options);
48
+ });
49
+ }
50
+ return finalResponse;
51
+ };
52
+ const isRedirect = (res) => {
53
+ return res.headers.get(import_constants.constants.NextHeaders.NextRedirect);
54
+ };
55
+ const setHeader = (res, name, val) => {
56
+ res.headers.set(name, val);
57
+ return res;
58
+ };
59
+ const stringifyHeaders = (headers) => {
60
+ if (!headers) {
61
+ return JSON.stringify({});
62
+ }
63
+ const obj = {};
64
+ headers.forEach((value, name) => {
65
+ obj[name] = value;
66
+ });
67
+ return JSON.stringify(obj);
68
+ };
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ isRedirect,
72
+ mergeResponses,
73
+ setHeader,
74
+ stringifyHeaders
75
+ });
76
+ //# sourceMappingURL=response.js.map