@happykit/auth-email
Version:
- A `useAuth` hook which returns the current user - An optional `getServerSideAuth` for server-side rendering - HappyAuth is tiny - it adds only 4.6 kB to the first load JS - it adds less than 0.04 kB if you're transitioning from another page - Extremely
1 lines • 30.7 kB
JavaScript
module.exports=function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(r,o,function(e){return n[e]}.bind(null,o));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=21)}([function(n,e){n.exports=require("react")},function(n,e){n.exports=require("classnames")},function(n,e){n.exports=require("@xstate/fsm")},function(n,e){n.exports=require("@xstate/react/lib/fsm")},,function(n,e){n.exports=require("next/head")},function(n,e,t){var r=t(7);n.exports="string"==typeof r?r:r.toString()},function(n,e,t){(e=t(8)(!1)).push([n.i,'/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the `main` element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * 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/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type="button"],\n[type="reset"],\n[type="submit"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type="button"]::-moz-focus-inner,\n[type="reset"]::-moz-focus-inner,\n[type="submit"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type="button"]:-moz-focusring,\n[type="reset"]:-moz-focusring,\n[type="submit"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type="checkbox"],\n[type="radio"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type="number"]::-webkit-inner-spin-button,\n[type="number"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type="search"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type="search"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. 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/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\n/**\n * Manually forked from SUIT CSS Base: https://github.com/suitcss/base\n * A thin layer on top of normalize.css that provides a starting point more\n * suitable for web applications.\n */\n\n/**\n * Removes 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\nbutton {\n background-color: transparent;\n background-image: none;\n padding: 0;\n}\n\n/**\n * Work around a Firefox/IE bug where the transparent `button` background\n * results in a loss of the default `button` focus styles.\n */\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/**\n * Tailwind custom reset styles\n */\n\n/**\n * 1. Use the user\'s configured `sans` font-family (with Tailwind\'s default\n * sans-serif font stack as a fallback) as a sane default.\n * 2. Use Tailwind\'s default "normal" line-height so the user isn\'t forced\n * to override it to ensure consistency even when using the default theme.\n */\n\nhtml {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */\n line-height: 1.5; /* 2 */\n}\n\n/**\n * 1. Prevent padding and border from affecting element width.\n *\n * We used to set this in the html element and inherit from\n * the parent element for everything else. This caused issues\n * in shadow-dom-enhanced elements like <details> where the content\n * is wrapped by a div with box-sizing set to `content-box`.\n *\n * https://github.com/mozdevs/cssremedy/issues/4\n *\n *\n * 2. Allow adding a border to an element by just adding a border-width.\n *\n * By default, the way the browser specifies that an element should have no\n * border is by setting it\'s border-style to `none` in the user-agent\n * stylesheet.\n *\n * In order to easily add borders to elements by just setting the `border-width`\n * property, we change the default border-style for all elements to `solid`, and\n * use border-width to hide them instead. This way our `border` utilities only\n * need to set the `border-width` property instead of the entire `border`\n * shorthand, making our border utilities much more straightforward to compose.\n *\n * 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: #e2e8f0; /* 2 */\n}\n\n/*\n * Ensure horizontal rules are visible by default\n */\n\nhr {\n border-top-width: 1px;\n}\n\n/**\n * Undo the `border-style: none` reset that Normalize applies to images so that\n * our `border-{width}` utilities have the expected effect.\n *\n * The Normalize reset is unnecessary for us since we default the border-width\n * to 0 on all elements.\n *\n * https://github.com/tailwindcss/tailwindcss/issues/362\n */\n\nimg {\n border-style: solid;\n}\n\ntextarea {\n resize: vertical;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #a0aec0;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #a0aec0;\n}\n\ninput::-ms-input-placeholder, textarea::-ms-input-placeholder {\n color: #a0aec0;\n}\n\ninput::placeholder,\ntextarea::placeholder {\n color: #a0aec0;\n}\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\ntable {\n border-collapse: collapse;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/**\n * Reset links to optimize for opt-in styling instead of\n * opt-out.\n */\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/**\n * Reset form element properties that are easy to forget to\n * style explicitly so you don\'t inadvertently introduce\n * styles that deviate from your design system. These styles\n * supplement a partial reset that is already applied by\n * normalize.css.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n}\n\n/**\n * Use the configured \'mono\' font family for elements that\n * are expected to be rendered with a monospace font, falling\n * back to the system monospace stack if there is no configured\n * \'mono\' font family.\n */\n\npre,\ncode,\nkbd,\nsamp {\n font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n/**\n * Make replaced elements `display: block` by default as that\'s\n * the behavior you want almost all of the time. Inspired by\n * CSS Remedy, with `svg` added as well.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n vertical-align: middle;\n}\n\n/**\n * Constrain images and videos to the parent width and preserve\n * their instrinsic aspect ratio.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n\n.appearance-none {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.bg-white {\n --bg-opacity: 1;\n background-color: #fff;\n background-color: rgba(255, 255, 255, var(--bg-opacity));\n}\n\n.bg-red-100 {\n --bg-opacity: 1;\n background-color: #fff5f5;\n background-color: rgba(255, 245, 245, var(--bg-opacity));\n}\n\n.bg-orange-100 {\n --bg-opacity: 1;\n background-color: #fffaf0;\n background-color: rgba(255, 250, 240, var(--bg-opacity));\n}\n\n.bg-green-100 {\n --bg-opacity: 1;\n background-color: #f0fff4;\n background-color: rgba(240, 255, 244, var(--bg-opacity));\n}\n\n.bg-indigo-100 {\n --bg-opacity: 1;\n background-color: #ebf4ff;\n background-color: rgba(235, 244, 255, var(--bg-opacity));\n}\n\n.bg-indigo-600 {\n --bg-opacity: 1;\n background-color: #5a67d8;\n background-color: rgba(90, 103, 216, var(--bg-opacity));\n}\n\n.hover\\:bg-gray-100:hover {\n --bg-opacity: 1;\n background-color: #f7fafc;\n background-color: rgba(247, 250, 252, var(--bg-opacity));\n}\n\n.hover\\:bg-indigo-500:hover {\n --bg-opacity: 1;\n background-color: #667eea;\n background-color: rgba(102, 126, 234, var(--bg-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.border-gray-300 {\n --border-opacity: 1;\n border-color: #e2e8f0;\n border-color: rgba(226, 232, 240, var(--border-opacity));\n}\n\n.border-gray-400 {\n --border-opacity: 1;\n border-color: #cbd5e0;\n border-color: rgba(203, 213, 224, var(--border-opacity));\n}\n\n.border-red-300 {\n --border-opacity: 1;\n border-color: #feb2b2;\n border-color: rgba(254, 178, 178, var(--border-opacity));\n}\n\n.border-red-500 {\n --border-opacity: 1;\n border-color: #f56565;\n border-color: rgba(245, 101, 101, var(--border-opacity));\n}\n\n.border-orange-500 {\n --border-opacity: 1;\n border-color: #ed8936;\n border-color: rgba(237, 137, 54, var(--border-opacity));\n}\n\n.border-green-500 {\n --border-opacity: 1;\n border-color: #48bb78;\n border-color: rgba(72, 187, 120, var(--border-opacity));\n}\n\n.border-indigo-500 {\n --border-opacity: 1;\n border-color: #667eea;\n border-color: rgba(102, 126, 234, var(--border-opacity));\n}\n\n.focus\\:border-indigo-700:focus {\n --border-opacity: 1;\n border-color: #4c51bf;\n border-color: rgba(76, 81, 191, var(--border-opacity));\n}\n\n.rounded {\n border-radius: 0.25rem;\n}\n\n.rounded-md {\n border-radius: 0.375rem;\n}\n\n.rounded-lg {\n border-radius: 0.5rem;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-l-4 {\n border-left-width: 4px;\n}\n\n.border-t {\n border-top-width: 1px;\n}\n\n.border-b {\n border-bottom-width: 1px;\n}\n\n.block {\n display: block;\n}\n\n.flex {\n display: flex;\n}\n\n.hidden {\n display: none;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.justify-around {\n justify-content: space-around;\n}\n\n.flex-auto {\n flex: 1 1 auto;\n}\n\n.flex-initial {\n flex: 0 1 auto;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.font-semibold {\n font-weight: 600;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-extrabold {\n font-weight: 800;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n}\n\n.text-3xl {\n font-size: 1.875rem;\n}\n\n.leading-5 {\n line-height: 1.25rem;\n}\n\n.leading-9 {\n line-height: 2.25rem;\n}\n\n.leading-normal {\n line-height: 1.5;\n}\n\n.my-3 {\n margin-top: 0.75rem;\n margin-bottom: 0.75rem;\n}\n\n.mt-2 {\n margin-top: 0.5rem;\n}\n\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n\n.ml-2 {\n margin-left: 0.5rem;\n}\n\n.mt-3 {\n margin-top: 0.75rem;\n}\n\n.mt-4 {\n margin-top: 1rem;\n}\n\n.mt-6 {\n margin-top: 1.5rem;\n}\n\n.mt-8 {\n margin-top: 2rem;\n}\n\n.max-w-md {\n max-width: 28rem;\n}\n\n.min-h-screen {\n min-height: 100vh;\n}\n\n.opacity-50 {\n opacity: 0.5;\n}\n\n.focus\\:outline-none:focus {\n outline: 0;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n.py-12 {\n padding-top: 3rem;\n padding-bottom: 3rem;\n}\n\n.static {\n position: static;\n}\n\n.shadow {\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);\n}\n\n.focus\\:shadow-outline:focus {\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);\n}\n\n.text-center {\n text-align: center;\n}\n\n.text-white {\n --text-opacity: 1;\n color: #fff;\n color: rgba(255, 255, 255, var(--text-opacity));\n}\n\n.text-gray-600 {\n --text-opacity: 1;\n color: #718096;\n color: rgba(113, 128, 150, var(--text-opacity));\n}\n\n.text-gray-700 {\n --text-opacity: 1;\n color: #4a5568;\n color: rgba(74, 85, 104, var(--text-opacity));\n}\n\n.text-gray-800 {\n --text-opacity: 1;\n color: #2d3748;\n color: rgba(45, 55, 72, var(--text-opacity));\n}\n\n.text-gray-900 {\n --text-opacity: 1;\n color: #1a202c;\n color: rgba(26, 32, 44, var(--text-opacity));\n}\n\n.text-red-600 {\n --text-opacity: 1;\n color: #e53e3e;\n color: rgba(229, 62, 62, var(--text-opacity));\n}\n\n.text-red-700 {\n --text-opacity: 1;\n color: #c53030;\n color: rgba(197, 48, 48, var(--text-opacity));\n}\n\n.text-orange-700 {\n --text-opacity: 1;\n color: #c05621;\n color: rgba(192, 86, 33, var(--text-opacity));\n}\n\n.text-green-700 {\n --text-opacity: 1;\n color: #2f855a;\n color: rgba(47, 133, 90, var(--text-opacity));\n}\n\n.text-indigo-600 {\n --text-opacity: 1;\n color: #5a67d8;\n color: rgba(90, 103, 216, var(--text-opacity));\n}\n\n.text-indigo-700 {\n --text-opacity: 1;\n color: #4c51bf;\n color: rgba(76, 81, 191, var(--text-opacity));\n}\n\n.hover\\:text-indigo-500:hover {\n --text-opacity: 1;\n color: #667eea;\n color: rgba(102, 126, 234, var(--text-opacity));\n}\n\n.underline {\n text-decoration: underline;\n}\n\n.focus\\:underline:focus {\n text-decoration: underline;\n}\n\n.select-none {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-full {\n width: 100%;\n}\n\n.transition {\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;\n}\n\n.ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.duration-150 {\n transition-duration: 150ms;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n }\n}\n\n@media (min-width: 1024px) {\n\n .lg\\:px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n }\n}\n',""]),n.exports=e},function(n,e,t){"use strict";n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var t=function(n,e){var t=n[1]||"",r=n[3];if(!r)return t;if(e&&"function"==typeof btoa){var o=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),i=r.sources.map((function(n){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(n," */")}));return[t].concat(i).concat([o]).join("\n")}var a,s,l;return[t].join("\n")}(e,n);return e[2]?"@media ".concat(e[2]," {").concat(t,"}"):t})).join("")},e.i=function(n,t,r){"string"==typeof n&&(n=[[null,n,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<n.length;s++){var l=[].concat(n[s]);r&&o[l[0]]||(t&&(l[2]?l[2]="".concat(t," and ").concat(l[2]):l[2]=t),e.push(l))}},e}},function(n,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(n,e,t,r){void 0===r&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){void 0===r&&(r=t),n[r]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),i=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)"default"!==t&&Object.hasOwnProperty.call(n,t)&&r(e,n,t);return o(e,n),e};Object.defineProperty(e,"__esModule",{value:!0}),e.SuccessMessage=e.WarningMessage=e.ErrorMessage=void 0;var a=i(t(0));e.ErrorMessage=function(n){return a.createElement("div",{className:"mt-3 bg-red-100 border-l-4 border-red-500 text-red-700 p-4",role:"alert"},a.createElement("p",{className:"font-bold"},n.title),n.children)},e.WarningMessage=function(n){return a.createElement("div",{className:"mt-3 bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4",role:"alert"},a.createElement("p",{className:"font-bold"},n.title),n.children)},e.SuccessMessage=function(n){return a.createElement("div",{className:"mt-3 bg-green-100 border-l-4 border-green-500 text-green-700 p-4",role:"alert"},n.title&&a.createElement("p",{className:"font-bold"},n.title),n.children)}},,function(n,e,t){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(n,e,t,r){void 0===r&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){void 0===r&&(r=t),n[r]=e[t]}),i=this&&this.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),a=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)"default"!==t&&Object.hasOwnProperty.call(n,t)&&o(e,n,t);return i(e,n),e},s=this&&this.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t},l=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.submitAssigner=e.touchedAssigner=e.inputAssigner=e.hasValidationErrors=e.InputGroup=void 0;var c=a(t(0)),d=l(t(1)),u=l(t(12));e.InputGroup=function(n){var e=n.id,t=n.label,o=n.error,i=n.touched,a=s(n,["id","label","error","touched"]);return c.createElement("label",{className:"block mt-4",htmlFor:e},c.createElement("span",{className:"mb-2 block text-sm font-medium leading-5 text-gray-700"},t)," ",c.createElement("input",r({className:d.default("bg-white focus:outline-none focus:shadow-outline border rounded-lg py-2 px-4 block w-full appearance-none leading-normal",i&&o?"border-red-300":"border-gray-300"),id:e},a)),i&&o&&c.createElement("p",{className:"mt-2 text-sm text-red-600"},o))},e.hasValidationErrors=function(n){return Object.values(n).some(Boolean)},e.inputAssigner=function(n){return function(e,t){var o=r(r({},e.values),t.payload),i=n(o);return r(r({},e),{values:o,validationErrors:i})}},e.touchedAssigner=function(n){return function(e,t){var o=r(r({},e.touched),t.payload),i=n(e.values);return r(r({},e),{touched:o,validationErrors:i})}},e.submitAssigner=function(n){return function(e,t){var o=u.default(e.touched,(function(){return!0})),i=n(e.values);return r(r({},e),{touched:o,validationErrors:i})}}},function(n,e){n.exports=require("lodash.mapvalues")},,,,,,,,,function(n,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(n,e,t,r){void 0===r&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){void 0===r&&(r=t),n[r]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),i=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)"default"!==t&&Object.hasOwnProperty.call(n,t)&&r(e,n,t);return o(e,n),e},a=this&&this.__awaiter||function(n,e,t,r){return new(t||(t=Promise))((function(o,i){function a(n){try{l(r.next(n))}catch(n){i(n)}}function s(n){try{l(r.throw(n))}catch(n){i(n)}}function l(n){var e;n.done?o(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,s)}l((r=r.apply(n,e||[])).next())}))},s=this&&this.__generator||function(n,e){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(n,a)}catch(n){i=[6,n],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},l=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForgotPassword=void 0;var c=i(t(0)),d=l(t(5)),u=l(t(1)),p=l(t(6)),b=t(11),m=t(2),f=t(3),h=t(9);function g(n){return{email:(e=n.email.trim(),0===e.length?"missing":e.length<=5?"invalid":e.includes("@")&&e.includes(".")?null:"invalid")};var e}var y=m.createMachine({id:"forgotPasswordMachine",initial:"form",context:{values:{email:""},error:null,touched:{email:!1},validationErrors:{email:null}},states:{form:{on:{INPUT:{target:"form",actions:m.assign(b.inputAssigner(g))},BLUR:{target:"form",actions:m.assign(b.touchedAssigner(g))},SUBMIT:{target:"submitting",actions:m.assign(b.submitAssigner(g))}}},submitting:{entry:["submit"],on:{ERROR:{target:"form",actions:m.assign({error:function(n,e){return e.payload}})},SENT:"sent"}},sent:{}}});e.ForgotPassword=function(n){var e=f.useMachine(y),t=e[0],r=e[1];return c.useEffect((function(){t.actions.forEach((function(e){switch(e.type){case"submit":!function(n,e,t){var r;a(this,void 0,void 0,(function(){var o,i;return s(this,(function(a){switch(a.label){case 0:if(b.hasValidationErrors(n.context.validationErrors))return t({type:"ERROR",payload:null}),[2];if(!e.forgotPassword)throw new Error('Tried to call auth.forgotPassword, but it does not exist on state "'+e.state+'"');a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.forgotPassword(n.context.values.email)];case 2:return o=a.sent(),(null===(r=o.data)||void 0===r?void 0:r.ok)?t({type:"SENT"}):t({type:"ERROR",payload:o.error||null}),[3,4];case 3:return i=a.sent(),console.error(i),t({type:"ERROR",payload:{code:"unexpected",message:"An unexpected error occurred"}}),[3,4];case 4:return[2]}}))}))}(t,n.auth,r)}}))}),[t,n.auth]),c.createElement(c.Fragment,null,c.createElement(d.default,null,c.createElement("style",null,p.default)),c.createElement("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8"},c.createElement("div",{className:"max-w-md w-full"},c.createElement("div",null,c.createElement("h2",{className:"text-center text-3xl leading-9 font-extrabold text-gray-900"},"Forgot your password?"),c.createElement("p",{className:"mt-2 text-center text-sm leading-5 text-gray-600"},"Enter your email and we will send instructions to reset your password")),"sent"===t.value?c.createElement(h.SuccessMessage,{title:"Email sent"},c.createElement("p",{className:"text-sm"},"In case ",c.createElement("b",null,t.context.values.email)," is connected to an account, an email with a link to reset your password has been sent to it.")):c.createElement("form",{onSubmit:function(n){n.preventDefault(),r({type:"SUBMIT"})},className:u.default("mt-8","submitting"===t.value&&"opacity-50"),noValidate:!0},c.createElement(b.InputGroup,{id:"email",label:"Email address",type:"email",autoComplete:"email",required:!0,touched:t.context.touched.email,error:function(){switch(t.context.validationErrors.email){case"missing":return"The email address is missing.";case"invalid":return"The email address doesn't seem valid.";default:return null}}(),value:t.context.values.email,disabled:"submitting"===t.value,onChange:function(n){var e=n.target.value;r({type:"INPUT",payload:{email:e}})},onBlur:function(){r({type:"BLUR",payload:{email:!0}})}}),c.createElement("div",{className:"mt-6"},c.createElement("button",{type:"submit",className:"w-full flex justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:shadow-outline-indigo active:bg-indigo-700 transition duration-150 ease-in-out",disabled:"submitting"===t.value},"Reset my password"))))))}}]);