{"version":3,"sources":["login.tsx","store/status/actions.ts","store/status/types.ts","bubble-room.tsx","room.tsx","store/room/actions.ts","store/room/types.ts","main.tsx","store/status/reducers.ts","store/room/reducers.ts","store/index.ts","App.tsx","serviceWorker.ts","index.tsx"],"names":["useStyles","makeStyles","form","display","justifyContent","alignItems","minHeight","flexDirection","Login","connect","undefined","updateUsername","username","type","payload","props","classes","useState","localUsername","setLocalUsername","className","onSubmit","e","preventDefault","TextField","id","label","variant","helperText","onChange","event","console","log","target","value","BubbleRoom","bubble","iframeRef","useRef","useEffect","current","daily","DailyIframe","wrap","url","name","join","title","ref","allow","root","canvas","flex","avatar","position","borderRadius","width","height","border","draggableAvatar","cursor","textAlign","lineHeight","background","opacity","ParticipantItem","updateParticipantPosition","uuid","x","y","participant","origin","setOrigin","mouse","setMouse","window","innerWidth","innerHeight","draggable","alt","onMouseDown","clientX","clientY","onMouseMove","onMouseUp","newX","newY","onMouseLeave","src","icon","style","left","top","BubbleComponent","Room","rootState","status","room","inBubble","participants","map","filter","b","bubbles","key","Main","initialState","rootReducer","combineReducers","state","action","index","findIndex","Math","abs","newParticipant","slice","store","createStore","__REDUX_DEVTOOLS_EXTENSION__","App","Boolean","location","hostname","match","ReactDOM","render","StrictMode","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","error","message"],"mappings":"iPAOMA,EAAYC,YAAW,CAC3BC,KAAM,CACJC,QAAS,OACTC,eAAgB,SAChBC,WAAY,SACZC,UAAW,QACXC,cAAe,YAkCNC,EAAQC,iBAAQC,EAAW,CAACC,eC7ClC,SAAwBC,GAC7B,MAAO,CAACC,KCCqB,kBDDEC,QAASF,KD4CrBH,EA1BE,SAACM,GACtB,IAAMC,EAAUhB,IACTW,EAAkBI,EAAlBJ,eAFqC,EAGFM,mBAAS,IAHP,mBAGrCC,EAHqC,KAGtBC,EAHsB,KAI5C,OACE,0BACEC,UAAWJ,EAAQd,KACnBmB,SAAU,SAAAC,GAIR,OAHAA,EAAEC,iBACFZ,EAA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,CAElBzD,SAAU,CAACc,IAAGC,KACd6B,aAEIC,EAAY,sBACbU,EAAMV,aAAaiB,MAAM,EAAGL,IADf,CAEhBI,GAFgB,YAGbN,EAAMV,aAAaiB,MAAML,EAAQ,KAEtC,OAAO,eAAIF,EAAX,CAAkBV,iBACpB,QACE,OAAOU,MCzFAQ,EAAQC,YACnBX,EACChC,OAAe4C,8BACb5C,OAAe4C,gCCGLC,MAVf,WACE,OACE,kBAAC,IAAD,CAAUH,MAAOA,GACf,6BACE,kBAACZ,EAAD,SCGYgB,QACW,cAA7B9C,OAAO+C,SAASC,UAEe,UAA7BhD,OAAO+C,SAASC,UAEhBhD,OAAO+C,SAASC,SAASC,MACvB,2DCZNC,IAASC,OACP,kBAAC,IAAMC,WAAP,KACE,kBAAC,EAAD,OAEFC,SAASC,eAAe,SDiIpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBC,MAAK,SAAAC,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACL1G,QAAQ0G,MAAMA,EAAMC,c","file":"static/js/main.468d5c81.chunk.js","sourcesContent":["import React from 'react';\nimport {useState} from 'react';\nimport {connect} from 'react-redux';\nimport {updateUsername} from './store/status/actions';\nimport {makeStyles} from '@material-ui/core/styles';\nimport TextField from '@material-ui/core/TextField';\n\nconst useStyles = makeStyles({\n form: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: '100vh',\n flexDirection: 'column',\n },\n});\n\ninterface LoginProps {\n updateUsername: typeof updateUsername;\n}\n\nconst LoginComponent = (props: LoginProps) => {\n const classes = useStyles();\n const {updateUsername} = props;\n const [localUsername, setLocalUsername] = useState('');\n return (\n {\n e.preventDefault();\n updateUsername(localUsername);\n\n return false;\n }}>\n {\n console.log('Update local ', localUsername);\n setLocalUsername(event.target.value);\n }}\n />\n \n );\n};\nexport const Login = connect(undefined, {updateUsername})(LoginComponent);\n","import {UPDATE_USERNAME, StatusActionTypes} from './types';\n\nexport function updateUsername(username: string): StatusActionTypes {\n return {type: UPDATE_USERNAME, payload: username};\n}\n","export interface Status {\n username: string | null;\n}\n\nexport const UPDATE_USERNAME = 'UPDATE_USERNAME';\n\ninterface UpdateUsernameAction {\n type: typeof UPDATE_USERNAME;\n payload: string;\n}\n\nexport type StatusActionTypes = UpdateUsernameAction;\n","import React from 'react';\nimport {useRef, useEffect} from 'react';\nimport DailyIframe from '@daily-co/daily-js';\n\nimport {Bubble} from './store/room/types';\n\ninterface BubbleProps {\n bubble: Bubble;\n}\n\nexport const BubbleRoom = (props: BubbleProps) => {\n const {bubble} = props;\n const iframeRef = useRef(null);\n useEffect(() => {\n if (iframeRef !== null && iframeRef.current !== null) {\n const daily = DailyIframe.wrap(iframeRef.current);\n const url = `https://minimap.daily.co/${bubble.name}`;\n daily.join({url});\n }\n }, [bubble.name]);\n return (\n \n );\n};\n","import React from 'react';\nimport {useState} from 'react';\nimport {connect} from 'react-redux';\nimport {makeStyles} from '@material-ui/core/styles';\nimport {RootState} from './store';\nimport {RoomState, Participant, Bubble} from './store/room/types';\nimport {updateParticipantPosition} from './store/room/actions';\nimport {BubbleRoom} from './bubble-room';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: '100vh',\n },\n canvas: {\n flex: 1,\n },\n avatar: {\n position: 'fixed',\n borderRadius: '50%',\n width: '100px',\n height: '100px',\n border: '1px solid transparent',\n },\n draggableAvatar: {\n position: 'fixed',\n borderRadius: '50%',\n width: '100px',\n height: '100px',\n border: '1px solid transparent',\n '&:hover': {\n cursor: 'pointer',\n border: '1px solid black',\n },\n },\n bubble: {\n position: 'fixed',\n borderRadius: '50%',\n textAlign: 'center',\n lineHeight: '300px',\n\n width: '300px',\n height: '300px',\n border: '1px solid transparent',\n background: 'red',\n opacity: 0.4,\n },\n});\n\ninterface RoomProps {\n username: string | null;\n room: RoomState;\n}\ninterface Position {\n x: number;\n y: number;\n}\n\ninterface ParticipantProps {\n participant: Participant;\n updateParticipantPosition: typeof updateParticipantPosition;\n}\n\nconst ParticipantComponent = (props: ParticipantProps) => {\n const {participant, updateParticipantPosition} = props;\n const classes = useStyles();\n const [origin, setOrigin] = useState(null);\n const [mouse, setMouse] = useState(null);\n const [width, height] = [window.innerWidth, window.innerHeight];\n let x = participant.position.x * width;\n let y = participant.position.y * height;\n if (origin !== null && mouse != null) {\n x += mouse.x - origin.x;\n y += mouse.y - origin.y;\n }\n if (participant.draggable) {\n return (\n setOrigin({x: event.clientX, y: event.clientY})}\n onMouseMove={event => setMouse({x: event.clientX, y: event.clientY})}\n onMouseUp={event => {\n if (origin !== null) {\n const newX = x / width;\n const newY = y / height;\n updateParticipantPosition(participant.uuid, newX, newY);\n setOrigin(null);\n setMouse(null);\n }\n }}\n onMouseLeave={event => {\n if (origin !== null) {\n const newX = x / width;\n const newY = y / height;\n updateParticipantPosition(participant.uuid, newX, newY);\n setOrigin(null);\n setMouse(null);\n }\n }}\n className={classes.draggableAvatar}\n src={participant.icon}\n style={{left: x, top: y}}\n />\n );\n }\n return (\n \n );\n};\n\nconst ParticipantItem = connect(null, {updateParticipantPosition})(\n ParticipantComponent,\n);\n\ninterface BubbleProps {\n bubble: Bubble;\n}\n\nconst BubbleComponent = (props: BubbleProps) => {\n const classes = useStyles();\n const {bubble} = props;\n const [width, height] = [window.innerWidth, window.innerHeight];\n let x = bubble.position.x * width;\n let y = bubble.position.y * height;\n return (\n
\n {bubble.name}\n
\n );\n};\n\nconst RoomComponent = (props: RoomProps) => {\n const classes = useStyles();\n const {room} = props;\n\n const inBubble = room.participants\n .map(participant => participant.inBubble)\n .filter(b => b)[0];\n\n return (\n
\n
\n {room.bubbles.map(bubble => (\n \n ))}\n {room.participants.map(participant => (\n \n ))}\n
\n {inBubble != null && }\n
\n );\n};\nexport const Room = connect((rootState: RootState) => {\n return {\n username: rootState.status.username,\n room: rootState.room,\n };\n})(RoomComponent);\n","import {\n UPDATE_PARTICIPANT_POSITION,\n SET_ROOM,\n RoomActionTypes,\n RoomState,\n} from './types';\n\nexport function setRoom(room: RoomState): RoomActionTypes {\n return {type: SET_ROOM, payload: room};\n}\nexport function updateParticipantPosition(\n uuid: string,\n x: number,\n y: number,\n): RoomActionTypes {\n return {type: UPDATE_PARTICIPANT_POSITION, uuid, x, y};\n}\n","export interface Position {\n x: number;\n y: number;\n}\n\nexport interface Bubble {\n name: string;\n position: Position;\n}\n\nexport interface Participant {\n uuid: string;\n name: string;\n icon: string;\n position: Position;\n draggable: boolean;\n inBubble: null | Bubble;\n}\nexport interface RoomState {\n participants: Participant[];\n bubbles: Bubble[];\n}\n\nexport const SET_ROOM = 'SET_ROOM';\nexport const UPDATE_PARTICIPANT_POSITION = 'UPDATE_PARTICIPANT_POSITION';\n\ninterface SetRoomAction {\n type: typeof SET_ROOM;\n payload: RoomState;\n}\ninterface UpdateParticipantPositionAction {\n type: typeof UPDATE_PARTICIPANT_POSITION;\n uuid: string;\n x: number;\n y: number;\n}\n\nexport type RoomActionTypes = SetRoomAction | UpdateParticipantPositionAction;\n","import React from 'react';\nimport {connect} from 'react-redux';\nimport {RootState} from './store';\nimport {Login} from './login';\nimport {Room} from './room';\n\ninterface MainProps {\n username: string | null;\n}\n\nconst MainComponent = (props: MainProps) => {\n const {username} = props;\n if (username === null) {\n return ;\n }\n return ;\n};\nexport const Main = connect((rootState: RootState) => {\n return {\n username: rootState.status.username,\n };\n})(MainComponent);\n","import {Status, UPDATE_USERNAME, StatusActionTypes} from './types';\n\n// const initialState: Status = {username: null};\nconst initialState: Status = {username: 'Nicolas Patry'};\n\nexport function statusReducer(state = initialState, action: StatusActionTypes) {\n switch (action.type) {\n case UPDATE_USERNAME:\n return {\n ...state,\n username: action.payload,\n };\n default:\n return state;\n }\n}\n","import {\n UPDATE_PARTICIPANT_POSITION,\n RoomState,\n SET_ROOM,\n RoomActionTypes,\n} from './types';\n\n// const initialState: RoomState = {participants: []};\nconst initialState: RoomState = {\n bubbles: [\n {\n name: 'Chill',\n position: {x: 0.22, y: 0.3},\n },\n {\n name: 'Figma',\n position: {x: 0.6, y: 0.1},\n },\n ],\n participants: [\n {\n uuid: '0',\n name: 'Nicolas Steegmann',\n icon:\n 'https://s3.amazonaws.com/keybase_processed_uploads/a1ce4cc187ac553739200a2ec660ce05_360_360.jpg',\n position: {x: 0.45, y: 0.5},\n draggable: true,\n inBubble: null,\n },\n {\n uuid: '1',\n name: 'Nicolas Steegmann',\n icon:\n 'https://www.pngjoy.com/pngm/182/3614808_cammy-circle-picture-profile-girl-png-transparent-png.png',\n position: {x: 0.38, y: 0.7},\n draggable: false,\n inBubble: null,\n },\n {\n uuid: '2',\n name: 'Nicolas Steegmann',\n icon: 'https://miro.medium.com/max/3072/1*o-UCEnQ3VRCrHjI8cx4JBQ.jpeg',\n position: {x: 0.22, y: 0.8},\n draggable: false,\n inBubble: null,\n },\n {\n uuid: '3',\n name: 'Nicolas Steegmann',\n icon:\n 'https://bcsmn.edu/wp-content/uploads/2020/02/Enthoven-Profile-Circle.jpg',\n position: {x: 0.8, y: 0.1},\n draggable: false,\n inBubble: null,\n },\n {\n uuid: '4',\n name: 'Nicolas Steegmann',\n icon:\n 'https://cdn.fastly.picmonkey.com/contentful/h6goo9gw1hh6/2sNZtFAWOdP1lmQ33VwRN3/24e953b920a9cd0ff2e1d587742a2472/1-intro-photo-final.jpg?w=800&q=70',\n position: {x: 0.67, y: 0.67},\n draggable: false,\n inBubble: null,\n },\n ],\n};\n\nexport function roomReducer(state = initialState, action: RoomActionTypes) {\n switch (action.type) {\n case SET_ROOM:\n return action.payload;\n case UPDATE_PARTICIPANT_POSITION:\n const index = state.participants.findIndex(\n participant => participant.uuid === action.uuid,\n );\n const x = action.x;\n const y = action.y;\n let inBubble = null;\n for (let bubble of state.bubbles) {\n if (\n Math.abs(x - bubble.position.x) < 0.15 &&\n Math.abs(y - bubble.position.y) < 0.2\n ) {\n inBubble = bubble;\n }\n }\n const newParticipant = {\n ...state.participants[index],\n position: {x, y},\n inBubble,\n };\n const participants = [\n ...state.participants.slice(0, index),\n newParticipant,\n ...state.participants.slice(index + 1),\n ];\n return {...state, participants};\n default:\n return state;\n }\n}\n","import {statusReducer} from './status/reducers';\nimport {roomReducer} from './room/reducers';\nimport {createStore, combineReducers} from 'redux';\n\nconst rootReducer = combineReducers({\n status: statusReducer,\n room: roomReducer,\n});\nexport type RootState = ReturnType;\nexport const store = createStore(\n rootReducer,\n (window as any).__REDUX_DEVTOOLS_EXTENSION__ &&\n (window as any).__REDUX_DEVTOOLS_EXTENSION__(),\n);\n","import React from 'react';\nimport {Provider} from 'react-redux';\nimport {Main} from './main';\nimport {store} from './store';\n\nfunction App() {\n return (\n \n
\n
\n
\n
\n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(\n process.env.PUBLIC_URL,\n window.location.href\n );\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' }\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}