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FC,cAAcH,GACdD,EAAQ,CACNK,OAAQ,UACRF,aAAA,GAGH,IAAI,IAGT,OAEIJ,QAAQO,KAAK,CACXR,EACA,IAAIC,SAAoCC,GACtCO,YACE,IACEP,EAAQ,CACNK,OAAQ,QACRG,UAAW,aAEfX,MAAA,C","sources":["webpack:///./scripts/components/SvgImage/svgs-raw/registrationSuccess.svg","webpack:///./scripts/utils/websocket.ts","webpack:///../../../packages/pg-ui/src/utils/websocket.ts"],"sourcesContent":["var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgRegistrationSuccess(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 96,\n height: 96,\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, props), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#registrationSuccess_svg__clip0)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M57.618 37.626c-12.076-12.038-25.07-18.59-29.05-14.628a3.269 3.269 0 00-.416.505v.031a4.118 4.118 0 00-.556 1.292L.795 86.894A6.013 6.013 0 000 89.905a6.08 6.08 0 00.766 2.937 6.128 6.128 0 007.978 2.549l62.571-28.124c.367-.17.702-.4.99-.682 3.97-3.95-2.598-16.908-14.687-28.959z\",\n fill: \"#FFD828\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.773 94.172a6.804 6.804 0 01-1.718-5.096l33.575-50.98 11.618 14.019L1.773 94.172z\",\n fill: \"#FFE56A\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M66.493 66.287c2.448-2.44-4.062-12.885-14.54-23.33-10.478-10.445-20.957-16.935-23.405-14.495-2.447 2.44 4.063 12.885 14.541 23.33 10.478 10.445 20.957 16.934 23.404 14.495z\",\n fill: \"#AD8924\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.006 33.219a3.663 3.663 0 003.669-3.658 3.663 3.663 0 00-3.669-3.657 3.663 3.663 0 00-3.669 3.657 3.663 3.663 0 003.67 3.658zM75.822 32.61a3.663 3.663 0 003.668-3.658 3.663 3.663 0 00-3.668-3.657 3.663 3.663 0 00-3.67 3.657 3.663 3.663 0 003.67 3.657z\",\n fill: \"red\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M75.822 86.248a3.052 3.052 0 003.057-3.048 3.053 3.053 0 00-3.058-3.048 3.053 3.053 0 00-3.057 3.048 3.052 3.052 0 003.058 3.048z\",\n fill: \"#FFD828\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.987 68.571c1.182 0 2.14-.955 2.14-2.133a2.137 2.137 0 00-2.14-2.133c-1.182 0-2.14.955-2.14 2.133s.958 2.133 2.14 2.133z\",\n fill: \"#FFF6CA\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M92.943 42.971A3.052 3.052 0 0096 39.924a3.052 3.052 0 00-3.057-3.048 3.052 3.052 0 00-3.058 3.048 3.052 3.052 0 003.058 3.047z\",\n fill: \"#FFD828\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M81.325 13.105a2.442 2.442 0 002.446-2.438 2.442 2.442 0 00-2.446-2.438 2.442 2.442 0 00-2.446 2.438 2.442 2.442 0 002.446 2.438zM6.726 5.18a2.442 2.442 0 002.446-2.437A2.442 2.442 0 006.726.305 2.442 2.442 0 004.28 2.743 2.442 2.442 0 006.726 5.18z\",\n fill: \"#00CDFF\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.853 2.134s15.287 7.314 3.67 25.6\",\n stroke: \"#00CDFF\",\n strokeWidth: 4,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M86.675 55.43s-9.594-13.94-25.944.305\",\n stroke: \"red\",\n strokeWidth: 4,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M60.84 7.924s4.28.61 4.28 4.876c0 4.267-4.89 4.876-7.948 4.267-3.057-.61-4.28 2.438-4.28 3.657 0 1.219 1.834 4.267 4.891 4.876a6.535 6.535 0 012.902 1.222 6.508 6.508 0 011.99 2.435c.611 1.22 0 4.876-3.669 3.657-3.669-1.219-6.726 1.22-6.726 1.22s-3.057 2.437-.611 5.485c2.446 3.048 4.28 2.438 4.28 2.438\",\n stroke: \"#9500E7\",\n strokeWidth: 4,\n strokeMiterlimit: 10,\n strokeLinecap: \"round\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.968 86.247c2.364 0 4.28-1.91 4.28-4.266a4.273 4.273 0 00-4.28-4.267 4.273 4.273 0 00-4.28 4.267 4.273 4.273 0 004.28 4.266z\",\n fill: \"red\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"registrationSuccess_svg__clip0\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h96v96H0z\"\n })))));\n}\nexport default __webpack_public_path__ + \"542f17a2847571595aee75ed0e02f915.svg\";\nexport { SvgRegistrationSuccess as ReactComponent };","import Echo from 'laravel-echo';\nimport {\n getAuthenticatedWebSocket as pguiGetAuthWebSocket,\n getWebsocket as pguiGetWebSocket,\n} from '@practicegenius/pg-ui/src/utils/websocket';\nimport * as env from '../constants/env';\nimport {__HACKY_GLOBAL_USER_JWT} from '../http/AuthApiProvider';\n\nconst coreServiceUrl = env.PG_CORE_URL;\n\nexport function getWebsocket(): Echo {\n const config = {\n pusherKey: env.PUSHER_KEY,\n pusherCluster: env.PUSHER_CLUSTER,\n pusherHost: env.PUSHER_HOST,\n authEndpoint: `${coreServiceUrl}/global_users/broadcasting/auth`,\n };\n\n return pguiGetWebSocket(config);\n}\n\n// TODO refactor this to a hook\nexport async function getAuthenticatedWebSocket() {\n const token = __HACKY_GLOBAL_USER_JWT;\n const config = {\n pusherKey: env.PUSHER_KEY,\n pusherCluster: env.PUSHER_CLUSTER,\n pusherHost: env.PUSHER_HOST,\n authEndpoint: `${coreServiceUrl}/global_users/broadcasting/auth`,\n };\n\n return pguiGetAuthWebSocket({token, ...config});\n}\n","import * as R from 'ramda';\nimport Pusher from 'pusher-js';\nimport Echo from 'laravel-echo';\nimport {Transport} from 'pusher-js/types/src/core/config';\n\ntype WebsocketConfig = {\n pusherKey: string;\n pusherCluster: string;\n pusherHost: string;\n authEndpoint: string;\n};\n\nexport function getWebsocket({\n pusherKey,\n pusherCluster,\n pusherHost,\n authEndpoint,\n}: WebsocketConfig): Echo {\n const endpointConfig = R.isEmpty(pusherCluster)\n ? {\n wsHost: pusherHost,\n disableStats: true,\n enabledTransports: ['ws', 'wss'] as Transport[],\n }\n : {\n cluster: pusherCluster,\n };\n\n return new Echo({\n broadcaster: 'pusher',\n key: pusherKey,\n encrypted: true,\n client: new Pusher(pusherKey, {\n authEndpoint,\n ...endpointConfig,\n }),\n });\n}\n\nexport async function getAuthenticatedWebSocket({\n pusherKey,\n pusherCluster,\n pusherHost,\n authEndpoint,\n token,\n}: WebsocketConfig & {\n token: string;\n}): Promise {\n const commonConfig = {\n broadcaster: 'pusher',\n encrypted: true,\n authEndpoint,\n auth: {\n headers: {\n Authorization: `Bearer ${token}`,\n },\n },\n key: pusherKey,\n };\n\n // If the cluster is empty, assume we're connecting to the local endpoint (Socketi)\n const endpointConfig = R.isEmpty(pusherCluster)\n ? {\n wsHost: pusherHost,\n disableStats: true,\n enabledTransports: ['ws', 'wss'],\n }\n : {\n cluster: pusherCluster,\n };\n\n return new Echo({\n ...commonConfig,\n ...endpointConfig,\n });\n}\n\ntype GetSocketIdSuccessResponse = {\n status: 'success';\n socketId: string;\n};\ntype GetSocketIdTimeoutResponse = {\n status: 'error';\n errorType: 'timeout';\n};\nexport const getSocketId = (\n websocket: Echo,\n timeoutMs = 3000\n): Promise => {\n const websocketPromise = new Promise(resolve => {\n const interval = setInterval(() => {\n const socketId = websocket.socketId();\n if (socketId) {\n clearInterval(interval);\n resolve({\n status: 'success',\n socketId,\n });\n }\n }, 200);\n });\n\n return process.env.NODE_ENV === 'test'\n ? websocketPromise\n : Promise.race([\n websocketPromise,\n new Promise(resolve =>\n setTimeout(\n () =>\n resolve({\n status: 'error',\n errorType: 'timeout',\n }),\n timeoutMs\n )\n ),\n ]);\n};\n"],"names":["_g","_defs","_extends","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","apply","SvgRegistrationSuccess","props","width","height","fill","xmlns","clipPath","d","stroke","strokeWidth","strokeMiterlimit","strokeLinecap","id","coreServiceUrl","getWebsocket","config","pusherKey","pusherCluster","pusherHost","authEndpoint","token","endpointConfig","wsHost","disableStats","enabledTransports","cluster","broadcaster","key","encrypted","client","commonConfig","auth","headers","Authorization","getSocketId","websocket","timeoutMs","websocketPromise","Promise","resolve","interval","setInterval","socketId","clearInterval","status","race","setTimeout","errorType"],"sourceRoot":""}