{"version":3,"sources":["AppProvider.js","ValidationErrors.js","EditLink.js","Footer.js","Import.js","Header.js","Tags.js","Links.js","Home.js","Landing.js","Login.js","Register.js","Site.js","App.js","serviceWorker.js","index.js","Logo.svg"],"names":["AppContext","createContext","AppProvider","props","handleError","error","response","console","log","data","type","setState","errors","alert","message","request","config","inst","axios","create","baseURL","process","headers","state","isAuth","user","loading","links","pagination","total","perPage","currentPage","firstPage","lastPage","nextPage","prevPage","tags","interceptors","use","Promise","reject","this","json","localStorage","getItem","JSON","parse","auth","stringify","setItem","token","loaded","history","replace","pathname","hash","search","goBack","location","push","post","then","catch","unauth","link","url","getLinks","id","get","params","URLSearchParams","getSearch","method","page","limit","setPagination","slug","query","put","delete","file","FormData","append","Provider","value","goHome","bind","setSearch","addError","register","login","logout","addLink","getLink","getLinksForTag","getLinksForSearch","updateLink","deleteLink","getTags","importOld","children","React","Component","AppProviderWithRouter","withRouter","ValidationErrors","tag","field","param","context","map","Alert","variant","errorMessage","contextType","EditLink","title","handleTags","handleInput","onSubmit","edit","match","name","event","target","join","className","Button","size","onClick","Card","Header","Body","Form","Group","Label","Control","placeholder","onChange","icon","faEdit","faPlus","Footer","Container","Row","Col","md","class","to","href","rel","Import","files","success","handleClose","Modal","show","onHide","Title","FormGroup","Check","label","disabled","checked","File","setFile","faBan","faDownload","showImport","NavDropdown","alignRight","Item","import","Nav","Navbar","bg","Brand","src","Logo","height","alt","hideImport","Tags","filter","t","count","sort","a","b","Links","firstTime","top","window","path","loadLinks","prevProps","pag","Badge","key","onDelete","activePage","itemsCountPerPage","totalItemsCount","pageRangeDisplayed","handlePageChange","itemClass","linkClass","LinkItem","el","document","createElement","setAttribute","body","appendChild","select","execCommand","removeChild","Text","faReply","copyLink","faCopy","faTrash","Home","Search","q","InputGroup","aria-label","Append","faSearch","Landing","Login","email","password","required","span","offset","Register","confirm","Site","App","basename","Consumer","Loading","fluid","exact","component","style","marginLeft","marginRight","lg","sm","paddingLeft","paddingRight","render","Spinner","animation","role","Boolean","hostname","ReactDOM","StrictMode","getElementById","navigator","serviceWorker","ready","registration","unregister","module","exports"],"mappings":"uSAqBaA,EAAaC,wBAAc,MAE3BC,EAAb,kDACI,WAAYC,GAAQ,IAAD,8BACf,cAAMA,IA8GVC,YAAc,SAAAC,GACV,GAAIA,EAAMC,SAAU,CAChBC,QAAQC,IAAIH,EAAMC,UAClB,IAAMG,EAAOJ,EAAMC,SAASG,KAC5B,OAAQA,EAAKC,MACT,IAAK,oBACD,EAAKC,SAAS,CAAEC,OAAQH,EAAKG,SAC7B,MACJ,QACIC,MAAMJ,EAAKK,eAEZT,EAAMU,SACbR,QAAQC,IAAIH,EAAMU,SAClBF,MAAM,2CAENN,QAAQC,IAAIH,EAAMW,SA5HtB,EAAKC,KAAOC,IAAMC,OAAO,CACrBC,QAAQ,GAAD,OAAKC,iCAAL,UAEX,EAAKL,OAAS,CACVM,QAAS,IAEb,EAAKC,MAAQ,CACTC,QAAQ,EACRC,KAAM,KACNC,SAAS,EACTd,OAAQ,GACRe,MAAO,GACPC,WAAY,CACRC,MAAO,EACPC,QAAS,GACTC,YAAa,EACbC,UAAW,EACXC,SAAU,EACVC,SAAU,EACVC,SAAU,GAEdC,KAAM,IAEV,EAAKnB,KAAKoB,aAAatB,QAAQuB,KAAI,SAAAtB,GAK/B,OAJA,EAAKL,SAAS,CACVC,OAAQ,GACRc,SAAS,IAENV,KACR,SAAAX,GAGC,OAFA,EAAKM,SAAS,CAAEe,SAAS,IACzB,EAAKtB,YAAYC,GACVkC,QAAQC,OAAOnC,MAE1B,EAAKY,KAAKoB,aAAa/B,SAASgC,KAAI,SAAAhC,GAEhC,OADA,EAAKK,SAAS,CAAEe,SAAS,IAClBpB,EAASG,QACjB,SAAAJ,GAGC,OAFA,EAAKM,SAAS,CAAEe,SAAS,IACzB,EAAKtB,YAAYC,GACVkC,QAAQC,OAAOnC,MA1CX,EADvB,iEAgDQ,IAAKoC,KAAKlB,MAAMC,OAAQ,CACpB,IAAIkB,EAAOC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AAD,CAAO6C,KAAK,YAAY4D,OAAQ,SAAA1P,GAAK,OAChC0G,EAAQtF,MAAMC,OAAoC,kBAAC,EAAD,CAAUgG,MAAM,EAAM9D,SAAUvD,EAAMuD,SAAU+D,MAAOtH,EAAMsH,QAAxF,kBAAC,IAAD,CAAU2B,GAAG,cAEzC,kBAAC,IAAD,CAAO6C,KAAK,SACR,kBAAC,GAAD,WAMpB,kBAAC,EAAD,gB,GArCC5F,IAAMC,WA+CvC,SAAS4I,GAAT,GACI,OAD2B,oBACjBxN,QAEF,yBAAKoG,UAAU,WACX,kBAACgI,EAAA,EAAD,CAAShI,UAAU,kBAAkBd,QAAQ,UAAU+I,UAAU,SAASC,KAAK,UAC3E,0BAAMlI,UAAU,WAAhB,gBAKL,8BCpFKmI,QACW,cAA7BjE,OAAOtI,SAASwM,UAEe,UAA7BlE,OAAOtI,SAASwM,UAEhBlE,OAAOtI,SAASwM,SAASzI,MACvB,2DCKN0I,IAASN,OACP,kBAAC,IAAMO,WAAP,KACE,kBAAC,GAAD,OAEFnD,SAASoD,eAAe,SDwGpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB3M,MAAK,SAAA4M,GACJA,EAAaC,gBAEd5M,OAAM,SAAAzD,GACLE,QAAQF,MAAMA,EAAMS,a,mBEzI5B6P,EAAOC,QAAU,IAA0B,kC","file":"static/js/main.fcb44373.chunk.js","sourcesContent":["/*\n * AppProvider.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport axios from 'axios';\nimport React, { createContext } from 'react';\nimport { withRouter } from 'react-router-dom';\n\nexport const AppContext = createContext(null);\n\nexport class AppProvider extends React.Component {\n constructor(props) {\n super(props);\n this.inst = axios.create({\n baseURL: `${process.env.REACT_APP_LINKBUCKET_URL}/api`\n });\n this.config = {\n headers: {}\n };\n this.state = {\n isAuth: false,\n user: null,\n loading: false,\n errors: [],\n links: [],\n pagination: {\n total: 1,\n perPage: 20,\n currentPage: 1,\n firstPage: 1,\n lastPage: 1,\n nextPage: 1,\n prevPage: 1\n },\n tags: []\n };\n this.inst.interceptors.request.use(config => {\n this.setState({\n errors: [],\n loading: true\n });\n return config;\n }, error => {\n this.setState({ loading: false });\n this.handleError(error);\n return Promise.reject(error);\n });\n this.inst.interceptors.response.use(response => {\n this.setState({ loading: false });\n return response.data;\n }, error => {\n this.setState({ loading: false });\n this.handleError(error);\n return Promise.reject(error);\n });\n }\n\n componentWillMount() {\n if (!this.state.isAuth) {\n let json = localStorage.getItem('data');\n //console.log(\"get: \" + json);\n if (json) {\n let data = JSON.parse(json);\n //console.log(data);\n if (data.isAuth) {\n this.auth(data.user);\n }\n }\n }\n }\n\n componentDidUpdate() {\n let json = JSON.stringify({\n isAuth: this.state.isAuth,\n user: this.state.user\n });\n //console.log(\"set: \" + json);\n localStorage.setItem('data', json);\n }\n\n auth(user) {\n this.config.headers['Authorization'] = `Bearer ${user.token}`;\n this.setState({\n isAuth: true,\n user: user\n });\n }\n\n unauth() {\n delete this.config.headers['Authorization'];\n this.setState({\n loaded: false,\n isAuth: false,\n user: null,\n errors: [],\n links: [],\n tags: []\n });\n }\n\n goHome() {\n this.props.history.replace({\n pathname: '/home',\n hash: '#',\n search: ''\n });\n }\n\n goBack() {\n this.props.history.goBack();\n }\n\n setSearch(search) {\n this.props.history.replace({\n search: search\n });\n }\n\n getSearch() {\n return this.props.location.search;\n }\n\n handleError = error => {\n if (error.response) {\n console.log(error.response);\n const data = error.response.data;\n switch (data.type) {\n case 'validation_failed':\n this.setState({ errors: data.errors });\n break;\n default:\n alert(data.message);\n }\n } else if (error.request) {\n console.log(error.request);\n alert(\"There was an error making the request.\");\n } else {\n console.log(error.config);\n }\n }\n\n addError(error) {\n const errors = this.state.errors;\n errors.push(error);\n this.setState({ errors: errors });\n }\n\n setPagination(data) {\n this.setState({\n pagination: {\n total: data[\"total\"],\n perPage: data[\"per_page\"],\n currentPage: data[\"current_page\"],\n firstPage: data[\"first_page\"],\n lastPage: data[\"last_page\"],\n nextPage: data[\"next_page\"],\n prevPage: data[\"prev_page\"]\n }\n });\n }\n\n async register(user) {\n return this.inst.post('/register', user)\n .then(response => {\n this.auth(response.data);\n return true;\n })\n .catch(() => false);\n }\n\n async login(user) {\n return this.inst.post('/token', user)\n .then(response => {\n this.auth(response.data);\n return true;\n })\n .catch(() => false);\n }\n\n logout() {\n this.unauth();\n }\n\n async addLink(link) {\n this.props.history.replace({ url: '/home' });\n return this.inst.post('/link', link, this.config)\n .then(() => {\n this.getLinks();\n return true;\n })\n .catch(() => false);\n }\n\n async getLink(id) {\n return this.inst.get('/link/' + id, this.config)\n .then(response => {\n return response.data;\n }).catch(() => null);\n }\n\n async getLinks() {\n this.setState({ links: [] });\n const params = new URLSearchParams(this.getSearch());\n console.log(params.get('p'));\n return this.inst({\n method: 'get',\n url: '/link',\n params: {\n page: params.get('p') || 1,\n limit: process.env.REACT_APP_PAGINATE_LIMIT,\n },\n ...this.config\n })\n .then(response => {\n this.setPagination(response)\n this.setState({\n links: response.data\n });\n return response.data;\n })\n .catch(() => null);\n }\n\n async getLinksForTag(slug) {\n this.setState({ links: [] });\n const params = new URLSearchParams(this.getSearch());\n return this.inst({\n method: 'get',\n url: '/tag/' + slug,\n params: { page: params.get('p') || 1, limit: 15 },\n ...this.config\n })\n .then(response => {\n this.setPagination(response)\n this.setState({\n links: response.data\n });\n return response.data;\n })\n .catch(() => null);\n }\n\n async getLinksForSearch() {\n this.setState({ links: [] });\n const params = new URLSearchParams(this.getSearch());\n return this.inst({\n method: 'get',\n url: '/search',\n params: {\n page: params.get('p') || 1,\n limit: 15,\n query: params.get('q') || ''\n },\n ...this.config\n })\n .then(response => {\n this.setPagination(response)\n this.setState({\n links: response.data\n });\n return response.data;\n })\n .catch(() => null)\n }\n\n async updateLink(id, link) {\n return this.inst.put('/link/' + id, link, this.config)\n .then(() => {\n return true;\n })\n .catch(() => false);\n }\n\n async deleteLink(id) {\n return this.inst.delete('/link/' + id, this.config)\n .then(() => {\n return true;\n })\n .catch(() => false);\n }\n\n async getTags() {\n return this.inst.get('/tag', this.config)\n .then(response => {\n this.setState({\n tags: response.data\n });\n return true;\n })\n .catch(() => false);\n }\n\n async importOld(file) {\n const data = new FormData();\n data.append(\"links\", file);\n return this.inst({\n method: 'post',\n url: '/import/old',\n data: data,\n ...this.config\n })\n .then(() => true)\n .catch(() => false);\n }\n\n render() {\n return (\n \n {this.props.children}\n \n );\n }\n}\n\nexport const AppProviderWithRouter = withRouter(AppProvider);\n","/*\n * ValidationErrors.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport React from 'react';\nimport { Alert } from 'react-bootstrap';\nimport { AppContext } from './AppProvider';\n\nexport default class ValidationErrors extends React.Component {\n static contextType = AppContext;\n\n errorMessage(error) {\n switch (error.tag) {\n case 'required':\n return `Field '${error.field}' is required.`;\n case 'unique':\n return `Field '${error.field}' must be unique.`;\n case 'email':\n return `Field '${error.field}' must be a valid email.`;\n case 'url':\n return `Field '${error.field}' must be a valid URL.`;\n case 'lt':\n return `Field '${error.field}' must be less than ${error.param} characters.`;\n case 'gt':\n return `Field '${error.field}' must be more than ${error.param} characters.`;\n case 'password_match':\n return `Passwords must match.`;\n default:\n return `Unknown error in field ${error.field}`;\n }\n }\n\n render() {\n const errors = this.context.state.errors.map((error) => {\n return (\n \n {this.errorMessage(error)}\n \n );\n });\n return (\n
\n {errors}\n
\n );\n }\n}","/*\n * EditLink.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport { faEdit, faPlus } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport React from 'react';\nimport { Button, Card, Form } from 'react-bootstrap';\nimport TagsInput from 'react-tagsinput';\nimport { AppContext } from './AppProvider';\nimport ValidationErrors from './ValidationErrors';\n\nexport default class EditLink extends React.Component {\n static contextType = AppContext;\n constructor(props) {\n super(props)\n this.state = {\n id: null,\n title: \"\",\n link: \"\",\n tags: []\n };\n this.handleTags = this.handleTags.bind(this);\n this.handleInput = this.handleInput.bind(this);\n this.onSubmit = this.onSubmit.bind(this);\n }\n\n componentDidMount() {\n if (this.props.edit) {\n const id = this.props.match.params.id;\n this.context.getLink(id).then(link => {\n if (link) {\n const tags = link.tags.map(tag => {\n return tag.name;\n });\n this.setState({\n id: link.id,\n title: link.title,\n link: link.link,\n tags: tags\n });\n }\n })\n }\n }\n\n handleTags(tags) {\n this.setState({ tags: tags })\n }\n\n handleInput(event) {\n const target = event.target;\n const value = target.value;\n const name = target.name;\n this.setState({\n [name]: value\n });\n }\n\n onSubmit() {\n const tags = this.state.tags.join(',');\n if (!this.props.edit) {\n this.context.addLink({\n link: this.state.link,\n tags: tags\n }).then(response => {\n if (response) {\n this.setState({\n title: \"\",\n link: \"\",\n tags: []\n });\n this.context.goHome();\n }\n });\n } else {\n this.context.updateLink(this.state.id, {\n title: this.state.title,\n link: this.state.link,\n tags: tags\n }).then(() => {\n this.context.goBack();\n })\n }\n }\n\n render() {\n return (\n
\n {this.props.edit &&\n

\n \n

\n }\n \n Add Link\n \n \n {this.props.edit &&\n \n Title\n \n \n }\n \n Link\n \n \n \n Tags\n \n \n {this.props.edit ?\n :\n \n }\n \n \n
\n );\n }\n}\n","/*\n * Footer.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport React from 'react';\nimport { Col, Container, Row } from 'react-bootstrap';\nimport { Link } from 'react-router-dom';\n\nexport default class Footer extends React.Component {\n render() {\n return (\n \n );\n }\n}\n","import React from 'react';\nimport { Button, Modal, Form, FormGroup } from 'react-bootstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faBan, faDownload } from '@fortawesome/free-solid-svg-icons';\nimport { AppContext } from './AppProvider';\n\nexport class Import extends React.Component {\n static contextType = AppContext;\n file = null;\n\n setFile(event) {\n const target = event.target;\n this.file = target.files[0];\n }\n\n onSubmit() {\n console.log(\"onSubmit()\");\n if (this.file !== null) {\n console.log(this.file);\n this.context.importOld(this.file).then(success => {\n if (success) {\n this.props.handleClose();\n }\n });\n }\n }\n\n render() {\n return (\n \n \n Import Bookmarks\n \n \n

\n Importing bookmarks is an asynchronous task, that means that, after you are redirected to home, you will have to refresh in a while in order to see all the bookmarks. That \"while\" will depend in how many bookmarks you are importing.\n

\n

\n Duplicate links won't be inserted.\n

\n \n \n \n \n \n \n \n
\n \n \n \n \n
\n );\n }\n}\n","/*\n * Header.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport React from 'react';\nimport { Link } from \"react-router-dom\";\nimport { Navbar, Nav, NavDropdown } from 'react-bootstrap';\nimport { AppContext } from './AppProvider';\nimport { Import } from './Import';\nimport Logo from './Logo.svg';\n\nexport default class Header extends React.Component {\n static contextType = AppContext;\n state = {\n showImport: false\n };\n\n showImport() {\n this.setState({showImport: true});\n }\n\n hideImport() {\n this.setState({showImport: false});\n }\n\n render() {\n let links;\n if (!this.context.state.isAuth) {\n links = ;\n } else {\n links = \n\t\t\t\t\n\t\t\t\t\tImport\n \n \n Export\n \n \n Logout\n \n \n }\n return (\n <>\n \n \n \n \"Linkbucket\"\n \n \n {links}\n \n \n \n );\n }\n}\n","/*\n * Tags.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nexport default class Tags extends React.Component {\n render() {\n const tags = this.props.tags\n .filter(t => t.count > 0)\n .sort((a, b) => {\n if (a.name < b.name) { return -1; }\n if (a.name > b.name) { return 1; }\n return 0;\n }).map((tag) => {\n return (\n \n \n {tag.name}\n {this.props.count && ` [${tag.count}]`}\n \n  \n \n );\n });\n return
{tags}
;\n }\n}\n","/*\n * Links.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport { faCopy, faEdit, faReply, faTrash } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport React from 'react';\nimport { Badge, Button, Card, Row } from 'react-bootstrap';\nimport Pagination from 'react-js-pagination';\nimport { Link } from 'react-router-dom';\nimport { AppContext } from './AppProvider';\nimport Tags from './Tags';\n\nexport default class Links extends React.Component {\n static contextType = AppContext;\n firstTime = true;\n\n loadLinks(top = false) {\n if (top) {\n window.location.href = \"#links\";\n }\n\n const path = this.props.match.path;\n const slug = this.props.match.params.slug;\n\n if (path === \"/home\") {\n this.context.getLinks();\n } else if (path === \"/tag/:slug\") {\n this.context.getLinksForTag(slug);\n } else if (path === \"/search\") {\n this.context.getLinksForSearch();\n }\n }\n\n componentDidMount() {\n if (this.firstTime) {\n this.firstTime = false;\n this.loadLinks();\n }\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.location !== prevProps.location) {\n this.loadLinks(true);\n }\n }\n\n handlePageChange(page) {\n const params = new URLSearchParams(this.props.location.search);\n this.context.setSearch('?p=' + page + (params.get('q') ? ('&q=' + params.get('q')) : ''));\n }\n\n onDelete(id) {\n this.context.deleteLink(id).then(() => {\n this.loadLinks();\n })\n }\n\n render() {\n const pag = this.context.state.pagination;\n var title =

Links

;\n if (this.props.match.path === \"/tag/:slug\") {\n title = (\n

\n \n \n {this.props.match.params.slug} ×\n \n \n

\n );\n } else if (this.props.match.path === \"/search\") {\n const params = new URLSearchParams(this.props.location.search);\n title = (\n

\n \n \n 🔎 {params.get('q')} ×\n \n \n

\n )\n }\n return (\n
\n {title}\n {this.context.state.links.map((link) => {\n return ;\n })}\n \n \n \n
\n );\n }\n}\n\nclass LinkItem extends React.Component {\n onDelete() {\n this.props.onDelete(this.props.link.id);\n }\n\n copyLink() {\n const link = this.props.link.link;\n const el = document.createElement('textarea');\n el.value = link;\n el.setAttribute('readonly', '');\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n }\n\n render() {\n const link = this.props.link;\n return (\n \n \n
{link.title}
\n \n {link.link}\n \n \n \n \n \n Go \n  \n \n Edit \n \n Delete \n
\n
\n );\n }\n}\n","/*\n * Home.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport { faSearch } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport React from 'react';\nimport { Card, Container, Form, InputGroup } from 'react-bootstrap';\nimport { Link } from 'react-router-dom';\nimport { AppContext } from './AppProvider';\nimport EditLink from './EditLink';\nimport Links from './Links';\nimport Tags from './Tags';\n\nexport default class Home extends React.Component {\n static contextType = AppContext;\n\n componentDidMount() {\n this.context.getTags();\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location !== this.props.location) {\n this.context.getTags();\n }\n }\n\n render() {\n return (\n \n \n
\n \n
\n \n
\n );\n }\n}\n\nclass Search extends React.Component {\n static contextType = AppContext;\n state = { q: \"\" }\n\n handleInput(event) {\n const target = event.target;\n const value = target.value;\n this.setState({\n q: value\n });\n }\n\n render() {\n return (\n \n Search\n \n

\n \n \n \n \n Search\n \n \n

\n

Tags

\n \n
\n
\n );\n }\n}\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport Logo from './Logo.svg';\nimport { Card, Container, Button } from 'react-bootstrap';\n\nexport default class Landing extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t

\n\t\t\t\t\t\tThe free and open source bookmark manager.\n\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t\t

It is supposed to respect your privacy.

\n\t\t\t\t\t
\n\t\t\t\t\tJoin \n\t\t\t\t\tLogin\n\t\t\t\t
\n\t\t\t
\n\t\t)\n\t}\n}\n","/*\n * Login.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport React from 'react';\nimport { Button, Card, Col, Container, Form } from 'react-bootstrap';\nimport { AppContext } from './AppProvider';\nimport ValidationErrors from './ValidationErrors';\n\n\nexport default class Login extends React.Component {\n static contextType = AppContext;\n\n constructor(props) {\n super(props);\n this.state = {\n email: \"\",\n password: \"\"\n };\n this.handleInput = this.handleInput.bind(this);\n this.onSubmit = this.onSubmit.bind(this);\n }\n\n handleInput(event) {\n const target = event.target;\n const value = target.value;\n const name = target.name;\n this.setState({\n [name]: value\n });\n }\n\n onSubmit() {\n this.context.login(this.state);\n }\n\n render() {\n return (\n \n \n Login\n \n \n \n E-Mail Address\n \n \n \n \n \n Password\n \n \n \n \n \n \n \n Login\n \n \n \n \n \n \n );\n }\n}\n","/*\n * Register.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport React from 'react';\nimport { Button, Card, Col, Container, Form } from 'react-bootstrap';\nimport { AppContext } from './AppProvider';\nimport ValidationErrors from './ValidationErrors';\n\nexport default class Register extends React.Component {\n static contextType = AppContext;\n\n constructor(props) {\n super(props);\n this.state = {\n name: \"\",\n email: \"\",\n password: \"\",\n confirm: \"\"\n };\n this.handleInput = this.handleInput.bind(this);\n this.onSubmit = this.onSubmit.bind(this);\n }\n\n handleInput(event) {\n const target = event.target;\n const value = target.value;\n const name = target.name;\n this.setState({\n [name]: value\n });\n }\n\n onSubmit() {\n if (this.state.password === \"\" || this.state.password === this.state.confirm) {\n this.context.register(this.state);\n } else {\n this.context.addError({ \"tag\": \"match\" });\n }\n }\n\n render() {\n return (\n \n \n Register\n \n \n \n Name\n \n \n \n \n \n E-Mail Address\n \n \n \n \n \n Password\n \n \n \n \n \n Confirm Password\n \n \n \n \n \n \n \n Register\n \n \n \n \n \n \n );\n }\n}\n","/*\n * Login.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport React from 'react';\nimport { Card, Container } from 'react-bootstrap';\nimport { Route } from 'react-router-dom';\n\nexport default class Site extends React.Component {\n render() {\n return (\n \n \n \n \n About\n\t\t\t\t\t\t\n \n Linkbucket is a free and open-source online bookmark manager focused on simplicity and minimalism.\n\t\t\t\t\t\t\n \n \n \n \n \n Free and Open Source\n\t\t\t\t\t\t\n \n The software that powers this website is called Linkbucket and anyone can download the \n\t\t\t\t\t\t\tsource code and run their own instance!\n\t\t\t\t\t\t\tIt is written in Go and React and it is totally self-hostable, so you can run your own instance.\n\t\t\t\t\t\t\n \n \n \n );\n }\n}\n","/*\n * App.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport React from 'react';\nimport { Col, Container, Row, Spinner } from 'react-bootstrap';\nimport {\n BrowserRouter as Router,\n\n\n Redirect, Route, Switch\n} from \"react-router-dom\";\nimport './App.css';\nimport { AppContext, AppProviderWithRouter } from './AppProvider';\nimport EditLink from './EditLink';\nimport Footer from './Footer';\nimport Header from './Header';\nimport Home from './Home';\nimport Landing from './Landing';\nimport Login from './Login';\nimport './Logo.svg';\nimport Register from './Register';\nimport Site from './Site';\n\n\nexport default class App extends React.Component {\n render() {\n return (\n \n \n \n {context => (\n
\n \n
\n \n \n \n \n \n \n {context.state.isAuth && }\n \n \n {context.state.isAuth ? : }\n \n \n {context.state.isAuth ? : }\n \n (\n !context.state.isAuth ? : \n )} />\n (\n !context.state.isAuth ? : \n )} />\n \n \n \n \n \n \n \n
\n
\n )}\n
\n
\n
\n );\n }\n}\n\nfunction Loading({ ...props }) {\n if (props.loading) {\n return (\n
\n \n Loading...\n \n
\n );\n } else {\n return
;\n }\n}\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\nexport function register(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(process.env.PUBLIC_URL, window.location.href);\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, 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, 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","/*\n * index.js\n * Copyright (C) 2020 Iván Ávalos \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\nimport 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","module.exports = __webpack_public_path__ + \"static/media/Logo.6f0f7086.svg\";"],"sourceRoot":""}