{"version":3,"sources":["webpack:///./src/ui/pages/SetupPage/SetupForm.module.less?edc6","../../node_modules/.pnpm/@ant-design+icons@4.7.0_react-dom@17.0.2_react@17.0.2/node_modules/@ant-design/icons/lib/icons/BankOutlined.js","../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/BankOutlined.js","lib/commons/passwordValidator.ts","ui/pages/SetupPage/SetupForm.tsx"],"names":["_interopRequireWildcard","require","_interopRequireDefault","Object","defineProperty","exports","value","default","_objectSpread2","React","_BankOutlined","_AntdIcon","BankOutlined","props","ref","createElement","icon","displayName","_default","forwardRef","validatePassword","rule","callback","length","TermsSwitch","children","name","className","onChange","classNames","styles","termsSwitch","SetupForm","appService","ApplicationServices","get","useState","step","setStep","loading","setLoading","emailOptout","setEmailOptout","submit","values","nonSensitiveUserData","email","company","analyticsService","track","user","userService","createUser","storageService","saveUserInfo","_emailOptout","_name","_suggestedInfo","companyName","reloadPage","handleError","fullLogo","registrationForm","required","message","type","validator","getFieldValue","_","Promise","resolve","reject","Error","val"],"mappings":";;;;;AAAA;AACA,kBAAkB,oX;;;;;;;;ACDL;;AAEb,IAAIA,uBAAuB,GAAGC,mBAAO,CAAC,EAAD,CAArC;;AAEA,IAAIC,sBAAsB,GAAGD,mBAAO,CAAC,CAAD,CAApC;;AAEAE,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;EAC3CC,KAAK,EAAE;AADoC,CAA7C;AAGAD,OAAO,CAACE,OAAR,GAAkB,KAAK,CAAvB;;AAEA,IAAIC,cAAc,GAAGN,sBAAsB,CAACD,mBAAO,CAAC,EAAD,CAAR,CAA3C;;AAEA,IAAIQ,KAAK,GAAGT,uBAAuB,CAACC,mBAAO,CAAC,CAAD,CAAR,CAAnC;;AAEA,IAAIS,aAAa,GAAGR,sBAAsB,CAACD,mBAAO,CAAC,IAAD,CAAR,CAA1C;;AAEA,IAAIU,SAAS,GAAGT,sBAAsB,CAACD,m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FAjEF,GALF,GADF,EAtBJ,GADF,EADF,EADF,CA2GD,C","file":"static/js/127.e04e04f8.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"setup-action-buttons\":\"SetupForm_setup-action-buttons__20_Ok\",\"setup-checkboxes\":\"SetupForm_setup-checkboxes__-dpVJ\",\"setup-switch\":\"SetupForm_setup-switch__158N-\",\"setup-form-card\":\"SetupForm_setup-form-card__USgxp\",\"ant-card-head\":\"SetupForm_ant-card-head__3eqK6\",\"setup-form-company\":\"SetupForm_setup-form-company__2KEiq\",\"termsSwitch\":\"SetupForm_termsSwitch__tTFzM\"};","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _BankOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/BankOutlined\"));\n\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\n\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nvar BankOutlined = function BankOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _BankOutlined.default\n }));\n};\n\nBankOutlined.displayName = 'BankOutlined';\n\nvar _default = /*#__PURE__*/React.forwardRef(BankOutlined);\n\nexports.default = _default;","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BankOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z\" } }] }, \"name\": \"bank\", \"theme\": \"outlined\" };\nexports.default = BankOutlined;\n","export const validatePassword = (rule, value, callback) => {\n if (value && value.length < 8) {\n callback(\"Password should be at least 8 characters\")\n } else {\n callback()\n }\n}\n","import * as React from \"react\"\nimport { Button, Form, Switch } from \"antd\"\nimport styles from \"./SetupForm.module.less\"\n\nimport LockOutlined from \"@ant-design/icons/lib/icons/LockOutlined\"\nimport MailOutlined from \"@ant-design/icons/lib/icons/MailOutlined\"\n\nimport { reloadPage } from \"lib/commons/utils\"\nimport ApplicationServices from \"../../../lib/services/ApplicationServices\"\nimport { handleError } from \"lib/components/components\"\nimport UserOutlined from \"@ant-design/icons/lib/icons/UserOutlined\"\nimport BankOutlined from \"@ant-design/icons/lib/icons/BankOutlined\"\nimport { useState } from \"react\"\n\nimport fullLogo from \"../../../icons/logo.svg\"\nimport { FloatingLabelInput } from \"ui/components/FloatingLabelInput/FloatingLabelInput\"\nimport classNames from \"classnames\"\nimport { validatePassword } from \"lib/commons/passwordValidator\"\n\nimport CloseOutlined from \"@ant-design/icons/lib/icons/CloseOutlined\"\nimport CheckOutlined from \"@ant-design/icons/lib/icons/CheckOutlined\"\nimport { SignupRequest } from \"../../../generated/conf-openapi\"\n\ntype State = {\n loading?: boolean\n tosAgree: boolean\n emailOptout: boolean\n usageOptout: boolean\n}\n\nfunction TermsSwitch({\n children,\n name,\n className = \"\",\n onChange,\n}: {\n children: React.ReactNode\n name: string\n className?: string\n onChange: (val: boolean) => void\n}) {\n return (\n \n }\n unCheckedChildren={}\n className=\"inline\"\n defaultChecked={true}\n onChange={onChange}\n />\n {children}\n \n )\n}\n\nexport default function SetupForm() {\n const appService = ApplicationServices.get()\n const [step, setStep] = useState(0)\n const [loading, setLoading] = useState(false)\n const [emailOptout, setEmailOptout] = useState(false)\n\n const submit = async values => {\n setLoading(true)\n try {\n const nonSensitiveUserData = {\n name: values[\"name\"],\n email: values[\"email\"],\n company: values[\"company_name\"],\n emailOptout,\n }\n if (!emailOptout) {\n await appService.analyticsService.track(\"selfhosted_email_subscribe\", {\n user: {\n email: nonSensitiveUserData.email,\n name: nonSensitiveUserData.name,\n },\n company: nonSensitiveUserData.company,\n emailOptout,\n })\n }\n await appService.analyticsService.track(\"selfhosted_signup\", { emailOptout })\n await appService.userService.createUser(values as SignupRequest)\n await appService.storageService.saveUserInfo({\n _emailOptout: emailOptout,\n _name: values[\"name\"],\n _suggestedInfo: { companyName: values[\"company_name\"], name: values[\"name\"] },\n })\n\n reloadPage()\n } catch (error) {\n handleError(error)\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <>\n
\n
\n {step === 0 && (\n <>\n
\n \n
\n

Welcome to Jitsu!

\n
\n {\n setStep(1)\n }}\n >\n Let's get started!\n \n
\n \n )}\n {step === 1 && (\n
\n
\n
\n \n
\n

What should we call you?

\n
\n }\n inputType=\"text\"\n size=\"large\"\n />\n }\n inputType=\"email\"\n size=\"large\"\n />\n }\n inputType=\"password\"\n size=\"large\"\n />\n ({\n validator(_, value) {\n if (!value || getFieldValue(\"password\") === value) {\n return Promise.resolve()\n }\n return Promise.reject(new Error(\"The two passwords that you entered do not match!\"))\n },\n }),\n ]}\n floatingLabelText=\"Confirm your password\"\n prefix={}\n inputType=\"password\"\n size=\"large\"\n />\n }\n inputType=\"text\"\n size=\"large\"\n />\n \n setEmailOptout(!val)}>\n Send me occasional product updates. You may unsubscribe at any time.\n \n \n
\n
\n )}\n
\n
\n \n )\n}\n"],"sourceRoot":""}