solid-ui 2.5.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/841.solid-ui.min.js +1 -1
- package/dist/841.solid-ui.min.js.map +1 -1
- package/dist/_2b19.solid-ui.js.map +1 -1
- package/dist/solid-ui.js +42754 -45728
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.LICENSE.txt +1 -5
- package/dist/solid-ui.min.js.map +1 -1
- package/lib/acl/access-controller.js +48 -49
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +40 -40
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +18 -19
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +4 -5
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +51 -52
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/chat/bookmarks.js +76 -77
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +74 -75
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +66 -67
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +218 -220
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/keys.js +62 -63
- package/lib/chat/keys.js.map +1 -1
- package/lib/chat/message.js +98 -100
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +99 -100
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/signature.d.ts.map +1 -1
- package/lib/chat/signature.js +0 -1
- package/lib/chat/signature.js.map +1 -1
- package/lib/chat/thread.js +57 -61
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js +1 -2
- package/lib/create/create.js.map +1 -1
- package/lib/folders.js +1 -4
- package/lib/folders.js.map +1 -1
- package/lib/footer/index.d.ts.map +1 -1
- package/lib/footer/index.js +14 -16
- package/lib/footer/index.js.map +1 -1
- package/lib/header/index.js +34 -36
- package/lib/header/index.js.map +1 -1
- package/lib/iconBase.d.ts.map +1 -1
- package/lib/iconBase.js +0 -1
- package/lib/iconBase.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/log.d.ts +7 -7
- package/lib/log.d.ts.map +1 -1
- package/lib/log.js +2 -2
- package/lib/log.js.map +1 -1
- package/lib/login/login.js +217 -222
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/matrix.js +1 -2
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/matrix/types.js.map +1 -1
- package/lib/media/media-capture.js +3 -4
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js +1 -4
- package/lib/messageArea.js.map +1 -1
- package/lib/ns.js +1 -2
- package/lib/ns.js.map +1 -1
- package/lib/pad.js +1 -2
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +1 -2
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +1 -2
- package/lib/preferences.js.map +1 -1
- package/lib/table.js +1 -2
- package/lib/table.js.map +1 -1
- package/lib/tabs.d.ts.map +1 -1
- package/lib/tabs.js +1 -2
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
- package/lib/utils/headerFooterHelpers.js +36 -36
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +1 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/keyHelpers/accessData.d.ts.map +1 -1
- package/lib/utils/keyHelpers/accessData.js +33 -34
- package/lib/utils/keyHelpers/accessData.js.map +1 -1
- package/lib/utils/keyHelpers/acl.d.ts.map +1 -1
- package/lib/utils/keyHelpers/acl.js +21 -22
- package/lib/utils/keyHelpers/acl.js.map +1 -1
- package/lib/utils/keyHelpers/otherHelpers.d.ts.map +1 -1
- package/lib/utils/keyHelpers/otherHelpers.js +1 -2
- package/lib/utils/keyHelpers/otherHelpers.js.map +1 -1
- package/lib/utils/label.js +1 -2
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.d.ts +4 -3
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +30 -30
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.d.ts.map +1 -1
- package/lib/widgets/buttons/iconLinks.js +2 -2
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.d.ts +1 -1
- package/lib/widgets/buttons.d.ts.map +1 -1
- package/lib/widgets/buttons.js +1 -3
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js +1 -2
- package/lib/widgets/dragAndDrop.js.map +1 -1
- package/lib/widgets/error.js +1 -2
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +47 -48
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +38 -39
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +44 -45
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +23 -24
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.d.ts.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +91 -93
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.js +2 -3
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.js +1 -2
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldParams.js +1 -2
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.js +1 -2
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +79 -80
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/index.js +1 -2
- package/lib/widgets/index.js.map +1 -1
- package/lib/widgets/multiSelect.js +1 -2
- package/lib/widgets/multiSelect.js.map +1 -1
- package/lib/widgets/peoplePicker.js +1 -2
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/lib/widgets/widgetHelpers.d.ts.map +1 -1
- package/lib/widgets/widgetHelpers.js +3 -3
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +57 -57
package/lib/chat/infinite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infinite.js","names":["$rdf","_interopRequireWildcard","require","_solidLogic","debug","_iconBase","ns","widgets","_chatLogic","_message","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_createForOfIteratorHelper","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","done","value","f","TypeError","o","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","desktopNotification","str","window","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","_x","_x2","_x3","_x4","_x5","_x6","_insertMessageIntoTable","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","channelObject","messageTable","message","fresh","options","userContext","messageRow","ele","newestFirst","dateString","wrap","_callee$","_context","prev","renderMessageRow","sent","selectedMessage","sameTerm","style","backgroundColor","selectedElement","firstChild","abrupt","newestfirst","AJAR_date","insertBefore","nextSibling","appendChild","stop","infiniteMessageArea","_x7","_x8","_x9","_x10","_infiniteMessageArea","_callee15","dom","wasStore","chatChannel","syncMessages","_syncMessages","addMessage","_addMessage","insertPreviousMessages","_insertPreviousMessages","removePreviousMessages","createMessageTable","_createMessageTable","renderMessageTable","_renderMessageTable","addNewChatDocumentIfNewDay","_addNewChatDocumentIfNewDay","appendCurrentMessages","_appendCurrentMessages","loadMoreWhereNeeded","_loadMoreWhereNeeded","loadInitialContent","_loadInitialContent","dateFolder","div","statusArea","liveMessageTable","threadRootMessage","earliest","latest","thread","threadTime","lock","_callee15$","_context15","_loadInitialContent3","_callee14","yank","fixScroll","live","selectedDocument","threadRootDocument","initialDocment","now","todayDocument","selectedMessageTable","selectedDate","_callee14$","_context14","_fixScroll","scrollIntoView","block","inputRow","_yank","doc","Date","leafDocumentFromDate","dateFromLeafDocument","setTimeout","addEventListener","solo","document","body","_loadInitialContent2","_loadMoreWhereNeeded3","_callee13","event","freeze","magicZone","scrollBottom","scrollTop","_callee13$","_context13","initial","extendBackwards","scrollHeight","clientHeight","extendForwards","_loadMoreWhereNeeded2","_x20","_x21","_appendCurrentMessage2","_callee12","chatDocument","_callee12$","_context12","refresh","_callee11","_callee11$","_context11","store","updater","addDownstreamChangeListener","_appendCurrentMessage","_addNewChatDocumentIf2","_callee10","newChatDocument","oldChatDocument","sts","_callee10$","_context10","removeChild","holds","rdfs","st","update","err","alert","_addNewChatDocumentIf","_renderMessageTable3","_callee9","date","scrollBackbutton","scrollForwardButton","_extendBackwards","setScrollBackbuttonIcon","_extendForwards","setScrollForwardButtonIcon","scrollForwardButtonHandler","_scrollForwardButtonHandler","tr","titleTR","scrollBackbuttonCell","dateCell","scrollForwardButtonCell","_iterator2","_step2","_callee9$","_context9","_scrollForwardButtonH2","_callee8","_event","_callee8$","_context8","extendedForwards","_scrollForwardButtonH","_x22","_setScrollForwardButt","sense","scrollForwardIcon","getScrollForwardButtonIcon","setAttribute","icons","iconBase","_extendForwards3","_callee7","_callee7$","_context7","_extendForwards2","_setScrollBackbuttonI","extendedBack","scrollBackIcon","getScrollbackIcon","_extendBackwards3","_callee6","_callee6$","_context6","disabled","_extendBackwards2","createElement","width","renderMessageEditor","textContent","shortDate","toISOString","includeRemoveButton","cancelButton","_e","parentNode","statementsMatching","wf","object","t0","finish","_renderMessageTable2","_x18","_x19","_createMessageTable3","_callee5","statusTR","_callee5$","_context5","fetcher","createIfNotExists","response","status","log","errorMessageBlock","_createMessageTable2","_x16","_x17","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee4","extremity","todayDoc","newMessageTable","_callee4$","_context4","limit","loadPrevious","_insertPreviousMessag","_x15","_addMessage3","_callee3","id","_callee3$","_context3","isDeleted","showDeletedMessages","any","sioc","_addMessage2","_x13","_x14","_syncMessages3","_callee2","displayed","ele2","messages","stored","_iterator","_step","m","_callee2$","_context2","AJAR_subject","uri","each","refreshTree","_syncMessages2","_x11","_x12","authorDateOnLeft","ChatChannel","dct"],"sources":["../../src/chat/infinite.js"],"sourcesContent":["/**\n * Contains the [[infiniteMessageArea]] class\n * @packageDocumentation\n */\n// import { findBookmarkDocument } from './bookmarks'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport { store } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport * as ns from '../ns'\n// import * as style from '../style'\n// import * as utils from '../utils'\nimport * as widgets from '../widgets'\n// import * as pad from '../pad'\n// import { DateFolder } from './dateFolder'\nimport { ChatChannel, isDeleted } from './chatLogic'\nimport { renderMessageEditor, renderMessageRow } from './message'\n\n// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }\n\nexport function desktopNotification (str) {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n debug.warn('This browser does no t support desktop notification')\n } else if (Notification.permission === 'granted') {\n // Let's check whether notificatio n permissions have already been granted\n // eslint-disable-next-line no-new\n new Notification(str)\n } else if (Notification.permission !== 'denied') {\n // Otherwise, we need to ask the user for permission\n Notification.requestPermission().then(function (permission) {\n // If the user accepts, let's create a notification\n if (permission === 'granted') {\n // eslint-disable-next-line no-new\n new Notification(str)\n }\n })\n }\n // At last, if the user has denied notifications, and you\n // want to be respectful there is no need to bother them any more.\n}\n\n/**\n * Renders a chat message inside a `messageTable`\n */\nexport async function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = await renderMessageRow(channelObject,\n message,\n fresh,\n options,\n userContext\n )\n\n // const message = messageRow.AJAR_subject\n if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {\n messageRow.style.backgroundColor = 'yellow'\n options.selectedElement = messageRow\n messageTable.selectedElement = messageRow\n }\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n const newestFirst = options.newestfirst === true\n const dateString = messageRow.AJAR_date\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(messageRow, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(messageRow)\n }\n}\n\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n * Use to import store as param 2, now ignores it and uses the UI main store\n *\n * Options include:\n\n - shiftEnterSendsMessage: Use shift/enter to send message, Enter to add newline, instead of the reverse.\n - authorDateOnLeft: Display the author's anme and date of the message in the left column instead of first above the content\n - selectedMessage: Display one message highlighted with the chat around it\n - solo: By itelf on a webpage, so user scroll anywhere in the web page scan scroll the chat.\n - newestFirst: Arrange the chat messages chronologically newest at the top insted of at the bottom\n - infinite: Use infinite scroll\n - showDeletedMessages: Show messages which have been delted as \"deleted message\". Otherwise hide them.\n - expandImagesInline: If a URI by itself in a message looks like an image URI, replace it with the image\n - inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.\n\n */\nexport async function infiniteMessageArea (dom, wasStore, chatChannel, options) {\n // ///////////////////////////////////////////////////////////////////////\n\n async function syncMessages (chatChannel, messageTable) {\n const displayed = {}\n let ele, ele2\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n displayed[ele.AJAR_subject.uri] = true\n }\n }\n const messages = store.each(chatChannel, ns.wf('message'), null, messageTable.chatDocument)\n\n const stored = {}\n for (const m of messages) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n await addMessage(m, messageTable)\n }\n }\n\n // eslint-disable-next-line space-in-parens\n for (ele = messageTable.firstChild; ele;) {\n ele2 = ele.nextSibling\n if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {\n messageTable.removeChild(ele)\n }\n ele = ele2\n }\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n // Refresh thumbs up etc\n widgets.refreshTree(ele) // Things inside may have changed too\n }\n }\n } // syncMessages\n\n // Called once per original message displayed\n async function addMessage (message, messageTable) {\n // const latest = await mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(message) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n /* if (isReplaced(message)) { //\n return // this is old version\n } */\n let thread = store.any(null, ns.sioc('has_member'), message, message.doc())\n const id = store.any(message, ns.sioc('id'), null, message.doc())\n if (id && !thread) {\n thread = store.any(null, ns.sioc('has_member'), id, message.doc())\n }\n\n if (options.thread) { // only show things in thread\n if (store.holds(message, ns.sioc('has_reply'), options.thread)) { // root of thread\n // debug.log(' addMessage: displaying root of thread ' + thread)\n } else if (thread && thread.sameTerm(options.thread)) {\n // debug.log(' addMessage: Displaying body of thread ' + message.uri.slice(-10))\n } else {\n // debug.log(' addMessage: Suppress non-thread message in thread table ' + message.uri.slice(-10))\n return // suppress message not in thread\n }\n } else { // Not threads\n if (thread) {\n // debug.log(' addMessage: Suppress thread message in non-thread table ' + message.uri.slice(-10))\n return // supress thread messages in body\n } else {\n // debug.log(' addMessage: Normal non-thread message in non-thread table ' + message.uri.slice(-10))\n }\n }\n if (!messageTable.fresh) { // if messageTable has been updated with insertMessageIntoTable() don't do it again\n // debug.log('@@@ infinite insertMessageIntoTable ' + message) // alain\n // debug.log('fresh ' + messageTable.fresh)\n // debug.log(messageTable)\n await insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n }\n\n /* Add a new messageTable at the top/bottom\n\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n // Are we at the top of a thread?\n if (backwards && earliest.limit && date <= earliest.limit) {\n if (!liveMessageTable) await appendCurrentMessages() // If necessary skip to today and add that\n return true // done\n }\n // debug.log(' insertPreviousMessages: loadPrevious given date ' + date)\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\n // debug.log(' insertPreviousMessages: loadPrevious returns date ' + date)\n\n /* debug.log(\n `insertPreviousMessages: from ${\n backwards ? 'backwards' : 'forwards'\n } loadPrevious: ${date}`\n ) */\n if (!date && !backwards && !liveMessageTable) {\n await appendCurrentMessages() // If necessary skip to today and add that\n }\n if (!date) return true // done\n let live = false\n if (!backwards) {\n const todayDoc = dateFolder.leafDocumentFromDate(new Date())\n const doc = dateFolder.leafDocumentFromDate(date)\n live = doc.sameTerm(todayDoc) // Is this todays?\n }\n const newMessageTable = await createMessageTable(date, live)\n extremity.messageTable = newMessageTable // move pointer to earliest\n if (backwards ? newestFirst : !newestFirst) {\n // put on bottom or top\n div.appendChild(newMessageTable)\n } else {\n // put on top as we scroll back\n div.insertBefore(newMessageTable, div.firstChild)\n }\n return live // not done\n }\n\n /* Remove message tables earlier than this one\n */\n function removePreviousMessages (backwards, messageTable) {\n if (backwards ? newestFirst : !newestFirst) {\n // it was put on bottom\n while (messageTable.nextSibling) {\n div.removeChild(messageTable.nextSibling)\n }\n } else {\n // it was put on top as we scroll back\n while (messageTable.previousSibling) {\n div.removeChild(messageTable.previousSibling)\n }\n }\n const extr = backwards ? earliest : latest\n extr.messageTable = messageTable\n }\n\n /* Load and render message table\n ** @returns DOM element generates\n */\n async function createMessageTable (date, live) {\n // debug.log(' createMessageTable for ' + date)\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n try {\n await store.fetcher.createIfNotExists(chatDocument)\n } catch (err) {\n const messageTable = dom.createElement('table')\n const statusTR = messageTable.appendChild(dom.createElement('tr')) // ### find status in exception\n if (err.response && err.response.status && err.response.status === 404) {\n // debug.log('Error 404 for chat file ' + chatDocument)\n return await renderMessageTable(date, live) // no message file is fine. will be created later\n // statusTR.appendChild(widgets.errorMessageBlock(dom, 'no message file', 'white'))\n } else {\n debug.log('*** Error NON 404 for chat file ' + chatDocument)\n statusTR.appendChild(widgets.errorMessageBlock(dom, err, 'pink'))\n }\n return statusTR\n }\n return await renderMessageTable(date, live)\n }\n\n async function renderMessageTable (date, live) {\n const scrollBackbutton = null // was let\n const scrollForwardButton = null // was let\n\n /// ///////////////// Scroll down adding more above\n\n async function extendBackwards () {\n const done = await insertPreviousMessages(true)\n if (done) {\n if (scrollBackbutton) {\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n ) // T\n scrollBackbutton.disabled = true\n }\n messageTable.initial = true\n } else {\n messageTable.extendedBack = true\n }\n setScrollBackbuttonIcon()\n return done\n }\n\n function setScrollBackbuttonIcon () {\n if (!scrollBackbutton) {\n return\n }\n const sense = messageTable.extendedBack ? !newestFirst : newestFirst\n const scrollBackIcon = messageTable.initial\n ? 'noun_T-Block_1114655_000000.svg'\n : getScrollbackIcon(sense)\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollBackIcon\n )\n\n function getScrollbackIcon (sense) {\n return sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\n /*\n if (done) {\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n )\n scrollForwardButton.disabled = true\n messageTable.final = true\n } else {\n messageTable.extendedForwards = true\n }\n setScrollForwardButtonIcon()\n */\n return done\n }\n\n function setScrollForwardButtonIcon () {\n if (!scrollForwardButton) return\n const sense = messageTable.extendedForwards ? !newestFirst : newestFirst // noun_T-Block_1114657_000000.svg\n const scrollForwardIcon = messageTable.final\n ? 'noun_T-Block_1114657_000000.svg'\n : getScrollForwardButtonIcon(sense)\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollForwardIcon\n )\n\n function getScrollForwardButtonIcon (sense) {\n return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollForwardButtonHandler (_event) {\n if (messageTable.extendedForwards) {\n removePreviousMessages(false, messageTable)\n messageTable.extendedForwards = false\n setScrollForwardButtonIcon()\n } else {\n await extendForwards() // async\n latest.messageTable.scrollIntoView(newestFirst)\n }\n }\n\n /// ///////////////////////\n /*\n options = options || {}\n options.authorDateOnLeft = true\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n*/\n // debug.log('Options for called message Area', options)\n const messageTable = dom.createElement('table')\n messageTable.style.width = '100%' // fill the pane div\n messageTable.extendBackwards = extendBackwards // Make function available to scroll stuff\n messageTable.extendForwards = extendForwards // Make function available to scroll stuff\n\n messageTable.date = date\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n messageTable.chatDocument = chatDocument\n\n messageTable.fresh = false\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n if (live) {\n messageTable.final = true\n liveMessageTable = messageTable\n latest.messageTable = messageTable\n const tr = renderMessageEditor(channelObject, messageTable, userContext, options)\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n messageTable.inputRow = tr\n }\n\n /// ///// Infinite scroll\n //\n // @@ listen for swipe past end event not just button\n const test = true\n if (test) { // ws options.infinite but need for non-infinite\n const titleTR = dom.createElement('tr')\n const scrollBackbuttonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\n /*\n const scrollBackIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollBackbutton = widgets.button(\n dom,\n icons.iconBase + scrollBackIcon,\n 'Previous messages ...'\n )\n scrollBackbuttonCell.style = 'width:3em; height:3em;'\n scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false)\n messageTable.extendedBack = false\n scrollBackbuttonCell.appendChild(scrollBackbutton)\n setScrollBackbuttonIcon()\n */\n const dateCell = titleTR.appendChild(dom.createElement('td'))\n dateCell.style =\n 'text-align: center; vertical-align: middle; color: #888; font-style: italic;'\n dateCell.textContent = widgets.shortDate(date.toISOString(), true) // no time, only date\n\n // @@@@@@@@@@@ todo move this button to other end of message cell, o\n const scrollForwardButtonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n if (options.includeRemoveButton) {\n scrollForwardButtonCell.appendChild(widgets.cancelButton(dom, _e => {\n div.parentNode.removeChild(div)\n }))\n }\n /*\n const scrollForwardIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollForwardButton = widgets.button(\n dom,\n icons.iconBase + scrollForwardIcon,\n 'Later messages ...'\n )\n scrollForwardButtonCell.appendChild(scrollForwardButton)\n scrollForwardButtonCell.style = 'width:3em; height:3em;'\n scrollForwardButton.addEventListener(\n 'click',\n scrollForwardButtonHandler,\n false\n )\n messageTable.extendedForward = false\n setScrollForwardButtonIcon()\n */\n messageTable.extendedForwards = false\n\n if (!newestFirst) {\n // opposite end from the entry field\n messageTable.insertBefore(titleTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(titleTR) // newestFirst\n }\n }\n\n const sts = store.statementsMatching(null, ns.wf('message'), null, chatDocument)\n if (!live && sts.length === 0) {\n // not todays\n // no need buttomns at the moment\n // messageTable.style.visibility = 'collapse' // Hide files with no messages\n }\n for (const st of sts) {\n await addMessage(st.object, messageTable)\n }\n messageTable.fresh = true // message table updated with insertMessageIntoTable()\n return messageTable\n } // renderMessageTable\n\n async function addNewChatDocumentIfNewDay () {\n // @@ Remove listener from previous table as it is now static\n const newChatDocument = dateFolder.leafDocumentFromDate(new Date())\n if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {\n // It is a new day\n if (liveMessageTable.inputRow) {\n liveMessageTable.removeChild(liveMessageTable.inputRow)\n delete liveMessageTable.inputRow\n }\n const oldChatDocument = latest.messageTable.chatDocument\n await appendCurrentMessages()\n // Adding a link in the document will ping listeners to add the new block too\n if (\n !store.holds(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ) {\n const sts = [\n $rdf.st(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ]\n try {\n store.updater.update([], sts)\n } catch (err) {\n alert('Unable to link old chat file to new one:' + err)\n }\n }\n }\n }\n\n /*\n function messageCount () {\n var n = 0\n const tables = div.children\n for (let i = 0; i < tables.length; i++) {\n n += tables[i].children.length - 1\n // debug.log(' table length:' + tables[i].children.length)\n }\n return n\n }\n*/\n\n /* Add the live message block with entry field for today\n */\n async function appendCurrentMessages () {\n const now = new Date()\n const chatDocument = dateFolder.leafDocumentFromDate(now)\n\n /// ///////////////////////////////////////////////////////////\n const messageTable = await createMessageTable(now, true)\n div.appendChild(messageTable)\n div.refresh = async function () {\n // only the last messageTable is live\n await addNewChatDocumentIfNewDay(new Date())\n await syncMessages(chatChannel, messageTable) // @@ livemessagetable??\n desktopNotification(chatChannel)\n } // The short chat version the live update listening is done in the pane but we do it in the widget @@\n store.updater.addDownstreamChangeListener(chatDocument, div.refresh) // Live update\n liveMessageTable = messageTable\n latest.messageTable = liveMessageTable\n return messageTable\n }\n\n async function loadMoreWhereNeeded (event, fixScroll) {\n if (lock) return\n lock = true\n const freeze = !fixScroll\n const magicZone = 150\n // const top = div.scrollTop\n // const bottom = div.scrollHeight - top - div.clientHeight\n let done\n\n while (\n div.scrollTop < magicZone &&\n earliest.messageTable &&\n !earliest.messageTable.initial &&\n earliest.messageTable.extendBackwards\n ) {\n // If this has been called before the element is actually in the\n // user's DOM tree, then this scrollTop check won't work -> loop forever\n // https://github.com/solidos/solid-ui/issues/366\n if (div.scrollHeight === 0) {\n // debug.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // debug.log(' chat/loadMoreWhereNeeded: Going now')\n const scrollBottom = div.scrollHeight - div.scrollTop\n // debug.log('infinite scroll: adding above: top ' + div.scrollTop)\n done = await earliest.messageTable.extendBackwards()\n if (freeze) {\n div.scrollTop = div.scrollHeight - scrollBottom\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n while (\n options.selectedMessage && // we started in the middle not at the bottom\n div.scrollHeight - div.scrollTop - div.clientHeight < magicZone && // we are scrolled right to the bottom\n latest.messageTable &&\n !latest.messageTable.final && // there is more data to come\n latest.messageTable.extendForwards\n ) {\n const scrollTop = div.scrollTop\n /* debug.log(\n 'infinite scroll: adding below: bottom: ' +\n (div.scrollHeight - div.scrollTop - div.clientHeight)\n ) */\n done = await latest.messageTable.extendForwards() // then add more data on the bottom\n if (freeze) {\n div.scrollTop = scrollTop // while adding below keep same things in view\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n lock = false\n }\n\n async function loadInitialContent () {\n function yank () {\n if (selectedMessageTable && selectedMessageTable.selectedElement) {\n selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\n }\n }\n\n // During initial load ONLY keep scroll to selected thing or bottom\n function fixScroll () {\n if (options.selectedElement) {\n options.selectedElement.scrollIntoView({ block: 'center' }) // align tops or bottoms\n } else {\n if (liveMessageTable.inputRow.scrollIntoView) {\n liveMessageTable.inputRow.scrollIntoView(newestFirst) // align tops or bottoms\n }\n }\n }\n\n let live, selectedDocument, threadRootDocument\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n }\n if (threadRootMessage) {\n threadRootDocument = threadRootMessage.doc()\n }\n const initialDocment = selectedDocument || threadRootDocument\n\n if (initialDocment) {\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(initialDocment)\n }\n\n let selectedMessageTable\n if (initialDocment && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(initialDocment)\n selectedMessageTable = await createMessageTable(selectedDate, live)\n div.appendChild(selectedMessageTable)\n earliest.messageTable = selectedMessageTable\n latest.messageTable = selectedMessageTable\n yank()\n setTimeout(yank, 1000) // @@ kludge - restore position distubed by other cHANGES\n } else {\n // Live end\n await appendCurrentMessages()\n earliest.messageTable = liveMessageTable\n latest.messageTable = liveMessageTable\n }\n\n await loadMoreWhereNeeded(null, fixScroll)\n div.addEventListener('scroll', loadMoreWhereNeeded)\n if (options.solo) {\n document.body.addEventListener('scroll', loadMoreWhereNeeded)\n }\n }\n\n // Body of main function\n\n options = options || {}\n options.authorDateOnLeft = false // @@ make a user optiosn\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n channelObject.div = div\n\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n let liveMessageTable\n let threadRootMessage\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n if (options.thread) {\n const thread = options.thread\n threadRootMessage = store.any(null, ns.sioc('has_reply'), thread, thread.doc())\n if (threadRootMessage) {\n const threadTime = store.any(threadRootMessage, ns.dct('created'), null, threadRootMessage.doc())\n if (threadTime) {\n earliest.limit = new Date(threadTime.value)\n // debug.log(' infinite: thread start at ' + earliest.limit)\n }\n }\n }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";;;;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AiB,EAAEnI,EAAE,CAACsV,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,EAAEnN,iBAAiB,CAAC2B,GAAG,CAAC,CAAC,CAAC;cACjG,IAAIvB,UAAU,EAAE;gBACdH,QAAQ,CAAC8K,KAAK,GAAG,IAAInJ,IAAI,CAACxB,UAAU,CAACpG,KAAK,CAAC;gBAC3C;cACF;YACF;UACF;UAEIqG,IAAI,GAAG,KAAK;UAAAE,UAAA,CAAAnG,IAAA;UAAA,OAEVsF,kBAAkB,CAAC,CAAC;QAAA;UAAA,OAAAa,UAAA,CAAA/C,MAAA,WACnBqC,GAAG;QAAA;QAAA;UAAA,OAAAU,UAAA,CAAAzC,IAAA;MAAA;IAAA,GAAAO,SAAA;EAAA,CACX;EAAA,OAAAD,oBAAA,CAAAxC,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"infinite.js","names":["$rdf","_interopRequireWildcard","require","_solidLogic","debug","_iconBase","ns","widgets","_chatLogic","_message","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t4","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_createForOfIteratorHelper","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","done","value","TypeError","a","u","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","desktopNotification","str","window","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","_x","_x2","_x3","_x4","_x5","_x6","_insertMessageIntoTable","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","channelObject","messageTable","message","fresh","options","userContext","messageRow","ele","newestFirst","dateString","wrap","_context","prev","renderMessageRow","sent","selectedMessage","sameTerm","style","backgroundColor","selectedElement","firstChild","abrupt","newestfirst","AJAR_date","insertBefore","nextSibling","appendChild","stop","infiniteMessageArea","_x7","_x8","_x9","_x0","_infiniteMessageArea","_callee13","dom","wasStore","chatChannel","syncMessages","_syncMessages","addMessage","_addMessage","insertPreviousMessages","_insertPreviousMessages","removePreviousMessages","createMessageTable","_createMessageTable","renderMessageTable","_renderMessageTable","addNewChatDocumentIfNewDay","_addNewChatDocumentIfNewDay","appendCurrentMessages","_appendCurrentMessages","loadMoreWhereNeeded","_loadMoreWhereNeeded","loadInitialContent","_loadInitialContent","dateFolder","div","statusArea","liveMessageTable","threadRootMessage","earliest","latest","thread","threadTime","lock","_context13","_loadInitialContent3","_callee12","yank","fixScroll","live","selectedDocument","threadRootDocument","initialDocment","now","todayDocument","selectedMessageTable","selectedDate","_context12","_fixScroll","scrollIntoView","block","inputRow","_yank","doc","Date","leafDocumentFromDate","dateFromLeafDocument","setTimeout","addEventListener","solo","document","body","_loadInitialContent2","_loadMoreWhereNeeded3","_callee11","event","freeze","magicZone","scrollBottom","scrollTop","_context11","initial","extendBackwards","scrollHeight","clientHeight","extendForwards","_loadMoreWhereNeeded2","_x18","_x19","_appendCurrentMessage2","_callee10","chatDocument","_context10","refresh","_callee1","_context1","store","updater","addDownstreamChangeListener","_appendCurrentMessage","_addNewChatDocumentIf2","_callee0","newChatDocument","oldChatDocument","sts","_context0","removeChild","holds","rdfs","st","update","err","alert","_addNewChatDocumentIf","_renderMessageTable3","_callee9","date","scrollBackbutton","scrollForwardButton","_extendBackwards","setScrollBackbuttonIcon","_extendForwards","setScrollForwardButtonIcon","scrollForwardButtonHandler","_scrollForwardButtonHandler","tr","titleTR","scrollBackbuttonCell","dateCell","scrollForwardButtonCell","_iterator2","_step2","_t3","_context9","_scrollForwardButtonH2","_callee8","_event","_context8","extendedForwards","_scrollForwardButtonH","_x20","_setScrollForwardButt","sense","scrollForwardIcon","getScrollForwardButtonIcon","setAttribute","icons","iconBase","_extendForwards3","_callee7","_context7","_extendForwards2","_setScrollBackbuttonI","extendedBack","scrollBackIcon","getScrollbackIcon","_extendBackwards3","_callee6","_context6","disabled","_extendBackwards2","createElement","width","renderMessageEditor","textContent","shortDate","toISOString","includeRemoveButton","cancelButton","_e","parentNode","statementsMatching","wf","object","finish","_renderMessageTable2","_x16","_x17","_createMessageTable3","_callee5","statusTR","_t2","_context5","fetcher","createIfNotExists","response","status","log","errorMessageBlock","_createMessageTable2","_x14","_x15","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee4","extremity","todayDoc","newMessageTable","_context4","limit","loadPrevious","_insertPreviousMessag","_x13","_addMessage3","_callee3","id","_context3","isDeleted","showDeletedMessages","any","sioc","_addMessage2","_x11","_x12","_syncMessages3","_callee2","displayed","ele2","messages","stored","_iterator","_step","m","_t","_context2","AJAR_subject","uri","each","refreshTree","_syncMessages2","_x1","_x10","authorDateOnLeft","ChatChannel","dct"],"sources":["../../src/chat/infinite.js"],"sourcesContent":["/**\n * Contains the [[infiniteMessageArea]] class\n * @packageDocumentation\n */\n// import { findBookmarkDocument } from './bookmarks'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport { store } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport * as ns from '../ns'\n// import * as style from '../style'\n// import * as utils from '../utils'\nimport * as widgets from '../widgets'\n// import * as pad from '../pad'\n// import { DateFolder } from './dateFolder'\nimport { ChatChannel, isDeleted } from './chatLogic'\nimport { renderMessageEditor, renderMessageRow } from './message'\n\n// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }\n\nexport function desktopNotification (str) {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n debug.warn('This browser does no t support desktop notification')\n } else if (Notification.permission === 'granted') {\n // Let's check whether notificatio n permissions have already been granted\n // eslint-disable-next-line no-new\n new Notification(str)\n } else if (Notification.permission !== 'denied') {\n // Otherwise, we need to ask the user for permission\n Notification.requestPermission().then(function (permission) {\n // If the user accepts, let's create a notification\n if (permission === 'granted') {\n // eslint-disable-next-line no-new\n new Notification(str)\n }\n })\n }\n // At last, if the user has denied notifications, and you\n // want to be respectful there is no need to bother them any more.\n}\n\n/**\n * Renders a chat message inside a `messageTable`\n */\nexport async function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = await renderMessageRow(channelObject,\n message,\n fresh,\n options,\n userContext\n )\n\n // const message = messageRow.AJAR_subject\n if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {\n messageRow.style.backgroundColor = 'yellow'\n options.selectedElement = messageRow\n messageTable.selectedElement = messageRow\n }\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n const newestFirst = options.newestfirst === true\n const dateString = messageRow.AJAR_date\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(messageRow, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(messageRow)\n }\n}\n\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n * Use to import store as param 2, now ignores it and uses the UI main store\n *\n * Options include:\n\n - shiftEnterSendsMessage: Use shift/enter to send message, Enter to add newline, instead of the reverse.\n - authorDateOnLeft: Display the author's anme and date of the message in the left column instead of first above the content\n - selectedMessage: Display one message highlighted with the chat around it\n - solo: By itelf on a webpage, so user scroll anywhere in the web page scan scroll the chat.\n - newestFirst: Arrange the chat messages chronologically newest at the top insted of at the bottom\n - infinite: Use infinite scroll\n - showDeletedMessages: Show messages which have been delted as \"deleted message\". Otherwise hide them.\n - expandImagesInline: If a URI by itself in a message looks like an image URI, replace it with the image\n - inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.\n\n */\nexport async function infiniteMessageArea (dom, wasStore, chatChannel, options) {\n // ///////////////////////////////////////////////////////////////////////\n\n async function syncMessages (chatChannel, messageTable) {\n const displayed = {}\n let ele, ele2\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n displayed[ele.AJAR_subject.uri] = true\n }\n }\n const messages = store.each(chatChannel, ns.wf('message'), null, messageTable.chatDocument)\n\n const stored = {}\n for (const m of messages) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n await addMessage(m, messageTable)\n }\n }\n\n for (ele = messageTable.firstChild; ele;) {\n ele2 = ele.nextSibling\n if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {\n messageTable.removeChild(ele)\n }\n ele = ele2\n }\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n // Refresh thumbs up etc\n widgets.refreshTree(ele) // Things inside may have changed too\n }\n }\n } // syncMessages\n\n // Called once per original message displayed\n async function addMessage (message, messageTable) {\n // const latest = await mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(message) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n /* if (isReplaced(message)) { //\n return // this is old version\n } */\n let thread = store.any(null, ns.sioc('has_member'), message, message.doc())\n const id = store.any(message, ns.sioc('id'), null, message.doc())\n if (id && !thread) {\n thread = store.any(null, ns.sioc('has_member'), id, message.doc())\n }\n\n if (options.thread) { // only show things in thread\n if (store.holds(message, ns.sioc('has_reply'), options.thread)) { // root of thread\n // debug.log(' addMessage: displaying root of thread ' + thread)\n } else if (thread && thread.sameTerm(options.thread)) {\n // debug.log(' addMessage: Displaying body of thread ' + message.uri.slice(-10))\n } else {\n // debug.log(' addMessage: Suppress non-thread message in thread table ' + message.uri.slice(-10))\n return // suppress message not in thread\n }\n } else { // Not threads\n if (thread) {\n // debug.log(' addMessage: Suppress thread message in non-thread table ' + message.uri.slice(-10))\n return // supress thread messages in body\n } else {\n // debug.log(' addMessage: Normal non-thread message in non-thread table ' + message.uri.slice(-10))\n }\n }\n if (!messageTable.fresh) { // if messageTable has been updated with insertMessageIntoTable() don't do it again\n // debug.log('@@@ infinite insertMessageIntoTable ' + message) // alain\n // debug.log('fresh ' + messageTable.fresh)\n // debug.log(messageTable)\n await insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n }\n\n /* Add a new messageTable at the top/bottom\n\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n // Are we at the top of a thread?\n if (backwards && earliest.limit && date <= earliest.limit) {\n if (!liveMessageTable) await appendCurrentMessages() // If necessary skip to today and add that\n return true // done\n }\n // debug.log(' insertPreviousMessages: loadPrevious given date ' + date)\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\n // debug.log(' insertPreviousMessages: loadPrevious returns date ' + date)\n\n /* debug.log(\n `insertPreviousMessages: from ${\n backwards ? 'backwards' : 'forwards'\n } loadPrevious: ${date}`\n ) */\n if (!date && !backwards && !liveMessageTable) {\n await appendCurrentMessages() // If necessary skip to today and add that\n }\n if (!date) return true // done\n let live = false\n if (!backwards) {\n const todayDoc = dateFolder.leafDocumentFromDate(new Date())\n const doc = dateFolder.leafDocumentFromDate(date)\n live = doc.sameTerm(todayDoc) // Is this todays?\n }\n const newMessageTable = await createMessageTable(date, live)\n extremity.messageTable = newMessageTable // move pointer to earliest\n if (backwards ? newestFirst : !newestFirst) {\n // put on bottom or top\n div.appendChild(newMessageTable)\n } else {\n // put on top as we scroll back\n div.insertBefore(newMessageTable, div.firstChild)\n }\n return live // not done\n }\n\n /* Remove message tables earlier than this one\n */\n function removePreviousMessages (backwards, messageTable) {\n if (backwards ? newestFirst : !newestFirst) {\n // it was put on bottom\n while (messageTable.nextSibling) {\n div.removeChild(messageTable.nextSibling)\n }\n } else {\n // it was put on top as we scroll back\n while (messageTable.previousSibling) {\n div.removeChild(messageTable.previousSibling)\n }\n }\n const extr = backwards ? earliest : latest\n extr.messageTable = messageTable\n }\n\n /* Load and render message table\n ** @returns DOM element generates\n */\n async function createMessageTable (date, live) {\n // debug.log(' createMessageTable for ' + date)\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n try {\n await store.fetcher.createIfNotExists(chatDocument)\n } catch (err) {\n const messageTable = dom.createElement('table')\n const statusTR = messageTable.appendChild(dom.createElement('tr')) // ### find status in exception\n if (err.response && err.response.status && err.response.status === 404) {\n // debug.log('Error 404 for chat file ' + chatDocument)\n return await renderMessageTable(date, live) // no message file is fine. will be created later\n // statusTR.appendChild(widgets.errorMessageBlock(dom, 'no message file', 'white'))\n } else {\n debug.log('*** Error NON 404 for chat file ' + chatDocument)\n statusTR.appendChild(widgets.errorMessageBlock(dom, err, 'pink'))\n }\n return statusTR\n }\n return await renderMessageTable(date, live)\n }\n\n async function renderMessageTable (date, live) {\n const scrollBackbutton = null // was let\n const scrollForwardButton = null // was let\n\n /// ///////////////// Scroll down adding more above\n\n async function extendBackwards () {\n const done = await insertPreviousMessages(true)\n if (done) {\n if (scrollBackbutton) {\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n ) // T\n scrollBackbutton.disabled = true\n }\n messageTable.initial = true\n } else {\n messageTable.extendedBack = true\n }\n setScrollBackbuttonIcon()\n return done\n }\n\n function setScrollBackbuttonIcon () {\n if (!scrollBackbutton) {\n return\n }\n const sense = messageTable.extendedBack ? !newestFirst : newestFirst\n const scrollBackIcon = messageTable.initial\n ? 'noun_T-Block_1114655_000000.svg'\n : getScrollbackIcon(sense)\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollBackIcon\n )\n\n function getScrollbackIcon (sense) {\n return sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\n /*\n if (done) {\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n )\n scrollForwardButton.disabled = true\n messageTable.final = true\n } else {\n messageTable.extendedForwards = true\n }\n setScrollForwardButtonIcon()\n */\n return done\n }\n\n function setScrollForwardButtonIcon () {\n if (!scrollForwardButton) return\n const sense = messageTable.extendedForwards ? !newestFirst : newestFirst // noun_T-Block_1114657_000000.svg\n const scrollForwardIcon = messageTable.final\n ? 'noun_T-Block_1114657_000000.svg'\n : getScrollForwardButtonIcon(sense)\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollForwardIcon\n )\n\n function getScrollForwardButtonIcon (sense) {\n return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollForwardButtonHandler (_event) {\n if (messageTable.extendedForwards) {\n removePreviousMessages(false, messageTable)\n messageTable.extendedForwards = false\n setScrollForwardButtonIcon()\n } else {\n await extendForwards() // async\n latest.messageTable.scrollIntoView(newestFirst)\n }\n }\n\n /// ///////////////////////\n /*\n options = options || {}\n options.authorDateOnLeft = true\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n*/\n // debug.log('Options for called message Area', options)\n const messageTable = dom.createElement('table')\n messageTable.style.width = '100%' // fill the pane div\n messageTable.extendBackwards = extendBackwards // Make function available to scroll stuff\n messageTable.extendForwards = extendForwards // Make function available to scroll stuff\n\n messageTable.date = date\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n messageTable.chatDocument = chatDocument\n\n messageTable.fresh = false\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n if (live) {\n messageTable.final = true\n liveMessageTable = messageTable\n latest.messageTable = messageTable\n const tr = renderMessageEditor(channelObject, messageTable, userContext, options)\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n messageTable.inputRow = tr\n }\n\n /// ///// Infinite scroll\n //\n // @@ listen for swipe past end event not just button\n const test = true\n if (test) { // ws options.infinite but need for non-infinite\n const titleTR = dom.createElement('tr')\n const scrollBackbuttonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\n /*\n const scrollBackIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollBackbutton = widgets.button(\n dom,\n icons.iconBase + scrollBackIcon,\n 'Previous messages ...'\n )\n scrollBackbuttonCell.style = 'width:3em; height:3em;'\n scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false)\n messageTable.extendedBack = false\n scrollBackbuttonCell.appendChild(scrollBackbutton)\n setScrollBackbuttonIcon()\n */\n const dateCell = titleTR.appendChild(dom.createElement('td'))\n dateCell.style =\n 'text-align: center; vertical-align: middle; color: #888; font-style: italic;'\n dateCell.textContent = widgets.shortDate(date.toISOString(), true) // no time, only date\n\n // @@@@@@@@@@@ todo move this button to other end of message cell, o\n const scrollForwardButtonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n if (options.includeRemoveButton) {\n scrollForwardButtonCell.appendChild(widgets.cancelButton(dom, _e => {\n div.parentNode.removeChild(div)\n }))\n }\n /*\n const scrollForwardIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollForwardButton = widgets.button(\n dom,\n icons.iconBase + scrollForwardIcon,\n 'Later messages ...'\n )\n scrollForwardButtonCell.appendChild(scrollForwardButton)\n scrollForwardButtonCell.style = 'width:3em; height:3em;'\n scrollForwardButton.addEventListener(\n 'click',\n scrollForwardButtonHandler,\n false\n )\n messageTable.extendedForward = false\n setScrollForwardButtonIcon()\n */\n messageTable.extendedForwards = false\n\n if (!newestFirst) {\n // opposite end from the entry field\n messageTable.insertBefore(titleTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(titleTR) // newestFirst\n }\n }\n\n const sts = store.statementsMatching(null, ns.wf('message'), null, chatDocument)\n if (!live && sts.length === 0) {\n // not todays\n // no need buttomns at the moment\n // messageTable.style.visibility = 'collapse' // Hide files with no messages\n }\n for (const st of sts) {\n await addMessage(st.object, messageTable)\n }\n messageTable.fresh = true // message table updated with insertMessageIntoTable()\n return messageTable\n } // renderMessageTable\n\n async function addNewChatDocumentIfNewDay () {\n // @@ Remove listener from previous table as it is now static\n const newChatDocument = dateFolder.leafDocumentFromDate(new Date())\n if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {\n // It is a new day\n if (liveMessageTable.inputRow) {\n liveMessageTable.removeChild(liveMessageTable.inputRow)\n delete liveMessageTable.inputRow\n }\n const oldChatDocument = latest.messageTable.chatDocument\n await appendCurrentMessages()\n // Adding a link in the document will ping listeners to add the new block too\n if (\n !store.holds(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ) {\n const sts = [\n $rdf.st(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ]\n try {\n store.updater.update([], sts)\n } catch (err) {\n alert('Unable to link old chat file to new one:' + err)\n }\n }\n }\n }\n\n /*\n function messageCount () {\n var n = 0\n const tables = div.children\n for (let i = 0; i < tables.length; i++) {\n n += tables[i].children.length - 1\n // debug.log(' table length:' + tables[i].children.length)\n }\n return n\n }\n*/\n\n /* Add the live message block with entry field for today\n */\n async function appendCurrentMessages () {\n const now = new Date()\n const chatDocument = dateFolder.leafDocumentFromDate(now)\n\n /// ///////////////////////////////////////////////////////////\n const messageTable = await createMessageTable(now, true)\n div.appendChild(messageTable)\n div.refresh = async function () {\n // only the last messageTable is live\n await addNewChatDocumentIfNewDay(new Date())\n await syncMessages(chatChannel, messageTable) // @@ livemessagetable??\n desktopNotification(chatChannel)\n } // The short chat version the live update listening is done in the pane but we do it in the widget @@\n store.updater.addDownstreamChangeListener(chatDocument, div.refresh) // Live update\n liveMessageTable = messageTable\n latest.messageTable = liveMessageTable\n return messageTable\n }\n\n async function loadMoreWhereNeeded (event, fixScroll) {\n if (lock) return\n lock = true\n const freeze = !fixScroll\n const magicZone = 150\n // const top = div.scrollTop\n // const bottom = div.scrollHeight - top - div.clientHeight\n let done\n\n while (\n div.scrollTop < magicZone &&\n earliest.messageTable &&\n !earliest.messageTable.initial &&\n earliest.messageTable.extendBackwards\n ) {\n // If this has been called before the element is actually in the\n // user's DOM tree, then this scrollTop check won't work -> loop forever\n // https://github.com/solidos/solid-ui/issues/366\n if (div.scrollHeight === 0) {\n // debug.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // debug.log(' chat/loadMoreWhereNeeded: Going now')\n const scrollBottom = div.scrollHeight - div.scrollTop\n // debug.log('infinite scroll: adding above: top ' + div.scrollTop)\n done = await earliest.messageTable.extendBackwards()\n if (freeze) {\n div.scrollTop = div.scrollHeight - scrollBottom\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n while (\n options.selectedMessage && // we started in the middle not at the bottom\n div.scrollHeight - div.scrollTop - div.clientHeight < magicZone && // we are scrolled right to the bottom\n latest.messageTable &&\n !latest.messageTable.final && // there is more data to come\n latest.messageTable.extendForwards\n ) {\n const scrollTop = div.scrollTop\n /* debug.log(\n 'infinite scroll: adding below: bottom: ' +\n (div.scrollHeight - div.scrollTop - div.clientHeight)\n ) */\n done = await latest.messageTable.extendForwards() // then add more data on the bottom\n if (freeze) {\n div.scrollTop = scrollTop // while adding below keep same things in view\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n lock = false\n }\n\n async function loadInitialContent () {\n function yank () {\n if (selectedMessageTable && selectedMessageTable.selectedElement) {\n selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\n }\n }\n\n // During initial load ONLY keep scroll to selected thing or bottom\n function fixScroll () {\n if (options.selectedElement) {\n options.selectedElement.scrollIntoView({ block: 'center' }) // align tops or bottoms\n } else {\n if (liveMessageTable.inputRow.scrollIntoView) {\n liveMessageTable.inputRow.scrollIntoView(newestFirst) // align tops or bottoms\n }\n }\n }\n\n let live, selectedDocument, threadRootDocument\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n }\n if (threadRootMessage) {\n threadRootDocument = threadRootMessage.doc()\n }\n const initialDocment = selectedDocument || threadRootDocument\n\n if (initialDocment) {\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(initialDocment)\n }\n\n let selectedMessageTable\n if (initialDocment && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(initialDocment)\n selectedMessageTable = await createMessageTable(selectedDate, live)\n div.appendChild(selectedMessageTable)\n earliest.messageTable = selectedMessageTable\n latest.messageTable = selectedMessageTable\n yank()\n setTimeout(yank, 1000) // @@ kludge - restore position distubed by other cHANGES\n } else {\n // Live end\n await appendCurrentMessages()\n earliest.messageTable = liveMessageTable\n latest.messageTable = liveMessageTable\n }\n\n await loadMoreWhereNeeded(null, fixScroll)\n div.addEventListener('scroll', loadMoreWhereNeeded)\n if (options.solo) {\n document.body.addEventListener('scroll', loadMoreWhereNeeded)\n }\n }\n\n // Body of main function\n\n options = options || {}\n options.authorDateOnLeft = false // @@ make a user optiosn\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n channelObject.div = div\n\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n let liveMessageTable\n let threadRootMessage\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n if (options.thread) {\n const thread = options.thread\n threadRootMessage = store.any(null, ns.sioc('has_reply'), thread, thread.doc())\n if (threadRootMessage) {\n const threadTime = store.any(threadRootMessage, ns.dct('created'), null, threadRootMessage.doc())\n if (threadTime) {\n earliest.limit = new Date(threadTime.value)\n // debug.log(' infinite: thread start at ' + earliest.limit)\n }\n }\n }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";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AEVqF,kBAAkB,CAAC,CAAC;QAAA;UAAA,OAAAY,UAAA,CAAA9C,MAAA,WACnBqC,GAAG;QAAA;QAAA;UAAA,OAAAS,UAAA,CAAAxC,IAAA;MAAA;IAAA,GAAAO,SAAA;EAAA,CACX;EAAA,OAAAD,oBAAA,CAAAvC,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
package/lib/chat/keys.js
CHANGED
|
@@ -19,8 +19,7 @@ var _solidLogic = require("solid-logic");
|
|
|
19
19
|
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
20
20
|
var _accessData = require("../utils/keyHelpers/accessData");
|
|
21
21
|
var _acl = require("../utils/keyHelpers/acl");
|
|
22
|
-
function
|
|
23
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
22
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
24
23
|
function generatePrivateKey() {
|
|
25
24
|
return (0, _utils.bytesToHex)(_secp256k.schnorr.utils.randomPrivateKey());
|
|
26
25
|
}
|
|
@@ -40,33 +39,33 @@ function getPublicKey(_x) {
|
|
|
40
39
|
}
|
|
41
40
|
function _getPublicKey() {
|
|
42
41
|
_getPublicKey = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
|
|
43
|
-
var publicKeyDoc, key;
|
|
44
|
-
return _regenerator["default"].wrap(function
|
|
42
|
+
var publicKeyDoc, key, _t2;
|
|
43
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
45
44
|
while (1) switch (_context2.prev = _context2.next) {
|
|
46
45
|
case 0:
|
|
47
|
-
_context2.next =
|
|
46
|
+
_context2.next = 1;
|
|
48
47
|
return _solidLogic.store.fetcher.load(webId);
|
|
49
|
-
case
|
|
50
|
-
_context2.next =
|
|
48
|
+
case 1:
|
|
49
|
+
_context2.next = 2;
|
|
51
50
|
return (0, _accessData.pubKeyUrl)(webId);
|
|
52
|
-
case
|
|
51
|
+
case 2:
|
|
53
52
|
publicKeyDoc = _context2.sent;
|
|
54
|
-
_context2.prev =
|
|
55
|
-
_context2.next =
|
|
53
|
+
_context2.prev = 3;
|
|
54
|
+
_context2.next = 4;
|
|
56
55
|
return _solidLogic.store.fetcher.load(publicKeyDoc);
|
|
57
|
-
case
|
|
56
|
+
case 4:
|
|
58
57
|
// url.href)
|
|
59
58
|
key = _solidLogic.store.any(webId, ns.solid('publicKey'));
|
|
60
59
|
return _context2.abrupt("return", key === null || key === void 0 ? void 0 : key.value);
|
|
61
|
-
case
|
|
62
|
-
_context2.prev =
|
|
63
|
-
|
|
60
|
+
case 5:
|
|
61
|
+
_context2.prev = 5;
|
|
62
|
+
_t2 = _context2["catch"](3);
|
|
64
63
|
return _context2.abrupt("return", undefined);
|
|
65
|
-
case
|
|
64
|
+
case 6:
|
|
66
65
|
case "end":
|
|
67
66
|
return _context2.stop();
|
|
68
67
|
}
|
|
69
|
-
}, _callee2, null, [[
|
|
68
|
+
}, _callee2, null, [[3, 5]]);
|
|
70
69
|
}));
|
|
71
70
|
return _getPublicKey.apply(this, arguments);
|
|
72
71
|
}
|
|
@@ -76,27 +75,27 @@ function getPrivateKey(_x2) {
|
|
|
76
75
|
function _getPrivateKey() {
|
|
77
76
|
_getPrivateKey = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(webId) {
|
|
78
77
|
var publicKeyDoc, privateKeyDoc, publicKey, privateKey, validPublicKey, del, add, newPublicKey, keyContainer;
|
|
79
|
-
return _regenerator["default"].wrap(function
|
|
78
|
+
return _regenerator["default"].wrap(function (_context3) {
|
|
80
79
|
while (1) switch (_context3.prev = _context3.next) {
|
|
81
80
|
case 0:
|
|
82
|
-
_context3.next =
|
|
81
|
+
_context3.next = 1;
|
|
83
82
|
return _solidLogic.store.fetcher.load(webId);
|
|
84
|
-
case
|
|
85
|
-
_context3.next =
|
|
83
|
+
case 1:
|
|
84
|
+
_context3.next = 2;
|
|
86
85
|
return (0, _accessData.pubKeyUrl)(webId);
|
|
87
|
-
case
|
|
86
|
+
case 2:
|
|
88
87
|
publicKeyDoc = _context3.sent;
|
|
89
|
-
_context3.next =
|
|
88
|
+
_context3.next = 3;
|
|
90
89
|
return (0, _accessData.privKeyUrl)(webId);
|
|
91
|
-
case
|
|
90
|
+
case 3:
|
|
92
91
|
privateKeyDoc = _context3.sent;
|
|
93
|
-
_context3.next =
|
|
92
|
+
_context3.next = 4;
|
|
94
93
|
return (0, _accessData.getExistingPublicKey)(webId, publicKeyDoc);
|
|
95
|
-
case
|
|
94
|
+
case 4:
|
|
96
95
|
publicKey = _context3.sent;
|
|
97
|
-
_context3.next =
|
|
96
|
+
_context3.next = 5;
|
|
98
97
|
return (0, _accessData.getExistingPrivateKey)(webId, privateKeyDoc);
|
|
99
|
-
case
|
|
98
|
+
case 5:
|
|
100
99
|
privateKey = _context3.sent;
|
|
101
100
|
// is publicKey valid ?
|
|
102
101
|
validPublicKey = true;
|
|
@@ -106,23 +105,23 @@ function _getPrivateKey() {
|
|
|
106
105
|
|
|
107
106
|
// create key pair or repair publicKey
|
|
108
107
|
if (!(!privateKey || !publicKey || !validPublicKey)) {
|
|
109
|
-
_context3.next =
|
|
108
|
+
_context3.next = 8;
|
|
110
109
|
break;
|
|
111
110
|
}
|
|
112
111
|
del = [];
|
|
113
112
|
add = [];
|
|
114
113
|
if (privateKey) {
|
|
115
|
-
_context3.next =
|
|
114
|
+
_context3.next = 6;
|
|
116
115
|
break;
|
|
117
116
|
}
|
|
118
117
|
// add = []
|
|
119
118
|
privateKey = generatePrivateKey();
|
|
120
119
|
add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), _solidLogic.store.sym(privateKeyDoc))];
|
|
121
|
-
_context3.next =
|
|
120
|
+
_context3.next = 6;
|
|
122
121
|
return saveKey(privateKeyDoc, [], add, webId.uri);
|
|
123
|
-
case
|
|
122
|
+
case 6:
|
|
124
123
|
if (!(!publicKey || !validPublicKey)) {
|
|
125
|
-
_context3.next =
|
|
124
|
+
_context3.next = 7;
|
|
126
125
|
break;
|
|
127
126
|
}
|
|
128
127
|
del = [];
|
|
@@ -134,15 +133,15 @@ function _getPrivateKey() {
|
|
|
134
133
|
// update new valid key
|
|
135
134
|
newPublicKey = generatePublicKey(privateKey);
|
|
136
135
|
add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), _solidLogic.store.sym(publicKeyDoc))];
|
|
137
|
-
_context3.next =
|
|
136
|
+
_context3.next = 7;
|
|
138
137
|
return saveKey(publicKeyDoc, del, add);
|
|
139
|
-
case
|
|
138
|
+
case 7:
|
|
140
139
|
keyContainer = privateKeyDoc.substring(0, privateKeyDoc.lastIndexOf('/') + 1);
|
|
141
|
-
_context3.next =
|
|
140
|
+
_context3.next = 8;
|
|
142
141
|
return (0, _acl.setAcl)(keyContainer, (0, _acl.keyContainerAclBody)(webId.uri));
|
|
143
|
-
case
|
|
142
|
+
case 8:
|
|
144
143
|
return _context3.abrupt("return", privateKey);
|
|
145
|
-
case
|
|
144
|
+
case 9:
|
|
146
145
|
case "end":
|
|
147
146
|
return _context3.stop();
|
|
148
147
|
}
|
|
@@ -152,42 +151,42 @@ function _getPrivateKey() {
|
|
|
152
151
|
}
|
|
153
152
|
var deleteKeyAcl = /*#__PURE__*/function () {
|
|
154
153
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(keyDoc) {
|
|
155
|
-
var keyAclDoc, response;
|
|
156
|
-
return _regenerator["default"].wrap(function
|
|
154
|
+
var keyAclDoc, response, _t;
|
|
155
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
157
156
|
while (1) switch (_context.prev = _context.next) {
|
|
158
157
|
case 0:
|
|
159
|
-
_context.next =
|
|
158
|
+
_context.next = 1;
|
|
160
159
|
return _solidLogic.store.fetcher.load(keyDoc);
|
|
161
|
-
case
|
|
160
|
+
case 1:
|
|
162
161
|
keyAclDoc = _solidLogic.store.any(_solidLogic.store.sym(keyDoc), _solidLogic.store.sym('http://www.iana.org/assignments/link-relations/acl'));
|
|
163
162
|
if (!keyAclDoc) {
|
|
164
|
-
_context.next =
|
|
163
|
+
_context.next = 6;
|
|
165
164
|
break;
|
|
166
165
|
}
|
|
167
|
-
_context.prev =
|
|
168
|
-
_context.next =
|
|
166
|
+
_context.prev = 2;
|
|
167
|
+
_context.next = 3;
|
|
169
168
|
return _solidLogic.store.fetcher.webOperation('DELETE', keyAclDoc.value);
|
|
170
|
-
case
|
|
169
|
+
case 3:
|
|
171
170
|
response = _context.sent;
|
|
172
171
|
// this may fail if webId is not an owner
|
|
173
172
|
debug.log('delete keyAcl' + keyAclDoc.value + ' ' + response.status); // should test 404 and 2xx
|
|
174
|
-
_context.next =
|
|
173
|
+
_context.next = 6;
|
|
175
174
|
break;
|
|
176
|
-
case
|
|
177
|
-
_context.prev =
|
|
178
|
-
|
|
179
|
-
if (!(
|
|
180
|
-
_context.next =
|
|
175
|
+
case 4:
|
|
176
|
+
_context.prev = 4;
|
|
177
|
+
_t = _context["catch"](2);
|
|
178
|
+
if (!(_t.response.status !== 404)) {
|
|
179
|
+
_context.next = 5;
|
|
181
180
|
break;
|
|
182
181
|
}
|
|
183
|
-
throw new Error(
|
|
184
|
-
case
|
|
185
|
-
debug.log('delete keyAcl' + keyAclDoc.value + ' ' +
|
|
186
|
-
case
|
|
182
|
+
throw new Error(_t);
|
|
183
|
+
case 5:
|
|
184
|
+
debug.log('delete keyAcl' + keyAclDoc.value + ' ' + _t.response.status); // should test 404 and 2xx
|
|
185
|
+
case 6:
|
|
187
186
|
case "end":
|
|
188
187
|
return _context.stop();
|
|
189
188
|
}
|
|
190
|
-
}, _callee, null, [[
|
|
189
|
+
}, _callee, null, [[2, 4]]);
|
|
191
190
|
}));
|
|
192
191
|
return function deleteKeyAcl(_x3) {
|
|
193
192
|
return _ref.apply(this, arguments);
|
|
@@ -207,21 +206,21 @@ function _saveKey() {
|
|
|
207
206
|
var me = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
208
207
|
return /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
209
208
|
var aclBody;
|
|
210
|
-
return _regenerator["default"].wrap(function
|
|
209
|
+
return _regenerator["default"].wrap(function (_context4) {
|
|
211
210
|
while (1) switch (_context4.prev = _context4.next) {
|
|
212
211
|
case 0:
|
|
213
|
-
_context4.next =
|
|
212
|
+
_context4.next = 1;
|
|
214
213
|
return deleteKeyAcl(keyDoc);
|
|
215
|
-
case
|
|
216
|
-
_context4.next =
|
|
214
|
+
case 1:
|
|
215
|
+
_context4.next = 2;
|
|
217
216
|
return _solidLogic.store.updater.updateMany(del, add);
|
|
218
|
-
case
|
|
217
|
+
case 2:
|
|
219
218
|
// or a promise store.updater.update ?
|
|
220
219
|
// create READ only ACL
|
|
221
220
|
aclBody = (0, _acl.keyAclBody)(keyDoc, me);
|
|
222
|
-
_context4.next =
|
|
221
|
+
_context4.next = 3;
|
|
223
222
|
return (0, _acl.setAcl)(keyDoc, aclBody);
|
|
224
|
-
case
|
|
223
|
+
case 3:
|
|
225
224
|
case "end":
|
|
226
225
|
return _context4.stop();
|
|
227
226
|
}
|
package/lib/chat/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","names":["debug","_interopRequireWildcard","require","_secp256k","_utils","ns","_solidLogic","$rdf","_accessData","_acl","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","generatePrivateKey","bytesToHex","schnorr","utils","randomPrivateKey","generatePublicKey","privateKey","getPublicKey","_x","_getPublicKey","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","webId","publicKeyDoc","key","wrap","_callee2$","_context2","prev","next","store","fetcher","load","pubKeyUrl","sent","any","solid","abrupt","value","t0","undefined","stop","getPrivateKey","_x2","_getPrivateKey","_callee3","privateKeyDoc","publicKey","validPublicKey","del","add","newPublicKey","keyContainer","_callee3$","_context3","privKeyUrl","getExistingPublicKey","getExistingPrivateKey","confirm","uri","st","literal","sym","saveKey","lit","log","substring","lastIndexOf","setAcl","keyContainerAclBody","deleteKeyAcl","_ref","_callee","keyDoc","keyAclDoc","response","_callee$","_context","webOperation","status","Error","_x3","_x4","_x5","_x6","_saveKey","me","length","_callee4","aclBody","_callee4$","_context4","updater","updateMany","keyAclBody"],"sources":["../../src/chat/keys.ts"],"sourcesContent":["import * as debug from '../debug'\r\nimport { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport * as ns from '../ns'\r\nimport { store } from 'solid-logic'\r\nimport { NamedNode } from 'rdflib'\r\nimport * as $rdf from 'rdflib'\r\nimport { getExistingPublicKey, pubKeyUrl, privKeyUrl, getExistingPrivateKey } from '../utils/keyHelpers/accessData'\r\nimport { setAcl, keyContainerAclBody, keyAclBody } from '../utils/keyHelpers/acl'\r\n\r\nexport function generatePrivateKey (): string {\r\n return bytesToHex(schnorr.utils.randomPrivateKey())\r\n}\r\n\r\nexport function generatePublicKey (privateKey: string): string {\r\n return bytesToHex(schnorr.getPublicKey(privateKey))\r\n}\r\n\r\n/**\r\n * getPublicKey\r\n * used for displaying messages in chat, therefore does not\r\n * create a new key if not found\r\n * @param webId\r\n * @returns string | undefined\r\n */\r\nexport async function getPublicKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n try {\r\n await store.fetcher.load(publicKeyDoc) // url.href)\r\n const key = store.any(webId, ns.solid('publicKey'))\r\n return key?.value // as NamedNode\r\n } catch (err) {\r\n return undefined\r\n }\r\n}\r\n\r\nexport async function getPrivateKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n // find keys url's\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n const privateKeyDoc = await privKeyUrl(webId)\r\n\r\n // find key pair\r\n const publicKey = await getExistingPublicKey(webId, publicKeyDoc)\r\n let privateKey = await getExistingPrivateKey(webId, privateKeyDoc)\r\n\r\n // is publicKey valid ?\r\n let validPublicKey = true\r\n if (privateKey && (publicKey !== generatePublicKey(privateKey as string))) {\r\n if (confirm('This is strange the publicKey is not valid for\\n' + webId?.uri +\r\n '\\'shall we repair keeping the private key ?')) validPublicKey = false\r\n }\r\n\r\n // create key pair or repair publicKey\r\n if (!privateKey || !publicKey || !validPublicKey) {\r\n let del: any[] = []\r\n let add: any[] = []\r\n\r\n if (!privateKey) {\r\n // add = []\r\n privateKey = generatePrivateKey()\r\n add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), store.sym(privateKeyDoc))]\r\n await saveKey(privateKeyDoc, [], add, webId.uri)\r\n }\r\n if (!publicKey || !validPublicKey) {\r\n del = []\r\n // delete invalid public key\r\n if (publicKey) {\r\n del = [$rdf.st(webId, ns.solid('publicKey'), $rdf.lit(publicKey), store.sym(publicKeyDoc))]\r\n debug.log('delete invalid publicKey ' + del)\r\n }\r\n // update new valid key\r\n const newPublicKey = generatePublicKey(privateKey)\r\n add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), store.sym(publicKeyDoc))]\r\n await saveKey(publicKeyDoc, del, add)\r\n }\r\n const keyContainer = privateKeyDoc.substring(0, privateKeyDoc.lastIndexOf('/') + 1)\r\n await setAcl(keyContainer, keyContainerAclBody(webId.uri)) // includes DELETE and PUT\r\n }\r\n return privateKey as string\r\n}\r\n\r\nconst deleteKeyAcl = async (keyDoc: string) => {\r\n await store.fetcher.load(keyDoc)\r\n\r\n const keyAclDoc = store.any(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl'))\r\n if (keyAclDoc) {\r\n // delete READ only keyAclDoc. This is possible if the webId is an owner\r\n try {\r\n const response = await store.fetcher.webOperation('DELETE', keyAclDoc.value) // this may fail if webId is not an owner\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + response.status) // should test 404 and 2xx\r\n } catch (err) {\r\n if (err.response.status !== 404) { throw new Error(err) }\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + err.response.status) // should test 404 and 2xx\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * delete acl if keydoc exists\r\n * create/edit keyDoc\r\n * set keyDoc acl\r\n */\r\nasync function saveKey (keyDoc: string, del, add, me: string = '') {\r\n await deleteKeyAcl(keyDoc)\r\n // save key\r\n await store.updater.updateMany(del, add) // or a promise store.updater.update ?\r\n\r\n // create READ only ACL\r\n const aclBody = keyAclBody(keyDoc, me)\r\n await setAcl(keyDoc, aclBody)\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAEA,IAAAK,IAAA,GAAAN,uBAAA,C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A;EAAAA,QAAA,OAAAnE,kBAAA,aAAtB,UAAwBuD,MAAc,EAAExB,GAAG,EAAEC,GAAG;IAAA,IAAEoC,EAAU,GAAArE,SAAA,CAAAsE,MAAA,QAAAtE,SAAA,QAAAuB,SAAA,GAAAvB,SAAA,MAAG,EAAE;IAAA,oBAAAE,YAAA,YAAAC,IAAA,UAAAoE,SAAA;MAAA,IAAAC,OAAA;MAAA,OAAAtE,YAAA,YAAAM,IAAA,UAAAiE,UAAAC,SAAA;QAAA,kBAAAA,SAAA,CAAA/D,IAAA,GAAA+D,SAAA,CAAA9D,IAAA;UAAA;YAAA8D,SAAA,CAAA9D,IAAA;YAAA,OACzDyC,YAAY,CAACG,MAAM,CAAC;UAAA;YAAAkB,SAAA,CAAA9D,IAAA;YAAA,OAEpBC,iBAAK,CAAC8D,OAAO,CAACC,UAAU,CAAC5C,GAAG,EAAEC,GAAG,CAAC;UAAA;YAAC;YAEzC;YACMuC,OAAO,GAAG,IAAAK,eAAU,EAACrB,MAAM,EAAEa,EAAE,CAAC;YAAAK,SAAA,CAAA9D,IAAA;YAAA,OAChC,IAAAuC,WAAM,EAACK,MAAM,EAAEgB,OAAO,CAAC;UAAA;UAAA;YAAA,OAAAE,SAAA,CAAAlD,IAAA;QAAA;MAAA,GAAA+C,QAAA;IAAA;EAAA,CAC9B;EAAA,OAAAH,QAAA,CAAArE,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"keys.js","names":["debug","_interopRequireWildcard","require","_secp256k","_utils","ns","_solidLogic","$rdf","_accessData","_acl","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t3","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","generatePrivateKey","bytesToHex","schnorr","utils","randomPrivateKey","generatePublicKey","privateKey","getPublicKey","_x","_getPublicKey","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","webId","publicKeyDoc","key","_t2","wrap","_context2","prev","next","store","fetcher","load","pubKeyUrl","sent","any","solid","abrupt","value","undefined","stop","getPrivateKey","_x2","_getPrivateKey","_callee3","privateKeyDoc","publicKey","validPublicKey","del","add","newPublicKey","keyContainer","_context3","privKeyUrl","getExistingPublicKey","getExistingPrivateKey","confirm","uri","st","literal","sym","saveKey","lit","log","substring","lastIndexOf","setAcl","keyContainerAclBody","deleteKeyAcl","_ref","_callee","keyDoc","keyAclDoc","response","_t","_context","webOperation","status","Error","_x3","_x4","_x5","_x6","_saveKey","me","length","_callee4","aclBody","_context4","updater","updateMany","keyAclBody"],"sources":["../../src/chat/keys.ts"],"sourcesContent":["import * as debug from '../debug'\r\nimport { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport * as ns from '../ns'\r\nimport { store } from 'solid-logic'\r\nimport { NamedNode } from 'rdflib'\r\nimport * as $rdf from 'rdflib'\r\nimport { getExistingPublicKey, pubKeyUrl, privKeyUrl, getExistingPrivateKey } from '../utils/keyHelpers/accessData'\r\nimport { setAcl, keyContainerAclBody, keyAclBody } from '../utils/keyHelpers/acl'\r\n\r\nexport function generatePrivateKey (): string {\r\n return bytesToHex(schnorr.utils.randomPrivateKey())\r\n}\r\n\r\nexport function generatePublicKey (privateKey: string): string {\r\n return bytesToHex(schnorr.getPublicKey(privateKey))\r\n}\r\n\r\n/**\r\n * getPublicKey\r\n * used for displaying messages in chat, therefore does not\r\n * create a new key if not found\r\n * @param webId\r\n * @returns string | undefined\r\n */\r\nexport async function getPublicKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n try {\r\n await store.fetcher.load(publicKeyDoc) // url.href)\r\n const key = store.any(webId, ns.solid('publicKey'))\r\n return key?.value // as NamedNode\r\n } catch (err) {\r\n return undefined\r\n }\r\n}\r\n\r\nexport async function getPrivateKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n // find keys url's\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n const privateKeyDoc = await privKeyUrl(webId)\r\n\r\n // find key pair\r\n const publicKey = await getExistingPublicKey(webId, publicKeyDoc)\r\n let privateKey = await getExistingPrivateKey(webId, privateKeyDoc)\r\n\r\n // is publicKey valid ?\r\n let validPublicKey = true\r\n if (privateKey && (publicKey !== generatePublicKey(privateKey as string))) {\r\n if (confirm('This is strange the publicKey is not valid for\\n' + webId?.uri +\r\n '\\'shall we repair keeping the private key ?')) validPublicKey = false\r\n }\r\n\r\n // create key pair or repair publicKey\r\n if (!privateKey || !publicKey || !validPublicKey) {\r\n let del: any[] = []\r\n let add: any[] = []\r\n\r\n if (!privateKey) {\r\n // add = []\r\n privateKey = generatePrivateKey()\r\n add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), store.sym(privateKeyDoc))]\r\n await saveKey(privateKeyDoc, [], add, webId.uri)\r\n }\r\n if (!publicKey || !validPublicKey) {\r\n del = []\r\n // delete invalid public key\r\n if (publicKey) {\r\n del = [$rdf.st(webId, ns.solid('publicKey'), $rdf.lit(publicKey), store.sym(publicKeyDoc))]\r\n debug.log('delete invalid publicKey ' + del)\r\n }\r\n // update new valid key\r\n const newPublicKey = generatePublicKey(privateKey)\r\n add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), store.sym(publicKeyDoc))]\r\n await saveKey(publicKeyDoc, del, add)\r\n }\r\n const keyContainer = privateKeyDoc.substring(0, privateKeyDoc.lastIndexOf('/') + 1)\r\n await setAcl(keyContainer, keyContainerAclBody(webId.uri)) // includes DELETE and PUT\r\n }\r\n return privateKey as string\r\n}\r\n\r\nconst deleteKeyAcl = async (keyDoc: string) => {\r\n await store.fetcher.load(keyDoc)\r\n\r\n const keyAclDoc = store.any(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl'))\r\n if (keyAclDoc) {\r\n // delete READ only keyAclDoc. This is possible if the webId is an owner\r\n try {\r\n const response = await store.fetcher.webOperation('DELETE', keyAclDoc.value) // this may fail if webId is not an owner\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + response.status) // should test 404 and 2xx\r\n } catch (err) {\r\n if (err.response.status !== 404) { throw new Error(err) }\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + err.response.status) // should test 404 and 2xx\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * delete acl if keydoc exists\r\n * create/edit keyDoc\r\n * set keyDoc acl\r\n */\r\nasync function saveKey (keyDoc: string, del, add, me: string = '') {\r\n await deleteKeyAcl(keyDoc)\r\n // save key\r\n await store.updater.updateMany(del, add) // or a promise store.updater.update ?\r\n\r\n // create READ only ACL\r\n const aclBody = keyAclBody(keyDoc, me)\r\n await setAcl(keyDoc, aclBody)\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAEA,IAAAK,IAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAAiF,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,wBAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,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