From a8eb1f84a2ddabae07f544c9720fcab3a98031e0 Mon Sep 17 00:00:00 2001 From: bourgeoa Date: Thu, 30 Nov 2023 16:48:05 +0000 Subject: [PATCH] deploy: 28954ea400b5ebbd9627fdf986cadccae104a51f --- Documentation/api/assets/navigation.js | 2 +- Documentation/api/assets/search.js | 2 +- Documentation/api/assets/style.css | 11 + Documentation/api/classes/rdf.BlankNode.html | 24 +- Documentation/api/classes/rdf.Collection.html | 28 +- .../api/classes/rdf.ConnectedStore.html | 156 +- Documentation/api/classes/rdf.Empty.html | 22 +- Documentation/api/classes/rdf.Fetcher.html | 46 +- Documentation/api/classes/rdf.Formula.html | 102 +- Documentation/api/classes/rdf.Literal.html | 34 +- Documentation/api/classes/rdf.LiveStore.html | 156 +- .../api/classes/rdf.NamedNode-1.html | 32 +- Documentation/api/classes/rdf.Node.html | 22 +- Documentation/api/classes/rdf.Query.html | 4 +- Documentation/api/classes/rdf.RDFParser.html | 8 +- .../api/classes/rdf.RDFaProcessor-1.html | 4 +- Documentation/api/classes/rdf.Statement.html | 18 +- Documentation/api/classes/rdf.Store.html | 156 +- .../api/classes/rdf.UpdateManager.html | 62 +- .../api/classes/rdf.UpdatesSocket.html | 4 +- Documentation/api/classes/rdf.UpdatesVia.html | 4 +- Documentation/api/classes/rdf.Variable.html | 22 +- .../api/classes/tabs.TabWidgetElement.html | 170 +- Documentation/api/functions/initFooter.html | 4 +- Documentation/api/functions/initHeader.html | 4 +- .../api/functions/language.addDefaults.html | 2 +- .../functions/language.filterByLanguage.html | 2 +- .../language.getPreferredLanguages.html | 2 +- .../language.getPreferredLanguagesFor.html | 2 +- Documentation/api/functions/log.alert.html | 4 +- Documentation/api/functions/log.clear.html | 4 +- Documentation/api/functions/log.debug.html | 4 +- Documentation/api/functions/log.dumpHTML.html | 4 +- Documentation/api/functions/log.error.html | 4 +- Documentation/api/functions/log.info.html | 4 +- .../api/functions/log.logAscending.html | 4 +- .../api/functions/log.logDescending.html | 4 +- Documentation/api/functions/log.msg.html | 4 +- Documentation/api/functions/log.setLevel.html | 4 +- Documentation/api/functions/log.success.html | 4 +- Documentation/api/functions/log.warn.html | 4 +- .../login.ensureLoadedPreferences.html | 4 +- .../functions/login.ensureLoadedProfile.html | 4 +- .../api/functions/login.ensureLoggedIn.html | 4 +- .../functions/login.filterAvailablePanes.html | 4 +- .../api/functions/login.findAppInstances.html | 4 +- .../api/functions/login.getUserRoles.html | 4 +- .../api/functions/login.loginStatusBox.html | 4 +- .../api/functions/login.newAppInstance.html | 4 +- .../functions/login.registrationControl.html | 4 +- .../api/functions/login.registrationList.html | 4 +- .../login.renderScopeHeadingRow.html | 2 +- .../functions/login.renderSignInPopup.html | 2 +- .../api/functions/login.scopeLabel.html | 2 +- .../api/functions/login.selectWorkspace.html | 4 +- .../api/functions/pad.getChunks.html | 4 +- .../api/functions/pad.lightColorHash.html | 4 +- .../functions/pad.manageParticipation.html | 4 +- Documentation/api/functions/pad.notepad.html | 4 +- .../api/functions/pad.notepadToHTML.html | 4 +- .../functions/pad.participationObject.html | 4 +- .../functions/pad.recordParticipation.html | 4 +- .../api/functions/pad.renderPartipants.html | 4 +- .../api/functions/pad.xmlEncode.html | 4 +- Documentation/api/functions/rdf.N3Parser.html | 2 +- .../api/functions/rdf.SPARQLToQuery.html | 4 +- .../api/functions/rdf.Serializer.html | 2 +- .../functions/rdf.Util.DOMParserFactory.html | 4 +- .../functions/rdf.Util.RDFArrayRemove.html | 4 +- .../api/functions/rdf.Util.callbackify.html | 4 +- .../api/functions/rdf.Util.domToString.html | 2 +- .../api/functions/rdf.Util.dtstamp.html | 2 +- .../api/functions/rdf.Util.dumpNode.html | 2 +- .../api/functions/rdf.Util.heavyCompare.html | 4 +- .../functions/rdf.Util.heavyCompareSPO.html | 2 +- .../rdf.Util.linkRelationProperty.html | 2 +- .../functions/rdf.Util.mediaTypeClass.html | 2 +- .../api/functions/rdf.Util.output.html | 4 +- .../api/functions/rdf.Util.parseXML.html | 4 +- .../api/functions/rdf.Util.stackString.html | 2 +- .../functions/rdf.Util.string.template.html | 4 +- .../functions/rdf.Util.string_startswith.html | 2 +- .../api/functions/rdf.blankNode-1.html | 2 +- .../api/functions/rdf.defaultGraph.html | 2 +- .../api/functions/rdf.fetcher-1.html | 2 +- Documentation/api/functions/rdf.fromNT.html | 2 +- Documentation/api/functions/rdf.graph.html | 2 +- .../api/functions/rdf.isBlankNode.html | 4 +- .../api/functions/rdf.isCollection.html | 4 +- Documentation/api/functions/rdf.isGraph.html | 4 +- .../api/functions/rdf.isLiteral.html | 4 +- .../api/functions/rdf.isNamedNode.html | 4 +- .../api/functions/rdf.isPredicate.html | 4 +- Documentation/api/functions/rdf.isQuad.html | 4 +- .../api/functions/rdf.isRDFObject.html | 4 +- .../api/functions/rdf.isRDFlibObject.html | 4 +- .../api/functions/rdf.isRDFlibPredicate.html | 4 +- .../api/functions/rdf.isRDFlibSubject.html | 4 +- .../api/functions/rdf.isStatement.html | 4 +- Documentation/api/functions/rdf.isStore.html | 4 +- .../api/functions/rdf.isSubject.html | 4 +- Documentation/api/functions/rdf.isTerm.html | 4 +- .../api/functions/rdf.isVariable.html | 4 +- .../functions/rdf.jsonParser.parseJSON.html | 2 +- Documentation/api/functions/rdf.lit.html | 2 +- .../api/functions/rdf.literal-1.html | 2 +- .../api/functions/rdf.log.debug.html | 2 +- .../api/functions/rdf.log.error.html | 2 +- Documentation/api/functions/rdf.log.info.html | 2 +- Documentation/api/functions/rdf.log.msg.html | 2 +- .../api/functions/rdf.log.success.html | 2 +- Documentation/api/functions/rdf.log.warn.html | 2 +- Documentation/api/functions/rdf.parse.html | 4 +- Documentation/api/functions/rdf.quad.html | 2 +- .../api/functions/rdf.queryToSPARQL.html | 2 +- .../api/functions/rdf.serialize.html | 4 +- .../api/functions/rdf.sparqlUpdateParser.html | 2 +- Documentation/api/functions/rdf.st.html | 2 +- Documentation/api/functions/rdf.sym.html | 2 +- Documentation/api/functions/rdf.term.html | 2 +- .../api/functions/rdf.termValue.html | 4 +- Documentation/api/functions/rdf.triple.html | 2 +- .../api/functions/rdf.uri.docpart.html | 4 +- .../api/functions/rdf.uri.document.html | 4 +- .../api/functions/rdf.uri.hostpart.html | 4 +- Documentation/api/functions/rdf.uri.join.html | 4 +- .../api/functions/rdf.uri.protocol.html | 4 +- .../api/functions/rdf.uri.refTo.html | 4 +- .../api/functions/rdf.variable-1.html | 2 +- .../api/functions/tabs.tabWidget.html | 4 +- Documentation/api/index.html | 2 +- .../createTypes.NewAppInstanceOptions.html | 4 +- .../api/interfaces/language.Binding.html | 4 +- .../api/interfaces/rdf.AutoInitOptions.html | 4 +- .../api/interfaces/rdf.ExtendedResponse.html | 4 +- .../api/interfaces/rdf.FetchError.html | 4 +- Documentation/api/modules.html | 4 +- Documentation/api/modules/createTypes.html | 4 +- Documentation/api/modules/language.html | 4 +- Documentation/api/modules/log.html | 4 +- Documentation/api/modules/login.html | 4 +- Documentation/api/modules/pad.html | 4 +- Documentation/api/modules/participation.html | 4 +- .../api/modules/rdf.RDFaProcessor.html | 2 +- Documentation/api/modules/rdf.Util.html | 2 +- .../api/modules/rdf.Util.string.html | 2 +- Documentation/api/modules/rdf.html | 2 +- Documentation/api/modules/rdf.jsonParser.html | 2 +- Documentation/api/modules/rdf.log.html | 2 +- Documentation/api/modules/rdf.uri.html | 2 +- Documentation/api/modules/tabs.html | 4 +- .../api/types/createTypes.CreateContext.html | 2 +- Documentation/api/variables/acl.html | 2 +- Documentation/api/variables/aclControl.html | 2 +- Documentation/api/variables/authn.html | 2 +- Documentation/api/variables/create.html | 2 +- Documentation/api/variables/dom.html | 2 +- Documentation/api/variables/icons.html | 2 +- .../language.defaultPreferredLanguages.html | 2 +- .../language.languageCodeURIBase.html | 2 +- Documentation/api/variables/matrix.html | 2 +- Documentation/api/variables/media.html | 2 +- Documentation/api/variables/ns.html | 1 + .../api/variables/rdf.DataFactory.html | 2 +- Documentation/api/variables/rdf.NextId.html | 2 +- .../rdf.RDFaProcessor.HTMLLiteralURI.html | 2 +- .../variables/rdf.RDFaProcessor.NCNAME.html | 2 +- .../rdf.RDFaProcessor.PlainLiteralURI.html | 2 +- .../rdf.RDFaProcessor.XMLLiteralURI.html | 2 +- .../rdf.RDFaProcessor.dateTimeTypes.html | 2 +- .../variables/rdf.RDFaProcessor.nameChar.html | 2 +- .../rdf.RDFaProcessor.nameStartChar.html | 2 +- .../rdf.RDFaProcessor.objectURI.html | 2 +- .../variables/rdf.RDFaProcessor.typeURI.html | 2 +- Documentation/api/variables/store.html | 2 +- Documentation/api/variables/versionInfo.html | 2 +- dist/805.solid-ui.min.js | 2 +- dist/805.solid-ui.min.js.map | 2 +- dist/solid-ui.js | 5201 +++++++++++------ dist/solid-ui.js.map | 2 +- dist/solid-ui.min.js | 2 +- dist/solid-ui.min.js.map | 2 +- ...e_modules_jsonld_lib_jsonld_js.solid-ui.js | 271 +- ...dules_jsonld_lib_jsonld_js.solid-ui.js.map | 2 +- .../storybook/333.0a058c8b.iframe.bundle.js | 2 - .../storybook/333.964b3572.iframe.bundle.js | 2 + ...333.964b3572.iframe.bundle.js.LICENSE.txt} | 0 .../storybook/805.06e021f2.iframe.bundle.js | 2 - .../storybook/805.6d9f11aa.iframe.bundle.js | 2 + ...805.6d9f11aa.iframe.bundle.js.LICENSE.txt} | 0 examples/storybook/iframe.html | 2 +- ...ndle.js => main.def0ebf5.iframe.bundle.js} | 4 +- ...ain.def0ebf5.iframe.bundle.js.LICENSE.txt} | 0 examples/storybook/project.json | 2 +- ...=> runtime~main.3d56b083.iframe.bundle.js} | 2 +- lib/acl/access-groups.js | 2 - lib/acl/access-groups.js.map | 2 +- lib/acl/acl.js | 2 - lib/acl/acl.js.map | 2 +- lib/chat/chatLogic.js | 10 +- lib/chat/chatLogic.js.map | 2 +- lib/chat/infinite.js | 5 - lib/chat/infinite.js.map | 2 +- lib/chat/message.js | 10 +- lib/chat/message.js.map | 2 +- lib/chat/messageTools.js | 1 + lib/chat/messageTools.js.map | 2 +- lib/chat/thread.js | 4 - lib/chat/thread.js.map | 2 +- lib/create/create.js | 2 - lib/create/create.js.map | 2 +- lib/login/login.js | 47 +- lib/login/login.js.map | 2 +- lib/matrix/matrix.js | 2 - lib/matrix/matrix.js.map | 2 +- lib/media/media-capture.js | 3 - lib/media/media-capture.js.map | 2 +- lib/messageArea.js | 4 - lib/messageArea.js.map | 2 +- lib/pad.js | 9 +- lib/pad.js.map | 2 +- lib/participation.js | 5 +- lib/participation.js.map | 2 +- lib/table.js | 4 - lib/table.js.map | 2 +- lib/tabs.js | 2 - lib/tabs.js.map | 2 +- lib/utils/index.js | 7 - lib/utils/index.js.map | 2 +- lib/versionInfo.js | 6 +- lib/versionInfo.js.map | 2 +- lib/widgets/buttons.js | 12 +- lib/widgets/buttons.js.map | 2 +- lib/widgets/dragAndDrop.js | 1 - lib/widgets/dragAndDrop.js.map | 2 +- lib/widgets/forms.js | 25 +- lib/widgets/forms.js.map | 2 +- .../forms/autocomplete/autocompleteBar.js | 10 +- .../forms/autocomplete/autocompleteField.js | 1 - .../autocomplete/autocompleteField.js.map | 2 +- .../forms/autocomplete/autocompletePicker.js | 11 +- .../autocomplete/autocompletePicker.js.map | 2 +- lib/widgets/forms/autocomplete/publicData.js | 3 - .../forms/autocomplete/publicData.js.map | 2 +- lib/widgets/forms/basic.js | 1 - lib/widgets/forms/basic.js.map | 2 +- lib/widgets/forms/fieldParams.js | 28 +- lib/widgets/forms/fieldParams.js.map | 2 +- lib/widgets/peoplePicker.js | 1 - lib/widgets/peoplePicker.js.map | 2 +- package-lock.json | 2575 ++++---- package.json | 32 +- src/versionInfo.ts | 6 +- 253 files changed, 5894 insertions(+), 4049 deletions(-) create mode 100644 Documentation/api/variables/ns.html delete mode 100644 examples/storybook/333.0a058c8b.iframe.bundle.js create mode 100644 examples/storybook/333.964b3572.iframe.bundle.js rename examples/storybook/{333.0a058c8b.iframe.bundle.js.LICENSE.txt => 333.964b3572.iframe.bundle.js.LICENSE.txt} (100%) delete mode 100644 examples/storybook/805.06e021f2.iframe.bundle.js create mode 100644 examples/storybook/805.6d9f11aa.iframe.bundle.js rename examples/storybook/{805.06e021f2.iframe.bundle.js.LICENSE.txt => 805.6d9f11aa.iframe.bundle.js.LICENSE.txt} (100%) rename examples/storybook/{main.844762ea.iframe.bundle.js => main.def0ebf5.iframe.bundle.js} (67%) rename examples/storybook/{main.844762ea.iframe.bundle.js.LICENSE.txt => main.def0ebf5.iframe.bundle.js.LICENSE.txt} (100%) rename examples/storybook/{runtime~main.64a16d0b.iframe.bundle.js => runtime~main.3d56b083.iframe.bundle.js} (99%) diff --git a/Documentation/api/assets/navigation.js b/Documentation/api/assets/navigation.js index 1cd2b917..2730e258 100644 --- a/Documentation/api/assets/navigation.js +++ b/Documentation/api/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6Wb23LbOBKG38W5TXZjJ3PKnS3bG23JtiLJmVRNbW1BJCQhJgEGBGV7pubdB+ARINEQ1bqajPrv7ydAAGwC9B9/nSn6os4+nTG+YZwpekfznGzppaTk7O1ZRtROB1MRFwnN/7VTafLGr3xiPD779PH8t48f3n/8+23LTQ/y0lGcTNINlZRHNAc4rgLi5Oo1oQChiUG5iqzB3CYG5RaKJdCVNzEo95nFW6qg7C4K5Ue6axVdvWaevvu3FSx5HeftWbRjSay79OzTHy3snj5fZtmU54rorn7IFBPcwjKuqNyQqEf2Zrl+Fz/9bF3zpEyeCF7+f4tXhuaQHWGP+P63X85/uvj7fxY3IXxb6OE27IgmMqoXrnSQ8a233S2oFoWaGdMNKRI1L8eupPGszrV6dE8kM4PLAoNZrtWHC0/DJyKmj4vpFclp0MOjD9BJHF9XF2Vd+abgUXmjO6qlc2k/2wN2wxLdm1evs8HN8iD74gBXz5NQT3vg3oxjHW6FPN5EJw18nIEstp4xLLajhi9JqFTea9KAMhhoY5RQ4m+QTi6DgeSYrostlFwGQ8lFmn1e3c3A/DoeQOhOBu6Gzi+DgWT96BNQrokFUrXkMo9ob9VwEbYmjLqmI1idKABL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WkiqLA+wNLVBM/asrbO9WKrD3foZpfR30EvCLr38s/0b1JgH2jEtWXDXYY3CuqtL42l7RWEfzgmUN/U8y7b2jP31/YH+iSyFpau7dj/XP/tdhNGvxdiZPr/UMSF1GoHfdmmwDqlbz6K2Ifs4oEriYWqS9P/xxIYpGz59OllYFAYkr09HjxZVaRUKr5UsKbaQKBxNythbrEfFgFjezvPZW5HqFT59S3A1vhUCdypm6FUP7nQBcdjHsXYf4QCEZU0eHU+QeDbcbCL0EAAA==" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WbXXPbthKG/4tym/Q0H+05zZ0t243OyLYiyWlmOp0OREISYhJgQFC22+l/L8BPgMRC1Oqqqfbd5yVAAFwC9O9/TxR9VpOPE8a3jDNFb2mekx29kJRMXk8yovY6mIq4SGj+w16lySu/8pHxePLxw9tfPrz/8cM/r1tuepSXjuJkkm6ppDyiOcBxFRAnVy8JBQhNDMpVZAPmNjEot1Asga68iUG5TyzeUQVld1EoP9Jdq+j6JfP03X+sYMnrOK8n0Z4lse7SycffW9gdfbrIshnPFdFdfZ8pJriFZVxRuSVRj+zNcv3e/fSzdc3TMnkqePn/LV4ZmkN2hD3ij7/89+1P7/75w+ImhO8KPdyGHdFERvXCpQ4yvvO2uwXVolAzY7olRaIW5diVNJ7XuVaPHohkZnBZYDDLtXr/ztPwqYjpw3J2SXIa9PDoA3QSx1fVRVlXvi14VN7ojmrpXNrP9oDdskT35uXLfHCzPMi+OMDV8yTU0x64N+NUhxshTzfRSQMfZyCLnWcMi92o4UsSKpX3mjSgDAbaGCWU+Bukk8tgIDmmm2IHJZfBUHKRZp/Wt3Mwv44HELqTgbuh88tgIFk/+gSUa2KBVC25yCPaWzVchK0Jo67oCFYnCsDSHEToUCAxp2pODzSBspt4CFFEer30T0BDqMIBwBORHMo2sWMTiHHvFGJ81CSiPC8knQsS03jhK0+cC9JQIKF/ldotIbpb9NMuj9+w/E0m2UE/4yb2MHZQQq+B/kXS41uKQ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YGAokp0WP92ZdZRUKp5rMHb6YJBBL9Vxq8zNythbqsfFgFjbxFBypzPUJnzqlvB7bCoX7nTN0IofzPgS46GPcuwvwhEIyoosOp8y8l5O7YL0EAAA==" \ No newline at end of file diff --git a/Documentation/api/assets/search.js b/Documentation/api/assets/search.js index 79dee6c2..f9606bcf 100644 --- a/Documentation/api/assets/search.js +++ b/Documentation/api/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA8Vd3ZObyBH/X+TXPZ2Gb/xm+845VzmJc+dLHrZcV6xgteQQKAit7bj8v2dmGKB71I0Q0m5evOulv6Z/3T0zDQzfFnX1eb94eftt8WdepouXrnOzKJNttni5SKvt4mZxqAv5+2NS58ldke1/lH9dPjTbQl5aF8l+n0nuxeL7TSdArByvF1HuewnbKj1Ifs37Qv+dZAf6k3VB6Jd/HdUf+L4b9DL++KP5ustGxLzoKYC0m8UuqbOyMUYwg0vSate8evP+p+w+ORTNaSXLYw5W6dLYdenAbJ1G7g/hBOVH9jKOqLMklVQTjBkon37gRlc3YFdMGXFnIDPSvfwxbaQD5dOP1OjqR+pOGWlnIDNSeelQ5lU5QT0gffqxdsq6wfpTxtpbyAy2qJL0d0UwDVuL/OkHDRV2AxfxlJEjU3mo776+qbZ3eZk0kyG3WZ4FeqS0j/eJIYAtZpyxTf5UafGXOtk9TLDJIn96J0CFnQOcSaUNmTph9K27qjNtGrie1xdGb++SSUFBGc4nycfqt6bOy820UAXUz5Ianb6+PkzMit5OZuBr5ZUzhm7TP/3gkcZu+JOqI7Z1PCcmO8Cmf7Y8wA5wJs2M2FjGA7uDWgT+/e7f2XrKKtcif/rxQ4X98CctcJGpo6OfXg1t+ucav10BJ2UANpbxwH3+5V2Z5o95ekiKN0k9cbHPsD29PyjFfVmcNDGQpk/xzgzP/F+8Aj0yaaY4MpnbIWXNxA1SR/gM+yOtql8uTiqMxjxmlBt9taqnb/2POZ5+3JbOHvBJpdE2eNQTk415xnH3w52E98bGGz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aanwwVc+9UvkI2gKAS8JnZ2gUpdXingr8xxX8ByWJjcrtnucS5n+gnqBj3oknNuN59Gvms/jZzWEkDzxWdQZ4AkjyuUu0PTt+xxqIHMZ9ftLfexL2Cr0+HwkFOWvRmGRZXlUiedjWAJw9bt7ouw4+8PaoJJBtPT5wA0nI352BUIRuB339y5YScqePg20a8NYf1dcTBAIYU+6htIgJMGeyOiPVJvB47UA4ENJXS3sAR7G6YVpQ9tf2hPMa/VmefAInRnhMs2IybflHm5aw8TByJgrgkOob2ksAIMNis5LmV50Z5IDzTC9eOKK/Ttud9Pw/ngYN0B41JwNX9/1KkRYKjsrCTZiva7F2CoYKwxO1j1rXBFJde8x00mB95IYnWrs35w/sCAYW8GtZsde+HqApXs/GbO54NZD+d+j9tM9l91AhUHwBKxqHSfWAHeBUkec/qa5I6+/4R2VGzH3xwfCIcJo5C9k9meJwjZYBXxuOCVbE/mFEHIC7OVvbXR82bd8YBQBIwHj0t4dbICXH5ARNmGCl5ZC5gsfOT1hyVAddCz7D1Xc6Qc1AiXDj6XIwd0+0PAmVmw6xV1BBNkgprY1p95y/944Qjd6XMq2+80gewA/oy5MtufjgfVwRH6nLFft0VW2lDEMFhdLjfak5ege+AA6ZX4l5vFLpe1Xabj4vXtlx8//g9cMx1lW5cAAA=="; \ No newline at end of file diff --git a/Documentation/api/assets/style.css b/Documentation/api/assets/style.css index 108428c3..07a385b7 100644 --- a/Documentation/api/assets/style.css +++ b/Documentation/api/assets/style.css @@ -11,6 +11,7 @@ --light-color-text-aside: #6e6e6e; --light-color-link: #1f70c2; + --light-color-ts-keyword: #056bd6; --light-color-ts-project: #b111c9; --light-color-ts-module: var(--light-color-ts-project); --light-color-ts-namespace: var(--light-color-ts-project); @@ -50,6 +51,7 @@ --dark-color-text-aside: #dddddd; --dark-color-link: #00aff4; + --dark-color-ts-keyword: #3399ff; --dark-color-ts-project: #e358ff; --dark-color-ts-module: var(--dark-color-ts-project); --dark-color-ts-namespace: var(--dark-color-ts-project); @@ -91,6 +93,7 @@ --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -132,6 +135,7 @@ --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -180,6 +184,7 @@ body { --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -219,6 +224,7 @@ body { --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -984,6 +990,11 @@ a.tsd-index-link { overflow-x: auto; } +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + .tsd-signature-symbol { color: var(--color-text-aside); font-weight: normal; diff --git a/Documentation/api/classes/rdf.BlankNode.html b/Documentation/api/classes/rdf.BlankNode.html index e5c9b86b..298d5da7 100644 --- a/Documentation/api/classes/rdf.BlankNode.html +++ b/Documentation/api/classes/rdf.BlankNode.html @@ -22,7 +22,7 @@ toNQ toNT toString -

Constructors

  • Initializes this node

    +

Constructors

  • Initializes this node

    Parameters

    • Optional id: unknown

      The identifier for the blank node

    Returns BlankNode

Properties

classOrder: number

The class order for this node

isBlank: number

Whether this is a blank node

@@ -32,21 +32,21 @@
value: string

The node's value

NTAnonymousNodePrefix: "_:"
fromValue: (<T>(value) => T)

Type declaration

    • <T>(value): T
    • Type Parameters

      • T extends FromValueReturns<any>

      Parameters

      • value: ValueType

      Returns T

getId: any
nextId: number

The next unique identifier for blank nodes

toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

Type declaration

    • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
    • Parameters

      • term: any

      Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Accessors

  • get id(): string
  • The identifier for the blank node

    -

    Returns string

  • set id(value): void
  • Parameters

    • value: string

    Returns void

Methods

  • Compares this node with another

    +

    Returns string

  • set id(value): void
  • Parameters

    • value: string

    Returns void

Methods

  • Compares this node with another

    Parameters

    Returns number

    See

    to check if two nodes are equal

    -
  • Gets a copy of this blank node in the specified formula

    +
  • Gets a copy of this blank node in the specified formula

    Parameters

    • formula: Store

      The formula

      -

    Returns BlankNode

  • Compares whether the two nodes are equal

    +

Returns BlankNode

  • Compares whether the two nodes are equal

    Parameters

    • other: Term

      The other node

      -

    Returns boolean

  • Creates a hash for this node

    +

Returns boolean

  • Creates a hash for this node

    Returns string

    Deprecated

    use {rdfFactory.id} instead if possible

    -
  • Compares whether this node is the same as the other one

    +
  • Compares whether this node is the same as the other one

    Parameters

    • other: Node

      Another node

      -

    Returns boolean

  • Creates the substituted node for this one, according to the specified bindings

    +

Returns boolean

  • Creates the substituted node for this one, according to the specified bindings

    Type Parameters

    Parameters

    • bindings: Bindings

      Bindings of identifiers to nodes

      -

    Returns T

  • Creates a canonical string representation of this node

    -

    Returns string

  • Creates a n-quads string representation of this node

    -

    Returns string

  • Creates a n-triples string representation of this node

    -

    Returns string

  • Creates a string representation of this node

    -

    Returns string

Generated using TypeDoc

\ No newline at end of file +

Returns T

Generated using TypeDoc

\ No newline at end of file diff --git a/Documentation/api/classes/rdf.Collection.html b/Documentation/api/classes/rdf.Collection.html index 4881cf14..ff7ecac8 100644 --- a/Documentation/api/classes/rdf.Collection.html +++ b/Documentation/api/classes/rdf.Collection.html @@ -25,27 +25,27 @@ toString unshift toNT -

Constructors

Properties

classOrder: number

The class order for this node

+

Constructors

Properties

classOrder: number

The class order for this node

closed: boolean
compareTerm: ((other) => number)

Type declaration

    • (other): number
    • Parameters

      Returns number

elements: T[]

The nodes in this collection

isVar: number
termType: "Collection"

The type of node

value: string

The node's value

-
fromValue: (<T>(value) => T)

Type declaration

    • <T>(value): T
    • Type Parameters

      • T extends FromValueReturns<any>

      Parameters

      • value: ValueType

      Returns T

termType: "Collection"
toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

Type declaration

    • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
    • Parameters

      • term: any

      Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Accessors

  • get id(): string
  • Returns string

  • set id(value): void
  • Parameters

    • value: string

    Returns void

Methods

  • Appends an element to this collection

    +
fromValue: (<T>(value) => T)

Type declaration

    • <T>(value): T
    • Type Parameters

      • T extends FromValueReturns<any>

      Parameters

      • value: ValueType

      Returns T

termType: "Collection"
toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

Type declaration

    • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
    • Parameters

      • term: any

      Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Accessors

  • get id(): string
  • Returns string

  • set id(value): void
  • Parameters

    • value: string

    Returns void

Methods

  • Appends an element to this collection

    Parameters

    • element: T

      The new element

      -

    Returns number

  • Closes this collection

    -

    Returns boolean

  • Compares whether the two nodes are equal

    +

Returns number

  • Closes this collection

    +

    Returns boolean

  • Compares whether the two nodes are equal

    Parameters

    • other: Term

      The other node

      -

    Returns boolean

  • Creates a hash for this node

    +

Returns boolean

  • Creates a hash for this node

    Returns string

    Deprecated

    use {rdfFactory.id} instead if possible

    -
  • Compares whether this node is the same as the other one

    +
  • Compares whether this node is the same as the other one

    Parameters

    • other: Node

      Another node

      -

    Returns boolean

  • Removes the first element from the collection (and return it)

    -

    Returns undefined | T

  • Creates a new Collection with the substituting bindings applied

    +

Returns boolean

  • Removes the first element from the collection (and return it)

    +

    Returns undefined | T

  • Creates a new Collection with the substituting bindings applied

    Parameters

    • bindings: Bindings

      The bindings to substitute

      -

    Returns any

  • Creates a canonical string representation of this node

    -

    Returns string

  • Creates a n-quads string representation of this node

    -

    Returns string

  • Creates a n-triples string representation of this node

    -

    Returns string

  • Serializes the collection to a string. +

Returns any

  • Creates a canonical string representation of this node

    +

    Returns string

  • Creates a n-quads string representation of this node

    +

    Returns string

  • Creates a n-triples string representation of this node

    +

    Returns string

  • Serializes the collection to a string. Surrounded by (parentheses) and separated by spaces.

    -

    Returns string

  • Prepends the specified element to the collection's front

    +

    Returns string

  • Prepends the specified element to the collection's front

    Parameters

    • element: T

      The element to prepend

      -

    Returns number

  • Parameters

    • collection: any

    Returns string

Generated using TypeDoc

\ No newline at end of file +

Returns number

Generated using TypeDoc

\ No newline at end of file diff --git a/Documentation/api/classes/rdf.ConnectedStore.html b/Documentation/api/classes/rdf.ConnectedStore.html index faa6fab1..1bf584e5 100644 --- a/Documentation/api/classes/rdf.ConnectedStore.html +++ b/Documentation/api/classes/rdf.ConnectedStore.html @@ -103,17 +103,17 @@ uris variable whether -

Constructors

Properties

HTTPRedirects: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

Redirections we got from HTTP

+

Constructors

Properties

HTTPRedirects: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

Redirections we got from HTTP

_existentialVariables?: BlankNode[]
_universalVariables?: NamedNode[]
aliases: any[]

Reverse mapping to redirection: aliases for this

classActions: {
    [k: string]: Function[];
}

Map of iri predicates to functions to call when adding { s type X }

Type declaration

  • [k: string]: Function[]
classOrder: number

The class order for this node

-
constraints: readonly any[]
features: FeaturesType
fetcher: Fetcher

The accompanying fetcher instance.

+
constraints: readonly any[]
features: FeaturesType
fetcher: Fetcher

The accompanying fetcher instance.

Is set by the fetcher when initialized.

-
index: [Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[]]
initBindings: readonly any[]
isVar: number
namespaces: {
    [key: string]: string;
}

Dictionary of namespace prefixes

+
index: [Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[]]
initBindings: readonly any[]
isVar: number
namespaces: {
    [key: string]: string;
}

Dictionary of namespace prefixes

Type declaration

  • [key: string]: string
ns: ((nsuri, factory?) => ((ln) => NamedNode))

Type declaration

    • (nsuri, factory?): ((ln) => NamedNode)
    • A namespace for the specified namespace's URI

      Parameters

      • nsuri: string

        The URI for the namespace

      • Optional factory: RdfJsDataFactory

      Returns ((ln) => NamedNode)

        • (ln): NamedNode
        • Parameters

          • ln: string

          Returns NamedNode

objectIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

Array of statements with this X as object

-
optional: readonly any[]
predicateIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

Array of statements with this X as predicate

+
optional: readonly any[]
predicateIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

Array of statements with this X as predicate

propertyActions: {
    [k: string]: Function[];
}

Map of iri predicates to functions to call when getting statement with {s X o}

Type declaration

  • [k: string]: Function[]
rdfFactory: any

The factory used to generate statements and terms

redirections: any[]

Redirect to lexically smaller equivalent symbol

@@ -128,24 +128,24 @@
var kb = rdf.graph()
kb.length // -> 0

Returns number

  • get defaultGraphURI(): string
  • Gets the URI of the default graph

    -

    Returns string

Methods

  • Transform a collection of NTriple URIs into their URI strings

    +

    Returns string

Methods

  • Transform a collection of NTriple URIs into their URI strings

    Parameters

    • t: any

      Some iterable collection of NTriple URI strings

    Returns {}

    A collection of the URIs as strings todo: explain why it is important to go through NT

    -
    • Adds a triple (quad) to the store.

      +
      • Adds a triple (quad) to the store.

        Parameters

        • subj: Quad_Subject | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[] | Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          The thing about which the fact a relationship is asserted. Also accepts a statement or an array of Statements.

        • Optional pred: Quad_Predicate

          The relationship which is asserted

        • Optional obj: string | Term

          The object of the relationship, e.g. another thing or a value. If passed a string, this will become a literal.

        • Optional why: Quad_Graph

          The document in which the triple (S,P,O) was or will be stored on the web

        Returns null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | ConnectedStore

        The statement added to the store, or the store

        -
      • Adds all the statements to this formula

        +
      • Adds all the statements to this formula

        Parameters

        • statements: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

          A collection of statements

          -

        Returns void

      • Add a callback which will be triggered after a statement has been added to the store.

        -

        Parameters

        • cb: ((q) => void)
            • (q): void
            • Parameters

              • q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

              Returns void

        Returns void

      • Parameters

        • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

        Returns number

        Deprecated

        Use {add} instead

        -
      • Return all equivalent URIs by which this is known

        +

      Returns void

      • Add a callback which will be triggered after a statement has been added to the store.

        +

        Parameters

        • cb: ((q) => void)
            • (q): void
            • Parameters

              • q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

              Returns void

        Returns void

      • Parameters

        • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

        Returns number

        Deprecated

        Use {add} instead

        +
      • Return all equivalent URIs by which this is known

        Parameters

        Returns NamedNode[]

      • Follow link from one node, using one wildcard, looking for one

        +

      Returns NamedNode[]

      • Follow link from one node, using one wildcard, looking for one

        For example, any(me, knows, null, profile) - a person I know accoring to my profile . any(me, knows, null, null) - a person I know accoring to anything in store . any(null, knows, me, null) - a person who know me accoring to anything in store .

        @@ -154,51 +154,51 @@
      • Optional o: null | Quad_Object

        A node to search for as object, or if null, a wildcard

      • Optional g: null | Quad_Graph

        A node to search for as graph, or if null, a wildcard

      Returns null | Node

      A node which match the wildcard position, or null

      -
      • Gets the first JavaScript object equivalent to a node based on the specified pattern

        +
      • Gets the first JavaScript object equivalent to a node based on the specified pattern

        Parameters

        • Optional s: null | Quad_Subject

          The subject

        • Optional p: null | Quad_Predicate

          The predicate

        • Optional o: null | Quad_Object

          The object

        • Optional g: null | Quad_Graph

          The graph that contains the statement

          -

        Returns any

      • Gets the first statement that matches the specified pattern

        -

        Parameters

        • Optional s: null | Quad_Subject
        • Optional p: null | Quad_Predicate
        • Optional o: null | Quad_Object
        • Optional g: null | Quad_Graph

        Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

      • Gets the value of a node that matches the specified pattern

        +

      Returns any

      • Gets the first statement that matches the specified pattern

        +

        Parameters

        • Optional s: null | Quad_Subject
        • Optional p: null | Quad_Predicate
        • Optional o: null | Quad_Object
        • Optional g: null | Quad_Graph

        Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

      • Gets the value of a node that matches the specified pattern

        Parameters

        • Optional s: null | Quad_Subject

          The subject

        • Optional p: null | Quad_Predicate

          The predicate

        • Optional o: null | Quad_Object

          The object

        • Optional g: null | Quad_Graph

          The graph that contains the statement

          -

        Returns string | void

      • Apply a set of statements to be deleted and to be inserted

        -

        Parameters

        • patch: {
              delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
              patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
              where?: any;
          }

          The set of statements to be deleted and to be inserted

          -
          • Optional delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
          • Optional patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
          • Optional where?: any
        • target: NamedNode

          The name of the document to patch

          +

        Returns string | void

      • Apply a set of statements to be deleted and to be inserted

        +

        Parameters

        • patch: {
              delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
              patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
              where?: any;
          }

          The set of statements to be deleted and to be inserted

          +
          • Optional delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
          • Optional patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
          • Optional where?: any
        • target: NamedNode

          The name of the document to patch

        • patchCallback: ((errorString?) => void)

          Callback to be called when patching is complete

          -
            • (errorString?): void
            • Parameters

              • Optional errorString: string

              Returns void

        Returns void

      • Shortcut for adding blankNodes

        -

        Parameters

        • Optional id: string

        Returns BlankNode

      • Finds the types in the list which have no stored subtypes +

          • (errorString?): void
          • Parameters

            • Optional errorString: string

            Returns void

      Returns void

      • Shortcut for adding blankNodes

        +

        Parameters

        • Optional id: string

        Returns BlankNode

      • Finds the types in the list which have no stored subtypes These are a set of classes which provide by themselves complete information -- the other classes are redundant for those who know the class DAG.

        Parameters

        • types: any

          A map of the types

          -

        Returns any

      • Returns the symbol with canonical URI as smushed

        +

      Returns any

      • Returns the symbol with canonical URI as smushed

        Parameters

        • Optional term: Term

          An RDF node

          -

        Returns Node

      • Checks this formula for consistency

        -

        Returns void

      • Checks a list of statements for consistency

        -

        Parameters

        • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

          The list of statements to check

          +

        Returns Node

      • Checks this formula for consistency

        +

        Returns void

      • Checks a list of statements for consistency

        +

        Parameters

        • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

          The list of statements to check

        • Optional from: number

          An index with the array ['subject', 'predicate', 'object', 'why']

          -

        Returns boolean | void

      • Closes this formula (and return it)

        -

        Returns Store

      • Compares this node with another

        +

      Returns boolean | void

      • Closes this formula (and return it)

        +

        Returns Store

      • Compares this node with another

        Parameters

        • other: Node

          The other node

        Returns number

        See

        to check if two nodes are equal

        -
      • Parameters

        • u1: Term
        • u2: Term

        Returns number

      • Trace statements which connect directly, or through bnodes

        +
      • Parameters

        • u1: Term
        • u2: Term

        Returns number

      • Trace statements which connect directly, or through bnodes

        Parameters

        • subject: Quad_Subject

          The node to start looking for statments

        • doc: Quad_Graph

          The document to be searched, or null to search all documents

          -
        • Optional excludePredicateURIs: readonly string[]

        Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

        an array of statements, duplicate statements are suppresssed.

        -
      • replaces

        +
      • Optional excludePredicateURIs: readonly string[]

      Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

      an array of statements, duplicate statements are suppresssed.

      +
      • replaces

        Parameters

        • template: Quad_Subject

          node to copy

        • target: Quad_Subject

          node to copy to

        • Optional flags: ("two-direction" | "delete")[]

          Whether or not to do a two-directional copy and/or delete triples

        Returns void

        Target

        and add appropriate triples removes no triples by default and is a one-direction replication

        -
      • N3 allows for declaring blank nodes, this function enables that support

        +
      • N3 allows for declaring blank nodes, this function enables that support

        Parameters

        • x: BlankNode

          The blank node to be declared, supported in N3

          -

        Returns BlankNode

      • Follow links from one node, using one wildcard.

        +

      Returns BlankNode

      • Follow links from one node, using one wildcard.

        For example, each(me, knows, null, profile) - people I know accoring to my profile . each(me, knows, null, null) - people I know accoring to anything in store . each(null, knows, me, null) - people who know me accoring to anything in store .

        @@ -209,38 +209,38 @@

      Returns Node[]

      • An array of nodes which match the wildcard position
      -
      • Test whether this formula is equals to {other}

        +
      • Test whether this formula is equals to {other}

        Parameters

        Returns boolean

      • Simplify graph in store when we realize two identifiers are equivalent +

      Returns boolean

      • Simplify graph in store when we realize two identifiers are equivalent We replace the bigger with the smaller.

        Parameters

        • u1in: Term

          The first node

        • u2in: Term

          The second node

          -

        Returns boolean

      • For thisClass or any subclass, anything which has it is its type +

      Returns boolean

      • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

        Parameters

        • subject: Node

          A named node

          -

        Returns UriMap

      • For thisClass or any subclass, anything which has it is its type +

      Returns UriMap

      • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

        Parameters

        • thisClass: any

        Returns MembersMap

        a hash of URIs

        -
      • Get all the Classes of which we can RDFS-infer the subject is a superclass +

      • Get all the Classes of which we can RDFS-infer the subject is a superclass Returns a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

        -

        Parameters

        Returns {
            [uri: string]: boolean;
        }

        • [uri: string]: boolean
      • Get all the Classes of which we can RDFS-infer the subject is a subclass

        +

        Parameters

        Returns {
            [uri: string]: boolean;
        }

        • [uri: string]: boolean
      • Get all the Classes of which we can RDFS-infer the subject is a subclass

        Parameters

        • subject: Node

          The thing whose classes are to be found

        Returns {
            [uri: string]: boolean;
        }

        a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

        -
        • [uri: string]: boolean
      • Get all the Classes of which we can RDFS-infer the subject is a member +

        • [uri: string]: boolean
      • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal) Returns a hash table where key is NT of type and value is statement why we @@ -248,91 +248,91 @@ Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

        Parameters

        • subject: Quad_Subject

          A subject node

          -

        Returns UriMap

      • Get all the Classes of which we can RDFS-infer the subject is a member +

      Returns UriMap

      • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal)

        Parameters

        • subject: any

          The thing whose classes are to be found

        Returns {
            [uri: string]: boolean;
        }

        a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

        -
        • [uri: string]: boolean
      • Creates a new empty indexed formula +

        • [uri: string]: boolean
      • Creates a new empty indexed formula Only applicable for IndexedFormula, but TypeScript won't allow a subclass to override a property

        Parameters

        • features: FeaturesType

          The list of features

          -

        Returns Store

      • Transforms an NTriples string format into a Node. +

      Returns Store

      • Transforms an NTriples string format into a Node. The blank node bit should not be used on program-external values; designed for internal work such as storing a blank node id in an HTML attribute. This will only parse the strings generated by the various toNT() methods.

        -

        Parameters

        • str: any

        Returns any

      • Creates a hash for this node

        +

        Parameters

        • str: any

        Returns any

      • Creates a hash for this node

        Returns string

        Deprecated

        use {rdfFactory.id} instead if possible

        -
      • Returns true if this formula holds the specified statement(s)

        -

        Parameters

        • s: any
        • Optional p: any
        • Optional o: any
        • Optional g: any

        Returns boolean

      • Returns true if this formula holds the specified {statement}

        -

        Parameters

        • statement: any

        Returns boolean

      • Returns a unique index-safe identifier for the given term.

        +
      • Returns true if this formula holds the specified statement(s)

        +

        Parameters

        • s: any
        • Optional p: any
        • Optional o: any
        • Optional g: any

        Returns boolean

      • Returns true if this formula holds the specified {statement}

        +

        Parameters

        • statement: any

        Returns boolean

      • Returns a unique index-safe identifier for the given term.

        Falls back to the rdflib hashString implementation if the given factory doesn't support id.

        -

        Parameters

        • term: TFIDFactoryTypes

        Returns Indexable

      • Parameters

        • features: FeaturesType

        Returns void

      • Used by the n3parser to generate list elements

        +

        Parameters

        • term: TFIDFactoryTypes

        Returns Indexable

      • Parameters

        • features: FeaturesType

        Returns void

      • Used by the n3parser to generate list elements

        Parameters

        • values: any

          The values of the collection

        • context: any

          The store

        Returns any

        • The term for the statement
        -
      • Returns any quads matching the given arguments. +

      • Returns any quads matching the given arguments. Standard RDFJS spec method for Source objects, implemented as an alias to statementsMatching()

        Parameters

        • Optional subject: null | Quad_Subject

          The subject

        • Optional predicate: null | Quad_Predicate

          The predicate

        • Optional object: null | Quad_Object

          The object

        • Optional graph: null | Quad_Graph

          The graph that contains the statement

          -

        Returns Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

      • Find out whether a given URI is used as symbol in the formula

        +

      Returns Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

      • Find out whether a given URI is used as symbol in the formula

        Parameters

        • uri: string

          The URI to look for

          -

        Returns boolean

      • Existentials are BNodes - something exists without naming

        +

      Returns boolean

      • Existentials are BNodes - something exists without naming

        Parameters

        • uri: string

          An URI

          -

        Returns Term

      • Adds a new property action

        +

      Returns Term

      • Adds a new property action

        Parameters

        • pred: Quad_Predicate

          the predicate that the function should be triggered on

        • action: ((store, subject, predicate, object) => boolean)

          the function that should trigger

          -
            • (store, subject, predicate, object): boolean
            • Parameters

              • store: Store
              • subject: Quad_Subject
              • predicate: Quad_Predicate
              • object: Quad_Object

              Returns boolean

        Returns boolean

      • Creates a new universal node +

          • (store, subject, predicate, object): boolean
          • Parameters

            • store: Store
            • subject: Quad_Subject
            • predicate: Quad_Predicate
            • object: Quad_Object

            Returns boolean

      Returns boolean

      • Creates a new universal node Universals are Variables

        Parameters

        • uri: string

          An URI

          -

        Returns NamedNode

      • Find an unused id for a file being edited: return a symbol +

      Returns NamedNode

      • Find an unused id for a file being edited: return a symbol (Note: Slow iff a lot of them -- could be O(log(k)) )

        Parameters

        • doc: NamedNode

          A document named node

          -

        Returns NamedNode

      • Query this store asynchronously, return bindings in callback

        +

      Returns NamedNode

      • Query this store asynchronously, return bindings in callback

        Parameters

        • myQuery: Query

          The query to be run

        • callback: ((bindings) => void)

          Function to call when bindings

            • (bindings): void
            • Parameters

              • bindings: Bindings

              Returns void

        • Optional fetcher: null | Fetcher
        • Optional onDone: (() => void)

          OBSOLETE - do not use this // @@ Why not ?? Called when query complete

          -
            • (): void
            • Returns void

        Returns void

      • Query this store synchronously and return bindings

        +
          • (): void
          • Returns void

      Returns void

      • Query this store synchronously and return bindings

        Parameters

        • myQuery: Query

          The query to be run

          -

        Returns any[]

      • Removes one or multiple statement(s) from this formula

        +

      Returns any[]

      • Removes one or multiple statement(s) from this formula

        Parameters

        • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

          A Statement or array of Statements to remove

          -

        Returns Store

      • Removes all statements in a doc, along with the related metadata including request/response

        +

      Returns Store

      • Removes all statements in a doc, along with the related metadata including request/response

        Parameters

        • doc: Quad_Graph

          The document / graph

          -

        Returns Store

      • Remove all statements matching args (within limit) *

        +

      Returns Store

      • Remove all statements matching args (within limit) *

        Parameters

        • Optional subj: null | Quad_Subject

          The subject

        • Optional pred: null | Quad_Predicate

          The predicate

        • Optional obj: null | Quad_Object

          The object

        • Optional why: null | Quad_Graph

          The graph that contains the statement

        • Optional limit: number

          The number of statements to remove

          -

        Returns void

      • Remove all matching statements

        +

      Returns void

      • Remove all matching statements

        Parameters

        • Optional subject: null | Quad_Subject

          The subject

        • Optional predicate: null | Quad_Predicate

          The predicate

        • Optional object: null | Quad_Object

          The object

        • Optional graph: null | Quad_Graph

          The graph that contains the statement

          -

        Returns Store

      • Remove a particular statement object from the store

        +

      Returns Store

      • Remove a particular statement object from the store

        Parameters

        • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

          a statement which is already in the store and indexed. Make sure you only use this for these. Otherwise, you should use remove() above.

          -

        Returns Store

      • Removes statements

        -

        Parameters

        • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

          The statements to remove

          -

        Returns Store

      • Replace big with small, obsoleted with obsoleting.

        -

        Parameters

        • big: Quad_Subject
        • small: Quad_Subject

        Returns boolean

      • Compares whether this node is the same as the other one

        +

      Returns Store

      • Removes statements

        +

        Parameters

        • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

          The statements to remove

          +

        Returns Store

      • Replace big with small, obsoleted with obsoleting.

        +

        Parameters

        • big: Quad_Subject
        • small: Quad_Subject

        Returns boolean

      • Compares whether this node is the same as the other one

        Parameters

        • other: Node

          Another node

          -

        Returns boolean

      • Compare by canonical URI as smushed

        +

      Returns boolean

      • Compare by canonical URI as smushed

        Parameters

        Returns boolean

      • Serializes this formula

        +

      Returns boolean

      • Serializes this formula

        Parameters

        • base: any

          The base string

        • contentType: any

          The content type of the syntax to use

        • provenance: any

          The provenance URI

        • Optional options: any

          options to pass to the serializer, as defined in serialize method

          -

        Returns undefined | string

      • Parameters

        • prefix: string
        • nsuri: string

        Returns void

      • Search the Store

        +

      Returns undefined | string

      • Parameters

        • prefix: string
        • nsuri: string

        Returns void

      • Search the Store

        ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!

        Parameters

        • Optional subj: null | Quad_Subject

          A node to search for as subject, or if null, a wildcard

        • Optional pred: null | Quad_Predicate

          A node to search for as predicate, or if null, a wildcard

          @@ -340,33 +340,33 @@
        • Optional why: null | Quad_Graph

          A node to search for as graph, or if null, a wildcard

        • Optional justOne: boolean

          flag - stop when found one rather than get all of them?

        Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

        An array of nodes which match the wildcard position

        -
      • Gets this graph with the bindings substituted

        +
      • Gets this graph with the bindings substituted

        Type Parameters

        Parameters

        • bindings: Bindings

          The bindings

          -

        Returns T

      • Parameters

        • uri: string
        • Optional name: any

        Returns NamedNode

      • Gets the node matching the specified pattern. Throws when no match could be made.

        +

      Returns T

      • Parameters

        • uri: string
        • Optional name: any

        Returns NamedNode

      • Gets the node matching the specified pattern. Throws when no match could be made.

        Parameters

        • Optional s: null | Quad_Subject

          The subject

        • Optional p: null | Quad_Predicate

          The predicate

        • Optional o: null | Quad_Object

          The object

        • Optional g: null | Quad_Graph

          The graph that contains the statement

          -

        Returns undefined | null | Node

      • Creates a canonical string representation of this node

        -

        Returns string

      • Creates a n-quads string representation of this node

        -

        Returns string

      • Creates a n-triples string representation of this node

        -

        Returns string

      • Serializes this formula to a string

        -

        Returns string

      • Finds the types in the list which have no stored supertypes +

      Returns undefined | null | Node

      • Creates a canonical string representation of this node

        +

        Returns string

      • Creates a n-quads string representation of this node

        +

        Returns string

      • Creates a n-triples string representation of this node

        +

        Returns string

      • Serializes this formula to a string

        +

        Returns string

      • Finds the types in the list which have no stored supertypes We exclude the universal class, owl:Things and rdf:Resource, as it is information-free.

        Parameters

        • types: {
              [id: string]: string | NamedNode;
          }

          The types

          -

        Returns {
            [id: string]: string | NamedNode;
        }

      • RDFS Inference +

      Returns {
          [id: string]: string | NamedNode;
      }

      • RDFS Inference These are hand-written implementations of a backward-chaining reasoner over the RDFS axioms.

        Parameters

        • seeds: BooleanMap

          A hash of NTs of classes to start with

        • predicate: Quad_Predicate

          The property to trace though

        • Optional inverse: boolean

          Trace inverse direction

          -

        Returns {
            [uri: string]: boolean;
        }

        • [uri: string]: boolean
      • A list of all the URIs by which this thing is known

        -

        Parameters

        • term: Quad_Subject

        Returns string[]

      • Gets a new variable

        +

      Returns {
          [uri: string]: boolean;
      }

      • [uri: string]: boolean
      • A list of all the URIs by which this thing is known

        +

        Parameters

        • term: Quad_Subject

        Returns string[]

      • Gets a new variable

        Parameters

        • name: string

          The variable's name

          -

        Returns Variable

      • Gets the number of statements in this formula that matches the specified pattern

        +

      Returns Variable

      • Gets the number of statements in this formula that matches the specified pattern

        Parameters

        • Optional s: null | Quad_Subject

          The subject

        • Optional p: null | Quad_Predicate

          The predicate

        • Optional o: null | Quad_Object

          The object

        • Optional g: null | Quad_Graph

          The graph that contains the statement

          -

        Returns number

      Generated using TypeDoc

      \ No newline at end of file +

      Returns number

      Generated using TypeDoc

      \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Empty.html b/Documentation/api/classes/rdf.Empty.html index 9c396874..48da3de2 100644 --- a/Documentation/api/classes/rdf.Empty.html +++ b/Documentation/api/classes/rdf.Empty.html @@ -14,22 +14,22 @@ toNQ toNT toString -

      Constructors

      Properties

      classOrder: number

      The class order for this node

      +

      Constructors

      Properties

      classOrder: number

      The class order for this node

      termType: "Empty"

      The type of node

      value: string

      The node's value

      -
      fromValue: (<T>(value) => T)

      Type declaration

        • <T>(value): T
        • Type Parameters

          • T extends FromValueReturns<any>

          Parameters

          • value: ValueType

          Returns T

      toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

      Type declaration

        • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
        • Parameters

          • term: any

          Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

      Methods

      • Compares this node with another

        +
      fromValue: (<T>(value) => T)

      Type declaration

        • <T>(value): T
        • Type Parameters

          • T extends FromValueReturns<any>

          Parameters

          • value: ValueType

          Returns T

      toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

      Type declaration

        • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
        • Parameters

          • term: any

          Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

      Methods

      • Compares this node with another

        Parameters

        • other: Node

          The other node

        Returns number

        See

        to check if two nodes are equal

        -
      • Compares whether the two nodes are equal

        +
      • Compares whether the two nodes are equal

        Parameters

        • other: Term

          The other node

          -

        Returns boolean

      • Creates a hash for this node

        +

      Returns boolean

      • Creates a hash for this node

        Returns string

        Deprecated

        use {rdfFactory.id} instead if possible

        -
      • Compares whether this node is the same as the other one

        +
      • Compares whether this node is the same as the other one

        Parameters

        • other: Node

          Another node

          -

        Returns boolean

      • Creates the substituted node for this one, according to the specified bindings

        +

      Returns boolean

      • Creates the substituted node for this one, according to the specified bindings

        Type Parameters

        Parameters

        • bindings: Bindings

          Bindings of identifiers to nodes

          -

        Returns T

      • Creates a canonical string representation of this node

        -

        Returns string

      • Creates a n-quads string representation of this node

        -

        Returns string

      • Creates a n-triples string representation of this node

        -

        Returns string

      • Creates a string representation of this node

        -

        Returns string

      Generated using TypeDoc

      \ No newline at end of file +

      Returns T

      Generated using TypeDoc

      \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Fetcher.html b/Documentation/api/classes/rdf.Fetcher.html index 16c7e4d8..5b541395 100644 --- a/Documentation/api/classes/rdf.Fetcher.html +++ b/Documentation/api/classes/rdf.Fetcher.html @@ -6,7 +6,7 @@
    • figuring how to parse them. It will also refresh, remove, the data
    • and put back the data to the web.
    • -

      Hierarchy

      Implements

      Constructors

      Implements

      • CallbackifyInterface

      Constructors

      Properties

      _fetch: Fetch
      appNode: NamedNode

      Denoting this session

      +

      Constructors

      Properties

      _fetch: Fetch
      appNode: NamedNode

      Denoting this session

      fetchCallbacks: FetchCallbacks

      fetchCallbacks[uri].push(callback)

      fetchQueue: FetchQueue
      fireCallbacks: Function

      Methods added by calling Util.callbackify in the constructor

      -
      handlers: typeof Handler[]
      lookedUp: BooleanMap
      mediatypes: MediatypesMap
      nonexistent: BooleanMap

      Keep track of explicit 404s -> we can overwrite etc

      +
      handlers: typeof Handler[]
      lookedUp: BooleanMap
      mediatypes: MediatypesMap
      nonexistent: BooleanMap

      Keep track of explicit 404s -> we can overwrite etc

      ns: {
          [k: string]: ((ln) => Quad_Predicate);
      }

      Type declaration

      • [k: string]: ((ln) => Quad_Predicate)
          • (ln): Quad_Predicate
          • Parameters

            • ln: string

            Returns Quad_Predicate

      redirectedTo: Record<string, string>

      Redirected from key uri to value uri

      requested: RequestedMap

      this.requested[uri] states: undefined no record of web access or records reset @@ -91,38 +91,38 @@ 'unsupported_protocol' URI is not a protocol Fetcher can deal with other strings mean various other errors.

      store: Store
      timeout: number
      timeouts: TimeOutsMap

      List of timeouts associated with a requested URL

      -
      CONTENT_TYPE_BY_EXT: Record<string, string>
      HANDLERS: {
          [handlerName: number]: Handler;
      }

      Type declaration

      • [handlerName: number]: Handler
      crossSiteProxyTemplate: any

      Methods

      • Returns string

      • Parameters

        • uri: string
        • callback: UserCallback

        Returns void

      • Parameters

        • handler: typeof Handler

        Returns void

      • Records a status message (as a literal node) by appending it to the +

      CONTENT_TYPE_BY_EXT: Record<string, string>
      HANDLERS: {
          [handlerName: number]: Handler;
      }

      Type declaration

      • [handlerName: number]: Handler
      crossSiteProxyTemplate: any

      Methods

      • Returns string

      • Parameters

        • uri: string
        • callback: UserCallback

        Returns void

      • Parameters

        • handler: typeof Handler

        Returns void

      • Records a status message (as a literal node) by appending it to the request's metadata status collection.

        -

        Parameters

        • req: BlankNode
        • statusMessage: string

        Returns void

      • Parameters

        • rdfType: NamedNode
        • req: Quad_Subject
        • kb: Store
        • locURI: string

        Returns void

      • Parameters

        • originalUri: string
        • _options: any

          DEPRECATED

          -
        • timeout: number

        Returns void

      • Parameters

        • parentURI: string

          URI of parent container

          +

          Parameters

          • req: BlankNode
          • statusMessage: string

          Returns void

      • Parameters

        • rdfType: NamedNode
        • req: Quad_Subject
        • kb: Store
        • locURI: string

        Returns void

      • Parameters

        • originalUri: string
        • _options: any

          DEPRECATED

          +
        • timeout: number

        Returns void

      • Parameters

        • parentURI: string

          URI of parent container

        • folderName: string

          Optional folder name (slug)

        • data: string

          Optional folder metadata

          -

        Returns Promise<Response>

      • Create an empty resource if it really does not exist +

      Returns Promise<Response>

      • Create an empty resource if it really does not exist Be absolutely sure something does not exist before creating a new empty file as otherwise existing could be deleted.

        Parameters

        • doc: NamedNode

          The resource

          -
        • Optional contentType: "text/turtle"
        • Optional data: string

        Returns Promise<ExtendedResponse>

      • Parameters

        Returns Response

      • Records errors in the system on failure:

        +
      • Optional contentType: "text/turtle"
      • Optional data: string

      Returns Promise<ExtendedResponse>

      • Parameters

        Returns Response

      • Records errors in the system on failure:

        • Adds an entry to the request status collection
        • Adds an error triple with the fail message to the metadata
        • Fires the 'fail' callback
        • Rejects with an error result object, which has a response object if any
        -

        Parameters

        • options: {
              original: Quad_Subject;
              req: BlankNode;
          } & Partial<AutoInitOptions>
        • errorMessage: string
        • statusCode: StatusValues
        • Optional response: ExtendedResponse

        Returns Promise<FetchError>

      • (The promise chain ends in either a failFetch() or a doneFetch())

        +

        Parameters

        • options: {
              original: Quad_Subject;
              req: BlankNode;
          } & Partial<AutoInitOptions>
        • errorMessage: string
        • statusCode: StatusValues
        • Optional response: ExtendedResponse

        Returns Promise<FetchError>

      • (The promise chain ends in either a failFetch() or a doneFetch())

        Parameters

        Returns Promise<FetchError | ExtendedResponse>

        fetch() result or an { error, status } object

        -
      • Looks up response header.

        +
      • Looks up response header.

        Parameters

        • doc: NamedNode
        • header: string

        Returns undefined | string[]

        a list of header values found in a stored HTTP response, or [] if response was found but no header found, or undefined if no response is available. Looks for { [] link:requestedURI ?uri; link:response [ httph:header-name ?value ] }

        -
      • Parameters

        • docuri: string

        Returns any

      • Parameters

        • uri: string

        Returns undefined | ContentType

      • Called when there's a network error in fetch(), or a response +

      • Parameters

        • docuri: string

        Returns any

      • Parameters

        • uri: string

        Returns undefined | ContentType

      • Parameters

        Returns null | Handler

      • Parameters

        • iri: string | NamedNode

        Returns void

      • Parameters

        Returns null | Handler

      • Parameters

        • iri: string | NamedNode

        Returns void

      • Tests whether a request is being made to a cross-site URI (for purposes of retrying with a proxy)

        -

        Parameters

        • uri: string

        Returns boolean

      • Parameters

        • docuri: string

        Returns boolean

      • Parameters

        • originalUri: NamedNode
        • rel: string
        • uri: string
        • why: Quad_Graph
        • Optional reverse: boolean

        Returns void

      • Promise-based load function

        +

        Parameters

        • uri: string

        Returns boolean

      • Parameters

        • docuri: string

        Returns boolean

      • Parameters

        • originalUri: NamedNode
        • rel: string
        • uri: string
        • why: Quad_Graph
        • Optional reverse: boolean

        Returns void

      • Promise-based load function

        Loads a web resource or resources into the store.

        A resource may be given as NamedNode object, or as a plain URI. an array of resources will be given, in which they will be fetched in parallel. @@ -130,16 +130,16 @@ This allows code like editable() for example to test things about the resource.

        Type Parameters

        • T extends string | NamedNode | (string | NamedNode)[]

        Parameters

        • uri: T

          {Array|Array|RDFlibNamedNode|string}

        • Optional options: Partial<AutoInitOptions>

          {Object}

          -

        Returns T extends (string | NamedNode)[]
            ? Promise<Response[]>
            : Promise<Response>

      • Looks up something. +

      Returns T extends (string | NamedNode)[]
          ? Promise<Response[]>
          : Promise<Response>

      • Looks up something. Looks up all the URIs a things has.

        Parameters

        • term: Quad_Subject

          canonical term for the thing whose URI is to be dereferenced

        • rterm: Quad_Subject

          the resource which referred to this (for tracking bad links)

          -

        Returns Promise<Response> | Promise<Response>[]

      • Parameters

        Returns null | string

      • Note two nodes are now smushed +

      Returns Promise<Response> | Promise<Response>[]

      • Parameters

        Returns null | string

      • Note two nodes are now smushed If only one was flagged as looked up, then the new node is looked up again, which will make sure all the URIs are dereferenced

        -

        Parameters

        • was: Quad_Subject
        • now: Quad_Subject

        Returns void

      • Asks for a doc to be loaded if necessary then calls back

        +

        Parameters

        • was: Quad_Subject
        • now: Quad_Subject

        Returns void

      • Asks for a doc to be loaded if necessary then calls back

        Calling methods: nowOrWhenFetched (uri, userCallback) nowOrWhenFetched (uri, options, userCallback) @@ -158,12 +158,12 @@

        errmessage Text error message if not OK.

        response The fetch Response object (was: XHR) if there was was one includes response.status as the HTTP status if any.

        -

        Parameters

        • uriIn: string | NamedNode
        • Optional p2: Partial<AutoInitOptions> | UserCallback
        • Optional userCallback: UserCallback
        • Optional options: Partial<AutoInitOptions>

        Returns void

      • Parameters

        • term: NamedNode

        Returns void

      • Parameters

        • linkHeader: string
        • originalUri: NamedNode
        • reqNode: Quad_Graph

        Returns void

      • Parameters

        Returns Promise<Response>

      • Writes back to the web what we have in the store for this uri

        -

        Parameters

        Returns Promise<Response>

      • Parameters

        • term: NamedNode
        • Optional userCallback: UserCallback

        Returns void

      • Parameters

        • term: NamedNode
        • userCallback: UserCallback

        Returns void

      • Parameters

        • term: Quad_Graph

        Returns void

      • Parameters

        • docuri: string
        • options: any

        Returns Promise<Response>

      • Parameters

        Returns Promise<void>

      • Parameters

        Returns void

      • Parameters

        • response: Response
        • options: {
              req: BlankNode;
              resource: Quad_Subject;
          } & Partial<AutoInitOptions>

        Returns BlankNode

      • Parameters

        • uri: string
        • options: {
              original: Quad_Subject;
              req: Quad_Subject;
          } & Partial<AutoInitOptions>

        Returns Promise<number | FetchError>

      • Parameters

        • term: NamedNode

        Returns void

      • Parameters

        • here: string
        • there: string
        • contentType: any

        Returns Promise<ExtendedResponse>

      • A generic web operation, at the fetch() level. +

        Parameters

        • uriIn: string | NamedNode
        • Optional p2: Partial<AutoInitOptions> | UserCallback
        • Optional userCallback: UserCallback
        • Optional options: Partial<AutoInitOptions>

        Returns void

      • Parameters

        • term: NamedNode

        Returns void

      • Parameters

        • linkHeader: string
        • originalUri: NamedNode
        • reqNode: Quad_Graph

        Returns void

      • Parameters

        Returns Promise<Response>

      • Writes back to the web what we have in the store for this uri

        +

        Parameters

        Returns Promise<Response>

      • Parameters

        • term: NamedNode
        • Optional userCallback: UserCallback

        Returns void

      • Parameters

        • term: NamedNode
        • userCallback: UserCallback

        Returns void

      • Parameters

        • term: Quad_Graph

        Returns void

      • Parameters

        • docuri: string
        • options: any

        Returns Promise<Response>

      • Parameters

        Returns Promise<void>

      • Parameters

        Returns void

      • Parameters

        • response: Response
        • options: {
              req: BlankNode;
              resource: Quad_Subject;
          } & Partial<AutoInitOptions>

        Returns BlankNode

      • Parameters

        • uri: string
        • options: {
              original: Quad_Subject;
              req: Quad_Subject;
          } & Partial<AutoInitOptions>

        Returns Promise<number | FetchError>

      • Parameters

        • term: NamedNode

        Returns void

      • Parameters

        • here: string
        • there: string
        • contentType: any

        Returns Promise<ExtendedResponse>

      • A generic web operation, at the fetch() level. does not involve the quad store.

        Returns promise of Response If data is returned, copies it to response.responseText before returning

        -

        Parameters

        • method: HTTPMethods
        • uriIn: string | NamedNode
        • Optional options: Partial<AutoInitOptions>

        Returns Promise<ExtendedResponse>

      • Parameters

        • uri: string

        Returns any

      • Parameters

        • uri: string

        Returns string

      • Parameters

        • uri: string

        Returns any

      • Decide on credentials using old XXHR api or new fetch() one

        -

        Parameters

        Returns void

      • Tests whether the uri's protocol is supported by the Fetcher.

        -

        Parameters

        • uri: string

        Returns boolean

      Generated using TypeDoc

      \ No newline at end of file +

      Parameters

      Returns Promise<ExtendedResponse>

      Generated using TypeDoc

      \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Formula.html b/Documentation/api/classes/rdf.Formula.html index e3f2e33c..fd7dff93 100644 --- a/Documentation/api/classes/rdf.Formula.html +++ b/Documentation/api/classes/rdf.Formula.html @@ -55,33 +55,33 @@ transitiveClosure variable whether -

      Constructors

      • Initializes this formula

        +

      Constructors

      • Initializes this formula

        Parameters

        • Optional statements: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          Initial array of statements

          -
        • Optional constraints: readonly any[]

          initial array of constraints

          -
        • Optional initBindings: readonly any[]

          initial bindings used in Query

          -
        • Optional optional: readonly any[]

          optional

          +
        • Optional constraints: readonly any[]

          initial array of constraints

          +
        • Optional initBindings: readonly any[]

          initial bindings used in Query

          +
        • Optional optional: readonly any[]

          optional

        • Optional opts: FormulaOpts

        Returns Formula

      Properties

      classOrder: number

      The class order for this node

      -
      constraints: readonly any[]
      fetcher?: Fetcher

      The accompanying fetcher instance.

      +
      constraints: readonly any[]
      fetcher?: Fetcher

      The accompanying fetcher instance.

      Is set by the fetcher when initialized.

      -
      initBindings: readonly any[]
      isVar: number
      ns: ((nsuri, factory?) => ((ln) => NamedNode))

      Type declaration

        • (nsuri, factory?): ((ln) => NamedNode)
        • A namespace for the specified namespace's URI

          +
      initBindings: readonly any[]
      isVar: number
      ns: ((nsuri, factory?) => ((ln) => NamedNode))

      Type declaration

        • (nsuri, factory?): ((ln) => NamedNode)
        • A namespace for the specified namespace's URI

          Parameters

          • nsuri: string

            The URI for the namespace

            -
          • Optional factory: RdfJsDataFactory

          Returns ((ln) => NamedNode)

            • (ln): NamedNode
            • Parameters

              • ln: string

              Returns NamedNode

      optional: readonly any[]
      rdfFactory: any

      The factory used to generate statements and terms

      +
    • Optional factory: RdfJsDataFactory
    • Returns ((ln) => NamedNode)

        • (ln): NamedNode
        • Parameters

          • ln: string

          Returns NamedNode

      optional: readonly any[]
      rdfFactory: any

      The factory used to generate statements and terms

      statements: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
      termType: "Graph"

      The type of node

      value: string

      The node's value

      -
      fromValue: (<T>(value) => T)

      Type declaration

        • <T>(value): T
        • Type Parameters

          • T extends FromValueReturns<any>

          Parameters

          • value: ValueType

          Returns T

      toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

      Type declaration

        • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
        • Parameters

          • term: any

          Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

      Methods

      • Transform a collection of NTriple URIs into their URI strings

        +
      fromValue: (<T>(value) => T)

      Type declaration

        • <T>(value): T
        • Type Parameters

          • T extends FromValueReturns<any>

          Parameters

          • value: ValueType

          Returns T

      toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

      Type declaration

        • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
        • Parameters

          • term: any

          Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

      Methods

      • Transform a collection of NTriple URIs into their URI strings

        Parameters

        • t: any

          Some iterable collection of NTriple URI strings

        Returns {}

        A collection of the URIs as strings todo: explain why it is important to go through NT

        -
        • Add a statement from its parts

          +
          • Add a statement from its parts

            Parameters

            • subject: Quad_Subject | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

              the first part of the statement

            • Optional predicate: Quad_Predicate

              the second part of the statement

            • Optional object: string | Term

              the third part of the statement

            • Optional graph: Quad_Graph

              the last part of the statement

              -

            Returns null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Formula

          • Adds all the statements to this formula

            +

          Returns null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Formula

          • Adds all the statements to this formula

            Parameters

            • statements: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

              A collection of statements

              -

            Returns void

          • Add a statment object

            +

          Returns void

          • Add a statment object

            Parameters

            • statement: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

              An existing constructed statement to add

              -

            Returns null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Formula

          • Follow link from one node, using one wildcard, looking for one

            +

          Returns null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Formula

          • Follow link from one node, using one wildcard, looking for one

            For example, any(me, knows, null, profile) - a person I know accoring to my profile . any(me, knows, null, null) - a person I know accoring to anything in store . any(null, knows, me, null) - a person who know me accoring to anything in store .

            @@ -90,32 +90,32 @@
          • Optional o: null | Quad_Object

            A node to search for as object, or if null, a wildcard

          • Optional g: null | Quad_Graph

            A node to search for as graph, or if null, a wildcard

          Returns null | Node

          A node which match the wildcard position, or null

          -
          • Gets the first JavaScript object equivalent to a node based on the specified pattern

            +
          • Gets the first JavaScript object equivalent to a node based on the specified pattern

            Parameters

            • Optional s: null | Quad_Subject

              The subject

            • Optional p: null | Quad_Predicate

              The predicate

            • Optional o: null | Quad_Object

              The object

            • Optional g: null | Quad_Graph

              The graph that contains the statement

              -

            Returns any

          • Gets the first statement that matches the specified pattern

            -

            Parameters

            • Optional s: null | Quad_Subject
            • Optional p: null | Quad_Predicate
            • Optional o: null | Quad_Object
            • Optional g: null | Quad_Graph

            Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

          • Gets the value of a node that matches the specified pattern

            +

          Returns any

          • Gets the first statement that matches the specified pattern

            +

            Parameters

            • Optional s: null | Quad_Subject
            • Optional p: null | Quad_Predicate
            • Optional o: null | Quad_Object
            • Optional g: null | Quad_Graph

            Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

          • Gets the value of a node that matches the specified pattern

            Parameters

            • Optional s: null | Quad_Subject

              The subject

            • Optional p: null | Quad_Predicate

              The predicate

            • Optional o: null | Quad_Object

              The object

            • Optional g: null | Quad_Graph

              The graph that contains the statement

              -

            Returns string | void

          • Shortcut for adding blankNodes

            -

            Parameters

            • Optional id: string

            Returns BlankNode

          • Finds the types in the list which have no stored subtypes +

          Returns string | void

          • Shortcut for adding blankNodes

            +

            Parameters

            • Optional id: string

            Returns BlankNode

          • Finds the types in the list which have no stored subtypes These are a set of classes which provide by themselves complete information -- the other classes are redundant for those who know the class DAG.

            Parameters

            • types: any

              A map of the types

              -

            Returns any

          • Compares this node with another

            +

          Returns any

          • Compares this node with another

            Parameters

            • other: Node

              The other node

            Returns number

            See

            to check if two nodes are equal

            -
          • Trace statements which connect directly, or through bnodes

            +
          • Trace statements which connect directly, or through bnodes

            Parameters

            • subject: Quad_Subject

              The node to start looking for statments

            • doc: Quad_Graph

              The document to be searched, or null to search all documents

              -
            • Optional excludePredicateURIs: readonly string[]

            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

            an array of statements, duplicate statements are suppresssed.

            -
          • Follow links from one node, using one wildcard.

            +
          • Optional excludePredicateURIs: readonly string[]

          Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          an array of statements, duplicate statements are suppresssed.

          +
          • Follow links from one node, using one wildcard.

            For example, each(me, knows, null, profile) - people I know accoring to my profile . each(me, knows, null, null) - people I know accoring to anything in store . each(null, knows, me, null) - people who know me accoring to anything in store .

            @@ -126,34 +126,34 @@

          Returns Node[]

          • An array of nodes which match the wildcard position
          -
          • Test whether this formula is equals to {other}

            +
          • Test whether this formula is equals to {other}

            Parameters

            Returns boolean

          • For thisClass or any subclass, anything which has it is its type +

          Returns boolean

          • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

            Parameters

            • subject: Node

              A named node

              -

            Returns UriMap

          • For thisClass or any subclass, anything which has it is its type +

          Returns UriMap

          • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

            Parameters

            • thisClass: any

            Returns MembersMap

            a hash of URIs

            -
          • Get all the Classes of which we can RDFS-infer the subject is a superclass +

          • Get all the Classes of which we can RDFS-infer the subject is a superclass Returns a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

            -

            Parameters

            Returns {
                [uri: string]: boolean;
            }

            • [uri: string]: boolean
          • Get all the Classes of which we can RDFS-infer the subject is a subclass

            +

            Parameters

            Returns {
                [uri: string]: boolean;
            }

            • [uri: string]: boolean
          • Get all the Classes of which we can RDFS-infer the subject is a subclass

            Parameters

            • subject: Node

              The thing whose classes are to be found

            Returns {
                [uri: string]: boolean;
            }

            a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

            -
            • [uri: string]: boolean
          • Get all the Classes of which we can RDFS-infer the subject is a member +

            • [uri: string]: boolean
          • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal) Returns a hash table where key is NT of type and value is statement why we @@ -161,39 +161,39 @@ Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

            Parameters

            • subject: Quad_Subject

              A subject node

              -

            Returns UriMap

          • Get all the Classes of which we can RDFS-infer the subject is a member +

          Returns UriMap

          • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal)

            Parameters

            • subject: any

              The thing whose classes are to be found

            Returns {
                [uri: string]: boolean;
            }

            a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

            -
            • [uri: string]: boolean
          • Creates a new empty formula

            -

            Parameters

            • Optional _features: readonly string[]

              Not applicable, but necessary for typing to pass

              -

            Returns Formula

          • Transforms an NTriples string format into a Node. +

            • [uri: string]: boolean
          • Creates a new empty formula

            +

            Parameters

            • Optional _features: readonly string[]

              Not applicable, but necessary for typing to pass

              +

            Returns Formula

          • Transforms an NTriples string format into a Node. The blank node bit should not be used on program-external values; designed for internal work such as storing a blank node id in an HTML attribute. This will only parse the strings generated by the various toNT() methods.

            -

            Parameters

            • str: any

            Returns any

          • Creates a hash for this node

            +

            Parameters

            • str: any

            Returns any

          • Creates a hash for this node

            Returns string

            Deprecated

            use {rdfFactory.id} instead if possible

            -
          • Returns true if this formula holds the specified statement(s)

            -

            Parameters

            • s: any
            • Optional p: any
            • Optional o: any
            • Optional g: any

            Returns boolean

          • Returns true if this formula holds the specified {statement}

            -

            Parameters

            • statement: any

            Returns boolean

          • Returns a unique index-safe identifier for the given term.

            +
          • Returns true if this formula holds the specified statement(s)

            +

            Parameters

            • s: any
            • Optional p: any
            • Optional o: any
            • Optional g: any

            Returns boolean

          • Returns true if this formula holds the specified {statement}

            +

            Parameters

            • statement: any

            Returns boolean

          • Returns a unique index-safe identifier for the given term.

            Falls back to the rdflib hashString implementation if the given factory doesn't support id.

            -

            Parameters

            • term: TFIDFactoryTypes

            Returns Indexable

          • Used by the n3parser to generate list elements

            +

            Parameters

            • term: TFIDFactoryTypes

            Returns Indexable

          • Used by the n3parser to generate list elements

            Parameters

            • values: any

              The values of the collection

            • context: any

              The store

            Returns any

            • The term for the statement
            -
          • Compares whether this node is the same as the other one

            +
          • Compares whether this node is the same as the other one

            Parameters

            • other: Node

              Another node

              -

            Returns boolean

          • Serializes this formula

            +

          Returns boolean

          • Serializes this formula

            Parameters

            • base: any

              The base string

            • contentType: any

              The content type of the syntax to use

            • provenance: any

              The provenance URI

            • Optional options: any

              options to pass to the serializer, as defined in serialize method

              -

            Returns undefined | string

          • Search the Store +

          Returns undefined | string

          • Search the Store This is really a teaching method as to do this properly you would use IndexedFormula

            Type Parameters

            • JustOne extends boolean = false

            Parameters

            • Optional s: null | Quad_Subject

              A node to search for as subject, or if null, a wildcard

            • Optional p: null | Quad_Predicate

              A node to search for as predicate, or if null, a wildcard

              @@ -203,32 +203,32 @@

            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

            • An array of nodes which match the wildcard position
            -
          • Creates a new formula with the substituting bindings applied

            +
          • Creates a new formula with the substituting bindings applied

            Type Parameters

            Parameters

            • bindings: Bindings

              The bindings to substitute

              -

            Returns T

          • Parameters

            • uri: string
            • Optional name: any

            Returns NamedNode

          • Gets the node matching the specified pattern. Throws when no match could be made.

            +

          Returns T

          • Parameters

            • uri: string
            • Optional name: any

            Returns NamedNode

          • Gets the node matching the specified pattern. Throws when no match could be made.

            Parameters

            • Optional s: null | Quad_Subject

              The subject

            • Optional p: null | Quad_Predicate

              The predicate

            • Optional o: null | Quad_Object

              The object

            • Optional g: null | Quad_Graph

              The graph that contains the statement

              -

            Returns undefined | null | Node

          • Creates a canonical string representation of this node

            -

            Returns string

          • Creates a n-quads string representation of this node

            -

            Returns string

          • Creates a n-triples string representation of this node

            -

            Returns string

          • Serializes this formula to a string

            -

            Returns string

          • Finds the types in the list which have no stored supertypes +

          Returns undefined | null | Node

          • Creates a canonical string representation of this node

            +

            Returns string

          • Creates a n-quads string representation of this node

            +

            Returns string

          • Creates a n-triples string representation of this node

            +

            Returns string

          • Serializes this formula to a string

            +

            Returns string

          • Finds the types in the list which have no stored supertypes We exclude the universal class, owl:Things and rdf:Resource, as it is information-free.

            Parameters

            • types: {
                  [id: string]: string | NamedNode;
              }

              The types

              -

            Returns {
                [id: string]: string | NamedNode;
            }

          • RDFS Inference +

          Returns {
              [id: string]: string | NamedNode;
          }

          • RDFS Inference These are hand-written implementations of a backward-chaining reasoner over the RDFS axioms.

            Parameters

            • seeds: BooleanMap

              A hash of NTs of classes to start with

            • predicate: Quad_Predicate

              The property to trace though

            • Optional inverse: boolean

              Trace inverse direction

              -

            Returns {
                [uri: string]: boolean;
            }

            • [uri: string]: boolean
          • Gets a new variable

            +

          Returns {
              [uri: string]: boolean;
          }

          • [uri: string]: boolean
          • Gets a new variable

            Parameters

            • name: string

              The variable's name

              -

            Returns Variable

          • Gets the number of statements in this formula that matches the specified pattern

            +

          Returns Variable

          • Gets the number of statements in this formula that matches the specified pattern

            Parameters

            • Optional s: null | Quad_Subject

              The subject

            • Optional p: null | Quad_Predicate

              The predicate

            • Optional o: null | Quad_Object

              The object

            • Optional g: null | Quad_Graph

              The graph that contains the statement

              -

            Returns number

          Generated using TypeDoc

          \ No newline at end of file +

          Returns number

          Generated using TypeDoc

          \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Literal.html b/Documentation/api/classes/rdf.Literal.html index 65fe1144..4abd70f0 100644 --- a/Documentation/api/classes/rdf.Literal.html +++ b/Documentation/api/classes/rdf.Literal.html @@ -24,7 +24,7 @@ fromNumber fromValue toNT -

          Constructors

          • Initializes a literal

            +

          Constructors

          • Initializes a literal

            Parameters

            • value: string

              The literal's lexical value

            • Optional language: null | string

              The language for the literal. Defaults to ''.

            • Optional datatype: any

              The literal's datatype as a named node. Defaults to xsd:string.

              @@ -35,29 +35,29 @@
          value: string

          The node's value

          toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

          Type declaration

            • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
            • Parameters

              • term: any

              Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

          Accessors

          • get lang(): string
          • The language for the literal

            Returns string

            Deprecated

            use {language} instead

            -
          • set lang(language): void
          • Parameters

            • language: string

            Returns void

          Methods

          • Compares this node with another

            +
          • set lang(language): void
          • Parameters

            • language: string

            Returns void

          Methods

          • Compares this node with another

            Parameters

            • other: Node

              The other node

            Returns number

            See

            to check if two nodes are equal

            -
          • Gets a copy of this literal

            -

            Returns Literal

          • Gets whether two literals are the same

            +
          • Gets a copy of this literal

            +

            Returns Literal

          • Gets whether two literals are the same

            Parameters

            • other: Term

              The other statement

              -

            Returns boolean

          • Creates a hash for this node

            +

          Returns boolean

          • Creates a hash for this node

            Returns string

            Deprecated

            use {rdfFactory.id} instead if possible

            -
          • Compares whether this node is the same as the other one

            +
          • Compares whether this node is the same as the other one

            Parameters

            • other: Node

              Another node

              -

            Returns boolean

          • Creates the substituted node for this one, according to the specified bindings

            +

          Returns boolean

          • Creates the substituted node for this one, according to the specified bindings

            Type Parameters

            Parameters

            • bindings: Bindings

              Bindings of identifiers to nodes

              -

            Returns T

          • Creates a canonical string representation of this node

            -

            Returns string

          • Creates a n-quads string representation of this node

            -

            Returns string

          • Creates a n-triples string representation of this node

            -

            Returns string

          • Creates a string representation of this node

            -

            Returns string

          • Builds a literal node from a boolean value

            +

          Returns T

          • Creates a canonical string representation of this node

            +

            Returns string

          • Creates a n-quads string representation of this node

            +

            Returns string

          • Creates a n-triples string representation of this node

            +

            Returns string

          • Creates a string representation of this node

            +

            Returns string

          • Builds a literal node from a boolean value

            Parameters

            • value: boolean

              The value

              -

            Returns Literal

          • Builds a literal node from a date value

            +

          Returns Literal

          • Builds a literal node from a date value

            Parameters

            • value: Date

              The value

              -

            Returns Literal

          • Builds a literal node from a number value

            +

          Returns Literal

          • Builds a literal node from a number value

            Parameters

            • value: number

              The value

              -

            Returns Literal

          • Builds a literal node from an input value

            +

          Returns Literal

          • Builds a literal node from an input value

            Type Parameters

            • T extends FromValueReturns<any>

            Parameters

            • value: ValueType

              The input value

              -

            Returns T

          • Serializes a literal to an N-Triples string

            -

            Parameters

            Returns string

          Generated using TypeDoc

          \ No newline at end of file +

          Returns T

          Generated using TypeDoc

          \ No newline at end of file diff --git a/Documentation/api/classes/rdf.LiveStore.html b/Documentation/api/classes/rdf.LiveStore.html index 0096cd60..af770be7 100644 --- a/Documentation/api/classes/rdf.LiveStore.html +++ b/Documentation/api/classes/rdf.LiveStore.html @@ -103,17 +103,17 @@ uris variable whether -

          Constructors

          Properties

          HTTPRedirects: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          Redirections we got from HTTP

          +

          Constructors

          Properties

          HTTPRedirects: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          Redirections we got from HTTP

          _existentialVariables?: BlankNode[]
          _universalVariables?: NamedNode[]
          aliases: any[]

          Reverse mapping to redirection: aliases for this

          classActions: {
              [k: string]: Function[];
          }

          Map of iri predicates to functions to call when adding { s type X }

          Type declaration

          • [k: string]: Function[]
          classOrder: number

          The class order for this node

          -
          constraints: readonly any[]
          features: FeaturesType
          fetcher: Fetcher

          The accompanying fetcher instance.

          +
          constraints: readonly any[]
          features: FeaturesType
          fetcher: Fetcher

          The accompanying fetcher instance.

          Is set by the fetcher when initialized.

          -
          index: [Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[]]
          initBindings: readonly any[]
          isVar: number
          namespaces: {
              [key: string]: string;
          }

          Dictionary of namespace prefixes

          +
          index: [Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[]]
          initBindings: readonly any[]
          isVar: number
          namespaces: {
              [key: string]: string;
          }

          Dictionary of namespace prefixes

          Type declaration

          • [key: string]: string
          ns: ((nsuri, factory?) => ((ln) => NamedNode))

          Type declaration

            • (nsuri, factory?): ((ln) => NamedNode)
            • A namespace for the specified namespace's URI

              Parameters

              • nsuri: string

                The URI for the namespace

              • Optional factory: RdfJsDataFactory

              Returns ((ln) => NamedNode)

                • (ln): NamedNode
                • Parameters

                  • ln: string

                  Returns NamedNode

          objectIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          Array of statements with this X as object

          -
          optional: readonly any[]
          predicateIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          Array of statements with this X as predicate

          +
          optional: readonly any[]
          predicateIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

          Array of statements with this X as predicate

          propertyActions: {
              [k: string]: Function[];
          }

          Map of iri predicates to functions to call when getting statement with {s X o}

          Type declaration

          • [k: string]: Function[]
          rdfFactory: any

          The factory used to generate statements and terms

          redirections: any[]

          Redirect to lexically smaller equivalent symbol

          @@ -128,24 +128,24 @@
          var kb = rdf.graph()
          kb.length // -> 0

          Returns number

          • get defaultGraphURI(): string
          • Gets the URI of the default graph

            -

            Returns string

          Methods

          • Transform a collection of NTriple URIs into their URI strings

            +

            Returns string

          Methods

          • Transform a collection of NTriple URIs into their URI strings

            Parameters

            • t: any

              Some iterable collection of NTriple URI strings

            Returns {}

            A collection of the URIs as strings todo: explain why it is important to go through NT

            -
            • Adds a triple (quad) to the store.

              +
              • Adds a triple (quad) to the store.

                Parameters

                • subj: Quad_Subject | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[] | Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                  The thing about which the fact a relationship is asserted. Also accepts a statement or an array of Statements.

                • Optional pred: Quad_Predicate

                  The relationship which is asserted

                • Optional obj: string | Term

                  The object of the relationship, e.g. another thing or a value. If passed a string, this will become a literal.

                • Optional why: Quad_Graph

                  The document in which the triple (S,P,O) was or will be stored on the web

                Returns null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | LiveStore

                The statement added to the store, or the store

                -
              • Adds all the statements to this formula

                +
              • Adds all the statements to this formula

                Parameters

                • statements: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                  A collection of statements

                  -

                Returns void

              • Add a callback which will be triggered after a statement has been added to the store.

                -

                Parameters

                • cb: ((q) => void)
                    • (q): void
                    • Parameters

                      • q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                      Returns void

                Returns void

              • Parameters

                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                Returns number

                Deprecated

                Use {add} instead

                -
              • Return all equivalent URIs by which this is known

                +

              Returns void

              • Add a callback which will be triggered after a statement has been added to the store.

                +

                Parameters

                • cb: ((q) => void)
                    • (q): void
                    • Parameters

                      • q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                      Returns void

                Returns void

              • Parameters

                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                Returns number

                Deprecated

                Use {add} instead

                +
              • Follow link from one node, using one wildcard, looking for one

                +

              Returns NamedNode[]

              • Follow link from one node, using one wildcard, looking for one

                For example, any(me, knows, null, profile) - a person I know accoring to my profile . any(me, knows, null, null) - a person I know accoring to anything in store . any(null, knows, me, null) - a person who know me accoring to anything in store .

                @@ -154,51 +154,51 @@
              • Optional o: null | Quad_Object

                A node to search for as object, or if null, a wildcard

              • Optional g: null | Quad_Graph

                A node to search for as graph, or if null, a wildcard

              Returns null | Node

              A node which match the wildcard position, or null

              -
              • Gets the first JavaScript object equivalent to a node based on the specified pattern

                +
              • Gets the first JavaScript object equivalent to a node based on the specified pattern

                Parameters

                • Optional s: null | Quad_Subject

                  The subject

                • Optional p: null | Quad_Predicate

                  The predicate

                • Optional o: null | Quad_Object

                  The object

                • Optional g: null | Quad_Graph

                  The graph that contains the statement

                  -

                Returns any

              • Gets the first statement that matches the specified pattern

                -

                Parameters

                • Optional s: null | Quad_Subject
                • Optional p: null | Quad_Predicate
                • Optional o: null | Quad_Object
                • Optional g: null | Quad_Graph

                Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

              • Gets the value of a node that matches the specified pattern

                +

              Returns any

              • Gets the first statement that matches the specified pattern

                +

                Parameters

                • Optional s: null | Quad_Subject
                • Optional p: null | Quad_Predicate
                • Optional o: null | Quad_Object
                • Optional g: null | Quad_Graph

                Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

              • Gets the value of a node that matches the specified pattern

                Parameters

                • Optional s: null | Quad_Subject

                  The subject

                • Optional p: null | Quad_Predicate

                  The predicate

                • Optional o: null | Quad_Object

                  The object

                • Optional g: null | Quad_Graph

                  The graph that contains the statement

                  -

                Returns string | void

              • Apply a set of statements to be deleted and to be inserted

                -

                Parameters

                • patch: {
                      delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                      patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                      where?: any;
                  }

                  The set of statements to be deleted and to be inserted

                  -
                  • Optional delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                  • Optional patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                  • Optional where?: any
                • target: NamedNode

                  The name of the document to patch

                  +

                Returns string | void

              • Apply a set of statements to be deleted and to be inserted

                +

                Parameters

                • patch: {
                      delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                      patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                      where?: any;
                  }

                  The set of statements to be deleted and to be inserted

                  +
                  • Optional delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                  • Optional patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                  • Optional where?: any
                • target: NamedNode

                  The name of the document to patch

                • patchCallback: ((errorString?) => void)

                  Callback to be called when patching is complete

                  -
                    • (errorString?): void
                    • Parameters

                      • Optional errorString: string

                      Returns void

                Returns void

              • Finds the types in the list which have no stored subtypes +

                  • (errorString?): void
                  • Parameters

                    • Optional errorString: string

                    Returns void

              Returns void

              • Finds the types in the list which have no stored subtypes These are a set of classes which provide by themselves complete information -- the other classes are redundant for those who know the class DAG.

                Parameters

                • types: any

                  A map of the types

                  -

                Returns any

              • Returns the symbol with canonical URI as smushed

                +

              Returns any

              • Returns the symbol with canonical URI as smushed

                Parameters

                • Optional term: Term

                  An RDF node

                  -

                Returns Node

              • Checks this formula for consistency

                -

                Returns void

              • Checks a list of statements for consistency

                -

                Parameters

                • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                  The list of statements to check

                  +

                Returns Node

              • Checks this formula for consistency

                +

                Returns void

              • Checks a list of statements for consistency

                +

                Parameters

                • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                  The list of statements to check

                • Optional from: number

                  An index with the array ['subject', 'predicate', 'object', 'why']

                  -

                Returns boolean | void

              • Closes this formula (and return it)

                -

                Returns Store

              • Compares this node with another

                +

              Returns boolean | void

              • Closes this formula (and return it)

                +

                Returns Store

              • Compares this node with another

                Parameters

                • other: Node

                  The other node

                Returns number

                See

                to check if two nodes are equal

                -
              • Parameters

                • u1: Term
                • u2: Term

                Returns number

              • Trace statements which connect directly, or through bnodes

                +
              • Parameters

                • u1: Term
                • u2: Term

                Returns number

              • Trace statements which connect directly, or through bnodes

                Parameters

                • subject: Quad_Subject

                  The node to start looking for statments

                • doc: Quad_Graph

                  The document to be searched, or null to search all documents

                  -
                • Optional excludePredicateURIs: readonly string[]

                Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                an array of statements, duplicate statements are suppresssed.

                -
              • replaces

                +
              • Optional excludePredicateURIs: readonly string[]

              Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

              an array of statements, duplicate statements are suppresssed.

              +
              • replaces

                Parameters

                • template: Quad_Subject

                  node to copy

                • target: Quad_Subject

                  node to copy to

                • Optional flags: ("two-direction" | "delete")[]

                  Whether or not to do a two-directional copy and/or delete triples

                Returns void

                Target

                and add appropriate triples removes no triples by default and is a one-direction replication

                -
              • N3 allows for declaring blank nodes, this function enables that support

                +
              • Follow links from one node, using one wildcard.

                +

              Returns BlankNode

              • Follow links from one node, using one wildcard.

                For example, each(me, knows, null, profile) - people I know accoring to my profile . each(me, knows, null, null) - people I know accoring to anything in store . each(null, knows, me, null) - people who know me accoring to anything in store .

                @@ -209,38 +209,38 @@

              Returns Node[]

              • An array of nodes which match the wildcard position
              -
              • Test whether this formula is equals to {other}

                +
              • Test whether this formula is equals to {other}

                Parameters

                Returns boolean

              • Simplify graph in store when we realize two identifiers are equivalent +

              Returns boolean

              • Simplify graph in store when we realize two identifiers are equivalent We replace the bigger with the smaller.

                Parameters

                • u1in: Term

                  The first node

                • u2in: Term

                  The second node

                  -

                Returns boolean

              • For thisClass or any subclass, anything which has it is its type +

              Returns boolean

              • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

                Parameters

                • subject: Node

                  A named node

                  -

                Returns UriMap

              • For thisClass or any subclass, anything which has it is its type +

              Returns UriMap

              • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

                Parameters

                • thisClass: any

                Returns MembersMap

                a hash of URIs

                -
              • Get all the Classes of which we can RDFS-infer the subject is a superclass +

              • Get all the Classes of which we can RDFS-infer the subject is a superclass Returns a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                -

                Parameters

                Returns {
                    [uri: string]: boolean;
                }

                • [uri: string]: boolean
              • Get all the Classes of which we can RDFS-infer the subject is a subclass

                +

                Parameters

                Returns {
                    [uri: string]: boolean;
                }

                • [uri: string]: boolean
              • Get all the Classes of which we can RDFS-infer the subject is a subclass

                Parameters

                • subject: Node

                  The thing whose classes are to be found

                Returns {
                    [uri: string]: boolean;
                }

                a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                -
                • [uri: string]: boolean
              • Get all the Classes of which we can RDFS-infer the subject is a member +

                • [uri: string]: boolean
              • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal) Returns a hash table where key is NT of type and value is statement why we @@ -248,91 +248,91 @@ Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                Parameters

                • subject: Quad_Subject

                  A subject node

                  -

                Returns UriMap

              • Get all the Classes of which we can RDFS-infer the subject is a member +

              Returns UriMap

              • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal)

                Parameters

                • subject: any

                  The thing whose classes are to be found

                Returns {
                    [uri: string]: boolean;
                }

                a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                -
                • [uri: string]: boolean
              • Creates a new empty indexed formula +

                • [uri: string]: boolean
              • Creates a new empty indexed formula Only applicable for IndexedFormula, but TypeScript won't allow a subclass to override a property

                Parameters

                • features: FeaturesType

                  The list of features

                  -

                Returns Store

              • Transforms an NTriples string format into a Node. +

              Returns Store

              • Transforms an NTriples string format into a Node. The blank node bit should not be used on program-external values; designed for internal work such as storing a blank node id in an HTML attribute. This will only parse the strings generated by the various toNT() methods.

                -

                Parameters

                • str: any

                Returns any

              • Creates a hash for this node

                +

                Parameters

                • str: any

                Returns any

              • Creates a hash for this node

                Returns string

                Deprecated

                use {rdfFactory.id} instead if possible

                -
              • Returns true if this formula holds the specified statement(s)

                -

                Parameters

                • s: any
                • Optional p: any
                • Optional o: any
                • Optional g: any

                Returns boolean

              • Returns true if this formula holds the specified {statement}

                -

                Parameters

                • statement: any

                Returns boolean

              • Returns a unique index-safe identifier for the given term.

                +
              • Returns true if this formula holds the specified statement(s)

                +

                Parameters

                • s: any
                • Optional p: any
                • Optional o: any
                • Optional g: any

                Returns boolean

              • Returns true if this formula holds the specified {statement}

                +

                Parameters

                • statement: any

                Returns boolean

              • Returns a unique index-safe identifier for the given term.

                Falls back to the rdflib hashString implementation if the given factory doesn't support id.

                -

                Parameters

                • term: TFIDFactoryTypes

                Returns Indexable

              • Parameters

                • features: FeaturesType

                Returns void

              • Used by the n3parser to generate list elements

                +

                Parameters

                • term: TFIDFactoryTypes

                Returns Indexable

              • Parameters

                • features: FeaturesType

                Returns void

              • Used by the n3parser to generate list elements

                Parameters

                • values: any

                  The values of the collection

                • context: any

                  The store

                Returns any

                • The term for the statement
                -
              • Returns any quads matching the given arguments. +

              • Returns any quads matching the given arguments. Standard RDFJS spec method for Source objects, implemented as an alias to statementsMatching()

                Parameters

                • Optional subject: null | Quad_Subject

                  The subject

                • Optional predicate: null | Quad_Predicate

                  The predicate

                • Optional object: null | Quad_Object

                  The object

                • Optional graph: null | Quad_Graph

                  The graph that contains the statement

                  -

                Returns Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

              • Find out whether a given URI is used as symbol in the formula

                +

              Returns Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

              • Find out whether a given URI is used as symbol in the formula

                Parameters

                • uri: string

                  The URI to look for

                  -

                Returns boolean

              • Existentials are BNodes - something exists without naming

                +

              Returns boolean

              • Existentials are BNodes - something exists without naming

                Parameters

                • uri: string

                  An URI

                  -

                Returns Term

              • Adds a new property action

                +

              Returns Term

              • Adds a new property action

                Parameters

                • pred: Quad_Predicate

                  the predicate that the function should be triggered on

                • action: ((store, subject, predicate, object) => boolean)

                  the function that should trigger

                  -
                    • (store, subject, predicate, object): boolean
                    • Parameters

                      • store: Store
                      • subject: Quad_Subject
                      • predicate: Quad_Predicate
                      • object: Quad_Object

                      Returns boolean

                Returns boolean

              • Creates a new universal node +

                  • (store, subject, predicate, object): boolean
                  • Parameters

                    • store: Store
                    • subject: Quad_Subject
                    • predicate: Quad_Predicate
                    • object: Quad_Object

                    Returns boolean

              Returns boolean

              • Creates a new universal node Universals are Variables

                Parameters

                • uri: string

                  An URI

                  -

                Returns NamedNode

              • Find an unused id for a file being edited: return a symbol +

              Returns NamedNode

              • Find an unused id for a file being edited: return a symbol (Note: Slow iff a lot of them -- could be O(log(k)) )

                Parameters

                • doc: NamedNode

                  A document named node

                  -

                Returns NamedNode

              • Query this store asynchronously, return bindings in callback

                +

              Returns NamedNode

              • Query this store asynchronously, return bindings in callback

                Parameters

                • myQuery: Query

                  The query to be run

                • callback: ((bindings) => void)

                  Function to call when bindings

                    • (bindings): void
                    • Parameters

                      • bindings: Bindings

                      Returns void

                • Optional fetcher: null | Fetcher
                • Optional onDone: (() => void)

                  OBSOLETE - do not use this // @@ Why not ?? Called when query complete

                  -
                    • (): void
                    • Returns void

                Returns void

              • Query this store synchronously and return bindings

                +
                  • (): void
                  • Returns void

              Returns void

              • Query this store synchronously and return bindings

                Parameters

                • myQuery: Query

                  The query to be run

                  -

                Returns any[]

              • Removes one or multiple statement(s) from this formula

                +

              Returns any[]

              • Removes one or multiple statement(s) from this formula

                Parameters

                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                  A Statement or array of Statements to remove

                  -

                Returns Store

              • Removes all statements in a doc, along with the related metadata including request/response

                +

              Returns Store

              • Removes all statements in a doc, along with the related metadata including request/response

                Parameters

                • doc: Quad_Graph

                  The document / graph

                  -

                Returns Store

              • Remove all statements matching args (within limit) *

                +

              Returns Store

              • Remove all statements matching args (within limit) *

                Parameters

                • Optional subj: null | Quad_Subject

                  The subject

                • Optional pred: null | Quad_Predicate

                  The predicate

                • Optional obj: null | Quad_Object

                  The object

                • Optional why: null | Quad_Graph

                  The graph that contains the statement

                • Optional limit: number

                  The number of statements to remove

                  -

                Returns void

              • Remove all matching statements

                +

              Returns void

              • Remove all matching statements

                Parameters

                • Optional subject: null | Quad_Subject

                  The subject

                • Optional predicate: null | Quad_Predicate

                  The predicate

                • Optional object: null | Quad_Object

                  The object

                • Optional graph: null | Quad_Graph

                  The graph that contains the statement

                  -

                Returns Store

              • Remove a particular statement object from the store

                +

              Returns Store

              • Remove a particular statement object from the store

                Parameters

                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                  a statement which is already in the store and indexed. Make sure you only use this for these. Otherwise, you should use remove() above.

                  -

                Returns Store

              • Removes statements

                -

                Parameters

                • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                  The statements to remove

                  -

                Returns Store

              • Replace big with small, obsoleted with obsoleting.

                -

                Parameters

                • big: Quad_Subject
                • small: Quad_Subject

                Returns boolean

              • Compares whether this node is the same as the other one

                +

              Returns Store

              • Removes statements

                +

                Parameters

                • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                  The statements to remove

                  +

                Returns Store

              • Replace big with small, obsoleted with obsoleting.

                +

                Parameters

                • big: Quad_Subject
                • small: Quad_Subject

                Returns boolean

              • Compares whether this node is the same as the other one

                Parameters

                • other: Node

                  Another node

                  -

                Returns boolean

              • Compare by canonical URI as smushed

                +

              Returns boolean

              • Compare by canonical URI as smushed

                Parameters

                Returns boolean

              • Serializes this formula

                +

              Returns boolean

              • Serializes this formula

                Parameters

                • base: any

                  The base string

                • contentType: any

                  The content type of the syntax to use

                • provenance: any

                  The provenance URI

                • Optional options: any

                  options to pass to the serializer, as defined in serialize method

                  -

                Returns undefined | string

              • Parameters

                • prefix: string
                • nsuri: string

                Returns void

              • Search the Store

                +

              Returns undefined | string

              • Parameters

                • prefix: string
                • nsuri: string

                Returns void

              • Search the Store

                ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!

                Parameters

                • Optional subj: null | Quad_Subject

                  A node to search for as subject, or if null, a wildcard

                • Optional pred: null | Quad_Predicate

                  A node to search for as predicate, or if null, a wildcard

                  @@ -340,33 +340,33 @@
                • Optional why: null | Quad_Graph

                  A node to search for as graph, or if null, a wildcard

                • Optional justOne: boolean

                  flag - stop when found one rather than get all of them?

                Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                An array of nodes which match the wildcard position

                -
              • Gets this graph with the bindings substituted

                +
              • Gets this graph with the bindings substituted

                Type Parameters

                Parameters

                • bindings: Bindings

                  The bindings

                  -

                Returns T

              • Gets the node matching the specified pattern. Throws when no match could be made.

                +

              Returns T

              • Gets the node matching the specified pattern. Throws when no match could be made.

                Parameters

                • Optional s: null | Quad_Subject

                  The subject

                • Optional p: null | Quad_Predicate

                  The predicate

                • Optional o: null | Quad_Object

                  The object

                • Optional g: null | Quad_Graph

                  The graph that contains the statement

                  -

                Returns undefined | null | Node

              • Creates a canonical string representation of this node

                -

                Returns string

              • Creates a n-quads string representation of this node

                -

                Returns string

              • Creates a n-triples string representation of this node

                -

                Returns string

              • Serializes this formula to a string

                -

                Returns string

              • Finds the types in the list which have no stored supertypes +

              Returns undefined | null | Node

              • Creates a canonical string representation of this node

                +

                Returns string

              • Creates a n-quads string representation of this node

                +

                Returns string

              • Creates a n-triples string representation of this node

                +

                Returns string

              • Serializes this formula to a string

                +

                Returns string

              • Finds the types in the list which have no stored supertypes We exclude the universal class, owl:Things and rdf:Resource, as it is information-free.

                Parameters

                • types: {
                      [id: string]: string | NamedNode;
                  }

                  The types

                  -

                Returns {
                    [id: string]: string | NamedNode;
                }

              • RDFS Inference +

              Returns {
                  [id: string]: string | NamedNode;
              }

              • RDFS Inference These are hand-written implementations of a backward-chaining reasoner over the RDFS axioms.

                Parameters

                • seeds: BooleanMap

                  A hash of NTs of classes to start with

                • predicate: Quad_Predicate

                  The property to trace though

                • Optional inverse: boolean

                  Trace inverse direction

                  -

                Returns {
                    [uri: string]: boolean;
                }

                • [uri: string]: boolean
              • A list of all the URIs by which this thing is known

                -

                Parameters

                • term: Quad_Subject

                Returns string[]

              • Gets a new variable

                +

              Returns {
                  [uri: string]: boolean;
              }

              • [uri: string]: boolean
              • A list of all the URIs by which this thing is known

                +

                Parameters

                • term: Quad_Subject

                Returns string[]

              • Gets a new variable

                Parameters

                • name: string

                  The variable's name

                  -

                Returns Variable

              • Gets the number of statements in this formula that matches the specified pattern

                +

              Returns Variable

              • Gets the number of statements in this formula that matches the specified pattern

                Parameters

                • Optional s: null | Quad_Subject

                  The subject

                • Optional p: null | Quad_Predicate

                  The predicate

                • Optional o: null | Quad_Object

                  The object

                • Optional g: null | Quad_Graph

                  The graph that contains the statement

                  -

                Returns number

              Generated using TypeDoc

              \ No newline at end of file +

              Returns number

              Generated using TypeDoc

              \ No newline at end of file diff --git a/Documentation/api/classes/rdf.NamedNode-1.html b/Documentation/api/classes/rdf.NamedNode-1.html index 8dd95f73..baebb081 100644 --- a/Documentation/api/classes/rdf.NamedNode-1.html +++ b/Documentation/api/classes/rdf.NamedNode-1.html @@ -19,33 +19,33 @@ toNT toString fromValue -

              Constructors

              • Create a named (IRI) RDF Node

                +

              Constructors

              • Create a named (IRI) RDF Node

                Parameters

                • iri: string

                  The IRI for this node

                Returns NamedNode

              Properties

              classOrder: number

              The class order for this node

              termType: "NamedNode"

              The type of node

              value: string

              The node's value

              toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

              Type declaration

                • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
                • Parameters

                  • term: any

                  Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

              Accessors

              • get uri(): string
              • Alias for value, favored by Tim

                -

                Returns string

              • set uri(uri): void
              • Parameters

                • uri: string

                Returns void

              Methods

              • Compares this node with another

                +

                Returns string

              • set uri(uri): void
              • Parameters

                • uri: string

                Returns void

              Methods

              • Compares this node with another

                Parameters

                • other: Node

                  The other node

                Returns number

                See

                to check if two nodes are equal

                -
              • Returns an $rdf node for the containing directory, ending in slash.

                -

                Returns null | NamedNode

              • Creates the fetchable named node for the document. +

              • Returns an $rdf node for the containing directory, ending in slash.

                +

                Returns null | NamedNode

              • Creates the fetchable named node for the document. Removes everything from the # anchor tag.

                -

                Returns NamedNode

              • Compares whether the two nodes are equal

                +

                Returns NamedNode

              • Compares whether the two nodes are equal

                Parameters

                • other: Term

                  The other node

                  -

                Returns boolean

              • Creates a hash for this node

                +

              Returns boolean

              • Creates a hash for this node

                Returns string

                Deprecated

                use {rdfFactory.id} instead if possible

                -
              • The local identifier with the document

                -

                Returns string

              • Compares whether this node is the same as the other one

                +
              • The local identifier with the document

                +

                Returns string

              • Compares whether this node is the same as the other one

                Parameters

                • other: Node

                  Another node

                  -

                Returns boolean

              • Returns an NN for the whole web site, ending in slash. +

              Returns boolean

              • Returns an NN for the whole web site, ending in slash. Contrast with the "origin" which does NOT have a trailing slash

                -

                Returns NamedNode

              • Creates the substituted node for this one, according to the specified bindings

                +

                Returns NamedNode

              • Creates the substituted node for this one, according to the specified bindings

                Type Parameters

                Parameters

                • bindings: Bindings

                  Bindings of identifiers to nodes

                  -

                Returns T

              • Creates a canonical string representation of this node

                -

                Returns string

              • Creates a n-quads string representation of this node

                -

                Returns string

              • Creates a n-triples string representation of this node

                -

                Returns string

              • Returns the URI including

                -

                Returns string

              • Creates a named node from the specified input value

                +

              Returns T

              • Creates a canonical string representation of this node

                +

                Returns string

              • Creates a n-quads string representation of this node

                +

                Returns string

              • Creates a n-triples string representation of this node

                +

                Returns string

              • Returns the URI including

                +

                Returns string

              • Creates a named node from the specified input value

                Parameters

                • value: any

                  An input value

                  -

                Returns any

              Generated using TypeDoc

              \ No newline at end of file +

              Returns any

              Generated using TypeDoc

              \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Node.html b/Documentation/api/classes/rdf.Node.html index 46df6624..aa0cdccb 100644 --- a/Documentation/api/classes/rdf.Node.html +++ b/Documentation/api/classes/rdf.Node.html @@ -18,22 +18,22 @@ toNQ toNT toString -

              Constructors

              • Parameters

                • value: string

                Returns Node

              Properties

              classOrder: number

              The class order for this node

              +

              Constructors

              • Parameters

                • value: string

                Returns Node

              Properties

              classOrder: number

              The class order for this node

              termType: TermType

              The type of node

              value: string

              The node's value

              -
              fromValue: (<T>(value) => T)

              Type declaration

                • <T>(value): T
                • Type Parameters

                  • T extends FromValueReturns<any>

                  Parameters

                  • value: ValueType

                  Returns T

              toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

              Type declaration

                • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
                • Parameters

                  • term: any

                  Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

              Methods

              • Compares this node with another

                +
              fromValue: (<T>(value) => T)

              Type declaration

                • <T>(value): T
                • Type Parameters

                  • T extends FromValueReturns<any>

                  Parameters

                  • value: ValueType

                  Returns T

              toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

              Type declaration

                • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
                • Parameters

                  • term: any

                  Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

              Methods

              • Compares this node with another

                Parameters

                • other: Node

                  The other node

                Returns number

                See

                to check if two nodes are equal

                -
              • Compares whether the two nodes are equal

                +
              • Compares whether the two nodes are equal

                Parameters

                • other: Term

                  The other node

                  -

                Returns boolean

              • Creates a hash for this node

                +

              Returns boolean

              • Creates a hash for this node

                Returns string

                Deprecated

                use {rdfFactory.id} instead if possible

                -
              • Compares whether this node is the same as the other one

                +
              • Compares whether this node is the same as the other one

                Parameters

                • other: Node

                  Another node

                  -

                Returns boolean

              • Creates the substituted node for this one, according to the specified bindings

                +

              Returns boolean

              • Creates the substituted node for this one, according to the specified bindings

                Type Parameters

                Parameters

                • bindings: Bindings

                  Bindings of identifiers to nodes

                  -

                Returns T

              • Creates a canonical string representation of this node

                -

                Returns string

              • Creates a n-quads string representation of this node

                -

                Returns string

              • Creates a n-triples string representation of this node

                -

                Returns string

              • Creates a string representation of this node

                -

                Returns string

              Generated using TypeDoc

              \ No newline at end of file +

              Returns T

              Generated using TypeDoc

              \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Query.html b/Documentation/api/classes/rdf.Query.html index ed3ef7a4..15725229 100644 --- a/Documentation/api/classes/rdf.Query.html +++ b/Documentation/api/classes/rdf.Query.html @@ -1,7 +1,7 @@ Query | solid-ui

              Class Query

              Query class, for tracking queries the user has in the UI.

              -

              Hierarchy

              • Query

              Constructors

              Constructors

              Properties

              Constructors

              • Parameters

                • name: any
                • id: any

                Returns Query

              Properties

              id: any
              name: any
              pat: Store
              vars: any[]

              Generated using TypeDoc

              \ No newline at end of file +

              Constructors

              • Parameters

                • name: any
                • id: any

                Returns Query

              Properties

              id: any
              name: any
              pat: Store
              vars: any[]

              Generated using TypeDoc

              \ No newline at end of file diff --git a/Documentation/api/classes/rdf.RDFParser.html b/Documentation/api/classes/rdf.RDFParser.html index 117fe513..58d97f5a 100644 --- a/Documentation/api/classes/rdf.RDFParser.html +++ b/Documentation/api/classes/rdf.RDFParser.html @@ -1,4 +1,4 @@ -RDFParser | solid-ui

              Class RDFParser

              Hierarchy

              • RDFParser

              Constructors

              constructor +RDFParser | solid-ui

              Class RDFParser

              Constructors

              Properties

              base bnodes buildFrame @@ -12,7 +12,7 @@

              Methods

              Constructors

              • Parameters

                • store: any

                Returns RDFParser

              Properties

              base: undefined | string
              bnodes: {}

              Type declaration

                buildFrame: any

                Builds scope frame

                +

                Constructors

                • Parameters

                  • store: any

                  Returns RDFParser

                Properties

                base: undefined | string
                bnodes: {}

                Type declaration

                  buildFrame: any

                  Builds scope frame

                  cleanParser: any

                  Cleans out state from a previous parse run

                  frameFactory: any

                  Frame class for namespace and base URI lookups Base lookups will always resolve because the parser knows @@ -22,8 +22,8 @@

                  Type declaration

                  • ATTRIBUTE: number
                  • CDATA_SECTION: number
                  • COMMENT: number
                  • DOCUMENT: number
                  • DOCUMENT_FRAGMENT: number
                  • DOCUMENT_TYPE: number
                  • ELEMENT: number
                  • ENTITY: number
                  • ENTITY_REFERENCE: number
                  • NOTATION: number
                  • PROCESSING_INSTRUCTION: number
                  • TEXT: number

                  Final

                  Member

                  RDFParser

                  ns: {
                      RDF: string;
                      RDFS: string;
                  }

                  Standard namespaces that we know how to handle

                  Type declaration

                  • RDF: string
                  • RDFS: string

                  Final

                  Member

                  RDFParser

                  -

                  Methods

                  • Parameters

                    • node: any
                    • uri: any
                    • name: any

                    Returns any

                  • Build our initial scope frame and parse the DOM into triples

                    +

                  Methods

                  • Parameters

                    • node: any
                    • uri: any
                    • name: any

                    Returns any

                  • Build our initial scope frame and parse the DOM into triples

                    Parameters

                    • document: HTMLDocument

                      The DOM to parse

                    • base: string

                      The base URL to use

                    • why: any

                      The context to which this resource belongs

                      -

                    Returns boolean

                  • Parameters

                    • frame: any

                    Returns void

                  Generated using TypeDoc

                  \ No newline at end of file +

                  Returns boolean

                  Generated using TypeDoc

                  \ No newline at end of file diff --git a/Documentation/api/classes/rdf.RDFaProcessor-1.html b/Documentation/api/classes/rdf.RDFaProcessor-1.html index 7aa096a9..f8d2838b 100644 --- a/Documentation/api/classes/rdf.RDFaProcessor-1.html +++ b/Documentation/api/classes/rdf.RDFaProcessor-1.html @@ -1,4 +1,4 @@ -RDFaProcessor | solid-ui

                  Class RDFaProcessor

                  Hierarchy

                  • RDFaProcessor

                  Constructors

                  constructor +RDFaProcessor | solid-ui

                  Class RDFaProcessor

                  Constructors

                  Properties

                  Constructors

                  • Parameters

                    • kb: any
                    • options: any

                    Returns RDFaProcessor

                  Properties

                  absURIRE: RegExp
                  blankCounter: number
                  blankNodes: any[]
                  finishedHandlers: any[]
                  htmlOptions: {
                      selfClosing: string;
                  }

                  Type declaration

                  • selfClosing: string
                  inHTMLMode: undefined | boolean
                  inXHTMLMode: boolean
                  kb: any
                  langAttributes: {
                      localName: string;
                      namespaceURI: string;
                  }[]

                  Type declaration

                  • localName: string
                  • namespaceURI: string
                  language: any
                  options: any
                  target: any
                  theOne: string
                  vocabulary: any

                  Methods

                  • Parameters

                    • origin: any
                    • subject: any
                    • predicate: any
                    • object: any

                    Returns void

                  • Parameters

                    • node: any

                    Returns string

                  • Parameters

                    • mappings: any

                    Returns {}

                    • Returns void

                    • Parameters

                      • value: any

                      Returns null | string

                    • Returns void

                    • Returns string

                    • Parameters

                      • origin: any
                      • subject: any

                      Returns void

                    • Parameters

                      • value: any
                      • prefixes: any
                      • base: any

                      Returns any

                    • Parameters

                      • value: any
                      • prefixes: any
                      • base: any

                      Returns any

                    • Parameters

                      • value: any
                      • defaultVocabulary: any
                      • terms: any
                      • prefixes: any
                      • base: any
                      • ignoreTerms: any

                      Returns any

                    • Parameters

                      • str: any
                      • target: any

                      Returns void

                    • Parameters

                      • value: any
                      • prefixes: any
                      • base: any

                      Returns any

                    • Parameters

                      • value: any
                      • defaultVocabulary: any
                      • terms: any
                      • prefixes: any
                      • base: any

                      Returns any

                    • Parameters

                      • value: any
                      • defaultVocabulary: any
                      • terms: any
                      • prefixes: any
                      • base: any

                      Returns any

                    • Parameters

                      • uri: any

                      Returns any

                    • Parameters

                      • node: any
                      • options: any

                      Returns void

                    • Parameters

                      • parent: any
                      • subject: any

                      Returns {
                          incomplete: never[];
                          language: any;
                          listMapping: any;
                          parent: any;
                          parentObject: null;
                          prefixes: any;
                          subject: any;
                          terms: any;
                          vocabulary: any;
                      }

                      • incomplete: never[]
                      • language: any
                      • listMapping: any
                      • parent: any
                      • parentObject: null
                      • prefixes: any
                      • subject: any
                      • terms: any
                      • vocabulary: any
                    • Parameters

                      • base: any
                      • uri: any

                      Returns string

                    • Parameters

                      • node: any

                      Returns void

                    • Returns void

                    • Returns void

                    • Returns void

                    • Returns void

                    • Parameters

                      • x: any

                      Returns any

                    • Parameters

                      • str: any

                      Returns any

                    • Parameters

                      • str: any

                      Returns any

                    • Parameters

                      • dom: any
                      • kb: any
                      • base: any

                      Returns void

                    • Parameters

                      • str: any

                      Returns any

                    • Parameters

                      • str: any

                      Returns any

                    Generated using TypeDoc

                    \ No newline at end of file +

                    Constructors

                    • Parameters

                      • kb: any
                      • options: any

                      Returns RDFaProcessor

                    Properties

                    absURIRE: RegExp
                    blankCounter: number
                    blankNodes: any[]
                    finishedHandlers: any[]
                    htmlOptions: {
                        selfClosing: string;
                    }

                    Type declaration

                    • selfClosing: string
                    inHTMLMode: undefined | boolean
                    inXHTMLMode: boolean
                    kb: any
                    langAttributes: {
                        localName: string;
                        namespaceURI: string;
                    }[]

                    Type declaration

                    • localName: string
                    • namespaceURI: string
                    language: any
                    options: any
                    target: any
                    theOne: string
                    vocabulary: any

                    Methods

                    • Parameters

                      • origin: any
                      • subject: any
                      • predicate: any
                      • object: any

                      Returns void

                    • Parameters

                      • node: any

                      Returns string

                    • Parameters

                      • mappings: any

                      Returns {}

                      • Returns void

                      • Parameters

                        • value: any

                        Returns null | string

                      • Returns void

                      • Returns string

                      • Parameters

                        • origin: any
                        • subject: any

                        Returns void

                      • Parameters

                        • value: any
                        • prefixes: any
                        • base: any

                        Returns any

                      • Parameters

                        • value: any
                        • prefixes: any
                        • base: any

                        Returns any

                      • Parameters

                        • value: any
                        • defaultVocabulary: any
                        • terms: any
                        • prefixes: any
                        • base: any
                        • ignoreTerms: any

                        Returns any

                      • Parameters

                        • str: any
                        • target: any

                        Returns void

                      • Parameters

                        • value: any
                        • prefixes: any
                        • base: any

                        Returns any

                      • Parameters

                        • value: any
                        • defaultVocabulary: any
                        • terms: any
                        • prefixes: any
                        • base: any

                        Returns any

                      • Parameters

                        • value: any
                        • defaultVocabulary: any
                        • terms: any
                        • prefixes: any
                        • base: any

                        Returns any

                      • Parameters

                        • uri: any

                        Returns any

                      • Parameters

                        • node: any
                        • options: any

                        Returns void

                      • Parameters

                        • parent: any
                        • subject: any

                        Returns {
                            incomplete: never[];
                            language: any;
                            listMapping: any;
                            parent: any;
                            parentObject: null;
                            prefixes: any;
                            subject: any;
                            terms: any;
                            vocabulary: any;
                        }

                        • incomplete: never[]
                        • language: any
                        • listMapping: any
                        • parent: any
                        • parentObject: null
                        • prefixes: any
                        • subject: any
                        • terms: any
                        • vocabulary: any
                      • Parameters

                        • base: any
                        • uri: any

                        Returns string

                      • Parameters

                        • node: any

                        Returns void

                      • Returns void

                      • Returns void

                      • Returns void

                      • Returns void

                      • Parameters

                        • x: any

                        Returns any

                      • Parameters

                        • str: any

                        Returns any

                      • Parameters

                        • str: any

                        Returns any

                      • Parameters

                        • dom: any
                        • kb: any
                        • base: any

                        Returns void

                      • Parameters

                        • str: any

                        Returns any

                      • Parameters

                        • str: any

                        Returns any

                      Generated using TypeDoc

                      \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Statement.html b/Documentation/api/classes/rdf.Statement.html index 0210e282..ddde23c5 100644 --- a/Documentation/api/classes/rdf.Statement.html +++ b/Documentation/api/classes/rdf.Statement.html @@ -1,5 +1,5 @@ Statement | solid-ui

                      Class Statement<S, P, O, G>

                      A Statement represents an RDF Triple or Quad.

                      -

                      Type Parameters

                      • S extends SubjectType = SubjectType

                      • P extends PredicateType = PredicateType

                      • O extends ObjectType = ObjectType

                      • G extends GraphType = GraphType

                      Hierarchy

                      • Statement

                      Implements

                      • Quad<S, P, O, G | DefaultGraph>

                      Constructors

                      Type Parameters

                      • S extends SubjectType = SubjectType

                      • P extends PredicateType = PredicateType

                      • O extends ObjectType = ObjectType

                      • G extends GraphType = GraphType

                      Implements

                      • Quad<S, P, O, G | DefaultGraph>

                      Constructors

                      Properties

                      graph object predicate @@ -11,7 +11,7 @@ toNQ toNT toString -

                      Constructors

                      • Construct a new statement

                        +

                      Constructors

                      • Construct a new statement

                        Type Parameters

                        • S extends SubjectType = SubjectType

                        • P extends PredicateType = PredicateType

                        • O extends ObjectType = ObjectType

                        • G extends GraphType = GraphType

                        Parameters

                        • subject: S

                          The subject of the triple. What the fact is about

                        • predicate: P

                          The relationship which is asserted between the subject and object

                        • object: O

                          The thing or data value which is asserted to be related to the subject

                          @@ -29,12 +29,12 @@
                      predicate: P

                      The relationship which is asserted between the subject and object

                      subject: S

                      The subject of the triple. What the Statement is about.

                      Accessors

                      • get why(): G | DefaultGraph
                      • Alias for graph, favored by Tim

                        -

                        Returns G | DefaultGraph

                      • set why(g): void
                      • Parameters

                        • g: G | DefaultGraph

                        Returns void

                      Methods

                      • Checks whether two statements are the same

                        +

                        Returns G | DefaultGraph

                      • set why(g): void
                      • Parameters

                        • g: G | DefaultGraph

                        Returns void

                      Methods

                      • Checks whether two statements are the same

                        Parameters

                        • other: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                          The other statement

                          -

                        Returns boolean

                      • Creates a statement with the bindings substituted

                        +

                      Returns boolean

                      • Creates a statement with the bindings substituted

                        Parameters

                        • bindings: Bindings

                          The bindings

                          -

                        Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

                      • Creates a canonical string representation of this statement.

                        -

                        Returns string

                      • Creates a n-quads string representation of this statement

                        -

                        Returns string

                      • Creates a n-triples string representation of this statement

                        -

                        Returns string

                      • Creates a string representation of this statement

                        -

                        Returns string

                      Generated using TypeDoc

                      \ No newline at end of file +

                      Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

                      Generated using TypeDoc

                      \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Store.html b/Documentation/api/classes/rdf.Store.html index d514b470..27f22268 100644 --- a/Documentation/api/classes/rdf.Store.html +++ b/Documentation/api/classes/rdf.Store.html @@ -105,20 +105,20 @@ uris variable whether -

                      Constructors

                      • Creates a new formula

                        +

                      Constructors

                      • Creates a new formula

                        Parameters

                        • Optional features: FeaturesType

                          What sort of automatic processing to do? Array of string

                        • Optional opts: FormulaOpts

                        Returns Store

                      Properties

                      HTTPRedirects: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                      Redirections we got from HTTP

                      _existentialVariables?: BlankNode[]
                      _universalVariables?: NamedNode[]
                      aliases: any[]

                      Reverse mapping to redirection: aliases for this

                      classActions: {
                          [k: string]: Function[];
                      }

                      Map of iri predicates to functions to call when adding { s type X }

                      Type declaration

                      • [k: string]: Function[]
                      classOrder: number

                      The class order for this node

                      -
                      constraints: readonly any[]
                      dataCallbacks?: any

                      Callbacks which are triggered after a statement has been added to the store

                      +
                      constraints: readonly any[]
                      dataCallbacks?: any

                      Callbacks which are triggered after a statement has been added to the store

                      features: FeaturesType
                      fetcher?: Fetcher

                      The accompanying fetcher instance.

                      Is set by the fetcher when initialized.

                      -
                      index: [Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[]]
                      initBindings: readonly any[]
                      isVar: number
                      namespaces: {
                          [key: string]: string;
                      }

                      Dictionary of namespace prefixes

                      +
                      index: [Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[], Statement<SubjectType, PredicateType, ObjectType, GraphType>[]]
                      initBindings: readonly any[]
                      isVar: number
                      namespaces: {
                          [key: string]: string;
                      }

                      Dictionary of namespace prefixes

                      Type declaration

                      • [key: string]: string
                      ns: ((nsuri, factory?) => ((ln) => NamedNode))

                      Type declaration

                        • (nsuri, factory?): ((ln) => NamedNode)
                        • A namespace for the specified namespace's URI

                          Parameters

                          • nsuri: string

                            The URI for the namespace

                          • Optional factory: RdfJsDataFactory

                          Returns ((ln) => NamedNode)

                            • (ln): NamedNode
                            • Parameters

                              • ln: string

                              Returns NamedNode

                      objectIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                      Array of statements with this X as object

                      -
                      optional: readonly any[]
                      predicateIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                      Array of statements with this X as predicate

                      +
                      optional: readonly any[]
                      predicateIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                      Array of statements with this X as predicate

                      propertyActions: {
                          [k: string]: Function[];
                      }

                      Map of iri predicates to functions to call when getting statement with {s X o}

                      Type declaration

                      • [k: string]: Function[]
                      rdfArrayRemove: any

                      Function to remove quads from the store arrays with

                      rdfFactory: any

                      The factory used to generate statements and terms

                      @@ -134,24 +134,24 @@
                      var kb = rdf.graph()
                      kb.length // -> 0

                      Returns number

                      • get defaultGraphURI(): string
                      • Gets the URI of the default graph

                        -

                        Returns string

                      Methods

                      • Transform a collection of NTriple URIs into their URI strings

                        +

                        Returns string

                      Methods

                      • Transform a collection of NTriple URIs into their URI strings

                        Parameters

                        • t: any

                          Some iterable collection of NTriple URI strings

                        Returns {}

                        A collection of the URIs as strings todo: explain why it is important to go through NT

                        -
                        • Adds a triple (quad) to the store.

                          +
                          • Adds a triple (quad) to the store.

                            Parameters

                            • subj: Quad_Subject | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[] | Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                              The thing about which the fact a relationship is asserted. Also accepts a statement or an array of Statements.

                            • Optional pred: Quad_Predicate

                              The relationship which is asserted

                            • Optional obj: string | Term

                              The object of the relationship, e.g. another thing or a value. If passed a string, this will become a literal.

                            • Optional why: Quad_Graph

                              The document in which the triple (S,P,O) was or will be stored on the web

                            Returns null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Store

                            The statement added to the store, or the store

                            -
                          • Adds all the statements to this formula

                            +
                          • Adds all the statements to this formula

                            Parameters

                            • statements: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                              A collection of statements

                              -

                            Returns void

                          • Add a callback which will be triggered after a statement has been added to the store.

                            -

                            Parameters

                            • cb: ((q) => void)
                                • (q): void
                                • Parameters

                                  • q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                  Returns void

                            Returns void

                          • Parameters

                            • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                            Returns number

                            Deprecated

                            Use {add} instead

                            -
                          • Return all equivalent URIs by which this is known

                            +

                          Returns void

                          • Add a callback which will be triggered after a statement has been added to the store.

                            +

                            Parameters

                            • cb: ((q) => void)
                                • (q): void
                                • Parameters

                                  • q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                  Returns void

                            Returns void

                          • Parameters

                            • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                            Returns number

                            Deprecated

                            Use {add} instead

                            +
                          • Return all equivalent URIs by which this is known

                            Parameters

                            Returns NamedNode[]

                          • Follow link from one node, using one wildcard, looking for one

                            +

                          Returns NamedNode[]

                          • Follow link from one node, using one wildcard, looking for one

                            For example, any(me, knows, null, profile) - a person I know accoring to my profile . any(me, knows, null, null) - a person I know accoring to anything in store . any(null, knows, me, null) - a person who know me accoring to anything in store .

                            @@ -160,51 +160,51 @@
                          • Optional o: null | Quad_Object

                            A node to search for as object, or if null, a wildcard

                          • Optional g: null | Quad_Graph

                            A node to search for as graph, or if null, a wildcard

                          Returns null | Node

                          A node which match the wildcard position, or null

                          -
                          • Gets the first JavaScript object equivalent to a node based on the specified pattern

                            +
                          • Gets the first JavaScript object equivalent to a node based on the specified pattern

                            Parameters

                            • Optional s: null | Quad_Subject

                              The subject

                            • Optional p: null | Quad_Predicate

                              The predicate

                            • Optional o: null | Quad_Object

                              The object

                            • Optional g: null | Quad_Graph

                              The graph that contains the statement

                              -

                            Returns any

                          • Gets the first statement that matches the specified pattern

                            -

                            Parameters

                            • Optional s: null | Quad_Subject
                            • Optional p: null | Quad_Predicate
                            • Optional o: null | Quad_Object
                            • Optional g: null | Quad_Graph

                            Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

                          • Gets the value of a node that matches the specified pattern

                            +

                          Returns any

                          • Gets the first statement that matches the specified pattern

                            +

                            Parameters

                            • Optional s: null | Quad_Subject
                            • Optional p: null | Quad_Predicate
                            • Optional o: null | Quad_Object
                            • Optional g: null | Quad_Graph

                            Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

                          • Gets the value of a node that matches the specified pattern

                            Parameters

                            • Optional s: null | Quad_Subject

                              The subject

                            • Optional p: null | Quad_Predicate

                              The predicate

                            • Optional o: null | Quad_Object

                              The object

                            • Optional g: null | Quad_Graph

                              The graph that contains the statement

                              -

                            Returns string | void

                          • Apply a set of statements to be deleted and to be inserted

                            -

                            Parameters

                            • patch: {
                                  delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                                  patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                                  where?: any;
                              }

                              The set of statements to be deleted and to be inserted

                              -
                              • Optional delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                              • Optional patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                              • Optional where?: any
                            • target: NamedNode

                              The name of the document to patch

                              +

                            Returns string | void

                          • Apply a set of statements to be deleted and to be inserted

                            +

                            Parameters

                            • patch: {
                                  delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                                  patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[];
                                  where?: any;
                              }

                              The set of statements to be deleted and to be inserted

                              +
                              • Optional delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                              • Optional patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                              • Optional where?: any
                            • target: NamedNode

                              The name of the document to patch

                            • patchCallback: ((errorString?) => void)

                              Callback to be called when patching is complete

                              -
                                • (errorString?): void
                                • Parameters

                                  • Optional errorString: string

                                  Returns void

                            Returns void

                          • Shortcut for adding blankNodes

                            -

                            Parameters

                            • Optional id: string

                            Returns BlankNode

                          • Finds the types in the list which have no stored subtypes +

                              • (errorString?): void
                              • Parameters

                                • Optional errorString: string

                                Returns void

                          Returns void

                          • Shortcut for adding blankNodes

                            +

                            Parameters

                            • Optional id: string

                            Returns BlankNode

                          • Finds the types in the list which have no stored subtypes These are a set of classes which provide by themselves complete information -- the other classes are redundant for those who know the class DAG.

                            Parameters

                            • types: any

                              A map of the types

                              -

                            Returns any

                          • Returns the symbol with canonical URI as smushed

                            +

                          Returns any

                          • Returns the symbol with canonical URI as smushed

                            Parameters

                            • Optional term: Term

                              An RDF node

                              -

                            Returns Node

                          • Checks this formula for consistency

                            -

                            Returns void

                          • Checks a list of statements for consistency

                            -

                            Parameters

                            • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                              The list of statements to check

                              +

                            Returns Node

                          • Checks this formula for consistency

                            +

                            Returns void

                          • Checks a list of statements for consistency

                            +

                            Parameters

                            • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                              The list of statements to check

                            • Optional from: number

                              An index with the array ['subject', 'predicate', 'object', 'why']

                              -

                            Returns boolean | void

                          • Closes this formula (and return it)

                            -

                            Returns Store

                          • Compares this node with another

                            +

                          Returns boolean | void

                          • Closes this formula (and return it)

                            +

                            Returns Store

                          • Compares this node with another

                            Parameters

                            • other: Node

                              The other node

                            Returns number

                            See

                            to check if two nodes are equal

                            -
                          • Parameters

                            • u1: Term
                            • u2: Term

                            Returns number

                          • Trace statements which connect directly, or through bnodes

                            +
                          • Parameters

                            • u1: Term
                            • u2: Term

                            Returns number

                          • Trace statements which connect directly, or through bnodes

                            Parameters

                            • subject: Quad_Subject

                              The node to start looking for statments

                            • doc: Quad_Graph

                              The document to be searched, or null to search all documents

                              -
                            • Optional excludePredicateURIs: readonly string[]

                            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                            an array of statements, duplicate statements are suppresssed.

                            -
                          • replaces

                            +
                          • Optional excludePredicateURIs: readonly string[]

                          Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                          an array of statements, duplicate statements are suppresssed.

                          +
                          • replaces

                            Parameters

                            • template: Quad_Subject

                              node to copy

                            • target: Quad_Subject

                              node to copy to

                            • Optional flags: ("two-direction" | "delete")[]

                              Whether or not to do a two-directional copy and/or delete triples

                            Returns void

                            Target

                            and add appropriate triples removes no triples by default and is a one-direction replication

                            -
                          • N3 allows for declaring blank nodes, this function enables that support

                            +
                          • N3 allows for declaring blank nodes, this function enables that support

                            Parameters

                            • x: BlankNode

                              The blank node to be declared, supported in N3

                              -

                            Returns BlankNode

                          • Follow links from one node, using one wildcard.

                            +

                          Returns BlankNode

                          • Follow links from one node, using one wildcard.

                            For example, each(me, knows, null, profile) - people I know accoring to my profile . each(me, knows, null, null) - people I know accoring to anything in store . each(null, knows, me, null) - people who know me accoring to anything in store .

                            @@ -215,38 +215,38 @@

                          Returns Node[]

                          • An array of nodes which match the wildcard position
                          -
                          • Test whether this formula is equals to {other}

                            +
                          • Test whether this formula is equals to {other}

                            Parameters

                            Returns boolean

                          • Simplify graph in store when we realize two identifiers are equivalent +

                          Returns boolean

                          • Simplify graph in store when we realize two identifiers are equivalent We replace the bigger with the smaller.

                            Parameters

                            • u1in: Term

                              The first node

                            • u2in: Term

                              The second node

                              -

                            Returns boolean

                          • For thisClass or any subclass, anything which has it is its type +

                          Returns boolean

                          • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

                            Parameters

                            • subject: Node

                              A named node

                              -

                            Returns UriMap

                          • For thisClass or any subclass, anything which has it is its type +

                          Returns UriMap

                          • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

                            Parameters

                            • thisClass: any

                            Returns MembersMap

                            a hash of URIs

                            -
                          • Get all the Classes of which we can RDFS-infer the subject is a superclass +

                          • Get all the Classes of which we can RDFS-infer the subject is a superclass Returns a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                            -

                            Parameters

                            Returns {
                                [uri: string]: boolean;
                            }

                            • [uri: string]: boolean
                          • Get all the Classes of which we can RDFS-infer the subject is a subclass

                            +

                            Parameters

                            Returns {
                                [uri: string]: boolean;
                            }

                            • [uri: string]: boolean
                          • Get all the Classes of which we can RDFS-infer the subject is a subclass

                            Parameters

                            • subject: Node

                              The thing whose classes are to be found

                            Returns {
                                [uri: string]: boolean;
                            }

                            a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                            -
                            • [uri: string]: boolean
                          • Get all the Classes of which we can RDFS-infer the subject is a member +

                            • [uri: string]: boolean
                          • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal) Returns a hash table where key is NT of type and value is statement why we @@ -254,91 +254,91 @@ Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                            Parameters

                            • subject: Quad_Subject

                              A subject node

                              -

                            Returns UriMap

                          • Get all the Classes of which we can RDFS-infer the subject is a member +

                          Returns UriMap

                          • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal)

                            Parameters

                            • subject: any

                              The thing whose classes are to be found

                            Returns {
                                [uri: string]: boolean;
                            }

                            a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

                            -
                            • [uri: string]: boolean
                          • Creates a new empty indexed formula +

                            • [uri: string]: boolean
                          • Creates a new empty indexed formula Only applicable for IndexedFormula, but TypeScript won't allow a subclass to override a property

                            Parameters

                            • features: FeaturesType

                              The list of features

                              -

                            Returns Store

                          • Transforms an NTriples string format into a Node. +

                          Returns Store

                          • Transforms an NTriples string format into a Node. The blank node bit should not be used on program-external values; designed for internal work such as storing a blank node id in an HTML attribute. This will only parse the strings generated by the various toNT() methods.

                            -

                            Parameters

                            • str: any

                            Returns any

                          • Creates a hash for this node

                            +

                            Parameters

                            • str: any

                            Returns any

                          • Creates a hash for this node

                            Returns string

                            Deprecated

                            use {rdfFactory.id} instead if possible

                            -
                          • Returns true if this formula holds the specified statement(s)

                            -

                            Parameters

                            • s: any
                            • Optional p: any
                            • Optional o: any
                            • Optional g: any

                            Returns boolean

                          • Returns true if this formula holds the specified {statement}

                            -

                            Parameters

                            • statement: any

                            Returns boolean

                          • Returns a unique index-safe identifier for the given term.

                            +
                          • Returns true if this formula holds the specified statement(s)

                            +

                            Parameters

                            • s: any
                            • Optional p: any
                            • Optional o: any
                            • Optional g: any

                            Returns boolean

                          • Returns true if this formula holds the specified {statement}

                            +

                            Parameters

                            • statement: any

                            Returns boolean

                          • Returns a unique index-safe identifier for the given term.

                            Falls back to the rdflib hashString implementation if the given factory doesn't support id.

                            -

                            Parameters

                            • term: TFIDFactoryTypes

                            Returns Indexable

                          • Parameters

                            • features: FeaturesType

                            Returns void

                          • Used by the n3parser to generate list elements

                            +

                            Parameters

                            • term: TFIDFactoryTypes

                            Returns Indexable

                          • Parameters

                            • features: FeaturesType

                            Returns void

                          • Used by the n3parser to generate list elements

                            Parameters

                            • values: any

                              The values of the collection

                            • context: any

                              The store

                            Returns any

                            • The term for the statement
                            -
                          • Returns any quads matching the given arguments. +

                          • Returns any quads matching the given arguments. Standard RDFJS spec method for Source objects, implemented as an alias to statementsMatching()

                            Parameters

                            • Optional subject: null | Quad_Subject

                              The subject

                            • Optional predicate: null | Quad_Predicate

                              The predicate

                            • Optional object: null | Quad_Object

                              The object

                            • Optional graph: null | Quad_Graph

                              The graph that contains the statement

                              -

                            Returns Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                          • Find out whether a given URI is used as symbol in the formula

                            +

                          Returns Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                          • Find out whether a given URI is used as symbol in the formula

                            Parameters

                            • uri: string

                              The URI to look for

                              -

                            Returns boolean

                          • Existentials are BNodes - something exists without naming

                            +

                          Returns boolean

                          • Existentials are BNodes - something exists without naming

                            Parameters

                            • uri: string

                              An URI

                              -

                            Returns Term

                          • Adds a new property action

                            +

                          Returns Term

                          • Adds a new property action

                            Parameters

                            • pred: Quad_Predicate

                              the predicate that the function should be triggered on

                            • action: ((store, subject, predicate, object) => boolean)

                              the function that should trigger

                              -
                                • (store, subject, predicate, object): boolean
                                • Parameters

                                  • store: Store
                                  • subject: Quad_Subject
                                  • predicate: Quad_Predicate
                                  • object: Quad_Object

                                  Returns boolean

                            Returns boolean

                          • Creates a new universal node +

                              • (store, subject, predicate, object): boolean
                              • Parameters

                                • store: Store
                                • subject: Quad_Subject
                                • predicate: Quad_Predicate
                                • object: Quad_Object

                                Returns boolean

                          Returns boolean

                          • Creates a new universal node Universals are Variables

                            Parameters

                            • uri: string

                              An URI

                              -

                            Returns NamedNode

                          • Find an unused id for a file being edited: return a symbol +

                          Returns NamedNode

                          • Find an unused id for a file being edited: return a symbol (Note: Slow iff a lot of them -- could be O(log(k)) )

                            Parameters

                            • doc: NamedNode

                              A document named node

                              -

                            Returns NamedNode

                          • Query this store asynchronously, return bindings in callback

                            +

                          Returns NamedNode

                          • Query this store asynchronously, return bindings in callback

                            Parameters

                            • myQuery: Query

                              The query to be run

                            • callback: ((bindings) => void)

                              Function to call when bindings

                                • (bindings): void
                                • Parameters

                                  • bindings: Bindings

                                  Returns void

                            • Optional fetcher: null | Fetcher
                            • Optional onDone: (() => void)

                              OBSOLETE - do not use this // @@ Why not ?? Called when query complete

                              -
                                • (): void
                                • Returns void

                            Returns void

                          • Query this store synchronously and return bindings

                            +
                              • (): void
                              • Returns void

                          Returns void

                          • Query this store synchronously and return bindings

                            Parameters

                            • myQuery: Query

                              The query to be run

                              -

                            Returns any[]

                          • Removes one or multiple statement(s) from this formula

                            +

                          Returns any[]

                          • Removes one or multiple statement(s) from this formula

                            Parameters

                            • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                              A Statement or array of Statements to remove

                              -

                            Returns Store

                          • Removes all statements in a doc, along with the related metadata including request/response

                            +

                          Returns Store

                          • Removes all statements in a doc, along with the related metadata including request/response

                            Parameters

                            • doc: Quad_Graph

                              The document / graph

                              -

                            Returns Store

                          • Remove all statements matching args (within limit) *

                            +

                          Returns Store

                          • Remove all statements matching args (within limit) *

                            Parameters

                            • Optional subj: null | Quad_Subject

                              The subject

                            • Optional pred: null | Quad_Predicate

                              The predicate

                            • Optional obj: null | Quad_Object

                              The object

                            • Optional why: null | Quad_Graph

                              The graph that contains the statement

                            • Optional limit: number

                              The number of statements to remove

                              -

                            Returns void

                          • Remove all matching statements

                            +

                          Returns void

                          • Remove all matching statements

                            Parameters

                            • Optional subject: null | Quad_Subject

                              The subject

                            • Optional predicate: null | Quad_Predicate

                              The predicate

                            • Optional object: null | Quad_Object

                              The object

                            • Optional graph: null | Quad_Graph

                              The graph that contains the statement

                              -

                            Returns Store

                          • Remove a particular statement object from the store

                            +

                          Returns Store

                          • Remove a particular statement object from the store

                            Parameters

                            • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                              a statement which is already in the store and indexed. Make sure you only use this for these. Otherwise, you should use remove() above.

                              -

                            Returns Store

                          • Removes statements

                            -

                            Parameters

                            • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                              The statements to remove

                              -

                            Returns Store

                          • Replace big with small, obsoleted with obsoleting.

                            -

                            Parameters

                            • big: Quad_Subject
                            • small: Quad_Subject

                            Returns boolean

                          • Compares whether this node is the same as the other one

                            +

                          Returns Store

                          • Removes statements

                            +

                            Parameters

                            • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                              The statements to remove

                              +

                            Returns Store

                          • Replace big with small, obsoleted with obsoleting.

                            +

                            Parameters

                            • big: Quad_Subject
                            • small: Quad_Subject

                            Returns boolean

                          • Compares whether this node is the same as the other one

                            Parameters

                            • other: Node

                              Another node

                              -

                            Returns boolean

                          • Compare by canonical URI as smushed

                            +

                          Returns boolean

                          • Compare by canonical URI as smushed

                            Parameters

                            Returns boolean

                          • Serializes this formula

                            +

                          Returns boolean

                          • Serializes this formula

                            Parameters

                            • base: any

                              The base string

                            • contentType: any

                              The content type of the syntax to use

                            • provenance: any

                              The provenance URI

                            • Optional options: any

                              options to pass to the serializer, as defined in serialize method

                              -

                            Returns undefined | string

                          • Parameters

                            • prefix: string
                            • nsuri: string

                            Returns void

                          • Search the Store

                            +

                          Returns undefined | string

                          • Parameters

                            • prefix: string
                            • nsuri: string

                            Returns void

                          • Search the Store

                            ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!

                            Parameters

                            • Optional subj: null | Quad_Subject

                              A node to search for as subject, or if null, a wildcard

                            • Optional pred: null | Quad_Predicate

                              A node to search for as predicate, or if null, a wildcard

                              @@ -346,33 +346,33 @@
                            • Optional why: null | Quad_Graph

                              A node to search for as graph, or if null, a wildcard

                            • Optional justOne: boolean

                              flag - stop when found one rather than get all of them?

                            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                            An array of nodes which match the wildcard position

                            -
                          • Gets this graph with the bindings substituted

                            +
                          • Gets this graph with the bindings substituted

                            Type Parameters

                            Parameters

                            • bindings: Bindings

                              The bindings

                              -

                            Returns T

                          • Parameters

                            • uri: string
                            • Optional name: any

                            Returns NamedNode

                          • Gets the node matching the specified pattern. Throws when no match could be made.

                            +

                          Returns T

                          • Parameters

                            • uri: string
                            • Optional name: any

                            Returns NamedNode

                          • Gets the node matching the specified pattern. Throws when no match could be made.

                            Parameters

                            • Optional s: null | Quad_Subject

                              The subject

                            • Optional p: null | Quad_Predicate

                              The predicate

                            • Optional o: null | Quad_Object

                              The object

                            • Optional g: null | Quad_Graph

                              The graph that contains the statement

                              -

                            Returns undefined | null | Node

                          • Creates a canonical string representation of this node

                            -

                            Returns string

                          • Creates a n-quads string representation of this node

                            -

                            Returns string

                          • Creates a n-triples string representation of this node

                            -

                            Returns string

                          • Serializes this formula to a string

                            -

                            Returns string

                          • Finds the types in the list which have no stored supertypes +

                          Returns undefined | null | Node

                          • Creates a canonical string representation of this node

                            +

                            Returns string

                          • Creates a n-quads string representation of this node

                            +

                            Returns string

                          • Creates a n-triples string representation of this node

                            +

                            Returns string

                          • Serializes this formula to a string

                            +

                            Returns string

                          • Finds the types in the list which have no stored supertypes We exclude the universal class, owl:Things and rdf:Resource, as it is information-free.

                            Parameters

                            • types: {
                                  [id: string]: string | NamedNode;
                              }

                              The types

                              -

                            Returns {
                                [id: string]: string | NamedNode;
                            }

                          • RDFS Inference +

                          Returns {
                              [id: string]: string | NamedNode;
                          }

                          • RDFS Inference These are hand-written implementations of a backward-chaining reasoner over the RDFS axioms.

                            Parameters

                            • seeds: BooleanMap

                              A hash of NTs of classes to start with

                            • predicate: Quad_Predicate

                              The property to trace though

                            • Optional inverse: boolean

                              Trace inverse direction

                              -

                            Returns {
                                [uri: string]: boolean;
                            }

                            • [uri: string]: boolean
                          • A list of all the URIs by which this thing is known

                            -

                            Parameters

                            • term: Quad_Subject

                            Returns string[]

                          • Gets a new variable

                            +

                          Returns {
                              [uri: string]: boolean;
                          }

                          • [uri: string]: boolean
                          • A list of all the URIs by which this thing is known

                            +

                            Parameters

                            • term: Quad_Subject

                            Returns string[]

                          • Gets a new variable

                            Parameters

                            • name: string

                              The variable's name

                              -

                            Returns Variable

                          • Gets the number of statements in this formula that matches the specified pattern

                            +

                          Returns Variable

                          • Gets the number of statements in this formula that matches the specified pattern

                            Parameters

                            • Optional s: null | Quad_Subject

                              The subject

                            • Optional p: null | Quad_Predicate

                              The predicate

                            • Optional o: null | Quad_Object

                              The object

                            • Optional g: null | Quad_Graph

                              The graph that contains the statement

                              -

                            Returns number

                          Generated using TypeDoc

                          \ No newline at end of file +

                          Returns number

                          Generated using TypeDoc

                          \ No newline at end of file diff --git a/Documentation/api/classes/rdf.UpdateManager.html b/Documentation/api/classes/rdf.UpdateManager.html index 0110f088..99e466df 100644 --- a/Documentation/api/classes/rdf.UpdateManager.html +++ b/Documentation/api/classes/rdf.UpdateManager.html @@ -2,7 +2,7 @@ Just as a Fetcher provides the store with the ability to read and write, the Update Manager provides functionality for making small patches in real time, and also looking out for concurrent updates from other agents

                          -

                          Hierarchy

                          Constructors

                          Constructors

                          • Parameters

                            • Optional store: Store

                              The quadstore to store data and metadata. Created if not passed.

                              +

                          Constructors

                          • Parameters

                            • Optional store: Store

                              The quadstore to store data and metadata. Created if not passed.

                            Returns UpdateManager

                          Properties

                          fps: {}

                          Type declaration

                            ifps: {}

                            Type declaration

                              ns: any

                              Object of namespaces

                              patchControl: []

                              Index of objects for coordinating incoming and outgoing patches

                              -
                              store: UpdateManagerFormula

                              Methods

                              • Parameters

                                • doc: NamedNode
                                • listener: any

                                Returns void

                              • Parameters

                                • obj: any

                                Returns any

                              • Parameters

                                • stmt: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                Returns string

                              • Private

                                Parameters

                                • bnodes: any
                                • doc: any

                                Returns never[]

                              • Private

                                Returns the smallest context to bind a given single bnode

                                -

                                Parameters

                                • x: any
                                • source: any

                                Returns any

                              • Private

                                Returns a context to bind a given node, up to a given depth

                                -

                                Parameters

                                • x: any
                                • source: any
                                • depth: any

                                Returns any

                              • Private

                                Makes a cached list of [Inverse-]Functional properties

                                -

                                Returns void

                              • Tests whether a file is editable. +

                              store: UpdateManagerFormula

                              Methods

                              • Parameters

                                • doc: NamedNode
                                • listener: any

                                Returns void

                              • Parameters

                                • obj: any

                                Returns any

                              • Parameters

                                • stmt: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                Returns string

                              • Private

                                Parameters

                                • bnodes: any
                                • doc: any

                                Returns never[]

                              • Private

                                Returns the smallest context to bind a given single bnode

                                +

                                Parameters

                                • x: any
                                • source: any

                                Returns any

                              • Private

                                Returns a context to bind a given node, up to a given depth

                                +

                                Parameters

                                • x: any
                                • source: any
                                • depth: any

                                Returns any

                              • Private

                                Makes a cached list of [Inverse-]Functional properties

                                +

                                Returns void

                              • Tests whether a file is editable. If the file has a specific annotation that it is machine written, for safety, it is editable (this doesn't actually check for write access) If the file has wac-allow and accept patch headers, those are respected. and local write access is determined by those headers. This async version not only looks at past HTTP requests, it also makes new ones if necessary.

                                -

                                Parameters

                                • uri: string | NamedNode
                                • Optional kb: Store

                                Returns Promise<undefined | string | boolean>

                                The method string SPARQL or DAV or +

                                Parameters

                                • uri: string | NamedNode
                                • Optional kb: Store

                                Returns Promise<undefined | string | boolean>

                                The method string N3PATCH or SPARQL or DAV or LOCALFILE or false if known, undefined if not known.

                                -
                              • We want to start counting websocket notifications +

                              • We want to start counting websocket notifications to distinguish the ones from others from our own.

                                -

                                Parameters

                                • doc: NamedNode

                                Returns void

                              • Private

                                Parameters

                                • context: any

                                Returns string

                              • Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]
                                • callbackFunction: CallBackFunction

                                Returns void

                              • Tests whether a file is editable. +

                                Parameters

                                • doc: NamedNode

                                Returns void

                              • Private

                                This helper function constructs n3-patch query from resolved arguments.

                                +

                                Parameters

                                • ds: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                                • is: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                                • bnodes_context: any

                                Returns string

                              • Private

                                This helper function constructs SPARQL Update query from resolved arguments.

                                +

                                Parameters

                                • ds: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                                • is: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
                                • bnodes_context: any

                                Returns string

                              • Private

                                Parameters

                                • context: any

                                Returns string

                              • Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]
                                • callbackFunction: CallBackFunction

                                Returns void

                              • Tests whether a file is editable. If the file has a specific annotation that it is machine written, for safety, it is editable (this doesn't actually check for write access) If the file has wac-allow and accept patch headers, those are respected. @@ -66,24 +70,24 @@ This synchronous version only looks at past HTTP requests, does not make new ones.

                                Parameters

                                • uri: string | NamedNode
                                • Optional kb: Store

                                Returns undefined | string | boolean

                                The method string SPARQL or DAV or LOCALFILE or false if known, undefined if not known.

                                -
                              • Private

                                Parameters

                                • uri: string
                                • query: string
                                • callbackFunction: CallBackFunction
                                • Optional options: Partial<AutoInitOptions>

                                Returns Promise<void>

                              • Remove from the store HTTP authorization metadata -The editble function below relies on copies we have in the store -of the results of previous HTTP transactions. Howver, when +

                              • Private

                                Parameters

                                • uri: string
                                • query: string
                                • callbackFunction: CallBackFunction
                                • Optional options: Partial<AutoInitOptions>

                                Returns Promise<void>

                              • Remove from the store HTTP authorization metadata +The editable function below relies on copies we have in the store +of the results of previous HTTP transactions. However, when the user logs in, then that data misrepresents what would happen if the user tried again.

                                -

                                Parameters

                                Returns void

                              • Parameters

                                • doc: NamedNode

                                Returns null | string

                              • Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>
                                • callbackFunction: CallBackFunction

                                Returns void

                              • Parameters

                                • uri: string

                                Returns boolean

                              • Private

                                Parameters

                                • x: any

                                Returns boolean

                              • Parameters

                                • stmt: any

                                Returns string

                              • Parameters

                                • doc: NamedNode

                                Returns any

                              • This is suitable for an initial creation of a document.

                                -

                                Parameters

                                • doc: NamedNode
                                • data: string | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]
                                • contentType: string
                                • callback: ((uri, ok, errorMessage?, response?) => void)
                                    • (uri, ok, errorMessage?, response?): void
                                    • Parameters

                                      • uri: string
                                      • ok: boolean
                                      • Optional errorMessage: string
                                      • Optional response: unknown

                                      Returns void

                                Returns Promise<void>

                              • Reloads a document.

                                +

                                Parameters

                                Returns void

                              • Parameters

                                • doc: NamedNode

                                Returns null | string

                              • Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>
                                • callbackFunction: CallBackFunction

                                Returns void

                              • Parameters

                                • uri: string

                                Returns boolean

                              • Private

                                Parameters

                                • x: any

                                Returns boolean

                              • Parameters

                                • stmt: any

                                Returns string

                              • Parameters

                                • doc: NamedNode

                                Returns any

                              • This is suitable for an initial creation of a document.

                                +

                                Parameters

                                • doc: NamedNode
                                • data: string | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]
                                • contentType: string
                                • callback: ((uri, ok, errorMessage?, response?) => void)
                                    • (uri, ok, errorMessage?, response?): void
                                    • Parameters

                                      • uri: string
                                      • ok: boolean
                                      • Optional errorMessage: string
                                      • Optional response: unknown

                                      Returns void

                                Returns Promise<void>

                              • Reloads a document.

                                Fast and cheap, no metadata. Measure times for the document. Load it provisionally. Don't delete the statements before the load, or it will leave a broken document in the meantime.

                                Parameters

                                • kb: Store
                                • doc: docReloadType

                                  {RDFlibNamedNode}

                                  -
                                • callbackFunction: ((ok, message?, response?) => void | {})
                                    • (ok, message?, response?): void | {}
                                    • Parameters

                                      • ok: boolean
                                      • Optional message: string
                                      • Optional response: Error | Response

                                      Returns void | {}

                                Returns void

                              • Parameters

                                • doc: NamedNode

                                Returns void

                              • Requests a now or future action to refresh changes coming downstream +

                              • callbackFunction: ((ok, message?, response?) => void | {})
                                  • (ok, message?, response?): void | {}
                                  • Parameters

                                    • ok: boolean
                                    • Optional message: string
                                    • Optional response: Error | Response

                                    Returns void | {}

                              Returns void

                              • Parameters

                                • doc: NamedNode

                                Returns void

                              • Requests a now or future action to refresh changes coming downstream This is designed to allow the system to re-request the server version, when a websocket has pinged to say there are changes. If the websocket, by contrast, has sent a patch, then this may not be necessary.

                                -

                                Parameters

                                • doc: NamedNode
                                • action: any

                                Returns void

                              • Parameters

                                • uri: string
                                • data: string | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]
                                • contentType: string

                                Returns string

                                Throws

                                On unsupported content type

                                -
                              • Sets up websocket to listen on

                                +

                                Parameters

                                • doc: NamedNode
                                • action: any

                                Returns void

                              • Parameters

                                • uri: string
                                • data: string | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]
                                • contentType: string

                                Returns string

                                Throws

                                On unsupported content type

                                +
                              • Sets up websocket to listen on

                                There is coordination between upstream changes and downstream ones so that a reload is not done in the middle of an upstream patch. If you use this API then you get called when a change happens, and you @@ -91,27 +95,27 @@ Alternative is addDownstreamChangeListener(), where you do not have to do the reload yourself. Do mot mix them.

                                kb contains the HTTP metadata from previous operations

                                -

                                Parameters

                                • doc: NamedNode
                                • handler: any

                                Returns boolean

                              • Private

                                Returns a list of all bnodes occurring in a list of statements

                                -

                                Parameters

                                • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                                Returns BlankNode[]

                              • Private

                                Returns a list of all bnodes occurring in a statement

                                -

                                Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                Returns BlankNode[]

                              • Private

                                Returns the best context for a single statement

                                -

                                Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                Returns never[]

                              • This high-level function updates the local store iff the web is changed successfully. +

                                Parameters

                                • doc: NamedNode
                                • handler: any

                                Returns boolean

                              • Private

                                Returns a list of all bnodes occurring in a list of statements

                                +

                                Parameters

                                • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

                                Returns BlankNode[]

                              • Private

                                Returns a list of all bnodes occurring in a statement

                                +

                                Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                Returns BlankNode[]

                              • Private

                                Returns the best context for a single statement

                                +

                                Parameters

                                • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                Returns never[]

                              • This high-level function updates the local store if the web is changed successfully. Deletions, insertions may be undefined or single statements or lists or formulae (may contain bnodes which can be indirectly identified by a where clause). The why property of each statement must be the same and give the web document to be updated.

                                -

                                Parameters

                                • deletions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                  Statement or statements to be deleted.

                                  -
                                • insertions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                  Statement or statements to be inserted.

                                  +

                                  Parameters

                                  • deletions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                    Statement or statements to be deleted.

                                    +
                                  • insertions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                    Statement or statements to be inserted.

                                  • Optional callback: ((uri, success, errorBody?, response?) => void)

                                    called as callbackFunction(uri, success, errorbody) OR returns a promise

                                      • (uri, success, errorBody?, response?): void
                                      • Parameters

                                        • uri: undefined | null | string
                                        • success: boolean
                                        • Optional errorBody: string
                                        • Optional response: Error | Response

                                        Returns void

                                  • Optional secondTry: boolean
                                  • Optional options: Partial<AutoInitOptions>

                                    Options for the fetch call

                                    -

                                  Returns void | Promise<void>

                              • Parameters

                                • doc: Quad_Subject
                                • ds: any
                                • is: any
                                • callbackFunction: any
                                • Optional options: Partial<AutoInitOptions>

                                Returns null | Promise<void>

                              • Likely deprecated, since this lib no longer deals with browser extension

                                -

                                Parameters

                                • doc: NamedNode
                                • ds: any
                                • is: any
                                • callbackFunction: any
                                • Optional options: Partial<AutoInitOptions>

                                Returns void

                              • This high-level function updates the local store iff the web is changed successfully. +

                              Returns void | Promise<void>

                              • Parameters

                                • doc: Quad_Subject
                                • ds: any
                                • is: any
                                • callbackFunction: any
                                • Optional options: Partial<AutoInitOptions>

                                Returns null | Promise<void>

                              • Likely deprecated, since this lib no longer deals with browser extension

                                +

                                Parameters

                                • doc: NamedNode
                                • ds: any
                                • is: any
                                • callbackFunction: any
                                • Optional options: Partial<AutoInitOptions>

                                Returns void

                              • This high-level function updates the local store iff the web is changed successfully. Deletions, insertions may be undefined or single statements or lists or formulae (may contain bnodes which can be indirectly identified by a where clause). The why property of each statement must be the give the web document to be updated. The statements to be deleted and inserted may span more than one web document.

                                -

                                Parameters

                                • deletions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                  Statement or statements to be deleted.

                                  -
                                • Optional insertions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                  Statement or statements to be inserted.

                                  +

                                  Parameters

                                  • deletions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                    Statement or statements to be deleted.

                                    +
                                  • Optional insertions: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

                                    Statement or statements to be inserted.

                                  Returns Promise<void[]>

                                  a promise

                                  -
                              • return a statemnet updating function

                                +
                              • return a statemnet updating function

                                This does NOT update the statement. It returns an object which includes function which can be used to change the object of the statement.

                                -

                                Parameters

                                • statement: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

                                Returns undefined | {
                                    set_object: ((obj, callbackFunction) => void);
                                    statement: undefined | Term[];
                                    statementNT: undefined | string;
                                    where: string;
                                }

                              Generated using TypeDoc

                              \ No newline at end of file +

                              Parameters

                              Returns undefined | {
                                  set_object: ((obj, callbackFunction) => void);
                                  statement: undefined | Term[];
                                  statementNT: undefined | string;
                                  where: string;
                              }

                              Generated using TypeDoc

                              \ No newline at end of file diff --git a/Documentation/api/classes/rdf.UpdatesSocket.html b/Documentation/api/classes/rdf.UpdatesSocket.html index 60c1edf9..fe328c49 100644 --- a/Documentation/api/classes/rdf.UpdatesSocket.html +++ b/Documentation/api/classes/rdf.UpdatesSocket.html @@ -1,4 +1,4 @@ -UpdatesSocket | solid-ui

                              Class UpdatesSocket

                              Hierarchy

                              • UpdatesSocket

                              Constructors

                              constructor +UpdatesSocket | solid-ui

                              Class UpdatesSocket

                              Constructors

                              Properties

                              Constructors

                              • Parameters

                                • parent: any
                                • via: any

                                Returns UpdatesSocket

                              Properties

                              connected: boolean
                              parent: any
                              pending: {}

                              Type declaration

                                socket: {}

                                Type declaration

                                  subscribed: {}

                                  Type declaration

                                    via: any

                                    Methods

                                    • Parameters

                                      • q: any

                                      Returns {}

                                      • Parameters

                                        • method: any
                                        • uri: any
                                        • data: any

                                        Returns any

                                      • Parameters

                                        • uri: any

                                        Returns any

                                      • Parameters

                                        • e: any

                                        Returns {}

                                        • Parameters

                                          • e: any

                                          Returns void

                                        • Parameters

                                          • e: any

                                          Returns any

                                        • Parameters

                                          • e: any

                                          Returns any[]

                                        • Parameters

                                          • uri: any

                                          Returns any

                                        Generated using TypeDoc

                                        \ No newline at end of file +

                                        Constructors

                                        • Parameters

                                          • parent: any
                                          • via: any

                                          Returns UpdatesSocket

                                        Properties

                                        connected: boolean
                                        parent: any
                                        pending: {}

                                        Type declaration

                                          socket: {}

                                          Type declaration

                                            subscribed: {}

                                            Type declaration

                                              via: any

                                              Methods

                                              • Parameters

                                                • q: any

                                                Returns {}

                                                • Parameters

                                                  • method: any
                                                  • uri: any
                                                  • data: any

                                                  Returns any

                                                • Parameters

                                                  • uri: any

                                                  Returns any

                                                • Parameters

                                                  • e: any

                                                  Returns {}

                                                  • Parameters

                                                    • e: any

                                                    Returns void

                                                  • Parameters

                                                    • e: any

                                                    Returns any

                                                  • Parameters

                                                    • e: any

                                                    Returns any[]

                                                  • Parameters

                                                    • uri: any

                                                    Returns any

                                                  Generated using TypeDoc

                                                  \ No newline at end of file diff --git a/Documentation/api/classes/rdf.UpdatesVia.html b/Documentation/api/classes/rdf.UpdatesVia.html index c89fd4db..ba980e34 100644 --- a/Documentation/api/classes/rdf.UpdatesVia.html +++ b/Documentation/api/classes/rdf.UpdatesVia.html @@ -1,8 +1,8 @@ -UpdatesVia | solid-ui

                                                  Class UpdatesVia

                                                  Hierarchy

                                                  • UpdatesVia

                                                  Constructors

                                                  constructor +UpdatesVia | solid-ui

                                                  Class UpdatesVia

                                                  Constructors

                                                  Properties

                                                  Methods

                                                  Constructors

                                                  • Parameters

                                                    • fetcher: any

                                                    Returns UpdatesVia

                                                  Properties

                                                  fetcher: any
                                                  graph: {}

                                                  Type declaration

                                                    via: {}

                                                    Type declaration

                                                      Methods

                                                      • Parameters

                                                        • d: any

                                                        Returns boolean

                                                      • Parameters

                                                        • uri: any
                                                        • d: any

                                                        Returns any

                                                      • Parameters

                                                        • via: any
                                                        • uri: any

                                                        Returns any

                                                      Generated using TypeDoc

                                                      \ No newline at end of file +

                                                      Constructors

                                                      • Parameters

                                                        • fetcher: any

                                                        Returns UpdatesVia

                                                      Properties

                                                      fetcher: any
                                                      graph: {}

                                                      Type declaration

                                                        via: {}

                                                        Type declaration

                                                          Methods

                                                          • Parameters

                                                            • d: any

                                                            Returns boolean

                                                          • Parameters

                                                            • uri: any
                                                            • d: any

                                                            Returns any

                                                          • Parameters

                                                            • via: any
                                                            • uri: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/classes/rdf.Variable.html b/Documentation/api/classes/rdf.Variable.html index f2f6f452..c50bfcc4 100644 --- a/Documentation/api/classes/rdf.Variable.html +++ b/Documentation/api/classes/rdf.Variable.html @@ -22,26 +22,26 @@ toNT toString toString -

                                                          Constructors

                                                          • Initializes this variable

                                                            +

                                                          Constructors

                                                          • Initializes this variable

                                                            Parameters

                                                            • Optional name: string

                                                              The variable's name

                                                            Returns Variable

                                                          Properties

                                                          base: string

                                                          The base string for a variable's name

                                                          classOrder: number

                                                          The class order for this node

                                                          isVar: number
                                                          termType: "Variable"

                                                          The type of node

                                                          uri: string

                                                          The unique identifier of this variable

                                                          value: string

                                                          The node's value

                                                          -
                                                          fromValue: (<T>(value) => T)

                                                          Type declaration

                                                            • <T>(value): T
                                                            • Type Parameters

                                                              • T extends FromValueReturns<any>

                                                              Parameters

                                                              • value: ValueType

                                                              Returns T

                                                          toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

                                                          Type declaration

                                                            • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
                                                            • Parameters

                                                              • term: any

                                                              Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

                                                          Methods

                                                          • Compares this node with another

                                                            +
                                                          fromValue: (<T>(value) => T)

                                                          Type declaration

                                                            • <T>(value): T
                                                            • Type Parameters

                                                              • T extends FromValueReturns<any>

                                                              Parameters

                                                              • value: ValueType

                                                              Returns T

                                                          toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

                                                          Type declaration

                                                            • (term): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
                                                            • Parameters

                                                              • term: any

                                                              Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

                                                          Methods

                                                          • Compares this node with another

                                                            Parameters

                                                            • other: Node

                                                              The other node

                                                            Returns number

                                                            See

                                                            to check if two nodes are equal

                                                            -
                                                          • Compares whether the two nodes are equal

                                                            +
                                                          • Compares whether the two nodes are equal

                                                            Parameters

                                                            • other: any

                                                              The other node

                                                              -

                                                            Returns boolean

                                                          • Creates a hash for this node

                                                            +

                                                          Returns boolean

                                                          • Creates a hash for this node

                                                            Returns string

                                                            Deprecated

                                                            use {rdfFactory.id} instead if possible

                                                            -
                                                          • Compares whether this node is the same as the other one

                                                            +
                                                          • Compares whether this node is the same as the other one

                                                            Parameters

                                                            • other: Node

                                                              Another node

                                                              -

                                                            Returns boolean

                                                          • Creates the substituted node for this one, according to the specified bindings

                                                            +

                                                          Returns boolean

                                                          • Creates the substituted node for this one, according to the specified bindings

                                                            Parameters

                                                            • bindings: any

                                                              Bindings of identifiers to nodes

                                                              -

                                                            Returns any

                                                          • Creates a canonical string representation of this node

                                                            -

                                                            Returns string

                                                          • Creates a n-quads string representation of this node

                                                            -

                                                            Returns string

                                                          • Creates a n-triples string representation of this node

                                                            -

                                                            Returns string

                                                          • Creates a string representation of this node

                                                            -

                                                            Returns string

                                                          • Parameters

                                                            • variable: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/classes/tabs.TabWidgetElement.html b/Documentation/api/classes/tabs.TabWidgetElement.html index 5f6f9034..6b1291c6 100644 --- a/Documentation/api/classes/tabs.TabWidgetElement.html +++ b/Documentation/api/classes/tabs.TabWidgetElement.html @@ -1,4 +1,4 @@ -TabWidgetElement | solid-ui

                                                          Class TabWidgetElement

                                                          Hierarchy

                                                          • HTMLElement
                                                            • TabWidgetElement

                                                          Constructors

                                                          constructor +TabWidgetElement | solid-ui

                                                          Class TabWidgetElement

                                                          Hierarchy

                                                          • HTMLElement
                                                            • TabWidgetElement

                                                          Constructors

                                                          Properties

                                                          ATTRIBUTE_NODE: number
                                                          CDATA_SECTION_NODE: number

                                                          node is a CDATASection node.

                                                          +

                                                          Constructors

                                                          Properties

                                                          ATTRIBUTE_NODE: number
                                                          CDATA_SECTION_NODE: number

                                                          node is a CDATASection node.

                                                          COMMENT_NODE: number

                                                          node is a Comment node.

                                                          DOCUMENT_FRAGMENT_NODE: number

                                                          node is a DocumentFragment node.

                                                          DOCUMENT_NODE: number

                                                          node is a document.

                                                          @@ -309,7 +309,7 @@
                                                          ENTITY_NODE: number
                                                          ENTITY_REFERENCE_NODE: number
                                                          NOTATION_NODE: number
                                                          PROCESSING_INSTRUCTION_NODE: number

                                                          node is a ProcessingInstruction node.

                                                          TEXT_NODE: number

                                                          node is a Text node.

                                                          accessKey: string
                                                          accessKeyLabel: string
                                                          ariaAtomic: null | string
                                                          ariaAutoComplete: null | string
                                                          ariaBusy: null | string
                                                          ariaChecked: null | string
                                                          ariaColCount: null | string
                                                          ariaColIndex: null | string
                                                          ariaColIndexText: null | string
                                                          ariaColSpan: null | string
                                                          ariaCurrent: null | string
                                                          ariaDisabled: null | string
                                                          ariaExpanded: null | string
                                                          ariaHasPopup: null | string
                                                          ariaHidden: null | string
                                                          ariaInvalid: null | string
                                                          ariaKeyShortcuts: null | string
                                                          ariaLabel: null | string
                                                          ariaLevel: null | string
                                                          ariaLive: null | string
                                                          ariaModal: null | string
                                                          ariaMultiLine: null | string
                                                          ariaMultiSelectable: null | string
                                                          ariaOrientation: null | string
                                                          ariaPlaceholder: null | string
                                                          ariaPosInSet: null | string
                                                          ariaPressed: null | string
                                                          ariaReadOnly: null | string
                                                          ariaRequired: null | string
                                                          ariaRoleDescription: null | string
                                                          ariaRowCount: null | string
                                                          ariaRowIndex: null | string
                                                          ariaRowIndexText: null | string
                                                          ariaRowSpan: null | string
                                                          ariaSelected: null | string
                                                          ariaSetSize: null | string
                                                          ariaSort: null | string
                                                          ariaValueMax: null | string
                                                          ariaValueMin: null | string
                                                          ariaValueNow: null | string
                                                          ariaValueText: null | string
                                                          assignedSlot: null | HTMLSlotElement
                                                          attributes: NamedNodeMap
                                                          autocapitalize: string
                                                          autofocus: boolean
                                                          baseURI: string

                                                          Returns node's node document's document base URL.

                                                          -
                                                          bodyContainer?: HTMLElement
                                                          childElementCount: number
                                                          childNodes: NodeListOf<ChildNode>

                                                          Returns the children.

                                                          +
                                                          bodyContainer?: HTMLElement
                                                          childElementCount: number
                                                          childNodes: NodeListOf<ChildNode>

                                                          Returns the children.

                                                          children: HTMLCollection

                                                          Returns the child elements.

                                                          classList: DOMTokenList

                                                          Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.

                                                          className: string

                                                          Returns the value of element's class content attribute. Can be set to change it.

                                                          @@ -326,95 +326,95 @@
                                                          nodeName: string

                                                          Returns a string appropriate for the type of node.

                                                          nodeType: number

                                                          Returns the type of node.

                                                          nodeValue: null | string
                                                          nonce?: string
                                                          offsetHeight: number
                                                          offsetLeft: number
                                                          offsetParent: null | Element
                                                          offsetTop: number
                                                          offsetWidth: number
                                                          onabort: null | ((this, ev) => any)

                                                          Fires when the user aborts the download.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: UIEvent

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: UIEvent

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onanimationcancel: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: AnimationEvent

                                                              Returns any

                                                          onanimationend: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: AnimationEvent

                                                              Returns any

                                                          onanimationiteration: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: AnimationEvent

                                                              Returns any

                                                          onanimationstart: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: AnimationEvent

                                                              Returns any

                                                          onauxclick: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          onbeforeinput: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: InputEvent

                                                              Returns any

                                                          onblur: null | ((this, ev) => any)

                                                          Fires when the object loses the input focus.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: FocusEvent

                                                              Returns any

                                                          Param

                                                          The focus event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: FocusEvent

                                                              Returns any

                                                          Param: ev

                                                          The focus event.

                                                          oncancel: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          oncanplay: null | ((this, ev) => any)

                                                          Occurs when playback is possible, but would require further buffering.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          oncanplaythrough: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          onchange: null | ((this, ev) => any)

                                                          Fires when the contents of the object or selection have changed.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onclick: null | ((this, ev) => any)

                                                          Fires when the user clicks the left mouse button on the object

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          onclose: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          oncontextmenu: null | ((this, ev) => any)

                                                          Fires when the user clicks the right mouse button in the client area, opening the context menu.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          oncopy: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: DocumentAndElementEventHandlers
                                                              • ev: ClipboardEvent

                                                              Returns any

                                                          oncuechange: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          oncut: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: DocumentAndElementEventHandlers
                                                              • ev: ClipboardEvent

                                                              Returns any

                                                          ondblclick: null | ((this, ev) => any)

                                                          Fires when the user double-clicks the object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          ondrag: null | ((this, ev) => any)

                                                          Fires on the source object continuously during a drag operation.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          ondragend: null | ((this, ev) => any)

                                                          Fires on the source object when the user releases the mouse at the close of a drag operation.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          ondragenter: null | ((this, ev) => any)

                                                          Fires on the target element when the user drags the object to a valid drop target.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param

                                                          The drag event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param: ev

                                                          The drag event.

                                                          ondragleave: null | ((this, ev) => any)

                                                          Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param

                                                          The drag event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param: ev

                                                          The drag event.

                                                          ondragover: null | ((this, ev) => any)

                                                          Fires on the target element continuously while the user drags the object over a valid drop target.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          ondragstart: null | ((this, ev) => any)

                                                          Fires on the source object when the user starts to drag a text selection or selected object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          ondrop: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: DragEvent

                                                              Returns any

                                                          ondurationchange: null | ((this, ev) => any)

                                                          Occurs when the duration attribute is updated.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onemptied: null | ((this, ev) => any)

                                                          Occurs when the media element is reset to its initial state.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onended: null | ((this, ev) => any)

                                                          Occurs when the end of playback is reached.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event

                                                          onerror: OnErrorEventHandler

                                                          Fires when an error occurs during object loading.

                                                          -

                                                          Param

                                                          The event.

                                                          +

                                                          Param: ev

                                                          The event.

                                                          onfocus: null | ((this, ev) => any)

                                                          Fires when the object receives focus.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: FocusEvent

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: FocusEvent

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onformdata: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: FormDataEvent

                                                              Returns any

                                                          onfullscreenchange: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: Element
                                                              • ev: Event

                                                              Returns any

                                                          onfullscreenerror: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: Element
                                                              • ev: Event

                                                              Returns any

                                                          ongotpointercapture: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          oninput: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          oninvalid: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          onkeydown: null | ((this, ev) => any)

                                                          Fires when the user presses a key.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: KeyboardEvent

                                                              Returns any

                                                          Param

                                                          The keyboard event

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: KeyboardEvent

                                                              Returns any

                                                          Param: ev

                                                          The keyboard event

                                                          onkeypress: null | ((this, ev) => any)

                                                          Fires when the user presses an alphanumeric key.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: KeyboardEvent

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: KeyboardEvent

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          Deprecated

                                                          onkeyup: null | ((this, ev) => any)

                                                          Fires when the user releases a key.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: KeyboardEvent

                                                              Returns any

                                                          Param

                                                          The keyboard event

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: KeyboardEvent

                                                              Returns any

                                                          Param: ev

                                                          The keyboard event

                                                          onload: null | ((this, ev) => any)

                                                          Fires immediately after the browser loads the object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onloadeddata: null | ((this, ev) => any)

                                                          Occurs when media data is loaded at the current playback position.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onloadedmetadata: null | ((this, ev) => any)

                                                          Occurs when the duration and dimensions of the media have been determined.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onloadstart: null | ((this, ev) => any)

                                                          Occurs when Internet Explorer begins looking for media data.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onlostpointercapture: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onmousedown: null | ((this, ev) => any)

                                                          Fires when the user clicks the object with either mouse button.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          onmouseenter: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          onmouseleave: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          onmousemove: null | ((this, ev) => any)

                                                          Fires when the user moves the mouse over the object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          onmouseout: null | ((this, ev) => any)

                                                          Fires when the user moves the mouse pointer outside the boundaries of the object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          onmouseover: null | ((this, ev) => any)

                                                          Fires when the user moves the mouse pointer into the object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          onmouseup: null | ((this, ev) => any)

                                                          Fires when the user releases a mouse button while the mouse is over the object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param

                                                          The mouse event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: MouseEvent

                                                              Returns any

                                                          Param: ev

                                                          The mouse event.

                                                          onpaste: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: DocumentAndElementEventHandlers
                                                              • ev: ClipboardEvent

                                                              Returns any

                                                          onpause: null | ((this, ev) => any)

                                                          Occurs when playback is paused.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onplay: null | ((this, ev) => any)

                                                          Occurs when the play method is requested.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onplaying: null | ((this, ev) => any)

                                                          Occurs when the audio or video has started playing.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onpointercancel: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onpointerdown: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onpointerenter: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onpointerleave: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onpointermove: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onpointerout: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onpointerover: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onpointerup: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: PointerEvent

                                                              Returns any

                                                          onprogress: null | ((this, ev) => any)

                                                          Occurs to indicate progress while downloading media data.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: ProgressEvent<EventTarget>

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: ProgressEvent<EventTarget>

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onratechange: null | ((this, ev) => any)

                                                          Occurs when the playback rate is increased or decreased.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onreset: null | ((this, ev) => any)

                                                          Fires when the user resets a form.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onresize: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: UIEvent

                                                              Returns any

                                                          onscroll: null | ((this, ev) => any)

                                                          Fires when the user repositions the scroll box in the scroll bar on the object.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onsecuritypolicyviolation: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: SecurityPolicyViolationEvent

                                                              Returns any

                                                          onseeked: null | ((this, ev) => any)

                                                          Occurs when the seek operation ends.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onseeking: null | ((this, ev) => any)

                                                          Occurs when the current playback position is moved.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onselect: null | ((this, ev) => any)

                                                          Fires when the current selection changes.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onselectionchange: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          onselectstart: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          onslotchange: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          onstalled: null | ((this, ev) => any)

                                                          Occurs when the download has stopped.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onsubmit: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: SubmitEvent

                                                              Returns any

                                                          onsuspend: null | ((this, ev) => any)

                                                          Occurs if the load operation has been intentionally halted.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          ontimeupdate: null | ((this, ev) => any)

                                                          Occurs to indicate the current playback position.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          ontoggle: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          ontouchcancel?: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TouchEvent

                                                              Returns any

                                                          ontouchend?: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TouchEvent

                                                              Returns any

                                                          ontouchmove?: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TouchEvent

                                                              Returns any

                                                          ontouchstart?: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TouchEvent

                                                              Returns any

                                                          ontransitioncancel: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TransitionEvent

                                                              Returns any

                                                          ontransitionend: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TransitionEvent

                                                              Returns any

                                                          ontransitionrun: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TransitionEvent

                                                              Returns any

                                                          ontransitionstart: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: TransitionEvent

                                                              Returns any

                                                          onvolumechange: null | ((this, ev) => any)

                                                          Occurs when the volume is changed, or playback is muted or unmuted.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onwaiting: null | ((this, ev) => any)

                                                          Occurs when playback stops because the next frame of a video resource is not available.

                                                          -

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param

                                                          The event.

                                                          +

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Param: ev

                                                          The event.

                                                          onwebkitanimationend: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Deprecated

                                                          This is a legacy alias of onanimationend.

                                                          onwebkitanimationiteration: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Deprecated

                                                          This is a legacy alias of onanimationiteration.

                                                          onwebkitanimationstart: null | ((this, ev) => any)

                                                          Type declaration

                                                            • (this, ev): any
                                                            • Parameters

                                                              • this: GlobalEventHandlers
                                                              • ev: Event

                                                              Returns any

                                                          Deprecated

                                                          This is a legacy alias of onanimationstart.

                                                          @@ -424,49 +424,49 @@

                                                          Deprecated

                                                          part: DOMTokenList
                                                          prefix: null | string

                                                          Returns the namespace prefix.

                                                          previousElementSibling: null | Element

                                                          Returns the first preceding sibling that is an element, and null otherwise.

                                                          previousSibling: null | ChildNode

                                                          Returns the previous sibling.

                                                          -
                                                          refresh?: (() => void)

                                                          Type declaration

                                                            • (): void
                                                            • Returns void

                                                          role: null | string
                                                          scrollHeight: number
                                                          scrollLeft: number
                                                          scrollTop: number
                                                          scrollWidth: number
                                                          shadowRoot: null | ShadowRoot

                                                          Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.

                                                          +
                                                          refresh?: (() => void)

                                                          Type declaration

                                                            • (): void
                                                            • Returns void

                                                          role: null | string
                                                          scrollHeight: number
                                                          scrollLeft: number
                                                          scrollTop: number
                                                          scrollWidth: number
                                                          shadowRoot: null | ShadowRoot

                                                          Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.

                                                          slot: string

                                                          Returns the value of element's slot content attribute. Can be set to change it.

                                                          -
                                                          spellcheck: boolean
                                                          style: CSSStyleDeclaration
                                                          tabContainer?: HTMLElement
                                                          tabIndex: number
                                                          tagName: string

                                                          Returns the HTML-uppercased qualified name.

                                                          -
                                                          textContent: null | string
                                                          title: string
                                                          translate: boolean

                                                          Methods

                                                          • Type Parameters

                                                            • K extends keyof HTMLElementEventMap

                                                            Parameters

                                                            • type: K
                                                            • listener: ((this, ev) => any)
                                                                • (this, ev): any
                                                                • Parameters

                                                                  • this: HTMLElement
                                                                  • ev: HTMLElementEventMap[K]

                                                                  Returns any

                                                            • Optional options: boolean | AddEventListenerOptions

                                                            Returns void

                                                          • Parameters

                                                            • type: string
                                                            • listener: EventListenerOrEventListenerObject
                                                            • Optional options: boolean | AddEventListenerOptions

                                                            Returns void

                                                          • Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.

                                                            +
                                                          spellcheck: boolean
                                                          style: CSSStyleDeclaration
                                                          tabContainer?: HTMLElement
                                                          tabIndex: number
                                                          tagName: string

                                                          Returns the HTML-uppercased qualified name.

                                                          +
                                                          textContent: null | string
                                                          title: string
                                                          translate: boolean

                                                          Methods

                                                          • Type Parameters

                                                            • K extends keyof HTMLElementEventMap

                                                            Parameters

                                                            • type: K
                                                            • listener: ((this, ev) => any)
                                                                • (this, ev): any
                                                                • Parameters

                                                                  • this: HTMLElement
                                                                  • ev: HTMLElementEventMap[K]

                                                                  Returns any

                                                            • Optional options: boolean | AddEventListenerOptions

                                                            Returns void

                                                          • Parameters

                                                            • type: string
                                                            • listener: EventListenerOrEventListenerObject
                                                            • Optional options: boolean | AddEventListenerOptions

                                                            Returns void

                                                          • Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.

                                                            Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

                                                            -

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Parameters

                                                            • keyframes: null | PropertyIndexedKeyframes | Keyframe[]
                                                            • Optional options: number | KeyframeAnimationOptions

                                                            Returns Animation

                                                          • Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.

                                                            +

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Parameters

                                                            • keyframes: null | PropertyIndexedKeyframes | Keyframe[]
                                                            • Optional options: number | KeyframeAnimationOptions

                                                            Returns Animation

                                                          • Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.

                                                            Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

                                                            -

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • node: T

                                                            Returns T

                                                          • Returns ElementInternals

                                                          • Creates a shadow root for element and returns it.

                                                            -

                                                            Parameters

                                                            • init: ShadowRootInit

                                                            Returns ShadowRoot

                                                          • Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.

                                                            +

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • node: T

                                                            Returns T

                                                          • Returns ElementInternals

                                                          • Creates a shadow root for element and returns it.

                                                            +

                                                            Parameters

                                                            • init: ShadowRootInit

                                                            Returns ShadowRoot

                                                          • Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.

                                                            Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

                                                            -

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Returns void

                                                          • Returns void

                                                          • Returns a copy of node. If deep is true, the copy also includes the node's descendants.

                                                            -

                                                            Parameters

                                                            • Optional deep: boolean

                                                            Returns Node

                                                          • Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.

                                                            -

                                                            Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • selector: K

                                                            Returns null | HTMLElementTagNameMap[K]

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • selector: K

                                                            Returns null | SVGElementTagNameMap[K]

                                                          • Type Parameters

                                                            • E extends Element<E> = Element

                                                            Parameters

                                                            • selectors: string

                                                            Returns null | E

                                                          • Returns a bitmask indicating the position of other relative to node.

                                                            -

                                                            Parameters

                                                            • other: Node

                                                            Returns number

                                                          • Returns true if other is an inclusive descendant of node, and false otherwise.

                                                            -

                                                            Parameters

                                                            • other: null | Node

                                                            Returns boolean

                                                          • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

                                                            -

                                                            Parameters

                                                            • event: Event

                                                            Returns boolean

                                                          • Parameters

                                                            • Optional options: FocusOptions

                                                            Returns void

                                                          • Parameters

                                                            • Optional options: GetAnimationsOptions

                                                            Returns Animation[]

                                                          • Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.

                                                            -

                                                            Parameters

                                                            • qualifiedName: string

                                                            Returns null | string

                                                          • Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.

                                                            -

                                                            Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns null | string

                                                          • Returns the qualified names of all element's attributes. Can contain duplicates.

                                                            -

                                                            Returns string[]

                                                          • Parameters

                                                            • qualifiedName: string

                                                            Returns null | Attr

                                                          • Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns null | Attr

                                                          • Returns DOMRect

                                                          • Returns DOMRectList

                                                          • Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.

                                                            -

                                                            Parameters

                                                            • classNames: string

                                                            Returns HTMLCollectionOf<Element>

                                                          • Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • qualifiedName: K

                                                            Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • qualifiedName: K

                                                            Returns HTMLCollectionOf<SVGElementTagNameMap[K]>

                                                          • Parameters

                                                            • qualifiedName: string

                                                            Returns HTMLCollectionOf<Element>

                                                          • Parameters

                                                            • namespaceURI: "http://www.w3.org/1999/xhtml"
                                                            • localName: string

                                                            Returns HTMLCollectionOf<HTMLElement>

                                                          • Parameters

                                                            • namespaceURI: "http://www.w3.org/2000/svg"
                                                            • localName: string

                                                            Returns HTMLCollectionOf<SVGElement>

                                                          • Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns HTMLCollectionOf<Element>

                                                          • Returns node's root.

                                                            -

                                                            Parameters

                                                            • Optional options: GetRootNodeOptions

                                                            Returns Node

                                                          • Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.

                                                            -

                                                            Parameters

                                                            • qualifiedName: string

                                                            Returns boolean

                                                          • Returns true if element has an attribute whose namespace is namespace and local name is localName.

                                                            -

                                                            Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns boolean

                                                          • Returns true if element has attributes, and false otherwise.

                                                            -

                                                            Returns boolean

                                                          • Returns whether node has children.

                                                            -

                                                            Returns boolean

                                                          • Parameters

                                                            • pointerId: number

                                                            Returns boolean

                                                          • Parameters

                                                            • where: InsertPosition
                                                            • element: Element

                                                            Returns null | Element

                                                          • Parameters

                                                            • position: InsertPosition
                                                            • text: string

                                                            Returns void

                                                          • Parameters

                                                            • where: InsertPosition
                                                            • data: string

                                                            Returns void

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • node: T
                                                            • child: null | Node

                                                            Returns T

                                                          • Parameters

                                                            • namespace: null | string

                                                            Returns boolean

                                                          • Returns whether node and otherNode have the same properties.

                                                            -

                                                            Parameters

                                                            • otherNode: null | Node

                                                            Returns boolean

                                                          • Parameters

                                                            • otherNode: null | Node

                                                            Returns boolean

                                                          • Parameters

                                                            • prefix: null | string

                                                            Returns null | string

                                                          • Parameters

                                                            • namespace: null | string

                                                            Returns null | string

                                                          • Returns true if matching selectors against element's root yields element, and false otherwise.

                                                            -

                                                            Parameters

                                                            • selectors: string

                                                            Returns boolean

                                                          • Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

                                                            -

                                                            Returns void

                                                          • Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.

                                                            +

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Returns void

                                                          • Returns void

                                                          • Returns a copy of node. If deep is true, the copy also includes the node's descendants.

                                                            +

                                                            Parameters

                                                            • Optional deep: boolean

                                                            Returns Node

                                                          • Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.

                                                            +

                                                            Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • selector: K

                                                            Returns null | HTMLElementTagNameMap[K]

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • selector: K

                                                            Returns null | SVGElementTagNameMap[K]

                                                          • Type Parameters

                                                            • E extends Element<E> = Element

                                                            Parameters

                                                            • selectors: string

                                                            Returns null | E

                                                          • Returns a bitmask indicating the position of other relative to node.

                                                            +

                                                            Parameters

                                                            • other: Node

                                                            Returns number

                                                          • Returns true if other is an inclusive descendant of node, and false otherwise.

                                                            +

                                                            Parameters

                                                            • other: null | Node

                                                            Returns boolean

                                                          • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

                                                            +

                                                            Parameters

                                                            • event: Event

                                                            Returns boolean

                                                          • Parameters

                                                            • Optional options: FocusOptions

                                                            Returns void

                                                          • Parameters

                                                            • Optional options: GetAnimationsOptions

                                                            Returns Animation[]

                                                          • Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.

                                                            +

                                                            Parameters

                                                            • qualifiedName: string

                                                            Returns null | string

                                                          • Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.

                                                            +

                                                            Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns null | string

                                                          • Returns the qualified names of all element's attributes. Can contain duplicates.

                                                            +

                                                            Returns string[]

                                                          • Parameters

                                                            • qualifiedName: string

                                                            Returns null | Attr

                                                          • Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns null | Attr

                                                          • Returns DOMRect

                                                          • Returns DOMRectList

                                                          • Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.

                                                            +

                                                            Parameters

                                                            • classNames: string

                                                            Returns HTMLCollectionOf<Element>

                                                          • Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • qualifiedName: K

                                                            Returns HTMLCollectionOf<HTMLElementTagNameMap[K]>

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • qualifiedName: K

                                                            Returns HTMLCollectionOf<SVGElementTagNameMap[K]>

                                                          • Parameters

                                                            • qualifiedName: string

                                                            Returns HTMLCollectionOf<Element>

                                                          • Parameters

                                                            • namespaceURI: "http://www.w3.org/1999/xhtml"
                                                            • localName: string

                                                            Returns HTMLCollectionOf<HTMLElement>

                                                          • Parameters

                                                            • namespaceURI: "http://www.w3.org/2000/svg"
                                                            • localName: string

                                                            Returns HTMLCollectionOf<SVGElement>

                                                          • Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns HTMLCollectionOf<Element>

                                                          • Returns node's root.

                                                            +

                                                            Parameters

                                                            • Optional options: GetRootNodeOptions

                                                            Returns Node

                                                          • Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.

                                                            +

                                                            Parameters

                                                            • qualifiedName: string

                                                            Returns boolean

                                                          • Returns true if element has an attribute whose namespace is namespace and local name is localName.

                                                            +

                                                            Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns boolean

                                                          • Returns true if element has attributes, and false otherwise.

                                                            +

                                                            Returns boolean

                                                          • Returns whether node has children.

                                                            +

                                                            Returns boolean

                                                          • Parameters

                                                            • pointerId: number

                                                            Returns boolean

                                                          • Parameters

                                                            • where: InsertPosition
                                                            • element: Element

                                                            Returns null | Element

                                                          • Parameters

                                                            • position: InsertPosition
                                                            • text: string

                                                            Returns void

                                                          • Parameters

                                                            • where: InsertPosition
                                                            • data: string

                                                            Returns void

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • node: T
                                                            • child: null | Node

                                                            Returns T

                                                          • Parameters

                                                            • namespace: null | string

                                                            Returns boolean

                                                          • Returns whether node and otherNode have the same properties.

                                                            +

                                                            Parameters

                                                            • otherNode: null | Node

                                                            Returns boolean

                                                          • Parameters

                                                            • otherNode: null | Node

                                                            Returns boolean

                                                          • Parameters

                                                            • prefix: null | string

                                                            Returns null | string

                                                          • Parameters

                                                            • namespace: null | string

                                                            Returns null | string

                                                          • Returns true if matching selectors against element's root yields element, and false otherwise.

                                                            +

                                                            Parameters

                                                            • selectors: string

                                                            Returns boolean

                                                          • Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

                                                            +

                                                            Returns void

                                                          • Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.

                                                            Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

                                                            -

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Returns the first element that is a descendant of node that matches selectors.

                                                            -

                                                            Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns null | HTMLElementTagNameMap[K]

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns null | SVGElementTagNameMap[K]

                                                          • Type Parameters

                                                            • E extends Element<E> = Element

                                                            Parameters

                                                            • selectors: string

                                                            Returns null | E

                                                          • Returns all element descendants of node that match selectors.

                                                            -

                                                            Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns NodeListOf<HTMLElementTagNameMap[K]>

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns NodeListOf<SVGElementTagNameMap[K]>

                                                          • Type Parameters

                                                            • E extends Element<E> = Element

                                                            Parameters

                                                            • selectors: string

                                                            Returns NodeListOf<E>

                                                          • Parameters

                                                            • pointerId: number

                                                            Returns void

                                                          • Removes node.

                                                            -

                                                            Returns void

                                                          • Removes element's first attribute whose qualified name is qualifiedName.

                                                            -

                                                            Parameters

                                                            • qualifiedName: string

                                                            Returns void

                                                          • Removes element's attribute whose namespace is namespace and local name is localName.

                                                            -

                                                            Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns void

                                                          • Parameters

                                                            • attr: Attr

                                                            Returns Attr

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • child: T

                                                            Returns T

                                                          • Type Parameters

                                                            • K extends keyof HTMLElementEventMap

                                                            Parameters

                                                            • type: K
                                                            • listener: ((this, ev) => any)
                                                                • (this, ev): any
                                                                • Parameters

                                                                  • this: HTMLElement
                                                                  • ev: HTMLElementEventMap[K]

                                                                  Returns any

                                                            • Optional options: boolean | EventListenerOptions

                                                            Returns void

                                                          • Parameters

                                                            • type: string
                                                            • listener: EventListenerOrEventListenerObject
                                                            • Optional options: boolean | EventListenerOptions

                                                            Returns void

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • node: Node
                                                            • child: T

                                                            Returns T

                                                          • Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.

                                                            +

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Returns the first element that is a descendant of node that matches selectors.

                                                            +

                                                            Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns null | HTMLElementTagNameMap[K]

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns null | SVGElementTagNameMap[K]

                                                          • Type Parameters

                                                            • E extends Element<E> = Element

                                                            Parameters

                                                            • selectors: string

                                                            Returns null | E

                                                          • Returns all element descendants of node that match selectors.

                                                            +

                                                            Type Parameters

                                                            • K extends keyof HTMLElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns NodeListOf<HTMLElementTagNameMap[K]>

                                                          • Type Parameters

                                                            • K extends keyof SVGElementTagNameMap

                                                            Parameters

                                                            • selectors: K

                                                            Returns NodeListOf<SVGElementTagNameMap[K]>

                                                          • Type Parameters

                                                            • E extends Element<E> = Element

                                                            Parameters

                                                            • selectors: string

                                                            Returns NodeListOf<E>

                                                          • Parameters

                                                            • pointerId: number

                                                            Returns void

                                                          • Removes node.

                                                            +

                                                            Returns void

                                                          • Removes element's first attribute whose qualified name is qualifiedName.

                                                            +

                                                            Parameters

                                                            • qualifiedName: string

                                                            Returns void

                                                          • Removes element's attribute whose namespace is namespace and local name is localName.

                                                            +

                                                            Parameters

                                                            • namespace: null | string
                                                            • localName: string

                                                            Returns void

                                                          • Parameters

                                                            • attr: Attr

                                                            Returns Attr

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • child: T

                                                            Returns T

                                                          • Type Parameters

                                                            • K extends keyof HTMLElementEventMap

                                                            Parameters

                                                            • type: K
                                                            • listener: ((this, ev) => any)
                                                                • (this, ev): any
                                                                • Parameters

                                                                  • this: HTMLElement
                                                                  • ev: HTMLElementEventMap[K]

                                                                  Returns any

                                                            • Optional options: boolean | EventListenerOptions

                                                            Returns void

                                                          • Parameters

                                                            • type: string
                                                            • listener: EventListenerOrEventListenerObject
                                                            • Optional options: boolean | EventListenerOptions

                                                            Returns void

                                                          • Type Parameters

                                                            • T extends Node<T>

                                                            Parameters

                                                            • node: Node
                                                            • child: T

                                                            Returns T

                                                          • Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.

                                                            Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

                                                            -

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.

                                                            +

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.

                                                            Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.

                                                            -

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Displays element fullscreen and resolves promise when done.

                                                            +

                                                            Parameters

                                                            • Rest ...nodes: (string | Node)[]

                                                            Returns void

                                                          • Displays element fullscreen and resolves promise when done.

                                                            When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.

                                                            -

                                                            Parameters

                                                            • Optional options: FullscreenOptions

                                                            Returns Promise<void>

                                                          • Returns void

                                                          • Parameters

                                                            • Optional options: ScrollToOptions

                                                            Returns void

                                                          • Parameters

                                                            • x: number
                                                            • y: number

                                                            Returns void

                                                          • Parameters

                                                            • Optional options: ScrollToOptions

                                                            Returns void

                                                          • Parameters

                                                            • x: number
                                                            • y: number

                                                            Returns void

                                                          • Parameters

                                                            • Optional arg: boolean | ScrollIntoViewOptions

                                                            Returns void

                                                          • Parameters

                                                            • Optional options: ScrollToOptions

                                                            Returns void

                                                          • Parameters

                                                            • x: number
                                                            • y: number

                                                            Returns void

                                                          • Sets the value of element's first attribute whose qualified name is qualifiedName to value.

                                                            -

                                                            Parameters

                                                            • qualifiedName: string
                                                            • value: string

                                                            Returns void

                                                          • Sets the value of element's attribute whose namespace is namespace and local name is localName to value.

                                                            -

                                                            Parameters

                                                            • namespace: null | string
                                                            • qualifiedName: string
                                                            • value: string

                                                            Returns void

                                                          • Parameters

                                                            • attr: Attr

                                                            Returns null | Attr

                                                          • Parameters

                                                            • attr: Attr

                                                            Returns null | Attr

                                                          • Parameters

                                                            • pointerId: number

                                                            Returns void

                                                          • If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.

                                                            +

                                                            Parameters

                                                            • Optional options: FullscreenOptions

                                                            Returns Promise<void>

                                                          • Returns void

                                                          • Parameters

                                                            • Optional options: ScrollToOptions

                                                            Returns void

                                                          • Parameters

                                                            • x: number
                                                            • y: number

                                                            Returns void

                                                          • Parameters

                                                            • Optional options: ScrollToOptions

                                                            Returns void

                                                          • Parameters

                                                            • x: number
                                                            • y: number

                                                            Returns void

                                                          • Parameters

                                                            • Optional arg: boolean | ScrollIntoViewOptions

                                                            Returns void

                                                          • Parameters

                                                            • Optional options: ScrollToOptions

                                                            Returns void

                                                          • Parameters

                                                            • x: number
                                                            • y: number

                                                            Returns void

                                                          • Sets the value of element's first attribute whose qualified name is qualifiedName to value.

                                                            +

                                                            Parameters

                                                            • qualifiedName: string
                                                            • value: string

                                                            Returns void

                                                          • Sets the value of element's attribute whose namespace is namespace and local name is localName to value.

                                                            +

                                                            Parameters

                                                            • namespace: null | string
                                                            • qualifiedName: string
                                                            • value: string

                                                            Returns void

                                                          • Parameters

                                                            • attr: Attr

                                                            Returns null | Attr

                                                          • Parameters

                                                            • attr: Attr

                                                            Returns null | Attr

                                                          • Parameters

                                                            • pointerId: number

                                                            Returns void

                                                          • If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.

                                                            Returns true if qualifiedName is now present, and false otherwise.

                                                            -

                                                            Parameters

                                                            • qualifiedName: string
                                                            • Optional force: boolean

                                                            Returns boolean

                                                          • Parameters

                                                            • selectors: string

                                                            Returns boolean

                                                            Deprecated

                                                            This is a legacy alias of matches.

                                                            -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Parameters

                                                          Returns boolean

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/initFooter.html b/Documentation/api/functions/initFooter.html index 41e77432..ffc42138 100644 --- a/Documentation/api/functions/initFooter.html +++ b/Documentation/api/functions/initFooter.html @@ -1,4 +1,4 @@ -initFooter | solid-ui

                                                          Function initFooter

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/initHeader.html b/Documentation/api/functions/initHeader.html index eb80b8ab..311e6f2e 100644 --- a/Documentation/api/functions/initHeader.html +++ b/Documentation/api/functions/initHeader.html @@ -1,6 +1,6 @@ -initHeader | solid-ui

                                                          Function initHeader

                                                          • Initialize header component, the header object returned depends on whether the user is authenticated.

                                                            +initHeader | solid-ui

                                                            Function initHeader

                                                            • Initialize header component, the header object returned depends on whether the user is authenticated.

                                                              Parameters

                                                              • store: Store

                                                                the data store

                                                              • userMenuList: MenuItems[]

                                                                a list of menu items when the user is logged in

                                                              • Optional options: HeaderOptions

                                                                allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.

                                                              Returns Promise<void>

                                                              a header for an authenticated user with menu items given or a login screen

                                                              -

                                                            Generated using TypeDoc

                                                            \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/language.addDefaults.html b/Documentation/api/functions/language.addDefaults.html index 76620e8a..fd5786c2 100644 --- a/Documentation/api/functions/language.addDefaults.html +++ b/Documentation/api/functions/language.addDefaults.html @@ -1 +1 @@ -addDefaults | solid-ui

                                                          Function addDefaults

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +addDefaults | solid-ui

                                                          Function addDefaults

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/language.filterByLanguage.html b/Documentation/api/functions/language.filterByLanguage.html index a46bf365..a057c668 100644 --- a/Documentation/api/functions/language.filterByLanguage.html +++ b/Documentation/api/functions/language.filterByLanguage.html @@ -1 +1 @@ -filterByLanguage | solid-ui

                                                          Function filterByLanguage

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +filterByLanguage | solid-ui

                                                          Function filterByLanguage

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/language.getPreferredLanguages.html b/Documentation/api/functions/language.getPreferredLanguages.html index 1b47e7f1..099f20e7 100644 --- a/Documentation/api/functions/language.getPreferredLanguages.html +++ b/Documentation/api/functions/language.getPreferredLanguages.html @@ -1 +1 @@ -getPreferredLanguages | solid-ui

                                                          Function getPreferredLanguages

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +getPreferredLanguages | solid-ui

                                                          Function getPreferredLanguages

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/language.getPreferredLanguagesFor.html b/Documentation/api/functions/language.getPreferredLanguagesFor.html index 59d977bc..4496cee4 100644 --- a/Documentation/api/functions/language.getPreferredLanguagesFor.html +++ b/Documentation/api/functions/language.getPreferredLanguagesFor.html @@ -1 +1 @@ -getPreferredLanguagesFor | solid-ui

                                                          Function getPreferredLanguagesFor

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +getPreferredLanguagesFor | solid-ui

                                                          Function getPreferredLanguagesFor

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.alert.html b/Documentation/api/functions/log.alert.html index 89651258..37cbb605 100644 --- a/Documentation/api/functions/log.alert.html +++ b/Documentation/api/functions/log.alert.html @@ -1,3 +1,3 @@ -alert | solid-ui

                                                          Function alert

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.clear.html b/Documentation/api/functions/log.clear.html index c012c0a9..1c7219c1 100644 --- a/Documentation/api/functions/log.clear.html +++ b/Documentation/api/functions/log.clear.html @@ -1,2 +1,2 @@ -clear | solid-ui

                                                          Function clear

                                                          • Will clear the content of the element with id "status".

                                                            -

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +clear | solid-ui

                                                          Function clear

                                                          • Will clear the content of the element with id "status".

                                                            +

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.debug.html b/Documentation/api/functions/log.debug.html index b5b57e42..cc8dddc9 100644 --- a/Documentation/api/functions/log.debug.html +++ b/Documentation/api/functions/log.debug.html @@ -1,3 +1,3 @@ -debug | solid-ui

                                                          Function debug

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.dumpHTML.html b/Documentation/api/functions/log.dumpHTML.html index 8898cc11..dcfe28d2 100644 --- a/Documentation/api/functions/log.dumpHTML.html +++ b/Documentation/api/functions/log.dumpHTML.html @@ -1,2 +1,2 @@ -dumpHTML | solid-ui

                                                          Function dumpHTML

                                                          • Will dump the current HTML using the [[debug]] method.

                                                            -

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +dumpHTML | solid-ui

                                                          Function dumpHTML

                                                          • Will dump the current HTML using the [[debug]] method.

                                                            +

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.error.html b/Documentation/api/functions/log.error.html index a526c87e..a3b63b8f 100644 --- a/Documentation/api/functions/log.error.html +++ b/Documentation/api/functions/log.error.html @@ -1,3 +1,3 @@ -error | solid-ui

                                                          Function error

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.info.html b/Documentation/api/functions/log.info.html index e33c56de..84b871f0 100644 --- a/Documentation/api/functions/log.info.html +++ b/Documentation/api/functions/log.info.html @@ -1,3 +1,3 @@ -info | solid-ui

                                                          Function info

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.logAscending.html b/Documentation/api/functions/log.logAscending.html index 232c12ea..02ef4760 100644 --- a/Documentation/api/functions/log.logAscending.html +++ b/Documentation/api/functions/log.logAscending.html @@ -1,2 +1,2 @@ -logAscending | solid-ui

                                                          Function logAscending

                                                          • Will start prepending messages the list of log messages.

                                                            -

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +logAscending | solid-ui

                                                          Function logAscending

                                                          • Will start prepending messages the list of log messages.

                                                            +

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.logDescending.html b/Documentation/api/functions/log.logDescending.html index 28aa6631..0c0c0c87 100644 --- a/Documentation/api/functions/log.logDescending.html +++ b/Documentation/api/functions/log.logDescending.html @@ -1,3 +1,3 @@ -logDescending | solid-ui

                                                          Function logDescending

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.msg.html b/Documentation/api/functions/log.msg.html index fac39576..dc9709f9 100644 --- a/Documentation/api/functions/log.msg.html +++ b/Documentation/api/functions/log.msg.html @@ -1,3 +1,3 @@ -msg | solid-ui

                                                          Function msg

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.setLevel.html b/Documentation/api/functions/log.setLevel.html index 1ab011ac..193e06a5 100644 --- a/Documentation/api/functions/log.setLevel.html +++ b/Documentation/api/functions/log.setLevel.html @@ -1,4 +1,4 @@ -setLevel | solid-ui

                                                          Function setLevel

                                                          • Lets you configure which types of messages will be shown. The module uses +setLevel | solid-ui

                                                            Function setLevel

                                                            • Lets you configure which types of messages will be shown. The module uses bitmask to filter which types of messages should be shown. E.g. if you only want warning messages to be shown, pass 2 to the function, if you want warning and success to be @@ -12,4 +12,4 @@

                                                            • Info: 16
                                                            • Debug: 32
                                                            -

                                                            Parameters

                                                            • level: number

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Parameters

                                                          Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.success.html b/Documentation/api/functions/log.success.html index 1fb4c048..ada307c9 100644 --- a/Documentation/api/functions/log.success.html +++ b/Documentation/api/functions/log.success.html @@ -1,3 +1,3 @@ -success | solid-ui

                                                          Function success

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/log.warn.html b/Documentation/api/functions/log.warn.html index 18b8053e..9bd5d112 100644 --- a/Documentation/api/functions/log.warn.html +++ b/Documentation/api/functions/log.warn.html @@ -1,3 +1,3 @@ -warn | solid-ui

                                                          Function warn

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.ensureLoadedPreferences.html b/Documentation/api/functions/login.ensureLoadedPreferences.html index 219b3426..970ee413 100644 --- a/Documentation/api/functions/login.ensureLoadedPreferences.html +++ b/Documentation/api/functions/login.ensureLoadedPreferences.html @@ -1,3 +1,3 @@ -ensureLoadedPreferences | solid-ui

                                                          Function ensureLoadedPreferencesPrivate

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.ensureLoadedProfile.html b/Documentation/api/functions/login.ensureLoadedProfile.html index 5c36ca68..04b06ec2 100644 --- a/Documentation/api/functions/login.ensureLoadedProfile.html +++ b/Documentation/api/functions/login.ensureLoadedProfile.html @@ -1,3 +1,3 @@ -ensureLoadedProfile | solid-ui

                                                          Function ensureLoadedProfile

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.ensureLoggedIn.html b/Documentation/api/functions/login.ensureLoggedIn.html index 0d021522..32c735a9 100644 --- a/Documentation/api/functions/login.ensureLoggedIn.html +++ b/Documentation/api/functions/login.ensureLoggedIn.html @@ -1,2 +1,2 @@ -ensureLoggedIn | solid-ui

                                                          Function ensureLoggedIn

                                                          • Resolves with the logged in user's WebID

                                                            -

                                                            Parameters

                                                            • context: AuthenticationContext

                                                            Returns Promise<AuthenticationContext>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +ensureLoggedIn | solid-ui

                                                          Function ensureLoggedIn

                                                          • Resolves with the logged in user's WebID

                                                            +

                                                            Parameters

                                                            • context: AuthenticationContext

                                                            Returns Promise<AuthenticationContext>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.filterAvailablePanes.html b/Documentation/api/functions/login.filterAvailablePanes.html index 2b5a3d47..1df23c2b 100644 --- a/Documentation/api/functions/login.filterAvailablePanes.html +++ b/Documentation/api/functions/login.filterAvailablePanes.html @@ -1,2 +1,2 @@ -filterAvailablePanes | solid-ui

                                                          Function filterAvailablePanes

                                                          • Filters which panes should be available, based on the result of [[getUserRoles]]

                                                            -

                                                            Parameters

                                                            • panes: PaneDefinition[]

                                                            Returns Promise<PaneDefinition[]>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +filterAvailablePanes | solid-ui

                                                          Function filterAvailablePanes

                                                          • Filters which panes should be available, based on the result of [[getUserRoles]]

                                                            +

                                                            Parameters

                                                            • panes: PaneDefinition[]

                                                            Returns Promise<PaneDefinition[]>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.findAppInstances.html b/Documentation/api/functions/login.findAppInstances.html index d7d8cb7d..2ea49122 100644 --- a/Documentation/api/functions/login.findAppInstances.html +++ b/Documentation/api/functions/login.findAppInstances.html @@ -1,3 +1,3 @@ -findAppInstances | solid-ui

                                                          Function findAppInstances

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.getUserRoles.html b/Documentation/api/functions/login.getUserRoles.html index 0e7d9f6a..e0ddfe7b 100644 --- a/Documentation/api/functions/login.getUserRoles.html +++ b/Documentation/api/functions/login.getUserRoles.html @@ -1,3 +1,3 @@ -getUserRoles | solid-ui

                                                          Function getUserRoles

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.loginStatusBox.html b/Documentation/api/functions/login.loginStatusBox.html index 4943934f..c75dd23f 100644 --- a/Documentation/api/functions/login.loginStatusBox.html +++ b/Documentation/api/functions/login.loginStatusBox.html @@ -1,3 +1,3 @@ -loginStatusBox | solid-ui

                                                          Function loginStatusBox

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.newAppInstance.html b/Documentation/api/functions/login.newAppInstance.html index fb0bea39..d378b39b 100644 --- a/Documentation/api/functions/login.newAppInstance.html +++ b/Documentation/api/functions/login.newAppInstance.html @@ -1,8 +1,8 @@ -newAppInstance | solid-ui

                                                          Function newAppInstance

                                                          • Creates a new instance of an app.

                                                            +newAppInstance | solid-ui

                                                            Function newAppInstance

                                                            • Creates a new instance of an app.

                                                              An instance of an app could be e.g. an issue tracker for a given project, or a chess game, or calendar, or a health/fitness record for a person.

                                                              Note that this use of the term 'app' refers more to entries in the user's type index than to actual software applications that use the personal data to which these entries point.

                                                              Parameters

                                                              • dom: HTMLDocument
                                                              • appDetails: AppDetails
                                                              • callback: ((workspace, newBase) => void)
                                                                  • (workspace, newBase): void
                                                                  • Parameters

                                                                    • workspace: null | string
                                                                    • newBase: string

                                                                    Returns void

                                                              Returns HTMLElement

                                                              A div with a button in it for making a new app instance

                                                              -

                                                            Generated using TypeDoc

                                                            \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.registrationControl.html b/Documentation/api/functions/login.registrationControl.html index b1d42481..e41b98f1 100644 --- a/Documentation/api/functions/login.registrationControl.html +++ b/Documentation/api/functions/login.registrationControl.html @@ -1,2 +1,2 @@ -registrationControl | solid-ui

                                                          Function registrationControl

                                                          • UI to control registration of instance

                                                            -

                                                            Parameters

                                                            • context: AuthenticationContext
                                                            • instance: any
                                                            • theClass: any

                                                            Returns Promise<AuthenticationContext | void>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +registrationControl | solid-ui

                                                          Function registrationControl

                                                          • UI to control registration of instance

                                                            +

                                                            Parameters

                                                            • context: AuthenticationContext
                                                            • instance: any
                                                            • theClass: any

                                                            Returns Promise<AuthenticationContext | void>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.registrationList.html b/Documentation/api/functions/login.registrationList.html index a1f7130a..c5f1430d 100644 --- a/Documentation/api/functions/login.registrationList.html +++ b/Documentation/api/functions/login.registrationList.html @@ -1,2 +1,2 @@ -registrationList | solid-ui

                                                          Function registrationList

                                                          • UI to List at all registered things

                                                            -

                                                            Parameters

                                                            • context: AuthenticationContext
                                                            • options: {
                                                                  private?: boolean;
                                                                  public?: boolean;
                                                                  type?: NamedNode;
                                                              }
                                                              • Optional private?: boolean
                                                              • Optional public?: boolean
                                                              • Optional type?: NamedNode

                                                            Returns Promise<AuthenticationContext>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +registrationList | solid-ui

                                                          Function registrationList

                                                          • UI to List at all registered things

                                                            +

                                                            Parameters

                                                            • context: AuthenticationContext
                                                            • options: {
                                                                  private?: boolean;
                                                                  public?: boolean;
                                                                  type?: NamedNode;
                                                              }
                                                              • Optional private?: boolean
                                                              • Optional public?: boolean
                                                              • Optional type?: NamedNode

                                                            Returns Promise<AuthenticationContext>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.renderScopeHeadingRow.html b/Documentation/api/functions/login.renderScopeHeadingRow.html index 58ea3ec1..0874199a 100644 --- a/Documentation/api/functions/login.renderScopeHeadingRow.html +++ b/Documentation/api/functions/login.renderScopeHeadingRow.html @@ -1 +1 @@ -renderScopeHeadingRow | solid-ui

                                                          Function renderScopeHeadingRow

                                                          • Parameters

                                                            • context: any
                                                            • store: any
                                                            • scope: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +renderScopeHeadingRow | solid-ui

                                                          Function renderScopeHeadingRow

                                                          • Parameters

                                                            • context: any
                                                            • store: any
                                                            • scope: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.renderSignInPopup.html b/Documentation/api/functions/login.renderSignInPopup.html index 1d98cd14..31755e96 100644 --- a/Documentation/api/functions/login.renderSignInPopup.html +++ b/Documentation/api/functions/login.renderSignInPopup.html @@ -1 +1 @@ -renderSignInPopup | solid-ui

                                                          Function renderSignInPopup

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +renderSignInPopup | solid-ui

                                                          Function renderSignInPopup

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.scopeLabel.html b/Documentation/api/functions/login.scopeLabel.html index 51f34604..26fa87cf 100644 --- a/Documentation/api/functions/login.scopeLabel.html +++ b/Documentation/api/functions/login.scopeLabel.html @@ -1 +1 @@ -scopeLabel | solid-ui

                                                          Function scopeLabel

                                                          • Parameters

                                                            • context: any
                                                            • scope: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +scopeLabel | solid-ui

                                                          Function scopeLabel

                                                          • Parameters

                                                            • context: any
                                                            • scope: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/login.selectWorkspace.html b/Documentation/api/functions/login.selectWorkspace.html index 95b9ac21..93bbaed5 100644 --- a/Documentation/api/functions/login.selectWorkspace.html +++ b/Documentation/api/functions/login.selectWorkspace.html @@ -1,4 +1,4 @@ -selectWorkspace | solid-ui

                                                          Function selectWorkspace

                                                          • Returns a UI object which, if it selects a workspace, +selectWorkspace | solid-ui

                                                            Function selectWorkspace

                                                            • Returns a UI object which, if it selects a workspace, will callback(workspace, newBase). See https://github.com/solidos/userguide/issues/16 for more info on workspaces.

                                                              If necessary, will get an account, preference file, etc. In sequence:

                                                              @@ -9,4 +9,4 @@
                                                            • Allows the user to just type in a URI by hand

                                                            Calls back with the workspace and the base URI

                                                            -

                                                            Parameters

                                                            • dom: HTMLDocument
                                                            • appDetails: AppDetails
                                                            • callbackWS: ((workspace, newBase) => void)
                                                                • (workspace, newBase): void
                                                                • Parameters

                                                                  • workspace: null | string
                                                                  • newBase: string

                                                                  Returns void

                                                            Returns HTMLElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Parameters

                                                          Returns HTMLElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.getChunks.html b/Documentation/api/functions/pad.getChunks.html index 6b601a72..3a01e455 100644 --- a/Documentation/api/functions/pad.getChunks.html +++ b/Documentation/api/functions/pad.getChunks.html @@ -1,3 +1,3 @@ -getChunks | solid-ui

                                                          Function getChunks

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.lightColorHash.html b/Documentation/api/functions/pad.lightColorHash.html index 7441639e..fc0352eb 100644 --- a/Documentation/api/functions/pad.lightColorHash.html +++ b/Documentation/api/functions/pad.lightColorHash.html @@ -1,4 +1,4 @@ -lightColorHash | solid-ui

                                                          Function lightColorHash

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.manageParticipation.html b/Documentation/api/functions/pad.manageParticipation.html index b5a7a80b..6a5e02b6 100644 --- a/Documentation/api/functions/pad.manageParticipation.html +++ b/Documentation/api/functions/pad.manageParticipation.html @@ -1,7 +1,7 @@ -manageParticipation | solid-ui

                                                          Function manageParticipation

                                                          • Record my participation and display participants

                                                            +manageParticipation | solid-ui

                                                            Function manageParticipation

                                                            • Record my participation and display participants

                                                              Parameters

                                                              • dom: Document

                                                                the web page loaded into the browser

                                                              • container: HTMLDivElement

                                                                the container element where the participants should be displayed

                                                              • padDoc: NamedNode
                                                              • subject: NamedNode

                                                                the thing in which participation is happening

                                                              • me: NamedNode

                                                                the logged in user

                                                              • options: ParticipationOptions

                                                                the options that can be passed in are deleteFunction, link, and draggable these are used by the personTR button

                                                                -

                                                              Returns HTMLTableElement

                                                            Generated using TypeDoc

                                                            \ No newline at end of file +

                                                          Returns HTMLTableElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.notepad.html b/Documentation/api/functions/pad.notepad.html index 2b7a8872..d972f6cf 100644 --- a/Documentation/api/functions/pad.notepad.html +++ b/Documentation/api/functions/pad.notepad.html @@ -1,7 +1,7 @@ -notepad | solid-ui

                                                          Function notepad

                                                          Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.notepadToHTML.html b/Documentation/api/functions/pad.notepadToHTML.html index 7e3f3282..71600185 100644 --- a/Documentation/api/functions/pad.notepadToHTML.html +++ b/Documentation/api/functions/pad.notepadToHTML.html @@ -1,3 +1,3 @@ -notepadToHTML | solid-ui

                                                          Function notepadToHTML

                                                          Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.participationObject.html b/Documentation/api/functions/pad.participationObject.html index 1eb2bf2f..2ed68f1a 100644 --- a/Documentation/api/functions/pad.participationObject.html +++ b/Documentation/api/functions/pad.participationObject.html @@ -1,6 +1,6 @@ -participationObject | solid-ui

                                                          Function participationObject

                                                          Returns Promise<unknown>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.recordParticipation.html b/Documentation/api/functions/pad.recordParticipation.html index 25c4ec82..f248c694 100644 --- a/Documentation/api/functions/pad.recordParticipation.html +++ b/Documentation/api/functions/pad.recordParticipation.html @@ -1,5 +1,5 @@ -recordParticipation | solid-ui

                                                          Function recordParticipation

                                                          Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.renderPartipants.html b/Documentation/api/functions/pad.renderPartipants.html index 0e57ec46..27d29eb1 100644 --- a/Documentation/api/functions/pad.renderPartipants.html +++ b/Documentation/api/functions/pad.renderPartipants.html @@ -1,6 +1,6 @@ -renderPartipants | solid-ui

                                                          Function renderPartipants

                                                          Returns ParticipationTableElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/pad.xmlEncode.html b/Documentation/api/functions/pad.xmlEncode.html index b1da19f9..ed6a8a86 100644 --- a/Documentation/api/functions/pad.xmlEncode.html +++ b/Documentation/api/functions/pad.xmlEncode.html @@ -1,2 +1,2 @@ -xmlEncode | solid-ui

                                                          Function xmlEncode

                                                          • Encode content to be put in XML or HTML elements

                                                            -

                                                            Parameters

                                                            • str: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +xmlEncode | solid-ui

                                                          Function xmlEncode

                                                          • Encode content to be put in XML or HTML elements

                                                            +

                                                            Parameters

                                                            • str: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.N3Parser.html b/Documentation/api/functions/rdf.N3Parser.html index d7533a35..9319c0fe 100644 --- a/Documentation/api/functions/rdf.N3Parser.html +++ b/Documentation/api/functions/rdf.N3Parser.html @@ -1 +1 @@ -N3Parser | solid-ui

                                                          Function N3Parser

                                                          • Parameters

                                                            • store: any
                                                            • openFormula: any
                                                            • thisDoc: any
                                                            • baseURI: any
                                                            • genPrefix: any
                                                            • metaURI: any
                                                            • flags: any
                                                            • why: any

                                                            Returns SinkParser

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +N3Parser | solid-ui

                                                          Function N3Parser

                                                          • Parameters

                                                            • store: any
                                                            • openFormula: any
                                                            • thisDoc: any
                                                            • baseURI: any
                                                            • genPrefix: any
                                                            • metaURI: any
                                                            • flags: any
                                                            • why: any

                                                            Returns SinkParser

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.SPARQLToQuery.html b/Documentation/api/functions/rdf.SPARQLToQuery.html index c6f275e8..9cfb0494 100644 --- a/Documentation/api/functions/rdf.SPARQLToQuery.html +++ b/Documentation/api/functions/rdf.SPARQLToQuery.html @@ -1,3 +1,3 @@ -SPARQLToQuery | solid-ui

                                                          Function SPARQLToQuery

                                                          • @SPARQL: SPARQL text that is converted to a query object which is returned. +SPARQLToQuery | solid-ui

                                                            Function SPARQLToQuery

                                                            • @SPARQL: SPARQL text that is converted to a query object which is returned. @testMode: testing flag. Prevents loading of sources.

                                                              -

                                                              Parameters

                                                              • SPARQL: any
                                                              • testMode: any
                                                              • kb: any

                                                              Returns false | Query

                                                            Generated using TypeDoc

                                                            \ No newline at end of file +

                                                            Parameters

                                                            • SPARQL: any
                                                            • testMode: any
                                                            • kb: any

                                                            Returns false | Query

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Serializer.html b/Documentation/api/functions/rdf.Serializer.html index 02601871..f2a30239 100644 --- a/Documentation/api/functions/rdf.Serializer.html +++ b/Documentation/api/functions/rdf.Serializer.html @@ -1 +1 @@ -Serializer | solid-ui

                                                          Function Serializer

                                                          • Parameters

                                                            • store: any

                                                            Returns Serializer

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +Serializer | solid-ui

                                                          Function Serializer

                                                          • Parameters

                                                            • store: any

                                                            Returns Serializer

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.DOMParserFactory.html b/Documentation/api/functions/rdf.Util.DOMParserFactory.html index bcf37098..02bb751e 100644 --- a/Documentation/api/functions/rdf.Util.DOMParserFactory.html +++ b/Documentation/api/functions/rdf.Util.DOMParserFactory.html @@ -1,2 +1,2 @@ -DOMParserFactory | solid-ui

                                                          Function DOMParserFactory

                                                          • Returns a DOM parser based on current runtime environment.

                                                            -

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +DOMParserFactory | solid-ui

                                                          Function DOMParserFactory

                                                          • Returns a DOM parser based on current runtime environment.

                                                            +

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.RDFArrayRemove.html b/Documentation/api/functions/rdf.Util.RDFArrayRemove.html index 2330ad94..733befae 100644 --- a/Documentation/api/functions/rdf.Util.RDFArrayRemove.html +++ b/Documentation/api/functions/rdf.Util.RDFArrayRemove.html @@ -1,2 +1,2 @@ -RDFArrayRemove | solid-ui

                                                          Function RDFArrayRemove

                                                          • Removes all statements equal to x from a

                                                            -

                                                            Parameters

                                                            • a: any
                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +RDFArrayRemove | solid-ui

                                                          Function RDFArrayRemove

                                                          • Removes all statements equal to x from a

                                                            +

                                                            Parameters

                                                            • a: any
                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.callbackify.html b/Documentation/api/functions/rdf.Util.callbackify.html index 56caace4..71cb2851 100644 --- a/Documentation/api/functions/rdf.Util.callbackify.html +++ b/Documentation/api/functions/rdf.Util.callbackify.html @@ -1,7 +1,7 @@ -callbackify | solid-ui

                                                          Function callbackify

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.domToString.html b/Documentation/api/functions/rdf.Util.domToString.html index 890b28d3..bc107b52 100644 --- a/Documentation/api/functions/rdf.Util.domToString.html +++ b/Documentation/api/functions/rdf.Util.domToString.html @@ -1 +1 @@ -domToString | solid-ui

                                                          Function domToString

                                                          • Parameters

                                                            • node: any
                                                            • options: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +domToString | solid-ui

                                                          Function domToString

                                                          • Parameters

                                                            • node: any
                                                            • options: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.dtstamp.html b/Documentation/api/functions/rdf.Util.dtstamp.html index 60a3eba5..ab9d96ef 100644 --- a/Documentation/api/functions/rdf.Util.dtstamp.html +++ b/Documentation/api/functions/rdf.Util.dtstamp.html @@ -1 +1 @@ -dtstamp | solid-ui

                                                          Function dtstamp

                                                          • Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +dtstamp | solid-ui

                                                          Function dtstamp

                                                          • Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.dumpNode.html b/Documentation/api/functions/rdf.Util.dumpNode.html index dc2486cc..bc559bc5 100644 --- a/Documentation/api/functions/rdf.Util.dumpNode.html +++ b/Documentation/api/functions/rdf.Util.dumpNode.html @@ -1 +1 @@ -dumpNode | solid-ui

                                                          Function dumpNode

                                                          • Parameters

                                                            • node: any
                                                            • options: any
                                                            • selfClosing: any
                                                            • skipAttributes: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +dumpNode | solid-ui

                                                          Function dumpNode

                                                          • Parameters

                                                            • node: any
                                                            • options: any
                                                            • selfClosing: any
                                                            • skipAttributes: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.heavyCompare.html b/Documentation/api/functions/rdf.Util.heavyCompare.html index d60eebb8..8f0614be 100644 --- a/Documentation/api/functions/rdf.Util.heavyCompare.html +++ b/Documentation/api/functions/rdf.Util.heavyCompare.html @@ -1,2 +1,2 @@ -heavyCompare | solid-ui

                                                          Function heavyCompare

                                                          • Compares statements (heavy comparison for repeatable canonical ordering)

                                                            -

                                                            Parameters

                                                            • x: any
                                                            • y: any
                                                            • g: any
                                                            • uriMap: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +heavyCompare | solid-ui

                                                          Function heavyCompare

                                                          • Compares statements (heavy comparison for repeatable canonical ordering)

                                                            +

                                                            Parameters

                                                            • x: any
                                                            • y: any
                                                            • g: any
                                                            • uriMap: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.heavyCompareSPO.html b/Documentation/api/functions/rdf.Util.heavyCompareSPO.html index 000d9bce..f4c4a7d5 100644 --- a/Documentation/api/functions/rdf.Util.heavyCompareSPO.html +++ b/Documentation/api/functions/rdf.Util.heavyCompareSPO.html @@ -1 +1 @@ -heavyCompareSPO | solid-ui

                                                          Function heavyCompareSPO

                                                          • Parameters

                                                            • x: any
                                                            • y: any
                                                            • g: any
                                                            • uriMap: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +heavyCompareSPO | solid-ui

                                                          Function heavyCompareSPO

                                                          • Parameters

                                                            • x: any
                                                            • y: any
                                                            • g: any
                                                            • uriMap: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.linkRelationProperty.html b/Documentation/api/functions/rdf.Util.linkRelationProperty.html index 84d7d198..1ecc0b16 100644 --- a/Documentation/api/functions/rdf.Util.linkRelationProperty.html +++ b/Documentation/api/functions/rdf.Util.linkRelationProperty.html @@ -1 +1 @@ -linkRelationProperty | solid-ui

                                                          Function linkRelationProperty

                                                          • Parameters

                                                            • relation: any

                                                            Returns NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +linkRelationProperty | solid-ui

                                                          Function linkRelationProperty

                                                          • Parameters

                                                            • relation: any

                                                            Returns NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.mediaTypeClass.html b/Documentation/api/functions/rdf.Util.mediaTypeClass.html index 37b6a3ce..9b0870d7 100644 --- a/Documentation/api/functions/rdf.Util.mediaTypeClass.html +++ b/Documentation/api/functions/rdf.Util.mediaTypeClass.html @@ -1 +1 @@ -mediaTypeClass | solid-ui

                                                          Function mediaTypeClass

                                                          • Parameters

                                                            • mediaType: any

                                                            Returns NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +mediaTypeClass | solid-ui

                                                          Function mediaTypeClass

                                                          • Parameters

                                                            • mediaType: any

                                                            Returns NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.output.html b/Documentation/api/functions/rdf.Util.output.html index 92cb7dd8..ca02a394 100644 --- a/Documentation/api/functions/rdf.Util.output.html +++ b/Documentation/api/functions/rdf.Util.output.html @@ -1,4 +1,4 @@ -output | solid-ui

                                                          Function output

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.parseXML.html b/Documentation/api/functions/rdf.Util.parseXML.html index 6df05e41..ae90e36d 100644 --- a/Documentation/api/functions/rdf.Util.parseXML.html +++ b/Documentation/api/functions/rdf.Util.parseXML.html @@ -1,2 +1,2 @@ -parseXML | solid-ui

                                                          Function parseXML

                                                          • Returns a DOM from parsed XML.

                                                            -

                                                            Parameters

                                                            • str: any
                                                            • options: any

                                                            Returns Document

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +parseXML | solid-ui

                                                          Function parseXML

                                                          • Returns a DOM from parsed XML.

                                                            +

                                                            Parameters

                                                            • str: any
                                                            • options: any

                                                            Returns Document

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.stackString.html b/Documentation/api/functions/rdf.Util.stackString.html index e282ddcb..c0903db7 100644 --- a/Documentation/api/functions/rdf.Util.stackString.html +++ b/Documentation/api/functions/rdf.Util.stackString.html @@ -1 +1 @@ -stackString | solid-ui

                                                          Function stackString

                                                          • Parameters

                                                            • e: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +stackString | solid-ui

                                                          Function stackString

                                                          • Parameters

                                                            • e: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.string.template.html b/Documentation/api/functions/rdf.Util.string.template.html index 128f3533..39930ae3 100644 --- a/Documentation/api/functions/rdf.Util.string.template.html +++ b/Documentation/api/functions/rdf.Util.string.template.html @@ -1,2 +1,2 @@ -template | solid-ui
                                                          • C++, python style %s -> subs

                                                            -

                                                            Parameters

                                                            • base: any
                                                            • subs: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +template | solid-ui
                                                          • C++, python style %s -> subs

                                                            +

                                                            Parameters

                                                            • base: any
                                                            • subs: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.Util.string_startswith.html b/Documentation/api/functions/rdf.Util.string_startswith.html index 6083e3f3..e141bf36 100644 --- a/Documentation/api/functions/rdf.Util.string_startswith.html +++ b/Documentation/api/functions/rdf.Util.string_startswith.html @@ -1 +1 @@ -string_startswith | solid-ui

                                                          Function string_startswith

                                                          • Parameters

                                                            • str: any
                                                            • pref: any

                                                            Returns boolean

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +string_startswith | solid-ui

                                                          Function string_startswith

                                                          • Parameters

                                                            • str: any
                                                            • pref: any

                                                            Returns boolean

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.blankNode-1.html b/Documentation/api/functions/rdf.blankNode-1.html index a377a2d4..6834ccd0 100644 --- a/Documentation/api/functions/rdf.blankNode-1.html +++ b/Documentation/api/functions/rdf.blankNode-1.html @@ -1 +1 @@ -blankNode | solid-ui

                                                          Function blankNode

                                                          • Parameters

                                                            • Optional value: string

                                                            Returns BlankNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +blankNode | solid-ui

                                                          Function blankNode

                                                          • Parameters

                                                            • Optional value: string

                                                            Returns BlankNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.defaultGraph.html b/Documentation/api/functions/rdf.defaultGraph.html index f4c210fd..94f53b7d 100644 --- a/Documentation/api/functions/rdf.defaultGraph.html +++ b/Documentation/api/functions/rdf.defaultGraph.html @@ -1 +1 @@ -defaultGraph | solid-ui

                                                          Function defaultGraph

                                                          • Returns default

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +defaultGraph | solid-ui

                                                          Function defaultGraph

                                                          • Returns default

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.fetcher-1.html b/Documentation/api/functions/rdf.fetcher-1.html index ec2778c7..b544bef5 100644 --- a/Documentation/api/functions/rdf.fetcher-1.html +++ b/Documentation/api/functions/rdf.fetcher-1.html @@ -1 +1 @@ -fetcher | solid-ui

                                                          Function fetcher

                                                          • Parameters

                                                            Returns Fetcher

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +fetcher | solid-ui

                                                          Function fetcher

                                                          • Parameters

                                                            Returns Fetcher

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.fromNT.html b/Documentation/api/functions/rdf.fromNT.html index 26c285e0..e609b73f 100644 --- a/Documentation/api/functions/rdf.fromNT.html +++ b/Documentation/api/functions/rdf.fromNT.html @@ -1 +1 @@ -fromNT | solid-ui

                                                          Function fromNT

                                                          • Parameters

                                                            • str: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +fromNT | solid-ui

                                                          Function fromNT

                                                          • Parameters

                                                            • str: any

                                                            Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.graph.html b/Documentation/api/functions/rdf.graph.html index e39ccce0..56d79d2b 100644 --- a/Documentation/api/functions/rdf.graph.html +++ b/Documentation/api/functions/rdf.graph.html @@ -1 +1 @@ -graph | solid-ui

                                                          Function graph

                                                          • Parameters

                                                            • Optional features: any
                                                            • Optional opts: any

                                                            Returns Store

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +graph | solid-ui

                                                          Function graph

                                                          • Parameters

                                                            • Optional features: any
                                                            • Optional opts: any

                                                            Returns Store

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isBlankNode.html b/Documentation/api/functions/rdf.isBlankNode.html index 7c911c3a..b01887e2 100644 --- a/Documentation/api/functions/rdf.isBlankNode.html +++ b/Documentation/api/functions/rdf.isBlankNode.html @@ -1,2 +1,2 @@ -isBlankNode | solid-ui

                                                          Function isBlankNode

                                                          • TypeGuard for RDF/JS spec BlankNodes

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is BlankNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isBlankNode | solid-ui

                                                          Function isBlankNode

                                                          • TypeGuard for RDF/JS spec BlankNodes

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is BlankNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isCollection.html b/Documentation/api/functions/rdf.isCollection.html index 99ac7cfb..1ff00836 100644 --- a/Documentation/api/functions/rdf.isCollection.html +++ b/Documentation/api/functions/rdf.isCollection.html @@ -1,2 +1,2 @@ -isCollection | solid-ui

                                                          Function isCollection

                                                          • TypeGuard for RDFLib Collections

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Collection<any>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isCollection | solid-ui

                                                          Function isCollection

                                                          • TypeGuard for RDFLib Collections

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Collection<any>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isGraph.html b/Documentation/api/functions/rdf.isGraph.html index 2673fc84..b106001d 100644 --- a/Documentation/api/functions/rdf.isGraph.html +++ b/Documentation/api/functions/rdf.isGraph.html @@ -1,2 +1,2 @@ -isGraph | solid-ui

                                                          Function isGraph

                                                          • TypeGuard for valid RDF/JS Graph types

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Graph

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isGraph | solid-ui

                                                          Function isGraph

                                                          • TypeGuard for valid RDF/JS Graph types

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Graph

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isLiteral.html b/Documentation/api/functions/rdf.isLiteral.html index 19cbeaba..0f41080f 100644 --- a/Documentation/api/functions/rdf.isLiteral.html +++ b/Documentation/api/functions/rdf.isLiteral.html @@ -1,2 +1,2 @@ -isLiteral | solid-ui

                                                          Function isLiteral

                                                          • TypeGuard for RDF/JS spec Literals

                                                            -

                                                            Parameters

                                                            • value: any

                                                            Returns value is Literal

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isLiteral | solid-ui

                                                          Function isLiteral

                                                          • TypeGuard for RDF/JS spec Literals

                                                            +

                                                            Parameters

                                                            • value: any

                                                            Returns value is Literal

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isNamedNode.html b/Documentation/api/functions/rdf.isNamedNode.html index 2815f606..fc46c2d3 100644 --- a/Documentation/api/functions/rdf.isNamedNode.html +++ b/Documentation/api/functions/rdf.isNamedNode.html @@ -1,2 +1,2 @@ -isNamedNode | solid-ui

                                                          Function isNamedNode

                                                          • TypeGuard for RDF/JS spec NamedNodes

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isNamedNode | solid-ui

                                                          Function isNamedNode

                                                          • TypeGuard for RDF/JS spec NamedNodes

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isPredicate.html b/Documentation/api/functions/rdf.isPredicate.html index 629ff3f2..284f7646 100644 --- a/Documentation/api/functions/rdf.isPredicate.html +++ b/Documentation/api/functions/rdf.isPredicate.html @@ -1,2 +1,2 @@ -isPredicate | solid-ui

                                                          Function isPredicate

                                                          • TypeGuard for valid RDF/JS spec Predicate types

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Predicate

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isPredicate | solid-ui

                                                          Function isPredicate

                                                          • TypeGuard for valid RDF/JS spec Predicate types

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Predicate

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isQuad.html b/Documentation/api/functions/rdf.isQuad.html index 6c4d0506..123dada2 100644 --- a/Documentation/api/functions/rdf.isQuad.html +++ b/Documentation/api/functions/rdf.isQuad.html @@ -1,2 +1,2 @@ -isQuad | solid-ui

                                                          Function isQuad

                                                          • TypeGuard for RDF/JS spec Quads

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad<any, any, any, any>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isQuad | solid-ui

                                                          Function isQuad

                                                          • TypeGuard for RDF/JS spec Quads

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad<any, any, any, any>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isRDFObject.html b/Documentation/api/functions/rdf.isRDFObject.html index abeff63a..be1aa5bd 100644 --- a/Documentation/api/functions/rdf.isRDFObject.html +++ b/Documentation/api/functions/rdf.isRDFObject.html @@ -1,2 +1,2 @@ -isRDFObject | solid-ui

                                                          Function isRDFObject

                                                          • TypeGuard for valid RDF/JS spec Object types

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Object

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isRDFObject | solid-ui

                                                          Function isRDFObject

                                                          • TypeGuard for valid RDF/JS spec Object types

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Object

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isRDFlibObject.html b/Documentation/api/functions/rdf.isRDFlibObject.html index b31b8dff..c62932dd 100644 --- a/Documentation/api/functions/rdf.isRDFlibObject.html +++ b/Documentation/api/functions/rdf.isRDFlibObject.html @@ -1,2 +1,2 @@ -isRDFlibObject | solid-ui

                                                          Function isRDFlibObject

                                                          • TypeGuard for valid RDFlib Object types, also allows Collections, Graphs

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is ObjectType

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isRDFlibObject | solid-ui

                                                          Function isRDFlibObject

                                                          • TypeGuard for valid RDFlib Object types, also allows Collections, Graphs

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is ObjectType

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isRDFlibPredicate.html b/Documentation/api/functions/rdf.isRDFlibPredicate.html index bf531d7b..c2caa413 100644 --- a/Documentation/api/functions/rdf.isRDFlibPredicate.html +++ b/Documentation/api/functions/rdf.isRDFlibPredicate.html @@ -1,2 +1,2 @@ -isRDFlibPredicate | solid-ui

                                                          Function isRDFlibPredicate

                                                          • TypeGuard for valid RDF/JS spec Predicate types

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Predicate

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isRDFlibPredicate | solid-ui

                                                          Function isRDFlibPredicate

                                                          • TypeGuard for valid RDF/JS spec Predicate types

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Predicate

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isRDFlibSubject.html b/Documentation/api/functions/rdf.isRDFlibSubject.html index 53d8207e..94947ef4 100644 --- a/Documentation/api/functions/rdf.isRDFlibSubject.html +++ b/Documentation/api/functions/rdf.isRDFlibSubject.html @@ -1,2 +1,2 @@ -isRDFlibSubject | solid-ui

                                                          Function isRDFlibSubject

                                                          • TypeGuard for valid RDFlib Subject types, same as Object as RDFLib symmetrical.

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is ObjectType

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isRDFlibSubject | solid-ui

                                                          Function isRDFlibSubject

                                                          • TypeGuard for valid RDFlib Subject types, same as Object as RDFLib symmetrical.

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is ObjectType

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isStatement.html b/Documentation/api/functions/rdf.isStatement.html index 55e563e1..d05ff072 100644 --- a/Documentation/api/functions/rdf.isStatement.html +++ b/Documentation/api/functions/rdf.isStatement.html @@ -1,2 +1,2 @@ -isStatement | solid-ui

                                                          Function isStatement

                                                          • TypeGuard for RDFLib Statements

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Statement<SubjectType, PredicateType, ObjectType, GraphType>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isStatement | solid-ui

                                                          Function isStatement

                                                          • TypeGuard for RDFLib Statements

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Statement<SubjectType, PredicateType, ObjectType, GraphType>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isStore.html b/Documentation/api/functions/rdf.isStore.html index d16a41dd..dc399902 100644 --- a/Documentation/api/functions/rdf.isStore.html +++ b/Documentation/api/functions/rdf.isStore.html @@ -1,2 +1,2 @@ -isStore | solid-ui

                                                          Function isStore

                                                          • TypeGuard for RDFlib Stores

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Store

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isStore | solid-ui

                                                          Function isStore

                                                          • TypeGuard for RDFlib Stores

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Store

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isSubject.html b/Documentation/api/functions/rdf.isSubject.html index 961953eb..9f7a8120 100644 --- a/Documentation/api/functions/rdf.isSubject.html +++ b/Documentation/api/functions/rdf.isSubject.html @@ -1,2 +1,2 @@ -isSubject | solid-ui

                                                          Function isSubject

                                                          • TypeGuard for valid RDF/JS spec Subject types

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Subject

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isSubject | solid-ui

                                                          Function isSubject

                                                          • TypeGuard for valid RDF/JS spec Subject types

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Quad_Subject

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isTerm.html b/Documentation/api/functions/rdf.isTerm.html index d38b869f..2de5166b 100644 --- a/Documentation/api/functions/rdf.isTerm.html +++ b/Documentation/api/functions/rdf.isTerm.html @@ -1,2 +1,2 @@ -isTerm | solid-ui

                                                          Function isTerm

                                                          • TypeGuard for RDF/JS spec Terms

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Term

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isTerm | solid-ui

                                                          Function isTerm

                                                          • TypeGuard for RDF/JS spec Terms

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Term

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.isVariable.html b/Documentation/api/functions/rdf.isVariable.html index ec6ac388..4606123a 100644 --- a/Documentation/api/functions/rdf.isVariable.html +++ b/Documentation/api/functions/rdf.isVariable.html @@ -1,2 +1,2 @@ -isVariable | solid-ui

                                                          Function isVariable

                                                          • TypeGuard for RDFLib Variables

                                                            -

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Variable

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +isVariable | solid-ui

                                                          Function isVariable

                                                          • TypeGuard for RDFLib Variables

                                                            +

                                                            Parameters

                                                            • obj: any

                                                            Returns obj is Variable

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.jsonParser.parseJSON.html b/Documentation/api/functions/rdf.jsonParser.parseJSON.html index ea305b78..4dfabd7c 100644 --- a/Documentation/api/functions/rdf.jsonParser.parseJSON.html +++ b/Documentation/api/functions/rdf.jsonParser.parseJSON.html @@ -1 +1 @@ -parseJSON | solid-ui
                                                          • Parameters

                                                            • data: any
                                                            • source: any
                                                            • store: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +parseJSON | solid-ui
                                                          • Parameters

                                                            • data: any
                                                            • source: any
                                                            • store: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.lit.html b/Documentation/api/functions/rdf.lit.html index 3cb9c74e..c7b95872 100644 --- a/Documentation/api/functions/rdf.lit.html +++ b/Documentation/api/functions/rdf.lit.html @@ -1 +1 @@ -lit | solid-ui

                                                          Function lit

                                                          • Parameters

                                                            • val: string
                                                            • Optional lang: string
                                                            • Optional dt: NamedNode

                                                            Returns Literal

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +lit | solid-ui

                                                          Function lit

                                                          • Parameters

                                                            • val: string
                                                            • Optional lang: string
                                                            • Optional dt: NamedNode

                                                            Returns Literal

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.literal-1.html b/Documentation/api/functions/rdf.literal-1.html index e2a2c31d..78079188 100644 --- a/Documentation/api/functions/rdf.literal-1.html +++ b/Documentation/api/functions/rdf.literal-1.html @@ -1 +1 @@ -literal | solid-ui

                                                          Function literal

                                                          • Parameters

                                                            • value: string
                                                            • Optional languageOrDatatype: string | NamedNode

                                                            Returns Literal

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +literal | solid-ui

                                                          Function literal

                                                          • Parameters

                                                            • value: string
                                                            • Optional languageOrDatatype: string | NamedNode

                                                            Returns Literal

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.log.debug.html b/Documentation/api/functions/rdf.log.debug.html index 55fe9890..0a49d2f4 100644 --- a/Documentation/api/functions/rdf.log.debug.html +++ b/Documentation/api/functions/rdf.log.debug.html @@ -1 +1 @@ -debug | solid-ui

                                                          Function debug

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +debug | solid-ui

                                                          Function debug

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.log.error.html b/Documentation/api/functions/rdf.log.error.html index ebac37db..a6089fe7 100644 --- a/Documentation/api/functions/rdf.log.error.html +++ b/Documentation/api/functions/rdf.log.error.html @@ -1 +1 @@ -error | solid-ui

                                                          Function error

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +error | solid-ui

                                                          Function error

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.log.info.html b/Documentation/api/functions/rdf.log.info.html index 44954a15..08658cf4 100644 --- a/Documentation/api/functions/rdf.log.info.html +++ b/Documentation/api/functions/rdf.log.info.html @@ -1 +1 @@ -info | solid-ui

                                                          Function info

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +info | solid-ui

                                                          Function info

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.log.msg.html b/Documentation/api/functions/rdf.log.msg.html index 4f6ae6c9..9f104efb 100644 --- a/Documentation/api/functions/rdf.log.msg.html +++ b/Documentation/api/functions/rdf.log.msg.html @@ -1 +1 @@ -msg | solid-ui

                                                          Function msg

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +msg | solid-ui

                                                          Function msg

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.log.success.html b/Documentation/api/functions/rdf.log.success.html index b893c535..28e7a915 100644 --- a/Documentation/api/functions/rdf.log.success.html +++ b/Documentation/api/functions/rdf.log.success.html @@ -1 +1 @@ -success | solid-ui

                                                          Function success

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +success | solid-ui

                                                          Function success

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.log.warn.html b/Documentation/api/functions/rdf.log.warn.html index 8f2b9df5..7108350f 100644 --- a/Documentation/api/functions/rdf.log.warn.html +++ b/Documentation/api/functions/rdf.log.warn.html @@ -1 +1 @@ -warn | solid-ui

                                                          Function warn

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +warn | solid-ui

                                                          Function warn

                                                          • Parameters

                                                            • x: any

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.parse.html b/Documentation/api/functions/rdf.parse.html index 0aa6ca26..4a29cffa 100644 --- a/Documentation/api/functions/rdf.parse.html +++ b/Documentation/api/functions/rdf.parse.html @@ -1,4 +1,4 @@ -parse | solid-ui

                                                          Function parse

                                                          • Parse a string and put the result into the graph kb. +parse | solid-ui

                                                            Function parse

                                                            • Parse a string and put the result into the graph kb. Normal method is sync. Unfortunately jsdonld is currently written to need to be called async. Hence the mess below with executeCallback.

                                                              @@ -7,4 +7,4 @@
                                                            • base: string

                                                              The base URI to use

                                                            • Optional contentType: string

                                                              The MIME content type string for the input - defaults to text/turtle

                                                            • Optional callback: CallbackFunc

                                                              The callback to call when the data has been loaded

                                                              -

                                                            Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.quad.html b/Documentation/api/functions/rdf.quad.html index ed7413cb..f8ecf2c9 100644 --- a/Documentation/api/functions/rdf.quad.html +++ b/Documentation/api/functions/rdf.quad.html @@ -1 +1 @@ -quad | solid-ui

                                                          Function quad

                                                          • Parameters

                                                            • subject: Term
                                                            • predicate: Term
                                                            • object: Term
                                                            • Optional graph: Term

                                                            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +quad | solid-ui

                                                          Function quad

                                                          • Parameters

                                                            • subject: Term
                                                            • predicate: Term
                                                            • object: Term
                                                            • Optional graph: Term

                                                            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.queryToSPARQL.html b/Documentation/api/functions/rdf.queryToSPARQL.html index 2df558d3..98c7ab8e 100644 --- a/Documentation/api/functions/rdf.queryToSPARQL.html +++ b/Documentation/api/functions/rdf.queryToSPARQL.html @@ -1 +1 @@ -queryToSPARQL | solid-ui

                                                          Function queryToSPARQL

                                                          • Parameters

                                                            • query: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +queryToSPARQL | solid-ui

                                                          Function queryToSPARQL

                                                          • Parameters

                                                            • query: any

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.serialize.html b/Documentation/api/functions/rdf.serialize.html index 66057d03..3a681b7f 100644 --- a/Documentation/api/functions/rdf.serialize.html +++ b/Documentation/api/functions/rdf.serialize.html @@ -1,4 +1,4 @@ -serialize | solid-ui

                                                          Function serialize

                                                          • Serialize to the appropriate format

                                                            +serialize | solid-ui

                                                            Function serialize

                                                            • Serialize to the appropriate format

                                                              Parameters

                                                              • target: null | NamedNode | BlankNode | Formula

                                                                The graph or nodes that should be serialized

                                                              • kb: Formula

                                                                The store

                                                              • Optional base: unknown
                                                              • Optional contentType: string

                                                                The mime type. @@ -6,4 +6,4 @@

                                                              • Optional callback: ((err, result?) => any)
                                                                  • (err, result?): any
                                                                  • Parameters

                                                                    • err: undefined | null | Error
                                                                    • Optional result: string

                                                                    Returns any

                                                              • Optional options: {
                                                                    flags?: string;
                                                                    namespaces?: Record<string, string>;
                                                                }
                                                                • Optional flags?: string

                                                                  A string of letters, each of which set an options e.g. deinprstux

                                                                • Optional namespaces?: Record<string, string>

                                                                  A set of [prefix, uri] pairs that define namespace prefixes

                                                                  -

                                                              Returns string | undefined

                                                            Generated using TypeDoc

                                                            \ No newline at end of file +

                                                          Returns string | undefined

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.sparqlUpdateParser.html b/Documentation/api/functions/rdf.sparqlUpdateParser.html index f5c364ad..7ff8858b 100644 --- a/Documentation/api/functions/rdf.sparqlUpdateParser.html +++ b/Documentation/api/functions/rdf.sparqlUpdateParser.html @@ -1 +1 @@ -sparqlUpdateParser | solid-ui

                                                          Function sparqlUpdateParser

                                                          • Parameters

                                                            • str: any
                                                            • kb: any
                                                            • base: any

                                                            Returns {
                                                                query: any;
                                                            }

                                                            • query: any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +sparqlUpdateParser | solid-ui

                                                          Function sparqlUpdateParser

                                                          • Parameters

                                                            • str: any
                                                            • kb: any
                                                            • base: any

                                                            Returns {
                                                                query: any;
                                                            }

                                                            • query: any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.st.html b/Documentation/api/functions/rdf.st.html index 2e068b82..e52610ac 100644 --- a/Documentation/api/functions/rdf.st.html +++ b/Documentation/api/functions/rdf.st.html @@ -1 +1 @@ -st | solid-ui

                                                          Function st

                                                          • Parameters

                                                            • subject: Quad_Subject
                                                            • predicate: Quad_Predicate
                                                            • object: Quad_Object
                                                            • Optional graph: Quad_Graph

                                                            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +st | solid-ui

                                                          Function st

                                                          • Parameters

                                                            • subject: Quad_Subject
                                                            • predicate: Quad_Predicate
                                                            • object: Quad_Object
                                                            • Optional graph: Quad_Graph

                                                            Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.sym.html b/Documentation/api/functions/rdf.sym.html index 671275ac..f88d05ea 100644 --- a/Documentation/api/functions/rdf.sym.html +++ b/Documentation/api/functions/rdf.sym.html @@ -1 +1 @@ -sym | solid-ui

                                                          Function sym

                                                          • Parameters

                                                            • value: string

                                                            Returns NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +sym | solid-ui

                                                          Function sym

                                                          • Parameters

                                                            • value: string

                                                            Returns NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.term.html b/Documentation/api/functions/rdf.term.html index 863f7b03..5383bad7 100644 --- a/Documentation/api/functions/rdf.term.html +++ b/Documentation/api/functions/rdf.term.html @@ -1 +1 @@ -term | solid-ui

                                                          Function term

                                                          • Type Parameters

                                                            • T extends FromValueReturns<any>

                                                            Parameters

                                                            • value: ValueType

                                                            Returns T

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +term | solid-ui

                                                          Function term

                                                          • Type Parameters

                                                            • T extends FromValueReturns<any>

                                                            Parameters

                                                            • value: ValueType

                                                            Returns T

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.termValue.html b/Documentation/api/functions/rdf.termValue.html index a6cbbc83..cfbda088 100644 --- a/Documentation/api/functions/rdf.termValue.html +++ b/Documentation/api/functions/rdf.termValue.html @@ -1,2 +1,2 @@ -termValue | solid-ui

                                                          Function termValue

                                                          • Retrieve the value of a term, or self if already a string.

                                                            -

                                                            Parameters

                                                            • node: string | Term

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +termValue | solid-ui

                                                          Function termValue

                                                          • Retrieve the value of a term, or self if already a string.

                                                            +

                                                            Parameters

                                                            • node: string | Term

                                                            Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.triple.html b/Documentation/api/functions/rdf.triple.html index 489a42d5..4b704f01 100644 --- a/Documentation/api/functions/rdf.triple.html +++ b/Documentation/api/functions/rdf.triple.html @@ -1 +1 @@ -triple | solid-ui

                                                          Function triple

                                                          • Parameters

                                                            • subject: Term
                                                            • predicate: Term
                                                            • object: Term
                                                            • Optional graph: Term

                                                            Returns Quad<any, any, any, any>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +triple | solid-ui

                                                          Function triple

                                                          • Parameters

                                                            • subject: Term
                                                            • predicate: Term
                                                            • object: Term
                                                            • Optional graph: Term

                                                            Returns Quad<any, any, any, any>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.uri.docpart.html b/Documentation/api/functions/rdf.uri.docpart.html index 07211856..5770c174 100644 --- a/Documentation/api/functions/rdf.uri.docpart.html +++ b/Documentation/api/functions/rdf.uri.docpart.html @@ -1,3 +1,3 @@ -docpart | solid-ui

                                                          Function docpart

                                                          Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.uri.document.html b/Documentation/api/functions/rdf.uri.document.html index e3f708cb..99cf7371 100644 --- a/Documentation/api/functions/rdf.uri.document.html +++ b/Documentation/api/functions/rdf.uri.document.html @@ -1,3 +1,3 @@ -document | solid-ui

                                                          Function document

                                                          Returns NamedNode

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.uri.hostpart.html b/Documentation/api/functions/rdf.uri.hostpart.html index 39b8021d..81b02016 100644 --- a/Documentation/api/functions/rdf.uri.hostpart.html +++ b/Documentation/api/functions/rdf.uri.hostpart.html @@ -1,3 +1,3 @@ -hostpart | solid-ui

                                                          Function hostpart

                                                          Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.uri.join.html b/Documentation/api/functions/rdf.uri.join.html index b63799f9..4c6c4d64 100644 --- a/Documentation/api/functions/rdf.uri.join.html +++ b/Documentation/api/functions/rdf.uri.join.html @@ -1,4 +1,4 @@ -join | solid-ui

                                                          Function join

                                                          Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.uri.protocol.html b/Documentation/api/functions/rdf.uri.protocol.html index 4257eee9..f2115e67 100644 --- a/Documentation/api/functions/rdf.uri.protocol.html +++ b/Documentation/api/functions/rdf.uri.protocol.html @@ -1,3 +1,3 @@ -protocol | solid-ui

                                                          Function protocol

                                                          Returns string | null

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.uri.refTo.html b/Documentation/api/functions/rdf.uri.refTo.html index 152406e5..acc6d0be 100644 --- a/Documentation/api/functions/rdf.uri.refTo.html +++ b/Documentation/api/functions/rdf.uri.refTo.html @@ -1,4 +1,4 @@ -refTo | solid-ui

                                                          Function refTo

                                                          Returns string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/rdf.variable-1.html b/Documentation/api/functions/rdf.variable-1.html index b4d82c10..94089d7c 100644 --- a/Documentation/api/functions/rdf.variable-1.html +++ b/Documentation/api/functions/rdf.variable-1.html @@ -1 +1 @@ -variable | solid-ui

                                                          Function variable

                                                          • Parameters

                                                            • value: string

                                                            Returns Variable

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +variable | solid-ui

                                                          Function variable

                                                          • Parameters

                                                            • value: string

                                                            Returns Variable

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/functions/tabs.tabWidget.html b/Documentation/api/functions/tabs.tabWidget.html index a03ee9c1..b1ccbdca 100644 --- a/Documentation/api/functions/tabs.tabWidget.html +++ b/Documentation/api/functions/tabs.tabWidget.html @@ -1,4 +1,4 @@ -tabWidget | solid-ui

                                                          Function tabWidget

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/index.html b/Documentation/api/index.html index 13986342..77d60cd4 100644 --- a/Documentation/api/index.html +++ b/Documentation/api/index.html @@ -39,4 +39,4 @@

                                                          Further documentation

                                                          -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/interfaces/createTypes.NewAppInstanceOptions.html b/Documentation/api/interfaces/createTypes.NewAppInstanceOptions.html index 48e43fda..9b15c52c 100644 --- a/Documentation/api/interfaces/createTypes.NewAppInstanceOptions.html +++ b/Documentation/api/interfaces/createTypes.NewAppInstanceOptions.html @@ -1,4 +1,4 @@ -NewAppInstanceOptions | solid-ui

                                                          Interface NewAppInstanceOptions

                                                          Hierarchy

                                                          • NewAppInstanceOptions

                                                          Properties

                                                          appPathSegment? +NewAppInstanceOptions | solid-ui

                                                          Interface NewAppInstanceOptions

                                                          interface NewAppInstanceOptions {
                                                              appPathSegment?: string;
                                                              div: HTMLElement;
                                                              dom: HTMLDocument;
                                                              event: any;
                                                              folder: null | NamedNode;
                                                              iconEle: HTMLImageElement;
                                                              me: NamedNode;
                                                              noIndexHTML: boolean;
                                                              noun: string;
                                                              pane: PaneDefinition;
                                                              refreshTarget?: HTMLTableElement;
                                                          }

                                                          Properties

                                                          Properties

                                                          appPathSegment?: string
                                                          div: HTMLElement
                                                          dom: HTMLDocument
                                                          event: any
                                                          folder: null | NamedNode
                                                          iconEle: HTMLImageElement
                                                          noIndexHTML: boolean
                                                          noun: string
                                                          pane: PaneDefinition
                                                          refreshTarget?: HTMLTableElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Properties

                                                          appPathSegment?: string
                                                          div: HTMLElement
                                                          dom: HTMLDocument
                                                          event: any
                                                          folder: null | NamedNode
                                                          iconEle: HTMLImageElement
                                                          noIndexHTML: boolean
                                                          noun: string
                                                          pane: PaneDefinition
                                                          refreshTarget?: HTMLTableElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/interfaces/language.Binding.html b/Documentation/api/interfaces/language.Binding.html index 1f29f6ab..07cf849b 100644 --- a/Documentation/api/interfaces/language.Binding.html +++ b/Documentation/api/interfaces/language.Binding.html @@ -1,5 +1,5 @@ -Binding | solid-ui

                                                          Interface Binding

                                                          Hierarchy

                                                          • Binding

                                                          Properties

                                                          coordinates? +Binding | solid-ui

                                                          Interface Binding

                                                          interface Binding {
                                                              coordinates?: Node;
                                                              location?: Node;
                                                              name?: Node;
                                                              subject: Node;
                                                          }

                                                          Properties

                                                          coordinates?: Node
                                                          location?: Node
                                                          name?: Node
                                                          subject: Node

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Properties

                                                          coordinates?: Node
                                                          location?: Node
                                                          name?: Node
                                                          subject: Node

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/interfaces/rdf.AutoInitOptions.html b/Documentation/api/interfaces/rdf.AutoInitOptions.html index 0194f1e7..85e56387 100644 --- a/Documentation/api/interfaces/rdf.AutoInitOptions.html +++ b/Documentation/api/interfaces/rdf.AutoInitOptions.html @@ -1,5 +1,5 @@ AutoInitOptions | solid-ui

                                                          Interface AutoInitOptions

                                                          Initiated by initFetchOptions, which runs on load

                                                          -

                                                          Hierarchy

                                                          • RequestInit
                                                            • AutoInitOptions

                                                          Properties

                                                          interface AutoInitOptions {
                                                              actualProxyURI?: string;
                                                              baseURI: string;
                                                              body?: string;
                                                              cache?: RequestCache;
                                                              clearPreviousData?: boolean;
                                                              contentType?: string;
                                                              credentials?: "include" | "omit";
                                                              data?: string;
                                                              fetch?: Fetch;
                                                              force?: boolean;
                                                              forceContentType?: ContentType;
                                                              handlers?: Handler[];
                                                              headers: HeadersInit;
                                                              integrity?: string;
                                                              keepalive?: boolean;
                                                              method?: HTTPMethods;
                                                              mode?: RequestMode;
                                                              noMeta?: boolean;
                                                              noRDFa?: boolean;
                                                              original: NamedNode;
                                                              proxyUsed?: boolean;
                                                              redirect?: RequestRedirect;
                                                              referrer?: string;
                                                              referrerPolicy?: ReferrerPolicy;
                                                              referringTerm?: NamedNode;
                                                              req: BlankNode;
                                                              requestedURI?: string;
                                                              resource: Quad_Subject;
                                                              retriedWithNoCredentials?: boolean;
                                                              signal?: null | AbortSignal;
                                                              timeout?: number;
                                                              window?: null;
                                                              withCredentials?: boolean;
                                                          }

                                                          Hierarchy

                                                          • RequestInit
                                                            • AutoInitOptions

                                                          Properties

                                                          actualProxyURI? baseURI body? cache? @@ -58,4 +58,4 @@
                                                          req: BlankNode
                                                          requestedURI?: string
                                                          resource: Quad_Subject
                                                          retriedWithNoCredentials?: boolean
                                                          signal?: null | AbortSignal

                                                          An AbortSignal to set request's signal.

                                                          timeout?: number
                                                          window?: null

                                                          Can only be null. Used to disassociate request from any Window.

                                                          withCredentials?: boolean

                                                          flag for XHR/CORS etc

                                                          -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/interfaces/rdf.ExtendedResponse.html b/Documentation/api/interfaces/rdf.ExtendedResponse.html index c67553c0..b70e2059 100644 --- a/Documentation/api/interfaces/rdf.ExtendedResponse.html +++ b/Documentation/api/interfaces/rdf.ExtendedResponse.html @@ -1,5 +1,5 @@ ExtendedResponse | solid-ui

                                                          Interface ExtendedResponse

                                                          An extended interface of Response, since RDFlib.js adds some properties.

                                                          -

                                                          Hierarchy

                                                          • Response
                                                            • ExtendedResponse

                                                          Properties

                                                          interface ExtendedResponse {
                                                              body: null | ReadableStream<Uint8Array>;
                                                              bodyUsed: boolean;
                                                              error?: string;
                                                              headers: Headers;
                                                              ok: boolean;
                                                              redirected: boolean;
                                                              req?: Quad_Subject;
                                                              responseText?: string;
                                                              size?: number;
                                                              status: number;
                                                              statusText: string;
                                                              timeout?: number;
                                                              type: ResponseType;
                                                              url: string;
                                                              arrayBuffer(): Promise<ArrayBuffer>;
                                                              blob(): Promise<Blob>;
                                                              clone(): Response;
                                                              formData(): Promise<FormData>;
                                                              json(): Promise<any>;
                                                              text(): Promise<string>;
                                                          }

                                                          Hierarchy

                                                          • Response
                                                            • ExtendedResponse

                                                          Properties

                                                          body bodyUsed error? headers @@ -22,4 +22,4 @@

                                                          Properties

                                                          body: null | ReadableStream<Uint8Array>
                                                          bodyUsed: boolean
                                                          error?: string

                                                          Used in UpdateManager.updateDav

                                                          headers: Headers
                                                          ok: boolean
                                                          redirected: boolean
                                                          req?: Quad_Subject

                                                          Identifier of the reqest

                                                          responseText?: string

                                                          String representation of the Body

                                                          -
                                                          size?: number
                                                          status: number
                                                          statusText: string
                                                          timeout?: number
                                                          type: ResponseType
                                                          url: string

                                                          Methods

                                                          • Returns Promise<ArrayBuffer>

                                                          • Returns Promise<Blob>

                                                          • Returns Response

                                                          • Returns Promise<FormData>

                                                          • Returns Promise<any>

                                                          • Returns Promise<string>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +
                                                          size?: number
                                                          status: number
                                                          statusText: string
                                                          timeout?: number
                                                          type: ResponseType
                                                          url: string

                                                          Methods

                                                          • Returns Promise<ArrayBuffer>

                                                          • Returns Promise<Blob>

                                                          • Returns Response

                                                          • Returns Promise<FormData>

                                                          • Returns Promise<any>

                                                          • Returns Promise<string>

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/interfaces/rdf.FetchError.html b/Documentation/api/interfaces/rdf.FetchError.html index 72ae20f9..c5bcecfd 100644 --- a/Documentation/api/interfaces/rdf.FetchError.html +++ b/Documentation/api/interfaces/rdf.FetchError.html @@ -1,7 +1,7 @@ -FetchError | solid-ui

                                                          Interface FetchError

                                                          Hierarchy

                                                          • Error
                                                            • FetchError

                                                          Properties

                                                          message +FetchError | solid-ui

                                                          Interface FetchError

                                                          interface FetchError {
                                                              message: string;
                                                              name: string;
                                                              response?: ExtendedResponse;
                                                              stack?: string;
                                                              status?: StatusValues;
                                                              statusText?: string;
                                                          }

                                                          Hierarchy

                                                          • Error
                                                            • FetchError

                                                          Properties

                                                          message: string
                                                          name: string
                                                          response?: ExtendedResponse
                                                          stack?: string
                                                          status?: StatusValues
                                                          statusText?: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Properties

                                                          message: string
                                                          name: string
                                                          response?: ExtendedResponse
                                                          stack?: string
                                                          status?: StatusValues
                                                          statusText?: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules.html b/Documentation/api/modules.html index b773921f..29d62ef0 100644 --- a/Documentation/api/modules.html +++ b/Documentation/api/modules.html @@ -13,7 +13,6 @@ participation rdf tabs -

                                                          Properties

                                                          Variables

                                                          Functions

                                                          References

                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns

                                                          Properties

                                                          ns: any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          References

                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns
                                                          Renames and re-exports ns

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/createTypes.html b/Documentation/api/modules/createTypes.html index a274dcf2..0f341c5c 100644 --- a/Documentation/api/modules/createTypes.html +++ b/Documentation/api/modules/createTypes.html @@ -1,3 +1,3 @@ -createTypes | solid-ui

                                                          Namespace createTypes

                                                          Index

                                                          Interfaces

                                                          NewAppInstanceOptions +createTypes | solid-ui

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/language.html b/Documentation/api/modules/language.html index fb242235..70425919 100644 --- a/Documentation/api/modules/language.html +++ b/Documentation/api/modules/language.html @@ -1,8 +1,8 @@ -language | solid-ui

                                                          Namespace language

                                                          Index

                                                          Interfaces

                                                          Binding +language | solid-ui

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/log.html b/Documentation/api/modules/log.html index b46e9af6..4e77b8b2 100644 --- a/Documentation/api/modules/log.html +++ b/Documentation/api/modules/log.html @@ -1,4 +1,4 @@ -log | solid-ui

                                                          Namespace log

                                                          Index

                                                          Functions

                                                          alert +log | solid-ui

                                                          Namespace log

                                                          Index

                                                          Functions

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/login.html b/Documentation/api/modules/login.html index 92c02aed..62ef60b4 100644 --- a/Documentation/api/modules/login.html +++ b/Documentation/api/modules/login.html @@ -20,7 +20,7 @@
                                                        • Vocabulary: "load" loads a file if it exists;
                                                        • 'Ensure" CREATES the file if it does not exist (if it can) and then loads it.
                                                        • -

                                                          Index

                                                          Functions

                                                          Index

                                                          Functions

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/pad.html b/Documentation/api/modules/pad.html index 6b6e8285..cb07f34f 100644 --- a/Documentation/api/modules/pad.html +++ b/Documentation/api/modules/pad.html @@ -1,4 +1,4 @@ -pad | solid-ui

                                                          Namespace pad

                                                          Index

                                                          Functions

                                                          getChunks +pad | solid-ui

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/participation.html b/Documentation/api/modules/participation.html index ade4cdc8..49bed8bb 100644 --- a/Documentation/api/modules/participation.html +++ b/Documentation/api/modules/participation.html @@ -1,5 +1,5 @@ -participation | solid-ui

                                                          Namespace participation

                                                          References

                                                          manageParticipation +participation | solid-ui

                                                          Namespace participation

                                                          References

                                                          Re-exports manageParticipation
                                                          Re-exports participationObject
                                                          Re-exports recordParticipation
                                                          Re-exports renderPartipants

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          References

                                                          Re-exports manageParticipation
                                                          Re-exports participationObject
                                                          Re-exports recordParticipation
                                                          Re-exports renderPartipants

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/rdf.RDFaProcessor.html b/Documentation/api/modules/rdf.RDFaProcessor.html index c7c04fe8..7e3ad8f6 100644 --- a/Documentation/api/modules/rdf.RDFaProcessor.html +++ b/Documentation/api/modules/rdf.RDFaProcessor.html @@ -7,4 +7,4 @@ nameStartChar objectURI typeURI -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/rdf.Util.html b/Documentation/api/modules/rdf.Util.html index e0a1ffdf..410d097f 100644 --- a/Documentation/api/modules/rdf.Util.html +++ b/Documentation/api/modules/rdf.Util.html @@ -15,4 +15,4 @@ parseXML stackString string_startswith -

                                                          References

                                                          Re-exports log
                                                          Re-exports uri

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          References

                                                          Re-exports log
                                                          Re-exports uri

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/rdf.Util.string.html b/Documentation/api/modules/rdf.Util.string.html index 44f07c3b..5716fd13 100644 --- a/Documentation/api/modules/rdf.Util.string.html +++ b/Documentation/api/modules/rdf.Util.string.html @@ -1,2 +1,2 @@ string | solid-ui

                                                          Namespace string

                                                          Index

                                                          Functions

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/rdf.html b/Documentation/api/modules/rdf.html index 37070ab0..643b360e 100644 --- a/Documentation/api/modules/rdf.html +++ b/Documentation/api/modules/rdf.html @@ -67,4 +67,4 @@ termValue triple variable -

                                                          References

                                                          Renames and re-exports Store
                                                          Renames and re-exports __type
                                                          Renames and re-exports sym

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          References

                                                          Renames and re-exports Store
                                                          Renames and re-exports __type
                                                          Renames and re-exports sym

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/rdf.jsonParser.html b/Documentation/api/modules/rdf.jsonParser.html index 87d13cff..1044970d 100644 --- a/Documentation/api/modules/rdf.jsonParser.html +++ b/Documentation/api/modules/rdf.jsonParser.html @@ -1,2 +1,2 @@ jsonParser | solid-ui

                                                          Namespace jsonParser

                                                          Index

                                                          Functions

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/rdf.log.html b/Documentation/api/modules/rdf.log.html index 8229a195..a8164101 100644 --- a/Documentation/api/modules/rdf.log.html +++ b/Documentation/api/modules/rdf.log.html @@ -4,4 +4,4 @@ msg success warn -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/rdf.uri.html b/Documentation/api/modules/rdf.uri.html index b427f76e..2ec87d5c 100644 --- a/Documentation/api/modules/rdf.uri.html +++ b/Documentation/api/modules/rdf.uri.html @@ -4,4 +4,4 @@ join protocol refTo -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/modules/tabs.html b/Documentation/api/modules/tabs.html index dbdc60f0..72c15d97 100644 --- a/Documentation/api/modules/tabs.html +++ b/Documentation/api/modules/tabs.html @@ -1,3 +1,3 @@ -tabs | solid-ui

                                                          Namespace tabs

                                                          Index

                                                          Classes

                                                          TabWidgetElement +tabs | solid-ui

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/types/createTypes.CreateContext.html b/Documentation/api/types/createTypes.CreateContext.html index 71b86f44..f3d42f70 100644 --- a/Documentation/api/types/createTypes.CreateContext.html +++ b/Documentation/api/types/createTypes.CreateContext.html @@ -1 +1 @@ -CreateContext | solid-ui

                                                          Type alias CreateContext

                                                          CreateContext: {
                                                              div: HTMLElement;
                                                              dom: HTMLDocument;
                                                              folder?: NamedNode;
                                                              me: NamedNode;
                                                              refreshTarget?: HTMLTableElement;
                                                              statusArea: HTMLElement;
                                                          }

                                                          Type declaration

                                                          • div: HTMLElement
                                                          • dom: HTMLDocument
                                                          • Optional folder?: NamedNode
                                                          • me: NamedNode
                                                          • Optional refreshTarget?: HTMLTableElement
                                                          • statusArea: HTMLElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +CreateContext | solid-ui

                                                          Type alias CreateContext

                                                          CreateContext: {
                                                              div: HTMLElement;
                                                              dom: HTMLDocument;
                                                              folder?: NamedNode;
                                                              me: NamedNode;
                                                              refreshTarget?: HTMLTableElement;
                                                              statusArea: HTMLElement;
                                                          }

                                                          Type declaration

                                                          • div: HTMLElement
                                                          • dom: HTMLDocument
                                                          • Optional folder?: NamedNode
                                                          • me: NamedNode
                                                          • Optional refreshTarget?: HTMLTableElement
                                                          • statusArea: HTMLElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/acl.html b/Documentation/api/variables/acl.html index d0017b0d..42298b2b 100644 --- a/Documentation/api/variables/acl.html +++ b/Documentation/api/variables/acl.html @@ -37,4 +37,4 @@

                                                          Accumulate the access rights which each agent or class has

                                                          Parameters

                                                          Returns AgentMapMap

                                                        • sameACL: ((a, b) => boolean)
                                                        • setACL: ((docURI, aclText, callbackFunction) => void)
                                                        • Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Parameters

                                                          Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/aclControl.html b/Documentation/api/variables/aclControl.html index 4aaab39a..c08f3fdf 100644 --- a/Documentation/api/variables/aclControl.html +++ b/Documentation/api/variables/aclControl.html @@ -22,4 +22,4 @@

                                                          Parameters

                                                          Returns string

                                                          Short name for the folder

                                                          -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/authn.html b/Documentation/api/variables/authn.html index ba0734b3..922eb48a 100644 --- a/Documentation/api/variables/authn.html +++ b/Documentation/api/variables/authn.html @@ -1 +1 @@ -authn | solid-ui

                                                          Variable authnConst

                                                          authn: AuthnLogic

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +authn | solid-ui

                                                          Variable authnConst

                                                          authn: AuthnLogic

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/create.html b/Documentation/api/variables/create.html index a9934f4b..5765b6aa 100644 --- a/Documentation/api/variables/create.html +++ b/Documentation/api/variables/create.html @@ -1 +1 @@ -create | solid-ui

                                                          Variable createConst

                                                          create: {
                                                              newThingUI: ((createContext, dataBrowserContext, thePanes) => void);
                                                          } = ...

                                                          Type declaration

                                                          • newThingUI: ((createContext, dataBrowserContext, thePanes) => void)
                                                              • (createContext, dataBrowserContext, thePanes): void
                                                              • Parameters

                                                                • createContext: CreateContext
                                                                • dataBrowserContext: DataBrowserContext
                                                                • thePanes: PaneDefinition[]

                                                                Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +create | solid-ui

                                                          Variable createConst

                                                          create: {
                                                              newThingUI: ((createContext, dataBrowserContext, thePanes) => void);
                                                          } = ...

                                                          Type declaration

                                                          • newThingUI: ((createContext, dataBrowserContext, thePanes) => void)
                                                              • (createContext, dataBrowserContext, thePanes): void
                                                              • Parameters

                                                                • createContext: CreateContext
                                                                • dataBrowserContext: DataBrowserContext
                                                                • thePanes: PaneDefinition[]

                                                                Returns void

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/dom.html b/Documentation/api/variables/dom.html index 329ec844..464bb27e 100644 --- a/Documentation/api/variables/dom.html +++ b/Documentation/api/variables/dom.html @@ -1 +1 @@ -dom | solid-ui

                                                          Variable domConst

                                                          dom: null | Document = ...

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +dom | solid-ui

                                                          Variable domConst

                                                          dom: null | Document = ...

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/icons.html b/Documentation/api/variables/icons.html index d9b4de2d..50826700 100644 --- a/Documentation/api/variables/icons.html +++ b/Documentation/api/variables/icons.html @@ -1 +1 @@ -icons | solid-ui

                                                          Variable iconsConst

                                                          icons: {
                                                              iconBase: any;
                                                              originalIconBase: any;
                                                          } = ...

                                                          Type declaration

                                                          • iconBase: any
                                                          • originalIconBase: any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +icons | solid-ui

                                                          Variable iconsConst

                                                          icons: {
                                                              iconBase: any;
                                                              originalIconBase: any;
                                                          } = ...

                                                          Type declaration

                                                          • iconBase: any
                                                          • originalIconBase: any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/language.defaultPreferredLanguages.html b/Documentation/api/variables/language.defaultPreferredLanguages.html index fd1fd5bb..90f72b19 100644 --- a/Documentation/api/variables/language.defaultPreferredLanguages.html +++ b/Documentation/api/variables/language.defaultPreferredLanguages.html @@ -1 +1 @@ -defaultPreferredLanguages | solid-ui

                                                          Variable defaultPreferredLanguagesConst

                                                          defaultPreferredLanguages: string[] = ...

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +defaultPreferredLanguages | solid-ui

                                                          Variable defaultPreferredLanguagesConst

                                                          defaultPreferredLanguages: string[] = ...

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/language.languageCodeURIBase.html b/Documentation/api/variables/language.languageCodeURIBase.html index 86987bf1..f9d1f4fe 100644 --- a/Documentation/api/variables/language.languageCodeURIBase.html +++ b/Documentation/api/variables/language.languageCodeURIBase.html @@ -1 +1 @@ -languageCodeURIBase | solid-ui

                                                          Variable languageCodeURIBaseConst

                                                          languageCodeURIBase: "https://www.w3.org/ns/iana/language-code/" = 'https://www.w3.org/ns/iana/language-code/'

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +languageCodeURIBase | solid-ui

                                                          Variable languageCodeURIBaseConst

                                                          languageCodeURIBase: "https://www.w3.org/ns/iana/language-code/" = 'https://www.w3.org/ns/iana/language-code/'

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/matrix.html b/Documentation/api/variables/matrix.html index 741d2df6..2852d021 100644 --- a/Documentation/api/variables/matrix.html +++ b/Documentation/api/variables/matrix.html @@ -1 +1 @@ -matrix | solid-ui

                                                          Variable matrixConst

                                                          matrix: {
                                                              matrixForQuery: ((dom, query, vx, vy, vvalue, options, whenDone) => any);
                                                          } = ...

                                                          Type declaration

                                                          • matrixForQuery: ((dom, query, vx, vy, vvalue, options, whenDone) => any)
                                                              • (dom, query, vx, vy, vvalue, options, whenDone): any
                                                              • Parameters

                                                                Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +matrix | solid-ui

                                                          Variable matrixConst

                                                          matrix: {
                                                              matrixForQuery: ((dom, query, vx, vy, vvalue, options, whenDone) => any);
                                                          } = ...

                                                          Type declaration

                                                          • matrixForQuery: ((dom, query, vx, vy, vvalue, options, whenDone) => any)
                                                              • (dom, query, vx, vy, vvalue, options, whenDone): any
                                                              • Parameters

                                                                Returns any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/media.html b/Documentation/api/variables/media.html index 681f4b0c..c6e1fb1b 100644 --- a/Documentation/api/variables/media.html +++ b/Documentation/api/variables/media.html @@ -11,4 +11,4 @@

                                                          Parameters

                                                          Returns HTMLDivElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Returns HTMLDivElement

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/ns.html b/Documentation/api/variables/ns.html new file mode 100644 index 00000000..2ea058a2 --- /dev/null +++ b/Documentation/api/variables/ns.html @@ -0,0 +1 @@ +ns | solid-ui

                                                          Variable ns

                                                          ns: any

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.DataFactory.html b/Documentation/api/variables/rdf.DataFactory.html index 8410d296..c4f6a60d 100644 --- a/Documentation/api/variables/rdf.DataFactory.html +++ b/Documentation/api/variables/rdf.DataFactory.html @@ -1,2 +1,2 @@ DataFactory | solid-ui

                                                          Variable DataFactoryConst

                                                          DataFactory: IRDFlibDataFactory

                                                          Full RDFLib.js Data Factory

                                                          -

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.NextId.html b/Documentation/api/variables/rdf.NextId.html index e3197e72..11cf6a48 100644 --- a/Documentation/api/variables/rdf.NextId.html +++ b/Documentation/api/variables/rdf.NextId.html @@ -1 +1 @@ -NextId | solid-ui

                                                          Variable NextIdConst

                                                          NextId: number

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +NextId | solid-ui

                                                          Variable NextIdConst

                                                          NextId: number

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.HTMLLiteralURI.html b/Documentation/api/variables/rdf.RDFaProcessor.HTMLLiteralURI.html index 8585e8c0..6e7141ae 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.HTMLLiteralURI.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.HTMLLiteralURI.html @@ -1 +1 @@ -HTMLLiteralURI | solid-ui

                                                          Variable HTMLLiteralURIConst

                                                          HTMLLiteralURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +HTMLLiteralURI | solid-ui

                                                          Variable HTMLLiteralURIConst

                                                          HTMLLiteralURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.NCNAME.html b/Documentation/api/variables/rdf.RDFaProcessor.NCNAME.html index e134ebed..0930fc23 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.NCNAME.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.NCNAME.html @@ -1 +1 @@ -NCNAME | solid-ui

                                                          Variable NCNAMEConst

                                                          NCNAME: RegExp

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +NCNAME | solid-ui

                                                          Variable NCNAMEConst

                                                          NCNAME: RegExp

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.PlainLiteralURI.html b/Documentation/api/variables/rdf.RDFaProcessor.PlainLiteralURI.html index 67b095cd..39a55089 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.PlainLiteralURI.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.PlainLiteralURI.html @@ -1 +1 @@ -PlainLiteralURI | solid-ui

                                                          Variable PlainLiteralURIConst

                                                          PlainLiteralURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +PlainLiteralURI | solid-ui

                                                          Variable PlainLiteralURIConst

                                                          PlainLiteralURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.XMLLiteralURI.html b/Documentation/api/variables/rdf.RDFaProcessor.XMLLiteralURI.html index 1cef74a4..a1095b94 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.XMLLiteralURI.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.XMLLiteralURI.html @@ -1 +1 @@ -XMLLiteralURI | solid-ui

                                                          Variable XMLLiteralURIConst

                                                          XMLLiteralURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +XMLLiteralURI | solid-ui

                                                          Variable XMLLiteralURIConst

                                                          XMLLiteralURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.dateTimeTypes.html b/Documentation/api/variables/rdf.RDFaProcessor.dateTimeTypes.html index dc9d17fc..7d7b9e5a 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.dateTimeTypes.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.dateTimeTypes.html @@ -1 +1 @@ -dateTimeTypes | solid-ui

                                                          Variable dateTimeTypesConst

                                                          dateTimeTypes: {
                                                              pattern: RegExp;
                                                              type: string;
                                                          }[]

                                                          Type declaration

                                                          • pattern: RegExp
                                                          • type: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +dateTimeTypes | solid-ui

                                                          Variable dateTimeTypesConst

                                                          dateTimeTypes: {
                                                              pattern: RegExp;
                                                              type: string;
                                                          }[]

                                                          Type declaration

                                                          • pattern: RegExp
                                                          • type: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.nameChar.html b/Documentation/api/variables/rdf.RDFaProcessor.nameChar.html index b23ea687..cd20e228 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.nameChar.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.nameChar.html @@ -1 +1 @@ -nameChar | solid-ui

                                                          Variable nameCharConst

                                                          nameChar: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +nameChar | solid-ui

                                                          Variable nameCharConst

                                                          nameChar: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.nameStartChar.html b/Documentation/api/variables/rdf.RDFaProcessor.nameStartChar.html index c15e5709..3000e8be 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.nameStartChar.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.nameStartChar.html @@ -1 +1 @@ -nameStartChar | solid-ui

                                                          Variable nameStartCharConst

                                                          nameStartChar: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +nameStartChar | solid-ui

                                                          Variable nameStartCharConst

                                                          nameStartChar: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.objectURI.html b/Documentation/api/variables/rdf.RDFaProcessor.objectURI.html index 2cebeabe..e0982150 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.objectURI.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.objectURI.html @@ -1 +1 @@ -objectURI | solid-ui

                                                          Variable objectURIConst

                                                          objectURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +objectURI | solid-ui

                                                          Variable objectURIConst

                                                          objectURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/rdf.RDFaProcessor.typeURI.html b/Documentation/api/variables/rdf.RDFaProcessor.typeURI.html index 693fe333..fed9db64 100644 --- a/Documentation/api/variables/rdf.RDFaProcessor.typeURI.html +++ b/Documentation/api/variables/rdf.RDFaProcessor.typeURI.html @@ -1 +1 @@ -typeURI | solid-ui

                                                          Variable typeURIConst

                                                          typeURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +typeURI | solid-ui

                                                          Variable typeURIConst

                                                          typeURI: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/store.html b/Documentation/api/variables/store.html index 953a60e6..b06ac7bd 100644 --- a/Documentation/api/variables/store.html +++ b/Documentation/api/variables/store.html @@ -1 +1 @@ -store | solid-ui

                                                          Variable storeConst

                                                          store: rdf

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +store | solid-ui

                                                          Variable storeConst

                                                          store: rdf

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/Documentation/api/variables/versionInfo.html b/Documentation/api/variables/versionInfo.html index ba08277d..465c36ef 100644 --- a/Documentation/api/variables/versionInfo.html +++ b/Documentation/api/variables/versionInfo.html @@ -1 +1 @@ -versionInfo | solid-ui

                                                          Variable versionInfoConst

                                                          versionInfo: {
                                                              buildTime: string;
                                                              commit: string;
                                                              npmInfo: {
                                                                  ares: string;
                                                                  brotli: string;
                                                                  cldr: string;
                                                                  icu: string;
                                                                  llhttp: string;
                                                                  modules: string;
                                                                  napi: string;
                                                                  nghttp2: string;
                                                                  nghttp3: string;
                                                                  ngtcp2: string;
                                                                  node: string;
                                                                  npm: string;
                                                                  openssl: string;
                                                                  solid-ui: string;
                                                                  tz: string;
                                                                  unicode: string;
                                                                  uv: string;
                                                                  v8: string;
                                                                  zlib: string;
                                                              };
                                                          } = ...

                                                          Type declaration

                                                          • buildTime: string
                                                          • commit: string
                                                          • npmInfo: {
                                                                ares: string;
                                                                brotli: string;
                                                                cldr: string;
                                                                icu: string;
                                                                llhttp: string;
                                                                modules: string;
                                                                napi: string;
                                                                nghttp2: string;
                                                                nghttp3: string;
                                                                ngtcp2: string;
                                                                node: string;
                                                                npm: string;
                                                                openssl: string;
                                                                solid-ui: string;
                                                                tz: string;
                                                                unicode: string;
                                                                uv: string;
                                                                v8: string;
                                                                zlib: string;
                                                            }
                                                            • ares: string
                                                            • brotli: string
                                                            • cldr: string
                                                            • icu: string
                                                            • llhttp: string
                                                            • modules: string
                                                            • napi: string
                                                            • nghttp2: string
                                                            • nghttp3: string
                                                            • ngtcp2: string
                                                            • node: string
                                                            • npm: string
                                                            • openssl: string
                                                            • solid-ui: string
                                                            • tz: string
                                                            • unicode: string
                                                            • uv: string
                                                            • v8: string
                                                            • zlib: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +versionInfo | solid-ui

                                                          Variable versionInfoConst

                                                          versionInfo: {
                                                              buildTime: string;
                                                              commit: string;
                                                              npmInfo: {
                                                                  ares: string;
                                                                  brotli: string;
                                                                  cldr: string;
                                                                  icu: string;
                                                                  llhttp: string;
                                                                  modules: string;
                                                                  napi: string;
                                                                  nghttp2: string;
                                                                  nghttp3: string;
                                                                  ngtcp2: string;
                                                                  node: string;
                                                                  npm: string;
                                                                  openssl: string;
                                                                  solid-ui: string;
                                                                  tz: string;
                                                                  unicode: string;
                                                                  uv: string;
                                                                  v8: string;
                                                                  zlib: string;
                                                              };
                                                          } = ...

                                                          Type declaration

                                                          • buildTime: string
                                                          • commit: string
                                                          • npmInfo: {
                                                                ares: string;
                                                                brotli: string;
                                                                cldr: string;
                                                                icu: string;
                                                                llhttp: string;
                                                                modules: string;
                                                                napi: string;
                                                                nghttp2: string;
                                                                nghttp3: string;
                                                                ngtcp2: string;
                                                                node: string;
                                                                npm: string;
                                                                openssl: string;
                                                                solid-ui: string;
                                                                tz: string;
                                                                unicode: string;
                                                                uv: string;
                                                                v8: string;
                                                                zlib: string;
                                                            }
                                                            • ares: string
                                                            • brotli: string
                                                            • cldr: string
                                                            • icu: string
                                                            • llhttp: string
                                                            • modules: string
                                                            • napi: string
                                                            • nghttp2: string
                                                            • nghttp3: string
                                                            • ngtcp2: string
                                                            • node: string
                                                            • npm: string
                                                            • openssl: string
                                                            • solid-ui: string
                                                            • tz: string
                                                            • unicode: string
                                                            • uv: string
                                                            • v8: string
                                                            • zlib: string

                                                          Generated using TypeDoc

                                                          \ No newline at end of file diff --git a/dist/805.solid-ui.min.js b/dist/805.solid-ui.min.js index 9c7d37e4..00582b5e 100644 --- a/dist/805.solid-ui.min.js +++ b/dist/805.solid-ui.min.js @@ -1,3 +1,3 @@ /*! For license information please see 805.solid-ui.min.js.LICENSE.txt */ -(self.webpackChunksolid_ui=self.webpackChunksolid_ui||[]).push([[805],{5456:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,o)=>t+(0===o?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,o,r)=>void 0===t[o]||"symbol"==typeof t[o]?n:n+(0===n.length?"":",")+e(o)+":"+e(t[o])),"")+"}"}},8058:(e,t,n)=>{"use strict";const{isArray:o,isObject:r,isString:a}=n(832),{asArray:i}=n(1055),{prependBase:s}=n(2278),l=n(4093),c=n(6767);function d(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function u({context:e,base:t}){if(!e)return;const n=e["@context"];if(a(n))e["@context"]=s(t,n);else if(o(n))for(let e=0;e10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(i.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,c;i.add(t);try{c=await n(t),s=c.document||null,a(s)&&(s=JSON.parse(s))}catch(e){throw new l("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!r(s))throw new l("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},c.contextUrl&&(o(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(c.contextUrl)),{context:s,remoteDoc:c}}}},4093:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},731:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},9048:(e,t,n)=>{"use strict";e.exports=n(7055).NQuads},533:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},6767:(e,t,n)=>{"use strict";const o=n(9593);e.exports=class{constructor({document:e}){this.document=e,this.cache=new o({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},3251:(e,t,n)=>{"use strict";const o=n(4093),{isArray:r,isObject:a,isString:i,isUndefined:s}=n(832),{isList:l,isValue:c,isGraph:d,isSimpleGraph:u,isSubjectReference:p}=n(8463),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(4131),{removeBase:m,prependBase:x}=n(2278),{REGEX_KEYWORD:b,addValue:w,asArray:j,compareShortestLeast:I}=n(1055),N={};function S(e,t,n){if("@nest"!==h(e,t,{vocab:!0},n))throw new o("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=N,N.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:h={}})=>{if(r(n)){let o=[];for(let r=0;r1&&(O=Array.from(O).sort());const E=e;for(const t of O){const n=N.compactIri({activeCtx:E,iri:t,relativeTo:{vocab:!0}}),o=f(b,n,"@context");s(o)||(e=await g({activeCtx:e,localCtx:o,options:h,propagate:!1}))}const k=Object.keys(n).sort();for(const s of k){const p=n[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&v(s)){const t=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,t,p)}else{if(!r(p))throw new o("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const t=N.compactIri({activeCtx:e,iri:s,value:p,relativeTo:{vocab:!0},reverse:m}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let o=x;n&&(S(e,n,h),a(x[n])||(x[n]={}),o=x[n]),w(o,t,p,{propertyIsArray:!0})}for(const t of p){const n=N.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:m}),o=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let p=x;o&&(S(e,o,h),a(x[o])||(x[o]={}),p=x[o]);const v=f(e,n,"@container")||[],g=d(t),y=l(t);let b;y?b=t["@list"]:g&&(b=t["@graph"]);let I=await N.compact({activeCtx:e,activeProperty:n,element:y||g?b:t,options:h});if(y){if(r(I)||(I=[I]),v.includes("@list")){w(p,n,I,{valueIsArray:!0,allowDuplicate:!0});continue}I={[N.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:I},"@index"in t&&(I[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(g)if(v.includes("@graph")&&(v.includes("@id")||v.includes("@index")&&u(t))){let o;p.hasOwnProperty(n)?o=p[n]:p[n]=o={};const r=(v.includes("@id")?t["@id"]:t["@index"])||N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(o,r,I,{propertyIsArray:!h.compactArrays||v.includes("@set")})}else v.includes("@graph")&&u(t)?(r(I)&&I.length>1&&(I={"@included":I}),w(p,n,I,{propertyIsArray:!h.compactArrays||v.includes("@set")})):(r(I)&&1===I.length&&h.compactArrays&&(I=I[0]),I={[N.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:I},"@id"in t&&(I[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(I[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(p,n,I,{propertyIsArray:!h.compactArrays||v.includes("@set")}));else if(v.includes("@language")||v.includes("@index")||v.includes("@id")||v.includes("@type")){let o,r;if(p.hasOwnProperty(n)?o=p[n]:p[n]=o={},v.includes("@language"))c(I)&&(I=I["@value"]),r=t["@language"];else if(v.includes("@index")){const o=f(e,n,"@index")||"@index",a=N.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}});if("@index"===o)r=t["@index"],delete I[a];else{let e;if([r,...e]=j(I[o]||[]),i(r))switch(e.length){case 0:delete I[o];break;case 1:I[o]=e[0];break;default:I[o]=e}else r=null}}else if(v.includes("@id")){const t=N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});r=I[t],delete I[t]}else if(v.includes("@type")){const o=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let a;switch([r,...a]=j(I[o]||[]),a.length){case 0:delete I[o];break;case 1:I[o]=a[0];break;default:I[o]=a}1===Object.keys(I).length&&"@id"in t&&(I=await N.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:h}))}r||(r=N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(o,r,I,{propertyIsArray:v.includes("@set")})}else{const e=!h.compactArrays||v.includes("@set")||v.includes("@list")||r(I)&&0===I.length||"@list"===s||"@graph"===s;w(p,n,I,{propertyIsArray:e})}}}else{if((f(e,t,"@container")||[]).includes("@index"))continue;const n=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,p)}else{const n=await N.compact({activeCtx:e,activeProperty:t,element:p,options:h});r(n)&&0===n.length||w(x,s,n)}else{const t=await N.compact({activeCtx:e,activeProperty:"@reverse",element:p,options:h});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const o=t[n],r=(f(e,n,"@container")||[]).includes("@set")||!h.compactArrays;w(x,n,o,{propertyIsArray:r}),delete t[n]}if(Object.keys(t).length>0){const n=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,t)}}else{let t=j(p).map((e=>N.compactIri({activeCtx:b,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const n=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),o=(f(e,n,"@container")||[]).includes("@set")&&y(e,1.1)||r(t)&&0===p.length;w(x,n,t,{propertyIsArray:o})}else{let t=j(p).map((t=>N.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:h.base})));1===t.length&&(t=t[0]),x[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return x}return n},N.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:r={vocab:!1},reverse:i=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const u=e.getInverse();if(v(t)&&t in u&&"@none"in u[t]&&"@type"in u[t]["@none"]&&"@none"in u[t]["@none"]["@type"])return u[t]["@none"]["@type"]["@none"];if(r.vocab&&t in u){const o=e["@language"]||"@none",r=[];a(n)&&"@index"in n&&!("@graph"in n)&&r.push("@index","@index@set"),a(n)&&"@preserve"in n&&(n=n["@preserve"][0]),d(n)?("@index"in n&&r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&r.push("@graph@id","@graph@id@set"),r.push("@graph","@graph@set","@set"),"@index"in n||r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||r.push("@graph@id","@graph@id@set")):a(n)&&!c(n)&&r.push("@id","@id@set","@type","@set@type");let s="@language",u="@null";if(i)s="@type",u="@reverse",r.push("@set");else if(l(n)){"@index"in n||r.push("@list");const e=n["@list"];if(0===e.length)s="@any",u="@none";else{let t=0===e.length?o:null,n=null;for(let o=0;oe.includes("_")));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const l=e.inverse[t];for(const e of o){if(!(e in l))continue;const t=l[e][r];for(const e of s)if(e in t)return t[e]}return null}(e,t,n,r,s,u);if(null!==p)return p}if(r.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const o=t.substr(n.length);if(!e.mappings.has(o))return o}}let p=null;const h=[];let f=e.fastCurieMap;const g=t.length-1;for(let e=0;e=0;--o){const r=h[o],a=r.terms;for(const o of a){const a=o+":"+t.substr(r.iri.length);e.mappings.get(o)._prefix&&(!e.mappings.has(a)||null===n&&e.mappings.get(a)["@id"]===t)&&(null===p||I(a,p)<0)&&(p=a)}}if(null!==p)return p;for(const[n,r]of e.mappings)if(r&&r._prefix&&t.startsWith(n+":"))throw new o(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!r.vocab){if("@base"in e){if(e["@base"]){const n=m(x(s,e["@base"]),t);return b.test(n)?`./${n}`:n}return t}return m(s,t)}return t},N.compactValue=({activeCtx:e,activeProperty:t,value:n,options:o})=>{if(c(n)){const o=f(e,t,"@type"),r=f(e,t,"@language"),a=f(e,t,"@direction"),s=f(e,t,"@container")||[],l="@index"in n&&!s.includes("@index");if(!l&&"@none"!==o){if(n["@type"]===o)return n["@value"];if("@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===a)return n["@value"];if("@language"in n&&n["@language"]===r)return n["@value"];if("@direction"in n&&n["@direction"]===a)return n["@value"]}const c=Object.keys(n).length,d=1===c||2===c&&"@index"in n&&!l,u="@language"in e,p=i(n["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(d&&"@none"!==o&&(!u||!p||h))return n["@value"];const v={};return l&&(v[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?v[N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=N.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(v[N.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(v[N.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),v[N.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],v}const r=h(e,t,{vocab:!0},o),a=f(e,t,"@type"),s=N.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===a},base:o.base});return"@id"===a||"@vocab"===a||"@graph"===r?s:{[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},3770:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},4131:(e,t,n)=>{"use strict";const o=n(1055),r=n(4093),{isArray:a,isObject:i,isString:s,isUndefined:l}=n(832),{isAbsolute:c,isRelative:d,prependBase:u}=n(2278),{handleEvent:p}=n(1696),{REGEX_BCP47:h,REGEX_KEYWORD:f,asArray:v,compareShortestLeast:g}=n(1055),y=new Map,m={};function x(e,t,n,o,r,a){if(null===t||!s(t)||m.isKeyword(t))return t;if(t.match(f))return null;if(o&&o.hasOwnProperty(t)&&!0!==r.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:t,defined:r,options:a}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(i(n)&&"@id"in n)return n["@id"]}const l=t.indexOf(":");if(l>0){const n=t.substr(0,l),i=t.substr(l+1);if("_"===n||0===i.indexOf("//"))return t;o&&o.hasOwnProperty(n)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:n,defined:r,options:a});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+i;if(c(t))return t}if(n.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(n.base){let n,o;"@base"in e?e["@base"]?(o=u(a.base,e["@base"]),n=u(o,t)):(o=e["@base"],n=t):(o=a.base,n=u(a.base,t)),t=n}return t}function b(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n{if(i(t)&&"@context"in t&&a(t["@context"])&&(t=t["@context"]),0===v(t).length)return e;const g=[],y=[({event:e,next:t})=>{g.push(e),t()}];n.eventHandler&&y.push(n.eventHandler);const b=n;n={...n,eventHandler:y};const w=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});i(w[0].document)&&"boolean"==typeof w[0].document["@propagate"]&&(o=w[0].document["@propagate"]);let j=e;o||j.previousContext||(j=j.clone(),j.previousContext=e);for(const o of w){let{document:a}=o;if(e=j,null===a){if(!l&&0!==Object.keys(e.protected).length)throw new r("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});j=e=m.getInitialContext(n).clone();continue}const v=o.getProcessed(e);if(v){if(b.eventHandler)for(const e of v.events)p({event:e,options:b});j=e=v.context;continue}if(i(a)&&"@context"in a&&(a=a["@context"]),!i(a))throw new r("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:a});j=j.clone();const y=new Map;if("@version"in a){if(1.1!==a["@version"])throw new r("Unsupported JSON-LD version: "+a["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:a});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new r("@version: "+a["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:a});j.processingMode="json-ld-1.1",j["@version"]=a["@version"],y.set("@version",!0)}if(j.processingMode=j.processingMode||e.processingMode,"@base"in a){let e=a["@base"];if(null===e||c(e));else{if(!d(e))throw new r('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:a});e=u(j["@base"],e)}j["@base"]=e,y.set("@base",!0)}if("@vocab"in a){const e=a["@vocab"];if(null===e)delete j["@vocab"];else{if(!s(e))throw new r('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:a});if(!c(e)&&m.processingMode(j,1))throw new r('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:a});{const t=x(j,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),j["@vocab"]=t}}y.set("@vocab",!0)}if("@language"in a){const e=a["@language"];if(null===e)delete j["@language"];else{if(!s(e))throw new r('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:a});e.match(h)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),j["@language"]=e.toLowerCase()}y.set("@language",!0)}if("@direction"in a){const t=a["@direction"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:a});if(null===t)delete j["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new r('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:a});j["@direction"]=t}y.set("@direction",!0)}if("@propagate"in a){const n=a["@propagate"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if("boolean"!=typeof n)throw new r("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});y.set("@propagate",!0)}if("@import"in a){const o=a["@import"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if(!s(o))throw new r("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const i=await n.contextResolver.resolve({activeCtx:e,context:o,documentLoader:n.documentLoader,base:n.base});if(1!==i.length)throw new r("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=i[0].getProcessed(e);if(l)a=l;else{const n=i[0].document;if("@import"in n)throw new r("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)a.hasOwnProperty(e)||(a[e]=n[e]);i[0].setProcessed(e,a)}y.set("@import",!0)}y.set("@protected",a["@protected"]||!1);for(const e in a)if(m.createTermDefinition({activeCtx:j,localCtx:a,term:e,defined:y,options:n,overrideProtected:l}),i(a[e])&&"@context"in a[e]){const t=a[e]["@context"];let o=!0;if(s(t)){const e=u(n.base,t);f.has(e)?o=!1:f.add(e)}if(o)try{await m.process({activeCtx:j.clone(),localCtx:a[e]["@context"],overrideProtected:!0,options:n,cycles:f})}catch(t){throw new r("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:a[e]["@context"],term:e})}}o.setProcessed(e,{context:j,events:g})}return j},m.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:o,options:l,overrideProtected:d=!1})=>{if(o.has(n)){if(o.get(n))return;throw new r("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let u;if(o.set(n,!1),t.hasOwnProperty(n)&&(u=t[n]),"@type"===n&&i(u)&&"@set"===(u["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],o=Object.keys(u);if(0===o.length||o.some((t=>!e.includes(t))))throw new r("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(m.isKeyword(n))throw new r("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(f))return void(l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:l}));if(""===n)throw new r("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const h=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let v=!1;if((s(u)||null===u)&&(v=!0,u={"@id":u}),!i(u))throw new r("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const g={};e.mappings.set(n,g),g.reverse=!1;const y=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&y.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in u)if(!y.includes(e))throw new r("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const w=n.indexOf(":");if(g._termHasColon=w>0,"@reverse"in u){if("@id"in u)throw new r("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in u)throw new r("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=u["@reverse"];if(!s(a))throw new r("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(a.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:a}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));const i=x(e,a,{vocab:!0,base:!1},t,o,l);if(!c(i))throw new r("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});g["@id"]=i,g.reverse=!0}else if("@id"in u){let a=u["@id"];if(a&&!s(a))throw new r("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)g["@id"]=null;else{if(!m.isKeyword(a)&&a.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:a}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));if(a!==n){if(a=x(e,a,{vocab:!0,base:!1},t,o,l),!c(a)&&!m.isKeyword(a))throw new r("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&x(e,n,{vocab:!0,base:!1},t,new Map(o).set(n,!0),l)!==a)throw new r("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});g["@id"]=a,g._prefix=v&&!g._termHasColon&&a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in g))if(g._termHasColon){const r=n.substr(0,w);if(t.hasOwnProperty(r)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:r,defined:o,options:l}),e.mappings.has(r)){const t=n.substr(w+1);g["@id"]=e.mappings.get(r)["@id"]+t}else g["@id"]=n}else if("@type"===n)g["@id"]=n;else{if(!("@vocab"in e))throw new r("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});g["@id"]=e["@vocab"]+n}if((!0===u["@protected"]||!0===o.get("@protected")&&!1!==u["@protected"])&&(e.protected[n]=!0,g.protected=!0),o.set(n,!0),"@type"in u){let n=u["@type"];if(!s(n))throw new r("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(m.processingMode(e,1))throw new r(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=x(e,n,{vocab:!0,base:!1},t,o,l),!c(n))throw new r("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new r("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}g["@type"]=n}if("@container"in u){const n=s(u["@container"])?[u["@container"]]:u["@container"]||[],o=["@list","@set","@index","@language"];let i=!0;const l=n.includes("@set");if(m.processingMode(e,1.1)){if(o.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new r("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new r("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=n.length<=(l?2:1);if(n.includes("@type")&&(g["@type"]=g["@type"]||"@id",!["@id","@vocab"].includes(g["@type"])))throw new r("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else i&=!a(u["@container"]),i&=n.length<=1;if(i&=n.every((e=>o.includes(e))),i&=!(l&&n.includes("@list")),!i)throw new r("Invalid JSON-LD syntax; @context @container value must be one of the following: "+o.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(g.reverse&&!n.every((e=>["@index","@set"].includes(e))))throw new r("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});g["@container"]=n}if("@index"in u){if(!("@container"in u)||!g["@container"].includes("@index"))throw new r(`Invalid JSON-LD syntax; @index without @index in @container: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(u["@index"])||0===u["@index"].indexOf("@"))throw new r(`Invalid JSON-LD syntax; @index must expand to an IRI: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});g["@index"]=u["@index"]}if("@context"in u&&(g["@context"]=u["@context"]),"@language"in u&&!("@type"in u)){let e=u["@language"];if(null!==e&&!s(e))throw new r("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),g["@language"]=e}if("@prefix"in u){if(n.match(/:|\//))throw new r("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(g["@id"]))throw new r("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof u["@prefix"])throw new r("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});g._prefix=!0===u["@prefix"]}if("@direction"in u){const e=u["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});g["@direction"]=e}if("@nest"in u){const e=u["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new r("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});g["@nest"]=e}const j=g["@id"];if("@context"===j||"@preserve"===j)throw new r("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(h&&h.protected&&!d&&(e.protected[n]=!0,g.protected=!0,!b(h,g)))throw new r("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},m.expandIri=(e,t,n,o)=>x(e,t,n,void 0,void 0,o),m.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=y.get(t);if(n)return n;const r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},o={},r=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],l=e.mappings,c=[...l.keys()].sort(g);for(const e of c){const a=l.get(e);if(null===a)continue;let c=a["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===a["@id"])continue;const d=v(a["@id"]);for(const l of d){let d=t[l];const u=m.isKeyword(l);if(d)u||a._termHasColon||o[l].push(e);else if(t[l]=d={},!u&&!a._termHasColon){o[l]=[e];const t={iri:l,terms:o[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(d[c]||(d[c]={"@language":{},"@type":{},"@any":{}}),d=d[c],i(e,d["@any"],"@none"),a.reverse)i(e,d["@type"],"@reverse");else if("@none"===a["@type"])i(e,d["@any"],"@none"),i(e,d["@language"],"@none"),i(e,d["@type"],"@none");else if("@type"in a)i(e,d["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],n=a["@direction"];i(e,d["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in a?i(e,d["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?i(e,d["@language"],`_${a["@direction"]}`):i(e,d["@language"],"@none"):s?(i(e,d["@language"],`_${s}`),i(e,d["@language"],"@none"),i(e,d["@type"],"@none")):(i(e,d["@language"],r),i(e,d["@language"],"@none"),i(e,d["@type"],"@none"))}}for(const e in n)a(n,e,1);return t},clone:function(){const e={};return e.mappings=o.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=o.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===y.size&&y.clear(),y.set(t,r),r;function a(e,t,n){const o=e[t],r=e[t]={};let i,s;for(const e of o)i=e.iri,s=n>=i.length?"":i[n],s in r?r[s].push(e):r[s]=[e];for(const e in r)""!==e&&a(r,e,n+1)}function i(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},m.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const o=e.mappings.get(t);if(l(n))return o;if(o.hasOwnProperty(n))return o[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},m.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,m.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},8831:(e,t,n)=>{"use strict";const{parseLinkHeader:o,buildHeaders:r}=n(1055),{LINK_HEADER_CONTEXT:a}=n(3770),i=n(4093),s=n(533),{prependBase:l}=n(2278),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=r(t),(new s).wrapLoader((async function r(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new i('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new i('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let d;try{d=await function(e,t,n){const o=new(e=e||XMLHttpRequest);return new Promise(((e,r)=>{o.onload=()=>e(o),o.onerror=e=>r(e),o.open("GET",t,!0);for(const e in n)o.setRequestHeader(e,n[e]);o.send()}))}(n,s,t)}catch(e){throw new i("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(d.status>=400)throw new i("URL could not be dereferenced: "+d.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:d.status});let u={contextUrl:null,documentUrl:s,document:d.response},p=null;const h=d.getResponseHeader("Content-Type");let f;if(c.test(d.getAllResponseHeaders())&&(f=d.getResponseHeader("Link")),f&&"application/ld+json"!==h){const e=o(f),t=e[a];if(Array.isArray(t))throw new i("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(u.contextUrl=t.target),p=e.alternate,p&&"application/ld+json"==p.type&&!(h||"").match(/^application\/(\w*\+)?json$/)&&(u=await r(l(s,p.target)))}return u})))},1696:(e,t,n)=>{"use strict";const o=n(4093),{isArray:r}=n(832),{asArray:a}=n(1055),i={};function s({event:e,handlers:t}){let n=!0;for(let a=0;n&&a{n=!0}});else{if("object"!=typeof i)throw new o("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in i?i[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}e.exports=i,i.defaultEventHandler=null,i.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?i.safeEventHandler:[],e.eventHandler?a(e.eventHandler):[],i.defaultEventHandler?i.defaultEventHandler:[]);return 0===t.length?null:t},i.handleEvent=({event:e,options:t})=>{s({event:e,handlers:t.eventHandler})};const l=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference"]);i.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&l.has(e.code))throw new o("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},i.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},i.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},i.unhandledEventHandler=function({event:e}){throw new o("No handler for event.","jsonld.UnhandledEvent",{event:e})},i.setDefaultEventHandler=function({eventHandler:e}={}){i.defaultEventHandler=e?a(e):null}},2759:(e,t,n)=>{"use strict";const o=n(4093),{isArray:r,isObject:a,isEmptyObject:i,isString:s,isUndefined:l}=n(832),{isList:c,isValue:d,isGraph:u,isSubject:p}=n(8463),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(4131),{isAbsolute:m}=n(2278),{REGEX_BCP47:x,REGEX_KEYWORD:b,addValue:w,asArray:j,getValues:I,validateTypeValue:N}=n(1055),{handleEvent:S}=n(1696),O={};async function E({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:u,expandedParent:b,options:I={},insideList:k,typeKey:L,typeScopedContext:R}){const T=Object.keys(u).sort(),A=[];let _;const M=u[L]&&"@json"===h(e,r(u[L])?u[L][0]:u[L],{vocab:!0},{...I,typeExpansion:!0});for(const E of T){let k,L=u[E];if("@context"===E)continue;const T=h(e,E,{vocab:!0},I);if(null===T||!m(T)&&!v(T)){I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:E,expandedProperty:T}},options:I});continue}if(v(T)){if("@reverse"===n)throw new o("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(T in b&&"@included"!==T&&"@type"!==T)throw new o("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:T})}if("@id"===T){if(!s(L)){if(!I.isFrame)throw new o('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(a(L)){if(!i(L))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}else{if(!r(L))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(!L.every((e=>s(e))))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}}w(b,"@id",j(L).map((t=>{if(s(t)){const n=h(e,t,{base:!0},I);return I.eventHandler&&(null===n?S(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:I}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:I}):m(n)||S({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:I})),n}return t})),{propertyIsArray:I.isFrame});continue}if("@type"===T){a(L)&&(L=Object.fromEntries(Object.entries(L).map((([e,t])=>[h(R,e,{vocab:!0}),j(t).map((e=>h(R,e,{base:!0,vocab:!0},{...I,typeExpansion:!0})))])))),N(L,I.isFrame),w(b,"@type",j(L).map((e=>{if(s(e)){const t=h(R,e,{base:!0,vocab:!0},{...I,typeExpansion:!0});return"@json"===t||m(t)||I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:I}),t}return e})),{propertyIsArray:I.isFrame});continue}if("@included"===T&&y(e,1.1)){const n=j(await O.expand({activeCtx:e,activeProperty:t,element:L,options:I}));if(!n.every((e=>p(e))))throw new o("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});w(b,"@included",n,{propertyIsArray:!0});continue}if("@graph"===T&&!a(L)&&!r(L))throw new o('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===T){_=L,M&&y(e,1.1)?b["@value"]=L:w(b,"@value",L,{propertyIsArray:I.isFrame});continue}if("@language"===T){if(null===L)continue;if(!s(L)&&!I.isFrame)throw new o('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=j(L).map((e=>s(e)?e.toLowerCase():e));for(const e of L)s(e)&&!e.match(x)&&I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:I});w(b,"@language",L,{propertyIsArray:I.isFrame});continue}if("@direction"===T){if(!s(L)&&!I.isFrame)throw new o('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=j(L);for(const e of L)if(s(e)&&"ltr"!==e&&"rtl"!==e)throw new o('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});w(b,"@direction",L,{propertyIsArray:I.isFrame});continue}if("@index"===T){if(!s(L))throw new o('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});w(b,"@index",L);continue}if("@reverse"===T){if(!a(L))throw new o('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(k=await O.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:I}),"@reverse"in k)for(const e in k["@reverse"])w(b,e,k["@reverse"][e],{propertyIsArray:!0});let t=b["@reverse"]||null;for(const e in k){if("@reverse"===e)continue;null===t&&(t=b["@reverse"]={}),w(t,e,[],{propertyIsArray:!0});const n=k[e];for(let r=0;r"@id"===e||"@index"===e))&&(k=j(k).map((e=>({"@graph":j(e)})))),J.mappings.has(E)&&J.mappings.get(E).reverse){const e=b["@reverse"]=b["@reverse"]||{};k=j(k);for(let t=0;t"@value"===h(e,t,{vocab:!0},I))))throw new o("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:r});await E({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:b,options:I,insideList:k,typeScopedContext:R,typeKey:L})}}}function k({activeCtx:e,activeProperty:t,value:n,options:o}){if(null==n)return null;const r=h(e,t,{vocab:!0},o);if("@id"===r)return h(e,n,{base:!0},o);if("@type"===r)return h(e,n,{vocab:!0,base:!0},{...o,typeExpansion:!0});const a=f(e,t,"@type");if(("@id"===a||"@graph"===r)&&s(n)){const r=h(e,n,{base:!0},o);return null===r&&n.match(b)&&o.eventHandler&&S({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:o}),{"@id":r}}if("@vocab"===a&&s(n))return{"@id":h(e,n,{vocab:!0,base:!0},o)};if(v(r))return n;const i={};if(a&&!["@id","@vocab","@none"].includes(a))i["@type"]=a;else if(s(n)){const n=f(e,t,"@language");null!==n&&(i["@language"]=n);const o=f(e,t,"@direction");null!==o&&(i["@direction"]=o)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),i["@value"]=n,i}function D(e,t,n,a){const i=[],l=Object.keys(t).sort();for(const c of l){const l=h(e,c,{vocab:!0},a);let d=t[c];r(d)||(d=[d]);for(const e of d){if(null===e)continue;if(!s(e))throw new o("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const r={"@value":e};"@none"!==l&&(c.match(x)||a.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:a}),r["@language"]=c.toLowerCase()),n&&(r["@direction"]=n),i.push(r)}}return i}async function C({activeCtx:e,options:t,activeProperty:n,value:a,asGraph:i,indexKey:s,propertyIndex:c}){const p=[],v=Object.keys(a).sort(),y="@type"===s;for(let m of v){if(y){const n=f(e,m,"@context");l(n)||(e=await g({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let v,x=a[m];r(x)||(x=[x]),x=await O.expand({activeCtx:e,activeProperty:n,element:x,options:t,insideList:!1,insideIndex:!0}),v=c?"@none"===m?"@none":k({activeCtx:e,activeProperty:s,value:m,options:t}):h(e,m,{vocab:!0},t),"@id"===s?m=h(e,m,{base:!0},t):y&&(m=v);for(let e of x){if(i&&!u(e)&&(e={"@graph":[e]}),"@type"===s)"@none"===v||(e["@type"]?e["@type"]=[m].concat(e["@type"]):e["@type"]=[m]);else{if(d(e)&&!["@language","@type","@index"].includes(s))throw new o(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${s}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==v&&w(e,c,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||s in e||(e[s]=m)}p.push(e)}}return p}e.exports=O,O.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:d=!1,insideIndex:u=!1,typeScopedContext:p=null})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!r(n)&&!a(n))return d||null!==t&&"@graph"!==h(e,t,{vocab:!0},c)?k({activeCtx:e,activeProperty:t,value:n,options:c}):(c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:c}),null);if(r(n)){let o=[];const a=f(e,t,"@container")||[];d=d||a.includes("@list");for(let a=0;a1?o.slice().sort():o:[o];for(const t of r){const n=f(p,t,"@context");l(n)||(e=await g({activeCtx:e,localCtx:n,options:c,propagate:!1}))}}let D={};await E({activeCtx:e,activeProperty:t,expandedActiveProperty:v,element:n,expandedParent:D,options:c,insideList:d,typeKey:N,typeScopedContext:p}),b=Object.keys(D);let C=b.length;if("@value"in D){if("@type"in D&&("@language"in D||"@direction"in D))throw new o('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:D});let t=C-1;if("@type"in D&&(t-=1),"@index"in D&&(t-=1),"@language"in D&&(t-=1),"@direction"in D&&(t-=1),0!==t)throw new o('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:D});const n=null===D["@value"]?[]:j(D["@value"]),r=I(D,"@type");if(y(e,1.1)&&r.includes("@json")&&1===r.length);else if(0===n.length)c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:D}},options:c}),D=null;else{if(!n.every((e=>s(e)||i(e)))&&"@language"in D)throw new o("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:D});if(!r.every((e=>m(e)&&!(s(e)&&0===e.indexOf("_:"))||i(e))))throw new o('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:D})}}else if("@type"in D&&!r(D["@type"]))D["@type"]=[D["@type"]];else if("@set"in D||"@list"in D){if(C>1&&(2!==C||!("@index"in D)))throw new o('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:D});"@set"in D&&(D=D["@set"],b=Object.keys(D),C=b.length)}else 1===C&&"@language"in D&&(c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:D}},options:c}),D=null);if(a(D)&&!c.keepFreeFloatingNodes&&!d&&(null===t||"@graph"===v)&&(0===C||"@value"in D||"@list"in D||1===C&&"@id"in D)){if(c.eventHandler){let e,t;0===C?(e="empty object",t="Dropping empty object."):"@value"in D?(e="object with only @value",t="Dropping object with only @value."):"@list"in D?(e="object with only @list",t="Dropping object with only @list."):1===C&&"@id"in D&&(e="object with only @id",t="Dropping object with only @id."),S({event:{type:["JsonLdEvent"],code:e,level:"warning",message:t,details:{value:D}},options:c})}D=null}return D}},1565:(e,t,n)=>{"use strict";const{isSubjectReference:o}=n(8463),{createMergedNodeMap:r}=n(2664),a={};e.exports=a,a.flatten=e=>{const t=r(e),n=[],a=Object.keys(t).sort();for(let e=0;e{"use strict";const{isKeyword:o}=n(4131),r=n(8463),a=n(832),i=n(1055),s=n(2278),l=n(4093),{createNodeMap:c,mergeNodeMapGraphs:d}=n(2664),u={};function p(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function h(e,t,n){for(let o=n.length-1;o>=0;--o){const r=n[o];if(r.graph===t&&r.subject["@id"]===e["@id"])return!0}return!1}function f(e,t,n){const o="@"+n;let r=o in e?e[o][0]:t[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return r}function v(e){if(!a.isArray(e)||1!==e.length||!a.isObject(e[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of i.asArray(e[0]["@id"]))if(!a.isObject(t)&&!s.isAbsolute(t)||a.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of i.asArray(e[0]["@type"]))if(!a.isObject(t)&&!s.isAbsolute(t)||a.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function g(e,t,n,s){let l=!0,c=!1;for(const d in n){let u=!1;const p=i.getValues(t,d),h=0===i.getValues(n,d).length;if("@id"===d){if(a.isEmptyObject(n["@id"][0]||{})?u=!0:n["@id"].length>=0&&(u=n["@id"].includes(p[0])),!s.requireAll)return u}else if("@type"===d){if(l=!1,h){if(p.length>0)return!1;u=!0}else if(1===n["@type"].length&&a.isEmptyObject(n["@type"][0]))u=p.length>0;else for(const e of n["@type"])u=!(!a.isObject(e)||!("@default"in e))||u||p.some((t=>t===e));if(!s.requireAll)return u}else{if(o(d))continue;{const t=i.getValues(n,d)[0];let o=!1;if(t&&(v([t]),o="@default"in t),l=!1,0===p.length&&o)continue;if(p.length>0&&h)return!1;if(void 0===t){if(p.length>0)return!1;u=!0}else if(r.isList(t)){const n=t["@list"][0];if(r.isList(p[0])){const t=p[0]["@list"];r.isValue(n)?u=t.some((e=>w(n,e))):(r.isSubject(n)||r.isSubjectReference(n))&&(u=t.some((t=>b(e,n,t,s))))}}else u=r.isValue(t)?p.some((e=>w(t,e))):r.isSubjectReference(t)?p.some((n=>b(e,t,n,s))):!!a.isObject(t)&&p.length>0}}if(!u&&s.requireAll)return!1;c=c||u}return l||c}function y(e,t){const n=e.uniqueEmbeds[e.graph],o=n[t],r=o.parent,s=o.property,l={"@id":t};if(a.isArray(r)){for(let e=0;e{const t=Object.keys(n);for(const o of t)o in n&&a.isObject(n[o].parent)&&n[o].parent["@id"]===e&&(delete n[o],c(o))};c(t)}function m(e,t){if(a.isArray(e))return e.map((e=>m(e,t)));if(a.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(r.isValue(e))return e;if(r.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=m(e[n],t)}return e}function x(e,t,n){a.isObject(e)?i.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function b(e,t,n,o){if(!("@id"in n))return!1;const r=e.subjects[n["@id"]];return r&&g(e,r,t,o)}function w(e,t){const n=t["@value"],o=t["@type"],r=t["@language"],i=e["@value"]?a.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?a.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?a.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===i.length&&0===s.length&&0===l.length||!(!i.includes(n)&&!a.isEmptyObject(i[0]))&&!!(!o&&0===s.length||s.includes(o)||o&&a.isEmptyObject(s[0]))&&!!(!r&&0===l.length||l.includes(r)||r&&a.isEmptyObject(l[0]))}e.exports=u,u.frameMergedOrDefault=(e,t,n)=>{const o={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new i.IdentifierIssuer("_:b");c(e,o.graphMap,"@default",r),n.merged&&(o.graphMap["@merged"]=d(o.graphMap),o.graph="@merged"),o.subjects=o.graphMap[o.graph];const a=[];return u.frame(o,Object.keys(o.subjects).sort(),t,a),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(o.bnodeMap).filter((e=>1===o.bnodeMap[e].length))),n.link={},m(a,n)},u.frame=(e,t,n,s,c=null)=>{v(n),n=n[0];const d=e.options,m={embed:f(n,d,"embed"),explicit:f(n,d,"explicit"),requireAll:f(n,d,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const b=e.link[e.graph],j=function(e,t,n,o){const r={};for(const a of t){const t=e.graphMap[e.graph][a];g(e,t,n,o)&&(r[a]=t)}return r}(e,t,n,m),I=Object.keys(j).sort();for(const v of I){const g=j[v];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&v in b){x(s,c,b[v]);continue}const I={"@id":v};if(0===v.indexOf("_:")&&i.addValue(e.bnodeMap,v,I,{propertyIsArray:!0}),b[v]=I,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(v))if(!e.embedded||"@never"!==m.embed&&!h(g,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(v)){if("@last"===m.embed&&v in e.uniqueEmbeds[e.graph]&&y(e,v),e.uniqueEmbeds[e.graph][v]={parent:s,property:c},e.subjectStack.push({subject:g,graph:e.graph}),v in e.graphMap){let t=!1,o=null;"@graph"in n?(o=n["@graph"][0],t=!("@merged"===v||"@default"===v),a.isObject(o)||(o={})):(t="@merged"!==e.graph,o={}),t&&u.frame({...e,graph:v,embedded:!1},Object.keys(e.graphMap[v]).sort(),[o],I,"@graph")}"@included"in n&&u.frame({...e,embedded:!1},t,n["@included"],I,"@included");for(const t of Object.keys(g).sort())if(o(t)){if(I[t]=i.clone(g[t]),"@type"===t)for(const t of g["@type"])0===t.indexOf("_:")&&i.addValue(e.bnodeMap,t,I,{propertyIsArray:!0})}else if(!m.explicit||t in n)for(const o of g[t]){const a=t in n?n[t]:p(m);if(r.isList(o)){const a=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:p(m),s={"@list":[]};x(I,t,s);const l=o["@list"];for(const t of l)r.isSubjectReference(t)?u.frame({...e,embedded:!0},[t["@id"]],a,s,"@list"):x(s,"@list",i.clone(t))}else r.isSubjectReference(o)?u.frame({...e,embedded:!0},[o["@id"]],a,I,t):w(a[0],o)&&x(I,t,i.clone(o))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!a.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(o(e))continue;const t=n[e][0]||{};if(!f(t,d,"omitDefault")&&!(e in I)){let n="@null";"@default"in t&&(n=i.clone(t["@default"])),a.isArray(n)||(n=[n]),I[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const o=n["@reverse"][t];for(const n of Object.keys(e.subjects))i.getValues(e.subjects[n],t).some((e=>e["@id"]===v))&&(I["@reverse"]=I["@reverse"]||{},i.addValue(I["@reverse"],t,[],{propertyIsArray:!0}),u.frame({...e,embedded:!0},[n],o,I["@reverse"][t],c))}x(s,c,I),e.subjectStack.pop()}else x(s,c,I);else x(s,c,I)}},u.cleanupNull=(e,t)=>{if(a.isArray(e))return e.map((e=>u.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(a.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=u.cleanupNull(e[n],t)}return e}},5076:(e,t,n)=>{"use strict";const o=n(4093),r=n(8463),a=n(832),{REGEX_BCP47:i,addValue:s}=n(1055),{handleEvent:l}=n(1696),{RDF_LIST:c,RDF_FIRST:d,RDF_REST:u,RDF_NIL:p,RDF_TYPE:h,RDF_JSON_LITERAL:f,XSD_BOOLEAN:v,XSD_DOUBLE:g,XSD_INTEGER:y,XSD_STRING:m}=n(3770),x={};function b(e,t,n,r){if(e.termType.endsWith("Node"))return{"@id":e.value};const s={"@value":e.value};if(e.language)e.language.match(i)||r.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:r}),s["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=m),c===f){c="@json";try{s["@value"]=JSON.parse(s["@value"])}catch(e){throw new o("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:s["@value"],cause:e})}}if(t){if(c===v)"true"===s["@value"]?s["@value"]=!0:"false"===s["@value"]&&(s["@value"]=!1);else if(a.isNumeric(s["@value"]))if(c===y){const e=parseInt(s["@value"],10);e.toFixed(0)===s["@value"]&&(s["@value"]=e)}else c===g&&(s["@value"]=parseFloat(s["@value"]));[v,y,g,m].includes(c)||(s["@type"]=c)}else if("i18n-datatype"===n&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(s["@language"]=e,e.match(i)||r.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r})),s["@direction"]=t}else c!==m&&(s["@type"]=c)}return s}e.exports=x,x.fromRDF=async(e,t)=>{const n={},o={"@default":n},i={},{useRdfType:l=!1,useNativeTypes:f=!1,rdfDirection:v=null}=t;for(const r of e){const e="DefaultGraph"===r.graph.termType?"@default":r.graph.value;e in o||(o[e]={}),"@default"===e||e in n||(n[e]={"@id":e});const a=o[e],c=r.subject.value,d=r.predicate.value,u=r.object;c in a||(a[c]={"@id":c});const g=a[c],y=u.termType.endsWith("Node");if(y&&!(u.value in a)&&(a[u.value]={"@id":u.value}),d===h&&!l&&y){s(g,"@type",u.value,{propertyIsArray:!0});continue}const m=b(u,f,v,t);if(s(g,d,m,{propertyIsArray:!0}),y)if(u.value===p){const e=a[u.value];"usages"in e||(e.usages=[]),e.usages.push({node:g,property:d,value:m})}else u.value in i?i[u.value]=!1:i[u.value]={node:g,property:d,value:m}}for(const e in o){const t=o[e];if(!(p in t))continue;const n=t[p];if(n.usages){for(let e of n.usages){let n=e.node,o=e.property,s=e.value;const l=[],p=[];let h=Object.keys(n).length;for(;o===u&&a.isObject(i[n["@id"]])&&a.isArray(n[d])&&1===n[d].length&&a.isArray(n[u])&&1===n[u].length&&(3===h||4===h&&a.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===c)&&(l.push(n[d][0]),p.push(n["@id"]),e=i[n["@id"]],n=e.node,o=e.property,s=e.value,h=Object.keys(n).length,r.isBlankNode(n)););delete s["@id"],s["@list"]=l.reverse();for(const e of p)delete t[e]}delete n.usages}}const g=[],y=Object.keys(n).sort();for(const e of y){const t=n[e];if(e in o){const n=t["@graph"]=[],a=o[e],i=Object.keys(a).sort();for(const e of i){const t=a[e];r.isSubjectReference(t)||n.push(t)}}r.isSubjectReference(t)||g.push(t)}return g}},8463:(e,t,n)=>{"use strict";const o=n(832),r={};e.exports=r,r.isSubject=e=>!(!o.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),r.isSubjectReference=e=>o.isObject(e)&&1===Object.keys(e).length&&"@id"in e,r.isValue=e=>o.isObject(e)&&"@value"in e,r.isList=e=>o.isObject(e)&&"@list"in e,r.isGraph=e=>o.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,r.isSimpleGraph=e=>r.isGraph(e)&&!("@id"in e),r.isBlankNode=e=>{if(o.isObject(e)){if("@id"in e){const t=e["@id"];return!o.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},6805:(e,t,n)=>{const o=n(7055),r=n(7222),a=n(1055),i=n(8058),s=a.IdentifierIssuer,l=n(4093),c=n(9593),d=n(9048),{expand:u}=n(2759),{flatten:p}=n(1565),{fromRDF:h}=n(5076),{toRDF:f}=n(9382),{frameMergedOrDefault:v,cleanupNull:g}=n(3859),{isArray:y,isObject:m,isString:x}=n(832),{isSubjectReference:b}=n(8463),{expandIri:w,getInitialContext:j,process:I,processingMode:N}=n(4131),{compact:S,compactIri:O}=n(3251),{createNodeMap:E,createMergedNodeMap:k,mergeNodeMaps:D}=n(2664),{logEventHandler:C,logWarningEventHandler:L,safeEventHandler:R,setDefaultEventHandler:T,setupEventHandler:A,strictEventHandler:_,unhandledEventHandler:M}=n(1696),J=function(e){const t={},J=new c({max:100});function P(t,{documentLoader:n=e.documentLoader,...o}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},o,t,{eventHandler:A({options:t})})}return e.compact=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let r;(o=P(o,{base:x(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new i({sharedCache:J})})).link&&(o.skipExpansion=!0),o.compactToRelative||delete o.base,r=o.skipExpansion?t:await e.expand(t,o);const c=await e.processContext(j(o),n,o);let d=await S({activeCtx:c,element:r,options:o});o.compactArrays&&!o.graph&&y(d)?1===d.length?d=d[0]:0===d.length&&(d={}):o.graph&&m(d)&&(d=[d]),m(n)&&"@context"in n&&(n=n["@context"]),n=a.clone(n),y(n)||(n=[n]);const u=n;n=[];for(let e=0;e0)&&n.push(u[e]);const p=n.length>0;if(1===n.length&&(n=n[0]),y(d)){const e=O({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=d;d={},p&&(d["@context"]=n),d[e]=t}else if(m(d)&&p){const e=d;d={"@context":n};for(const t in e)d[t]=e[t]}return d},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const o={},r=[];if("expandContext"in(n=P(n,{keepFreeFloatingNodes:!1,contextResolver:new i({sharedCache:J})}))){const e=a.clone(n.expandContext);m(e)&&"@context"in e?o.expandContext=e:o.expandContext={"@context":e},r.push(o.expandContext)}let s;if(x(t)){const a=await e.get(t,n);s=a.documentUrl,o.input=a.document,a.contextUrl&&(o.remoteContext={"@context":a.contextUrl},r.push(o.remoteContext))}else o.input=a.clone(t);"base"in n||(n.base=s||"");let l=j(n);for(const e of r)l=await I({activeCtx:l,localCtx:e,options:n});let c=await u({activeCtx:l,element:o.input,options:n});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c},e.flatten=async function(t,n,o){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,o=P(o,{base:x(t)?t:"",contextResolver:new i({sharedCache:J})});const r=await e.expand(t,o),a=p(r);return null===n?a:(o.graph=!0,o.skipExpansion=!0,await e.compact(a,n,o))},e.frame=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(o=P(o,{base:x(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new i({sharedCache:J})}),x(n)){const t=await e.get(n,o);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const r=n&&n["@context"]||{},a=await e.processContext(j(o),r,o);o.hasOwnProperty("omitGraph")||(o.omitGraph=N(a,1.1)),o.hasOwnProperty("pruneBlankNodeIdentifiers")||(o.pruneBlankNodeIdentifiers=N(a,1.1));const s=await e.expand(t,o),l={...o};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),d=Object.keys(n).map((e=>w(a,e,{vocab:!0})));l.merged=!d.includes("@graph"),l.is11=N(a,1.1);const u=v(s,c,l);l.graph=!o.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let p=await e.compact(u,r,l);return l.link={},p=g(p,l),p},e.link=async function(t,n,o){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",e.frame(t,r,o)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=P(n,{base:x(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new i({sharedCache:J})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=d.parse(t);return o.canonize(e,n)}const r={...n};delete r.format,r.produceGeneralizedRdf=!1;const a=await e.toRDF(t,r);return o.canonize(a,n)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=P(n,{format:x(e)?"application/n-quads":void 0});const{format:o}=n;let{rdfParser:r}=n;if(o){if(r=r||t[o],!r)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:o})}else r=()=>e;const a=await r(e);return h(a,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let o;o=(n=P(n,{base:x(t)?t:"",skipExpansion:!1,contextResolver:new i({sharedCache:J})})).skipExpansion?t:await e.expand(t,n);const r=f(o,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return d.serialize(r);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=P(n,{base:x(t)?t:"",contextResolver:new i({sharedCache:J})});const o=await e.expand(t,n);return k(o,n)},e.merge=async function(t,n,o){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,o=P(o,{contextResolver:new i({sharedCache:J})});const r=await Promise.all(t.map((t=>{const n={...o};return e.expand(t,n)})));let l=!0;"mergeNodes"in o&&(l=o.mergeNodes);const c=o.issuer||new s("_:b"),d={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let o;o="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const r=await o(t);try{if(!r.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");x(r.document)&&(r.document=JSON.parse(r.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:r})}return r},e.processContext=async function(e,t,n){return n=P(n,{base:"",contextResolver:new i({sharedCache:J})}),null===t?j(n):(t=a.clone(t),m(t)&&"@context"in t||(t={"@context":t}),I({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(4131).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",d.parse),e.registerRDFParser("application/nquads",d.parse),e.url=n(2278),e.logEventHandler=C,e.logWarningEventHandler=L,e.safeEventHandler=R,e.setDefaultEventHandler=T,e.strictEventHandler=_,e.unhandledEventHandler=M,e.util=a,Object.assign(e,a),e.promises=e,e.RequestQueue=n(533),e.JsonLdProcessor=n(731)(e),r.setupGlobals(e),r.setupDocumentLoaders(e),e},P=function(){return J((function(){return P()}))};J(P),e.exports=P},2664:(e,t,n)=>{"use strict";const{isKeyword:o}=n(4131),r=n(8463),a=n(832),i=n(1055),s=n(4093),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new i.IdentifierIssuer("_:b"),o={"@default":{}};return l.createNodeMap(e,o,"@default",n),l.mergeNodeMaps(o)},l.createNodeMap=(e,t,n,c,d,u)=>{if(a.isArray(e)){for(const o of e)l.createNodeMap(o,t,n,c,void 0,u);return}if(!a.isObject(e))return void(u&&u.push(e));if(r.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(u&&u.push(e))}if(u&&r.isList(e)){const o=[];return l.createNodeMap(e["@list"],t,n,c,d,o),void u.push({"@list":o})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}a.isUndefined(d)&&(d=r.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),u&&u.push({"@id":d});const p=t[n],h=p[d]=p[d]||{};h["@id"]=d;const f=Object.keys(e).sort();for(let a of f){if("@id"===a)continue;if("@reverse"===a){const o={"@id":d},a=e["@reverse"];for(const e in a){const s=a[e];for(const a of s){let s=a["@id"];r.isBlankNode(a)&&(s=c.getId(s)),l.createNodeMap(a,t,n,c,s),i.addValue(p[s],e,o,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===a){d in t||(t[d]={}),l.createNodeMap(e[a],t,d,c);continue}if("@included"===a){l.createNodeMap(e[a],t,n,c);continue}if("@type"!==a&&o(a)){if("@index"===a&&a in h&&(e[a]!==h[a]||e[a]["@id"]!==h[a]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:h});h[a]=e[a];continue}const u=e[a];if(0===a.indexOf("_:")&&(a=c.getId(a)),0!==u.length)for(let e of u)if("@type"===a&&(e=0===e.indexOf("_:")?c.getId(e):e),r.isSubject(e)||r.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const o=r.isBlankNode(e)?c.getId(e["@id"]):e["@id"];i.addValue(h,a,{"@id":o},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,o)}else if(r.isValue(e))i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(e)){const o=[];l.createNodeMap(e["@list"],t,n,c,d,o),e={"@list":o},i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,d),i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else i.addValue(h,a,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const r of Object.keys(e[n]).sort()){const a=e[n][r];r in t||(t[r]={"@id":r});const s=t[r];for(const e of Object.keys(a).sort())if(o(e)&&"@type"!==e)s[e]=i.clone(a[e]);else for(const t of a[e])i.addValue(s,e,i.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const o of n){if("@default"===o)continue;const n=e[o];let a=t[o];a?"@graph"in a||(a["@graph"]=[]):t[o]=a={"@id":o,"@graph":[]};const i=a["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];r.isSubjectReference(t)||i.push(t)}}return t}},7222:(e,t,n)=>{"use strict";const o=n(8831),r={};e.exports=r,r.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=o,e.useDocumentLoader("xhr"))},r.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},9382:(e,t,n)=>{"use strict";const{createNodeMap:o}=n(2664),{isKeyword:r}=n(4131),a=n(8463),i=n(5456),s=n(832),l=n(1055),{handleEvent:c}=n(1696),{RDF_FIRST:d,RDF_REST:u,RDF_NIL:p,RDF_TYPE:h,RDF_JSON_LITERAL:f,RDF_LANGSTRING:v,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:x}=n(3770),{isAbsolute:b}=n(2278),w={};function j(e,t,n,o,a){const i=Object.keys(t).sort();for(const s of i){const i=t[s],l=Object.keys(i).sort();for(let t of l){const l=i[t];if("@type"===t)t=h;else if(r(t))continue;for(const r of l){const i={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!b(s)){a.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:s}},options:a});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!b(t)){a.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:a});continue}if("BlankNode"===l.termType&&!a.produceGeneralizedRdf){a.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:o.getOldIds().find((e=>o.getId(e)===t))}},options:a});continue}const d=I(r,o,e,n,a.rdfDirection,a);d&&e.push({subject:i,predicate:l,object:d,graph:n})}}}}function I(e,t,n,o,r,l){const h={};if(a.isValue(e)){h.termType="Literal",h.value=void 0,h.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)h.value=i(t),h.datatype.value=f;else if(s.isBoolean(t))h.value=t.toString(),h.datatype.value=n||g;else if(s.isDouble(t)||n===y)s.isDouble(t)||(t=parseFloat(t)),h.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),h.datatype.value=n||y;else if(s.isNumber(t))h.value=t.toFixed(0),h.datatype.value=n||m;else if("i18n-datatype"===r&&"@direction"in e){const n="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;h.datatype.value=n,h.value=t}else"@language"in e?(h.value=t,h.datatype.value=n||v,h.language=e["@language"]):(h.value=t,h.datatype.value=n||x)}else if(a.isList(e)){const a=function(e,t,n,o,r,a){const i={termType:"NamedNode",value:d},s={termType:"NamedNode",value:u},l={termType:"NamedNode",value:p},c=e.pop(),h=c?{termType:"BlankNode",value:t.getId()}:l;let f=h;for(const l of e){const e=I(l,t,n,o,r,a),c={termType:"BlankNode",value:t.getId()};n.push({subject:f,predicate:i,object:e,graph:o}),n.push({subject:f,predicate:s,object:c,graph:o}),f=c}if(c){const e=I(c,t,n,o,r,a);n.push({subject:f,predicate:i,object:e,graph:o}),n.push({subject:f,predicate:s,object:l,graph:o})}return h}(e["@list"],t,n,o,r,l);h.termType=a.termType,h.value=a.value}else{const t=s.isObject(e)?e["@id"]:e;h.termType=t.startsWith("_:")?"BlankNode":"NamedNode",h.value=t}return"NamedNode"!==h.termType||b(h.value)?h:(l.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:h.value}},options:l}),null)}e.exports=w,w.toRDF=(e,t)=>{const n=new l.IdentifierIssuer("_:b"),r={"@default":{}};o(e,r,"@default",n);const a=[],i=Object.keys(r).sort();for(const e of i){let o;if("@default"===e)o={termType:"DefaultGraph",value:""};else{if(!b(e)){t.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}o=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},o.value=e}j(a,r[e],o,n,t)}return a}},832:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},2278:(e,t,n)=>{"use strict";const o=n(832),r={};e.exports=r,r.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(e,t)=>{const n={},o=r.parsers[t||"full"],a=o.regex.exec(e);let i=o.keys.length;for(;i--;)n[o.keys[i]]=void 0===a[i]?null:a[i];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(e,t)=>{if(null===e)return t;if(r.isAbsolute(t))return t;e&&!o.isString(e)||(e=r.parse(e||""));const n=r.parse(t),a={protocol:e.protocol||""};if(null!==n.authority)a.authority=n.authority,a.path=n.path,a.query=n.query;else if(a.authority=e.authority,""===n.path)a.path=e.path,null!==n.query?a.query=n.query:a.query=e.query;else{if(0===n.path.indexOf("/"))a.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,a.path=t}a.query=n.query}""!==n.path&&(a.path=r.removeDotSegments(a.path));let i=a.protocol;return null!==a.authority&&(i+="//"+a.authority),i+=a.path,null!==a.query&&(i+="?"+a.query),null!==n.fragment&&(i+="#"+n.fragment),""===i&&(i="./"),i},r.removeBase=(e,t)=>{if(null===e)return t;e&&!o.isString(e)||(e=r.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const a=r.parse(t.substr(n.length)),i=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),l=a.fragment||a.query?0:1;for(;i.length>0&&s.length>l&&i[0]===s[0];)i.shift(),s.shift();let c="";if(i.length>0){i.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),o=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),o&&n.push("")):o&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=e=>o.isString(e)&&a.test(e),r.isRelative=e=>o.isString(e)},1055:(e,t,n)=>{"use strict";const o=n(8463),r=n(832),a=n(7055).IdentifierIssuer,i=n(4093),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,d="application/ld+json, application/json",u={};function p(e,t){if(r.isArray(t))for(let n=0;n{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+d+'" is supported.');return Object.assign({Accept:d},e)},u.parseLinkHeader=e=>{const t={},n=e.match(s);for(let e=0;e{if(!(r.isString(e)||r.isArray(e)&&e.every((e=>r.isString(e))))){if(t&&r.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&u.asArray(e["@default"]).every((e=>r.isString(e))))return}throw new i('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},u.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!r.isArray(n)||n.length>0}return!1},u.hasValue=(e,t,n)=>{if(u.hasProperty(e,t)){let a=e[t];const i=o.isList(a);if(r.isArray(a)||i){i&&(a=a["@list"]);for(let e=0;e{if("propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1),"valueIsArray"in o||(o.valueIsArray=!1),"allowDuplicate"in o||(o.allowDuplicate=!0),"prependValue"in o||(o.prependValue=!1),o.valueIsArray)e[t]=n;else if(r.isArray(n)){0===n.length&&o.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),o.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let r=0;r[].concat(e[t]||[]),u.removeProperty=(e,t)=>{delete e[t]},u.removeValue=(e,t,n,o)=>{"propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1);const r=u.getValues(e,t).filter((e=>!u.compareValues(e,n)));0===r.length?u.removeProperty(e,t):1!==r.length||o.propertyIsArray?e[t]=r:e[t]=r[0]},u.relabelBlankNodes=(e,t)=>p((t=t||{}).issuer||new a("_:b"),e),u.compareValues=(e,t)=>e===t||!(!o.isValue(e)||!o.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(r.isObject(e)&&"@id"in e&&r.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],u.compareShortestLeast=(e,t)=>e.length{"use strict";const o=n(4411),r=Symbol("max"),a=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),d=Symbol("noDisposeOnSet"),u=Symbol("lruList"),p=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1,v=(e,t,n)=>{const o=e[p].get(t);if(o){const t=o.value;if(g(e,t)){if(m(e,o),!e[s])return}else n&&(e[h]&&(o.value.now=Date.now()),e[u].unshiftNode(o));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[a]>e[r])for(let t=e[u].tail;e[a]>e[r]&&null!==t;){const n=t.prev;m(e,t),t=n}},m=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[a]-=n.length,e[p].delete(n.key),e[u].removeNode(t)}};class x{constructor(e,t,n,o,r){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=r||0}}const b=(e,t,n,o)=>{let r=n.value;g(e,r)&&(m(e,n),e[s]||(r=void 0)),r&&t.call(o,r.value,r.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[r]=e.max||1/0;const t=e.length||f;if(this[i]="function"!=typeof t?f:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[d]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[r]=e||1/0,y(this)}get max(){return this[r]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[i]&&(this[i]=e,this[a]=0,this[u].forEach((e=>{e.length=this[i](e.value,e.key),this[a]+=e.length}))),y(this)}get lengthCalculator(){return this[i]}get length(){return this[a]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let n=this[u].tail;null!==n;){const o=n.prev;b(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[u].head;null!==n;){const o=n.next;b(this,e,n,t),n=o}}keys(){return this[u].toArray().map((e=>e.key))}values(){return this[u].toArray().map((e=>e.value))}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach((e=>this[c](e.key,e.value))),this[p]=new Map,this[u]=new o,this[a]=0}dump(){return this[u].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[u]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,s=this[i](t,e);if(this[p].has(e)){if(s>this[r])return m(this,this[p].get(e)),!1;const i=this[p].get(e).value;return this[c]&&(this[d]||this[c](e,i.value)),i.now=o,i.maxAge=n,i.value=t,this[a]+=s-i.length,i.length=s,this.get(e),y(this),!0}const h=new x(e,t,s,o,n);return h.length>this[r]?(this[c]&&this[c](e,t),!1):(this[a]+=h.length,this[u].unshift(h),this[p].set(e,this[u].head),y(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!g(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[u].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],r=o.e||0;if(0===r)this.set(o.k,o.v);else{const e=r-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[p].forEach(((e,t)=>v(this,t,!1)))}}},7055:(e,t,n)=>{e.exports=n(9344)},2401:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:o}=this;return new e(t,new Map(n),o)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},5947:(e,t,n)=>{"use strict";n(4889);const o=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!o||!o.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await o.subtle.digest(this.algorithm,e));let n="";for(let e=0;e{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",o="NamedNode",r="BlankNode",a="Literal",i="DefaultGraph",s={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",n=t+"0-9-·̀-ͯ‿-⁀",o="(_:(?:["+t+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",r="[ \\t]+",a="[ \\t]*",i="(?:"+e+"|"+o+")"+r,l=e+r,c="(?:"+e+"|"+o+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+a,d="(?:\\.|(?:(?:"+e+"|"+o+")"+a+"\\.))";s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=new RegExp("^"+a+"$"),s.quad=new RegExp("^"+a+i+l+c+d+a+"$")})(),e.exports=class e{static parse(e){const l=[],d={},u=e.split(s.eoln);let p=0;for(const e of u){if(p++,s.empty.test(e))continue;const u=e.match(s.quad);if(null===u)throw new Error("N-Quads parse error on line "+p+".");const v={subject:null,predicate:null,object:null,graph:null};if(void 0!==u[1]?v.subject={termType:o,value:u[1]}:v.subject={termType:r,value:u[2]},v.predicate={termType:o,value:u[3]},void 0!==u[4]?v.object={termType:o,value:u[4]}:void 0!==u[5]?v.object={termType:r,value:u[5]}:(v.object={termType:a,value:void 0,datatype:{termType:o}},void 0!==u[7]?v.object.datatype.value=u[7]:void 0!==u[8]?(v.object.datatype.value=t,v.object.language=u[8]):v.object.datatype.value=n,v.object.value=u[6].replace(c,(function(e,t,n,o){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(o)throw new Error("Unsupported U escape")}))),void 0!==u[9]?v.graph={termType:o,value:u[9]}:void 0!==u[10]?v.graph={termType:r,value:u[10]}:v.graph={termType:i,value:""},v.graph.value in d){let e=!0;const t=d[v.graph.value];for(const n of t)if(f=v,(h=n).subject.termType===f.subject.termType&&h.object.termType===f.object.termType&&h.subject.value===f.subject.value&&h.predicate.value===f.predicate.value&&h.object.value===f.object.value&&(h.object.termType!==a||h.object.datatype.termType===f.object.datatype.termType&&h.object.language===f.object.language&&h.object.datatype.value===f.object.datatype.value)){e=!1;break}e&&(t.push(v),l.push(v))}else d[v.graph.value]=[v],l.push(v)}var h,f;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const o of t)n.push(e.serializeQuad(o));return n.sort().join("")}static serializeQuadComponents(e,a,i,s){let c="";return e.termType===o?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${a.value}> `,i.termType===o?c+=`<${i.value}>`:i.termType===r?c+=i.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(i.value)}"`,i.datatype.value===t?i.language&&(c+=`@${i.language}`):i.datatype.value!==n&&(c+=`^^<${i.datatype.value}>`)),s.termType===o?c+=` <${s.value}>`:s.termType===r&&(c+=` ${s.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const s=[],l={"blank node":r,IRI:o,literal:a};for(const c in e)e[c].forEach((e=>{const d={};for(const r in e){const i=e[r],s={termType:l[i.type],value:i.value};s.termType===a&&(s.datatype={termType:o},"datatype"in i&&(s.datatype.value=i.datatype),"language"in i?("datatype"in i||(s.datatype.value=t),s.language=i.language):"datatype"in i||(s.datatype.value=n)),d[r]=s}d.graph="@default"===c?{termType:i,value:""}:{termType:c.startsWith("_:")?r:o,value:c},s.push(d)}));return s}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},8326:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;to)&&(s&&n>0&&i>e[n-1]||!s&&ne[n+1])&&(o=i,r=n)}if(null===o)this.done=!0;else{const n=t.get(o)?r-1:r+1;e[r]=e[n],e[n]=o;for(const n of e)n>o&&t.set(n,!t.get(n))}return n}}},3445:(e,t,n)=>{"use strict";const o=n(2401),r=n(5947),a=n(8326),i=n(9980);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new r("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let r=0;for(const e of n)++r%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const a=[...t.keys()].sort(),l=[];for(const e of a){const n=t.get(e);if(n.length>1){l.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of l){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("_:b");e.getId(n);const r=await this.hashNDegreeQuads(n,e);t.push(r)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=i.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(i.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=await r.digest(),n.hash}async hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(o),"g"!==o&&a.update(this.getRelatedPredicate(t)),a.update(r),a.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),r=await this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const s=new a(r.get(e));let l=0;for(;s.hasNext();){const e=s.next();++l%3==0&&await this._yield();let o=t.clone(),r="";const a=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||a.push(t),r+=o.getId(t)),0!==i.length&&r>i){c=!0;break}if(!c){for(const e of a){const t=await this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){c=!0;break}}c||(0===i.length||r`}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let r=0;for(const a of o)++r%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:r,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=await this.hashRelatedBlankNode(i,e,r,n),l=a.get(s);l?l.push(i):a.set(s,[i])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},5643:(e,t,n)=>{"use strict";const o=n(2401),r=n(5947),a=n(8326),i=n(9980);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new r("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const r=[...t.keys()].sort(),a=[];for(const e of r){const n=t.get(e);if(n.length>1){a.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of a){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("_:b");e.getId(n);const r=this.hashNDegreeQuads(n,e);t.push(r)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=i.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(i.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=r.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(o),"g"!==o&&a.update(this.getRelatedPredicate(t)),a.update(r),a.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),r=this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const s=new a(r.get(e));for(;s.hasNext();){const e=s.next();let o=t.clone(),r="";const a=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||a.push(t),r+=o.getId(t)),0!==i.length&&r>i){l=!0;break}if(!l){for(const e of a){const t=this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){l=!0;break}}l||(0===i.length||r`}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const r of o)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:r,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=this.hashRelatedBlankNode(i,e,r,n),l=a.get(s);l?l.push(i):a.set(s,[i])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},9201:(e,t,n)=>{"use strict";const o=n(5947),r=n(3445);e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new o("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let r=0;for(const a of o){let o,i;if("BlankNode"===a.subject.termType&&a.subject.value!==e)i=a.subject.value,o="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;i=a.object.value,o="r"}++r%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(i,a,t,o),l=n.get(s);l?l.push(i):n.set(s,[i])}return n}}},7702:(e,t,n)=>{"use strict";const o=n(5947),r=n(5643);e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new o("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const r of o){let o,a;if("BlankNode"===r.subject.termType&&r.subject.value!==e)a=r.subject.value,o="p";else{if("BlankNode"!==r.object.termType||r.object.value===e)continue;a=r.object.value,o="r"}const i=this.hashRelatedBlankNode(a,r,t,o),s=n.get(i);s?s.push(a):n.set(i,[a])}return n}}},9344:(e,t,n)=>{"use strict";const o=n(3445),r=n(9201),a=n(5643),i=n(7702);let s;try{s=n(3421)}catch(e){}t.NQuads=n(9980),t.IdentifierIssuer=n(2401),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,n){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),n.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,o)=>s.canonize(e,n,((e,n)=>e?o(e):t(n)))))}if("URDNA2015"===n.algorithm)return new o(n).main(e);if("URGNA2012"===n.algorithm){if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new r(n).main(e)}if(!("algorithm"in n))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm)},t._canonizeSync=function(e,n){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),n.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(e,n)}if("URDNA2015"===n.algorithm)return new a(n).main(e);if("URGNA2012"===n.algorithm){if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(n).main(e)}if(!("algorithm"in n))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm)}},4889:function(e,t,n){!function(e,t){"use strict";if(!e.setImmediate){var n,o,r,a,i,s=1,l={},c=!1,d=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){r.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(h,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),o=0;o{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},4411:(e,t,n)=>{"use strict";function o(e){var t=this;if(t instanceof o||(t=new o),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");o=this.head.next,n=this.head.value}for(var r=0;null!==o;r++)n=e(n,o.value,r),o=o.next;return n},o.prototype.reduceReverse=function(e,t){var n,o=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");o=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==o;r--)n=e(n,o.value,r),o=o.prev;return n},o.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},o.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},o.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(tthis.length&&(t=this.length);for(var r=0,a=this.head;null!==a&&rthis.length&&(t=this.length);for(var r=this.length,a=this.tail;null!==a&&r>t;r--)a=a.prev;for(;null!==a&&r>e;r--,a=a.prev)n.push(a.value);return n},o.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,a=this.head;null!==a&&o{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,o)=>t+(0===o?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,o,r)=>void 0===t[o]||"symbol"==typeof t[o]?n:n+(0===n.length?"":",")+e(o)+":"+e(t[o])),"")+"}"}},8058:(e,t,n)=>{"use strict";const{isArray:o,isObject:r,isString:a}=n(832),{asArray:i}=n(1055),{prependBase:s}=n(2278),l=n(4093),c=n(6767);function d(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function u({context:e,base:t}){if(!e)return;const n=e["@context"];if(a(n))e["@context"]=s(t,n);else if(o(n))for(let e=0;e10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(i.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,c;i.add(t);try{c=await n(t),s=c.document||null,a(s)&&(s=JSON.parse(s))}catch(e){throw new l("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!r(s))throw new l("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},c.contextUrl&&(o(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(c.contextUrl)),{context:s,remoteDoc:c}}}},4093:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},731:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},9048:(e,t,n)=>{"use strict";e.exports=n(7055).NQuads},533:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},6767:(e,t,n)=>{"use strict";const o=n(9593);e.exports=class{constructor({document:e}){this.document=e,this.cache=new o({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},3251:(e,t,n)=>{"use strict";const o=n(4093),{isArray:r,isObject:a,isString:i,isUndefined:s}=n(832),{isList:l,isValue:c,isGraph:d,isSimpleGraph:u,isSubjectReference:p}=n(8463),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(4131),{removeBase:m,prependBase:x}=n(2278),{REGEX_KEYWORD:b,addValue:w,asArray:j,compareShortestLeast:I}=n(1055),N={};function S(e,t,n){if("@nest"!==h(e,t,{vocab:!0},n))throw new o("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=N,N.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:h={}})=>{if(r(n)){let o=[];for(let r=0;r1&&(O=Array.from(O).sort());const E=e;for(const t of O){const n=N.compactIri({activeCtx:E,iri:t,relativeTo:{vocab:!0}}),o=f(b,n,"@context");s(o)||(e=await g({activeCtx:e,localCtx:o,options:h,propagate:!1}))}const D=Object.keys(n).sort();for(const s of D){const p=n[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&v(s)){const t=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,t,p)}else{if(!r(p))throw new o("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const t=N.compactIri({activeCtx:e,iri:s,value:p,relativeTo:{vocab:!0},reverse:m}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let o=x;n&&(S(e,n,h),a(x[n])||(x[n]={}),o=x[n]),w(o,t,p,{propertyIsArray:!0})}for(const t of p){const n=N.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:m}),o=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let p=x;o&&(S(e,o,h),a(x[o])||(x[o]={}),p=x[o]);const v=f(e,n,"@container")||[],g=d(t),y=l(t);let b;y?b=t["@list"]:g&&(b=t["@graph"]);let I=await N.compact({activeCtx:e,activeProperty:n,element:y||g?b:t,options:h});if(y){if(r(I)||(I=[I]),v.includes("@list")){w(p,n,I,{valueIsArray:!0,allowDuplicate:!0});continue}I={[N.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:I},"@index"in t&&(I[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(g)if(v.includes("@graph")&&(v.includes("@id")||v.includes("@index")&&u(t))){let o;p.hasOwnProperty(n)?o=p[n]:p[n]=o={};const r=(v.includes("@id")?t["@id"]:t["@index"])||N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(o,r,I,{propertyIsArray:!h.compactArrays||v.includes("@set")})}else v.includes("@graph")&&u(t)?(r(I)&&I.length>1&&(I={"@included":I}),w(p,n,I,{propertyIsArray:!h.compactArrays||v.includes("@set")})):(r(I)&&1===I.length&&h.compactArrays&&(I=I[0]),I={[N.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:I},"@id"in t&&(I[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(I[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(p,n,I,{propertyIsArray:!h.compactArrays||v.includes("@set")}));else if(v.includes("@language")||v.includes("@index")||v.includes("@id")||v.includes("@type")){let o,r;if(p.hasOwnProperty(n)?o=p[n]:p[n]=o={},v.includes("@language"))c(I)&&(I=I["@value"]),r=t["@language"];else if(v.includes("@index")){const o=f(e,n,"@index")||"@index",a=N.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}});if("@index"===o)r=t["@index"],delete I[a];else{let e;if([r,...e]=j(I[o]||[]),i(r))switch(e.length){case 0:delete I[o];break;case 1:I[o]=e[0];break;default:I[o]=e}else r=null}}else if(v.includes("@id")){const t=N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});r=I[t],delete I[t]}else if(v.includes("@type")){const o=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let a;switch([r,...a]=j(I[o]||[]),a.length){case 0:delete I[o];break;case 1:I[o]=a[0];break;default:I[o]=a}1===Object.keys(I).length&&"@id"in t&&(I=await N.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:h}))}r||(r=N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(o,r,I,{propertyIsArray:v.includes("@set")})}else{const e=!h.compactArrays||v.includes("@set")||v.includes("@list")||r(I)&&0===I.length||"@list"===s||"@graph"===s;w(p,n,I,{propertyIsArray:e})}}}else{if((f(e,t,"@container")||[]).includes("@index"))continue;const n=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,p)}else{const n=await N.compact({activeCtx:e,activeProperty:t,element:p,options:h});r(n)&&0===n.length||w(x,s,n)}else{const t=await N.compact({activeCtx:e,activeProperty:"@reverse",element:p,options:h});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const o=t[n],r=(f(e,n,"@container")||[]).includes("@set")||!h.compactArrays;w(x,n,o,{propertyIsArray:r}),delete t[n]}if(Object.keys(t).length>0){const n=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,t)}}else{let t=j(p).map((e=>N.compactIri({activeCtx:b,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const n=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),o=(f(e,n,"@container")||[]).includes("@set")&&y(e,1.1)||r(t)&&0===p.length;w(x,n,t,{propertyIsArray:o})}else{let t=j(p).map((t=>N.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:h.base})));1===t.length&&(t=t[0]),x[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return x}return n},N.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:r={vocab:!1},reverse:i=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const u=e.getInverse();if(v(t)&&t in u&&"@none"in u[t]&&"@type"in u[t]["@none"]&&"@none"in u[t]["@none"]["@type"])return u[t]["@none"]["@type"]["@none"];if(r.vocab&&t in u){const o=e["@language"]||"@none",r=[];a(n)&&"@index"in n&&!("@graph"in n)&&r.push("@index","@index@set"),a(n)&&"@preserve"in n&&(n=n["@preserve"][0]),d(n)?("@index"in n&&r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&r.push("@graph@id","@graph@id@set"),r.push("@graph","@graph@set","@set"),"@index"in n||r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||r.push("@graph@id","@graph@id@set")):a(n)&&!c(n)&&r.push("@id","@id@set","@type","@set@type");let s="@language",u="@null";if(i)s="@type",u="@reverse",r.push("@set");else if(l(n)){"@index"in n||r.push("@list");const e=n["@list"];if(0===e.length)s="@any",u="@none";else{let t=0===e.length?o:null,n=null;for(let o=0;oe.includes("_")));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const l=e.inverse[t];for(const e of o){if(!(e in l))continue;const t=l[e][r];for(const e of s)if(e in t)return t[e]}return null}(e,t,n,r,s,u);if(null!==p)return p}if(r.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const o=t.substr(n.length);if(!e.mappings.has(o))return o}}let p=null;const h=[];let f=e.fastCurieMap;const g=t.length-1;for(let e=0;e=0;--o){const r=h[o],a=r.terms;for(const o of a){const a=o+":"+t.substr(r.iri.length);e.mappings.get(o)._prefix&&(!e.mappings.has(a)||null===n&&e.mappings.get(a)["@id"]===t)&&(null===p||I(a,p)<0)&&(p=a)}}if(null!==p)return p;for(const[n,r]of e.mappings)if(r&&r._prefix&&t.startsWith(n+":"))throw new o(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!r.vocab){if("@base"in e){if(e["@base"]){const n=m(x(s,e["@base"]),t);return b.test(n)?`./${n}`:n}return t}return m(s,t)}return t},N.compactValue=({activeCtx:e,activeProperty:t,value:n,options:o})=>{if(c(n)){const o=f(e,t,"@type"),r=f(e,t,"@language"),a=f(e,t,"@direction"),s=f(e,t,"@container")||[],l="@index"in n&&!s.includes("@index");if(!l&&"@none"!==o){if(n["@type"]===o)return n["@value"];if("@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===a)return n["@value"];if("@language"in n&&n["@language"]===r)return n["@value"];if("@direction"in n&&n["@direction"]===a)return n["@value"]}const c=Object.keys(n).length,d=1===c||2===c&&"@index"in n&&!l,u="@language"in e,p=i(n["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(d&&"@none"!==o&&(!u||!p||h))return n["@value"];const v={};return l&&(v[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?v[N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=N.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(v[N.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(v[N.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),v[N.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],v}const r=h(e,t,{vocab:!0},o),a=f(e,t,"@type"),s=N.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===a},base:o.base});return"@id"===a||"@vocab"===a||"@graph"===r?s:{[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},3770:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},4131:(e,t,n)=>{"use strict";const o=n(1055),r=n(4093),{isArray:a,isObject:i,isString:s,isUndefined:l}=n(832),{isAbsolute:c,isRelative:d,prependBase:u}=n(2278),{handleEvent:p}=n(1696),{REGEX_BCP47:h,REGEX_KEYWORD:f,asArray:v,compareShortestLeast:g}=n(1055),y=new Map,m={};function x(e,t,n,o,r,a){if(null===t||!s(t)||m.isKeyword(t))return t;if(t.match(f))return null;if(o&&o.hasOwnProperty(t)&&!0!==r.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:t,defined:r,options:a}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(i(n)&&"@id"in n)return n["@id"]}const l=t.indexOf(":");if(l>0){const n=t.substr(0,l),i=t.substr(l+1);if("_"===n||0===i.indexOf("//"))return t;o&&o.hasOwnProperty(n)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:n,defined:r,options:a});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+i;if(c(t))return t}if(n.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(n.base){let n,o;"@base"in e?e["@base"]?(o=u(a.base,e["@base"]),n=u(o,t)):(o=e["@base"],n=t):(o=a.base,n=u(a.base,t)),t=n}return t}function b(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n{if(i(t)&&"@context"in t&&a(t["@context"])&&(t=t["@context"]),0===v(t).length)return e;const g=[],y=[({event:e,next:t})=>{g.push(e),t()}];n.eventHandler&&y.push(n.eventHandler);const b=n;n={...n,eventHandler:y};const w=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});i(w[0].document)&&"boolean"==typeof w[0].document["@propagate"]&&(o=w[0].document["@propagate"]);let j=e;o||j.previousContext||(j=j.clone(),j.previousContext=e);for(const o of w){let{document:a}=o;if(e=j,null===a){if(!l&&0!==Object.keys(e.protected).length)throw new r("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});j=e=m.getInitialContext(n).clone();continue}const v=o.getProcessed(e);if(v){if(b.eventHandler)for(const e of v.events)p({event:e,options:b});j=e=v.context;continue}if(i(a)&&"@context"in a&&(a=a["@context"]),!i(a))throw new r("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:a});j=j.clone();const y=new Map;if("@version"in a){if(1.1!==a["@version"])throw new r("Unsupported JSON-LD version: "+a["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:a});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new r("@version: "+a["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:a});j.processingMode="json-ld-1.1",j["@version"]=a["@version"],y.set("@version",!0)}if(j.processingMode=j.processingMode||e.processingMode,"@base"in a){let e=a["@base"];if(null===e||c(e));else{if(!d(e))throw new r('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:a});e=u(j["@base"],e)}j["@base"]=e,y.set("@base",!0)}if("@vocab"in a){const e=a["@vocab"];if(null===e)delete j["@vocab"];else{if(!s(e))throw new r('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:a});if(!c(e)&&m.processingMode(j,1))throw new r('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:a});{const t=x(j,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),j["@vocab"]=t}}y.set("@vocab",!0)}if("@language"in a){const e=a["@language"];if(null===e)delete j["@language"];else{if(!s(e))throw new r('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:a});e.match(h)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),j["@language"]=e.toLowerCase()}y.set("@language",!0)}if("@direction"in a){const t=a["@direction"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:a});if(null===t)delete j["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new r('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:a});j["@direction"]=t}y.set("@direction",!0)}if("@propagate"in a){const n=a["@propagate"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if("boolean"!=typeof n)throw new r("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});y.set("@propagate",!0)}if("@import"in a){const o=a["@import"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if(!s(o))throw new r("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const i=await n.contextResolver.resolve({activeCtx:e,context:o,documentLoader:n.documentLoader,base:n.base});if(1!==i.length)throw new r("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=i[0].getProcessed(e);if(l)a=l;else{const n=i[0].document;if("@import"in n)throw new r("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)a.hasOwnProperty(e)||(a[e]=n[e]);i[0].setProcessed(e,a)}y.set("@import",!0)}y.set("@protected",a["@protected"]||!1);for(const e in a)if(m.createTermDefinition({activeCtx:j,localCtx:a,term:e,defined:y,options:n,overrideProtected:l}),i(a[e])&&"@context"in a[e]){const t=a[e]["@context"];let o=!0;if(s(t)){const e=u(n.base,t);f.has(e)?o=!1:f.add(e)}if(o)try{await m.process({activeCtx:j.clone(),localCtx:a[e]["@context"],overrideProtected:!0,options:n,cycles:f})}catch(t){throw new r("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:a[e]["@context"],term:e})}}o.setProcessed(e,{context:j,events:g})}return j},m.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:o,options:l,overrideProtected:d=!1})=>{if(o.has(n)){if(o.get(n))return;throw new r("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let u;if(o.set(n,!1),t.hasOwnProperty(n)&&(u=t[n]),"@type"===n&&i(u)&&"@set"===(u["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],o=Object.keys(u);if(0===o.length||o.some((t=>!e.includes(t))))throw new r("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(m.isKeyword(n))throw new r("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(f))return void(l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:l}));if(""===n)throw new r("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const h=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let v=!1;if((s(u)||null===u)&&(v=!0,u={"@id":u}),!i(u))throw new r("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const g={};e.mappings.set(n,g),g.reverse=!1;const y=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&y.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in u)if(!y.includes(e))throw new r("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const w=n.indexOf(":");if(g._termHasColon=w>0,"@reverse"in u){if("@id"in u)throw new r("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in u)throw new r("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=u["@reverse"];if(!s(a))throw new r("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(a.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:a}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));const i=x(e,a,{vocab:!0,base:!1},t,o,l);if(!c(i))throw new r("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});g["@id"]=i,g.reverse=!0}else if("@id"in u){let a=u["@id"];if(a&&!s(a))throw new r("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)g["@id"]=null;else{if(!m.isKeyword(a)&&a.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:a}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));if(a!==n){if(a=x(e,a,{vocab:!0,base:!1},t,o,l),!c(a)&&!m.isKeyword(a))throw new r("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&x(e,n,{vocab:!0,base:!1},t,new Map(o).set(n,!0),l)!==a)throw new r("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});g["@id"]=a,g._prefix=v&&!g._termHasColon&&null!==a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in g))if(g._termHasColon){const r=n.substr(0,w);if(t.hasOwnProperty(r)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:r,defined:o,options:l}),e.mappings.has(r)){const t=n.substr(w+1);g["@id"]=e.mappings.get(r)["@id"]+t}else g["@id"]=n}else if("@type"===n)g["@id"]=n;else{if(!("@vocab"in e))throw new r("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});g["@id"]=e["@vocab"]+n}if((!0===u["@protected"]||!0===o.get("@protected")&&!1!==u["@protected"])&&(e.protected[n]=!0,g.protected=!0),o.set(n,!0),"@type"in u){let n=u["@type"];if(!s(n))throw new r("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(m.processingMode(e,1))throw new r(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=x(e,n,{vocab:!0,base:!1},t,o,l),!c(n))throw new r("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new r("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}g["@type"]=n}if("@container"in u){const n=s(u["@container"])?[u["@container"]]:u["@container"]||[],o=["@list","@set","@index","@language"];let i=!0;const l=n.includes("@set");if(m.processingMode(e,1.1)){if(o.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new r("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new r("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=n.length<=(l?2:1);if(n.includes("@type")&&(g["@type"]=g["@type"]||"@id",!["@id","@vocab"].includes(g["@type"])))throw new r("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else i&=!a(u["@container"]),i&=n.length<=1;if(i&=n.every((e=>o.includes(e))),i&=!(l&&n.includes("@list")),!i)throw new r("Invalid JSON-LD syntax; @context @container value must be one of the following: "+o.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(g.reverse&&!n.every((e=>["@index","@set"].includes(e))))throw new r("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});g["@container"]=n}if("@index"in u){if(!("@container"in u)||!g["@container"].includes("@index"))throw new r(`Invalid JSON-LD syntax; @index without @index in @container: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(u["@index"])||0===u["@index"].indexOf("@"))throw new r(`Invalid JSON-LD syntax; @index must expand to an IRI: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});g["@index"]=u["@index"]}if("@context"in u&&(g["@context"]=u["@context"]),"@language"in u&&!("@type"in u)){let e=u["@language"];if(null!==e&&!s(e))throw new r("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),g["@language"]=e}if("@prefix"in u){if(n.match(/:|\//))throw new r("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(g["@id"]))throw new r("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof u["@prefix"])throw new r("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});g._prefix=!0===u["@prefix"]}if("@direction"in u){const e=u["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});g["@direction"]=e}if("@nest"in u){const e=u["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new r("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});g["@nest"]=e}const j=g["@id"];if("@context"===j||"@preserve"===j)throw new r("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(h&&h.protected&&!d&&(e.protected[n]=!0,g.protected=!0,!b(h,g)))throw new r("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},m.expandIri=(e,t,n,o)=>x(e,t,n,void 0,void 0,o),m.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=y.get(t);if(n)return n;const r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},o={},r=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],l=e.mappings,c=[...l.keys()].sort(g);for(const e of c){const a=l.get(e);if(null===a)continue;let c=a["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===a["@id"])continue;const d=v(a["@id"]);for(const l of d){let d=t[l];const u=m.isKeyword(l);if(d)u||a._termHasColon||o[l].push(e);else if(t[l]=d={},!u&&!a._termHasColon){o[l]=[e];const t={iri:l,terms:o[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(d[c]||(d[c]={"@language":{},"@type":{},"@any":{}}),d=d[c],i(e,d["@any"],"@none"),a.reverse)i(e,d["@type"],"@reverse");else if("@none"===a["@type"])i(e,d["@any"],"@none"),i(e,d["@language"],"@none"),i(e,d["@type"],"@none");else if("@type"in a)i(e,d["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],n=a["@direction"];i(e,d["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in a?i(e,d["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?i(e,d["@language"],`_${a["@direction"]}`):i(e,d["@language"],"@none"):s?(i(e,d["@language"],`_${s}`),i(e,d["@language"],"@none"),i(e,d["@type"],"@none")):(i(e,d["@language"],r),i(e,d["@language"],"@none"),i(e,d["@type"],"@none"))}}for(const e in n)a(n,e,1);return t},clone:function(){const e={};return e.mappings=o.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=o.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===y.size&&y.clear(),y.set(t,r),r;function a(e,t,n){const o=e[t],r=e[t]={};let i,s;for(const e of o)i=e.iri,s=n>=i.length?"":i[n],s in r?r[s].push(e):r[s]=[e];for(const e in r)""!==e&&a(r,e,n+1)}function i(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},m.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const o=e.mappings.get(t);if(l(n))return o;if(o.hasOwnProperty(n))return o[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},m.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,m.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},8831:(e,t,n)=>{"use strict";const{parseLinkHeader:o,buildHeaders:r}=n(1055),{LINK_HEADER_CONTEXT:a}=n(3770),i=n(4093),s=n(533),{prependBase:l}=n(2278),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=r(t),(new s).wrapLoader((async function r(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new i('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new i('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let d;try{d=await function(e,t,n){const o=new(e=e||XMLHttpRequest);return new Promise(((e,r)=>{o.onload=()=>e(o),o.onerror=e=>r(e),o.open("GET",t,!0);for(const e in n)o.setRequestHeader(e,n[e]);o.send()}))}(n,s,t)}catch(e){throw new i("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(d.status>=400)throw new i("URL could not be dereferenced: "+d.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:d.status});let u={contextUrl:null,documentUrl:s,document:d.response},p=null;const h=d.getResponseHeader("Content-Type");let f;if(c.test(d.getAllResponseHeaders())&&(f=d.getResponseHeader("Link")),f&&"application/ld+json"!==h){const e=o(f),t=e[a];if(Array.isArray(t))throw new i("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(u.contextUrl=t.target),p=e.alternate,p&&"application/ld+json"==p.type&&!(h||"").match(/^application\/(\w*\+)?json$/)&&(u=await r(l(s,p.target)))}return u})))},1696:(e,t,n)=>{"use strict";const o=n(4093),{isArray:r}=n(832),{asArray:a}=n(1055),i={};function s({event:e,handlers:t}){let n=!0;for(let a=0;n&&a{n=!0}});else{if("object"!=typeof i)throw new o("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in i?i[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}e.exports=i,i.defaultEventHandler=null,i.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?i.safeEventHandler:[],e.eventHandler?a(e.eventHandler):[],i.defaultEventHandler?i.defaultEventHandler:[]);return 0===t.length?null:t},i.handleEvent=({event:e,options:t})=>{s({event:e,handlers:t.eventHandler})};const l=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);i.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&l.has(e.code))throw new o("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},i.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},i.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},i.unhandledEventHandler=function({event:e}){throw new o("No handler for event.","jsonld.UnhandledEvent",{event:e})},i.setDefaultEventHandler=function({eventHandler:e}={}){i.defaultEventHandler=e?a(e):null}},2759:(e,t,n)=>{"use strict";const o=n(4093),{isArray:r,isObject:a,isEmptyObject:i,isString:s,isUndefined:l}=n(832),{isList:c,isValue:d,isGraph:u,isSubject:p}=n(8463),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(4131),{isAbsolute:m}=n(2278),{REGEX_BCP47:x,REGEX_KEYWORD:b,addValue:w,asArray:j,getValues:I,validateTypeValue:N}=n(1055),{handleEvent:S}=n(1696),O={};function E({value:e,count:t,options:n}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(n.eventHandler){let o,r;0===t?(o="empty object",r="Dropping empty object."):"@value"in e?(o="object with only @value",r="Dropping object with only @value."):"@list"in e?(o="object with only @list",r="Dropping object with only @list."):1===t&&"@id"in e&&(o="object with only @id",r="Dropping object with only @id."),S({event:{type:["JsonLdEvent"],code:o,level:"warning",message:r,details:{value:e}},options:n})}return null}return e}async function D({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:u,expandedParent:b,options:I={},insideList:k,typeKey:R,typeScopedContext:T}){const A=Object.keys(u).sort(),_=[];let M;const J=u[R]&&"@json"===h(e,r(u[R])?u[R][0]:u[R],{vocab:!0},{...I,typeExpansion:!0});for(const D of A){let k,R=u[D];if("@context"===D)continue;const A=h(e,D,{vocab:!0},I);if(null===A||!m(A)&&!v(A)){I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:D,expandedProperty:A}},options:I});continue}if(v(A)){if("@reverse"===n)throw new o("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:R});if(A in b&&"@included"!==A&&"@type"!==A)throw new o("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:A})}if("@id"===A){if(!s(R)){if(!I.isFrame)throw new o('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:R});if(a(R)){if(!i(R))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:R})}else{if(!r(R))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:R});if(!R.every((e=>s(e))))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:R})}}w(b,"@id",j(R).map((t=>{if(s(t)){const n=h(e,t,{base:!0},I);return I.eventHandler&&(null===n?S(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:I}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:I}):m(n)||S({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:I})),n}return t})),{propertyIsArray:I.isFrame});continue}if("@type"===A){a(R)&&(R=Object.fromEntries(Object.entries(R).map((([e,t])=>[h(T,e,{vocab:!0}),j(t).map((e=>h(T,e,{base:!0,vocab:!0},{...I,typeExpansion:!0})))])))),N(R,I.isFrame),w(b,"@type",j(R).map((e=>{if(s(e)){const t=h(T,e,{base:!0,vocab:!0},{...I,typeExpansion:!0});return"@json"===t||m(t)||I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:I}),t}return e})),{propertyIsArray:!!I.isFrame});continue}if("@included"===A&&y(e,1.1)){const n=j(await O.expand({activeCtx:e,activeProperty:t,element:R,options:I}));if(!n.every((e=>p(e))))throw new o("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:R});w(b,"@included",n,{propertyIsArray:!0});continue}if("@graph"===A&&!a(R)&&!r(R))throw new o('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:R});if("@value"===A){M=R,J&&y(e,1.1)?b["@value"]=R:w(b,"@value",R,{propertyIsArray:I.isFrame});continue}if("@language"===A){if(null===R)continue;if(!s(R)&&!I.isFrame)throw new o('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:R});R=j(R).map((e=>s(e)?e.toLowerCase():e));for(const e of R)s(e)&&!e.match(x)&&I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:I});w(b,"@language",R,{propertyIsArray:I.isFrame});continue}if("@direction"===A){if(!s(R)&&!I.isFrame)throw new o('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:R});R=j(R);for(const e of R)if(s(e)&&"ltr"!==e&&"rtl"!==e)throw new o('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:R});w(b,"@direction",R,{propertyIsArray:I.isFrame});continue}if("@index"===A){if(!s(R))throw new o('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:R});w(b,"@index",R);continue}if("@reverse"===A){if(!a(R))throw new o('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:R});if(k=await O.expand({activeCtx:e,activeProperty:"@reverse",element:R,options:I}),"@reverse"in k)for(const e in k["@reverse"])w(b,e,k["@reverse"][e],{propertyIsArray:!0});let t=b["@reverse"]||null;for(const e in k){if("@reverse"===e)continue;null===t&&(t=b["@reverse"]={}),w(t,e,[],{propertyIsArray:!0});const n=k[e];for(let r=0;r"@id"===e||"@index"===e))){if(k=j(k),I.isFrame||(k=k.filter((e=>null!==E({value:e,count:Object.keys(e).length,options:I})))),0===k.length)continue;k=k.map((e=>({"@graph":j(e)})))}if(P.mappings.has(D)&&P.mappings.get(D).reverse){const e=b["@reverse"]=b["@reverse"]||{};k=j(k);for(let t=0;t"@value"===h(e,t,{vocab:!0},I))))throw new o("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:r});await D({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:b,options:I,insideList:k,typeScopedContext:T,typeKey:R})}}}function k({activeCtx:e,activeProperty:t,value:n,options:o}){if(null==n)return null;const r=h(e,t,{vocab:!0},o);if("@id"===r)return h(e,n,{base:!0},o);if("@type"===r)return h(e,n,{vocab:!0,base:!0},{...o,typeExpansion:!0});const a=f(e,t,"@type");if(("@id"===a||"@graph"===r)&&s(n)){const r=h(e,n,{base:!0},o);return null===r&&n.match(b)&&o.eventHandler&&S({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:o}),{"@id":r}}if("@vocab"===a&&s(n))return{"@id":h(e,n,{vocab:!0,base:!0},o)};if(v(r))return n;const i={};if(a&&!["@id","@vocab","@none"].includes(a))i["@type"]=a;else if(s(n)){const n=f(e,t,"@language");null!==n&&(i["@language"]=n);const o=f(e,t,"@direction");null!==o&&(i["@direction"]=o)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),i["@value"]=n,i}function C(e,t,n,a){const i=[],l=Object.keys(t).sort();for(const c of l){const l=h(e,c,{vocab:!0},a);let d=t[c];r(d)||(d=[d]);for(const e of d){if(null===e)continue;if(!s(e))throw new o("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const r={"@value":e};"@none"!==l&&(c.match(x)||a.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:a}),r["@language"]=c.toLowerCase()),n&&(r["@direction"]=n),i.push(r)}}return i}async function L({activeCtx:e,options:t,activeProperty:n,value:a,asGraph:i,indexKey:s,propertyIndex:c}){const p=[],v=Object.keys(a).sort(),y="@type"===s;for(let m of v){if(y){const n=f(e,m,"@context");l(n)||(e=await g({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let v,x=a[m];r(x)||(x=[x]),x=await O.expand({activeCtx:e,activeProperty:n,element:x,options:t,insideList:!1,insideIndex:!0}),v=c?"@none"===m?"@none":k({activeCtx:e,activeProperty:s,value:m,options:t}):h(e,m,{vocab:!0},t),"@id"===s?m=h(e,m,{base:!0},t):y&&(m=v);for(let e of x){if(i&&!u(e)&&(e={"@graph":[e]}),"@type"===s)"@none"===v||(e["@type"]?e["@type"]=[m].concat(e["@type"]):e["@type"]=[m]);else{if(d(e)&&!["@language","@type","@index"].includes(s))throw new o(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${s}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==v&&w(e,c,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||s in e||(e[s]=m)}p.push(e)}}return p}e.exports=O,O.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:d=!1,insideIndex:u=!1,typeScopedContext:p=null})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!r(n)&&!a(n))return d||null!==t&&"@graph"!==h(e,t,{vocab:!0},c)?k({activeCtx:e,activeProperty:t,value:n,options:c}):(c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:c}),null);if(r(n)){let o=[];const a=f(e,t,"@container")||[];d=d||a.includes("@list");for(let a=0;a1?o.slice().sort():o:[o];for(const t of r){const n=f(p,t,"@context");l(n)||(e=await g({activeCtx:e,localCtx:n,options:c,propagate:!1}))}}let C={};await D({activeCtx:e,activeProperty:t,expandedActiveProperty:v,element:n,expandedParent:C,options:c,insideList:d,typeKey:N,typeScopedContext:p}),b=Object.keys(C);let L=b.length;if("@value"in C){if("@type"in C&&("@language"in C||"@direction"in C))throw new o('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:C});let t=L-1;if("@type"in C&&(t-=1),"@index"in C&&(t-=1),"@language"in C&&(t-=1),"@direction"in C&&(t-=1),0!==t)throw new o('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:C});const n=null===C["@value"]?[]:j(C["@value"]),r=I(C,"@type");if(y(e,1.1)&&r.includes("@json")&&1===r.length);else if(0===n.length)c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:C}},options:c}),C=null;else{if(!n.every((e=>s(e)||i(e)))&&"@language"in C)throw new o("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:C});if(!r.every((e=>m(e)&&!(s(e)&&0===e.indexOf("_:"))||i(e))))throw new o('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:C})}}else if("@type"in C&&!r(C["@type"]))C["@type"]=[C["@type"]];else if("@set"in C||"@list"in C){if(L>1&&(2!==L||!("@index"in C)))throw new o('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:C});"@set"in C&&(C=C["@set"],b=Object.keys(C),L=b.length)}else 1===L&&"@language"in C&&(c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:C}},options:c}),C=null);return!a(C)||c.keepFreeFloatingNodes||d||null!==t&&"@graph"!==v&&!(f(e,t,"@container")||[]).includes("@graph")||(C=E({value:C,count:L,options:c})),C}},1565:(e,t,n)=>{"use strict";const{isSubjectReference:o}=n(8463),{createMergedNodeMap:r}=n(2664),a={};e.exports=a,a.flatten=e=>{const t=r(e),n=[],a=Object.keys(t).sort();for(let e=0;e{"use strict";const{isKeyword:o}=n(4131),r=n(8463),a=n(832),i=n(1055),s=n(2278),l=n(4093),{createNodeMap:c,mergeNodeMapGraphs:d}=n(2664),u={};function p(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function h(e,t,n){for(let o=n.length-1;o>=0;--o){const r=n[o];if(r.graph===t&&r.subject["@id"]===e["@id"])return!0}return!1}function f(e,t,n){const o="@"+n;let r=o in e?e[o][0]:t[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return r}function v(e){if(!a.isArray(e)||1!==e.length||!a.isObject(e[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of i.asArray(e[0]["@id"]))if(!a.isObject(t)&&!s.isAbsolute(t)||a.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of i.asArray(e[0]["@type"]))if(!a.isObject(t)&&!s.isAbsolute(t)&&"@json"!==t||a.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function g(e,t,n,s){let l=!0,c=!1;for(const d in n){let u=!1;const p=i.getValues(t,d),h=0===i.getValues(n,d).length;if("@id"===d){if(a.isEmptyObject(n["@id"][0]||{})?u=!0:n["@id"].length>=0&&(u=n["@id"].includes(p[0])),!s.requireAll)return u}else if("@type"===d){if(l=!1,h){if(p.length>0)return!1;u=!0}else if(1===n["@type"].length&&a.isEmptyObject(n["@type"][0]))u=p.length>0;else for(const e of n["@type"])u=!(!a.isObject(e)||!("@default"in e))||u||p.some((t=>t===e));if(!s.requireAll)return u}else{if(o(d))continue;{const t=i.getValues(n,d)[0];let o=!1;if(t&&(v([t]),o="@default"in t),l=!1,0===p.length&&o)continue;if(p.length>0&&h)return!1;if(void 0===t){if(p.length>0)return!1;u=!0}else if(r.isList(t)){const n=t["@list"][0];if(r.isList(p[0])){const t=p[0]["@list"];r.isValue(n)?u=t.some((e=>w(n,e))):(r.isSubject(n)||r.isSubjectReference(n))&&(u=t.some((t=>b(e,n,t,s))))}}else u=r.isValue(t)?p.some((e=>w(t,e))):r.isSubjectReference(t)?p.some((n=>b(e,t,n,s))):!!a.isObject(t)&&p.length>0}}if(!u&&s.requireAll)return!1;c=c||u}return l||c}function y(e,t){const n=e.uniqueEmbeds[e.graph],o=n[t],r=o.parent,s=o.property,l={"@id":t};if(a.isArray(r)){for(let e=0;e{const t=Object.keys(n);for(const o of t)o in n&&a.isObject(n[o].parent)&&n[o].parent["@id"]===e&&(delete n[o],c(o))};c(t)}function m(e,t){if(a.isArray(e))return e.map((e=>m(e,t)));if(a.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(r.isValue(e))return e;if(r.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=m(e[n],t)}return e}function x(e,t,n){a.isObject(e)?i.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function b(e,t,n,o){if(!("@id"in n))return!1;const r=e.subjects[n["@id"]];return r&&g(e,r,t,o)}function w(e,t){const n=t["@value"],o=t["@type"],r=t["@language"],i=e["@value"]?a.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?a.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?a.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===i.length&&0===s.length&&0===l.length||!(!i.includes(n)&&!a.isEmptyObject(i[0]))&&!!(!o&&0===s.length||s.includes(o)||o&&a.isEmptyObject(s[0]))&&!!(!r&&0===l.length||l.includes(r)||r&&a.isEmptyObject(l[0]))}e.exports=u,u.frameMergedOrDefault=(e,t,n)=>{const o={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new i.IdentifierIssuer("_:b");c(e,o.graphMap,"@default",r),n.merged&&(o.graphMap["@merged"]=d(o.graphMap),o.graph="@merged"),o.subjects=o.graphMap[o.graph];const a=[];return u.frame(o,Object.keys(o.subjects).sort(),t,a),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(o.bnodeMap).filter((e=>1===o.bnodeMap[e].length))),n.link={},m(a,n)},u.frame=(e,t,n,s,c=null)=>{v(n),n=n[0];const d=e.options,m={embed:f(n,d,"embed"),explicit:f(n,d,"explicit"),requireAll:f(n,d,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const b=e.link[e.graph],j=function(e,t,n,o){const r={};for(const a of t){const t=e.graphMap[e.graph][a];g(e,t,n,o)&&(r[a]=t)}return r}(e,t,n,m),I=Object.keys(j).sort();for(const v of I){const g=j[v];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&v in b){x(s,c,b[v]);continue}const I={"@id":v};if(0===v.indexOf("_:")&&i.addValue(e.bnodeMap,v,I,{propertyIsArray:!0}),b[v]=I,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(v))if(!e.embedded||"@never"!==m.embed&&!h(g,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(v)){if("@last"===m.embed&&v in e.uniqueEmbeds[e.graph]&&y(e,v),e.uniqueEmbeds[e.graph][v]={parent:s,property:c},e.subjectStack.push({subject:g,graph:e.graph}),v in e.graphMap){let t=!1,o=null;"@graph"in n?(o=n["@graph"][0],t=!("@merged"===v||"@default"===v),a.isObject(o)||(o={})):(t="@merged"!==e.graph,o={}),t&&u.frame({...e,graph:v,embedded:!1},Object.keys(e.graphMap[v]).sort(),[o],I,"@graph")}"@included"in n&&u.frame({...e,embedded:!1},t,n["@included"],I,"@included");for(const t of Object.keys(g).sort())if(o(t)){if(I[t]=i.clone(g[t]),"@type"===t)for(const t of g["@type"])0===t.indexOf("_:")&&i.addValue(e.bnodeMap,t,I,{propertyIsArray:!0})}else if(!m.explicit||t in n)for(const o of g[t]){const a=t in n?n[t]:p(m);if(r.isList(o)){const a=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:p(m),s={"@list":[]};x(I,t,s);const l=o["@list"];for(const t of l)r.isSubjectReference(t)?u.frame({...e,embedded:!0},[t["@id"]],a,s,"@list"):x(s,"@list",i.clone(t))}else r.isSubjectReference(o)?u.frame({...e,embedded:!0},[o["@id"]],a,I,t):w(a[0],o)&&x(I,t,i.clone(o))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!a.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(o(e))continue;const t=n[e][0]||{};if(!f(t,d,"omitDefault")&&!(e in I)){let n="@null";"@default"in t&&(n=i.clone(t["@default"])),a.isArray(n)||(n=[n]),I[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const o=n["@reverse"][t];for(const n of Object.keys(e.subjects))i.getValues(e.subjects[n],t).some((e=>e["@id"]===v))&&(I["@reverse"]=I["@reverse"]||{},i.addValue(I["@reverse"],t,[],{propertyIsArray:!0}),u.frame({...e,embedded:!0},[n],o,I["@reverse"][t],c))}x(s,c,I),e.subjectStack.pop()}else x(s,c,I);else x(s,c,I)}},u.cleanupNull=(e,t)=>{if(a.isArray(e))return e.map((e=>u.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(a.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=u.cleanupNull(e[n],t)}return e}},5076:(e,t,n)=>{"use strict";const o=n(4093),r=n(8463),a=n(832),{REGEX_BCP47:i,addValue:s}=n(1055),{handleEvent:l}=n(1696),{RDF_LIST:c,RDF_FIRST:d,RDF_REST:u,RDF_NIL:p,RDF_TYPE:h,RDF_JSON_LITERAL:f,XSD_BOOLEAN:v,XSD_DOUBLE:g,XSD_INTEGER:y,XSD_STRING:m}=n(3770),x={};function b(e,t,n,r){if(e.termType.endsWith("Node"))return{"@id":e.value};const s={"@value":e.value};if(e.language)e.language.match(i)||r.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:r}),s["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=m),c===f){c="@json";try{s["@value"]=JSON.parse(s["@value"])}catch(e){throw new o("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:s["@value"],cause:e})}}if(t){if(c===v)"true"===s["@value"]?s["@value"]=!0:"false"===s["@value"]&&(s["@value"]=!1);else if(a.isNumeric(s["@value"]))if(c===y){const e=parseInt(s["@value"],10);e.toFixed(0)===s["@value"]&&(s["@value"]=e)}else c===g&&(s["@value"]=parseFloat(s["@value"]));[v,y,g,m].includes(c)||(s["@type"]=c)}else if("i18n-datatype"===n&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(s["@language"]=e,e.match(i)||r.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r})),s["@direction"]=t}else c!==m&&(s["@type"]=c)}return s}e.exports=x,x.fromRDF=async(e,t)=>{const{useRdfType:n=!1,useNativeTypes:i=!1,rdfDirection:l=null}=t,f={},v={"@default":f},g={};if(l){if("compound-literal"===l)throw new o("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:l});if("i18n-datatype"!==l)throw new o("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:l})}for(const o of e){const e="DefaultGraph"===o.graph.termType?"@default":o.graph.value;e in v||(v[e]={}),"@default"===e||e in f||(f[e]={"@id":e});const r=v[e],a=o.subject.value,c=o.predicate.value,d=o.object;a in r||(r[a]={"@id":a});const u=r[a],y=d.termType.endsWith("Node");if(y&&!(d.value in r)&&(r[d.value]={"@id":d.value}),c===h&&!n&&y){s(u,"@type",d.value,{propertyIsArray:!0});continue}const m=b(d,i,l,t);if(s(u,c,m,{propertyIsArray:!0}),y)if(d.value===p){const e=r[d.value];"usages"in e||(e.usages=[]),e.usages.push({node:u,property:c,value:m})}else d.value in g?g[d.value]=!1:g[d.value]={node:u,property:c,value:m}}for(const e in v){const t=v[e];if(!(p in t))continue;const n=t[p];if(n.usages){for(let e of n.usages){let n=e.node,o=e.property,i=e.value;const s=[],l=[];let p=Object.keys(n).length;for(;o===u&&a.isObject(g[n["@id"]])&&a.isArray(n[d])&&1===n[d].length&&a.isArray(n[u])&&1===n[u].length&&(3===p||4===p&&a.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===c)&&(s.push(n[d][0]),l.push(n["@id"]),e=g[n["@id"]],n=e.node,o=e.property,i=e.value,p=Object.keys(n).length,r.isBlankNode(n)););delete i["@id"],i["@list"]=s.reverse();for(const e of l)delete t[e]}delete n.usages}}const y=[],m=Object.keys(f).sort();for(const e of m){const t=f[e];if(e in v){const n=t["@graph"]=[],o=v[e],a=Object.keys(o).sort();for(const e of a){const t=o[e];r.isSubjectReference(t)||n.push(t)}}r.isSubjectReference(t)||y.push(t)}return y}},8463:(e,t,n)=>{"use strict";const o=n(832),r={};e.exports=r,r.isSubject=e=>!(!o.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),r.isSubjectReference=e=>o.isObject(e)&&1===Object.keys(e).length&&"@id"in e,r.isValue=e=>o.isObject(e)&&"@value"in e,r.isList=e=>o.isObject(e)&&"@list"in e,r.isGraph=e=>o.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,r.isSimpleGraph=e=>r.isGraph(e)&&!("@id"in e),r.isBlankNode=e=>{if(o.isObject(e)){if("@id"in e){const t=e["@id"];return!o.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},6805:(e,t,n)=>{const o=n(7055),r=n(7222),a=n(1055),i=n(8058),s=a.IdentifierIssuer,l=n(4093),c=n(9593),d=n(9048),{expand:u}=n(2759),{flatten:p}=n(1565),{fromRDF:h}=n(5076),{toRDF:f}=n(9382),{frameMergedOrDefault:v,cleanupNull:g}=n(3859),{isArray:y,isObject:m,isString:x}=n(832),{isSubjectReference:b}=n(8463),{expandIri:w,getInitialContext:j,process:I,processingMode:N}=n(4131),{compact:S,compactIri:O}=n(3251),{createNodeMap:E,createMergedNodeMap:D,mergeNodeMaps:k}=n(2664),{logEventHandler:C,logWarningEventHandler:L,safeEventHandler:R,setDefaultEventHandler:T,setupEventHandler:A,strictEventHandler:_,unhandledEventHandler:M}=n(1696),J=function(e){const t={},J=new c({max:100});function P(t,{documentLoader:n=e.documentLoader,...o}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},o,t,{eventHandler:A({options:t})})}return e.compact=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let r;(o=P(o,{base:x(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new i({sharedCache:J})})).link&&(o.skipExpansion=!0),o.compactToRelative||delete o.base,r=o.skipExpansion?t:await e.expand(t,o);const c=await e.processContext(j(o),n,o);let d=await S({activeCtx:c,element:r,options:o});o.compactArrays&&!o.graph&&y(d)?1===d.length?d=d[0]:0===d.length&&(d={}):o.graph&&m(d)&&(d=[d]),m(n)&&"@context"in n&&(n=n["@context"]),n=a.clone(n),y(n)||(n=[n]);const u=n;n=[];for(let e=0;e0)&&n.push(u[e]);const p=n.length>0;if(1===n.length&&(n=n[0]),y(d)){const e=O({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=d;d={},p&&(d["@context"]=n),d[e]=t}else if(m(d)&&p){const e=d;d={"@context":n};for(const t in e)d[t]=e[t]}return d},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const o={},r=[];if("expandContext"in(n=P(n,{keepFreeFloatingNodes:!1,contextResolver:new i({sharedCache:J})}))){const e=a.clone(n.expandContext);m(e)&&"@context"in e?o.expandContext=e:o.expandContext={"@context":e},r.push(o.expandContext)}let s;if(x(t)){const a=await e.get(t,n);s=a.documentUrl,o.input=a.document,a.contextUrl&&(o.remoteContext={"@context":a.contextUrl},r.push(o.remoteContext))}else o.input=a.clone(t);"base"in n||(n.base=s||"");let l=j(n);for(const e of r)l=await I({activeCtx:l,localCtx:e,options:n});let c=await u({activeCtx:l,element:o.input,options:n});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c},e.flatten=async function(t,n,o){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,o=P(o,{base:x(t)?t:"",contextResolver:new i({sharedCache:J})});const r=await e.expand(t,o),a=p(r);return null===n?a:(o.graph=!0,o.skipExpansion=!0,await e.compact(a,n,o))},e.frame=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(o=P(o,{base:x(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new i({sharedCache:J})}),x(n)){const t=await e.get(n,o);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const r=n&&n["@context"]||{},a=await e.processContext(j(o),r,o);o.hasOwnProperty("omitGraph")||(o.omitGraph=N(a,1.1)),o.hasOwnProperty("pruneBlankNodeIdentifiers")||(o.pruneBlankNodeIdentifiers=N(a,1.1));const s=await e.expand(t,o),l={...o};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),d=Object.keys(n).map((e=>w(a,e,{vocab:!0})));l.merged=!d.includes("@graph"),l.is11=N(a,1.1);const u=v(s,c,l);l.graph=!o.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let p=await e.compact(u,r,l);return l.link={},p=g(p,l),p},e.link=async function(t,n,o){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",e.frame(t,r,o)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=P(n,{base:x(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new i({sharedCache:J})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=d.parse(t);return o.canonize(e,n)}const r={...n};delete r.format,r.produceGeneralizedRdf=!1;const a=await e.toRDF(t,r);return o.canonize(a,n)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=P(n,{format:x(e)?"application/n-quads":void 0});const{format:o}=n;let{rdfParser:r}=n;if(o){if(r=r||t[o],!r)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:o})}else r=()=>e;const a=await r(e);return h(a,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let o;o=(n=P(n,{base:x(t)?t:"",skipExpansion:!1,contextResolver:new i({sharedCache:J})})).skipExpansion?t:await e.expand(t,n);const r=f(o,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return d.serialize(r);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=P(n,{base:x(t)?t:"",contextResolver:new i({sharedCache:J})});const o=await e.expand(t,n);return D(o,n)},e.merge=async function(t,n,o){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,o=P(o,{contextResolver:new i({sharedCache:J})});const r=await Promise.all(t.map((t=>{const n={...o};return e.expand(t,n)})));let l=!0;"mergeNodes"in o&&(l=o.mergeNodes);const c=o.issuer||new s("_:b"),d={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let o;o="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const r=await o(t);try{if(!r.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");x(r.document)&&(r.document=JSON.parse(r.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:r})}return r},e.processContext=async function(e,t,n){return n=P(n,{base:"",contextResolver:new i({sharedCache:J})}),null===t?j(n):(t=a.clone(t),m(t)&&"@context"in t||(t={"@context":t}),I({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(4131).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",d.parse),e.registerRDFParser("application/nquads",d.parse),e.url=n(2278),e.logEventHandler=C,e.logWarningEventHandler=L,e.safeEventHandler=R,e.setDefaultEventHandler=T,e.strictEventHandler=_,e.unhandledEventHandler=M,e.util=a,Object.assign(e,a),e.promises=e,e.RequestQueue=n(533),e.JsonLdProcessor=n(731)(e),r.setupGlobals(e),r.setupDocumentLoaders(e),e},P=function(){return J((function(){return P()}))};J(P),e.exports=P},2664:(e,t,n)=>{"use strict";const{isKeyword:o}=n(4131),r=n(8463),a=n(832),i=n(1055),s=n(4093),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new i.IdentifierIssuer("_:b"),o={"@default":{}};return l.createNodeMap(e,o,"@default",n),l.mergeNodeMaps(o)},l.createNodeMap=(e,t,n,c,d,u)=>{if(a.isArray(e)){for(const o of e)l.createNodeMap(o,t,n,c,void 0,u);return}if(!a.isObject(e))return void(u&&u.push(e));if(r.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(u&&u.push(e))}if(u&&r.isList(e)){const o=[];return l.createNodeMap(e["@list"],t,n,c,d,o),void u.push({"@list":o})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}a.isUndefined(d)&&(d=r.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),u&&u.push({"@id":d});const p=t[n],h=p[d]=p[d]||{};h["@id"]=d;const f=Object.keys(e).sort();for(let a of f){if("@id"===a)continue;if("@reverse"===a){const o={"@id":d},a=e["@reverse"];for(const e in a){const s=a[e];for(const a of s){let s=a["@id"];r.isBlankNode(a)&&(s=c.getId(s)),l.createNodeMap(a,t,n,c,s),i.addValue(p[s],e,o,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===a){d in t||(t[d]={}),l.createNodeMap(e[a],t,d,c);continue}if("@included"===a){l.createNodeMap(e[a],t,n,c);continue}if("@type"!==a&&o(a)){if("@index"===a&&a in h&&(e[a]!==h[a]||e[a]["@id"]!==h[a]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:h});h[a]=e[a];continue}const u=e[a];if(0===a.indexOf("_:")&&(a=c.getId(a)),0!==u.length)for(let e of u)if("@type"===a&&(e=0===e.indexOf("_:")?c.getId(e):e),r.isSubject(e)||r.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const o=r.isBlankNode(e)?c.getId(e["@id"]):e["@id"];i.addValue(h,a,{"@id":o},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,o)}else if(r.isValue(e))i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(e)){const o=[];l.createNodeMap(e["@list"],t,n,c,d,o),e={"@list":o},i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,d),i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else i.addValue(h,a,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const r of Object.keys(e[n]).sort()){const a=e[n][r];r in t||(t[r]={"@id":r});const s=t[r];for(const e of Object.keys(a).sort())if(o(e)&&"@type"!==e)s[e]=i.clone(a[e]);else for(const t of a[e])i.addValue(s,e,i.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const o of n){if("@default"===o)continue;const n=e[o];let a=t[o];a?"@graph"in a||(a["@graph"]=[]):t[o]=a={"@id":o,"@graph":[]};const i=a["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];r.isSubjectReference(t)||i.push(t)}}return t}},7222:(e,t,n)=>{"use strict";const o=n(8831),r={};e.exports=r,r.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=o,e.useDocumentLoader("xhr"))},r.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},9382:(e,t,n)=>{"use strict";const{createNodeMap:o}=n(2664),{isKeyword:r}=n(4131),a=n(8463),i=n(5456),s=n(4093),l=n(832),c=n(1055),{handleEvent:d}=n(1696),{RDF_FIRST:u,RDF_REST:p,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:v,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:m,XSD_INTEGER:x,XSD_STRING:b}=n(3770),{isAbsolute:w}=n(2278),j={};function I(e,t,n,o,a){const i=Object.keys(t).sort();for(const s of i){const i=t[s],l=Object.keys(i).sort();for(let t of l){const l=i[t];if("@type"===t)t=f;else if(r(t))continue;for(const r of l){const i={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!w(s)){a.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:s}},options:a});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){a.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:a});continue}if("BlankNode"===l.termType&&!a.produceGeneralizedRdf){a.eventHandler&&d({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:o.getOldIds().find((e=>o.getId(e)===t))}},options:a});continue}const c=N(r,o,e,n,a.rdfDirection,a);c&&e.push({subject:i,predicate:l,object:c,graph:n})}}}}function N(e,t,n,o,r,c){const f={};if(a.isValue(e)){f.termType="Literal",f.value=void 0,f.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)f.value=i(t),f.datatype.value=v;else if(l.isBoolean(t))f.value=t.toString(),f.datatype.value=n||y;else if(l.isDouble(t)||n===m)l.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=n||m;else if(l.isNumber(t))f.value=t.toFixed(0),f.datatype.value=n||x;else if("@direction"in e&&"i18n-datatype"===r){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;f.datatype.value=n,f.value=t}else{if("@direction"in e&&"compound-literal"===r)throw new s("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:r});if("@direction"in e&&r)throw new s("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:r});"@language"in e?("@direction"in e&&!r&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||g,f.language=e["@language"]):("@direction"in e&&!r&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||b)}}else if(a.isList(e)){const a=function(e,t,n,o,r,a){const i={termType:"NamedNode",value:u},s={termType:"NamedNode",value:p},l={termType:"NamedNode",value:h},c=e.pop(),d=c?{termType:"BlankNode",value:t.getId()}:l;let f=d;for(const l of e){const e=N(l,t,n,o,r,a),c={termType:"BlankNode",value:t.getId()};n.push({subject:f,predicate:i,object:e,graph:o}),n.push({subject:f,predicate:s,object:c,graph:o}),f=c}if(c){const e=N(c,t,n,o,r,a);n.push({subject:f,predicate:i,object:e,graph:o}),n.push({subject:f,predicate:s,object:l,graph:o})}return d}(e["@list"],t,n,o,r,c);f.termType=a.termType,f.value=a.value}else{const t=l.isObject(e)?e["@id"]:e;f.termType=t.startsWith("_:")?"BlankNode":"NamedNode",f.value=t}return"NamedNode"!==f.termType||w(f.value)?f:(c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:c}),null)}e.exports=j,j.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),r={"@default":{}};o(e,r,"@default",n);const a=[],i=Object.keys(r).sort();for(const e of i){let o;if("@default"===e)o={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}o=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},o.value=e}I(a,r[e],o,n,t)}return a}},832:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},2278:(e,t,n)=>{"use strict";const o=n(832),r={};e.exports=r,r.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(e,t)=>{const n={},o=r.parsers[t||"full"],a=o.regex.exec(e);let i=o.keys.length;for(;i--;)n[o.keys[i]]=void 0===a[i]?null:a[i];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(e,t)=>{if(null===e)return t;if(r.isAbsolute(t))return t;e&&!o.isString(e)||(e=r.parse(e||""));const n=r.parse(t),a={protocol:e.protocol||""};if(null!==n.authority)a.authority=n.authority,a.path=n.path,a.query=n.query;else if(a.authority=e.authority,""===n.path)a.path=e.path,null!==n.query?a.query=n.query:a.query=e.query;else{if(0===n.path.indexOf("/"))a.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,a.path=t}a.query=n.query}""!==n.path&&(a.path=r.removeDotSegments(a.path));let i=a.protocol;return null!==a.authority&&(i+="//"+a.authority),i+=a.path,null!==a.query&&(i+="?"+a.query),null!==n.fragment&&(i+="#"+n.fragment),""===i&&(i="./"),i},r.removeBase=(e,t)=>{if(null===e)return t;e&&!o.isString(e)||(e=r.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const a=r.parse(t.substr(n.length)),i=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),l=a.fragment||a.query?0:1;for(;i.length>0&&s.length>l&&i[0]===s[0];)i.shift(),s.shift();let c="";if(i.length>0){i.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),o=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),o&&n.push("")):o&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=e=>o.isString(e)&&a.test(e),r.isRelative=e=>o.isString(e)},1055:(e,t,n)=>{"use strict";const o=n(8463),r=n(832),a=n(7055).IdentifierIssuer,i=n(4093),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,d="application/ld+json, application/json",u={};function p(e,t){if(r.isArray(t))for(let n=0;n{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+d+'" is supported.');return Object.assign({Accept:d},e)},u.parseLinkHeader=e=>{const t={},n=e.match(s);for(let e=0;e{if(!(r.isString(e)||r.isArray(e)&&e.every((e=>r.isString(e))))){if(t&&r.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&u.asArray(e["@default"]).every((e=>r.isString(e))))return}throw new i('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},u.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!r.isArray(n)||n.length>0}return!1},u.hasValue=(e,t,n)=>{if(u.hasProperty(e,t)){let a=e[t];const i=o.isList(a);if(r.isArray(a)||i){i&&(a=a["@list"]);for(let e=0;e{if("propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1),"valueIsArray"in o||(o.valueIsArray=!1),"allowDuplicate"in o||(o.allowDuplicate=!0),"prependValue"in o||(o.prependValue=!1),o.valueIsArray)e[t]=n;else if(r.isArray(n)){0===n.length&&o.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),o.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let r=0;r[].concat(e[t]||[]),u.removeProperty=(e,t)=>{delete e[t]},u.removeValue=(e,t,n,o)=>{"propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1);const r=u.getValues(e,t).filter((e=>!u.compareValues(e,n)));0===r.length?u.removeProperty(e,t):1!==r.length||o.propertyIsArray?e[t]=r:e[t]=r[0]},u.relabelBlankNodes=(e,t)=>p((t=t||{}).issuer||new a("_:b"),e),u.compareValues=(e,t)=>e===t||!(!o.isValue(e)||!o.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(r.isObject(e)&&"@id"in e&&r.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],u.compareShortestLeast=(e,t)=>e.length{"use strict";const o=n(4411),r=Symbol("max"),a=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),d=Symbol("noDisposeOnSet"),u=Symbol("lruList"),p=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1,v=(e,t,n)=>{const o=e[p].get(t);if(o){const t=o.value;if(g(e,t)){if(m(e,o),!e[s])return}else n&&(e[h]&&(o.value.now=Date.now()),e[u].unshiftNode(o));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[a]>e[r])for(let t=e[u].tail;e[a]>e[r]&&null!==t;){const n=t.prev;m(e,t),t=n}},m=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[a]-=n.length,e[p].delete(n.key),e[u].removeNode(t)}};class x{constructor(e,t,n,o,r){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=r||0}}const b=(e,t,n,o)=>{let r=n.value;g(e,r)&&(m(e,n),e[s]||(r=void 0)),r&&t.call(o,r.value,r.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[r]=e.max||1/0;const t=e.length||f;if(this[i]="function"!=typeof t?f:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[d]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[r]=e||1/0,y(this)}get max(){return this[r]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[i]&&(this[i]=e,this[a]=0,this[u].forEach((e=>{e.length=this[i](e.value,e.key),this[a]+=e.length}))),y(this)}get lengthCalculator(){return this[i]}get length(){return this[a]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let n=this[u].tail;null!==n;){const o=n.prev;b(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[u].head;null!==n;){const o=n.next;b(this,e,n,t),n=o}}keys(){return this[u].toArray().map((e=>e.key))}values(){return this[u].toArray().map((e=>e.value))}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach((e=>this[c](e.key,e.value))),this[p]=new Map,this[u]=new o,this[a]=0}dump(){return this[u].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[u]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,s=this[i](t,e);if(this[p].has(e)){if(s>this[r])return m(this,this[p].get(e)),!1;const i=this[p].get(e).value;return this[c]&&(this[d]||this[c](e,i.value)),i.now=o,i.maxAge=n,i.value=t,this[a]+=s-i.length,i.length=s,this.get(e),y(this),!0}const h=new x(e,t,s,o,n);return h.length>this[r]?(this[c]&&this[c](e,t),!1):(this[a]+=h.length,this[u].unshift(h),this[p].set(e,this[u].head),y(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!g(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[u].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],r=o.e||0;if(0===r)this.set(o.k,o.v);else{const e=r-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[p].forEach(((e,t)=>v(this,t,!1)))}}},7055:(e,t,n)=>{e.exports=n(9344)},2401:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:o}=this;return new e(t,new Map(n),o)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},5947:(e,t,n)=>{"use strict";n(4889);const o=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!o||!o.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await o.subtle.digest(this.algorithm,e));let n="";for(let e=0;e{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",o="NamedNode",r="BlankNode",a="Literal",i="DefaultGraph",s={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",n=t+"0-9-·̀-ͯ‿-⁀",o="(_:(?:["+t+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",r="[ \\t]+",a="[ \\t]*",i="(?:"+e+"|"+o+")"+r,l=e+r,c="(?:"+e+"|"+o+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+a,d="(?:\\.|(?:(?:"+e+"|"+o+")"+a+"\\.))";s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=new RegExp("^"+a+"$"),s.quad=new RegExp("^"+a+i+l+c+d+a+"$")})(),e.exports=class e{static parse(e){const l=[],d={},u=e.split(s.eoln);let p=0;for(const e of u){if(p++,s.empty.test(e))continue;const u=e.match(s.quad);if(null===u)throw new Error("N-Quads parse error on line "+p+".");const v={subject:null,predicate:null,object:null,graph:null};if(void 0!==u[1]?v.subject={termType:o,value:u[1]}:v.subject={termType:r,value:u[2]},v.predicate={termType:o,value:u[3]},void 0!==u[4]?v.object={termType:o,value:u[4]}:void 0!==u[5]?v.object={termType:r,value:u[5]}:(v.object={termType:a,value:void 0,datatype:{termType:o}},void 0!==u[7]?v.object.datatype.value=u[7]:void 0!==u[8]?(v.object.datatype.value=t,v.object.language=u[8]):v.object.datatype.value=n,v.object.value=u[6].replace(c,(function(e,t,n,o){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(o)throw new Error("Unsupported U escape")}))),void 0!==u[9]?v.graph={termType:o,value:u[9]}:void 0!==u[10]?v.graph={termType:r,value:u[10]}:v.graph={termType:i,value:""},v.graph.value in d){let e=!0;const t=d[v.graph.value];for(const n of t)if(f=v,(h=n).subject.termType===f.subject.termType&&h.object.termType===f.object.termType&&h.subject.value===f.subject.value&&h.predicate.value===f.predicate.value&&h.object.value===f.object.value&&(h.object.termType!==a||h.object.datatype.termType===f.object.datatype.termType&&h.object.language===f.object.language&&h.object.datatype.value===f.object.datatype.value)){e=!1;break}e&&(t.push(v),l.push(v))}else d[v.graph.value]=[v],l.push(v)}var h,f;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const o of t)n.push(e.serializeQuad(o));return n.sort().join("")}static serializeQuadComponents(e,a,i,s){let c="";return e.termType===o?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${a.value}> `,i.termType===o?c+=`<${i.value}>`:i.termType===r?c+=i.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(i.value)}"`,i.datatype.value===t?i.language&&(c+=`@${i.language}`):i.datatype.value!==n&&(c+=`^^<${i.datatype.value}>`)),s.termType===o?c+=` <${s.value}>`:s.termType===r&&(c+=` ${s.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const s=[],l={"blank node":r,IRI:o,literal:a};for(const c in e)e[c].forEach((e=>{const d={};for(const r in e){const i=e[r],s={termType:l[i.type],value:i.value};s.termType===a&&(s.datatype={termType:o},"datatype"in i&&(s.datatype.value=i.datatype),"language"in i?("datatype"in i||(s.datatype.value=t),s.language=i.language):"datatype"in i||(s.datatype.value=n)),d[r]=s}d.graph="@default"===c?{termType:i,value:""}:{termType:c.startsWith("_:")?r:o,value:c},s.push(d)}));return s}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},8326:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;to)&&(s&&n>0&&i>e[n-1]||!s&&ne[n+1])&&(o=i,r=n)}if(null===o)this.done=!0;else{const n=t.get(o)?r-1:r+1;e[r]=e[n],e[n]=o;for(const n of e)n>o&&t.set(n,!t.get(n))}return n}}},3445:(e,t,n)=>{"use strict";const o=n(2401),r=n(5947),a=n(8326),i=n(9980);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new r("sha256")),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let r=0;for(const e of n)++r%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const a=[...t.keys()].sort(),l=[];for(const e of a){const n=t.get(e);if(n.length>1){l.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of l){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("_:b");e.getId(n);const r=await this.hashNDegreeQuads(n,e);t.push(r)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=i.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(i.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=await r.digest(),n.hash}async hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(o),"g"!==o&&a.update(this.getRelatedPredicate(t)),a.update(r),a.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),r=await this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const s=new a(r.get(e));let l=0;for(;s.hasNext();){const e=s.next();++l%3==0&&await this._yield();let o=t.clone(),r="";const a=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||a.push(t),r+=o.getId(t)),0!==i.length&&r>i){c=!0;break}if(!c){for(const e of a){const t=await this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){c=!0;break}}c||(0===i.length||r`}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let r=0;for(const a of o)++r%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:r,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=await this.hashRelatedBlankNode(i,e,r,n),l=a.get(s);l?l.push(i):a.set(s,[i])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},5643:(e,t,n)=>{"use strict";const o=n(2401),r=n(5947),a=n(8326),i=n(9980);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new r("sha256")),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const r=[...t.keys()].sort(),a=[];for(const e of r){const n=t.get(e);if(n.length>1){a.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of a){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("_:b");e.getId(n);const r=this.hashNDegreeQuads(n,e);t.push(r)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=i.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(i.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=r.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(o),"g"!==o&&a.update(this.getRelatedPredicate(t)),a.update(r),a.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),r=this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const s=new a(r.get(e));for(;s.hasNext();){const e=s.next();let o=t.clone(),r="";const a=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||a.push(t),r+=o.getId(t)),0!==i.length&&r>i){l=!0;break}if(!l){for(const e of a){const t=this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){l=!0;break}}l||(0===i.length||r`}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const r of o)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:r,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=this.hashRelatedBlankNode(i,e,r,n),l=a.get(s);l?l.push(i):a.set(s,[i])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},9201:(e,t,n)=>{"use strict";const o=n(5947),r=n(3445);e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new o("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let r=0;for(const a of o){let o,i;if("BlankNode"===a.subject.termType&&a.subject.value!==e)i=a.subject.value,o="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;i=a.object.value,o="r"}++r%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(i,a,t,o),l=n.get(s);l?l.push(i):n.set(s,[i])}return n}}},7702:(e,t,n)=>{"use strict";const o=n(5947),r=n(5643);e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new o("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const r of o){let o,a;if("BlankNode"===r.subject.termType&&r.subject.value!==e)a=r.subject.value,o="p";else{if("BlankNode"!==r.object.termType||r.object.value===e)continue;a=r.object.value,o="r"}const i=this.hashRelatedBlankNode(a,r,t,o),s=n.get(i);s?s.push(a):n.set(i,[a])}return n}}},9344:(e,t,n)=>{"use strict";const o=n(3445),r=n(9201),a=n(5643),i=n(7702);let s;try{s=n(3421)}catch(e){}function l(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=n(9980),t.IdentifierIssuer=n(2401),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,t){const n=l(e);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,o)=>s.canonize(n,t,((t,n)=>t?o(t):e(n)))))}if("URDNA2015"===t.algorithm)return new o(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new r(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},t._canonizeSync=function(e,t){const n=l(e);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new a(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},4889:function(e,t,n){!function(e,t){"use strict";if(!e.setImmediate){var n,o,r,a,i,s=1,l={},c=!1,d=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){r.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(h,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),o=0;o{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},4411:(e,t,n)=>{"use strict";function o(e){var t=this;if(t instanceof o||(t=new o),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");o=this.head.next,n=this.head.value}for(var r=0;null!==o;r++)n=e(n,o.value,r),o=o.next;return n},o.prototype.reduceReverse=function(e,t){var n,o=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");o=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==o;r--)n=e(n,o.value,r),o=o.prev;return n},o.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},o.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},o.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(tthis.length&&(t=this.length);for(var r=0,a=this.head;null!==a&&rthis.length&&(t=this.length);for(var r=this.length,a=this.tail;null!==a&&r>t;r--)a=a.prev;for(;null!==a&&r>e;r--,a=a.prev)n.push(a.value);return n},o.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,a=this.head;null!==a&&o {\n const comma = ci === 0 ? '' : ',';\n const value = cv === undefined || typeof cv === 'symbol' ? null : cv;\n return t + comma + serialize(value);\n }, '') + ']';\n }\n\n return '{' + Object.keys(object).sort().reduce((t, cv, ci) => {\n if (object[cv] === undefined ||\n typeof object[cv] === 'symbol') {\n return t;\n }\n const comma = t.length === 0 ? '' : ',';\n return t + comma + serialize(cv) + ':' + serialize(object[cv]);\n }, '') + '}';\n};\n","/*\n * Copyright (c) 2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString,\n} = require('./types');\nconst {\n asArray: _asArray\n} = require('./util');\nconst {prependBase} = require('./url');\nconst JsonLdError = require('./JsonLdError');\nconst ResolvedContext = require('./ResolvedContext');\n\nconst MAX_CONTEXT_URLS = 10;\n\nmodule.exports = class ContextResolver {\n /**\n * Creates a ContextResolver.\n *\n * @param sharedCache a shared LRU cache with `get` and `set` APIs.\n */\n constructor({sharedCache}) {\n this.perOpCache = new Map();\n this.sharedCache = sharedCache;\n }\n\n async resolve({\n activeCtx, context, documentLoader, base, cycles = new Set()\n }) {\n // process `@context`\n if(context && _isObject(context) && context['@context']) {\n context = context['@context'];\n }\n\n // context is one or more contexts\n context = _asArray(context);\n\n // resolve each context in the array\n const allResolved = [];\n for(const ctx of context) {\n if(_isString(ctx)) {\n // see if `ctx` has been resolved before...\n let resolved = this._get(ctx);\n if(!resolved) {\n // not resolved yet, resolve\n resolved = await this._resolveRemoteContext(\n {activeCtx, url: ctx, documentLoader, base, cycles});\n }\n\n // add to output and continue\n if(_isArray(resolved)) {\n allResolved.push(...resolved);\n } else {\n allResolved.push(resolved);\n }\n continue;\n }\n if(ctx === null) {\n // handle `null` context, nothing to cache\n allResolved.push(new ResolvedContext({document: null}));\n continue;\n }\n if(!_isObject(ctx)) {\n _throwInvalidLocalContext(context);\n }\n // context is an object, get/create `ResolvedContext` for it\n const key = JSON.stringify(ctx);\n let resolved = this._get(key);\n if(!resolved) {\n // create a new static `ResolvedContext` and cache it\n resolved = new ResolvedContext({document: ctx});\n this._cacheResolvedContext({key, resolved, tag: 'static'});\n }\n allResolved.push(resolved);\n }\n\n return allResolved;\n }\n\n _get(key) {\n // get key from per operation cache; no `tag` is used with this cache so\n // any retrieved context will always be the same during a single operation\n let resolved = this.perOpCache.get(key);\n if(!resolved) {\n // see if the shared cache has a `static` entry for this URL\n const tagMap = this.sharedCache.get(key);\n if(tagMap) {\n resolved = tagMap.get('static');\n if(resolved) {\n this.perOpCache.set(key, resolved);\n }\n }\n }\n return resolved;\n }\n\n _cacheResolvedContext({key, resolved, tag}) {\n this.perOpCache.set(key, resolved);\n if(tag !== undefined) {\n let tagMap = this.sharedCache.get(key);\n if(!tagMap) {\n tagMap = new Map();\n this.sharedCache.set(key, tagMap);\n }\n tagMap.set(tag, resolved);\n }\n return resolved;\n }\n\n async _resolveRemoteContext({activeCtx, url, documentLoader, base, cycles}) {\n // resolve relative URL and fetch context\n url = prependBase(base, url);\n const {context, remoteDoc} = await this._fetchContext(\n {activeCtx, url, documentLoader, cycles});\n\n // update base according to remote document and resolve any relative URLs\n base = remoteDoc.documentUrl || url;\n _resolveContextUrls({context, base});\n\n // resolve, cache, and return context\n const resolved = await this.resolve(\n {activeCtx, context, documentLoader, base, cycles});\n this._cacheResolvedContext({key: url, resolved, tag: remoteDoc.tag});\n return resolved;\n }\n\n async _fetchContext({activeCtx, url, documentLoader, cycles}) {\n // check for max context URLs fetched during a resolve operation\n if(cycles.size > MAX_CONTEXT_URLS) {\n throw new JsonLdError(\n 'Maximum number of @context URLs exceeded.',\n 'jsonld.ContextUrlError',\n {\n code: activeCtx.processingMode === 'json-ld-1.0' ?\n 'loading remote context failed' :\n 'context overflow',\n max: MAX_CONTEXT_URLS\n });\n }\n\n // check for context URL cycle\n // shortcut to avoid extra work that would eventually hit the max above\n if(cycles.has(url)) {\n throw new JsonLdError(\n 'Cyclical @context URLs detected.',\n 'jsonld.ContextUrlError',\n {\n code: activeCtx.processingMode === 'json-ld-1.0' ?\n 'recursive context inclusion' :\n 'context overflow',\n url\n });\n }\n\n // track cycles\n cycles.add(url);\n\n let context;\n let remoteDoc;\n\n try {\n remoteDoc = await documentLoader(url);\n context = remoteDoc.document || null;\n // parse string context as JSON\n if(_isString(context)) {\n context = JSON.parse(context);\n }\n } catch(e) {\n throw new JsonLdError(\n 'Dereferencing a URL did not result in a valid JSON-LD object. ' +\n 'Possible causes are an inaccessible URL perhaps due to ' +\n 'a same-origin policy (ensure the server uses CORS if you are ' +\n 'using client-side JavaScript), too many redirects, a ' +\n 'non-JSON response, or more than one HTTP Link Header was ' +\n 'provided for a remote context.',\n 'jsonld.InvalidUrl',\n {code: 'loading remote context failed', url, cause: e});\n }\n\n // ensure ctx is an object\n if(!_isObject(context)) {\n throw new JsonLdError(\n 'Dereferencing a URL did not result in a JSON object. The ' +\n 'response was valid JSON, but it was not a JSON object.',\n 'jsonld.InvalidUrl', {code: 'invalid remote context', url});\n }\n\n // use empty context if no @context key is present\n if(!('@context' in context)) {\n context = {'@context': {}};\n } else {\n context = {'@context': context['@context']};\n }\n\n // append @context URL to context if given\n if(remoteDoc.contextUrl) {\n if(!_isArray(context['@context'])) {\n context['@context'] = [context['@context']];\n }\n context['@context'].push(remoteDoc.contextUrl);\n }\n\n return {context, remoteDoc};\n }\n};\n\nfunction _throwInvalidLocalContext(ctx) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context must be an object.',\n 'jsonld.SyntaxError', {\n code: 'invalid local context', context: ctx\n });\n}\n\n/**\n * Resolve all relative `@context` URLs in the given context by inline\n * replacing them with absolute URLs.\n *\n * @param context the context.\n * @param base the base IRI to use to resolve relative IRIs.\n */\nfunction _resolveContextUrls({context, base}) {\n if(!context) {\n return;\n }\n\n const ctx = context['@context'];\n\n if(_isString(ctx)) {\n context['@context'] = prependBase(base, ctx);\n return;\n }\n\n if(_isArray(ctx)) {\n for(let i = 0; i < ctx.length; ++i) {\n const element = ctx[i];\n if(_isString(element)) {\n ctx[i] = prependBase(base, element);\n continue;\n }\n if(_isObject(element)) {\n _resolveContextUrls({context: {'@context': element}, base});\n }\n }\n return;\n }\n\n if(!_isObject(ctx)) {\n // no @context URLs can be found in non-object\n return;\n }\n\n // ctx is an object, resolve any context URLs in terms\n for(const term in ctx) {\n _resolveContextUrls({context: ctx[term], base});\n }\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class JsonLdError extends Error {\n /**\n * Creates a JSON-LD Error.\n *\n * @param msg the error message.\n * @param type the error type.\n * @param details the error details.\n */\n constructor(\n message = 'An unspecified JSON-LD error occurred.',\n name = 'jsonld.Error',\n details = {}) {\n super(message);\n this.name = name;\n this.message = message;\n this.details = details;\n }\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = jsonld => {\n class JsonLdProcessor {\n toString() {\n return '[object JsonLdProcessor]';\n }\n }\n Object.defineProperty(JsonLdProcessor, 'prototype', {\n writable: false,\n enumerable: false\n });\n Object.defineProperty(JsonLdProcessor.prototype, 'constructor', {\n writable: true,\n enumerable: false,\n configurable: true,\n value: JsonLdProcessor\n });\n\n // The Web IDL test harness will check the number of parameters defined in\n // the functions below. The number of parameters must exactly match the\n // required (non-optional) parameters of the JsonLdProcessor interface as\n // defined here:\n // https://www.w3.org/TR/json-ld-api/#the-jsonldprocessor-interface\n\n JsonLdProcessor.compact = function(input, ctx) {\n if(arguments.length < 2) {\n return Promise.reject(\n new TypeError('Could not compact, too few arguments.'));\n }\n return jsonld.compact(input, ctx);\n };\n JsonLdProcessor.expand = function(input) {\n if(arguments.length < 1) {\n return Promise.reject(\n new TypeError('Could not expand, too few arguments.'));\n }\n return jsonld.expand(input);\n };\n JsonLdProcessor.flatten = function(input) {\n if(arguments.length < 1) {\n return Promise.reject(\n new TypeError('Could not flatten, too few arguments.'));\n }\n return jsonld.flatten(input);\n };\n\n return JsonLdProcessor;\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\n// TODO: move `NQuads` to its own package\nmodule.exports = require('rdf-canonize').NQuads;\n","/*\n * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class RequestQueue {\n /**\n * Creates a simple queue for requesting documents.\n */\n constructor() {\n this._requests = {};\n }\n\n wrapLoader(loader) {\n const self = this;\n self._loader = loader;\n return function(/* url */) {\n return self.add.apply(self, arguments);\n };\n }\n\n async add(url) {\n let promise = this._requests[url];\n if(promise) {\n // URL already queued, wait for it to load\n return Promise.resolve(promise);\n }\n\n // queue URL and load it\n promise = this._requests[url] = this._loader(url);\n\n try {\n return await promise;\n } finally {\n delete this._requests[url];\n }\n }\n};\n","/*\n * Copyright (c) 2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst LRU = require('lru-cache');\n\nconst MAX_ACTIVE_CONTEXTS = 10;\n\nmodule.exports = class ResolvedContext {\n /**\n * Creates a ResolvedContext.\n *\n * @param document the context document.\n */\n constructor({document}) {\n this.document = document;\n // TODO: enable customization of processed context cache\n // TODO: limit based on size of processed contexts vs. number of them\n this.cache = new LRU({max: MAX_ACTIVE_CONTEXTS});\n }\n\n getProcessed(activeCtx) {\n return this.cache.get(activeCtx);\n }\n\n setProcessed(activeCtx, processedCtx) {\n this.cache.set(activeCtx, processedCtx);\n }\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString,\n isUndefined: _isUndefined\n} = require('./types');\n\nconst {\n isList: _isList,\n isValue: _isValue,\n isGraph: _isGraph,\n isSimpleGraph: _isSimpleGraph,\n isSubjectReference: _isSubjectReference\n} = require('./graphTypes');\n\nconst {\n expandIri: _expandIri,\n getContextValue: _getContextValue,\n isKeyword: _isKeyword,\n process: _processContext,\n processingMode: _processingMode\n} = require('./context');\n\nconst {\n removeBase: _removeBase,\n prependBase: _prependBase\n} = require('./url');\n\nconst {\n REGEX_KEYWORD,\n addValue: _addValue,\n asArray: _asArray,\n compareShortestLeast: _compareShortestLeast\n} = require('./util');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Recursively compacts an element using the given active context. All values\n * must be in expanded form before this method is called.\n *\n * @param activeCtx the active context to use.\n * @param activeProperty the compacted property associated with the element\n * to compact, null for none.\n * @param element the element to compact.\n * @param options the compaction options.\n *\n * @return a promise that resolves to the compacted value.\n */\napi.compact = async ({\n activeCtx,\n activeProperty = null,\n element,\n options = {}\n}) => {\n // recursively compact array\n if(_isArray(element)) {\n let rval = [];\n for(let i = 0; i < element.length; ++i) {\n const compacted = await api.compact({\n activeCtx,\n activeProperty,\n element: element[i],\n options\n });\n if(compacted === null) {\n // FIXME: need event?\n continue;\n }\n rval.push(compacted);\n }\n if(options.compactArrays && rval.length === 1) {\n // use single element if no container is specified\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n if(container.length === 0) {\n rval = rval[0];\n }\n }\n return rval;\n }\n\n // use any scoped context on activeProperty\n const ctx = _getContextValue(activeCtx, activeProperty, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n // recursively compact object\n if(_isObject(element)) {\n if(options.link && '@id' in element &&\n options.link.hasOwnProperty(element['@id'])) {\n // check for a linked element to reuse\n const linked = options.link[element['@id']];\n for(let i = 0; i < linked.length; ++i) {\n if(linked[i].expanded === element) {\n return linked[i].compacted;\n }\n }\n }\n\n // do value compaction on @values and subject references\n if(_isValue(element) || _isSubjectReference(element)) {\n const rval =\n api.compactValue({activeCtx, activeProperty, value: element, options});\n if(options.link && _isSubjectReference(element)) {\n // store linked element\n if(!(options.link.hasOwnProperty(element['@id']))) {\n options.link[element['@id']] = [];\n }\n options.link[element['@id']].push({expanded: element, compacted: rval});\n }\n return rval;\n }\n\n // if expanded property is @list and we're contained within a list\n // container, recursively compact this item to an array\n if(_isList(element)) {\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n if(container.includes('@list')) {\n return api.compact({\n activeCtx,\n activeProperty,\n element: element['@list'],\n options\n });\n }\n }\n\n // FIXME: avoid misuse of active property as an expanded property?\n const insideReverse = (activeProperty === '@reverse');\n\n const rval = {};\n\n // original context before applying property-scoped and local contexts\n const inputCtx = activeCtx;\n\n // revert to previous context, if there is one,\n // and element is not a value object or a node reference\n if(!_isValue(element) && !_isSubjectReference(element)) {\n activeCtx = activeCtx.revertToPreviousContext();\n }\n\n // apply property-scoped context after reverting term-scoped context\n const propertyScopedCtx =\n _getContextValue(inputCtx, activeProperty, '@context');\n if(!_isUndefined(propertyScopedCtx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: propertyScopedCtx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n if(options.link && '@id' in element) {\n // store linked element\n if(!options.link.hasOwnProperty(element['@id'])) {\n options.link[element['@id']] = [];\n }\n options.link[element['@id']].push({expanded: element, compacted: rval});\n }\n\n // apply any context defined on an alias of @type\n // if key is @type and any compacted value is a term having a local\n // context, overlay that context\n let types = element['@type'] || [];\n if(types.length > 1) {\n types = Array.from(types).sort();\n }\n // find all type-scoped contexts based on current context, prior to\n // updating it\n const typeContext = activeCtx;\n for(const type of types) {\n const compactedType = api.compactIri(\n {activeCtx: typeContext, iri: type, relativeTo: {vocab: true}});\n\n // Use any type-scoped context defined on this value\n const ctx = _getContextValue(inputCtx, compactedType, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n options,\n propagate: false\n });\n }\n }\n\n // process element keys in order\n const keys = Object.keys(element).sort();\n for(const expandedProperty of keys) {\n const expandedValue = element[expandedProperty];\n\n // compact @id\n if(expandedProperty === '@id') {\n let compactedValue = _asArray(expandedValue).map(\n expandedIri => api.compactIri({\n activeCtx,\n iri: expandedIri,\n relativeTo: {vocab: false},\n base: options.base\n }));\n if(compactedValue.length === 1) {\n compactedValue = compactedValue[0];\n }\n\n // use keyword alias and add value\n const alias = api.compactIri(\n {activeCtx, iri: '@id', relativeTo: {vocab: true}});\n\n rval[alias] = compactedValue;\n continue;\n }\n\n // compact @type(s)\n if(expandedProperty === '@type') {\n // resolve type values against previous context\n let compactedValue = _asArray(expandedValue).map(\n expandedIri => api.compactIri({\n activeCtx: inputCtx,\n iri: expandedIri,\n relativeTo: {vocab: true}\n }));\n if(compactedValue.length === 1) {\n compactedValue = compactedValue[0];\n }\n\n // use keyword alias and add value\n const alias = api.compactIri(\n {activeCtx, iri: '@type', relativeTo: {vocab: true}});\n const container = _getContextValue(\n activeCtx, alias, '@container') || [];\n\n // treat as array for @type if @container includes @set\n const typeAsSet =\n container.includes('@set') &&\n _processingMode(activeCtx, 1.1);\n const isArray =\n typeAsSet || (_isArray(compactedValue) && expandedValue.length === 0);\n _addValue(rval, alias, compactedValue, {propertyIsArray: isArray});\n continue;\n }\n\n // handle @reverse\n if(expandedProperty === '@reverse') {\n // recursively compact expanded value\n const compactedValue = await api.compact({\n activeCtx,\n activeProperty: '@reverse',\n element: expandedValue,\n options\n });\n\n // handle double-reversed properties\n for(const compactedProperty in compactedValue) {\n if(activeCtx.mappings.has(compactedProperty) &&\n activeCtx.mappings.get(compactedProperty).reverse) {\n const value = compactedValue[compactedProperty];\n const container = _getContextValue(\n activeCtx, compactedProperty, '@container') || [];\n const useArray = (\n container.includes('@set') || !options.compactArrays);\n _addValue(\n rval, compactedProperty, value, {propertyIsArray: useArray});\n delete compactedValue[compactedProperty];\n }\n }\n\n if(Object.keys(compactedValue).length > 0) {\n // use keyword alias and add value\n const alias = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n relativeTo: {vocab: true}\n });\n _addValue(rval, alias, compactedValue);\n }\n\n continue;\n }\n\n if(expandedProperty === '@preserve') {\n // compact using activeProperty\n const compactedValue = await api.compact({\n activeCtx,\n activeProperty,\n element: expandedValue,\n options\n });\n\n if(!(_isArray(compactedValue) && compactedValue.length === 0)) {\n _addValue(rval, expandedProperty, compactedValue);\n }\n continue;\n }\n\n // handle @index property\n if(expandedProperty === '@index') {\n // drop @index if inside an @index container\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n if(container.includes('@index')) {\n continue;\n }\n\n // use keyword alias and add value\n const alias = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n relativeTo: {vocab: true}\n });\n _addValue(rval, alias, expandedValue);\n continue;\n }\n\n // skip array processing for keywords that aren't\n // @graph, @list, or @included\n if(expandedProperty !== '@graph' && expandedProperty !== '@list' &&\n expandedProperty !== '@included' &&\n _isKeyword(expandedProperty)) {\n // use keyword alias and add value as is\n const alias = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n relativeTo: {vocab: true}\n });\n _addValue(rval, alias, expandedValue);\n continue;\n }\n\n // Note: expanded value must be an array due to expansion algorithm.\n if(!_isArray(expandedValue)) {\n throw new JsonLdError(\n 'JSON-LD expansion error; expanded value must be an array.',\n 'jsonld.SyntaxError');\n }\n\n // preserve empty arrays\n if(expandedValue.length === 0) {\n const itemActiveProperty = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n value: expandedValue,\n relativeTo: {vocab: true},\n reverse: insideReverse\n });\n const nestProperty = activeCtx.mappings.has(itemActiveProperty) ?\n activeCtx.mappings.get(itemActiveProperty)['@nest'] : null;\n let nestResult = rval;\n if(nestProperty) {\n _checkNestProperty(activeCtx, nestProperty, options);\n if(!_isObject(rval[nestProperty])) {\n rval[nestProperty] = {};\n }\n nestResult = rval[nestProperty];\n }\n _addValue(\n nestResult, itemActiveProperty, expandedValue, {\n propertyIsArray: true\n });\n }\n\n // recusively process array values\n for(const expandedItem of expandedValue) {\n // compact property and get container type\n const itemActiveProperty = api.compactIri({\n activeCtx,\n iri: expandedProperty,\n value: expandedItem,\n relativeTo: {vocab: true},\n reverse: insideReverse\n });\n\n // if itemActiveProperty is a @nest property, add values to nestResult,\n // otherwise rval\n const nestProperty = activeCtx.mappings.has(itemActiveProperty) ?\n activeCtx.mappings.get(itemActiveProperty)['@nest'] : null;\n let nestResult = rval;\n if(nestProperty) {\n _checkNestProperty(activeCtx, nestProperty, options);\n if(!_isObject(rval[nestProperty])) {\n rval[nestProperty] = {};\n }\n nestResult = rval[nestProperty];\n }\n\n const container = _getContextValue(\n activeCtx, itemActiveProperty, '@container') || [];\n\n // get simple @graph or @list value if appropriate\n const isGraph = _isGraph(expandedItem);\n const isList = _isList(expandedItem);\n let inner;\n if(isList) {\n inner = expandedItem['@list'];\n } else if(isGraph) {\n inner = expandedItem['@graph'];\n }\n\n // recursively compact expanded item\n let compactedItem = await api.compact({\n activeCtx,\n activeProperty: itemActiveProperty,\n element: (isList || isGraph) ? inner : expandedItem,\n options\n });\n\n // handle @list\n if(isList) {\n // ensure @list value is an array\n if(!_isArray(compactedItem)) {\n compactedItem = [compactedItem];\n }\n\n if(!container.includes('@list')) {\n // wrap using @list alias\n compactedItem = {\n [api.compactIri({\n activeCtx,\n iri: '@list',\n relativeTo: {vocab: true}\n })]: compactedItem\n };\n\n // include @index from expanded @list, if any\n if('@index' in expandedItem) {\n compactedItem[api.compactIri({\n activeCtx,\n iri: '@index',\n relativeTo: {vocab: true}\n })] = expandedItem['@index'];\n }\n } else {\n _addValue(nestResult, itemActiveProperty, compactedItem, {\n valueIsArray: true,\n allowDuplicate: true\n });\n continue;\n }\n }\n\n // Graph object compaction cases\n if(isGraph) {\n if(container.includes('@graph') && (container.includes('@id') ||\n container.includes('@index') && _isSimpleGraph(expandedItem))) {\n // get or create the map object\n let mapObject;\n if(nestResult.hasOwnProperty(itemActiveProperty)) {\n mapObject = nestResult[itemActiveProperty];\n } else {\n nestResult[itemActiveProperty] = mapObject = {};\n }\n\n // index on @id or @index or alias of @none\n const key = (container.includes('@id') ?\n expandedItem['@id'] : expandedItem['@index']) ||\n api.compactIri({activeCtx, iri: '@none',\n relativeTo: {vocab: true}});\n // add compactedItem to map, using value of `@id` or a new blank\n // node identifier\n\n _addValue(\n mapObject, key, compactedItem, {\n propertyIsArray:\n (!options.compactArrays || container.includes('@set'))\n });\n } else if(container.includes('@graph') &&\n _isSimpleGraph(expandedItem)) {\n // container includes @graph but not @id or @index and value is a\n // simple graph object add compact value\n // if compactedItem contains multiple values, it is wrapped in\n // `@included`\n if(_isArray(compactedItem) && compactedItem.length > 1) {\n compactedItem = {'@included': compactedItem};\n }\n _addValue(\n nestResult, itemActiveProperty, compactedItem, {\n propertyIsArray:\n (!options.compactArrays || container.includes('@set'))\n });\n } else {\n // wrap using @graph alias, remove array if only one item and\n // compactArrays not set\n if(_isArray(compactedItem) && compactedItem.length === 1 &&\n options.compactArrays) {\n compactedItem = compactedItem[0];\n }\n compactedItem = {\n [api.compactIri({\n activeCtx,\n iri: '@graph',\n relativeTo: {vocab: true}\n })]: compactedItem\n };\n\n // include @id from expanded graph, if any\n if('@id' in expandedItem) {\n compactedItem[api.compactIri({\n activeCtx,\n iri: '@id',\n relativeTo: {vocab: true}\n })] = expandedItem['@id'];\n }\n\n // include @index from expanded graph, if any\n if('@index' in expandedItem) {\n compactedItem[api.compactIri({\n activeCtx,\n iri: '@index',\n relativeTo: {vocab: true}\n })] = expandedItem['@index'];\n }\n _addValue(\n nestResult, itemActiveProperty, compactedItem, {\n propertyIsArray:\n (!options.compactArrays || container.includes('@set'))\n });\n }\n } else if(container.includes('@language') ||\n container.includes('@index') || container.includes('@id') ||\n container.includes('@type')) {\n // handle language and index maps\n // get or create the map object\n let mapObject;\n if(nestResult.hasOwnProperty(itemActiveProperty)) {\n mapObject = nestResult[itemActiveProperty];\n } else {\n nestResult[itemActiveProperty] = mapObject = {};\n }\n\n let key;\n if(container.includes('@language')) {\n // if container is a language map, simplify compacted value to\n // a simple string\n if(_isValue(compactedItem)) {\n compactedItem = compactedItem['@value'];\n }\n key = expandedItem['@language'];\n } else if(container.includes('@index')) {\n const indexKey = _getContextValue(\n activeCtx, itemActiveProperty, '@index') || '@index';\n const containerKey = api.compactIri(\n {activeCtx, iri: indexKey, relativeTo: {vocab: true}});\n if(indexKey === '@index') {\n key = expandedItem['@index'];\n delete compactedItem[containerKey];\n } else {\n let others;\n [key, ...others] = _asArray(compactedItem[indexKey] || []);\n if(!_isString(key)) {\n // Will use @none if it isn't a string.\n key = null;\n } else {\n switch(others.length) {\n case 0:\n delete compactedItem[indexKey];\n break;\n case 1:\n compactedItem[indexKey] = others[0];\n break;\n default:\n compactedItem[indexKey] = others;\n break;\n }\n }\n }\n } else if(container.includes('@id')) {\n const idKey = api.compactIri({activeCtx, iri: '@id',\n relativeTo: {vocab: true}});\n key = compactedItem[idKey];\n delete compactedItem[idKey];\n } else if(container.includes('@type')) {\n const typeKey = api.compactIri({\n activeCtx,\n iri: '@type',\n relativeTo: {vocab: true}\n });\n let types;\n [key, ...types] = _asArray(compactedItem[typeKey] || []);\n switch(types.length) {\n case 0:\n delete compactedItem[typeKey];\n break;\n case 1:\n compactedItem[typeKey] = types[0];\n break;\n default:\n compactedItem[typeKey] = types;\n break;\n }\n\n // If compactedItem contains a single entry\n // whose key maps to @id, recompact without @type\n if(Object.keys(compactedItem).length === 1 &&\n '@id' in expandedItem) {\n compactedItem = await api.compact({\n activeCtx,\n activeProperty: itemActiveProperty,\n element: {'@id': expandedItem['@id']},\n options\n });\n }\n }\n\n // if compacting this value which has no key, index on @none\n if(!key) {\n key = api.compactIri({activeCtx, iri: '@none',\n relativeTo: {vocab: true}});\n }\n // add compact value to map object using key from expanded value\n // based on the container type\n _addValue(\n mapObject, key, compactedItem, {\n propertyIsArray: container.includes('@set')\n });\n } else {\n // use an array if: compactArrays flag is false,\n // @container is @set or @list , value is an empty\n // array, or key is @graph\n const isArray = (!options.compactArrays ||\n container.includes('@set') || container.includes('@list') ||\n (_isArray(compactedItem) && compactedItem.length === 0) ||\n expandedProperty === '@list' || expandedProperty === '@graph');\n\n // add compact value\n _addValue(\n nestResult, itemActiveProperty, compactedItem,\n {propertyIsArray: isArray});\n }\n }\n }\n\n return rval;\n }\n\n // only primitives remain which are already compact\n return element;\n};\n\n/**\n * Compacts an IRI or keyword into a term or prefix if it can be. If the\n * IRI has an associated value it may be passed.\n *\n * @param activeCtx the active context to use.\n * @param iri the IRI to compact.\n * @param value the value to check or null.\n * @param relativeTo options for how to compact IRIs:\n * vocab: true to split after @vocab, false not to.\n * @param reverse true if a reverse property is being compacted, false if not.\n * @param base the absolute URL to use for compacting document-relative IRIs.\n *\n * @return the compacted term, prefix, keyword alias, or the original IRI.\n */\napi.compactIri = ({\n activeCtx,\n iri,\n value = null,\n relativeTo = {vocab: false},\n reverse = false,\n base = null\n}) => {\n // can't compact null\n if(iri === null) {\n return iri;\n }\n\n // if context is from a property term scoped context composed with a\n // type-scoped context, then use the previous context instead\n if(activeCtx.isPropertyTermScoped && activeCtx.previousContext) {\n activeCtx = activeCtx.previousContext;\n }\n\n const inverseCtx = activeCtx.getInverse();\n\n // if term is a keyword, it may be compacted to a simple alias\n if(_isKeyword(iri) &&\n iri in inverseCtx &&\n '@none' in inverseCtx[iri] &&\n '@type' in inverseCtx[iri]['@none'] &&\n '@none' in inverseCtx[iri]['@none']['@type']) {\n return inverseCtx[iri]['@none']['@type']['@none'];\n }\n\n // use inverse context to pick a term if iri is relative to vocab\n if(relativeTo.vocab && iri in inverseCtx) {\n const defaultLanguage = activeCtx['@language'] || '@none';\n\n // prefer @index if available in value\n const containers = [];\n if(_isObject(value) && '@index' in value && !('@graph' in value)) {\n containers.push('@index', '@index@set');\n }\n\n // if value is a preserve object, use its value\n if(_isObject(value) && '@preserve' in value) {\n value = value['@preserve'][0];\n }\n\n // prefer most specific container including @graph, prefering @set\n // variations\n if(_isGraph(value)) {\n // favor indexmap if the graph is indexed\n if('@index' in value) {\n containers.push(\n '@graph@index', '@graph@index@set', '@index', '@index@set');\n }\n // favor idmap if the graph is has an @id\n if('@id' in value) {\n containers.push(\n '@graph@id', '@graph@id@set');\n }\n containers.push('@graph', '@graph@set', '@set');\n // allow indexmap if the graph is not indexed\n if(!('@index' in value)) {\n containers.push(\n '@graph@index', '@graph@index@set', '@index', '@index@set');\n }\n // allow idmap if the graph does not have an @id\n if(!('@id' in value)) {\n containers.push('@graph@id', '@graph@id@set');\n }\n } else if(_isObject(value) && !_isValue(value)) {\n containers.push('@id', '@id@set', '@type', '@set@type');\n }\n\n // defaults for term selection based on type/language\n let typeOrLanguage = '@language';\n let typeOrLanguageValue = '@null';\n\n if(reverse) {\n typeOrLanguage = '@type';\n typeOrLanguageValue = '@reverse';\n containers.push('@set');\n } else if(_isList(value)) {\n // choose the most specific term that works for all elements in @list\n // only select @list containers if @index is NOT in value\n if(!('@index' in value)) {\n containers.push('@list');\n }\n const list = value['@list'];\n if(list.length === 0) {\n // any empty list can be matched against any term that uses the\n // @list container regardless of @type or @language\n typeOrLanguage = '@any';\n typeOrLanguageValue = '@none';\n } else {\n let commonLanguage = (list.length === 0) ? defaultLanguage : null;\n let commonType = null;\n for(let i = 0; i < list.length; ++i) {\n const item = list[i];\n let itemLanguage = '@none';\n let itemType = '@none';\n if(_isValue(item)) {\n if('@direction' in item) {\n const lang = (item['@language'] || '').toLowerCase();\n const dir = item['@direction'];\n itemLanguage = `${lang}_${dir}`;\n } else if('@language' in item) {\n itemLanguage = item['@language'].toLowerCase();\n } else if('@type' in item) {\n itemType = item['@type'];\n } else {\n // plain literal\n itemLanguage = '@null';\n }\n } else {\n itemType = '@id';\n }\n if(commonLanguage === null) {\n commonLanguage = itemLanguage;\n } else if(itemLanguage !== commonLanguage && _isValue(item)) {\n commonLanguage = '@none';\n }\n if(commonType === null) {\n commonType = itemType;\n } else if(itemType !== commonType) {\n commonType = '@none';\n }\n // there are different languages and types in the list, so choose\n // the most generic term, no need to keep iterating the list\n if(commonLanguage === '@none' && commonType === '@none') {\n break;\n }\n }\n commonLanguage = commonLanguage || '@none';\n commonType = commonType || '@none';\n if(commonType !== '@none') {\n typeOrLanguage = '@type';\n typeOrLanguageValue = commonType;\n } else {\n typeOrLanguageValue = commonLanguage;\n }\n }\n } else {\n if(_isValue(value)) {\n if('@language' in value && !('@index' in value)) {\n containers.push('@language', '@language@set');\n typeOrLanguageValue = value['@language'];\n const dir = value['@direction'];\n if(dir) {\n typeOrLanguageValue = `${typeOrLanguageValue}_${dir}`;\n }\n } else if('@direction' in value && !('@index' in value)) {\n typeOrLanguageValue = `_${value['@direction']}`;\n } else if('@type' in value) {\n typeOrLanguage = '@type';\n typeOrLanguageValue = value['@type'];\n }\n } else {\n typeOrLanguage = '@type';\n typeOrLanguageValue = '@id';\n }\n containers.push('@set');\n }\n\n // do term selection\n containers.push('@none');\n\n // an index map can be used to index values using @none, so add as a low\n // priority\n if(_isObject(value) && !('@index' in value)) {\n // allow indexing even if no @index present\n containers.push('@index', '@index@set');\n }\n\n // values without type or language can use @language map\n if(_isValue(value) && Object.keys(value).length === 1) {\n // allow indexing even if no @index present\n containers.push('@language', '@language@set');\n }\n\n const term = _selectTerm(\n activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue);\n if(term !== null) {\n return term;\n }\n }\n\n // no term match, use @vocab if available\n if(relativeTo.vocab) {\n if('@vocab' in activeCtx) {\n // determine if vocab is a prefix of the iri\n const vocab = activeCtx['@vocab'];\n if(iri.indexOf(vocab) === 0 && iri !== vocab) {\n // use suffix as relative iri if it is not a term in the active context\n const suffix = iri.substr(vocab.length);\n if(!activeCtx.mappings.has(suffix)) {\n return suffix;\n }\n }\n }\n }\n\n // no term or @vocab match, check for possible CURIEs\n let choice = null;\n // TODO: make FastCurieMap a class with a method to do this lookup\n const partialMatches = [];\n let iriMap = activeCtx.fastCurieMap;\n // check for partial matches of against `iri`, which means look until\n // iri.length - 1, not full length\n const maxPartialLength = iri.length - 1;\n for(let i = 0; i < maxPartialLength && iri[i] in iriMap; ++i) {\n iriMap = iriMap[iri[i]];\n if('' in iriMap) {\n partialMatches.push(iriMap[''][0]);\n }\n }\n // check partial matches in reverse order to prefer longest ones first\n for(let i = partialMatches.length - 1; i >= 0; --i) {\n const entry = partialMatches[i];\n const terms = entry.terms;\n for(const term of terms) {\n // a CURIE is usable if:\n // 1. it has no mapping, OR\n // 2. value is null, which means we're not compacting an @value, AND\n // the mapping matches the IRI\n const curie = term + ':' + iri.substr(entry.iri.length);\n const isUsableCurie = (activeCtx.mappings.get(term)._prefix &&\n (!activeCtx.mappings.has(curie) ||\n (value === null && activeCtx.mappings.get(curie)['@id'] === iri)));\n\n // select curie if it is shorter or the same length but lexicographically\n // less than the current choice\n if(isUsableCurie && (choice === null ||\n _compareShortestLeast(curie, choice) < 0)) {\n choice = curie;\n }\n }\n }\n\n // return chosen curie\n if(choice !== null) {\n return choice;\n }\n\n // If iri could be confused with a compact IRI using a term in this context,\n // signal an error\n for(const [term, td] of activeCtx.mappings) {\n if(td && td._prefix && iri.startsWith(term + ':')) {\n throw new JsonLdError(\n `Absolute IRI \"${iri}\" confused with prefix \"${term}\".`,\n 'jsonld.SyntaxError',\n {code: 'IRI confused with prefix', context: activeCtx});\n }\n }\n\n // compact IRI relative to base\n if(!relativeTo.vocab) {\n if('@base' in activeCtx) {\n if(!activeCtx['@base']) {\n // The None case preserves rval as potentially relative\n return iri;\n } else {\n const _iri = _removeBase(_prependBase(base, activeCtx['@base']), iri);\n return REGEX_KEYWORD.test(_iri) ? `./${_iri}` : _iri;\n }\n } else {\n return _removeBase(base, iri);\n }\n }\n\n // return IRI as is\n return iri;\n};\n\n/**\n * Performs value compaction on an object with '@value' or '@id' as the only\n * property.\n *\n * @param activeCtx the active context.\n * @param activeProperty the active property that points to the value.\n * @param value the value to compact.\n * @param {Object} [options] - processing options.\n *\n * @return the compaction result.\n */\napi.compactValue = ({activeCtx, activeProperty, value, options}) => {\n // value is a @value\n if(_isValue(value)) {\n // get context rules\n const type = _getContextValue(activeCtx, activeProperty, '@type');\n const language = _getContextValue(activeCtx, activeProperty, '@language');\n const direction = _getContextValue(activeCtx, activeProperty, '@direction');\n const container =\n _getContextValue(activeCtx, activeProperty, '@container') || [];\n\n // whether or not the value has an @index that must be preserved\n const preserveIndex = '@index' in value && !container.includes('@index');\n\n // if there's no @index to preserve ...\n if(!preserveIndex && type !== '@none') {\n // matching @type or @language specified in context, compact value\n if(value['@type'] === type) {\n return value['@value'];\n }\n if('@language' in value && value['@language'] === language &&\n '@direction' in value && value['@direction'] === direction) {\n return value['@value'];\n }\n if('@language' in value && value['@language'] === language) {\n return value['@value'];\n }\n if('@direction' in value && value['@direction'] === direction) {\n return value['@value'];\n }\n }\n\n // return just the value of @value if all are true:\n // 1. @value is the only key or @index isn't being preserved\n // 2. there is no default language or @value is not a string or\n // the key has a mapping with a null @language\n const keyCount = Object.keys(value).length;\n const isValueOnlyKey = (keyCount === 1 ||\n (keyCount === 2 && '@index' in value && !preserveIndex));\n const hasDefaultLanguage = ('@language' in activeCtx);\n const isValueString = _isString(value['@value']);\n const hasNullMapping = (activeCtx.mappings.has(activeProperty) &&\n activeCtx.mappings.get(activeProperty)['@language'] === null);\n if(isValueOnlyKey &&\n type !== '@none' &&\n (!hasDefaultLanguage || !isValueString || hasNullMapping)) {\n return value['@value'];\n }\n\n const rval = {};\n\n // preserve @index\n if(preserveIndex) {\n rval[api.compactIri({\n activeCtx,\n iri: '@index',\n relativeTo: {vocab: true}\n })] = value['@index'];\n }\n\n if('@type' in value) {\n // compact @type IRI\n rval[api.compactIri({\n activeCtx,\n iri: '@type',\n relativeTo: {vocab: true}\n })] = api.compactIri(\n {activeCtx, iri: value['@type'], relativeTo: {vocab: true}});\n } else if('@language' in value) {\n // alias @language\n rval[api.compactIri({\n activeCtx,\n iri: '@language',\n relativeTo: {vocab: true}\n })] = value['@language'];\n }\n\n if('@direction' in value) {\n // alias @direction\n rval[api.compactIri({\n activeCtx,\n iri: '@direction',\n relativeTo: {vocab: true}\n })] = value['@direction'];\n }\n\n // alias @value\n rval[api.compactIri({\n activeCtx,\n iri: '@value',\n relativeTo: {vocab: true}\n })] = value['@value'];\n\n return rval;\n }\n\n // value is a subject reference\n const expandedProperty = _expandIri(activeCtx, activeProperty, {vocab: true},\n options);\n const type = _getContextValue(activeCtx, activeProperty, '@type');\n const compacted = api.compactIri({\n activeCtx,\n iri: value['@id'],\n relativeTo: {vocab: type === '@vocab'},\n base: options.base});\n\n // compact to scalar\n if(type === '@id' || type === '@vocab' || expandedProperty === '@graph') {\n return compacted;\n }\n\n return {\n [api.compactIri({\n activeCtx,\n iri: '@id',\n relativeTo: {vocab: true}\n })]: compacted\n };\n};\n\n/**\n * Picks the preferred compaction term from the given inverse context entry.\n *\n * @param activeCtx the active context.\n * @param iri the IRI to pick the term for.\n * @param value the value to pick the term for.\n * @param containers the preferred containers.\n * @param typeOrLanguage either '@type' or '@language'.\n * @param typeOrLanguageValue the preferred value for '@type' or '@language'.\n *\n * @return the preferred term.\n */\nfunction _selectTerm(\n activeCtx, iri, value, containers, typeOrLanguage, typeOrLanguageValue) {\n if(typeOrLanguageValue === null) {\n typeOrLanguageValue = '@null';\n }\n\n // preferences for the value of @type or @language\n const prefs = [];\n\n // determine prefs for @id based on whether or not value compacts to a term\n if((typeOrLanguageValue === '@id' || typeOrLanguageValue === '@reverse') &&\n _isObject(value) && '@id' in value) {\n // prefer @reverse first\n if(typeOrLanguageValue === '@reverse') {\n prefs.push('@reverse');\n }\n // try to compact value to a term\n const term = api.compactIri(\n {activeCtx, iri: value['@id'], relativeTo: {vocab: true}});\n if(activeCtx.mappings.has(term) &&\n activeCtx.mappings.get(term) &&\n activeCtx.mappings.get(term)['@id'] === value['@id']) {\n // prefer @vocab\n prefs.push.apply(prefs, ['@vocab', '@id']);\n } else {\n // prefer @id\n prefs.push.apply(prefs, ['@id', '@vocab']);\n }\n } else {\n prefs.push(typeOrLanguageValue);\n\n // consider direction only\n const langDir = prefs.find(el => el.includes('_'));\n if(langDir) {\n // consider _dir portion\n prefs.push(langDir.replace(/^[^_]+_/, '_'));\n }\n }\n prefs.push('@none');\n\n const containerMap = activeCtx.inverse[iri];\n for(const container of containers) {\n // if container not available in the map, continue\n if(!(container in containerMap)) {\n continue;\n }\n\n const typeOrLanguageValueMap = containerMap[container][typeOrLanguage];\n for(const pref of prefs) {\n // if type/language option not available in the map, continue\n if(!(pref in typeOrLanguageValueMap)) {\n continue;\n }\n\n // select term\n return typeOrLanguageValueMap[pref];\n }\n }\n\n return null;\n}\n\n/**\n * The value of `@nest` in the term definition must either be `@nest`, or a term\n * which resolves to `@nest`.\n *\n * @param activeCtx the active context.\n * @param nestProperty a term in the active context or `@nest`.\n * @param {Object} [options] - processing options.\n */\nfunction _checkNestProperty(activeCtx, nestProperty, options) {\n if(_expandIri(activeCtx, nestProperty, {vocab: true}, options) !== '@nest') {\n throw new JsonLdError(\n 'JSON-LD compact error; nested property must have an @nest value ' +\n 'resolving to @nest.',\n 'jsonld.SyntaxError', {code: 'invalid @nest value'});\n }\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nconst XSD = 'http://www.w3.org/2001/XMLSchema#';\n\nmodule.exports = {\n // TODO: Deprecated and will be removed later. Use LINK_HEADER_CONTEXT.\n LINK_HEADER_REL: 'http://www.w3.org/ns/json-ld#context',\n\n LINK_HEADER_CONTEXT: 'http://www.w3.org/ns/json-ld#context',\n\n RDF,\n RDF_LIST: RDF + 'List',\n RDF_FIRST: RDF + 'first',\n RDF_REST: RDF + 'rest',\n RDF_NIL: RDF + 'nil',\n RDF_TYPE: RDF + 'type',\n RDF_PLAIN_LITERAL: RDF + 'PlainLiteral',\n RDF_XML_LITERAL: RDF + 'XMLLiteral',\n RDF_JSON_LITERAL: RDF + 'JSON',\n RDF_OBJECT: RDF + 'object',\n RDF_LANGSTRING: RDF + 'langString',\n\n XSD,\n XSD_BOOLEAN: XSD + 'boolean',\n XSD_DOUBLE: XSD + 'double',\n XSD_INTEGER: XSD + 'integer',\n XSD_STRING: XSD + 'string',\n};\n","/*\n * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst util = require('./util');\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString,\n isUndefined: _isUndefined\n} = require('./types');\n\nconst {\n isAbsolute: _isAbsoluteIri,\n isRelative: _isRelativeIri,\n prependBase\n} = require('./url');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\nconst {\n REGEX_BCP47,\n REGEX_KEYWORD,\n asArray: _asArray,\n compareShortestLeast: _compareShortestLeast\n} = require('./util');\n\nconst INITIAL_CONTEXT_CACHE = new Map();\nconst INITIAL_CONTEXT_CACHE_MAX_SIZE = 10000;\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Processes a local context and returns a new active context.\n *\n * @param activeCtx the current active context.\n * @param localCtx the local context to process.\n * @param options the context processing options.\n * @param propagate `true` if `false`, retains any previously defined term,\n * which can be rolled back when the descending into a new node object.\n * @param overrideProtected `false` allows protected terms to be modified.\n *\n * @return a Promise that resolves to the new active context.\n */\napi.process = async ({\n activeCtx, localCtx, options,\n propagate = true,\n overrideProtected = false,\n cycles = new Set()\n}) => {\n // normalize local context to an array of @context objects\n if(_isObject(localCtx) && '@context' in localCtx &&\n _isArray(localCtx['@context'])) {\n localCtx = localCtx['@context'];\n }\n const ctxs = _asArray(localCtx);\n\n // no contexts in array, return current active context w/o changes\n if(ctxs.length === 0) {\n return activeCtx;\n }\n\n // event handler for capturing events to replay when using a cached context\n const events = [];\n const eventCaptureHandler = [\n ({event, next}) => {\n events.push(event);\n next();\n }\n ];\n // chain to original handler\n if(options.eventHandler) {\n eventCaptureHandler.push(options.eventHandler);\n }\n // store original options to use when replaying events\n const originalOptions = options;\n // shallow clone options with event capture handler\n options = {...options, eventHandler: eventCaptureHandler};\n\n // resolve contexts\n const resolved = await options.contextResolver.resolve({\n activeCtx,\n context: localCtx,\n documentLoader: options.documentLoader,\n base: options.base\n });\n\n // override propagate if first resolved context has `@propagate`\n if(_isObject(resolved[0].document) &&\n typeof resolved[0].document['@propagate'] === 'boolean') {\n // retrieve early, error checking done later\n propagate = resolved[0].document['@propagate'];\n }\n\n // process each context in order, update active context\n // on each iteration to ensure proper caching\n let rval = activeCtx;\n\n // track the previous context\n // if not propagating, make sure rval has a previous context\n if(!propagate && !rval.previousContext) {\n // clone `rval` context before updating\n rval = rval.clone();\n rval.previousContext = activeCtx;\n }\n\n for(const resolvedContext of resolved) {\n let {document: ctx} = resolvedContext;\n\n // update active context to one computed from last iteration\n activeCtx = rval;\n\n // reset to initial context\n if(ctx === null) {\n // We can't nullify if there are protected terms and we're\n // not allowing overrides (e.g. processing a property term scoped context)\n if(!overrideProtected && Object.keys(activeCtx.protected).length !== 0) {\n throw new JsonLdError(\n 'Tried to nullify a context with protected terms outside of ' +\n 'a term definition.',\n 'jsonld.SyntaxError',\n {code: 'invalid context nullification'});\n }\n rval = activeCtx = api.getInitialContext(options).clone();\n continue;\n }\n\n // get processed context from cache if available\n const processed = resolvedContext.getProcessed(activeCtx);\n if(processed) {\n if(originalOptions.eventHandler) {\n // replay events with original non-capturing options\n for(const event of processed.events) {\n _handleEvent({event, options: originalOptions});\n }\n }\n\n rval = activeCtx = processed.context;\n continue;\n }\n\n // dereference @context key if present\n if(_isObject(ctx) && '@context' in ctx) {\n ctx = ctx['@context'];\n }\n\n // context must be an object by now, all URLs retrieved before this call\n if(!_isObject(ctx)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context must be an object.',\n 'jsonld.SyntaxError', {code: 'invalid local context', context: ctx});\n }\n\n // TODO: there is likely a `previousContext` cloning optimization that\n // could be applied here (no need to copy it under certain conditions)\n\n // clone context before updating it\n rval = rval.clone();\n\n // define context mappings for keys in local context\n const defined = new Map();\n\n // handle @version\n if('@version' in ctx) {\n if(ctx['@version'] !== 1.1) {\n throw new JsonLdError(\n 'Unsupported JSON-LD version: ' + ctx['@version'],\n 'jsonld.UnsupportedVersion',\n {code: 'invalid @version value', context: ctx});\n }\n if(activeCtx.processingMode &&\n activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n '@version: ' + ctx['@version'] + ' not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.ProcessingModeConflict',\n {code: 'processing mode conflict', context: ctx});\n }\n rval.processingMode = 'json-ld-1.1';\n rval['@version'] = ctx['@version'];\n defined.set('@version', true);\n }\n\n // if not set explicitly, set processingMode to \"json-ld-1.1\"\n rval.processingMode =\n rval.processingMode || activeCtx.processingMode;\n\n // handle @base\n if('@base' in ctx) {\n let base = ctx['@base'];\n\n if(base === null || _isAbsoluteIri(base)) {\n // no action\n } else if(_isRelativeIri(base)) {\n base = prependBase(rval['@base'], base);\n } else {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@base\" in a ' +\n '@context must be an absolute IRI, a relative IRI, or null.',\n 'jsonld.SyntaxError', {code: 'invalid base IRI', context: ctx});\n }\n\n rval['@base'] = base;\n defined.set('@base', true);\n }\n\n // handle @vocab\n if('@vocab' in ctx) {\n const value = ctx['@vocab'];\n if(value === null) {\n delete rval['@vocab'];\n } else if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@vocab\" in a ' +\n '@context must be a string or null.',\n 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx});\n } else if(!_isAbsoluteIri(value) && api.processingMode(rval, 1.0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@vocab\" in a ' +\n '@context must be an absolute IRI.',\n 'jsonld.SyntaxError', {code: 'invalid vocab mapping', context: ctx});\n } else {\n const vocab = _expandIri(rval, value, {vocab: true, base: true},\n undefined, undefined, options);\n if(!_isAbsoluteIri(vocab)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative @vocab reference',\n level: 'warning',\n message: 'Relative @vocab reference found.',\n details: {\n vocab\n }\n },\n options\n });\n }\n }\n rval['@vocab'] = vocab;\n }\n defined.set('@vocab', true);\n }\n\n // handle @language\n if('@language' in ctx) {\n const value = ctx['@language'];\n if(value === null) {\n delete rval['@language'];\n } else if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@language\" in a ' +\n '@context must be a string or null.',\n 'jsonld.SyntaxError',\n {code: 'invalid default language', context: ctx});\n } else {\n if(!value.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language: value\n }\n },\n options\n });\n }\n }\n rval['@language'] = value.toLowerCase();\n }\n defined.set('@language', true);\n }\n\n // handle @direction\n if('@direction' in ctx) {\n const value = ctx['@direction'];\n if(activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @direction not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.SyntaxError',\n {code: 'invalid context member', context: ctx});\n }\n if(value === null) {\n delete rval['@direction'];\n } else if(value !== 'ltr' && value !== 'rtl') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; the value of \"@direction\" in a ' +\n '@context must be null, \"ltr\", or \"rtl\".',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', context: ctx});\n } else {\n rval['@direction'] = value;\n }\n defined.set('@direction', true);\n }\n\n // handle @propagate\n // note: we've already extracted it, here we just do error checking\n if('@propagate' in ctx) {\n const value = ctx['@propagate'];\n if(activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @propagate not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.SyntaxError',\n {code: 'invalid context entry', context: ctx});\n }\n if(typeof value !== 'boolean') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @propagate value must be a boolean.',\n 'jsonld.SyntaxError',\n {code: 'invalid @propagate value', context: localCtx});\n }\n defined.set('@propagate', true);\n }\n\n // handle @import\n if('@import' in ctx) {\n const value = ctx['@import'];\n if(activeCtx.processingMode === 'json-ld-1.0') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @import not compatible with ' +\n activeCtx.processingMode,\n 'jsonld.SyntaxError',\n {code: 'invalid context entry', context: ctx});\n }\n if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @import must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid @import value', context: localCtx});\n }\n\n // resolve contexts\n const resolvedImport = await options.contextResolver.resolve({\n activeCtx,\n context: value,\n documentLoader: options.documentLoader,\n base: options.base\n });\n if(resolvedImport.length !== 1) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @import must reference a single context.',\n 'jsonld.SyntaxError',\n {code: 'invalid remote context', context: localCtx});\n }\n const processedImport = resolvedImport[0].getProcessed(activeCtx);\n if(processedImport) {\n // Note: if the same context were used in this active context\n // as a reference context, then processed_input might not\n // be a dict.\n ctx = processedImport;\n } else {\n const importCtx = resolvedImport[0].document;\n if('@import' in importCtx) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax: ' +\n 'imported context must not include @import.',\n 'jsonld.SyntaxError',\n {code: 'invalid context entry', context: localCtx});\n }\n\n // merge ctx into importCtx and replace rval with the result\n for(const key in importCtx) {\n if(!ctx.hasOwnProperty(key)) {\n ctx[key] = importCtx[key];\n }\n }\n\n // Note: this could potenially conflict if the import\n // were used in the same active context as a referenced\n // context and an import. In this case, we\n // could override the cached result, but seems unlikely.\n resolvedImport[0].setProcessed(activeCtx, ctx);\n }\n\n defined.set('@import', true);\n }\n\n // handle @protected; determine whether this sub-context is declaring\n // all its terms to be \"protected\" (exceptions can be made on a\n // per-definition basis)\n defined.set('@protected', ctx['@protected'] || false);\n\n // process all other keys\n for(const key in ctx) {\n api.createTermDefinition({\n activeCtx: rval,\n localCtx: ctx,\n term: key,\n defined,\n options,\n overrideProtected\n });\n\n if(_isObject(ctx[key]) && '@context' in ctx[key]) {\n const keyCtx = ctx[key]['@context'];\n let process = true;\n if(_isString(keyCtx)) {\n const url = prependBase(options.base, keyCtx);\n // track processed contexts to avoid scoped context recursion\n if(cycles.has(url)) {\n process = false;\n } else {\n cycles.add(url);\n }\n }\n // parse context to validate\n if(process) {\n try {\n await api.process({\n activeCtx: rval.clone(),\n localCtx: ctx[key]['@context'],\n overrideProtected: true,\n options,\n cycles\n });\n } catch(e) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid scoped context.',\n 'jsonld.SyntaxError',\n {\n code: 'invalid scoped context',\n context: ctx[key]['@context'],\n term: key\n });\n }\n }\n }\n }\n\n // cache processed result\n resolvedContext.setProcessed(activeCtx, {\n context: rval,\n events\n });\n }\n\n return rval;\n};\n\n/**\n * Creates a term definition during context processing.\n *\n * @param activeCtx the current active context.\n * @param localCtx the local context being processed.\n * @param term the term in the local context to define the mapping for.\n * @param defined a map of defining/defined keys to detect cycles and prevent\n * double definitions.\n * @param {Object} [options] - creation options.\n * @param overrideProtected `false` allows protected terms to be modified.\n */\napi.createTermDefinition = ({\n activeCtx,\n localCtx,\n term,\n defined,\n options,\n overrideProtected = false,\n}) => {\n if(defined.has(term)) {\n // term already defined\n if(defined.get(term)) {\n return;\n }\n // cycle detected\n throw new JsonLdError(\n 'Cyclical context definition detected.',\n 'jsonld.CyclicalContext',\n {code: 'cyclic IRI mapping', context: localCtx, term});\n }\n\n // now defining term\n defined.set(term, false);\n\n // get context term value\n let value;\n if(localCtx.hasOwnProperty(term)) {\n value = localCtx[term];\n }\n\n if(term === '@type' &&\n _isObject(value) &&\n (value['@container'] || '@set') === '@set' &&\n api.processingMode(activeCtx, 1.1)) {\n\n const validKeys = ['@container', '@id', '@protected'];\n const keys = Object.keys(value);\n if(keys.length === 0 || keys.some(k => !validKeys.includes(k))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; keywords cannot be overridden.',\n 'jsonld.SyntaxError',\n {code: 'keyword redefinition', context: localCtx, term});\n }\n } else if(api.isKeyword(term)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; keywords cannot be overridden.',\n 'jsonld.SyntaxError',\n {code: 'keyword redefinition', context: localCtx, term});\n } else if(term.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved term',\n level: 'warning',\n message:\n 'Terms beginning with \"@\" are ' +\n 'reserved for future use and dropped.',\n details: {\n term\n }\n },\n options\n });\n }\n return;\n } else if(term === '') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a term cannot be an empty string.',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n\n // keep reference to previous mapping for potential `@protected` check\n const previousMapping = activeCtx.mappings.get(term);\n\n // remove old mapping\n if(activeCtx.mappings.has(term)) {\n activeCtx.mappings.delete(term);\n }\n\n // convert short-hand value to object w/@id\n let simpleTerm = false;\n if(_isString(value) || value === null) {\n simpleTerm = true;\n value = {'@id': value};\n }\n\n if(!_isObject(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context term values must be ' +\n 'strings or objects.',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n\n // create new mapping\n const mapping = {};\n activeCtx.mappings.set(term, mapping);\n mapping.reverse = false;\n\n // make sure term definition only has expected keywords\n const validKeys = ['@container', '@id', '@language', '@reverse', '@type'];\n\n // JSON-LD 1.1 support\n if(api.processingMode(activeCtx, 1.1)) {\n validKeys.push(\n '@context', '@direction', '@index', '@nest', '@prefix', '@protected');\n }\n\n for(const kw in value) {\n if(!validKeys.includes(kw)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a term definition must not contain ' + kw,\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n }\n\n // always compute whether term has a colon as an optimization for\n // _compactIri\n const colon = term.indexOf(':');\n mapping._termHasColon = (colon > 0);\n\n if('@reverse' in value) {\n if('@id' in value) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @reverse term definition must not ' +\n 'contain @id.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property', context: localCtx});\n }\n if('@nest' in value) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @reverse term definition must not ' +\n 'contain @nest.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property', context: localCtx});\n }\n const reverse = value['@reverse'];\n if(!_isString(reverse)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @reverse value must be a string.',\n 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx});\n }\n\n if(reverse.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @reverse value',\n level: 'warning',\n message:\n '@reverse values beginning with \"@\" are ' +\n 'reserved for future use and dropped.',\n details: {\n reverse\n }\n },\n options\n });\n }\n if(previousMapping) {\n activeCtx.mappings.set(term, previousMapping);\n } else {\n activeCtx.mappings.delete(term);\n }\n return;\n }\n\n // expand and add @id mapping\n const id = _expandIri(\n activeCtx, reverse, {vocab: true, base: false}, localCtx, defined,\n options);\n if(!_isAbsoluteIri(id)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @reverse value must be an ' +\n 'absolute IRI or a blank node identifier.',\n 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx});\n }\n\n mapping['@id'] = id;\n mapping.reverse = true;\n } else if('@id' in value) {\n let id = value['@id'];\n if(id && !_isString(id)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @id value must be an array ' +\n 'of strings or a string.',\n 'jsonld.SyntaxError', {code: 'invalid IRI mapping', context: localCtx});\n }\n if(id === null) {\n // reserve a null term, which may be protected\n mapping['@id'] = null;\n } else if(!api.isKeyword(id) && id.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @id value',\n level: 'warning',\n message:\n '@id values beginning with \"@\" are ' +\n 'reserved for future use and dropped.',\n details: {\n id\n }\n },\n options\n });\n }\n if(previousMapping) {\n activeCtx.mappings.set(term, previousMapping);\n } else {\n activeCtx.mappings.delete(term);\n }\n return;\n } else if(id !== term) {\n // expand and add @id mapping\n id = _expandIri(\n activeCtx, id, {vocab: true, base: false}, localCtx, defined, options);\n if(!_isAbsoluteIri(id) && !api.isKeyword(id)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a @context @id value must be an ' +\n 'absolute IRI, a blank node identifier, or a keyword.',\n 'jsonld.SyntaxError',\n {code: 'invalid IRI mapping', context: localCtx});\n }\n\n // if term has the form of an IRI it must map the same\n if(term.match(/(?::[^:])|\\//)) {\n const termDefined = new Map(defined).set(term, true);\n const termIri = _expandIri(\n activeCtx, term, {vocab: true, base: false},\n localCtx, termDefined, options);\n if(termIri !== id) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; term in form of IRI must ' +\n 'expand to definition.',\n 'jsonld.SyntaxError',\n {code: 'invalid IRI mapping', context: localCtx});\n }\n }\n\n mapping['@id'] = id;\n // indicate if this term may be used as a compact IRI prefix\n mapping._prefix = (simpleTerm &&\n !mapping._termHasColon &&\n id.match(/[:\\/\\?#\\[\\]@]$/));\n }\n }\n\n if(!('@id' in mapping)) {\n // see if the term has a prefix\n if(mapping._termHasColon) {\n const prefix = term.substr(0, colon);\n if(localCtx.hasOwnProperty(prefix)) {\n // define parent prefix\n api.createTermDefinition({\n activeCtx, localCtx, term: prefix, defined, options\n });\n }\n\n if(activeCtx.mappings.has(prefix)) {\n // set @id based on prefix parent\n const suffix = term.substr(colon + 1);\n mapping['@id'] = activeCtx.mappings.get(prefix)['@id'] + suffix;\n } else {\n // term is an absolute IRI\n mapping['@id'] = term;\n }\n } else if(term === '@type') {\n // Special case, were we've previously determined that container is @set\n mapping['@id'] = term;\n } else {\n // non-IRIs *must* define @ids if @vocab is not available\n if(!('@vocab' in activeCtx)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context terms must define an @id.',\n 'jsonld.SyntaxError',\n {code: 'invalid IRI mapping', context: localCtx, term});\n }\n // prepend vocab to term\n mapping['@id'] = activeCtx['@vocab'] + term;\n }\n }\n\n // Handle term protection\n if(value['@protected'] === true ||\n (defined.get('@protected') === true && value['@protected'] !== false)) {\n activeCtx.protected[term] = true;\n mapping.protected = true;\n }\n\n // IRI mapping now defined\n defined.set(term, true);\n\n if('@type' in value) {\n let type = value['@type'];\n if(!_isString(type)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n\n if((type === '@json' || type === '@none')) {\n if(api.processingMode(activeCtx, 1.0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must not be ' +\n `\"${type}\" in JSON-LD 1.0 mode.`,\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n } else if(type !== '@id' && type !== '@vocab') {\n // expand @type to full IRI\n type = _expandIri(\n activeCtx, type, {vocab: true, base: false}, localCtx, defined,\n options);\n if(!_isAbsoluteIri(type)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must be an ' +\n 'absolute IRI.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n if(type.indexOf('_:') === 0) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an @context @type value must be an IRI, ' +\n 'not a blank node identifier.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n }\n\n // add @type to mapping\n mapping['@type'] = type;\n }\n\n if('@container' in value) {\n // normalize container to an array form\n const container = _isString(value['@container']) ?\n [value['@container']] : (value['@container'] || []);\n const validContainers = ['@list', '@set', '@index', '@language'];\n let isValid = true;\n const hasSet = container.includes('@set');\n\n // JSON-LD 1.1 support\n if(api.processingMode(activeCtx, 1.1)) {\n validContainers.push('@graph', '@id', '@type');\n\n // check container length\n if(container.includes('@list')) {\n if(container.length !== 1) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container with @list must ' +\n 'have no other values',\n 'jsonld.SyntaxError',\n {code: 'invalid container mapping', context: localCtx});\n }\n } else if(container.includes('@graph')) {\n if(container.some(key =>\n key !== '@graph' && key !== '@id' && key !== '@index' &&\n key !== '@set')) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container with @graph must ' +\n 'have no other values other than @id, @index, and @set',\n 'jsonld.SyntaxError',\n {code: 'invalid container mapping', context: localCtx});\n }\n } else {\n // otherwise, container may also include @set\n isValid &= container.length <= (hasSet ? 2 : 1);\n }\n\n if(container.includes('@type')) {\n // If mapping does not have an @type,\n // set it to @id\n mapping['@type'] = mapping['@type'] || '@id';\n\n // type mapping must be either @id or @vocab\n if(!['@id', '@vocab'].includes(mapping['@type'])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; container: @type requires @type to be ' +\n '@id or @vocab.',\n 'jsonld.SyntaxError',\n {code: 'invalid type mapping', context: localCtx});\n }\n }\n } else {\n // in JSON-LD 1.0, container must not be an array (it must be a string,\n // which is one of the validContainers)\n isValid &= !_isArray(value['@container']);\n\n // check container length\n isValid &= container.length <= 1;\n }\n\n // check against valid containers\n isValid &= container.every(c => validContainers.includes(c));\n\n // @set not allowed with @list\n isValid &= !(hasSet && container.includes('@list'));\n\n if(!isValid) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container value must be ' +\n 'one of the following: ' + validContainers.join(', '),\n 'jsonld.SyntaxError',\n {code: 'invalid container mapping', context: localCtx});\n }\n\n if(mapping.reverse &&\n !container.every(c => ['@index', '@set'].includes(c))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @container value for a @reverse ' +\n 'type definition must be @index or @set.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property', context: localCtx});\n }\n\n // add @container to mapping\n mapping['@container'] = container;\n }\n\n // property indexing\n if('@index' in value) {\n if(!('@container' in value) || !mapping['@container'].includes('@index')) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @index without @index in @container: ' +\n `\"${value['@index']}\" on term \"${term}\".`, 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n if(!_isString(value['@index']) || value['@index'].indexOf('@') === 0) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @index must expand to an IRI: ' +\n `\"${value['@index']}\" on term \"${term}\".`, 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n mapping['@index'] = value['@index'];\n }\n\n // scoped contexts\n if('@context' in value) {\n mapping['@context'] = value['@context'];\n }\n\n if('@language' in value && !('@type' in value)) {\n let language = value['@language'];\n if(language !== null && !_isString(language)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @language value must be ' +\n 'a string or null.', 'jsonld.SyntaxError',\n {code: 'invalid language mapping', context: localCtx});\n }\n\n // add @language to mapping\n if(language !== null) {\n language = language.toLowerCase();\n }\n mapping['@language'] = language;\n }\n\n // term may be used as a prefix\n if('@prefix' in value) {\n if(term.match(/:|\\//)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @prefix used on a compact IRI term',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n if(api.isKeyword(mapping['@id'])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; keywords may not be used as prefixes',\n 'jsonld.SyntaxError',\n {code: 'invalid term definition', context: localCtx});\n }\n if(typeof value['@prefix'] === 'boolean') {\n mapping._prefix = value['@prefix'] === true;\n } else {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context value for @prefix must be boolean',\n 'jsonld.SyntaxError',\n {code: 'invalid @prefix value', context: localCtx});\n }\n }\n\n if('@direction' in value) {\n const direction = value['@direction'];\n if(direction !== null && direction !== 'ltr' && direction !== 'rtl') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @direction value must be ' +\n 'null, \"ltr\", or \"rtl\".',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', context: localCtx});\n }\n mapping['@direction'] = direction;\n }\n\n if('@nest' in value) {\n const nest = value['@nest'];\n if(!_isString(nest) || (nest !== '@nest' && nest.indexOf('@') === 0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context @nest value must be ' +\n 'a string which is not a keyword other than @nest.',\n 'jsonld.SyntaxError',\n {code: 'invalid @nest value', context: localCtx});\n }\n mapping['@nest'] = nest;\n }\n\n // disallow aliasing @context and @preserve\n const id = mapping['@id'];\n if(id === '@context' || id === '@preserve') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; @context and @preserve cannot be aliased.',\n 'jsonld.SyntaxError', {code: 'invalid keyword alias', context: localCtx});\n }\n\n // Check for overriding protected terms\n if(previousMapping && previousMapping.protected && !overrideProtected) {\n // force new term to continue to be protected and see if the mappings would\n // be equal\n activeCtx.protected[term] = true;\n mapping.protected = true;\n if(!_deepCompare(previousMapping, mapping)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; tried to redefine a protected term.',\n 'jsonld.SyntaxError',\n {code: 'protected term redefinition', context: localCtx, term});\n }\n }\n};\n\n/**\n * Expands a string to a full IRI. The string may be a term, a prefix, a\n * relative IRI, or an absolute IRI. The associated absolute IRI will be\n * returned.\n *\n * @param activeCtx the current active context.\n * @param value the string to expand.\n * @param relativeTo options for how to resolve relative IRIs:\n * base: true to resolve against the base IRI, false not to.\n * vocab: true to concatenate after @vocab, false not to.\n * @param {Object} [options] - processing options.\n *\n * @return the expanded value.\n */\napi.expandIri = (activeCtx, value, relativeTo, options) => {\n return _expandIri(activeCtx, value, relativeTo, undefined, undefined,\n options);\n};\n\n/**\n * Expands a string to a full IRI. The string may be a term, a prefix, a\n * relative IRI, or an absolute IRI. The associated absolute IRI will be\n * returned.\n *\n * @param activeCtx the current active context.\n * @param value the string to expand.\n * @param relativeTo options for how to resolve relative IRIs:\n * base: true to resolve against the base IRI, false not to.\n * vocab: true to concatenate after @vocab, false not to.\n * @param localCtx the local context being processed (only given if called\n * during context processing).\n * @param defined a map for tracking cycles in context definitions (only given\n * if called during context processing).\n * @param {Object} [options] - processing options.\n *\n * @return the expanded value.\n */\nfunction _expandIri(activeCtx, value, relativeTo, localCtx, defined, options) {\n // already expanded\n if(value === null || !_isString(value) || api.isKeyword(value)) {\n return value;\n }\n\n // ignore non-keyword things that look like a keyword\n if(value.match(REGEX_KEYWORD)) {\n return null;\n }\n\n // define term dependency if not defined\n if(localCtx && localCtx.hasOwnProperty(value) &&\n defined.get(value) !== true) {\n api.createTermDefinition({\n activeCtx, localCtx, term: value, defined, options\n });\n }\n\n relativeTo = relativeTo || {};\n if(relativeTo.vocab) {\n const mapping = activeCtx.mappings.get(value);\n\n // value is explicitly ignored with a null mapping\n if(mapping === null) {\n return null;\n }\n\n if(_isObject(mapping) && '@id' in mapping) {\n // value is a term\n return mapping['@id'];\n }\n }\n\n // split value into prefix:suffix\n const colon = value.indexOf(':');\n if(colon > 0) {\n const prefix = value.substr(0, colon);\n const suffix = value.substr(colon + 1);\n\n // do not expand blank nodes (prefix of '_') or already-absolute\n // IRIs (suffix of '//')\n if(prefix === '_' || suffix.indexOf('//') === 0) {\n return value;\n }\n\n // prefix dependency not defined, define it\n if(localCtx && localCtx.hasOwnProperty(prefix)) {\n api.createTermDefinition({\n activeCtx, localCtx, term: prefix, defined, options\n });\n }\n\n // use mapping if prefix is defined\n const mapping = activeCtx.mappings.get(prefix);\n if(mapping && mapping._prefix) {\n return mapping['@id'] + suffix;\n }\n\n // already absolute IRI\n if(_isAbsoluteIri(value)) {\n return value;\n }\n }\n\n // A flag that captures whether the iri being expanded is\n // the value for an @type\n //let typeExpansion = false;\n\n //if(options !== undefined && options.typeExpansion !== undefined) {\n // typeExpansion = options.typeExpansion;\n //}\n\n if(relativeTo.vocab && '@vocab' in activeCtx) {\n // prepend vocab\n const prependedResult = activeCtx['@vocab'] + value;\n // FIXME: needed? may be better as debug event.\n /*\n if(options && options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'prepending @vocab during expansion',\n level: 'info',\n message: 'Prepending @vocab during expansion.',\n details: {\n type: '@vocab',\n vocab: activeCtx['@vocab'],\n value,\n result: prependedResult,\n typeExpansion\n }\n },\n options\n });\n }\n */\n // the null case preserves value as potentially relative\n value = prependedResult;\n } else if(relativeTo.base) {\n // prepend base\n let prependedResult;\n let base;\n if('@base' in activeCtx) {\n if(activeCtx['@base']) {\n base = prependBase(options.base, activeCtx['@base']);\n prependedResult = prependBase(base, value);\n } else {\n base = activeCtx['@base'];\n prependedResult = value;\n }\n } else {\n base = options.base;\n prependedResult = prependBase(options.base, value);\n }\n // FIXME: needed? may be better as debug event.\n /*\n if(options && options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'prepending @base during expansion',\n level: 'info',\n message: 'Prepending @base during expansion.',\n details: {\n type: '@base',\n base,\n value,\n result: prependedResult,\n typeExpansion\n }\n },\n options\n });\n }\n */\n // the null case preserves value as potentially relative\n value = prependedResult;\n }\n\n // FIXME: duplicate? needed? maybe just enable in a verbose debug mode\n /*\n if(!_isAbsoluteIri(value) && options && options.eventHandler) {\n // emit event indicating a relative IRI was found, which can result in it\n // being dropped when converting to other RDF representations\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative IRI after expansion',\n // FIXME: what level?\n level: 'warning',\n message: 'Relative IRI after expansion.',\n details: {\n relativeIri: value,\n typeExpansion\n }\n },\n options\n });\n // NOTE: relative reference events emitted at calling sites as needed\n }\n */\n\n return value;\n}\n\n/**\n * Gets the initial context.\n *\n * @param options the options to use:\n * [base] the document base IRI.\n *\n * @return the initial context.\n */\napi.getInitialContext = options => {\n const key = JSON.stringify({processingMode: options.processingMode});\n const cached = INITIAL_CONTEXT_CACHE.get(key);\n if(cached) {\n return cached;\n }\n\n const initialContext = {\n processingMode: options.processingMode,\n mappings: new Map(),\n inverse: null,\n getInverse: _createInverseContext,\n clone: _cloneActiveContext,\n revertToPreviousContext: _revertToPreviousContext,\n protected: {}\n };\n // TODO: consider using LRU cache instead\n if(INITIAL_CONTEXT_CACHE.size === INITIAL_CONTEXT_CACHE_MAX_SIZE) {\n // clear whole cache -- assumes scenario where the cache fills means\n // the cache isn't being used very efficiently anyway\n INITIAL_CONTEXT_CACHE.clear();\n }\n INITIAL_CONTEXT_CACHE.set(key, initialContext);\n return initialContext;\n\n /**\n * Generates an inverse context for use in the compaction algorithm, if\n * not already generated for the given active context.\n *\n * @return the inverse context.\n */\n function _createInverseContext() {\n const activeCtx = this;\n\n // lazily create inverse\n if(activeCtx.inverse) {\n return activeCtx.inverse;\n }\n const inverse = activeCtx.inverse = {};\n\n // variables for building fast CURIE map\n const fastCurieMap = activeCtx.fastCurieMap = {};\n const irisToTerms = {};\n\n // handle default language\n const defaultLanguage = (activeCtx['@language'] || '@none').toLowerCase();\n\n // handle default direction\n const defaultDirection = activeCtx['@direction'];\n\n // create term selections for each mapping in the context, ordered by\n // shortest and then lexicographically least\n const mappings = activeCtx.mappings;\n const terms = [...mappings.keys()].sort(_compareShortestLeast);\n for(const term of terms) {\n const mapping = mappings.get(term);\n if(mapping === null) {\n continue;\n }\n\n let container = mapping['@container'] || '@none';\n container = [].concat(container).sort().join('');\n\n if(mapping['@id'] === null) {\n continue;\n }\n // iterate over every IRI in the mapping\n const ids = _asArray(mapping['@id']);\n for(const iri of ids) {\n let entry = inverse[iri];\n const isKeyword = api.isKeyword(iri);\n\n if(!entry) {\n // initialize entry\n inverse[iri] = entry = {};\n\n if(!isKeyword && !mapping._termHasColon) {\n // init IRI to term map and fast CURIE prefixes\n irisToTerms[iri] = [term];\n const fastCurieEntry = {iri, terms: irisToTerms[iri]};\n if(iri[0] in fastCurieMap) {\n fastCurieMap[iri[0]].push(fastCurieEntry);\n } else {\n fastCurieMap[iri[0]] = [fastCurieEntry];\n }\n }\n } else if(!isKeyword && !mapping._termHasColon) {\n // add IRI to term match\n irisToTerms[iri].push(term);\n }\n\n // add new entry\n if(!entry[container]) {\n entry[container] = {\n '@language': {},\n '@type': {},\n '@any': {}\n };\n }\n entry = entry[container];\n _addPreferredTerm(term, entry['@any'], '@none');\n\n if(mapping.reverse) {\n // term is preferred for values using @reverse\n _addPreferredTerm(term, entry['@type'], '@reverse');\n } else if(mapping['@type'] === '@none') {\n _addPreferredTerm(term, entry['@any'], '@none');\n _addPreferredTerm(term, entry['@language'], '@none');\n _addPreferredTerm(term, entry['@type'], '@none');\n } else if('@type' in mapping) {\n // term is preferred for values using specific type\n _addPreferredTerm(term, entry['@type'], mapping['@type']);\n } else if('@language' in mapping && '@direction' in mapping) {\n // term is preferred for values using specific language and direction\n const language = mapping['@language'];\n const direction = mapping['@direction'];\n if(language && direction) {\n _addPreferredTerm(term, entry['@language'],\n `${language}_${direction}`.toLowerCase());\n } else if(language) {\n _addPreferredTerm(term, entry['@language'], language.toLowerCase());\n } else if(direction) {\n _addPreferredTerm(term, entry['@language'], `_${direction}`);\n } else {\n _addPreferredTerm(term, entry['@language'], '@null');\n }\n } else if('@language' in mapping) {\n _addPreferredTerm(term, entry['@language'],\n (mapping['@language'] || '@null').toLowerCase());\n } else if('@direction' in mapping) {\n if(mapping['@direction']) {\n _addPreferredTerm(term, entry['@language'],\n `_${mapping['@direction']}`);\n } else {\n _addPreferredTerm(term, entry['@language'], '@none');\n }\n } else if(defaultDirection) {\n _addPreferredTerm(term, entry['@language'], `_${defaultDirection}`);\n _addPreferredTerm(term, entry['@language'], '@none');\n _addPreferredTerm(term, entry['@type'], '@none');\n } else {\n // add entries for no type and no language\n _addPreferredTerm(term, entry['@language'], defaultLanguage);\n _addPreferredTerm(term, entry['@language'], '@none');\n _addPreferredTerm(term, entry['@type'], '@none');\n }\n }\n }\n\n // build fast CURIE map\n for(const key in fastCurieMap) {\n _buildIriMap(fastCurieMap, key, 1);\n }\n\n return inverse;\n }\n\n /**\n * Runs a recursive algorithm to build a lookup map for quickly finding\n * potential CURIEs.\n *\n * @param iriMap the map to build.\n * @param key the current key in the map to work on.\n * @param idx the index into the IRI to compare.\n */\n function _buildIriMap(iriMap, key, idx) {\n const entries = iriMap[key];\n const next = iriMap[key] = {};\n\n let iri;\n let letter;\n for(const entry of entries) {\n iri = entry.iri;\n if(idx >= iri.length) {\n letter = '';\n } else {\n letter = iri[idx];\n }\n if(letter in next) {\n next[letter].push(entry);\n } else {\n next[letter] = [entry];\n }\n }\n\n for(const key in next) {\n if(key === '') {\n continue;\n }\n _buildIriMap(next, key, idx + 1);\n }\n }\n\n /**\n * Adds the term for the given entry if not already added.\n *\n * @param term the term to add.\n * @param entry the inverse context typeOrLanguage entry to add to.\n * @param typeOrLanguageValue the key in the entry to add to.\n */\n function _addPreferredTerm(term, entry, typeOrLanguageValue) {\n if(!entry.hasOwnProperty(typeOrLanguageValue)) {\n entry[typeOrLanguageValue] = term;\n }\n }\n\n /**\n * Clones an active context, creating a child active context.\n *\n * @return a clone (child) of the active context.\n */\n function _cloneActiveContext() {\n const child = {};\n child.mappings = util.clone(this.mappings);\n child.clone = this.clone;\n child.inverse = null;\n child.getInverse = this.getInverse;\n child.protected = util.clone(this.protected);\n if(this.previousContext) {\n child.previousContext = this.previousContext.clone();\n }\n child.revertToPreviousContext = this.revertToPreviousContext;\n if('@base' in this) {\n child['@base'] = this['@base'];\n }\n if('@language' in this) {\n child['@language'] = this['@language'];\n }\n if('@vocab' in this) {\n child['@vocab'] = this['@vocab'];\n }\n return child;\n }\n\n /**\n * Reverts any type-scoped context in this active context to the previous\n * context.\n */\n function _revertToPreviousContext() {\n if(!this.previousContext) {\n return this;\n }\n return this.previousContext.clone();\n }\n};\n\n/**\n * Gets the value for the given active context key and type, null if none is\n * set or undefined if none is set and type is '@context'.\n *\n * @param ctx the active context.\n * @param key the context key.\n * @param [type] the type of value to get (eg: '@id', '@type'), if not\n * specified gets the entire entry for a key, null if not found.\n *\n * @return the value, null, or undefined.\n */\napi.getContextValue = (ctx, key, type) => {\n // invalid key\n if(key === null) {\n if(type === '@context') {\n return undefined;\n }\n return null;\n }\n\n // get specific entry information\n if(ctx.mappings.has(key)) {\n const entry = ctx.mappings.get(key);\n\n if(_isUndefined(type)) {\n // return whole entry\n return entry;\n }\n if(entry.hasOwnProperty(type)) {\n // return entry value for type\n return entry[type];\n }\n }\n\n // get default language\n if(type === '@language' && type in ctx) {\n return ctx[type];\n }\n\n // get default direction\n if(type === '@direction' && type in ctx) {\n return ctx[type];\n }\n\n if(type === '@context') {\n return undefined;\n }\n return null;\n};\n\n/**\n * Processing Mode check.\n *\n * @param activeCtx the current active context.\n * @param version the string or numeric version to check.\n *\n * @return boolean.\n */\napi.processingMode = (activeCtx, version) => {\n if(version.toString() >= '1.1') {\n return !activeCtx.processingMode ||\n activeCtx.processingMode >= 'json-ld-' + version.toString();\n } else {\n return activeCtx.processingMode === 'json-ld-1.0';\n }\n};\n\n/**\n * Returns whether or not the given value is a keyword.\n *\n * @param v the value to check.\n *\n * @return true if the value is a keyword, false if not.\n */\napi.isKeyword = v => {\n if(!_isString(v) || v[0] !== '@') {\n return false;\n }\n switch(v) {\n case '@base':\n case '@container':\n case '@context':\n case '@default':\n case '@direction':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@included':\n case '@index':\n case '@json':\n case '@language':\n case '@list':\n case '@nest':\n case '@none':\n case '@omitDefault':\n case '@prefix':\n case '@preserve':\n case '@protected':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@version':\n case '@vocab':\n return true;\n }\n return false;\n};\n\nfunction _deepCompare(x1, x2) {\n // compare `null` or primitive types directly\n if((!(x1 && typeof x1 === 'object')) ||\n (!(x2 && typeof x2 === 'object'))) {\n return x1 === x2;\n }\n // x1 and x2 are objects (also potentially arrays)\n const x1Array = Array.isArray(x1);\n if(x1Array !== Array.isArray(x2)) {\n return false;\n }\n if(x1Array) {\n if(x1.length !== x2.length) {\n return false;\n }\n for(let i = 0; i < x1.length; ++i) {\n if(!_deepCompare(x1[i], x2[i])) {\n return false;\n }\n }\n return true;\n }\n // x1 and x2 are non-array objects\n const k1s = Object.keys(x1);\n const k2s = Object.keys(x2);\n if(k1s.length !== k2s.length) {\n return false;\n }\n for(const k1 in x1) {\n let v1 = x1[k1];\n let v2 = x2[k1];\n // special case: `@container` can be in any order\n if(k1 === '@container') {\n if(Array.isArray(v1) && Array.isArray(v2)) {\n v1 = v1.slice().sort();\n v2 = v2.slice().sort();\n }\n }\n if(!_deepCompare(v1, v2)) {\n return false;\n }\n }\n return true;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {parseLinkHeader, buildHeaders} = require('../util');\nconst {LINK_HEADER_CONTEXT} = require('../constants');\nconst JsonLdError = require('../JsonLdError');\nconst RequestQueue = require('../RequestQueue');\nconst {prependBase} = require('../url');\n\nconst REGEX_LINK_HEADER = /(^|(\\r\\n))link:/i;\n\n/**\n * Creates a built-in XMLHttpRequest document loader.\n *\n * @param options the options to use:\n * secure: require all URLs to use HTTPS.\n * headers: an object (map) of headers which will be passed as request\n * headers for the requested document. Accept is not allowed.\n * [xhr]: the XMLHttpRequest API to use.\n *\n * @return the XMLHttpRequest document loader.\n */\nmodule.exports = ({\n secure,\n headers = {},\n xhr\n} = {headers: {}}) => {\n headers = buildHeaders(headers);\n const queue = new RequestQueue();\n return queue.wrapLoader(loader);\n\n async function loader(url) {\n if(url.indexOf('http:') !== 0 && url.indexOf('https:') !== 0) {\n throw new JsonLdError(\n 'URL could not be dereferenced; only \"http\" and \"https\" URLs are ' +\n 'supported.',\n 'jsonld.InvalidUrl', {code: 'loading document failed', url});\n }\n if(secure && url.indexOf('https') !== 0) {\n throw new JsonLdError(\n 'URL could not be dereferenced; secure mode is enabled and ' +\n 'the URL\\'s scheme is not \"https\".',\n 'jsonld.InvalidUrl', {code: 'loading document failed', url});\n }\n\n let req;\n try {\n req = await _get(xhr, url, headers);\n } catch(e) {\n throw new JsonLdError(\n 'URL could not be dereferenced, an error occurred.',\n 'jsonld.LoadDocumentError',\n {code: 'loading document failed', url, cause: e});\n }\n\n if(req.status >= 400) {\n throw new JsonLdError(\n 'URL could not be dereferenced: ' + req.statusText,\n 'jsonld.LoadDocumentError', {\n code: 'loading document failed',\n url,\n httpStatusCode: req.status\n });\n }\n\n let doc = {contextUrl: null, documentUrl: url, document: req.response};\n let alternate = null;\n\n // handle Link Header (avoid unsafe header warning by existence testing)\n const contentType = req.getResponseHeader('Content-Type');\n let linkHeader;\n if(REGEX_LINK_HEADER.test(req.getAllResponseHeaders())) {\n linkHeader = req.getResponseHeader('Link');\n }\n if(linkHeader && contentType !== 'application/ld+json') {\n // only 1 related link header permitted\n const linkHeaders = parseLinkHeader(linkHeader);\n const linkedContext = linkHeaders[LINK_HEADER_CONTEXT];\n if(Array.isArray(linkedContext)) {\n throw new JsonLdError(\n 'URL could not be dereferenced, it has more than one ' +\n 'associated HTTP Link Header.',\n 'jsonld.InvalidUrl',\n {code: 'multiple context link headers', url});\n }\n if(linkedContext) {\n doc.contextUrl = linkedContext.target;\n }\n\n // \"alternate\" link header is a redirect\n alternate = linkHeaders.alternate;\n if(alternate &&\n alternate.type == 'application/ld+json' &&\n !(contentType || '').match(/^application\\/(\\w*\\+)?json$/)) {\n doc = await loader(prependBase(url, alternate.target));\n }\n }\n\n return doc;\n }\n};\n\nfunction _get(xhr, url, headers) {\n xhr = xhr || XMLHttpRequest;\n const req = new xhr();\n return new Promise((resolve, reject) => {\n req.onload = () => resolve(req);\n req.onerror = err => reject(err);\n req.open('GET', url, true);\n for(const k in headers) {\n req.setRequestHeader(k, headers[k]);\n }\n req.send();\n });\n}\n","/*\n * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray\n} = require('./types');\n\nconst {\n asArray: _asArray\n} = require('./util');\n\nconst api = {};\nmodule.exports = api;\n\n// default handler, store as null or an array\n// exposed to allow fast external pre-handleEvent() checks\napi.defaultEventHandler = null;\n\n/**\n * Setup event handler.\n *\n * Return an array event handler constructed from an optional safe mode\n * handler, an optional options event handler, and an optional default handler.\n *\n * @param {object} options - processing options\n * {function|object|array} [eventHandler] - an event handler.\n *\n * @return an array event handler.\n */\napi.setupEventHandler = ({options = {}}) => {\n // build in priority order\n const eventHandler = [].concat(\n options.safe ? api.safeEventHandler : [],\n options.eventHandler ? _asArray(options.eventHandler) : [],\n api.defaultEventHandler ? api.defaultEventHandler : []\n );\n // null if no handlers\n return eventHandler.length === 0 ? null : eventHandler;\n};\n\n/**\n * Handle an event.\n *\n * Top level APIs have a common 'eventHandler' option. This option can be a\n * function, array of functions, object mapping event.code to functions (with a\n * default to call next()), or any combination of such handlers. Handlers will\n * be called with an object with an 'event' entry and a 'next' function. Custom\n * handlers should process the event as appropriate. The 'next()' function\n * should be called to let the next handler process the event.\n *\n * NOTE: Only call this function if options.eventHandler is set and is an\n * array of hanlers. This is an optimization. Callers are expected to check\n * for an event handler before constructing events and calling this function.\n *\n * @param {object} event - event structure:\n * {string} code - event code\n * {string} level - severity level, one of: ['warning']\n * {string} message - human readable message\n * {object} details - event specific details\n * @param {object} options - processing options\n * {array} eventHandler - an event handler array.\n */\napi.handleEvent = ({\n event,\n options\n}) => {\n _handle({event, handlers: options.eventHandler});\n};\n\nfunction _handle({event, handlers}) {\n let doNext = true;\n for(let i = 0; doNext && i < handlers.length; ++i) {\n doNext = false;\n const handler = handlers[i];\n if(_isArray(handler)) {\n doNext = _handle({event, handlers: handler});\n } else if(typeof handler === 'function') {\n handler({event, next: () => {\n doNext = true;\n }});\n } else if(typeof handler === 'object') {\n if(event.code in handler) {\n handler[event.code]({event, next: () => {\n doNext = true;\n }});\n } else {\n doNext = true;\n }\n } else {\n throw new JsonLdError(\n 'Invalid event handler.',\n 'jsonld.InvalidEventHandler',\n {event});\n }\n }\n return doNext;\n}\n\nconst _notSafeEventCodes = new Set([\n 'empty object',\n 'free-floating scalar',\n 'invalid @language value',\n 'invalid property',\n // NOTE: spec edge case\n 'null @id value',\n 'null @value value',\n 'object with only @id',\n 'object with only @language',\n 'object with only @list',\n 'object with only @value',\n 'relative @id reference',\n 'relative @type reference',\n 'relative @vocab reference',\n 'reserved @id value',\n 'reserved @reverse value',\n 'reserved term',\n // toRDF\n 'blank node predicate',\n 'relative graph reference',\n 'relative object reference',\n 'relative predicate reference',\n 'relative subject reference'\n]);\n\n// safe handler that rejects unsafe warning conditions\napi.safeEventHandler = function safeEventHandler({event, next}) {\n // fail on all unsafe warnings\n if(event.level === 'warning' && _notSafeEventCodes.has(event.code)) {\n throw new JsonLdError(\n 'Safe mode validation error.',\n 'jsonld.ValidationError',\n {event}\n );\n }\n next();\n};\n\n// logs all events and continues\napi.logEventHandler = function logEventHandler({event, next}) {\n console.log(`EVENT: ${event.message}`, {event});\n next();\n};\n\n// log 'warning' level events\napi.logWarningEventHandler = function logWarningEventHandler({event, next}) {\n if(event.level === 'warning') {\n console.warn(`WARNING: ${event.message}`, {event});\n }\n next();\n};\n\n// fallback to throw errors for any unhandled events\napi.unhandledEventHandler = function unhandledEventHandler({event}) {\n throw new JsonLdError(\n 'No handler for event.',\n 'jsonld.UnhandledEvent',\n {event}\n );\n};\n\n/**\n * Set default event handler.\n *\n * By default, all event are unhandled. It is recommended to pass in an\n * eventHandler into each call. However, this call allows using a default\n * eventHandler when one is not otherwise provided.\n *\n * @param {object} options - default handler options:\n * {function|object|array} eventHandler - a default event handler.\n * falsey to unset.\n */\napi.setDefaultEventHandler = function({eventHandler} = {}) {\n api.defaultEventHandler = eventHandler ? _asArray(eventHandler) : null;\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isEmptyObject: _isEmptyObject,\n isString: _isString,\n isUndefined: _isUndefined\n} = require('./types');\n\nconst {\n isList: _isList,\n isValue: _isValue,\n isGraph: _isGraph,\n isSubject: _isSubject\n} = require('./graphTypes');\n\nconst {\n expandIri: _expandIri,\n getContextValue: _getContextValue,\n isKeyword: _isKeyword,\n process: _processContext,\n processingMode: _processingMode\n} = require('./context');\n\nconst {\n isAbsolute: _isAbsoluteIri\n} = require('./url');\n\nconst {\n REGEX_BCP47,\n REGEX_KEYWORD,\n addValue: _addValue,\n asArray: _asArray,\n getValues: _getValues,\n validateTypeValue: _validateTypeValue\n} = require('./util');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Recursively expands an element using the given context. Any context in\n * the element will be removed. All context URLs must have been retrieved\n * before calling this method.\n *\n * @param activeCtx the context to use.\n * @param activeProperty the property for the element, null for none.\n * @param element the element to expand.\n * @param options the expansion options.\n * @param insideList true if the element is a list, false if not.\n * @param insideIndex true if the element is inside an index container,\n * false if not.\n * @param typeScopedContext an optional type-scoped active context for\n * expanding values of nodes that were expressed according to\n * a type-scoped context.\n *\n * @return a Promise that resolves to the expanded value.\n */\napi.expand = async ({\n activeCtx,\n activeProperty = null,\n element,\n options = {},\n insideList = false,\n insideIndex = false,\n typeScopedContext = null\n}) => {\n // nothing to expand\n if(element === null || element === undefined) {\n return null;\n }\n\n // disable framing if activeProperty is @default\n if(activeProperty === '@default') {\n options = Object.assign({}, options, {isFrame: false});\n }\n\n if(!_isArray(element) && !_isObject(element)) {\n // drop free-floating scalars that are not in lists\n if(!insideList && (activeProperty === null ||\n _expandIri(activeCtx, activeProperty, {vocab: true},\n options) === '@graph')) {\n // FIXME\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'free-floating scalar',\n level: 'warning',\n message: 'Dropping free-floating scalar not in a list.',\n details: {\n value: element\n //activeProperty\n //insideList\n }\n },\n options\n });\n }\n return null;\n }\n\n // expand element according to value expansion rules\n return _expandValue({activeCtx, activeProperty, value: element, options});\n }\n\n // recursively expand array\n if(_isArray(element)) {\n let rval = [];\n const container = _getContextValue(\n activeCtx, activeProperty, '@container') || [];\n insideList = insideList || container.includes('@list');\n for(let i = 0; i < element.length; ++i) {\n // expand element\n let e = await api.expand({\n activeCtx,\n activeProperty,\n element: element[i],\n options,\n insideIndex,\n typeScopedContext\n });\n if(insideList && _isArray(e)) {\n e = {'@list': e};\n }\n\n if(e === null) {\n // FIXME: add debug event?\n //unmappedValue: element[i],\n //activeProperty,\n //parent: element,\n //index: i,\n //expandedParent: rval,\n //insideList\n\n // NOTE: no-value events emitted at calling sites as needed\n continue;\n }\n\n if(_isArray(e)) {\n rval = rval.concat(e);\n } else {\n rval.push(e);\n }\n }\n return rval;\n }\n\n // recursively expand object:\n\n // first, expand the active property\n const expandedActiveProperty = _expandIri(\n activeCtx, activeProperty, {vocab: true}, options);\n\n // Get any property-scoped context for activeProperty\n const propertyScopedCtx =\n _getContextValue(activeCtx, activeProperty, '@context');\n\n // second, determine if any type-scoped context should be reverted; it\n // should only be reverted when the following are all true:\n // 1. `element` is not a value or subject reference\n // 2. `insideIndex` is false\n typeScopedContext = typeScopedContext ||\n (activeCtx.previousContext ? activeCtx : null);\n let keys = Object.keys(element).sort();\n let mustRevert = !insideIndex;\n if(mustRevert && typeScopedContext && keys.length <= 2 &&\n !keys.includes('@context')) {\n for(const key of keys) {\n const expandedProperty = _expandIri(\n typeScopedContext, key, {vocab: true}, options);\n if(expandedProperty === '@value') {\n // value found, ensure type-scoped context is used to expand it\n mustRevert = false;\n activeCtx = typeScopedContext;\n break;\n }\n if(expandedProperty === '@id' && keys.length === 1) {\n // subject reference found, do not revert\n mustRevert = false;\n break;\n }\n }\n }\n\n if(mustRevert) {\n // revert type scoped context\n activeCtx = activeCtx.revertToPreviousContext();\n }\n\n // apply property-scoped context after reverting term-scoped context\n if(!_isUndefined(propertyScopedCtx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: propertyScopedCtx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n // if element has a context, process it\n if('@context' in element) {\n activeCtx = await _processContext(\n {activeCtx, localCtx: element['@context'], options});\n }\n\n // set the type-scoped context to the context on input, for use later\n typeScopedContext = activeCtx;\n\n // Remember the first key found expanding to @type\n let typeKey = null;\n\n // look for scoped contexts on `@type`\n for(const key of keys) {\n const expandedProperty = _expandIri(activeCtx, key, {vocab: true}, options);\n if(expandedProperty === '@type') {\n // set scoped contexts from @type\n // avoid sorting if possible\n typeKey = typeKey || key;\n const value = element[key];\n const types =\n Array.isArray(value) ?\n (value.length > 1 ? value.slice().sort() : value) : [value];\n for(const type of types) {\n const ctx = _getContextValue(typeScopedContext, type, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n options,\n propagate: false\n });\n }\n }\n }\n }\n\n // process each key and value in element, ignoring @nest content\n let rval = {};\n await _expandObject({\n activeCtx,\n activeProperty,\n expandedActiveProperty,\n element,\n expandedParent: rval,\n options,\n insideList,\n typeKey,\n typeScopedContext\n });\n\n // get property count on expanded output\n keys = Object.keys(rval);\n let count = keys.length;\n\n if('@value' in rval) {\n // @value must only have @language or @type\n if('@type' in rval && ('@language' in rval || '@direction' in rval)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an element containing \"@value\" may not ' +\n 'contain both \"@type\" and either \"@language\" or \"@direction\".',\n 'jsonld.SyntaxError', {code: 'invalid value object', element: rval});\n }\n let validCount = count - 1;\n if('@type' in rval) {\n validCount -= 1;\n }\n if('@index' in rval) {\n validCount -= 1;\n }\n if('@language' in rval) {\n validCount -= 1;\n }\n if('@direction' in rval) {\n validCount -= 1;\n }\n if(validCount !== 0) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an element containing \"@value\" may only ' +\n 'have an \"@index\" property and either \"@type\" ' +\n 'or either or both \"@language\" or \"@direction\".',\n 'jsonld.SyntaxError', {code: 'invalid value object', element: rval});\n }\n const values = rval['@value'] === null ? [] : _asArray(rval['@value']);\n const types = _getValues(rval, '@type');\n\n // drop null @values\n if(_processingMode(activeCtx, 1.1) && types.includes('@json') &&\n types.length === 1) {\n // Any value of @value is okay if @type: @json\n } else if(values.length === 0) {\n // FIXME\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'null @value value',\n level: 'warning',\n message: 'Dropping null @value value.',\n details: {\n value: rval\n }\n },\n options\n });\n }\n rval = null;\n } else if(!values.every(v => (_isString(v) || _isEmptyObject(v))) &&\n '@language' in rval) {\n // if @language is present, @value must be a string\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; only strings may be language-tagged.',\n 'jsonld.SyntaxError',\n {code: 'invalid language-tagged value', element: rval});\n } else if(!types.every(t =>\n (_isAbsoluteIri(t) && !(_isString(t) && t.indexOf('_:') === 0) ||\n _isEmptyObject(t)))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; an element containing \"@value\" and \"@type\" ' +\n 'must have an absolute IRI for the value of \"@type\".',\n 'jsonld.SyntaxError', {code: 'invalid typed value', element: rval});\n }\n } else if('@type' in rval && !_isArray(rval['@type'])) {\n // convert @type to an array\n rval['@type'] = [rval['@type']];\n } else if('@set' in rval || '@list' in rval) {\n // handle @set and @list\n if(count > 1 && !(count === 2 && '@index' in rval)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; if an element has the property \"@set\" ' +\n 'or \"@list\", then it can have at most one other property that is ' +\n '\"@index\".', 'jsonld.SyntaxError',\n {code: 'invalid set or list object', element: rval});\n }\n // optimize away @set\n if('@set' in rval) {\n rval = rval['@set'];\n keys = Object.keys(rval);\n count = keys.length;\n }\n } else if(count === 1 && '@language' in rval) {\n // drop objects with only @language\n // FIXME\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'object with only @language',\n level: 'warning',\n message: 'Dropping object with only @language.',\n details: {\n value: rval\n }\n },\n options\n });\n }\n rval = null;\n }\n\n // drop certain top-level objects that do not occur in lists\n if(_isObject(rval) &&\n !options.keepFreeFloatingNodes && !insideList &&\n (activeProperty === null || expandedActiveProperty === '@graph')) {\n // drop empty object, top-level @value/@list, or object with only @id\n if(count === 0 || '@value' in rval || '@list' in rval ||\n (count === 1 && '@id' in rval)) {\n // FIXME\n if(options.eventHandler) {\n // FIXME: one event or diff event for empty, @v/@l, {@id}?\n let code;\n let message;\n if(count === 0) {\n code = 'empty object';\n message = 'Dropping empty object.';\n } else if('@value' in rval) {\n code = 'object with only @value';\n message = 'Dropping object with only @value.';\n } else if('@list' in rval) {\n code = 'object with only @list';\n message = 'Dropping object with only @list.';\n } else if(count === 1 && '@id' in rval) {\n code = 'object with only @id';\n message = 'Dropping object with only @id.';\n }\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code,\n level: 'warning',\n message,\n details: {\n value: rval\n }\n },\n options\n });\n }\n rval = null;\n }\n }\n\n return rval;\n};\n\n/**\n * Expand each key and value of element adding to result\n *\n * @param activeCtx the context to use.\n * @param activeProperty the property for the element.\n * @param expandedActiveProperty the expansion of activeProperty\n * @param element the element to expand.\n * @param expandedParent the expanded result into which to add values.\n * @param options the expansion options.\n * @param insideList true if the element is a list, false if not.\n * @param typeKey first key found expanding to @type.\n * @param typeScopedContext the context before reverting.\n */\nasync function _expandObject({\n activeCtx,\n activeProperty,\n expandedActiveProperty,\n element,\n expandedParent,\n options = {},\n insideList,\n typeKey,\n typeScopedContext\n}) {\n const keys = Object.keys(element).sort();\n const nests = [];\n let unexpandedValue;\n\n // Figure out if this is the type for a JSON literal\n const isJsonType = element[typeKey] &&\n _expandIri(activeCtx,\n (_isArray(element[typeKey]) ? element[typeKey][0] : element[typeKey]),\n {vocab: true}, {\n ...options,\n typeExpansion: true\n }) === '@json';\n\n for(const key of keys) {\n let value = element[key];\n let expandedValue;\n\n // skip @context\n if(key === '@context') {\n continue;\n }\n\n // expand property\n const expandedProperty = _expandIri(activeCtx, key, {vocab: true}, options);\n\n // drop non-absolute IRI keys that aren't keywords\n if(expandedProperty === null ||\n !(_isAbsoluteIri(expandedProperty) || _isKeyword(expandedProperty))) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid property',\n level: 'warning',\n message: 'Dropping property that did not expand into an ' +\n 'absolute IRI or keyword.',\n details: {\n property: key,\n expandedProperty\n }\n },\n options\n });\n }\n continue;\n }\n\n if(_isKeyword(expandedProperty)) {\n if(expandedActiveProperty === '@reverse') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a keyword cannot be used as a @reverse ' +\n 'property.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property map', value});\n }\n if(expandedProperty in expandedParent &&\n expandedProperty !== '@included' &&\n expandedProperty !== '@type') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; colliding keywords detected.',\n 'jsonld.SyntaxError',\n {code: 'colliding keywords', keyword: expandedProperty});\n }\n }\n\n // syntax error if @id is not a string\n if(expandedProperty === '@id') {\n if(!_isString(value)) {\n if(!options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value must a string.',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n if(_isObject(value)) {\n // empty object is a wildcard\n if(!_isEmptyObject(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value an empty object or array ' +\n 'of strings, if framing',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n } else if(_isArray(value)) {\n if(!value.every(v => _isString(v))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value an empty object or array ' +\n 'of strings, if framing',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n } else {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@id\" value an empty object or array ' +\n 'of strings, if framing',\n 'jsonld.SyntaxError', {code: 'invalid @id value', value});\n }\n }\n\n _addValue(\n expandedParent, '@id',\n _asArray(value).map(v => {\n if(_isString(v)) {\n const ve = _expandIri(activeCtx, v, {base: true}, options);\n if(options.eventHandler) {\n if(ve === null) {\n // NOTE: spec edge case\n // See https://github.com/w3c/json-ld-api/issues/480\n if(v === null) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'null @id value',\n level: 'warning',\n message: 'Null @id found.',\n details: {\n id: v\n }\n },\n options\n });\n } else {\n // matched KEYWORD regex\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @id value',\n level: 'warning',\n message: 'Reserved @id found.',\n details: {\n id: v\n }\n },\n options\n });\n }\n } else if(!_isAbsoluteIri(ve)) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative @id reference',\n level: 'warning',\n message: 'Relative @id reference found.',\n details: {\n id: v,\n expandedId: ve\n }\n },\n options\n });\n }\n }\n return ve;\n }\n return v;\n }),\n {propertyIsArray: options.isFrame});\n continue;\n }\n\n if(expandedProperty === '@type') {\n // if framing, can be a default object, but need to expand\n // key to determine that\n if(_isObject(value)) {\n value = Object.fromEntries(Object.entries(value).map(([k, v]) => [\n _expandIri(typeScopedContext, k, {vocab: true}),\n _asArray(v).map(vv =>\n _expandIri(typeScopedContext, vv, {base: true, vocab: true},\n {...options, typeExpansion: true})\n )\n ]));\n }\n _validateTypeValue(value, options.isFrame);\n _addValue(\n expandedParent, '@type',\n _asArray(value).map(v => {\n if(_isString(v)) {\n const ve = _expandIri(typeScopedContext, v,\n {base: true, vocab: true},\n {...options, typeExpansion: true});\n if(ve !== '@json' && !_isAbsoluteIri(ve)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative @type reference',\n level: 'warning',\n message: 'Relative @type reference found.',\n details: {\n type: v\n }\n },\n options\n });\n }\n }\n return ve;\n }\n return v;\n }),\n {propertyIsArray: options.isFrame});\n continue;\n }\n\n // Included blocks are treated as an array of separate object nodes sharing\n // the same referencing active_property.\n // For 1.0, it is skipped as are other unknown keywords\n if(expandedProperty === '@included' && _processingMode(activeCtx, 1.1)) {\n const includedResult = _asArray(await api.expand({\n activeCtx,\n activeProperty,\n element: value,\n options\n }));\n\n // Expanded values must be node objects\n if(!includedResult.every(v => _isSubject(v))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; ' +\n 'values of @included must expand to node objects.',\n 'jsonld.SyntaxError', {code: 'invalid @included value', value});\n }\n\n _addValue(\n expandedParent, '@included', includedResult, {propertyIsArray: true});\n continue;\n }\n\n // @graph must be an array or an object\n if(expandedProperty === '@graph' &&\n !(_isObject(value) || _isArray(value))) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@graph\" value must not be an ' +\n 'object or an array.',\n 'jsonld.SyntaxError', {code: 'invalid @graph value', value});\n }\n\n if(expandedProperty === '@value') {\n // capture value for later\n // \"colliding keywords\" check prevents this from being set twice\n unexpandedValue = value;\n if(isJsonType && _processingMode(activeCtx, 1.1)) {\n // no coercion to array, and retain all values\n expandedParent['@value'] = value;\n } else {\n _addValue(\n expandedParent, '@value', value, {propertyIsArray: options.isFrame});\n }\n continue;\n }\n\n // @language must be a string\n // it should match BCP47\n if(expandedProperty === '@language') {\n if(value === null) {\n // drop null @language values, they expand as if they didn't exist\n continue;\n }\n if(!_isString(value) && !options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@language\" value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid language-tagged string', value});\n }\n // ensure language value is lowercase\n value = _asArray(value).map(v => _isString(v) ? v.toLowerCase() : v);\n\n // ensure language tag matches BCP47\n for(const language of value) {\n if(_isString(language) && !language.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language\n }\n },\n options\n });\n }\n }\n }\n\n _addValue(\n expandedParent, '@language', value, {propertyIsArray: options.isFrame});\n continue;\n }\n\n // @direction must be \"ltr\" or \"rtl\"\n if(expandedProperty === '@direction') {\n if(!_isString(value) && !options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@direction\" value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', value});\n }\n\n value = _asArray(value);\n\n // ensure direction is \"ltr\" or \"rtl\"\n for(const dir of value) {\n if(_isString(dir) && dir !== 'ltr' && dir !== 'rtl') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@direction\" must be \"ltr\" or \"rtl\".',\n 'jsonld.SyntaxError',\n {code: 'invalid base direction', value});\n }\n }\n\n _addValue(\n expandedParent, '@direction', value,\n {propertyIsArray: options.isFrame});\n continue;\n }\n\n // @index must be a string\n if(expandedProperty === '@index') {\n if(!_isString(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@index\" value must be a string.',\n 'jsonld.SyntaxError',\n {code: 'invalid @index value', value});\n }\n _addValue(expandedParent, '@index', value);\n continue;\n }\n\n // @reverse must be an object\n if(expandedProperty === '@reverse') {\n if(!_isObject(value)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@reverse\" value must be an object.',\n 'jsonld.SyntaxError', {code: 'invalid @reverse value', value});\n }\n\n expandedValue = await api.expand({\n activeCtx,\n activeProperty:\n '@reverse',\n element: value,\n options\n });\n // properties double-reversed\n if('@reverse' in expandedValue) {\n for(const property in expandedValue['@reverse']) {\n _addValue(\n expandedParent, property, expandedValue['@reverse'][property],\n {propertyIsArray: true});\n }\n }\n\n // FIXME: can this be merged with code below to simplify?\n // merge in all reversed properties\n let reverseMap = expandedParent['@reverse'] || null;\n for(const property in expandedValue) {\n if(property === '@reverse') {\n continue;\n }\n if(reverseMap === null) {\n reverseMap = expandedParent['@reverse'] = {};\n }\n _addValue(reverseMap, property, [], {propertyIsArray: true});\n const items = expandedValue[property];\n for(let ii = 0; ii < items.length; ++ii) {\n const item = items[ii];\n if(_isValue(item) || _isList(item)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@reverse\" value must not be a ' +\n '@value or an @list.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property value', value: expandedValue});\n }\n _addValue(reverseMap, property, item, {propertyIsArray: true});\n }\n }\n\n continue;\n }\n\n // nested keys\n if(expandedProperty === '@nest') {\n nests.push(key);\n continue;\n }\n\n // use potential scoped context for key\n let termCtx = activeCtx;\n const ctx = _getContextValue(activeCtx, key, '@context');\n if(!_isUndefined(ctx)) {\n termCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n propagate: true,\n overrideProtected: true,\n options\n });\n }\n\n const container = _getContextValue(termCtx, key, '@container') || [];\n\n if(container.includes('@language') && _isObject(value)) {\n const direction = _getContextValue(termCtx, key, '@direction');\n // handle language map container (skip if value is not an object)\n expandedValue = _expandLanguageMap(termCtx, value, direction, options);\n } else if(container.includes('@index') && _isObject(value)) {\n // handle index container (skip if value is not an object)\n const asGraph = container.includes('@graph');\n const indexKey = _getContextValue(termCtx, key, '@index') || '@index';\n const propertyIndex = indexKey !== '@index' &&\n _expandIri(activeCtx, indexKey, {vocab: true}, options);\n\n expandedValue = await _expandIndexMap({\n activeCtx: termCtx,\n options,\n activeProperty: key,\n value,\n asGraph,\n indexKey,\n propertyIndex\n });\n } else if(container.includes('@id') && _isObject(value)) {\n // handle id container (skip if value is not an object)\n const asGraph = container.includes('@graph');\n expandedValue = await _expandIndexMap({\n activeCtx: termCtx,\n options,\n activeProperty: key,\n value,\n asGraph,\n indexKey: '@id'\n });\n } else if(container.includes('@type') && _isObject(value)) {\n // handle type container (skip if value is not an object)\n expandedValue = await _expandIndexMap({\n // since container is `@type`, revert type scoped context when expanding\n activeCtx: termCtx.revertToPreviousContext(),\n options,\n activeProperty: key,\n value,\n asGraph: false,\n indexKey: '@type'\n });\n } else {\n // recurse into @list or @set\n const isList = (expandedProperty === '@list');\n if(isList || expandedProperty === '@set') {\n let nextActiveProperty = activeProperty;\n if(isList && expandedActiveProperty === '@graph') {\n nextActiveProperty = null;\n }\n expandedValue = await api.expand({\n activeCtx: termCtx,\n activeProperty: nextActiveProperty,\n element: value,\n options,\n insideList: isList\n });\n } else if(\n _getContextValue(activeCtx, key, '@type') === '@json') {\n expandedValue = {\n '@type': '@json',\n '@value': value\n };\n } else {\n // recursively expand value with key as new active property\n expandedValue = await api.expand({\n activeCtx: termCtx,\n activeProperty: key,\n element: value,\n options,\n insideList: false\n });\n }\n }\n\n // drop null values if property is not @value\n if(expandedValue === null && expandedProperty !== '@value') {\n // FIXME: event?\n //unmappedValue: value,\n //expandedProperty,\n //key,\n continue;\n }\n\n // convert expanded value to @list if container specifies it\n if(expandedProperty !== '@list' && !_isList(expandedValue) &&\n container.includes('@list')) {\n // ensure expanded value in @list is an array\n expandedValue = {'@list': _asArray(expandedValue)};\n }\n\n // convert expanded value to @graph if container specifies it\n // and value is not, itself, a graph\n // index cases handled above\n if(container.includes('@graph') &&\n !container.some(key => key === '@id' || key === '@index')) {\n // ensure expanded values are arrays\n expandedValue = _asArray(expandedValue)\n .map(v => ({'@graph': _asArray(v)}));\n }\n\n // FIXME: can this be merged with code above to simplify?\n // merge in reverse properties\n if(termCtx.mappings.has(key) && termCtx.mappings.get(key).reverse) {\n const reverseMap =\n expandedParent['@reverse'] = expandedParent['@reverse'] || {};\n expandedValue = _asArray(expandedValue);\n for(let ii = 0; ii < expandedValue.length; ++ii) {\n const item = expandedValue[ii];\n if(_isValue(item) || _isList(item)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@reverse\" value must not be a ' +\n '@value or an @list.', 'jsonld.SyntaxError',\n {code: 'invalid reverse property value', value: expandedValue});\n }\n _addValue(reverseMap, expandedProperty, item, {propertyIsArray: true});\n }\n continue;\n }\n\n // add value for property\n // special keywords handled above\n _addValue(expandedParent, expandedProperty, expandedValue, {\n propertyIsArray: true\n });\n }\n\n // @value must not be an object or an array (unless framing) or if @type is\n // @json\n if('@value' in expandedParent) {\n if(expandedParent['@type'] === '@json' && _processingMode(activeCtx, 1.1)) {\n // allow any value, to be verified when the object is fully expanded and\n // the @type is @json.\n } else if((_isObject(unexpandedValue) || _isArray(unexpandedValue)) &&\n !options.isFrame) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@value\" value must not be an ' +\n 'object or an array.',\n 'jsonld.SyntaxError',\n {code: 'invalid value object value', value: unexpandedValue});\n }\n }\n\n // expand each nested key\n for(const key of nests) {\n const nestedValues = _isArray(element[key]) ? element[key] : [element[key]];\n for(const nv of nestedValues) {\n if(!_isObject(nv) || Object.keys(nv).some(k =>\n _expandIri(activeCtx, k, {vocab: true}, options) === '@value')) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; nested value must be a node object.',\n 'jsonld.SyntaxError',\n {code: 'invalid @nest value', value: nv});\n }\n await _expandObject({\n activeCtx,\n activeProperty,\n expandedActiveProperty,\n element: nv,\n expandedParent,\n options,\n insideList,\n typeScopedContext,\n typeKey\n });\n }\n }\n}\n\n/**\n * Expands the given value by using the coercion and keyword rules in the\n * given context.\n *\n * @param activeCtx the active context to use.\n * @param activeProperty the active property the value is associated with.\n * @param value the value to expand.\n * @param {Object} [options] - processing options.\n *\n * @return the expanded value.\n */\nfunction _expandValue({activeCtx, activeProperty, value, options}) {\n // nothing to expand\n if(value === null || value === undefined) {\n return null;\n }\n\n // special-case expand @id and @type (skips '@id' expansion)\n const expandedProperty = _expandIri(\n activeCtx, activeProperty, {vocab: true}, options);\n if(expandedProperty === '@id') {\n return _expandIri(activeCtx, value, {base: true}, options);\n } else if(expandedProperty === '@type') {\n return _expandIri(activeCtx, value, {vocab: true, base: true},\n {...options, typeExpansion: true});\n }\n\n // get type definition from context\n const type = _getContextValue(activeCtx, activeProperty, '@type');\n\n // do @id expansion (automatic for @graph)\n if((type === '@id' || expandedProperty === '@graph') && _isString(value)) {\n const expandedValue = _expandIri(activeCtx, value, {base: true}, options);\n // NOTE: handle spec edge case and avoid invalid {\"@id\": null}\n if(expandedValue === null && value.match(REGEX_KEYWORD)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'reserved @id value',\n level: 'warning',\n message: 'Reserved @id found.',\n details: {\n id: activeProperty\n }\n },\n options\n });\n }\n }\n return {'@id': expandedValue};\n }\n // do @id expansion w/vocab\n if(type === '@vocab' && _isString(value)) {\n return {\n '@id': _expandIri(activeCtx, value, {vocab: true, base: true}, options)\n };\n }\n\n // do not expand keyword values\n if(_isKeyword(expandedProperty)) {\n return value;\n }\n\n const rval = {};\n\n if(type && !['@id', '@vocab', '@none'].includes(type)) {\n // other type\n rval['@type'] = type;\n } else if(_isString(value)) {\n // check for language tagging for strings\n const language = _getContextValue(activeCtx, activeProperty, '@language');\n if(language !== null) {\n rval['@language'] = language;\n }\n const direction = _getContextValue(activeCtx, activeProperty, '@direction');\n if(direction !== null) {\n rval['@direction'] = direction;\n }\n }\n // do conversion of values that aren't basic JSON types to strings\n if(!['boolean', 'number', 'string'].includes(typeof value)) {\n value = value.toString();\n }\n rval['@value'] = value;\n\n return rval;\n}\n\n/**\n * Expands a language map.\n *\n * @param activeCtx the active context to use.\n * @param languageMap the language map to expand.\n * @param direction the direction to apply to values.\n * @param {Object} [options] - processing options.\n *\n * @return the expanded language map.\n */\nfunction _expandLanguageMap(activeCtx, languageMap, direction, options) {\n const rval = [];\n const keys = Object.keys(languageMap).sort();\n for(const key of keys) {\n const expandedKey = _expandIri(activeCtx, key, {vocab: true}, options);\n let val = languageMap[key];\n if(!_isArray(val)) {\n val = [val];\n }\n for(const item of val) {\n if(item === null) {\n // null values are allowed (8.5) but ignored (3.1)\n continue;\n }\n if(!_isString(item)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; language map values must be strings.',\n 'jsonld.SyntaxError',\n {code: 'invalid language map value', languageMap});\n }\n const val = {'@value': item};\n if(expandedKey !== '@none') {\n if(!key.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language: key\n }\n },\n options\n });\n }\n }\n val['@language'] = key.toLowerCase();\n }\n if(direction) {\n val['@direction'] = direction;\n }\n rval.push(val);\n }\n }\n return rval;\n}\n\nasync function _expandIndexMap({\n activeCtx, options, activeProperty, value, asGraph, indexKey, propertyIndex\n}) {\n const rval = [];\n const keys = Object.keys(value).sort();\n const isTypeIndex = indexKey === '@type';\n for(let key of keys) {\n // if indexKey is @type, there may be a context defined for it\n if(isTypeIndex) {\n const ctx = _getContextValue(activeCtx, key, '@context');\n if(!_isUndefined(ctx)) {\n activeCtx = await _processContext({\n activeCtx,\n localCtx: ctx,\n propagate: false,\n options\n });\n }\n }\n\n let val = value[key];\n if(!_isArray(val)) {\n val = [val];\n }\n\n val = await api.expand({\n activeCtx,\n activeProperty,\n element: val,\n options,\n insideList: false,\n insideIndex: true\n });\n\n // expand for @type, but also for @none\n let expandedKey;\n if(propertyIndex) {\n if(key === '@none') {\n expandedKey = '@none';\n } else {\n expandedKey = _expandValue(\n {activeCtx, activeProperty: indexKey, value: key, options});\n }\n } else {\n expandedKey = _expandIri(activeCtx, key, {vocab: true}, options);\n }\n\n if(indexKey === '@id') {\n // expand document relative\n key = _expandIri(activeCtx, key, {base: true}, options);\n } else if(isTypeIndex) {\n key = expandedKey;\n }\n\n for(let item of val) {\n // If this is also a @graph container, turn items into graphs\n if(asGraph && !_isGraph(item)) {\n item = {'@graph': [item]};\n }\n if(indexKey === '@type') {\n if(expandedKey === '@none') {\n // ignore @none\n } else if(item['@type']) {\n item['@type'] = [key].concat(item['@type']);\n } else {\n item['@type'] = [key];\n }\n } else if(_isValue(item) &&\n !['@language', '@type', '@index'].includes(indexKey)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; Attempt to add illegal key to value ' +\n `object: \"${indexKey}\".`,\n 'jsonld.SyntaxError',\n {code: 'invalid value object', value: item});\n } else if(propertyIndex) {\n // index is a property to be expanded, and values interpreted for that\n // property\n if(expandedKey !== '@none') {\n // expand key as a value\n _addValue(item, propertyIndex, expandedKey, {\n propertyIsArray: true,\n prependValue: true\n });\n }\n } else if(expandedKey !== '@none' && !(indexKey in item)) {\n item[indexKey] = key;\n }\n rval.push(item);\n }\n }\n return rval;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {\n isSubjectReference: _isSubjectReference\n} = require('./graphTypes');\n\nconst {\n createMergedNodeMap: _createMergedNodeMap\n} = require('./nodeMap');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Performs JSON-LD flattening.\n *\n * @param input the expanded JSON-LD to flatten.\n *\n * @return the flattened output.\n */\napi.flatten = input => {\n const defaultGraph = _createMergedNodeMap(input);\n\n // produce flattened output\n const flattened = [];\n const keys = Object.keys(defaultGraph).sort();\n for(let ki = 0; ki < keys.length; ++ki) {\n const node = defaultGraph[keys[ki]];\n // only add full subjects to top-level\n if(!_isSubjectReference(node)) {\n flattened.push(node);\n }\n }\n return flattened;\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {isKeyword} = require('./context');\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\nconst util = require('./util');\nconst url = require('./url');\nconst JsonLdError = require('./JsonLdError');\nconst {\n createNodeMap: _createNodeMap,\n mergeNodeMapGraphs: _mergeNodeMapGraphs\n} = require('./nodeMap');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Performs JSON-LD `merged` framing.\n *\n * @param input the expanded JSON-LD to frame.\n * @param frame the expanded JSON-LD frame to use.\n * @param options the framing options.\n *\n * @return the framed output.\n */\napi.frameMergedOrDefault = (input, frame, options) => {\n // create framing state\n const state = {\n options,\n embedded: false,\n graph: '@default',\n graphMap: {'@default': {}},\n subjectStack: [],\n link: {},\n bnodeMap: {}\n };\n\n // produce a map of all graphs and name each bnode\n // FIXME: currently uses subjects from @merged graph only\n const issuer = new util.IdentifierIssuer('_:b');\n _createNodeMap(input, state.graphMap, '@default', issuer);\n if(options.merged) {\n state.graphMap['@merged'] = _mergeNodeMapGraphs(state.graphMap);\n state.graph = '@merged';\n }\n state.subjects = state.graphMap[state.graph];\n\n // frame the subjects\n const framed = [];\n api.frame(state, Object.keys(state.subjects).sort(), frame, framed);\n\n // If pruning blank nodes, find those to prune\n if(options.pruneBlankNodeIdentifiers) {\n // remove all blank nodes appearing only once, done in compaction\n options.bnodesToClear =\n Object.keys(state.bnodeMap).filter(id => state.bnodeMap[id].length === 1);\n }\n\n // remove @preserve from results\n options.link = {};\n return _cleanupPreserve(framed, options);\n};\n\n/**\n * Frames subjects according to the given frame.\n *\n * @param state the current framing state.\n * @param subjects the subjects to filter.\n * @param frame the frame.\n * @param parent the parent subject or top-level array.\n * @param property the parent property, initialized to null.\n */\napi.frame = (state, subjects, frame, parent, property = null) => {\n // validate the frame\n _validateFrame(frame);\n frame = frame[0];\n\n // get flags for current frame\n const options = state.options;\n const flags = {\n embed: _getFrameFlag(frame, options, 'embed'),\n explicit: _getFrameFlag(frame, options, 'explicit'),\n requireAll: _getFrameFlag(frame, options, 'requireAll')\n };\n\n // get link for current graph\n if(!state.link.hasOwnProperty(state.graph)) {\n state.link[state.graph] = {};\n }\n const link = state.link[state.graph];\n\n // filter out subjects that match the frame\n const matches = _filterSubjects(state, subjects, frame, flags);\n\n // add matches to output\n const ids = Object.keys(matches).sort();\n for(const id of ids) {\n const subject = matches[id];\n\n /* Note: In order to treat each top-level match as a compartmentalized\n result, clear the unique embedded subjects map when the property is null,\n which only occurs at the top-level. */\n if(property === null) {\n state.uniqueEmbeds = {[state.graph]: {}};\n } else {\n state.uniqueEmbeds[state.graph] = state.uniqueEmbeds[state.graph] || {};\n }\n\n if(flags.embed === '@link' && id in link) {\n // TODO: may want to also match an existing linked subject against\n // the current frame ... so different frames could produce different\n // subjects that are only shared in-memory when the frames are the same\n\n // add existing linked subject\n _addFrameOutput(parent, property, link[id]);\n continue;\n }\n\n // start output for subject\n const output = {'@id': id};\n if(id.indexOf('_:') === 0) {\n util.addValue(state.bnodeMap, id, output, {propertyIsArray: true});\n }\n link[id] = output;\n\n // validate @embed\n if((flags.embed === '@first' || flags.embed === '@last') && state.is11) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid value of @embed.',\n 'jsonld.SyntaxError', {code: 'invalid @embed value', frame});\n }\n\n if(!state.embedded && state.uniqueEmbeds[state.graph].hasOwnProperty(id)) {\n // skip adding this node object to the top level, as it was\n // already included in another node object\n continue;\n }\n\n // if embed is @never or if a circular reference would be created by an\n // embed, the subject cannot be embedded, just add the reference;\n // note that a circular reference won't occur when the embed flag is\n // `@link` as the above check will short-circuit before reaching this point\n if(state.embedded &&\n (flags.embed === '@never' ||\n _createsCircularReference(subject, state.graph, state.subjectStack))) {\n _addFrameOutput(parent, property, output);\n continue;\n }\n\n // if only the first (or once) should be embedded\n if(state.embedded &&\n (flags.embed == '@first' || flags.embed == '@once') &&\n state.uniqueEmbeds[state.graph].hasOwnProperty(id)) {\n _addFrameOutput(parent, property, output);\n continue;\n }\n\n // if only the last match should be embedded\n if(flags.embed === '@last') {\n // remove any existing embed\n if(id in state.uniqueEmbeds[state.graph]) {\n _removeEmbed(state, id);\n }\n }\n\n state.uniqueEmbeds[state.graph][id] = {parent, property};\n\n // push matching subject onto stack to enable circular embed checks\n state.subjectStack.push({subject, graph: state.graph});\n\n // subject is also the name of a graph\n if(id in state.graphMap) {\n let recurse = false;\n let subframe = null;\n if(!('@graph' in frame)) {\n recurse = state.graph !== '@merged';\n subframe = {};\n } else {\n subframe = frame['@graph'][0];\n recurse = !(id === '@merged' || id === '@default');\n if(!types.isObject(subframe)) {\n subframe = {};\n }\n }\n\n if(recurse) {\n // recurse into graph\n api.frame(\n {...state, graph: id, embedded: false},\n Object.keys(state.graphMap[id]).sort(), [subframe], output, '@graph');\n }\n }\n\n // if frame has @included, recurse over its sub-frame\n if('@included' in frame) {\n api.frame(\n {...state, embedded: false},\n subjects, frame['@included'], output, '@included');\n }\n\n // iterate over subject properties\n for(const prop of Object.keys(subject).sort()) {\n // copy keywords to output\n if(isKeyword(prop)) {\n output[prop] = util.clone(subject[prop]);\n\n if(prop === '@type') {\n // count bnode values of @type\n for(const type of subject['@type']) {\n if(type.indexOf('_:') === 0) {\n util.addValue(\n state.bnodeMap, type, output, {propertyIsArray: true});\n }\n }\n }\n continue;\n }\n\n // explicit is on and property isn't in the frame, skip processing\n if(flags.explicit && !(prop in frame)) {\n continue;\n }\n\n // add objects\n for(const o of subject[prop]) {\n const subframe = (prop in frame ?\n frame[prop] : _createImplicitFrame(flags));\n\n // recurse into list\n if(graphTypes.isList(o)) {\n const subframe =\n (frame[prop] && frame[prop][0] && frame[prop][0]['@list']) ?\n frame[prop][0]['@list'] :\n _createImplicitFrame(flags);\n\n // add empty list\n const list = {'@list': []};\n _addFrameOutput(output, prop, list);\n\n // add list objects\n const src = o['@list'];\n for(const oo of src) {\n if(graphTypes.isSubjectReference(oo)) {\n // recurse into subject reference\n api.frame(\n {...state, embedded: true},\n [oo['@id']], subframe, list, '@list');\n } else {\n // include other values automatically\n _addFrameOutput(list, '@list', util.clone(oo));\n }\n }\n } else if(graphTypes.isSubjectReference(o)) {\n // recurse into subject reference\n api.frame(\n {...state, embedded: true},\n [o['@id']], subframe, output, prop);\n } else if(_valueMatch(subframe[0], o)) {\n // include other values, if they match\n _addFrameOutput(output, prop, util.clone(o));\n }\n }\n }\n\n // handle defaults\n for(const prop of Object.keys(frame).sort()) {\n // skip keywords\n if(prop === '@type') {\n if(!types.isObject(frame[prop][0]) ||\n !('@default' in frame[prop][0])) {\n continue;\n }\n // allow through default types\n } else if(isKeyword(prop)) {\n continue;\n }\n\n // if omit default is off, then include default values for properties\n // that appear in the next frame but are not in the matching subject\n const next = frame[prop][0] || {};\n const omitDefaultOn = _getFrameFlag(next, options, 'omitDefault');\n if(!omitDefaultOn && !(prop in output)) {\n let preserve = '@null';\n if('@default' in next) {\n preserve = util.clone(next['@default']);\n }\n if(!types.isArray(preserve)) {\n preserve = [preserve];\n }\n output[prop] = [{'@preserve': preserve}];\n }\n }\n\n // if embed reverse values by finding nodes having this subject as a value\n // of the associated property\n for(const reverseProp of Object.keys(frame['@reverse'] || {}).sort()) {\n const subframe = frame['@reverse'][reverseProp];\n for(const subject of Object.keys(state.subjects)) {\n const nodeValues =\n util.getValues(state.subjects[subject], reverseProp);\n if(nodeValues.some(v => v['@id'] === id)) {\n // node has property referencing this subject, recurse\n output['@reverse'] = output['@reverse'] || {};\n util.addValue(\n output['@reverse'], reverseProp, [], {propertyIsArray: true});\n api.frame(\n {...state, embedded: true},\n [subject], subframe, output['@reverse'][reverseProp],\n property);\n }\n }\n }\n\n // add output to parent\n _addFrameOutput(parent, property, output);\n\n // pop matching subject from circular ref-checking stack\n state.subjectStack.pop();\n }\n};\n\n/**\n * Replace `@null` with `null`, removing it from arrays.\n *\n * @param input the framed, compacted output.\n * @param options the framing options used.\n *\n * @return the resulting output.\n */\napi.cleanupNull = (input, options) => {\n // recurse through arrays\n if(types.isArray(input)) {\n const noNulls = input.map(v => api.cleanupNull(v, options));\n return noNulls.filter(v => v); // removes nulls from array\n }\n\n if(input === '@null') {\n return null;\n }\n\n if(types.isObject(input)) {\n // handle in-memory linked nodes\n if('@id' in input) {\n const id = input['@id'];\n if(options.link.hasOwnProperty(id)) {\n const idx = options.link[id].indexOf(input);\n if(idx !== -1) {\n // already visited\n return options.link[id][idx];\n }\n // prevent circular visitation\n options.link[id].push(input);\n } else {\n // prevent circular visitation\n options.link[id] = [input];\n }\n }\n\n for(const key in input) {\n input[key] = api.cleanupNull(input[key], options);\n }\n }\n return input;\n};\n\n/**\n * Creates an implicit frame when recursing through subject matches. If\n * a frame doesn't have an explicit frame for a particular property, then\n * a wildcard child frame will be created that uses the same flags that the\n * parent frame used.\n *\n * @param flags the current framing flags.\n *\n * @return the implicit frame.\n */\nfunction _createImplicitFrame(flags) {\n const frame = {};\n for(const key in flags) {\n if(flags[key] !== undefined) {\n frame['@' + key] = [flags[key]];\n }\n }\n return [frame];\n}\n\n/**\n * Checks the current subject stack to see if embedding the given subject\n * would cause a circular reference.\n *\n * @param subjectToEmbed the subject to embed.\n * @param graph the graph the subject to embed is in.\n * @param subjectStack the current stack of subjects.\n *\n * @return true if a circular reference would be created, false if not.\n */\nfunction _createsCircularReference(subjectToEmbed, graph, subjectStack) {\n for(let i = subjectStack.length - 1; i >= 0; --i) {\n const subject = subjectStack[i];\n if(subject.graph === graph &&\n subject.subject['@id'] === subjectToEmbed['@id']) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Gets the frame flag value for the given flag name.\n *\n * @param frame the frame.\n * @param options the framing options.\n * @param name the flag name.\n *\n * @return the flag value.\n */\nfunction _getFrameFlag(frame, options, name) {\n const flag = '@' + name;\n let rval = (flag in frame ? frame[flag][0] : options[name]);\n if(name === 'embed') {\n // default is \"@last\"\n // backwards-compatibility support for \"embed\" maps:\n // true => \"@last\"\n // false => \"@never\"\n if(rval === true) {\n rval = '@once';\n } else if(rval === false) {\n rval = '@never';\n } else if(rval !== '@always' && rval !== '@never' && rval !== '@link' &&\n rval !== '@first' && rval !== '@last' && rval !== '@once') {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid value of @embed.',\n 'jsonld.SyntaxError', {code: 'invalid @embed value', frame});\n }\n }\n return rval;\n}\n\n/**\n * Validates a JSON-LD frame, throwing an exception if the frame is invalid.\n *\n * @param frame the frame to validate.\n */\nfunction _validateFrame(frame) {\n if(!types.isArray(frame) || frame.length !== 1 || !types.isObject(frame[0])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.',\n 'jsonld.SyntaxError', {frame});\n }\n\n if('@id' in frame[0]) {\n for(const id of util.asArray(frame[0]['@id'])) {\n // @id must be wildcard or an IRI\n if(!(types.isObject(id) || url.isAbsolute(id)) ||\n (types.isString(id) && id.indexOf('_:') === 0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid @id in frame.',\n 'jsonld.SyntaxError', {code: 'invalid frame', frame});\n }\n }\n }\n\n if('@type' in frame[0]) {\n for(const type of util.asArray(frame[0]['@type'])) {\n // @id must be wildcard or an IRI\n if(!(types.isObject(type) || url.isAbsolute(type)) ||\n (types.isString(type) && type.indexOf('_:') === 0)) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; invalid @type in frame.',\n 'jsonld.SyntaxError', {code: 'invalid frame', frame});\n }\n }\n }\n}\n\n/**\n * Returns a map of all of the subjects that match a parsed frame.\n *\n * @param state the current framing state.\n * @param subjects the set of subjects to filter.\n * @param frame the parsed frame.\n * @param flags the frame flags.\n *\n * @return all of the matched subjects.\n */\nfunction _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n const rval = {};\n for(const id of subjects) {\n const subject = state.graphMap[state.graph][id];\n if(_filterSubject(state, subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}\n\n/**\n * Returns true if the given subject matches the given frame.\n *\n * Matches either based on explicit type inclusion where the node has any\n * type listed in the frame. If the frame has empty types defined matches\n * nodes not having a @type. If the frame has a type of {} defined matches\n * nodes having any type defined.\n *\n * Otherwise, does duck typing, where the node must have all of the\n * properties defined in the frame.\n *\n * @param state the current framing state.\n * @param subject the subject to check.\n * @param frame the frame to check.\n * @param flags the frame flags.\n *\n * @return true if the subject matches, false if not.\n */\nfunction _filterSubject(state, subject, frame, flags) {\n // check ducktype\n let wildcard = true;\n let matchesSome = false;\n\n for(const key in frame) {\n let matchThis = false;\n const nodeValues = util.getValues(subject, key);\n const isEmpty = util.getValues(frame, key).length === 0;\n\n if(key === '@id') {\n // match on no @id or any matching @id, including wildcard\n if(types.isEmptyObject(frame['@id'][0] || {})) {\n matchThis = true;\n } else if(frame['@id'].length >= 0) {\n matchThis = frame['@id'].includes(nodeValues[0]);\n }\n if(!flags.requireAll) {\n return matchThis;\n }\n } else if(key === '@type') {\n // check @type (object value means 'any' type,\n // fall through to ducktyping)\n wildcard = false;\n if(isEmpty) {\n if(nodeValues.length > 0) {\n // don't match on no @type\n return false;\n }\n matchThis = true;\n } else if(frame['@type'].length === 1 &&\n types.isEmptyObject(frame['@type'][0])) {\n // match on wildcard @type if there is a type\n matchThis = nodeValues.length > 0;\n } else {\n // match on a specific @type\n for(const type of frame['@type']) {\n if(types.isObject(type) && '@default' in type) {\n // match on default object\n matchThis = true;\n } else {\n matchThis = matchThis || nodeValues.some(tt => tt === type);\n }\n }\n }\n if(!flags.requireAll) {\n return matchThis;\n }\n } else if(isKeyword(key)) {\n continue;\n } else {\n // Force a copy of this frame entry so it can be manipulated\n const thisFrame = util.getValues(frame, key)[0];\n let hasDefault = false;\n if(thisFrame) {\n _validateFrame([thisFrame]);\n hasDefault = '@default' in thisFrame;\n }\n\n // no longer a wildcard pattern if frame has any non-keyword properties\n wildcard = false;\n\n // skip, but allow match if node has no value for property, and frame has\n // a default value\n if(nodeValues.length === 0 && hasDefault) {\n continue;\n }\n\n // if frame value is empty, don't match if subject has any value\n if(nodeValues.length > 0 && isEmpty) {\n return false;\n }\n\n if(thisFrame === undefined) {\n // node does not match if values is not empty and the value of property\n // in frame is match none.\n if(nodeValues.length > 0) {\n return false;\n }\n matchThis = true;\n } else {\n if(graphTypes.isList(thisFrame)) {\n const listValue = thisFrame['@list'][0];\n if(graphTypes.isList(nodeValues[0])) {\n const nodeListValues = nodeValues[0]['@list'];\n\n if(graphTypes.isValue(listValue)) {\n // match on any matching value\n matchThis = nodeListValues.some(lv => _valueMatch(listValue, lv));\n } else if(graphTypes.isSubject(listValue) ||\n graphTypes.isSubjectReference(listValue)) {\n matchThis = nodeListValues.some(lv => _nodeMatch(\n state, listValue, lv, flags));\n }\n }\n } else if(graphTypes.isValue(thisFrame)) {\n matchThis = nodeValues.some(nv => _valueMatch(thisFrame, nv));\n } else if(graphTypes.isSubjectReference(thisFrame)) {\n matchThis =\n nodeValues.some(nv => _nodeMatch(state, thisFrame, nv, flags));\n } else if(types.isObject(thisFrame)) {\n matchThis = nodeValues.length > 0;\n } else {\n matchThis = false;\n }\n }\n }\n\n // all non-defaulted values must match if requireAll is set\n if(!matchThis && flags.requireAll) {\n return false;\n }\n\n matchesSome = matchesSome || matchThis;\n }\n\n // return true if wildcard or subject matches some properties\n return wildcard || matchesSome;\n}\n\n/**\n * Removes an existing embed.\n *\n * @param state the current framing state.\n * @param id the @id of the embed to remove.\n */\nfunction _removeEmbed(state, id) {\n // get existing embed\n const embeds = state.uniqueEmbeds[state.graph];\n const embed = embeds[id];\n const parent = embed.parent;\n const property = embed.property;\n\n // create reference to replace embed\n const subject = {'@id': id};\n\n // remove existing embed\n if(types.isArray(parent)) {\n // replace subject with reference\n for(let i = 0; i < parent.length; ++i) {\n if(util.compareValues(parent[i], subject)) {\n parent[i] = subject;\n break;\n }\n }\n } else {\n // replace subject with reference\n const useArray = types.isArray(parent[property]);\n util.removeValue(parent, property, subject, {propertyIsArray: useArray});\n util.addValue(parent, property, subject, {propertyIsArray: useArray});\n }\n\n // recursively remove dependent dangling embeds\n const removeDependents = id => {\n // get embed keys as a separate array to enable deleting keys in map\n const ids = Object.keys(embeds);\n for(const next of ids) {\n if(next in embeds && types.isObject(embeds[next].parent) &&\n embeds[next].parent['@id'] === id) {\n delete embeds[next];\n removeDependents(next);\n }\n }\n };\n removeDependents(id);\n}\n\n/**\n * Removes the @preserve keywords from expanded result of framing.\n *\n * @param input the framed, framed output.\n * @param options the framing options used.\n *\n * @return the resulting output.\n */\nfunction _cleanupPreserve(input, options) {\n // recurse through arrays\n if(types.isArray(input)) {\n return input.map(value => _cleanupPreserve(value, options));\n }\n\n if(types.isObject(input)) {\n // remove @preserve\n if('@preserve' in input) {\n return input['@preserve'][0];\n }\n\n // skip @values\n if(graphTypes.isValue(input)) {\n return input;\n }\n\n // recurse through @lists\n if(graphTypes.isList(input)) {\n input['@list'] = _cleanupPreserve(input['@list'], options);\n return input;\n }\n\n // handle in-memory linked nodes\n if('@id' in input) {\n const id = input['@id'];\n if(options.link.hasOwnProperty(id)) {\n const idx = options.link[id].indexOf(input);\n if(idx !== -1) {\n // already visited\n return options.link[id][idx];\n }\n // prevent circular visitation\n options.link[id].push(input);\n } else {\n // prevent circular visitation\n options.link[id] = [input];\n }\n }\n\n // recurse through properties\n for(const prop in input) {\n // potentially remove the id, if it is an unreference bnode\n if(prop === '@id' && options.bnodesToClear.includes(input[prop])) {\n delete input['@id'];\n continue;\n }\n\n input[prop] = _cleanupPreserve(input[prop], options);\n }\n }\n return input;\n}\n\n/**\n * Adds framing output to the given parent.\n *\n * @param parent the parent to add to.\n * @param property the parent property.\n * @param output the output to add.\n */\nfunction _addFrameOutput(parent, property, output) {\n if(types.isObject(parent)) {\n util.addValue(parent, property, output, {propertyIsArray: true});\n } else {\n parent.push(output);\n }\n}\n\n/**\n * Node matches if it is a node, and matches the pattern as a frame.\n *\n * @param state the current framing state.\n * @param pattern used to match value\n * @param value to check\n * @param flags the frame flags.\n */\nfunction _nodeMatch(state, pattern, value, flags) {\n if(!('@id' in value)) {\n return false;\n }\n const nodeObject = state.subjects[value['@id']];\n return nodeObject && _filterSubject(state, nodeObject, pattern, flags);\n}\n\n/**\n * Value matches if it is a value and matches the value pattern\n *\n * * `pattern` is empty\n * * @values are the same, or `pattern[@value]` is a wildcard, and\n * * @types are the same or `value[@type]` is not null\n * and `pattern[@type]` is `{}`, or `value[@type]` is null\n * and `pattern[@type]` is null or `[]`, and\n * * @languages are the same or `value[@language]` is not null\n * and `pattern[@language]` is `{}`, or `value[@language]` is null\n * and `pattern[@language]` is null or `[]`.\n *\n * @param pattern used to match value\n * @param value to check\n */\nfunction _valueMatch(pattern, value) {\n const v1 = value['@value'];\n const t1 = value['@type'];\n const l1 = value['@language'];\n const v2 = pattern['@value'] ?\n (types.isArray(pattern['@value']) ?\n pattern['@value'] : [pattern['@value']]) :\n [];\n const t2 = pattern['@type'] ?\n (types.isArray(pattern['@type']) ?\n pattern['@type'] : [pattern['@type']]) :\n [];\n const l2 = pattern['@language'] ?\n (types.isArray(pattern['@language']) ?\n pattern['@language'] : [pattern['@language']]) :\n [];\n\n if(v2.length === 0 && t2.length === 0 && l2.length === 0) {\n return true;\n }\n if(!(v2.includes(v1) || types.isEmptyObject(v2[0]))) {\n return false;\n }\n if(!(!t1 && t2.length === 0 || t2.includes(t1) || t1 &&\n types.isEmptyObject(t2[0]))) {\n return false;\n }\n if(!(!l1 && l2.length === 0 || l2.includes(l1) || l1 &&\n types.isEmptyObject(l2[0]))) {\n return false;\n }\n return true;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst JsonLdError = require('./JsonLdError');\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\n\nconst {\n REGEX_BCP47,\n addValue: _addValue\n} = require('./util');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\n// constants\nconst {\n // RDF,\n RDF_LIST,\n RDF_FIRST,\n RDF_REST,\n RDF_NIL,\n RDF_TYPE,\n // RDF_PLAIN_LITERAL,\n // RDF_XML_LITERAL,\n RDF_JSON_LITERAL,\n // RDF_OBJECT,\n // RDF_LANGSTRING,\n\n // XSD,\n XSD_BOOLEAN,\n XSD_DOUBLE,\n XSD_INTEGER,\n XSD_STRING,\n} = require('./constants');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Converts an RDF dataset to JSON-LD.\n *\n * @param dataset the RDF dataset.\n * @param options the RDF serialization options.\n *\n * @return a Promise that resolves to the JSON-LD output.\n */\napi.fromRDF = async (\n dataset,\n options\n) => {\n const defaultGraph = {};\n const graphMap = {'@default': defaultGraph};\n const referencedOnce = {};\n const {\n useRdfType = false,\n useNativeTypes = false,\n rdfDirection = null\n } = options;\n\n for(const quad of dataset) {\n // TODO: change 'name' to 'graph'\n const name = (quad.graph.termType === 'DefaultGraph') ?\n '@default' : quad.graph.value;\n if(!(name in graphMap)) {\n graphMap[name] = {};\n }\n if(name !== '@default' && !(name in defaultGraph)) {\n defaultGraph[name] = {'@id': name};\n }\n\n const nodeMap = graphMap[name];\n\n // get subject, predicate, object\n const s = quad.subject.value;\n const p = quad.predicate.value;\n const o = quad.object;\n\n if(!(s in nodeMap)) {\n nodeMap[s] = {'@id': s};\n }\n const node = nodeMap[s];\n\n const objectIsNode = o.termType.endsWith('Node');\n if(objectIsNode && !(o.value in nodeMap)) {\n nodeMap[o.value] = {'@id': o.value};\n }\n\n if(p === RDF_TYPE && !useRdfType && objectIsNode) {\n _addValue(node, '@type', o.value, {propertyIsArray: true});\n continue;\n }\n\n const value = _RDFToObject(o, useNativeTypes, rdfDirection, options);\n _addValue(node, p, value, {propertyIsArray: true});\n\n // object may be an RDF list/partial list node but we can't know easily\n // until all triples are read\n if(objectIsNode) {\n if(o.value === RDF_NIL) {\n // track rdf:nil uniquely per graph\n const object = nodeMap[o.value];\n if(!('usages' in object)) {\n object.usages = [];\n }\n object.usages.push({\n node,\n property: p,\n value\n });\n } else if(o.value in referencedOnce) {\n // object referenced more than once\n referencedOnce[o.value] = false;\n } else {\n // keep track of single reference\n referencedOnce[o.value] = {\n node,\n property: p,\n value\n };\n }\n }\n }\n\n /*\n for(let name in dataset) {\n const graph = dataset[name];\n if(!(name in graphMap)) {\n graphMap[name] = {};\n }\n if(name !== '@default' && !(name in defaultGraph)) {\n defaultGraph[name] = {'@id': name};\n }\n const nodeMap = graphMap[name];\n for(let ti = 0; ti < graph.length; ++ti) {\n const triple = graph[ti];\n\n // get subject, predicate, object\n const s = triple.subject.value;\n const p = triple.predicate.value;\n const o = triple.object;\n\n if(!(s in nodeMap)) {\n nodeMap[s] = {'@id': s};\n }\n const node = nodeMap[s];\n\n const objectIsId = (o.type === 'IRI' || o.type === 'blank node');\n if(objectIsId && !(o.value in nodeMap)) {\n nodeMap[o.value] = {'@id': o.value};\n }\n\n if(p === RDF_TYPE && !useRdfType && objectIsId) {\n _addValue(node, '@type', o.value, {propertyIsArray: true});\n continue;\n }\n\n const value = _RDFToObject(o, useNativeTypes);\n _addValue(node, p, value, {propertyIsArray: true});\n\n // object may be an RDF list/partial list node but we can't know easily\n // until all triples are read\n if(objectIsId) {\n if(o.value === RDF_NIL) {\n // track rdf:nil uniquely per graph\n const object = nodeMap[o.value];\n if(!('usages' in object)) {\n object.usages = [];\n }\n object.usages.push({\n node: node,\n property: p,\n value: value\n });\n } else if(o.value in referencedOnce) {\n // object referenced more than once\n referencedOnce[o.value] = false;\n } else {\n // keep track of single reference\n referencedOnce[o.value] = {\n node: node,\n property: p,\n value: value\n };\n }\n }\n }\n }*/\n\n // convert linked lists to @list arrays\n for(const name in graphMap) {\n const graphObject = graphMap[name];\n\n // no @lists to be converted, continue\n if(!(RDF_NIL in graphObject)) {\n continue;\n }\n\n // iterate backwards through each RDF list\n const nil = graphObject[RDF_NIL];\n if(!nil.usages) {\n continue;\n }\n for(let usage of nil.usages) {\n let node = usage.node;\n let property = usage.property;\n let head = usage.value;\n const list = [];\n const listNodes = [];\n\n // ensure node is a well-formed list node; it must:\n // 1. Be referenced only once.\n // 2. Have an array for rdf:first that has 1 item.\n // 3. Have an array for rdf:rest that has 1 item.\n // 4. Have no keys other than: @id, rdf:first, rdf:rest, and,\n // optionally, @type where the value is rdf:List.\n let nodeKeyCount = Object.keys(node).length;\n while(property === RDF_REST &&\n types.isObject(referencedOnce[node['@id']]) &&\n types.isArray(node[RDF_FIRST]) && node[RDF_FIRST].length === 1 &&\n types.isArray(node[RDF_REST]) && node[RDF_REST].length === 1 &&\n (nodeKeyCount === 3 ||\n (nodeKeyCount === 4 && types.isArray(node['@type']) &&\n node['@type'].length === 1 && node['@type'][0] === RDF_LIST))) {\n list.push(node[RDF_FIRST][0]);\n listNodes.push(node['@id']);\n\n // get next node, moving backwards through list\n usage = referencedOnce[node['@id']];\n node = usage.node;\n property = usage.property;\n head = usage.value;\n nodeKeyCount = Object.keys(node).length;\n\n // if node is not a blank node, then list head found\n if(!graphTypes.isBlankNode(node)) {\n break;\n }\n }\n\n // transform list into @list object\n delete head['@id'];\n head['@list'] = list.reverse();\n for(const listNode of listNodes) {\n delete graphObject[listNode];\n }\n }\n\n delete nil.usages;\n }\n\n const result = [];\n const subjects = Object.keys(defaultGraph).sort();\n for(const subject of subjects) {\n const node = defaultGraph[subject];\n if(subject in graphMap) {\n const graph = node['@graph'] = [];\n const graphObject = graphMap[subject];\n const graphSubjects = Object.keys(graphObject).sort();\n for(const graphSubject of graphSubjects) {\n const node = graphObject[graphSubject];\n // only add full subjects to top-level\n if(!graphTypes.isSubjectReference(node)) {\n graph.push(node);\n }\n }\n }\n // only add full subjects to top-level\n if(!graphTypes.isSubjectReference(node)) {\n result.push(node);\n }\n }\n\n return result;\n};\n\n/**\n * Converts an RDF triple object to a JSON-LD object.\n *\n * @param o the RDF triple object to convert.\n * @param useNativeTypes true to output native types, false not to.\n * @param rdfDirection text direction mode [null, i18n-datatype]\n * @param options top level API options\n *\n * @return the JSON-LD object.\n */\nfunction _RDFToObject(o, useNativeTypes, rdfDirection, options) {\n // convert NamedNode/BlankNode object to JSON-LD\n if(o.termType.endsWith('Node')) {\n return {'@id': o.value};\n }\n\n // convert literal to JSON-LD\n const rval = {'@value': o.value};\n\n // add language\n if(o.language) {\n if(!o.language.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language: o.language\n }\n },\n options\n });\n }\n }\n rval['@language'] = o.language;\n } else {\n let type = o.datatype.value;\n if(!type) {\n type = XSD_STRING;\n }\n if(type === RDF_JSON_LITERAL) {\n type = '@json';\n try {\n rval['@value'] = JSON.parse(rval['@value']);\n } catch(e) {\n throw new JsonLdError(\n 'JSON literal could not be parsed.',\n 'jsonld.InvalidJsonLiteral',\n {code: 'invalid JSON literal', value: rval['@value'], cause: e});\n }\n }\n // use native types for certain xsd types\n if(useNativeTypes) {\n if(type === XSD_BOOLEAN) {\n if(rval['@value'] === 'true') {\n rval['@value'] = true;\n } else if(rval['@value'] === 'false') {\n rval['@value'] = false;\n }\n } else if(types.isNumeric(rval['@value'])) {\n if(type === XSD_INTEGER) {\n const i = parseInt(rval['@value'], 10);\n if(i.toFixed(0) === rval['@value']) {\n rval['@value'] = i;\n }\n } else if(type === XSD_DOUBLE) {\n rval['@value'] = parseFloat(rval['@value']);\n }\n }\n // do not add native type\n if(![XSD_BOOLEAN, XSD_INTEGER, XSD_DOUBLE, XSD_STRING].includes(type)) {\n rval['@type'] = type;\n }\n } else if(rdfDirection === 'i18n-datatype' &&\n type.startsWith('https://www.w3.org/ns/i18n#')) {\n const [, language, direction] = type.split(/[#_]/);\n if(language.length > 0) {\n rval['@language'] = language;\n if(!language.match(REGEX_BCP47)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'invalid @language value',\n level: 'warning',\n message: '@language value must be valid BCP47.',\n details: {\n language\n }\n },\n options\n });\n }\n }\n }\n rval['@direction'] = direction;\n } else if(type !== XSD_STRING) {\n rval['@type'] = type;\n }\n }\n\n return rval;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst types = require('./types');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Returns true if the given value is a subject with properties.\n *\n * @param v the value to check.\n *\n * @return true if the value is a subject with properties, false if not.\n */\napi.isSubject = v => {\n // Note: A value is a subject if all of these hold true:\n // 1. It is an Object.\n // 2. It is not a @value, @set, or @list.\n // 3. It has more than 1 key OR any existing key is not @id.\n if(types.isObject(v) &&\n !(('@value' in v) || ('@set' in v) || ('@list' in v))) {\n const keyCount = Object.keys(v).length;\n return (keyCount > 1 || !('@id' in v));\n }\n return false;\n};\n\n/**\n * Returns true if the given value is a subject reference.\n *\n * @param v the value to check.\n *\n * @return true if the value is a subject reference, false if not.\n */\napi.isSubjectReference = v =>\n // Note: A value is a subject reference if all of these hold true:\n // 1. It is an Object.\n // 2. It has a single key: @id.\n (types.isObject(v) && Object.keys(v).length === 1 && ('@id' in v));\n\n/**\n * Returns true if the given value is a @value.\n *\n * @param v the value to check.\n *\n * @return true if the value is a @value, false if not.\n */\napi.isValue = v =>\n // Note: A value is a @value if all of these hold true:\n // 1. It is an Object.\n // 2. It has the @value property.\n types.isObject(v) && ('@value' in v);\n\n/**\n * Returns true if the given value is a @list.\n *\n * @param v the value to check.\n *\n * @return true if the value is a @list, false if not.\n */\napi.isList = v =>\n // Note: A value is a @list if all of these hold true:\n // 1. It is an Object.\n // 2. It has the @list property.\n types.isObject(v) && ('@list' in v);\n\n/**\n * Returns true if the given value is a @graph.\n *\n * @return true if the value is a @graph, false if not.\n */\napi.isGraph = v => {\n // Note: A value is a graph if all of these hold true:\n // 1. It is an object.\n // 2. It has an `@graph` key.\n // 3. It may have '@id' or '@index'\n return types.isObject(v) &&\n '@graph' in v &&\n Object.keys(v)\n .filter(key => key !== '@id' && key !== '@index').length === 1;\n};\n\n/**\n * Returns true if the given value is a simple @graph.\n *\n * @return true if the value is a simple @graph, false if not.\n */\napi.isSimpleGraph = v => {\n // Note: A value is a simple graph if all of these hold true:\n // 1. It is an object.\n // 2. It has an `@graph` key.\n // 3. It has only 1 key or 2 keys where one of them is `@index`.\n return api.isGraph(v) && !('@id' in v);\n};\n\n/**\n * Returns true if the given value is a blank node.\n *\n * @param v the value to check.\n *\n * @return true if the value is a blank node, false if not.\n */\napi.isBlankNode = v => {\n // Note: A value is a blank node if all of these hold true:\n // 1. It is an Object.\n // 2. If it has an @id key that is not a string OR begins with '_:'.\n // 3. It has no keys OR is not a @value, @set, or @list.\n if(types.isObject(v)) {\n if('@id' in v) {\n const id = v['@id'];\n return !types.isString(id) || id.indexOf('_:') === 0;\n }\n return (Object.keys(v).length === 0 ||\n !(('@value' in v) || ('@set' in v) || ('@list' in v)));\n }\n return false;\n};\n","/**\n * A JavaScript implementation of the JSON-LD API.\n *\n * @author Dave Longley\n *\n * @license BSD 3-Clause License\n * Copyright (c) 2011-2022 Digital Bazaar, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * Neither the name of the Digital Bazaar, Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nconst canonize = require('rdf-canonize');\nconst platform = require('./platform');\nconst util = require('./util');\nconst ContextResolver = require('./ContextResolver');\nconst IdentifierIssuer = util.IdentifierIssuer;\nconst JsonLdError = require('./JsonLdError');\nconst LRU = require('lru-cache');\nconst NQuads = require('./NQuads');\n\nconst {expand: _expand} = require('./expand');\nconst {flatten: _flatten} = require('./flatten');\nconst {fromRDF: _fromRDF} = require('./fromRdf');\nconst {toRDF: _toRDF} = require('./toRdf');\n\nconst {\n frameMergedOrDefault: _frameMergedOrDefault,\n cleanupNull: _cleanupNull\n} = require('./frame');\n\nconst {\n isArray: _isArray,\n isObject: _isObject,\n isString: _isString\n} = require('./types');\n\nconst {\n isSubjectReference: _isSubjectReference,\n} = require('./graphTypes');\n\nconst {\n expandIri: _expandIri,\n getInitialContext: _getInitialContext,\n process: _processContext,\n processingMode: _processingMode\n} = require('./context');\n\nconst {\n compact: _compact,\n compactIri: _compactIri\n} = require('./compact');\n\nconst {\n createNodeMap: _createNodeMap,\n createMergedNodeMap: _createMergedNodeMap,\n mergeNodeMaps: _mergeNodeMaps\n} = require('./nodeMap');\n\nconst {\n logEventHandler: _logEventHandler,\n logWarningEventHandler: _logWarningEventHandler,\n safeEventHandler: _safeEventHandler,\n setDefaultEventHandler: _setDefaultEventHandler,\n setupEventHandler: _setupEventHandler,\n strictEventHandler: _strictEventHandler,\n unhandledEventHandler: _unhandledEventHandler\n} = require('./events');\n\n/* eslint-disable indent */\n// attaches jsonld API to the given object\nconst wrapper = function(jsonld) {\n\n/** Registered RDF dataset parsers hashed by content-type. */\nconst _rdfParsers = {};\n\n// resolved context cache\n// TODO: consider basing max on context size rather than number\nconst RESOLVED_CONTEXT_CACHE_MAX_SIZE = 100;\nconst _resolvedContextCache = new LRU({max: RESOLVED_CONTEXT_CACHE_MAX_SIZE});\n\n/* Core API */\n\n/**\n * Performs JSON-LD compaction.\n *\n * @param input the JSON-LD input to compact.\n * @param ctx the context to compact with.\n * @param [options] options to use:\n * [base] the base IRI to use.\n * [compactArrays] true to compact arrays to single values when\n * appropriate, false not to (default: true).\n * [compactToRelative] true to compact IRIs to be relative to document\n * base, false to keep absolute (default: true)\n * [graph] true to always output a top-level graph (default: false).\n * [expandContext] a context to expand with.\n * [skipExpansion] true to assume the input is expanded and skip\n * expansion, false not to, defaults to false.\n * [documentLoader(url, options)] the document loader.\n * [framing] true if compaction is occuring during a framing operation.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the compacted output.\n */\njsonld.compact = async function(input, ctx, options) {\n if(arguments.length < 2) {\n throw new TypeError('Could not compact, too few arguments.');\n }\n\n if(ctx === null) {\n throw new JsonLdError(\n 'The compaction context must not be null.',\n 'jsonld.CompactError', {code: 'invalid local context'});\n }\n\n // nothing to compact\n if(input === null) {\n return null;\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n compactArrays: true,\n compactToRelative: true,\n graph: false,\n skipExpansion: false,\n link: false,\n issuer: new IdentifierIssuer('_:b'),\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n if(options.link) {\n // force skip expansion when linking, \"link\" is not part of the public\n // API, it should only be called from framing\n options.skipExpansion = true;\n }\n if(!options.compactToRelative) {\n delete options.base;\n }\n\n // expand input\n let expanded;\n if(options.skipExpansion) {\n expanded = input;\n } else {\n expanded = await jsonld.expand(input, options);\n }\n\n // process context\n const activeCtx = await jsonld.processContext(\n _getInitialContext(options), ctx, options);\n\n // do compaction\n let compacted = await _compact({\n activeCtx,\n element: expanded,\n options\n });\n\n // perform clean up\n if(options.compactArrays && !options.graph && _isArray(compacted)) {\n if(compacted.length === 1) {\n // simplify to a single item\n compacted = compacted[0];\n } else if(compacted.length === 0) {\n // simplify to an empty object\n compacted = {};\n }\n } else if(options.graph && _isObject(compacted)) {\n // always use array if graph option is on\n compacted = [compacted];\n }\n\n // follow @context key\n if(_isObject(ctx) && '@context' in ctx) {\n ctx = ctx['@context'];\n }\n\n // build output context\n ctx = util.clone(ctx);\n if(!_isArray(ctx)) {\n ctx = [ctx];\n }\n // remove empty contexts\n const tmp = ctx;\n ctx = [];\n for(let i = 0; i < tmp.length; ++i) {\n if(!_isObject(tmp[i]) || Object.keys(tmp[i]).length > 0) {\n ctx.push(tmp[i]);\n }\n }\n\n // remove array if only one context\n const hasContext = (ctx.length > 0);\n if(ctx.length === 1) {\n ctx = ctx[0];\n }\n\n // add context and/or @graph\n if(_isArray(compacted)) {\n // use '@graph' keyword\n const graphAlias = _compactIri({\n activeCtx, iri: '@graph', relativeTo: {vocab: true}\n });\n const graph = compacted;\n compacted = {};\n if(hasContext) {\n compacted['@context'] = ctx;\n }\n compacted[graphAlias] = graph;\n } else if(_isObject(compacted) && hasContext) {\n // reorder keys so @context is first\n const graph = compacted;\n compacted = {'@context': ctx};\n for(const key in graph) {\n compacted[key] = graph[key];\n }\n }\n\n return compacted;\n};\n\n/**\n * Performs JSON-LD expansion.\n *\n * @param input the JSON-LD input to expand.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [keepFreeFloatingNodes] true to keep free-floating nodes,\n * false not to, defaults to false.\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the expanded output.\n */\njsonld.expand = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not expand, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n keepFreeFloatingNodes: false,\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // build set of objects that may have @contexts to resolve\n const toResolve = {};\n\n // build set of contexts to process prior to expansion\n const contextsToProcess = [];\n\n // if an `expandContext` has been given ensure it gets resolved\n if('expandContext' in options) {\n const expandContext = util.clone(options.expandContext);\n if(_isObject(expandContext) && '@context' in expandContext) {\n toResolve.expandContext = expandContext;\n } else {\n toResolve.expandContext = {'@context': expandContext};\n }\n contextsToProcess.push(toResolve.expandContext);\n }\n\n // if input is a string, attempt to dereference remote document\n let defaultBase;\n if(!_isString(input)) {\n // input is not a URL, do not need to retrieve it first\n toResolve.input = util.clone(input);\n } else {\n // load remote doc\n const remoteDoc = await jsonld.get(input, options);\n defaultBase = remoteDoc.documentUrl;\n toResolve.input = remoteDoc.document;\n if(remoteDoc.contextUrl) {\n // context included in HTTP link header and must be resolved\n toResolve.remoteContext = {'@context': remoteDoc.contextUrl};\n contextsToProcess.push(toResolve.remoteContext);\n }\n }\n\n // set default base\n if(!('base' in options)) {\n options.base = defaultBase || '';\n }\n\n // process any additional contexts\n let activeCtx = _getInitialContext(options);\n for(const localCtx of contextsToProcess) {\n activeCtx = await _processContext({activeCtx, localCtx, options});\n }\n\n // expand resolved input\n let expanded = await _expand({\n activeCtx,\n element: toResolve.input,\n options\n });\n\n // optimize away @graph with no other properties\n if(_isObject(expanded) && ('@graph' in expanded) &&\n Object.keys(expanded).length === 1) {\n expanded = expanded['@graph'];\n } else if(expanded === null) {\n expanded = [];\n }\n\n // normalize to an array\n if(!_isArray(expanded)) {\n expanded = [expanded];\n }\n\n return expanded;\n};\n\n/**\n * Performs JSON-LD flattening.\n *\n * @param input the JSON-LD to flatten.\n * @param ctx the context to use to compact the flattened output, or null.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [documentLoader(url, options)] the document loader.\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the flattened output.\n */\njsonld.flatten = async function(input, ctx, options) {\n if(arguments.length < 1) {\n return new TypeError('Could not flatten, too few arguments.');\n }\n\n if(typeof ctx === 'function') {\n ctx = null;\n } else {\n ctx = ctx || null;\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // expand input\n const expanded = await jsonld.expand(input, options);\n\n // do flattening\n const flattened = _flatten(expanded);\n\n if(ctx === null) {\n // no compaction required\n return flattened;\n }\n\n // compact result (force @graph option to true, skip expansion)\n options.graph = true;\n options.skipExpansion = true;\n const compacted = await jsonld.compact(flattened, ctx, options);\n\n return compacted;\n};\n\n/**\n * Performs JSON-LD framing.\n *\n * @param input the JSON-LD input to frame.\n * @param frame the JSON-LD frame to use.\n * @param [options] the framing options.\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [embed] default @embed flag: '@last', '@always', '@never', '@link'\n * (default: '@last').\n * [explicit] default @explicit flag (default: false).\n * [requireAll] default @requireAll flag (default: true).\n * [omitDefault] default @omitDefault flag (default: false).\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the framed output.\n */\njsonld.frame = async function(input, frame, options) {\n if(arguments.length < 2) {\n throw new TypeError('Could not frame, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n embed: '@once',\n explicit: false,\n requireAll: false,\n omitDefault: false,\n bnodesToClear: [],\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // if frame is a string, attempt to dereference remote document\n if(_isString(frame)) {\n // load remote doc\n const remoteDoc = await jsonld.get(frame, options);\n frame = remoteDoc.document;\n\n if(remoteDoc.contextUrl) {\n // inject link header @context into frame\n let ctx = frame['@context'];\n if(!ctx) {\n ctx = remoteDoc.contextUrl;\n } else if(_isArray(ctx)) {\n ctx.push(remoteDoc.contextUrl);\n } else {\n ctx = [ctx, remoteDoc.contextUrl];\n }\n frame['@context'] = ctx;\n }\n }\n\n const frameContext = frame ? frame['@context'] || {} : {};\n\n // process context\n const activeCtx = await jsonld.processContext(\n _getInitialContext(options), frameContext, options);\n\n // mode specific defaults\n if(!options.hasOwnProperty('omitGraph')) {\n options.omitGraph = _processingMode(activeCtx, 1.1);\n }\n if(!options.hasOwnProperty('pruneBlankNodeIdentifiers')) {\n options.pruneBlankNodeIdentifiers = _processingMode(activeCtx, 1.1);\n }\n\n // expand input\n const expanded = await jsonld.expand(input, options);\n\n // expand frame\n const opts = {...options};\n opts.isFrame = true;\n opts.keepFreeFloatingNodes = true;\n const expandedFrame = await jsonld.expand(frame, opts);\n\n // if the unexpanded frame includes a key expanding to @graph, frame the\n // default graph, otherwise, the merged graph\n const frameKeys = Object.keys(frame)\n .map(key => _expandIri(activeCtx, key, {vocab: true}));\n opts.merged = !frameKeys.includes('@graph');\n opts.is11 = _processingMode(activeCtx, 1.1);\n\n // do framing\n const framed = _frameMergedOrDefault(expanded, expandedFrame, opts);\n\n opts.graph = !options.omitGraph;\n opts.skipExpansion = true;\n opts.link = {};\n opts.framing = true;\n let compacted = await jsonld.compact(framed, frameContext, opts);\n\n // replace @null with null, compacting arrays\n opts.link = {};\n compacted = _cleanupNull(compacted, opts);\n\n return compacted;\n};\n\n/**\n * **Experimental**\n *\n * Links a JSON-LD document's nodes in memory.\n *\n * @param input the JSON-LD document to link.\n * @param [ctx] the JSON-LD context to apply.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the linked output.\n */\njsonld.link = async function(input, ctx, options) {\n // API matches running frame with a wildcard frame and embed: '@link'\n // get arguments\n const frame = {};\n if(ctx) {\n frame['@context'] = ctx;\n }\n frame['@embed'] = '@link';\n return jsonld.frame(input, frame, options);\n};\n\n/**\n * Performs RDF dataset normalization on the given input. The input is JSON-LD\n * unless the 'inputFormat' option is used. The output is an RDF dataset\n * unless the 'format' option is used.\n *\n * Note: Canonicalization sets `safe` to `true` and `base` to `null` by\n * default in order to produce safe outputs and \"fail closed\" by default. This\n * is different from the other API transformations in this version which\n * allow unsafe defaults (for cryptographic usage) in order to comply with the\n * JSON-LD 1.1 specification.\n *\n * @param input the input to normalize as JSON-LD or as a format specified by\n * the 'inputFormat' option.\n * @param [options] the options to use:\n * [algorithm] the normalization algorithm to use, `URDNA2015` or\n * `URGNA2012` (default: `URDNA2015`).\n * [base] the base IRI to use (default: `null`).\n * [expandContext] a context to expand with.\n * [skipExpansion] true to assume the input is expanded and skip\n * expansion, false not to, defaults to false.\n * [inputFormat] the format if input is not JSON-LD:\n * 'application/n-quads' for N-Quads.\n * [format] the format if output is a string:\n * 'application/n-quads' for N-Quads.\n * [documentLoader(url, options)] the document loader.\n * [useNative] true to use a native canonize algorithm\n * [safe] true to use safe mode. (default: true).\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the normalized output.\n */\njsonld.normalize = jsonld.canonize = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not canonize, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : null,\n algorithm: 'URDNA2015',\n skipExpansion: false,\n safe: true,\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n if('inputFormat' in options) {\n if(options.inputFormat !== 'application/n-quads' &&\n options.inputFormat !== 'application/nquads') {\n throw new JsonLdError(\n 'Unknown canonicalization input format.',\n 'jsonld.CanonizeError');\n }\n // TODO: `await` for async parsers\n const parsedInput = NQuads.parse(input);\n\n // do canonicalization\n return canonize.canonize(parsedInput, options);\n }\n\n // convert to RDF dataset then do normalization\n const opts = {...options};\n delete opts.format;\n opts.produceGeneralizedRdf = false;\n const dataset = await jsonld.toRDF(input, opts);\n\n // do canonicalization\n return canonize.canonize(dataset, options);\n};\n\n/**\n * Converts an RDF dataset to JSON-LD.\n *\n * @param dataset a serialized string of RDF in a format specified by the\n * format option or an RDF dataset to convert.\n * @param [options] the options to use:\n * [format] the format if dataset param must first be parsed:\n * 'application/n-quads' for N-Quads (default).\n * [rdfParser] a custom RDF-parser to use to parse the dataset.\n * [useRdfType] true to use rdf:type, false to use @type\n * (default: false).\n * [useNativeTypes] true to convert XSD types into native types\n * (boolean, integer, double), false not to (default: false).\n * [rdfDirection] 'i18n-datatype' to support RDF transformation of\n * @direction (default: null).\n * [safe] true to use safe mode. (default: false)\n *\n * @return a Promise that resolves to the JSON-LD document.\n */\njsonld.fromRDF = async function(dataset, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not convert from RDF, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n format: _isString(dataset) ? 'application/n-quads' : undefined\n });\n\n const {format} = options;\n let {rdfParser} = options;\n\n // handle special format\n if(format) {\n // check supported formats\n rdfParser = rdfParser || _rdfParsers[format];\n if(!rdfParser) {\n throw new JsonLdError(\n 'Unknown input format.',\n 'jsonld.UnknownFormat', {format});\n }\n } else {\n // no-op parser, assume dataset already parsed\n rdfParser = () => dataset;\n }\n\n // rdfParser must be synchronous or return a promise, no callback support\n const parsedDataset = await rdfParser(dataset);\n return _fromRDF(parsedDataset, options);\n};\n\n/**\n * Outputs the RDF dataset found in the given JSON-LD object.\n *\n * @param input the JSON-LD input.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [skipExpansion] true to assume the input is expanded and skip\n * expansion, false not to, defaults to false.\n * [format] the format to use to output a string:\n * 'application/n-quads' for N-Quads.\n * [produceGeneralizedRdf] true to output generalized RDF, false\n * to produce only standard RDF (default: false).\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the RDF dataset.\n */\njsonld.toRDF = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not convert to RDF, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n skipExpansion: false,\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // TODO: support toRDF custom map?\n let expanded;\n if(options.skipExpansion) {\n expanded = input;\n } else {\n // expand input\n expanded = await jsonld.expand(input, options);\n }\n\n // output RDF dataset\n const dataset = _toRDF(expanded, options);\n if(options.format) {\n if(options.format === 'application/n-quads' ||\n options.format === 'application/nquads') {\n return NQuads.serialize(dataset);\n }\n throw new JsonLdError(\n 'Unknown output format.',\n 'jsonld.UnknownFormat', {format: options.format});\n }\n\n return dataset;\n};\n\n/**\n * **Experimental**\n *\n * Recursively flattens the nodes in the given JSON-LD input into a merged\n * map of node ID => node. All graphs will be merged into the default graph.\n *\n * @param input the JSON-LD input.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes.\n * [documentLoader(url, options)] the document loader.\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the merged node map.\n */\njsonld.createNodeMap = async function(input, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not create node map, too few arguments.');\n }\n\n // set default options\n options = _setDefaults(options, {\n base: _isString(input) ? input : '',\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // expand input\n const expanded = await jsonld.expand(input, options);\n\n return _createMergedNodeMap(expanded, options);\n};\n\n/**\n * **Experimental**\n *\n * Merges two or more JSON-LD documents into a single flattened document.\n *\n * @param docs the JSON-LD documents to merge together.\n * @param ctx the context to use to compact the merged result, or null.\n * @param [options] the options to use:\n * [base] the base IRI to use.\n * [expandContext] a context to expand with.\n * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes.\n * [mergeNodes] true to merge properties for nodes with the same ID,\n * false to ignore new properties for nodes with the same ID once\n * the ID has been defined; note that this may not prevent merging\n * new properties where a node is in the `object` position\n * (default: true).\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the merged output.\n */\njsonld.merge = async function(docs, ctx, options) {\n if(arguments.length < 1) {\n throw new TypeError('Could not merge, too few arguments.');\n }\n if(!_isArray(docs)) {\n throw new TypeError('Could not merge, \"docs\" must be an array.');\n }\n\n if(typeof ctx === 'function') {\n ctx = null;\n } else {\n ctx = ctx || null;\n }\n\n // set default options\n options = _setDefaults(options, {\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // expand all documents\n const expanded = await Promise.all(docs.map(doc => {\n const opts = {...options};\n return jsonld.expand(doc, opts);\n }));\n\n let mergeNodes = true;\n if('mergeNodes' in options) {\n mergeNodes = options.mergeNodes;\n }\n\n const issuer = options.issuer || new IdentifierIssuer('_:b');\n const graphs = {'@default': {}};\n\n for(let i = 0; i < expanded.length; ++i) {\n // uniquely relabel blank nodes\n const doc = util.relabelBlankNodes(expanded[i], {\n issuer: new IdentifierIssuer('_:b' + i + '-')\n });\n\n // add nodes to the shared node map graphs if merging nodes, to a\n // separate graph set if not\n const _graphs = (mergeNodes || i === 0) ? graphs : {'@default': {}};\n _createNodeMap(doc, _graphs, '@default', issuer);\n\n if(_graphs !== graphs) {\n // merge document graphs but don't merge existing nodes\n for(const graphName in _graphs) {\n const _nodeMap = _graphs[graphName];\n if(!(graphName in graphs)) {\n graphs[graphName] = _nodeMap;\n continue;\n }\n const nodeMap = graphs[graphName];\n for(const key in _nodeMap) {\n if(!(key in nodeMap)) {\n nodeMap[key] = _nodeMap[key];\n }\n }\n }\n }\n }\n\n // add all non-default graphs to default graph\n const defaultGraph = _mergeNodeMaps(graphs);\n\n // produce flattened output\n const flattened = [];\n const keys = Object.keys(defaultGraph).sort();\n for(let ki = 0; ki < keys.length; ++ki) {\n const node = defaultGraph[keys[ki]];\n // only add full subjects to top-level\n if(!_isSubjectReference(node)) {\n flattened.push(node);\n }\n }\n\n if(ctx === null) {\n return flattened;\n }\n\n // compact result (force @graph option to true, skip expansion)\n options.graph = true;\n options.skipExpansion = true;\n const compacted = await jsonld.compact(flattened, ctx, options);\n\n return compacted;\n};\n\n/**\n * The default document loader for external documents.\n *\n * @param url the URL to load.\n *\n * @return a promise that resolves to the remote document.\n */\nObject.defineProperty(jsonld, 'documentLoader', {\n get: () => jsonld._documentLoader,\n set: v => jsonld._documentLoader = v\n});\n// default document loader not implemented\njsonld.documentLoader = async url => {\n throw new JsonLdError(\n 'Could not retrieve a JSON-LD document from the URL. URL ' +\n 'dereferencing not implemented.', 'jsonld.LoadDocumentError',\n {code: 'loading document failed', url});\n};\n\n/**\n * Gets a remote JSON-LD document using the default document loader or\n * one given in the passed options.\n *\n * @param url the URL to fetch.\n * @param [options] the options to use:\n * [documentLoader] the document loader to use.\n *\n * @return a Promise that resolves to the retrieved remote document.\n */\njsonld.get = async function(url, options) {\n let load;\n if(typeof options.documentLoader === 'function') {\n load = options.documentLoader;\n } else {\n load = jsonld.documentLoader;\n }\n\n const remoteDoc = await load(url);\n\n try {\n if(!remoteDoc.document) {\n throw new JsonLdError(\n 'No remote document found at the given URL.',\n 'jsonld.NullRemoteDocument');\n }\n if(_isString(remoteDoc.document)) {\n remoteDoc.document = JSON.parse(remoteDoc.document);\n }\n } catch(e) {\n throw new JsonLdError(\n 'Could not retrieve a JSON-LD document from the URL.',\n 'jsonld.LoadDocumentError', {\n code: 'loading document failed',\n cause: e,\n remoteDoc\n });\n }\n\n return remoteDoc;\n};\n\n/**\n * Processes a local context, resolving any URLs as necessary, and returns a\n * new active context.\n *\n * @param activeCtx the current active context.\n * @param localCtx the local context to process.\n * @param [options] the options to use:\n * [documentLoader(url, options)] the document loader.\n * [safe] true to use safe mode. (default: false)\n * [contextResolver] internal use only.\n *\n * @return a Promise that resolves to the new active context.\n */\njsonld.processContext = async function(\n activeCtx, localCtx, options) {\n // set default options\n options = _setDefaults(options, {\n base: '',\n contextResolver: new ContextResolver(\n {sharedCache: _resolvedContextCache})\n });\n\n // return initial context early for null context\n if(localCtx === null) {\n return _getInitialContext(options);\n }\n\n // get URLs in localCtx\n localCtx = util.clone(localCtx);\n if(!(_isObject(localCtx) && '@context' in localCtx)) {\n localCtx = {'@context': localCtx};\n }\n\n return _processContext({activeCtx, localCtx, options});\n};\n\n// backwards compatibility\njsonld.getContextValue = require('./context').getContextValue;\n\n/**\n * Document loaders.\n */\njsonld.documentLoaders = {};\n\n/**\n * Assigns the default document loader for external document URLs to a built-in\n * default. Supported types currently include: 'xhr' and 'node'.\n *\n * @param type the type to set.\n * @param [params] the parameters required to use the document loader.\n */\njsonld.useDocumentLoader = function(type) {\n if(!(type in jsonld.documentLoaders)) {\n throw new JsonLdError(\n 'Unknown document loader type: \"' + type + '\"',\n 'jsonld.UnknownDocumentLoader',\n {type});\n }\n\n // set document loader\n jsonld.documentLoader = jsonld.documentLoaders[type].apply(\n jsonld, Array.prototype.slice.call(arguments, 1));\n};\n\n/**\n * Registers an RDF dataset parser by content-type, for use with\n * jsonld.fromRDF. An RDF dataset parser will always be given one parameter,\n * a string of input. An RDF dataset parser can be synchronous or\n * asynchronous (by returning a promise).\n *\n * @param contentType the content-type for the parser.\n * @param parser(input) the parser function (takes a string as a parameter\n * and either returns an RDF dataset or a Promise that resolves to one.\n */\njsonld.registerRDFParser = function(contentType, parser) {\n _rdfParsers[contentType] = parser;\n};\n\n/**\n * Unregisters an RDF dataset parser by content-type.\n *\n * @param contentType the content-type for the parser.\n */\njsonld.unregisterRDFParser = function(contentType) {\n delete _rdfParsers[contentType];\n};\n\n// register the N-Quads RDF parser\njsonld.registerRDFParser('application/n-quads', NQuads.parse);\njsonld.registerRDFParser('application/nquads', NQuads.parse);\n\n/* URL API */\njsonld.url = require('./url');\n\n/* Events API and handlers */\njsonld.logEventHandler = _logEventHandler;\njsonld.logWarningEventHandler = _logWarningEventHandler;\njsonld.safeEventHandler = _safeEventHandler;\njsonld.setDefaultEventHandler = _setDefaultEventHandler;\njsonld.strictEventHandler = _strictEventHandler;\njsonld.unhandledEventHandler = _unhandledEventHandler;\n\n/* Utility API */\njsonld.util = util;\n// backwards compatibility\nObject.assign(jsonld, util);\n\n// reexpose API as jsonld.promises for backwards compatability\njsonld.promises = jsonld;\n\n// backwards compatibility\njsonld.RequestQueue = require('./RequestQueue');\n\n/* WebIDL API */\njsonld.JsonLdProcessor = require('./JsonLdProcessor')(jsonld);\n\nplatform.setupGlobals(jsonld);\nplatform.setupDocumentLoaders(jsonld);\n\nfunction _setDefaults(options, {\n documentLoader = jsonld.documentLoader,\n ...defaults\n}) {\n // fail if obsolete options present\n if(options && 'compactionMap' in options) {\n throw new JsonLdError(\n '\"compactionMap\" not supported.',\n 'jsonld.OptionsError');\n }\n if(options && 'expansionMap' in options) {\n throw new JsonLdError(\n '\"expansionMap\" not supported.',\n 'jsonld.OptionsError');\n }\n return Object.assign(\n {},\n {documentLoader},\n defaults,\n options,\n {eventHandler: _setupEventHandler({options})}\n );\n}\n\n// end of jsonld API `wrapper` factory\nreturn jsonld;\n};\n\n// external APIs:\n\n// used to generate a new jsonld API instance\nconst factory = function() {\n return wrapper(function() {\n return factory();\n });\n};\n\n// wrap the main jsonld API instance\nwrapper(factory);\n// export API\nmodule.exports = factory;\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {isKeyword} = require('./context');\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\nconst util = require('./util');\nconst JsonLdError = require('./JsonLdError');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Creates a merged JSON-LD node map (node ID => node).\n *\n * @param input the expanded JSON-LD to create a node map of.\n * @param [options] the options to use:\n * [issuer] a jsonld.IdentifierIssuer to use to label blank nodes.\n *\n * @return the node map.\n */\napi.createMergedNodeMap = (input, options) => {\n options = options || {};\n\n // produce a map of all subjects and name each bnode\n const issuer = options.issuer || new util.IdentifierIssuer('_:b');\n const graphs = {'@default': {}};\n api.createNodeMap(input, graphs, '@default', issuer);\n\n // add all non-default graphs to default graph\n return api.mergeNodeMaps(graphs);\n};\n\n/**\n * Recursively flattens the subjects in the given JSON-LD expanded input\n * into a node map.\n *\n * @param input the JSON-LD expanded input.\n * @param graphs a map of graph name to subject map.\n * @param graph the name of the current graph.\n * @param issuer the blank node identifier issuer.\n * @param name the name assigned to the current input if it is a bnode.\n * @param list the list to append to, null for none.\n */\napi.createNodeMap = (input, graphs, graph, issuer, name, list) => {\n // recurse through array\n if(types.isArray(input)) {\n for(const node of input) {\n api.createNodeMap(node, graphs, graph, issuer, undefined, list);\n }\n return;\n }\n\n // add non-object to list\n if(!types.isObject(input)) {\n if(list) {\n list.push(input);\n }\n return;\n }\n\n // add values to list\n if(graphTypes.isValue(input)) {\n if('@type' in input) {\n let type = input['@type'];\n // rename @type blank node\n if(type.indexOf('_:') === 0) {\n input['@type'] = type = issuer.getId(type);\n }\n }\n if(list) {\n list.push(input);\n }\n return;\n } else if(list && graphTypes.isList(input)) {\n const _list = [];\n api.createNodeMap(input['@list'], graphs, graph, issuer, name, _list);\n list.push({'@list': _list});\n return;\n }\n\n // Note: At this point, input must be a subject.\n\n // spec requires @type to be named first, so assign names early\n if('@type' in input) {\n const types = input['@type'];\n for(const type of types) {\n if(type.indexOf('_:') === 0) {\n issuer.getId(type);\n }\n }\n }\n\n // get name for subject\n if(types.isUndefined(name)) {\n name = graphTypes.isBlankNode(input) ?\n issuer.getId(input['@id']) : input['@id'];\n }\n\n // add subject reference to list\n if(list) {\n list.push({'@id': name});\n }\n\n // create new subject or merge into existing one\n const subjects = graphs[graph];\n const subject = subjects[name] = subjects[name] || {};\n subject['@id'] = name;\n const properties = Object.keys(input).sort();\n for(let property of properties) {\n // skip @id\n if(property === '@id') {\n continue;\n }\n\n // handle reverse properties\n if(property === '@reverse') {\n const referencedNode = {'@id': name};\n const reverseMap = input['@reverse'];\n for(const reverseProperty in reverseMap) {\n const items = reverseMap[reverseProperty];\n for(const item of items) {\n let itemName = item['@id'];\n if(graphTypes.isBlankNode(item)) {\n itemName = issuer.getId(itemName);\n }\n api.createNodeMap(item, graphs, graph, issuer, itemName);\n util.addValue(\n subjects[itemName], reverseProperty, referencedNode,\n {propertyIsArray: true, allowDuplicate: false});\n }\n }\n continue;\n }\n\n // recurse into graph\n if(property === '@graph') {\n // add graph subjects map entry\n if(!(name in graphs)) {\n graphs[name] = {};\n }\n api.createNodeMap(input[property], graphs, name, issuer);\n continue;\n }\n\n // recurse into included\n if(property === '@included') {\n api.createNodeMap(input[property], graphs, graph, issuer);\n continue;\n }\n\n // copy non-@type keywords\n if(property !== '@type' && isKeyword(property)) {\n if(property === '@index' && property in subject &&\n (input[property] !== subject[property] ||\n input[property]['@id'] !== subject[property]['@id'])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; conflicting @index property detected.',\n 'jsonld.SyntaxError',\n {code: 'conflicting indexes', subject});\n }\n subject[property] = input[property];\n continue;\n }\n\n // iterate over objects\n const objects = input[property];\n\n // if property is a bnode, assign it a new id\n if(property.indexOf('_:') === 0) {\n property = issuer.getId(property);\n }\n\n // ensure property is added for empty arrays\n if(objects.length === 0) {\n util.addValue(subject, property, [], {propertyIsArray: true});\n continue;\n }\n for(let o of objects) {\n if(property === '@type') {\n // rename @type blank nodes\n o = (o.indexOf('_:') === 0) ? issuer.getId(o) : o;\n }\n\n // handle embedded subject or subject reference\n if(graphTypes.isSubject(o) || graphTypes.isSubjectReference(o)) {\n // skip null @id\n if('@id' in o && !o['@id']) {\n continue;\n }\n\n // relabel blank node @id\n const id = graphTypes.isBlankNode(o) ?\n issuer.getId(o['@id']) : o['@id'];\n\n // add reference and recurse\n util.addValue(\n subject, property, {'@id': id},\n {propertyIsArray: true, allowDuplicate: false});\n api.createNodeMap(o, graphs, graph, issuer, id);\n } else if(graphTypes.isValue(o)) {\n util.addValue(\n subject, property, o,\n {propertyIsArray: true, allowDuplicate: false});\n } else if(graphTypes.isList(o)) {\n // handle @list\n const _list = [];\n api.createNodeMap(o['@list'], graphs, graph, issuer, name, _list);\n o = {'@list': _list};\n util.addValue(\n subject, property, o,\n {propertyIsArray: true, allowDuplicate: false});\n } else {\n // handle @value\n api.createNodeMap(o, graphs, graph, issuer, name);\n util.addValue(\n subject, property, o, {propertyIsArray: true, allowDuplicate: false});\n }\n }\n }\n};\n\n/**\n * Merge separate named graphs into a single merged graph including\n * all nodes from the default graph and named graphs.\n *\n * @param graphs a map of graph name to subject map.\n *\n * @return the merged graph map.\n */\napi.mergeNodeMapGraphs = graphs => {\n const merged = {};\n for(const name of Object.keys(graphs).sort()) {\n for(const id of Object.keys(graphs[name]).sort()) {\n const node = graphs[name][id];\n if(!(id in merged)) {\n merged[id] = {'@id': id};\n }\n const mergedNode = merged[id];\n\n for(const property of Object.keys(node).sort()) {\n if(isKeyword(property) && property !== '@type') {\n // copy keywords\n mergedNode[property] = util.clone(node[property]);\n } else {\n // merge objects\n for(const value of node[property]) {\n util.addValue(\n mergedNode, property, util.clone(value),\n {propertyIsArray: true, allowDuplicate: false});\n }\n }\n }\n }\n }\n\n return merged;\n};\n\napi.mergeNodeMaps = graphs => {\n // add all non-default graphs to default graph\n const defaultGraph = graphs['@default'];\n const graphNames = Object.keys(graphs).sort();\n for(const graphName of graphNames) {\n if(graphName === '@default') {\n continue;\n }\n const nodeMap = graphs[graphName];\n let subject = defaultGraph[graphName];\n if(!subject) {\n defaultGraph[graphName] = subject = {\n '@id': graphName,\n '@graph': []\n };\n } else if(!('@graph' in subject)) {\n subject['@graph'] = [];\n }\n const graph = subject['@graph'];\n for(const id of Object.keys(nodeMap).sort()) {\n const node = nodeMap[id];\n // only add full subjects\n if(!graphTypes.isSubjectReference(node)) {\n graph.push(node);\n }\n }\n }\n return defaultGraph;\n};\n","/*\n * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst xhrLoader = require('./documentLoaders/xhr');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Setup browser document loaders.\n *\n * @param jsonld the jsonld api.\n */\napi.setupDocumentLoaders = function(jsonld) {\n if(typeof XMLHttpRequest !== 'undefined') {\n jsonld.documentLoaders.xhr = xhrLoader;\n // use xhr document loader by default\n jsonld.useDocumentLoader('xhr');\n }\n};\n\n/**\n * Setup browser globals.\n *\n * @param jsonld the jsonld api.\n */\napi.setupGlobals = function(jsonld) {\n // setup browser global JsonLdProcessor\n if(typeof globalThis.JsonLdProcessor === 'undefined') {\n Object.defineProperty(globalThis, 'JsonLdProcessor', {\n writable: true,\n enumerable: false,\n configurable: true,\n value: jsonld.JsonLdProcessor\n });\n }\n};\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst {createNodeMap} = require('./nodeMap');\nconst {isKeyword} = require('./context');\nconst graphTypes = require('./graphTypes');\nconst jsonCanonicalize = require('canonicalize');\nconst types = require('./types');\nconst util = require('./util');\n\nconst {\n handleEvent: _handleEvent\n} = require('./events');\n\nconst {\n // RDF,\n // RDF_LIST,\n RDF_FIRST,\n RDF_REST,\n RDF_NIL,\n RDF_TYPE,\n // RDF_PLAIN_LITERAL,\n // RDF_XML_LITERAL,\n RDF_JSON_LITERAL,\n // RDF_OBJECT,\n RDF_LANGSTRING,\n\n // XSD,\n XSD_BOOLEAN,\n XSD_DOUBLE,\n XSD_INTEGER,\n XSD_STRING,\n} = require('./constants');\n\nconst {\n isAbsolute: _isAbsoluteIri\n} = require('./url');\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Outputs an RDF dataset for the expanded JSON-LD input.\n *\n * @param input the expanded JSON-LD input.\n * @param options the RDF serialization options.\n *\n * @return the RDF dataset.\n */\napi.toRDF = (input, options) => {\n // create node map for default graph (and any named graphs)\n const issuer = new util.IdentifierIssuer('_:b');\n const nodeMap = {'@default': {}};\n createNodeMap(input, nodeMap, '@default', issuer);\n\n const dataset = [];\n const graphNames = Object.keys(nodeMap).sort();\n for(const graphName of graphNames) {\n let graphTerm;\n if(graphName === '@default') {\n graphTerm = {termType: 'DefaultGraph', value: ''};\n } else if(_isAbsoluteIri(graphName)) {\n if(graphName.startsWith('_:')) {\n graphTerm = {termType: 'BlankNode'};\n } else {\n graphTerm = {termType: 'NamedNode'};\n }\n graphTerm.value = graphName;\n } else {\n // skip relative IRIs (not valid RDF)\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative graph reference',\n level: 'warning',\n message: 'Relative graph reference found.',\n details: {\n graph: graphName\n }\n },\n options\n });\n }\n continue;\n }\n _graphToRDF(dataset, nodeMap[graphName], graphTerm, issuer, options);\n }\n\n return dataset;\n};\n\n/**\n * Adds RDF quads for a particular graph to the given dataset.\n *\n * @param dataset the dataset to append RDF quads to.\n * @param graph the graph to create RDF quads for.\n * @param graphTerm the graph term for each quad.\n * @param issuer a IdentifierIssuer for assigning blank node names.\n * @param options the RDF serialization options.\n *\n * @return the array of RDF triples for the given graph.\n */\nfunction _graphToRDF(dataset, graph, graphTerm, issuer, options) {\n const ids = Object.keys(graph).sort();\n for(const id of ids) {\n const node = graph[id];\n const properties = Object.keys(node).sort();\n for(let property of properties) {\n const items = node[property];\n if(property === '@type') {\n property = RDF_TYPE;\n } else if(isKeyword(property)) {\n continue;\n }\n\n for(const item of items) {\n // RDF subject\n const subject = {\n termType: id.startsWith('_:') ? 'BlankNode' : 'NamedNode',\n value: id\n };\n\n // skip relative IRI subjects (not valid RDF)\n if(!_isAbsoluteIri(id)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative subject reference',\n level: 'warning',\n message: 'Relative subject reference found.',\n details: {\n subject: id\n }\n },\n options\n });\n }\n continue;\n }\n\n // RDF predicate\n const predicate = {\n termType: property.startsWith('_:') ? 'BlankNode' : 'NamedNode',\n value: property\n };\n\n // skip relative IRI predicates (not valid RDF)\n if(!_isAbsoluteIri(property)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative predicate reference',\n level: 'warning',\n message: 'Relative predicate reference found.',\n details: {\n predicate: property\n }\n },\n options\n });\n }\n continue;\n }\n\n // skip blank node predicates unless producing generalized RDF\n if(predicate.termType === 'BlankNode' &&\n !options.produceGeneralizedRdf) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'blank node predicate',\n level: 'warning',\n message: 'Dropping blank node predicate.',\n details: {\n // FIXME: add better issuer API to get reverse mapping\n property: issuer.getOldIds()\n .find(key => issuer.getId(key) === property)\n }\n },\n options\n });\n }\n continue;\n }\n\n // convert list, value or node object to triple\n const object = _objectToRDF(\n item, issuer, dataset, graphTerm, options.rdfDirection, options);\n // skip null objects (they are relative IRIs)\n if(object) {\n dataset.push({\n subject,\n predicate,\n object,\n graph: graphTerm\n });\n }\n }\n }\n }\n}\n\n/**\n * Converts a @list value into linked list of blank node RDF quads\n * (an RDF collection).\n *\n * @param list the @list value.\n * @param issuer a IdentifierIssuer for assigning blank node names.\n * @param dataset the array of quads to append to.\n * @param graphTerm the graph term for each quad.\n * @param options the RDF serialization options.\n *\n * @return the head of the list.\n */\nfunction _listToRDF(list, issuer, dataset, graphTerm, rdfDirection, options) {\n const first = {termType: 'NamedNode', value: RDF_FIRST};\n const rest = {termType: 'NamedNode', value: RDF_REST};\n const nil = {termType: 'NamedNode', value: RDF_NIL};\n\n const last = list.pop();\n // Result is the head of the list\n const result = last ? {termType: 'BlankNode', value: issuer.getId()} : nil;\n let subject = result;\n\n for(const item of list) {\n const object = _objectToRDF(\n item, issuer, dataset, graphTerm, rdfDirection, options);\n const next = {termType: 'BlankNode', value: issuer.getId()};\n dataset.push({\n subject,\n predicate: first,\n object,\n graph: graphTerm\n });\n dataset.push({\n subject,\n predicate: rest,\n object: next,\n graph: graphTerm\n });\n subject = next;\n }\n\n // Tail of list\n if(last) {\n const object = _objectToRDF(\n last, issuer, dataset, graphTerm, rdfDirection, options);\n dataset.push({\n subject,\n predicate: first,\n object,\n graph: graphTerm\n });\n dataset.push({\n subject,\n predicate: rest,\n object: nil,\n graph: graphTerm\n });\n }\n\n return result;\n}\n\n/**\n * Converts a JSON-LD value object to an RDF literal or a JSON-LD string,\n * node object to an RDF resource, or adds a list.\n *\n * @param item the JSON-LD value or node object.\n * @param issuer a IdentifierIssuer for assigning blank node names.\n * @param dataset the dataset to append RDF quads to.\n * @param graphTerm the graph term for each quad.\n * @param options the RDF serialization options.\n *\n * @return the RDF literal or RDF resource.\n */\nfunction _objectToRDF(\n item, issuer, dataset, graphTerm, rdfDirection, options\n) {\n const object = {};\n\n // convert value object to RDF\n if(graphTypes.isValue(item)) {\n object.termType = 'Literal';\n object.value = undefined;\n object.datatype = {\n termType: 'NamedNode'\n };\n let value = item['@value'];\n const datatype = item['@type'] || null;\n\n // convert to XSD/JSON datatypes as appropriate\n if(datatype === '@json') {\n object.value = jsonCanonicalize(value);\n object.datatype.value = RDF_JSON_LITERAL;\n } else if(types.isBoolean(value)) {\n object.value = value.toString();\n object.datatype.value = datatype || XSD_BOOLEAN;\n } else if(types.isDouble(value) || datatype === XSD_DOUBLE) {\n if(!types.isDouble(value)) {\n value = parseFloat(value);\n }\n // canonical double representation\n object.value = value.toExponential(15).replace(/(\\d)0*e\\+?/, '$1E');\n object.datatype.value = datatype || XSD_DOUBLE;\n } else if(types.isNumber(value)) {\n object.value = value.toFixed(0);\n object.datatype.value = datatype || XSD_INTEGER;\n } else if(rdfDirection === 'i18n-datatype' &&\n '@direction' in item) {\n const datatype = 'https://www.w3.org/ns/i18n#' +\n (item['@language'] || '') +\n `_${item['@direction']}`;\n object.datatype.value = datatype;\n object.value = value;\n } else if('@language' in item) {\n object.value = value;\n object.datatype.value = datatype || RDF_LANGSTRING;\n object.language = item['@language'];\n } else {\n object.value = value;\n object.datatype.value = datatype || XSD_STRING;\n }\n } else if(graphTypes.isList(item)) {\n const _list = _listToRDF(\n item['@list'], issuer, dataset, graphTerm, rdfDirection, options);\n object.termType = _list.termType;\n object.value = _list.value;\n } else {\n // convert string/node object to RDF\n const id = types.isObject(item) ? item['@id'] : item;\n object.termType = id.startsWith('_:') ? 'BlankNode' : 'NamedNode';\n object.value = id;\n }\n\n // skip relative IRIs, not valid RDF\n if(object.termType === 'NamedNode' && !_isAbsoluteIri(object.value)) {\n if(options.eventHandler) {\n _handleEvent({\n event: {\n type: ['JsonLdEvent'],\n code: 'relative object reference',\n level: 'warning',\n message: 'Relative object reference found.',\n details: {\n object: object.value\n }\n },\n options\n });\n }\n return null;\n }\n\n return object;\n}\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst api = {};\nmodule.exports = api;\n\n/**\n * Returns true if the given value is an Array.\n *\n * @param v the value to check.\n *\n * @return true if the value is an Array, false if not.\n */\napi.isArray = Array.isArray;\n\n/**\n * Returns true if the given value is a Boolean.\n *\n * @param v the value to check.\n *\n * @return true if the value is a Boolean, false if not.\n */\napi.isBoolean = v => (typeof v === 'boolean' ||\n Object.prototype.toString.call(v) === '[object Boolean]');\n\n/**\n * Returns true if the given value is a double.\n *\n * @param v the value to check.\n *\n * @return true if the value is a double, false if not.\n */\napi.isDouble = v => api.isNumber(v) &&\n (String(v).indexOf('.') !== -1 || Math.abs(v) >= 1e21);\n\n/**\n * Returns true if the given value is an empty Object.\n *\n * @param v the value to check.\n *\n * @return true if the value is an empty Object, false if not.\n */\napi.isEmptyObject = v => api.isObject(v) && Object.keys(v).length === 0;\n\n/**\n * Returns true if the given value is a Number.\n *\n * @param v the value to check.\n *\n * @return true if the value is a Number, false if not.\n */\napi.isNumber = v => (typeof v === 'number' ||\n Object.prototype.toString.call(v) === '[object Number]');\n\n/**\n * Returns true if the given value is numeric.\n *\n * @param v the value to check.\n *\n * @return true if the value is numeric, false if not.\n */\napi.isNumeric = v => !isNaN(parseFloat(v)) && isFinite(v);\n\n/**\n * Returns true if the given value is an Object.\n *\n * @param v the value to check.\n *\n * @return true if the value is an Object, false if not.\n */\napi.isObject = v => Object.prototype.toString.call(v) === '[object Object]';\n\n/**\n * Returns true if the given value is a String.\n *\n * @param v the value to check.\n *\n * @return true if the value is a String, false if not.\n */\napi.isString = v => (typeof v === 'string' ||\n Object.prototype.toString.call(v) === '[object String]');\n\n/**\n * Returns true if the given value is undefined.\n *\n * @param v the value to check.\n *\n * @return true if the value is undefined, false if not.\n */\napi.isUndefined = v => typeof v === 'undefined';\n","/*\n * Copyright (c) 2017 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst types = require('./types');\n\nconst api = {};\nmodule.exports = api;\n\n// define URL parser\n// parseUri 1.2.2\n// (c) Steven Levithan \n// MIT License\n// with local jsonld.js modifications\napi.parsers = {\n simple: {\n // RFC 3986 basic parts\n keys: [\n 'href', 'scheme', 'authority', 'path', 'query', 'fragment'\n ],\n /* eslint-disable-next-line max-len */\n regex: /^(?:([^:\\/?#]+):)?(?:\\/\\/([^\\/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/\n },\n full: {\n keys: [\n 'href', 'protocol', 'scheme', 'authority', 'auth', 'user', 'password',\n 'hostname', 'port', 'path', 'directory', 'file', 'query', 'fragment'\n ],\n /* eslint-disable-next-line max-len */\n regex: /^(([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?(?:(((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\napi.parse = (str, parser) => {\n const parsed = {};\n const o = api.parsers[parser || 'full'];\n const m = o.regex.exec(str);\n let i = o.keys.length;\n while(i--) {\n parsed[o.keys[i]] = (m[i] === undefined) ? null : m[i];\n }\n\n // remove default ports in found in URLs\n if((parsed.scheme === 'https' && parsed.port === '443') ||\n (parsed.scheme === 'http' && parsed.port === '80')) {\n parsed.href = parsed.href.replace(':' + parsed.port, '');\n parsed.authority = parsed.authority.replace(':' + parsed.port, '');\n parsed.port = null;\n }\n\n parsed.normalizedPath = api.removeDotSegments(parsed.path);\n return parsed;\n};\n\n/**\n * Prepends a base IRI to the given relative IRI.\n *\n * @param base the base IRI.\n * @param iri the relative IRI.\n *\n * @return the absolute IRI.\n */\napi.prependBase = (base, iri) => {\n // skip IRI processing\n if(base === null) {\n return iri;\n }\n // already an absolute IRI\n if(api.isAbsolute(iri)) {\n return iri;\n }\n\n // parse base if it is a string\n if(!base || types.isString(base)) {\n base = api.parse(base || '');\n }\n\n // parse given IRI\n const rel = api.parse(iri);\n\n // per RFC3986 5.2.2\n const transform = {\n protocol: base.protocol || ''\n };\n\n if(rel.authority !== null) {\n transform.authority = rel.authority;\n transform.path = rel.path;\n transform.query = rel.query;\n } else {\n transform.authority = base.authority;\n\n if(rel.path === '') {\n transform.path = base.path;\n if(rel.query !== null) {\n transform.query = rel.query;\n } else {\n transform.query = base.query;\n }\n } else {\n if(rel.path.indexOf('/') === 0) {\n // IRI represents an absolute path\n transform.path = rel.path;\n } else {\n // merge paths\n let path = base.path;\n\n // append relative path to the end of the last directory from base\n path = path.substr(0, path.lastIndexOf('/') + 1);\n if((path.length > 0 || base.authority) && path.substr(-1) !== '/') {\n path += '/';\n }\n path += rel.path;\n\n transform.path = path;\n }\n transform.query = rel.query;\n }\n }\n\n if(rel.path !== '') {\n // remove slashes and dots in path\n transform.path = api.removeDotSegments(transform.path);\n }\n\n // construct URL\n let rval = transform.protocol;\n if(transform.authority !== null) {\n rval += '//' + transform.authority;\n }\n rval += transform.path;\n if(transform.query !== null) {\n rval += '?' + transform.query;\n }\n if(rel.fragment !== null) {\n rval += '#' + rel.fragment;\n }\n\n // handle empty base\n if(rval === '') {\n rval = './';\n }\n\n return rval;\n};\n\n/**\n * Removes a base IRI from the given absolute IRI.\n *\n * @param base the base IRI.\n * @param iri the absolute IRI.\n *\n * @return the relative IRI if relative to base, otherwise the absolute IRI.\n */\napi.removeBase = (base, iri) => {\n // skip IRI processing\n if(base === null) {\n return iri;\n }\n\n if(!base || types.isString(base)) {\n base = api.parse(base || '');\n }\n\n // establish base root\n let root = '';\n if(base.href !== '') {\n root += (base.protocol || '') + '//' + (base.authority || '');\n } else if(iri.indexOf('//')) {\n // support network-path reference with empty base\n root += '//';\n }\n\n // IRI not relative to base\n if(iri.indexOf(root) !== 0) {\n return iri;\n }\n\n // remove root from IRI and parse remainder\n const rel = api.parse(iri.substr(root.length));\n\n // remove path segments that match (do not remove last segment unless there\n // is a hash or query)\n const baseSegments = base.normalizedPath.split('/');\n const iriSegments = rel.normalizedPath.split('/');\n const last = (rel.fragment || rel.query) ? 0 : 1;\n while(baseSegments.length > 0 && iriSegments.length > last) {\n if(baseSegments[0] !== iriSegments[0]) {\n break;\n }\n baseSegments.shift();\n iriSegments.shift();\n }\n\n // use '../' for each non-matching base segment\n let rval = '';\n if(baseSegments.length > 0) {\n // don't count the last segment (if it ends with '/' last path doesn't\n // count and if it doesn't end with '/' it isn't a path)\n baseSegments.pop();\n for(let i = 0; i < baseSegments.length; ++i) {\n rval += '../';\n }\n }\n\n // prepend remaining segments\n rval += iriSegments.join('/');\n\n // add query and hash\n if(rel.query !== null) {\n rval += '?' + rel.query;\n }\n if(rel.fragment !== null) {\n rval += '#' + rel.fragment;\n }\n\n // handle empty base\n if(rval === '') {\n rval = './';\n }\n\n return rval;\n};\n\n/**\n * Removes dot segments from a URL path.\n *\n * @param path the path to remove dot segments from.\n */\napi.removeDotSegments = path => {\n // RFC 3986 5.2.4 (reworked)\n\n // empty path shortcut\n if(path.length === 0) {\n return '';\n }\n\n const input = path.split('/');\n const output = [];\n\n while(input.length > 0) {\n const next = input.shift();\n const done = input.length === 0;\n\n if(next === '.') {\n if(done) {\n // ensure output has trailing /\n output.push('');\n }\n continue;\n }\n\n if(next === '..') {\n output.pop();\n if(done) {\n // ensure output has trailing /\n output.push('');\n }\n continue;\n }\n\n output.push(next);\n }\n\n // if path was absolute, ensure output has leading /\n if(path[0] === '/' && output.length > 0 && output[0] !== '') {\n output.unshift('');\n }\n if(output.length === 1 && output[0] === '') {\n return '/';\n }\n\n return output.join('/');\n};\n\n// TODO: time better isAbsolute/isRelative checks using full regexes:\n// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html\n\n// regex to check for absolute IRI (starting scheme and ':') or blank node IRI\nconst isAbsoluteRegex = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^\\s]*$/;\n\n/**\n * Returns true if the given value is an absolute IRI or blank node IRI, false\n * if not.\n * Note: This weak check only checks for a correct starting scheme.\n *\n * @param v the value to check.\n *\n * @return true if the value is an absolute IRI, false if not.\n */\napi.isAbsolute = v => types.isString(v) && isAbsoluteRegex.test(v);\n\n/**\n * Returns true if the given value is a relative IRI, false if not.\n * Note: this is a weak check.\n *\n * @param v the value to check.\n *\n * @return true if the value is a relative IRI, false if not.\n */\napi.isRelative = v => types.isString(v);\n","/*\n * Copyright (c) 2017-2019 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst graphTypes = require('./graphTypes');\nconst types = require('./types');\n// TODO: move `IdentifierIssuer` to its own package\nconst IdentifierIssuer = require('rdf-canonize').IdentifierIssuer;\nconst JsonLdError = require('./JsonLdError');\n\n// constants\nconst REGEX_BCP47 = /^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;\nconst REGEX_LINK_HEADERS = /(?:<[^>]*?>|\"[^\"]*?\"|[^,])+/g;\nconst REGEX_LINK_HEADER = /\\s*<([^>]*?)>\\s*(?:;\\s*(.*))?/;\nconst REGEX_LINK_HEADER_PARAMS =\n /(.*?)=(?:(?:\"([^\"]*?)\")|([^\"]*?))\\s*(?:(?:;\\s*)|$)/g;\nconst REGEX_KEYWORD = /^@[a-zA-Z]+$/;\n\nconst DEFAULTS = {\n headers: {\n accept: 'application/ld+json, application/json'\n }\n};\n\nconst api = {};\nmodule.exports = api;\napi.IdentifierIssuer = IdentifierIssuer;\napi.REGEX_BCP47 = REGEX_BCP47;\napi.REGEX_KEYWORD = REGEX_KEYWORD;\n\n/**\n * Clones an object, array, Map, Set, or string/number. If a typed JavaScript\n * object is given, such as a Date, it will be converted to a string.\n *\n * @param value the value to clone.\n *\n * @return the cloned value.\n */\napi.clone = function(value) {\n if(value && typeof value === 'object') {\n let rval;\n if(types.isArray(value)) {\n rval = [];\n for(let i = 0; i < value.length; ++i) {\n rval[i] = api.clone(value[i]);\n }\n } else if(value instanceof Map) {\n rval = new Map();\n for(const [k, v] of value) {\n rval.set(k, api.clone(v));\n }\n } else if(value instanceof Set) {\n rval = new Set();\n for(const v of value) {\n rval.add(api.clone(v));\n }\n } else if(types.isObject(value)) {\n rval = {};\n for(const key in value) {\n rval[key] = api.clone(value[key]);\n }\n } else {\n rval = value.toString();\n }\n return rval;\n }\n return value;\n};\n\n/**\n * Ensure a value is an array. If the value is an array, it is returned.\n * Otherwise, it is wrapped in an array.\n *\n * @param value the value to return as an array.\n *\n * @return the value as an array.\n */\napi.asArray = function(value) {\n return Array.isArray(value) ? value : [value];\n};\n\n/**\n * Builds an HTTP headers object for making a JSON-LD request from custom\n * headers and asserts the `accept` header isn't overridden.\n *\n * @param headers an object of headers with keys as header names and values\n * as header values.\n *\n * @return an object of headers with a valid `accept` header.\n */\napi.buildHeaders = (headers = {}) => {\n const hasAccept = Object.keys(headers).some(\n h => h.toLowerCase() === 'accept');\n\n if(hasAccept) {\n throw new RangeError(\n 'Accept header may not be specified; only \"' +\n DEFAULTS.headers.accept + '\" is supported.');\n }\n\n return Object.assign({Accept: DEFAULTS.headers.accept}, headers);\n};\n\n/**\n * Parses a link header. The results will be key'd by the value of \"rel\".\n *\n * Link: ;\n * rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"\n *\n * Parses as: {\n * 'http://www.w3.org/ns/json-ld#context': {\n * target: http://json-ld.org/contexts/person.jsonld,\n * type: 'application/ld+json'\n * }\n * }\n *\n * If there is more than one \"rel\" with the same IRI, then entries in the\n * resulting map for that \"rel\" will be arrays.\n *\n * @param header the link header to parse.\n */\napi.parseLinkHeader = header => {\n const rval = {};\n // split on unbracketed/unquoted commas\n const entries = header.match(REGEX_LINK_HEADERS);\n for(let i = 0; i < entries.length; ++i) {\n let match = entries[i].match(REGEX_LINK_HEADER);\n if(!match) {\n continue;\n }\n const result = {target: match[1]};\n const params = match[2];\n while((match = REGEX_LINK_HEADER_PARAMS.exec(params))) {\n result[match[1]] = (match[2] === undefined) ? match[3] : match[2];\n }\n const rel = result.rel || '';\n if(Array.isArray(rval[rel])) {\n rval[rel].push(result);\n } else if(rval.hasOwnProperty(rel)) {\n rval[rel] = [rval[rel], result];\n } else {\n rval[rel] = result;\n }\n }\n return rval;\n};\n\n/**\n * Throws an exception if the given value is not a valid @type value.\n *\n * @param v the value to check.\n */\napi.validateTypeValue = (v, isFrame) => {\n if(types.isString(v)) {\n return;\n }\n\n if(types.isArray(v) && v.every(vv => types.isString(vv))) {\n return;\n }\n if(isFrame && types.isObject(v)) {\n switch(Object.keys(v).length) {\n case 0:\n // empty object is wildcard\n return;\n case 1:\n // default entry is all strings\n if('@default' in v &&\n api.asArray(v['@default']).every(vv => types.isString(vv))) {\n return;\n }\n }\n }\n\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; \"@type\" value must a string, an array of ' +\n 'strings, an empty object, ' +\n 'or a default object.', 'jsonld.SyntaxError',\n {code: 'invalid type value', value: v});\n};\n\n/**\n * Returns true if the given subject has the given property.\n *\n * @param subject the subject to check.\n * @param property the property to look for.\n *\n * @return true if the subject has the given property, false if not.\n */\napi.hasProperty = (subject, property) => {\n if(subject.hasOwnProperty(property)) {\n const value = subject[property];\n return (!types.isArray(value) || value.length > 0);\n }\n return false;\n};\n\n/**\n * Determines if the given value is a property of the given subject.\n *\n * @param subject the subject to check.\n * @param property the property to check.\n * @param value the value to check.\n *\n * @return true if the value exists, false if not.\n */\napi.hasValue = (subject, property, value) => {\n if(api.hasProperty(subject, property)) {\n let val = subject[property];\n const isList = graphTypes.isList(val);\n if(types.isArray(val) || isList) {\n if(isList) {\n val = val['@list'];\n }\n for(let i = 0; i < val.length; ++i) {\n if(api.compareValues(value, val[i])) {\n return true;\n }\n }\n } else if(!types.isArray(value)) {\n // avoid matching the set of values with an array value parameter\n return api.compareValues(value, val);\n }\n }\n return false;\n};\n\n/**\n * Adds a value to a subject. If the value is an array, all values in the\n * array will be added.\n *\n * @param subject the subject to add the value to.\n * @param property the property that relates the value to the subject.\n * @param value the value to add.\n * @param [options] the options to use:\n * [propertyIsArray] true if the property is always an array, false\n * if not (default: false).\n * [valueIsArray] true if the value to be added should be preserved as\n * an array (lists) (default: false).\n * [allowDuplicate] true to allow duplicates, false not to (uses a\n * simple shallow comparison of subject ID or value) (default: true).\n * [prependValue] false to prepend value to any existing values.\n * (default: false)\n */\napi.addValue = (subject, property, value, options) => {\n options = options || {};\n if(!('propertyIsArray' in options)) {\n options.propertyIsArray = false;\n }\n if(!('valueIsArray' in options)) {\n options.valueIsArray = false;\n }\n if(!('allowDuplicate' in options)) {\n options.allowDuplicate = true;\n }\n if(!('prependValue' in options)) {\n options.prependValue = false;\n }\n\n if(options.valueIsArray) {\n subject[property] = value;\n } else if(types.isArray(value)) {\n if(value.length === 0 && options.propertyIsArray &&\n !subject.hasOwnProperty(property)) {\n subject[property] = [];\n }\n if(options.prependValue) {\n value = value.concat(subject[property]);\n subject[property] = [];\n }\n for(let i = 0; i < value.length; ++i) {\n api.addValue(subject, property, value[i], options);\n }\n } else if(subject.hasOwnProperty(property)) {\n // check if subject already has value if duplicates not allowed\n const hasValue = (!options.allowDuplicate &&\n api.hasValue(subject, property, value));\n\n // make property an array if value not present or always an array\n if(!types.isArray(subject[property]) &&\n (!hasValue || options.propertyIsArray)) {\n subject[property] = [subject[property]];\n }\n\n // add new value\n if(!hasValue) {\n if(options.prependValue) {\n subject[property].unshift(value);\n } else {\n subject[property].push(value);\n }\n }\n } else {\n // add new value as set or single value\n subject[property] = options.propertyIsArray ? [value] : value;\n }\n};\n\n/**\n * Gets all of the values for a subject's property as an array.\n *\n * @param subject the subject.\n * @param property the property.\n *\n * @return all of the values for a subject's property as an array.\n */\napi.getValues = (subject, property) => [].concat(subject[property] || []);\n\n/**\n * Removes a property from a subject.\n *\n * @param subject the subject.\n * @param property the property.\n */\napi.removeProperty = (subject, property) => {\n delete subject[property];\n};\n\n/**\n * Removes a value from a subject.\n *\n * @param subject the subject.\n * @param property the property that relates the value to the subject.\n * @param value the value to remove.\n * @param [options] the options to use:\n * [propertyIsArray] true if the property is always an array, false\n * if not (default: false).\n */\napi.removeValue = (subject, property, value, options) => {\n options = options || {};\n if(!('propertyIsArray' in options)) {\n options.propertyIsArray = false;\n }\n\n // filter out value\n const values = api.getValues(subject, property).filter(\n e => !api.compareValues(e, value));\n\n if(values.length === 0) {\n api.removeProperty(subject, property);\n } else if(values.length === 1 && !options.propertyIsArray) {\n subject[property] = values[0];\n } else {\n subject[property] = values;\n }\n};\n\n/**\n * Relabels all blank nodes in the given JSON-LD input.\n *\n * @param input the JSON-LD input.\n * @param [options] the options to use:\n * [issuer] an IdentifierIssuer to use to label blank nodes.\n */\napi.relabelBlankNodes = (input, options) => {\n options = options || {};\n const issuer = options.issuer || new IdentifierIssuer('_:b');\n return _labelBlankNodes(issuer, input);\n};\n\n/**\n * Compares two JSON-LD values for equality. Two JSON-LD values will be\n * considered equal if:\n *\n * 1. They are both primitives of the same type and value.\n * 2. They are both @values with the same @value, @type, @language,\n * and @index, OR\n * 3. They both have @ids they are the same.\n *\n * @param v1 the first value.\n * @param v2 the second value.\n *\n * @return true if v1 and v2 are considered equal, false if not.\n */\napi.compareValues = (v1, v2) => {\n // 1. equal primitives\n if(v1 === v2) {\n return true;\n }\n\n // 2. equal @values\n if(graphTypes.isValue(v1) && graphTypes.isValue(v2) &&\n v1['@value'] === v2['@value'] &&\n v1['@type'] === v2['@type'] &&\n v1['@language'] === v2['@language'] &&\n v1['@index'] === v2['@index']) {\n return true;\n }\n\n // 3. equal @ids\n if(types.isObject(v1) &&\n ('@id' in v1) &&\n types.isObject(v2) &&\n ('@id' in v2)) {\n return v1['@id'] === v2['@id'];\n }\n\n return false;\n};\n\n/**\n * Compares two strings first based on length and then lexicographically.\n *\n * @param a the first string.\n * @param b the second string.\n *\n * @return -1 if a < b, 1 if a > b, 0 if a === b.\n */\napi.compareShortestLeast = (a, b) => {\n if(a.length < b.length) {\n return -1;\n }\n if(b.length < a.length) {\n return 1;\n }\n if(a === b) {\n return 0;\n }\n return (a < b) ? -1 : 1;\n};\n\n/**\n * Labels the blank nodes in the given value using the given IdentifierIssuer.\n *\n * @param issuer the IdentifierIssuer to use.\n * @param element the element with blank nodes to rename.\n *\n * @return the element.\n */\nfunction _labelBlankNodes(issuer, element) {\n if(types.isArray(element)) {\n for(let i = 0; i < element.length; ++i) {\n element[i] = _labelBlankNodes(issuer, element[i]);\n }\n } else if(graphTypes.isList(element)) {\n element['@list'] = _labelBlankNodes(issuer, element['@list']);\n } else if(types.isObject(element)) {\n // relabel blank node\n if(graphTypes.isBlankNode(element)) {\n element['@id'] = issuer.getId(element['@id']);\n }\n\n // recursively apply to all keys\n const keys = Object.keys(element).sort();\n for(let ki = 0; ki < keys.length; ++ki) {\n const key = keys[ki];\n if(key !== '@id') {\n element[key] = _labelBlankNodes(issuer, element[key]);\n }\n }\n }\n\n return element;\n}\n","'use strict'\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = require('yallist')\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n","/**\n * An implementation of the RDF Dataset Normalization specification.\n *\n * @author Dave Longley\n *\n * Copyright 2010-2021 Digital Bazaar, Inc.\n */\nmodule.exports = require('./lib');\n","/*\n * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class IdentifierIssuer {\n /**\n * Creates a new IdentifierIssuer. A IdentifierIssuer issues unique\n * identifiers, keeping track of any previously issued identifiers.\n *\n * @param prefix the prefix to use ('').\n * @param existing an existing Map to use.\n * @param counter the counter to use.\n */\n constructor(prefix, existing = new Map(), counter = 0) {\n this.prefix = prefix;\n this._existing = existing;\n this.counter = counter;\n }\n\n /**\n * Copies this IdentifierIssuer.\n *\n * @return a copy of this IdentifierIssuer.\n */\n clone() {\n const {prefix, _existing, counter} = this;\n return new IdentifierIssuer(prefix, new Map(_existing), counter);\n }\n\n /**\n * Gets the new identifier for the given old identifier, where if no old\n * identifier is given a new identifier will be generated.\n *\n * @param [old] the old identifier to get the new identifier for.\n *\n * @return the new identifier.\n */\n getId(old) {\n // return existing old identifier\n const existing = old && this._existing.get(old);\n if(existing) {\n return existing;\n }\n\n // get next identifier\n const identifier = this.prefix + this.counter;\n this.counter++;\n\n // save mapping\n if(old) {\n this._existing.set(old, identifier);\n }\n\n return identifier;\n }\n\n /**\n * Returns true if the given old identifer has already been assigned a new\n * identifier.\n *\n * @param old the old identifier to check.\n *\n * @return true if the old identifier has been assigned a new identifier,\n * false if not.\n */\n hasId(old) {\n return this._existing.has(old);\n }\n\n /**\n * Returns all of the IDs that have been issued new IDs in the order in\n * which they were issued new IDs.\n *\n * @return the list of old IDs that has been issued new IDs in order.\n */\n getOldIds() {\n return [...this._existing.keys()];\n }\n};\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nrequire('setimmediate');\n\nconst crypto = self.crypto || self.msCrypto;\n\nmodule.exports = class MessageDigest {\n /**\n * Creates a new MessageDigest.\n *\n * @param algorithm the algorithm to use.\n */\n constructor(algorithm) {\n // check if crypto.subtle is available\n // check is here rather than top-level to only fail if class is used\n if(!(crypto && crypto.subtle)) {\n throw new Error('crypto.subtle not found.');\n }\n if(algorithm === 'sha256') {\n this.algorithm = {name: 'SHA-256'};\n } else if(algorithm === 'sha1') {\n this.algorithm = {name: 'SHA-1'};\n } else {\n throw new Error(`Unsupported algorithm \"${algorithm}\".`);\n }\n this._content = '';\n }\n\n update(msg) {\n this._content += msg;\n }\n\n async digest() {\n const data = new TextEncoder().encode(this._content);\n const buffer = new Uint8Array(\n await crypto.subtle.digest(this.algorithm, data));\n // return digest in hex\n let hex = '';\n for(let i = 0; i < buffer.length; ++i) {\n hex += buffer[i].toString(16).padStart(2, '0');\n }\n return hex;\n }\n};\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\n// eslint-disable-next-line no-unused-vars\nconst TERMS = ['subject', 'predicate', 'object', 'graph'];\nconst RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nconst RDF_LANGSTRING = RDF + 'langString';\nconst XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string';\n\nconst TYPE_NAMED_NODE = 'NamedNode';\nconst TYPE_BLANK_NODE = 'BlankNode';\nconst TYPE_LITERAL = 'Literal';\nconst TYPE_DEFAULT_GRAPH = 'DefaultGraph';\n\n// build regexes\nconst REGEX = {};\n(() => {\n const iri = '(?:<([^:]+:[^>]*)>)';\n // https://www.w3.org/TR/turtle/#grammar-production-BLANK_NODE_LABEL\n const PN_CHARS_BASE =\n 'A-Z' + 'a-z' +\n '\\u00C0-\\u00D6' +\n '\\u00D8-\\u00F6' +\n '\\u00F8-\\u02FF' +\n '\\u0370-\\u037D' +\n '\\u037F-\\u1FFF' +\n '\\u200C-\\u200D' +\n '\\u2070-\\u218F' +\n '\\u2C00-\\u2FEF' +\n '\\u3001-\\uD7FF' +\n '\\uF900-\\uFDCF' +\n '\\uFDF0-\\uFFFD';\n // TODO:\n //'\\u10000-\\uEFFFF';\n const PN_CHARS_U =\n PN_CHARS_BASE +\n '_';\n const PN_CHARS =\n PN_CHARS_U +\n '0-9' +\n '-' +\n '\\u00B7' +\n '\\u0300-\\u036F' +\n '\\u203F-\\u2040';\n const BLANK_NODE_LABEL =\n '(_:' +\n '(?:[' + PN_CHARS_U + '0-9])' +\n '(?:(?:[' + PN_CHARS + '.])*(?:[' + PN_CHARS + ']))?' +\n ')';\n const bnode = BLANK_NODE_LABEL;\n const plain = '\"([^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*)\"';\n const datatype = '(?:\\\\^\\\\^' + iri + ')';\n const language = '(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))';\n const literal = '(?:' + plain + '(?:' + datatype + '|' + language + ')?)';\n const ws = '[ \\\\t]+';\n const wso = '[ \\\\t]*';\n\n // define quad part regexes\n const subject = '(?:' + iri + '|' + bnode + ')' + ws;\n const property = iri + ws;\n const object = '(?:' + iri + '|' + bnode + '|' + literal + ')' + wso;\n const graphName = '(?:\\\\.|(?:(?:' + iri + '|' + bnode + ')' + wso + '\\\\.))';\n\n // end of line and empty regexes\n REGEX.eoln = /(?:\\r\\n)|(?:\\n)|(?:\\r)/g;\n REGEX.empty = new RegExp('^' + wso + '$');\n\n // full quad regex\n REGEX.quad = new RegExp(\n '^' + wso + subject + property + object + graphName + wso + '$');\n})();\n\nmodule.exports = class NQuads {\n /**\n * Parses RDF in the form of N-Quads.\n *\n * @param input the N-Quads input to parse.\n *\n * @return an RDF dataset (an array of quads per http://rdf.js.org/).\n */\n static parse(input) {\n // build RDF dataset\n const dataset = [];\n\n const graphs = {};\n\n // split N-Quad input into lines\n const lines = input.split(REGEX.eoln);\n let lineNumber = 0;\n for(const line of lines) {\n lineNumber++;\n\n // skip empty lines\n if(REGEX.empty.test(line)) {\n continue;\n }\n\n // parse quad\n const match = line.match(REGEX.quad);\n if(match === null) {\n throw new Error('N-Quads parse error on line ' + lineNumber + '.');\n }\n\n // create RDF quad\n const quad = {subject: null, predicate: null, object: null, graph: null};\n\n // get subject\n if(match[1] !== undefined) {\n quad.subject = {termType: TYPE_NAMED_NODE, value: match[1]};\n } else {\n quad.subject = {termType: TYPE_BLANK_NODE, value: match[2]};\n }\n\n // get predicate\n quad.predicate = {termType: TYPE_NAMED_NODE, value: match[3]};\n\n // get object\n if(match[4] !== undefined) {\n quad.object = {termType: TYPE_NAMED_NODE, value: match[4]};\n } else if(match[5] !== undefined) {\n quad.object = {termType: TYPE_BLANK_NODE, value: match[5]};\n } else {\n quad.object = {\n termType: TYPE_LITERAL,\n value: undefined,\n datatype: {\n termType: TYPE_NAMED_NODE\n }\n };\n if(match[7] !== undefined) {\n quad.object.datatype.value = match[7];\n } else if(match[8] !== undefined) {\n quad.object.datatype.value = RDF_LANGSTRING;\n quad.object.language = match[8];\n } else {\n quad.object.datatype.value = XSD_STRING;\n }\n quad.object.value = _unescape(match[6]);\n }\n\n // get graph\n if(match[9] !== undefined) {\n quad.graph = {\n termType: TYPE_NAMED_NODE,\n value: match[9]\n };\n } else if(match[10] !== undefined) {\n quad.graph = {\n termType: TYPE_BLANK_NODE,\n value: match[10]\n };\n } else {\n quad.graph = {\n termType: TYPE_DEFAULT_GRAPH,\n value: ''\n };\n }\n\n // only add quad if it is unique in its graph\n if(!(quad.graph.value in graphs)) {\n graphs[quad.graph.value] = [quad];\n dataset.push(quad);\n } else {\n let unique = true;\n const quads = graphs[quad.graph.value];\n for(const q of quads) {\n if(_compareTriples(q, quad)) {\n unique = false;\n break;\n }\n }\n if(unique) {\n quads.push(quad);\n dataset.push(quad);\n }\n }\n }\n\n return dataset;\n }\n\n /**\n * Converts an RDF dataset to N-Quads.\n *\n * @param dataset (array of quads) the RDF dataset to convert.\n *\n * @return the N-Quads string.\n */\n static serialize(dataset) {\n if(!Array.isArray(dataset)) {\n dataset = NQuads.legacyDatasetToQuads(dataset);\n }\n const quads = [];\n for(const quad of dataset) {\n quads.push(NQuads.serializeQuad(quad));\n }\n return quads.sort().join('');\n }\n\n /**\n * Converts RDF quad components to an N-Quad string (a single quad).\n *\n * @param {Object} s - N-Quad subject component.\n * @param {Object} p - N-Quad predicate component.\n * @param {Object} o - N-Quad object component.\n * @param {Object} g - N-Quad graph component.\n *\n * @return {string} the N-Quad.\n */\n static serializeQuadComponents(s, p, o, g) {\n let nquad = '';\n\n // subject can only be NamedNode or BlankNode\n if(s.termType === TYPE_NAMED_NODE) {\n nquad += `<${s.value}>`;\n } else {\n nquad += `${s.value}`;\n }\n\n // predicate can only be NamedNode\n nquad += ` <${p.value}> `;\n\n // object is NamedNode, BlankNode, or Literal\n if(o.termType === TYPE_NAMED_NODE) {\n nquad += `<${o.value}>`;\n } else if(o.termType === TYPE_BLANK_NODE) {\n nquad += o.value;\n } else {\n nquad += `\"${_escape(o.value)}\"`;\n if(o.datatype.value === RDF_LANGSTRING) {\n if(o.language) {\n nquad += `@${o.language}`;\n }\n } else if(o.datatype.value !== XSD_STRING) {\n nquad += `^^<${o.datatype.value}>`;\n }\n }\n\n // graph can only be NamedNode or BlankNode (or DefaultGraph, but that\n // does not add to `nquad`)\n if(g.termType === TYPE_NAMED_NODE) {\n nquad += ` <${g.value}>`;\n } else if(g.termType === TYPE_BLANK_NODE) {\n nquad += ` ${g.value}`;\n }\n\n nquad += ' .\\n';\n return nquad;\n }\n\n /**\n * Converts an RDF quad to an N-Quad string (a single quad).\n *\n * @param quad the RDF quad convert.\n *\n * @return the N-Quad string.\n */\n static serializeQuad(quad) {\n return NQuads.serializeQuadComponents(\n quad.subject, quad.predicate, quad.object, quad.graph);\n }\n\n /**\n * Converts a legacy-formatted dataset to an array of quads dataset per\n * http://rdf.js.org/.\n *\n * @param dataset the legacy dataset to convert.\n *\n * @return the array of quads dataset.\n */\n static legacyDatasetToQuads(dataset) {\n const quads = [];\n\n const termTypeMap = {\n 'blank node': TYPE_BLANK_NODE,\n IRI: TYPE_NAMED_NODE,\n literal: TYPE_LITERAL\n };\n\n for(const graphName in dataset) {\n const triples = dataset[graphName];\n triples.forEach(triple => {\n const quad = {};\n for(const componentName in triple) {\n const oldComponent = triple[componentName];\n const newComponent = {\n termType: termTypeMap[oldComponent.type],\n value: oldComponent.value\n };\n if(newComponent.termType === TYPE_LITERAL) {\n newComponent.datatype = {\n termType: TYPE_NAMED_NODE\n };\n if('datatype' in oldComponent) {\n newComponent.datatype.value = oldComponent.datatype;\n }\n if('language' in oldComponent) {\n if(!('datatype' in oldComponent)) {\n newComponent.datatype.value = RDF_LANGSTRING;\n }\n newComponent.language = oldComponent.language;\n } else if(!('datatype' in oldComponent)) {\n newComponent.datatype.value = XSD_STRING;\n }\n }\n quad[componentName] = newComponent;\n }\n if(graphName === '@default') {\n quad.graph = {\n termType: TYPE_DEFAULT_GRAPH,\n value: ''\n };\n } else {\n quad.graph = {\n termType: graphName.startsWith('_:') ?\n TYPE_BLANK_NODE : TYPE_NAMED_NODE,\n value: graphName\n };\n }\n quads.push(quad);\n });\n }\n\n return quads;\n }\n};\n\n/**\n * Compares two RDF triples for equality.\n *\n * @param t1 the first triple.\n * @param t2 the second triple.\n *\n * @return true if the triples are the same, false if not.\n */\nfunction _compareTriples(t1, t2) {\n // compare subject and object types first as it is the quickest check\n if(!(t1.subject.termType === t2.subject.termType &&\n t1.object.termType === t2.object.termType)) {\n return false;\n }\n // compare values\n if(!(t1.subject.value === t2.subject.value &&\n t1.predicate.value === t2.predicate.value &&\n t1.object.value === t2.object.value)) {\n return false;\n }\n if(t1.object.termType !== TYPE_LITERAL) {\n // no `datatype` or `language` to check\n return true;\n }\n return (\n (t1.object.datatype.termType === t2.object.datatype.termType) &&\n (t1.object.language === t2.object.language) &&\n (t1.object.datatype.value === t2.object.datatype.value)\n );\n}\n\nconst _escapeRegex = /[\"\\\\\\n\\r]/g;\n/**\n * Escape string to N-Quads literal\n */\nfunction _escape(s) {\n return s.replace(_escapeRegex, function(match) {\n switch(match) {\n case '\"': return '\\\\\"';\n case '\\\\': return '\\\\\\\\';\n case '\\n': return '\\\\n';\n case '\\r': return '\\\\r';\n }\n });\n}\n\nconst _unescapeRegex =\n /(?:\\\\([tbnrf\"'\\\\]))|(?:\\\\u([0-9A-Fa-f]{4}))|(?:\\\\U([0-9A-Fa-f]{8}))/g;\n/**\n * Unescape N-Quads literal to string\n */\nfunction _unescape(s) {\n return s.replace(_unescapeRegex, function(match, code, u, U) {\n if(code) {\n switch(code) {\n case 't': return '\\t';\n case 'b': return '\\b';\n case 'n': return '\\n';\n case 'r': return '\\r';\n case 'f': return '\\f';\n case '\"': return '\"';\n case '\\'': return '\\'';\n case '\\\\': return '\\\\';\n }\n }\n if(u) {\n return String.fromCharCode(parseInt(u, 16));\n }\n if(U) {\n // FIXME: support larger values\n throw new Error('Unsupported U escape');\n }\n });\n}\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nmodule.exports = class Permuter {\n /**\n * A Permuter iterates over all possible permutations of the given array\n * of elements.\n *\n * @param list the array of elements to iterate over.\n */\n constructor(list) {\n // original array\n this.current = list.sort();\n // indicates whether there are more permutations\n this.done = false;\n // directional info for permutation algorithm\n this.dir = new Map();\n for(let i = 0; i < list.length; ++i) {\n this.dir.set(list[i], true);\n }\n }\n\n /**\n * Returns true if there is another permutation.\n *\n * @return true if there is another permutation, false if not.\n */\n hasNext() {\n return !this.done;\n }\n\n /**\n * Gets the next permutation. Call hasNext() to ensure there is another one\n * first.\n *\n * @return the next permutation.\n */\n next() {\n // copy current permutation to return it\n const {current, dir} = this;\n const rval = current.slice();\n\n /* Calculate the next permutation using the Steinhaus-Johnson-Trotter\n permutation algorithm. */\n\n // get largest mobile element k\n // (mobile: element is greater than the one it is looking at)\n let k = null;\n let pos = 0;\n const length = current.length;\n for(let i = 0; i < length; ++i) {\n const element = current[i];\n const left = dir.get(element);\n if((k === null || element > k) &&\n ((left && i > 0 && element > current[i - 1]) ||\n (!left && i < (length - 1) && element > current[i + 1]))) {\n k = element;\n pos = i;\n }\n }\n\n // no more permutations\n if(k === null) {\n this.done = true;\n } else {\n // swap k and the element it is looking at\n const swap = dir.get(k) ? pos - 1 : pos + 1;\n current[pos] = current[swap];\n current[swap] = k;\n\n // reverse the direction of all elements larger than k\n for(const element of current) {\n if(element > k) {\n dir.set(element, !dir.get(element));\n }\n }\n }\n\n return rval;\n }\n};\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst IdentifierIssuer = require('./IdentifierIssuer');\nconst MessageDigest = require('./MessageDigest');\nconst Permuter = require('./Permuter');\nconst NQuads = require('./NQuads');\n\nmodule.exports = class URDNA2015 {\n constructor({\n createMessageDigest = () => new MessageDigest('sha256'),\n maxDeepIterations = Infinity\n } = {}) {\n this.name = 'URDNA2015';\n this.blankNodeInfo = new Map();\n this.canonicalIssuer = new IdentifierIssuer('_:c14n');\n this.createMessageDigest = createMessageDigest;\n this.maxDeepIterations = maxDeepIterations;\n this.quads = null;\n this.deepIterations = null;\n }\n\n // 4.4) Normalization Algorithm\n async main(dataset) {\n this.deepIterations = new Map();\n this.quads = dataset;\n\n // 1) Create the normalization state.\n // 2) For every quad in input dataset:\n for(const quad of dataset) {\n // 2.1) For each blank node that occurs in the quad, add a reference\n // to the quad using the blank node identifier in the blank node to\n // quads map, creating a new entry if necessary.\n this._addBlankNodeQuadInfo({quad, component: quad.subject});\n this._addBlankNodeQuadInfo({quad, component: quad.object});\n this._addBlankNodeQuadInfo({quad, component: quad.graph});\n }\n\n // 3) Create a list of non-normalized blank node identifiers\n // non-normalized identifiers and populate it using the keys from the\n // blank node to quads map.\n // Note: We use a map here and it was generated during step 2.\n\n // 4) `simple` flag is skipped -- loop is optimized away. This optimization\n // is permitted because there was a typo in the hash first degree quads\n // algorithm in the URDNA2015 spec that was implemented widely making it\n // such that it could not be fixed; the result was that the loop only\n // needs to be run once and the first degree quad hashes will never change.\n // 5.1-5.2 are skipped; first degree quad hashes are generated just once\n // for all non-normalized blank nodes.\n\n // 5.3) For each blank node identifier identifier in non-normalized\n // identifiers:\n const hashToBlankNodes = new Map();\n const nonNormalized = [...this.blankNodeInfo.keys()];\n let i = 0;\n for(const id of nonNormalized) {\n // Note: batch hashing first degree quads 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // steps 5.3.1 and 5.3.2:\n await this._hashAndTrackBlankNode({id, hashToBlankNodes});\n }\n\n // 5.4) For each hash to identifier list mapping in hash to blank\n // nodes map, lexicographically-sorted by hash:\n const hashes = [...hashToBlankNodes.keys()].sort();\n // optimize away second sort, gather non-unique hashes in order as we go\n const nonUnique = [];\n for(const hash of hashes) {\n // 5.4.1) If the length of identifier list is greater than 1,\n // continue to the next mapping.\n const idList = hashToBlankNodes.get(hash);\n if(idList.length > 1) {\n nonUnique.push(idList);\n continue;\n }\n\n // 5.4.2) Use the Issue Identifier algorithm, passing canonical\n // issuer and the single blank node identifier in identifier\n // list, identifier, to issue a canonical replacement identifier\n // for identifier.\n const id = idList[0];\n this.canonicalIssuer.getId(id);\n\n // Note: These steps are skipped, optimized away since the loop\n // only needs to be run once.\n // 5.4.3) Remove identifier from non-normalized identifiers.\n // 5.4.4) Remove hash from the hash to blank nodes map.\n // 5.4.5) Set simple to true.\n }\n\n // 6) For each hash to identifier list mapping in hash to blank nodes map,\n // lexicographically-sorted by hash:\n // Note: sort optimized away, use `nonUnique`.\n for(const idList of nonUnique) {\n // 6.1) Create hash path list where each item will be a result of\n // running the Hash N-Degree Quads algorithm.\n const hashPathList = [];\n\n // 6.2) For each blank node identifier identifier in identifier list:\n for(const id of idList) {\n // 6.2.1) If a canonical identifier has already been issued for\n // identifier, continue to the next identifier.\n if(this.canonicalIssuer.hasId(id)) {\n continue;\n }\n\n // 6.2.2) Create temporary issuer, an identifier issuer\n // initialized with the prefix _:b.\n const issuer = new IdentifierIssuer('_:b');\n\n // 6.2.3) Use the Issue Identifier algorithm, passing temporary\n // issuer and identifier, to issue a new temporary blank node\n // identifier for identifier.\n issuer.getId(id);\n\n // 6.2.4) Run the Hash N-Degree Quads algorithm, passing\n // temporary issuer, and append the result to the hash path list.\n const result = await this.hashNDegreeQuads(id, issuer);\n hashPathList.push(result);\n }\n\n // 6.3) For each result in the hash path list,\n // lexicographically-sorted by the hash in result:\n hashPathList.sort(_stringHashCompare);\n for(const result of hashPathList) {\n // 6.3.1) For each blank node identifier, existing identifier,\n // that was issued a temporary identifier by identifier issuer\n // in result, issue a canonical identifier, in the same order,\n // using the Issue Identifier algorithm, passing canonical\n // issuer and existing identifier.\n const oldIds = result.issuer.getOldIds();\n for(const id of oldIds) {\n this.canonicalIssuer.getId(id);\n }\n }\n }\n\n /* Note: At this point all blank nodes in the set of RDF quads have been\n assigned canonical identifiers, which have been stored in the canonical\n issuer. Here each quad is updated by assigning each of its blank nodes\n its new identifier. */\n\n // 7) For each quad, quad, in input dataset:\n const normalized = [];\n for(const quad of this.quads) {\n // 7.1) Create a copy, quad copy, of quad and replace any existing\n // blank node identifiers using the canonical identifiers\n // previously issued by canonical issuer.\n // Note: We optimize away the copy here.\n const nQuad = NQuads.serializeQuadComponents(\n this._componentWithCanonicalId(quad.subject),\n quad.predicate,\n this._componentWithCanonicalId(quad.object),\n this._componentWithCanonicalId(quad.graph)\n );\n // 7.2) Add quad copy to the normalized dataset.\n normalized.push(nQuad);\n }\n\n // sort normalized output\n normalized.sort();\n\n // 8) Return the normalized dataset.\n return normalized.join('');\n }\n\n // 4.6) Hash First Degree Quads\n async hashFirstDegreeQuads(id) {\n // 1) Initialize nquads to an empty list. It will be used to store quads in\n // N-Quads format.\n const nquads = [];\n\n // 2) Get the list of quads `quads` associated with the reference blank node\n // identifier in the blank node to quads map.\n const info = this.blankNodeInfo.get(id);\n const quads = info.quads;\n\n // 3) For each quad `quad` in `quads`:\n for(const quad of quads) {\n // 3.1) Serialize the quad in N-Quads format with the following special\n // rule:\n\n // 3.1.1) If any component in quad is an blank node, then serialize it\n // using a special identifier as follows:\n const copy = {\n subject: null, predicate: quad.predicate, object: null, graph: null\n };\n // 3.1.2) If the blank node's existing blank node identifier matches\n // the reference blank node identifier then use the blank node\n // identifier _:a, otherwise, use the blank node identifier _:z.\n copy.subject = this.modifyFirstDegreeComponent(\n id, quad.subject, 'subject');\n copy.object = this.modifyFirstDegreeComponent(\n id, quad.object, 'object');\n copy.graph = this.modifyFirstDegreeComponent(\n id, quad.graph, 'graph');\n nquads.push(NQuads.serializeQuad(copy));\n }\n\n // 4) Sort nquads in lexicographical order.\n nquads.sort();\n\n // 5) Return the hash that results from passing the sorted, joined nquads\n // through the hash algorithm.\n const md = this.createMessageDigest();\n for(const nquad of nquads) {\n md.update(nquad);\n }\n info.hash = await md.digest();\n return info.hash;\n }\n\n // 4.7) Hash Related Blank Node\n async hashRelatedBlankNode(related, quad, issuer, position) {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n if(this.canonicalIssuer.hasId(related)) {\n id = this.canonicalIssuer.getId(related);\n } else if(issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = this.blankNodeInfo.get(related).hash;\n }\n\n // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n const md = this.createMessageDigest();\n md.update(position);\n\n // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n if(position !== 'g') {\n md.update(this.getRelatedPredicate(quad));\n }\n\n // 4) Append identifier to input.\n md.update(id);\n\n // 5) Return the hash that results from passing input through the hash\n // algorithm.\n return md.digest();\n }\n\n // 4.8) Hash N-Degree Quads\n async hashNDegreeQuads(id, issuer) {\n const deepIterations = this.deepIterations.get(id) || 0;\n if(deepIterations > this.maxDeepIterations) {\n throw new Error(\n `Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);\n }\n this.deepIterations.set(id, deepIterations + 1);\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n // Note: 2) and 3) handled within `createHashToRelated`\n const md = this.createMessageDigest();\n const hashToRelated = await this.createHashToRelated(id, issuer);\n\n // 4) Create an empty string, data to hash.\n // Note: We created a hash object `md` above instead.\n\n // 5) For each related hash to blank node list mapping in hash to related\n // blank nodes map, sorted lexicographically by related hash:\n const hashes = [...hashToRelated.keys()].sort();\n for(const hash of hashes) {\n // 5.1) Append the related hash to the data to hash.\n md.update(hash);\n\n // 5.2) Create a string chosen path.\n let chosenPath = '';\n\n // 5.3) Create an unset chosen issuer variable.\n let chosenIssuer;\n\n // 5.4) For each permutation of blank node list:\n const permuter = new Permuter(hashToRelated.get(hash));\n let i = 0;\n while(permuter.hasNext()) {\n const permutation = permuter.next();\n // Note: batch permutations 3 at a time\n if(++i % 3 === 0) {\n await this._yield();\n }\n\n // 5.4.1) Create a copy of issuer, issuer copy.\n let issuerCopy = issuer.clone();\n\n // 5.4.2) Create a string path.\n let path = '';\n\n // 5.4.3) Create a recursion list, to store blank node identifiers\n // that must be recursively processed by this algorithm.\n const recursionList = [];\n\n // 5.4.4) For each related in permutation:\n let nextPermutation = false;\n for(const related of permutation) {\n // 5.4.4.1) If a canonical identifier has been issued for\n // related, append it to path.\n if(this.canonicalIssuer.hasId(related)) {\n path += this.canonicalIssuer.getId(related);\n } else {\n // 5.4.4.2) Otherwise:\n // 5.4.4.2.1) If issuer copy has not issued an identifier for\n // related, append related to recursion list.\n if(!issuerCopy.hasId(related)) {\n recursionList.push(related);\n }\n // 5.4.4.2.2) Use the Issue Identifier algorithm, passing\n // issuer copy and related and append the result to path.\n path += issuerCopy.getId(related);\n }\n\n // 5.4.4.3) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.5) For each related in recursion list:\n for(const related of recursionList) {\n // 5.4.5.1) Set result to the result of recursively executing\n // the Hash N-Degree Quads algorithm, passing related for\n // identifier and issuer copy for path identifier issuer.\n const result = await this.hashNDegreeQuads(related, issuerCopy);\n\n // 5.4.5.2) Use the Issue Identifier algorithm, passing issuer\n // copy and related and append the result to path.\n path += issuerCopy.getId(related);\n\n // 5.4.5.3) Append <, the hash in result, and > to path.\n path += `<${result.hash}>`;\n\n // 5.4.5.4) Set issuer copy to the identifier issuer in\n // result.\n issuerCopy = result.issuer;\n\n // 5.4.5.5) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.6) If chosen path is empty or path is lexicographically\n // less than chosen path, set chosen path to path and chosen\n // issuer to issuer copy.\n if(chosenPath.length === 0 || path < chosenPath) {\n chosenPath = path;\n chosenIssuer = issuerCopy;\n }\n }\n\n // 5.5) Append chosen path to data to hash.\n md.update(chosenPath);\n\n // 5.6) Replace issuer, by reference, with chosen issuer.\n issuer = chosenIssuer;\n }\n\n // 6) Return issuer and the hash that results from passing data to hash\n // through the hash algorithm.\n return {hash: await md.digest(), issuer};\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n /* Note: A mistake in the URDNA2015 spec that made its way into\n implementations (and therefore must stay to avoid interop breakage)\n resulted in an assigned canonical ID, if available for\n `component.value`, not being used in place of `_:a`/`_:z`, so\n we don't use it here. */\n return {\n termType: 'BlankNode',\n value: component.value === id ? '_:a' : '_:z'\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return `<${quad.predicate.value}>`;\n }\n\n // helper for creating hash to related blank nodes map\n async createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n let i = 0;\n for(const quad of quads) {\n // Note: batch hashing related blank node quads 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // 3.1) For each component in quad, if component is the subject, object,\n // and graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n await Promise.all([\n this._addRelatedBlankNodeHash({\n quad, component: quad.subject, position: 's',\n id, issuer, hashToRelated\n }),\n this._addRelatedBlankNodeHash({\n quad, component: quad.object, position: 'o',\n id, issuer, hashToRelated\n }),\n this._addRelatedBlankNodeHash({\n quad, component: quad.graph, position: 'g',\n id, issuer, hashToRelated\n })\n ]);\n }\n\n return hashToRelated;\n }\n\n async _hashAndTrackBlankNode({id, hashToBlankNodes}) {\n // 5.3.1) Create a hash, hash, according to the Hash First Degree\n // Quads algorithm.\n const hash = await this.hashFirstDegreeQuads(id);\n\n // 5.3.2) Add hash and identifier to hash to blank nodes map,\n // creating a new entry if necessary.\n const idList = hashToBlankNodes.get(hash);\n if(!idList) {\n hashToBlankNodes.set(hash, [id]);\n } else {\n idList.push(id);\n }\n }\n\n _addBlankNodeQuadInfo({quad, component}) {\n if(component.termType !== 'BlankNode') {\n return;\n }\n const id = component.value;\n const info = this.blankNodeInfo.get(id);\n if(info) {\n info.quads.add(quad);\n } else {\n this.blankNodeInfo.set(id, {quads: new Set([quad]), hash: null});\n }\n }\n\n async _addRelatedBlankNodeHash(\n {quad, component, position, id, issuer, hashToRelated}) {\n if(!(component.termType === 'BlankNode' && component.value !== id)) {\n return;\n }\n // 3.1.1) Set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for component as\n // related, quad, path identifier issuer as issuer, and position as\n // either s, o, or g based on whether component is a subject, object,\n // graph name, respectively.\n const related = component.value;\n const hash = await this.hashRelatedBlankNode(\n related, quad, issuer, position);\n\n // 3.1.2) Add a mapping of hash to the blank node identifier for\n // component to hash to related blank nodes map, adding an entry as\n // necessary.\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n // canonical ids for 7.1\n _componentWithCanonicalId(component) {\n if(component.termType === 'BlankNode' &&\n !component.value.startsWith(this.canonicalIssuer.prefix)) {\n // create new BlankNode\n return {\n termType: 'BlankNode',\n value: this.canonicalIssuer.getId(component.value)\n };\n }\n return component;\n }\n\n async _yield() {\n return new Promise(resolve => setImmediate(resolve));\n }\n};\n\nfunction _stringHashCompare(a, b) {\n return a.hash < b.hash ? -1 : a.hash > b.hash ? 1 : 0;\n}\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst IdentifierIssuer = require('./IdentifierIssuer');\n// FIXME: do not import; convert to requiring a\n// hash factory\nconst MessageDigest = require('./MessageDigest');\nconst Permuter = require('./Permuter');\nconst NQuads = require('./NQuads');\n\nmodule.exports = class URDNA2015Sync {\n constructor({\n createMessageDigest = () => new MessageDigest('sha256'),\n maxDeepIterations = Infinity\n } = {}) {\n this.name = 'URDNA2015';\n this.blankNodeInfo = new Map();\n this.canonicalIssuer = new IdentifierIssuer('_:c14n');\n this.createMessageDigest = createMessageDigest;\n this.maxDeepIterations = maxDeepIterations;\n this.quads = null;\n this.deepIterations = null;\n }\n\n // 4.4) Normalization Algorithm\n main(dataset) {\n this.deepIterations = new Map();\n this.quads = dataset;\n\n // 1) Create the normalization state.\n // 2) For every quad in input dataset:\n for(const quad of dataset) {\n // 2.1) For each blank node that occurs in the quad, add a reference\n // to the quad using the blank node identifier in the blank node to\n // quads map, creating a new entry if necessary.\n this._addBlankNodeQuadInfo({quad, component: quad.subject});\n this._addBlankNodeQuadInfo({quad, component: quad.object});\n this._addBlankNodeQuadInfo({quad, component: quad.graph});\n }\n\n // 3) Create a list of non-normalized blank node identifiers\n // non-normalized identifiers and populate it using the keys from the\n // blank node to quads map.\n // Note: We use a map here and it was generated during step 2.\n\n // 4) `simple` flag is skipped -- loop is optimized away. This optimization\n // is permitted because there was a typo in the hash first degree quads\n // algorithm in the URDNA2015 spec that was implemented widely making it\n // such that it could not be fixed; the result was that the loop only\n // needs to be run once and the first degree quad hashes will never change.\n // 5.1-5.2 are skipped; first degree quad hashes are generated just once\n // for all non-normalized blank nodes.\n\n // 5.3) For each blank node identifier identifier in non-normalized\n // identifiers:\n const hashToBlankNodes = new Map();\n const nonNormalized = [...this.blankNodeInfo.keys()];\n for(const id of nonNormalized) {\n // steps 5.3.1 and 5.3.2:\n this._hashAndTrackBlankNode({id, hashToBlankNodes});\n }\n\n // 5.4) For each hash to identifier list mapping in hash to blank\n // nodes map, lexicographically-sorted by hash:\n const hashes = [...hashToBlankNodes.keys()].sort();\n // optimize away second sort, gather non-unique hashes in order as we go\n const nonUnique = [];\n for(const hash of hashes) {\n // 5.4.1) If the length of identifier list is greater than 1,\n // continue to the next mapping.\n const idList = hashToBlankNodes.get(hash);\n if(idList.length > 1) {\n nonUnique.push(idList);\n continue;\n }\n\n // 5.4.2) Use the Issue Identifier algorithm, passing canonical\n // issuer and the single blank node identifier in identifier\n // list, identifier, to issue a canonical replacement identifier\n // for identifier.\n const id = idList[0];\n this.canonicalIssuer.getId(id);\n\n // Note: These steps are skipped, optimized away since the loop\n // only needs to be run once.\n // 5.4.3) Remove identifier from non-normalized identifiers.\n // 5.4.4) Remove hash from the hash to blank nodes map.\n // 5.4.5) Set simple to true.\n }\n\n // 6) For each hash to identifier list mapping in hash to blank nodes map,\n // lexicographically-sorted by hash:\n // Note: sort optimized away, use `nonUnique`.\n for(const idList of nonUnique) {\n // 6.1) Create hash path list where each item will be a result of\n // running the Hash N-Degree Quads algorithm.\n const hashPathList = [];\n\n // 6.2) For each blank node identifier identifier in identifier list:\n for(const id of idList) {\n // 6.2.1) If a canonical identifier has already been issued for\n // identifier, continue to the next identifier.\n if(this.canonicalIssuer.hasId(id)) {\n continue;\n }\n\n // 6.2.2) Create temporary issuer, an identifier issuer\n // initialized with the prefix _:b.\n const issuer = new IdentifierIssuer('_:b');\n\n // 6.2.3) Use the Issue Identifier algorithm, passing temporary\n // issuer and identifier, to issue a new temporary blank node\n // identifier for identifier.\n issuer.getId(id);\n\n // 6.2.4) Run the Hash N-Degree Quads algorithm, passing\n // temporary issuer, and append the result to the hash path list.\n const result = this.hashNDegreeQuads(id, issuer);\n hashPathList.push(result);\n }\n\n // 6.3) For each result in the hash path list,\n // lexicographically-sorted by the hash in result:\n hashPathList.sort(_stringHashCompare);\n for(const result of hashPathList) {\n // 6.3.1) For each blank node identifier, existing identifier,\n // that was issued a temporary identifier by identifier issuer\n // in result, issue a canonical identifier, in the same order,\n // using the Issue Identifier algorithm, passing canonical\n // issuer and existing identifier.\n const oldIds = result.issuer.getOldIds();\n for(const id of oldIds) {\n this.canonicalIssuer.getId(id);\n }\n }\n }\n\n /* Note: At this point all blank nodes in the set of RDF quads have been\n assigned canonical identifiers, which have been stored in the canonical\n issuer. Here each quad is updated by assigning each of its blank nodes\n its new identifier. */\n\n // 7) For each quad, quad, in input dataset:\n const normalized = [];\n for(const quad of this.quads) {\n // 7.1) Create a copy, quad copy, of quad and replace any existing\n // blank node identifiers using the canonical identifiers\n // previously issued by canonical issuer.\n // Note: We optimize away the copy here.\n const nQuad = NQuads.serializeQuadComponents(\n this._componentWithCanonicalId({component: quad.subject}),\n quad.predicate,\n this._componentWithCanonicalId({component: quad.object}),\n this._componentWithCanonicalId({component: quad.graph})\n );\n // 7.2) Add quad copy to the normalized dataset.\n normalized.push(nQuad);\n }\n\n // sort normalized output\n normalized.sort();\n\n // 8) Return the normalized dataset.\n return normalized.join('');\n }\n\n // 4.6) Hash First Degree Quads\n hashFirstDegreeQuads(id) {\n // 1) Initialize nquads to an empty list. It will be used to store quads in\n // N-Quads format.\n const nquads = [];\n\n // 2) Get the list of quads `quads` associated with the reference blank node\n // identifier in the blank node to quads map.\n const info = this.blankNodeInfo.get(id);\n const quads = info.quads;\n\n // 3) For each quad `quad` in `quads`:\n for(const quad of quads) {\n // 3.1) Serialize the quad in N-Quads format with the following special\n // rule:\n\n // 3.1.1) If any component in quad is an blank node, then serialize it\n // using a special identifier as follows:\n const copy = {\n subject: null, predicate: quad.predicate, object: null, graph: null\n };\n // 3.1.2) If the blank node's existing blank node identifier matches\n // the reference blank node identifier then use the blank node\n // identifier _:a, otherwise, use the blank node identifier _:z.\n copy.subject = this.modifyFirstDegreeComponent(\n id, quad.subject, 'subject');\n copy.object = this.modifyFirstDegreeComponent(\n id, quad.object, 'object');\n copy.graph = this.modifyFirstDegreeComponent(\n id, quad.graph, 'graph');\n nquads.push(NQuads.serializeQuad(copy));\n }\n\n // 4) Sort nquads in lexicographical order.\n nquads.sort();\n\n // 5) Return the hash that results from passing the sorted, joined nquads\n // through the hash algorithm.\n const md = this.createMessageDigest();\n for(const nquad of nquads) {\n md.update(nquad);\n }\n info.hash = md.digest();\n return info.hash;\n }\n\n // 4.7) Hash Related Blank Node\n hashRelatedBlankNode(related, quad, issuer, position) {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n if(this.canonicalIssuer.hasId(related)) {\n id = this.canonicalIssuer.getId(related);\n } else if(issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = this.blankNodeInfo.get(related).hash;\n }\n\n // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n const md = this.createMessageDigest();\n md.update(position);\n\n // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n if(position !== 'g') {\n md.update(this.getRelatedPredicate(quad));\n }\n\n // 4) Append identifier to input.\n md.update(id);\n\n // 5) Return the hash that results from passing input through the hash\n // algorithm.\n return md.digest();\n }\n\n // 4.8) Hash N-Degree Quads\n hashNDegreeQuads(id, issuer) {\n const deepIterations = this.deepIterations.get(id) || 0;\n if(deepIterations > this.maxDeepIterations) {\n throw new Error(\n `Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);\n }\n this.deepIterations.set(id, deepIterations + 1);\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n // Note: 2) and 3) handled within `createHashToRelated`\n const md = this.createMessageDigest();\n const hashToRelated = this.createHashToRelated(id, issuer);\n\n // 4) Create an empty string, data to hash.\n // Note: We created a hash object `md` above instead.\n\n // 5) For each related hash to blank node list mapping in hash to related\n // blank nodes map, sorted lexicographically by related hash:\n const hashes = [...hashToRelated.keys()].sort();\n for(const hash of hashes) {\n // 5.1) Append the related hash to the data to hash.\n md.update(hash);\n\n // 5.2) Create a string chosen path.\n let chosenPath = '';\n\n // 5.3) Create an unset chosen issuer variable.\n let chosenIssuer;\n\n // 5.4) For each permutation of blank node list:\n const permuter = new Permuter(hashToRelated.get(hash));\n while(permuter.hasNext()) {\n const permutation = permuter.next();\n\n // 5.4.1) Create a copy of issuer, issuer copy.\n let issuerCopy = issuer.clone();\n\n // 5.4.2) Create a string path.\n let path = '';\n\n // 5.4.3) Create a recursion list, to store blank node identifiers\n // that must be recursively processed by this algorithm.\n const recursionList = [];\n\n // 5.4.4) For each related in permutation:\n let nextPermutation = false;\n for(const related of permutation) {\n // 5.4.4.1) If a canonical identifier has been issued for\n // related, append it to path.\n if(this.canonicalIssuer.hasId(related)) {\n path += this.canonicalIssuer.getId(related);\n } else {\n // 5.4.4.2) Otherwise:\n // 5.4.4.2.1) If issuer copy has not issued an identifier for\n // related, append related to recursion list.\n if(!issuerCopy.hasId(related)) {\n recursionList.push(related);\n }\n // 5.4.4.2.2) Use the Issue Identifier algorithm, passing\n // issuer copy and related and append the result to path.\n path += issuerCopy.getId(related);\n }\n\n // 5.4.4.3) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.5) For each related in recursion list:\n for(const related of recursionList) {\n // 5.4.5.1) Set result to the result of recursively executing\n // the Hash N-Degree Quads algorithm, passing related for\n // identifier and issuer copy for path identifier issuer.\n const result = this.hashNDegreeQuads(related, issuerCopy);\n\n // 5.4.5.2) Use the Issue Identifier algorithm, passing issuer\n // copy and related and append the result to path.\n path += issuerCopy.getId(related);\n\n // 5.4.5.3) Append <, the hash in result, and > to path.\n path += `<${result.hash}>`;\n\n // 5.4.5.4) Set issuer copy to the identifier issuer in\n // result.\n issuerCopy = result.issuer;\n\n // 5.4.5.5) If chosen path is not empty and the length of path\n // is greater than or equal to the length of chosen path and\n // path is lexicographically greater than chosen path, then\n // skip to the next permutation.\n // Note: Comparing path length to chosen path length can be optimized\n // away; only compare lexicographically.\n if(chosenPath.length !== 0 && path > chosenPath) {\n nextPermutation = true;\n break;\n }\n }\n\n if(nextPermutation) {\n continue;\n }\n\n // 5.4.6) If chosen path is empty or path is lexicographically\n // less than chosen path, set chosen path to path and chosen\n // issuer to issuer copy.\n if(chosenPath.length === 0 || path < chosenPath) {\n chosenPath = path;\n chosenIssuer = issuerCopy;\n }\n }\n\n // 5.5) Append chosen path to data to hash.\n md.update(chosenPath);\n\n // 5.6) Replace issuer, by reference, with chosen issuer.\n issuer = chosenIssuer;\n }\n\n // 6) Return issuer and the hash that results from passing data to hash\n // through the hash algorithm.\n return {hash: md.digest(), issuer};\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n /* Note: A mistake in the URDNA2015 spec that made its way into\n implementations (and therefore must stay to avoid interop breakage)\n resulted in an assigned canonical ID, if available for\n `component.value`, not being used in place of `_:a`/`_:z`, so\n we don't use it here. */\n return {\n termType: 'BlankNode',\n value: component.value === id ? '_:a' : '_:z'\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return `<${quad.predicate.value}>`;\n }\n\n // helper for creating hash to related blank nodes map\n createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n for(const quad of quads) {\n // 3.1) For each component in quad, if component is the subject, object,\n // or graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n this._addRelatedBlankNodeHash({\n quad, component: quad.subject, position: 's',\n id, issuer, hashToRelated\n });\n this._addRelatedBlankNodeHash({\n quad, component: quad.object, position: 'o',\n id, issuer, hashToRelated\n });\n this._addRelatedBlankNodeHash({\n quad, component: quad.graph, position: 'g',\n id, issuer, hashToRelated\n });\n }\n\n return hashToRelated;\n }\n\n _hashAndTrackBlankNode({id, hashToBlankNodes}) {\n // 5.3.1) Create a hash, hash, according to the Hash First Degree\n // Quads algorithm.\n const hash = this.hashFirstDegreeQuads(id);\n\n // 5.3.2) Add hash and identifier to hash to blank nodes map,\n // creating a new entry if necessary.\n const idList = hashToBlankNodes.get(hash);\n if(!idList) {\n hashToBlankNodes.set(hash, [id]);\n } else {\n idList.push(id);\n }\n }\n\n _addBlankNodeQuadInfo({quad, component}) {\n if(component.termType !== 'BlankNode') {\n return;\n }\n const id = component.value;\n const info = this.blankNodeInfo.get(id);\n if(info) {\n info.quads.add(quad);\n } else {\n this.blankNodeInfo.set(id, {quads: new Set([quad]), hash: null});\n }\n }\n\n _addRelatedBlankNodeHash(\n {quad, component, position, id, issuer, hashToRelated}) {\n if(!(component.termType === 'BlankNode' && component.value !== id)) {\n return;\n }\n // 3.1.1) Set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for component as\n // related, quad, path identifier issuer as issuer, and position as\n // either s, o, or g based on whether component is a subject, object,\n // graph name, respectively.\n const related = component.value;\n const hash = this.hashRelatedBlankNode(related, quad, issuer, position);\n\n // 3.1.2) Add a mapping of hash to the blank node identifier for\n // component to hash to related blank nodes map, adding an entry as\n // necessary.\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n // canonical ids for 7.1\n _componentWithCanonicalId({component}) {\n if(component.termType === 'BlankNode' &&\n !component.value.startsWith(this.canonicalIssuer.prefix)) {\n // create new BlankNode\n return {\n termType: 'BlankNode',\n value: this.canonicalIssuer.getId(component.value)\n };\n }\n return component;\n }\n};\n\nfunction _stringHashCompare(a, b) {\n return a.hash < b.hash ? -1 : a.hash > b.hash ? 1 : 0;\n}\n","/*!\n * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst MessageDigest = require('./MessageDigest');\nconst URDNA2015 = require('./URDNA2015');\n\nmodule.exports = class URDNA2012 extends URDNA2015 {\n constructor() {\n super();\n this.name = 'URGNA2012';\n this.createMessageDigest = () => new MessageDigest('sha1');\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n if(key === 'graph') {\n return {\n termType: 'BlankNode',\n value: '_:g'\n };\n }\n return {\n termType: 'BlankNode',\n value: (component.value === id ? '_:a' : '_:z')\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return quad.predicate.value;\n }\n\n // helper for creating hash to related blank nodes map\n async createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n let i = 0;\n for(const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n }\n // Note: batch hashing related blank nodes 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n const hash = await this.hashRelatedBlankNode(\n related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n }\n};\n","/*!\n * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.\n */\n'use strict';\n\nconst MessageDigest = require('./MessageDigest');\nconst URDNA2015Sync = require('./URDNA2015Sync');\n\nmodule.exports = class URDNA2012Sync extends URDNA2015Sync {\n constructor() {\n super();\n this.name = 'URGNA2012';\n this.createMessageDigest = () => new MessageDigest('sha1');\n }\n\n // helper for modifying component during Hash First Degree Quads\n modifyFirstDegreeComponent(id, component, key) {\n if(component.termType !== 'BlankNode') {\n return component;\n }\n if(key === 'graph') {\n return {\n termType: 'BlankNode',\n value: '_:g'\n };\n }\n return {\n termType: 'BlankNode',\n value: (component.value === id ? '_:a' : '_:z')\n };\n }\n\n // helper for getting a related predicate\n getRelatedPredicate(quad) {\n return quad.predicate.value;\n }\n\n // helper for creating hash to related blank nodes map\n createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n for(const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n const hash = this.hashRelatedBlankNode(related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n }\n};\n","/**\n * An implementation of the RDF Dataset Normalization specification.\n * This library works in the browser and node.js.\n *\n * BSD 3-Clause License\n * Copyright (c) 2016-2022 Digital Bazaar, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * Neither the name of the Digital Bazaar, Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n'use strict';\n\nconst URDNA2015 = require('./URDNA2015');\nconst URGNA2012 = require('./URGNA2012');\nconst URDNA2015Sync = require('./URDNA2015Sync');\nconst URGNA2012Sync = require('./URGNA2012Sync');\n\n// optional native support\nlet rdfCanonizeNative;\ntry {\n rdfCanonizeNative = require('rdf-canonize-native');\n} catch(e) {}\n\n// expose helpers\nexports.NQuads = require('./NQuads');\nexports.IdentifierIssuer = require('./IdentifierIssuer');\n\n/**\n * Get or set native API.\n *\n * @param api the native API.\n *\n * @return the currently set native API.\n */\nexports._rdfCanonizeNative = function(api) {\n if(api) {\n rdfCanonizeNative = api;\n }\n return rdfCanonizeNative;\n};\n\n/**\n * Asynchronously canonizes an RDF dataset.\n *\n * @param {Array} dataset - The dataset to canonize.\n * @param {object} options - The options to use:\n * {string} algorithm - The canonicalization algorithm to use, `URDNA2015` or\n * `URGNA2012`.\n * {Function} [createMessageDigest] - A factory function for creating a\n * `MessageDigest` interface that overrides the built-in message digest\n * implementation used by the canonize algorithm; note that using a hash\n * algorithm (or HMAC algorithm) that differs from the one specified by\n * the canonize algorithm will result in different output.\n * {boolean} [useNative=false] - Use native implementation.\n * {number} [maxDeepIterations=Infinity] - The maximum number of times to run\n * deep comparison algorithms (such as the N-Degree Hash Quads algorithm\n * used in URDNA2015) before bailing out and throwing an error; this is a\n * useful setting for preventing wasted CPU cycles or DoS when canonizing\n * meaningless or potentially malicious datasets, a recommended value is\n * `1`.\n *\n * @return a Promise that resolves to the canonicalized RDF Dataset.\n */\nexports.canonize = async function(dataset, options) {\n // back-compat with legacy dataset\n if(!Array.isArray(dataset)) {\n dataset = exports.NQuads.legacyDatasetToQuads(dataset);\n }\n\n if(options.useNative) {\n if(!rdfCanonizeNative) {\n throw new Error('rdf-canonize-native not available');\n }\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"useNative\".');\n }\n return new Promise((resolve, reject) =>\n rdfCanonizeNative.canonize(dataset, options, (err, canonical) =>\n err ? reject(err) : resolve(canonical)));\n }\n\n if(options.algorithm === 'URDNA2015') {\n return new URDNA2015(options).main(dataset);\n }\n if(options.algorithm === 'URGNA2012') {\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"URGNA2012\".');\n }\n return new URGNA2012(options).main(dataset);\n }\n if(!('algorithm' in options)) {\n throw new Error('No RDF Dataset Canonicalization algorithm specified.');\n }\n throw new Error(\n 'Invalid RDF Dataset Canonicalization algorithm: ' + options.algorithm);\n};\n\n/**\n * This method is no longer available in the public API, it is for testing\n * only. It synchronously canonizes an RDF dataset and does not work in the\n * browser.\n *\n * @param {Array} dataset - The dataset to canonize.\n * @param {object} options - The options to use:\n * {string} algorithm - The canonicalization algorithm to use, `URDNA2015` or\n * `URGNA2012`.\n * {Function} [createMessageDigest] - A factory function for creating a\n * `MessageDigest` interface that overrides the built-in message digest\n * implementation used by the canonize algorithm; note that using a hash\n * algorithm (or HMAC algorithm) that differs from the one specified by\n * the canonize algorithm will result in different output.\n * {boolean} [useNative=false] - Use native implementation.\n * {number} [maxDeepIterations=Infinity] - The maximum number of times to run\n * deep comparison algorithms (such as the N-Degree Hash Quads algorithm\n * used in URDNA2015) before bailing out and throwing an error; this is a\n * useful setting for preventing wasted CPU cycles or DoS when canonizing\n * meaningless or potentially malicious datasets, a recommended value is\n * `1`.\n *\n * @return the RDF dataset in canonical form.\n */\nexports._canonizeSync = function(dataset, options) {\n // back-compat with legacy dataset\n if(!Array.isArray(dataset)) {\n dataset = exports.NQuads.legacyDatasetToQuads(dataset);\n }\n\n if(options.useNative) {\n if(!rdfCanonizeNative) {\n throw new Error('rdf-canonize-native not available');\n }\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"useNative\".');\n }\n return rdfCanonizeNative.canonizeSync(dataset, options);\n }\n if(options.algorithm === 'URDNA2015') {\n return new URDNA2015Sync(options).main(dataset);\n }\n if(options.algorithm === 'URGNA2012') {\n if(options.createMessageDigest) {\n throw new Error(\n '\"createMessageDigest\" cannot be used with \"URGNA2012\".');\n }\n return new URGNA2012Sync(options).main(dataset);\n }\n if(!('algorithm' in options)) {\n throw new Error('No RDF Dataset Canonicalization algorithm specified.');\n }\n throw new Error(\n 'Invalid RDF Dataset Canonicalization algorithm: ' + options.algorithm);\n};\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a \ No newline at end of file + window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}]; \ No newline at end of file diff --git a/examples/storybook/main.844762ea.iframe.bundle.js b/examples/storybook/main.def0ebf5.iframe.bundle.js similarity index 67% rename from examples/storybook/main.844762ea.iframe.bundle.js rename to examples/storybook/main.def0ebf5.iframe.bundle.js index 6a64807d..2e5a6ec7 100644 --- a/examples/storybook/main.844762ea.iframe.bundle.js +++ b/examples/storybook/main.def0ebf5.iframe.bundle.js @@ -1,2 +1,2 @@ -/*! For license information please see main.844762ea.iframe.bundle.js.LICENSE.txt */ -(self.webpackChunksolid_ui=self.webpackChunksolid_ui||[]).push([[179],{"./.storybook/preview.js-generated-config-entry.js":(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var preview_namespaceObject={};__webpack_require__.r(preview_namespaceObject),__webpack_require__.d(preview_namespaceObject,{__namedExportsOrder:()=>__namedExportsOrder,parameters:()=>parameters});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var ClientApi=__webpack_require__("./node_modules/@storybook/client-api/dist/esm/ClientApi.js"),parameters={actions:{argTypesRegex:"^on[A-Z].*"}},__namedExportsOrder=["parameters"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.keys(preview_namespaceObject).forEach((function(key){var value=preview_namespaceObject[key];switch(key){case"args":return(0,ClientApi.uc)(value);case"argTypes":return(0,ClientApi.v9)(value);case"decorators":return value.forEach((function(decorator){return(0,ClientApi.$9)(decorator,!1)}));case"loaders":return value.forEach((function(loader){return(0,ClientApi.HZ)(loader,!1)}));case"parameters":return(0,ClientApi.h1)(function _objectSpread(target){for(var i=1;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AccessController=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),_acl=__webpack_require__("./lib/acl/acl.js"),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_accessGroups=__webpack_require__("./lib/acl/access-groups.js"),_aclControl=__webpack_require__("./lib/acl/acl-control.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.AccessController=function(){function AccessController(subject,noun,context,statusElement,targetIsProtected,targetDoc,targetACLDoc,defaultHolder,defaultACLDoc,prospectiveDefaultHolder,store,dom){if((0,_classCallCheck2.default)(this,AccessController),this.subject=subject,this.noun=noun,this.context=context,this.statusElement=statusElement,this.targetIsProtected=targetIsProtected,this.targetDoc=targetDoc,this.targetACLDoc=targetACLDoc,this.defaultHolder=defaultHolder,this.defaultACLDoc=defaultACLDoc,this.prospectiveDefaultHolder=prospectiveDefaultHolder,this.store=store,this.dom=dom,(0,_defineProperty2.default)(this,"mainCombo",void 0),(0,_defineProperty2.default)(this,"defaultsCombo",void 0),(0,_defineProperty2.default)(this,"isContainer",void 0),(0,_defineProperty2.default)(this,"defaultsDiffer",void 0),(0,_defineProperty2.default)(this,"rootElement",void 0),(0,_defineProperty2.default)(this,"isUsingDefaults",void 0),this.rootElement=dom.createElement("div"),this.rootElement.setAttribute("style",style.aclGroupContent),this.isContainer="/"===targetDoc.uri.slice(-1),defaultHolder&&defaultACLDoc){this.isUsingDefaults=!0;var aclDefaultStore=(0,_acl.adoptACLDefault)(this.targetDoc,targetACLDoc,defaultHolder,defaultACLDoc);this.mainCombo=new _accessGroups.AccessGroups(targetDoc,targetACLDoc,this,aclDefaultStore,{defaults:this.isContainer}),this.defaultsCombo=null,this.defaultsDiffer=!1}else this.isUsingDefaults=!1,this.mainCombo=new _accessGroups.AccessGroups(targetDoc,targetACLDoc,this,store),this.defaultsCombo=new _accessGroups.AccessGroups(targetDoc,targetACLDoc,this,store,{defaults:this.isContainer}),this.defaultsDiffer=!(0,_acl.sameACL)(this.mainCombo.aclMap,this.defaultsCombo.aclMap)}var _removeDefaults,_removeAcls,_addDefaults,_addAcls;return(0,_createClass2.default)(AccessController,[{key:"isEditable",get:function get(){return!this.isUsingDefaults}},{key:"render",value:function render(){if(this.rootElement.innerHTML="",this.isUsingDefaults){if(this.renderStatus("The sharing for this ".concat(this.noun," is the default for folder ")),this.defaultHolder){var defaultHolderLink=this.statusElement.appendChild(this.dom.createElement("a"));defaultHolderLink.href=this.defaultHolder.uri,defaultHolderLink.innerText=(0,_aclControl.shortNameForFolder)(this.defaultHolder)}}else!this.defaultsDiffer&&this.isContainer?this.renderStatus("This is also the default for things in this folder."):this.renderStatus("");return this.rootElement.appendChild(this.mainCombo.render()),this.defaultsCombo&&this.defaultsDiffer?(this.rootElement.appendChild(this.renderRemoveDefaultsController()),this.rootElement.appendChild(this.defaultsCombo.render())):this.isEditable&&this.isContainer&&this.rootElement.appendChild(this.renderAddDefaultsController()),!this.targetIsProtected&&this.isUsingDefaults?this.rootElement.appendChild(this.renderAddAclsController()):this.targetIsProtected||this.rootElement.appendChild(this.renderRemoveAclsController()),this.rootElement}},{key:"renderRemoveAclsController",value:function renderRemoveAclsController(){var _this=this,useDefaultButton=this.dom.createElement("button");return useDefaultButton.innerText="Remove custom sharing settings for this ".concat(this.noun," -- just use default").concat(this.prospectiveDefaultHolder?" for ".concat(utils.label(this.prospectiveDefaultHolder)):""),useDefaultButton.setAttribute("style",style.bigButton),useDefaultButton.addEventListener("click",(function(){return _this.removeAcls().then((function(){return _this.render()})).catch((function(error){return _this.renderStatus(error)}))})),useDefaultButton}},{key:"renderAddAclsController",value:function renderAddAclsController(){var _this2=this,addAclButton=this.dom.createElement("button");return addAclButton.innerText="Set specific sharing for this ".concat(this.noun),addAclButton.setAttribute("style",style.bigButton),addAclButton.addEventListener("click",(function(){return _this2.addAcls().then((function(){return _this2.render()})).catch((function(error){return _this2.renderStatus(error)}))})),addAclButton}},{key:"renderAddDefaultsController",value:function renderAddDefaultsController(){var _this3=this,containerElement=this.dom.createElement("div");containerElement.setAttribute("style",style.defaultsController);var noticeElement=containerElement.appendChild(this.dom.createElement("div"));noticeElement.innerText="Sharing for things within the folder currently tracks sharing for the folder.",noticeElement.setAttribute("style",style.defaultsControllerNotice);var button=containerElement.appendChild(this.dom.createElement("button"));return button.innerText="Set the sharing of folder contents separately from the sharing for the folder",button.setAttribute("style",style.bigButton),button.addEventListener("click",(function(){return _this3.addDefaults().then((function(){return _this3.render()}))})),containerElement}},{key:"renderRemoveDefaultsController",value:function renderRemoveDefaultsController(){var _this4=this,containerElement=this.dom.createElement("div");containerElement.setAttribute("style",style.defaultsController);var noticeElement=containerElement.appendChild(this.dom.createElement("div"));noticeElement.innerText="Access to things within this folder:",noticeElement.setAttribute("style",style.defaultsControllerNotice);var button=containerElement.appendChild(this.dom.createElement("button"));return button.innerText="Set default for folder contents to just track the sharing for the folder",button.setAttribute("style",style.bigButton),button.addEventListener("click",(function(){return _this4.removeDefaults().then((function(){return _this4.render()})).catch((function(error){return _this4.renderStatus(error)}))})),containerElement}},{key:"renderTemporaryStatus",value:function renderTemporaryStatus(message){var _this5=this;this.statusElement.setAttribute("style",style.aclControlBoxStatusRevealed),this.statusElement.innerText=message,this.statusElement.setAttribute("style",style.temporaryStatusInit),setTimeout((function(){_this5.statusElement.setAttribute("style",style.temporaryStatusEnd)})),setTimeout((function(){_this5.statusElement.innerText=""}),5e3)}},{key:"renderStatus",value:function renderStatus(message){message||this.statusElement.setAttribute("style",style.aclControlBoxStatusRevealed),this.statusElement.innerText=message}},{key:"addAcls",value:(_addAcls=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(){var message,_message,_this6=this;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(this.defaultHolder&&this.defaultACLDoc){_context.next=4;break}return message="Unable to find defaults to copy",debug.error(message),_context.abrupt("return",Promise.reject(message));case 4:return(0,_acl.adoptACLDefault)(this.targetDoc,this.targetACLDoc,this.defaultHolder,this.defaultACLDoc).statements.forEach((function(st){return _this6.store.add(st.subject,st.predicate,st.object,_this6.targetACLDoc)})),_context.prev=6,_context.next=9,this.store.fetcher.putBack(this.targetACLDoc);case 9:return this.isUsingDefaults=!1,_context.abrupt("return",Promise.resolve());case 13:return _context.prev=13,_context.t0=_context.catch(6),_message=" Error writing back access control file! ".concat(_context.t0),debug.error(_message),_context.abrupt("return",Promise.reject(_message));case 18:case"end":return _context.stop()}}),_callee,this,[[6,13]])}))),function addAcls(){return _addAcls.apply(this,arguments)})},{key:"addDefaults",value:(_addDefaults=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(){return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:this.defaultsCombo=new _accessGroups.AccessGroups(this.targetDoc,this.targetACLDoc,this,this.store,{defaults:!0}),this.defaultsDiffer=!0;case 2:case"end":return _context2.stop()}}),_callee2,this)}))),function addDefaults(){return _addDefaults.apply(this,arguments)})},{key:"removeAcls",value:(_removeAcls=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(){var message;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.prev=0,_context3.next=3,this.store.fetcher.delete(this.targetACLDoc.uri,{});case 3:return this.isUsingDefaults=!0,_context3.prev=4,_context3.next=7,(0,_acl.getProspectiveHolder)(this.targetDoc.uri);case 7:this.prospectiveDefaultHolder=_context3.sent,_context3.next=13;break;case 10:_context3.prev=10,_context3.t0=_context3.catch(4),debug.warn(_context3.t0);case 13:_context3.next=20;break;case 15:return _context3.prev=15,_context3.t1=_context3.catch(0),message="Error deleting access control file: ".concat(this.targetACLDoc,": ").concat(_context3.t1),debug.error(message),_context3.abrupt("return",Promise.reject(message));case 20:case"end":return _context3.stop()}}),_callee3,this,[[0,15],[4,10]])}))),function removeAcls(){return _removeAcls.apply(this,arguments)})},{key:"removeDefaults",value:(_removeDefaults=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(){var fallbackCombo;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return fallbackCombo=this.defaultsCombo,_context4.prev=1,this.defaultsCombo=null,this.defaultsDiffer=!1,_context4.next=6,this.save();case 6:_context4.next=14;break;case 8:return _context4.prev=8,_context4.t0=_context4.catch(1),this.defaultsCombo=fallbackCombo,this.defaultsDiffer=!0,debug.error(_context4.t0),_context4.abrupt("return",Promise.reject(_context4.t0));case 14:case"end":return _context4.stop()}}),_callee4,this,[[1,8]])}))),function removeDefaults(){return _removeDefaults.apply(this,arguments)})},{key:"save",value:function save(){var _this7=this,newAClGraph=(0,_rdflib.graph)();this.isContainer?this.defaultsCombo&&this.defaultsDiffer?((0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),(0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.defaultsCombo.byCombo,this.targetACLDoc,!1,!0)):(0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0,!0):(0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),newAClGraph.fetcher=(0,_rdflib.fetcher)(newAClGraph,{fetch:this.store.fetcher._fetch});var updater=newAClGraph.updater||new _rdflib.UpdateManager(newAClGraph);return new Promise((function(resolve,reject){updater.put(_this7.targetACLDoc,newAClGraph.statementsMatching(void 0,void 0,void 0,_this7.targetACLDoc),"text/turtle",(function(uri,ok,message){if(!ok)return reject(new Error("ACL file save failed: ".concat(message)));_this7.store.fetcher.unload(_this7.targetACLDoc),_this7.store.add(newAClGraph.statements),_this7.store.fetcher.requested[_this7.targetACLDoc.uri]="done",_this7.mainCombo.store=_this7.store,_this7.defaultsCombo&&(_this7.defaultsCombo.store=_this7.store),_this7.defaultsDiffer=!!_this7.defaultsCombo&&!(0,_acl.sameACL)(_this7.mainCombo.aclMap,_this7.defaultsCombo.aclMap),debug.log("ACL modification: success!"),resolve()}))}))}}]),AccessController}()},"./lib/acl/access-groups.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.ends-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AccessGroups=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_slicedToArray2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_acl=__webpack_require__("./lib/acl/acl.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_addAgentButtons=__webpack_require__("./lib/acl/add-agent-buttons.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var ACL=ns.acl,COLLOQUIAL={13:"Owners",9:"Owners (write locked)",5:"Editors",3:"Posters",2:"Submitters",1:"Viewers"},RECOMMENDED={13:!0,5:!0,3:!0,2:!0,1:!0},EXPLANATION={13:"can read, write, and control sharing.",9:"can read and control sharing, currently write-locked.",5:"can read and change information",3:"can add new information, and read but not change existing information",2:"can add new information but not read any",1:"can read but not change information"};exports.AccessGroups=function(){function AccessGroups(doc,aclDoc,controller,store){var options=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,_classCallCheck2.default)(this,AccessGroups),this.doc=doc,this.aclDoc=aclDoc,this.controller=controller,this.options=options,(0,_defineProperty2.default)(this,"defaults",void 0),(0,_defineProperty2.default)(this,"byCombo",void 0),(0,_defineProperty2.default)(this,"aclMap",void 0),(0,_defineProperty2.default)(this,"addAgentButton",void 0),(0,_defineProperty2.default)(this,"rootElement",void 0),(0,_defineProperty2.default)(this,"_store",void 0),this.defaults=options.defaults||!1,this._store=store,this.aclMap=(0,_acl.readACL)(doc,aclDoc,store,this.defaults),this.byCombo=(0,_acl.ACLbyCombination)(this.aclMap),this.addAgentButton=new _addAgentButtons.AddAgentButtons(this),this.rootElement=this.controller.dom.createElement("div"),this.rootElement.setAttribute("style",style.accessGroupList)}var _handleDroppedUri,_handleDroppedUris,_addNewURI,_deleteAgent;return(0,_createClass2.default)(AccessGroups,[{key:"store",get:function get(){return this._store},set:function set(store){this._store=store,this.aclMap=(0,_acl.readACL)(this.doc,this.aclDoc,store,this.defaults),this.byCombo=(0,_acl.ACLbyCombination)(this.aclMap)}},{key:"render",value:function render(){var _this=this;return this.rootElement.innerHTML="",this.renderGroups().forEach((function(group){return _this.rootElement.appendChild(group)})),this.controller.isEditable&&this.rootElement.appendChild(this.addAgentButton.render()),this.rootElement}},{key:"renderGroups",value:function renderGroups(){for(var groupElements=[],comboIndex=15;comboIndex>0;comboIndex--){var combo=kToCombo(comboIndex);(this.controller.isEditable&&RECOMMENDED[comboIndex]||this.byCombo[combo])&&groupElements.push(this.renderGroup(comboIndex,combo))}return groupElements}},{key:"renderGroup",value:function renderGroup(comboIndex,combo){var _this2=this,groupRow=this.controller.dom.createElement("div");return groupRow.setAttribute("style",style.accessGroupListItem),widgets.makeDropTarget(groupRow,(function(uris){return _this2.handleDroppedUris(uris,combo).then((function(){return _this2.controller.render()})).catch((function(error){return _this2.controller.renderStatus(error)}))})),this.renderGroupElements(comboIndex,combo).forEach((function(column){return groupRow.appendChild(column)})),groupRow}},{key:"renderGroupElements",value:function renderGroupElements(comboIndex,combo){var _this3=this,groupNameColumn=this.controller.dom.createElement("div");if(groupNameColumn.setAttribute("style",style.group),this.controller.isEditable)switch(comboIndex){case 1:groupNameColumn.setAttribute("style",style.group1);break;case 2:groupNameColumn.setAttribute("style",style.group2);break;case 3:groupNameColumn.setAttribute("style",style.group3);break;case 5:groupNameColumn.setAttribute("style",style.group5);break;case 9:groupNameColumn.setAttribute("style",style.group9);break;case 13:groupNameColumn.setAttribute("style",style.group13);break;default:groupNameColumn.setAttribute("style",style.group)}groupNameColumn.innerText=COLLOQUIAL[comboIndex]||function ktToList(k){for(var list="",y=["Read","Append","Write","Control"],i=0;i<4;i++)k&1<2&&void 0!==arguments[2]&&arguments[2];return _regenerator.default.mark((function _callee4(){var agent,thing,_this6$_store,_this6$_store$fetcher,message,error;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:if(agent=findAgent(uri,_this6.store),thing=(0,_rdflib.sym)(uri),agent||secondAttempt){_context4.next=17;break}return debug.log(" Not obvious: looking up dropped thing ".concat(thing)),_context4.prev=4,_context4.next=7,null===(_this6$_store=_this6._store)||void 0===_this6$_store||null===(_this6$_store$fetcher=_this6$_store.fetcher)||void 0===_this6$_store$fetcher?void 0:_this6$_store$fetcher.load(thing.doc());case 7:_context4.next=14;break;case 9:return _context4.prev=9,_context4.t0=_context4.catch(4),message="Ignore error looking up dropped thing: ".concat(_context4.t0),debug.error(message),_context4.abrupt("return",Promise.reject(new Error(message)));case 14:return _context4.abrupt("return",_this6.handleDroppedUri(uri,combo,!0));case 17:if(agent){_context4.next=21;break}return error=" Error: Drop fails to drop appropriate thing! ".concat(uri),debug.error(error),_context4.abrupt("return",Promise.reject(new Error(error)));case 21:_this6.setACLCombo(combo,uri,agent,_this6.controller.subject);case 22:case"end":return _context4.stop()}}),_callee4,null,[[4,9]])}))()})),function handleDroppedUri(_x7,_x8){return _handleDroppedUri.apply(this,arguments)})},{key:"setACLCombo",value:function setACLCombo(combo,uri,res,subject){combo in this.byCombo||(this.byCombo[combo]=[]),this.removeAgentFromCombos(uri),this.byCombo[combo].push([res.pred,res.obj.uri]),debug.log("ACL: setting access to ".concat(subject," by ").concat(res.pred,": ").concat(res.obj))}},{key:"removeAgentFromCombos",value:function removeAgentFromCombos(uri){for(var k=0;k<16;k++){var combos=this.byCombo[kToCombo(k)];if(combos)for(var i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ACLControlBox5=function ACLControlBox5(subject,context,noun,kb){var dom=context.dom,doc=subject.doc(),container=dom.createElement("div");container.setAttribute("style",style.aclControlBoxContainer);var header=container.appendChild(dom.createElement("h1"));header.textContent="Sharing for ".concat(noun," ").concat(utils.label(subject)),header.setAttribute("style",style.aclControlBoxHeader);var status=container.appendChild(dom.createElement("div"));status.setAttribute("style",style.aclControlBoxStatus);try{(function loadController(_x,_x2,_x3,_x4,_x5,_x6,_x7){return _loadController.apply(this,arguments)})(doc,kb,subject,noun,context,dom,status).then((function(controller){return container.appendChild(controller.render())}))}catch(error){status.innerText=error}return container},exports.handleDrop=handleDrop,exports.preventBrowserDropEvents=function preventBrowserDropEvents(document){if((0,_debug.log)("preventBrowserDropEvents called."),void 0!==global){if(global[preventBrowserDropEventsDone])return;global[preventBrowserDropEventsDone]=!0}document.addEventListener("drop",handleDrop,!1),document.addEventListener("dragenter",preventDrag,!1),document.addEventListener("dragover",preventDrag,!1)},exports.preventDrag=preventDrag,exports.setGlobalWindow=function setGlobalWindow(window){global=window},exports.shortNameForFolder=function shortNameForFolder(x){var str=x.uri;"/"===str.slice(-1)&&(str=str.slice(0,-1));var slash=str.lastIndexOf("/");slash>=0&&(str=str.slice(slash+1));return str||"/"};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_acl=__webpack_require__("./lib/acl/acl.js"),_accessController=__webpack_require__("./lib/acl/access-controller.js"),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_debug=__webpack_require__("./lib/debug.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var global=window,preventBrowserDropEventsDone=Symbol("prevent double triggering of drop event");function preventDrag(e){e.stopPropagation(),e.preventDefault()}function handleDrop(e){e.dataTransfer.files.length>0&&(global.confirm("Are you sure you want to drop this file here? (Cancel opens it in a new tab)")||(e.stopPropagation(),e.preventDefault(),(0,_debug.log)("@@@@ document-level DROP suppressed: "+e.dataTransfer.dropEffect)))}function _loadController(){return _loadController=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(doc,kb,subject,noun,context,dom,status){return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.abrupt("return",new Promise((function(resolve,reject){return(0,_acl.getACLorDefault)(doc,function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(ok,isDirectACL,targetDoc,targetACLDoc,defaultHolder,defaultACLDoc){var targetDirectory,targetIsProtected,prospectiveDefaultHolder,getController;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(getController=function _getController(prospectiveDefaultHolder){return new _accessController.AccessController(subject,noun,context,status,targetIsProtected,targetDoc,targetACLDoc,defaultHolder,defaultACLDoc,prospectiveDefaultHolder,kb,dom)},ok){_context.next=3;break}return _context.abrupt("return",reject(new Error("Error reading ".concat(isDirectACL?"":" default ","ACL. status ").concat(targetDoc,": ").concat(targetACLDoc))));case 3:if(targetDirectory=getDirectory(targetDoc),(targetIsProtected=isStorage(targetDoc,targetACLDoc,kb)||hasProtectedAcl(targetDoc))||!targetDirectory){_context.next=16;break}return _context.prev=6,_context.next=9,(0,_acl.getProspectiveHolder)(targetDirectory);case 9:return prospectiveDefaultHolder=_context.sent,_context.abrupt("return",resolve(getController(prospectiveDefaultHolder)));case 13:_context.prev=13,_context.t0=_context.catch(6),(0,_debug.warn)(_context.t0);case 16:return _context.abrupt("return",resolve(getController()));case 17:case"end":return _context.stop()}}),_callee,null,[[6,13]])})));return function(_x8,_x9,_x10,_x11,_x12,_x13){return _ref.apply(this,arguments)}}())})));case 1:case"end":return _context2.stop()}}),_callee2)}))),_loadController.apply(this,arguments)}function getDirectory(doc){var str=doc.uri.split("#")[0],p=str.slice(0,-1).lastIndexOf("/"),q=str.indexOf("//");return q>=0&&p{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ACLToString=function ACLToString(ac){return comboToString(ACLbyCombination(ac))},exports.ACLbyCombination=ACLbyCombination,exports.ACLunion=ACLunion,exports.adoptACLDefault=function adoptACLDefault(doc,aclDoc,defaultResource,defaultACLDoc){var ACL=ns.acl,isContainer="/"===doc.uri.slice(-1),proposed=kb.each(void 0,ACL("default"),defaultResource,defaultACLDoc).concat(kb.each(void 0,ACL("defaultForNew"),defaultResource,defaultACLDoc)).reduce((function(accumulatedStatements,da){return accumulatedStatements.concat(kb.statementsMatching(da,ns.rdf("type"),ACL("Authorization"),defaultACLDoc)).concat(kb.statementsMatching(da,ACL("agent"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("agentClass"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("agentGroup"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("origin"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("originClass"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("mode"),void 0,defaultACLDoc)).concat((0,_rdflib.st)(da,ACL("accessTo"),doc,defaultACLDoc)).concat(isContainer?(0,_rdflib.st)(da,ACL("default"),doc,defaultACLDoc):[])}),[]),kb2=(0,_rdflib.graph)();return proposed.forEach((function(st){return kb2.add(move(st.subject),move(st.predicate),move(st.object),(0,_rdflib.sym)(aclDoc.uri))})),kb2;function move(symbol){var y=defaultACLDoc.uri.length;return(0,_rdflib.sym)(symbol.uri.slice(0,y)===defaultACLDoc.uri?aclDoc.uri+symbol.uri.slice(y):symbol.uri)}},exports.comboToString=comboToString,exports.fixIndividualACL=fixIndividualACL,exports.fixIndividualCardACL=function fixIndividualCardACL(person,log,callbackFunction){var groups=kb.each(void 0,ns.vcard("hasMember"),person);groups?fixIndividualACL(person,groups,log,callbackFunction):(log("This card is in no groups"),callbackFunction(!0))},exports.getACL=getACL,exports.getACLorDefault=getACLorDefault,exports.getProspectiveHolder=function getProspectiveHolder(_x){return _getProspectiveHolder.apply(this,arguments)},exports.loadUnionACL=loadUnionACL,exports.makeACLGraph=makeACLGraph,exports.makeACLGraphbyCombo=makeACLGraphbyCombo,exports.makeACLString=function makeACLString(x,ac,aclDoc){var kb2=(0,_rdflib.graph)();return makeACLGraph(kb2,x,ac,aclDoc),(0,_rdflib.serialize)(aclDoc,kb2,aclDoc.uri,"text/turtle")||""},exports.putACLObject=putACLObject,exports.putACLbyCombo=putACLbyCombo,exports.readACL=readACL,exports.sameACL=sameACL,exports.setACL=function setACL(docURI,aclText,callbackFunction){var aclDoc=kb.any(docURI,_solidLogic.ACL_LINK);if(!kb.fetcher)throw new Error("Store has no fetcher");aclDoc?kb.fetcher.webOperation("PUT",aclDoc.value,{data:aclText,contentType:"text/turtle"}).then((function(res){callbackFunction(res.ok,res.error||"")})):kb.fetcher.nowOrWhenFetched(docURI,void 0,(function(ok,body){if(!ok)return callbackFunction(ok,"Gettting headers for ACL: "+body);var aclDoc=kb.any(docURI,_solidLogic.ACL_LINK);if(aclDoc){if(!kb.fetcher)throw new Error("Store has no fetcher");kb.fetcher.webOperation("PUT",aclDoc.value,{data:aclText,contentType:"text/turtle"}).then((function(res){callbackFunction(res.ok,res.error||"")}))}else callbackFunction(!1,"No Link rel=ACL header for "+docURI)}))};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=_solidLogic.solidLogicSingleton.store;function readACL(doc,aclDoc){var kb2=arguments.length>2&&void 0!==arguments[2]?arguments[2]:kb,getDefaults=arguments.length>3&&void 0!==arguments[3]&&arguments[3],auths=getDefaults?getDefaultsFallback(kb2,ns):kb2.each(void 0,ns.acl("accessTo"),doc),ACL=ns.acl,ac={agent:{},agentClass:{},agentGroup:{},origin:{},originClass:{}};return Object.keys(ac).forEach((function(pred){auths.forEach((function(a){kb2.each(a,ACL("mode")).forEach((function(mode){kb2.each(a,ACL(pred)).forEach((function(agent){ac[pred][agent.uri]=ac[pred][agent.uri]||{},ac[pred][agent.uri][mode.uri]=a}))}))}))})),ac;function getDefaultsFallback(kb,ns){return kb.each(void 0,ns.acl("default"),doc).concat(kb.each(void 0,ns.acl("defaultForNew"),doc))}}function sameACL(a,b){var contains=function contains(a,b){for(var pred in{agent:!0,agentClass:!0,agentGroup:!0,origin:!0,originClass:!0})if(a[pred])for(var agent in a[pred])for(var mode in a[pred][agent])if(!b[pred][agent]||!b[pred][agent][mode])return!1;return!0};return contains(a,b)&&contains(b,a)}function ACLunion(list){for(var a,ag,b=list[0],_loop=function _loop(k){["agent","agentClass","agentGroup","origin","originClass"].forEach((function(pred){if((a=list[k])[pred])for(ag in a[pred])for(var mode in a[pred][ag])b[pred][ag]||(b[pred][ag]=[]),b[pred][ag][mode]=!0}))},k=1;kright)return callbackFunction(!1,!0,404,"Found no ACL resource");uri=uri.slice(0,right+1);var doc2=(0,_rdflib.sym)(uri);getACL(doc2,(function(ok,status,defaultACLDoc){if(!ok)return callbackFunction(!1,!0,status,"( No ACL pointer ".concat(uri," ").concat(status,")").concat(defaultACLDoc));if(403===status)return callbackFunction(!1,!0,status,"( default ACL file FORBIDDEN. Stop.".concat(uri,")"));if(404===status)return tryParent(uri);if(200!==status)return callbackFunction(!1,!0,status,"Error status '".concat(status,"' searching for default for ").concat(doc2));if(!kb.each(void 0,ACL("default"),kb.sym(uri),defaultACLDoc).concat(kb.each(void 0,ACL("defaultForNew"),kb.sym(uri),defaultACLDoc)).length)return tryParent(uri);var defaultHolder=kb.sym(uri);return callbackFunction(!0,!1,doc,aclDoc,defaultHolder,defaultACLDoc)}))}(doc.uri):callbackFunction(!1,!1,status,"Error accessing Access Control information for ".concat(doc,") ").concat(message))}))}function getACL(doc,callbackFunction){if(!kb.fetcher)throw new Error("kb has no fetcher");kb.fetcher.nowOrWhenFetched(doc,void 0,(function(ok,body){if(!ok)return callbackFunction(ok,"Can't get headers to find ACL for ".concat(doc,": ").concat(body));var aclDoc=kb.any(doc,_solidLogic.ACL_LINK);if(aclDoc){if(!kb.fetcher)throw new Error("kb has no fetcher");if(kb.fetcher.nonexistent[aclDoc.value])return callbackFunction(!0,404,aclDoc,"ACL file ".concat(aclDoc," does not exist."));kb.fetcher.nowOrWhenFetched(aclDoc,void 0,(function(ok,message,response){ok?callbackFunction(!0,200,aclDoc):callbackFunction(!0,response.status,aclDoc,"Can't read Access Control File ".concat(aclDoc,": ").concat(message))}))}else callbackFunction(!1,900,"No Link rel=ACL header for ".concat(doc))}))}function _getProspectiveHolder(){return(_getProspectiveHolder=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(targetDirectory){return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.abrupt("return",new Promise((function(resolve,reject){return getACLorDefault((0,_rdflib.sym)(targetDirectory),(function(ok,isDirectACL,targetDoc,targetACLDoc,defaultHolder){return ok?resolve(isDirectACL?targetDoc:defaultHolder):reject(new Error("Error loading ".concat(targetDirectory)))}))})));case 1:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}},"./lib/acl/add-agent-buttons.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.flat-map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.unscopables.flat-map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddAgentButtons=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_login=__webpack_require__("./lib/login/login.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.AddAgentButtons=function(){function AddAgentButtons(groupList){(0,_classCallCheck2.default)(this,AddAgentButtons),this.groupList=groupList,(0,_defineProperty2.default)(this,"rootElement",void 0),(0,_defineProperty2.default)(this,"barElement",void 0),(0,_defineProperty2.default)(this,"isExpanded",!1),this.rootElement=groupList.controller.dom.createElement("div"),this.barElement=groupList.controller.dom.createElement("div")}var _getOriginFromName,_addBot,_addAgent,_addGroup,_addPerson,_renderAppsTable;return(0,_createClass2.default)(AddAgentButtons,[{key:"render",value:function render(){return this.rootElement.innerHTML="",this.rootElement.appendChild(this.renderAddButton()),this.rootElement.appendChild(this.barElement),this.rootElement}},{key:"renderAddButton",value:function renderAddButton(){var _this=this;return widgets.button(this.groupList.controller.dom,"".concat(_iconBase.icons.iconBase,"noun_34653_green.svg"),"Add ...",(function(){_this.toggleBar(),_this.renderBar()}))}},{key:"renderBar",value:function renderBar(){this.barElement.innerHTML="",this.isExpanded&&(this.barElement.appendChild(this.renderPersonButton()),this.barElement.appendChild(this.renderGroupButton()),this.barElement.appendChild(this.renderPublicButton()),this.barElement.appendChild(this.renderAuthenticatedAgentButton()),this.barElement.appendChild(this.renderBotButton()),this.barElement.appendChild(this.renderAppsButton()))}},{key:"renderSimplifiedBar",value:function renderSimplifiedBar(button){var _this2=this;Array.from(this.barElement.children).filter((function(element){return element!==button})).forEach((function(element){return _this2.barElement.removeChild(element)}))}},{key:"renderPersonButton",value:function renderPersonButton(){var _this3=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+widgets.iconForClass["vcard:Individual"],"Add Person",(function(event){_this3.renderSimplifiedBar(event.target),_this3.renderNameForm(ns.vcard("Individual"),"person").then((function(name){return _this3.addPerson(name)})).then((function(){return _this3.renderCleanup()})).catch((function(error){return _this3.groupList.controller.renderStatus(error)}))}))}},{key:"renderGroupButton",value:function renderGroupButton(){var _this4=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+widgets.iconForClass["vcard:Group"],"Add Group",(function(event){_this4.renderSimplifiedBar(event.target),_this4.renderNameForm(ns.vcard("Group"),"group").then((function(name){return _this4.addGroup(name)})).then((function(){return _this4.renderCleanup()})).catch((function(error){return _this4.groupList.controller.renderStatus(error)}))}))}},{key:"renderNameForm",value:function renderNameForm(type,noun){return widgets.askName(this.groupList.controller.dom,this.groupList.store,this.barElement,ns.vcard("URI"),type,noun)}},{key:"renderPublicButton",value:function renderPublicButton(){var _this5=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+widgets.iconForClass["foaf:Agent"],"Add Everyone",(function(){return _this5.addAgent(ns.foaf("Agent").uri).then((function(){return _this5.groupList.controller.renderTemporaryStatus("Adding the general public to those who can read. Drag the globe to a different level to give them more access.")})).then((function(){return _this5.renderCleanup()}))}))}},{key:"renderAuthenticatedAgentButton",value:function renderAuthenticatedAgentButton(){var _this6=this;return widgets.button(this.groupList.controller.dom,"".concat(_iconBase.icons.iconBase,"noun_99101.svg"),"Anyone logged In",(function(){return _this6.addAgent(ns.acl("AuthenticatedAgent").uri).then((function(){return _this6.groupList.controller.renderTemporaryStatus("Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.")})).then((function(){return _this6.renderCleanup()}))}))}},{key:"renderBotButton",value:function renderBotButton(){var _this7=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+"noun_Robot_849764.svg","A Software Agent (bot)",(function(event){_this7.renderSimplifiedBar(event.target),_this7.renderNameForm(ns.schema("Application"),"bot").then((function(name){return _this7.addBot(name)})).then((function(){return _this7.renderCleanup()}))}))}},{key:"renderAppsButton",value:function renderAppsButton(){var _this8=this;return widgets.button(this.groupList.controller.dom,"".concat(_iconBase.icons.iconBase,"noun_15177.svg"),"A Web App (origin)",(function(event){_this8.renderSimplifiedBar(event.target);var eventContext={div:_this8.barElement,dom:_this8.groupList.controller.dom},existingApps=_this8.renderAppsTable(eventContext).catch((function(error){return _this8.groupList.controller.renderStatus(error)}));_this8.renderAppsView();var newApp=_this8.renderNameForm(ns.schema("WebApplication"),"webapp domain").then((function(name){return _this8.getOriginFromName(name)}));Promise.race([existingApps,newApp]).then((function(origin){origin&&_this8.groupList.addNewURI(origin)})).then((function(){return _this8.renderCleanup()}))}))}},{key:"renderAppsView",value:function renderAppsView(){var _this9=this,trustedApplications=this.groupList.controller.context.session.paneRegistry.byName("trustedApplications");if(trustedApplications){var trustedApplicationsElement=trustedApplications.render(null,this.groupList.controller.context);trustedApplicationsElement.setAttribute("style",style.trustedAppController);var cancelButton=widgets.cancelButton(this.groupList.controller.dom,(function(){return _this9.renderCleanup()}));cancelButton.setAttribute("style",style.trustedAppCancelButton),trustedApplicationsElement.insertBefore(cancelButton,trustedApplicationsElement.firstChild),this.barElement.appendChild(trustedApplicationsElement)}}},{key:"renderAppsTable",value:(_renderAppsTable=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(eventContext){var trustedApps,trustedOrigins,_this10=this;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,(0,_login.ensureLoadedProfile)(eventContext);case 2:return trustedApps=this.groupList.store.each(eventContext.me,ns.acl("trustedApp")),trustedOrigins=trustedApps.flatMap((function(app){return _this10.groupList.store.each(app,ns.acl("origin"))})),this.barElement.appendChild(this.groupList.controller.dom.createElement("p")).textContent="You have ".concat(trustedOrigins.length," selected web apps."),_context.abrupt("return",new Promise((function(resolve,reject){var appsTable=_this10.barElement.appendChild(_this10.groupList.controller.dom.createElement("table"));appsTable.setAttribute("style",style.trustedAppAddApplicationsTable),trustedApps.forEach((function(app){var origin=_this10.groupList.store.any(app,ns.acl("origin"));origin||reject(new Error("Unable to pick app: ".concat(app.value)));var thingTR=widgets.personTR(_this10.groupList.controller.dom,ns.acl("origin"),origin,{}),innerTable=_this10.groupList.controller.dom.createElement("table"),innerRow=innerTable.appendChild(_this10.groupList.controller.dom.createElement("tr"));innerRow.appendChild(_this10.groupList.controller.dom.createElement("td")).appendChild(thingTR),innerRow.appendChild(_this10.groupList.controller.dom.createElement("td")).textContent="Give access to ".concat(_this10.groupList.controller.noun," ").concat(utils.label(_this10.groupList.controller.subject),"?"),innerRow.appendChild(_this10.groupList.controller.dom.createElement("td")).appendChild(widgets.continueButton(_this10.groupList.controller.dom,(function(){return resolve(origin.value)}))),appsTable.appendChild(innerTable)}))})));case 6:case"end":return _context.stop()}}),_callee,this)}))),function renderAppsTable(_x){return _renderAppsTable.apply(this,arguments)})},{key:"renderCleanup",value:function renderCleanup(){this.renderBar(),this.groupList.render()}},{key:"addPerson",value:(_addPerson=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(name){var domainNameRegexp;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(name){_context2.next=2;break}return _context2.abrupt("return",this.toggleBar());case 2:if(domainNameRegexp=/^https?:/i,name.match(domainNameRegexp)){_context2.next=5;break}return _context2.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return debug.log("Adding to ACL person: ".concat(name)),_context2.next=8,this.groupList.addNewURI(name);case 8:this.toggleBar();case 9:case"end":return _context2.stop()}}),_callee2,this)}))),function addPerson(_x2){return _addPerson.apply(this,arguments)})},{key:"addGroup",value:(_addGroup=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(name){var domainNameRegexp;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(name){_context3.next=2;break}return _context3.abrupt("return",this.toggleBar());case 2:if(domainNameRegexp=/^https?:/i,name.match(domainNameRegexp)){_context3.next=5;break}return _context3.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return debug.log("Adding to ACL group: "+name),_context3.next=8,this.groupList.addNewURI(name);case 8:this.toggleBar();case 9:case"end":return _context3.stop()}}),_callee3,this)}))),function addGroup(_x3){return _addGroup.apply(this,arguments)})},{key:"addAgent",value:(_addAgent=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(agentUri){return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,this.groupList.addNewURI(agentUri);case 2:this.toggleBar();case 3:case"end":return _context4.stop()}}),_callee4,this)}))),function addAgent(_x4){return _addAgent.apply(this,arguments)})},{key:"addBot",value:(_addBot=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(name){var domainNameRegexp;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:if(name){_context5.next=2;break}return _context5.abrupt("return",this.toggleBar());case 2:if(domainNameRegexp=/^https?:/i,name.match(domainNameRegexp)){_context5.next=5;break}return _context5.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return debug.log("Adding to ACL bot: "+name),_context5.next=8,this.groupList.addNewURI(name);case 8:this.toggleBar();case 9:case"end":return _context5.stop()}}),_callee5,this)}))),function addBot(_x5){return _addBot.apply(this,arguments)})},{key:"getOriginFromName",value:(_getOriginFromName=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee6(name){var domainNameRegexp,origin;return _regenerator.default.wrap((function _callee6$(_context6){for(;;)switch(_context6.prev=_context6.next){case 0:if(name){_context6.next=2;break}return _context6.abrupt("return",Promise.resolve());case 2:if(domainNameRegexp=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i,name.match(domainNameRegexp)){_context6.next=5;break}return _context6.abrupt("return",Promise.reject(new Error("Not a domain name")));case 5:return origin="https://"+name,debug.log("Adding to ACL origin: "+origin),this.toggleBar(),_context6.abrupt("return",origin);case 9:case"end":return _context6.stop()}}),_callee6,this)}))),function getOriginFromName(_x6){return _getOriginFromName.apply(this,arguments)})},{key:"toggleBar",value:function toggleBar(){this.isExpanded=!this.isExpanded}}]),AddAgentButtons}()},"./lib/acl/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.aclControl=exports.acl=void 0;var _acl=__webpack_require__("./lib/acl/acl.js"),_aclControl=__webpack_require__("./lib/acl/acl-control.js");exports.acl={adoptACLDefault:_acl.adoptACLDefault,readACL:_acl.readACL,sameACL:_acl.sameACL,ACLunion:_acl.ACLunion,loadUnionACL:_acl.loadUnionACL,ACLbyCombination:_acl.ACLbyCombination,makeACLGraph:_acl.makeACLGraph,makeACLGraphbyCombo:_acl.makeACLGraphbyCombo,ACLToString:_acl.ACLToString,comboToString:_acl.comboToString,makeACLString:_acl.makeACLString,putACLObject:_acl.putACLObject,putACLbyCombo:_acl.putACLbyCombo,fixIndividualCardACL:_acl.fixIndividualCardACL,fixIndividualACL:_acl.fixIndividualACL,setACL:_acl.setACL,getACLorDefault:_acl.getACLorDefault,getACL:_acl.getACL},exports.aclControl={preventBrowserDropEvents:_aclControl.preventBrowserDropEvents,shortNameForFolder:_aclControl.shortNameForFolder,ACLControlBox5:_aclControl.ACLControlBox5}},"./lib/chat/bookmarks.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.findBookmarkDocument=function findBookmarkDocument(_x){return _findBookmarkDocument.apply(this,arguments)},exports.renderBookmarksButton=function renderBookmarksButton(_x7,_x8){return _renderBookmarksButton.apply(this,arguments)},exports.toggleBookmark=toggleBookmark;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_index=__webpack_require__("./lib/media/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),pad=_interopRequireWildcard(__webpack_require__("./lib/pad.js")),rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_login=__webpack_require__("./lib/login/login.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var UI={icons:_iconBase.icons,ns,media:_index.media,pad,rdf,style,utils,widgets},$rdf=UI.rdf,BOOK=$rdf.Namespace("http://www.w3.org/2002/01/bookmark#"),label=utils.label,dom=window.document||null;function createIfNotExists(doc){return new Promise((function(resolve,reject){_solidLogic.store.fetcher.load(doc).then((function(response){debug.log("createIfNotExists doc exists, all good "+doc),resolve(response)}),(function(err){404===err.response.status?(debug.log("createIfNotExists doc does NOT exist, will create... "+doc),_solidLogic.store.fetcher.webOperation("PUT",doc.uri,{data:"",contentType:"text/turtle"}).then((function(response){delete _solidLogic.store.fetcher.requested[doc.uri],debug.log("createIfNotExists doc created ok "+doc),resolve(response)}),(function(err){debug.log("createIfNotExists doc FAILED: "+doc+": "+err),reject(err)}))):(debug.log("createIfNotExists doc load error NOT 404: "+doc+": "+err),reject(err))}))}))}function updatePromise(del,ins){return new Promise((function(resolve,reject){_solidLogic.store.updater.update(del,ins,(function(uri,ok,errorBody){ok?resolve():reject(new Error(errorBody))}))}))}function _findBookmarkDocument(){return(_findBookmarkDocument=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(userContext){var theClass,fileTail,newBookmarkFile;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return theClass=BOOK("Bookmark"),fileTail="bookmarks.ttl",!0,_context.next=5,(0,_login.findAppInstances)(userContext,theClass,true);case 5:if(!(userContext.instances&&userContext.instances.length>0)){_context.next=10;break}userContext.bookmarkDocument=userContext.instances[0],userContext.instances.length>1&&alert("More than one bookmark file! "+userContext.instances),_context.next=28;break;case 10:if(!userContext.publicProfile){_context.next=27;break}return newBookmarkFile=$rdf.sym(userContext.publicProfile.dir().uri+fileTail),_context.prev=12,debug.log("Creating new bookmark file "+newBookmarkFile),_context.next=16,createIfNotExists(newBookmarkFile);case 16:_context.next=22;break;case 18:return _context.prev=18,_context.t0=_context.catch(12),alert.error("Can't make fresh bookmark file:"+_context.t0),_context.abrupt("return",userContext);case 22:return _context.next=24,(0,_solidLogic.registerInTypeIndex)(newBookmarkFile,userContext.index,theClass);case 24:userContext.bookmarkDocument=newBookmarkFile,_context.next=28;break;case 27:alert("You seem to have no bookmark file and not even a profile file.");case 28:return _context.abrupt("return",userContext);case 29:case"end":return _context.stop()}}),_callee,null,[[12,18]])})))).apply(this,arguments)}function addBookmark(_x2,_x3){return _addBookmark.apply(this,arguments)}function _addBookmark(){return(_addBookmark=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(context,target){var title,me,author,bookmarkDoc,bookmark,ins,msg;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(title="",me=_solidLogic.authn.currentUser()){_context2.next=4;break}throw new Error("Must be logged on to add Bookmark");case 4:return author=_solidLogic.store.any(target,ns.foaf("maker")),title=label(author)+": "+_solidLogic.store.anyValue(target,ns.sioc("content")).slice(0,80),bookmarkDoc=context.bookmarkDocument,bookmark=UI.widgets.newThing(bookmarkDoc,title),ins=[$rdf.st(bookmarkDoc,UI.ns.dct("references"),bookmark,bookmarkDoc),$rdf.st(bookmark,UI.ns.rdf("type"),BOOK("Bookmark"),bookmarkDoc),$rdf.st(bookmark,UI.ns.dct("created"),new Date,bookmarkDoc),$rdf.st(bookmark,BOOK("recalls"),target,bookmarkDoc),$rdf.st(bookmark,UI.ns.foaf("maker"),me,bookmarkDoc),$rdf.st(bookmark,UI.ns.dct("title"),title,bookmarkDoc)],_context2.prev=9,_context2.next=12,updatePromise([],ins);case 12:_context2.next=19;break;case 14:return _context2.prev=14,_context2.t0=_context2.catch(9),msg="Making bookmark: "+_context2.t0,alert.error(msg),_context2.abrupt("return",null);case 19:return _context2.abrupt("return",bookmark);case 20:case"end":return _context2.stop()}}),_callee2,null,[[9,14]])})))).apply(this,arguments)}function toggleBookmark(_x4,_x5,_x6){return _toggleBookmark.apply(this,arguments)}function _toggleBookmark(){return(_toggleBookmark=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(userContext,target,bookmarkButton){var bookmarks,i,bookmark;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,_solidLogic.store.fetcher.load(userContext.bookmarkDocument);case 2:if(!(bookmarks=_solidLogic.store.each(null,BOOK("recalls"),target,userContext.bookmarkDocument)).length){_context3.next=24;break}if(confirm("Delete bookmark on this?"+bookmarks.length)){_context3.next=6;break}return _context3.abrupt("return");case 6:i=0;case 7:if(!(i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChatChannel=void 0,exports._createIfNotExists=function _createIfNotExists(_x4){return _createIfNotExists2.apply(this,arguments)},exports.isDeleted=function isDeleted(message){return _solidLogic.store.holds(message,ns.schema("dateDeleted"),null,message.doc())},exports.isHidden=function isHidden(message){return this.isDeleted(message)||this.isReplaced(message)},exports.isReplaced=function isReplaced(message){return _solidLogic.store.holds(message,ns.dct("isReplacedBy"),null,message.doc())},exports.mostRecentVersion=mostRecentVersion,exports.nick=function nick(person){var s=_solidLogic.store.any(person,ns.foaf("nick"));return s?""+s.value:""+utils.label(person)},exports.originalVersion=function originalVersion(message){var msg=message;for(;msg;)message=msg,msg=_solidLogic.store.any(null,ns.dct("isReplacedBy"),message,message.doc());return message};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_dateFolder=__webpack_require__("./lib/chat/dateFolder.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_signature=__webpack_require__("./lib/chat/signature.js"),_keys=__webpack_require__("./lib/chat/keys.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.ChatChannel=function(){function ChatChannel(channel,options){(0,_classCallCheck2.default)(this,ChatChannel),this.channel=channel,this.channelRoot=channel.doc(),this.options=options,this.dateFolder=new _dateFolder.DateFolder(this.channelRoot,"chat.ttl"),this.div=null}var _deleteMessage,_updateMessage,_createMessage;return(0,_createClass2.default)(ChatChannel,[{key:"createMessage",value:(_createMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(text){return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.abrupt("return",this.updateMessage(text));case 1:case"end":return _context.stop()}}),_callee,this)}))),function createMessage(_x){return _createMessage.apply(this,arguments)})},{key:"updateMessage",value:(_updateMessage=(0,_asyncToGenerator2.default)((function(text){var _this=this,oldMsg=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,deleteIt=arguments.length>2?arguments[2]:void 0;return _regenerator.default.mark((function _callee2(){var sts,now,timestamp,dateStamp,chatDocument,message,me,msg,oldMsgMaker,errMsg,privateKey,sig,_errMsg;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(sts=[],now=new Date,timestamp=""+now.getTime(),dateStamp=$rdf.term(now),chatDocument=oldMsg?oldMsg.doc():_this.dateFolder.leafDocumentFromDate(now),message=_solidLogic.store.sym(chatDocument.uri+"#Msg"+timestamp),me=_solidLogic.authn.currentUser(),(msg=(0,_signature.getBlankMsg)()).id=message.uri,!oldMsg){_context2.next=22;break}if((oldMsgMaker=_solidLogic.store.any(oldMsg,ns.foaf("maker"))).uri!==me.uri){_context2.next=16;break}sts.push($rdf.st(mostRecentVersion(oldMsg),ns.dct("isReplacedBy"),message,chatDocument)),deleteIt&&sts.push($rdf.st(message,ns.schema("dateDeleted"),dateStamp,chatDocument)),_context2.next=20;break;case 16:throw errMsg="Error you cannot delete/edit a message from someone else : \n"+oldMsgMaker.uri,debug.warn(errMsg),alert(errMsg),new Error(errMsg);case 20:_context2.next=23;break;case 22:sts.push($rdf.st(_this.channel,ns.wf("message"),message,chatDocument));case 23:if(sts.push($rdf.st(message,ns.sioc("content"),_solidLogic.store.literal(text),chatDocument)),msg.content=text,sts.push($rdf.st(message,ns.dct("created"),dateStamp,chatDocument)),msg.created=dateStamp.value,!me){_context2.next=35;break}return sts.push($rdf.st(message,ns.foaf("maker"),me,chatDocument)),msg.maker=me.uri,_context2.next=32,(0,_keys.getPrivateKey)(me);case 32:privateKey=_context2.sent,sig=(0,_signature.signMsg)(msg,privateKey),sts.push($rdf.st(message,$rdf.sym("".concat(_signature.SEC,"proofValue")),$rdf.lit(sig),chatDocument));case 35:return _context2.prev=35,_context2.next=38,_solidLogic.store.updater.update([],sts);case 38:_context2.next=46;break;case 40:throw _context2.prev=40,_context2.t0=_context2.catch(35),_errMsg="Error saving chat message: "+_context2.t0,debug.warn(_errMsg),alert(_errMsg),new Error(_errMsg);case 46:return _context2.abrupt("return",message);case 47:case"end":return _context2.stop()}}),_callee2,null,[[35,40]])}))()})),function updateMessage(_x2){return _updateMessage.apply(this,arguments)})},{key:"deleteMessage",value:(_deleteMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(message){return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.abrupt("return",this.updateMessage("(message deleted)",message,!0));case 1:case"end":return _context3.stop()}}),_callee3,this)}))),function deleteMessage(_x3){return _deleteMessage.apply(this,arguments)})}]),ChatChannel}();function mostRecentVersion(message){for(var msg=message;msg;)message=msg,msg=_solidLogic.store.any(message,ns.dct("isReplacedBy"),null,message.doc());return message}function _createIfNotExists2(){return _createIfNotExists2=(0,_asyncToGenerator2.default)((function(doc){var contentType=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text/turtle",data=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return _regenerator.default.mark((function _callee4(){var response;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.prev=0,_context4.next=3,_solidLogic.store.fetcher.load(doc);case 3:response=_context4.sent,_context4.next=26;break;case 6:if(_context4.prev=6,_context4.t0=_context4.catch(0),404!==_context4.t0.response.status){_context4.next=24;break}return debug.log("createIfNotExists: doc does NOT exist, will create... "+doc),_context4.prev=10,_context4.next=13,_solidLogic.store.fetcher.webOperation("PUT",doc.uri,{data,contentType});case 13:response=_context4.sent,_context4.next=20;break;case 16:throw _context4.prev=16,_context4.t1=_context4.catch(10),debug.log("createIfNotExists doc FAILED: "+doc+": "+_context4.t1),_context4.t1;case 20:return delete _solidLogic.store.fetcher.requested[doc.uri],_context4.abrupt("return",response);case 24:throw debug.log("createIfNotExists doc load error NOT 404: "+doc+": "+_context4.t0),_context4.t0;case 26:return _context4.abrupt("return",response);case 27:case"end":return _context4.stop()}}),_callee4,null,[[0,6],[10,16]])}))()})),_createIfNotExists2.apply(this,arguments)}},"./lib/chat/dateFolder.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reverse.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.DateFolder=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.DateFolder=function(){function DateFolder(rootThing,leafFileName,membershipProperty){(0,_classCallCheck2.default)(this,DateFolder),this.root=rootThing,this.rootFolder=rootThing.dir(),this.leafFileName=leafFileName||"index.ttl",this.membershipProperty=membershipProperty||ns.wf("leafObject")}var _firstLeaf,_loadPrevious;return(0,_createClass2.default)(DateFolder,[{key:"leafDocumentFromDate",value:function leafDocumentFromDate(date){var path=date.toISOString().split("T")[0].replace(/-/g,"/");return path=this.root.dir().uri+path+"/"+this.leafFileName,_solidLogic.store.sym(path)}},{key:"dateFromLeafDocument",value:function dateFromLeafDocument(doc){var head=this.rootFolder.uri.length,str=doc.uri.slice(head,head+10).replace(/\//g,"-"),date=new Date(str);return debug.log("Date for "+doc+":"+date.toISOString()),date}},{key:"loadPrevious",value:(_loadPrevious=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(date,backwards){var thisDateFolder,previousPeriod,_previousPeriod,folder,found,doc;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _previousPeriod=function _previousPeriod3(){return _previousPeriod=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(file,level){var younger,suitable,lastNonEmpty,_lastNonEmpty,parent,siblings,_folder,uncle,cousins,result;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _lastNonEmpty=function _lastNonEmpty3(){return _lastNonEmpty=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(siblings){var _folder2,leafDocument;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if((siblings=siblings.filter(suitable)).sort(),backwards||siblings.reverse(),3===level){_context.next=5;break}return _context.abrupt("return",siblings.pop());case 5:if(!siblings.length){_context.next=14;break}return _folder2=siblings.pop(),leafDocument=_solidLogic.store.sym(_folder2.uri+thisDateFolder.leafFileName),_context.next=10,_solidLogic.store.fetcher.load(leafDocument);case 10:if(!(_solidLogic.store.statementsMatching(null,ns.dct("created"),null,leafDocument).length>0)){_context.next=12;break}return _context.abrupt("return",_folder2);case 12:_context.next=5;break;case 14:return _context.abrupt("return",null);case 15:case"end":return _context.stop()}}),_callee)}))),_lastNonEmpty.apply(this,arguments)},lastNonEmpty=function _lastNonEmpty2(_x5){return _lastNonEmpty.apply(this,arguments)},suitable=function _suitable(x){var tail=x.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(tail[0])},younger=function _younger(x){return!(backwards?x.uri>=file.uri:x.uri<=file.uri)},parent=file.dir(),_context2.prev=5,_context2.next=8,_solidLogic.store.fetcher.load(parent);case 8:return siblings=(siblings=_solidLogic.store.each(parent,ns.ldp("contains"))).filter(younger),_context2.next=12,lastNonEmpty(siblings);case 12:if(!(_folder=_context2.sent)){_context2.next=15;break}return _context2.abrupt("return",_folder);case 15:_context2.next=25;break;case 17:if(_context2.prev=17,_context2.t0=_context2.catch(5),!_context2.t0.response||!_context2.t0.response.status||404!==_context2.t0.response.status){_context2.next=23;break}debug.log("Error 404 for chat parent file "+parent),_context2.next=25;break;case 23:throw debug.log("*** Error NON 404 for chat parent file "+parent),new Error("*** ".concat(_context2.t0.message," for chat folder ").concat(parent));case 25:if(0!==level){_context2.next=27;break}return _context2.abrupt("return",null);case 27:return _context2.next=29,previousPeriod(parent,level-1);case 29:if(uncle=_context2.sent){_context2.next=32;break}return _context2.abrupt("return",null);case 32:return _context2.next=34,_solidLogic.store.fetcher.load(uncle);case 34:return cousins=_solidLogic.store.each(uncle,ns.ldp("contains")),_context2.next=37,lastNonEmpty(cousins);case 37:return result=_context2.sent,_context2.abrupt("return",result);case 39:case"end":return _context2.stop()}}),_callee2,null,[[5,17]])}))),_previousPeriod.apply(this,arguments)},previousPeriod=function _previousPeriod2(_x3,_x4){return _previousPeriod.apply(this,arguments)},thisDateFolder=this,folder=this.leafDocumentFromDate(date).dir(),_context3.next=6,previousPeriod(folder,3);case 6:if(!(found=_context3.sent)){_context3.next=10;break}return doc=_solidLogic.store.sym(found.uri+this.leafFileName),_context3.abrupt("return",this.dateFromLeafDocument(doc));case 10:return _context3.abrupt("return",null);case 11:case"end":return _context3.stop()}}),_callee3,this)}))),function loadPrevious(_x,_x2){return _loadPrevious.apply(this,arguments)})},{key:"firstLeaf",value:(_firstLeaf=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(backwards){var folderStore,folderFetcher,earliestSubfolder,_earliestSubfolder,y,month,d,leafDocument,leafObjects,msg,sortMe;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:return _earliestSubfolder=function _earliestSubfolder3(){return(_earliestSubfolder=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(parent){var suitable,kids;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return suitable=function _suitable2(x){var tail=x.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(tail[0])},debug.log(" parent "+parent),delete folderFetcher.requested[parent.uri],_context4.next=5,folderFetcher.load(parent,{force:!0});case 5:if(0!==(kids=(kids=folderStore.each(parent,ns.ldp("contains"))).filter(suitable)).length){_context4.next=9;break}throw new Error(" @@@ No children to parent2 "+parent);case 9:return kids.sort(),backwards&&kids.reverse(),_context4.abrupt("return",kids[0]);case 12:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)},earliestSubfolder=function _earliestSubfolder2(_x7){return _earliestSubfolder.apply(this,arguments)},folderStore=$rdf.graph(),folderFetcher=new $rdf.Fetcher(folderStore),_context5.next=6,earliestSubfolder(this.root.dir());case 6:return y=_context5.sent,_context5.next=9,earliestSubfolder(y);case 9:return month=_context5.sent,_context5.next=12,earliestSubfolder(month);case 12:return d=_context5.sent,leafDocument=$rdf.sym(d.uri+"chat.ttl"),_context5.next=16,folderFetcher.load(leafDocument);case 16:if(0!==(leafObjects=folderStore.each(this.root,this.membershipProperty,null,leafDocument)).length){_context5.next=21;break}throw msg=" INCONSISTENCY -- no chat leafObject in file "+leafDocument,debug.trace(msg),new Error(msg);case 21:return(sortMe=leafObjects.map((function(leafObject){return[folderStore.any(leafObject,ns.dct("created")),leafObject]}))).sort(),backwards&&sortMe.reverse(),debug.log((backwards?"Latest":"Earliest")+" leafObject is "+sortMe[0][1]),_context5.abrupt("return",sortMe[0][1]);case 26:case"end":return _context5.stop()}}),_callee5,this)}))),function firstLeaf(_x6){return _firstLeaf.apply(this,arguments)})}]),DateFolder}()},"./lib/chat/infinite.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.desktopNotification=desktopNotification,exports.infiniteMessageArea=function infiniteMessageArea(_x,_x2,_x3,_x4){return _infiniteMessageArea.apply(this,arguments)},exports.insertMessageIntoTable=insertMessageIntoTable;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_chatLogic=__webpack_require__("./lib/chat/chatLogic.js"),_message=__webpack_require__("./lib/chat/message.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function desktopNotification(str){"Notification"in window?"granted"===Notification.permission?new Notification(str):"denied"!==Notification.permission&&Notification.requestPermission().then((function(permission){"granted"===permission&&new Notification(str)})):debug.warn("This browser does no t support desktop notification")}function insertMessageIntoTable(channelObject,messageTable,message,fresh,options,userContext){var messageRow=(0,_message.renderMessageRow)(channelObject,message,fresh,options,userContext);options.selectedMessage&&options.selectedMessage.sameTerm(message)&&(messageRow.style.backgroundColor="yellow",options.selectedElement=messageRow,messageTable.selectedElement=messageRow);for(var done=!1,ele=messageTable.firstChild;ele;ele=ele.nextSibling){var newestFirst=!0===options.newestfirst,dateString=messageRow.AJAR_date;if(dateString>ele.AJAR_date&&newestFirst||dateString{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.generatePrivateKey=generatePrivateKey,exports.generatePublicKey=generatePublicKey,exports.getPrivateKey=function getPrivateKey(_x2){return _getPrivateKey.apply(this,arguments)},exports.getPublicKey=function getPublicKey(_x){return _getPublicKey.apply(this,arguments)};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_secp256k=__webpack_require__("./node_modules/@noble/curves/secp256k1.js"),_utils=__webpack_require__("./node_modules/@noble/hashes/utils.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_accessData=__webpack_require__("./lib/utils/keyHelpers/accessData.js"),_acl=__webpack_require__("./lib/utils/keyHelpers/acl.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function generatePrivateKey(){return(0,_utils.bytesToHex)(_secp256k.schnorr.utils.randomPrivateKey())}function generatePublicKey(privateKey){return(0,_utils.bytesToHex)(_secp256k.schnorr.getPublicKey(privateKey))}function _getPublicKey(){return(_getPublicKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(webId){var publicKeyDoc,key;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,_solidLogic.store.fetcher.load(webId);case 2:return _context2.next=4,(0,_accessData.pubKeyUrl)(webId);case 4:return publicKeyDoc=_context2.sent,_context2.prev=5,_context2.next=8,_solidLogic.store.fetcher.load(publicKeyDoc);case 8:return key=_solidLogic.store.any(webId,ns.solid("publicKey")),_context2.abrupt("return",null==key?void 0:key.value);case 12:return _context2.prev=12,_context2.t0=_context2.catch(5),_context2.abrupt("return",void 0);case 15:case"end":return _context2.stop()}}),_callee2,null,[[5,12]])})))).apply(this,arguments)}function _getPrivateKey(){return(_getPrivateKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(webId){var publicKeyDoc,privateKeyDoc,publicKey,privateKey,validPublicKey,del,add,newPublicKey,keyContainer;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,_solidLogic.store.fetcher.load(webId);case 2:return _context3.next=4,(0,_accessData.pubKeyUrl)(webId);case 4:return publicKeyDoc=_context3.sent,_context3.next=7,(0,_accessData.privKeyUrl)(webId);case 7:return privateKeyDoc=_context3.sent,_context3.next=10,(0,_accessData.getExistingPublicKey)(webId,publicKeyDoc);case 10:return publicKey=_context3.sent,_context3.next=13,(0,_accessData.getExistingPrivateKey)(webId,privateKeyDoc);case 13:if(privateKey=_context3.sent,validPublicKey=!0,privateKey&&publicKey!==generatePublicKey(privateKey)&&confirm("This is strange the publicKey is not valid for\n"+(null==webId?void 0:webId.uri)+"'shall we repair keeping the private key ?")&&(validPublicKey=!1),privateKey&&publicKey&&validPublicKey){_context3.next=34;break}if(del=[],add=[],privateKey){_context3.next=24;break}return privateKey=generatePrivateKey(),add=[$rdf.st(webId,ns.solid("privateKey"),$rdf.literal(privateKey),_solidLogic.store.sym(privateKeyDoc))],_context3.next=24,saveKey(privateKeyDoc,[],add,webId.uri);case 24:if(publicKey&&validPublicKey){_context3.next=31;break}return del=[],publicKey&&(del=[$rdf.st(webId,ns.solid("publicKey"),$rdf.lit(publicKey),_solidLogic.store.sym(publicKeyDoc))],debug.log(del)),newPublicKey=generatePublicKey(privateKey),add=[$rdf.st(webId,ns.solid("publicKey"),$rdf.literal(newPublicKey),_solidLogic.store.sym(publicKeyDoc))],_context3.next=31,saveKey(publicKeyDoc,del,add);case 31:return keyContainer=privateKeyDoc.substring(0,privateKeyDoc.lastIndexOf("/")+1),_context3.next=34,(0,_acl.setAcl)(keyContainer,(0,_acl.keyContainerAclBody)(webId.uri));case 34:return _context3.abrupt("return",privateKey);case 35:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}var deleteKeyAcl=function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(keyDoc){var keyAclDoc,response;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,_solidLogic.store.fetcher.load(keyDoc);case 2:if(!(keyAclDoc=_solidLogic.store.any(_solidLogic.store.sym(keyDoc),_solidLogic.store.sym("http://www.iana.org/assignments/link-relations/acl")))){_context.next=16;break}return _context.prev=4,_context.next=7,_solidLogic.store.fetcher.webOperation("DELETE",keyAclDoc.value);case 7:response=_context.sent,debug.log("delete "+keyAclDoc.value+" "+response.status),_context.next=16;break;case 11:if(_context.prev=11,_context.t0=_context.catch(4),404===_context.t0.response.status){_context.next=15;break}throw new Error(_context.t0);case 15:debug.log("delete "+keyAclDoc.value+" "+_context.t0.response.status);case 16:case"end":return _context.stop()}}),_callee,null,[[4,11]])})));return function deleteKeyAcl(_x3){return _ref.apply(this,arguments)}}();function saveKey(_x4,_x5,_x6){return _saveKey.apply(this,arguments)}function _saveKey(){return _saveKey=(0,_asyncToGenerator2.default)((function(keyDoc,del,add){var me=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return _regenerator.default.mark((function _callee4(){var aclBody;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,deleteKeyAcl(keyDoc);case 2:return _context4.next=4,_solidLogic.store.updater.updateMany(del,add);case 4:return aclBody=(0,_acl.keyAclBody)(keyDoc,me),_context4.next=7,(0,_acl.setAcl)(keyDoc,aclBody);case 7:case"end":return _context4.stop()}}),_callee4)}))()})),_saveKey.apply(this,arguments)}},"./lib/chat/message.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.date.now.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.creatorAndDate=creatorAndDate,exports.creatorAndDateHorizontal=creatorAndDateHorizontal,exports.elementForImageURI=elementForImageURI,exports.renderMessageEditor=renderMessageEditor,exports.renderMessageRow=function renderMessageRow(channelObject,message,fresh,options,userContext){var unsignedMessage=!1,colorizeByAuthor="1"===options.colorizeByAuthor||!0===options.colorizeByAuthor,creator=_solidLogic.store.any(message,ns.foaf("maker")),date=_solidLogic.store.any(message,ns.dct("created")),latestVersion=(0,_chatLogic.mostRecentVersion)(message),latestVersionCreator=_solidLogic.store.any(latestVersion,ns.foaf("maker")),msgId=creator.uri===latestVersionCreator.uri?latestVersion:message,content=_solidLogic.store.any(msgId,ns.sioc("content")),signature=_solidLogic.store.any(msgId,$rdf.sym("".concat(_signature.SEC,"proofValue"))),msg=(0,_signature.getBlankMsg)();msg.id=msgId.uri,msg.created=_solidLogic.store.any(msgId,ns.dct("created")).value,msg.content=content.value,msg.maker=creator.uri,null!=signature&&signature.value?(0,_keys.getPublicKey)(creator).then((function(publicKey){debug.log(creator.uri+"\n"+msg.created+"\n"+msg.id+"\n"+publicKey),publicKey||debug.warn("message is signed but "+creator.uri+" is missing publicKey");null!=publicKey&&publicKey.match(/[0-9A-Fa-f]{6}/g)?null!=signature&&signature.value&&!(0,_signature.verifySignature)(null==signature?void 0:signature.value,msg,publicKey)&&debug.warn("invalid signature\n"+msg.id):debug.warn("invalid publicKey hex string\n"+creator.uri+"\n"+publicKey)})):(unsignedMessage=!0,debug.warn(msgId.uri+" is unsigned"));var originalMessage=(0,_chatLogic.originalVersion)(message),edited=!message.sameTerm(originalMessage),sortDate=_solidLogic.store.the(originalMessage,ns.dct("created"),null,originalMessage.doc()),messageRow=dom.createElement("tr");unsignedMessage&&messageRow.setAttribute("style","background-color: red");messageRow.AJAR_date=sortDate.value,messageRow.AJAR_subject=message;var td1=dom.createElement("td");if(messageRow.appendChild(td1),options.authorDateOnLeft)creatorAndDate(td1,creator,widgets.shortDate(sortDate.value),message);else{var img=dom.createElement("img");img.setAttribute("style","max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;"),widgets.setImage(img,creator),td1.appendChild(img)}var bothDates=widgets.shortDate(sortDate.value);edited&&(bothDates+=" ... "+widgets.shortDate(date.value));var td2=messageRow.appendChild(dom.createElement("td"));options.authorDateOnLeft||creatorAndDateHorizontal(td2,creator,bothDates,message);var text=content.value.trim(),isURI=/^https?:\/[^ <>]*$/i.test(text),para=null;if(isURI){if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text)&&options.expandImagesInline){var _img=elementForImageURI(text,options);td2.appendChild(_img)}else{var anc=td2.appendChild(dom.createElement("a"));para=anc.appendChild(dom.createElement("p")),anc.href=text,para.textContent=text,td2.appendChild(anc)}}else para=dom.createElement("p"),td2.appendChild(para),para.textContent=text;if(para){var bgcolor=colorizeByAuthor?pad.lightColorHash(creator):function getBgColor(fresh){return fresh?"#e8ffe8":"white"}(fresh);para.setAttribute("style",messageBodyStyle+"background-color: "+bgcolor+";")}var strip=(0,_messageTools.sentimentStripLinked)(message,message.doc());strip.children.length&&(td2.appendChild(dom.createElement("br")),td2.appendChild(strip));var td3=dom.createElement("td");messageRow.appendChild(td3);var toolsButton=widgets.button(dom,_iconBase.icons.iconBase+"noun_243787.svg","...");return td3.appendChild(toolsButton),toolsButton.addEventListener("click",(function(_event){if(messageRow.toolTR)return messageRow.parentNode.removeChild(messageRow.toolTR),void delete messageRow.toolTR;var toolsTR=dom.createElement("tr"),tools=(0,_messageTools.messageToolbar)(message,messageRow,userContext,channelObject);tools.style="border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;",messageRow.nextSibling?messageRow.parentElement.insertBefore(toolsTR,messageRow.nextSibling):messageRow.parentElement.appendChild(toolsTR),messageRow.toolTR=toolsTR,toolsTR.appendChild(dom.createElement("td"));var toolsTD=toolsTR.appendChild(dom.createElement("td"));toolsTR.appendChild(dom.createElement("td")),toolsTD.appendChild(tools)})),messageRow},exports.switchToEditor=function switchToEditor(messageRow,message,channelObject,userContext){var messageTable=messageRow.parentNode,editRow=renderMessageEditor(channelObject,messageTable,userContext,channelObject.options,(0,_chatLogic.mostRecentVersion)(message));messageTable.insertBefore(editRow,messageRow),editRow.originalRow=messageRow,messageRow.style.visibility="hidden"};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_infinite=__webpack_require__("./lib/chat/infinite.js"),_messageTools=__webpack_require__("./lib/chat/messageTools.js"),_bookmarks=__webpack_require__("./lib/chat/bookmarks.js"),_chatLogic=__webpack_require__("./lib/chat/chatLogic.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_login=__webpack_require__("./lib/login/login.js"),_index=__webpack_require__("./lib/media/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),pad=_interopRequireWildcard(__webpack_require__("./lib/pad.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_signature=__webpack_require__("./lib/chat/signature.js"),_keys=__webpack_require__("./lib/chat/keys.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.messageToolbar=function messageToolbar(message,messageRow,userContext,channelObject){function _deleteMessage(){return(_deleteMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(){var author,msg;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(author=_solidLogic.store.any(message,ns.foaf("maker")),me){_context2.next=5;break}alert("You can't delete the message, you are not logged in."),_context2.next=22;break;case 5:if(!me.sameTerm(author)){_context2.next=21;break}return _context2.prev=6,_context2.next=9,channelObject.deleteMessage(message);case 9:_context2.next=18;break;case 11:_context2.prev=11,_context2.t0=_context2.catch(6),msg="Error deleting messaage "+_context2.t0,debug.warn(msg),alert(msg),(userContext.statusArea||messageRow.parentNode).appendChild(widgets.errorMessageBlock(dom,msg));case 18:messageRow.parentNode.removeChild(messageRow),_context2.next=22;break;case 21:alert("You can't delete the message, you are not logged in as the author, "+author);case 22:closeToolbar();case 23:case"end":return _context2.stop()}}),_callee2,null,[[6,11]])})))).apply(this,arguments)}function _editMessage(){return _editMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(messageRow){return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:me.value===_solidLogic.store.any(message,ns.foaf("maker")).value&&(closeToolbar(),(0,_message.switchToEditor)(messageRow,message,channelObject,userContext));case 1:case"end":return _context3.stop()}}),_callee3)}))),_editMessage.apply(this,arguments)}var div=dom.createElement("div");if((0,_chatLogic.mostRecentVersion)(message).value===ns.schema("dateDeleted").value)return div;function closeToolbar(){div.parentElement.parentElement.removeChild(div.parentElement)}function deleteThingThen(_x2){return _deleteThingThen.apply(this,arguments)}function _deleteThingThen(){return(_deleteThingThen=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(x){return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,_solidLogic.store.updater.update(_solidLogic.store.connectedStatements(x),[]);case 2:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}var me=_solidLogic.authn.currentUser();me&&_solidLogic.store.holds(message,ns.foaf("maker"),me)&&(div.appendChild(widgets.deleteButtonWithCheck(dom,div,"message",(function deleteMessage(){return _deleteMessage.apply(this,arguments)}))),div.appendChild(widgets.button(dom,_iconBase.icons.iconBase+"noun_253504.svg","edit",(function(){return function editMessage(_x){return _editMessage.apply(this,arguments)}(messageRow)}))));function sentimentButton(context,target,icon,actionClass,doc,mutuallyExclusive){function setColor(){button.style.backgroundColor=action?"yellow":"white"}var action,button=widgets.button(dom,icon,utils.label(actionClass),function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(_event){var insertMe,dirty,i,a;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!action){_context.next=7;break}return _context.next=3,deleteThingThen(action);case 3:action=null,setColor(),_context.next=25;break;case 7:return action=widgets.newThing(doc),insertMe=[rdf.st(action,ns.schema("agent"),context.me,doc),rdf.st(action,ns.rdf("type"),actionClass,doc),rdf.st(action,ns.schema("target"),target,doc)],_context.next=11,_solidLogic.store.updater.update([],insertMe);case 11:if(setColor(),!mutuallyExclusive){_context.next=25;break}dirty=!1,i=0;case 15:if(!(i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.SEC=void 0,exports.getBlankMsg=function getBlankMsg(){return{id:"",created:"",dateDeleted:"",content:"",maker:"",sig:""}},exports.getMsgHash=getMsgHash,exports.serializeMsg=serializeMsg,exports.signMsg=function signMsg(message,key){return(0,_utils.bytesToHex)(_secp256k.schnorr.sign(getMsgHash(message),key))},exports.utf8Encoder=exports.utf8Decoder=void 0,exports.verifySignature=function verifySignature(sig,message,pubKey){return _secp256k.schnorr.verify(sig,getMsgHash(message),pubKey)};var _secp256k=__webpack_require__("./node_modules/@noble/curves/secp256k1.js"),_utils=__webpack_require__("./node_modules/@noble/hashes/utils.js"),_sha=__webpack_require__("./node_modules/@noble/hashes/sha256.js"),utf8Encoder=(exports.utf8Decoder=new TextDecoder("utf-8"),exports.utf8Encoder=new TextEncoder);exports.SEC="https://w3id.org/security#";function serializeMsg(msg){return JSON.stringify(msg)}function getMsgHash(message){var msgHash=(0,_sha.sha256)(utf8Encoder.encode(serializeMsg(message)));return(0,_utils.bytesToHex)(msgHash)}},"./lib/create/create.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.ends-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.values.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.newThingUI=function newThingUI(createContext,dataBrowserContext,thePanes){var dom=createContext.dom,div=createContext.div;if(createContext.me&&!createContext.me.uri)throw new Error("newThingUI: Invalid userid: "+createContext.me);var iconStyle="padding: 0.7em; width: 2em; height: 2em;",star=div.appendChild(dom.createElement("img")),visible=!1;star.setAttribute("src",_iconBase.icons.iconBase+"noun_34653_green.svg"),star.setAttribute("style",iconStyle),star.setAttribute("title","Add another tool");var complain=function complain(message){var pre=div.appendChild(dom.createElement("pre"));pre.setAttribute("style","background-color: pink"),pre.appendChild(dom.createTextNode(message))};function styleTheIcons(style){for(var i=0;i1?"".concat(utils.label(pane.mintClass)," (using ").concat(pane.name," pane)"):utils.label(pane.mintClass):pane.name+" @@";icon.setAttribute("title","Make new "+noun),icon.setAttribute("style",iconStyle+"display: none;"),iconArray.push(icon),icon.disabled||icon.addEventListener("click",(function(e){!function selectTool(icon){styleTheIcons("display: none;"),icon.setAttribute("style",iconStyle+"background-color: yellow;")}(icon),function makeNewAppInstance(options){return new Promise((function(resolve,reject){var selectUI;function callbackWS(ws,newBase){(0,_login.ensureLoadedProfile)(createContext).then((function(_context){var newPaneOptions=Object.assign({newBase,folder:options.folder||void 0,workspace:ws},options);for(var opt in options)newPaneOptions[opt]=options[opt];debug.log("newThingUI: Minting new ".concat(newPaneOptions.pane.name," at ").concat(newPaneOptions.newBase)),options.pane.mintNew(dataBrowserContext,newPaneOptions).then((function(newPaneOptions){if(!newPaneOptions||!newPaneOptions.newInstance)throw new Error("Cannot mint new - missing newInstance");if(newPaneOptions.folder){var isPackage=newPaneOptions.newInstance.uri.slice(newPaneOptions.folder.uri.length).includes("/");debug.log(" new thing is packge? "+isPackage),isPackage?kb.add(newPaneOptions.folder,ns.ldp("contains"),kb.sym(newPaneOptions.newBase),newPaneOptions.folder.doc()):kb.add(newPaneOptions.folder,ns.ldp("contains"),newPaneOptions.newInstance,newPaneOptions.folder.doc()),newPaneOptions.refreshTarget&&newPaneOptions.refreshTarget.refresh&&newPaneOptions.refreshTarget.refresh()}else{var p=options.div.appendChild(dom.createElement("p"));p.setAttribute("style","font-size: 120%;"),p.innerHTML="Your new "+options.noun+" is ready to be set up.

                                                          Go to your new "+options.noun+"."}selectNewTool()})).catch((function(err){complain(err),reject(err)}))}),(function(err){complain("Error logging on: "+err)}))}var pa=options.pane;options.noun=pa.mintClass?utils.label(pa.mintClass):pa.name,options.appPathSegment=options.noun.slice(0,1).toUpperCase()+options.noun.slice(1),options.folder?widgets.askName(dom,kb,options.div,ns.foaf("name"),null,options.noun).then((function gotName(name){if(name){var uri=options.folder.uri;uri.endsWith("/")||(uri+="/"),callbackWS(null,uri=uri+encodeURIComponent(name)+"/")}else selectNewTool()})):(selectUI=(0,_login.selectWorkspace)(dom,{noun:options.noun,appPathSegment:options.appPathSegment},callbackWS),options.div.appendChild(selectUI))}))}({event:e,folder:createContext.folder||null,iconEle:icon,pane,noun,noIndexHTML:!0,div:createContext.div,me:createContext.me,dom:createContext.dom,refreshTarget:createContext.refreshTarget})}))}))};var _solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_login=__webpack_require__("./lib/login/login.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=_solidLogic.solidLogicSingleton.store},"./lib/create/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.create=void 0;var _create=__webpack_require__("./lib/create/create.js");exports.create={newThingUI:_create.newThingUI}},"./lib/create/types.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0})},"./lib/debug.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.error=function error(){var _console3;(_console3=console).error.apply(_console3,arguments)},exports.log=function log(){var _console;(_console=console).log.apply(_console,arguments)},exports.trace=function trace(){var _console4;(_console4=console).trace.apply(_console4,arguments)},exports.warn=function warn(){var _console2;(_console2=console).warn.apply(_console2,arguments)}},"./lib/footer/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.createControllerInfoBlock=createControllerInfoBlock,exports.initFooter=function initFooter(_x,_x2){return _initFooter.apply(this,arguments)},exports.rebuildFooter=rebuildFooter;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),style=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&&Object.prototype.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}(__webpack_require__("./lib/style.js")),_headerFooterHelpers=__webpack_require__("./lib/utils/headerFooterHelpers.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _initFooter(){return(_initFooter=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(store,options){var footer,pod,podOwner;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(footer=document.getElementById("PageFooter")){_context2.next=3;break}return _context2.abrupt("return");case 3:return pod=(0,_headerFooterHelpers.getPod)(),_context2.next=6,(0,_headerFooterHelpers.getPodOwner)(pod,store);case 6:podOwner=_context2.sent,rebuildFooter(footer,store,pod,podOwner,options)(),_solidLogic.authSession.onLogin(rebuildFooter(footer,store,pod,podOwner,options)),_solidLogic.authSession.onLogout(rebuildFooter(footer,store,pod,podOwner,options));case 10:case"end":return _context2.stop()}}),_callee2)})))).apply(this,arguments)}function rebuildFooter(footer,store,pod,podOwner,options){return(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(){var user;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return user=_solidLogic.authn.currentUser(),footer.innerHTML="",_context.t0=footer,_context.next=5,createControllerInfoBlock(store,user,pod,podOwner,options);case 5:_context.t1=_context.sent,_context.t0.appendChild.call(_context.t0,_context.t1);case 7:case"end":return _context.stop()}}),_callee)})))}function createControllerInfoBlock(store,user,pod,podOwner,options){var profileLinkContainer=document.createElement("div");if(!pod||!podOwner||user&&user.equals(podOwner))return profileLinkContainer;profileLinkContainer.setAttribute("style",style.footer);var podLinkPre=document.createElement("span");podLinkPre.innerText="You're visiting ";var podLink=document.createElement("a");podLink.href=pod.uri,podLink.innerText="the Pod";var profileLinkPre=document.createElement("span");profileLinkPre.innerText=" controlled by ";var profileLink=document.createElement("a");profileLink.href=podOwner.uri,profileLink.innerText=(0,_headerFooterHelpers.getName)(store,podOwner);var solidProjectLinkPre=document.createElement("span");solidProjectLinkPre.innerText=". For more info, check out ";var solidProjectLink=document.createElement("a");solidProjectLink.href=options&&options.solidProjectUrl?options.solidProjectUrl:"https://solidproject.org",solidProjectLink.innerText=options&&options.solidProjectName?options.solidProjectName:"solidproject.org";var solidProjectLinkPost=document.createElement("span");return solidProjectLinkPost.innerText=".",profileLinkContainer.appendChild(podLinkPre),profileLinkContainer.appendChild(podLink),profileLinkContainer.appendChild(profileLinkPre),profileLinkContainer.appendChild(profileLink),profileLinkContainer.appendChild(solidProjectLinkPre),profileLinkContainer.appendChild(solidProjectLink),profileLinkContainer.appendChild(solidProjectLinkPost),profileLinkContainer}},"./lib/header/empty-profile.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.emptyProfile=void 0;exports.emptyProfile='\n\n \n \n \n \n \n \n \n'},"./lib/header/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.createBanner=createBanner,exports.createHelpMenu=createHelpMenu,exports.createLoginSignUpButtons=createLoginSignUpButtons,exports.createUserMenu=createUserMenu,exports.createUserMenuButton=createUserMenuButton,exports.createUserMenuItem=createUserMenuItem,exports.createUserMenuLink=createUserMenuLink,exports.getProfileImg=getProfileImg,exports.initHeader=function initHeader(_x,_x2,_x3){return _initHeader.apply(this,arguments)},exports.rebuildHeader=rebuildHeader;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_index=__webpack_require__("./lib/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_login=__webpack_require__("./lib/login/login.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_emptyProfile=__webpack_require__("./lib/header/empty-profile.js"),_headerFooterHelpers=__webpack_require__("./lib/utils/headerFooterHelpers.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var DEFAULT_HELP_MENU_ICON=_index.icons.iconBase+"noun_help.svg";function _initHeader(){return(_initHeader=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(store,userMenuList,options){var header,pod;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(header=document.getElementById("PageHeader")){_context2.next=3;break}return _context2.abrupt("return");case 3:pod=(0,_headerFooterHelpers.getPod)(),rebuildHeader(header,store,pod,userMenuList,options)(),_solidLogic.authSession.onLogout(rebuildHeader(header,store,pod,userMenuList,options)),_solidLogic.authSession.onLogin(rebuildHeader(header,store,pod,userMenuList,options));case 7:case"end":return _context2.stop()}}),_callee2)})))).apply(this,arguments)}function rebuildHeader(header,store,pod,userMenuList,options){return(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(){var user;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return user=_solidLogic.authn.currentUser(),header.innerHTML="",_context.t0=header,_context.next=5,createBanner(store,pod,user,userMenuList,options);case 5:_context.t1=_context.sent,_context.t0.appendChild.call(_context.t0,_context.t1);case 7:case"end":return _context.stop()}}),_callee)})))}function createBanner(_x4,_x5,_x6,_x7,_x8){return _createBanner.apply(this,arguments)}function _createBanner(){return(_createBanner=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(store,pod,user,userMenuList,options){var podLink,image,userMenu,banner,leftSideOfHeader,helpMenu;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if((podLink=document.createElement("a")).href=pod.uri,podLink.setAttribute("style",style.headerBannerLink),image=document.createElement("img"),options&&(image.src=options.logo?options.logo:"https://solidproject.org/assets/img/solid-emblem.svg"),image.setAttribute("style",style.headerBannerIcon),podLink.appendChild(image),!user){_context3.next=13;break}return _context3.next=10,createUserMenu(store,user,userMenuList);case 10:_context3.t0=_context3.sent,_context3.next=14;break;case 13:_context3.t0=createLoginSignUpButtons();case 14:return userMenu=_context3.t0,(banner=document.createElement("div")).setAttribute("style",style.headerBanner),banner.appendChild(podLink),(leftSideOfHeader=document.createElement("div")).setAttribute("style",style.headerBannerRightMenu),leftSideOfHeader.appendChild(userMenu),options&&options.helpMenuList&&(helpMenu=createHelpMenu(options,options.helpMenuList),leftSideOfHeader.appendChild(helpMenu)),banner.appendChild(leftSideOfHeader),_context3.abrupt("return",banner);case 24:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}function createHelpMenu(options,helpMenuItems){if(helpMenuItems){var helpMenuList=document.createElement("ul");helpMenuList.setAttribute("style",style.headerUserMenuList),helpMenuItems.forEach((function(menuItem){"url"===(menuItem.url?"url":"onclick")?helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label,menuItem.url,menuItem.target))):helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label,menuItem.onclick)))}));var helpMenu=document.createElement("nav");helpMenu.setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed),helpMenu.setAttribute("aria-hidden","true"),helpMenu.setAttribute("id","helperNav"),helpMenu.appendChild(helpMenuList);var helpMenuContainer=document.createElement("div");helpMenuContainer.setAttribute("style",style.headerBannerUserMenu),helpMenuContainer.appendChild(helpMenu);var helpMenuTrigger=document.createElement("button");helpMenuTrigger.setAttribute("style",style.headerUserMenuTrigger),helpMenuTrigger.type="button";var helpMenuIcon=document.createElement("img");helpMenuIcon.src=options&&options.helpIcon?options.helpIcon:_index.icons.iconBase+DEFAULT_HELP_MENU_ICON,helpMenuIcon.setAttribute("style",style.headerUserMenuTriggerImg),helpMenuContainer.appendChild(helpMenuTrigger),helpMenuTrigger.appendChild(helpMenuIcon);var throttledMenuToggle=(0,_headerFooterHelpers.throttle)((function(event){return toggleMenu(event,helpMenuTrigger,helpMenu)}),50);helpMenuTrigger.addEventListener("click",throttledMenuToggle);var timer=setTimeout((function(){return null}),0);return helpMenuContainer.addEventListener("mouseover",(function(event){clearTimeout(timer),throttledMenuToggle(event);var nav=document.getElementById("helperNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenu)})),helpMenuContainer.addEventListener("mouseout",(function(event){timer=setTimeout((function(){return throttledMenuToggle(event)}),200);var nav=document.getElementById("helperNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed)})),helpMenuContainer}}function createLoginSignUpButtons(){var profileLoginButtonPre=document.createElement("div");return profileLoginButtonPre.setAttribute("style",style.headerBannerLogin),profileLoginButtonPre.appendChild((0,_login.loginStatusBox)(document,null,{})),profileLoginButtonPre}function createUserMenuButton(label,onClick){var button=document.createElement("button");return button.setAttribute("style",style.headerUserMenuButton),button.onmouseover=function(){button.setAttribute("style",style.headerUserMenuButtonHover)},button.onmouseout=function(){button.setAttribute("style",style.headerUserMenuButton)},button.addEventListener("click",onClick),button.innerText=label,button}function createUserMenuLink(label,href,target){var link=document.createElement("a");return link.setAttribute("style",style.headerUserMenuLink),link.onmouseover=function(){link.setAttribute("style",style.headerUserMenuLinkHover)},link.onmouseout=function(){link.setAttribute("style",style.headerUserMenuLink)},link.href=href,link.innerText=label,target&&(link.target=target),link}function createUserMenu(_x9,_x10,_x11){return _createUserMenu.apply(this,arguments)}function _createUserMenu(){return(_createUserMenu=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(store,user,userMenuList){var fetcher,loggedInMenuList,loggedInMenu,loggedInMenuTrigger,profileImg,loggedInMenuContainer,throttledMenuToggle,timer;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:if(!(fetcher=store.fetcher)){_context4.next=4;break}return _context4.next=4,fetcher.load(user);case 4:return(loggedInMenuList=document.createElement("ul")).setAttribute("style",style.headerUserMenuList),userMenuList&&userMenuList.forEach((function(menuItem){"url"===(menuItem.url?"url":"onclick")?loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label,menuItem.url,menuItem.target))):loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label,menuItem.onclick)))})),(loggedInMenu=document.createElement("nav")).setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed),loggedInMenu.setAttribute("aria-hidden","true"),loggedInMenu.setAttribute("id","loggedInNav"),loggedInMenu.appendChild(loggedInMenuList),(loggedInMenuTrigger=document.createElement("button")).setAttribute("style",style.headerUserMenuTrigger),loggedInMenuTrigger.type="button","string"==typeof(profileImg=getProfileImg(store,user))?loggedInMenuTrigger.innerHTML=profileImg:loggedInMenuTrigger.appendChild(profileImg),(loggedInMenuContainer=document.createElement("div")).setAttribute("style",style.headerBannerUserMenuNotDisplayed),loggedInMenuContainer.appendChild(loggedInMenuTrigger),loggedInMenuContainer.appendChild(loggedInMenu),throttledMenuToggle=(0,_headerFooterHelpers.throttle)((function(event){return toggleMenu(event,loggedInMenuTrigger,loggedInMenu)}),50),loggedInMenuTrigger.addEventListener("click",throttledMenuToggle),timer=setTimeout((function(){return null}),0),loggedInMenuContainer.addEventListener("mouseover",(function(event){clearTimeout(timer),throttledMenuToggle(event);var nav=document.getElementById("loggedInNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenu)})),loggedInMenuContainer.addEventListener("mouseout",(function(event){timer=setTimeout((function(){return throttledMenuToggle(event)}),200);var nav=document.getElementById("loggedInNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed)})),_context4.abrupt("return",loggedInMenuContainer);case 27:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}function createUserMenuItem(child){var menuProfileItem=document.createElement("li");return menuProfileItem.setAttribute("style",style.headerUserMenuListItem),menuProfileItem.appendChild(child),menuProfileItem}function getProfileImg(store,user){var profileUrl=null;try{if(!(profileUrl=widgets.findImage(user)))return _emptyProfile.emptyProfile}catch(_unused){return _emptyProfile.emptyProfile}var profileImage=document.createElement("div");return profileImage.setAttribute("style",style.headerUserMenuPhoto),profileImage.style.backgroundImage="url(".concat(profileUrl,")"),profileImage}function toggleMenu(event,trigger,menu){var isExpanded="true"===trigger.getAttribute("aria-expanded"),expand="mouseover"===event.type,close="mouseout"===event.type;isExpanded&&expand||!isExpanded&&close||(trigger.setAttribute("aria-expanded",(!isExpanded).toString()),menu.setAttribute("aria-hidden",isExpanded.toString()))}},"./lib/iconBase.js":(module,exports,__webpack_require__)=>{"use strict";module=__webpack_require__.nmd(module),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.originalIconBase=exports.icons=exports.iconBase=void 0;var _debug=__webpack_require__("./lib/debug.js"),icons=exports.icons=module.scriptURI?{iconBase:module.scriptURI.slice(0,module.scriptURI.lastIndexOf("/"))+"/icons/",originalIconBase:module.scriptURI.slice(0,module.scriptURI.lastIndexOf("/"))+"/originalIcons/"}:"undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.iconBase?{iconBase:$SolidTestEnvironment.iconBase,originalIconBase:$SolidTestEnvironment.originalIconBase}:{iconBase:"https://solidos.github.io/solid-ui/src/icons/",originalIconBase:"https://solidos.github.io/solid-ui/src/originalIcons/"};(0,_debug.log)(" icons.iconBase is set to : "+icons.iconBase);exports.iconBase=icons.iconBase,exports.originalIconBase=icons.originalIconBase},"./lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"acl",{enumerable:!0,get:function get(){return _index.acl}}),Object.defineProperty(exports,"aclControl",{enumerable:!0,get:function get(){return _index.aclControl}}),Object.defineProperty(exports,"authn",{enumerable:!0,get:function get(){return _solidLogic.authn}}),Object.defineProperty(exports,"create",{enumerable:!0,get:function get(){return _index2.create}}),exports.dom=exports.createTypes=void 0,Object.defineProperty(exports,"icons",{enumerable:!0,get:function get(){return _iconBase.icons}}),Object.defineProperty(exports,"infiniteMessageArea",{enumerable:!0,get:function get(){return _infinite.infiniteMessageArea}}),Object.defineProperty(exports,"initFooter",{enumerable:!0,get:function get(){return _footer.initFooter}}),Object.defineProperty(exports,"initHeader",{enumerable:!0,get:function get(){return _header.initHeader}}),exports.login=exports.log=exports.language=void 0,Object.defineProperty(exports,"matrix",{enumerable:!0,get:function get(){return _index3.matrix}}),Object.defineProperty(exports,"media",{enumerable:!0,get:function get(){return _index4.media}}),Object.defineProperty(exports,"messageArea",{enumerable:!0,get:function get(){return _messageArea.messageArea}}),exports.rdf=exports.preferences=exports.participation=exports.pad=exports.ns=void 0,Object.defineProperty(exports,"store",{enumerable:!0,get:function get(){return _solidLogic.store}}),exports.style=void 0,Object.defineProperty(exports,"table",{enumerable:!0,get:function get(){return _table.renderTableViewPane}}),exports.utils=exports.tabs=void 0,Object.defineProperty(exports,"versionInfo",{enumerable:!0,get:function get(){return _versionInfo.versionInfo}}),exports.widgets=void 0;var rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js"));exports.rdf=rdf;var ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));exports.ns=ns;var _index=__webpack_require__("./lib/acl/index.js"),_index2=__webpack_require__("./lib/create/index.js"),_iconBase=__webpack_require__("./lib/iconBase.js"),language=_interopRequireWildcard(__webpack_require__("./lib/widgets/forms/autocomplete/language.js"));exports.language=language;var log=_interopRequireWildcard(__webpack_require__("./lib/log.js"));exports.log=log;var _index3=__webpack_require__("./lib/matrix/index.js"),_index4=__webpack_require__("./lib/media/index.js"),_messageArea=__webpack_require__("./lib/messageArea.js"),_infinite=__webpack_require__("./lib/chat/infinite.js"),pad=_interopRequireWildcard(__webpack_require__("./lib/pad.js"));exports.pad=pad;var participation=_interopRequireWildcard(__webpack_require__("./lib/participation.js"));exports.participation=participation;var preferences=_interopRequireWildcard(__webpack_require__("./lib/preferences.js"));exports.preferences=preferences;var style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));exports.style=style;var _table=__webpack_require__("./lib/table.js"),tabs=_interopRequireWildcard(__webpack_require__("./lib/tabs.js"));exports.tabs=tabs;var utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js"));exports.utils=utils;var login=_interopRequireWildcard(__webpack_require__("./lib/login/login.js"));exports.login=login;var widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));exports.widgets=widgets;var _versionInfo=__webpack_require__("./lib/versionInfo.js"),_header=__webpack_require__("./lib/header/index.js"),_footer=__webpack_require__("./lib/footer/index.js"),createTypes=_interopRequireWildcard(__webpack_require__("./lib/create/types.js"));exports.createTypes=createTypes;var _solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var dom=exports.dom=window?window.document:null;"undefined"!=typeof window&&(window.UI={authn:_solidLogic.authn,store:_solidLogic.store,ns,rdf,acl:_index.acl,aclControl:_index.aclControl,create:_index2.create,createTypes,dom,icons:_iconBase.icons,language,log,login,matrix:_index3.matrix,media:_index4.media,messageArea:_messageArea.messageArea,infiniteMessageArea:_infinite.infiniteMessageArea,pad,participation,preferences,style,table:_table.renderTableViewPane,tabs,utils,widgets,versionInfo:_versionInfo.versionInfo,initHeader:_header.initHeader,initFooter:_footer.initFooter})},"./lib/log.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogLevel=void 0,exports.alert=function alert(message){_window&&void 0!==_window.alert?_window.alert(message):warn(message)},exports.clear=function clear(){var _dom2,logArea=null===(_dom2=_dom)||void 0===_dom2?void 0:_dom2.getElementById("status");if(!logArea)return;logArea.innerHTML=""},exports.debug=debug,exports.dumpHTML=function dumpHTML(){var _dom3,_dom3$body;if(!_dom)return;var level=_level;_level=63,debug((null===(_dom3=_dom)||void 0===_dom3||null===(_dom3$body=_dom3.body)||void 0===_dom3$body?void 0:_dom3$body.innerHTML)||""),_level=level},exports.error=function error(message){log(message,1,"eror")},exports.escapeForXML=escapeForXML,exports.info=function info(message){log(message,16,"info")},exports.logAscending=function logAscending(){_ascending=!0},exports.logDescending=function logDescending(){_ascending=!1},exports.msg=function msg(message){log(message)},exports.setInternals=function setInternals(window,document){_window=window,_dom=document},exports.setLevel=function setLevel(level){_level=63,debug("Log level is now "+level),_level=level},exports.success=function success(message){log(message,8,"good")},exports.warn=warn;exports.LogLevel=function(LogLevel){return LogLevel[LogLevel.Error=1]="Error",LogLevel[LogLevel.Warning=2]="Warning",LogLevel[LogLevel.Message=4]="Message",LogLevel[LogLevel.Success=8]="Success",LogLevel[LogLevel.Info=16]="Info",LogLevel[LogLevel.Debug=32]="Debug",LogLevel[LogLevel.All=63]="All",LogLevel}({});var _level=7,_ascending=!1,_dom=document,_window=window;function log(str){var type=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,typestr=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mesg";if(_level&type)if(void 0!==_dom){var logArea=_dom.getElementById("status");if(!logArea)return;var addendum=_dom.createElement("span");addendum.setAttribute("class",typestr);var now=new Date;addendum.innerHTML="".concat(now.getHours(),":").concat(now.getMinutes(),":").concat(now.getSeconds()," [").concat(typestr,"] ").concat(escapeForXML(str),"
                                                          "),_ascending?logArea.insertBefore(addendum,logArea.firstChild):logArea.appendChild(addendum)}else"undefined"!=typeof console&&console.log(str)}function warn(message){log(message,2,"warn")}function debug(message){log(message,32,"dbug")}function escapeForXML(str){return str.replace(/&/g,"&").replace(//g,">")}},"./lib/login/login.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/web.url.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ensureLoadedPreferences=ensureLoadedPreferences,exports.ensureLoadedProfile=ensureLoadedProfile,exports.ensureLoggedIn=ensureLoggedIn,exports.filterAvailablePanes=function filterAvailablePanes(_x13){return _filterAvailablePanes.apply(this,arguments)},exports.findAppInstances=function findAppInstances(_x3,_x4,_x5){return _findAppInstances.apply(this,arguments)},exports.getUserRoles=getUserRoles,exports.loginStatusBox=loginStatusBox,exports.newAppInstance=function newAppInstance(dom,appDetails,callback){var gotWS=function gotWS(ws,base){callback(ws,base)},div=dom.createElement("div"),b=dom.createElement("button");return b.setAttribute("type","button"),div.appendChild(b),b.innerHTML="Make new ".concat(appDetails.noun),b.addEventListener("click",(function(_event){div.appendChild(selectWorkspace(dom,appDetails,gotWS))}),!1),div.appendChild(b),div},exports.registrationControl=function registrationControl(_x6,_x7,_x8){return _registrationControl.apply(this,arguments)},exports.registrationList=function registrationList(_x9,_x10){return _registrationList.apply(this,arguments)},exports.renderScopeHeadingRow=renderScopeHeadingRow,exports.renderSignInPopup=renderSignInPopup,exports.scopeLabel=scopeLabel,exports.selectWorkspace=selectWorkspace;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_log=__webpack_require__("./lib/log.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_signup=__webpack_require__("./lib/signup/signup.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i",box.setAttribute("style","font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;"),table=box.firstChild,tbody=table.firstChild,_iterator2=_createForOfIteratorHelper(scopes),_context10.prev=16,_iterator2.s();case 18:if((_step2=_iterator2.n()).done){_context10.next=44;break}return scope=_step2.value,headingRow=renderScopeHeadingRow(context,0,scope),tbody.appendChild(headingRow),_context10.next=24,getScopedAppsFromIndex(scope,options.type||null);case 24:0===(items=_context10.sent).length&&(headingRow.style.display="none"),_iterator3=_createForOfIteratorHelper(items),_context10.prev=27,_loop=_regenerator.default.mark((function _loop(){var item,row;return _regenerator.default.wrap((function _loop$(_context9){for(;;)switch(_context9.prev=_context9.next){case 0:item=_step3.value,row=widgets.personTR(dom,ns.solid("instance"),item.instance,{deleteFunction:function(){var _deleteFunction=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee8(){return _regenerator.default.wrap((function _callee8$(_context8){for(;;)switch(_context8.prev=_context8.next){case 0:return _context8.next=2,deleteTypeIndexRegistration(item);case 2:tbody.removeChild(row);case 3:case"end":return _context8.stop()}}),_callee8)})));return function deleteFunction(){return _deleteFunction.apply(this,arguments)}}()}),row.children[0].style.paddingLeft="3em",tbody.appendChild(row);case 4:case"end":return _context9.stop()}}),_loop)})),_iterator3.s();case 30:if((_step3=_iterator3.n()).done){_context10.next=34;break}return _context10.delegateYield(_loop(),"t0",32);case 32:_context10.next=30;break;case 34:_context10.next=39;break;case 36:_context10.prev=36,_context10.t1=_context10.catch(27),_iterator3.e(_context10.t1);case 39:return _context10.prev=39,_iterator3.f(),_context10.finish(39);case 42:_context10.next=18;break;case 44:_context10.next=49;break;case 46:_context10.prev=46,_context10.t2=_context10.catch(16),_iterator2.e(_context10.t2);case 49:return _context10.prev=49,_iterator2.f(),_context10.finish(49);case 52:return _context10.abrupt("return",context);case 53:case"end":return _context10.stop()}}),_callee9,null,[[16,46,49,52],[27,36,39,42]])}))),_registrationList.apply(this,arguments)}function signInOrSignUpBox(dom,setUserCallback){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},signInButtonStyle=(options=options||{}).buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",box=dom.createElement("div"),magicClassName="SolidSignInOrSignUpBox";debug.log("widgets.signInOrSignUpBox"),box.setUserCallback=setUserCallback,box.setAttribute("class",magicClassName),box.setAttribute("style","display:flex;");var signInPopUpButton=dom.createElement("input");box.appendChild(signInPopUpButton),signInPopUpButton.setAttribute("type","button"),signInPopUpButton.setAttribute("value","Log in"),signInPopUpButton.setAttribute("style","".concat(signInButtonStyle,"background-color: #eef;").concat(style.headerBannerLoginInput)),_solidLogic.authSession.onLogin((function(){var me=_solidLogic.authn.currentUser();if(me){var webIdURI=me.uri,divs=dom.getElementsByClassName(magicClassName);debug.log("Logged in, ".concat(divs.length," panels to be serviced"));for(var i=0;i',issuerPopupBoxCloseButton.setAttribute("style","background-color: transparent; border: none;"),issuerPopupBoxCloseButton.addEventListener("click",(function(){issuerPopup.remove()})),issuerPopupBoxTopMenu.appendChild(issuerPopupBoxLabel),issuerPopupBoxTopMenu.appendChild(issuerPopupBoxCloseButton);var loginToIssuer=function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(issuerUri){var preLoginRedirectHash,locationUrl;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.prev=0,_solidLogic.solidLogicSingleton.store.updater.flagAuthorizationMetadata(),(preLoginRedirectHash=new URL(window.location.href).hash)&&window.localStorage.setItem("preLoginRedirectHash",preLoginRedirectHash),window.localStorage.setItem("loginIssuer",issuerUri),(locationUrl=new URL(window.location.href)).hash="",_context.next=9,_solidLogic.authSession.login({redirectUrl:locationUrl.href,oidcIssuer:issuerUri});case 9:_context.next=14;break;case 11:_context.prev=11,_context.t0=_context.catch(0),(0,_log.alert)(_context.t0.message);case 14:case"end":return _context.stop()}}),_callee,null,[[0,11]])})));return function loginToIssuer(_x11){return _ref.apply(this,arguments)}}(),issuerTextContainer=dom.createElement("div");issuerTextContainer.setAttribute("style","\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var issuerTextInputContainer=dom.createElement("div");issuerTextInputContainer.setAttribute("style","\n display: flex;\n flex-direction: row;\n ");var issuerTextLabel=dom.createElement("label");issuerTextLabel.innerText="Enter the URL of your identity provider:",issuerTextLabel.setAttribute("style","color: #888");var issuerTextInput=dom.createElement("input");issuerTextInput.setAttribute("type","text"),issuerTextInput.setAttribute("style","margin-left: 0 !important; flex: 1; margin-right: 5px !important"),issuerTextInput.setAttribute("placeholder","https://example.com"),issuerTextInput.value=localStorage.getItem("loginIssuer")||"";var issuerTextGoButton=dom.createElement("button");issuerTextGoButton.innerText="Go",issuerTextGoButton.setAttribute("style","margin-top: 12px; margin-bottom: 12px;"),issuerTextGoButton.addEventListener("click",(function(){loginToIssuer(issuerTextInput.value)})),issuerTextContainer.appendChild(issuerTextLabel),issuerTextInputContainer.appendChild(issuerTextInput),issuerTextInputContainer.appendChild(issuerTextGoButton),issuerTextContainer.appendChild(issuerTextInputContainer),issuerPopupBox.appendChild(issuerTextContainer);var issuerButtonContainer=dom.createElement("div");issuerButtonContainer.setAttribute("style","\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var issuerBottonLabel=dom.createElement("label");issuerBottonLabel.innerText="Or pick an identity provider from the list below:",issuerBottonLabel.setAttribute("style","color: #888"),issuerButtonContainer.appendChild(issuerBottonLabel),(0,_solidLogic.getSuggestedIssuers)().forEach((function(issuerInfo){var issuerButton=dom.createElement("button");issuerButton.innerText=issuerInfo.name,issuerButton.setAttribute("style","height: 38px; margin-top: 10px"),issuerButton.addEventListener("click",(function(){loginToIssuer(issuerInfo.uri)})),issuerButtonContainer.appendChild(issuerButton)})),issuerPopupBox.appendChild(issuerButtonContainer)}function loginStatusBox(dom){var listener=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},me=(0,_solidLogic.offlineTestID)(),box=dom.createElement("div");function setIt(newidURI){newidURI&&(me=_solidLogic.authn.saveUser(newidURI),box.refresh(),listener&&listener(me.uri))}function logoutButtonHandler(_event){var oldMe=me;_solidLogic.authSession.logout().then((function(){var message="Your WebID was ".concat(oldMe,". It has been forgotten.");me=null;try{(0,_log.alert)(message)}catch(e){window.alert(message)}box.refresh(),listener&&listener(null)}),(function(err){(0,_log.alert)("Fail to log out:"+err)}))}function logoutButton(me,options){var signInButtonStyle=options.buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",logoutLabel="WebID logout";if(me){var nick=_solidLogic.solidLogicSingleton.store.any(me,ns.foaf("nick"))||_solidLogic.solidLogicSingleton.store.any(me,ns.foaf("name"));nick&&(logoutLabel="Logout "+nick.value)}var signOutButton=dom.createElement("input");return signOutButton.setAttribute("type","button"),signOutButton.setAttribute("value",logoutLabel),signOutButton.setAttribute("style","".concat(signInButtonStyle,"background-color: #eee;")),signOutButton.addEventListener("click",logoutButtonHandler,!1),signOutButton}function trackSession(){me=_solidLogic.authn.currentUser(),box.refresh()}return box.refresh=function(){var sessionInfo=_solidLogic.authSession.info;((me=sessionInfo&&sessionInfo.webId&&sessionInfo.isLoggedIn?_solidLogic.solidLogicSingleton.store.sym(sessionInfo.webId):null)&&box.me!==me.uri||!me&&box.me)&&(widgets.clearElement(box),me?box.appendChild(logoutButton(me,options)):box.appendChild(signInOrSignUpBox(dom,setIt,options))),box.me=me?me.uri:null},box.refresh(),trackSession(),_solidLogic.authSession.onLogin(trackSession),_solidLogic.authSession.onLogout(trackSession),box.me="99999",box.refresh(),box}function selectWorkspace(dom,appDetails,callbackWS){var noun=appDetails.noun,appPathSegment=appDetails.appPathSegment,me=(0,_solidLogic.offlineTestID)(),box=dom.createElement("div"),context={me,dom,div:box};function say(s,background){box.appendChild(widgets.errorMessageBlock(dom,s,background))}function figureOutBase(ws){var newBaseString,newBaseNode=_solidLogic.solidLogicSingleton.store.any(ws,ns.space("uriPrefix"));"/"!==(newBaseString=newBaseNode?newBaseNode.value:ws.uri.split("#")[0]).slice(-1)&&(debug.log("".concat(appPathSegment,": No / at end of uriPrefix ").concat(newBaseString)),newBaseString="".concat(newBaseString,"/"));var now=new Date;return newBaseString+="".concat(appPathSegment,"/id").concat(now.getTime(),"/")}return ensureLoadedPreferences(context).then((function displayOptions(context){function _makeNewWorkspace(){return _makeNewWorkspace=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(_event){var row,cell,newBase,newWs,newData;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return row=table.appendChild(dom.createElement("tr")),(cell=row.appendChild(dom.createElement("td"))).setAttribute("colspan","3"),cell.style.padding="0.5em",_context3.t0=encodeURI,_context3.next=7,widgets.askName(dom,_solidLogic.solidLogicSingleton.store,cell,ns.solid("URL"),ns.space("Workspace"),"Workspace");case 7:if(_context3.t1=_context3.sent,newBase=(0,_context3.t0)(_context3.t1),newWs=widgets.newThing(context.preferencesFile),newData=[(0,_rdflib.st)(context.me,ns.space("workspace"),newWs,context.preferencesFile),(0,_rdflib.st)(newWs,ns.space("uriPrefix"),newBase,context.preferencesFile)],_solidLogic.solidLogicSingleton.store.updater){_context3.next=13;break}throw new Error("store has no updater");case 13:return _context3.next=15,_solidLogic.solidLogicSingleton.store.updater.update([],newData);case 15:case"end":return _context3.stop()}}),_callee3)}))),_makeNewWorkspace.apply(this,arguments)}var id=context.me,preferencesFile=context.preferencesFile,newBase=null,w=_solidLogic.solidLogicSingleton.store.each(id,ns.space("workspace"),void 0,preferencesFile),storages=_solidLogic.solidLogicSingleton.store.each(id,ns.space("storage"));0===w.length&&storages&&(say("You don't seem to have any workspaces. You have ".concat(storages.length," storage spaces."),"white"),storages.map((function(s){return w=w.concat(_solidLogic.solidLogicSingleton.store.each(s,ns.ldp("contains")))})).filter((function(file){return file.id?["public","private"].includes(file.id().toLowerCase()):""}))),1===w.length&&(say("Workspace used: ".concat(w[0].uri),"white"),newBase=figureOutBase(w[0]));var table=dom.createElement("table");table.setAttribute("style","border-collapse:separate; border-spacing: 0.5em;"),box.appendChild(table),box.appendChild(dom.createElement("hr"));var p=box.appendChild(dom.createElement("p"));p.setAttribute("style",style.commentStyle),p.textContent="Where would you like to store the data for the ".concat(noun,"?\n Give the URL of the folder where you would like the data stored.\n It can be anywhere in solid world - this URI is just an idea.");var baseField=box.appendChild(dom.createElement("input"));baseField.setAttribute("type","text"),baseField.setAttribute("style",style.textInputStyle),baseField.size=80,baseField.label="base URL",baseField.autocomplete="on",newBase&&(baseField.value=newBase),context.baseField=baseField,box.appendChild(dom.createElement("br"));var col1,col2,col3,tr,ws,localStyle,comment,button=box.appendChild(dom.createElement("button"));button.setAttribute("style",style.buttonStyle),button.textContent="Start new ".concat(noun," at this URI"),button.addEventListener("click",(function(_event){var newBase=baseField.value.replace(" ","%20");"/"!==newBase.slice(-1)&&(newBase+="/"),callbackWS(null,newBase)})),w=w.filter((function(x){return!_solidLogic.solidLogicSingleton.store.holds(x,ns.rdf("type"),ns.space("MasterWorkspace"))}));for(var cellStyle="height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;",deselectedStyle="".concat(cellStyle,"border: 0px;"),i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.matrix=void 0;var _matrix=__webpack_require__("./lib/matrix/matrix.js");exports.matrix={matrixForQuery:_matrix.matrixForQuery}},"./lib/matrix/matrix.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.matrixForQuery=function matrixForQuery(dom,query,vx,vy,vvalue,options,whenDone){var matrix=dom.createElement("table"),header=dom.createElement("tr");header.appendChild(dom.createElement("td")).setAttribute("class","MatrixCorner"),matrix.appendChild(header),matrix.lastHeader=header;var columns=[],rows=[],setCell=function setCell(cell,x,y,value){for(;cell.firstChild;)cell.removeChild(cell.firstChild);cell.setAttribute("style",""),cell.style.textAlign="center",options.cellFunction?options.cellFunction(cell,x,y,value):(cell.textContent=utils.label(value),cell.setAttribute("style","padding: 0.3em")),delete cell.old},rowFor=function rowFor(y1){var y=y1.toNT();if(rows[y])return rows[y];var tr=dom.createElement("tr"),header=tr.appendChild(dom.createElement("td"));header.setAttribute("style","padding: 0.3em;"),header.textContent=utils.label(y1),"NamedNode"===y1.termType&&kb.fetcher.nowOrWhenFetched(y1.uri.split("#")[0],void 0,(function(ok,_body,_response){ok&&(header.textContent=utils.label(y1))}));for(var i=0;iele.dataValueNT&&options&&options.yDecreasing||ycolumns[i]&&options.xDecreasing||xNT0&&!rowsUsed[row.dataValueNT])delete rows[row.dataValueNT],matrix.removeChild(row);else for(var _j=row.children.length-1;_j>0;_j--){var _cell=row.children[_j];colsUsed[_j]||row.removeChild(_cell)}for(var newcolumns=[],_j2=0;_j2{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.media=void 0;var _mediaCapture=__webpack_require__("./lib/media/media-capture.js");exports.media={cameraCaptureControl:_mediaCapture.cameraCaptureControl,cameraButton:_mediaCapture.cameraButton}},"./lib/media/media-capture.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.cameraButton=function cameraButton(dom,store,getImageDoc,doneCallback){var control,div=dom.createElement("div"),but=widgets.button(dom,cameraIcon,"Take picture");function restoreButton(_x){return _restoreButton.apply(this,arguments)}function _restoreButton(){return(_restoreButton=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(imageDoc){return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:div.removeChild(control),div.appendChild(but),doneCallback(imageDoc);case 3:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}return div.appendChild(but),but.addEventListener("click",(function(_event){div.removeChild(but),control=cameraCaptureControl(dom,store,getImageDoc,restoreButton),div.appendChild(control)})),div},exports.cameraCaptureControl=cameraCaptureControl;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var cameraIcon=_iconBase.icons.iconBase+"noun_Camera_1618446_000000.svg",retakeIcon=_iconBase.icons.iconBase+"noun_479395.svg",controlStyle="border-radius: 0.5em; margin: 0.8em; width: ".concat("640","; height:").concat("480",";");function cameraCaptureControl(dom,store,getImageDoc,doneCallback){var destination,imageBlob,player,canvas,div=dom.createElement("div"),table=div.appendChild(dom.createElement("table")),main=table.appendChild(dom.createElement("tr")).appendChild(dom.createElement("td"));main.setAttribute("colspan","4");var buttons=table.appendChild(dom.createElement("tr"));buttons.appendChild(dom.createElement("td")).appendChild(widgets.cancelButton(dom)).addEventListener("click",(function(_event){stopVideo(),doneCallback(null)}));var retakeButton=buttons.appendChild(dom.createElement("td")).appendChild(widgets.button(dom,retakeIcon,"Retake"));retakeButton.addEventListener("click",(function(_event){!function retake(){main.removeChild(canvas),displayPlayer()}()})),retakeButton.style.visibility="collapse";var shutterButton=buttons.appendChild(dom.createElement("td")).appendChild(widgets.button(dom,_iconBase.icons.iconBase+"noun_10636.svg","Snap"));shutterButton.addEventListener("click",(function grabCanvas(){(canvas=dom.createElement("canvas")).setAttribute("width","640"),canvas.setAttribute("height","480"),canvas.setAttribute("style",controlStyle),main.appendChild(canvas),canvas.getContext("2d").drawImage(player,0,0,canvas.width,canvas.height),player.parentNode.removeChild(player),canvas.toBlob((function(blob){var msg="got blob type ".concat(blob.type," size ").concat(blob.size);debug.log(msg),destination=getImageDoc(),imageBlob=blob,function reviewImage(){sendButton.style.visibility="visible",retakeButton.style.visibility="visible",shutterButton.style.visibility="collapse"}()}),"image/png")})),shutterButton.style.visibility="collapse";var sendButton=buttons.appendChild(dom.createElement("td")).appendChild(widgets.continueButton(dom));function displayPlayer(){if((player=main.appendChild(dom.createElement("video"))).setAttribute("controls","1"),player.setAttribute("autoplay","1"),player.setAttribute("style",controlStyle),!navigator.mediaDevices)throw new Error("navigator.mediaDevices not available");navigator.mediaDevices.getUserMedia(constraints).then((function(stream){player.srcObject=stream,shutterButton.style.visibility="visible",sendButton.style.visibility="collapse",retakeButton.style.visibility="collapse"}))}sendButton.addEventListener("click",(function(_event){!function saveBlob(blob,destination){var contentType=blob.type;debug.log("Putting "+blob.size+" bytes of "+contentType+" to "+destination),store.fetcher.webOperation("PUT",destination.uri,{data:blob,contentType}).then((function(_resp){debug.log("ok saved "+destination),stopVideo(),doneCallback(destination)}),(function(err){stopVideo(),alert(err)}))}(imageBlob,destination)})),sendButton.style.visibility="collapse";var constraints={video:!0};function stopVideo(){player&&player.srcObject&&player.srcObject.getVideoTracks().forEach((function(track){return track.stop()}))}return displayPlayer(),div}},"./lib/messageArea.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.messageArea=function messageArea(dom,kb,subject,messageStore,options){kb=kb||_solidLogic.solidLogicSingleton.store,messageStore=messageStore.doc();var messageTable,me,ns=UI.ns,WF=rdf.Namespace("http://www.w3.org/2005/01/wf/flow#"),DCT=rdf.Namespace("http://purl.org/dc/terms/"),newestFirst=!!(options=options||{}).newestFirst,messageBodyStyle="white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;",div=dom.createElement("div"),updater=_solidLogic.solidLogicSingleton.store.updater,anchor=function anchor(text,term){var a=dom.createElement("a");return term&&term.uri&&(a.setAttribute("href",term.uri),a.addEventListener("click",UI.widgets.openHrefInOutlineMode,!0),a.setAttribute("style","color: #3B5998; text-decoration: none; ")),a.textContent=text,a},mention=function mention(message,style){var pre=dom.createElement("pre");return pre.setAttribute("style",style||"color: grey"),div.appendChild(pre),pre.appendChild(dom.createTextNode(message)),pre},announce={log:function log(message){mention(message,"color: #111;")},warn:function warn(message){mention(message,"color: #880;")},error:function error(message){mention(message,"color: #800;")}};function nick(person){var s=_solidLogic.solidLogicSingleton.store.any(person,UI.ns.foaf("nick"));return s?""+s.value:""+utils.label(person)}function creatorAndDate(td1,creator,date,message){var nickAnchor=td1.appendChild(anchor(nick(creator),creator));creator.uri&&_solidLogic.solidLogicSingleton.store.fetcher.nowOrWhenFetched(creator.doc(),void 0,(function(_ok,_body){nickAnchor.textContent=nick(creator)})),td1.appendChild(dom.createElement("br")),td1.appendChild(anchor(date,message))}function syncMessages(about,messageTable){var ele,ele2,displayed={};for(ele=messageTable.firstChild;ele;ele=ele.nextSibling)ele.AJAR_subject&&(displayed[ele.AJAR_subject.uri]=!0);var messages=kb.each(about,ns.wf("message")),stored={};for(messages.forEach((function(m){stored[m.uri]=!0,displayed[m.uri]||addMessage(m)})),ele=messageTable.firstChild;ele;)ele2=ele.nextSibling,ele.AJAR_subject&&!stored[ele.AJAR_subject.uri]&&messageTable.removeChild(ele),ele=ele2}var addMessage=function addMessage(message){var bindings={"?msg":message,"?creator":kb.any(message,ns.foaf("maker")),"?date":kb.any(message,DCT("created")),"?content":kb.any(message,ns.sioc("content"))};renderMessage(bindings,!0)},renderMessage=function renderMessage(bindings,fresh){var creator=bindings["?creator"],message=bindings["?msg"],date=bindings["?date"],content=bindings["?content"],dateString=date.value,tr=dom.createElement("tr");tr.AJAR_date=dateString,tr.AJAR_subject=message;for(var done=!1,ele=messageTable.firstChild;ele;ele=ele.nextSibling)if(dateString>ele.AJAR_date&&newestFirst||dateString{"use strict";__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js"),_solidNamespace=_interopRequireDefault(__webpack_require__("./node_modules/solid-namespace/index.js")),$rdf=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&&Object.prototype.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}(__webpack_require__("./node_modules/rdflib/esm/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}module.exports=(0,_solidNamespace.default)($rdf)},"./lib/pad.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.reflect.construct.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getChunks=getChunks,exports.lightColorHash=lightColorHash,Object.defineProperty(exports,"manageParticipation",{enumerable:!0,get:function get(){return _participation.manageParticipation}}),exports.notepad=function notepad(dom,padDoc,subject,me,options){var exists=(options=options||{}).exists,table=dom.createElement("table"),kb=store;if(me&&!me.uri)throw new Error("UI.pad.notepad: Invalid userid");var updater=store.updater,PAD=(0,_rdflib.Namespace)("http://www.w3.org/ns/pim/pad#");table.setAttribute("style","padding: 1em; overflow: auto; resize: horizontal; min-width: 40em;");var upstreamStatus=null,downstreamStatus=null;if(options.statusArea){var tr=options.statusArea.appendChild(dom.createElement("table")).appendChild(dom.createElement("tr"));upstreamStatus=tr.appendChild(dom.createElement("td")),downstreamStatus=tr.appendChild(dom.createElement("td")),upstreamStatus&&upstreamStatus.setAttribute("style","width:50%"),downstreamStatus&&downstreamStatus.setAttribute("style","width:50%")}var complain=function complain(message){var upstream=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,_debug.log)(message),options.statusArea&&(upstream?upstreamStatus:downstreamStatus).appendChild((0,_widgets.errorMessageBlock)(dom,message,"pink"))},clearStatus=function clearStatus(_upsteam){options.statusArea&&(options.statusArea.innerHTML="")},setPartStyle=function setPartStyle(part,colors,pending){var chunk=part.subject;colors=colors||"";var author=kb.any(chunk,ns.dc("author"));!colors&&author&&(colors="color: "+(pending?"#888":"black")+"; background-color: "+lightColorHash(author)+";");var indent=kb.any(chunk,PAD("indent")),style=(indent=indent?indent.value:0)>=0?"font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;text-indent: "+3*indent+"em;":"font-family: sans-serif; font-weight: bold; border: none;"+["font-size: 110%; padding-top: 0.5em; padding-bottom: 0.5em; width: 100%;","font-size: 120%; padding-top: 1em; padding-bottom: 1em; width: 100%;","font-size: 150%; padding-top: 1em; padding-bottom: 1em; width: 100%;"][-1-indent];part.setAttribute("style",style+colors)},removePart=function removePart(part){var chunk=part.subject;if(!chunk)throw new Error("No chunk for line to be deleted!");var prev=kb.any(void 0,PAD("next"),chunk),next=kb.any(chunk,PAD("next"));if(prev.sameTerm(subject)&&next.sameTerm(subject))(0,_debug.log)("You can't delete the only line.");else{var del=kb.statementsMatching(chunk,void 0,void 0,padDoc).concat(kb.statementsMatching(void 0,void 0,chunk,padDoc)),ins=[(0,_rdflib.st)(prev,PAD("next"),next,padDoc)];if(chunk instanceof _rdflib.NamedNode){var label=chunk.uri.slice(-4);(0,_debug.log)("Deleting line "+label)}if(!updater)throw new Error("have no updater");updater.update(del,ins,(function(uri,ok,errorMessage,response){if(ok){var row=part.parentNode;if(row){var before=row.previousSibling;row.parentNode&&row.parentNode.removeChild(row),before&&before.firstChild&&before.firstChild.focus()}}else if(response&&409===response.status)setPartStyle(part,"color: black; background-color: #ffd;"),part.state=0,(0,_utils.beep)(.5,512),setTimeout((function(){reloadAndSync()}),1e3);else{(0,_debug.log)(" removePart FAILED "+chunk+": "+errorMessage),(0,_debug.log)(" removePart was deleteing :'"+del),setPartStyle(part,"color: black; background-color: #fdd;");var res=response?response.status:" [no response field] ";complain("Error "+res+" saving changes: "+errorMessage.true)}}))}},addListeners=function addListeners(part,chunk){part.addEventListener("keydown",(function(event){if(!updater)throw new Error("no updater");var queueProperty,queue;switch(event.keyCode){case 13:var before=event.shiftKey;if((0,_debug.log)("enter"),before?(queue=kb.any(void 0,PAD("next"),chunk),queueProperty="newlinesAfter"):(queue=kb.any(chunk,PAD("next")),queueProperty="newlinesBefore"),queue[queueProperty]=queue[queueProperty]||0,queue[queueProperty]+=1,queue[queueProperty]>1)return void(0,_debug.log)(" queueing newline queue = "+queue[queueProperty]);(0,_debug.log)(" go ahead line before "+queue[queueProperty]),newChunk(part,before);break;case 8:if(0===part.value.length)switch((0,_debug.log)("Delete key line "+chunk.uri.slice(-4)+" state "+part.state),part.state){case 1:case 2:return void(part.state=4);case 3:case 4:return;case void 0:case 0:part.state=3,removePart(part),event.preventDefault();break;default:throw new Error("pad: Unexpected state "+part)}break;case 9:var delta=event.shiftKey?-1:1;!function changeIndent(part,chunk,delta){var del=kb.statementsMatching(chunk,PAD("indent")),current=del.length?Number(del[0].object.value):0;if(!(current+delta<-3)){var newIndent=current+delta,ins=(0,_rdflib.st)(chunk,PAD("indent"),newIndent,padDoc);if(!updater)throw new Error("no updater");updater.update(del,ins,(function(uri,ok,errorBody){ok?setPartStyle(part):((0,_debug.log)("Indent change FAILED '"+newIndent+"' for "+padDoc+": "+errorBody),setPartStyle(part,"color: black; background-color: #fdd;"),updater.requestDownstreamAction(padDoc,reloadAndSync))}))}}(part,chunk,delta),event.preventDefault();break;case 27:(0,_debug.log)("escape"),updater.requestDownstreamAction(padDoc,reloadAndSync),event.preventDefault();break;case 38:part.parentNode.previousSibling&&(part.parentNode.previousSibling.firstChild.focus(),event.preventDefault());break;case 40:part.parentNode.nextSibling&&(part.parentNode.nextSibling.firstChild.focus(),event.preventDefault())}}));var updateStore=function updateStore(part){var chunk=part.subject;setPartStyle(part,void 0,!0);var ins,old=kb.any(chunk,ns.sioc("content")).value,del=[(0,_rdflib.st)(chunk,ns.sioc("content"),old,padDoc)];part.value&&(ins=[(0,_rdflib.st)(chunk,ns.sioc("content"),part.value,padDoc)]);var newOne=part.value;if(part.lastSent&&old!==part.lastSent)throw new Error("Out of order, last sent expected '"+old+"' but found '"+part.lastSent+"'");if(part.lastSent=newOne,!updater)throw new Error("no updater");updater.update(del,ins,(function(uri,ok,errorBody,xhr){ok?(clearStatus(),setPartStyle(part),(0,_debug.log)(" Patch ok '"+old+"' -> '"+newOne+"' "),4===part.state?(part.state=3,removePart(part)):3===part.state||(2===part.state?(part.state=1,updateStore(part)):part.state=0)):((0,_debug.log)(" patch FAILED "+xhr.status+" for '"+old+"' -> '"+newOne+"': "+errorBody),409===xhr.status?(setPartStyle(part,"color: black; background-color: #fdd;"),part.state=0,(0,_utils.beep)(.5,512),setTimeout((function(){updater.requestDownstreamAction(padDoc,reloadAndSync)}),1e3)):(setPartStyle(part,"color: black; background-color: #fdd;"),part.state=0,complain(" Error "+xhr.status+" sending data: "+errorBody,!0),(0,_utils.beep)(1,128)))}))};part.addEventListener("input",(function inputChangeListener(_event){switch(setPartStyle(part,void 0,!0),(0,_debug.log)("Input event state "+part.state+" value '"+part.value+"'"),part.state){case 3:case 4:case 2:return;case 1:return void(part.state=2);case 0:case void 0:part.state=1,updateStore(part)}}))},newPartAfter=function newPartAfter(tr1,chunk,before){var text=kb.any(chunk,ns.sioc("content"));text=text?text.value:"";var tr=dom.createElement("tr");before?table.insertBefore(tr,tr1):tr1&&tr1.nextSibling?table.insertBefore(tr,tr1.nextSibling):table.appendChild(tr);var part=tr.appendChild(dom.createElement("input"));return part.subject=chunk,part.setAttribute("type","text"),part.value=text,me?(setPartStyle(part,""),addListeners(part,chunk)):(setPartStyle(part,"color: #222; background-color: #fff"),(0,_debug.log)("Note can't add listeners - not logged in")),part},newChunk=function newChunk(ele,before){var here,prev,next,queue,tr1,kb=store,indent=0,queueProperty=null;ele?("input"!==ele.tagName.toLowerCase()&&(0,_debug.log)("return pressed when current document is: "+ele.tagName),here=ele.subject,indent=(indent=kb.any(here,PAD("indent")))?Number(indent.value):0,before?(prev=kb.any(void 0,PAD("next"),here),next=here,queue=prev,queueProperty="newlinesAfter"):(prev=here,next=kb.any(here,PAD("next")),queue=next,queueProperty="newlinesBefore"),tr1=ele.parentNode):(prev=subject,next=subject,tr1=void 0);var chunk=(0,_widgets.newThing)(padDoc),label=chunk.uri.slice(-4),del=[(0,_rdflib.st)(prev,PAD("next"),next,padDoc)],ins=[(0,_rdflib.st)(prev,PAD("next"),chunk,padDoc),(0,_rdflib.st)(chunk,PAD("next"),next,padDoc),(0,_rdflib.st)(chunk,ns.dc("author"),me,padDoc),(0,_rdflib.st)(chunk,ns.sioc("content"),"",padDoc)];if(indent>0&&ins.push((0,_rdflib.st)(chunk,PAD("indent"),indent,padDoc)),(0,_debug.log)(" Fresh chunk "+label+" proposed"),!updater)throw new Error("no updater");updater.update(del,ins,(function(uri,ok,errorBody,_xhr){if(ok){var newPart=newPartAfter(tr1,chunk,before);setPartStyle(newPart),newPart.focus(),queueProperty&&((0,_debug.log)(" Fresh chunk "+label+" updated, queue = "+queue[queueProperty]),queue[queueProperty]-=1,queue[queueProperty]>0&&((0,_debug.log)(" Implementing queued newlines = "+next.newLinesBefore),newChunk(newPart,before)))}else(0,_debug.log)(" ERROR writing new line "+label+": "+errorBody)}))},consistencyCheck=function consistencyCheck(){var found={},failed=0;function complain2(msg){complain(msg),failed++}if(!kb.the(subject,PAD("next")))return complain2("No initial next pointer"),!1;for(var chunk,prev=subject;(chunk=kb.the(prev,PAD("next")))||complain2("No next pointer from "+prev),!chunk.sameTerm(subject);){prev=chunk;var label=chunk.uri.split("#")[1];if(found[chunk.uri])return complain2("Loop!"),!1;found[chunk.uri]=!0;var k=kb.each(chunk,PAD("next")).length;1!==k&&complain2("Should be 1 not "+k+" next pointer for "+label),(k=kb.each(chunk,PAD("indent")).length)>1&&complain2("Should be 0 or 1 not "+k+" indent for "+label),1!==(k=kb.each(chunk,ns.sioc("content")).length)&&complain2("Should be 1 not "+k+" contents for "+label),1!==(k=kb.each(chunk,ns.dc("author")).length)&&complain2("Should be 1 not "+k+" author for "+label),kb.statementsMatching(void 0,ns.sioc("contents")).forEach((function(st){found[st.subject.value]||complain2("Loose chunk! "+st.subject.value)}))}return!failed},sync=function sync(){if(1!==kb.each(subject,PAD("next")).length){var msg="Pad: Inconsistent data - NEXT pointers: "+kb.each(subject,PAD("next")).length;return(0,_debug.log)(msg),void(options.statusArea&&(options.statusArea.textContent+=msg))}for(var row,manif=[],chunk=kb.the(subject,PAD("next"));!chunk.sameTerm(subject);chunk=kb.the(chunk,PAD("next")))for(var i=0;i=0;_i--)manif[(row=table.children[_i]).firstChild.subject.uri]||table.removeChild(row);row=table.firstChild;for(var _chunk=kb.the(subject,PAD("next"));!_chunk.sameTerm(subject);_chunk=kb.the(_chunk,PAD("next"))){var text=kb.any(_chunk,ns.sioc("content")).value;if(row&&manif[_chunk.uri]){var part=row.firstChild;text!==part.value&&(part.value=text),setPartStyle(part),part.state=0,delete part.lastSent,row=row.nextSibling}else newPartAfter(row,_chunk,!0)}},refreshTree=function refreshTree(root){if(root.refresh)root.refresh();else for(var i=0;i\n \n",title=kb.anyValue(pad,ns.dct("title"));title&&(html+=" ".concat(xmlEncode(title),"\n"));html+=" \n \n";var level=0;function decreaseLevel(indent){for(;level>indent;level--)html+="\n"}return chunks.forEach((function(chunk){var indent=kb.anyJS(chunk,PAD("indent")),rawContent=kb.anyJS(chunk,ns.sioc("content"));if(rawContent){var content=xmlEncode(rawContent);if(indent<0){decreaseLevel(0);var h=indent>=-3?4+indent:1;html+="\n").concat(content,"\n")}else indent>0?(decreaseLevel(indent),function increaseLevel(indent){for(;level\n"}(indent),html+="
                                                        • ".concat(content,"
                                                        • \n")):(decreaseLevel(indent),html+="

                                                          ".concat(content,"

                                                          \n"))}})),decreaseLevel(0),html+=" \n\n"},Object.defineProperty(exports,"participationObject",{enumerable:!0,get:function get(){return _participation.participationObject}}),Object.defineProperty(exports,"recordParticipation",{enumerable:!0,get:function get(){return _participation.recordParticipation}}),Object.defineProperty(exports,"renderPartipants",{enumerable:!0,get:function get(){return _participation.renderPartipants}}),exports.xmlEncode=xmlEncode;_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/assertThisInitialized.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/inherits.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/getPrototypeOf.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/wrapNativeSuper.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"));var ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_widgets=__webpack_require__("./lib/widgets/index.js"),_utils=__webpack_require__("./lib/utils/index.js"),_debug=__webpack_require__("./lib/debug.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_participation=__webpack_require__("./lib/participation.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}var store=_solidLogic.solidLogicSingleton.store,PAD=(0,_rdflib.Namespace)("http://www.w3.org/ns/pim/pad#");function lightColorHash(author){return author&&author.uri?"#"+(16777215&function hash(x){return x.split("").reduce((function(a,b){return(a=(a<<5)-a+b.charCodeAt(0))&a}),0)}(author.uri)|12632256).toString(16):"#ffffff"}function getChunks(subject,kb){for(var chunks=[],chunk=kb.the(subject,PAD("next"));!chunk.sameTerm(subject);chunk=kb.the(chunk,PAD("next")))chunks.push(chunk);return chunks}function xmlEncode(str){return str.replace("&","&").replace("<","<").replace(">",">")}},"./lib/participation.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.reflect.construct.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.manageParticipation=function manageParticipation(dom,container,padDoc,subject,me,options){var table=dom.createElement("table");container.appendChild(table),renderPartipants(dom,table,padDoc,subject,me,options);try{recordParticipation(subject,padDoc,table)}catch(e){container.appendChild((0,_widgets.errorMessageBlock)(dom,"Error recording your partipation: "+e))}return table},exports.participationObject=function participationObject(subject,padDoc,me){return new Promise((function(resolve,reject){if(!me)throw new Error("No user id");var parps=store.each(subject,ns.wf("participation")).filter((function(pn){return store.holds(pn,ns.wf("participant"),me)}));if(parps.length>1){var _step,candidates=[],_iterator=function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}(parps);try{for(_iterator.s();!(_step=_iterator.n()).done;){var participation=_step.value,date=store.anyValue(participation,ns.cal("dtstart"));date&&candidates.push([date,participation])}}catch(err){_iterator.e(err)}finally{_iterator.f()}candidates.sort(),debug.warn("Multiple particpation objects, picking earliest, in "+padDoc),resolve(candidates[0][1])}if(parps.length)resolve(parps[0]);else{var _participation2=(0,_widgets.newThing)(padDoc),ins=[(0,_rdflib.st)(subject,ns.wf("participation"),_participation2,padDoc),(0,_rdflib.st)(_participation2,ns.wf("participant"),me,padDoc),(0,_rdflib.st)(_participation2,ns.cal("dtstart"),new Date,padDoc),(0,_rdflib.st)(_participation2,ns.ui("backgroundColor"),(0,_pad.lightColorHash)(me),padDoc)];store.updater.update([],ins,(function(uri,ok,errorMessage){ok?resolve(_participation2):reject(new Error("Error recording your partipation: "+errorMessage))})),resolve(_participation2)}}))},exports.recordParticipation=recordParticipation,exports.renderPartipants=renderPartipants;_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/assertThisInitialized.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/inherits.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/getPrototypeOf.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/wrapNativeSuper.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"));var _debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),debug=_debug,_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_widgets=__webpack_require__("./lib/widgets/index.js"),_utils=__webpack_require__("./lib/utils/index.js"),_pad=__webpack_require__("./lib/pad.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i1)throw new Error("Multiple records of your participation");if(parps.length)return parps[0];if(!store.updater.editable(padDoc))return debug.log("Not recording participation, as no write acesss as "+me+" to "+padDoc),null;var participation=(0,_widgets.newThing)(padDoc),ins=[(0,_rdflib.st)(subject,ns.wf("participation"),participation,padDoc),(0,_rdflib.st)(participation,ns.wf("participant"),me,padDoc),(0,_rdflib.st)(participation,ns.cal("dtstart"),new Date,padDoc),(0,_rdflib.st)(participation,ns.ui("backgroundColor"),(0,_pad.lightColorHash)(me),padDoc)];return store.updater.update([],ins,(function(uri,ok,errorMessage){if(!ok)throw new Error("Error recording your partipation: "+errorMessage);refreshable&&refreshable.refresh&&refreshable.refresh()})),participation}}},"./lib/preferences.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.get=function get(k){return value[k]},exports.getPreferencesForClass=function getPreferencesForClass(subject,theClass,predicates,context){return new Promise((function(resolve,reject){recordSharedPreferences(subject,context).then((function(context){var sharedPreferences=context.sharedPreferences;if(context.me)participation.participationObject(subject,subject.doc(),context.me).then((function(participation){recordPersonalDefaults(theClass,context).then((function(context){var results=[],personalDefaults=context.personalDefaults;predicates.forEach((function(pred){var v1=kb.any(participation,pred)||kb.any(sharedPreferences,pred)||kb.any(personalDefaults,pred);v1&&(results[pred.uri]=toJS(v1))})),resolve(results)}),reject)}),reject);else{var results=[];predicates.forEach((function(pred){var v1=kb.any(sharedPreferences,pred);v1&&(results[pred.uri]=toJS(v1))})),resolve(results)}}))}))},exports.recordPersonalDefaults=recordPersonalDefaults,exports.recordSharedPreferences=recordSharedPreferences,exports.renderPreferencesForm=function renderPreferencesForm(subject,theClass,preferencesForm,context){var prefContainer=context.dom.createElement("div");return participation.participationObject(subject,subject.doc(),context.me).then((function(participation){var dom=context.dom;function heading(text){prefContainer.appendChild(dom.createElement("h5")).textContent=text}heading("My view of this "+context.noun),widgets.appendForm(dom,prefContainer,{},participation,preferencesForm,subject.doc(),(function(ok,mes){ok||widgets.complain(context,mes)})),heading("Everyone's view of this "+context.noun),recordSharedPreferences(subject,context).then((function(context){var sharedPreferences=context.sharedPreferences;widgets.appendForm(dom,prefContainer,{},sharedPreferences,preferencesForm,subject.doc(),(function(ok,mes){ok||widgets.complain(context,mes)})),heading("My default view of any "+context.noun),recordPersonalDefaults(theClass,context).then((function(context){widgets.appendForm(dom,prefContainer,{},context.personalDefaults,preferencesForm,context.preferencesFile,(function(ok,mes){ok||widgets.complain(context,mes)}))}),(function(err){widgets.complain(context,err)}))}))}),(function(err){prefContainer.appendChild(widgets.errorMessageBlock(context.dom,err))})),prefContainer},exports.set=function set(k,v){if("string"!=typeof v)throw debug.log("Non-string value of preference "+k+": "+v),new Error("Non-string value of preference "+k+": "+v);this.value[k]=v},exports.value=void 0;var $rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_login=__webpack_require__("./lib/login/login.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),participation=_interopRequireWildcard(__webpack_require__("./lib/participation.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=_solidLogic.store,value=exports.value=[];function recordSharedPreferences(subject,context){return new Promise((function(resolve,reject){var sharedPreferences=kb.any(subject,ns.ui("sharedPreferences"));if(sharedPreferences)context.sharedPreferences=sharedPreferences,resolve(context);else{var sp=$rdf.sym(subject.doc().uri+"#SharedPreferences"),ins=[$rdf.st(subject,ns.ui("sharedPreferences"),sp,subject.doc())];debug.log("Creating shared preferences "+sp),kb.updater.update([],ins,(function(uri,ok,errorMessage){ok?(context.sharedPreferences=sp,resolve(context)):reject(new Error("Error creating shared prefs: "+errorMessage))}))}}))}function recordPersonalDefaults(theClass,context){return new Promise((function(resolve,reject){(0,_login.ensureLoadedPreferences)(context).then((function(context){if(context.preferencesFile){var prefs,reg,regs=kb.each(null,ns.solid("forClass"),theClass,context.preferencesFile),ins=[];if(regs.length){if(regs.forEach((function(r){prefs=prefs||kb.any(r,ns.solid("personalDefaults"))})),prefs)return context.personalDefaults=prefs,void resolve(context);prefs=widgets.newThing(context.preferencesFile),reg=regs[0]}else reg=widgets.newThing(context.preferencesFile),ins=[$rdf.st(reg,ns.rdf("type"),ns.solid("TypeRegistration"),context.preferencesFile),$rdf.st(reg,ns.solid("forClass"),theClass,context.preferencesFile)];prefs=widgets.newThing(context.preferencesFile),ins.push($rdf.st(reg,ns.solid("personalDefaults"),prefs,context.preferencesFile)),kb.updater.update([],ins,(function(uri,ok,errm){ok?(context.personalDefaults=prefs,resolve(context)):reject(new Error("Setting preferences for "+theClass+": "+errm))}))}else debug.log("Not doing private class preferences as no access to preferences file. "+context.preferencesFileError)}),(function(err){reject(err)}))}))}function toJS(term){return term.datatype?term.datatype.equals(ns.xsd("boolean"))?"1"===term.value:term.datatype.equals(ns.xsd("dateTime"))||term.datatype.equals(ns.xsd("date"))?new Date(term.value):term.datatype.equals(ns.xsd("integer"))||term.datatype.equals(ns.xsd("float"))||term.datatype.equals(ns.xsd("decimal"))?Number(term.value):term.value:term}},"./lib/signup/config-default.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;exports.default={authEndpoint:"",fallbackAuthEndpoint:"https://databox.me/",signupEndpoint:"https://solidproject.org/use-solid/",signupWindowHeight:600,signupWindowWidth:1024,key:"",cert:""}},"./lib/signup/signup.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.Signup=Signup;var _configDefault=_interopRequireDefault(__webpack_require__("./lib/signup/config-default.js"));function Signup(config){this.config=config||_configDefault.default}Signup.prototype.listen=function listen(){return new Promise((function(resolve,reject){var eventMethod=window.addEventListener?"addEventListener":"attachEvent";(0,window[eventMethod])("attachEvent"===eventMethod?"onmessage":"message",(function(e){var u=e.data;if("User:"===u.slice(0,5)){var user=u.slice(5,u.length);return user&&user.length>0&&"http"===user.slice(0,4)?resolve(user):reject(user)}}),!0)}))},Signup.prototype.signup=function signup(signupUrl){signupUrl=signupUrl||this.config.signupEndpoint;var width=this.config.signupWindowWidth,height=this.config.signupWindowHeight,leftPosition=window.screen.width/2-(width/2+10),topPosition=window.screen.height/2-(height/2+50),windowUrl=signupUrl+"?origin="+encodeURIComponent(window.location.origin),windowSpecs="resizable,scrollbars,status,width="+width+",height="+height+",left="+leftPosition+",top="+topPosition;window.open(windowUrl,"Solid signup",windowSpecs);var self=this;return new Promise((function(resolve){self.listen().then((function(webid){return resolve(webid)}))}))}},"./lib/style.js":(module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.style=void 0;var style=exports.style={checkboxStyle:"color: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;",checkboxInputStyle:"font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em",fieldLabelStyle:"color: #3B5998; text-decoration: none;",formSelectSTyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyleUneditable:"background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputSize:20,buttonStyle:"background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;",commentStyle:"padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;",iconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;",smallButtonStyle:"margin: 0.2em; width: 1em; height:1em;",classIconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;",confirmPopupStyle:"padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;",tabBorderRadius:"0.2em",messageBodyStyle:"white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;",pendingeditModifier:"color: #bbb;",highlightColor:"#7C4DFF",personaBarStyle:"width: 100%; height: 4em; background-color: #eee; vertical-align: middle;",searchInputStyle:"border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;",autocompleteRowStyle:"border: 0.2em solid straw;",signInButtonStyle:"padding: 1em; border-radius:0.2em; font-size: 100%;",heading1Style:"font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;",heading2Style:"font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;",heading3Style:"font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;",heading4Style:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formBorderColor:"#888888",formHeadingColor:"#888888",formHeadingStyle:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formTextInput:"font-size: 100%; margin: 0.1em; padding: 0.1em;",formGroupStyle:["padding-left: 0em; border: 0.0em solid ".concat("#888888","; border-radius: 0.2em;"),"padding-left: 2em; border: 0.05em solid ".concat("#888888","; border-radius: 0.2em;"),"padding-left: 2em; border: 0.1em solid ".concat("#888888","; border-radius: 0.2em;"),"padding-left: 2em; border: 0.2em solid ".concat("#888888","; border-radius: 0.2em;")],formFieldLabelStyle:"'color: ".concat("#3B5998","; text-decoration: none;'"),formFieldNameBoxWidth:"8em",formFieldNameBoxStyle:"padding: 0.3em; vertical-align: middle; width:".concat("8em",";"),textInputBackgroundColor:"#eef",textInputBackgroundColorUneditable:"#fff",textInputColor:"#000",textInputColorPending:"#888",multilineTextInputStyle:"font-size:100%; white-space: pre-wrap; background-color: #eef; border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;",renderAsDivStyle:"display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;",imageDivStyle:"width:2.5em; padding:0.5em; height: 2.5em;",linkDivStyle:"width:2em; padding:0.5em; height: 4em;",aclControlBoxContainer:"margin: 1em",aclControlBoxHeader:"font-size: 120%; margin: 0 0 1rem",aclControlBoxStatus:"display: none; margin: 1rem 0",aclControlBoxStatusRevealed:"display: block",aclGroupContent:"maxWidth: 650",accessGroupList:"display: grid; grid-template-columns: 1fr; margin: 1em; width: 100%",accessGroupListItem:"display: grid; grid-template-columns: 100px auto 30%",defaultsController:"display: flex",defaultsControllerNotice:"color: #888; flexGrow: 1; fontSize: 80%",bigButton:"background-color: white; border: 0.1em solid #888; border-radius: 0.3em; max-width: 50%; padding-bottom: 1em; padding-top: 1em",group:"color: #888",group1:"color: green",group2:"color: #cc0",group3:"color: orange",group5:"color: red",group9:"color: blue",group13:"color: purple",trustedAppAddApplicationsTable:"background-color: #eee",trustedAppCancelButton:"float: right",trustedAppControllerI:"border-color: orange; borderRadius: 1em; borderWidth: 0.1em",temporaryStatusInit:"background: green",temporaryStatusEnd:"background: transparent; transition: background 5s linear",headerUserMenuLink:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none",headerUserMenuLinkHover:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)",headerUserMenuTrigger:"background: none; border: 0; cursor: pointer; width: 60px; height: 60px",headerUserMenuTriggerImg:"border-radius: 50%; height: 56px; width: 28px !important",headerUserMenuButton:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%",headerUserMenuButtonHover:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)",headerUserMenuList:"list-style: none; margin: 0; padding: 0",headerUserMenuListDisplay:"list-style: none; margin: 0; padding: 0; display:true",headerUserMenuNavigationMenu:"background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: true",headerUserMenuNavigationMenuNotDisplayed:"background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: none",headerUserMenuListItem:"border-bottom: solid 1px #000000",headerUserMenuPhoto:"border-radius: 50%; background-position: center; background-repeat: no-repeat; background-size: cover; height: 50px; width: 50px",headerBanner:"box-shadow: 0px 1px 4px #000000; display: flex; justify-content: space-between; padding: 0 1.5em; margin-bottom: 4px",headerBannerLink:"display: block",headerBannerRightMenu:"display: flex",headerBannerLogin:"margin-left: auto",allChildrenVisible:"display:true",headerBannerLoginInput:"margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important",headerBannerUserMenu:"border-left: solid 1px #000000; margin-left: auto",headerBannerHelpMenu:"border-left: solid 1px #000000; margin.left: auto",headerBannerIcon:"background-size: 65px 60px !important; height: 60px !important; width: 65px !important",footer:"border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em",primaryButton:"background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",primaryButtonHover:"background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",primaryButtonNoBorder:"background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",primaryButtonNoBorderHover:"background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",secondaryButton:"background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",secondaryButtonHover:"background-color: #37cde6; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",secondaryButtonNoBorder:"background-color: #ffffff; color: #01c9ea; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",secondaryButtonNoBorderHover:"background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out"};style.setStyle=function setStyle(ele,styleName){ele.style=style[styleName]},module.exports=style},"./lib/style_multiSelect.js":(module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.style=void 0;var style=exports.style={multiselect__container:"\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n min-height: 36px;\n padding: 4px 8px 0 8px;\n position: relative;\n width: 354px;\n margin-bottom: 5px;\n font-size: 100%\n ",multiselect__wrapper:"\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n height: 100%;\n width: 100%;\n ",multiselect__clear_btn:"\n cursor: pointer;\n align-items: center;\n margin-bottom: 4px;\n margin-left: 4px;\n ",multiselect__options:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n ",multiselect__options_visible:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n max-height: 200px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n opacity: 1;\n transition: max-height 0.2s ease;\n ",multiselect__options_ul:"\n list-style: none;\n margin: 0;\n padding: 2px 0;\n max-height: 200px;\n overflow: auto;\n ",multiselect__options_ul_li:"\n cursor: pointer;\n padding: 4px 8px;\n ",multiselect__options_ul_li_hover:"\n background-color: #dedede;\n ",multiselect__options_ul_p_multiselect__options_no_results:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_p_multiselect__options_no_data:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_li_multiselect__options_selected:"\n background-color: #656565;\n color: #fff;\n ",multiselect__options_ul_li_multiselect__options_selected_hover:"\n background-color: #656565;\n ",multiselect__options_ul_li_arrow_selected:"\n border: 2px solid rgba(101, 101, 101, 0.5);\n ",multiselect__selected:"\n background-color: #656565;\n border-radius: 2px;\n color: #fff;\n margin-bottom: 4px;\n margin-right: 4px;\n padding: 4px 8px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n ",multiselect__selected_multiselect__remove_btn:"\n cursor: pointer;\n display: flex;\n margin-left: 6px;\n ",multiselect__input:"\n border: none;\n -ms-flex-preferred-size: 40%;\n flex-basis: 40%;\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n height: 5px; \n margin-bottom: 4px;\n min-width: 40%;\n outline: none; \n "};style.setStyle=function setStyle(ele,styleName){ele.style=style[styleName]},module.exports=style},"./lib/table.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.date.now.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.renderTableViewPane=function renderTableViewPane(doc,options){var allType,types,typeSelectorDiv,addColumnDiv,sourceDocument=options.sourceDocument,tableClass=options.tableClass,givenQuery=options.query,ns=UI.ns,kb=_solidLogic.store,rowsLookup={},FORBIDDEN_COLUMNS={"http://www.w3.org/2002/07/owl#sameAs":!0,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":!0},XSD_NUMBER_TYPES={"http://www.w3.org/2001/XMLSchema#decimal":!0,"http://www.w3.org/2001/XMLSchema#float":!0,"http://www.w3.org/2001/XMLSchema#double":!0,"http://www.w3.org/2001/XMLSchema#integer":!0,"http://www.w3.org/2001/XMLSchema#nonNegativeInteger":!0,"http://www.w3.org/2001/XMLSchema#positiveInteger":!0,"http://www.w3.org/2001/XMLSchema#nonPositiveInteger":!0,"http://www.w3.org/2001/XMLSchema#negativeInteger":!0,"http://www.w3.org/2001/XMLSchema#long":!0,"http://www.w3.org/2001/XMLSchema#int":!0,"http://www.w3.org/2001/XMLSchema#short":!0,"http://www.w3.org/2001/XMLSchema#byte":!0,"http://www.w3.org/2001/XMLSchema#unsignedLong":!0,"http://www.w3.org/2001/XMLSchema#unsignedInt":!0,"http://www.w3.org/2001/XMLSchema#unsignedShort":!0,"http://www.w3.org/2001/XMLSchema#unsignedByte":!0},XSD_DATE_TYPES={"http://www.w3.org/2001/XMLSchema#dateTime":!0,"http://www.w3.org/2001/XMLSchema#date":!0},IMAGE_TYPES={"http://xmlns.com/foaf/0.1/Image":!0,"http://purl.org/dc/terms/Image":!0},keyVariable=options.keyVariable||"?_row",subjectIdCounter=0,lastQuery=null,mostCommonType=null,resultDiv=doc.createElement("div");resultDiv.className="tableViewPane",resultDiv.appendChild(function generateControlBar(){var result=doc.createElement("table");result.setAttribute("class","toolbar");var tr=doc.createElement("tr");return typeSelectorDiv=doc.createElement("td"),tr.appendChild(typeSelectorDiv),addColumnDiv=doc.createElement("td"),tr.appendChild(addColumnDiv),result.appendChild(tr),result}());var table,tableDiv=doc.createElement("div");if(resultDiv.appendChild(tableDiv),resultDiv.refresh=function(){runQuery(table.query,table.logicalRows,table.columns,table)},givenQuery)table=renderTableForQuery(givenQuery),tableDiv.appendChild(table);else{var s=function calculateTable(){var subjects,types,s=function discoverTypes(){for(var types={},subjectList=kb.statementsMatching(void 0,UI.ns.rdf("type"),tableClass,sourceDocument),subjects={},i=0;ibestCount&&(best=type,bestCount=type.useCount)}return best}(types),buildFilteredTable(mostCommonType||allType)}return resultDiv;function generateQuery(type){var query=new rdf.Query,rowVar=kb.variable(keyVariable.slice(1));return function addSelectToQuery(query,type){for(var selectedColumns=type.getColumns(),i=0;ibLabel)-(aLabel0){resultDiv.appendChild(doc.createTextNode("Add column: "));var dropdown=doc.createElement("select");dropdown.appendChild(optionElement("","-1"));for(var i=0;i=0&&(type.addColumn(unusedColumns[columnIndex]),buildFilteredTable(type))}),!1)}return resultDiv}(type)),function updateTable(query,type){lastQuery&&(lastQuery.running=!1);var htmlTable=renderTableForQuery(query,type);clearElement(tableDiv),tableDiv.appendChild(htmlTable),lastQuery=query}(generateQuery(type),type)}function clearElement(element){for(;element.childNodes.length>0;)element.removeChild(element.childNodes[0])}function SubjectType(type){this.type=type,this.columns=null,this.allColumns=[],this.useCount=0,this.getAllColumns=function(){return this.allColumns},this.getColumns=function(){if(!this.columns){var allColumns=this.getAllColumns();this.columns=allColumns.slice(0,7)}return this.columns},this.getUnusedColumns=function(){for(var allColumns=this.getAllColumns(),columns=this.getColumns(),result=[],i=0;ib.useCount)}columns.sort(sortFunction)}(allColumnsList),type.allColumns=allColumnsList}function renderColumnDeleteButton(type,column){var button=doc.createElement("a");return button.appendChild(doc.createTextNode("[x]")),button.addEventListener("click",(function(){type.removeColumn(column),buildFilteredTable(type)}),!1),button}function applyColumnFiltersToRow(row,columns){for(var rowDisplayed=!0,c=0;cstrValue2?1:0}),reverse)}function renderLiteralSelector(rows,columns,column){var result=doc.createElement("div"),textBox=doc.createElement("input");textBox.setAttribute("type","text"),textBox.style.width="70%",result.appendChild(textBox);var sort1=doc.createElement("span");sort1.appendChild(doc.createTextNode("▼")),sort1.addEventListener("click",(function(){literalSort(rows,column,!1)}),!1),result.appendChild(sort1);var sort2=doc.createElement("span");sort2.appendChild(doc.createTextNode("▲")),sort2.addEventListener("click",(function(){literalSort(rows,column,!0)}),!1),result.appendChild(sort2);var substring=null;return column.filterFunction=function(colValue){return!substring||!!colValue&&("Literal"===colValue.termType?colValue.value:"NamedNode"===colValue.termType?utils.label(colValue):"").toLowerCase().indexOf(substring)>=0},textBox.addEventListener("keyup",(function(){substring=""!==textBox.value?textBox.value.toLowerCase():null,applyColumnFilters(rows,columns)}),!1),result}function renderEnumSelector(rows,columns,column,list){for(var result=doc.createElement("div"),dropdown=doc.createElement("select"),searchValue={},i=0;imax))},minSelector.addEventListener("keyup",eventListener,!1),maxSelector.addEventListener("keyup",eventListener,!1),result}function renderTableSelector(rows,columns,column){if(column.superClass&&column.alternatives.length>0)return renderEnumSelector(rows,columns,column,column.alternatives);for(var range,cs=column.getConstraints(),i=0;i0)return renderEnumSelector(rows,columns,column,choices.elements)}return function fallbackRenderTableSelector(rows,columns,column){return column.checkedAnyValues&&column.possiblyNumber?renderNumberSelector(rows,columns,column):column.possiblyLiteral?renderLiteralSelector(rows,columns,column):null}(rows,columns,column)}function linkTo(uri,linkText,hints){hints=hints||{};var result=doc.createElement("a"),linkFunction=hints.linkFunction;return result.setAttribute("href",uri),result.appendChild(doc.createTextNode(linkText)),linkFunction?result.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var uri=utils.getTarget(e).getAttribute("href");uri||debug.log("No href found \n"),linkFunction(uri)}),!0):result.addEventListener("click",UI.widgets.openHrefInOutlineMode,!0),result}function getHints(column){return options&&options.hints&&column.variable&&options.hints[column.variable.toNT()]?options.hints[column.variable.toNT()]:{}}function renderValue(obj,column){var hints=getHints(column),cellFormat=hints.cellFormat;if(!cellFormat){if("Literal"===obj.termType){if(obj.datatype){if(XSD_DATE_TYPES[obj.datatype.uri])return doc.createTextNode(UI.widgets.shortDate(obj.value));if(XSD_NUMBER_TYPES[obj.datatype.uri]){var span=doc.createElement("span");return span.textContent=obj.value,span.setAttribute("style","text-align: right"),span}}return doc.createTextNode(obj.value)}if("NamedNode"===obj.termType&&column.isImageColumn())return function renderImage(obj){var result=doc.createElement("img");return result.setAttribute("src",obj.uri),result.style.height="40px",result}(obj);if("NamedNode"===obj.termType||"BlankNode"===obj.termType)return function linkToObject(obj,hints){var match=!1;return obj.uri&&(match=obj.uri.match(/^mailto:(.*)/)),linkTo(obj.uri,match?match[1]:utils.label(obj),hints)}(obj,hints);if("Collection"===obj.termType){var _span=doc.createElement("span");return _span.appendChild(doc.createTextNode("[")),obj.elements.forEach((function(x){_span.appendChild(renderValue(x,column)),_span.appendChild(doc.createTextNode(", "))})),_span.removeChild(_span.lastChild),_span.appendChild(doc.createTextNode("]")),_span}return doc.createTextNode("unknown termtype '"+obj.termType+"'!")}if("shortDate"===cellFormat)return doc.createTextNode(UI.widgets.shortDate(obj.value))}function valueInList(value,list){var i,key=null;if("Literal"===value.termType)key="value";else{if("NamedNode"!==value.termType)return list.indexOf(value)>=0;key="uri"}for(i=0;ij&&(orig=row.originalValues[columnKey][j],obj.toString()!==orig.toString()&&(different=!0)),td.appendChild(renderValue(obj,column)),j!==objects.length-1&&td.appendChild(doc.createTextNode(",\n")),different&&(td.style.background="#efe")}}tr.appendChild(td)}return row._htmlRow=tr,tr}(row._htmlRow,row,columns)),applyColumnFiltersToRow(row,columns)}function getSubjectId(subject){if("uri"in subject)return subject.uri;if("_subject_id"in subject)return subject._subject_id;var result=""+subjectIdCounter;return subject._subject_id=result,++subjectIdCounter,result}function runQuery(query,rows,columns,table){query.running=!0;var startTime=Date.now(),progressMessage=doc.createElement("tr");table.appendChild(progressMessage),progressMessage.textContent="Loading ...";for(var i=0;i=0;_i4--)if(rows[_i4].original){debug.log(" deleting row "+rows[_i4]._subject);var tr=rows[_i4]._htmlRow;tr.parentNode.removeChild(tr),delete rowsLookup[getSubjectId(rows[_i4]._subject)],rows.splice(_i4,1)}if(options.sortBy){var column=function getColumnForVariable(columns,variableNT){for(var predicateUri in columns){var column=columns[predicateUri];if(column.variable.toNT()===variableNT)return column}throw new Error("getColumnForVariable: no column for variable ".concat(variableNT))}(columns,options.sortBy);literalSort(rows,column,options.sortReverse)}options.onDone&&options.onDone(resultDiv)}))}function inferColumnsFromFormula(columns,formula){UI.log.debug(">> processing formula");for(var i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.reflect.construct.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.TabWidgetElement=void 0,exports.tabWidget=function tabWidget(options){var subject=options.subject,dom=options.dom||document,orientation=parseInt(options.orientation||"0"),backgroundColor=options.backgroundColor||"#ddddcc",flipped=2&orientation,vertical=1&orientation,onClose=options.onClose,_getColors=function getColors(backgroundColor){return function isLight(x){for(var total=0,i=0;i<3;i++)total+=parseInt(x.slice(2*i+1,2*i+3),16);return total>384}(backgroundColor)?[colorBlend(backgroundColor,"#ffffff",.3),"#000000"]:[colorBlend(backgroundColor,"#000000",.3),"#ffffff"]}(backgroundColor),_getColors2=(0,_slicedToArray2.default)(_getColors,2),selectedColor=_getColors2[0],color=_getColors2[1],bodyMainStyle="flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor,"; padding: 1em;"),rootElement=dom.createElement("div");rootElement.setAttribute("style","display: flex; height: 100%; width: 100%; flex-direction: "+(vertical?"row":"column")+(flipped?"-reverse;":";"));var navElement=rootElement.appendChild(dom.createElement("nav"));navElement.setAttribute("style","margin: 0;");var mainElement=rootElement.appendChild(dom.createElement("main"));mainElement.setAttribute("style","margin: 0; width:100%; height: 100%;");var tabContainer=navElement.appendChild(dom.createElement("ul"));tabContainer.setAttribute("style","\n list-style-type: none;\n display: flex;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n flex-direction: ".concat(vertical?"column":"row","\n "));var bodyContainer=mainElement;rootElement.tabContainer=tabContainer,rootElement.bodyContainer=bodyContainer;var corners=["0.2em","0.2em","0","0"],cornersPrepped=corners.concat(corners).slice(orientation,orientation+4),cornersStyle="border-radius: ".concat(cornersPrepped.join(" "),";"),margins=["0.3em","0.3em","0","0.3em"],marginsPrepped=margins.concat(margins).slice(orientation,orientation+4),marginsStyle="margin: ".concat(marginsPrepped.join(" "),";"),paddingStyle="padding: ".concat(marginsPrepped.join(" "),";"),tabStyle=cornersStyle+"position: relative; padding: 0.7em; max-width: 20em; color: ".concat(color,";"),unselectedStyle="".concat(tabStyle+marginsStyle," opacity: 50%; background-color: ").concat(backgroundColor,";"),selectedStyle="".concat(tabStyle+marginsStyle," background-color: ").concat(selectedColor,";"),shownStyle="height: 100%; width: 100%;",hiddenStyle=shownStyle+"display: none;";if(rootElement.refresh=orderedSync,orderedSync(),!options.startEmpty&&tabContainer.children.length&&options.selectedTab){var selectedTab0=Array.from(tabContainer.children).map((function(tab){return tab.firstChild})).find((function(tab){return tab.dataset.name===options.selectedTab})),selectedTabURI=options.selectedTab.uri,selectedTab1=Array.from(tabContainer.children).find((function(tab){return tab.subject&&tab.subject.uri&&tab.subject.uri===selectedTabURI})),clickMe=(selectedTab1||selectedTab0||tabContainer.children[0]).firstChild;clickMe&&clickMe.click()}else options.startEmpty||tabContainer.children[0].firstChild.click();return rootElement;function makeNewSlot(item){var ele=dom.createElement("li");ele.setAttribute("style",unselectedStyle),ele.subject=item;var div=ele.appendChild(dom.createElement("button"));if(div.setAttribute("style","background: none; border: none; font: inherit; cursor: pointer"),div.onclick=function(){if(resetTabStyle(),resetBodyStyle(),ele.setAttribute("style",selectedStyle),ele.bodyTR){ele.bodyTR.setAttribute("style",shownStyle);var bodyMain=getOrCreateContainerElement(ele);options.renderMain&&ele.subject&&!1!==bodyMain.asSettings&&(bodyMain.innerHTML="loading item ..."+item,options.renderMain(bodyMain,ele.subject),bodyMain.asSettings=!1)}},options.renderTabSettings&&ele.subject){var ellipsis=dom.createElement("button");ellipsis.textContent="...",ellipsis.setAttribute("style","position: absolute; right: 0; bottom: 0; width: 20%; background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit;"),ellipsis.onclick=function(){if(resetTabStyle(),resetBodyStyle(),ele.setAttribute("style",selectedStyle),ele.bodyTR){ele.bodyTR.setAttribute("style",shownStyle);var bodyMain=getOrCreateContainerElement(ele);options.renderTabSettings&&ele.subject&&!0!==bodyMain.asSettings&&(bodyMain.innerHTML="loading settings ..."+item,options.renderTabSettings(bodyMain,ele.subject),bodyMain.asSettings=!0)}},ele.appendChild(ellipsis)}return options.renderTab?options.renderTab(div,item):div.innerHTML=(0,_utils.label)(item),ele;function getOrCreateContainerElement(ele){var _ele$bodyTR,bodyMain=null===(_ele$bodyTR=ele.bodyTR)||void 0===_ele$bodyTR?void 0:_ele$bodyTR.children[0];if(bodyMain)return bodyMain;var newBodyMain=ele.bodyTR.appendChild(dom.createElement("main"));return newBodyMain.setAttribute("style",bodyMainStyle),newBodyMain}}function orderedSync(){var slot,i,j,left,right,items=function getItems(){return options.items?options.items:!1!==options.ordered?_solidLogic.store.the(subject,options.predicate).elements:_solidLogic.store.each(subject,options.predicate)}(),differ=!1;for(left=0;left=items.length||slot.subject&&!slot.subject.sameTerm(items[left])){differ=!0;break}if(differ||items.length!==tabContainer.children.length){for(right=tabContainer.children.length-1;right>=0&&(slot=tabContainer.children[right],j=right-tabContainer.children.length+items.length,!slot.subject||slot.subject.sameTerm(items[j]));right--);for(var insertables=items.slice(left,right-tabContainer.children.length+items.length+1);right>=left;)tabContainer.removeChild(tabContainer.children[left]),bodyContainer.removeChild(bodyContainer.children[left]),right-=1;for(i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.date.now.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getName=function getName(store,user){return store.anyValue(user,_.ns.vcard("fn"),null,user.doc())||store.anyValue(user,_.ns.foaf("name"),null,user.doc())||user.uri},exports.getPod=function getPod(){return(0,_rdflib.sym)(document.location.origin).site()},exports.getPodOwner=function getPodOwner(_x,_x2){return _getPodOwner.apply(this,arguments)},exports.throttle=function throttle(func,wait){var context,args,result,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},timeout=null,previous=0,later=function later(){previous=options.leading?Date.now():0,timeout=null,result=func.apply(context,args),timeout||(context=args=null)};return function(){var now=Date.now();previous||options.leading||(previous=now);var remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0||remaining>wait?(timeout&&(clearTimeout(timeout),timeout=null),previous=now,result=func.apply(context,args),timeout||(context=args=null)):timeout||!1===options.trailing||(timeout=setTimeout(later,remaining)),result}};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_=__webpack_require__("./lib/index.js");function _getPodOwner(){return(_getPodOwner=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(pod,store){var response,containerTurtle,podOwner,guess;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_context.prev=0,store.any(pod,null,_.ns.ldp("Container"),pod)){_context.next=7;break}return _context.next=4,store.fetcher.webOperation("GET",pod.uri,store.fetcher.initFetchOptions(pod.uri,{headers:{accept:"text/turtle"}}));case 4:response=_context.sent,containerTurtle=response.responseText,(0,_rdflib.parse)(containerTurtle,store,pod.uri,"text/turtle");case 7:_context.next=13;break;case 9:return _context.prev=9,_context.t0=_context.catch(0),console.error("Error loading pod "+pod+": "+_context.t0),_context.abrupt("return",null);case 13:if(store.holds(pod,_.ns.rdf("type"),_.ns.space("Storage"),pod)){_context.next=16;break}return console.warn("Pod "+pod+" does not declare itself as a space:Storage"),_context.abrupt("return",null);case 16:if(!(podOwner=store.any(pod,_.ns.solid("owner"),null,pod)||store.any(null,_.ns.space("storage"),pod,pod))){_context.next=31;break}return _context.prev=18,_context.next=21,store.fetcher.load(podOwner.doc());case 21:_context.next=27;break;case 23:return _context.prev=23,_context.t1=_context.catch(18),console.warn("Unable to load profile of pod owner "+podOwner),_context.abrupt("return",null);case 27:return store.holds(podOwner,_.ns.space("storage"),pod,podOwner.doc())||console.warn("Pod owner ".concat(podOwner," does NOT list pod ").concat(pod," as their storage")),_context.abrupt("return",podOwner);case 31:return guess=(0,_rdflib.sym)("".concat(pod.uri,"profile/card#me")),_context.prev=32,_context.next=35,store.fetcher.load(guess);case 35:_context.next=41;break;case 37:return _context.prev=37,_context.t2=_context.catch(32),console.error("Ooops. Guessed wrong pod owner webid {$guess} : can't load it."),_context.abrupt("return",null);case 41:if(!store.holds(guess,_.ns.space("storage"),pod,guess.doc())){_context.next=44;break}return console.warn("Using guessed pod owner webid but it links back."),_context.abrupt("return",guess);case 44:return _context.abrupt("return",null);case 45:case"end":return _context.stop()}}),_callee,null,[[0,9],[18,23],[32,37]])})))).apply(this,arguments)}},"./lib/utils/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AJARImage=function AJARImage(src,alt,tt,doc){doc||(doc=document);var image=doc.createElement("img");image.setAttribute("src",src),image.addEventListener("copy",(function(e){e.clipboardData.setData("text/plain",""),e.clipboardData.setData("text/html",""),e.preventDefault()})),void 0!==tt&&image.setAttribute("title",tt);return image},exports.RDFComparePredicateObject=function RDFComparePredicateObject(self,other){var x=self.predicate.compareTerm(other.predicate);return 0!==x?x:self.object.compareTerm(other.object)},exports.RDFComparePredicateSubject=function RDFComparePredicateSubject(self,other){var x=self.predicate.compareTerm(other.predicate);return 0!==x?x:self.subject.compareTerm(other.subject)},exports.addLoadEvent=function addLoadEvent(func){var oldonload=window.onload;"function"!=typeof window.onload?window.onload=func:window.onload=function(){oldonload(),func()}},exports.ancestor=function ancestor(target,tagName){var level;for(level=target;level;level=level.parentNode)try{if(level.tagName===tagName)return level}catch(e){return}return},exports.beep=function beep(){if(!audioContext)return;var ctx=new audioContext;return function(duration,frequency,type,finishedCallback){duration=+(duration||.3),type=type||"sine","function"!=typeof finishedCallback&&(finishedCallback=function finishedCallback(){});var osc=ctx.createOscillator();osc.type=type,osc.frequency.value=frequency||256,osc.connect(ctx.destination),osc.start(0),osc.stop(duration)}},exports.clearVariableNames=function clearVariableNames(){nextVariable=0},exports.emptyNode=function emptyNode(node){for(var nodes=node.childNodes,i=nodes.length-1;i>=0;i--)node.removeChild(nodes[i]);return node},exports.escapeForXML=escapeForXML,exports.findPos=findPos,exports.genUuid=function genUuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=16*Math.random()|0;return("x"===c?r:3&r|8).toString(16)}))},exports.getAbout=getAbout,exports.getEyeFocus=function getEyeFocus(element,instantly,isBottom,myWindow){myWindow||(myWindow=window);var elementPosY=findPos(element)[1],appContext=window.SolidAppContext||{},scrollDiff=appContext&&appContext.scroll||52,totalScroll=elementPosY-scrollDiff-myWindow.scrollY;if(instantly)return isBottom?void myWindow.scrollBy(0,elementPosY+element.clientHeight-(myWindow.scrollY+myWindow.innerHeight)):void myWindow.scrollBy(0,totalScroll);var id=myWindow.setInterval((function scrollAmount(){myWindow.scrollBy(0,totalScroll/10),10===++times&&myWindow.clearInterval(id)}),50),times=0},exports.getTarget=function getTarget(e){var target;(e=e||window.event).target?target=e.target:e.srcElement&&(target=e.srcElement);3===target.nodeType&&(target=target.parentNode);return target},exports.getTerm=function getTerm(target){var statementTr=target.parentNode,st=statementTr?statementTr.AJAR_statement:void 0;switch(st?target.className:""){case"pred":case"pred selected":return st.predicate;case"obj":case"obj selected":return statementTr.AJAR_inverse?st.subject:st.object;case"":case"selected":return getAbout(_solidLogic.store,target);case"undetermined selected":return target.nextSibling?st.predicate:statementTr.AJAR_inverse?st.subject:st.object}},exports.hashColor=function hashColor(who){return"#"+(16777215&function hash(x){return x.split("").reduce((function(a,b){return(a=(a<<5)-a+b.charCodeAt(0))&a}),0)}(who=who.uri||who)|12632256).toString(16)},exports.include=function include(document,linkstr){var lnk=document.createElement("script");return lnk.setAttribute("type","text/javascript"),lnk.setAttribute("src",linkstr),lnk},Object.defineProperty(exports,"label",{enumerable:!0,get:function get(){return _label.label}}),exports.labelForXML=function labelForXML(x){return escapeForXML((0,_label.label)(x))},exports.labelWithOntology=function labelWithOntology(x,initialCap){var t=_solidLogic.store.findTypeURIs(x);if(t[UI.ns.rdf("Predicate").uri]||t[UI.ns.rdfs("Class").uri])return(0,_label.label)(x,initialCap)+" ("+ontologyLabel(x)+")";return(0,_label.label)(x,initialCap)},exports.newVariableName=function newVariableName(){return"v"+nextVariable++},exports.ontologyLabel=ontologyLabel,exports.predParentOf=function predParentOf(node){var n=node;for(;;){if(n.getAttribute("predTR"))return n;if(!n.previousSibling||"TR"!==n.previousSibling.nodeName)return UI.log.error("Could not find predParent"),node;n=n.previousSibling}},exports.predicateLabel=predicateLabel,exports.predicateLabelForXML=function predicateLabelForXML(p,inverse){return escapeForXML(predicateLabel(p,inverse))},exports.shortName=function shortName(uri){var p=uri;"#/".indexOf(p[p.length-1])>=0&&(p=p.slice(0,-1));var pok,namespaces=[];for(var _ns in this.prefixes)namespaces[this.prefixes[_ns]]=_ns;var i,canUse=function canUse(pp){return"ns"!==pp&&(pok=pp,!0)},hash=p.lastIndexOf("#");hash>=0&&(p=p.slice(hash-1));for(;;){var slash=p.lastIndexOf("/");for(slash>=0&&(p=p.slice(slash+1)),i=0;i-1)break;"("===line.charAt(0)&&(line="function"+line);var chunks=line.split("@");toPrint.push(chunks)}for(i=0;i=table.children.length)table.appendChild(newRow);else{var ele=table.children[g];table.insertBefore(newRow,ele)}newRow.subject=thing}}for(i=0;i=table.children.length){var newRow=createNewRow(thing);newRow.subject=thing,table.appendChild(newRow)}else{var _row=table.children[g];if(_row.subject.sameTerm(thing));else{var existingRow=elementMap[thing.toNT()];if(existingRow)table.removeChild(existingRow),table.insertBefore(existingRow,_row);else{var _newRow=createNewRow(thing);_row.before(_newRow),_newRow.subject=thing}}}}for(;table.children.length>things.length;)table.removeChild(table.children[table.children.length-1])};var log=_interopRequireWildcard(__webpack_require__("./lib/log.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_label=__webpack_require__("./lib/utils/label.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var audioContext,UI={log,ns,rdf},nextVariable=0;function getAbout(kb,target){var level,aa;for(level=target;level&&1===level.nodeType;level=level.parentNode)if(aa=level.getAttribute("about"))return kb.fromNT(aa);UI.log.debug("getAbout: No about found")}function findPos(obj){var DocBox=obj.ownerDocument.documentElement.getBoundingClientRect(),box=obj.getBoundingClientRect();return[box.left-DocBox.left,box.top-DocBox.top]}function ontologyLabel(term){if(void 0===term.uri)return"??";var part,s=term.uri,namespaces=[],i=s.lastIndexOf("#");if(i>=0)s=s.slice(0,i+1);else{if(!((i=s.lastIndexOf("/"))>=0))return term.uri+"?!";s=s.slice(0,i+1)}for(var _ns2 in UI.ns)namespaces[UI.ns[_ns2]]=_ns2;try{return namespaces[s]}catch(e){}for(s=s.slice(0,-1);s;){if(!((i=s.lastIndexOf("/"))>=0))return term.uri+"!?";if(part=s.slice(i+1),s=s.slice(0,i),"ns"!==part&&"0123456789".indexOf(part[0])<0)return part}}function escapeForXML(str){return str.replace(/&/g,"&").replace(/{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getExistingPrivateKey=function getExistingPrivateKey(_x5,_x6){return _getExistingPrivateKey.apply(this,arguments)},exports.getExistingPublicKey=function getExistingPublicKey(_x2,_x3){return _getExistingPublicKey.apply(this,arguments)},exports.getKeyIfExists=getKeyIfExists,exports.pubKeyUrl=exports.privKeyUrl=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.pubKeyUrl=function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(webId){var _store$any,_parentSettings,parentSettings;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(parentSettings=null===(_store$any=_solidLogic.store.any(webId,ns.space("preferencesFile"),null,webId.doc()))||void 0===_store$any?void 0:_store$any.value,parentSettings=null===(_parentSettings=parentSettings)||void 0===_parentSettings?void 0:_parentSettings.split("/").slice(0,-2).join("/")){_context.next=4;break}throw new Error("prefererencesFile is expected to exist in ".concat(webId.doc));case 4:return _context.abrupt("return","".concat(parentSettings,"/profile/keys/publicKey.ttl"));case 5:case"end":return _context.stop()}}),_callee)})));return function pubKeyUrl(_x){return _ref.apply(this,arguments)}}();function _getExistingPublicKey(){return(_getExistingPublicKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(webId,publicKeyUrl){return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,getKeyIfExists(webId,publicKeyUrl,"publicKey");case 2:return _context3.abrupt("return",_context3.sent);case 3:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}exports.privKeyUrl=function(){var _ref2=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(webId){var _store$any2,_settings,settings;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(settings=null===(_store$any2=_solidLogic.store.any(webId,ns.space("preferencesFile"),null,webId.doc()))||void 0===_store$any2?void 0:_store$any2.value,settings=null===(_settings=settings)||void 0===_settings?void 0:_settings.split("/").slice(0,-1).join("/")){_context2.next=4;break}throw new Error("prefererencesFile is expected to exist in ".concat(webId.doc));case 4:return _context2.abrupt("return","".concat(settings,"/keys/privateKey.ttl"));case 5:case"end":return _context2.stop()}}),_callee2)})));return function privKeyUrl(_x4){return _ref2.apply(this,arguments)}}();function _getExistingPrivateKey(){return(_getExistingPrivateKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(webId,privateKeyUrl){return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,getKeyIfExists(webId,privateKeyUrl,"privateKey");case 2:return _context4.abrupt("return",_context4.sent);case 3:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}function getKeyIfExists(_x7,_x8,_x9){return _getKeyIfExists.apply(this,arguments)}function _getKeyIfExists(){return(_getKeyIfExists=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(webId,keyUrl,keyType){var key;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:return _context5.prev=0,_context5.next=3,_solidLogic.store.fetcher.load(keyUrl);case 3:return key=_solidLogic.store.any(webId,ns.solid(keyType)),_context5.abrupt("return",null==key?void 0:key.value);case 7:if(_context5.prev=7,_context5.t0=_context5.catch(0),404!==_context5.t0.response.status){_context5.next=24;break}return debug.log("createIfNotExists: doc does NOT exist, will create... "+keyUrl),_context5.prev=11,_context5.next=14,_solidLogic.store.fetcher.webOperation("PUT",keyUrl,{data:"",contentType:"text/turtle"});case 14:_context5.next=20;break;case 16:throw _context5.prev=16,_context5.t1=_context5.catch(11),debug.log("createIfNotExists doc FAILED: "+keyUrl+": "+_context5.t1),_context5.t1;case 20:return delete _solidLogic.store.fetcher.requested[keyUrl],_context5.abrupt("return",void 0);case 24:throw debug.log("createIfNotExists doc FAILED: "+keyUrl+": "+_context5.t0),_context5.t0;case 26:case"end":return _context5.stop()}}),_callee5,null,[[0,7],[11,16]])})))).apply(this,arguments)}},"./lib/utils/keyHelpers/acl.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.keyContainerAclBody=exports.keyAclBody=void 0,exports.setAcl=function setAcl(_x,_x2){return _setAcl.apply(this,arguments)};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=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&&Object.prototype.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}(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _setAcl(){return(_setAcl=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(keyDoc,aclBody){var keyAclDoc,_err$response;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,_solidLogic.store.fetcher.load(keyDoc);case 2:if(debug.log(_solidLogic.store.statementsMatching(_solidLogic.store.sym(keyDoc),_solidLogic.store.sym("http://www.iana.org/assignments/link-relations/acl"))),keyAclDoc=_solidLogic.store.any(_solidLogic.store.sym(keyDoc),_solidLogic.store.sym("http://www.iana.org/assignments/link-relations/acl"))){_context.next=6;break}throw new Error("Key ACL doc not found!");case 6:return _context.prev=6,_context.next=9,_solidLogic.store.fetcher.webOperation("PUT",keyAclDoc.value,{data:aclBody,contentType:"text/turtle"});case 9:_context.next=16;break;case 11:if(_context.prev=11,_context.t0=_context.catch(6),404===(null===_context.t0||void 0===_context.t0||null===(_err$response=_context.t0.response)||void 0===_err$response?void 0:_err$response.status)){_context.next=15;break}throw new Error(_context.t0);case 15:debug.log("delete "+keyAclDoc.value+" "+_context.t0.response.status);case 16:case"end":return _context.stop()}}),_callee,null,[[6,11]])})))).apply(this,arguments)}exports.keyContainerAclBody=function keyContainerAclBody(me){return"\n@prefix : <#>.\n@prefix acl: .\n@prefix foaf: .\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <".concat(me,">;\n acl:mode acl:Read, acl:Write.\n")},exports.keyAclBody=function keyAclBody(keyDoc,me){var keyAgent="acl:agentClass foaf:Agent";return null!=me&&me.length&&(keyAgent="acl:agent <".concat(me,">")),"\n@prefix foaf: .\n@prefix acl: .\n<#Read>\n a acl:Authorization;\n ".concat(keyAgent,";\n acl:accessTo <").concat(keyDoc.split("/").pop(),">;\n acl:mode acl:Read.\n")}},"./lib/utils/label.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.string.link.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.label=function label(thing){var initialCap=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function doCap(label){return initialCap?label.slice(0,1).toUpperCase()+label.slice(1):label}function cleanUp(label){var result="";"/"===label.slice(-1)&&(label=label.slice(0,-1));for(var i=0;i0;i--)for(var hex="0123456789abcefABCDEF";"%"===s[i]&&hex.indexOf(s[i+1])>=0&&hex.indexOf(s[i+2])>=0;)s=s.slice(0,i)+String.fromCharCode(parseInt(s.slice(i+1,i+3),16))+s.slice(i+3)}s=slice(s,"/profile/card#me"),s=slice(s,"#this");var hash=(s=slice(s,"#me")).indexOf("#");if(hash>=0)return cleanUp(s.slice(hash+1));var slash=s.lastIndexOf("/",s.length-2);return slash>=0&&slash{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.versionInfo=void 0;exports.versionInfo={buildTime:"2023-11-01T11:18:08Z",commit:"ee8e69c20cc21d93eb942bc5479e4644d5704964",npmInfo:{"solid-ui":"2.4.29",npm:"8.19.4",node:"16.20.2",v8:"9.4.146.26-node.26",uv:"1.43.0",zlib:"1.2.11",brotli:"1.0.9",ares:"1.19.1",modules:"93",nghttp2:"1.47.0",napi:"8",llhttp:"6.0.11",openssl:"1.1.1v+quic",cldr:"41.0",icu:"71.1",tz:"2022f",unicode:"14.0",ngtcp2:"0.8.1",nghttp3:"0.7.0"}}},"./lib/widgets/buttons.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.string.search.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.string.link.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.addStyleSheet=function addStyleSheet(dom,href){for(var links=dom.querySelectorAll("link"),i=0;i3&&void 0!==arguments[3]?arguments[3]:{},deleteAttachment=function deleteAttachment(target){if(!kb.updater)throw new Error("kb has no updater");kb.updater.update((0,_rdflib.st)(subject,predicate,target,doc),[],(function(uri,ok,errorBody,_xhr){ok?refresh():complain(void 0,"Error deleting one: "+errorBody)}))};function createNewRow(target){var theTarget=target,opt={noun};return modify&&(opt.deleteFunction=function(){deleteAttachment(theTarget)}),personTR(dom,predicate,target,opt)}var refresh=function refresh(){var things=kb.each(subject,predicate);things.sort(),utils.syncTableToArray(attachmentTable,things,createNewRow)};function droppedURIHandler(uris){var ins=[];if(uris.forEach((function(u){var target=(0,_rdflib.sym)(u);debug.log("Dropped on attachemnt "+u),ins.push((0,_rdflib.st)(subject,predicate,target,doc))})),!kb.updater)throw new Error("kb has no updater");kb.updater.update([],ins,(function(uri,ok,errorBody,_xhr){ok?refresh():complain(void 0,"Error adding one: "+errorBody)}))}function droppedFileHandler(files){var _options$uploadFolder,_options$uploadFolder2;(0,_dragAndDrop.uploadFiles)(kb.fetcher,files,null===(_options$uploadFolder=options.uploadFolder)||void 0===_options$uploadFolder?void 0:_options$uploadFolder.uri,null===(_options$uploadFolder2=options.uploadFolder)||void 0===_options$uploadFolder2?void 0:_options$uploadFolder2.uri,(function(theFile,destURI){var ins=[(0,_rdflib.st)(subject,predicate,kb.sym(destURI),doc)];if(!kb.updater)throw new Error("kb has no updater");kb.updater.update([],ins,(function(uri,ok,errorBody,_xhr){ok?refresh():complain(void 0,"Error adding link to uploaded file: "+errorBody)}))}))}var doc=options.doc||subject.doc();void 0===options.modify&&(options.modify=!0);var modify=options.modify,promptIcon=options.promptIcon||iconBase+"noun_748003.svg",predicate=options.predicate||ns.wf("attachment"),noun=options.noun||"attachment",kb=_solidLogic.store,attachmentOuter=div.appendChild(dom.createElement("table"));attachmentOuter.setAttribute("style","margin-top: 1em; margin-bottom: 1em;");var attachmentOne=attachmentOuter.appendChild(dom.createElement("tr")),attachmentLeft=attachmentOne.appendChild(dom.createElement("td")),attachmentRight=attachmentOne.appendChild(dom.createElement("td")),attachmentTable=attachmentRight.appendChild(dom.createElement("table"));if(attachmentTable.appendChild(dom.createElement("tr")),attachmentOuter.refresh=refresh,refresh(),modify){var paperclip=button(dom,promptIcon,"Drop attachments here");attachmentLeft.appendChild(paperclip);var fhandler=options.uploadFolder?droppedFileHandler:null;if((0,_dragAndDrop.makeDropTarget)(paperclip,droppedURIHandler,fhandler),(0,_dragAndDrop.makeDropTarget)(attachmentLeft,droppedURIHandler,fhandler),options.uploadFolder){var buttonDiv=fileUploadButtonDiv(dom,droppedFileHandler);attachmentLeft.appendChild(buttonDiv)}}return attachmentOuter},exports.button=button,exports.cancelButton=cancelButton,exports.clearElement=function clearElement(ele){for(;ele.firstChild;)ele.removeChild(ele.firstChild);return ele},exports.complain=complain,exports.continueButton=continueButton,exports.createLinkDiv=createLinkDiv,exports.createNameDiv=createNameDiv,exports.defaultAnnotationStore=function defaultAnnotationStore(subject){if(void 0===subject.uri)return;var s=subject.uri;if("http://"!==s.slice(0,7))return;var hash=(s=s.slice(7)).indexOf("#");if(hash>=0)s=s.slice(0,hash);else{var slash=s.lastIndexOf("/");if(slash<0)return;s=s.slice(0,slash)}return _solidLogic.store.sym("http://tabulator.org/wiki/annnotation/"+s)},exports.deleteButtonWithCheck=deleteButtonWithCheck,exports.extractLogURI=function extractLogURI(fullURI){var logPos=fullURI.search(/logFile=/),rulPos=fullURI.search(/&rulesFile=/);return fullURI.substring(logPos+8,rulPos)},exports.faviconOrDefault=faviconOrDefault,exports.fileUploadButtonDiv=fileUploadButtonDiv,exports.findImage=findImage,exports.findImageFromURI=findImageFromURI,exports.formatDateTime=formatDateTime,exports.iconForClass=void 0,exports.imagesOf=function imagesOf(x,kb){return kb.each(x,ns.sioc("avatar")).concat(kb.each(x,ns.foaf("img"))).concat(kb.each(x,ns.vcard("logo"))).concat(kb.each(x,ns.vcard("hasPhoto"))).concat(kb.each(x,ns.vcard("photo"))).concat(kb.each(x,ns.foaf("depiction")))},exports.index=void 0,exports.isAudio=function isAudio(file){return isImage(file,"audio")},exports.isImage=isImage,exports.isVideo=function isVideo(file){return isImage(file,"video")},exports.linkButton=function linkButton(dom,object){var b=dom.createElement("button");return b.setAttribute("type","button"),b.textContent="Goto "+utils.label(object),b.addEventListener("click",(function(_event){dom.outlineManager.GotoSubject(object,!0,void 0,!0,void 0)}),!0),b},exports.openHrefInOutlineMode=function openHrefInOutlineMode(e){e.preventDefault(),e.stopPropagation();var uri=utils.getTarget(e).getAttribute("href");if(!uri)return debug.log("openHrefInOutlineMode: No href found!\n");var dom=window.document;dom.outlineManager?dom.outlineManager.GotoSubject(_solidLogic.store.sym(uri),!0,void 0,!0,void 0):window&&window.panes&&window.panes.getOutliner?window.panes.getOutliner().GotoSubject(_solidLogic.store.sym(uri),!0,void 0,!0,void 0):debug.log("ERROR: Can't access outline manager in this config")},exports.personTR=void 0,exports.propertyTriage=function propertyTriage(kb){var possibleProperties={},dp={},op={},no=0,nd=0,nu=0,pi=kb.predicateIndex;for(var p in pi){"Literal"===pi[p][0].object.termType?(dp[p]=!0,nd++):(op[p]=!0,no++)}for(var ps=kb.each(void 0,ns.rdf("type"),ns.rdf("Property")),i=0;i4&&void 0!==arguments[4]?arguments[4]:{buttonColor:"Primary",needsBorder:!1},button=dom.createElement("button");if(button.setAttribute("type","button"),iconURI){var img=button.appendChild(dom.createElement("img"));img.setAttribute("src",iconURI),img.setAttribute("style","width: 2em; height: 2em;"),img.title=text,button.setAttribute("style",style.buttonStyle)}else button.textContent=text.toLocaleUpperCase(),button.onmouseover=function(){"Secondary"===options.buttonColor?options.needsBorder?button.setAttribute("style",style.secondaryButtonNoBorderHover):button.setAttribute("style",style.secondaryButtonHover):options.needsBorder?button.setAttribute("style",style.primaryButtonNoBorderHover):button.setAttribute("style",style.primaryButtonHover)},button.onmouseout=function(){"Secondary"===options.buttonColor?options.needsBorder?button.setAttribute("style",style.secondaryButtonNoBorder):button.setAttribute("style",style.secondaryButton):options.needsBorder?button.setAttribute("style",style.primaryButtonNoBorder):button.setAttribute("style",style.primaryButton)},"Secondary"===options.buttonColor?options.needsBorder?button.setAttribute("style",style.secondaryButtonNoBorder):button.setAttribute("style",style.secondaryButton):options.needsBorder?button.setAttribute("style",style.primaryButtonNoBorder):button.setAttribute("style",style.primaryButton);return handler&&button.addEventListener("click",handler,!1),button}function cancelButton(dom,handler){var b=button(dom,cancelIconURI,"Cancel",handler);return b.firstChild&&(b.firstChild.style.opacity="0.3"),b}function continueButton(dom,handler){return button(dom,checkIconURI,"Continue",handler)}var personTR=exports.personTR=renderAsRow;function renderAsRow(dom,pred,obj,options){var tr=dom.createElement("tr");options=options||{};var td1=tr.appendChild(dom.createElement("td")),td2=tr.appendChild(dom.createElement("td")),td3=tr.appendChild(dom.createElement("td")),image=options.image||faviconOrDefault(dom,obj);if(td1.setAttribute("style","vertical-align: middle; width:2.5em; padding:0.5em; height: 2.5em;"),td2.setAttribute("style","vertical-align: middle; text-align:left;"),td3.setAttribute("style","vertical-align: middle; width:2em; padding:0.5em; height: 4em;"),td1.appendChild(image),options.title?td2.textContent=options.title:setName(td2,obj),options.deleteFunction&&deleteButtonWithCheck(dom,td3,options.noun||"one",options.deleteFunction),obj.uri){if(!1!==options.link)td3.appendChild((0,_iconLinks.linkIcon)(dom,obj)).classList.add("HoverControlHide"),td3.appendChild(dom.createElement("br"));!1!==options.draggable&&(image.setAttribute("draggable","false"),(0,_dragAndDrop.makeDraggable)(tr,obj))}return tr.subject=obj,tr}function createNameDiv(dom,div,title,obj){var nameDiv=div.appendChild(dom.createElement("div"));title?nameDiv.textContent=title:setName(nameDiv,obj)}function createLinkDiv(dom,div,obj,options){var linkDiv=div.appendChild(dom.createElement("div"));linkDiv.setAttribute("style",style.linkDivStyle),options.deleteFunction&&deleteButtonWithCheck(dom,linkDiv,options.noun||"one",options.deleteFunction),obj.uri&&(!1!==options.link&&(0,_iconLinks.createLinkForURI)(dom,linkDiv,obj),(0,_dragAndDrop.makeDraggable)(div,obj))}function selectorPanelRefresh(list,dom,kb,type,predicate,inverse,possible,options,callbackFunction,linkCallback){var style0="border: 0.1em solid #ddd; border-bottom: none; width: 95%; height: 2em; padding: 0.5em;",selected=null;list.innerHTML="";for(var refreshItem=function refreshItem(box,x){var item,image,setStyle=function setStyle(){var already=inverse?kb.each(void 0,predicate,x):kb.each(x,predicate);iconDiv.setAttribute("class",0===already.length?"hideTillHover":""),image.setAttribute("src",options.connectIcon||iconBase+"noun_25830.svg"),image.setAttribute("title",already.length?already.length:"attach")},f=index.twoLine.widgetForClass(type);(item=f(dom,x)).setAttribute("style",style0);var nav=dom.createElement("div");nav.setAttribute("class","hideTillHover"),nav.setAttribute("style","float:right; width:10%");var a=dom.createElement("a");a.setAttribute("href",x.uri),a.setAttribute("style","float:right"),nav.appendChild(a).textContent=">",box.appendChild(nav);var iconDiv=dom.createElement("div");return iconDiv.setAttribute("style",(inverse?"float:left;":"float:right;")+" width:30px;"),image=dom.createElement("img"),setStyle(),iconDiv.appendChild(image),box.appendChild(iconDiv),item.addEventListener("click",(function(event){selected===item?(item.setAttribute("style",style0),selected=null):(selected&&selected.setAttribute("style",style0),item.setAttribute("style",style0+"background-color: #ccc; color:black;"),selected=item),callbackFunction(x,event,selected===item),setStyle()}),!1),image.addEventListener("click",(function(event){linkCallback(x,event,inverse,setStyle)}),!1),box.appendChild(item),box},i=0;i\n < /tr>\n < tr >\n ").concat(enc("date").slice(0,10),'\n ').concat(enc("amount"),"\n "),failed&&(box.innerHTML='\n \n ').concat(utils.escapeForXML(failed),"\n ")),box},"http://www.w3.org/ns/pim/trip#Trip":function twoLineTrip(dom,x){var enc=function enc(p){var y=_solidLogic.store.any(x,p);return y?utils.escapeForXML(y.value):"?"},box=dom.createElement("table");return box.innerHTML='\n \n '.concat(enc(ns.dc("title")),'\n \n \n ').concat(enc(ns.cal("dtstart")),"\n ").concat(enc(ns.cal("dtend")),"\n "),box},widgetForClass:function twoLineWidgetForClass(c){var widget=index.twoLine[c.uri],kb=_solidLogic.store;if(widget)return widget;var sup=kb.findSuperClassesNT(c);for(var cl in sup)if(widget=index.twoLine[kb.fromNT(cl).uri])return widget;return index.twoLine[""]}}}},"./lib/widgets/buttons/iconLinks.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.createLinkForURI=void 0,exports.linkIcon=linkIcon;var _iconBase=__webpack_require__("./lib/iconBase.js");function linkIcon(dom,subject,iconURI){var anchor=dom.createElement("a");anchor.setAttribute("href",subject.uri),subject.uri.startsWith("http")&&anchor.setAttribute("target","_blank");var img=anchor.appendChild(dom.createElement("img"));return img.setAttribute("src",iconURI||_iconBase.originalIconBase+"go-to-this.png"),img.setAttribute("style","margin: 0.3em;"),anchor}exports.createLinkForURI=function createLinkForURI(dom,linkDiv,obj){var iconLink=linkIcon(dom,obj);linkDiv.appendChild(iconLink).classList.add("HoverControlHide"),linkDiv.appendChild(dom.createElement("br"))}},"./lib/widgets/dragAndDrop.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.string.ends-with.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.makeDraggable=function makeDraggable(tr,obj){tr.setAttribute("draggable","true"),tr.addEventListener("dragstart",(function(e){tr.style.fontWeight="bold",e.dataTransfer.setData("text/uri-list",obj.uri),e.dataTransfer.setData("text/plain",obj.uri),e.dataTransfer.setData("text/html",tr.outerHTML),debug.log("Dragstart: "+tr+" -> "+obj+"de: "+e.dataTransfer.dropEffect)}),!1),tr.addEventListener("drag",(function(e){e.preventDefault(),e.stopPropagation()}),!1),tr.addEventListener("dragend",(function(e){tr.style.fontWeight="normal",debug.log("Dragend dropeffect: "+e.dataTransfer.dropEffect),debug.log("Dragend: "+tr+" -> "+obj)}),!1)},exports.makeDropTarget=function makeDropTarget(ele,droppedURIHandler,droppedFileHandler){var dragoverListener=function dragoverListener(e){e.preventDefault(),e.dataTransfer.dropEffect="copy"},dragenterListener=function dragenterListener(e){debug.log("dragenter event dropEffect: "+e.dataTransfer.dropEffect),this.style&&(this.savedStyle||(this.savedStyle={},this.savedStyle.border=this.style.border,this.savedStyle.backgroundColor=this.style.backgroundColor,this.savedStyle.borderRadius=this.style.borderRadius),this.style.backgroundColor="#ccc",this.style.border="0.25em dashed black",this.style.borderRadius="0.3em"),e.dataTransfer.dropEffect="link",debug.log("dragenter event dropEffect 2: "+e.dataTransfer.dropEffect)},dragleaveListener=function dragleaveListener(e){debug.log("dragleave event dropEffect: "+e.dataTransfer.dropEffect),this.savedStyle?(this.style.border=this.savedStyle.border,this.style.backgroundColor=this.savedStyle.backgroundColor,this.style.borderRadius=this.savedStyle.borderRadius):(this.style.backgroundColor="white",this.style.border="0em solid black")},dropListener=function dropListener(e){e.preventDefault&&e.preventDefault(),debug.log("Drop event. dropEffect: "+e.dataTransfer.dropEffect),debug.log("Drop event. types: "+(e.dataTransfer.types?e.dataTransfer.types.join(", "):"NOPE"));var text,uris=null;if(e.dataTransfer.types){for(var t=0;t{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.errorMessageBlock=function errorMessageBlock(dom,err,backgroundColor,err2){var div=dom.createElement("div"),errorObject=err2||err instanceof Error?err:null;errorObject?(console.error("errorMessageBlock: ".concat(errorObject," at: ").concat(errorObject.stack||"??"),errorObject),div.textContent=errorObject.message):div.textContent=err;return div.appendChild((0,_widgets.cancelButton)(dom,(function(){div.parentNode&&div.parentNode.removeChild(div)}))).style="width: 2em; height: 2em; align: right;",div.setAttribute("style","margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: "+(backgroundColor||"#fee")+"; color:black;"),div};var _widgets=__webpack_require__("./lib/widgets/index.js")},"./lib/widgets/forms.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.appendForm=appendForm,Object.defineProperty(exports,"basicField",{enumerable:!0,get:function get(){return _basic.basicField}}),exports.buildCheckboxForm=buildCheckboxForm,exports.editFormButton=function editFormButton(dom,container,form,dataDoc,callbackFunction){var b=dom.createElement("button");return b.setAttribute("type","button"),b.innerHTML="Edit "+utils.label(ns.ui("Form")),b.addEventListener("click",(function(_e){appendForm(dom,container,{},form,ns.ui("FormForm"),dataDoc,callbackFunction).setAttribute("style",ns.ui("FormForm").sameTerm(form)?"background-color: #fee;":"background-color: #ffffe7;"),b.parentNode.removeChild(b)}),!0),b},Object.defineProperty(exports,"field",{enumerable:!0,get:function get(){return _fieldFunction.field}}),Object.defineProperty(exports,"fieldFunction",{enumerable:!0,get:function get(){return _fieldFunction.fieldFunction}}),Object.defineProperty(exports,"fieldLabel",{enumerable:!0,get:function get(){return _basic.fieldLabel}}),Object.defineProperty(exports,"fieldParams",{enumerable:!0,get:function get(){return _fieldParams.fieldParams}}),Object.defineProperty(exports,"fieldStore",{enumerable:!0,get:function get(){return _basic.fieldStore}}),exports.findClosest=findClosest,exports.formsFor=function formsFor(subject){var kb=_solidLogic.store;log.debug("formsFor: subject="+subject);var t1,t=kb.findTypeURIs(subject);for(t1 in t)log.debug(" type: "+t1);var bottom=kb.bottomTypeURIs(t),candidates=[];for(var b in bottom)log.debug("candidatesFor: trying bottom type ="+b),candidates=(candidates=candidates.concat(findClosest(kb,b,ns.ui("creationForm")))).concat(findClosest(kb,b,ns.ui("annotationForm")));return candidates},exports.makeDescription=makeDescription,exports.makeSelectForCategory=makeSelectForCategory,exports.makeSelectForChoice=makeSelectForChoice,exports.makeSelectForClassifierOptions=makeSelectForClassifierOptions,exports.makeSelectForNestedCategory=makeSelectForNestedCategory,exports.makeSelectForOptions=function makeSelectForOptions(dom,kb,subject,predicate,possible,options,dataDoc,callbackFunction){log.debug("Select list length now "+possible.length);for(var actual,n=0,uris={},editable=kb.updater.editable(dataDoc.uri),i=0;i60&&(members=members.slice(0,60));for(var used={},i=0;i<(members.length>60?60:members.length);i++)kb.statementsMatching(members[i],void 0,void 0).forEach((function(st){used[st.predicate.uri]=!0}));explicit.forEach((function(p){used[p.uri]=!0}));var result=[];for(var uri in used)result.push(kb.sym(uri));return result},Object.defineProperty(exports,"renderNameValuePair",{enumerable:!0,get:function get(){return _basic.renderNameValuePair}}),exports.sortByLabel=sortByLabel,exports.sortBySequence=sortBySequence;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),buttons=_interopRequireWildcard(__webpack_require__("./lib/widgets/buttons.js")),_fieldParams=__webpack_require__("./lib/widgets/forms/fieldParams.js"),_fieldFunction=__webpack_require__("./lib/widgets/forms/fieldFunction.js"),_formStyle=__webpack_require__("./lib/widgets/forms/formStyle.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_error=__webpack_require__("./lib/widgets/error.js"),_basic=__webpack_require__("./lib/widgets/forms/basic.js"),_autocompleteField=__webpack_require__("./lib/widgets/forms/autocomplete/autocompleteField.js"),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),log=_interopRequireWildcard(__webpack_require__("./lib/log.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_multiSelect=__webpack_require__("./lib/widgets/multiSelect.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i0;){var c=agenda.shift(),lists=kb.each(c,prop);if(log.debug("Lists for "+c+", "+prop+": "+lists.length),0!==lists.length)return lists;for(var supers=kb.each(c,ns.rdfs("subClassOf")),i=0;i";var formFunction=(0,_fieldFunction.fieldFunction)(dom,form),object=newThing(dataDoc),gotButton=!1;function linkDone(uri,ok,body){return callbackFunction(ok,body)}log.info("paneUtils Object is "+object);var f=formFunction(dom,box,{},object,form,dataDoc,(function itemDone(ok,body){if(!ok)return callbackFunction(ok,body);var insertMe=[];subject&&!kb.holds(subject,predicate,object,dataDoc)&&insertMe.push($rdf.st(subject,predicate,object,dataDoc)),subject&&!kb.holds(object,ns.rdf("type"),theClass,dataDoc)&&insertMe.push($rdf.st(object,ns.rdf("type"),theClass,dataDoc)),insertMe.length?kb.updater.update([],insertMe,linkDone):callbackFunction(!0,body),gotButton||(gotButton=box.appendChild(buttons.linkButton(dom,object)))}));return buttons.removeButton(dom,f).setAttribute("style","float: right;"),box.AJAR_subject=object,box}function makeDescription(dom,kb,subject,predicate,dataDoc,callbackFunction){var submit,group=dom.createElement("div"),desc=kb.anyJS(subject,predicate,null,dataDoc)||"",field=dom.createElement("textarea");function saveChange(_e){submit.disabled=!0,submit.setAttribute("style","visibility: hidden; float: right;"),field.disabled=!0,field.style.color=style.textInputColorPending;var ds=kb.statementsMatching(subject,predicate,null,dataDoc),is=$rdf.st(subject,predicate,field.value,dataDoc);kb.updater.update(ds,is,(function(uri,ok,body){ok?(field.style.color=style.textInputColor,field.disabled=!1):group.appendChild((0,_error.errorMessageBlock)(dom,"Error (while saving change to "+dataDoc.uri+"): "+body)),callbackFunction&&callbackFunction(ok,body)}))}return group.appendChild(field),field.rows=desc?desc.split("\n").length+2:2,field.cols=80,field.setAttribute("style",style.multilineTextInputStyle),null!==desc?field.value=desc:field.select(),group.refresh=function(){var v=kb.any(subject,predicate,null,dataDoc);v&&v.value!==field.value&&(field.value=v.value)},kb.updater.editable(dataDoc.uri)?((submit=widgets.continueButton(dom,saveChange)).disabled=!0,submit.style.visibility="hidden",submit.style.float="right",group.appendChild(submit),field.addEventListener("keyup",(function(_e){field.style.color="green",submit&&(submit.disabled=!1,submit.style.visibility="")}),!0),field.addEventListener("change",saveChange,!0)):(field.disabled=!0,field.style.backgroundColor=style.textInputBackgroundColorUneditable),group}function makeSelectForClassifierOptions(dom,kb,subject,predicate,possible,options,dataDoc,callbackFunction){log.debug("Select list length now "+possible.length);for(var actual,n=0,uris={},editable=kb.updater.editable(dataDoc.uri),i=0;i3||weight<0)return box.appendChild((0,_error.errorMessageBlock)(dom,"Form Group weight ".concat(weight," should be 0-3")));box.setAttribute("style",style.formGroupStyle[weight]),box.style.display="flex",box.style.flexDirection="column",box.class="form-weight-"+weight;var subfields,parts=kb.any(form,ui("parts"),null,formDoc);if(parts?subfields=parts.elements:(parts=kb.each(form,ui("part"),null,formDoc),subfields=sortBySequence(parts)),!parts)return box.appendChild((0,_error.errorMessageBlock)(dom,"No parts to form! "));for(var i=0;i0)){_context8.next=12;break}j=0;case 3:if(!(j{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.renderAutocompleteControl=function renderAutocompleteControl(_x,_x2,_x3,_x4,_x5,_x6){return _renderAutocompleteControl.apply(this,arguments)};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_autocompletePicker=__webpack_require__("./lib/widgets/forms/autocomplete/autocompletePicker.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.autocompleteField=function autocompleteField(dom,container,already,subject,form,doc,callbackFunction){var _kb$updater;function _addOneIdAndRefresh(){return(_addOneIdAndRefresh=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(result,name){var oldValue,oldName,deletables,insertables,_kb$updater2;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(name){_context.next=2;break}throw new Error("autocompleteField: No name set.");case 2:if(!(oldValue=kb.the(subject,property,null,doc))){_context.next=7;break}if(oldName=kb.any(oldValue,labelProperty,null,doc),!(oldValue.equals(result)&&oldName&&oldName.sameTerm(name))){_context.next=7;break}return _context.abrupt("return");case 7:return deletables=oldValue?kb.statementsMatching(subject,property,oldValue,doc).concat(kb.statementsMatching(oldValue,labelProperty,null,doc)):[],insertables=[(0,_rdflib.st)(subject,property,result,doc),(0,_rdflib.st)(result,labelProperty,name,doc)],_context.prev=9,_context.next=12,null===(_kb$updater2=kb.updater)||void 0===_kb$updater2?void 0:_kb$updater2.updateMany(deletables,insertables);case 12:_context.next=19;break;case 14:return _context.prev=14,_context.t0=_context.catch(9),callbackFunction(!1,_context.t0),box.appendChild(widgets.errorMessageBlock(dom,"Autocomplete form data update error:"+_context.t0,null,_context.t0)),_context.abrupt("return");case 19:callbackFunction(!0,"");case 20:case"end":return _context.stop()}}),_callee,null,[[9,14]])})))).apply(this,arguments)}function _deleteOne(){return(_deleteOne=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(_result,_name){var oldValue,deletables,insertables,_kb$updater3,e2;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(oldValue=kb.the(subject,property,null,doc)){_context2.next=5;break}return callbackFunction(!1,"NO data to elete"),box.appendChild(widgets.errorMessageBlock(dom,"Autocomplete delete: no old data!")),_context2.abrupt("return");case 5:return deletables=kb.statementsMatching(subject,property,oldValue,doc).concat(kb.statementsMatching(oldValue,labelProperty,null,doc)),insertables=[],_context2.prev=7,_context2.next=10,null===(_kb$updater3=kb.updater)||void 0===_kb$updater3?void 0:_kb$updater3.updateMany(deletables,insertables);case 10:_context2.next=18;break;case 12:return _context2.prev=12,_context2.t0=_context2.catch(7),e2=new Error("Autocomplete form data delete error:"+_context2.t0),callbackFunction(!1,_context2.t0),box.appendChild(widgets.errorMessageBlock(dom,e2,null,_context2.t0)),_context2.abrupt("return");case 18:callbackFunction(!0,"");case 19:case"end":return _context2.stop()}}),_callee2,null,[[7,12]])})))).apply(this,arguments)}if("NamedNode"!==subject.termType)throw new Error("Sorry this field only works on NamedNode subjects (for editable)");var kb=_solidLogic.store,formDoc=form.doc?form.doc():null,box=dom.createElement("div");container&&container.appendChild(box);var lhs=dom.createElement("div");lhs.setAttribute("class","formFieldName"),lhs.setAttribute("style",style.formFieldNameBoxStyle),box.appendChild(lhs);var rhs=dom.createElement("div");rhs.setAttribute("class","formFieldValue"),box.appendChild(rhs);var property=kb.any(form,ns.ui("property"));if(!property)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No property given for autocomplete field: "+form));var labelProperty=kb.any(form,ns.ui("labelProperty"))||ns.schema("name"),dataSource=kb.any(form,ns.ui("dataSource"));if(!dataSource)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No data source given for autocomplete field: "+form));var queryParams={label:kb.anyJS(dataSource,ns.schema("name"),null,dataSource.doc()),logo:kb.any(dataSource,ns.schema("logo"),null,dataSource.doc())},targetClass=kb.any(form,ns.ui("targetClass"),null,form.doc())||kb.any(dataSource,ns.ui("targetClass"),null,dataSource.doc());targetClass&&(queryParams.targetClass=targetClass);queryParams.objectURIBase=kb.any(dataSource,ns.ui("objectURIBase"),null,dataSource.doc())||void 0;var endpoint=kb.anyJS(dataSource,ns.ui("endpoint"),null,dataSource.doc());if(endpoint){if(queryParams.endpoint=endpoint,queryParams.searchByNameQuery=kb.anyJS(dataSource,ns.ui("searchByNameQuery"),null,dataSource.doc()),!queryParams.searchByNameQuery)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No searchByNameQuery given for endpoint data Source: "+form));queryParams.insitituteDetailsQuery=kb.anyJS(dataSource,ns.ui("insitituteDetailsQuery"),null,dataSource.doc())}else{var searchByNameURI=kb.anyJS(dataSource,ns.ui("searchByNameURI"));if(!searchByNameURI)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No searchByNameURI OR sparql endpoint given for dataSource: "+dataSource));queryParams.searchByNameURI=searchByNameURI}var suppressEmptyUneditable=kb.anyJS(form,ns.ui("suppressEmptyUneditable"),null,formDoc),editable=null===(_kb$updater=kb.updater)||void 0===_kb$updater?void 0:_kb$updater.editable(doc.uri),autocompleteOptions={permanent:!0,targetClass:queryParams.targetClass,queryParams};autocompleteOptions.size=kb.anyJS(form,ns.ui("size"),null,formDoc)||void 0;var obj=kb.any(subject,property,void 0,doc);if(obj)autocompleteOptions.currentObject=obj,autocompleteOptions.currentName=kb.any(autocompleteOptions.currentObject,labelProperty,null,doc);else if(obj=kb.any(form,ns.ui("default")))autocompleteOptions.currentObject=obj,autocompleteOptions.currentName=kb.any(autocompleteOptions.currentObject,labelProperty,null,doc);else if(suppressEmptyUneditable&&!editable)return box.style.display="none",box;lhs.appendChild(widgets.fieldLabel(dom,property,form));var barOptions={editable,dbLookup:!0};return(0,_autocompleteBar.renderAutocompleteControl)(dom,subject,barOptions,autocompleteOptions,(function addOneIdAndRefresh(_x,_x2){return _addOneIdAndRefresh.apply(this,arguments)}),(function deleteOne(_x3,_x4){return _deleteOne.apply(this,arguments)})).then((function(control){rhs.appendChild(control)}),(function(err){rhs.appendChild(widgets.errorMessageBlock(dom,"Error rendering autocomplete ".concat(form,": ").concat(err),"#fee",err))})),box};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_autocompleteBar=__webpack_require__("./lib/widgets/forms/autocomplete/autocompleteBar.js"),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}},"./lib/widgets/forms/autocomplete/autocompletePicker.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.renderAutoComplete=function renderAutoComplete(_x,_x2,_x3,_x4){return _renderAutoComplete.apply(this,arguments)},exports.setVisible=setVisible;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_publicData=__webpack_require__("./lib/widgets/forms/autocomplete/publicData.js"),_language=__webpack_require__("./lib/widgets/forms/autocomplete/language.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);iself.name.value?1:other.name.name1;)table.removeChild(table.lastChild)},nameMatch=function _nameMatch(filter,candidate){for(var parts=filter.split(" "),j=0;j{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reverse.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.addDefaults=addDefaults,exports.defaultPreferredLanguages=void 0,exports.filterByLanguage=function filterByLanguage(bindings,languagePrefs){var uris={};bindings.forEach((function(binding){var uri=binding.subject.value;uris[uri]=uris[uri]||[],uris[uri].push(binding)}));var languagePrefs2=languagePrefs||defaultPreferredLanguages;languagePrefs2.reverse();var slimmed=[];for(var u in uris){var sortMe=uris[u].map((function(binding){var lang=binding.name["xml:lang"];return[languagePrefs2.indexOf(lang),binding]}));sortMe.sort(),sortMe.reverse(),slimmed.push(sortMe[0][1])}return debug.log(" Filter by language: ".concat(bindings.length," -> ").concat(slimmed.length)),slimmed},exports.getPreferredLanguages=function getPreferredLanguages(){return _getPreferredLanguages.apply(this,arguments)},exports.getPreferredLanguagesFor=getPreferredLanguagesFor,exports.languageCodeURIBase=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var languageCodeURIBase=exports.languageCodeURIBase="https://www.w3.org/ns/iana/language-code/",defaultPreferredLanguages=exports.defaultPreferredLanguages=["en","fr","de","it","ar"];function addDefaults(array){return array||(array=[]),array.concat(defaultPreferredLanguages.filter((function(code){return!array.includes(code)})))}function getPreferredLanguagesFor(_x){return _getPreferredLanguagesFor.apply(this,arguments)}function _getPreferredLanguagesFor(){return(_getPreferredLanguagesFor=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(person){var _store$fetcher,doc,list,languageCodeArray;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return doc=person.doc(),_context.next=3,null===(_store$fetcher=_solidLogic.store.fetcher)||void 0===_store$fetcher?void 0:_store$fetcher.load(doc);case 3:if(list=_solidLogic.store.any(person,ns.schema("knowsLanguage"),null,doc)){_context.next=6;break}return _context.abrupt("return",defaultPreferredLanguages);case 6:if(languageCodeArray=[],list.elements.forEach((function(item){var lang=_solidLogic.store.any(item,ns.solid("publicId"),null,doc);if(lang)if(lang.value.startsWith(languageCodeURIBase)){var code=lang.value.slice(languageCodeURIBase.length);languageCodeArray.push(code)}else console.error("What should be a language code ".concat(lang.value," does not start with ").concat(languageCodeURIBase));else console.warn("getPreferredLanguages: No publiID of language.")})),!(languageCodeArray.length>0)){_context.next=11;break}return console.log(' User knows languages with codes: "'.concat(languageCodeArray.join(","),'"')),_context.abrupt("return",addDefaults(languageCodeArray));case 11:return _context.abrupt("return",null);case 12:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}function _getPreferredLanguages(){return(_getPreferredLanguages=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(){var me,solidLanguagePrefs;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,_solidLogic.authn.currentUser();case 2:if(!(me=_context2.sent)){_context2.next=9;break}return _context2.next=6,getPreferredLanguagesFor(me);case 6:if(!(solidLanguagePrefs=_context2.sent)){_context2.next=9;break}return _context2.abrupt("return",solidLanguagePrefs);case 9:if("undefined"==typeof navigator){_context2.next=14;break}if(!navigator.languages){_context2.next=12;break}return _context2.abrupt("return",addDefaults(navigator.languages.map((function(longForm){return longForm.split("-")[0]}))));case 12:if(!navigator.language){_context2.next=14;break}return _context2.abrupt("return",addDefaults([navigator.language.split("-")[0]]));case 14:return _context2.abrupt("return",defaultPreferredLanguages);case 15:case"end":return _context2.stop()}}),_callee2)})))).apply(this,arguments)}},"./lib/widgets/forms/autocomplete/publicData.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.set.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/web.url.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AUTOCOMPLETE_LIMIT=void 0,exports.ESCOResultToBindings=ESCOResultToBindings,exports.bindingToTerm=function bindingToTerm(item){var typ=item.type.toLowerCase();if("uri"===typ||"iri"===typ)return _solidLogic.store.sym(item.value);if("literal"===typ)return item["xml:lang"]?new _rdflib.Literal(item.value,item["xml:lang"]):new _rdflib.Literal(item.value);throw new Error('bindingToTerm: Unexpected type "'.concat(item.type,'" in sparql binding}'))},exports.fetcherOptionsJsonPublicData=exports.escoParameters=exports.dbpediaParameters=exports.dbPediaTypeMap=void 0,exports.getDbpediaDetails=getDbpediaDetails,exports.getWikidataDetails=getWikidataDetails,exports.getWikidataDetailsOld=function getWikidataDetailsOld(_x19,_x20,_x21){return _getWikidataDetailsOld.apply(this,arguments)},exports.getWikidataLocation=function getWikidataLocation(_x22,_x23,_x24){return _getWikidataLocation.apply(this,arguments)},exports.instituteDetailsWikidataQuery=void 0,exports.loadFromBindings=loadFromBindings,exports.loadPublicDataThing=function loadPublicDataThing(_x13,_x14,_x15){return _loadPublicDataThing.apply(this,arguments)},exports.queryESCODataByName=function queryESCODataByName(_x,_x2,_x3){return _queryESCODataByName.apply(this,arguments)},exports.queryPublicDataByName=function queryPublicDataByName(_x4,_x5,_x6,_x7){return _queryPublicDataByName.apply(this,arguments)},exports.queryPublicDataConstruct=queryPublicDataConstruct,exports.queryPublicDataSelect=queryPublicDataSelect,exports.wikidataParameters=exports.wikidataOutgoingClassMap=exports.wikidataIncomingClassMap=exports.wikidataClasses=exports.variableNameToPredicateMap=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_language=__webpack_require__("./lib/widgets/forms/autocomplete/language.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var AUTOCOMPLETE_LIMIT=exports.AUTOCOMPLETE_LIMIT=200,subjectRegexp=/\$\(subject\)/g,instituteDetailsWikidataQuery=(exports.wikidataClasses={Corporation:"http://www.wikidata.org/entity/Q6881511",EducationalOrganization:"http://www.wikidata.org/entity/Q178706",GovernmentOrganization:"http://www.wikidata.org/entity/Q327333",MedicalOrganization:"http://www.wikidata.org/entity/Q4287745",MusicGroup:"http://www.wikidata.org/entity/Q32178211",NGO:"http://www.wikidata.org/entity/Q163740",Occupation:"http://www.wikidata.org/entity/Q28640",Project:"http://www.wikidata.org/entity/Q170584",ResearchOrganization:"http://www.wikidata.org/entity/Q31855",SportsOrganization:"http://www.wikidata.org/entity/Q4438121"},exports.instituteDetailsWikidataQuery='prefix vcard: \nCONSTRUCT\n{ wd:Q49108 vcard:fn ?itemLabel.\nwd:Q49108 rdf:type ?klass. ?klass rdfs:label ?klassLabel; rdfs:comment ?klassDescription .\nwd:Q49108 schema:logo ?logo;\n schema:image ?image;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary rdfs:label ?subsidiaryLabel .\n ?supersidiary schema:subOrganization wd:Q49108 .\n ?supersidiary rdfs:label ?supersidiaryLabel .\n wd:Q49108 schema:location ?location .\n ?location schema:elevation ?elevation .\n ?location wdt:P131 ?region . ?region rdfs:label ?regionLabel .\n ?location wdt:P625 ?coordinates .\n ?location schema:country ?country . ?country rdfs:label ?countryLabel .\n}\nWHERE\n{ optional {wd:Q49108 rdfs:label ?itemLabel} .\n optional {wd:Q49108 wdt:P154 ?logo .}\n optional {wd:Q49108 wdt:P31 ?klass .}\n optional {wd:Q49108 wdt:P158 ?sealImage .}\n optional {wd:Q49108 wdt:P18 ?image .}\n\n optional { wd:Q49108 wdt:P355 ?subsidiary . }\n optional { ?supersidiary wdt:P355 wd:Q49108. }\n\n optional { wd:Q49108 wdt:P276 ?location .\n\n optional { ?location schema:eleveation ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\n optional { ?location wdt:P17 ?country }\n }\n SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it". }\n}'),fetcherOptionsJsonPublicData=exports.fetcherOptionsJsonPublicData={credentials:"omit",headers:new Headers({Accept:"application/json"})},dbpediaParameters=(exports.escoParameters={label:"ESCO",logo:_solidLogic.store.sym("https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif"),searchByNameURI:"https://ec.europa.eu/esco/api/search?language=$(language)&type=occupation&text=$(name)"},exports.dbpediaParameters={label:"DBPedia",logo:_solidLogic.store.sym("https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/DBpediaLogo.svg/263px-DBpediaLogo.svg.png"),searchByNameQuery:'select distinct ?subject, ?name where {\n ?subject a $(targetClass); rdfs:label ?name\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit)',endpoint:"https://dbpedia.org/sparql/"}),wikidataParameters=(exports.dbPediaTypeMap={AcademicInsitution:"http://umbel.org/umbel/rc/EducationalOrganization"},exports.wikidataOutgoingClassMap={AcademicInsitution:"http://www.wikidata.org/entity/Q4671277",Enterprise:"http://www.wikidata.org/entity/Q6881511",Business:"http://www.wikidata.org/entity/Q4830453",NGO:"http://www.wikidata.org/entity/Q79913",CharitableOrganization:"http://www.wikidata.org/entity/Q708676",Insitute:"http://www.wikidata.org/entity/Q1664720"},exports.wikidataParameters={label:"WikiData",limit:3e3,logo:_solidLogic.store.sym("https://www.wikimedia.org/static/images/project-logos/wikidatawiki.png"),endpoint:"https://query.wikidata.org/sparql",searchByNameQuery:'SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit) ',insitituteDetailsQuery:'CONSTRUCT\n{ wd:Q49108 schema:name ?itemLabel;\n schema:logo ?logo;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary schema:name ?subsidiaryLabel .\n}\nWHERE\n{\n wd:Q49108 # rdfs:label ?itemLabel ;\n wdt:P154 ?logo;\n wdt:P158 ?sealImage ;\n wdt:P355 ?subsidiary .\n # ?subsidiary rdfs:label ?subsidiaryLabel .\n\n SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], fr". }\n}'}),wikidataIncomingClassMap=exports.wikidataIncomingClassMap={"http://www.wikidata.org/entity/Q15936437":ns.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q1664720":ns.schema("EducationalOrganization"),"http://www.wikidata.org/entity/Q43229":ns.schema("Organization"),"http://www.wikidata.org/entity/Q3918":ns.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q170584":ns.schema("Project"),"http://www.wikidata.org/entity/Q327333":ns.schema("GovernmentOrganization"),"http://www.wikidata.org/entity/Q2221906":ns.schema("Place"),"http://www.wikidata.org/entity/Q167037":ns.schema("Corporation")},variableNameToPredicateMap=exports.variableNameToPredicateMap={targetClass:ns.rdf("type"),sealImage:ns.schema("logo"),shortName:ns.foaf("nick"),subsidiary:ns.schema("subOrganization"),city:ns.vcard("locality"),state:ns.vcard("region"),country:ns.vcard("country-name"),homepage:ns.foaf("homepage"),lat:ns.schema("latitude"),long:ns.schema("longitude")};function loadFromBindings(kb,solidSubject,bindings,doc){var predMap=arguments.length>4&&void 0!==arguments[4]?arguments[4]:variableNameToPredicateMap,results={};debug.log("loadFromBindings: subject: ".concat(solidSubject)),debug.log(" doc: ".concat(doc)),bindings.forEach((function(binding){for(var key in binding){var result=binding[key],combined=JSON.stringify(result);results[key]=results[key]||new Set,results[key].add(combined)}}));var _loop=function _loop(key){var values=results[key];debug.log(" results ".concat(key," -> ").concat(values)),values.forEach((function(combined){var obj,result=JSON.parse(combined),type=result.type,value=result.value;if("uri"===type)obj=kb.sym(value);else{if("literal"!==type)throw new Error("loadFromBindings: unexpected type: ".concat(type));obj=new _rdflib.Literal(value,result.language,result.datatype)}if("type"===key)wikidataIncomingClassMap[value]?obj=wikidataIncomingClassMap[value]:debug.warn("Unmapped Wikidata Class: "+value);else if("coordinates"===key){debug.log(" @@@ hey a point: "+value);var match=/.*\(([-0-9.-]*) ([-0-9.-]*)\)/.exec(value);if(match){var _float=ns.xsd("float"),latitude=new _rdflib.Literal(match[1],null,_float),longitude=new _rdflib.Literal(match[2],null,_float);kb.add(solidSubject,ns.schema("longitude"),longitude,doc),kb.add(solidSubject,ns.schema("latitude"),latitude,doc)}else debug.log("Bad coordinates syntax: "+value)}else{var pred=predMap[key]||ns.schema(key);kb.add(solidSubject,pred,obj,doc),debug.log(" public data ".concat(pred," ").concat(obj,"."))}}))};for(var key in results)_loop(key)}function ESCOResultToBindings(json){return json._embedded.results.map((function(result){return{name:{value:result.title,type:"literal"},subject:{type:"IRI",value:result.uri}}}))}function _queryESCODataByName(){return(_queryESCODataByName=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(filter,theClass,queryTarget){var _store$fetcher,limit,queryURI,response,text,json;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(queryTarget.searchByNameURI){_context.next=2;break}throw new Error("Missing queryTarget.searchByNameURI on queryESCODataByName");case 2:return limit=queryTarget.limit||AUTOCOMPLETE_LIMIT,queryURI=queryTarget.searchByNameURI.replace("$(name)",filter).replace("$(limit)",""+limit).replace("$(targetClass)",theClass.toNT()),debug.log("Querying ESCO data - uri: "+queryURI),_context.next=7,null===(_store$fetcher=_solidLogic.store.fetcher)||void 0===_store$fetcher?void 0:_store$fetcher.webOperation("GET",queryURI,fetcherOptionsJsonPublicData);case 7:if(response=_context.sent,text=(null==response?void 0:response.responseText)||"",debug.log(" Query result text"+text.slice(0,500)+"..."),0!==text.length){_context.next=12;break}throw new Error("Wot no text back from ESCO query "+queryURI);case 12:return json=JSON.parse(text),debug.log(" ESCO Query result JSON"+JSON.stringify(json,null,4).slice(0,500)+"..."),_context.abrupt("return",ESCOResultToBindings(json));case 15:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}function fixWikidataJSON(str){var syntaxProblem=str.indexOf("SPARQL-QUERY");if(syntaxProblem<0)return str;debug.warn(" ### Fixing JSON with wikidata error code injection "+str.slice(syntaxProblem,syntaxProblem+200));var goodness=str.lastIndexOf("}, {");return str.slice(0,goodness)+" } ] } } "}function _queryPublicDataByName(){return(_queryPublicDataByName=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(filter,theClass,languages,queryTarget){var substituteStrings,languagePrefs,language,sparql,queryURI,response,_store$fetcher2,text,text2,json,bindings;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(substituteStrings=function _substituteStrings(template){var limit=queryTarget.limit||AUTOCOMPLETE_LIMIT;return template.replace("$(name)",filter).replace("$(limit)",""+limit).replace("$(language)",language).replace("$(targetClass)",theClass.toNT())},theClass){_context2.next=3;break}throw new Error("queryPublicDataByName: No class provided");case 3:return _context2.next=5,(0,_language.getPreferredLanguages)();case 5:if(_context2.t0=_context2.sent,_context2.t0){_context2.next=8;break}_context2.t0=_language.defaultPreferredLanguages;case 8:if(languagePrefs=_context2.t0,language=languagePrefs[0]||"en",!queryTarget.searchByNameQuery){_context2.next=16;break}return sparql=substituteStrings(queryTarget.searchByNameQuery),debug.log("Querying public data - sparql: "+sparql),_context2.abrupt("return",queryPublicDataSelect(sparql,queryTarget));case 16:if(!queryTarget.searchByNameURI){_context2.next=46;break}return queryURI=substituteStrings(queryTarget.searchByNameURI),_context2.prev=18,_context2.next=21,null===(_store$fetcher2=_solidLogic.store.fetcher)||void 0===_store$fetcher2?void 0:_store$fetcher2.webOperation("GET",queryURI,fetcherOptionsJsonPublicData);case 21:response=_context2.sent,_context2.next=27;break;case 24:throw _context2.prev=24,_context2.t1=_context2.catch(18),new Error("Exception when trying to fetch ".concat(queryURI," \n ").concat(_context2.t1));case 27:if(text=response.responseText||"",200===response.status){_context2.next=30;break}throw new Error("HTTP error status ".concat(response.status," trying to fetch ").concat(queryURI," "));case 30:if(debug.log(" Query result text"+text.slice(0,500)+"..."),0!==text.length){_context2.next=33;break}throw new Error("queryPublicDataByName: No text back from public data query "+queryURI);case 33:if(text2=fixWikidataJSON(text),json=JSON.parse(text2),debug.log(" API Query result JSON"+JSON.stringify(json,null,4).slice(0,500)+"..."),!json._embedded){_context2.next=42;break}return debug.log(" Looks like ESCO"),bindings=ESCOResultToBindings(json),_context2.abrupt("return",bindings);case 42:throw alert("Code me: unrecognized API return format"),new Error("*** Need to add code to parse unrecognized API JSON return\n".concat(JSON.stringify(json,null,4)));case 44:_context2.next=47;break;case 46:throw new Error("Query source must have either rest API or SPARQL endpoint.");case 47:case"end":return _context2.stop()}}),_callee2,null,[[18,24]])})))).apply(this,arguments)}function queryPublicDataSelect(_x8,_x9){return _queryPublicDataSelect.apply(this,arguments)}function _queryPublicDataSelect(){return(_queryPublicDataSelect=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(sparql,queryTarget){var _store$fetcher3,myUrlWithParams,queryURI,headers,options,response,text,text2,json,bindings;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(queryTarget.endpoint){_context3.next=2;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataSelect");case 2:return(myUrlWithParams=new URL(queryTarget.endpoint)).searchParams.append("query",sparql),queryURI=myUrlWithParams.href,debug.log(" queryPublicDataSelect uri: "+queryURI),(headers=new Headers).append("Accept","application/json"),options={credentials:"omit",headers},_context3.next=11,null===(_store$fetcher3=_solidLogic.store.fetcher)||void 0===_store$fetcher3?void 0:_store$fetcher3.webOperation("GET",queryURI,options);case 11:if(response=_context3.sent,0!==(text=(null==response?void 0:response.responseText)||"").length){_context3.next=15;break}throw new Error("No text back from query "+queryURI);case 15:return text2=fixWikidataJSON(text),json=JSON.parse(text2),debug.log(" Query result JSON"+JSON.stringify(json,null,4).slice(0,100)+"..."),bindings=json.results.bindings,_context3.abrupt("return",bindings);case 20:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}function queryPublicDataConstruct(_x10,_x11,_x12){return _queryPublicDataConstruct.apply(this,arguments)}function _queryPublicDataConstruct(){return(_queryPublicDataConstruct=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(sparql,pubicId,queryTarget){var _store$fetcher4,myUrlWithParams,queryURI,headers,options,response,text,report;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:if(debug.log("queryPublicDataConstruct: sparql:",sparql),queryTarget.endpoint){_context4.next=3;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataConstruct");case 3:return(myUrlWithParams=new URL(queryTarget.endpoint)).searchParams.append("query",sparql),queryURI=myUrlWithParams.href,debug.log(" queryPublicDataConstruct uri: "+queryURI),(headers=new Headers).append("Accept","text/turtle"),options={credentials:"omit",headers},_context4.next=12,null===(_store$fetcher4=_solidLogic.store.fetcher)||void 0===_store$fetcher4?void 0:_store$fetcher4.webOperation("GET",queryURI,options);case 12:if(response=_context4.sent,text=(null==response?void 0:response.responseText)||"No response text?",report=text.length>500?text.slice(0,200)+" ... "+text.slice(-200):text,debug.log(" queryPublicDataConstruct result text:"+report),0!==text.length){_context4.next=18;break}throw new Error("queryPublicDataConstruct: No text back from construct query:"+queryURI);case 18:(0,_rdflib.parse)(text,_solidLogic.store,pubicId.uri,"text/turtle");case 19:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}function _loadPublicDataThing(){return(_loadPublicDataThing=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(kb,subject,publicDataID){var iDToFetch,headers;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:if(!publicDataID.uri.startsWith("https://dbpedia.org/resource/")){_context5.next=4;break}return _context5.abrupt("return",getDbpediaDetails(kb,subject,publicDataID));case 4:if(!publicDataID.uri.match(/^https?:\/\/www\.wikidata\.org\/entity\/.*/)){_context5.next=9;break}return _context5.next=7,getWikidataDetails(kb,subject,publicDataID);case 7:_context5.next=13;break;case 9:return iDToFetch=publicDataID.uri.startsWith("http:")?kb.sym("https:"+publicDataID.uri.slice(5)):publicDataID,(headers=new Headers).append("Accept","text/turtle"),_context5.abrupt("return",kb.fetcher.load(iDToFetch,{credentials:"omit",headers}));case 13:case"end":return _context5.stop()}}),_callee5)})))).apply(this,arguments)}function getWikidataDetails(_x16,_x17,_x18){return _getWikidataDetails.apply(this,arguments)}function _getWikidataDetails(){return(_getWikidataDetails=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee6(kb,solidSubject,publicDataID){var subjRegexp,sparql;return _regenerator.default.wrap((function _callee6$(_context6){for(;;)switch(_context6.prev=_context6.next){case 0:return subjRegexp=/wd:Q49108/g,sparql=instituteDetailsWikidataQuery.replace(subjRegexp,publicDataID.toNT()),_context6.next=4,queryPublicDataConstruct(sparql,publicDataID,wikidataParameters);case 4:debug.log("getWikidataDetails: loaded.",publicDataID);case 5:case"end":return _context6.stop()}}),_callee6)})))).apply(this,arguments)}function _getWikidataDetailsOld(){return(_getWikidataDetailsOld=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee7(kb,solidSubject,publicDataID){var sparql,bindings;return _regenerator.default.wrap((function _callee7$(_context7){for(;;)switch(_context7.prev=_context7.next){case 0:return sparql='select distinct * where {\n optional { $(subject) wdt:P31 ?targetClass } # instance of\n optional { $(subject) wdt:P154 ?logo }\n optional { $(subject) wdt:P158 ?sealImage }\n# optional { $(subject) wdt:P159 ?headquartersLocation }\n\noptional { $(subject) wdt:P17 ?country }\noptional { $(subject) wdt:P18 ?image }\noptional { $(subject) wdt:P1813 ?shortName }\n\noptional { $(subject) wdt:P355 ?subsidiary }\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(subjectRegexp,publicDataID.toNT()),_context7.next=3,queryPublicDataSelect(sparql,wikidataParameters);case 3:bindings=_context7.sent,loadFromBindings(kb,publicDataID,bindings,publicDataID.doc());case 5:case"end":return _context7.stop()}}),_callee7)})))).apply(this,arguments)}function _getWikidataLocation(){return(_getWikidataLocation=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee8(kb,solidSubject,publicDataID){var sparql,bindings;return _regenerator.default.wrap((function _callee8$(_context8){for(;;)switch(_context8.prev=_context8.next){case 0:return sparql='select distinct * where {\n\n $(subject) wdt:P276 ?location .\n\n optional { ?location wdt:P2044 ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\noptional { ?location wdt:P17 ?country }\n\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(subjectRegexp,publicDataID.toNT()),debug.log(" location query sparql:"+sparql),_context8.next=4,queryPublicDataSelect(sparql,wikidataParameters);case 4:bindings=_context8.sent,debug.log(" location query bindings:",bindings),loadFromBindings(kb,publicDataID,bindings,publicDataID.doc());case 7:case"end":return _context8.stop()}}),_callee8)})))).apply(this,arguments)}function getDbpediaDetails(_x25,_x26,_x27){return _getDbpediaDetails.apply(this,arguments)}function _getDbpediaDetails(){return(_getDbpediaDetails=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee9(kb,solidSubject,publicDataID){var sparql,bindings;return _regenerator.default.wrap((function _callee9$(_context9){for(;;)switch(_context9.prev=_context9.next){case 0:return sparql="select distinct ?city, ?state, ?country, ?homepage, ?logo, ?lat, ?long, WHERE {\n OPTIONAL { <".concat(publicDataID,"> ?city }\n OPTIONAL { ").concat(publicDataID," ?state }\n OPTIONAL { ").concat(publicDataID," ?country }\n OPTIONAL { ").concat(publicDataID," foaf:homepage ?homepage }\n OPTIONAL { ").concat(publicDataID," foaf:lat ?lat; foaf:long ?long }\n OPTIONAL { ").concat(publicDataID," ?country }\n }"),_context9.next=3,queryPublicDataSelect(sparql,dbpediaParameters);case 3:bindings=_context9.sent,loadFromBindings(kb,publicDataID,bindings,publicDataID.doc()),debug.log("Finished getDbpediaDetails.");case 6:case"end":return _context9.stop()}}),_callee9)})))).apply(this,arguments)}},"./lib/widgets/forms/basic.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.basicField=function basicField(dom,container,already,subject,form,doc,callbackFunction){var kb=store,formDoc=form.doc?form.doc():null,box=dom.createElement("div"),property=kb.any(form,ns.ui("property"));container&&container.appendChild(box);if(!property)return box.appendChild((0,_error.errorMessageBlock)(dom,"Error: No property given for text field: "+form));var rhs=renderNameValuePair(dom,kb,box,form),suppressEmptyUneditable=kb.anyJS(form,ns.ui("suppressEmptyUneditable"),null,formDoc),uri=(0,_fieldFunction.mostSpecificClassURI)(form),params=_fieldParams.fieldParams[uri];void 0===params&&(params={style:""});var paramStyle=params.style||"",style=_style.textInputStyle+paramStyle,field=dom.createElement("input");field.style=style,rhs.appendChild(field),field.setAttribute("type",params.type?params.type:"text");var size=kb.anyJS(form,ns.ui("size"))||_style.textInputSize||20;field.setAttribute("size",size);var maxLength=kb.any(form,ns.ui("maxLength"));field.setAttribute("maxLength",maxLength?""+maxLength:"4096"),doc=doc||fieldStore(subject,property,doc);var obj=kb.any(subject,property,void 0,doc);obj||(obj=kb.any(form,ns.ui("default")));obj&&obj.value&¶ms.uriPrefix?field.value=decodeURIComponent(obj.value.replace(params.uriPrefix,"")).replace(/ /g,""):obj&&(field.value=obj.value||obj.value||"");if(field.setAttribute("style",style),!kb.updater)throw new Error("kb has no updater");if(!kb.updater.editable(doc.uri))return field.readOnly=!0,field.style=_style.textInputStyleUneditable+paramStyle,suppressEmptyUneditable&&""===field.value&&(box.style.display="none"),box;return field.addEventListener("keyup",(function(_e){params.pattern&&field.setAttribute("style",style+(field.value.match(params.pattern)?"color: green;":"color: red;"))}),!0),field.addEventListener("change",(function(_e){if(!params.pattern||field.value.match(params.pattern)){field.disabled=!0,field.setAttribute("style",style+"color: gray;");var result,ds=kb.statementsMatching(subject,property);params.namedNode?result=kb.sym(field.value):params.uriPrefix?(result=encodeURIComponent(field.value.replace(/ /g,"")),result=kb.sym(params.uriPrefix+field.value)):result=params.dt?new _rdflib.Literal(field.value.trim(),void 0,ns.xsd(params.dt)):new _rdflib.Literal(field.value);var is=ds.map((function(statement){return(0,_rdflib.st)(statement.subject,statement.predicate,result,statement.why)}));0===is.length&&(is=[(0,_rdflib.st)(subject,property,result,doc)]),function updateMany(ds,is,callback){var docs=[];if(is.forEach((function(st){docs.includes(st.why.uri)||docs.push(st.why.uri)})),ds.forEach((function(st){docs.includes(st.why.uri)||docs.push(st.why.uri)})),0===docs.length)throw new Error("updateMany has no docs to patch");if(!kb.updater)throw new Error("kb has no updater");if(1===docs.length)return kb.updater.update(ds,is,callback);var doc=docs.pop(),is1=is.filter((function(st){return st.why.uri===doc})),is2=is.filter((function(st){return st.why.uri!==doc})),ds1=ds.filter((function(st){return st.why.uri===doc})),ds2=ds.filter((function(st){return st.why.uri!==doc}));kb.updater.update(ds1,is1,(function(uri,ok,body){ok?updateMany(ds2,is2,callback):callback(uri,ok,body)}))}(ds,is,(function(uri,ok,body){ok?(field.disabled=!1,field.setAttribute("style",style)):box.appendChild((0,_error.errorMessageBlock)(dom,body)),callbackFunction(ok,body)}))}}),!0),box},exports.fieldLabel=fieldLabel,exports.fieldStore=fieldStore,exports.renderNameValuePair=renderNameValuePair;var _rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_style=__webpack_require__("./lib/style.js"),_utils=__webpack_require__("./lib/utils/index.js"),_error=__webpack_require__("./lib/widgets/error.js"),_fieldFunction=__webpack_require__("./lib/widgets/forms/fieldFunction.js"),_fieldParams=__webpack_require__("./lib/widgets/forms/fieldParams.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}var store=_solidLogic.solidLogicSingleton.store;function renderNameValuePair(dom,kb,box,form,label){box.style.display="flex",box.style.flexDirection="row";var lhs=box.appendChild(dom.createElement("div"));lhs.style.width=_style.formFieldNameBoxWidth;var rhs=box.appendChild(dom.createElement("div"));return lhs.setAttribute("class","formFieldName"),lhs.setAttribute("style",_style.formFieldNameBoxStyle),rhs.setAttribute("class","formFieldValue"),label?lhs.appendChild(dom.createTextNode(label)):kb.any(form,ns.ui("property"))?lhs.appendChild(fieldLabel(dom,kb.any(form,ns.ui("property")),form)):(rhs.appendChild((0,_error.errorMessageBlock)(dom,"No property or label given for form field: "+form)),lhs.appendChild(dom.createTextNode("???"))),rhs}function fieldLabel(dom,property,fieldInQuestion){var lab=store.any(fieldInQuestion,ns.ui("label"));if(lab||(lab=(0,_utils.label)(property,!0)),void 0===property)return dom.createTextNode("@@Internal error: undefined property");var anchor=dom.createElement("a");return property.uri&&anchor.setAttribute("href",property.uri),anchor.setAttribute("style","color: #3B5998; text-decoration: none;"),anchor.textContent=lab,anchor}function fieldStore(subject,predicate,def){var sts=store.statementsMatching(subject,predicate);if(0===sts.length)return def;if(!store.updater)throw new Error("Store has no updater");return sts.length>0&&sts[0].why.value&&store.updater.editable(sts[0].why.value,store)?store.sym(sts[0].why.value):def}},"./lib/widgets/forms/fieldFunction.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.field=void 0,exports.fieldFunction=function fieldFunction(dom,fieldInQuestion){var uri=mostSpecificClassURI(fieldInQuestion),fun=field[uri];if((0,_log.debug)("paneUtils: Going to implement field "+fieldInQuestion+" of type "+uri),!fun)return function(dom2,container){var box=(0,_error.errorMessageBlock)(dom2,"No handler for field "+fieldInQuestion+" of type "+uri);return container&&container.appendChild(box),box};return fun},exports.mostSpecificClassURI=mostSpecificClassURI;var _solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_log=__webpack_require__("./lib/log.js"),_error=__webpack_require__("./lib/widgets/error.js"),store=_solidLogic.solidLogicSingleton.store,field=exports.field={};function mostSpecificClassURI(x){var kb=store,ft=kb.findTypeURIs(x),bot=kb.bottomTypeURIs(ft),bots=[];for(var b in bot)bots.push(b);return bots[0]}},"./lib/widgets/forms/fieldParams.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.fieldParams=void 0;var _fieldParams,_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_style=__webpack_require__("./lib/style.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}exports.fieldParams=(_fieldParams={},(0,_defineProperty2.default)(_fieldParams,ns.ui("ColorField").uri,{size:9,type:"color",style:"height: 3em;",dt:"color",pattern:/^\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("DateField").uri,{size:20,type:"date",dt:"date",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("DateTimeField").uri,{size:20,type:"datetime-local",dt:"dateTime",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("TimeField").uri,{size:10,type:"time",dt:"time",pattern:/^\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("IntegerField").uri,{size:12,style:"text-align: right;",dt:"integer",pattern:/^\s*-?[0-9]+\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("DecimalField").uri,{size:12,style:"text-align: right;",dt:"decimal",pattern:/^\s*-?[0-9]*(\.[0-9]*)?\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("FloatField").uri,{size:12,style:"text-align: right;",dt:"float",pattern:/^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("SingleLineTextField").uri,{}),(0,_defineProperty2.default)(_fieldParams,ns.ui("NamedNodeURIField").uri,{namedNode:!0}),(0,_defineProperty2.default)(_fieldParams,ns.ui("TextField").uri,{}),(0,_defineProperty2.default)(_fieldParams,ns.ui("PhoneField").uri,{size:20,uriPrefix:"tel:",pattern:/^\+?[\d-]+[\d]*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("EmailField").uri,{size:30,uriPrefix:"mailto:",pattern:/^\s*.*@.*\..*\s*$/}),(0,_defineProperty2.default)(_fieldParams,ns.ui("Group").uri,{style:_style.formGroupStyle}),(0,_defineProperty2.default)(_fieldParams,ns.ui("Comment").uri,{element:"p",style:_style.commentStyle}),(0,_defineProperty2.default)(_fieldParams,ns.ui("Heading").uri,{element:"h3",style:_style.formHeadingStyle}),_fieldParams)},"./lib/widgets/forms/formStyle.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.setFieldStyle=function setFieldStyle(ele,field){var classUri=(0,_fieldFunction.mostSpecificClassURI)(field),params=_fieldParams.fieldParams[classUri]||{},style=_solidLogic.store.any(field,ns.ui("style"));if(!style)return void(params.style&&ele.setAttribute("style",params.style));if("Literal"===style.termType)style&&ele.setAttribute("style",style.value);else{_solidLogic.store.statementsMatching(style,null,null,field.doc()).forEach((function(st){if(st.predicate.uri&&st.predicate.uri.startsWith("https://www.w3.org/ns/css#")){var cssAttribute=st.predicate.uri.slice("https://www.w3.org/ns/css#".length);try{ele.style[cssAttribute]=st.object.value}catch(err){console.warn("setFieldStyle: Error setting element style ".concat(cssAttribute,' to "').concat(st.object.value,'"')),console.warn('setFieldStyle: ... Element tagName was "'.concat(ele.tagName||"???",'"'))}}}))}};var ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_fieldParams=__webpack_require__("./lib/widgets/forms/fieldParams.js"),_fieldFunction=__webpack_require__("./lib/widgets/forms/fieldFunction.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}},"./lib/widgets/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={publicData:!0};exports.publicData=void 0;var _peoplePicker=__webpack_require__("./lib/widgets/peoplePicker.js");Object.keys(_peoplePicker).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_peoplePicker[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _peoplePicker[key]}}))}));var _dragAndDrop=__webpack_require__("./lib/widgets/dragAndDrop.js");Object.keys(_dragAndDrop).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_dragAndDrop[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _dragAndDrop[key]}}))}));var _buttons=__webpack_require__("./lib/widgets/buttons.js");Object.keys(_buttons).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_buttons[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _buttons[key]}}))}));var _iconLinks=__webpack_require__("./lib/widgets/buttons/iconLinks.js");Object.keys(_iconLinks).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_iconLinks[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _iconLinks[key]}}))}));var _error=__webpack_require__("./lib/widgets/error.js");Object.keys(_error).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_error[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _error[key]}}))}));var _forms=__webpack_require__("./lib/widgets/forms.js");Object.keys(_forms).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_forms[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _forms[key]}}))}));var _autocompleteBar=__webpack_require__("./lib/widgets/forms/autocomplete/autocompleteBar.js");Object.keys(_autocompleteBar).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_autocompleteBar[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _autocompleteBar[key]}}))}));var _autocompletePicker=__webpack_require__("./lib/widgets/forms/autocomplete/autocompletePicker.js");Object.keys(_autocompletePicker).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_autocompletePicker[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _autocompletePicker[key]}}))}));var _publicData=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&&Object.prototype.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}(__webpack_require__("./lib/widgets/forms/autocomplete/publicData.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}exports.publicData=_publicData},"./lib/widgets/multiSelect.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js"),__webpack_require__("./node_modules/core-js/modules/es.array.some.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.IconicMultiSelect=void 0;var _toConsumableArray2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),style=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&&Object.prototype.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}(__webpack_require__("./lib/style_multiSelect.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}exports.IconicMultiSelect=function(){function IconicMultiSelect(_ref){var data=_ref.data,itemTemplate=_ref.itemTemplate,noData=_ref.noData,noResults=_ref.noResults,placeholder=_ref.placeholder,select=_ref.select,container=_ref.container,tagTemplate=_ref.tagTemplate,textField=_ref.textField,valueField=_ref.valueField;(0,_classCallCheck2.default)(this,IconicMultiSelect),(0,_defineProperty2.default)(this,"_data",void 0),(0,_defineProperty2.default)(this,"_domElements",void 0),(0,_defineProperty2.default)(this,"_event",(function(){})),(0,_defineProperty2.default)(this,"_itemTemplate",void 0),(0,_defineProperty2.default)(this,"_multiselect",void 0),(0,_defineProperty2.default)(this,"_noData",void 0),(0,_defineProperty2.default)(this,"_noResults",void 0),(0,_defineProperty2.default)(this,"_options",[]),(0,_defineProperty2.default)(this,"_placeholder",void 0),(0,_defineProperty2.default)(this,"_select",void 0),(0,_defineProperty2.default)(this,"_selectContainer",void 0),(0,_defineProperty2.default)(this,"_selectedOptions",[]),(0,_defineProperty2.default)(this,"_tagTemplate",void 0),(0,_defineProperty2.default)(this,"_textField",void 0),(0,_defineProperty2.default)(this,"_valueField",void 0),(0,_defineProperty2.default)(this,"_cross",'\n \n \n \n '),this._data=null!=data?data:[],this._itemTemplate=null!=itemTemplate?itemTemplate:null,this._noData=null!=noData?noData:"No data found.",this._noResults=null!=noResults?noResults:"No results found.",this._placeholder=null!=placeholder?placeholder:"Select...",this._select=select,this._selectContainer=container,this._tagTemplate=null!=tagTemplate?tagTemplate:null,this._textField=null!=textField?textField:null,this._valueField=null!=valueField?valueField:null}return(0,_createClass2.default)(IconicMultiSelect,[{key:"init",value:function init(){if(!this._select||"SELECT"!==this._select.nodeName)throw new Error("The selector '".concat(this._select,"' did not select any valid select tag."));if(this._itemTemplate&&0===this._data.length)throw new Error("itemTemplate must be initialized with data from the component settings");if(this._tagTemplate&&0===this._data.length)throw new Error("tagTemplate must be initialized with data from the component settings");this._options=this._data.length>0?this._getDataFromSettings():this._getDataFromSelectTag(),this._renderMultiselect(),this._renderOptionsList(),this._domElements={clear:this._multiselect.querySelector(".multiselect__clear-btn"),input:this._multiselect.querySelector(".multiselect__input"),optionsContainer:this._multiselect.querySelector(".multiselect__options"),optionsContainerList:this._multiselect.querySelector(".multiselect__options > ul"),options:{list:this._multiselect.querySelectorAll(".multiselect__options > ul > li"),find:function find(callbackFn){for(var i=0;i').concat(this._tagTemplate?this._processTemplate(this._tagTemplate,index):option.text,'').concat(this._cross,"");this._domElements.input.insertAdjacentHTML("beforebegin",html),this._multiselect.querySelector('span[data-value="'.concat(option.value,'"]')).lastElementChild.addEventListener("click",(function(){var target=_this._domElements.options.find((function(el){return el.dataset.value===option.value}));_this._handleOption(target)}))}},{key:"_clearSelection",value:function _clearSelection(){for(var _this2=this,_loop=function _loop(){var option=_this2._selectedOptions[i],target=_this2._domElements.options.find((function(el){return el.dataset.value===option.value}));target.classList.remove("multiselect__options--selected"),target.setAttribute("style",style.multiselect__options),_this2._removeOptionFromList(target.dataset.value)},i=0;i0&&_this3._filterOptions(value)})),this._domElements.input.addEventListener("keydown",(function(e){_this3._handleArrows(e),_this3._handleBackspace(e),_this3._handleEnter(e)}))}},{key:"_filterOptions",value:function _filterOptions(value){var _this4=this,isOpen=this._domElements.optionsContainer.classList.contains("visible"),valueLowerCase=value.toLowerCase();if(!isOpen&&value.length>0&&(this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",style.multiselect__options_visible)),this._domElements.options.list.length>0){for(var i=0;i0&&this._valueField&&this._textField){var isValueFieldValid="string"==typeof this._valueField,isTextFieldValid="string"==typeof this._textField,arr=[];if(!isValueFieldValid||!isTextFieldValid)throw new Error("textField and valueField must be of type string");for(var i=0;i ul");if(isOpen){var selected=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected"),action={ArrowUp:"previous",Up:"previous",ArrowDown:"next",Down:"next"};if(!selected)return optionsContainerList.firstElementChild.classList.add("arrow-selected"),optionsContainerList.firstElementChild.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),void optionsContainerList.firstElementChild.scrollIntoView(!1);if(selected.classList.remove("arrow-selected"),selected.setAttribute("style",style.multiselect__options_ul_li),!(selected=selected[action[event.key]+"ElementSibling"]))return(selected=optionsContainerList.children["next"===action[event.key]?0:optionsContainerList.children.length-1]).classList.add("arrow-selected"),selected.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),void this._scrollIntoView(optionsContainerList,selected);selected.classList.add("arrow-selected"),selected.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),this._scrollIntoView(optionsContainerList,selected)}else this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",style.multiselect__options_visible),optionsContainerList.firstElementChild.classList.add("arrow-selected"),optionsContainerList.firstElementChild.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),optionsContainerList.firstElementChild.scrollIntoView(!1)}}},{key:"_handleBackspace",value:function _handleBackspace(e){if(8===e.keyCode&&""===e.target.value){var lastSelectedOption=this._selectedOptions.length>0?this._selectedOptions[this._selectedOptions.length-1]:null;if(lastSelectedOption){var targetLastSelectedOption=this._multiselect.querySelector('li[data-value="'.concat(lastSelectedOption.value,'"]'));this._handleOption(targetLastSelectedOption),0===this._selectedOptions.length&&(this._domElements.optionsContainer.classList.remove("visible"),this._domElements.optionsContainer.setAttribute("style",style.multiselect__options))}}}},{key:"_handleClearSelectionBtn",value:function _handleClearSelectionBtn(){this._selectedOptions.length>0?this._domElements.clear.style.display="flex":this._domElements.clear.style.display="none"}},{key:"_handleEnter",value:function _handleEnter(event){if(13===event.keyCode){var selected=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected");selected&&(this._handleOption(selected),this._closeList())}}},{key:"_handleOption",value:function _handleOption(target){for(var dispatchEvent=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=0;i\n
                                                            \n ').concat(this._options.length>0&&!this._itemTemplate?this._options.map((function(option){return'\n
                                                          • ').concat(option.text,"
                                                          • \n ")})).join(""):"","\n\n ").concat(this._options.length>0&&this._itemTemplate?this._options.map((function(option,index){return'\n
                                                          • ').concat(_this6._processTemplate(_this6._itemTemplate,index),"
                                                          • \n ")})).join(""):"","\n ").concat(this._showNoData(0===this._options.length),"\n
                                                          \n \n ");this._multiselect.insertAdjacentHTML("beforeend",html)}},{key:"_renderMultiselect",value:function _renderMultiselect(){this._select.style.display="none";var id="iconic-"+this._generateId(20);this._multiselect=document.createElement("div"),this._multiselect.setAttribute("id",id),this._multiselect.setAttribute("class","multiselect__container"),this._multiselect.setAttribute("style",style.multiselect__container);var html='\n
                                                          \n \n
                                                          \n \n ");this._multiselect.innerHTML=html,this._selectContainer.appendChild(this._multiselect)}},{key:"_scrollIntoView",value:function _scrollIntoView(parent,child){var rectParent=parent.getBoundingClientRect(),rectChild=child.getBoundingClientRect();rectParent.toprectChild.top+child.offsetHeight||(parent.scrollTop=child.clientHeight+(child.offsetTop-child.offsetHeight)-(parent.offsetHeight-(child.offsetHeight+(child.offsetHeight-child.clientHeight))))}},{key:"_showNoData",value:function _showNoData(condition){return condition?'

                                                          ').concat(this._noData,"

                                                          "):""}},{key:"_showNoResults",value:function _showNoResults(condition){var dom=this._multiselect.querySelector(".multiselect__options--no-results");if(condition){var html='

                                                          ').concat(this._noResults,"

                                                          ");!dom&&this._domElements.optionsContainerList.insertAdjacentHTML("beforeend",html)}else dom&&dom.parentNode&&dom.parentNode.removeChild(dom)}}]),IconicMultiSelect}()},"./lib/widgets/peoplePicker.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.Person=exports.PeoplePicker=exports.GroupPicker=exports.GroupBuilder=exports.Group=void 0;var _templateObject,_taggedTemplateLiteral2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_escapeHtml=_interopRequireDefault(__webpack_require__("./node_modules/escape-html/index.js")),_uuid=_interopRequireDefault(__webpack_require__("./node_modules/uuid/dist/esm-browser/index.js")),rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_dragAndDrop=__webpack_require__("./lib/widgets/dragAndDrop.js"),_error=__webpack_require__("./lib/widgets/error.js"),_iconBase=__webpack_require__("./lib/iconBase.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=__webpack_require__("./node_modules/solid-logic/lib/index.js").solidLogicSingleton.store,GroupPicker=(exports.PeoplePicker=function(){function PeoplePicker(element,typeIndex,groupPickedCb,options){(0,_classCallCheck2.default)(this,PeoplePicker),this.options=options||{},this.element=element,this.typeIndex=typeIndex,this.groupPickedCb=groupPickedCb,this.selectedgroup=this.options.selectedgroup,this.onSelectGroup=this.onSelectGroup.bind(this)}return(0,_createClass2.default)(PeoplePicker,[{key:"render",value:function render(){var _this=this,container=document.createElement("div");if(container.style.maxWidth="350px",container.style.minHeight="200px",container.style.outline="1px solid black",container.style.display="flex",this.selectedgroup){container.style.flexDirection="column";var selectedGroup=document.createElement("div");new Group(selectedGroup,this.selectedgroup).render();var changeGroupButton=document.createElement("button");changeGroupButton.textContent=(0,_escapeHtml.default)("Change group"),changeGroupButton.addEventListener("click",(function(_event){_this.selectedgroup=null,_this.render()})),container.appendChild(selectedGroup),container.appendChild(changeGroupButton)}else this.findAddressBook(this.typeIndex).then((function(_ref){var book=_ref.book,chooseExistingGroupButton=document.createElement("button");chooseExistingGroupButton.textContent=(0,_escapeHtml.default)("Pick an existing group"),chooseExistingGroupButton.style.margin="auto",chooseExistingGroupButton.addEventListener("click",(function(_event){new GroupPicker(container,book,_this.onSelectGroup).render()}));var createNewGroupButton=document.createElement("button");createNewGroupButton.textContent=(0,_escapeHtml.default)("Create a new group"),createNewGroupButton.style.margin="auto",createNewGroupButton.addEventListener("click",(function(_event){_this.createNewGroup(book,_this.options.defaultNewGroupName).then((function(_ref2){var group=_ref2.group;new GroupBuilder(_this.element,book,group,_this.onSelectGroup).render()})).catch((function(errorBody){_this.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("Error creating a new group. (".concat(errorBody,")"))))}))})),container.appendChild(chooseExistingGroupButton),container.appendChild(createNewGroupButton),_this.element.innerHTML="",_this.element.appendChild(container)})).catch((function(err){_this.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("Could find your groups. (".concat(err,")"))))}));return this.element.innerHTML="",this.element.appendChild(container),this}},{key:"findAddressBook",value:function findAddressBook(typeIndex){return new Promise((function(resolve,reject){kb.fetcher.nowOrWhenFetched(typeIndex,(function(ok,err){if(!ok)return reject(err);var bookRegistration=kb.any(null,ns.solid("forClass"),ns.vcard("AddressBook"));if(!bookRegistration)return reject(new Error("no address book registered in the solid type index "+typeIndex));var book=kb.any(bookRegistration,ns.solid("instance"));if(!book)return reject(new Error("incomplete address book registration"));kb.fetcher.load(book).then((function(_xhr){return resolve({book})})).catch((function(err){return reject(new Error("Could not load address book "+err))}))}))}))}},{key:"createNewGroup",value:function createNewGroup(book,defaultNewGroupName){var _indexes=indexes(book),groupIndex=_indexes.groupIndex,groupContainer=_indexes.groupContainer,group=rdf.sym("".concat(groupContainer.uri).concat(_uuid.default.v4().slice(0,8),".ttl#this")),name=defaultNewGroupName||"Untitled Group",patchPromises=[group.doc(),groupIndex].map((function(doc){var typeStatement=rdf.st(group,ns.rdf("type"),ns.vcard("Group"),doc),nameStatement=rdf.st(group,ns.vcard("fn"),name,group.doc(),doc),includesGroupStatement=rdf.st(book,ns.vcard("includesGroup"),group,doc),toIns=doc.equals(groupIndex)?[typeStatement,nameStatement,includesGroupStatement]:[typeStatement,nameStatement];return patch(doc.uri,{toIns}).then((function(){toIns.forEach((function(st){kb.add(st)}))}))}));return Promise.all(patchPromises).then((function(){return{group}})).catch((function(err){throw debug.log("Could not create new group. PATCH failed "+err),new Error("Couldn't create new group. PATCH failed for (".concat(err.xhr?err.xhr.responseURL:""," )"))}))}},{key:"onSelectGroup",value:function onSelectGroup(group){this.selectedgroup=group,this.groupPickedCb(group),this.render()}}]),PeoplePicker}(),exports.GroupPicker=function(){function GroupPicker(element,book,onSelectGroup){(0,_classCallCheck2.default)(this,GroupPicker),this.element=element,this.book=book,this.onSelectGroup=onSelectGroup}return(0,_createClass2.default)(GroupPicker,[{key:"render",value:function render(){var _this2=this;return this.loadGroups().then((function(groups){var container=document.createElement("div");container.style.display="flex",container.style.flexDirection="column",groups.forEach((function(group){var groupButton=document.createElement("button");groupButton.addEventListener("click",_this2.handleClickGroup(group)),new Group(groupButton,group).render(),container.appendChild(groupButton)})),_this2.element.innerHTML="",_this2.element.appendChild(container)})).catch((function(err){_this2.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("There was an error loading your groups. (".concat(err,")"))))})),this}},{key:"loadGroups",value:function loadGroups(){var _this3=this;return new Promise((function(resolve,reject){var groupIndex=indexes(_this3.book).groupIndex;kb.fetcher.nowOrWhenFetched(groupIndex,(function(ok,err){if(!ok)return reject(err);var groups=kb.each(_this3.book,ns.vcard("includesGroup"));return resolve(groups)}))}))}},{key:"handleClickGroup",value:function handleClickGroup(group){var _this4=this;return function(_event){_this4.onSelectGroup(group)}}}]),GroupPicker}()),Group=exports.Group=function(){function Group(element,group){(0,_classCallCheck2.default)(this,Group),this.element=element,this.group=group}return(0,_createClass2.default)(Group,[{key:"render",value:function render(){var container=document.createElement("div");return container.textContent=(0,_escapeHtml.default)(getWithDefault(this.group,ns.vcard("fn"),"[".concat(this.group.value,"]"))),this.element.innerHTML="",this.element.appendChild(container),this}}]),Group}(),GroupBuilder=exports.GroupBuilder=function(){function GroupBuilder(element,book,group,doneBuildingCb,groupChangedCb){(0,_classCallCheck2.default)(this,GroupBuilder),this.element=element,this.book=book,this.group=group,this.onGroupChanged=function(err,changeType,agent){groupChangedCb&&groupChangedCb(err,changeType,agent)},this.groupChangedCb=groupChangedCb,this.doneBuildingCb=doneBuildingCb}return(0,_createClass2.default)(GroupBuilder,[{key:"refresh",value:function refresh(){}},{key:"render",value:function render(){var _this5=this,dropContainer=document.createElement("div");dropContainer.style.maxWidth="350px",dropContainer.style.minHeight="200px",dropContainer.style.outline="1px solid black",dropContainer.style.display="flex",dropContainer.style.flexDirection="column",(0,_dragAndDrop.makeDropTarget)(dropContainer,(function(uris){uris.forEach((function(uri){_this5.add(uri).catch((function(err){_this5.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("Could not add the given WebId. (".concat(err,")"))))}))}))}));var groupNameInput=document.createElement("input");groupNameInput.type="text",groupNameInput.value=getWithDefault(this.group,ns.vcard("fn"),"Untitled Group"),groupNameInput.addEventListener("change",(function(event){_this5.setGroupName(event.target.value).catch((function(err){_this5.element.appendChild((0,_error.errorMessageBlock)(document,"Error changing group name. (".concat(err,")")))}))}));var groupNameLabel=document.createElement("label");if(groupNameLabel.textContent=(0,_escapeHtml.default)("Group Name:"),groupNameLabel.appendChild(groupNameInput),dropContainer.appendChild(groupNameLabel),kb.any(this.group,ns.vcard("hasMember")))kb.match(this.group,ns.vcard("hasMember")).forEach((function(statement){var webIdNode=statement.object,personDiv=document.createElement("div");new Person(personDiv,webIdNode,_this5.handleRemove(webIdNode)).render(),dropContainer.appendChild(personDiv)}));else{var copy=document.createElement("p");copy.textContent=(0,_escapeHtml.default)(_templateObject||(_templateObject=(0,_taggedTemplateLiteral2.default)(["\n To add someone to this group, drag and drop their WebID URL onto the box.\n "]))),dropContainer.appendChild(copy)}var doneBuildingButton=document.createElement("button");return doneBuildingButton.textContent=(0,_escapeHtml.default)("Done"),doneBuildingButton.addEventListener("click",(function(_event){_this5.doneBuildingCb(_this5.group)})),dropContainer.appendChild(doneBuildingButton),this.element.innerHTML="",this.element.appendChild(dropContainer),this}},{key:"add",value:function add(webId){var _this6=this;return new Promise((function(resolve,reject){kb.fetcher.nowOrWhenFetched(webId,(function(ok,err){if(!ok)return _this6.onGroupChanged(err),reject(err);var webIdNode=rdf.namedNode(webId),rdfClass=kb.any(webIdNode,ns.rdf("type"));return rdfClass&&rdfClass.equals(ns.foaf("Person"))?resolve(webIdNode):reject(new Error("Only people supported right now. (tried to add something of type ".concat(rdfClass.value,")")))}))})).then((function(webIdNode){var statement=rdf.st(_this6.group,ns.vcard("hasMember"),webIdNode);return kb.holdsStatement(statement)?webIdNode:patch(_this6.group.doc().uri,{toIns:[statement]}).then((function(){statement.why=_this6.group.doc(),kb.add(statement),_this6.onGroupChanged(null,"added",webIdNode),_this6.render()}))}))}},{key:"handleRemove",value:function handleRemove(webIdNode){var _this7=this;return function(_event){var statement=rdf.st(_this7.group,ns.vcard("hasMember"),webIdNode);return patch(_this7.group.doc().uri,{toDel:[statement]}).then((function(){return kb.remove(statement),_this7.onGroupChanged(null,"removed",webIdNode),_this7.render(),!0})).catch((function(err){var name=kb.any(webIdNode,ns.foaf("name")),errorMessage=name&&name.value?"Could not remove ".concat(name.value,". (").concat(err,")"):"Could not remove ".concat(webIdNode.value,". (").concat(err,")");throw new Error(errorMessage)}))}}},{key:"setGroupName",value:function setGroupName(name){var _this8=this,groupIndex=indexes(this.book).groupIndex,updatePromises=[this.group.doc(),groupIndex].map((function(namedGraph){var oldNameStatements=kb.match(_this8.group,ns.vcard("fn"),null,namedGraph),newNameStatement=rdf.st(_this8.group,ns.vcard("fn"),rdf.literal(name));return patch(namedGraph.value,{toDel:oldNameStatements,toIns:[newNameStatement]}).then((function(_solidResponse){kb.removeStatements(oldNameStatements),newNameStatement.why=namedGraph,kb.add(newNameStatement)}))}));return Promise.all(updatePromises)}}]),GroupBuilder}(),Person=exports.Person=function(){function Person(element,webIdNode,handleRemove){(0,_classCallCheck2.default)(this,Person),this.webIdNode=webIdNode,this.element=element,this.handleRemove=handleRemove}return(0,_createClass2.default)(Person,[{key:"render",value:function render(){var _this9=this,container=document.createElement("div");container.style.display="flex";var imgSrc=getWithDefault(this.webIdNode,ns.foaf("img"),_iconBase.iconBase+"noun_15059.svg"),profileImg=document.createElement("img");profileImg.src=(0,_escapeHtml.default)(imgSrc),profileImg.width="50",profileImg.height="50",profileImg.style.margin="5px";var name=getWithDefault(this.webIdNode,ns.foaf("name"),"[".concat(this.webIdNode,"]")),nameSpan=document.createElement("span");nameSpan.innerHTML=(0,_escapeHtml.default)(name),nameSpan.style.flexGrow="1",nameSpan.style.margin="auto 0";var removeButton=document.createElement("button");return removeButton.textContent="Remove",removeButton.addEventListener("click",(function(_event){return _this9.handleRemove().catch((function(err){_this9.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("".concat(err))))}))})),removeButton.style.margin="5px",container.appendChild(profileImg),container.appendChild(nameSpan),container.appendChild(removeButton),this.element.innerHTML="",this.element.appendChild(container),this}}]),Person}();function getWithDefault(subject,predicate,defaultValue){var object=kb.any(subject,predicate);return object?object.value:defaultValue}function patch(url,_ref3){var toDel=_ref3.toDel,toIns=_ref3.toIns;return new Promise((function(resolve,reject){kb.updater.update(toDel,toIns,(function(uri,success,errorMessage){if(!success)return reject(new Error("PATCH failed for resource <".concat(uri,">: ").concat(errorMessage)));resolve()}))}))}function indexes(book){return{groupIndex:kb.any(book,ns.vcard("groupIndex")),groupContainer:kb.sym(book.dir().uri+"Group/")}}},"./lib/widgets/widgetHelpers.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrapDivInATR=exports.createImageDiv=exports.addClickListenerToElement=void 0;var _style=__webpack_require__("./lib/style.js");exports.wrapDivInATR=function wrapDivInATR(dom,div,obj){var tr=dom.createElement("tr");return tr.appendChild(dom.createElement("td")).appendChild(div),tr.subject=obj,tr},exports.addClickListenerToElement=function addClickListenerToElement(div,onClickFunction){div.addEventListener("click",onClickFunction)},exports.createImageDiv=function createImageDiv(dom,div,image){var imageDiv=div.appendChild(dom.createElement("div"));imageDiv.setAttribute("style",_style.imageDivStyle),imageDiv.appendChild(image),image.setAttribute("draggable","false")}},"./src/stories/decorators.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{b:()=>rawJsonDecorator});var rawJsonDecorator=function rawJsonDecorator(Story){return"
                                                          "+JSON.stringify(Story(),null,2)+"
                                                          "}},"./storybook-init-framework-entry.js":(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/@storybook/html/dist/esm/client/index.js")},"./src/stories/Buttons.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,buttonWithIcon:()=>buttonWithIcon,cancelButton:()=>cancelButton,continueButton:()=>continueButton,default:()=>__WEBPACK_DEFAULT_EXPORT__,deleteButton:()=>deleteButton,fileUploadButton:()=>fileUploadButton,linkButton:()=>linkButton,linkCustomIcon:()=>linkCustomIcon,linkIcon:()=>linkIcon,primary:()=>primary,primaryNeedsBorder:()=>primaryNeedsBorder,removeButton:()=>removeButton,secondary:()=>secondary,secondaryNeedsBorder:()=>secondaryNeedsBorder});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Buttons",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"button-with-text-no-border"},"Button with text (no border)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Primary",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Primary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Secondary",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary"}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"button-with-text-needs-border"},"Button with text (needs border)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Primary (needs border)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{needsBorder:!0})),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Secondary (needs border)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary",needsBorder:!0}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"continue--cancel-button"},"Continue & Cancel button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Continue button",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.continueButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Cancel button",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.cancelButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"delete-button"},"Delete button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Delete button",mdxType:"Story"},(function(){var div=document.createElement("div");_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.deleteButtonWithCheck(document,div,"something",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("deleted"));return div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"button-with-icon"},"Button with icon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Button with icon",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,"https://solidproject.org/assets/img/solid-emblem.svg","test",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked!")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"file-upload-button"},"File upload button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"File upload button",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.fileUploadButtonDiv(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("uploaded")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"link-button"},"Link button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Link button",mdxType:"Story"},(function(){return document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkButton(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"link-icon"},"Link icon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Link icon",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Link custom icon",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"),"https://solidproject.org/favicon.ico"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"remove-button"},"Remove button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Remove button",mdxType:"Story"},(function(){var div=document.createElement("div"),p=document.createElement("p");p.appendChild(document.createTextNode("click x to remove me"));var button=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.removeButton(document,p);return div.appendChild(p),div.appendChild(button),div}))))}MDXContent.isMDXComponent=!0;var primary=function primary(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Primary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))};primary.storyName="Primary",primary.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Primary", action("clicked"))'}};var secondary=function secondary(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary"})};secondary.storyName="Secondary",secondary.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Secondary", action("clicked"), {\n buttonColor: "Secondary"\n})'}};var primaryNeedsBorder=function primaryNeedsBorder(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{needsBorder:!0})};primaryNeedsBorder.storyName="Primary (needs border)",primaryNeedsBorder.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Secondary", action("clicked"), {\n needsBorder: true\n})'}};var secondaryNeedsBorder=function secondaryNeedsBorder(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary",needsBorder:!0})};secondaryNeedsBorder.storyName="Secondary (needs border)",secondaryNeedsBorder.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Secondary", action("clicked"), {\n buttonColor: "Secondary",\n needsBorder: true\n})'}};var continueButton=function continueButton(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.continueButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))};continueButton.storyName="Continue button",continueButton.parameters={storySource:{source:'UI.widgets.continueButton(document, action("clicked"))'}};var cancelButton=function cancelButton(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.cancelButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))};cancelButton.storyName="Cancel button",cancelButton.parameters={storySource:{source:'UI.widgets.cancelButton(document, action("clicked"))'}};var deleteButton=function deleteButton(){var div=document.createElement("div");_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.deleteButtonWithCheck(document,div,"something",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("deleted"));return div};deleteButton.storyName="Delete button",deleteButton.parameters={storySource:{source:"() => {\n const div = document.createElement(\"div\");\n const result = UI.widgets.deleteButtonWithCheck(document, div, 'something', action('deleted'));\n return div;\n}"}};var buttonWithIcon=function buttonWithIcon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,"https://solidproject.org/assets/img/solid-emblem.svg","test",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked!"))};buttonWithIcon.storyName="Button with icon",buttonWithIcon.parameters={storySource:{source:"UI.widgets.button(document, 'https://solidproject.org/assets/img/solid-emblem.svg', 'test', action('clicked!'))"}};var fileUploadButton=function fileUploadButton(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.fileUploadButtonDiv(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("uploaded"))};fileUploadButton.storyName="File upload button",fileUploadButton.parameters={storySource:{source:"UI.widgets.fileUploadButtonDiv(document, action('uploaded'))"}};var linkButton=function linkButton(){return document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkButton(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/"))};linkButton.storyName="Link button",linkButton.parameters={storySource:{source:"() => {\n document.outlineManager = {\n GotoSubject: action('go to subject')\n };\n return UI.widgets.linkButton(document, UI.rdf.namedNode('http://example.com/'));\n}"}};var linkIcon=function linkIcon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"))};linkIcon.storyName="Link icon",linkIcon.parameters={storySource:{source:"UI.widgets.linkIcon(document, UI.rdf.namedNode('https://solidproject.org/'))"}};var linkCustomIcon=function linkCustomIcon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"),"https://solidproject.org/favicon.ico")};linkCustomIcon.storyName="Link custom icon",linkCustomIcon.parameters={storySource:{source:"UI.widgets.linkIcon(document, UI.rdf.namedNode('https://solidproject.org/'), 'https://solidproject.org/favicon.ico')"}};var removeButton=function removeButton(){var div=document.createElement("div"),p=document.createElement("p");p.appendChild(document.createTextNode("click x to remove me"));var button=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.removeButton(document,p);return div.appendChild(p),div.appendChild(button),div};removeButton.storyName="Remove button",removeButton.parameters={storySource:{source:"() => {\n const div = document.createElement('div');\n const p = document.createElement('p');\n p.appendChild(document.createTextNode('click x to remove me'));\n const button = UI.widgets.removeButton(document, p);\n div.appendChild(p);\n div.appendChild(button);\n return div;\n}"}};var componentMeta={title:"Buttons",includeStories:["primary","secondary","primaryNeedsBorder","secondaryNeedsBorder","continueButton","cancelButton","deleteButton","buttonWithIcon","fileUploadButton","linkButton","linkIcon","linkCustomIcon","removeButton"]},mdxStoryNameToKey={Primary:"primary",Secondary:"secondary","Primary (needs border)":"primaryNeedsBorder","Secondary (needs border)":"secondaryNeedsBorder","Continue button":"continueButton","Cancel button":"cancelButton","Delete button":"deleteButton","Button with icon":"buttonWithIcon","File upload button":"fileUploadButton","Link button":"linkButton","Link icon":"linkIcon","Link custom icon":"linkCustomIcon","Remove button":"removeButton"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["primary","secondary","primaryNeedsBorder","secondaryNeedsBorder","continueButton","cancelButton","deleteButton","buttonWithIcon","fileUploadButton","linkButton","linkIcon","linkCustomIcon","removeButton"]},"./src/stories/DateTime.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,formatDateTime:()=>formatDateTime,formatDateTimeDate:()=>formatDateTimeDate,formatDateTimeTime:()=>formatDateTimeTime,shortDateNotTodayWithoutTime:()=>shortDateNotTodayWithoutTime,shortDateTodayWithTime:()=>shortDateTodayWithTime,shortDateTodayWithoutTime:()=>shortDateTodayWithoutTime,shortDateWithTimeButNotToday:()=>shortDateWithTimeButNotToday,shortTime:()=>shortTime,timestamp:()=>timestamp});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.h_,{title:"Date & Time",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"formatdatetime"},"formatDateTime"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#formatdatetime",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"formatDateTime",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"formatDateTime date",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Date}.{Month}.{Year}"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"formatDateTime time",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Hours}:{Minutes}:{Seconds}"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"shortdate"},"shortDate"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"By default, converts e.g. '2020-02-19T19:35:28.557Z' to '19:35' if today is 19 Feb 2020, and to 'Feb 19' if not."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#shortdate",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (not today & without time)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!0))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (with time, but not today)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!1))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (today & without time)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!0))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (today & with time)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!1))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"shorttime"},"shortTime"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Get a short string representation of the current time"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#shorttime",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortTime",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortTime())),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"timestamp"},"timestamp"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Get a string representation of the current time"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#timestamp",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"timestamp",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.timestamp())))}MDXContent.isMDXComponent=!0;var formatDateTime=function formatDateTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}")};formatDateTime.storyName="formatDateTime",formatDateTime.parameters={storySource:{source:'UI.widgets.formatDateTime(new Date(), "{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}")'}};var formatDateTimeDate=function formatDateTimeDate(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Date}.{Month}.{Year}")};formatDateTimeDate.storyName="formatDateTime date",formatDateTimeDate.parameters={storySource:{source:'UI.widgets.formatDateTime(new Date(), "{Date}.{Month}.{Year}")'}};var formatDateTimeTime=function formatDateTimeTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Hours}:{Minutes}:{Seconds}")};formatDateTimeTime.storyName="formatDateTime time",formatDateTimeTime.parameters={storySource:{source:'UI.widgets.formatDateTime(new Date(), "{Hours}:{Minutes}:{Seconds}")'}};var shortDateNotTodayWithoutTime=function shortDateNotTodayWithoutTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!0)};shortDateNotTodayWithoutTime.storyName="shortDate (not today & without time)",shortDateNotTodayWithoutTime.parameters={storySource:{source:'UI.widgets.shortDate("2020-01-01T15:43", true)'}};var shortDateWithTimeButNotToday=function shortDateWithTimeButNotToday(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!1)};shortDateWithTimeButNotToday.storyName="shortDate (with time, but not today)",shortDateWithTimeButNotToday.parameters={storySource:{source:'UI.widgets.shortDate("2020-01-01T15:43", false)'}};var shortDateTodayWithoutTime=function shortDateTodayWithoutTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!0)};shortDateTodayWithoutTime.storyName="shortDate (today & without time)",shortDateTodayWithoutTime.parameters={storySource:{source:"UI.widgets.shortDate(new Date().toISOString(), true)"}};var shortDateTodayWithTime=function shortDateTodayWithTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!1)};shortDateTodayWithTime.storyName="shortDate (today & with time)",shortDateTodayWithTime.parameters={storySource:{source:"UI.widgets.shortDate(new Date().toISOString(), false)"}};var shortTime=function shortTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortTime()};shortTime.storyName="shortTime",shortTime.parameters={storySource:{source:"UI.widgets.shortTime()"}};var timestamp=function timestamp(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.timestamp()};timestamp.storyName="timestamp",timestamp.parameters={storySource:{source:"UI.widgets.timestamp()"}};var componentMeta={title:"Date & Time",includeStories:["formatDateTime","formatDateTimeDate","formatDateTimeTime","shortDateNotTodayWithoutTime","shortDateWithTimeButNotToday","shortDateTodayWithoutTime","shortDateTodayWithTime","shortTime","timestamp"]},mdxStoryNameToKey={formatDateTime:"formatDateTime","formatDateTime date":"formatDateTimeDate","formatDateTime time":"formatDateTimeTime","shortDate (not today & without time)":"shortDateNotTodayWithoutTime","shortDate (with time, but not today)":"shortDateWithTimeButNotToday","shortDate (today & without time)":"shortDateTodayWithoutTime","shortDate (today & with time)":"shortDateTodayWithTime",shortTime:"shortTime",timestamp:"timestamp"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["formatDateTime","formatDateTimeDate","formatDateTimeTime","shortDateNotTodayWithoutTime","shortDateWithTimeButNotToday","shortDateTodayWithoutTime","shortDateTodayWithTime","shortTime","timestamp"]},"./src/stories/Display.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,complain:()=>complain,default:()=>__WEBPACK_DEFAULT_EXPORT__,errorMessageBlock:()=>errorMessageBlock,setName:()=>setName});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Display",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"complain"},"complain"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#complain",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"complain",mdxType:"Story"},(function(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.complain({div,dom:document},"not good!"),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"errormessageblock"},"errorMessageBlock"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_error_.html#errormessageblock",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"errorMessageBlock",mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.errorMessageBlock(document,"my error message","#f0f")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"setname"},"setName"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Sets the best name we have and looks up a better one"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#setname",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"setName",mdxType:"Story"},(function(){var div=document.createElement("div"),jane=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://jane.example/person/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(jane,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("name"),"Jane Doe"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setName(div,jane),div}))))}MDXContent.isMDXComponent=!0;var complain=function complain(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.complain({div,dom:document},"not good!"),div};complain.storyName="complain",complain.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n UI.widgets.complain({\n div,\n dom: document\n }, "not good!");\n return div;\n}'}};var errorMessageBlock=function errorMessageBlock(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.errorMessageBlock(document,"my error message","#f0f")};errorMessageBlock.storyName="errorMessageBlock",errorMessageBlock.parameters={storySource:{source:'() => {\n return UI.widgets.errorMessageBlock(document, "my error message", "#f0f");\n}'}};var setName=function setName(){var div=document.createElement("div"),jane=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://jane.example/person/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(jane,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("name"),"Jane Doe"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setName(div,jane),div};setName.storyName="setName",setName.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n const jane = UI.rdf.namedNode("https://jane.example/person/card#me");\n UI.store.add(jane, UI.ns.foaf("name"), "Jane Doe");\n UI.widgets.setName(div, jane);\n return div;\n}'}};var componentMeta={title:"Display",includeStories:["complain","errorMessageBlock","setName"]},mdxStoryNameToKey={complain:"complain",errorMessageBlock:"errorMessageBlock",setName:"setName"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["complain","errorMessageBlock","setName"]},"./src/stories/DomManipulation.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,addStyleSheet:()=>addStyleSheet,clearElement:()=>clearElement,default:()=>__WEBPACK_DEFAULT_EXPORT__,refreshTree:()=>refreshTree});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.h_,{title:"DOM manipulation",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"addstylesheet"},"addStyleSheet"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Stick a stylesheet link the document if not already there"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#addstylesheet",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"addStyleSheet",withSource:"open",decorators:[function(Story){Story();var html=document.querySelector("link").outerHTML,pre=document.createElement("pre"),text=document.createTextNode(html);return pre.appendChild(text),pre}],mdxType:"Story"},(function(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.addStyleSheet(document,"https://linkeddata.github.io/tabulator-firefox/content/tabbedtab.css")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"clearelement"},"clearElement"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Remove all the children of an HTML element"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#clearelement",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"clearElement",mdxType:"Story"},(function(){var counter=0,div=document.createElement("p");return setInterval((function(){if(counter++%2==0){var text=document.createTextNode("Now you see me");div.appendChild(text)}else _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.clearElement(div)}),1e3),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"refreshtree"},"refreshTree"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Refresh a DOM tree recursively"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#refreshtree",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"refreshTree",mdxType:"Story"},(function(){setInterval((function(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.refreshTree(document.body)}),1e3);var refreshable=document.createElement("p");return refreshable.refresh=function(){refreshable.innerText=(new Date).getTime()},refreshable}))))}MDXContent.isMDXComponent=!0;var addStyleSheet=function addStyleSheet(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.addStyleSheet(document,"https://linkeddata.github.io/tabulator-firefox/content/tabbedtab.css")};addStyleSheet.storyName="addStyleSheet",addStyleSheet.parameters={storySource:{source:'() => {\n UI.widgets.addStyleSheet(document, "https://linkeddata.github.io/tabulator-firefox/content/tabbedtab.css");\n}'}},addStyleSheet.decorators=[function(Story){Story();var html=document.querySelector("link").outerHTML,pre=document.createElement("pre"),text=document.createTextNode(html);return pre.appendChild(text),pre}];var clearElement=function clearElement(){var counter=0,div=document.createElement("p");return setInterval((function(){if(counter++%2==0){var text=document.createTextNode("Now you see me");div.appendChild(text)}else _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.clearElement(div)}),1e3),div};clearElement.storyName="clearElement",clearElement.parameters={storySource:{source:'() => {\n let counter = 0;\n const div = document.createElement("p");\n setInterval(() => {\n if (counter++ % 2 === 0) {\n const text = document.createTextNode("Now you see me");\n div.appendChild(text);\n } else {\n UI.widgets.clearElement(div);\n }\n }, 1000);\n return div;\n}'}};var refreshTree=function refreshTree(){setInterval((function(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.refreshTree(document.body)}),1e3);var refreshable=document.createElement("p");return refreshable.refresh=function(){refreshable.innerText=(new Date).getTime()},refreshable};refreshTree.storyName="refreshTree",refreshTree.parameters={storySource:{source:'() => {\n setInterval(() => {\n UI.widgets.refreshTree(document.body);\n }, 1000);\n const refreshable = document.createElement("p");\n refreshable.refresh = () => {\n refreshable.innerText = new Date().getTime();\n };\n return refreshable;\n}'}};var componentMeta={title:"DOM manipulation",includeStories:["addStyleSheet","clearElement","refreshTree"]},mdxStoryNameToKey={addStyleSheet:"addStyleSheet",clearElement:"clearElement",refreshTree:"refreshTree"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["addStyleSheet","clearElement","refreshTree"]},"./src/stories/DragAndDrop.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,draggable:()=>draggable,dropTarget:()=>dropTarget,uploadFiles:()=>uploadFiles});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Drag & Drop",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"drag--drop"},"Drag & Drop"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"DragAndDrop has three functions that can be used to handle dragging and dropping of uris, files, and images."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"makeDraggable")," is used to make an element Draggable. Along with the HTML Element, it is also necessary to pass an\nobject with a uri. This is used to set the data on the EventListener for 'dragstart'."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"makeDropTarget")," is used to make an element enabled as a drop target. Along with the HTML Element, it is also\nnecessary to pass in two callback functions; one to handle draggable uris and the other to handle draggable files and images."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"uploadFiles")," is used to process the files that a user is uploading."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,'Drag the message from the "Draggable" story or drag any file or image and drop it on the element in the "Drop Target" story to see it\nwork.'),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Draggable",mdxType:"Story"},(function(){var dragElement=document.createElement("div");dragElement.appendChild(document.createTextNode("Drag me to the target!"));var uri=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://exampleuser.inrupt.net");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDraggable(dragElement,uri),dragElement}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Drop Target",mdxType:"Story"},(function(){var target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop things (URIs, files, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped file")),target}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"uploadfiles"},"uploadFiles"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"The function ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"uploadFiles")," could for example be used in the droppedFileHandler function which is passed to the\nmakeDropTarget function."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Upload Files",args:{fileBase:"https://pod.example/Files",pictureBase:"https://pod.example/Pictures"},mdxType:"Story"},(function(_ref2){var fileBase=_ref2.fileBase,pictureBase=_ref2.pictureBase,target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop a file (document, picture, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(function(files){_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.uploadFiles(_lib__WEBPACK_IMPORTED_MODULE_7__.store.fetcher,files,fileBase,pictureBase,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("file uploaded successfully"))})),target}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.xP,{story:"Upload Files",mdxType:"Props"}))}MDXContent.isMDXComponent=!0;var draggable=function draggable(){var dragElement=document.createElement("div");dragElement.appendChild(document.createTextNode("Drag me to the target!"));var uri=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://exampleuser.inrupt.net");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDraggable(dragElement,uri),dragElement};draggable.storyName="Draggable",draggable.parameters={storySource:{source:'() => {\n const dragElement = document.createElement("div");\n dragElement.appendChild(document.createTextNode("Drag me to the target!"));\n const uri = new UI.rdf.NamedNode(\'https://exampleuser.inrupt.net\');\n UI.widgets.makeDraggable(dragElement, uri);\n return dragElement;\n}'}};var dropTarget=function dropTarget(){var target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop things (URIs, files, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped file")),target};dropTarget.storyName="Drop Target",dropTarget.parameters={storySource:{source:'() => {\n const target = document.createElement("div");\n target.style = "padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px";\n target.appendChild(document.createTextNode("Drop things (URIs, files, ...) here"));\n UI.widgets.makeDropTarget(target, action(\'dropped uri\'), action(\'dropped file\'));\n return target;\n}'}};var uploadFiles=function uploadFiles(_ref3){var fileBase=_ref3.fileBase,pictureBase=_ref3.pictureBase,target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop a file (document, picture, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(function(files){_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.uploadFiles(_lib__WEBPACK_IMPORTED_MODULE_7__.store.fetcher,files,fileBase,pictureBase,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("file uploaded successfully"))})),target};uploadFiles.storyName="Upload Files",uploadFiles.args={fileBase:"https://pod.example/Files",pictureBase:"https://pod.example/Pictures"},uploadFiles.parameters={storySource:{source:'({\n fileBase,\n pictureBase\n}) => {\n const target = document.createElement("div");\n target.style = "padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px";\n target.appendChild(document.createTextNode("Drop a file (document, picture, ...) here"));\n UI.widgets.makeDropTarget(target, action(\'dropped uri\'), files => {\n UI.widgets.uploadFiles(UI.store.fetcher, files, fileBase, pictureBase, action(\'file uploaded successfully\'));\n });\n return target;\n}'}};var componentMeta={title:"Drag & Drop",includeStories:["draggable","dropTarget","uploadFiles"]},mdxStoryNameToKey={Draggable:"draggable","Drop Target":"dropTarget","Upload Files":"uploadFiles"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["draggable","dropTarget","uploadFiles"]},"./src/stories/Events.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,openHrefInOutlineMode:()=>openHrefInOutlineMode});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Events",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"openhrefinoutlinemode"},"openHrefInOutlineMode"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Event Handler for links within solid apps."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#openhrefinoutlinemode",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"openHrefInOutlineMode",mdxType:"Story"},(function(){document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")};var anchor=document.createElement("a");return anchor.setAttribute("href","http://example.com"),anchor.onclick=function(e){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.openHrefInOutlineMode(e),!1},anchor.appendChild(document.createTextNode("click me")),anchor}))))}MDXContent.isMDXComponent=!0;var openHrefInOutlineMode=function openHrefInOutlineMode(){document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")};var anchor=document.createElement("a");return anchor.setAttribute("href","http://example.com"),anchor.onclick=function(e){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.openHrefInOutlineMode(e),!1},anchor.appendChild(document.createTextNode("click me")),anchor};openHrefInOutlineMode.storyName="openHrefInOutlineMode",openHrefInOutlineMode.parameters={storySource:{source:'() => {\n document.outlineManager = {\n GotoSubject: action("go to subject")\n };\n const anchor = document.createElement("a");\n anchor.setAttribute("href", "http://example.com");\n anchor.onclick = e => {\n UI.widgets.openHrefInOutlineMode(e);\n return false;\n };\n anchor.appendChild(document.createTextNode("click me"));\n return anchor;\n}'}};var componentMeta={title:"Events",includeStories:["openHrefInOutlineMode"]},mdxStoryNameToKey={openHrefInOutlineMode:"openHrefInOutlineMode"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["openHrefInOutlineMode"]},"./src/stories/Header.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,header:()=>header,headerDecorator:()=>headerDecorator});__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var headerDecorator=function headerDecorator(Story){return setTimeout((function(){return Story()}),1),'
                                                          The above div with ID "PageHeader" is replaced by the header component
                                                          '},layoutProps={headerDecorator};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Header",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"header"},"Header"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("div",{id:"PageHeader"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"To experience the full behaviour of the header, you need to log in. This can be done at\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"http://solidos.github.io/solid-ui/examples/header",target:"_blank",rel:"nofollow noopener noreferrer"},"the example page"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"header",decorators:[headerDecorator],mdxType:"Story"},(function(){_lib__WEBPACK_IMPORTED_MODULE_8__.initHeader(_lib__WEBPACK_IMPORTED_MODULE_8__.store,{})}))))}MDXContent.isMDXComponent=!0;var header=function header(){_lib__WEBPACK_IMPORTED_MODULE_8__.initHeader(_lib__WEBPACK_IMPORTED_MODULE_8__.store,{})};header.storyName="header",header.parameters={storySource:{source:"() => {\n const options = {};\n UI.initHeader(UI.store, options);\n}"}},header.decorators=[headerDecorator];var componentMeta={title:"Header",includeStories:["header"]},mdxStoryNameToKey={header:"header"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["headerDecorator","header"]},"./src/stories/Images.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,eMail:()=>eMail,favicon:()=>favicon,forFoafAgent:()=>forFoafAgent,forRdfResource:()=>forRdfResource,imageDecorator:()=>imageDecorator,imagesOf:()=>imagesOf,messageId:()=>messageId,setImage:()=>setImage,withFoafImg:()=>withFoafImg,withVcardHasPhoto:()=>withVcardHasPhoto,withoutFavicon:()=>withoutFavicon});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_decorators__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/stories/decorators.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var imageDecorator=function imageDecorator(Story){var result=Story();return"\n
                                                          Returns:
                                                          \n
                                                          "+result+'
                                                          \n

                                                          Preview:

                                                          \n \n'},layoutProps={imageDecorator};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Images",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"findimage"},"findImage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Find something we have as explicit image data for the thing"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#findimage",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"for-foafagent"},"for foaf:Agent"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"for foaf:Agent",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Agent")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"for-rdfresource"},"for rdf:Resource"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"for rdf:Resource",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("Resource")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"with-vcardhasphoto"},"with vcard:hasPhoto"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"with vcard:hasPhoto",decorators:[imageDecorator],mdxType:"Story"},(function(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/1#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.vcard("hasPhoto"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"with-foafimg"},"with foaf:img"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"with foaf:img",decorators:[imageDecorator],mdxType:"Story"},(function(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/2#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"findimagefromuri"},"findImageFromURI"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Find an image for this thing as a class"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#findimagefromuri",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"without-favicon"},"without favicon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"without favicon",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example.com/")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"favicon"},"favicon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"favicon",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/some/file.html")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"message-id-mid"},"Message-ID (mid:)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Message-ID",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mid:example")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"e-mail-mailto"},"E-Mail (mailto:)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"E-Mail",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mailto:user@mail.example")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"imagesof"},"imagesOf"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Set of suitable images"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#imagesof",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"imagesOf",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://thing.example/resource#it"),avatar=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image1.png"),image=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image2.jpg");return store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.sioc("avatar"),avatar),store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),image),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.imagesOf(thing,store)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"setimage"},"setImage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#setimage",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"setImage",mdxType:"Story"},(function(){var myTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(myTrip,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.trip("Trip"));var img=document.createElement("img");return img.setAttribute("style","height:50px;width:50px;"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setImage(img,myTrip),img}))))}MDXContent.isMDXComponent=!0;var forFoafAgent=function forFoafAgent(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Agent"))};forFoafAgent.storyName="for foaf:Agent",forFoafAgent.parameters={storySource:{source:'UI.widgets.findImage(UI.ns.foaf("Agent"))'}},forFoafAgent.decorators=[imageDecorator];var forRdfResource=function forRdfResource(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("Resource"))};forRdfResource.storyName="for rdf:Resource",forRdfResource.parameters={storySource:{source:'UI.widgets.findImage(UI.ns.rdf("Resource"))'}},forRdfResource.decorators=[imageDecorator];var withVcardHasPhoto=function withVcardHasPhoto(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/1#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.vcard("hasPhoto"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)};withVcardHasPhoto.storyName="with vcard:hasPhoto",withVcardHasPhoto.parameters={storySource:{source:'() => {\n const person = UI.rdf.namedNode("https://person.example/1#me");\n const photo = UI.rdf.namedNode("https://michielbdejong.com/img/me.jpg");\n UI.store.add(person, UI.ns.vcard("hasPhoto"), photo);\n return UI.widgets.findImage(person);\n}'}},withVcardHasPhoto.decorators=[imageDecorator];var withFoafImg=function withFoafImg(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/2#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)};withFoafImg.storyName="with foaf:img",withFoafImg.parameters={storySource:{source:'() => {\n const person = UI.rdf.namedNode("https://person.example/2#me");\n const photo = UI.rdf.namedNode("https://michielbdejong.com/img/me.jpg");\n UI.store.add(person, UI.ns.foaf("img"), photo);\n return UI.widgets.findImage(person);\n}'}},withFoafImg.decorators=[imageDecorator];var withoutFavicon=function withoutFavicon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example.com/"))};withoutFavicon.storyName="without favicon",withoutFavicon.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("https://example.com/"))'}},withoutFavicon.decorators=[imageDecorator];var favicon=function favicon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/some/file.html"))};favicon.storyName="favicon",favicon.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("https://solidproject.org/some/file.html"))'}},favicon.decorators=[imageDecorator];var messageId=function messageId(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mid:example"))};messageId.storyName="Message-ID",messageId.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("mid:example"))'}},messageId.decorators=[imageDecorator];var eMail=function eMail(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mailto:user@mail.example"))};eMail.storyName="E-Mail",eMail.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("mailto:user@mail.example"))'}},eMail.decorators=[imageDecorator];var imagesOf=function imagesOf(){var store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://thing.example/resource#it"),avatar=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image1.png"),image=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image2.jpg");return store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.sioc("avatar"),avatar),store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),image),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.imagesOf(thing,store)};imagesOf.storyName="imagesOf",imagesOf.parameters={storySource:{source:'() => {\n const store = UI.rdf.graph();\n const thing = UI.rdf.namedNode("http://thing.example/resource#it");\n const avatar = UI.rdf.namedNode("https://pod.example/image1.png");\n const image = UI.rdf.namedNode("https://pod.example/image2.jpg");\n store.add(thing, UI.ns.sioc("avatar"), avatar);\n store.add(thing, UI.ns.foaf("img"), image);\n return UI.widgets.imagesOf(thing, store);\n}'}},imagesOf.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var setImage=function setImage(){var myTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(myTrip,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.trip("Trip"));var img=document.createElement("img");return img.setAttribute("style","height:50px;width:50px;"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setImage(img,myTrip),img};setImage.storyName="setImage",setImage.parameters={storySource:{source:'() => {\n const myTrip = UI.rdf.namedNode("http://example.com/#trip");\n UI.store.add(myTrip, UI.ns.rdf("type"), UI.ns.trip("Trip"));\n const img = document.createElement("img");\n img.setAttribute("style", "height:50px;width:50px;");\n UI.widgets.setImage(img, myTrip);\n return img;\n}'}};var componentMeta={title:"Images",includeStories:["forFoafAgent","forRdfResource","withVcardHasPhoto","withFoafImg","withoutFavicon","favicon","messageId","eMail","imagesOf","setImage"]},mdxStoryNameToKey={"for foaf:Agent":"forFoafAgent","for rdf:Resource":"forRdfResource","with vcard:hasPhoto":"withVcardHasPhoto","with foaf:img":"withFoafImg","without favicon":"withoutFavicon",favicon:"favicon","Message-ID":"messageId","E-Mail":"eMail",imagesOf:"imagesOf",setImage:"setImage"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["imageDecorator","forFoafAgent","forRdfResource","withVcardHasPhoto","withFoafImg","withoutFavicon","favicon","messageId","eMail","imagesOf","setImage"]},"./src/stories/Interactive.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,askName:()=>askName,attachmentList:()=>attachmentList,default:()=>__WEBPACK_DEFAULT_EXPORT__,personTr:()=>personTr,renderAsDiv:()=>renderAsDiv,selectorPanel:()=>selectorPanel,selectorPanelRefresh:()=>selectorPanelRefresh});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Interactive",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"ask-name"},"Ask name"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#askname",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Ask name",mdxType:"Story"},(function(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.askName(document,_lib__WEBPACK_IMPORTED_MODULE_7__.store,div).then((function(name){return window.alert('You picked "'+name+'"')})),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"attachment-list"},"Attachment list"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Component that displays a list of resources, for instance the attachments of a message, or the various documents related to a meeting.\nAccepts dropping URLs onto it to add attachments to it."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#attachmentlist",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Attachment list",mdxType:"Story"},(function(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.wf("attachment"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-attachment")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.attachmentList(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),div),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"persontr"},"personTR"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"A TR to represent a draggable person, etc in a list"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#persontr",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Person TR",mdxType:"Story"},(function(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.personTR(document,null,michiel)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"renderasdiv"},"renderAsDIV"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"A Div to represent a draggable person, etc in a list"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#persontr",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Render As DIV",mdxType:"Story"},(function(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.renderAsDiv(document,michiel,{wrapInATR:!0})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"selectorpanel"},"selectorPanel"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#selectorpanel",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"selectorPanel",mdxType:"Story"},(function(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanel(document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"selectorpanelrefresh"},"selectorPanelRefresh"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#selectorpanelrefresh",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"selectorPanelRefresh",mdxType:"Story"},(function(){var list=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanelRefresh(list,document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))}))))}MDXContent.isMDXComponent=!0;var askName=function askName(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.askName(document,_lib__WEBPACK_IMPORTED_MODULE_7__.store,div).then((function(name){return window.alert('You picked "'+name+'"')})),div};askName.storyName="Ask name",askName.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n UI.widgets.askName(document, UI.store, div).then(name => window.alert(`You picked "${name}"`));\n return div;\n}'}};var attachmentList=function attachmentList(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.wf("attachment"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-attachment")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.attachmentList(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),div),div};attachmentList.storyName="Attachment list",attachmentList.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n UI.store.add(UI.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"), UI.ns.wf("attachment"), UI.rdf.namedNode("http://example.com/#some-attachment"));\n UI.widgets.attachmentList(document, UI.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl" + "#this"), div);\n return div;\n}'}};var personTr=function personTr(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.personTR(document,null,michiel)};personTr.storyName="Person TR",personTr.parameters={storySource:{source:'() => {\n const michiel = UI.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");\n return UI.widgets.personTR(document, null, michiel);\n}'}};var renderAsDiv=function renderAsDiv(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.renderAsDiv(document,michiel,{wrapInATR:!0})};renderAsDiv.storyName="Render As DIV",renderAsDiv.parameters={storySource:{source:'() => {\n const michiel = UI.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");\n const options = {\n wrapInATR: true\n };\n return UI.widgets.renderAsDiv(document, michiel, options);\n}'}};var selectorPanel=function selectorPanel(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanel(document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))};selectorPanel.storyName="selectorPanel",selectorPanel.parameters={storySource:{source:'() => {\n const kb = UI.rdf.graph();\n const type = UI.rdf.namedNode("http://example.com/#type");\n const predicate = UI.rdf.namedNode("http://example.com/#pred");\n const inverse = false;\n const possible = [UI.rdf.namedNode("http://example.com/#blue"), UI.rdf.namedNode("http://example.com/#green"), UI.rdf.namedNode("http://example.com/#yellow")];\n const options = {};\n return UI.widgets.selectorPanel(document, kb, type, predicate, inverse, possible, options, action("selection"), action("link clicked"));\n}'}};var selectorPanelRefresh=function selectorPanelRefresh(){var list=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanelRefresh(list,document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))};selectorPanelRefresh.storyName="selectorPanelRefresh",selectorPanelRefresh.parameters={storySource:{source:'() => {\n const list = document.createElement("div");\n const kb = UI.rdf.graph();\n const type = UI.rdf.namedNode("http://example.com/#type");\n const predicate = UI.rdf.namedNode("http://example.com/#pred");\n const inverse = false;\n const possible = [UI.rdf.namedNode("http://example.com/#blue"), UI.rdf.namedNode("http://example.com/#green"), UI.rdf.namedNode("http://example.com/#yellow")];\n const options = {};\n return UI.widgets.selectorPanelRefresh(list, document, kb, type, predicate, inverse, possible, options, action("selection"), action("link clicked"));\n}'}};var componentMeta={title:"Interactive",includeStories:["askName","attachmentList","personTr","renderAsDiv","selectorPanel","selectorPanelRefresh"]},mdxStoryNameToKey={"Ask name":"askName","Attachment list":"attachmentList","Person TR":"personTr","Render As DIV":"renderAsDiv",selectorPanel:"selectorPanel",selectorPanelRefresh:"selectorPanelRefresh"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["askName","attachmentList","personTr","renderAsDiv","selectorPanel","selectorPanelRefresh"]},"./src/stories/Log.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,alertMessage:()=>alertMessage,buttonDecorator:()=>buttonDecorator,clearMessages:()=>clearMessages,debugMessage:()=>debugMessage,default:()=>__WEBPACK_DEFAULT_EXPORT__,dumpHtml:()=>dumpHtml,errorMessage:()=>errorMessage,infoMessage:()=>infoMessage,logAscending:()=>logAscending,logDescending:()=>logDescending,setLevel:()=>setLevel,simpleMessage:()=>simpleMessage,successMessage:()=>successMessage,warningMessage:()=>warningMessage});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var buttonDecorator=function buttonDecorator(Story,_ref){var args=_ref.args,button=document.createElement("button");return button.innerText=args.buttonLabel,button.addEventListener("click",(function(){return Story()})),button},layoutProps={buttonDecorator};function MDXContent(_ref2){var components=_ref2.components,props=_objectWithoutProperties(_ref2,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Log",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h1",{id:"the-log-module"},"The Log module"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"On this page you'll find some examples from the log module. See\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_log_",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation"),"\nfor more information."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("div",{style:{background:"white",border:"0.5em solid black",position:"fixed",top:0,right:0,width:"300px",padding:"0.5em"}},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("strong",{parentName:"p"},"Status area:")," This is the playground which the examples will interact with. Click the various\nbuttons to see their effect here."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("div",{id:"status",style:{border:"1px solid red",padding:"0.5em",maxHeight:"50vh",overflow:"auto"}}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Note that by default only ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"msg"),", ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"warn")," and ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"error")," will add messages to the\nstatus area. You can change this by using ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"?path=/docs/log--set-level"},"setLevel"),".")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logmsg-a-simple-message"},"log.msg: A simple message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"simple message",decorators:[buttonDecorator],args:{buttonLabel:"Add a message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.msg("A simple message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logwarn-a-warning-message"},"log.warn: A warning message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"warning message",decorators:[buttonDecorator],args:{buttonLabel:"Add a warning"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.warn("A warning message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logdebug-a-debug-message"},"log.debug: A debug message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"debug message",decorators:[buttonDecorator],args:{buttonLabel:"Add a debugging message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.debug("A debugging message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"loginfo-an-info-message"},"log.info: An info message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"info message",decorators:[buttonDecorator],args:{buttonLabel:"Add an info message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.info("An info message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logerror-an-error-message"},"log.error: An error message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"error message",decorators:[buttonDecorator],args:{buttonLabel:"Add an error message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.error("An error message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logsuccess-a-success-message"},"log.success: A success message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"success message",decorators:[buttonDecorator],args:{buttonLabel:"Add a success message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.success("A success message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logalert-a-alert-message"},"log.alert: A alert message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"This example uses alert to notify user of a message. It will not log in the status area unless window.alert is not available."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"alert message",decorators:[buttonDecorator],args:{buttonLabel:"Trigger an alert message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.alert("An alert message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logclear-clear-messages"},"log.clear: Clear messages"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Using this method you can clear the existing messages in the status area."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"clear messages",decorators:[buttonDecorator],args:{buttonLabel:"Clear status area"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.clear()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logsetlevel-configure-which-messages-are-to-be-shown"},"log.setLevel: Configure which messages are to be shown"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"The module uses ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Mask_(computing)",target:"_blank",rel:"nofollow noopener noreferrer"},"bitmask")," to filter which types of messages that will be shown. It assigns the following 10-based\nnumber to each type (binaries in parenthesis):"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("ul",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Error: 1 (000001)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Warning: 2 (000010)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Message: 4 (000100)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Success: 8 (001000)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Info: 16 (010000)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Debug: 32 (100000)")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"By default only error, warning, and normal messages will be shown, hence the number 7 that is shown by default in this example. You can set it to show all types of messages by passing 63 (which is the sum of all, and is 111111 in binary)."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"set level",mdxType:"Story"},(function(){var div=document.createElement("div"),input=document.createElement("input");input.type="text",input.inputmode="numeric",input.pattern="[0-9]*",input.value=7,div.appendChild(input);var button=document.createElement("button");return button.innerText="Set level",button.addEventListener("click",(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.setLevel(parseInt(input.value,10))})),div.appendChild(button),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logdumphtml-dump-all-html-in-body-in-a-log-message"},"log.dumpHTML: Dump all HTML in body in a log message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"dump html",decorators:[buttonDecorator],args:{buttonLabel:"Dump HTML"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.dumpHTML()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"loglogascending-start-logging-all-messages-in-ascending-order"},"log.logAscending: Start logging all messages in ascending order"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"log ascending",decorators:[buttonDecorator],args:{buttonLabel:"Log ascending"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logAscending()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"loglogdescending-start-logging-all-messages-in-descending-order"},"log.logDescending: Start logging all messages in descending order"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"log descending",decorators:[buttonDecorator],args:{buttonLabel:"Log descending"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logDescending()}))))}MDXContent.isMDXComponent=!0;var simpleMessage=function simpleMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.msg("A simple message")};simpleMessage.storyName="simple message",simpleMessage.args={buttonLabel:"Add a message"},simpleMessage.parameters={storySource:{source:'() => UI.log.msg("A simple message")'}},simpleMessage.decorators=[buttonDecorator];var warningMessage=function warningMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.warn("A warning message")};warningMessage.storyName="warning message",warningMessage.args={buttonLabel:"Add a warning"},warningMessage.parameters={storySource:{source:'() => UI.log.warn("A warning message")'}},warningMessage.decorators=[buttonDecorator];var debugMessage=function debugMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.debug("A debugging message")};debugMessage.storyName="debug message",debugMessage.args={buttonLabel:"Add a debugging message"},debugMessage.parameters={storySource:{source:'() => UI.log.debug("A debugging message")'}},debugMessage.decorators=[buttonDecorator];var infoMessage=function infoMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.info("An info message")};infoMessage.storyName="info message",infoMessage.args={buttonLabel:"Add an info message"},infoMessage.parameters={storySource:{source:'() => UI.log.info("An info message")'}},infoMessage.decorators=[buttonDecorator];var errorMessage=function errorMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.error("An error message")};errorMessage.storyName="error message",errorMessage.args={buttonLabel:"Add an error message"},errorMessage.parameters={storySource:{source:'() => UI.log.error("An error message")'}},errorMessage.decorators=[buttonDecorator];var successMessage=function successMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.success("A success message")};successMessage.storyName="success message",successMessage.args={buttonLabel:"Add a success message"},successMessage.parameters={storySource:{source:'() => UI.log.success("A success message")'}},successMessage.decorators=[buttonDecorator];var alertMessage=function alertMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.alert("An alert message")};alertMessage.storyName="alert message",alertMessage.args={buttonLabel:"Trigger an alert message"},alertMessage.parameters={storySource:{source:'() => UI.log.alert("An alert message")'}},alertMessage.decorators=[buttonDecorator];var clearMessages=function clearMessages(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.clear()};clearMessages.storyName="clear messages",clearMessages.args={buttonLabel:"Clear status area"},clearMessages.parameters={storySource:{source:"() => UI.log.clear()"}},clearMessages.decorators=[buttonDecorator];var setLevel=function setLevel(){var div=document.createElement("div"),input=document.createElement("input");input.type="text",input.inputmode="numeric",input.pattern="[0-9]*",input.value=7,div.appendChild(input);var button=document.createElement("button");return button.innerText="Set level",button.addEventListener("click",(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.setLevel(parseInt(input.value,10))})),div.appendChild(button),div};setLevel.storyName="set level",setLevel.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n const input = document.createElement("input");\n input.type = "text";\n input.inputmode = "numeric";\n input.pattern = "[0-9]*";\n input.value = 7;\n div.appendChild(input);\n const button = document.createElement("button");\n button.innerText = "Set level";\n button.addEventListener("click", () => UI.log.setLevel(parseInt(input.value, 10)));\n div.appendChild(button);\n return div;\n}'}};var dumpHtml=function dumpHtml(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.dumpHTML()};dumpHtml.storyName="dump html",dumpHtml.args={buttonLabel:"Dump HTML"},dumpHtml.parameters={storySource:{source:"() => UI.log.dumpHTML()"}},dumpHtml.decorators=[buttonDecorator];var logAscending=function logAscending(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logAscending()};logAscending.storyName="log ascending",logAscending.args={buttonLabel:"Log ascending"},logAscending.parameters={storySource:{source:"() => UI.log.logAscending()"}},logAscending.decorators=[buttonDecorator];var logDescending=function logDescending(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logDescending()};logDescending.storyName="log descending",logDescending.args={buttonLabel:"Log descending"},logDescending.parameters={storySource:{source:"() => UI.log.logDescending()"}},logDescending.decorators=[buttonDecorator];var componentMeta={title:"Log",includeStories:["simpleMessage","warningMessage","debugMessage","infoMessage","errorMessage","successMessage","alertMessage","clearMessages","setLevel","dumpHtml","logAscending","logDescending"]},mdxStoryNameToKey={"simple message":"simpleMessage","warning message":"warningMessage","debug message":"debugMessage","info message":"infoMessage","error message":"errorMessage","success message":"successMessage","alert message":"alertMessage","clear messages":"clearMessages","set level":"setLevel","dump html":"dumpHtml","log ascending":"logAscending","log descending":"logDescending"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["buttonDecorator","simpleMessage","warningMessage","debugMessage","infoMessage","errorMessage","successMessage","alertMessage","clearMessages","setLevel","dumpHtml","logAscending","logDescending"]},"./src/stories/Matrix.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,forQuery:()=>forQuery});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Matrix",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h1",{id:"matrix"},"Matrix"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"More complex examples can be investigated on the\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"http://solidos.github.io/solid-ui/examples/matrix/index.html",target:"_blank",rel:"nofollow noopener noreferrer"},"example page"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"for-query"},"for query"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"for query",mdxType:"Story"},(function(){var testDocURI="https://pod.example/",testDoc=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.sym(testDocURI),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store;kb.removeMany(void 0,void 0,void 0,testDoc);_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.parse('@prefix : <#>.\n@prefix foaf: .\n@prefix sched: .\n@prefix cal: .\n@prefix dc: .\n:event1 dc:author :a0;\n a sched:YesNoMaybe ;\n sched:response :r1, :r2 .\n:a0 foaf:name "Zoe" .\n:a1 foaf:name "Alice" .\n:a2 foaf:name "Bob" .\n:r1 dc:author :a1;\n sched:cell\n [ sched:availabilty sched:No; cal:dtstart "2015-01-01" ],\n [ sched:availabilty sched:Yes; cal:dtstart "2015-01-05"] .\n:r2 dc:author :a2;\n sched:cell\n [ sched:availabilty sched:Maybe; cal:dtstart "2015-01-01" ] .\n',kb,testDocURI,"text/turtle");var SCHED=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/ns/pim/schedule#"),DC=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://purl.org/dc/elements/1.1/"),ICAL=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/2002/12/cal/ical#"),invitation=kb.sym(testDocURI+"#event1"),query=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Query("Responses"),variables={time:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("time"),author:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("author"),availabilty:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("value"),response:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("response"),cell:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("cell")};query.pat.add(invitation,SCHED("response"),variables.response),query.pat.add(variables.response,DC("author"),variables.author),query.pat.add(variables.response,SCHED("cell"),variables.cell),query.pat.add(variables.cell,SCHED("availabilty"),variables.availabilty),query.pat.add(variables.cell,ICAL("dtstart"),variables.time);var options={cellFunction:function cellFunction(cell,x,y,value){cell.textContent=value?_lib__WEBPACK_IMPORTED_MODULE_7__.utils.label(value):"-"}};return _lib__WEBPACK_IMPORTED_MODULE_7__.matrix.matrixForQuery(document,query,variables.time,variables.author,variables.availabilty,options,(function(){}))}))))}MDXContent.isMDXComponent=!0;var forQuery=function forQuery(){var testDocURI="https://pod.example/",testDoc=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.sym(testDocURI),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store;kb.removeMany(void 0,void 0,void 0,testDoc);_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.parse('@prefix : <#>.\n@prefix foaf: .\n@prefix sched: .\n@prefix cal: .\n@prefix dc: .\n:event1 dc:author :a0;\n a sched:YesNoMaybe ;\n sched:response :r1, :r2 .\n:a0 foaf:name "Zoe" .\n:a1 foaf:name "Alice" .\n:a2 foaf:name "Bob" .\n:r1 dc:author :a1;\n sched:cell\n [ sched:availabilty sched:No; cal:dtstart "2015-01-01" ],\n [ sched:availabilty sched:Yes; cal:dtstart "2015-01-05"] .\n:r2 dc:author :a2;\n sched:cell\n [ sched:availabilty sched:Maybe; cal:dtstart "2015-01-01" ] .\n',kb,testDocURI,"text/turtle");var SCHED=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/ns/pim/schedule#"),DC=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://purl.org/dc/elements/1.1/"),ICAL=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/2002/12/cal/ical#"),invitation=kb.sym(testDocURI+"#event1"),query=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Query("Responses"),variables={time:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("time"),author:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("author"),availabilty:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("value"),response:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("response"),cell:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("cell")};query.pat.add(invitation,SCHED("response"),variables.response),query.pat.add(variables.response,DC("author"),variables.author),query.pat.add(variables.response,SCHED("cell"),variables.cell),query.pat.add(variables.cell,SCHED("availabilty"),variables.availabilty),query.pat.add(variables.cell,ICAL("dtstart"),variables.time);var options={cellFunction:function cellFunction(cell,x,y,value){cell.textContent=value?_lib__WEBPACK_IMPORTED_MODULE_7__.utils.label(value):"-"}};return _lib__WEBPACK_IMPORTED_MODULE_7__.matrix.matrixForQuery(document,query,variables.time,variables.author,variables.availabilty,options,(function(){}))};forQuery.storyName="for query",forQuery.parameters={storySource:{source:'() => {\n const testDocURI = "https://pod.example/";\n const testDoc = UI.rdf.sym(testDocURI);\n const kb = UI.store;\n kb.removeMany(undefined, undefined, undefined, testDoc);\n const turtle = `@prefix : <#>.\n@prefix foaf: .\n@prefix sched: .\n@prefix cal: .\n@prefix dc: .\n:event1 dc:author :a0;\n a sched:YesNoMaybe ;\n sched:response :r1, :r2 .\n:a0 foaf:name "Zoe" .\n:a1 foaf:name "Alice" .\n:a2 foaf:name "Bob" .\n:r1 dc:author :a1;\n sched:cell\n [ sched:availabilty sched:No; cal:dtstart "2015-01-01" ],\n [ sched:availabilty sched:Yes; cal:dtstart "2015-01-05"] .\n:r2 dc:author :a2;\n sched:cell\n [ sched:availabilty sched:Maybe; cal:dtstart "2015-01-01" ] .\n`;\n UI.rdf.parse(turtle, kb, testDocURI, "text/turtle");\n const SCHED = UI.rdf.Namespace("http://www.w3.org/ns/pim/schedule#");\n const DC = UI.rdf.Namespace("http://purl.org/dc/elements/1.1/");\n const ICAL = UI.rdf.Namespace("http://www.w3.org/2002/12/cal/ical#");\n const invitation = kb.sym(`${testDocURI}#event1`);\n var query = new UI.rdf.Query("Responses");\n const variables = {\n time: UI.rdf.variable("time"),\n author: UI.rdf.variable("author"),\n availabilty: UI.rdf.variable("value"),\n response: UI.rdf.variable("response"),\n cell: UI.rdf.variable("cell")\n };\n query.pat.add(invitation, SCHED("response"), variables.response);\n query.pat.add(variables.response, DC("author"), variables.author);\n query.pat.add(variables.response, SCHED("cell"), variables.cell);\n query.pat.add(variables.cell, SCHED("availabilty"), variables.availabilty);\n query.pat.add(variables.cell, ICAL("dtstart"), variables.time);\n const options = {\n cellFunction: (cell, x, y, value) => {\n cell.textContent = value ? UI.utils.label(value) : "-";\n }\n };\n return UI.matrix.matrixForQuery(document, query, variables.time, variables.author, variables.availabilty, options, function () {});\n}'}};var componentMeta={title:"Matrix",includeStories:["forQuery"]},mdxStoryNameToKey={"for query":"forQuery"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["forQuery"]},"./src/stories/MediaTypes.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,isAudio:()=>isAudio,isImage:()=>isImage,isVideo:()=>isVideo});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_decorators__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/stories/decorators.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Media Types",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"isaudio"},"isAudio"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#isaudio",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"isAudio",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/audio/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isAudio(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"isvideo"},"isVideo"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#isvideo",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"isVideo",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/video/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isVideo(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"isimage"},"isImage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#isvideo",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"isImage",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/image/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isImage(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"))}))))}MDXContent.isMDXComponent=!0;var isAudio=function isAudio(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/audio/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isAudio(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"))};isAudio.storyName="isAudio",isAudio.parameters={storySource:{source:'() => {\n const type = UI.rdf.namedNode("http://www.w3.org/ns/iana/media-types/audio/");\n UI.store.add(UI.rdf.namedNode("http://example.com/audio.mpeg"), UI.ns.rdf("type"), type);\n return UI.widgets.isAudio(UI.rdf.namedNode("http://example.com/audio.mpeg"));\n}'}},isAudio.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var isVideo=function isVideo(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/video/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isVideo(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"))};isVideo.storyName="isVideo",isVideo.parameters={storySource:{source:'() => {\n const type = UI.rdf.namedNode("http://www.w3.org/ns/iana/media-types/video/");\n UI.store.add(UI.rdf.namedNode("http://example.com/video.mov"), UI.ns.rdf("type"), type);\n return UI.widgets.isVideo(UI.rdf.namedNode("http://example.com/video.mov"));\n}'}},isVideo.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var isImage=function isImage(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/image/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isImage(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"))};isImage.storyName="isImage",isImage.parameters={storySource:{source:'() => {\n const type = UI.rdf.namedNode("http://www.w3.org/ns/iana/media-types/image/");\n UI.store.add(UI.rdf.namedNode("http://example.com/image.jpeg"), UI.ns.rdf("type"), type);\n return UI.widgets.isImage(UI.rdf.namedNode("http://example.com/image.jpeg"));\n}'}},isImage.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var componentMeta={title:"Media Types",includeStories:["isAudio","isVideo","isImage"]},mdxStoryNameToKey={isAudio:"isAudio",isVideo:"isVideo",isImage:"isImage"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["isAudio","isVideo","isImage"]},"./src/stories/Notepad.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,lightColorHash:()=>lightColorHash,manageParticipation:()=>manageParticipation,notepad:()=>notepad,notepadToHtml:()=>notepadToHtml,participationObject:()=>participationObject,renderParticipants:()=>renderParticipants});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Notepad",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"notepad-creates-a-notepad"},"notepad: Creates a notepad"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"In this first example we'll see how you can create a notepad. This method creates input fields\nwhich allow you to provide a notepad component to your application."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"The inputs will be stored to ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://example-user.inrupt.net/public/example-notepad/index.ttl#this",target:"_blank",rel:"nofollow noopener noreferrer"},"https://example-user.inrupt.net/public/example-notepad/index.ttl#this")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"notepad",mdxType:"Story"},(function(){var pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/example-notepad/index.ttl#this"),me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepad(document,pad.doc(),subject,me,{})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"manageparticipation-creates-the-table-to-display-the-participants"},"manageParticipation: Creates the table to display the participants"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"manageParticipation",mdxType:"Story"},(function(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),structure=document.createElement("div"),container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#"),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this"),options={statusArea:container};return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.manageParticipation(document,structure,pad.doc(),subject,me,options)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"notepadtohtml-converts-a-turtle-file-to-an-html"},"notepadToHTML: Converts a Turtle file to an HTML"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"This method converts a pad.ttl document to HTML."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"notepadToHTML",mdxType:"Story"},(function(){var div=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var htmlStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepadToHTML(pad,kb);div.appendChild(document.createTextNode(htmlStr))})),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"lightcolorhash--determines-a-color-to-be-used-for-a-participants-notepad-entry"},"lightColorHash : Determines a color to be used for a participants notepad entry"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"This method returns a hex value for setting the color of the input box of the notepad. It does this by hashing the uri passed in as an argument. Ideally this would be the uri of the person logged in."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"lightColorHash",mdxType:"Story"},(function(){var colorStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.lightColorHash(new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me")),inputBox=document.createElement("INPUT");return inputBox.setAttribute("type","text"),inputBox.style.backgroundColor=colorStr,inputBox}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"renderparticipants-creates-a-table-of-participants-on-a-given-notepad-document"},"renderParticipants: Creates a table of participants on a given notepad document"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Creates the table with the list of participants that have contributed to the given pad that is passed in. This gets called from manageParticipation, but can be used on it's own as well."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"renderParticipants",mdxType:"Story"},(function(){var div=document.createElement("div"),table=document.createElement("table"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var subject=kb.sym("https://test.test#"),tableOfParticipants=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.renderPartipants(document,table,pad,subject,new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me"),{});div.appendChild(tableOfParticipants)})),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"participationobject-contains-the-subject-pad-and-uri-for-the-participants"},"participationObject: Contains the subject, pad and URI for the participants"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"participationObject",mdxType:"Story"},(function(){var container=document.createElement("pre"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,subject=kb.sym("https://test.test#"),fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.participationObject(subject,pad,me)})).then((function(node){container.appendChild(document.createTextNode(JSON.stringify(node,null,2)))})),container}))))}MDXContent.isMDXComponent=!0;var notepad=function notepad(){var pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/example-notepad/index.ttl#this"),me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepad(document,pad.doc(),subject,me,{})};notepad.storyName="notepad",notepad.parameters={storySource:{source:"() => {\n const pad = UI.rdf.namedNode('https://example-user.inrupt.net/public/example-notepad/index.ttl#this');\n const me = new UI.rdf.NamedNode('https://example-user.inrupt.net/profile/card#me');\n const subject = UI.store.sym('https://test.test#');\n const options = {};\n return UI.pad.notepad(document, pad.doc(), subject, me, options);\n}"}};var manageParticipation=function manageParticipation(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),structure=document.createElement("div"),container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#"),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this"),options={statusArea:container};return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.manageParticipation(document,structure,pad.doc(),subject,me,options)};manageParticipation.storyName="manageParticipation",manageParticipation.parameters={storySource:{source:"() => {\n const me = new UI.rdf.NamedNode('https://example-user.inrupt.net/profile/card#me');\n const structure = document.createElement('div');\n const container = document.createElement('div');\n const subject = UI.store.sym('https://test.test#');\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n const options = {\n statusArea: container\n };\n return UI.pad.manageParticipation(document, structure, pad.doc(), subject, me, options);\n}"}};var notepadToHtml=function notepadToHtml(){var div=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var htmlStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepadToHTML(pad,kb);div.appendChild(document.createTextNode(htmlStr))})),div};notepadToHtml.storyName="notepadToHTML",notepadToHtml.parameters={storySource:{source:"() => {\n const div = document.createElement(\"div\");\n const kb = UI.store;\n const fetcher = UI.rdf.fetcher(kb);\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n fetcher.load(pad.doc()).then(() => {\n const htmlStr = UI.pad.notepadToHTML(pad, kb);\n div.appendChild(document.createTextNode(htmlStr));\n });\n return div;\n}"}};var lightColorHash=function lightColorHash(){var colorStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.lightColorHash(new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me")),inputBox=document.createElement("INPUT");return inputBox.setAttribute("type","text"),inputBox.style.backgroundColor=colorStr,inputBox};lightColorHash.storyName="lightColorHash",lightColorHash.parameters={storySource:{source:"() => {\n const colorStr = UI.pad.lightColorHash(new UI.rdf.NamedNode('https://sharonstrats.inrupt.net/profile/card#me'));\n const inputBox = document.createElement('INPUT');\n inputBox.setAttribute(\"type\", \"text\");\n inputBox.style.backgroundColor = colorStr;\n return inputBox;\n}"}};var renderParticipants=function renderParticipants(){var div=document.createElement("div"),table=document.createElement("table"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var subject=kb.sym("https://test.test#"),tableOfParticipants=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.renderPartipants(document,table,pad,subject,new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me"),{});div.appendChild(tableOfParticipants)})),div};renderParticipants.storyName="renderParticipants",renderParticipants.parameters={storySource:{source:"() => {\n const div = document.createElement(\"div\");\n const table = document.createElement('table');\n const kb = UI.store;\n const fetcher = UI.rdf.fetcher(kb);\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n fetcher.load(pad.doc()).then(() => {\n // subject = new NamedNode('test') // this i think the page where a list.. ns.ws('participants') are stored\n const subject = kb.sym('https://test.test#');\n const options = {}; // what to put in options\n //options are used in the button personTR there are the following properties can be defined deleteFunction, link, draggable\n const tableOfParticipants = UI.pad.renderPartipants(document, table, pad, subject, new UI.rdf.NamedNode('https://sharonstrats.inrupt.net/profile/card#me'), options);\n div.appendChild(tableOfParticipants);\n });\n return div;\n}"}};var participationObject=function participationObject(){var container=document.createElement("pre"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,subject=kb.sym("https://test.test#"),fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.participationObject(subject,pad,me)})).then((function(node){container.appendChild(document.createTextNode(JSON.stringify(node,null,2)))})),container};participationObject.storyName="participationObject",participationObject.parameters={storySource:{source:"() => {\n const container = document.createElement(\"pre\");\n const kb = UI.store;\n const subject = kb.sym('https://test.test#');\n const fetcher = UI.rdf.fetcher(kb);\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n fetcher.load(pad.doc()).then(() => {\n const me = new UI.rdf.NamedNode('https://sharonstrats.inrupt.net/profile/card#me');\n return UI.pad.participationObject(subject, pad, me);\n }).then(node => {\n container.appendChild(document.createTextNode(JSON.stringify(node, null, 2)));\n });\n return container;\n}"}};var componentMeta={title:"Notepad",includeStories:["notepad","manageParticipation","notepadToHtml","lightColorHash","renderParticipants","participationObject"]},mdxStoryNameToKey={notepad:"notepad",manageParticipation:"manageParticipation",notepadToHTML:"notepadToHtml",lightColorHash:"lightColorHash",renderParticipants:"renderParticipants",participationObject:"participationObject"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["notepad","manageParticipation","notepadToHtml","lightColorHash","renderParticipants","participationObject"]},"./src/stories/RdfUtils.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,allClassUris:()=>allClassUris,default:()=>__WEBPACK_DEFAULT_EXPORT__,defaultAnnotationStore:()=>defaultAnnotationStore,extractLogUri:()=>extractLogUri,propertyTriage:()=>propertyTriage});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_decorators__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/stories/decorators.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"RDF utilities",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"allclassuris"},"allClassUris"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Retrieve all RDF class URIs from solid-ui's RDF store"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#allclassuris",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"allClassUris",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.allClassURIs()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"defaultannotationstore"},"defaultAnnotationStore"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Make a URI in the Tabulator.org annotation store out of the URI of the thing to be annotated."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#defaultannotationstore",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"defaultAnnotationStore",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.defaultAnnotationStore(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/a/b.html"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"extractloguri"},"extractLogURI"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"To figure out the log URI from the full URI used to invoke the reasoner"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#extractloguri",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"extractLogURI",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){return decodeURIComponent(_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.extractLogURI("https://example.com/logFile=http%3A%2F%2Fexample.org%2Flogs.ttl&rulesFile=ttp%3A%2F%2Fexample.org%2Frules.ttl"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"propertytriage"},"propertyTriage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Figuring which properties we know about"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#propertytriage",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"propertyTriage",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph();return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.propertyTriage(kb)}))))}MDXContent.isMDXComponent=!0;var allClassUris=function allClassUris(){return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.allClassURIs()};allClassUris.storyName="allClassUris",allClassUris.parameters={storySource:{source:'() => {\n UI.store.add(UI.rdf.namedNode("http://example.com/#some-thing"), UI.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), UI.rdf.namedNode("http://example.com/#some-class"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#some-other-thing"), UI.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), UI.rdf.namedNode("http://example.com/#some-other-class"));\n return UI.widgets.allClassURIs();\n}'}},allClassUris.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var defaultAnnotationStore=function defaultAnnotationStore(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.defaultAnnotationStore(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/a/b.html"))};defaultAnnotationStore.storyName="defaultAnnotationStore",defaultAnnotationStore.parameters={storySource:{source:'() => {\n const url = "http://example.com/a/b.html";\n return UI.widgets.defaultAnnotationStore(UI.rdf.namedNode(url));\n}'}},defaultAnnotationStore.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var extractLogUri=function extractLogUri(){return decodeURIComponent(_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.extractLogURI("https://example.com/logFile=http%3A%2F%2Fexample.org%2Flogs.ttl&rulesFile=ttp%3A%2F%2Fexample.org%2Frules.ttl"))};extractLogUri.storyName="extractLogURI",extractLogUri.parameters={storySource:{source:'() => {\n const url = "https://example.com/logFile=http%3A%2F%2Fexample.org%2Flogs.ttl&rulesFile=ttp%3A%2F%2Fexample.org%2Frules.ttl";\n return decodeURIComponent(UI.widgets.extractLogURI(url));\n}'}},extractLogUri.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var propertyTriage=function propertyTriage(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph();return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.propertyTriage(kb)};propertyTriage.storyName="propertyTriage",propertyTriage.parameters={storySource:{source:"() => {\n // FIXME: make this example return actual possible properties\n const kb = UI.rdf.graph();\n return UI.widgets.propertyTriage(kb);\n}"}},propertyTriage.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var componentMeta={title:"RDF utilities",includeStories:["allClassUris","defaultAnnotationStore","extractLogUri","propertyTriage"]},mdxStoryNameToKey={allClassUris:"allClassUris",defaultAnnotationStore:"defaultAnnotationStore",extractLogURI:"extractLogUri",propertyTriage:"propertyTriage"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["allClassUris","defaultAnnotationStore","extractLogUri","propertyTriage"]},"./src/stories/Tabs.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,backgroundColor:()=>backgroundColor,default:()=>__WEBPACK_DEFAULT_EXPORT__,loadTurtleDecorator:()=>loadTurtleDecorator,onClose:()=>onClose,optionItems:()=>optionItems,orientation:()=>orientation,rdfCollection:()=>rdfCollection,renderTab:()=>renderTab,renderTabSettings:()=>renderTabSettings,selectedTab:()=>selectedTab,startEmpty:()=>startEmpty,unsortedTriples:()=>unsortedTriples});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var loadTurtleDecorator=function loadTurtleDecorator(Story){var _Story=Story(),render=_Story.render,data=_Story.data;_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.parse(data,_lib__WEBPACK_IMPORTED_MODULE_8__.store,location.origin,"text/turtle",(function(error){error&&console.error(error)}));var div=document.createElement("div"),pre=document.createElement("pre");return pre.appendChild(document.createTextNode(data)),div.appendChild(pre),div.appendChild(render()),div},layoutProps={loadTurtleDecorator};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Tabs",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-populating-content-using-an-rdf-collection"},"tabWidget: Populating content using an RDF collection"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"In this first example we'll see how you can generate a tabs widget using triples that are formatted as a collection in\nRDF. See ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_tabs_.html#tabwidget",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")," for more\ninfo about how to use the tabWidget."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"The triples belows shows the minimum data you need to start using the tabWidget in combination with store."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"rdf collection",decorators:[loadTurtleDecorator],mdxType:"Story"},(function(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject1"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate1");return{data:"\n@prefix : <#> .\n:subject1\n :predicate1 ( :item1A :item1B ) .\n ",render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject.uri}})}}}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Note that you would probably use ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.rdf.namedNode")," directly from rdflib.js. (E.g. instead of\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.rdf.namedNode")," you would probably make use of namedNode with\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"import { namedNode } from 'rdflib'"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-populating-content-using-unsorted-triples"},"tabWidget: Populating content using unsorted triples"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"In this second example we'll use an unsorted set of triples instead of a collection."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"This is the data we will be working with. Note that we've also added labels to the items to help the widget know how to label the tabs."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Note that we've set option ordered to false in this example."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"unsorted triples",decorators:[loadTurtleDecorator],mdxType:"Story"},(function(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject2"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate2");return{data:'\n@prefix : <#> .\n@prefix rdfs: .\n:subject2\n :predicate2 :item2A, :item2B .\n:item2A\n rdfs:label "Tab 1" .\n:item2B\n rdfs:label "Tab 2" .\n ',render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,ordered:!1,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)}})}}}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-populating-content-using-option-items"},"tabWidget: Populating content using option items"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Finally we can set the items manually by using option items."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"We do not need to use options subject and predicate when using items."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"option items",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"ℹ For the remaining examples we'll use option items to populate our tabs."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-backgroundcolor"},"tabWidget: Option backgroundColor"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Using option ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"backgroundColor")," we can set a specific color (in hex value) to our tabs. It will consider how light a\ncolor is when figuring out which color to set to the text. It will also distinguish between selected and not selected\ntabs by coloring the selected tab a bit darker."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"background color",args:{backgroundColor:"#ff0000"},argTypes:{backgroundColor:{control:{type:"select",options:["#ff0000","#00ff00","#0000ff"]}}},mdxType:"Story"},(function(_ref2){var backgroundColor=_ref2.backgroundColor,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({backgroundColor,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.xP,{story:"background color",mdxType:"Props"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-onclose"},"tabWidget: Option onClose"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"on close",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({onClose:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("closed"),items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-orientation"},"tabWidget: Option orientation"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Using option ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"orientation")," we can set how the tabs and body should be positioned."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"orientation",args:{orientation:"1"},argTypes:{orientation:{control:{type:"select",options:["0","1","2","3"]}}},mdxType:"Story"},">",(function(_ref3){var orientation=_ref3.orientation,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({orientation,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.xP,{story:"orientation",mdxType:"Props"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-rendertab"},"tabWidget: Option renderTab"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderTab")," allows us to override the default behavior for how tabs are rendered, e.g. which text should be shown for each tab."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"renderTab",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.innerText="Go to "+subject.uri}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-rendertabsettings"},"tabWidget: Option renderTabSettings"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderTabSettings")," functions much like ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderMain"),", expect that it is triggered by holding ALT key (Option key on Mac\n) and clicking on a tab."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"renderTabSettings",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTabSettings:function renderTabSettings(bodyMain,subject){bodyMain.innerText="Settings for "+subject.uri}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-selectedtab"},"tabWidget: Option selectedTab"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"selectedTab")," allows you to set which tab should be opened by when the widget is initially rendered. It must be used\nin junction with ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderTab")," since it relies on ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"dataset.name")," being set."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"selectedTab",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.dataset.name=subject.uri,tabDiv.innerText=_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)},selectedTab:item2.uri})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-startempty"},"tabWidget: Option startEmpty"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"startEmpty")," makes it so that the body of a tab isn't shown when initially rendered."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"startEmpty",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],startEmpty:!0,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))))}MDXContent.isMDXComponent=!0;var rdfCollection=function rdfCollection(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject1"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate1");return{data:"\n@prefix : <#> .\n:subject1\n :predicate1 ( :item1A :item1B ) .\n ",render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject.uri}})}}};rdfCollection.storyName="rdf collection",rdfCollection.parameters={storySource:{source:'() => {\n const subject = UI.rdf.namedNode(location.origin + "#subject1");\n const predicate = UI.rdf.namedNode(location.origin + "#predicate1");\n return {\n data: `\n@prefix : <#> .\n:subject1\n :predicate1 ( :item1A :item1B ) .\n `,\n render: () => UI.tabs.tabWidget({\n subject,\n predicate,\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject.uri}`;\n }\n })\n };\n}'}},rdfCollection.decorators=[loadTurtleDecorator];var unsortedTriples=function unsortedTriples(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject2"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate2");return{data:'\n@prefix : <#> .\n@prefix rdfs: .\n:subject2\n :predicate2 :item2A, :item2B .\n:item2A\n rdfs:label "Tab 1" .\n:item2B\n rdfs:label "Tab 2" .\n ',render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,ordered:!1,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)}})}}};unsortedTriples.storyName="unsorted triples",unsortedTriples.parameters={storySource:{source:'() => {\n const subject = UI.rdf.namedNode(location.origin + "#subject2");\n const predicate = UI.rdf.namedNode(location.origin + "#predicate2");\n return {\n data: `\n@prefix : <#> .\n@prefix rdfs: .\n:subject2\n :predicate2 :item2A, :item2B .\n:item2A\n rdfs:label "Tab 1" .\n:item2B\n rdfs:label "Tab 2" .\n `,\n render: () => UI.tabs.tabWidget({\n subject,\n predicate,\n ordered: false,\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${UI.utils.label(subject)}`;\n }\n })\n };\n}'}},unsortedTriples.decorators=[loadTurtleDecorator];var optionItems=function optionItems(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};optionItems.storyName="option items",optionItems.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var backgroundColor=function backgroundColor(_ref4){var backgroundColor=_ref4.backgroundColor,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({backgroundColor,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};backgroundColor.storyName="background color",backgroundColor.argTypes={backgroundColor:{control:{type:"select",options:["#ff0000","#00ff00","#0000ff"]}}},backgroundColor.args={backgroundColor:"#ff0000"},backgroundColor.parameters={storySource:{source:'({\n backgroundColor\n}) => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n backgroundColor,\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var onClose=function onClose(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({onClose:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("closed"),items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};onClose.storyName="on close",onClose.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n onClose: action("closed"),\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var orientation=function orientation(_ref5){var orientation=_ref5.orientation,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({orientation,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};orientation.storyName="orientation",orientation.argTypes={orientation:{control:{type:"select",options:["0","1","2","3"]}}},orientation.args={orientation:"1"},orientation.parameters={storySource:{source:'({\n orientation\n}) => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n orientation,\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var renderTab=function renderTab(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.innerText="Go to "+subject.uri}})};renderTab.storyName="renderTab",renderTab.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n },\n renderTab: (tabDiv, subject) => {\n tabDiv.innerText = `Go to ${subject.uri}`;\n }\n });\n}'}};var renderTabSettings=function renderTabSettings(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTabSettings:function renderTabSettings(bodyMain,subject){bodyMain.innerText="Settings for "+subject.uri}})};renderTabSettings.storyName="renderTabSettings",renderTabSettings.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n },\n renderTabSettings: (bodyMain, subject) => {\n bodyMain.innerText = `Settings for ${subject.uri}`;\n }\n });\n}'}};var selectedTab=function selectedTab(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.dataset.name=subject.uri,tabDiv.innerText=_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)},selectedTab:item2.uri})};selectedTab.storyName="selectedTab",selectedTab.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n },\n renderTab: (tabDiv, subject) => {\n tabDiv.dataset.name = subject.uri;\n tabDiv.innerText = UI.utils.label(subject);\n },\n selectedTab: item2.uri\n });\n}'}};var startEmpty=function startEmpty(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],startEmpty:!0,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};startEmpty.storyName="startEmpty",startEmpty.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n startEmpty: true,\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var componentMeta={title:"Tabs",includeStories:["rdfCollection","unsortedTriples","optionItems","backgroundColor","onClose","orientation","renderTab","renderTabSettings","selectedTab","startEmpty"]},mdxStoryNameToKey={"rdf collection":"rdfCollection","unsorted triples":"unsortedTriples","option items":"optionItems","background color":"backgroundColor","on close":"onClose",orientation:"orientation",renderTab:"renderTab",renderTabSettings:"renderTabSettings",selectedTab:"selectedTab",startEmpty:"startEmpty"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["loadTurtleDecorator","rdfCollection","unsortedTriples","optionItems","backgroundColor","onClose","orientation","renderTab","renderTabSettings","selectedTab","startEmpty"]},"./src/stories/Widgets.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,twoLineTransactions:()=>twoLineTransactions,twoLineTrip:()=>twoLineTrip,twoLineWidgetForClass:()=>twoLineWidgetForClass});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Widgets",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"twolinetransactions"},"twoLineTransactions"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Display a transaction"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#twolinetransaction",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"twoLineTransactions",mdxType:"Story"},(function(){var twoLineTransaction=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/2000/10/swap/pim/qif#Transaction"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#transaction");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("payee"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://payee.com/#me")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("date"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("amount"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("20 USD")),twoLineTransaction(document,thing)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"twolinetrip"},"twoLineTrip"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Display a trip"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#twolinetrip",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"twoLineTrip",mdxType:"Story"},(function(){var twoLineTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/ns/pim/trip#Trip"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.dc("title"),"Some trip"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtstart"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtend"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-02-02")),twoLineTrip(document,thing)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"twolinewidgetforclass"},"twoLineWidgetForClass"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Find a function that can create a widget for a given class"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#twolinewidgetforclass",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"twoLineWidgetForClass",mdxType:"Story"},(function(){var rdfClass=_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Person"),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine.widgetForClass(rdfClass)(document,thing)}))))}MDXContent.isMDXComponent=!0;var twoLineTransactions=function twoLineTransactions(){var twoLineTransaction=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/2000/10/swap/pim/qif#Transaction"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#transaction");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("payee"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://payee.com/#me")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("date"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("amount"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("20 USD")),twoLineTransaction(document,thing)};twoLineTransactions.storyName="twoLineTransactions",twoLineTransactions.parameters={storySource:{source:'() => {\n const twoLineTransaction = UI.widgets.index.twoLine["http://www.w3.org/2000/10/swap/pim/qif#Transaction"];\n const thing = UI.rdf.namedNode("http://example.com/#transaction");\n UI.store.add(thing, UI.ns.qu("payee"), UI.rdf.namedNode("https://payee.com/#me"));\n UI.store.add(thing, UI.ns.qu("date"), UI.rdf.literal("2020-01-01"));\n UI.store.add(thing, UI.ns.qu("amount"), UI.rdf.literal("20 USD"));\n return twoLineTransaction(document, thing);\n}'}};var twoLineTrip=function twoLineTrip(){var twoLineTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/ns/pim/trip#Trip"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.dc("title"),"Some trip"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtstart"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtend"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-02-02")),twoLineTrip(document,thing)};twoLineTrip.storyName="twoLineTrip",twoLineTrip.parameters={storySource:{source:'() => {\n const twoLineTrip = UI.widgets.index.twoLine["http://www.w3.org/ns/pim/trip#Trip"];\n const thing = UI.rdf.namedNode("http://example.com/#trip");\n UI.store.add(thing, UI.ns.dc("title"), "Some trip");\n UI.store.add(thing, UI.ns.cal("dtstart"), UI.rdf.literal("2020-01-01"));\n UI.store.add(thing, UI.ns.cal("dtend"), UI.rdf.literal("2020-02-02"));\n return twoLineTrip(document, thing);\n}'}};var twoLineWidgetForClass=function twoLineWidgetForClass(){var rdfClass=_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Person"),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine.widgetForClass(rdfClass)(document,thing)};twoLineWidgetForClass.storyName="twoLineWidgetForClass",twoLineWidgetForClass.parameters={storySource:{source:'() => {\n const rdfClass = UI.ns.foaf("Person");\n const thing = UI.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");\n const widgetFunction = UI.widgets.index.twoLine.widgetForClass(rdfClass);\n const widget = widgetFunction(document, thing);\n return widget;\n}'}};var componentMeta={title:"Widgets",includeStories:["twoLineTransactions","twoLineTrip","twoLineWidgetForClass"]},mdxStoryNameToKey={twoLineTransactions:"twoLineTransactions",twoLineTrip:"twoLineTrip",twoLineWidgetForClass:"twoLineWidgetForClass"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["twoLineTransactions","twoLineTrip","twoLineWidgetForClass"]},"./src/stories/forms/Fields.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,basicFields:()=>basicFields,default:()=>__WEBPACK_DEFAULT_EXPORT__,formGroupNoAlready:()=>formGroupNoAlready,formGroupWithAlready:()=>formGroupWithAlready});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Forms/fields",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"basic-fields"},"basic fields"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"basic fields",mdxType:"Story"},(function(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),doc=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/"),callbackFunction=function callbackFunction(ok,errorMessage){console.log(ok,errorMessage,document.getElementById("div-basicField").innerHTML)};return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("property"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#some-property"),doc),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},["PhoneField","EmailField","ColorField","DateField","DateTimeField","TimeField","NumericField","IntegerField","DecimalField","FloatField","TextField","SingleLineTextField","NamedNodeURIField"].forEach((function(fieldName){_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui(fieldName).uri](document,container,already,subject,form,doc,callbackFunction)})),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"uiwidgetsfielduinsuiformuri--uiwidgetsfielduinsuigroupuri-no-already"},"UI.widgets.field","[UI.ns.ui('Form').uri]"," / UI.widgets.field","[UI.ns.ui('Group').uri]",", no already"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"form / group, no already",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store");return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("parts"),new _lib__WEBPACK_IMPORTED_MODULE_8__.rdf.Collection([_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2")]),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 1 of the form]"),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 2 of the form]"),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Form").uri](document,container,{},subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"uiwidgetsfielduinsuiformuri--xuiwidgetsfielduinsuigroupuri-with-already"},"UI.widgets.field","[UI.ns.ui('Form').uri]"," / xUI.widgets.field","[UI.ns.ui('Group').uri]",", with already"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.widgets.field[UI.ns.ui('Group').uri]")," is currently synonymous with ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.widgets.field[UI.ns.ui('Form').uri]"),", but\nthis additional example shows the use of ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"already"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"form / group, with already",mdxType:"Story"},(function(){var _already,container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store"),already=((_already={})[subject.toNT()+"|"+form.toNT()]=!0,_already);return document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Group").uri](document,container,already,subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container}))))}MDXContent.isMDXComponent=!0;var basicFields=function basicFields(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),doc=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/"),callbackFunction=function callbackFunction(ok,errorMessage){console.log(ok,errorMessage,document.getElementById("div-basicField").innerHTML)};return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("property"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#some-property"),doc),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},["PhoneField","EmailField","ColorField","DateField","DateTimeField","TimeField","NumericField","IntegerField","DecimalField","FloatField","TextField","SingleLineTextField","NamedNodeURIField"].forEach((function(fieldName){_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui(fieldName).uri](document,container,already,subject,form,doc,callbackFunction)})),container};basicFields.storyName="basic fields",basicFields.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://example.com/#this");\n const form = UI.rdf.namedNode("http://example.com/#form");\n const doc = UI.rdf.namedNode("http://example.com/");\n const callbackFunction = (ok, errorMessage) => {\n console.log(ok, errorMessage, document.getElementById("div-basicField").innerHTML);\n };\n UI.store.add(form, UI.ns.ui("property"), UI.rdf.namedNode("http://example.com/#some-property"), doc);\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n document.outlineManager = {\n appendPropertyTRs: () => {}\n };\n ["PhoneField", "EmailField", "ColorField", "DateField", "DateTimeField", "TimeField", "NumericField", "IntegerField", "DecimalField", "FloatField", "TextField", "SingleLineTextField", "NamedNodeURIField"].forEach(fieldName => {\n UI.widgets.field[UI.ns.ui(fieldName).uri](document, container, already, subject, form, doc, callbackFunction);\n });\n return container;\n}'}};var formGroupNoAlready=function formGroupNoAlready(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store");return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("parts"),new _lib__WEBPACK_IMPORTED_MODULE_8__.rdf.Collection([_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2")]),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 1 of the form]"),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 2 of the form]"),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Form").uri](document,container,{},subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container};formGroupNoAlready.storyName="form / group, no already",formGroupNoAlready.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://example.com/#this");\n const form = UI.rdf.namedNode("http://example.com/#form");\n const store = UI.rdf.namedNode("http://example.com/#store");\n UI.store.add(form, UI.ns.ui("parts"), new UI.rdf.Collection([UI.rdf.namedNode("http://example.com/#part1"), UI.rdf.namedNode("http://example.com/#part2")]), UI.rdf.namedNode("http://example.com/"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#part1"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#part1"), UI.ns.ui("contents"), "[this is part 1 of the form]");\n UI.store.add(UI.rdf.namedNode("http://example.com/#part2"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#part2"), UI.ns.ui("contents"), "[this is part 2 of the form]");\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n document.outlineManager = {\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Form").uri](document, container, already, subject, form, store, action("callback"));\n return container;\n}'}};var formGroupWithAlready=function formGroupWithAlready(){var _already2,container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store"),already=((_already2={})[subject.toNT()+"|"+form.toNT()]=!0,_already2);return document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Group").uri](document,container,already,subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container};formGroupWithAlready.storyName="form / group, with already",formGroupWithAlready.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const subject = UI.rdf.namedNode("http://example.com/#this");\n const form = UI.rdf.namedNode("http://example.com/#form");\n const store = UI.rdf.namedNode("http://example.com/#store");\n const key = subject.toNT() + "|" + form.toNT();\n const already = {\n [key]: true\n };\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n document.outlineManager = {\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Group").uri](document, container, already, subject, form, store, action("callback"));\n return container;\n}'}};var componentMeta={title:"Forms/fields",includeStories:["basicFields","formGroupNoAlready","formGroupWithAlready"]},mdxStoryNameToKey={"basic fields":"basicFields","form / group, no already":"formGroupNoAlready","form / group, with already":"formGroupWithAlready"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["basicFields","formGroupNoAlready","formGroupWithAlready"]},"./src/stories/forms/Forms.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,live:()=>live,trivialCommentField:()=>trivialCommentField});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.h_,{title:"Forms/appendForm",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("h2",{id:"appendform"},"appendForm"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("h3",{id:"trivial--comment-field"},"trivial / Comment field"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("p",null,"This example shows a trivial use of the ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("inlineCode",{parentName:"p"},"appendForm")," function, in conjunction with a Comment field."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.oG,{name:"trivial / Comment field",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#subject"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),doc=subject.doc();return _lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("contents"),"[a trivial form with just a comment]"),_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,{},subject,form,doc),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("h3",{id:"live"},"live"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.oG,{name:"live",mdxType:"Story"},(function(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#form1"),doc=subject.doc(),loadProfile=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(doc),loadForm=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(form.doc());return Promise.all([loadProfile,loadForm]).then((function(){_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,already,subject,form,doc)})),container}))))}MDXContent.isMDXComponent=!0;var trivialCommentField=function trivialCommentField(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#subject"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),doc=subject.doc();return _lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("contents"),"[a trivial form with just a comment]"),_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,{},subject,form,doc),container};trivialCommentField.storyName="trivial / Comment field",trivialCommentField.parameters={storySource:{source:"() => {\n const container = document.createElement(\"div\");\n const already = {};\n const subject = UI.rdf.namedNode('http://example.com/#subject');\n const form = UI.rdf.namedNode('http://example.com/#form');\n const doc = subject.doc();\n UI.store.add(UI.rdf.namedNode('http://example.com/#form'), UI.ns.rdf('type'), UI.ns.ui('Comment'));\n UI.store.add(UI.rdf.namedNode('http://example.com/#form'), UI.ns.ui('contents'), '[a trivial form with just a comment]');\n UI.widgets.appendForm(document, container, already, subject, form, doc);\n return container;\n}"}};var live=function live(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#form1"),doc=subject.doc(),loadProfile=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(doc),loadForm=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(form.doc());return Promise.all([loadProfile,loadForm]).then((function(){_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,already,subject,form,doc)})),container};live.storyName="live",live.parameters={storySource:{source:"() => {\n const container = document.createElement(\"div\");\n const already = {};\n const subject = UI.rdf.namedNode('https://michielbdejong.inrupt.net/profile/card#me');\n const form = UI.rdf.namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#form1');\n const doc = subject.doc();\n const loadProfile = UI.store.fetcher.load(doc);\n const loadForm = UI.store.fetcher.load(form.doc());\n Promise.all([loadProfile, loadForm]).then(() => {\n UI.widgets.appendForm(document, container, already, subject, form, doc);\n });\n return container;\n}"}};var componentMeta={title:"Forms/appendForm",includeStories:["trivialCommentField","live"]},mdxStoryNameToKey={"trivial / Comment field":"trivialCommentField",live:"live"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["trivialCommentField","live"]},"./src/stories/forms/Intro.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,__page:()=>__page,default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_excluded=(__webpack_require__("./lib/index.js"),["components"]);function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Forms/Documentation",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"see-also"},"See also"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("ul",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/solid-ui/Documentation/forms-intro.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Forms intro")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/solid-ui//Documentation/form-ecosystem.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Form ecosystem")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/form-playground/playground.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Form Playground")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/form-playground/browse.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Form Browse")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/solid-ui/Documentation/api/",target:"_blank",rel:"nofollow noopener noreferrer"},"API docs"))))}MDXContent.isMDXComponent=!0;var __page=function __page(){throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};var componentMeta={title:"Forms/Documentation",includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["__page"]},"./src/stories/forms/Options.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,dependingOn:()=>dependingOn,usingRdfTypes:()=>usingRdfTypes});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Forms/Options",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"uiwidgetsfielduinsuioptionsuri-using-rdf-types"},"UI.widgets.field","[UI.ns.ui('Options').uri]",", using RDF types"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"using RDF types",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for houses]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for cows]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"uiwidgetsfielduinsuioptionsuri-using-dependingon"},"UI.widgets.field","[UI.ns.ui('Options').uri]",", using dependingOn"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"depending on",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("dependingOn"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for developers]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for power users]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container}))))}MDXContent.isMDXComponent=!0;var usingRdfTypes=function usingRdfTypes(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for houses]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for cows]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container};usingRdfTypes.storyName="using RDF types",usingRdfTypes.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://first.example/#this");\n const exampleOptionsField = UI.rdf.namedNode("http://first.example/#exampleOptionsField");\n const store = UI.rdf.namedNode("http://first.example/#store");\n /* UI to display in case subject is a house: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://first.example/#if-subject-is-house"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-house"), UI.ns.ui("for"), UI.rdf.namedNode("http://first.example/#house"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-house"), UI.ns.ui("use"), UI.rdf.namedNode("http://first.example/#number-of-bedrooms"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-bedrooms"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-bedrooms"), UI.ns.ui("contents"), "[UI for houses]");\n /* UI to display in case subject is a cow: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://first.example/#if-subject-is-cow"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-cow"), UI.ns.ui("for"), UI.rdf.namedNode("http://first.example/#cow"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-cow"), UI.ns.ui("use"), UI.rdf.namedNode("http://first.example/#number-of-legs"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-legs"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-legs"), UI.ns.ui("contents"), "[UI for cows]");\n UI.store.add(subject, UI.ns.rdf("type"), UI.rdf.namedNode("http://first.example/#cow"), UI.rdf.namedNode("http://first.example/")); // Subject is a cow, so it should display [UI for cows]\n document.outlineManager = {\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Options").uri](document, container, already, subject, exampleOptionsField, store, action("callback"));\n return container;\n}'}};var dependingOn=function dependingOn(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("dependingOn"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for developers]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for power users]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container};dependingOn.storyName="depending on",dependingOn.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://second.example/#this");\n const exampleOptionsField = UI.rdf.namedNode("http://second.example/#exampleOptionsField");\n const store = UI.rdf.namedNode("http://second.example/#store");\n /* This form depends on persona: */\n UI.store.add(exampleOptionsField, UI.ns.ui("dependingOn"), UI.rdf.namedNode("http://second.example/#persona"), UI.rdf.namedNode("http://second.example/"));\n /* UI to display in case subject is developer: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://second.example/#if-subject-is-developer"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-developer"), UI.ns.ui("for"), UI.rdf.namedNode("http://second.example/#developer"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-developer"), UI.ns.ui("use"), UI.rdf.namedNode("http://second.example/#ui-for-developers"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-developers"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-developers"), UI.ns.ui("contents"), "[UI for developers]");\n /* UI to display in case subject is power user: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://second.example/#if-subject-is-power-user"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-power-user"), UI.ns.ui("for"), UI.rdf.namedNode("http://second.example/#power-user"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-power-user"), UI.ns.ui("use"), UI.rdf.namedNode("http://second.example/#ui-for-power-users"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-power-users"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-power-users"), UI.ns.ui("contents"), "[UI for power users]");\n /* Subject is both a developer and a power user, so it should display both [UI for developers] and [UI for\n power users] */\n UI.store.add(subject, UI.rdf.namedNode("http://second.example/#persona"), UI.rdf.namedNode("http://second.example/#developer"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(subject, UI.rdf.namedNode("http://second.example/#persona"), UI.rdf.namedNode("http://second.example/#power-user"), UI.rdf.namedNode("http://second.example/"));\n document.outlineManager = {\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Options").uri](document, container, already, subject, exampleOptionsField, store, action("callback"));\n return container;\n}'}};var componentMeta={title:"Forms/Options",includeStories:["usingRdfTypes","dependingOn"]},mdxStoryNameToKey={"using RDF types":"usingRdfTypes","depending on":"dependingOn"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["usingRdfTypes","dependingOn"]},"./src/stories/iconForClass.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,forSolidAppProviderClass:()=>forSolidAppProviderClass,iconDecorator:()=>iconDecorator});__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var iconDecorator=function iconDecorator(Story){return"\n "+Story().map((function(_ref){var className=_ref.className,icon=_ref.icon;return"'})).join("")+"\n
                                                          classNameiconPreview
                                                          "+className+""+icon+'
                                                          "},layoutProps={iconDecorator};function MDXContent(_ref2){var components=_ref2.components,props=_objectWithoutProperties(_ref2,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.h_,{title:"iconForClass",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h1",{id:"iconforclass"},"iconForClass"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Best logo or avatar or photo etc to represent someone or some group etc"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#iconforclass",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"for-solidappproviderclass"},"for solid:AppProviderClass"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"for solid:AppProviderClass",decorators:[iconDecorator],mdxType:"Story"},(function(){return Object.keys(_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass).map((function(className){return{className,icon:_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass[className]}}))}))))}MDXContent.isMDXComponent=!0;var forSolidAppProviderClass=function forSolidAppProviderClass(){return Object.keys(_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass).map((function(className){return{className,icon:_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass[className]}}))};forSolidAppProviderClass.storyName="for solid:AppProviderClass",forSolidAppProviderClass.parameters={storySource:{source:"() => Object.keys(UI.widgets.iconForClass).map(className => {\n const icon = UI.widgets.iconForClass[className];\n return {\n className,\n icon\n };\n})"}},forSolidAppProviderClass.decorators=[iconDecorator];var componentMeta={title:"iconForClass",includeStories:["forSolidAppProviderClass"]},mdxStoryNameToKey={"for solid:AppProviderClass":"forSolidAppProviderClass"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["iconDecorator","forSolidAppProviderClass"]},"./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$",module.exports=webpackEmptyContext},"./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$":(module,__unused_webpack_exports,__webpack_require__)=>{var map={"./stories/Buttons.stories.mdx":"./src/stories/Buttons.stories.mdx","./stories/DateTime.stories.mdx":"./src/stories/DateTime.stories.mdx","./stories/Display.stories.mdx":"./src/stories/Display.stories.mdx","./stories/DomManipulation.stories.mdx":"./src/stories/DomManipulation.stories.mdx","./stories/DragAndDrop.stories.mdx":"./src/stories/DragAndDrop.stories.mdx","./stories/Events.stories.mdx":"./src/stories/Events.stories.mdx","./stories/Header.stories.mdx":"./src/stories/Header.stories.mdx","./stories/Images.stories.mdx":"./src/stories/Images.stories.mdx","./stories/Interactive.stories.mdx":"./src/stories/Interactive.stories.mdx","./stories/Log.stories.mdx":"./src/stories/Log.stories.mdx","./stories/Matrix.stories.mdx":"./src/stories/Matrix.stories.mdx","./stories/MediaTypes.stories.mdx":"./src/stories/MediaTypes.stories.mdx","./stories/Notepad.stories.mdx":"./src/stories/Notepad.stories.mdx","./stories/RdfUtils.stories.mdx":"./src/stories/RdfUtils.stories.mdx","./stories/Tabs.stories.mdx":"./src/stories/Tabs.stories.mdx","./stories/Widgets.stories.mdx":"./src/stories/Widgets.stories.mdx","./stories/forms/Fields.stories.mdx":"./src/stories/forms/Fields.stories.mdx","./stories/forms/Forms.stories.mdx":"./src/stories/forms/Forms.stories.mdx","./stories/forms/Intro.stories.mdx":"./src/stories/forms/Intro.stories.mdx","./stories/forms/Options.stories.mdx":"./src/stories/forms/Options.stories.mdx","./stories/iconForClass.stories.mdx":"./src/stories/iconForClass.stories.mdx"};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){if(!__webpack_require__.o(map,req)){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}return map[req]}webpackContext.keys=function webpackContextKeys(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id="./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},"?4f7e":()=>{},"./generated-stories-entry.cjs":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module=__webpack_require__.nmd(module),(0,__webpack_require__("./node_modules/@storybook/html/dist/esm/client/index.js").configure)([__webpack_require__("./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$"),__webpack_require__("./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$")],module,!1)}},__webpack_require__=>{var __webpack_exec__=moduleId=>__webpack_require__(__webpack_require__.s=moduleId);__webpack_require__.O(0,[333],(()=>(__webpack_exec__("./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js"),__webpack_exec__("./node_modules/@storybook/core-client/dist/esm/globals/globals.js"),__webpack_exec__("./storybook-init-framework-entry.js"),__webpack_exec__("./node_modules/@storybook/html/dist/esm/client/preview/config-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/html/dist/esm/client/docs/config-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-links/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-actions/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-docs/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-backgrounds/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-measure/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-outline/preview.js-generated-config-entry.js"),__webpack_exec__("./.storybook/preview.js-generated-config-entry.js"),__webpack_exec__("./generated-stories-entry.cjs"))));__webpack_require__.O()}]); \ No newline at end of file +/*! For license information please see main.def0ebf5.iframe.bundle.js.LICENSE.txt */ +(self.webpackChunksolid_ui=self.webpackChunksolid_ui||[]).push([[179],{"./.storybook/preview.js-generated-config-entry.js":(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var preview_namespaceObject={};__webpack_require__.r(preview_namespaceObject),__webpack_require__.d(preview_namespaceObject,{__namedExportsOrder:()=>__namedExportsOrder,parameters:()=>parameters});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var ClientApi=__webpack_require__("./node_modules/@storybook/client-api/dist/esm/ClientApi.js"),parameters={actions:{argTypesRegex:"^on[A-Z].*"}},__namedExportsOrder=["parameters"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.keys(preview_namespaceObject).forEach((function(key){var value=preview_namespaceObject[key];switch(key){case"args":return(0,ClientApi.uc)(value);case"argTypes":return(0,ClientApi.v9)(value);case"decorators":return value.forEach((function(decorator){return(0,ClientApi.$9)(decorator,!1)}));case"loaders":return value.forEach((function(loader){return(0,ClientApi.HZ)(loader,!1)}));case"parameters":return(0,ClientApi.h1)(function _objectSpread(target){for(var i=1;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AccessController=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),_acl=__webpack_require__("./lib/acl/acl.js"),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_accessGroups=__webpack_require__("./lib/acl/access-groups.js"),_aclControl=__webpack_require__("./lib/acl/acl-control.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.AccessController=function(){function AccessController(subject,noun,context,statusElement,targetIsProtected,targetDoc,targetACLDoc,defaultHolder,defaultACLDoc,prospectiveDefaultHolder,store,dom){if((0,_classCallCheck2.default)(this,AccessController),this.subject=subject,this.noun=noun,this.context=context,this.statusElement=statusElement,this.targetIsProtected=targetIsProtected,this.targetDoc=targetDoc,this.targetACLDoc=targetACLDoc,this.defaultHolder=defaultHolder,this.defaultACLDoc=defaultACLDoc,this.prospectiveDefaultHolder=prospectiveDefaultHolder,this.store=store,this.dom=dom,(0,_defineProperty2.default)(this,"mainCombo",void 0),(0,_defineProperty2.default)(this,"defaultsCombo",void 0),(0,_defineProperty2.default)(this,"isContainer",void 0),(0,_defineProperty2.default)(this,"defaultsDiffer",void 0),(0,_defineProperty2.default)(this,"rootElement",void 0),(0,_defineProperty2.default)(this,"isUsingDefaults",void 0),this.rootElement=dom.createElement("div"),this.rootElement.setAttribute("style",style.aclGroupContent),this.isContainer="/"===targetDoc.uri.slice(-1),defaultHolder&&defaultACLDoc){this.isUsingDefaults=!0;var aclDefaultStore=(0,_acl.adoptACLDefault)(this.targetDoc,targetACLDoc,defaultHolder,defaultACLDoc);this.mainCombo=new _accessGroups.AccessGroups(targetDoc,targetACLDoc,this,aclDefaultStore,{defaults:this.isContainer}),this.defaultsCombo=null,this.defaultsDiffer=!1}else this.isUsingDefaults=!1,this.mainCombo=new _accessGroups.AccessGroups(targetDoc,targetACLDoc,this,store),this.defaultsCombo=new _accessGroups.AccessGroups(targetDoc,targetACLDoc,this,store,{defaults:this.isContainer}),this.defaultsDiffer=!(0,_acl.sameACL)(this.mainCombo.aclMap,this.defaultsCombo.aclMap)}var _removeDefaults,_removeAcls,_addDefaults,_addAcls;return(0,_createClass2.default)(AccessController,[{key:"isEditable",get:function get(){return!this.isUsingDefaults}},{key:"render",value:function render(){if(this.rootElement.innerHTML="",this.isUsingDefaults){if(this.renderStatus("The sharing for this ".concat(this.noun," is the default for folder ")),this.defaultHolder){var defaultHolderLink=this.statusElement.appendChild(this.dom.createElement("a"));defaultHolderLink.href=this.defaultHolder.uri,defaultHolderLink.innerText=(0,_aclControl.shortNameForFolder)(this.defaultHolder)}}else!this.defaultsDiffer&&this.isContainer?this.renderStatus("This is also the default for things in this folder."):this.renderStatus("");return this.rootElement.appendChild(this.mainCombo.render()),this.defaultsCombo&&this.defaultsDiffer?(this.rootElement.appendChild(this.renderRemoveDefaultsController()),this.rootElement.appendChild(this.defaultsCombo.render())):this.isEditable&&this.isContainer&&this.rootElement.appendChild(this.renderAddDefaultsController()),!this.targetIsProtected&&this.isUsingDefaults?this.rootElement.appendChild(this.renderAddAclsController()):this.targetIsProtected||this.rootElement.appendChild(this.renderRemoveAclsController()),this.rootElement}},{key:"renderRemoveAclsController",value:function renderRemoveAclsController(){var _this=this,useDefaultButton=this.dom.createElement("button");return useDefaultButton.innerText="Remove custom sharing settings for this ".concat(this.noun," -- just use default").concat(this.prospectiveDefaultHolder?" for ".concat(utils.label(this.prospectiveDefaultHolder)):""),useDefaultButton.setAttribute("style",style.bigButton),useDefaultButton.addEventListener("click",(function(){return _this.removeAcls().then((function(){return _this.render()})).catch((function(error){return _this.renderStatus(error)}))})),useDefaultButton}},{key:"renderAddAclsController",value:function renderAddAclsController(){var _this2=this,addAclButton=this.dom.createElement("button");return addAclButton.innerText="Set specific sharing for this ".concat(this.noun),addAclButton.setAttribute("style",style.bigButton),addAclButton.addEventListener("click",(function(){return _this2.addAcls().then((function(){return _this2.render()})).catch((function(error){return _this2.renderStatus(error)}))})),addAclButton}},{key:"renderAddDefaultsController",value:function renderAddDefaultsController(){var _this3=this,containerElement=this.dom.createElement("div");containerElement.setAttribute("style",style.defaultsController);var noticeElement=containerElement.appendChild(this.dom.createElement("div"));noticeElement.innerText="Sharing for things within the folder currently tracks sharing for the folder.",noticeElement.setAttribute("style",style.defaultsControllerNotice);var button=containerElement.appendChild(this.dom.createElement("button"));return button.innerText="Set the sharing of folder contents separately from the sharing for the folder",button.setAttribute("style",style.bigButton),button.addEventListener("click",(function(){return _this3.addDefaults().then((function(){return _this3.render()}))})),containerElement}},{key:"renderRemoveDefaultsController",value:function renderRemoveDefaultsController(){var _this4=this,containerElement=this.dom.createElement("div");containerElement.setAttribute("style",style.defaultsController);var noticeElement=containerElement.appendChild(this.dom.createElement("div"));noticeElement.innerText="Access to things within this folder:",noticeElement.setAttribute("style",style.defaultsControllerNotice);var button=containerElement.appendChild(this.dom.createElement("button"));return button.innerText="Set default for folder contents to just track the sharing for the folder",button.setAttribute("style",style.bigButton),button.addEventListener("click",(function(){return _this4.removeDefaults().then((function(){return _this4.render()})).catch((function(error){return _this4.renderStatus(error)}))})),containerElement}},{key:"renderTemporaryStatus",value:function renderTemporaryStatus(message){var _this5=this;this.statusElement.setAttribute("style",style.aclControlBoxStatusRevealed),this.statusElement.innerText=message,this.statusElement.setAttribute("style",style.temporaryStatusInit),setTimeout((function(){_this5.statusElement.setAttribute("style",style.temporaryStatusEnd)})),setTimeout((function(){_this5.statusElement.innerText=""}),5e3)}},{key:"renderStatus",value:function renderStatus(message){message||this.statusElement.setAttribute("style",style.aclControlBoxStatusRevealed),this.statusElement.innerText=message}},{key:"addAcls",value:(_addAcls=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(){var message,_message,_this6=this;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(this.defaultHolder&&this.defaultACLDoc){_context.next=4;break}return message="Unable to find defaults to copy",debug.error(message),_context.abrupt("return",Promise.reject(message));case 4:return(0,_acl.adoptACLDefault)(this.targetDoc,this.targetACLDoc,this.defaultHolder,this.defaultACLDoc).statements.forEach((function(st){return _this6.store.add(st.subject,st.predicate,st.object,_this6.targetACLDoc)})),_context.prev=6,_context.next=9,this.store.fetcher.putBack(this.targetACLDoc);case 9:return this.isUsingDefaults=!1,_context.abrupt("return",Promise.resolve());case 13:return _context.prev=13,_context.t0=_context.catch(6),_message=" Error writing back access control file! ".concat(_context.t0),debug.error(_message),_context.abrupt("return",Promise.reject(_message));case 18:case"end":return _context.stop()}}),_callee,this,[[6,13]])}))),function addAcls(){return _addAcls.apply(this,arguments)})},{key:"addDefaults",value:(_addDefaults=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(){return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:this.defaultsCombo=new _accessGroups.AccessGroups(this.targetDoc,this.targetACLDoc,this,this.store,{defaults:!0}),this.defaultsDiffer=!0;case 2:case"end":return _context2.stop()}}),_callee2,this)}))),function addDefaults(){return _addDefaults.apply(this,arguments)})},{key:"removeAcls",value:(_removeAcls=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(){var message;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.prev=0,_context3.next=3,this.store.fetcher.delete(this.targetACLDoc.uri,{});case 3:return this.isUsingDefaults=!0,_context3.prev=4,_context3.next=7,(0,_acl.getProspectiveHolder)(this.targetDoc.uri);case 7:this.prospectiveDefaultHolder=_context3.sent,_context3.next=13;break;case 10:_context3.prev=10,_context3.t0=_context3.catch(4),debug.warn(_context3.t0);case 13:_context3.next=20;break;case 15:return _context3.prev=15,_context3.t1=_context3.catch(0),message="Error deleting access control file: ".concat(this.targetACLDoc,": ").concat(_context3.t1),debug.error(message),_context3.abrupt("return",Promise.reject(message));case 20:case"end":return _context3.stop()}}),_callee3,this,[[0,15],[4,10]])}))),function removeAcls(){return _removeAcls.apply(this,arguments)})},{key:"removeDefaults",value:(_removeDefaults=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(){var fallbackCombo;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return fallbackCombo=this.defaultsCombo,_context4.prev=1,this.defaultsCombo=null,this.defaultsDiffer=!1,_context4.next=6,this.save();case 6:_context4.next=14;break;case 8:return _context4.prev=8,_context4.t0=_context4.catch(1),this.defaultsCombo=fallbackCombo,this.defaultsDiffer=!0,debug.error(_context4.t0),_context4.abrupt("return",Promise.reject(_context4.t0));case 14:case"end":return _context4.stop()}}),_callee4,this,[[1,8]])}))),function removeDefaults(){return _removeDefaults.apply(this,arguments)})},{key:"save",value:function save(){var _this7=this,newAClGraph=(0,_rdflib.graph)();this.isContainer?this.defaultsCombo&&this.defaultsDiffer?((0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),(0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.defaultsCombo.byCombo,this.targetACLDoc,!1,!0)):(0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0,!0):(0,_acl.makeACLGraphbyCombo)(newAClGraph,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),newAClGraph.fetcher=(0,_rdflib.fetcher)(newAClGraph,{fetch:this.store.fetcher._fetch});var updater=newAClGraph.updater||new _rdflib.UpdateManager(newAClGraph);return new Promise((function(resolve,reject){updater.put(_this7.targetACLDoc,newAClGraph.statementsMatching(void 0,void 0,void 0,_this7.targetACLDoc),"text/turtle",(function(uri,ok,message){if(!ok)return reject(new Error("ACL file save failed: ".concat(message)));_this7.store.fetcher.unload(_this7.targetACLDoc),_this7.store.add(newAClGraph.statements),_this7.store.fetcher.requested[_this7.targetACLDoc.uri]="done",_this7.mainCombo.store=_this7.store,_this7.defaultsCombo&&(_this7.defaultsCombo.store=_this7.store),_this7.defaultsDiffer=!!_this7.defaultsCombo&&!(0,_acl.sameACL)(_this7.mainCombo.aclMap,_this7.defaultsCombo.aclMap),debug.log("ACL modification: success!"),resolve()}))}))}}]),AccessController}()},"./lib/acl/access-groups.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.ends-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AccessGroups=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_slicedToArray2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_acl=__webpack_require__("./lib/acl/acl.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_addAgentButtons=__webpack_require__("./lib/acl/add-agent-buttons.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var ACL=ns.acl,COLLOQUIAL={13:"Owners",9:"Owners (write locked)",5:"Editors",3:"Posters",2:"Submitters",1:"Viewers"},RECOMMENDED={13:!0,5:!0,3:!0,2:!0,1:!0},EXPLANATION={13:"can read, write, and control sharing.",9:"can read and control sharing, currently write-locked.",5:"can read and change information",3:"can add new information, and read but not change existing information",2:"can add new information but not read any",1:"can read but not change information"};exports.AccessGroups=function(){function AccessGroups(doc,aclDoc,controller,store){var options=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,_classCallCheck2.default)(this,AccessGroups),this.doc=doc,this.aclDoc=aclDoc,this.controller=controller,this.options=options,(0,_defineProperty2.default)(this,"defaults",void 0),(0,_defineProperty2.default)(this,"byCombo",void 0),(0,_defineProperty2.default)(this,"aclMap",void 0),(0,_defineProperty2.default)(this,"addAgentButton",void 0),(0,_defineProperty2.default)(this,"rootElement",void 0),(0,_defineProperty2.default)(this,"_store",void 0),this.defaults=options.defaults||!1,this._store=store,this.aclMap=(0,_acl.readACL)(doc,aclDoc,store,this.defaults),this.byCombo=(0,_acl.ACLbyCombination)(this.aclMap),this.addAgentButton=new _addAgentButtons.AddAgentButtons(this),this.rootElement=this.controller.dom.createElement("div"),this.rootElement.setAttribute("style",style.accessGroupList)}var _handleDroppedUri,_handleDroppedUris,_addNewURI,_deleteAgent;return(0,_createClass2.default)(AccessGroups,[{key:"store",get:function get(){return this._store},set:function set(store){this._store=store,this.aclMap=(0,_acl.readACL)(this.doc,this.aclDoc,store,this.defaults),this.byCombo=(0,_acl.ACLbyCombination)(this.aclMap)}},{key:"render",value:function render(){var _this=this;return this.rootElement.innerHTML="",this.renderGroups().forEach((function(group){return _this.rootElement.appendChild(group)})),this.controller.isEditable&&this.rootElement.appendChild(this.addAgentButton.render()),this.rootElement}},{key:"renderGroups",value:function renderGroups(){for(var groupElements=[],comboIndex=15;comboIndex>0;comboIndex--){var combo=kToCombo(comboIndex);(this.controller.isEditable&&RECOMMENDED[comboIndex]||this.byCombo[combo])&&groupElements.push(this.renderGroup(comboIndex,combo))}return groupElements}},{key:"renderGroup",value:function renderGroup(comboIndex,combo){var _this2=this,groupRow=this.controller.dom.createElement("div");return groupRow.setAttribute("style",style.accessGroupListItem),widgets.makeDropTarget(groupRow,(function(uris){return _this2.handleDroppedUris(uris,combo).then((function(){return _this2.controller.render()})).catch((function(error){return _this2.controller.renderStatus(error)}))})),this.renderGroupElements(comboIndex,combo).forEach((function(column){return groupRow.appendChild(column)})),groupRow}},{key:"renderGroupElements",value:function renderGroupElements(comboIndex,combo){var _this3=this,groupNameColumn=this.controller.dom.createElement("div");if(groupNameColumn.setAttribute("style",style.group),this.controller.isEditable)switch(comboIndex){case 1:groupNameColumn.setAttribute("style",style.group1);break;case 2:groupNameColumn.setAttribute("style",style.group2);break;case 3:groupNameColumn.setAttribute("style",style.group3);break;case 5:groupNameColumn.setAttribute("style",style.group5);break;case 9:groupNameColumn.setAttribute("style",style.group9);break;case 13:groupNameColumn.setAttribute("style",style.group13);break;default:groupNameColumn.setAttribute("style",style.group)}groupNameColumn.innerText=COLLOQUIAL[comboIndex]||function ktToList(k){for(var list="",y=["Read","Append","Write","Control"],i=0;i<4;i++)k&1<2&&void 0!==arguments[2]&&arguments[2];return _regenerator.default.mark((function _callee4(){var agent,thing,_this6$_store,_this6$_store$fetcher,message,error;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:if(agent=findAgent(uri,_this6.store),thing=(0,_rdflib.sym)(uri),agent||secondAttempt){_context4.next=17;break}return debug.log(" Not obvious: looking up dropped thing ".concat(thing)),_context4.prev=4,_context4.next=7,null===(_this6$_store=_this6._store)||void 0===_this6$_store||null===(_this6$_store$fetcher=_this6$_store.fetcher)||void 0===_this6$_store$fetcher?void 0:_this6$_store$fetcher.load(thing.doc());case 7:_context4.next=14;break;case 9:return _context4.prev=9,_context4.t0=_context4.catch(4),message="Ignore error looking up dropped thing: ".concat(_context4.t0),debug.error(message),_context4.abrupt("return",Promise.reject(new Error(message)));case 14:return _context4.abrupt("return",_this6.handleDroppedUri(uri,combo,!0));case 17:if(agent){_context4.next=21;break}return error=" Error: Drop fails to drop appropriate thing! ".concat(uri),debug.error(error),_context4.abrupt("return",Promise.reject(new Error(error)));case 21:_this6.setACLCombo(combo,uri,agent,_this6.controller.subject);case 22:case"end":return _context4.stop()}}),_callee4,null,[[4,9]])}))()})),function handleDroppedUri(_x7,_x8){return _handleDroppedUri.apply(this,arguments)})},{key:"setACLCombo",value:function setACLCombo(combo,uri,res,subject){combo in this.byCombo||(this.byCombo[combo]=[]),this.removeAgentFromCombos(uri),this.byCombo[combo].push([res.pred,res.obj.uri]),debug.log("ACL: setting access to ".concat(subject," by ").concat(res.pred,": ").concat(res.obj))}},{key:"removeAgentFromCombos",value:function removeAgentFromCombos(uri){for(var k=0;k<16;k++){var combos=this.byCombo[kToCombo(k)];if(combos)for(var i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ACLControlBox5=function ACLControlBox5(subject,context,noun,kb){var dom=context.dom,doc=subject.doc(),container=dom.createElement("div");container.setAttribute("style",style.aclControlBoxContainer);var header=container.appendChild(dom.createElement("h1"));header.textContent="Sharing for ".concat(noun," ").concat(utils.label(subject)),header.setAttribute("style",style.aclControlBoxHeader);var status=container.appendChild(dom.createElement("div"));status.setAttribute("style",style.aclControlBoxStatus);try{(function loadController(_x,_x2,_x3,_x4,_x5,_x6,_x7){return _loadController.apply(this,arguments)})(doc,kb,subject,noun,context,dom,status).then((function(controller){return container.appendChild(controller.render())}))}catch(error){status.innerText=error}return container},exports.handleDrop=handleDrop,exports.preventBrowserDropEvents=function preventBrowserDropEvents(document){if((0,_debug.log)("preventBrowserDropEvents called."),void 0!==global){if(global[preventBrowserDropEventsDone])return;global[preventBrowserDropEventsDone]=!0}document.addEventListener("drop",handleDrop,!1),document.addEventListener("dragenter",preventDrag,!1),document.addEventListener("dragover",preventDrag,!1)},exports.preventDrag=preventDrag,exports.setGlobalWindow=function setGlobalWindow(window){global=window},exports.shortNameForFolder=function shortNameForFolder(x){var str=x.uri;"/"===str.slice(-1)&&(str=str.slice(0,-1));var slash=str.lastIndexOf("/");slash>=0&&(str=str.slice(slash+1));return str||"/"};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_acl=__webpack_require__("./lib/acl/acl.js"),_accessController=__webpack_require__("./lib/acl/access-controller.js"),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_debug=__webpack_require__("./lib/debug.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var global=window,preventBrowserDropEventsDone=Symbol("prevent double triggering of drop event");function preventDrag(e){e.stopPropagation(),e.preventDefault()}function handleDrop(e){e.dataTransfer.files.length>0&&(global.confirm("Are you sure you want to drop this file here? (Cancel opens it in a new tab)")||(e.stopPropagation(),e.preventDefault(),(0,_debug.log)("@@@@ document-level DROP suppressed: "+e.dataTransfer.dropEffect)))}function _loadController(){return _loadController=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(doc,kb,subject,noun,context,dom,status){return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.abrupt("return",new Promise((function(resolve,reject){return(0,_acl.getACLorDefault)(doc,function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(ok,isDirectACL,targetDoc,targetACLDoc,defaultHolder,defaultACLDoc){var targetDirectory,targetIsProtected,prospectiveDefaultHolder,getController;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(getController=function _getController(prospectiveDefaultHolder){return new _accessController.AccessController(subject,noun,context,status,targetIsProtected,targetDoc,targetACLDoc,defaultHolder,defaultACLDoc,prospectiveDefaultHolder,kb,dom)},ok){_context.next=3;break}return _context.abrupt("return",reject(new Error("Error reading ".concat(isDirectACL?"":" default ","ACL. status ").concat(targetDoc,": ").concat(targetACLDoc))));case 3:if(targetDirectory=getDirectory(targetDoc),(targetIsProtected=isStorage(targetDoc,targetACLDoc,kb)||hasProtectedAcl(targetDoc))||!targetDirectory){_context.next=16;break}return _context.prev=6,_context.next=9,(0,_acl.getProspectiveHolder)(targetDirectory);case 9:return prospectiveDefaultHolder=_context.sent,_context.abrupt("return",resolve(getController(prospectiveDefaultHolder)));case 13:_context.prev=13,_context.t0=_context.catch(6),(0,_debug.warn)(_context.t0);case 16:return _context.abrupt("return",resolve(getController()));case 17:case"end":return _context.stop()}}),_callee,null,[[6,13]])})));return function(_x8,_x9,_x10,_x11,_x12,_x13){return _ref.apply(this,arguments)}}())})));case 1:case"end":return _context2.stop()}}),_callee2)}))),_loadController.apply(this,arguments)}function getDirectory(doc){var str=doc.uri.split("#")[0],p=str.slice(0,-1).lastIndexOf("/"),q=str.indexOf("//");return q>=0&&p{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ACLToString=function ACLToString(ac){return comboToString(ACLbyCombination(ac))},exports.ACLbyCombination=ACLbyCombination,exports.ACLunion=ACLunion,exports.adoptACLDefault=function adoptACLDefault(doc,aclDoc,defaultResource,defaultACLDoc){var ACL=ns.acl,isContainer="/"===doc.uri.slice(-1),proposed=kb.each(void 0,ACL("default"),defaultResource,defaultACLDoc).concat(kb.each(void 0,ACL("defaultForNew"),defaultResource,defaultACLDoc)).reduce((function(accumulatedStatements,da){return accumulatedStatements.concat(kb.statementsMatching(da,ns.rdf("type"),ACL("Authorization"),defaultACLDoc)).concat(kb.statementsMatching(da,ACL("agent"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("agentClass"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("agentGroup"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("origin"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("originClass"),void 0,defaultACLDoc)).concat(kb.statementsMatching(da,ACL("mode"),void 0,defaultACLDoc)).concat((0,_rdflib.st)(da,ACL("accessTo"),doc,defaultACLDoc)).concat(isContainer?(0,_rdflib.st)(da,ACL("default"),doc,defaultACLDoc):[])}),[]),kb2=(0,_rdflib.graph)();return proposed.forEach((function(st){return kb2.add(move(st.subject),move(st.predicate),move(st.object),(0,_rdflib.sym)(aclDoc.uri))})),kb2;function move(symbol){var y=defaultACLDoc.uri.length;return(0,_rdflib.sym)(symbol.uri.slice(0,y)===defaultACLDoc.uri?aclDoc.uri+symbol.uri.slice(y):symbol.uri)}},exports.comboToString=comboToString,exports.fixIndividualACL=fixIndividualACL,exports.fixIndividualCardACL=function fixIndividualCardACL(person,log,callbackFunction){var groups=kb.each(void 0,ns.vcard("hasMember"),person);groups?fixIndividualACL(person,groups,log,callbackFunction):(log("This card is in no groups"),callbackFunction(!0))},exports.getACL=getACL,exports.getACLorDefault=getACLorDefault,exports.getProspectiveHolder=function getProspectiveHolder(_x){return _getProspectiveHolder.apply(this,arguments)},exports.loadUnionACL=loadUnionACL,exports.makeACLGraph=makeACLGraph,exports.makeACLGraphbyCombo=makeACLGraphbyCombo,exports.makeACLString=function makeACLString(x,ac,aclDoc){var kb2=(0,_rdflib.graph)();return makeACLGraph(kb2,x,ac,aclDoc),(0,_rdflib.serialize)(aclDoc,kb2,aclDoc.uri,"text/turtle")||""},exports.putACLObject=putACLObject,exports.putACLbyCombo=putACLbyCombo,exports.readACL=readACL,exports.sameACL=sameACL,exports.setACL=function setACL(docURI,aclText,callbackFunction){var aclDoc=kb.any(docURI,_solidLogic.ACL_LINK);if(!kb.fetcher)throw new Error("Store has no fetcher");aclDoc?kb.fetcher.webOperation("PUT",aclDoc.value,{data:aclText,contentType:"text/turtle"}).then((function(res){callbackFunction(res.ok,res.error||"")})):kb.fetcher.nowOrWhenFetched(docURI,void 0,(function(ok,body){if(!ok)return callbackFunction(ok,"Gettting headers for ACL: "+body);var aclDoc=kb.any(docURI,_solidLogic.ACL_LINK);if(aclDoc){if(!kb.fetcher)throw new Error("Store has no fetcher");kb.fetcher.webOperation("PUT",aclDoc.value,{data:aclText,contentType:"text/turtle"}).then((function(res){callbackFunction(res.ok,res.error||"")}))}else callbackFunction(!1,"No Link rel=ACL header for "+docURI)}))};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=_solidLogic.solidLogicSingleton.store;function readACL(doc,aclDoc){var kb2=arguments.length>2&&void 0!==arguments[2]?arguments[2]:kb,getDefaults=arguments.length>3&&void 0!==arguments[3]&&arguments[3],auths=getDefaults?getDefaultsFallback(kb2,ns):kb2.each(void 0,ns.acl("accessTo"),doc),ACL=ns.acl,ac={agent:{},agentClass:{},agentGroup:{},origin:{},originClass:{}};return Object.keys(ac).forEach((function(pred){auths.forEach((function(a){kb2.each(a,ACL("mode")).forEach((function(mode){kb2.each(a,ACL(pred)).forEach((function(agent){ac[pred][agent.uri]=ac[pred][agent.uri]||{},ac[pred][agent.uri][mode.uri]=a}))}))}))})),ac;function getDefaultsFallback(kb,ns){return kb.each(void 0,ns.acl("default"),doc).concat(kb.each(void 0,ns.acl("defaultForNew"),doc))}}function sameACL(a,b){var contains=function contains(a,b){for(var pred in{agent:!0,agentClass:!0,agentGroup:!0,origin:!0,originClass:!0})if(a[pred])for(var agent in a[pred])for(var mode in a[pred][agent])if(!b[pred][agent]||!b[pred][agent][mode])return!1;return!0};return contains(a,b)&&contains(b,a)}function ACLunion(list){for(var a,ag,b=list[0],_loop=function _loop(k){["agent","agentClass","agentGroup","origin","originClass"].forEach((function(pred){if((a=list[k])[pred])for(ag in a[pred])for(var mode in a[pred][ag])b[pred][ag]||(b[pred][ag]=[]),b[pred][ag][mode]=!0}))},k=1;kright)return callbackFunction(!1,!0,404,"Found no ACL resource");uri=uri.slice(0,right+1);var doc2=(0,_rdflib.sym)(uri);getACL(doc2,(function(ok,status,defaultACLDoc){if(!ok)return callbackFunction(!1,!0,status,"( No ACL pointer ".concat(uri," ").concat(status,")").concat(defaultACLDoc));if(403===status)return callbackFunction(!1,!0,status,"( default ACL file FORBIDDEN. Stop.".concat(uri,")"));if(404===status)return tryParent(uri);if(200!==status)return callbackFunction(!1,!0,status,"Error status '".concat(status,"' searching for default for ").concat(doc2));if(!kb.each(void 0,ACL("default"),kb.sym(uri),defaultACLDoc).concat(kb.each(void 0,ACL("defaultForNew"),kb.sym(uri),defaultACLDoc)).length)return tryParent(uri);var defaultHolder=kb.sym(uri);return callbackFunction(!0,!1,doc,aclDoc,defaultHolder,defaultACLDoc)}))}(doc.uri):callbackFunction(!1,!1,status,"Error accessing Access Control information for ".concat(doc,") ").concat(message))}))}function getACL(doc,callbackFunction){if(!kb.fetcher)throw new Error("kb has no fetcher");kb.fetcher.nowOrWhenFetched(doc,void 0,(function(ok,body){if(!ok)return callbackFunction(ok,"Can't get headers to find ACL for ".concat(doc,": ").concat(body));var aclDoc=kb.any(doc,_solidLogic.ACL_LINK);if(aclDoc){if(!kb.fetcher)throw new Error("kb has no fetcher");if(kb.fetcher.nonexistent[aclDoc.value])return callbackFunction(!0,404,aclDoc,"ACL file ".concat(aclDoc," does not exist."));kb.fetcher.nowOrWhenFetched(aclDoc,void 0,(function(ok,message,response){ok?callbackFunction(!0,200,aclDoc):callbackFunction(!0,response.status,aclDoc,"Can't read Access Control File ".concat(aclDoc,": ").concat(message))}))}else callbackFunction(!1,900,"No Link rel=ACL header for ".concat(doc))}))}function _getProspectiveHolder(){return(_getProspectiveHolder=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(targetDirectory){return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.abrupt("return",new Promise((function(resolve,reject){return getACLorDefault((0,_rdflib.sym)(targetDirectory),(function(ok,isDirectACL,targetDoc,targetACLDoc,defaultHolder){return ok?resolve(isDirectACL?targetDoc:defaultHolder):reject(new Error("Error loading ".concat(targetDirectory)))}))})));case 1:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}},"./lib/acl/add-agent-buttons.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.flat-map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.unscopables.flat-map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddAgentButtons=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_login=__webpack_require__("./lib/login/login.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.AddAgentButtons=function(){function AddAgentButtons(groupList){(0,_classCallCheck2.default)(this,AddAgentButtons),this.groupList=groupList,(0,_defineProperty2.default)(this,"rootElement",void 0),(0,_defineProperty2.default)(this,"barElement",void 0),(0,_defineProperty2.default)(this,"isExpanded",!1),this.rootElement=groupList.controller.dom.createElement("div"),this.barElement=groupList.controller.dom.createElement("div")}var _getOriginFromName,_addBot,_addAgent,_addGroup,_addPerson,_renderAppsTable;return(0,_createClass2.default)(AddAgentButtons,[{key:"render",value:function render(){return this.rootElement.innerHTML="",this.rootElement.appendChild(this.renderAddButton()),this.rootElement.appendChild(this.barElement),this.rootElement}},{key:"renderAddButton",value:function renderAddButton(){var _this=this;return widgets.button(this.groupList.controller.dom,"".concat(_iconBase.icons.iconBase,"noun_34653_green.svg"),"Add ...",(function(){_this.toggleBar(),_this.renderBar()}))}},{key:"renderBar",value:function renderBar(){this.barElement.innerHTML="",this.isExpanded&&(this.barElement.appendChild(this.renderPersonButton()),this.barElement.appendChild(this.renderGroupButton()),this.barElement.appendChild(this.renderPublicButton()),this.barElement.appendChild(this.renderAuthenticatedAgentButton()),this.barElement.appendChild(this.renderBotButton()),this.barElement.appendChild(this.renderAppsButton()))}},{key:"renderSimplifiedBar",value:function renderSimplifiedBar(button){var _this2=this;Array.from(this.barElement.children).filter((function(element){return element!==button})).forEach((function(element){return _this2.barElement.removeChild(element)}))}},{key:"renderPersonButton",value:function renderPersonButton(){var _this3=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+widgets.iconForClass["vcard:Individual"],"Add Person",(function(event){_this3.renderSimplifiedBar(event.target),_this3.renderNameForm(ns.vcard("Individual"),"person").then((function(name){return _this3.addPerson(name)})).then((function(){return _this3.renderCleanup()})).catch((function(error){return _this3.groupList.controller.renderStatus(error)}))}))}},{key:"renderGroupButton",value:function renderGroupButton(){var _this4=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+widgets.iconForClass["vcard:Group"],"Add Group",(function(event){_this4.renderSimplifiedBar(event.target),_this4.renderNameForm(ns.vcard("Group"),"group").then((function(name){return _this4.addGroup(name)})).then((function(){return _this4.renderCleanup()})).catch((function(error){return _this4.groupList.controller.renderStatus(error)}))}))}},{key:"renderNameForm",value:function renderNameForm(type,noun){return widgets.askName(this.groupList.controller.dom,this.groupList.store,this.barElement,ns.vcard("URI"),type,noun)}},{key:"renderPublicButton",value:function renderPublicButton(){var _this5=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+widgets.iconForClass["foaf:Agent"],"Add Everyone",(function(){return _this5.addAgent(ns.foaf("Agent").uri).then((function(){return _this5.groupList.controller.renderTemporaryStatus("Adding the general public to those who can read. Drag the globe to a different level to give them more access.")})).then((function(){return _this5.renderCleanup()}))}))}},{key:"renderAuthenticatedAgentButton",value:function renderAuthenticatedAgentButton(){var _this6=this;return widgets.button(this.groupList.controller.dom,"".concat(_iconBase.icons.iconBase,"noun_99101.svg"),"Anyone logged In",(function(){return _this6.addAgent(ns.acl("AuthenticatedAgent").uri).then((function(){return _this6.groupList.controller.renderTemporaryStatus("Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.")})).then((function(){return _this6.renderCleanup()}))}))}},{key:"renderBotButton",value:function renderBotButton(){var _this7=this;return widgets.button(this.groupList.controller.dom,_iconBase.icons.iconBase+"noun_Robot_849764.svg","A Software Agent (bot)",(function(event){_this7.renderSimplifiedBar(event.target),_this7.renderNameForm(ns.schema("Application"),"bot").then((function(name){return _this7.addBot(name)})).then((function(){return _this7.renderCleanup()}))}))}},{key:"renderAppsButton",value:function renderAppsButton(){var _this8=this;return widgets.button(this.groupList.controller.dom,"".concat(_iconBase.icons.iconBase,"noun_15177.svg"),"A Web App (origin)",(function(event){_this8.renderSimplifiedBar(event.target);var eventContext={div:_this8.barElement,dom:_this8.groupList.controller.dom},existingApps=_this8.renderAppsTable(eventContext).catch((function(error){return _this8.groupList.controller.renderStatus(error)}));_this8.renderAppsView();var newApp=_this8.renderNameForm(ns.schema("WebApplication"),"webapp domain").then((function(name){return _this8.getOriginFromName(name)}));Promise.race([existingApps,newApp]).then((function(origin){origin&&_this8.groupList.addNewURI(origin)})).then((function(){return _this8.renderCleanup()}))}))}},{key:"renderAppsView",value:function renderAppsView(){var _this9=this,trustedApplications=this.groupList.controller.context.session.paneRegistry.byName("trustedApplications");if(trustedApplications){var trustedApplicationsElement=trustedApplications.render(null,this.groupList.controller.context);trustedApplicationsElement.setAttribute("style",style.trustedAppController);var cancelButton=widgets.cancelButton(this.groupList.controller.dom,(function(){return _this9.renderCleanup()}));cancelButton.setAttribute("style",style.trustedAppCancelButton),trustedApplicationsElement.insertBefore(cancelButton,trustedApplicationsElement.firstChild),this.barElement.appendChild(trustedApplicationsElement)}}},{key:"renderAppsTable",value:(_renderAppsTable=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(eventContext){var trustedApps,trustedOrigins,_this10=this;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,(0,_login.ensureLoadedProfile)(eventContext);case 2:return trustedApps=this.groupList.store.each(eventContext.me,ns.acl("trustedApp")),trustedOrigins=trustedApps.flatMap((function(app){return _this10.groupList.store.each(app,ns.acl("origin"))})),this.barElement.appendChild(this.groupList.controller.dom.createElement("p")).textContent="You have ".concat(trustedOrigins.length," selected web apps."),_context.abrupt("return",new Promise((function(resolve,reject){var appsTable=_this10.barElement.appendChild(_this10.groupList.controller.dom.createElement("table"));appsTable.setAttribute("style",style.trustedAppAddApplicationsTable),trustedApps.forEach((function(app){var origin=_this10.groupList.store.any(app,ns.acl("origin"));origin||reject(new Error("Unable to pick app: ".concat(app.value)));var thingTR=widgets.personTR(_this10.groupList.controller.dom,ns.acl("origin"),origin,{}),innerTable=_this10.groupList.controller.dom.createElement("table"),innerRow=innerTable.appendChild(_this10.groupList.controller.dom.createElement("tr"));innerRow.appendChild(_this10.groupList.controller.dom.createElement("td")).appendChild(thingTR),innerRow.appendChild(_this10.groupList.controller.dom.createElement("td")).textContent="Give access to ".concat(_this10.groupList.controller.noun," ").concat(utils.label(_this10.groupList.controller.subject),"?"),innerRow.appendChild(_this10.groupList.controller.dom.createElement("td")).appendChild(widgets.continueButton(_this10.groupList.controller.dom,(function(){return resolve(origin.value)}))),appsTable.appendChild(innerTable)}))})));case 6:case"end":return _context.stop()}}),_callee,this)}))),function renderAppsTable(_x){return _renderAppsTable.apply(this,arguments)})},{key:"renderCleanup",value:function renderCleanup(){this.renderBar(),this.groupList.render()}},{key:"addPerson",value:(_addPerson=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(name){var domainNameRegexp;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(name){_context2.next=2;break}return _context2.abrupt("return",this.toggleBar());case 2:if(domainNameRegexp=/^https?:/i,name.match(domainNameRegexp)){_context2.next=5;break}return _context2.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return debug.log("Adding to ACL person: ".concat(name)),_context2.next=8,this.groupList.addNewURI(name);case 8:this.toggleBar();case 9:case"end":return _context2.stop()}}),_callee2,this)}))),function addPerson(_x2){return _addPerson.apply(this,arguments)})},{key:"addGroup",value:(_addGroup=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(name){var domainNameRegexp;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(name){_context3.next=2;break}return _context3.abrupt("return",this.toggleBar());case 2:if(domainNameRegexp=/^https?:/i,name.match(domainNameRegexp)){_context3.next=5;break}return _context3.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return debug.log("Adding to ACL group: "+name),_context3.next=8,this.groupList.addNewURI(name);case 8:this.toggleBar();case 9:case"end":return _context3.stop()}}),_callee3,this)}))),function addGroup(_x3){return _addGroup.apply(this,arguments)})},{key:"addAgent",value:(_addAgent=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(agentUri){return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,this.groupList.addNewURI(agentUri);case 2:this.toggleBar();case 3:case"end":return _context4.stop()}}),_callee4,this)}))),function addAgent(_x4){return _addAgent.apply(this,arguments)})},{key:"addBot",value:(_addBot=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(name){var domainNameRegexp;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:if(name){_context5.next=2;break}return _context5.abrupt("return",this.toggleBar());case 2:if(domainNameRegexp=/^https?:/i,name.match(domainNameRegexp)){_context5.next=5;break}return _context5.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return debug.log("Adding to ACL bot: "+name),_context5.next=8,this.groupList.addNewURI(name);case 8:this.toggleBar();case 9:case"end":return _context5.stop()}}),_callee5,this)}))),function addBot(_x5){return _addBot.apply(this,arguments)})},{key:"getOriginFromName",value:(_getOriginFromName=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee6(name){var domainNameRegexp,origin;return _regenerator.default.wrap((function _callee6$(_context6){for(;;)switch(_context6.prev=_context6.next){case 0:if(name){_context6.next=2;break}return _context6.abrupt("return",Promise.resolve());case 2:if(domainNameRegexp=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i,name.match(domainNameRegexp)){_context6.next=5;break}return _context6.abrupt("return",Promise.reject(new Error("Not a domain name")));case 5:return origin="https://"+name,debug.log("Adding to ACL origin: "+origin),this.toggleBar(),_context6.abrupt("return",origin);case 9:case"end":return _context6.stop()}}),_callee6,this)}))),function getOriginFromName(_x6){return _getOriginFromName.apply(this,arguments)})},{key:"toggleBar",value:function toggleBar(){this.isExpanded=!this.isExpanded}}]),AddAgentButtons}()},"./lib/acl/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.aclControl=exports.acl=void 0;var _acl=__webpack_require__("./lib/acl/acl.js"),_aclControl=__webpack_require__("./lib/acl/acl-control.js");exports.acl={adoptACLDefault:_acl.adoptACLDefault,readACL:_acl.readACL,sameACL:_acl.sameACL,ACLunion:_acl.ACLunion,loadUnionACL:_acl.loadUnionACL,ACLbyCombination:_acl.ACLbyCombination,makeACLGraph:_acl.makeACLGraph,makeACLGraphbyCombo:_acl.makeACLGraphbyCombo,ACLToString:_acl.ACLToString,comboToString:_acl.comboToString,makeACLString:_acl.makeACLString,putACLObject:_acl.putACLObject,putACLbyCombo:_acl.putACLbyCombo,fixIndividualCardACL:_acl.fixIndividualCardACL,fixIndividualACL:_acl.fixIndividualACL,setACL:_acl.setACL,getACLorDefault:_acl.getACLorDefault,getACL:_acl.getACL},exports.aclControl={preventBrowserDropEvents:_aclControl.preventBrowserDropEvents,shortNameForFolder:_aclControl.shortNameForFolder,ACLControlBox5:_aclControl.ACLControlBox5}},"./lib/chat/bookmarks.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.findBookmarkDocument=function findBookmarkDocument(_x){return _findBookmarkDocument.apply(this,arguments)},exports.renderBookmarksButton=function renderBookmarksButton(_x7,_x8){return _renderBookmarksButton.apply(this,arguments)},exports.toggleBookmark=toggleBookmark;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_index=__webpack_require__("./lib/media/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),pad=_interopRequireWildcard(__webpack_require__("./lib/pad.js")),rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_login=__webpack_require__("./lib/login/login.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var UI={icons:_iconBase.icons,ns,media:_index.media,pad,rdf,style,utils,widgets},$rdf=UI.rdf,BOOK=$rdf.Namespace("http://www.w3.org/2002/01/bookmark#"),label=utils.label,dom=window.document||null;function createIfNotExists(doc){return new Promise((function(resolve,reject){_solidLogic.store.fetcher.load(doc).then((function(response){debug.log("createIfNotExists doc exists, all good "+doc),resolve(response)}),(function(err){404===err.response.status?(debug.log("createIfNotExists doc does NOT exist, will create... "+doc),_solidLogic.store.fetcher.webOperation("PUT",doc.uri,{data:"",contentType:"text/turtle"}).then((function(response){delete _solidLogic.store.fetcher.requested[doc.uri],debug.log("createIfNotExists doc created ok "+doc),resolve(response)}),(function(err){debug.log("createIfNotExists doc FAILED: "+doc+": "+err),reject(err)}))):(debug.log("createIfNotExists doc load error NOT 404: "+doc+": "+err),reject(err))}))}))}function updatePromise(del,ins){return new Promise((function(resolve,reject){_solidLogic.store.updater.update(del,ins,(function(uri,ok,errorBody){ok?resolve():reject(new Error(errorBody))}))}))}function _findBookmarkDocument(){return(_findBookmarkDocument=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(userContext){var theClass,fileTail,newBookmarkFile;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return theClass=BOOK("Bookmark"),fileTail="bookmarks.ttl",!0,_context.next=5,(0,_login.findAppInstances)(userContext,theClass,true);case 5:if(!(userContext.instances&&userContext.instances.length>0)){_context.next=10;break}userContext.bookmarkDocument=userContext.instances[0],userContext.instances.length>1&&alert("More than one bookmark file! "+userContext.instances),_context.next=28;break;case 10:if(!userContext.publicProfile){_context.next=27;break}return newBookmarkFile=$rdf.sym(userContext.publicProfile.dir().uri+fileTail),_context.prev=12,debug.log("Creating new bookmark file "+newBookmarkFile),_context.next=16,createIfNotExists(newBookmarkFile);case 16:_context.next=22;break;case 18:return _context.prev=18,_context.t0=_context.catch(12),alert.error("Can't make fresh bookmark file:"+_context.t0),_context.abrupt("return",userContext);case 22:return _context.next=24,(0,_solidLogic.registerInTypeIndex)(newBookmarkFile,userContext.index,theClass);case 24:userContext.bookmarkDocument=newBookmarkFile,_context.next=28;break;case 27:alert("You seem to have no bookmark file and not even a profile file.");case 28:return _context.abrupt("return",userContext);case 29:case"end":return _context.stop()}}),_callee,null,[[12,18]])})))).apply(this,arguments)}function addBookmark(_x2,_x3){return _addBookmark.apply(this,arguments)}function _addBookmark(){return(_addBookmark=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(context,target){var title,me,author,bookmarkDoc,bookmark,ins,msg;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(title="",me=_solidLogic.authn.currentUser()){_context2.next=4;break}throw new Error("Must be logged on to add Bookmark");case 4:return author=_solidLogic.store.any(target,ns.foaf("maker")),title=label(author)+": "+_solidLogic.store.anyValue(target,ns.sioc("content")).slice(0,80),bookmarkDoc=context.bookmarkDocument,bookmark=UI.widgets.newThing(bookmarkDoc,title),ins=[$rdf.st(bookmarkDoc,UI.ns.dct("references"),bookmark,bookmarkDoc),$rdf.st(bookmark,UI.ns.rdf("type"),BOOK("Bookmark"),bookmarkDoc),$rdf.st(bookmark,UI.ns.dct("created"),new Date,bookmarkDoc),$rdf.st(bookmark,BOOK("recalls"),target,bookmarkDoc),$rdf.st(bookmark,UI.ns.foaf("maker"),me,bookmarkDoc),$rdf.st(bookmark,UI.ns.dct("title"),title,bookmarkDoc)],_context2.prev=9,_context2.next=12,updatePromise([],ins);case 12:_context2.next=19;break;case 14:return _context2.prev=14,_context2.t0=_context2.catch(9),msg="Making bookmark: "+_context2.t0,alert.error(msg),_context2.abrupt("return",null);case 19:return _context2.abrupt("return",bookmark);case 20:case"end":return _context2.stop()}}),_callee2,null,[[9,14]])})))).apply(this,arguments)}function toggleBookmark(_x4,_x5,_x6){return _toggleBookmark.apply(this,arguments)}function _toggleBookmark(){return(_toggleBookmark=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(userContext,target,bookmarkButton){var bookmarks,i,bookmark;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,_solidLogic.store.fetcher.load(userContext.bookmarkDocument);case 2:if(!(bookmarks=_solidLogic.store.each(null,BOOK("recalls"),target,userContext.bookmarkDocument)).length){_context3.next=24;break}if(confirm("Delete bookmark on this?"+bookmarks.length)){_context3.next=6;break}return _context3.abrupt("return");case 6:i=0;case 7:if(!(i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChatChannel=void 0,exports._createIfNotExists=function _createIfNotExists(_x4){return _createIfNotExists2.apply(this,arguments)},exports.isDeleted=function isDeleted(message){return _solidLogic.store.holds(message,ns.schema("dateDeleted"),null,message.doc())},exports.isHidden=function isHidden(message){return this.isDeleted(message)||this.isReplaced(message)},exports.isReplaced=function isReplaced(message){return _solidLogic.store.holds(message,ns.dct("isReplacedBy"),null,message.doc())},exports.mostRecentVersion=mostRecentVersion,exports.nick=function nick(person){var s=_solidLogic.store.any(person,ns.foaf("nick"));return s?""+s.value:""+utils.label(person)},exports.originalVersion=function originalVersion(message){var msg=message;for(;msg;)message=msg,msg=_solidLogic.store.any(null,ns.dct("isReplacedBy"),message,message.doc());return message};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_dateFolder=__webpack_require__("./lib/chat/dateFolder.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_signature=__webpack_require__("./lib/chat/signature.js"),_keys=__webpack_require__("./lib/chat/keys.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.ChatChannel=function(){function ChatChannel(channel,options){(0,_classCallCheck2.default)(this,ChatChannel),this.channel=channel,this.channelRoot=channel.doc(),this.options=options,this.dateFolder=new _dateFolder.DateFolder(this.channelRoot,"chat.ttl"),this.div=null}var _deleteMessage,_updateMessage,_createMessage;return(0,_createClass2.default)(ChatChannel,[{key:"createMessage",value:(_createMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(text){return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.abrupt("return",this.updateMessage(text));case 1:case"end":return _context.stop()}}),_callee,this)}))),function createMessage(_x){return _createMessage.apply(this,arguments)})},{key:"updateMessage",value:(_updateMessage=(0,_asyncToGenerator2.default)((function(text){var _this=this,oldMsg=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,deleteIt=arguments.length>2?arguments[2]:void 0;return _regenerator.default.mark((function _callee2(){var sts,now,timestamp,dateStamp,chatDocument,message,me,msg,oldMsgMaker,errMsg,privateKey,sig,_errMsg;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(sts=[],now=new Date,timestamp=""+now.getTime(),dateStamp=$rdf.term(now),chatDocument=oldMsg?oldMsg.doc():_this.dateFolder.leafDocumentFromDate(now),message=_solidLogic.store.sym(chatDocument.uri+"#Msg"+timestamp),me=_solidLogic.authn.currentUser(),(msg=(0,_signature.getBlankMsg)()).id=message.uri,!oldMsg){_context2.next=22;break}if((oldMsgMaker=_solidLogic.store.any(oldMsg,ns.foaf("maker"))).uri!==me.uri){_context2.next=16;break}sts.push($rdf.st(mostRecentVersion(oldMsg),ns.dct("isReplacedBy"),message,chatDocument)),deleteIt&&sts.push($rdf.st(message,ns.schema("dateDeleted"),dateStamp,chatDocument)),_context2.next=20;break;case 16:throw errMsg="Error you cannot delete/edit a message from someone else : \n"+oldMsgMaker.uri,debug.warn(errMsg),alert(errMsg),new Error(errMsg);case 20:_context2.next=23;break;case 22:sts.push($rdf.st(_this.channel,ns.wf("message"),message,chatDocument));case 23:if(sts.push($rdf.st(message,ns.sioc("content"),_solidLogic.store.literal(text),chatDocument)),msg.content=text,sts.push($rdf.st(message,ns.dct("created"),dateStamp,chatDocument)),msg.created=dateStamp.value,!me){_context2.next=35;break}return sts.push($rdf.st(message,ns.foaf("maker"),me,chatDocument)),msg.maker=me.uri,_context2.next=32,(0,_keys.getPrivateKey)(me);case 32:privateKey=_context2.sent,sig=(0,_signature.signMsg)(msg,privateKey),sts.push($rdf.st(message,$rdf.sym("".concat(_signature.SEC,"proofValue")),$rdf.lit(sig),chatDocument));case 35:return _context2.prev=35,_context2.next=38,_solidLogic.store.updater.update([],sts);case 38:_context2.next=46;break;case 40:throw _context2.prev=40,_context2.t0=_context2.catch(35),_errMsg="Error saving chat message: "+_context2.t0,debug.warn(_errMsg),alert(_errMsg),new Error(_errMsg);case 46:return _context2.abrupt("return",message);case 47:case"end":return _context2.stop()}}),_callee2,null,[[35,40]])}))()})),function updateMessage(_x2){return _updateMessage.apply(this,arguments)})},{key:"deleteMessage",value:(_deleteMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(message){return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.abrupt("return",this.updateMessage("(message deleted)",message,!0));case 1:case"end":return _context3.stop()}}),_callee3,this)}))),function deleteMessage(_x3){return _deleteMessage.apply(this,arguments)})}]),ChatChannel}();function mostRecentVersion(message){for(var msg=message;msg;)message=msg,msg=_solidLogic.store.any(message,ns.dct("isReplacedBy"),null,message.doc());return message}function _createIfNotExists2(){return _createIfNotExists2=(0,_asyncToGenerator2.default)((function(doc){var contentType=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text/turtle",data=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return _regenerator.default.mark((function _callee4(){var response;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.prev=0,_context4.next=3,_solidLogic.store.fetcher.load(doc);case 3:response=_context4.sent,_context4.next=26;break;case 6:if(_context4.prev=6,_context4.t0=_context4.catch(0),404!==_context4.t0.response.status){_context4.next=24;break}return debug.log("createIfNotExists: doc does NOT exist, will create... "+doc),_context4.prev=10,_context4.next=13,_solidLogic.store.fetcher.webOperation("PUT",doc.uri,{data,contentType});case 13:response=_context4.sent,_context4.next=20;break;case 16:throw _context4.prev=16,_context4.t1=_context4.catch(10),debug.log("createIfNotExists doc FAILED: "+doc+": "+_context4.t1),_context4.t1;case 20:return delete _solidLogic.store.fetcher.requested[doc.uri],_context4.abrupt("return",response);case 24:throw debug.log("createIfNotExists doc load error NOT 404: "+doc+": "+_context4.t0),_context4.t0;case 26:return _context4.abrupt("return",response);case 27:case"end":return _context4.stop()}}),_callee4,null,[[0,6],[10,16]])}))()})),_createIfNotExists2.apply(this,arguments)}},"./lib/chat/dateFolder.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reverse.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.DateFolder=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.DateFolder=function(){function DateFolder(rootThing,leafFileName,membershipProperty){(0,_classCallCheck2.default)(this,DateFolder),this.root=rootThing,this.rootFolder=rootThing.dir(),this.leafFileName=leafFileName||"index.ttl",this.membershipProperty=membershipProperty||ns.wf("leafObject")}var _firstLeaf,_loadPrevious;return(0,_createClass2.default)(DateFolder,[{key:"leafDocumentFromDate",value:function leafDocumentFromDate(date){var path=date.toISOString().split("T")[0].replace(/-/g,"/");return path=this.root.dir().uri+path+"/"+this.leafFileName,_solidLogic.store.sym(path)}},{key:"dateFromLeafDocument",value:function dateFromLeafDocument(doc){var head=this.rootFolder.uri.length,str=doc.uri.slice(head,head+10).replace(/\//g,"-"),date=new Date(str);return debug.log("Date for "+doc+":"+date.toISOString()),date}},{key:"loadPrevious",value:(_loadPrevious=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(date,backwards){var thisDateFolder,previousPeriod,_previousPeriod,folder,found,doc;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _previousPeriod=function _previousPeriod3(){return _previousPeriod=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(file,level){var younger,suitable,lastNonEmpty,_lastNonEmpty,parent,siblings,_folder,uncle,cousins,result;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _lastNonEmpty=function _lastNonEmpty3(){return _lastNonEmpty=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(siblings){var _folder2,leafDocument;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if((siblings=siblings.filter(suitable)).sort(),backwards||siblings.reverse(),3===level){_context.next=5;break}return _context.abrupt("return",siblings.pop());case 5:if(!siblings.length){_context.next=14;break}return _folder2=siblings.pop(),leafDocument=_solidLogic.store.sym(_folder2.uri+thisDateFolder.leafFileName),_context.next=10,_solidLogic.store.fetcher.load(leafDocument);case 10:if(!(_solidLogic.store.statementsMatching(null,ns.dct("created"),null,leafDocument).length>0)){_context.next=12;break}return _context.abrupt("return",_folder2);case 12:_context.next=5;break;case 14:return _context.abrupt("return",null);case 15:case"end":return _context.stop()}}),_callee)}))),_lastNonEmpty.apply(this,arguments)},lastNonEmpty=function _lastNonEmpty2(_x5){return _lastNonEmpty.apply(this,arguments)},suitable=function _suitable(x){var tail=x.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(tail[0])},younger=function _younger(x){return!(backwards?x.uri>=file.uri:x.uri<=file.uri)},parent=file.dir(),_context2.prev=5,_context2.next=8,_solidLogic.store.fetcher.load(parent);case 8:return siblings=(siblings=_solidLogic.store.each(parent,ns.ldp("contains"))).filter(younger),_context2.next=12,lastNonEmpty(siblings);case 12:if(!(_folder=_context2.sent)){_context2.next=15;break}return _context2.abrupt("return",_folder);case 15:_context2.next=25;break;case 17:if(_context2.prev=17,_context2.t0=_context2.catch(5),!_context2.t0.response||!_context2.t0.response.status||404!==_context2.t0.response.status){_context2.next=23;break}debug.log("Error 404 for chat parent file "+parent),_context2.next=25;break;case 23:throw debug.log("*** Error NON 404 for chat parent file "+parent),new Error("*** ".concat(_context2.t0.message," for chat folder ").concat(parent));case 25:if(0!==level){_context2.next=27;break}return _context2.abrupt("return",null);case 27:return _context2.next=29,previousPeriod(parent,level-1);case 29:if(uncle=_context2.sent){_context2.next=32;break}return _context2.abrupt("return",null);case 32:return _context2.next=34,_solidLogic.store.fetcher.load(uncle);case 34:return cousins=_solidLogic.store.each(uncle,ns.ldp("contains")),_context2.next=37,lastNonEmpty(cousins);case 37:return result=_context2.sent,_context2.abrupt("return",result);case 39:case"end":return _context2.stop()}}),_callee2,null,[[5,17]])}))),_previousPeriod.apply(this,arguments)},previousPeriod=function _previousPeriod2(_x3,_x4){return _previousPeriod.apply(this,arguments)},thisDateFolder=this,folder=this.leafDocumentFromDate(date).dir(),_context3.next=6,previousPeriod(folder,3);case 6:if(!(found=_context3.sent)){_context3.next=10;break}return doc=_solidLogic.store.sym(found.uri+this.leafFileName),_context3.abrupt("return",this.dateFromLeafDocument(doc));case 10:return _context3.abrupt("return",null);case 11:case"end":return _context3.stop()}}),_callee3,this)}))),function loadPrevious(_x,_x2){return _loadPrevious.apply(this,arguments)})},{key:"firstLeaf",value:(_firstLeaf=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(backwards){var folderStore,folderFetcher,earliestSubfolder,_earliestSubfolder,y,month,d,leafDocument,leafObjects,msg,sortMe;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:return _earliestSubfolder=function _earliestSubfolder3(){return(_earliestSubfolder=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(parent){var suitable,kids;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return suitable=function _suitable2(x){var tail=x.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(tail[0])},debug.log(" parent "+parent),delete folderFetcher.requested[parent.uri],_context4.next=5,folderFetcher.load(parent,{force:!0});case 5:if(0!==(kids=(kids=folderStore.each(parent,ns.ldp("contains"))).filter(suitable)).length){_context4.next=9;break}throw new Error(" @@@ No children to parent2 "+parent);case 9:return kids.sort(),backwards&&kids.reverse(),_context4.abrupt("return",kids[0]);case 12:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)},earliestSubfolder=function _earliestSubfolder2(_x7){return _earliestSubfolder.apply(this,arguments)},folderStore=$rdf.graph(),folderFetcher=new $rdf.Fetcher(folderStore),_context5.next=6,earliestSubfolder(this.root.dir());case 6:return y=_context5.sent,_context5.next=9,earliestSubfolder(y);case 9:return month=_context5.sent,_context5.next=12,earliestSubfolder(month);case 12:return d=_context5.sent,leafDocument=$rdf.sym(d.uri+"chat.ttl"),_context5.next=16,folderFetcher.load(leafDocument);case 16:if(0!==(leafObjects=folderStore.each(this.root,this.membershipProperty,null,leafDocument)).length){_context5.next=21;break}throw msg=" INCONSISTENCY -- no chat leafObject in file "+leafDocument,debug.trace(msg),new Error(msg);case 21:return(sortMe=leafObjects.map((function(leafObject){return[folderStore.any(leafObject,ns.dct("created")),leafObject]}))).sort(),backwards&&sortMe.reverse(),debug.log((backwards?"Latest":"Earliest")+" leafObject is "+sortMe[0][1]),_context5.abrupt("return",sortMe[0][1]);case 26:case"end":return _context5.stop()}}),_callee5,this)}))),function firstLeaf(_x6){return _firstLeaf.apply(this,arguments)})}]),DateFolder}()},"./lib/chat/infinite.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.desktopNotification=desktopNotification,exports.infiniteMessageArea=function infiniteMessageArea(_x,_x2,_x3,_x4){return _infiniteMessageArea.apply(this,arguments)},exports.insertMessageIntoTable=insertMessageIntoTable;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_chatLogic=__webpack_require__("./lib/chat/chatLogic.js"),_message=__webpack_require__("./lib/chat/message.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function desktopNotification(str){"Notification"in window?"granted"===Notification.permission?new Notification(str):"denied"!==Notification.permission&&Notification.requestPermission().then((function(permission){"granted"===permission&&new Notification(str)})):debug.warn("This browser does no t support desktop notification")}function insertMessageIntoTable(channelObject,messageTable,message,fresh,options,userContext){var messageRow=(0,_message.renderMessageRow)(channelObject,message,fresh,options,userContext);options.selectedMessage&&options.selectedMessage.sameTerm(message)&&(messageRow.style.backgroundColor="yellow",options.selectedElement=messageRow,messageTable.selectedElement=messageRow);for(var done=!1,ele=messageTable.firstChild;ele;ele=ele.nextSibling){var newestFirst=!0===options.newestfirst,dateString=messageRow.AJAR_date;if(dateString>ele.AJAR_date&&newestFirst||dateString{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.generatePrivateKey=generatePrivateKey,exports.generatePublicKey=generatePublicKey,exports.getPrivateKey=function getPrivateKey(_x2){return _getPrivateKey.apply(this,arguments)},exports.getPublicKey=function getPublicKey(_x){return _getPublicKey.apply(this,arguments)};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_secp256k=__webpack_require__("./node_modules/@noble/curves/secp256k1.js"),_utils=__webpack_require__("./node_modules/@noble/hashes/utils.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_accessData=__webpack_require__("./lib/utils/keyHelpers/accessData.js"),_acl=__webpack_require__("./lib/utils/keyHelpers/acl.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function generatePrivateKey(){return(0,_utils.bytesToHex)(_secp256k.schnorr.utils.randomPrivateKey())}function generatePublicKey(privateKey){return(0,_utils.bytesToHex)(_secp256k.schnorr.getPublicKey(privateKey))}function _getPublicKey(){return(_getPublicKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(webId){var publicKeyDoc,key;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,_solidLogic.store.fetcher.load(webId);case 2:return _context2.next=4,(0,_accessData.pubKeyUrl)(webId);case 4:return publicKeyDoc=_context2.sent,_context2.prev=5,_context2.next=8,_solidLogic.store.fetcher.load(publicKeyDoc);case 8:return key=_solidLogic.store.any(webId,ns.solid("publicKey")),_context2.abrupt("return",null==key?void 0:key.value);case 12:return _context2.prev=12,_context2.t0=_context2.catch(5),_context2.abrupt("return",void 0);case 15:case"end":return _context2.stop()}}),_callee2,null,[[5,12]])})))).apply(this,arguments)}function _getPrivateKey(){return(_getPrivateKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(webId){var publicKeyDoc,privateKeyDoc,publicKey,privateKey,validPublicKey,del,add,newPublicKey,keyContainer;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,_solidLogic.store.fetcher.load(webId);case 2:return _context3.next=4,(0,_accessData.pubKeyUrl)(webId);case 4:return publicKeyDoc=_context3.sent,_context3.next=7,(0,_accessData.privKeyUrl)(webId);case 7:return privateKeyDoc=_context3.sent,_context3.next=10,(0,_accessData.getExistingPublicKey)(webId,publicKeyDoc);case 10:return publicKey=_context3.sent,_context3.next=13,(0,_accessData.getExistingPrivateKey)(webId,privateKeyDoc);case 13:if(privateKey=_context3.sent,validPublicKey=!0,privateKey&&publicKey!==generatePublicKey(privateKey)&&confirm("This is strange the publicKey is not valid for\n"+(null==webId?void 0:webId.uri)+"'shall we repair keeping the private key ?")&&(validPublicKey=!1),privateKey&&publicKey&&validPublicKey){_context3.next=34;break}if(del=[],add=[],privateKey){_context3.next=24;break}return privateKey=generatePrivateKey(),add=[$rdf.st(webId,ns.solid("privateKey"),$rdf.literal(privateKey),_solidLogic.store.sym(privateKeyDoc))],_context3.next=24,saveKey(privateKeyDoc,[],add,webId.uri);case 24:if(publicKey&&validPublicKey){_context3.next=31;break}return del=[],publicKey&&(del=[$rdf.st(webId,ns.solid("publicKey"),$rdf.lit(publicKey),_solidLogic.store.sym(publicKeyDoc))],debug.log(del)),newPublicKey=generatePublicKey(privateKey),add=[$rdf.st(webId,ns.solid("publicKey"),$rdf.literal(newPublicKey),_solidLogic.store.sym(publicKeyDoc))],_context3.next=31,saveKey(publicKeyDoc,del,add);case 31:return keyContainer=privateKeyDoc.substring(0,privateKeyDoc.lastIndexOf("/")+1),_context3.next=34,(0,_acl.setAcl)(keyContainer,(0,_acl.keyContainerAclBody)(webId.uri));case 34:return _context3.abrupt("return",privateKey);case 35:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}var deleteKeyAcl=function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(keyDoc){var keyAclDoc,response;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,_solidLogic.store.fetcher.load(keyDoc);case 2:if(!(keyAclDoc=_solidLogic.store.any(_solidLogic.store.sym(keyDoc),_solidLogic.store.sym("http://www.iana.org/assignments/link-relations/acl")))){_context.next=16;break}return _context.prev=4,_context.next=7,_solidLogic.store.fetcher.webOperation("DELETE",keyAclDoc.value);case 7:response=_context.sent,debug.log("delete "+keyAclDoc.value+" "+response.status),_context.next=16;break;case 11:if(_context.prev=11,_context.t0=_context.catch(4),404===_context.t0.response.status){_context.next=15;break}throw new Error(_context.t0);case 15:debug.log("delete "+keyAclDoc.value+" "+_context.t0.response.status);case 16:case"end":return _context.stop()}}),_callee,null,[[4,11]])})));return function deleteKeyAcl(_x3){return _ref.apply(this,arguments)}}();function saveKey(_x4,_x5,_x6){return _saveKey.apply(this,arguments)}function _saveKey(){return _saveKey=(0,_asyncToGenerator2.default)((function(keyDoc,del,add){var me=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return _regenerator.default.mark((function _callee4(){var aclBody;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,deleteKeyAcl(keyDoc);case 2:return _context4.next=4,_solidLogic.store.updater.updateMany(del,add);case 4:return aclBody=(0,_acl.keyAclBody)(keyDoc,me),_context4.next=7,(0,_acl.setAcl)(keyDoc,aclBody);case 7:case"end":return _context4.stop()}}),_callee4)}))()})),_saveKey.apply(this,arguments)}},"./lib/chat/message.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.date.now.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.creatorAndDate=creatorAndDate,exports.creatorAndDateHorizontal=creatorAndDateHorizontal,exports.elementForImageURI=elementForImageURI,exports.renderMessageEditor=renderMessageEditor,exports.renderMessageRow=function renderMessageRow(channelObject,message,fresh,options,userContext){var unsignedMessage=!1,colorizeByAuthor="1"===options.colorizeByAuthor||!0===options.colorizeByAuthor,creator=_solidLogic.store.any(message,ns.foaf("maker")),date=_solidLogic.store.any(message,ns.dct("created")),latestVersion=(0,_chatLogic.mostRecentVersion)(message),latestVersionCreator=_solidLogic.store.any(latestVersion,ns.foaf("maker")),msgId=creator.uri===latestVersionCreator.uri?latestVersion:message,content=_solidLogic.store.any(msgId,ns.sioc("content")),signature=_solidLogic.store.any(msgId,$rdf.sym("".concat(_signature.SEC,"proofValue"))),msg=(0,_signature.getBlankMsg)();msg.id=msgId.uri,msg.created=_solidLogic.store.any(msgId,ns.dct("created")).value,msg.content=content.value,msg.maker=creator.uri,null!=signature&&signature.value?(0,_keys.getPublicKey)(creator).then((function(publicKey){debug.log(creator.uri+"\n"+msg.created+"\n"+msg.id+"\n"+publicKey),publicKey||debug.warn("message is signed but "+creator.uri+" is missing publicKey");null!=publicKey&&publicKey.match(/[0-9A-Fa-f]{6}/g)?null!=signature&&signature.value&&!(0,_signature.verifySignature)(null==signature?void 0:signature.value,msg,publicKey)&&debug.warn("invalid signature\n"+msg.id):debug.warn("invalid publicKey hex string\n"+creator.uri+"\n"+publicKey)})):(unsignedMessage=!0,debug.warn(msgId.uri+" is unsigned"));var originalMessage=(0,_chatLogic.originalVersion)(message),edited=!message.sameTerm(originalMessage),sortDate=_solidLogic.store.the(originalMessage,ns.dct("created"),null,originalMessage.doc()),messageRow=dom.createElement("tr");unsignedMessage&&messageRow.setAttribute("style","background-color: red");messageRow.AJAR_date=sortDate.value,messageRow.AJAR_subject=message;var td1=dom.createElement("td");if(messageRow.appendChild(td1),options.authorDateOnLeft)creatorAndDate(td1,creator,widgets.shortDate(sortDate.value),message);else{var img=dom.createElement("img");img.setAttribute("style","max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;"),widgets.setImage(img,creator),td1.appendChild(img)}var bothDates=widgets.shortDate(sortDate.value);edited&&(bothDates+=" ... "+widgets.shortDate(date.value));var td2=messageRow.appendChild(dom.createElement("td"));options.authorDateOnLeft||creatorAndDateHorizontal(td2,creator,bothDates,message);var text=content.value.trim(),isURI=/^https?:\/[^ <>]*$/i.test(text),para=null;if(isURI){if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text)&&options.expandImagesInline){var _img=elementForImageURI(text,options);td2.appendChild(_img)}else{var anc=td2.appendChild(dom.createElement("a"));para=anc.appendChild(dom.createElement("p")),anc.href=text,para.textContent=text,td2.appendChild(anc)}}else para=dom.createElement("p"),td2.appendChild(para),para.textContent=text;if(para){var bgcolor=colorizeByAuthor?pad.lightColorHash(creator):function getBgColor(fresh){return fresh?"#e8ffe8":"white"}(fresh);para.setAttribute("style",messageBodyStyle+"background-color: "+bgcolor+";")}var strip=(0,_messageTools.sentimentStripLinked)(message,message.doc());strip.children.length&&(td2.appendChild(dom.createElement("br")),td2.appendChild(strip));var td3=dom.createElement("td");messageRow.appendChild(td3);var toolsButton=widgets.button(dom,_iconBase.icons.iconBase+"noun_243787.svg","...");return td3.appendChild(toolsButton),toolsButton.addEventListener("click",(function(_event){if(messageRow.toolTR)return messageRow.parentNode.removeChild(messageRow.toolTR),void delete messageRow.toolTR;var toolsTR=dom.createElement("tr"),tools=(0,_messageTools.messageToolbar)(message,messageRow,userContext,channelObject);tools.style="border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;",messageRow.nextSibling?messageRow.parentElement.insertBefore(toolsTR,messageRow.nextSibling):messageRow.parentElement.appendChild(toolsTR),messageRow.toolTR=toolsTR,toolsTR.appendChild(dom.createElement("td"));var toolsTD=toolsTR.appendChild(dom.createElement("td"));toolsTR.appendChild(dom.createElement("td")),toolsTD.appendChild(tools)})),messageRow},exports.switchToEditor=function switchToEditor(messageRow,message,channelObject,userContext){var messageTable=messageRow.parentNode,editRow=renderMessageEditor(channelObject,messageTable,userContext,channelObject.options,(0,_chatLogic.mostRecentVersion)(message));messageTable.insertBefore(editRow,messageRow),editRow.originalRow=messageRow,messageRow.style.visibility="hidden"};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_infinite=__webpack_require__("./lib/chat/infinite.js"),_messageTools=__webpack_require__("./lib/chat/messageTools.js"),_bookmarks=__webpack_require__("./lib/chat/bookmarks.js"),_chatLogic=__webpack_require__("./lib/chat/chatLogic.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_login=__webpack_require__("./lib/login/login.js"),_index=__webpack_require__("./lib/media/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),pad=_interopRequireWildcard(__webpack_require__("./lib/pad.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_signature=__webpack_require__("./lib/chat/signature.js"),_keys=__webpack_require__("./lib/chat/keys.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.messageToolbar=function messageToolbar(message,messageRow,userContext,channelObject){function _deleteMessage(){return(_deleteMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(){var author,msg;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(author=_solidLogic.store.any(message,ns.foaf("maker")),me){_context2.next=5;break}alert("You can't delete the message, you are not logged in."),_context2.next=22;break;case 5:if(!me.sameTerm(author)){_context2.next=21;break}return _context2.prev=6,_context2.next=9,channelObject.deleteMessage(message);case 9:_context2.next=18;break;case 11:_context2.prev=11,_context2.t0=_context2.catch(6),msg="Error deleting messaage "+_context2.t0,debug.warn(msg),alert(msg),(userContext.statusArea||messageRow.parentNode).appendChild(widgets.errorMessageBlock(dom,msg));case 18:messageRow.parentNode.removeChild(messageRow),_context2.next=22;break;case 21:alert("You can't delete the message, you are not logged in as the author, "+author);case 22:closeToolbar();case 23:case"end":return _context2.stop()}}),_callee2,null,[[6,11]])})))).apply(this,arguments)}function _editMessage(){return _editMessage=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(messageRow){return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:me.value===_solidLogic.store.any(message,ns.foaf("maker")).value&&(closeToolbar(),(0,_message.switchToEditor)(messageRow,message,channelObject,userContext));case 1:case"end":return _context3.stop()}}),_callee3)}))),_editMessage.apply(this,arguments)}var div=dom.createElement("div");if((0,_chatLogic.mostRecentVersion)(message).value===ns.schema("dateDeleted").value)return div;function closeToolbar(){div.parentElement.parentElement.removeChild(div.parentElement)}function deleteThingThen(_x2){return _deleteThingThen.apply(this,arguments)}function _deleteThingThen(){return(_deleteThingThen=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(x){return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,_solidLogic.store.updater.update(_solidLogic.store.connectedStatements(x),[]);case 2:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}var me=_solidLogic.authn.currentUser();me&&_solidLogic.store.holds(message,ns.foaf("maker"),me)&&(div.appendChild(widgets.deleteButtonWithCheck(dom,div,"message",(function deleteMessage(){return _deleteMessage.apply(this,arguments)}))),div.appendChild(widgets.button(dom,_iconBase.icons.iconBase+"noun_253504.svg","edit",(function(){return function editMessage(_x){return _editMessage.apply(this,arguments)}(messageRow)}))));function sentimentButton(context,target,icon,actionClass,doc,mutuallyExclusive){function setColor(){button.style.backgroundColor=action?"yellow":"white"}var action,button=widgets.button(dom,icon,utils.label(actionClass),function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(_event){var insertMe,dirty,i,a;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!action){_context.next=7;break}return _context.next=3,deleteThingThen(action);case 3:action=null,setColor(),_context.next=25;break;case 7:return action=widgets.newThing(doc),insertMe=[rdf.st(action,ns.schema("agent"),context.me,doc),rdf.st(action,ns.rdf("type"),actionClass,doc),rdf.st(action,ns.schema("target"),target,doc)],_context.next=11,_solidLogic.store.updater.update([],insertMe);case 11:if(setColor(),!mutuallyExclusive){_context.next=25;break}dirty=!1,i=0;case 15:if(!(i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.SEC=void 0,exports.getBlankMsg=function getBlankMsg(){return{id:"",created:"",dateDeleted:"",content:"",maker:"",sig:""}},exports.getMsgHash=getMsgHash,exports.serializeMsg=serializeMsg,exports.signMsg=function signMsg(message,key){return(0,_utils.bytesToHex)(_secp256k.schnorr.sign(getMsgHash(message),key))},exports.utf8Encoder=exports.utf8Decoder=void 0,exports.verifySignature=function verifySignature(sig,message,pubKey){return _secp256k.schnorr.verify(sig,getMsgHash(message),pubKey)};var _secp256k=__webpack_require__("./node_modules/@noble/curves/secp256k1.js"),_utils=__webpack_require__("./node_modules/@noble/hashes/utils.js"),_sha=__webpack_require__("./node_modules/@noble/hashes/sha256.js"),utf8Encoder=(exports.utf8Decoder=new TextDecoder("utf-8"),exports.utf8Encoder=new TextEncoder);exports.SEC="https://w3id.org/security#";function serializeMsg(msg){return JSON.stringify(msg)}function getMsgHash(message){var msgHash=(0,_sha.sha256)(utf8Encoder.encode(serializeMsg(message)));return(0,_utils.bytesToHex)(msgHash)}},"./lib/create/create.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.ends-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.values.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.newThingUI=function newThingUI(createContext,dataBrowserContext,thePanes){var dom=createContext.dom,div=createContext.div;if(createContext.me&&!createContext.me.uri)throw new Error("newThingUI: Invalid userid: "+createContext.me);var iconStyle="padding: 0.7em; width: 2em; height: 2em;",star=div.appendChild(dom.createElement("img")),visible=!1;star.setAttribute("src",_iconBase.icons.iconBase+"noun_34653_green.svg"),star.setAttribute("style",iconStyle),star.setAttribute("title","Add another tool");var complain=function complain(message){var pre=div.appendChild(dom.createElement("pre"));pre.setAttribute("style","background-color: pink"),pre.appendChild(dom.createTextNode(message))};function styleTheIcons(style){for(var i=0;i1?"".concat(utils.label(pane.mintClass)," (using ").concat(pane.name," pane)"):utils.label(pane.mintClass):pane.name+" @@";icon.setAttribute("title","Make new "+noun),icon.setAttribute("style",iconStyle+"display: none;"),iconArray.push(icon),icon.disabled||icon.addEventListener("click",(function(e){!function selectTool(icon){styleTheIcons("display: none;"),icon.setAttribute("style",iconStyle+"background-color: yellow;")}(icon),function makeNewAppInstance(options){return new Promise((function(resolve,reject){var selectUI;function callbackWS(ws,newBase){(0,_login.ensureLoadedProfile)(createContext).then((function(_context){var newPaneOptions=Object.assign({newBase,folder:options.folder||void 0,workspace:ws},options);for(var opt in options)newPaneOptions[opt]=options[opt];debug.log("newThingUI: Minting new ".concat(newPaneOptions.pane.name," at ").concat(newPaneOptions.newBase)),options.pane.mintNew(dataBrowserContext,newPaneOptions).then((function(newPaneOptions){if(!newPaneOptions||!newPaneOptions.newInstance)throw new Error("Cannot mint new - missing newInstance");if(newPaneOptions.folder){var isPackage=newPaneOptions.newInstance.uri.slice(newPaneOptions.folder.uri.length).includes("/");debug.log(" new thing is packge? "+isPackage),isPackage?kb.add(newPaneOptions.folder,ns.ldp("contains"),kb.sym(newPaneOptions.newBase),newPaneOptions.folder.doc()):kb.add(newPaneOptions.folder,ns.ldp("contains"),newPaneOptions.newInstance,newPaneOptions.folder.doc()),newPaneOptions.refreshTarget&&newPaneOptions.refreshTarget.refresh&&newPaneOptions.refreshTarget.refresh()}else{var p=options.div.appendChild(dom.createElement("p"));p.setAttribute("style","font-size: 120%;"),p.innerHTML="Your new "+options.noun+" is ready to be set up.

                                                          Go to your new "+options.noun+"."}selectNewTool()})).catch((function(err){complain(err),reject(err)}))}),(function(err){complain("Error logging on: "+err)}))}var pa=options.pane;options.noun=pa.mintClass?utils.label(pa.mintClass):pa.name,options.appPathSegment=options.noun.slice(0,1).toUpperCase()+options.noun.slice(1),options.folder?widgets.askName(dom,kb,options.div,ns.foaf("name"),null,options.noun).then((function gotName(name){if(name){var uri=options.folder.uri;uri.endsWith("/")||(uri+="/"),callbackWS(null,uri=uri+encodeURIComponent(name)+"/")}else selectNewTool()})):(selectUI=(0,_login.selectWorkspace)(dom,{noun:options.noun,appPathSegment:options.appPathSegment},callbackWS),options.div.appendChild(selectUI))}))}({event:e,folder:createContext.folder||null,iconEle:icon,pane,noun,noIndexHTML:!0,div:createContext.div,me:createContext.me,dom:createContext.dom,refreshTarget:createContext.refreshTarget})}))}))};var _solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_login=__webpack_require__("./lib/login/login.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=_solidLogic.solidLogicSingleton.store},"./lib/create/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.create=void 0;var _create=__webpack_require__("./lib/create/create.js");exports.create={newThingUI:_create.newThingUI}},"./lib/create/types.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0})},"./lib/debug.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.error=function error(){var _console3;(_console3=console).error.apply(_console3,arguments)},exports.log=function log(){var _console;(_console=console).log.apply(_console,arguments)},exports.trace=function trace(){var _console4;(_console4=console).trace.apply(_console4,arguments)},exports.warn=function warn(){var _console2;(_console2=console).warn.apply(_console2,arguments)}},"./lib/footer/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.createControllerInfoBlock=createControllerInfoBlock,exports.initFooter=function initFooter(_x,_x2){return _initFooter.apply(this,arguments)},exports.rebuildFooter=rebuildFooter;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),style=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&&Object.prototype.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}(__webpack_require__("./lib/style.js")),_headerFooterHelpers=__webpack_require__("./lib/utils/headerFooterHelpers.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _initFooter(){return(_initFooter=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(store,options){var footer,pod,podOwner;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(footer=document.getElementById("PageFooter")){_context2.next=3;break}return _context2.abrupt("return");case 3:return pod=(0,_headerFooterHelpers.getPod)(),_context2.next=6,(0,_headerFooterHelpers.getPodOwner)(pod,store);case 6:podOwner=_context2.sent,rebuildFooter(footer,store,pod,podOwner,options)(),_solidLogic.authSession.onLogin(rebuildFooter(footer,store,pod,podOwner,options)),_solidLogic.authSession.onLogout(rebuildFooter(footer,store,pod,podOwner,options));case 10:case"end":return _context2.stop()}}),_callee2)})))).apply(this,arguments)}function rebuildFooter(footer,store,pod,podOwner,options){return(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(){var user;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return user=_solidLogic.authn.currentUser(),footer.innerHTML="",_context.t0=footer,_context.next=5,createControllerInfoBlock(store,user,pod,podOwner,options);case 5:_context.t1=_context.sent,_context.t0.appendChild.call(_context.t0,_context.t1);case 7:case"end":return _context.stop()}}),_callee)})))}function createControllerInfoBlock(store,user,pod,podOwner,options){var profileLinkContainer=document.createElement("div");if(!pod||!podOwner||user&&user.equals(podOwner))return profileLinkContainer;profileLinkContainer.setAttribute("style",style.footer);var podLinkPre=document.createElement("span");podLinkPre.innerText="You're visiting ";var podLink=document.createElement("a");podLink.href=pod.uri,podLink.innerText="the Pod";var profileLinkPre=document.createElement("span");profileLinkPre.innerText=" controlled by ";var profileLink=document.createElement("a");profileLink.href=podOwner.uri,profileLink.innerText=(0,_headerFooterHelpers.getName)(store,podOwner);var solidProjectLinkPre=document.createElement("span");solidProjectLinkPre.innerText=". For more info, check out ";var solidProjectLink=document.createElement("a");solidProjectLink.href=options&&options.solidProjectUrl?options.solidProjectUrl:"https://solidproject.org",solidProjectLink.innerText=options&&options.solidProjectName?options.solidProjectName:"solidproject.org";var solidProjectLinkPost=document.createElement("span");return solidProjectLinkPost.innerText=".",profileLinkContainer.appendChild(podLinkPre),profileLinkContainer.appendChild(podLink),profileLinkContainer.appendChild(profileLinkPre),profileLinkContainer.appendChild(profileLink),profileLinkContainer.appendChild(solidProjectLinkPre),profileLinkContainer.appendChild(solidProjectLink),profileLinkContainer.appendChild(solidProjectLinkPost),profileLinkContainer}},"./lib/header/empty-profile.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.emptyProfile=void 0;exports.emptyProfile='\n\n \n \n \n \n \n \n \n'},"./lib/header/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.createBanner=createBanner,exports.createHelpMenu=createHelpMenu,exports.createLoginSignUpButtons=createLoginSignUpButtons,exports.createUserMenu=createUserMenu,exports.createUserMenuButton=createUserMenuButton,exports.createUserMenuItem=createUserMenuItem,exports.createUserMenuLink=createUserMenuLink,exports.getProfileImg=getProfileImg,exports.initHeader=function initHeader(_x,_x2,_x3){return _initHeader.apply(this,arguments)},exports.rebuildHeader=rebuildHeader;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_index=__webpack_require__("./lib/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_login=__webpack_require__("./lib/login/login.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_emptyProfile=__webpack_require__("./lib/header/empty-profile.js"),_headerFooterHelpers=__webpack_require__("./lib/utils/headerFooterHelpers.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var DEFAULT_HELP_MENU_ICON=_index.icons.iconBase+"noun_help.svg";function _initHeader(){return(_initHeader=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(store,userMenuList,options){var header,pod;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(header=document.getElementById("PageHeader")){_context2.next=3;break}return _context2.abrupt("return");case 3:pod=(0,_headerFooterHelpers.getPod)(),rebuildHeader(header,store,pod,userMenuList,options)(),_solidLogic.authSession.onLogout(rebuildHeader(header,store,pod,userMenuList,options)),_solidLogic.authSession.onLogin(rebuildHeader(header,store,pod,userMenuList,options));case 7:case"end":return _context2.stop()}}),_callee2)})))).apply(this,arguments)}function rebuildHeader(header,store,pod,userMenuList,options){return(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(){var user;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return user=_solidLogic.authn.currentUser(),header.innerHTML="",_context.t0=header,_context.next=5,createBanner(store,pod,user,userMenuList,options);case 5:_context.t1=_context.sent,_context.t0.appendChild.call(_context.t0,_context.t1);case 7:case"end":return _context.stop()}}),_callee)})))}function createBanner(_x4,_x5,_x6,_x7,_x8){return _createBanner.apply(this,arguments)}function _createBanner(){return(_createBanner=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(store,pod,user,userMenuList,options){var podLink,image,userMenu,banner,leftSideOfHeader,helpMenu;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if((podLink=document.createElement("a")).href=pod.uri,podLink.setAttribute("style",style.headerBannerLink),image=document.createElement("img"),options&&(image.src=options.logo?options.logo:"https://solidproject.org/assets/img/solid-emblem.svg"),image.setAttribute("style",style.headerBannerIcon),podLink.appendChild(image),!user){_context3.next=13;break}return _context3.next=10,createUserMenu(store,user,userMenuList);case 10:_context3.t0=_context3.sent,_context3.next=14;break;case 13:_context3.t0=createLoginSignUpButtons();case 14:return userMenu=_context3.t0,(banner=document.createElement("div")).setAttribute("style",style.headerBanner),banner.appendChild(podLink),(leftSideOfHeader=document.createElement("div")).setAttribute("style",style.headerBannerRightMenu),leftSideOfHeader.appendChild(userMenu),options&&options.helpMenuList&&(helpMenu=createHelpMenu(options,options.helpMenuList),leftSideOfHeader.appendChild(helpMenu)),banner.appendChild(leftSideOfHeader),_context3.abrupt("return",banner);case 24:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}function createHelpMenu(options,helpMenuItems){if(helpMenuItems){var helpMenuList=document.createElement("ul");helpMenuList.setAttribute("style",style.headerUserMenuList),helpMenuItems.forEach((function(menuItem){"url"===(menuItem.url?"url":"onclick")?helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label,menuItem.url,menuItem.target))):helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label,menuItem.onclick)))}));var helpMenu=document.createElement("nav");helpMenu.setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed),helpMenu.setAttribute("aria-hidden","true"),helpMenu.setAttribute("id","helperNav"),helpMenu.appendChild(helpMenuList);var helpMenuContainer=document.createElement("div");helpMenuContainer.setAttribute("style",style.headerBannerUserMenu),helpMenuContainer.appendChild(helpMenu);var helpMenuTrigger=document.createElement("button");helpMenuTrigger.setAttribute("style",style.headerUserMenuTrigger),helpMenuTrigger.type="button";var helpMenuIcon=document.createElement("img");helpMenuIcon.src=options&&options.helpIcon?options.helpIcon:_index.icons.iconBase+DEFAULT_HELP_MENU_ICON,helpMenuIcon.setAttribute("style",style.headerUserMenuTriggerImg),helpMenuContainer.appendChild(helpMenuTrigger),helpMenuTrigger.appendChild(helpMenuIcon);var throttledMenuToggle=(0,_headerFooterHelpers.throttle)((function(event){return toggleMenu(event,helpMenuTrigger,helpMenu)}),50);helpMenuTrigger.addEventListener("click",throttledMenuToggle);var timer=setTimeout((function(){return null}),0);return helpMenuContainer.addEventListener("mouseover",(function(event){clearTimeout(timer),throttledMenuToggle(event);var nav=document.getElementById("helperNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenu)})),helpMenuContainer.addEventListener("mouseout",(function(event){timer=setTimeout((function(){return throttledMenuToggle(event)}),200);var nav=document.getElementById("helperNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed)})),helpMenuContainer}}function createLoginSignUpButtons(){var profileLoginButtonPre=document.createElement("div");return profileLoginButtonPre.setAttribute("style",style.headerBannerLogin),profileLoginButtonPre.appendChild((0,_login.loginStatusBox)(document,null,{})),profileLoginButtonPre}function createUserMenuButton(label,onClick){var button=document.createElement("button");return button.setAttribute("style",style.headerUserMenuButton),button.onmouseover=function(){button.setAttribute("style",style.headerUserMenuButtonHover)},button.onmouseout=function(){button.setAttribute("style",style.headerUserMenuButton)},button.addEventListener("click",onClick),button.innerText=label,button}function createUserMenuLink(label,href,target){var link=document.createElement("a");return link.setAttribute("style",style.headerUserMenuLink),link.onmouseover=function(){link.setAttribute("style",style.headerUserMenuLinkHover)},link.onmouseout=function(){link.setAttribute("style",style.headerUserMenuLink)},link.href=href,link.innerText=label,target&&(link.target=target),link}function createUserMenu(_x9,_x10,_x11){return _createUserMenu.apply(this,arguments)}function _createUserMenu(){return(_createUserMenu=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(store,user,userMenuList){var fetcher,loggedInMenuList,loggedInMenu,loggedInMenuTrigger,profileImg,loggedInMenuContainer,throttledMenuToggle,timer;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:if(!(fetcher=store.fetcher)){_context4.next=4;break}return _context4.next=4,fetcher.load(user);case 4:return(loggedInMenuList=document.createElement("ul")).setAttribute("style",style.headerUserMenuList),userMenuList&&userMenuList.forEach((function(menuItem){"url"===(menuItem.url?"url":"onclick")?loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label,menuItem.url,menuItem.target))):loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label,menuItem.onclick)))})),(loggedInMenu=document.createElement("nav")).setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed),loggedInMenu.setAttribute("aria-hidden","true"),loggedInMenu.setAttribute("id","loggedInNav"),loggedInMenu.appendChild(loggedInMenuList),(loggedInMenuTrigger=document.createElement("button")).setAttribute("style",style.headerUserMenuTrigger),loggedInMenuTrigger.type="button","string"==typeof(profileImg=getProfileImg(store,user))?loggedInMenuTrigger.innerHTML=profileImg:loggedInMenuTrigger.appendChild(profileImg),(loggedInMenuContainer=document.createElement("div")).setAttribute("style",style.headerBannerUserMenuNotDisplayed),loggedInMenuContainer.appendChild(loggedInMenuTrigger),loggedInMenuContainer.appendChild(loggedInMenu),throttledMenuToggle=(0,_headerFooterHelpers.throttle)((function(event){return toggleMenu(event,loggedInMenuTrigger,loggedInMenu)}),50),loggedInMenuTrigger.addEventListener("click",throttledMenuToggle),timer=setTimeout((function(){return null}),0),loggedInMenuContainer.addEventListener("mouseover",(function(event){clearTimeout(timer),throttledMenuToggle(event);var nav=document.getElementById("loggedInNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenu)})),loggedInMenuContainer.addEventListener("mouseout",(function(event){timer=setTimeout((function(){return throttledMenuToggle(event)}),200);var nav=document.getElementById("loggedInNav");null==nav||nav.setAttribute("style",style.headerUserMenuNavigationMenuNotDisplayed)})),_context4.abrupt("return",loggedInMenuContainer);case 27:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}function createUserMenuItem(child){var menuProfileItem=document.createElement("li");return menuProfileItem.setAttribute("style",style.headerUserMenuListItem),menuProfileItem.appendChild(child),menuProfileItem}function getProfileImg(store,user){var profileUrl=null;try{if(!(profileUrl=widgets.findImage(user)))return _emptyProfile.emptyProfile}catch(_unused){return _emptyProfile.emptyProfile}var profileImage=document.createElement("div");return profileImage.setAttribute("style",style.headerUserMenuPhoto),profileImage.style.backgroundImage="url(".concat(profileUrl,")"),profileImage}function toggleMenu(event,trigger,menu){var isExpanded="true"===trigger.getAttribute("aria-expanded"),expand="mouseover"===event.type,close="mouseout"===event.type;isExpanded&&expand||!isExpanded&&close||(trigger.setAttribute("aria-expanded",(!isExpanded).toString()),menu.setAttribute("aria-hidden",isExpanded.toString()))}},"./lib/iconBase.js":(module,exports,__webpack_require__)=>{"use strict";module=__webpack_require__.nmd(module),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.originalIconBase=exports.icons=exports.iconBase=void 0;var _debug=__webpack_require__("./lib/debug.js"),icons=exports.icons=module.scriptURI?{iconBase:module.scriptURI.slice(0,module.scriptURI.lastIndexOf("/"))+"/icons/",originalIconBase:module.scriptURI.slice(0,module.scriptURI.lastIndexOf("/"))+"/originalIcons/"}:"undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.iconBase?{iconBase:$SolidTestEnvironment.iconBase,originalIconBase:$SolidTestEnvironment.originalIconBase}:{iconBase:"https://solidos.github.io/solid-ui/src/icons/",originalIconBase:"https://solidos.github.io/solid-ui/src/originalIcons/"};(0,_debug.log)(" icons.iconBase is set to : "+icons.iconBase);exports.iconBase=icons.iconBase,exports.originalIconBase=icons.originalIconBase},"./lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"acl",{enumerable:!0,get:function get(){return _index.acl}}),Object.defineProperty(exports,"aclControl",{enumerable:!0,get:function get(){return _index.aclControl}}),Object.defineProperty(exports,"authn",{enumerable:!0,get:function get(){return _solidLogic.authn}}),Object.defineProperty(exports,"create",{enumerable:!0,get:function get(){return _index2.create}}),exports.dom=exports.createTypes=void 0,Object.defineProperty(exports,"icons",{enumerable:!0,get:function get(){return _iconBase.icons}}),Object.defineProperty(exports,"infiniteMessageArea",{enumerable:!0,get:function get(){return _infinite.infiniteMessageArea}}),Object.defineProperty(exports,"initFooter",{enumerable:!0,get:function get(){return _footer.initFooter}}),Object.defineProperty(exports,"initHeader",{enumerable:!0,get:function get(){return _header.initHeader}}),exports.login=exports.log=exports.language=void 0,Object.defineProperty(exports,"matrix",{enumerable:!0,get:function get(){return _index3.matrix}}),Object.defineProperty(exports,"media",{enumerable:!0,get:function get(){return _index4.media}}),Object.defineProperty(exports,"messageArea",{enumerable:!0,get:function get(){return _messageArea.messageArea}}),exports.rdf=exports.preferences=exports.participation=exports.pad=exports.ns=void 0,Object.defineProperty(exports,"store",{enumerable:!0,get:function get(){return _solidLogic.store}}),exports.style=void 0,Object.defineProperty(exports,"table",{enumerable:!0,get:function get(){return _table.renderTableViewPane}}),exports.utils=exports.tabs=void 0,Object.defineProperty(exports,"versionInfo",{enumerable:!0,get:function get(){return _versionInfo.versionInfo}}),exports.widgets=void 0;var rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js"));exports.rdf=rdf;var ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));exports.ns=ns;var _index=__webpack_require__("./lib/acl/index.js"),_index2=__webpack_require__("./lib/create/index.js"),_iconBase=__webpack_require__("./lib/iconBase.js"),language=_interopRequireWildcard(__webpack_require__("./lib/widgets/forms/autocomplete/language.js"));exports.language=language;var log=_interopRequireWildcard(__webpack_require__("./lib/log.js"));exports.log=log;var _index3=__webpack_require__("./lib/matrix/index.js"),_index4=__webpack_require__("./lib/media/index.js"),_messageArea=__webpack_require__("./lib/messageArea.js"),_infinite=__webpack_require__("./lib/chat/infinite.js"),pad=_interopRequireWildcard(__webpack_require__("./lib/pad.js"));exports.pad=pad;var participation=_interopRequireWildcard(__webpack_require__("./lib/participation.js"));exports.participation=participation;var preferences=_interopRequireWildcard(__webpack_require__("./lib/preferences.js"));exports.preferences=preferences;var style=_interopRequireWildcard(__webpack_require__("./lib/style.js"));exports.style=style;var _table=__webpack_require__("./lib/table.js"),tabs=_interopRequireWildcard(__webpack_require__("./lib/tabs.js"));exports.tabs=tabs;var utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js"));exports.utils=utils;var login=_interopRequireWildcard(__webpack_require__("./lib/login/login.js"));exports.login=login;var widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));exports.widgets=widgets;var _versionInfo=__webpack_require__("./lib/versionInfo.js"),_header=__webpack_require__("./lib/header/index.js"),_footer=__webpack_require__("./lib/footer/index.js"),createTypes=_interopRequireWildcard(__webpack_require__("./lib/create/types.js"));exports.createTypes=createTypes;var _solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var dom=exports.dom=window?window.document:null;"undefined"!=typeof window&&(window.UI={authn:_solidLogic.authn,store:_solidLogic.store,ns,rdf,acl:_index.acl,aclControl:_index.aclControl,create:_index2.create,createTypes,dom,icons:_iconBase.icons,language,log,login,matrix:_index3.matrix,media:_index4.media,messageArea:_messageArea.messageArea,infiniteMessageArea:_infinite.infiniteMessageArea,pad,participation,preferences,style,table:_table.renderTableViewPane,tabs,utils,widgets,versionInfo:_versionInfo.versionInfo,initHeader:_header.initHeader,initFooter:_footer.initFooter})},"./lib/log.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogLevel=void 0,exports.alert=function alert(message){_window&&void 0!==_window.alert?_window.alert(message):warn(message)},exports.clear=function clear(){var _dom2,logArea=null===(_dom2=_dom)||void 0===_dom2?void 0:_dom2.getElementById("status");if(!logArea)return;logArea.innerHTML=""},exports.debug=debug,exports.dumpHTML=function dumpHTML(){var _dom3,_dom3$body;if(!_dom)return;var level=_level;_level=63,debug((null===(_dom3=_dom)||void 0===_dom3||null===(_dom3$body=_dom3.body)||void 0===_dom3$body?void 0:_dom3$body.innerHTML)||""),_level=level},exports.error=function error(message){log(message,1,"eror")},exports.escapeForXML=escapeForXML,exports.info=function info(message){log(message,16,"info")},exports.logAscending=function logAscending(){_ascending=!0},exports.logDescending=function logDescending(){_ascending=!1},exports.msg=function msg(message){log(message)},exports.setInternals=function setInternals(window,document){_window=window,_dom=document},exports.setLevel=function setLevel(level){_level=63,debug("Log level is now "+level),_level=level},exports.success=function success(message){log(message,8,"good")},exports.warn=warn;exports.LogLevel=function(LogLevel){return LogLevel[LogLevel.Error=1]="Error",LogLevel[LogLevel.Warning=2]="Warning",LogLevel[LogLevel.Message=4]="Message",LogLevel[LogLevel.Success=8]="Success",LogLevel[LogLevel.Info=16]="Info",LogLevel[LogLevel.Debug=32]="Debug",LogLevel[LogLevel.All=63]="All",LogLevel}({});var _level=7,_ascending=!1,_dom=document,_window=window;function log(str){var type=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,typestr=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mesg";if(_level&type)if(void 0!==_dom){var logArea=_dom.getElementById("status");if(!logArea)return;var addendum=_dom.createElement("span");addendum.setAttribute("class",typestr);var now=new Date;addendum.innerHTML="".concat(now.getHours(),":").concat(now.getMinutes(),":").concat(now.getSeconds()," [").concat(typestr,"] ").concat(escapeForXML(str),"
                                                          "),_ascending?logArea.insertBefore(addendum,logArea.firstChild):logArea.appendChild(addendum)}else"undefined"!=typeof console&&console.log(str)}function warn(message){log(message,2,"warn")}function debug(message){log(message,32,"dbug")}function escapeForXML(str){return str.replace(/&/g,"&").replace(//g,">")}},"./lib/login/login.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/web.url.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.ensureLoadedPreferences=ensureLoadedPreferences,exports.ensureLoadedProfile=ensureLoadedProfile,exports.ensureLoggedIn=ensureLoggedIn,exports.filterAvailablePanes=function filterAvailablePanes(_x13){return _filterAvailablePanes.apply(this,arguments)},exports.findAppInstances=function findAppInstances(_x3,_x4,_x5){return _findAppInstances.apply(this,arguments)},exports.getUserRoles=getUserRoles,exports.loginStatusBox=loginStatusBox,exports.newAppInstance=function newAppInstance(dom,appDetails,callback){var gotWS=function gotWS(ws,base){callback(ws,base)},div=dom.createElement("div"),b=dom.createElement("button");return b.setAttribute("type","button"),div.appendChild(b),b.innerHTML="Make new ".concat(appDetails.noun),b.addEventListener("click",(function(_event){div.appendChild(selectWorkspace(dom,appDetails,gotWS))}),!1),div.appendChild(b),div},exports.registrationControl=function registrationControl(_x6,_x7,_x8){return _registrationControl.apply(this,arguments)},exports.registrationList=function registrationList(_x9,_x10){return _registrationList.apply(this,arguments)},exports.renderScopeHeadingRow=renderScopeHeadingRow,exports.renderSignInPopup=renderSignInPopup,exports.scopeLabel=scopeLabel,exports.selectWorkspace=selectWorkspace;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_log=__webpack_require__("./lib/log.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_signup=__webpack_require__("./lib/signup/signup.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i",box.setAttribute("style","font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;"),table=box.firstChild,tbody=table.firstChild,_iterator2=_createForOfIteratorHelper(scopes),_context10.prev=16,_iterator2.s();case 18:if((_step2=_iterator2.n()).done){_context10.next=44;break}return scope=_step2.value,headingRow=renderScopeHeadingRow(context,0,scope),tbody.appendChild(headingRow),_context10.next=24,getScopedAppsFromIndex(scope,options.type||null);case 24:0===(items=_context10.sent).length&&(headingRow.style.display="none"),_iterator3=_createForOfIteratorHelper(items),_context10.prev=27,_loop=_regenerator.default.mark((function _loop(){var item,row;return _regenerator.default.wrap((function _loop$(_context9){for(;;)switch(_context9.prev=_context9.next){case 0:item=_step3.value,row=widgets.personTR(dom,ns.solid("instance"),item.instance,{deleteFunction:function(){var _deleteFunction=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee8(){return _regenerator.default.wrap((function _callee8$(_context8){for(;;)switch(_context8.prev=_context8.next){case 0:return _context8.next=2,deleteTypeIndexRegistration(item);case 2:tbody.removeChild(row);case 3:case"end":return _context8.stop()}}),_callee8)})));return function deleteFunction(){return _deleteFunction.apply(this,arguments)}}()}),row.children[0].style.paddingLeft="3em",tbody.appendChild(row);case 4:case"end":return _context9.stop()}}),_loop)})),_iterator3.s();case 30:if((_step3=_iterator3.n()).done){_context10.next=34;break}return _context10.delegateYield(_loop(),"t0",32);case 32:_context10.next=30;break;case 34:_context10.next=39;break;case 36:_context10.prev=36,_context10.t1=_context10.catch(27),_iterator3.e(_context10.t1);case 39:return _context10.prev=39,_iterator3.f(),_context10.finish(39);case 42:_context10.next=18;break;case 44:_context10.next=49;break;case 46:_context10.prev=46,_context10.t2=_context10.catch(16),_iterator2.e(_context10.t2);case 49:return _context10.prev=49,_iterator2.f(),_context10.finish(49);case 52:return _context10.abrupt("return",context);case 53:case"end":return _context10.stop()}}),_callee9,null,[[16,46,49,52],[27,36,39,42]])}))),_registrationList.apply(this,arguments)}function signInOrSignUpBox(dom,setUserCallback){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},signInButtonStyle=(options=options||{}).buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",box=dom.createElement("div"),magicClassName="SolidSignInOrSignUpBox";debug.log("widgets.signInOrSignUpBox"),box.setUserCallback=setUserCallback,box.setAttribute("class",magicClassName),box.setAttribute("style","display:flex;");var signInPopUpButton=dom.createElement("input");box.appendChild(signInPopUpButton),signInPopUpButton.setAttribute("type","button"),signInPopUpButton.setAttribute("value","Log in"),signInPopUpButton.setAttribute("style","".concat(signInButtonStyle,"background-color: #eef;").concat(style.headerBannerLoginInput)),_solidLogic.authSession.onLogin((function(){var me=_solidLogic.authn.currentUser();if(me){var webIdURI=me.uri,divs=dom.getElementsByClassName(magicClassName);debug.log("Logged in, ".concat(divs.length," panels to be serviced"));for(var i=0;i',issuerPopupBoxCloseButton.setAttribute("style","background-color: transparent; border: none;"),issuerPopupBoxCloseButton.addEventListener("click",(function(){issuerPopup.remove()})),issuerPopupBoxTopMenu.appendChild(issuerPopupBoxLabel),issuerPopupBoxTopMenu.appendChild(issuerPopupBoxCloseButton);var loginToIssuer=function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(issuerUri){var preLoginRedirectHash,locationUrl;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.prev=0,_solidLogic.solidLogicSingleton.store.updater.flagAuthorizationMetadata(),(preLoginRedirectHash=new URL(window.location.href).hash)&&window.localStorage.setItem("preLoginRedirectHash",preLoginRedirectHash),window.localStorage.setItem("loginIssuer",issuerUri),(locationUrl=new URL(window.location.href)).hash="",_context.next=9,_solidLogic.authSession.login({redirectUrl:locationUrl.href,oidcIssuer:issuerUri});case 9:_context.next=14;break;case 11:_context.prev=11,_context.t0=_context.catch(0),(0,_log.alert)(_context.t0.message);case 14:case"end":return _context.stop()}}),_callee,null,[[0,11]])})));return function loginToIssuer(_x11){return _ref.apply(this,arguments)}}(),issuerTextContainer=dom.createElement("div");issuerTextContainer.setAttribute("style","\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var issuerTextInputContainer=dom.createElement("div");issuerTextInputContainer.setAttribute("style","\n display: flex;\n flex-direction: row;\n ");var issuerTextLabel=dom.createElement("label");issuerTextLabel.innerText="Enter the URL of your identity provider:",issuerTextLabel.setAttribute("style","color: #888");var issuerTextInput=dom.createElement("input");issuerTextInput.setAttribute("type","text"),issuerTextInput.setAttribute("style","margin-left: 0 !important; flex: 1; margin-right: 5px !important"),issuerTextInput.setAttribute("placeholder","https://example.com"),issuerTextInput.value=localStorage.getItem("loginIssuer")||"";var issuerTextGoButton=dom.createElement("button");issuerTextGoButton.innerText="Go",issuerTextGoButton.setAttribute("style","margin-top: 12px; margin-bottom: 12px;"),issuerTextGoButton.addEventListener("click",(function(){loginToIssuer(issuerTextInput.value)})),issuerTextContainer.appendChild(issuerTextLabel),issuerTextInputContainer.appendChild(issuerTextInput),issuerTextInputContainer.appendChild(issuerTextGoButton),issuerTextContainer.appendChild(issuerTextInputContainer),issuerPopupBox.appendChild(issuerTextContainer);var issuerButtonContainer=dom.createElement("div");issuerButtonContainer.setAttribute("style","\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var issuerBottonLabel=dom.createElement("label");issuerBottonLabel.innerText="Or pick an identity provider from the list below:",issuerBottonLabel.setAttribute("style","color: #888"),issuerButtonContainer.appendChild(issuerBottonLabel),(0,_solidLogic.getSuggestedIssuers)().forEach((function(issuerInfo){var issuerButton=dom.createElement("button");issuerButton.innerText=issuerInfo.name,issuerButton.setAttribute("style","height: 38px; margin-top: 10px"),issuerButton.addEventListener("click",(function(){loginToIssuer(issuerInfo.uri)})),issuerButtonContainer.appendChild(issuerButton)})),issuerPopupBox.appendChild(issuerButtonContainer)}function loginStatusBox(dom){var listener=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},me=(0,_solidLogic.offlineTestID)(),box=dom.createElement("div");function setIt(newidURI){newidURI&&(me=_solidLogic.authn.saveUser(newidURI),box.refresh(),listener&&listener(me.uri))}function logoutButtonHandler(_event){var oldMe=me;_solidLogic.authSession.logout().then((function(){var message="Your WebID was ".concat(oldMe,". It has been forgotten.");me=null;try{(0,_log.alert)(message)}catch(e){window.alert(message)}box.refresh(),listener&&listener(null)}),(function(err){(0,_log.alert)("Fail to log out:"+err)}))}function logoutButton(me,options){var signInButtonStyle=options.buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",logoutLabel="WebID logout";if(me){var nick=_solidLogic.solidLogicSingleton.store.any(me,ns.foaf("nick"))||_solidLogic.solidLogicSingleton.store.any(me,ns.foaf("name"));nick&&(logoutLabel="Logout "+nick.value)}var signOutButton=dom.createElement("input");return signOutButton.setAttribute("type","button"),signOutButton.setAttribute("value",logoutLabel),signOutButton.setAttribute("style","".concat(signInButtonStyle,"background-color: #eee;")),signOutButton.addEventListener("click",logoutButtonHandler,!1),signOutButton}function trackSession(){me=_solidLogic.authn.currentUser(),box.refresh()}return box.refresh=function(){var sessionInfo=_solidLogic.authSession.info;((me=sessionInfo&&sessionInfo.webId&&sessionInfo.isLoggedIn?_solidLogic.solidLogicSingleton.store.sym(sessionInfo.webId):null)&&box.me!==me.uri||!me&&box.me)&&(widgets.clearElement(box),me?box.appendChild(logoutButton(me,options)):box.appendChild(signInOrSignUpBox(dom,setIt,options))),box.me=me?me.uri:null},box.refresh(),trackSession(),_solidLogic.authSession.onLogin(trackSession),_solidLogic.authSession.onLogout(trackSession),box.me="99999",box.refresh(),box}function selectWorkspace(dom,appDetails,callbackWS){var noun=appDetails.noun,appPathSegment=appDetails.appPathSegment,me=(0,_solidLogic.offlineTestID)(),box=dom.createElement("div"),context={me,dom,div:box};function say(s,background){box.appendChild(widgets.errorMessageBlock(dom,s,background))}function figureOutBase(ws){var newBaseString,newBaseNode=_solidLogic.solidLogicSingleton.store.any(ws,ns.space("uriPrefix"));"/"!==(newBaseString=newBaseNode?newBaseNode.value:ws.uri.split("#")[0]).slice(-1)&&(debug.log("".concat(appPathSegment,": No / at end of uriPrefix ").concat(newBaseString)),newBaseString="".concat(newBaseString,"/"));var now=new Date;return newBaseString+="".concat(appPathSegment,"/id").concat(now.getTime(),"/")}return ensureLoadedPreferences(context).then((function displayOptions(context){function _makeNewWorkspace(){return _makeNewWorkspace=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(_event){var row,cell,newBase,newWs,newData;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return row=table.appendChild(dom.createElement("tr")),(cell=row.appendChild(dom.createElement("td"))).setAttribute("colspan","3"),cell.style.padding="0.5em",_context3.t0=encodeURI,_context3.next=7,widgets.askName(dom,_solidLogic.solidLogicSingleton.store,cell,ns.solid("URL"),ns.space("Workspace"),"Workspace");case 7:if(_context3.t1=_context3.sent,newBase=(0,_context3.t0)(_context3.t1),newWs=widgets.newThing(context.preferencesFile),newData=[(0,_rdflib.st)(context.me,ns.space("workspace"),newWs,context.preferencesFile),(0,_rdflib.st)(newWs,ns.space("uriPrefix"),newBase,context.preferencesFile)],_solidLogic.solidLogicSingleton.store.updater){_context3.next=13;break}throw new Error("store has no updater");case 13:return _context3.next=15,_solidLogic.solidLogicSingleton.store.updater.update([],newData);case 15:case"end":return _context3.stop()}}),_callee3)}))),_makeNewWorkspace.apply(this,arguments)}var id=context.me,preferencesFile=context.preferencesFile,newBase=null,w=_solidLogic.solidLogicSingleton.store.each(id,ns.space("workspace"),void 0,preferencesFile),storages=_solidLogic.solidLogicSingleton.store.each(id,ns.space("storage"));0===w.length&&storages&&(say("You don't seem to have any workspaces. You have ".concat(storages.length," storage spaces."),"white"),storages.map((function(s){return w=w.concat(_solidLogic.solidLogicSingleton.store.each(s,ns.ldp("contains")))})).filter((function(file){return file.id?["public","private"].includes(file.id().toLowerCase()):""}))),1===w.length&&(say("Workspace used: ".concat(w[0].uri),"white"),newBase=figureOutBase(w[0]));var table=dom.createElement("table");table.setAttribute("style","border-collapse:separate; border-spacing: 0.5em;"),box.appendChild(table),box.appendChild(dom.createElement("hr"));var p=box.appendChild(dom.createElement("p"));p.setAttribute("style",style.commentStyle),p.textContent="Where would you like to store the data for the ".concat(noun,"?\n Give the URL of the folder where you would like the data stored.\n It can be anywhere in solid world - this URI is just an idea.");var baseField=box.appendChild(dom.createElement("input"));baseField.setAttribute("type","text"),baseField.setAttribute("style",style.textInputStyle),baseField.size=80,baseField.label="base URL",baseField.autocomplete="on",newBase&&(baseField.value=newBase),context.baseField=baseField,box.appendChild(dom.createElement("br"));var col1,col2,col3,tr,ws,localStyle,comment,button=box.appendChild(dom.createElement("button"));button.setAttribute("style",style.buttonStyle),button.textContent="Start new ".concat(noun," at this URI"),button.addEventListener("click",(function(_event){var newBase=baseField.value.replace(" ","%20");"/"!==newBase.slice(-1)&&(newBase+="/"),callbackWS(null,newBase)})),w=w.filter((function(x){return!_solidLogic.solidLogicSingleton.store.holds(x,ns.rdf("type"),ns.space("MasterWorkspace"))}));for(var cellStyle="height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;",deselectedStyle="".concat(cellStyle,"border: 0px;"),i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.matrix=void 0;var _matrix=__webpack_require__("./lib/matrix/matrix.js");exports.matrix={matrixForQuery:_matrix.matrixForQuery}},"./lib/matrix/matrix.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.matrixForQuery=function matrixForQuery(dom,query,vx,vy,vvalue,options,whenDone){var matrix=dom.createElement("table"),header=dom.createElement("tr");header.appendChild(dom.createElement("td")).setAttribute("class","MatrixCorner"),matrix.appendChild(header),matrix.lastHeader=header;var columns=[],rows=[],setCell=function setCell(cell,x,y,value){for(;cell.firstChild;)cell.removeChild(cell.firstChild);cell.setAttribute("style",""),cell.style.textAlign="center",options.cellFunction?options.cellFunction(cell,x,y,value):(cell.textContent=utils.label(value),cell.setAttribute("style","padding: 0.3em")),delete cell.old},rowFor=function rowFor(y1){var y=y1.toNT();if(rows[y])return rows[y];var tr=dom.createElement("tr"),header=tr.appendChild(dom.createElement("td"));header.setAttribute("style","padding: 0.3em;"),header.textContent=utils.label(y1),"NamedNode"===y1.termType&&kb.fetcher.nowOrWhenFetched(y1.uri.split("#")[0],void 0,(function(ok,_body,_response){ok&&(header.textContent=utils.label(y1))}));for(var i=0;iele.dataValueNT&&options&&options.yDecreasing||ycolumns[i]&&options.xDecreasing||xNT0&&!rowsUsed[row.dataValueNT])delete rows[row.dataValueNT],matrix.removeChild(row);else for(var _j=row.children.length-1;_j>0;_j--){var _cell=row.children[_j];colsUsed[_j]||row.removeChild(_cell)}for(var newcolumns=[],_j2=0;_j2{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.media=void 0;var _mediaCapture=__webpack_require__("./lib/media/media-capture.js");exports.media={cameraCaptureControl:_mediaCapture.cameraCaptureControl,cameraButton:_mediaCapture.cameraButton}},"./lib/media/media-capture.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.cameraButton=function cameraButton(dom,store,getImageDoc,doneCallback){var control,div=dom.createElement("div"),but=widgets.button(dom,cameraIcon,"Take picture");function restoreButton(_x){return _restoreButton.apply(this,arguments)}function _restoreButton(){return(_restoreButton=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(imageDoc){return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:div.removeChild(control),div.appendChild(but),doneCallback(imageDoc);case 3:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}return div.appendChild(but),but.addEventListener("click",(function(_event){div.removeChild(but),control=cameraCaptureControl(dom,store,getImageDoc,restoreButton),div.appendChild(control)})),div},exports.cameraCaptureControl=cameraCaptureControl;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var cameraIcon=_iconBase.icons.iconBase+"noun_Camera_1618446_000000.svg",retakeIcon=_iconBase.icons.iconBase+"noun_479395.svg",controlStyle="border-radius: 0.5em; margin: 0.8em; width: ".concat("640","; height:").concat("480",";");function cameraCaptureControl(dom,store,getImageDoc,doneCallback){var destination,imageBlob,player,canvas,div=dom.createElement("div"),table=div.appendChild(dom.createElement("table")),main=table.appendChild(dom.createElement("tr")).appendChild(dom.createElement("td"));main.setAttribute("colspan","4");var buttons=table.appendChild(dom.createElement("tr"));buttons.appendChild(dom.createElement("td")).appendChild(widgets.cancelButton(dom)).addEventListener("click",(function(_event){stopVideo(),doneCallback(null)}));var retakeButton=buttons.appendChild(dom.createElement("td")).appendChild(widgets.button(dom,retakeIcon,"Retake"));retakeButton.addEventListener("click",(function(_event){!function retake(){main.removeChild(canvas),displayPlayer()}()})),retakeButton.style.visibility="collapse";var shutterButton=buttons.appendChild(dom.createElement("td")).appendChild(widgets.button(dom,_iconBase.icons.iconBase+"noun_10636.svg","Snap"));shutterButton.addEventListener("click",(function grabCanvas(){(canvas=dom.createElement("canvas")).setAttribute("width","640"),canvas.setAttribute("height","480"),canvas.setAttribute("style",controlStyle),main.appendChild(canvas),canvas.getContext("2d").drawImage(player,0,0,canvas.width,canvas.height),player.parentNode.removeChild(player),canvas.toBlob((function(blob){var msg="got blob type ".concat(blob.type," size ").concat(blob.size);debug.log(msg),destination=getImageDoc(),imageBlob=blob,function reviewImage(){sendButton.style.visibility="visible",retakeButton.style.visibility="visible",shutterButton.style.visibility="collapse"}()}),"image/png")})),shutterButton.style.visibility="collapse";var sendButton=buttons.appendChild(dom.createElement("td")).appendChild(widgets.continueButton(dom));function displayPlayer(){if((player=main.appendChild(dom.createElement("video"))).setAttribute("controls","1"),player.setAttribute("autoplay","1"),player.setAttribute("style",controlStyle),!navigator.mediaDevices)throw new Error("navigator.mediaDevices not available");navigator.mediaDevices.getUserMedia(constraints).then((function(stream){player.srcObject=stream,shutterButton.style.visibility="visible",sendButton.style.visibility="collapse",retakeButton.style.visibility="collapse"}))}sendButton.addEventListener("click",(function(_event){!function saveBlob(blob,destination){var contentType=blob.type;debug.log("Putting "+blob.size+" bytes of "+contentType+" to "+destination),store.fetcher.webOperation("PUT",destination.uri,{data:blob,contentType}).then((function(_resp){debug.log("ok saved "+destination),stopVideo(),doneCallback(destination)}),(function(err){stopVideo(),alert(err)}))}(imageBlob,destination)})),sendButton.style.visibility="collapse";var constraints={video:!0};function stopVideo(){player&&player.srcObject&&player.srcObject.getVideoTracks().forEach((function(track){return track.stop()}))}return displayPlayer(),div}},"./lib/messageArea.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.messageArea=function messageArea(dom,kb,subject,messageStore,options){kb=kb||_solidLogic.solidLogicSingleton.store,messageStore=messageStore.doc();var messageTable,me,ns=UI.ns,WF=rdf.Namespace("http://www.w3.org/2005/01/wf/flow#"),DCT=rdf.Namespace("http://purl.org/dc/terms/"),newestFirst=!!(options=options||{}).newestFirst,messageBodyStyle="white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;",div=dom.createElement("div"),updater=_solidLogic.solidLogicSingleton.store.updater,anchor=function anchor(text,term){var a=dom.createElement("a");return term&&term.uri&&(a.setAttribute("href",term.uri),a.addEventListener("click",UI.widgets.openHrefInOutlineMode,!0),a.setAttribute("style","color: #3B5998; text-decoration: none; ")),a.textContent=text,a},mention=function mention(message,style){var pre=dom.createElement("pre");return pre.setAttribute("style",style||"color: grey"),div.appendChild(pre),pre.appendChild(dom.createTextNode(message)),pre},announce={log:function log(message){mention(message,"color: #111;")},warn:function warn(message){mention(message,"color: #880;")},error:function error(message){mention(message,"color: #800;")}};function nick(person){var s=_solidLogic.solidLogicSingleton.store.any(person,UI.ns.foaf("nick"));return s?""+s.value:""+utils.label(person)}function creatorAndDate(td1,creator,date,message){var nickAnchor=td1.appendChild(anchor(nick(creator),creator));creator.uri&&_solidLogic.solidLogicSingleton.store.fetcher.nowOrWhenFetched(creator.doc(),void 0,(function(_ok,_body){nickAnchor.textContent=nick(creator)})),td1.appendChild(dom.createElement("br")),td1.appendChild(anchor(date,message))}function syncMessages(about,messageTable){var ele,ele2,displayed={};for(ele=messageTable.firstChild;ele;ele=ele.nextSibling)ele.AJAR_subject&&(displayed[ele.AJAR_subject.uri]=!0);var messages=kb.each(about,ns.wf("message")),stored={};for(messages.forEach((function(m){stored[m.uri]=!0,displayed[m.uri]||addMessage(m)})),ele=messageTable.firstChild;ele;)ele2=ele.nextSibling,ele.AJAR_subject&&!stored[ele.AJAR_subject.uri]&&messageTable.removeChild(ele),ele=ele2}var addMessage=function addMessage(message){var bindings={"?msg":message,"?creator":kb.any(message,ns.foaf("maker")),"?date":kb.any(message,DCT("created")),"?content":kb.any(message,ns.sioc("content"))};renderMessage(bindings,!0)},renderMessage=function renderMessage(bindings,fresh){var creator=bindings["?creator"],message=bindings["?msg"],date=bindings["?date"],content=bindings["?content"],dateString=date.value,tr=dom.createElement("tr");tr.AJAR_date=dateString,tr.AJAR_subject=message;for(var done=!1,ele=messageTable.firstChild;ele;ele=ele.nextSibling)if(dateString>ele.AJAR_date&&newestFirst||dateString{"use strict";__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js"),_solidNamespace=_interopRequireDefault(__webpack_require__("./node_modules/solid-namespace/index.js")),$rdf=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&&Object.prototype.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}(__webpack_require__("./node_modules/rdflib/esm/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}module.exports=(0,_solidNamespace.default)($rdf)},"./lib/pad.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.reflect.construct.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getChunks=getChunks,exports.lightColorHash=lightColorHash,Object.defineProperty(exports,"manageParticipation",{enumerable:!0,get:function get(){return _participation.manageParticipation}}),exports.notepad=function notepad(dom,padDoc,subject,me,options){var exists=(options=options||{}).exists,table=dom.createElement("table"),kb=store;if(me&&!me.uri)throw new Error("UI.pad.notepad: Invalid userid");var updater=store.updater,PAD=(0,_rdflib.Namespace)("http://www.w3.org/ns/pim/pad#");table.setAttribute("style","padding: 1em; overflow: auto; resize: horizontal; min-width: 40em;");var upstreamStatus=null,downstreamStatus=null;if(options.statusArea){var tr=options.statusArea.appendChild(dom.createElement("table")).appendChild(dom.createElement("tr"));upstreamStatus=tr.appendChild(dom.createElement("td")),downstreamStatus=tr.appendChild(dom.createElement("td")),upstreamStatus&&upstreamStatus.setAttribute("style","width:50%"),downstreamStatus&&downstreamStatus.setAttribute("style","width:50%")}var complain=function complain(message){var upstream=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,_debug.log)(message),options.statusArea&&(upstream?upstreamStatus:downstreamStatus).appendChild((0,_widgets.errorMessageBlock)(dom,message,"pink"))},clearStatus=function clearStatus(_upsteam){options.statusArea&&(options.statusArea.innerHTML="")},setPartStyle=function setPartStyle(part,colors,pending){var chunk=part.subject;colors=colors||"";var author=kb.any(chunk,ns.dc("author"));!colors&&author&&(colors="color: "+(pending?"#888":"black")+"; background-color: "+lightColorHash(author)+";");var indent=kb.any(chunk,PAD("indent")),style=(indent=indent?indent.value:0)>=0?"font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;text-indent: "+3*indent+"em;":"font-family: sans-serif; font-weight: bold; border: none;"+["font-size: 110%; padding-top: 0.5em; padding-bottom: 0.5em; width: 100%;","font-size: 120%; padding-top: 1em; padding-bottom: 1em; width: 100%;","font-size: 150%; padding-top: 1em; padding-bottom: 1em; width: 100%;"][-1-indent];part.setAttribute("style",style+colors)},removePart=function removePart(part){var chunk=part.subject;if(!chunk)throw new Error("No chunk for line to be deleted!");var prev=kb.any(void 0,PAD("next"),chunk),next=kb.any(chunk,PAD("next"));if(prev.sameTerm(subject)&&next.sameTerm(subject))(0,_debug.log)("You can't delete the only line.");else{var del=kb.statementsMatching(chunk,void 0,void 0,padDoc).concat(kb.statementsMatching(void 0,void 0,chunk,padDoc)),ins=[(0,_rdflib.st)(prev,PAD("next"),next,padDoc)];if(chunk instanceof _rdflib.NamedNode){var label=chunk.uri.slice(-4);(0,_debug.log)("Deleting line "+label)}if(!updater)throw new Error("have no updater");updater.update(del,ins,(function(uri,ok,errorMessage,response){if(ok){var row=part.parentNode;if(row){var before=row.previousSibling;row.parentNode&&row.parentNode.removeChild(row),before&&before.firstChild&&before.firstChild.focus()}}else if(response&&409===response.status)setPartStyle(part,"color: black; background-color: #ffd;"),part.state=0,(0,_utils.beep)(.5,512),setTimeout((function(){reloadAndSync()}),1e3);else{(0,_debug.log)(" removePart FAILED "+chunk+": "+errorMessage),(0,_debug.log)(" removePart was deleteing :'"+del),setPartStyle(part,"color: black; background-color: #fdd;");var res=response?response.status:" [no response field] ";complain("Error "+res+" saving changes: "+errorMessage.true)}}))}},addListeners=function addListeners(part,chunk){part.addEventListener("keydown",(function(event){if(!updater)throw new Error("no updater");var queueProperty,queue;switch(event.keyCode){case 13:var before=event.shiftKey;if((0,_debug.log)("enter"),before?(queue=kb.any(void 0,PAD("next"),chunk),queueProperty="newlinesAfter"):(queue=kb.any(chunk,PAD("next")),queueProperty="newlinesBefore"),queue[queueProperty]=queue[queueProperty]||0,queue[queueProperty]+=1,queue[queueProperty]>1)return void(0,_debug.log)(" queueing newline queue = "+queue[queueProperty]);(0,_debug.log)(" go ahead line before "+queue[queueProperty]),newChunk(part,before);break;case 8:if(0===part.value.length)switch((0,_debug.log)("Delete key line "+chunk.uri.slice(-4)+" state "+part.state),part.state){case 1:case 2:return void(part.state=4);case 3:case 4:return;case void 0:case 0:part.state=3,removePart(part),event.preventDefault();break;default:throw new Error("pad: Unexpected state "+part)}break;case 9:var delta=event.shiftKey?-1:1;!function changeIndent(part,chunk,delta){var del=kb.statementsMatching(chunk,PAD("indent")),current=del.length?Number(del[0].object.value):0;if(!(current+delta<-3)){var newIndent=current+delta,ins=(0,_rdflib.st)(chunk,PAD("indent"),newIndent,padDoc);if(!updater)throw new Error("no updater");updater.update(del,ins,(function(uri,ok,errorBody){ok?setPartStyle(part):((0,_debug.log)("Indent change FAILED '"+newIndent+"' for "+padDoc+": "+errorBody),setPartStyle(part,"color: black; background-color: #fdd;"),updater.requestDownstreamAction(padDoc,reloadAndSync))}))}}(part,chunk,delta),event.preventDefault();break;case 27:(0,_debug.log)("escape"),updater.requestDownstreamAction(padDoc,reloadAndSync),event.preventDefault();break;case 38:part.parentNode.previousSibling&&(part.parentNode.previousSibling.firstChild.focus(),event.preventDefault());break;case 40:part.parentNode.nextSibling&&(part.parentNode.nextSibling.firstChild.focus(),event.preventDefault())}}));var updateStore=function updateStore(part){var chunk=part.subject;setPartStyle(part,void 0,!0);var ins,old=kb.any(chunk,ns.sioc("content")).value,del=[(0,_rdflib.st)(chunk,ns.sioc("content"),old,padDoc)];part.value&&(ins=[(0,_rdflib.st)(chunk,ns.sioc("content"),part.value,padDoc)]);var newOne=part.value;if(part.lastSent&&old!==part.lastSent)throw new Error("Out of order, last sent expected '"+old+"' but found '"+part.lastSent+"'");if(part.lastSent=newOne,!updater)throw new Error("no updater");updater.update(del,ins,(function(uri,ok,errorBody,xhr){ok?(clearStatus(),setPartStyle(part),(0,_debug.log)(" Patch ok '"+old+"' -> '"+newOne+"' "),4===part.state?(part.state=3,removePart(part)):3===part.state||(2===part.state?(part.state=1,updateStore(part)):part.state=0)):((0,_debug.log)(" patch FAILED "+xhr.status+" for '"+old+"' -> '"+newOne+"': "+errorBody),409===xhr.status?(setPartStyle(part,"color: black; background-color: #fdd;"),part.state=0,(0,_utils.beep)(.5,512),setTimeout((function(){updater.requestDownstreamAction(padDoc,reloadAndSync)}),1e3)):(setPartStyle(part,"color: black; background-color: #fdd;"),part.state=0,complain(" Error "+xhr.status+" sending data: "+errorBody,!0),(0,_utils.beep)(1,128)))}))};part.addEventListener("input",(function inputChangeListener(_event){switch(setPartStyle(part,void 0,!0),(0,_debug.log)("Input event state "+part.state+" value '"+part.value+"'"),part.state){case 3:case 4:case 2:return;case 1:return void(part.state=2);case 0:case void 0:part.state=1,updateStore(part)}}))},newPartAfter=function newPartAfter(tr1,chunk,before){var text=kb.any(chunk,ns.sioc("content"));text=text?text.value:"";var tr=dom.createElement("tr");before?table.insertBefore(tr,tr1):tr1&&tr1.nextSibling?table.insertBefore(tr,tr1.nextSibling):table.appendChild(tr);var part=tr.appendChild(dom.createElement("input"));return part.subject=chunk,part.setAttribute("type","text"),part.value=text,me?(setPartStyle(part,""),addListeners(part,chunk)):(setPartStyle(part,"color: #222; background-color: #fff"),(0,_debug.log)("Note can't add listeners - not logged in")),part},newChunk=function newChunk(ele,before){var here,prev,next,queue,tr1,kb=store,indent=0,queueProperty=null;ele?("input"!==ele.tagName.toLowerCase()&&(0,_debug.log)("return pressed when current document is: "+ele.tagName),here=ele.subject,indent=(indent=kb.any(here,PAD("indent")))?Number(indent.value):0,before?(prev=kb.any(void 0,PAD("next"),here),next=here,queue=prev,queueProperty="newlinesAfter"):(prev=here,next=kb.any(here,PAD("next")),queue=next,queueProperty="newlinesBefore"),tr1=ele.parentNode):(prev=subject,next=subject,tr1=void 0);var chunk=(0,_widgets.newThing)(padDoc),label=chunk.uri.slice(-4),del=[(0,_rdflib.st)(prev,PAD("next"),next,padDoc)],ins=[(0,_rdflib.st)(prev,PAD("next"),chunk,padDoc),(0,_rdflib.st)(chunk,PAD("next"),next,padDoc),(0,_rdflib.st)(chunk,ns.dc("author"),me,padDoc),(0,_rdflib.st)(chunk,ns.sioc("content"),"",padDoc)];if(indent>0&&ins.push((0,_rdflib.st)(chunk,PAD("indent"),indent,padDoc)),(0,_debug.log)(" Fresh chunk "+label+" proposed"),!updater)throw new Error("no updater");updater.update(del,ins,(function(uri,ok,errorBody,_xhr){if(ok){var newPart=newPartAfter(tr1,chunk,before);setPartStyle(newPart),newPart.focus(),queueProperty&&((0,_debug.log)(" Fresh chunk "+label+" updated, queue = "+queue[queueProperty]),queue[queueProperty]-=1,queue[queueProperty]>0&&((0,_debug.log)(" Implementing queued newlines = "+next.newLinesBefore),newChunk(newPart,before)))}else(0,_debug.log)(" ERROR writing new line "+label+": "+errorBody)}))},consistencyCheck=function consistencyCheck(){var found={},failed=0;function complain2(msg){complain(msg),failed++}if(!kb.the(subject,PAD("next")))return complain2("No initial next pointer"),!1;for(var chunk,prev=subject;(chunk=kb.the(prev,PAD("next")))||complain2("No next pointer from "+prev),!chunk.sameTerm(subject);){prev=chunk;var label=chunk.uri.split("#")[1];if(found[chunk.uri])return complain2("Loop!"),!1;found[chunk.uri]=!0;var k=kb.each(chunk,PAD("next")).length;1!==k&&complain2("Should be 1 not "+k+" next pointer for "+label),(k=kb.each(chunk,PAD("indent")).length)>1&&complain2("Should be 0 or 1 not "+k+" indent for "+label),1!==(k=kb.each(chunk,ns.sioc("content")).length)&&complain2("Should be 1 not "+k+" contents for "+label),1!==(k=kb.each(chunk,ns.dc("author")).length)&&complain2("Should be 1 not "+k+" author for "+label),kb.statementsMatching(void 0,ns.sioc("contents")).forEach((function(st){found[st.subject.value]||complain2("Loose chunk! "+st.subject.value)}))}return!failed},sync=function sync(){if(1!==kb.each(subject,PAD("next")).length){var msg="Pad: Inconsistent data - NEXT pointers: "+kb.each(subject,PAD("next")).length;return(0,_debug.log)(msg),void(options.statusArea&&(options.statusArea.textContent+=msg))}for(var row,manif=[],chunk=kb.the(subject,PAD("next"));!chunk.sameTerm(subject);chunk=kb.the(chunk,PAD("next")))for(var i=0;i=0;_i--)manif[(row=table.children[_i]).firstChild.subject.uri]||table.removeChild(row);row=table.firstChild;for(var _chunk=kb.the(subject,PAD("next"));!_chunk.sameTerm(subject);_chunk=kb.the(_chunk,PAD("next"))){var text=kb.any(_chunk,ns.sioc("content")).value;if(row&&manif[_chunk.uri]){var part=row.firstChild;text!==part.value&&(part.value=text),setPartStyle(part),part.state=0,delete part.lastSent,row=row.nextSibling}else newPartAfter(row,_chunk,!0)}},refreshTree=function refreshTree(root){if(root.refresh)root.refresh();else for(var i=0;i\n \n",title=kb.anyValue(pad,ns.dct("title"));title&&(html+=" ".concat(xmlEncode(title),"\n"));html+=" \n \n";var level=0;function decreaseLevel(indent){for(;level>indent;level--)html+="\n"}return chunks.forEach((function(chunk){var indent=kb.anyJS(chunk,PAD("indent")),rawContent=kb.anyJS(chunk,ns.sioc("content"));if(rawContent){var content=xmlEncode(rawContent);if(indent<0){decreaseLevel(0);var h=indent>=-3?4+indent:1;html+="\n").concat(content,"\n")}else indent>0?(decreaseLevel(indent),function increaseLevel(indent){for(;level\n"}(indent),html+="
                                                        • ".concat(content,"
                                                        • \n")):(decreaseLevel(indent),html+="

                                                          ".concat(content,"

                                                          \n"))}})),decreaseLevel(0),html+=" \n\n"},Object.defineProperty(exports,"participationObject",{enumerable:!0,get:function get(){return _participation.participationObject}}),Object.defineProperty(exports,"recordParticipation",{enumerable:!0,get:function get(){return _participation.recordParticipation}}),Object.defineProperty(exports,"renderPartipants",{enumerable:!0,get:function get(){return _participation.renderPartipants}}),exports.xmlEncode=xmlEncode;_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/assertThisInitialized.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/inherits.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/getPrototypeOf.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/wrapNativeSuper.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"));var ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_widgets=__webpack_require__("./lib/widgets/index.js"),_utils=__webpack_require__("./lib/utils/index.js"),_debug=__webpack_require__("./lib/debug.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_participation=__webpack_require__("./lib/participation.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}var store=_solidLogic.solidLogicSingleton.store,PAD=(0,_rdflib.Namespace)("http://www.w3.org/ns/pim/pad#");function lightColorHash(author){return author&&author.uri?"#"+(16777215&function hash(x){return x.split("").reduce((function(a,b){return(a=(a<<5)-a+b.charCodeAt(0))&a}),0)}(author.uri)|12632256).toString(16):"#ffffff"}function getChunks(subject,kb){for(var chunks=[],chunk=kb.the(subject,PAD("next"));!chunk.sameTerm(subject);chunk=kb.the(chunk,PAD("next")))chunks.push(chunk);return chunks}function xmlEncode(str){return str.replace("&","&").replace("<","<").replace(">",">")}},"./lib/participation.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.reflect.construct.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.manageParticipation=function manageParticipation(dom,container,padDoc,subject,me,options){var table=dom.createElement("table");container.appendChild(table),renderPartipants(dom,table,padDoc,subject,me,options);try{recordParticipation(subject,padDoc,table)}catch(e){container.appendChild((0,_widgets.errorMessageBlock)(dom,"Error recording your partipation: "+e))}return table},exports.participationObject=function participationObject(subject,padDoc,me){return new Promise((function(resolve,reject){if(!me)throw new Error("No user id");var parps=store.each(subject,ns.wf("participation")).filter((function(pn){return store.holds(pn,ns.wf("participant"),me)}));if(parps.length>1){var _step,candidates=[],_iterator=function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}(parps);try{for(_iterator.s();!(_step=_iterator.n()).done;){var participation=_step.value,date=store.anyValue(participation,ns.cal("dtstart"));date&&candidates.push([date,participation])}}catch(err){_iterator.e(err)}finally{_iterator.f()}candidates.sort(),debug.warn("Multiple particpation objects, picking earliest, in "+padDoc),resolve(candidates[0][1])}if(parps.length)resolve(parps[0]);else{var _participation2=(0,_widgets.newThing)(padDoc),ins=[(0,_rdflib.st)(subject,ns.wf("participation"),_participation2,padDoc),(0,_rdflib.st)(_participation2,ns.wf("participant"),me,padDoc),(0,_rdflib.st)(_participation2,ns.cal("dtstart"),new Date,padDoc),(0,_rdflib.st)(_participation2,ns.ui("backgroundColor"),(0,_pad.lightColorHash)(me),padDoc)];store.updater.update([],ins,(function(uri,ok,errorMessage){ok?resolve(_participation2):reject(new Error("Error recording your partipation: "+errorMessage))})),resolve(_participation2)}}))},exports.recordParticipation=recordParticipation,exports.renderPartipants=renderPartipants;_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/assertThisInitialized.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/inherits.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/getPrototypeOf.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/wrapNativeSuper.js")),_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"));var _debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),debug=_debug,_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_widgets=__webpack_require__("./lib/widgets/index.js"),_utils=__webpack_require__("./lib/utils/index.js"),_pad=__webpack_require__("./lib/pad.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i1)throw new Error("Multiple records of your participation");if(parps.length)return parps[0];if(!store.updater.editable(padDoc))return debug.log("Not recording participation, as no write acesss as "+me+" to "+padDoc),null;var participation=(0,_widgets.newThing)(padDoc),ins=[(0,_rdflib.st)(subject,ns.wf("participation"),participation,padDoc),(0,_rdflib.st)(participation,ns.wf("participant"),me,padDoc),(0,_rdflib.st)(participation,ns.cal("dtstart"),new Date,padDoc),(0,_rdflib.st)(participation,ns.ui("backgroundColor"),(0,_pad.lightColorHash)(me),padDoc)];return store.updater.update([],ins,(function(uri,ok,errorMessage){if(!ok)throw new Error("Error recording your partipation: "+errorMessage);refreshable&&refreshable.refresh&&refreshable.refresh()})),participation}}},"./lib/preferences.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.get=function get(k){return value[k]},exports.getPreferencesForClass=function getPreferencesForClass(subject,theClass,predicates,context){return new Promise((function(resolve,reject){recordSharedPreferences(subject,context).then((function(context){var sharedPreferences=context.sharedPreferences;if(context.me)participation.participationObject(subject,subject.doc(),context.me).then((function(participation){recordPersonalDefaults(theClass,context).then((function(context){var results=[],personalDefaults=context.personalDefaults;predicates.forEach((function(pred){var v1=kb.any(participation,pred)||kb.any(sharedPreferences,pred)||kb.any(personalDefaults,pred);v1&&(results[pred.uri]=toJS(v1))})),resolve(results)}),reject)}),reject);else{var results=[];predicates.forEach((function(pred){var v1=kb.any(sharedPreferences,pred);v1&&(results[pred.uri]=toJS(v1))})),resolve(results)}}))}))},exports.recordPersonalDefaults=recordPersonalDefaults,exports.recordSharedPreferences=recordSharedPreferences,exports.renderPreferencesForm=function renderPreferencesForm(subject,theClass,preferencesForm,context){var prefContainer=context.dom.createElement("div");return participation.participationObject(subject,subject.doc(),context.me).then((function(participation){var dom=context.dom;function heading(text){prefContainer.appendChild(dom.createElement("h5")).textContent=text}heading("My view of this "+context.noun),widgets.appendForm(dom,prefContainer,{},participation,preferencesForm,subject.doc(),(function(ok,mes){ok||widgets.complain(context,mes)})),heading("Everyone's view of this "+context.noun),recordSharedPreferences(subject,context).then((function(context){var sharedPreferences=context.sharedPreferences;widgets.appendForm(dom,prefContainer,{},sharedPreferences,preferencesForm,subject.doc(),(function(ok,mes){ok||widgets.complain(context,mes)})),heading("My default view of any "+context.noun),recordPersonalDefaults(theClass,context).then((function(context){widgets.appendForm(dom,prefContainer,{},context.personalDefaults,preferencesForm,context.preferencesFile,(function(ok,mes){ok||widgets.complain(context,mes)}))}),(function(err){widgets.complain(context,err)}))}))}),(function(err){prefContainer.appendChild(widgets.errorMessageBlock(context.dom,err))})),prefContainer},exports.set=function set(k,v){if("string"!=typeof v)throw debug.log("Non-string value of preference "+k+": "+v),new Error("Non-string value of preference "+k+": "+v);this.value[k]=v},exports.value=void 0;var $rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_login=__webpack_require__("./lib/login/login.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),participation=_interopRequireWildcard(__webpack_require__("./lib/participation.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=_solidLogic.store,value=exports.value=[];function recordSharedPreferences(subject,context){return new Promise((function(resolve,reject){var sharedPreferences=kb.any(subject,ns.ui("sharedPreferences"));if(sharedPreferences)context.sharedPreferences=sharedPreferences,resolve(context);else{var sp=$rdf.sym(subject.doc().uri+"#SharedPreferences"),ins=[$rdf.st(subject,ns.ui("sharedPreferences"),sp,subject.doc())];debug.log("Creating shared preferences "+sp),kb.updater.update([],ins,(function(uri,ok,errorMessage){ok?(context.sharedPreferences=sp,resolve(context)):reject(new Error("Error creating shared prefs: "+errorMessage))}))}}))}function recordPersonalDefaults(theClass,context){return new Promise((function(resolve,reject){(0,_login.ensureLoadedPreferences)(context).then((function(context){if(context.preferencesFile){var prefs,reg,regs=kb.each(null,ns.solid("forClass"),theClass,context.preferencesFile),ins=[];if(regs.length){if(regs.forEach((function(r){prefs=prefs||kb.any(r,ns.solid("personalDefaults"))})),prefs)return context.personalDefaults=prefs,void resolve(context);prefs=widgets.newThing(context.preferencesFile),reg=regs[0]}else reg=widgets.newThing(context.preferencesFile),ins=[$rdf.st(reg,ns.rdf("type"),ns.solid("TypeRegistration"),context.preferencesFile),$rdf.st(reg,ns.solid("forClass"),theClass,context.preferencesFile)];prefs=widgets.newThing(context.preferencesFile),ins.push($rdf.st(reg,ns.solid("personalDefaults"),prefs,context.preferencesFile)),kb.updater.update([],ins,(function(uri,ok,errm){ok?(context.personalDefaults=prefs,resolve(context)):reject(new Error("Setting preferences for "+theClass+": "+errm))}))}else debug.log("Not doing private class preferences as no access to preferences file. "+context.preferencesFileError)}),(function(err){reject(err)}))}))}function toJS(term){return term.datatype?term.datatype.equals(ns.xsd("boolean"))?"1"===term.value:term.datatype.equals(ns.xsd("dateTime"))||term.datatype.equals(ns.xsd("date"))?new Date(term.value):term.datatype.equals(ns.xsd("integer"))||term.datatype.equals(ns.xsd("float"))||term.datatype.equals(ns.xsd("decimal"))?Number(term.value):term.value:term}},"./lib/signup/config-default.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;exports.default={authEndpoint:"",fallbackAuthEndpoint:"https://databox.me/",signupEndpoint:"https://solidproject.org/use-solid/",signupWindowHeight:600,signupWindowWidth:1024,key:"",cert:""}},"./lib/signup/signup.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.Signup=Signup;var _configDefault=_interopRequireDefault(__webpack_require__("./lib/signup/config-default.js"));function Signup(config){this.config=config||_configDefault.default}Signup.prototype.listen=function listen(){return new Promise((function(resolve,reject){var eventMethod=window.addEventListener?"addEventListener":"attachEvent";(0,window[eventMethod])("attachEvent"===eventMethod?"onmessage":"message",(function(e){var u=e.data;if("User:"===u.slice(0,5)){var user=u.slice(5,u.length);return user&&user.length>0&&"http"===user.slice(0,4)?resolve(user):reject(user)}}),!0)}))},Signup.prototype.signup=function signup(signupUrl){signupUrl=signupUrl||this.config.signupEndpoint;var width=this.config.signupWindowWidth,height=this.config.signupWindowHeight,leftPosition=window.screen.width/2-(width/2+10),topPosition=window.screen.height/2-(height/2+50),windowUrl=signupUrl+"?origin="+encodeURIComponent(window.location.origin),windowSpecs="resizable,scrollbars,status,width="+width+",height="+height+",left="+leftPosition+",top="+topPosition;window.open(windowUrl,"Solid signup",windowSpecs);var self=this;return new Promise((function(resolve){self.listen().then((function(webid){return resolve(webid)}))}))}},"./lib/style.js":(module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.style=void 0;var style=exports.style={checkboxStyle:"color: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;",checkboxInputStyle:"font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em",fieldLabelStyle:"color: #3B5998; text-decoration: none;",formSelectSTyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyleUneditable:"background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputSize:20,buttonStyle:"background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;",commentStyle:"padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;",iconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;",smallButtonStyle:"margin: 0.2em; width: 1em; height:1em;",classIconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;",confirmPopupStyle:"padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;",tabBorderRadius:"0.2em",messageBodyStyle:"white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;",pendingeditModifier:"color: #bbb;",highlightColor:"#7C4DFF",personaBarStyle:"width: 100%; height: 4em; background-color: #eee; vertical-align: middle;",searchInputStyle:"border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;",autocompleteRowStyle:"border: 0.2em solid straw;",signInButtonStyle:"padding: 1em; border-radius:0.2em; font-size: 100%;",heading1Style:"font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;",heading2Style:"font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;",heading3Style:"font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;",heading4Style:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formBorderColor:"#888888",formHeadingColor:"#888888",formHeadingStyle:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formTextInput:"font-size: 100%; margin: 0.1em; padding: 0.1em;",formGroupStyle:["padding-left: 0em; border: 0.0em solid ".concat("#888888","; border-radius: 0.2em;"),"padding-left: 2em; border: 0.05em solid ".concat("#888888","; border-radius: 0.2em;"),"padding-left: 2em; border: 0.1em solid ".concat("#888888","; border-radius: 0.2em;"),"padding-left: 2em; border: 0.2em solid ".concat("#888888","; border-radius: 0.2em;")],formFieldLabelStyle:"'color: ".concat("#3B5998","; text-decoration: none;'"),formFieldNameBoxWidth:"8em",formFieldNameBoxStyle:"padding: 0.3em; vertical-align: middle; width:".concat("8em",";"),textInputBackgroundColor:"#eef",textInputBackgroundColorUneditable:"#fff",textInputColor:"#000",textInputColorPending:"#888",multilineTextInputStyle:"font-size:100%; white-space: pre-wrap; background-color: #eef; border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;",renderAsDivStyle:"display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;",imageDivStyle:"width:2.5em; padding:0.5em; height: 2.5em;",linkDivStyle:"width:2em; padding:0.5em; height: 4em;",aclControlBoxContainer:"margin: 1em",aclControlBoxHeader:"font-size: 120%; margin: 0 0 1rem",aclControlBoxStatus:"display: none; margin: 1rem 0",aclControlBoxStatusRevealed:"display: block",aclGroupContent:"maxWidth: 650",accessGroupList:"display: grid; grid-template-columns: 1fr; margin: 1em; width: 100%",accessGroupListItem:"display: grid; grid-template-columns: 100px auto 30%",defaultsController:"display: flex",defaultsControllerNotice:"color: #888; flexGrow: 1; fontSize: 80%",bigButton:"background-color: white; border: 0.1em solid #888; border-radius: 0.3em; max-width: 50%; padding-bottom: 1em; padding-top: 1em",group:"color: #888",group1:"color: green",group2:"color: #cc0",group3:"color: orange",group5:"color: red",group9:"color: blue",group13:"color: purple",trustedAppAddApplicationsTable:"background-color: #eee",trustedAppCancelButton:"float: right",trustedAppControllerI:"border-color: orange; borderRadius: 1em; borderWidth: 0.1em",temporaryStatusInit:"background: green",temporaryStatusEnd:"background: transparent; transition: background 5s linear",headerUserMenuLink:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none",headerUserMenuLinkHover:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)",headerUserMenuTrigger:"background: none; border: 0; cursor: pointer; width: 60px; height: 60px",headerUserMenuTriggerImg:"border-radius: 50%; height: 56px; width: 28px !important",headerUserMenuButton:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%",headerUserMenuButtonHover:"background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)",headerUserMenuList:"list-style: none; margin: 0; padding: 0",headerUserMenuListDisplay:"list-style: none; margin: 0; padding: 0; display:true",headerUserMenuNavigationMenu:"background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: true",headerUserMenuNavigationMenuNotDisplayed:"background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: none",headerUserMenuListItem:"border-bottom: solid 1px #000000",headerUserMenuPhoto:"border-radius: 50%; background-position: center; background-repeat: no-repeat; background-size: cover; height: 50px; width: 50px",headerBanner:"box-shadow: 0px 1px 4px #000000; display: flex; justify-content: space-between; padding: 0 1.5em; margin-bottom: 4px",headerBannerLink:"display: block",headerBannerRightMenu:"display: flex",headerBannerLogin:"margin-left: auto",allChildrenVisible:"display:true",headerBannerLoginInput:"margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important",headerBannerUserMenu:"border-left: solid 1px #000000; margin-left: auto",headerBannerHelpMenu:"border-left: solid 1px #000000; margin.left: auto",headerBannerIcon:"background-size: 65px 60px !important; height: 60px !important; width: 65px !important",footer:"border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em",primaryButton:"background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",primaryButtonHover:"background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",primaryButtonNoBorder:"background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",primaryButtonNoBorderHover:"background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",secondaryButton:"background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",secondaryButtonHover:"background-color: #37cde6; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out",secondaryButtonNoBorder:"background-color: #ffffff; color: #01c9ea; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none",secondaryButtonNoBorderHover:"background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out"};style.setStyle=function setStyle(ele,styleName){ele.style=style[styleName]},module.exports=style},"./lib/style_multiSelect.js":(module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.style=void 0;var style=exports.style={multiselect__container:"\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n min-height: 36px;\n padding: 4px 8px 0 8px;\n position: relative;\n width: 354px;\n margin-bottom: 5px;\n font-size: 100%\n ",multiselect__wrapper:"\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n height: 100%;\n width: 100%;\n ",multiselect__clear_btn:"\n cursor: pointer;\n align-items: center;\n margin-bottom: 4px;\n margin-left: 4px;\n ",multiselect__options:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n ",multiselect__options_visible:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n max-height: 200px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n opacity: 1;\n transition: max-height 0.2s ease;\n ",multiselect__options_ul:"\n list-style: none;\n margin: 0;\n padding: 2px 0;\n max-height: 200px;\n overflow: auto;\n ",multiselect__options_ul_li:"\n cursor: pointer;\n padding: 4px 8px;\n ",multiselect__options_ul_li_hover:"\n background-color: #dedede;\n ",multiselect__options_ul_p_multiselect__options_no_results:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_p_multiselect__options_no_data:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_li_multiselect__options_selected:"\n background-color: #656565;\n color: #fff;\n ",multiselect__options_ul_li_multiselect__options_selected_hover:"\n background-color: #656565;\n ",multiselect__options_ul_li_arrow_selected:"\n border: 2px solid rgba(101, 101, 101, 0.5);\n ",multiselect__selected:"\n background-color: #656565;\n border-radius: 2px;\n color: #fff;\n margin-bottom: 4px;\n margin-right: 4px;\n padding: 4px 8px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n ",multiselect__selected_multiselect__remove_btn:"\n cursor: pointer;\n display: flex;\n margin-left: 6px;\n ",multiselect__input:"\n border: none;\n -ms-flex-preferred-size: 40%;\n flex-basis: 40%;\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n height: 5px; \n margin-bottom: 4px;\n min-width: 40%;\n outline: none; \n "};style.setStyle=function setStyle(ele,styleName){ele.style=style[styleName]},module.exports=style},"./lib/table.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.date.now.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.renderTableViewPane=function renderTableViewPane(doc,options){var allType,types,typeSelectorDiv,addColumnDiv,sourceDocument=options.sourceDocument,tableClass=options.tableClass,givenQuery=options.query,ns=UI.ns,kb=_solidLogic.store,rowsLookup={},FORBIDDEN_COLUMNS={"http://www.w3.org/2002/07/owl#sameAs":!0,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":!0},XSD_NUMBER_TYPES={"http://www.w3.org/2001/XMLSchema#decimal":!0,"http://www.w3.org/2001/XMLSchema#float":!0,"http://www.w3.org/2001/XMLSchema#double":!0,"http://www.w3.org/2001/XMLSchema#integer":!0,"http://www.w3.org/2001/XMLSchema#nonNegativeInteger":!0,"http://www.w3.org/2001/XMLSchema#positiveInteger":!0,"http://www.w3.org/2001/XMLSchema#nonPositiveInteger":!0,"http://www.w3.org/2001/XMLSchema#negativeInteger":!0,"http://www.w3.org/2001/XMLSchema#long":!0,"http://www.w3.org/2001/XMLSchema#int":!0,"http://www.w3.org/2001/XMLSchema#short":!0,"http://www.w3.org/2001/XMLSchema#byte":!0,"http://www.w3.org/2001/XMLSchema#unsignedLong":!0,"http://www.w3.org/2001/XMLSchema#unsignedInt":!0,"http://www.w3.org/2001/XMLSchema#unsignedShort":!0,"http://www.w3.org/2001/XMLSchema#unsignedByte":!0},XSD_DATE_TYPES={"http://www.w3.org/2001/XMLSchema#dateTime":!0,"http://www.w3.org/2001/XMLSchema#date":!0},IMAGE_TYPES={"http://xmlns.com/foaf/0.1/Image":!0,"http://purl.org/dc/terms/Image":!0},keyVariable=options.keyVariable||"?_row",subjectIdCounter=0,lastQuery=null,mostCommonType=null,resultDiv=doc.createElement("div");resultDiv.className="tableViewPane",resultDiv.appendChild(function generateControlBar(){var result=doc.createElement("table");result.setAttribute("class","toolbar");var tr=doc.createElement("tr");return typeSelectorDiv=doc.createElement("td"),tr.appendChild(typeSelectorDiv),addColumnDiv=doc.createElement("td"),tr.appendChild(addColumnDiv),result.appendChild(tr),result}());var table,tableDiv=doc.createElement("div");if(resultDiv.appendChild(tableDiv),resultDiv.refresh=function(){runQuery(table.query,table.logicalRows,table.columns,table)},givenQuery)table=renderTableForQuery(givenQuery),tableDiv.appendChild(table);else{var s=function calculateTable(){var subjects,types,s=function discoverTypes(){for(var types={},subjectList=kb.statementsMatching(void 0,UI.ns.rdf("type"),tableClass,sourceDocument),subjects={},i=0;ibestCount&&(best=type,bestCount=type.useCount)}return best}(types),buildFilteredTable(mostCommonType||allType)}return resultDiv;function generateQuery(type){var query=new rdf.Query,rowVar=kb.variable(keyVariable.slice(1));return function addSelectToQuery(query,type){for(var selectedColumns=type.getColumns(),i=0;ibLabel)-(aLabel0){resultDiv.appendChild(doc.createTextNode("Add column: "));var dropdown=doc.createElement("select");dropdown.appendChild(optionElement("","-1"));for(var i=0;i=0&&(type.addColumn(unusedColumns[columnIndex]),buildFilteredTable(type))}),!1)}return resultDiv}(type)),function updateTable(query,type){lastQuery&&(lastQuery.running=!1);var htmlTable=renderTableForQuery(query,type);clearElement(tableDiv),tableDiv.appendChild(htmlTable),lastQuery=query}(generateQuery(type),type)}function clearElement(element){for(;element.childNodes.length>0;)element.removeChild(element.childNodes[0])}function SubjectType(type){this.type=type,this.columns=null,this.allColumns=[],this.useCount=0,this.getAllColumns=function(){return this.allColumns},this.getColumns=function(){if(!this.columns){var allColumns=this.getAllColumns();this.columns=allColumns.slice(0,7)}return this.columns},this.getUnusedColumns=function(){for(var allColumns=this.getAllColumns(),columns=this.getColumns(),result=[],i=0;ib.useCount)}columns.sort(sortFunction)}(allColumnsList),type.allColumns=allColumnsList}function renderColumnDeleteButton(type,column){var button=doc.createElement("a");return button.appendChild(doc.createTextNode("[x]")),button.addEventListener("click",(function(){type.removeColumn(column),buildFilteredTable(type)}),!1),button}function applyColumnFiltersToRow(row,columns){for(var rowDisplayed=!0,c=0;cstrValue2?1:0}),reverse)}function renderLiteralSelector(rows,columns,column){var result=doc.createElement("div"),textBox=doc.createElement("input");textBox.setAttribute("type","text"),textBox.style.width="70%",result.appendChild(textBox);var sort1=doc.createElement("span");sort1.appendChild(doc.createTextNode("▼")),sort1.addEventListener("click",(function(){literalSort(rows,column,!1)}),!1),result.appendChild(sort1);var sort2=doc.createElement("span");sort2.appendChild(doc.createTextNode("▲")),sort2.addEventListener("click",(function(){literalSort(rows,column,!0)}),!1),result.appendChild(sort2);var substring=null;return column.filterFunction=function(colValue){return!substring||!!colValue&&("Literal"===colValue.termType?colValue.value:"NamedNode"===colValue.termType?utils.label(colValue):"").toLowerCase().indexOf(substring)>=0},textBox.addEventListener("keyup",(function(){substring=""!==textBox.value?textBox.value.toLowerCase():null,applyColumnFilters(rows,columns)}),!1),result}function renderEnumSelector(rows,columns,column,list){for(var result=doc.createElement("div"),dropdown=doc.createElement("select"),searchValue={},i=0;imax))},minSelector.addEventListener("keyup",eventListener,!1),maxSelector.addEventListener("keyup",eventListener,!1),result}function renderTableSelector(rows,columns,column){if(column.superClass&&column.alternatives.length>0)return renderEnumSelector(rows,columns,column,column.alternatives);for(var range,cs=column.getConstraints(),i=0;i0)return renderEnumSelector(rows,columns,column,choices.elements)}return function fallbackRenderTableSelector(rows,columns,column){return column.checkedAnyValues&&column.possiblyNumber?renderNumberSelector(rows,columns,column):column.possiblyLiteral?renderLiteralSelector(rows,columns,column):null}(rows,columns,column)}function linkTo(uri,linkText,hints){hints=hints||{};var result=doc.createElement("a"),linkFunction=hints.linkFunction;return result.setAttribute("href",uri),result.appendChild(doc.createTextNode(linkText)),linkFunction?result.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var uri=utils.getTarget(e).getAttribute("href");uri||debug.log("No href found \n"),linkFunction(uri)}),!0):result.addEventListener("click",UI.widgets.openHrefInOutlineMode,!0),result}function getHints(column){return options&&options.hints&&column.variable&&options.hints[column.variable.toNT()]?options.hints[column.variable.toNT()]:{}}function renderValue(obj,column){var hints=getHints(column),cellFormat=hints.cellFormat;if(!cellFormat){if("Literal"===obj.termType){if(obj.datatype){if(XSD_DATE_TYPES[obj.datatype.uri])return doc.createTextNode(UI.widgets.shortDate(obj.value));if(XSD_NUMBER_TYPES[obj.datatype.uri]){var span=doc.createElement("span");return span.textContent=obj.value,span.setAttribute("style","text-align: right"),span}}return doc.createTextNode(obj.value)}if("NamedNode"===obj.termType&&column.isImageColumn())return function renderImage(obj){var result=doc.createElement("img");return result.setAttribute("src",obj.uri),result.style.height="40px",result}(obj);if("NamedNode"===obj.termType||"BlankNode"===obj.termType)return function linkToObject(obj,hints){var match=!1;return obj.uri&&(match=obj.uri.match(/^mailto:(.*)/)),linkTo(obj.uri,match?match[1]:utils.label(obj),hints)}(obj,hints);if("Collection"===obj.termType){var _span=doc.createElement("span");return _span.appendChild(doc.createTextNode("[")),obj.elements.forEach((function(x){_span.appendChild(renderValue(x,column)),_span.appendChild(doc.createTextNode(", "))})),_span.removeChild(_span.lastChild),_span.appendChild(doc.createTextNode("]")),_span}return doc.createTextNode("unknown termtype '"+obj.termType+"'!")}if("shortDate"===cellFormat)return doc.createTextNode(UI.widgets.shortDate(obj.value))}function valueInList(value,list){var i,key=null;if("Literal"===value.termType)key="value";else{if("NamedNode"!==value.termType)return list.indexOf(value)>=0;key="uri"}for(i=0;ij&&(orig=row.originalValues[columnKey][j],obj.toString()!==orig.toString()&&(different=!0)),td.appendChild(renderValue(obj,column)),j!==objects.length-1&&td.appendChild(doc.createTextNode(",\n")),different&&(td.style.background="#efe")}}tr.appendChild(td)}return row._htmlRow=tr,tr}(row._htmlRow,row,columns)),applyColumnFiltersToRow(row,columns)}function getSubjectId(subject){if("uri"in subject)return subject.uri;if("_subject_id"in subject)return subject._subject_id;var result=""+subjectIdCounter;return subject._subject_id=result,++subjectIdCounter,result}function runQuery(query,rows,columns,table){query.running=!0;var startTime=Date.now(),progressMessage=doc.createElement("tr");table.appendChild(progressMessage),progressMessage.textContent="Loading ...";for(var i=0;i=0;_i4--)if(rows[_i4].original){debug.log(" deleting row "+rows[_i4]._subject);var tr=rows[_i4]._htmlRow;tr.parentNode.removeChild(tr),delete rowsLookup[getSubjectId(rows[_i4]._subject)],rows.splice(_i4,1)}if(options.sortBy){var column=function getColumnForVariable(columns,variableNT){for(var predicateUri in columns){var column=columns[predicateUri];if(column.variable.toNT()===variableNT)return column}throw new Error("getColumnForVariable: no column for variable ".concat(variableNT))}(columns,options.sortBy);literalSort(rows,column,options.sortReverse)}options.onDone&&options.onDone(resultDiv)}))}function inferColumnsFromFormula(columns,formula){UI.log.debug(">> processing formula");for(var i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.reflect.construct.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.TabWidgetElement=void 0,exports.tabWidget=function tabWidget(options){var subject=options.subject,dom=options.dom||document,orientation=parseInt(options.orientation||"0"),backgroundColor=options.backgroundColor||"#ddddcc",flipped=2&orientation,vertical=1&orientation,onClose=options.onClose,_getColors=function getColors(backgroundColor){return function isLight(x){for(var total=0,i=0;i<3;i++)total+=parseInt(x.slice(2*i+1,2*i+3),16);return total>384}(backgroundColor)?[colorBlend(backgroundColor,"#ffffff",.3),"#000000"]:[colorBlend(backgroundColor,"#000000",.3),"#ffffff"]}(backgroundColor),_getColors2=(0,_slicedToArray2.default)(_getColors,2),selectedColor=_getColors2[0],color=_getColors2[1],bodyMainStyle="flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor,"; padding: 1em;"),rootElement=dom.createElement("div");rootElement.setAttribute("style","display: flex; height: 100%; width: 100%; flex-direction: "+(vertical?"row":"column")+(flipped?"-reverse;":";"));var navElement=rootElement.appendChild(dom.createElement("nav"));navElement.setAttribute("style","margin: 0;");var mainElement=rootElement.appendChild(dom.createElement("main"));mainElement.setAttribute("style","margin: 0; width:100%; height: 100%;");var tabContainer=navElement.appendChild(dom.createElement("ul"));tabContainer.setAttribute("style","\n list-style-type: none;\n display: flex;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n flex-direction: ".concat(vertical?"column":"row","\n "));var bodyContainer=mainElement;rootElement.tabContainer=tabContainer,rootElement.bodyContainer=bodyContainer;var corners=["0.2em","0.2em","0","0"],cornersPrepped=corners.concat(corners).slice(orientation,orientation+4),cornersStyle="border-radius: ".concat(cornersPrepped.join(" "),";"),margins=["0.3em","0.3em","0","0.3em"],marginsPrepped=margins.concat(margins).slice(orientation,orientation+4),marginsStyle="margin: ".concat(marginsPrepped.join(" "),";"),paddingStyle="padding: ".concat(marginsPrepped.join(" "),";"),tabStyle=cornersStyle+"position: relative; padding: 0.7em; max-width: 20em; color: ".concat(color,";"),unselectedStyle="".concat(tabStyle+marginsStyle," opacity: 50%; background-color: ").concat(backgroundColor,";"),selectedStyle="".concat(tabStyle+marginsStyle," background-color: ").concat(selectedColor,";"),shownStyle="height: 100%; width: 100%;",hiddenStyle=shownStyle+"display: none;";if(rootElement.refresh=orderedSync,orderedSync(),!options.startEmpty&&tabContainer.children.length&&options.selectedTab){var selectedTab0=Array.from(tabContainer.children).map((function(tab){return tab.firstChild})).find((function(tab){return tab.dataset.name===options.selectedTab})),selectedTabURI=options.selectedTab.uri,selectedTab1=Array.from(tabContainer.children).find((function(tab){return tab.subject&&tab.subject.uri&&tab.subject.uri===selectedTabURI})),clickMe=(selectedTab1||selectedTab0||tabContainer.children[0]).firstChild;clickMe&&clickMe.click()}else options.startEmpty||tabContainer.children[0].firstChild.click();return rootElement;function makeNewSlot(item){var ele=dom.createElement("li");ele.setAttribute("style",unselectedStyle),ele.subject=item;var div=ele.appendChild(dom.createElement("button"));if(div.setAttribute("style","background: none; border: none; font: inherit; cursor: pointer"),div.onclick=function(){if(resetTabStyle(),resetBodyStyle(),ele.setAttribute("style",selectedStyle),ele.bodyTR){ele.bodyTR.setAttribute("style",shownStyle);var bodyMain=getOrCreateContainerElement(ele);options.renderMain&&ele.subject&&!1!==bodyMain.asSettings&&(bodyMain.innerHTML="loading item ..."+item,options.renderMain(bodyMain,ele.subject),bodyMain.asSettings=!1)}},options.renderTabSettings&&ele.subject){var ellipsis=dom.createElement("button");ellipsis.textContent="...",ellipsis.setAttribute("style","position: absolute; right: 0; bottom: 0; width: 20%; background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit;"),ellipsis.onclick=function(){if(resetTabStyle(),resetBodyStyle(),ele.setAttribute("style",selectedStyle),ele.bodyTR){ele.bodyTR.setAttribute("style",shownStyle);var bodyMain=getOrCreateContainerElement(ele);options.renderTabSettings&&ele.subject&&!0!==bodyMain.asSettings&&(bodyMain.innerHTML="loading settings ..."+item,options.renderTabSettings(bodyMain,ele.subject),bodyMain.asSettings=!0)}},ele.appendChild(ellipsis)}return options.renderTab?options.renderTab(div,item):div.innerHTML=(0,_utils.label)(item),ele;function getOrCreateContainerElement(ele){var _ele$bodyTR,bodyMain=null===(_ele$bodyTR=ele.bodyTR)||void 0===_ele$bodyTR?void 0:_ele$bodyTR.children[0];if(bodyMain)return bodyMain;var newBodyMain=ele.bodyTR.appendChild(dom.createElement("main"));return newBodyMain.setAttribute("style",bodyMainStyle),newBodyMain}}function orderedSync(){var slot,i,j,left,right,items=function getItems(){return options.items?options.items:!1!==options.ordered?_solidLogic.store.the(subject,options.predicate).elements:_solidLogic.store.each(subject,options.predicate)}(),differ=!1;for(left=0;left=items.length||slot.subject&&!slot.subject.sameTerm(items[left])){differ=!0;break}if(differ||items.length!==tabContainer.children.length){for(right=tabContainer.children.length-1;right>=0&&(slot=tabContainer.children[right],j=right-tabContainer.children.length+items.length,!slot.subject||slot.subject.sameTerm(items[j]));right--);for(var insertables=items.slice(left,right-tabContainer.children.length+items.length+1);right>=left;)tabContainer.removeChild(tabContainer.children[left]),bodyContainer.removeChild(bodyContainer.children[left]),right-=1;for(i=0;i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.date.now.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getName=function getName(store,user){return store.anyValue(user,_.ns.vcard("fn"),null,user.doc())||store.anyValue(user,_.ns.foaf("name"),null,user.doc())||user.uri},exports.getPod=function getPod(){return(0,_rdflib.sym)(document.location.origin).site()},exports.getPodOwner=function getPodOwner(_x,_x2){return _getPodOwner.apply(this,arguments)},exports.throttle=function throttle(func,wait){var context,args,result,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},timeout=null,previous=0,later=function later(){previous=options.leading?Date.now():0,timeout=null,result=func.apply(context,args),timeout||(context=args=null)};return function(){var now=Date.now();previous||options.leading||(previous=now);var remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0||remaining>wait?(timeout&&(clearTimeout(timeout),timeout=null),previous=now,result=func.apply(context,args),timeout||(context=args=null)):timeout||!1===options.trailing||(timeout=setTimeout(later,remaining)),result}};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_=__webpack_require__("./lib/index.js");function _getPodOwner(){return(_getPodOwner=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(pod,store){var response,containerTurtle,podOwner,guess;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_context.prev=0,store.any(pod,null,_.ns.ldp("Container"),pod)){_context.next=7;break}return _context.next=4,store.fetcher.webOperation("GET",pod.uri,store.fetcher.initFetchOptions(pod.uri,{headers:{accept:"text/turtle"}}));case 4:response=_context.sent,containerTurtle=response.responseText,(0,_rdflib.parse)(containerTurtle,store,pod.uri,"text/turtle");case 7:_context.next=13;break;case 9:return _context.prev=9,_context.t0=_context.catch(0),console.error("Error loading pod "+pod+": "+_context.t0),_context.abrupt("return",null);case 13:if(store.holds(pod,_.ns.rdf("type"),_.ns.space("Storage"),pod)){_context.next=16;break}return console.warn("Pod "+pod+" does not declare itself as a space:Storage"),_context.abrupt("return",null);case 16:if(!(podOwner=store.any(pod,_.ns.solid("owner"),null,pod)||store.any(null,_.ns.space("storage"),pod,pod))){_context.next=31;break}return _context.prev=18,_context.next=21,store.fetcher.load(podOwner.doc());case 21:_context.next=27;break;case 23:return _context.prev=23,_context.t1=_context.catch(18),console.warn("Unable to load profile of pod owner "+podOwner),_context.abrupt("return",null);case 27:return store.holds(podOwner,_.ns.space("storage"),pod,podOwner.doc())||console.warn("Pod owner ".concat(podOwner," does NOT list pod ").concat(pod," as their storage")),_context.abrupt("return",podOwner);case 31:return guess=(0,_rdflib.sym)("".concat(pod.uri,"profile/card#me")),_context.prev=32,_context.next=35,store.fetcher.load(guess);case 35:_context.next=41;break;case 37:return _context.prev=37,_context.t2=_context.catch(32),console.error("Ooops. Guessed wrong pod owner webid {$guess} : can't load it."),_context.abrupt("return",null);case 41:if(!store.holds(guess,_.ns.space("storage"),pod,guess.doc())){_context.next=44;break}return console.warn("Using guessed pod owner webid but it links back."),_context.abrupt("return",guess);case 44:return _context.abrupt("return",null);case 45:case"end":return _context.stop()}}),_callee,null,[[0,9],[18,23],[32,37]])})))).apply(this,arguments)}},"./lib/utils/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AJARImage=function AJARImage(src,alt,tt,doc){doc||(doc=document);var image=doc.createElement("img");image.setAttribute("src",src),image.addEventListener("copy",(function(e){e.clipboardData.setData("text/plain",""),e.clipboardData.setData("text/html",""),e.preventDefault()})),void 0!==tt&&image.setAttribute("title",tt);return image},exports.RDFComparePredicateObject=function RDFComparePredicateObject(self,other){var x=self.predicate.compareTerm(other.predicate);return 0!==x?x:self.object.compareTerm(other.object)},exports.RDFComparePredicateSubject=function RDFComparePredicateSubject(self,other){var x=self.predicate.compareTerm(other.predicate);return 0!==x?x:self.subject.compareTerm(other.subject)},exports.addLoadEvent=function addLoadEvent(func){var oldonload=window.onload;"function"!=typeof window.onload?window.onload=func:window.onload=function(){oldonload(),func()}},exports.ancestor=function ancestor(target,tagName){var level;for(level=target;level;level=level.parentNode)try{if(level.tagName===tagName)return level}catch(e){return}return},exports.beep=function beep(){if(!audioContext)return;var ctx=new audioContext;return function(duration,frequency,type,finishedCallback){duration=+(duration||.3),type=type||"sine","function"!=typeof finishedCallback&&(finishedCallback=function finishedCallback(){});var osc=ctx.createOscillator();osc.type=type,osc.frequency.value=frequency||256,osc.connect(ctx.destination),osc.start(0),osc.stop(duration)}},exports.clearVariableNames=function clearVariableNames(){nextVariable=0},exports.emptyNode=function emptyNode(node){for(var nodes=node.childNodes,i=nodes.length-1;i>=0;i--)node.removeChild(nodes[i]);return node},exports.escapeForXML=escapeForXML,exports.findPos=findPos,exports.genUuid=function genUuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=16*Math.random()|0;return("x"===c?r:3&r|8).toString(16)}))},exports.getAbout=getAbout,exports.getEyeFocus=function getEyeFocus(element,instantly,isBottom,myWindow){myWindow||(myWindow=window);var elementPosY=findPos(element)[1],appContext=window.SolidAppContext||{},scrollDiff=appContext&&appContext.scroll||52,totalScroll=elementPosY-scrollDiff-myWindow.scrollY;if(instantly)return isBottom?void myWindow.scrollBy(0,elementPosY+element.clientHeight-(myWindow.scrollY+myWindow.innerHeight)):void myWindow.scrollBy(0,totalScroll);var id=myWindow.setInterval((function scrollAmount(){myWindow.scrollBy(0,totalScroll/10),10===++times&&myWindow.clearInterval(id)}),50),times=0},exports.getTarget=function getTarget(e){var target;(e=e||window.event).target?target=e.target:e.srcElement&&(target=e.srcElement);3===target.nodeType&&(target=target.parentNode);return target},exports.getTerm=function getTerm(target){var statementTr=target.parentNode,st=statementTr?statementTr.AJAR_statement:void 0;switch(st?target.className:""){case"pred":case"pred selected":return st.predicate;case"obj":case"obj selected":return statementTr.AJAR_inverse?st.subject:st.object;case"":case"selected":return getAbout(_solidLogic.store,target);case"undetermined selected":return target.nextSibling?st.predicate:statementTr.AJAR_inverse?st.subject:st.object}},exports.hashColor=function hashColor(who){return"#"+(16777215&function hash(x){return x.split("").reduce((function(a,b){return(a=(a<<5)-a+b.charCodeAt(0))&a}),0)}(who=who.uri||who)|12632256).toString(16)},exports.include=function include(document,linkstr){var lnk=document.createElement("script");return lnk.setAttribute("type","text/javascript"),lnk.setAttribute("src",linkstr),lnk},Object.defineProperty(exports,"label",{enumerable:!0,get:function get(){return _label.label}}),exports.labelForXML=function labelForXML(x){return escapeForXML((0,_label.label)(x))},exports.labelWithOntology=function labelWithOntology(x,initialCap){var t=_solidLogic.store.findTypeURIs(x);if(t[UI.ns.rdf("Predicate").uri]||t[UI.ns.rdfs("Class").uri])return(0,_label.label)(x,initialCap)+" ("+ontologyLabel(x)+")";return(0,_label.label)(x,initialCap)},exports.newVariableName=function newVariableName(){return"v"+nextVariable++},exports.ontologyLabel=ontologyLabel,exports.predParentOf=function predParentOf(node){var n=node;for(;;){if(n.getAttribute("predTR"))return n;if(!n.previousSibling||"TR"!==n.previousSibling.nodeName)return UI.log.error("Could not find predParent"),node;n=n.previousSibling}},exports.predicateLabel=predicateLabel,exports.predicateLabelForXML=function predicateLabelForXML(p,inverse){return escapeForXML(predicateLabel(p,inverse))},exports.shortName=function shortName(uri){var p=uri;"#/".indexOf(p[p.length-1])>=0&&(p=p.slice(0,-1));var pok,namespaces=[];for(var _ns in this.prefixes)namespaces[this.prefixes[_ns]]=_ns;var i,canUse=function canUse(pp){return"ns"!==pp&&(pok=pp,!0)},hash=p.lastIndexOf("#");hash>=0&&(p=p.slice(hash-1));for(;;){var slash=p.lastIndexOf("/");for(slash>=0&&(p=p.slice(slash+1)),i=0;i-1)break;"("===line.charAt(0)&&(line="function"+line);var chunks=line.split("@");toPrint.push(chunks)}for(i=0;i=table.children.length)table.appendChild(newRow);else{var ele=table.children[g];table.insertBefore(newRow,ele)}newRow.subject=thing}}for(i=0;i=table.children.length){var newRow=createNewRow(thing);newRow.subject=thing,table.appendChild(newRow)}else{var _row=table.children[g];if(_row.subject.sameTerm(thing));else{var existingRow=elementMap[thing.toNT()];if(existingRow)table.removeChild(existingRow),table.insertBefore(existingRow,_row);else{var _newRow=createNewRow(thing);_row.before(_newRow),_newRow.subject=thing}}}}for(;table.children.length>things.length;)table.removeChild(table.children[table.children.length-1])};var log=_interopRequireWildcard(__webpack_require__("./lib/log.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_label=__webpack_require__("./lib/utils/label.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var audioContext,UI={log,ns,rdf},nextVariable=0;function getAbout(kb,target){var level,aa;for(level=target;level&&1===level.nodeType;level=level.parentNode)if(aa=level.getAttribute("about"))return kb.fromNT(aa);UI.log.debug("getAbout: No about found")}function findPos(obj){var DocBox=obj.ownerDocument.documentElement.getBoundingClientRect(),box=obj.getBoundingClientRect();return[box.left-DocBox.left,box.top-DocBox.top]}function ontologyLabel(term){if(void 0===term.uri)return"??";var part,s=term.uri,namespaces=[],i=s.lastIndexOf("#");if(i>=0)s=s.slice(0,i+1);else{if(!((i=s.lastIndexOf("/"))>=0))return term.uri+"?!";s=s.slice(0,i+1)}for(var _ns2 in UI.ns)namespaces[UI.ns[_ns2]]=_ns2;try{return namespaces[s]}catch(e){}for(s=s.slice(0,-1);s;){if(!((i=s.lastIndexOf("/"))>=0))return term.uri+"!?";if(part=s.slice(i+1),s=s.slice(0,i),"ns"!==part&&"0123456789".indexOf(part[0])<0)return part}}function escapeForXML(str){return str.replace(/&/g,"&").replace(/{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getExistingPrivateKey=function getExistingPrivateKey(_x5,_x6){return _getExistingPrivateKey.apply(this,arguments)},exports.getExistingPublicKey=function getExistingPublicKey(_x2,_x3){return _getExistingPublicKey.apply(this,arguments)},exports.getKeyIfExists=getKeyIfExists,exports.pubKeyUrl=exports.privKeyUrl=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}exports.pubKeyUrl=function(){var _ref=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(webId){var _store$any,_parentSettings,parentSettings;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(parentSettings=null===(_store$any=_solidLogic.store.any(webId,ns.space("preferencesFile"),null,webId.doc()))||void 0===_store$any?void 0:_store$any.value,parentSettings=null===(_parentSettings=parentSettings)||void 0===_parentSettings?void 0:_parentSettings.split("/").slice(0,-2).join("/")){_context.next=4;break}throw new Error("prefererencesFile is expected to exist in ".concat(webId.doc));case 4:return _context.abrupt("return","".concat(parentSettings,"/profile/keys/publicKey.ttl"));case 5:case"end":return _context.stop()}}),_callee)})));return function pubKeyUrl(_x){return _ref.apply(this,arguments)}}();function _getExistingPublicKey(){return(_getExistingPublicKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(webId,publicKeyUrl){return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return _context3.next=2,getKeyIfExists(webId,publicKeyUrl,"publicKey");case 2:return _context3.abrupt("return",_context3.sent);case 3:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}exports.privKeyUrl=function(){var _ref2=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(webId){var _store$any2,_settings,settings;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(settings=null===(_store$any2=_solidLogic.store.any(webId,ns.space("preferencesFile"),null,webId.doc()))||void 0===_store$any2?void 0:_store$any2.value,settings=null===(_settings=settings)||void 0===_settings?void 0:_settings.split("/").slice(0,-1).join("/")){_context2.next=4;break}throw new Error("prefererencesFile is expected to exist in ".concat(webId.doc));case 4:return _context2.abrupt("return","".concat(settings,"/keys/privateKey.ttl"));case 5:case"end":return _context2.stop()}}),_callee2)})));return function privKeyUrl(_x4){return _ref2.apply(this,arguments)}}();function _getExistingPrivateKey(){return(_getExistingPrivateKey=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(webId,privateKeyUrl){return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return _context4.next=2,getKeyIfExists(webId,privateKeyUrl,"privateKey");case 2:return _context4.abrupt("return",_context4.sent);case 3:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}function getKeyIfExists(_x7,_x8,_x9){return _getKeyIfExists.apply(this,arguments)}function _getKeyIfExists(){return(_getKeyIfExists=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(webId,keyUrl,keyType){var key;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:return _context5.prev=0,_context5.next=3,_solidLogic.store.fetcher.load(keyUrl);case 3:return key=_solidLogic.store.any(webId,ns.solid(keyType)),_context5.abrupt("return",null==key?void 0:key.value);case 7:if(_context5.prev=7,_context5.t0=_context5.catch(0),404!==_context5.t0.response.status){_context5.next=24;break}return debug.log("createIfNotExists: doc does NOT exist, will create... "+keyUrl),_context5.prev=11,_context5.next=14,_solidLogic.store.fetcher.webOperation("PUT",keyUrl,{data:"",contentType:"text/turtle"});case 14:_context5.next=20;break;case 16:throw _context5.prev=16,_context5.t1=_context5.catch(11),debug.log("createIfNotExists doc FAILED: "+keyUrl+": "+_context5.t1),_context5.t1;case 20:return delete _solidLogic.store.fetcher.requested[keyUrl],_context5.abrupt("return",void 0);case 24:throw debug.log("createIfNotExists doc FAILED: "+keyUrl+": "+_context5.t0),_context5.t0;case 26:case"end":return _context5.stop()}}),_callee5,null,[[0,7],[11,16]])})))).apply(this,arguments)}},"./lib/utils/keyHelpers/acl.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.keyContainerAclBody=exports.keyAclBody=void 0,exports.setAcl=function setAcl(_x,_x2){return _setAcl.apply(this,arguments)};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=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&&Object.prototype.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}(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _setAcl(){return(_setAcl=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(keyDoc,aclBody){var keyAclDoc,_err$response;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,_solidLogic.store.fetcher.load(keyDoc);case 2:if(debug.log(_solidLogic.store.statementsMatching(_solidLogic.store.sym(keyDoc),_solidLogic.store.sym("http://www.iana.org/assignments/link-relations/acl"))),keyAclDoc=_solidLogic.store.any(_solidLogic.store.sym(keyDoc),_solidLogic.store.sym("http://www.iana.org/assignments/link-relations/acl"))){_context.next=6;break}throw new Error("Key ACL doc not found!");case 6:return _context.prev=6,_context.next=9,_solidLogic.store.fetcher.webOperation("PUT",keyAclDoc.value,{data:aclBody,contentType:"text/turtle"});case 9:_context.next=16;break;case 11:if(_context.prev=11,_context.t0=_context.catch(6),404===(null===_context.t0||void 0===_context.t0||null===(_err$response=_context.t0.response)||void 0===_err$response?void 0:_err$response.status)){_context.next=15;break}throw new Error(_context.t0);case 15:debug.log("delete "+keyAclDoc.value+" "+_context.t0.response.status);case 16:case"end":return _context.stop()}}),_callee,null,[[6,11]])})))).apply(this,arguments)}exports.keyContainerAclBody=function keyContainerAclBody(me){return"\n@prefix : <#>.\n@prefix acl: .\n@prefix foaf: .\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <".concat(me,">;\n acl:mode acl:Read, acl:Write.\n")},exports.keyAclBody=function keyAclBody(keyDoc,me){var keyAgent="acl:agentClass foaf:Agent";return null!=me&&me.length&&(keyAgent="acl:agent <".concat(me,">")),"\n@prefix foaf: .\n@prefix acl: .\n<#Read>\n a acl:Authorization;\n ".concat(keyAgent,";\n acl:accessTo <").concat(keyDoc.split("/").pop(),">;\n acl:mode acl:Read.\n")}},"./lib/utils/label.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.string.link.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.label=function label(thing){var initialCap=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function doCap(label){return initialCap?label.slice(0,1).toUpperCase()+label.slice(1):label}function cleanUp(label){var result="";"/"===label.slice(-1)&&(label=label.slice(0,-1));for(var i=0;i0;i--)for(var hex="0123456789abcefABCDEF";"%"===s[i]&&hex.indexOf(s[i+1])>=0&&hex.indexOf(s[i+2])>=0;)s=s.slice(0,i)+String.fromCharCode(parseInt(s.slice(i+1,i+3),16))+s.slice(i+3)}s=slice(s,"/profile/card#me"),s=slice(s,"#this");var hash=(s=slice(s,"#me")).indexOf("#");if(hash>=0)return cleanUp(s.slice(hash+1));var slash=s.lastIndexOf("/",s.length-2);return slash>=0&&slash{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.versionInfo=void 0;exports.versionInfo={buildTime:"2023-11-30T16:45:27Z",commit:"28954ea400b5ebbd9627fdf986cadccae104a51f",npmInfo:{"solid-ui":"2.4.30",npm:"8.19.4",node:"16.20.2",v8:"9.4.146.26-node.26",uv:"1.43.0",zlib:"1.2.11",brotli:"1.0.9",ares:"1.19.1",modules:"93",nghttp2:"1.47.0",napi:"8",llhttp:"6.0.11",openssl:"1.1.1v+quic",cldr:"41.0",icu:"71.1",tz:"2022f",unicode:"14.0",ngtcp2:"0.8.1",nghttp3:"0.7.0"}}},"./lib/widgets/buttons.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.string.search.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.string.link.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.addStyleSheet=function addStyleSheet(dom,href){for(var links=dom.querySelectorAll("link"),i=0;i3&&void 0!==arguments[3]?arguments[3]:{},deleteAttachment=function deleteAttachment(target){if(!kb.updater)throw new Error("kb has no updater");kb.updater.update((0,_rdflib.st)(subject,predicate,target,doc),[],(function(uri,ok,errorBody,_xhr){ok?refresh():complain(void 0,"Error deleting one: "+errorBody)}))};function createNewRow(target){var theTarget=target,opt={noun};return modify&&(opt.deleteFunction=function(){deleteAttachment(theTarget)}),personTR(dom,predicate,target,opt)}var refresh=function refresh(){var things=kb.each(subject,predicate);things.sort(),utils.syncTableToArray(attachmentTable,things,createNewRow)};function droppedURIHandler(uris){var ins=[];if(uris.forEach((function(u){var target=(0,_rdflib.sym)(u);debug.log("Dropped on attachemnt "+u),ins.push((0,_rdflib.st)(subject,predicate,target,doc))})),!kb.updater)throw new Error("kb has no updater");kb.updater.update([],ins,(function(uri,ok,errorBody,_xhr){ok?refresh():complain(void 0,"Error adding one: "+errorBody)}))}function droppedFileHandler(files){var _options$uploadFolder,_options$uploadFolder2;(0,_dragAndDrop.uploadFiles)(kb.fetcher,files,null===(_options$uploadFolder=options.uploadFolder)||void 0===_options$uploadFolder?void 0:_options$uploadFolder.uri,null===(_options$uploadFolder2=options.uploadFolder)||void 0===_options$uploadFolder2?void 0:_options$uploadFolder2.uri,(function(theFile,destURI){var ins=[(0,_rdflib.st)(subject,predicate,kb.sym(destURI),doc)];if(!kb.updater)throw new Error("kb has no updater");kb.updater.update([],ins,(function(uri,ok,errorBody,_xhr){ok?refresh():complain(void 0,"Error adding link to uploaded file: "+errorBody)}))}))}var doc=options.doc||subject.doc();void 0===options.modify&&(options.modify=!0);var modify=options.modify,promptIcon=options.promptIcon||iconBase+"noun_748003.svg",predicate=options.predicate||ns.wf("attachment"),noun=options.noun||"attachment",kb=_solidLogic.store,attachmentOuter=div.appendChild(dom.createElement("table"));attachmentOuter.setAttribute("style","margin-top: 1em; margin-bottom: 1em;");var attachmentOne=attachmentOuter.appendChild(dom.createElement("tr")),attachmentLeft=attachmentOne.appendChild(dom.createElement("td")),attachmentRight=attachmentOne.appendChild(dom.createElement("td")),attachmentTable=attachmentRight.appendChild(dom.createElement("table"));if(attachmentTable.appendChild(dom.createElement("tr")),attachmentOuter.refresh=refresh,refresh(),modify){var paperclip=button(dom,promptIcon,"Drop attachments here");attachmentLeft.appendChild(paperclip);var fhandler=options.uploadFolder?droppedFileHandler:null;if((0,_dragAndDrop.makeDropTarget)(paperclip,droppedURIHandler,fhandler),(0,_dragAndDrop.makeDropTarget)(attachmentLeft,droppedURIHandler,fhandler),options.uploadFolder){var buttonDiv=fileUploadButtonDiv(dom,droppedFileHandler);attachmentLeft.appendChild(buttonDiv)}}return attachmentOuter},exports.button=button,exports.cancelButton=cancelButton,exports.clearElement=function clearElement(ele){for(;ele.firstChild;)ele.removeChild(ele.firstChild);return ele},exports.complain=complain,exports.continueButton=continueButton,exports.createLinkDiv=createLinkDiv,exports.createNameDiv=createNameDiv,exports.defaultAnnotationStore=function defaultAnnotationStore(subject){if(void 0===subject.uri)return;var s=subject.uri;if("http://"!==s.slice(0,7))return;var hash=(s=s.slice(7)).indexOf("#");if(hash>=0)s=s.slice(0,hash);else{var slash=s.lastIndexOf("/");if(slash<0)return;s=s.slice(0,slash)}return _solidLogic.store.sym("http://tabulator.org/wiki/annnotation/"+s)},exports.deleteButtonWithCheck=deleteButtonWithCheck,exports.extractLogURI=function extractLogURI(fullURI){var logPos=fullURI.search(/logFile=/),rulPos=fullURI.search(/&rulesFile=/);return fullURI.substring(logPos+8,rulPos)},exports.faviconOrDefault=faviconOrDefault,exports.fileUploadButtonDiv=fileUploadButtonDiv,exports.findImage=findImage,exports.findImageFromURI=findImageFromURI,exports.formatDateTime=formatDateTime,exports.iconForClass=void 0,exports.imagesOf=function imagesOf(x,kb){return kb.each(x,ns.sioc("avatar")).concat(kb.each(x,ns.foaf("img"))).concat(kb.each(x,ns.vcard("logo"))).concat(kb.each(x,ns.vcard("hasPhoto"))).concat(kb.each(x,ns.vcard("photo"))).concat(kb.each(x,ns.foaf("depiction")))},exports.index=void 0,exports.isAudio=function isAudio(file){return isImage(file,"audio")},exports.isImage=isImage,exports.isVideo=function isVideo(file){return isImage(file,"video")},exports.linkButton=function linkButton(dom,object){var b=dom.createElement("button");return b.setAttribute("type","button"),b.textContent="Goto "+utils.label(object),b.addEventListener("click",(function(_event){dom.outlineManager.GotoSubject(object,!0,void 0,!0,void 0)}),!0),b},exports.openHrefInOutlineMode=function openHrefInOutlineMode(e){e.preventDefault(),e.stopPropagation();var uri=utils.getTarget(e).getAttribute("href");if(!uri)return debug.log("openHrefInOutlineMode: No href found!\n");var dom=window.document;dom.outlineManager?dom.outlineManager.GotoSubject(_solidLogic.store.sym(uri),!0,void 0,!0,void 0):window&&window.panes&&window.panes.getOutliner?window.panes.getOutliner().GotoSubject(_solidLogic.store.sym(uri),!0,void 0,!0,void 0):debug.log("ERROR: Can't access outline manager in this config")},exports.personTR=void 0,exports.propertyTriage=function propertyTriage(kb){var possibleProperties={},dp={},op={},no=0,nd=0,nu=0,pi=kb.predicateIndex;for(var p in pi){"Literal"===pi[p][0].object.termType?(dp[p]=!0,nd++):(op[p]=!0,no++)}for(var ps=kb.each(void 0,ns.rdf("type"),ns.rdf("Property")),i=0;i4&&void 0!==arguments[4]?arguments[4]:{buttonColor:"Primary",needsBorder:!1},button=dom.createElement("button");if(button.setAttribute("type","button"),iconURI){var img=button.appendChild(dom.createElement("img"));img.setAttribute("src",iconURI),img.setAttribute("style","width: 2em; height: 2em;"),img.title=text,button.setAttribute("style",style.buttonStyle)}else button.textContent=text.toLocaleUpperCase(),button.onmouseover=function(){"Secondary"===options.buttonColor?options.needsBorder?button.setAttribute("style",style.secondaryButtonNoBorderHover):button.setAttribute("style",style.secondaryButtonHover):options.needsBorder?button.setAttribute("style",style.primaryButtonNoBorderHover):button.setAttribute("style",style.primaryButtonHover)},button.onmouseout=function(){"Secondary"===options.buttonColor?options.needsBorder?button.setAttribute("style",style.secondaryButtonNoBorder):button.setAttribute("style",style.secondaryButton):options.needsBorder?button.setAttribute("style",style.primaryButtonNoBorder):button.setAttribute("style",style.primaryButton)},"Secondary"===options.buttonColor?options.needsBorder?button.setAttribute("style",style.secondaryButtonNoBorder):button.setAttribute("style",style.secondaryButton):options.needsBorder?button.setAttribute("style",style.primaryButtonNoBorder):button.setAttribute("style",style.primaryButton);return handler&&button.addEventListener("click",handler,!1),button}function cancelButton(dom,handler){var b=button(dom,cancelIconURI,"Cancel",handler);return b.firstChild&&(b.firstChild.style.opacity="0.3"),b}function continueButton(dom,handler){return button(dom,checkIconURI,"Continue",handler)}var personTR=exports.personTR=renderAsRow;function renderAsRow(dom,pred,obj,options){var tr=dom.createElement("tr");options=options||{};var td1=tr.appendChild(dom.createElement("td")),td2=tr.appendChild(dom.createElement("td")),td3=tr.appendChild(dom.createElement("td")),image=options.image||faviconOrDefault(dom,obj);if(td1.setAttribute("style","vertical-align: middle; width:2.5em; padding:0.5em; height: 2.5em;"),td2.setAttribute("style","vertical-align: middle; text-align:left;"),td3.setAttribute("style","vertical-align: middle; width:2em; padding:0.5em; height: 4em;"),td1.appendChild(image),options.title?td2.textContent=options.title:setName(td2,obj),options.deleteFunction&&deleteButtonWithCheck(dom,td3,options.noun||"one",options.deleteFunction),obj.uri){if(!1!==options.link)td3.appendChild((0,_iconLinks.linkIcon)(dom,obj)).classList.add("HoverControlHide"),td3.appendChild(dom.createElement("br"));!1!==options.draggable&&(image.setAttribute("draggable","false"),(0,_dragAndDrop.makeDraggable)(tr,obj))}return tr.subject=obj,tr}function createNameDiv(dom,div,title,obj){var nameDiv=div.appendChild(dom.createElement("div"));title?nameDiv.textContent=title:setName(nameDiv,obj)}function createLinkDiv(dom,div,obj,options){var linkDiv=div.appendChild(dom.createElement("div"));linkDiv.setAttribute("style",style.linkDivStyle),options.deleteFunction&&deleteButtonWithCheck(dom,linkDiv,options.noun||"one",options.deleteFunction),obj.uri&&(!1!==options.link&&(0,_iconLinks.createLinkForURI)(dom,linkDiv,obj),(0,_dragAndDrop.makeDraggable)(div,obj))}function selectorPanelRefresh(list,dom,kb,type,predicate,inverse,possible,options,callbackFunction,linkCallback){var style0="border: 0.1em solid #ddd; border-bottom: none; width: 95%; height: 2em; padding: 0.5em;",selected=null;list.innerHTML="";for(var refreshItem=function refreshItem(box,x){var item,image,setStyle=function setStyle(){var already=inverse?kb.each(void 0,predicate,x):kb.each(x,predicate);iconDiv.setAttribute("class",0===already.length?"hideTillHover":""),image.setAttribute("src",options.connectIcon||iconBase+"noun_25830.svg"),image.setAttribute("title",already.length?already.length:"attach")},f=index.twoLine.widgetForClass(type);(item=f(dom,x)).setAttribute("style",style0);var nav=dom.createElement("div");nav.setAttribute("class","hideTillHover"),nav.setAttribute("style","float:right; width:10%");var a=dom.createElement("a");a.setAttribute("href",x.uri),a.setAttribute("style","float:right"),nav.appendChild(a).textContent=">",box.appendChild(nav);var iconDiv=dom.createElement("div");return iconDiv.setAttribute("style",(inverse?"float:left;":"float:right;")+" width:30px;"),image=dom.createElement("img"),setStyle(),iconDiv.appendChild(image),box.appendChild(iconDiv),item.addEventListener("click",(function(event){selected===item?(item.setAttribute("style",style0),selected=null):(selected&&selected.setAttribute("style",style0),item.setAttribute("style",style0+"background-color: #ccc; color:black;"),selected=item),callbackFunction(x,event,selected===item),setStyle()}),!1),image.addEventListener("click",(function(event){linkCallback(x,event,inverse,setStyle)}),!1),box.appendChild(item),box},i=0;i\n < /tr>\n < tr >\n ").concat(enc("date").slice(0,10),'\n ').concat(enc("amount"),"\n "),failed&&(box.innerHTML='\n \n ').concat(utils.escapeForXML(failed),"\n ")),box},"http://www.w3.org/ns/pim/trip#Trip":function twoLineTrip(dom,x){var enc=function enc(p){var y=_solidLogic.store.any(x,p);return y?utils.escapeForXML(y.value):"?"},box=dom.createElement("table");return box.innerHTML='\n \n '.concat(enc(ns.dc("title")),'\n \n \n ').concat(enc(ns.cal("dtstart")),"\n ").concat(enc(ns.cal("dtend")),"\n "),box},widgetForClass:function twoLineWidgetForClass(c){var widget=index.twoLine[c.uri],kb=_solidLogic.store;if(widget)return widget;var sup=kb.findSuperClassesNT(c);for(var cl in sup)if(widget=index.twoLine[kb.fromNT(cl).uri])return widget;return index.twoLine[""]}}}},"./lib/widgets/buttons/iconLinks.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.createLinkForURI=void 0,exports.linkIcon=linkIcon;var _iconBase=__webpack_require__("./lib/iconBase.js");function linkIcon(dom,subject,iconURI){var anchor=dom.createElement("a");anchor.setAttribute("href",subject.uri),subject.uri.startsWith("http")&&anchor.setAttribute("target","_blank");var img=anchor.appendChild(dom.createElement("img"));return img.setAttribute("src",iconURI||_iconBase.originalIconBase+"go-to-this.png"),img.setAttribute("style","margin: 0.3em;"),anchor}exports.createLinkForURI=function createLinkForURI(dom,linkDiv,obj){var iconLink=linkIcon(dom,obj);linkDiv.appendChild(iconLink).classList.add("HoverControlHide"),linkDiv.appendChild(dom.createElement("br"))}},"./lib/widgets/dragAndDrop.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.string.ends-with.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.makeDraggable=function makeDraggable(tr,obj){tr.setAttribute("draggable","true"),tr.addEventListener("dragstart",(function(e){tr.style.fontWeight="bold",e.dataTransfer.setData("text/uri-list",obj.uri),e.dataTransfer.setData("text/plain",obj.uri),e.dataTransfer.setData("text/html",tr.outerHTML),debug.log("Dragstart: "+tr+" -> "+obj+"de: "+e.dataTransfer.dropEffect)}),!1),tr.addEventListener("drag",(function(e){e.preventDefault(),e.stopPropagation()}),!1),tr.addEventListener("dragend",(function(e){tr.style.fontWeight="normal",debug.log("Dragend dropeffect: "+e.dataTransfer.dropEffect),debug.log("Dragend: "+tr+" -> "+obj)}),!1)},exports.makeDropTarget=function makeDropTarget(ele,droppedURIHandler,droppedFileHandler){var dragoverListener=function dragoverListener(e){e.preventDefault(),e.dataTransfer.dropEffect="copy"},dragenterListener=function dragenterListener(e){debug.log("dragenter event dropEffect: "+e.dataTransfer.dropEffect),this.style&&(this.savedStyle||(this.savedStyle={},this.savedStyle.border=this.style.border,this.savedStyle.backgroundColor=this.style.backgroundColor,this.savedStyle.borderRadius=this.style.borderRadius),this.style.backgroundColor="#ccc",this.style.border="0.25em dashed black",this.style.borderRadius="0.3em"),e.dataTransfer.dropEffect="link",debug.log("dragenter event dropEffect 2: "+e.dataTransfer.dropEffect)},dragleaveListener=function dragleaveListener(e){debug.log("dragleave event dropEffect: "+e.dataTransfer.dropEffect),this.savedStyle?(this.style.border=this.savedStyle.border,this.style.backgroundColor=this.savedStyle.backgroundColor,this.style.borderRadius=this.savedStyle.borderRadius):(this.style.backgroundColor="white",this.style.border="0em solid black")},dropListener=function dropListener(e){e.preventDefault&&e.preventDefault(),debug.log("Drop event. dropEffect: "+e.dataTransfer.dropEffect),debug.log("Drop event. types: "+(e.dataTransfer.types?e.dataTransfer.types.join(", "):"NOPE"));var text,uris=null;if(e.dataTransfer.types){for(var t=0;t{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.errorMessageBlock=function errorMessageBlock(dom,err,backgroundColor,err2){var div=dom.createElement("div"),errorObject=err2||err instanceof Error?err:null;errorObject?(console.error("errorMessageBlock: ".concat(errorObject," at: ").concat(errorObject.stack||"??"),errorObject),div.textContent=errorObject.message):div.textContent=err;return div.appendChild((0,_widgets.cancelButton)(dom,(function(){div.parentNode&&div.parentNode.removeChild(div)}))).style="width: 2em; height: 2em; align: right;",div.setAttribute("style","margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: "+(backgroundColor||"#fee")+"; color:black;"),div};var _widgets=__webpack_require__("./lib/widgets/index.js")},"./lib/widgets/forms.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.number.constructor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.appendForm=appendForm,Object.defineProperty(exports,"basicField",{enumerable:!0,get:function get(){return _basic.basicField}}),exports.buildCheckboxForm=buildCheckboxForm,exports.editFormButton=function editFormButton(dom,container,form,dataDoc,callbackFunction){var b=dom.createElement("button");return b.setAttribute("type","button"),b.innerHTML="Edit "+utils.label(ns.ui("Form")),b.addEventListener("click",(function(_e){appendForm(dom,container,{},form,ns.ui("FormForm"),dataDoc,callbackFunction).setAttribute("style",ns.ui("FormForm").sameTerm(form)?"background-color: #fee;":"background-color: #ffffe7;"),b.parentNode.removeChild(b)}),!0),b},Object.defineProperty(exports,"field",{enumerable:!0,get:function get(){return _fieldFunction.field}}),Object.defineProperty(exports,"fieldFunction",{enumerable:!0,get:function get(){return _fieldFunction.fieldFunction}}),Object.defineProperty(exports,"fieldLabel",{enumerable:!0,get:function get(){return _basic.fieldLabel}}),Object.defineProperty(exports,"fieldParams",{enumerable:!0,get:function get(){return _fieldParams.fieldParams}}),Object.defineProperty(exports,"fieldStore",{enumerable:!0,get:function get(){return _basic.fieldStore}}),exports.findClosest=findClosest,exports.formsFor=function formsFor(subject){var kb=_solidLogic.store;log.debug("formsFor: subject="+subject);var t1,t=kb.findTypeURIs(subject);for(t1 in t)log.debug(" type: "+t1);var bottom=kb.bottomTypeURIs(t),candidates=[];for(var b in bottom)log.debug("candidatesFor: trying bottom type ="+b),candidates=(candidates=candidates.concat(findClosest(kb,b,ns.ui("creationForm")))).concat(findClosest(kb,b,ns.ui("annotationForm")));return candidates},exports.makeDescription=makeDescription,exports.makeSelectForCategory=makeSelectForCategory,exports.makeSelectForChoice=makeSelectForChoice,exports.makeSelectForClassifierOptions=makeSelectForClassifierOptions,exports.makeSelectForNestedCategory=makeSelectForNestedCategory,exports.makeSelectForOptions=function makeSelectForOptions(dom,kb,subject,predicate,possible,options,dataDoc,callbackFunction){log.debug("Select list length now "+possible.length);for(var actual,n=0,uris={},editable=kb.updater.editable(dataDoc.uri),i=0;i60&&(members=members.slice(0,60));for(var used={},i=0;i<(members.length>60?60:members.length);i++)kb.statementsMatching(members[i],void 0,void 0).forEach((function(st){used[st.predicate.uri]=!0}));explicit.forEach((function(p){used[p.uri]=!0}));var result=[];for(var uri in used)result.push(kb.sym(uri));return result},Object.defineProperty(exports,"renderNameValuePair",{enumerable:!0,get:function get(){return _basic.renderNameValuePair}}),exports.sortByLabel=sortByLabel,exports.sortBySequence=sortBySequence;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),buttons=_interopRequireWildcard(__webpack_require__("./lib/widgets/buttons.js")),_fieldParams=__webpack_require__("./lib/widgets/forms/fieldParams.js"),_fieldFunction=__webpack_require__("./lib/widgets/forms/fieldFunction.js"),_formStyle=__webpack_require__("./lib/widgets/forms/formStyle.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_error=__webpack_require__("./lib/widgets/error.js"),_basic=__webpack_require__("./lib/widgets/forms/basic.js"),_autocompleteField=__webpack_require__("./lib/widgets/forms/autocomplete/autocompleteField.js"),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),log=_interopRequireWildcard(__webpack_require__("./lib/log.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),$rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_multiSelect=__webpack_require__("./lib/widgets/multiSelect.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i0;){var c=agenda.shift(),lists=kb.each(c,prop);if(log.debug("Lists for "+c+", "+prop+": "+lists.length),0!==lists.length)return lists;for(var supers=kb.each(c,ns.rdfs("subClassOf")),i=0;i";var formFunction=(0,_fieldFunction.fieldFunction)(dom,form),object=newThing(dataDoc),gotButton=!1;function linkDone(uri,ok,body){return callbackFunction(ok,body)}log.info("paneUtils Object is "+object);var f=formFunction(dom,box,{},object,form,dataDoc,(function itemDone(ok,body){if(!ok)return callbackFunction(ok,body);var insertMe=[];subject&&!kb.holds(subject,predicate,object,dataDoc)&&insertMe.push($rdf.st(subject,predicate,object,dataDoc)),subject&&!kb.holds(object,ns.rdf("type"),theClass,dataDoc)&&insertMe.push($rdf.st(object,ns.rdf("type"),theClass,dataDoc)),insertMe.length?kb.updater.update([],insertMe,linkDone):callbackFunction(!0,body),gotButton||(gotButton=box.appendChild(buttons.linkButton(dom,object)))}));return buttons.removeButton(dom,f).setAttribute("style","float: right;"),box.AJAR_subject=object,box}function makeDescription(dom,kb,subject,predicate,dataDoc,callbackFunction){var submit,group=dom.createElement("div"),desc=kb.anyJS(subject,predicate,null,dataDoc)||"",field=dom.createElement("textarea");function saveChange(_e){submit.disabled=!0,submit.setAttribute("style","visibility: hidden; float: right;"),field.disabled=!0,field.style.color=style.textInputColorPending;var ds=kb.statementsMatching(subject,predicate,null,dataDoc),is=$rdf.st(subject,predicate,field.value,dataDoc);kb.updater.update(ds,is,(function(uri,ok,body){ok?(field.style.color=style.textInputColor,field.disabled=!1):group.appendChild((0,_error.errorMessageBlock)(dom,"Error (while saving change to "+dataDoc.uri+"): "+body)),callbackFunction&&callbackFunction(ok,body)}))}return group.appendChild(field),field.rows=desc?desc.split("\n").length+2:2,field.cols=80,field.setAttribute("style",style.multilineTextInputStyle),null!==desc?field.value=desc:field.select(),group.refresh=function(){var v=kb.any(subject,predicate,null,dataDoc);v&&v.value!==field.value&&(field.value=v.value)},kb.updater.editable(dataDoc.uri)?((submit=widgets.continueButton(dom,saveChange)).disabled=!0,submit.style.visibility="hidden",submit.style.float="right",group.appendChild(submit),field.addEventListener("keyup",(function(_e){field.style.color="green",submit&&(submit.disabled=!1,submit.style.visibility="")}),!0),field.addEventListener("change",saveChange,!0)):(field.disabled=!0,field.style.backgroundColor=style.textInputBackgroundColorUneditable),group}function makeSelectForClassifierOptions(dom,kb,subject,predicate,possible,options,dataDoc,callbackFunction){log.debug("Select list length now "+possible.length);for(var actual,n=0,uris={},editable=kb.updater.editable(dataDoc.uri),i=0;i3||weight<0)return box.appendChild((0,_error.errorMessageBlock)(dom,"Form Group weight ".concat(weight," should be 0-3")));box.setAttribute("style",style.formGroupStyle[weight]),box.style.display="flex",box.style.flexDirection="column",box.class="form-weight-"+weight;var subfields,parts=kb.any(form,ui("parts"),null,formDoc);if(parts?subfields=parts.elements:(parts=kb.each(form,ui("part"),null,formDoc),subfields=sortBySequence(parts)),!parts)return box.appendChild((0,_error.errorMessageBlock)(dom,"No parts to form! "));for(var i=0;i0)){_context8.next=12;break}j=0;case 3:if(!(j{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.renderAutocompleteControl=function renderAutocompleteControl(_x,_x2,_x3,_x4,_x5,_x6){return _renderAutocompleteControl.apply(this,arguments)};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_iconBase=__webpack_require__("./lib/iconBase.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),utils=_interopRequireWildcard(__webpack_require__("./lib/utils/index.js")),_autocompletePicker=__webpack_require__("./lib/widgets/forms/autocomplete/autocompletePicker.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.autocompleteField=function autocompleteField(dom,container,already,subject,form,doc,callbackFunction){var _kb$updater;function _addOneIdAndRefresh(){return(_addOneIdAndRefresh=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(result,name){var oldValue,oldName,deletables,insertables,_kb$updater2;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(name){_context.next=2;break}throw new Error("autocompleteField: No name set.");case 2:if(!(oldValue=kb.the(subject,property,null,doc))){_context.next=7;break}if(oldName=kb.any(oldValue,labelProperty,null,doc),!(oldValue.equals(result)&&oldName&&oldName.sameTerm(name))){_context.next=7;break}return _context.abrupt("return");case 7:return deletables=oldValue?kb.statementsMatching(subject,property,oldValue,doc).concat(kb.statementsMatching(oldValue,labelProperty,null,doc)):[],insertables=[(0,_rdflib.st)(subject,property,result,doc),(0,_rdflib.st)(result,labelProperty,name,doc)],_context.prev=9,_context.next=12,null===(_kb$updater2=kb.updater)||void 0===_kb$updater2?void 0:_kb$updater2.updateMany(deletables,insertables);case 12:_context.next=19;break;case 14:return _context.prev=14,_context.t0=_context.catch(9),callbackFunction(!1,_context.t0),box.appendChild(widgets.errorMessageBlock(dom,"Autocomplete form data update error:"+_context.t0,null,_context.t0)),_context.abrupt("return");case 19:callbackFunction(!0,"");case 20:case"end":return _context.stop()}}),_callee,null,[[9,14]])})))).apply(this,arguments)}function _deleteOne(){return(_deleteOne=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(_result,_name){var oldValue,deletables,insertables,_kb$updater3,e2;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(oldValue=kb.the(subject,property,null,doc)){_context2.next=5;break}return callbackFunction(!1,"NO data to elete"),box.appendChild(widgets.errorMessageBlock(dom,"Autocomplete delete: no old data!")),_context2.abrupt("return");case 5:return deletables=kb.statementsMatching(subject,property,oldValue,doc).concat(kb.statementsMatching(oldValue,labelProperty,null,doc)),insertables=[],_context2.prev=7,_context2.next=10,null===(_kb$updater3=kb.updater)||void 0===_kb$updater3?void 0:_kb$updater3.updateMany(deletables,insertables);case 10:_context2.next=18;break;case 12:return _context2.prev=12,_context2.t0=_context2.catch(7),e2=new Error("Autocomplete form data delete error:"+_context2.t0),callbackFunction(!1,_context2.t0),box.appendChild(widgets.errorMessageBlock(dom,e2,null,_context2.t0)),_context2.abrupt("return");case 18:callbackFunction(!0,"");case 19:case"end":return _context2.stop()}}),_callee2,null,[[7,12]])})))).apply(this,arguments)}if("NamedNode"!==subject.termType)throw new Error("Sorry this field only works on NamedNode subjects (for editable)");var kb=_solidLogic.store,formDoc=form.doc?form.doc():null,box=dom.createElement("div");container&&container.appendChild(box);var lhs=dom.createElement("div");lhs.setAttribute("class","formFieldName"),lhs.setAttribute("style",style.formFieldNameBoxStyle),box.appendChild(lhs);var rhs=dom.createElement("div");rhs.setAttribute("class","formFieldValue"),box.appendChild(rhs);var property=kb.any(form,ns.ui("property"));if(!property)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No property given for autocomplete field: "+form));var labelProperty=kb.any(form,ns.ui("labelProperty"))||ns.schema("name"),dataSource=kb.any(form,ns.ui("dataSource"));if(!dataSource)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No data source given for autocomplete field: "+form));var queryParams={label:kb.anyJS(dataSource,ns.schema("name"),null,dataSource.doc()),logo:kb.any(dataSource,ns.schema("logo"),null,dataSource.doc())},targetClass=kb.any(form,ns.ui("targetClass"),null,form.doc())||kb.any(dataSource,ns.ui("targetClass"),null,dataSource.doc());targetClass&&(queryParams.targetClass=targetClass);queryParams.objectURIBase=kb.any(dataSource,ns.ui("objectURIBase"),null,dataSource.doc())||void 0;var endpoint=kb.anyJS(dataSource,ns.ui("endpoint"),null,dataSource.doc());if(endpoint){if(queryParams.endpoint=endpoint,queryParams.searchByNameQuery=kb.anyJS(dataSource,ns.ui("searchByNameQuery"),null,dataSource.doc()),!queryParams.searchByNameQuery)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No searchByNameQuery given for endpoint data Source: "+form));queryParams.insitituteDetailsQuery=kb.anyJS(dataSource,ns.ui("insitituteDetailsQuery"),null,dataSource.doc())}else{var searchByNameURI=kb.anyJS(dataSource,ns.ui("searchByNameURI"));if(!searchByNameURI)return box.appendChild(widgets.errorMessageBlock(dom,"Error: No searchByNameURI OR sparql endpoint given for dataSource: "+dataSource));queryParams.searchByNameURI=searchByNameURI}var suppressEmptyUneditable=kb.anyJS(form,ns.ui("suppressEmptyUneditable"),null,formDoc),editable=null===(_kb$updater=kb.updater)||void 0===_kb$updater?void 0:_kb$updater.editable(doc.uri),autocompleteOptions={permanent:!0,targetClass:queryParams.targetClass,queryParams};autocompleteOptions.size=kb.anyJS(form,ns.ui("size"),null,formDoc)||void 0;var obj=kb.any(subject,property,void 0,doc);if(obj)autocompleteOptions.currentObject=obj,autocompleteOptions.currentName=kb.any(autocompleteOptions.currentObject,labelProperty,null,doc);else if(obj=kb.any(form,ns.ui("default")))autocompleteOptions.currentObject=obj,autocompleteOptions.currentName=kb.any(autocompleteOptions.currentObject,labelProperty,null,doc);else if(suppressEmptyUneditable&&!editable)return box.style.display="none",box;lhs.appendChild(widgets.fieldLabel(dom,property,form));var barOptions={editable,dbLookup:!0};return(0,_autocompleteBar.renderAutocompleteControl)(dom,subject,barOptions,autocompleteOptions,(function addOneIdAndRefresh(_x,_x2){return _addOneIdAndRefresh.apply(this,arguments)}),(function deleteOne(_x3,_x4){return _deleteOne.apply(this,arguments)})).then((function(control){rhs.appendChild(control)}),(function(err){rhs.appendChild(widgets.errorMessageBlock(dom,"Error rendering autocomplete ".concat(form,": ").concat(err),"#fee",err))})),box};var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),_autocompleteBar=__webpack_require__("./lib/widgets/forms/autocomplete/autocompleteBar.js"),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}},"./lib/widgets/forms/autocomplete/autocompletePicker.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.from.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.renderAutoComplete=function renderAutoComplete(_x,_x2,_x3,_x4){return _renderAutoComplete.apply(this,arguments)},exports.setVisible=setVisible;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),style=_interopRequireWildcard(__webpack_require__("./lib/style.js")),widgets=_interopRequireWildcard(__webpack_require__("./lib/widgets/index.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_publicData=__webpack_require__("./lib/widgets/forms/autocomplete/publicData.js"),_language=__webpack_require__("./lib/widgets/forms/autocomplete/language.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);iself.name.value?1:other.name.name1;)table.removeChild(table.lastChild)},nameMatch=function _nameMatch(filter,candidate){for(var parts=filter.split(" "),j=0;j{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reverse.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.addDefaults=addDefaults,exports.defaultPreferredLanguages=void 0,exports.filterByLanguage=function filterByLanguage(bindings,languagePrefs){var uris={};bindings.forEach((function(binding){var uri=binding.subject.value;uris[uri]=uris[uri]||[],uris[uri].push(binding)}));var languagePrefs2=languagePrefs||defaultPreferredLanguages;languagePrefs2.reverse();var slimmed=[];for(var u in uris){var sortMe=uris[u].map((function(binding){var lang=binding.name["xml:lang"];return[languagePrefs2.indexOf(lang),binding]}));sortMe.sort(),sortMe.reverse(),slimmed.push(sortMe[0][1])}return debug.log(" Filter by language: ".concat(bindings.length," -> ").concat(slimmed.length)),slimmed},exports.getPreferredLanguages=function getPreferredLanguages(){return _getPreferredLanguages.apply(this,arguments)},exports.getPreferredLanguagesFor=getPreferredLanguagesFor,exports.languageCodeURIBase=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var languageCodeURIBase=exports.languageCodeURIBase="https://www.w3.org/ns/iana/language-code/",defaultPreferredLanguages=exports.defaultPreferredLanguages=["en","fr","de","it","ar"];function addDefaults(array){return array||(array=[]),array.concat(defaultPreferredLanguages.filter((function(code){return!array.includes(code)})))}function getPreferredLanguagesFor(_x){return _getPreferredLanguagesFor.apply(this,arguments)}function _getPreferredLanguagesFor(){return(_getPreferredLanguagesFor=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(person){var _store$fetcher,doc,list,languageCodeArray;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return doc=person.doc(),_context.next=3,null===(_store$fetcher=_solidLogic.store.fetcher)||void 0===_store$fetcher?void 0:_store$fetcher.load(doc);case 3:if(list=_solidLogic.store.any(person,ns.schema("knowsLanguage"),null,doc)){_context.next=6;break}return _context.abrupt("return",defaultPreferredLanguages);case 6:if(languageCodeArray=[],list.elements.forEach((function(item){var lang=_solidLogic.store.any(item,ns.solid("publicId"),null,doc);if(lang)if(lang.value.startsWith(languageCodeURIBase)){var code=lang.value.slice(languageCodeURIBase.length);languageCodeArray.push(code)}else console.error("What should be a language code ".concat(lang.value," does not start with ").concat(languageCodeURIBase));else console.warn("getPreferredLanguages: No publiID of language.")})),!(languageCodeArray.length>0)){_context.next=11;break}return console.log(' User knows languages with codes: "'.concat(languageCodeArray.join(","),'"')),_context.abrupt("return",addDefaults(languageCodeArray));case 11:return _context.abrupt("return",null);case 12:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}function _getPreferredLanguages(){return(_getPreferredLanguages=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(){var me,solidLanguagePrefs;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,_solidLogic.authn.currentUser();case 2:if(!(me=_context2.sent)){_context2.next=9;break}return _context2.next=6,getPreferredLanguagesFor(me);case 6:if(!(solidLanguagePrefs=_context2.sent)){_context2.next=9;break}return _context2.abrupt("return",solidLanguagePrefs);case 9:if("undefined"==typeof navigator){_context2.next=14;break}if(!navigator.languages){_context2.next=12;break}return _context2.abrupt("return",addDefaults(navigator.languages.map((function(longForm){return longForm.split("-")[0]}))));case 12:if(!navigator.language){_context2.next=14;break}return _context2.abrupt("return",addDefaults([navigator.language.split("-")[0]]));case 14:return _context2.abrupt("return",defaultPreferredLanguages);case 15:case"end":return _context2.stop()}}),_callee2)})))).apply(this,arguments)}},"./lib/widgets/forms/autocomplete/publicData.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.set.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.array.last-index-of.js"),__webpack_require__("./node_modules/core-js/modules/web.url.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.AUTOCOMPLETE_LIMIT=void 0,exports.ESCOResultToBindings=ESCOResultToBindings,exports.bindingToTerm=function bindingToTerm(item){var typ=item.type.toLowerCase();if("uri"===typ||"iri"===typ)return _solidLogic.store.sym(item.value);if("literal"===typ)return item["xml:lang"]?new _rdflib.Literal(item.value,item["xml:lang"]):new _rdflib.Literal(item.value);throw new Error('bindingToTerm: Unexpected type "'.concat(item.type,'" in sparql binding}'))},exports.fetcherOptionsJsonPublicData=exports.escoParameters=exports.dbpediaParameters=exports.dbPediaTypeMap=void 0,exports.getDbpediaDetails=getDbpediaDetails,exports.getWikidataDetails=getWikidataDetails,exports.getWikidataDetailsOld=function getWikidataDetailsOld(_x19,_x20,_x21){return _getWikidataDetailsOld.apply(this,arguments)},exports.getWikidataLocation=function getWikidataLocation(_x22,_x23,_x24){return _getWikidataLocation.apply(this,arguments)},exports.instituteDetailsWikidataQuery=void 0,exports.loadFromBindings=loadFromBindings,exports.loadPublicDataThing=function loadPublicDataThing(_x13,_x14,_x15){return _loadPublicDataThing.apply(this,arguments)},exports.queryESCODataByName=function queryESCODataByName(_x,_x2,_x3){return _queryESCODataByName.apply(this,arguments)},exports.queryPublicDataByName=function queryPublicDataByName(_x4,_x5,_x6,_x7){return _queryPublicDataByName.apply(this,arguments)},exports.queryPublicDataConstruct=queryPublicDataConstruct,exports.queryPublicDataSelect=queryPublicDataSelect,exports.wikidataParameters=exports.wikidataOutgoingClassMap=exports.wikidataIncomingClassMap=exports.wikidataClasses=exports.variableNameToPredicateMap=void 0;var _regenerator=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/regenerator/index.js")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),_rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js")),_language=__webpack_require__("./lib/widgets/forms/autocomplete/language.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var AUTOCOMPLETE_LIMIT=exports.AUTOCOMPLETE_LIMIT=200,subjectRegexp=/\$\(subject\)/g,instituteDetailsWikidataQuery=(exports.wikidataClasses={Corporation:"http://www.wikidata.org/entity/Q6881511",EducationalOrganization:"http://www.wikidata.org/entity/Q178706",GovernmentOrganization:"http://www.wikidata.org/entity/Q327333",MedicalOrganization:"http://www.wikidata.org/entity/Q4287745",MusicGroup:"http://www.wikidata.org/entity/Q32178211",NGO:"http://www.wikidata.org/entity/Q163740",Occupation:"http://www.wikidata.org/entity/Q28640",Project:"http://www.wikidata.org/entity/Q170584",ResearchOrganization:"http://www.wikidata.org/entity/Q31855",SportsOrganization:"http://www.wikidata.org/entity/Q4438121"},exports.instituteDetailsWikidataQuery='prefix vcard: \nCONSTRUCT\n{ wd:Q49108 vcard:fn ?itemLabel.\nwd:Q49108 rdf:type ?klass. ?klass rdfs:label ?klassLabel; rdfs:comment ?klassDescription .\nwd:Q49108 schema:logo ?logo;\n schema:image ?image;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary rdfs:label ?subsidiaryLabel .\n ?supersidiary schema:subOrganization wd:Q49108 .\n ?supersidiary rdfs:label ?supersidiaryLabel .\n wd:Q49108 schema:location ?location .\n ?location schema:elevation ?elevation .\n ?location wdt:P131 ?region . ?region rdfs:label ?regionLabel .\n ?location wdt:P625 ?coordinates .\n ?location schema:country ?country . ?country rdfs:label ?countryLabel .\n}\nWHERE\n{ optional {wd:Q49108 rdfs:label ?itemLabel} .\n optional {wd:Q49108 wdt:P154 ?logo .}\n optional {wd:Q49108 wdt:P31 ?klass .}\n optional {wd:Q49108 wdt:P158 ?sealImage .}\n optional {wd:Q49108 wdt:P18 ?image .}\n\n optional { wd:Q49108 wdt:P355 ?subsidiary . }\n optional { ?supersidiary wdt:P355 wd:Q49108. }\n\n optional { wd:Q49108 wdt:P276 ?location .\n\n optional { ?location schema:eleveation ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\n optional { ?location wdt:P17 ?country }\n }\n SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it". }\n}'),fetcherOptionsJsonPublicData=exports.fetcherOptionsJsonPublicData={credentials:"omit",headers:new Headers({Accept:"application/json"})},dbpediaParameters=(exports.escoParameters={label:"ESCO",logo:_solidLogic.store.sym("https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif"),searchByNameURI:"https://ec.europa.eu/esco/api/search?language=$(language)&type=occupation&text=$(name)"},exports.dbpediaParameters={label:"DBPedia",logo:_solidLogic.store.sym("https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/DBpediaLogo.svg/263px-DBpediaLogo.svg.png"),searchByNameQuery:'select distinct ?subject, ?name where {\n ?subject a $(targetClass); rdfs:label ?name\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit)',endpoint:"https://dbpedia.org/sparql/"}),wikidataParameters=(exports.dbPediaTypeMap={AcademicInsitution:"http://umbel.org/umbel/rc/EducationalOrganization"},exports.wikidataOutgoingClassMap={AcademicInsitution:"http://www.wikidata.org/entity/Q4671277",Enterprise:"http://www.wikidata.org/entity/Q6881511",Business:"http://www.wikidata.org/entity/Q4830453",NGO:"http://www.wikidata.org/entity/Q79913",CharitableOrganization:"http://www.wikidata.org/entity/Q708676",Insitute:"http://www.wikidata.org/entity/Q1664720"},exports.wikidataParameters={label:"WikiData",limit:3e3,logo:_solidLogic.store.sym("https://www.wikimedia.org/static/images/project-logos/wikidatawiki.png"),endpoint:"https://query.wikidata.org/sparql",searchByNameQuery:'SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit) ',insitituteDetailsQuery:'CONSTRUCT\n{ wd:Q49108 schema:name ?itemLabel;\n schema:logo ?logo;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary schema:name ?subsidiaryLabel .\n}\nWHERE\n{\n wd:Q49108 # rdfs:label ?itemLabel ;\n wdt:P154 ?logo;\n wdt:P158 ?sealImage ;\n wdt:P355 ?subsidiary .\n # ?subsidiary rdfs:label ?subsidiaryLabel .\n\n SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], fr". }\n}'}),wikidataIncomingClassMap=exports.wikidataIncomingClassMap={"http://www.wikidata.org/entity/Q15936437":ns.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q1664720":ns.schema("EducationalOrganization"),"http://www.wikidata.org/entity/Q43229":ns.schema("Organization"),"http://www.wikidata.org/entity/Q3918":ns.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q170584":ns.schema("Project"),"http://www.wikidata.org/entity/Q327333":ns.schema("GovernmentOrganization"),"http://www.wikidata.org/entity/Q2221906":ns.schema("Place"),"http://www.wikidata.org/entity/Q167037":ns.schema("Corporation")},variableNameToPredicateMap=exports.variableNameToPredicateMap={targetClass:ns.rdf("type"),sealImage:ns.schema("logo"),shortName:ns.foaf("nick"),subsidiary:ns.schema("subOrganization"),city:ns.vcard("locality"),state:ns.vcard("region"),country:ns.vcard("country-name"),homepage:ns.foaf("homepage"),lat:ns.schema("latitude"),long:ns.schema("longitude")};function loadFromBindings(kb,solidSubject,bindings,doc){var predMap=arguments.length>4&&void 0!==arguments[4]?arguments[4]:variableNameToPredicateMap,results={};debug.log("loadFromBindings: subject: ".concat(solidSubject)),debug.log(" doc: ".concat(doc)),bindings.forEach((function(binding){for(var key in binding){var result=binding[key],combined=JSON.stringify(result);results[key]=results[key]||new Set,results[key].add(combined)}}));var _loop=function _loop(key){var values=results[key];debug.log(" results ".concat(key," -> ").concat(values)),values.forEach((function(combined){var obj,result=JSON.parse(combined),type=result.type,value=result.value;if("uri"===type)obj=kb.sym(value);else{if("literal"!==type)throw new Error("loadFromBindings: unexpected type: ".concat(type));obj=new _rdflib.Literal(value,result.language,result.datatype)}if("type"===key)wikidataIncomingClassMap[value]?obj=wikidataIncomingClassMap[value]:debug.warn("Unmapped Wikidata Class: "+value);else if("coordinates"===key){debug.log(" @@@ hey a point: "+value);var match=/.*\(([-0-9.-]*) ([-0-9.-]*)\)/.exec(value);if(match){var _float=ns.xsd("float"),latitude=new _rdflib.Literal(match[1],null,_float),longitude=new _rdflib.Literal(match[2],null,_float);kb.add(solidSubject,ns.schema("longitude"),longitude,doc),kb.add(solidSubject,ns.schema("latitude"),latitude,doc)}else debug.log("Bad coordinates syntax: "+value)}else{var pred=predMap[key]||ns.schema(key);kb.add(solidSubject,pred,obj,doc),debug.log(" public data ".concat(pred," ").concat(obj,"."))}}))};for(var key in results)_loop(key)}function ESCOResultToBindings(json){return json._embedded.results.map((function(result){return{name:{value:result.title,type:"literal"},subject:{type:"IRI",value:result.uri}}}))}function _queryESCODataByName(){return(_queryESCODataByName=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee(filter,theClass,queryTarget){var _store$fetcher,limit,queryURI,response,text,json;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(queryTarget.searchByNameURI){_context.next=2;break}throw new Error("Missing queryTarget.searchByNameURI on queryESCODataByName");case 2:return limit=queryTarget.limit||AUTOCOMPLETE_LIMIT,queryURI=queryTarget.searchByNameURI.replace("$(name)",filter).replace("$(limit)",""+limit).replace("$(targetClass)",theClass.toNT()),debug.log("Querying ESCO data - uri: "+queryURI),_context.next=7,null===(_store$fetcher=_solidLogic.store.fetcher)||void 0===_store$fetcher?void 0:_store$fetcher.webOperation("GET",queryURI,fetcherOptionsJsonPublicData);case 7:if(response=_context.sent,text=(null==response?void 0:response.responseText)||"",debug.log(" Query result text"+text.slice(0,500)+"..."),0!==text.length){_context.next=12;break}throw new Error("Wot no text back from ESCO query "+queryURI);case 12:return json=JSON.parse(text),debug.log(" ESCO Query result JSON"+JSON.stringify(json,null,4).slice(0,500)+"..."),_context.abrupt("return",ESCOResultToBindings(json));case 15:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}function fixWikidataJSON(str){var syntaxProblem=str.indexOf("SPARQL-QUERY");if(syntaxProblem<0)return str;debug.warn(" ### Fixing JSON with wikidata error code injection "+str.slice(syntaxProblem,syntaxProblem+200));var goodness=str.lastIndexOf("}, {");return str.slice(0,goodness)+" } ] } } "}function _queryPublicDataByName(){return(_queryPublicDataByName=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee2(filter,theClass,languages,queryTarget){var substituteStrings,languagePrefs,language,sparql,queryURI,response,_store$fetcher2,text,text2,json,bindings;return _regenerator.default.wrap((function _callee2$(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(substituteStrings=function _substituteStrings(template){var limit=queryTarget.limit||AUTOCOMPLETE_LIMIT;return template.replace("$(name)",filter).replace("$(limit)",""+limit).replace("$(language)",language).replace("$(targetClass)",theClass.toNT())},theClass){_context2.next=3;break}throw new Error("queryPublicDataByName: No class provided");case 3:return _context2.next=5,(0,_language.getPreferredLanguages)();case 5:if(_context2.t0=_context2.sent,_context2.t0){_context2.next=8;break}_context2.t0=_language.defaultPreferredLanguages;case 8:if(languagePrefs=_context2.t0,language=languagePrefs[0]||"en",!queryTarget.searchByNameQuery){_context2.next=16;break}return sparql=substituteStrings(queryTarget.searchByNameQuery),debug.log("Querying public data - sparql: "+sparql),_context2.abrupt("return",queryPublicDataSelect(sparql,queryTarget));case 16:if(!queryTarget.searchByNameURI){_context2.next=46;break}return queryURI=substituteStrings(queryTarget.searchByNameURI),_context2.prev=18,_context2.next=21,null===(_store$fetcher2=_solidLogic.store.fetcher)||void 0===_store$fetcher2?void 0:_store$fetcher2.webOperation("GET",queryURI,fetcherOptionsJsonPublicData);case 21:response=_context2.sent,_context2.next=27;break;case 24:throw _context2.prev=24,_context2.t1=_context2.catch(18),new Error("Exception when trying to fetch ".concat(queryURI," \n ").concat(_context2.t1));case 27:if(text=response.responseText||"",200===response.status){_context2.next=30;break}throw new Error("HTTP error status ".concat(response.status," trying to fetch ").concat(queryURI," "));case 30:if(debug.log(" Query result text"+text.slice(0,500)+"..."),0!==text.length){_context2.next=33;break}throw new Error("queryPublicDataByName: No text back from public data query "+queryURI);case 33:if(text2=fixWikidataJSON(text),json=JSON.parse(text2),debug.log(" API Query result JSON"+JSON.stringify(json,null,4).slice(0,500)+"..."),!json._embedded){_context2.next=42;break}return debug.log(" Looks like ESCO"),bindings=ESCOResultToBindings(json),_context2.abrupt("return",bindings);case 42:throw alert("Code me: unrecognized API return format"),new Error("*** Need to add code to parse unrecognized API JSON return\n".concat(JSON.stringify(json,null,4)));case 44:_context2.next=47;break;case 46:throw new Error("Query source must have either rest API or SPARQL endpoint.");case 47:case"end":return _context2.stop()}}),_callee2,null,[[18,24]])})))).apply(this,arguments)}function queryPublicDataSelect(_x8,_x9){return _queryPublicDataSelect.apply(this,arguments)}function _queryPublicDataSelect(){return(_queryPublicDataSelect=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee3(sparql,queryTarget){var _store$fetcher3,myUrlWithParams,queryURI,headers,options,response,text,text2,json,bindings;return _regenerator.default.wrap((function _callee3$(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(queryTarget.endpoint){_context3.next=2;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataSelect");case 2:return(myUrlWithParams=new URL(queryTarget.endpoint)).searchParams.append("query",sparql),queryURI=myUrlWithParams.href,debug.log(" queryPublicDataSelect uri: "+queryURI),(headers=new Headers).append("Accept","application/json"),options={credentials:"omit",headers},_context3.next=11,null===(_store$fetcher3=_solidLogic.store.fetcher)||void 0===_store$fetcher3?void 0:_store$fetcher3.webOperation("GET",queryURI,options);case 11:if(response=_context3.sent,0!==(text=(null==response?void 0:response.responseText)||"").length){_context3.next=15;break}throw new Error("No text back from query "+queryURI);case 15:return text2=fixWikidataJSON(text),json=JSON.parse(text2),debug.log(" Query result JSON"+JSON.stringify(json,null,4).slice(0,100)+"..."),bindings=json.results.bindings,_context3.abrupt("return",bindings);case 20:case"end":return _context3.stop()}}),_callee3)})))).apply(this,arguments)}function queryPublicDataConstruct(_x10,_x11,_x12){return _queryPublicDataConstruct.apply(this,arguments)}function _queryPublicDataConstruct(){return(_queryPublicDataConstruct=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee4(sparql,pubicId,queryTarget){var _store$fetcher4,myUrlWithParams,queryURI,headers,options,response,text,report;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:if(debug.log("queryPublicDataConstruct: sparql:",sparql),queryTarget.endpoint){_context4.next=3;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataConstruct");case 3:return(myUrlWithParams=new URL(queryTarget.endpoint)).searchParams.append("query",sparql),queryURI=myUrlWithParams.href,debug.log(" queryPublicDataConstruct uri: "+queryURI),(headers=new Headers).append("Accept","text/turtle"),options={credentials:"omit",headers},_context4.next=12,null===(_store$fetcher4=_solidLogic.store.fetcher)||void 0===_store$fetcher4?void 0:_store$fetcher4.webOperation("GET",queryURI,options);case 12:if(response=_context4.sent,text=(null==response?void 0:response.responseText)||"No response text?",report=text.length>500?text.slice(0,200)+" ... "+text.slice(-200):text,debug.log(" queryPublicDataConstruct result text:"+report),0!==text.length){_context4.next=18;break}throw new Error("queryPublicDataConstruct: No text back from construct query:"+queryURI);case 18:(0,_rdflib.parse)(text,_solidLogic.store,pubicId.uri,"text/turtle");case 19:case"end":return _context4.stop()}}),_callee4)})))).apply(this,arguments)}function _loadPublicDataThing(){return(_loadPublicDataThing=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee5(kb,subject,publicDataID){var iDToFetch,headers;return _regenerator.default.wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:if(!publicDataID.uri.startsWith("https://dbpedia.org/resource/")){_context5.next=4;break}return _context5.abrupt("return",getDbpediaDetails(kb,subject,publicDataID));case 4:if(!publicDataID.uri.match(/^https?:\/\/www\.wikidata\.org\/entity\/.*/)){_context5.next=9;break}return _context5.next=7,getWikidataDetails(kb,subject,publicDataID);case 7:_context5.next=13;break;case 9:return iDToFetch=publicDataID.uri.startsWith("http:")?kb.sym("https:"+publicDataID.uri.slice(5)):publicDataID,(headers=new Headers).append("Accept","text/turtle"),_context5.abrupt("return",kb.fetcher.load(iDToFetch,{credentials:"omit",headers}));case 13:case"end":return _context5.stop()}}),_callee5)})))).apply(this,arguments)}function getWikidataDetails(_x16,_x17,_x18){return _getWikidataDetails.apply(this,arguments)}function _getWikidataDetails(){return(_getWikidataDetails=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee6(kb,solidSubject,publicDataID){var subjRegexp,sparql;return _regenerator.default.wrap((function _callee6$(_context6){for(;;)switch(_context6.prev=_context6.next){case 0:return subjRegexp=/wd:Q49108/g,sparql=instituteDetailsWikidataQuery.replace(subjRegexp,publicDataID.toNT()),_context6.next=4,queryPublicDataConstruct(sparql,publicDataID,wikidataParameters);case 4:debug.log("getWikidataDetails: loaded.",publicDataID);case 5:case"end":return _context6.stop()}}),_callee6)})))).apply(this,arguments)}function _getWikidataDetailsOld(){return(_getWikidataDetailsOld=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee7(kb,solidSubject,publicDataID){var sparql,bindings;return _regenerator.default.wrap((function _callee7$(_context7){for(;;)switch(_context7.prev=_context7.next){case 0:return sparql='select distinct * where {\n optional { $(subject) wdt:P31 ?targetClass } # instance of\n optional { $(subject) wdt:P154 ?logo }\n optional { $(subject) wdt:P158 ?sealImage }\n# optional { $(subject) wdt:P159 ?headquartersLocation }\n\noptional { $(subject) wdt:P17 ?country }\noptional { $(subject) wdt:P18 ?image }\noptional { $(subject) wdt:P1813 ?shortName }\n\noptional { $(subject) wdt:P355 ?subsidiary }\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(subjectRegexp,publicDataID.toNT()),_context7.next=3,queryPublicDataSelect(sparql,wikidataParameters);case 3:bindings=_context7.sent,loadFromBindings(kb,publicDataID,bindings,publicDataID.doc());case 5:case"end":return _context7.stop()}}),_callee7)})))).apply(this,arguments)}function _getWikidataLocation(){return(_getWikidataLocation=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee8(kb,solidSubject,publicDataID){var sparql,bindings;return _regenerator.default.wrap((function _callee8$(_context8){for(;;)switch(_context8.prev=_context8.next){case 0:return sparql='select distinct * where {\n\n $(subject) wdt:P276 ?location .\n\n optional { ?location wdt:P2044 ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\noptional { ?location wdt:P17 ?country }\n\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(subjectRegexp,publicDataID.toNT()),debug.log(" location query sparql:"+sparql),_context8.next=4,queryPublicDataSelect(sparql,wikidataParameters);case 4:bindings=_context8.sent,debug.log(" location query bindings:",bindings),loadFromBindings(kb,publicDataID,bindings,publicDataID.doc());case 7:case"end":return _context8.stop()}}),_callee8)})))).apply(this,arguments)}function getDbpediaDetails(_x25,_x26,_x27){return _getDbpediaDetails.apply(this,arguments)}function _getDbpediaDetails(){return(_getDbpediaDetails=(0,_asyncToGenerator2.default)(_regenerator.default.mark((function _callee9(kb,solidSubject,publicDataID){var sparql,bindings;return _regenerator.default.wrap((function _callee9$(_context9){for(;;)switch(_context9.prev=_context9.next){case 0:return sparql="select distinct ?city, ?state, ?country, ?homepage, ?logo, ?lat, ?long, WHERE {\n OPTIONAL { <".concat(publicDataID,"> ?city }\n OPTIONAL { ").concat(publicDataID," ?state }\n OPTIONAL { ").concat(publicDataID," ?country }\n OPTIONAL { ").concat(publicDataID," foaf:homepage ?homepage }\n OPTIONAL { ").concat(publicDataID," foaf:lat ?lat; foaf:long ?long }\n OPTIONAL { ").concat(publicDataID," ?country }\n }"),_context9.next=3,queryPublicDataSelect(sparql,dbpediaParameters);case 3:bindings=_context9.sent,loadFromBindings(kb,publicDataID,bindings,publicDataID.doc()),debug.log("Finished getDbpediaDetails.");case 6:case"end":return _context9.stop()}}),_callee9)})))).apply(this,arguments)}},"./lib/widgets/forms/basic.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.basicField=function basicField(dom,container,already,subject,form,doc,callbackFunction){var kb=store,formDoc=form.doc?form.doc():null,box=dom.createElement("div"),property=kb.any(form,ns.ui("property"));container&&container.appendChild(box);if(!property)return box.appendChild((0,_error.errorMessageBlock)(dom,"Error: No property given for text field: "+form));var rhs=renderNameValuePair(dom,kb,box,form),suppressEmptyUneditable=kb.anyJS(form,ns.ui("suppressEmptyUneditable"),null,formDoc),uri=(0,_fieldFunction.mostSpecificClassURI)(form),params=_fieldParams.fieldParams[uri];void 0===params&&(params={style:""});var paramStyle=params.style||"",style=_style.textInputStyle+paramStyle,field=dom.createElement("input");field.style=style,rhs.appendChild(field),field.setAttribute("type",params.type?params.type:"text");var size=kb.anyJS(form,ns.ui("size"))||_style.textInputSize||20;field.setAttribute("size",size);var maxLength=kb.any(form,ns.ui("maxLength"));field.setAttribute("maxLength",maxLength?""+maxLength:"4096"),doc=doc||fieldStore(subject,property,doc);var obj=kb.any(subject,property,void 0,doc);obj||(obj=kb.any(form,ns.ui("default")));obj&&obj.value&¶ms.uriPrefix?field.value=decodeURIComponent(obj.value.replace(params.uriPrefix,"")).replace(/ /g,""):obj&&(field.value=obj.value||obj.value||"");if(field.setAttribute("style",style),!kb.updater)throw new Error("kb has no updater");if(!kb.updater.editable(doc.uri))return field.readOnly=!0,field.style=_style.textInputStyleUneditable+paramStyle,suppressEmptyUneditable&&""===field.value&&(box.style.display="none"),box;return field.addEventListener("keyup",(function(_e){params.pattern&&field.setAttribute("style",style+(field.value.match(params.pattern)?"color: green;":"color: red;"))}),!0),field.addEventListener("change",(function(_e){if(!params.pattern||field.value.match(params.pattern)){field.disabled=!0,field.setAttribute("style",style+"color: gray;");var result,ds=kb.statementsMatching(subject,property);params.namedNode?result=kb.sym(field.value):params.uriPrefix?(result=encodeURIComponent(field.value.replace(/ /g,"")),result=kb.sym(params.uriPrefix+field.value)):result=params.dt?new _rdflib.Literal(field.value.trim(),void 0,ns.xsd(params.dt)):new _rdflib.Literal(field.value);var is=ds.map((function(statement){return(0,_rdflib.st)(statement.subject,statement.predicate,result,statement.why)}));0===is.length&&(is=[(0,_rdflib.st)(subject,property,result,doc)]),function updateMany(ds,is,callback){var docs=[];if(is.forEach((function(st){docs.includes(st.why.uri)||docs.push(st.why.uri)})),ds.forEach((function(st){docs.includes(st.why.uri)||docs.push(st.why.uri)})),0===docs.length)throw new Error("updateMany has no docs to patch");if(!kb.updater)throw new Error("kb has no updater");if(1===docs.length)return kb.updater.update(ds,is,callback);var doc=docs.pop(),is1=is.filter((function(st){return st.why.uri===doc})),is2=is.filter((function(st){return st.why.uri!==doc})),ds1=ds.filter((function(st){return st.why.uri===doc})),ds2=ds.filter((function(st){return st.why.uri!==doc}));kb.updater.update(ds1,is1,(function(uri,ok,body){ok?updateMany(ds2,is2,callback):callback(uri,ok,body)}))}(ds,is,(function(uri,ok,body){ok?(field.disabled=!1,field.setAttribute("style",style)):box.appendChild((0,_error.errorMessageBlock)(dom,body)),callbackFunction(ok,body)}))}}),!0),box},exports.fieldLabel=fieldLabel,exports.fieldStore=fieldStore,exports.renderNameValuePair=renderNameValuePair;var _rdflib=__webpack_require__("./node_modules/rdflib/esm/index.js"),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_style=__webpack_require__("./lib/style.js"),_utils=__webpack_require__("./lib/utils/index.js"),_error=__webpack_require__("./lib/widgets/error.js"),_fieldFunction=__webpack_require__("./lib/widgets/forms/fieldFunction.js"),_fieldParams=__webpack_require__("./lib/widgets/forms/fieldParams.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}var store=_solidLogic.solidLogicSingleton.store;function renderNameValuePair(dom,kb,box,form,label){box.style.display="flex",box.style.flexDirection="row";var lhs=box.appendChild(dom.createElement("div"));lhs.style.width=_style.formFieldNameBoxWidth;var rhs=box.appendChild(dom.createElement("div"));return lhs.setAttribute("class","formFieldName"),lhs.setAttribute("style",_style.formFieldNameBoxStyle),rhs.setAttribute("class","formFieldValue"),label?lhs.appendChild(dom.createTextNode(label)):kb.any(form,ns.ui("property"))?lhs.appendChild(fieldLabel(dom,kb.any(form,ns.ui("property")),form)):(rhs.appendChild((0,_error.errorMessageBlock)(dom,"No property or label given for form field: "+form)),lhs.appendChild(dom.createTextNode("???"))),rhs}function fieldLabel(dom,property,fieldInQuestion){var lab=store.any(fieldInQuestion,ns.ui("label"));if(lab||(lab=(0,_utils.label)(property,!0)),void 0===property)return dom.createTextNode("@@Internal error: undefined property");var anchor=dom.createElement("a");return property.uri&&anchor.setAttribute("href",property.uri),anchor.setAttribute("style","color: #3B5998; text-decoration: none;"),anchor.textContent=lab,anchor}function fieldStore(subject,predicate,def){var sts=store.statementsMatching(subject,predicate);if(0===sts.length)return def;if(!store.updater)throw new Error("Store has no updater");return sts.length>0&&sts[0].why.value&&store.updater.editable(sts[0].why.value,store)?store.sym(sts[0].why.value):def}},"./lib/widgets/forms/fieldFunction.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.field=void 0,exports.fieldFunction=function fieldFunction(dom,fieldInQuestion){var uri=mostSpecificClassURI(fieldInQuestion),fun=field[uri];if((0,_log.debug)("paneUtils: Going to implement field "+fieldInQuestion+" of type "+uri),!fun)return function(dom2,container){var box=(0,_error.errorMessageBlock)(dom2,"No handler for field "+fieldInQuestion+" of type "+uri);return container&&container.appendChild(box),box};return fun},exports.mostSpecificClassURI=mostSpecificClassURI;var _solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_log=__webpack_require__("./lib/log.js"),_error=__webpack_require__("./lib/widgets/error.js"),store=_solidLogic.solidLogicSingleton.store,field=exports.field={};function mostSpecificClassURI(x){var kb=store,ft=kb.findTypeURIs(x),bot=kb.bottomTypeURIs(ft),bots=[];for(var b in bot)bots.push(b);return bots[0]}},"./lib/widgets/forms/fieldParams.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.fieldParams=void 0;var _fieldParams,_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_style=__webpack_require__("./lib/style.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}exports.fieldParams=(_fieldParams={},(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)(_fieldParams,ns.ui("ColorField").uri,{size:9,type:"color",style:"height: 3em;",dt:"color",pattern:/^\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\s*$/}),ns.ui("DateField").uri,{size:20,type:"date",dt:"date",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\s*$/}),ns.ui("DateTimeField").uri,{size:20,type:"datetime-local",dt:"dateTime",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\s*$/}),ns.ui("TimeField").uri,{size:10,type:"time",dt:"time",pattern:/^\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\s*$/}),ns.ui("IntegerField").uri,{size:12,style:"text-align: right;",dt:"integer",pattern:/^\s*-?[0-9]+\s*$/}),ns.ui("DecimalField").uri,{size:12,style:"text-align: right;",dt:"decimal",pattern:/^\s*-?[0-9]*(\.[0-9]*)?\s*$/}),ns.ui("FloatField").uri,{size:12,style:"text-align: right;",dt:"float",pattern:/^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/}),ns.ui("SingleLineTextField").uri,{}),ns.ui("NamedNodeURIField").uri,{namedNode:!0}),ns.ui("TextField").uri,{}),(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)(_fieldParams,ns.ui("PhoneField").uri,{size:20,uriPrefix:"tel:",pattern:/^\+?[\d-]+[\d]*$/}),ns.ui("EmailField").uri,{size:30,uriPrefix:"mailto:",pattern:/^\s*.*@.*\..*\s*$/}),ns.ui("Group").uri,{style:_style.formGroupStyle}),ns.ui("Comment").uri,{element:"p",style:_style.commentStyle}),ns.ui("Heading").uri,{element:"h3",style:_style.formHeadingStyle}))},"./lib/widgets/forms/formStyle.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.starts-with.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.setFieldStyle=function setFieldStyle(ele,field){var classUri=(0,_fieldFunction.mostSpecificClassURI)(field),params=_fieldParams.fieldParams[classUri]||{},style=_solidLogic.store.any(field,ns.ui("style"));if(!style)return void(params.style&&ele.setAttribute("style",params.style));if("Literal"===style.termType)style&&ele.setAttribute("style",style.value);else{_solidLogic.store.statementsMatching(style,null,null,field.doc()).forEach((function(st){if(st.predicate.uri&&st.predicate.uri.startsWith("https://www.w3.org/ns/css#")){var cssAttribute=st.predicate.uri.slice("https://www.w3.org/ns/css#".length);try{ele.style[cssAttribute]=st.object.value}catch(err){console.warn("setFieldStyle: Error setting element style ".concat(cssAttribute,' to "').concat(st.object.value,'"')),console.warn('setFieldStyle: ... Element tagName was "'.concat(ele.tagName||"???",'"'))}}}))}};var ns=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&&Object.prototype.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}(__webpack_require__("./lib/ns.js")),_solidLogic=__webpack_require__("./node_modules/solid-logic/lib/index.js"),_fieldParams=__webpack_require__("./lib/widgets/forms/fieldParams.js"),_fieldFunction=__webpack_require__("./lib/widgets/forms/fieldFunction.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}},"./lib/widgets/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");var _typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={publicData:!0};exports.publicData=void 0;var _peoplePicker=__webpack_require__("./lib/widgets/peoplePicker.js");Object.keys(_peoplePicker).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_peoplePicker[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _peoplePicker[key]}}))}));var _dragAndDrop=__webpack_require__("./lib/widgets/dragAndDrop.js");Object.keys(_dragAndDrop).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_dragAndDrop[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _dragAndDrop[key]}}))}));var _buttons=__webpack_require__("./lib/widgets/buttons.js");Object.keys(_buttons).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_buttons[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _buttons[key]}}))}));var _iconLinks=__webpack_require__("./lib/widgets/buttons/iconLinks.js");Object.keys(_iconLinks).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_iconLinks[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _iconLinks[key]}}))}));var _error=__webpack_require__("./lib/widgets/error.js");Object.keys(_error).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_error[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _error[key]}}))}));var _forms=__webpack_require__("./lib/widgets/forms.js");Object.keys(_forms).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_forms[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _forms[key]}}))}));var _autocompleteBar=__webpack_require__("./lib/widgets/forms/autocomplete/autocompleteBar.js");Object.keys(_autocompleteBar).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_autocompleteBar[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _autocompleteBar[key]}}))}));var _autocompletePicker=__webpack_require__("./lib/widgets/forms/autocomplete/autocompletePicker.js");Object.keys(_autocompletePicker).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||key in exports&&exports[key]===_autocompletePicker[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _autocompletePicker[key]}}))}));var _publicData=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&&Object.prototype.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}(__webpack_require__("./lib/widgets/forms/autocomplete/publicData.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}exports.publicData=_publicData},"./lib/widgets/multiSelect.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js"),__webpack_require__("./node_modules/core-js/modules/es.array.some.js"),__webpack_require__("./node_modules/core-js/modules/es.array.splice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.IconicMultiSelect=void 0;var _toConsumableArray2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_defineProperty2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),style=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&&Object.prototype.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}(__webpack_require__("./lib/style_multiSelect.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}exports.IconicMultiSelect=function(){function IconicMultiSelect(_ref){var data=_ref.data,itemTemplate=_ref.itemTemplate,noData=_ref.noData,noResults=_ref.noResults,placeholder=_ref.placeholder,select=_ref.select,container=_ref.container,tagTemplate=_ref.tagTemplate,textField=_ref.textField,valueField=_ref.valueField;(0,_classCallCheck2.default)(this,IconicMultiSelect),(0,_defineProperty2.default)(this,"_data",void 0),(0,_defineProperty2.default)(this,"_domElements",void 0),(0,_defineProperty2.default)(this,"_event",(function(){})),(0,_defineProperty2.default)(this,"_itemTemplate",void 0),(0,_defineProperty2.default)(this,"_multiselect",void 0),(0,_defineProperty2.default)(this,"_noData",void 0),(0,_defineProperty2.default)(this,"_noResults",void 0),(0,_defineProperty2.default)(this,"_options",[]),(0,_defineProperty2.default)(this,"_placeholder",void 0),(0,_defineProperty2.default)(this,"_select",void 0),(0,_defineProperty2.default)(this,"_selectContainer",void 0),(0,_defineProperty2.default)(this,"_selectedOptions",[]),(0,_defineProperty2.default)(this,"_tagTemplate",void 0),(0,_defineProperty2.default)(this,"_textField",void 0),(0,_defineProperty2.default)(this,"_valueField",void 0),(0,_defineProperty2.default)(this,"_cross",'\n \n \n \n '),this._data=null!=data?data:[],this._itemTemplate=null!=itemTemplate?itemTemplate:null,this._noData=null!=noData?noData:"No data found.",this._noResults=null!=noResults?noResults:"No results found.",this._placeholder=null!=placeholder?placeholder:"Select...",this._select=select,this._selectContainer=container,this._tagTemplate=null!=tagTemplate?tagTemplate:null,this._textField=null!=textField?textField:null,this._valueField=null!=valueField?valueField:null}return(0,_createClass2.default)(IconicMultiSelect,[{key:"init",value:function init(){if(!this._select||"SELECT"!==this._select.nodeName)throw new Error("The selector '".concat(this._select,"' did not select any valid select tag."));if(this._itemTemplate&&0===this._data.length)throw new Error("itemTemplate must be initialized with data from the component settings");if(this._tagTemplate&&0===this._data.length)throw new Error("tagTemplate must be initialized with data from the component settings");this._options=this._data.length>0?this._getDataFromSettings():this._getDataFromSelectTag(),this._renderMultiselect(),this._renderOptionsList(),this._domElements={clear:this._multiselect.querySelector(".multiselect__clear-btn"),input:this._multiselect.querySelector(".multiselect__input"),optionsContainer:this._multiselect.querySelector(".multiselect__options"),optionsContainerList:this._multiselect.querySelector(".multiselect__options > ul"),options:{list:this._multiselect.querySelectorAll(".multiselect__options > ul > li"),find:function find(callbackFn){for(var i=0;i').concat(this._tagTemplate?this._processTemplate(this._tagTemplate,index):option.text,'').concat(this._cross,"");this._domElements.input.insertAdjacentHTML("beforebegin",html),this._multiselect.querySelector('span[data-value="'.concat(option.value,'"]')).lastElementChild.addEventListener("click",(function(){var target=_this._domElements.options.find((function(el){return el.dataset.value===option.value}));_this._handleOption(target)}))}},{key:"_clearSelection",value:function _clearSelection(){for(var _this2=this,_loop=function _loop(){var option=_this2._selectedOptions[i],target=_this2._domElements.options.find((function(el){return el.dataset.value===option.value}));target.classList.remove("multiselect__options--selected"),target.setAttribute("style",style.multiselect__options),_this2._removeOptionFromList(target.dataset.value)},i=0;i0&&_this3._filterOptions(value)})),this._domElements.input.addEventListener("keydown",(function(e){_this3._handleArrows(e),_this3._handleBackspace(e),_this3._handleEnter(e)}))}},{key:"_filterOptions",value:function _filterOptions(value){var _this4=this,isOpen=this._domElements.optionsContainer.classList.contains("visible"),valueLowerCase=value.toLowerCase();if(!isOpen&&value.length>0&&(this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",style.multiselect__options_visible)),this._domElements.options.list.length>0){for(var i=0;i0&&this._valueField&&this._textField){var isValueFieldValid="string"==typeof this._valueField,isTextFieldValid="string"==typeof this._textField,arr=[];if(!isValueFieldValid||!isTextFieldValid)throw new Error("textField and valueField must be of type string");for(var i=0;i ul");if(isOpen){var selected=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected"),action={ArrowUp:"previous",Up:"previous",ArrowDown:"next",Down:"next"};if(!selected)return optionsContainerList.firstElementChild.classList.add("arrow-selected"),optionsContainerList.firstElementChild.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),void optionsContainerList.firstElementChild.scrollIntoView(!1);if(selected.classList.remove("arrow-selected"),selected.setAttribute("style",style.multiselect__options_ul_li),!(selected=selected[action[event.key]+"ElementSibling"]))return(selected=optionsContainerList.children["next"===action[event.key]?0:optionsContainerList.children.length-1]).classList.add("arrow-selected"),selected.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),void this._scrollIntoView(optionsContainerList,selected);selected.classList.add("arrow-selected"),selected.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),this._scrollIntoView(optionsContainerList,selected)}else this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",style.multiselect__options_visible),optionsContainerList.firstElementChild.classList.add("arrow-selected"),optionsContainerList.firstElementChild.setAttribute("style",style.multiselect__options_ul_li_arrow_selected),optionsContainerList.firstElementChild.scrollIntoView(!1)}}},{key:"_handleBackspace",value:function _handleBackspace(e){if(8===e.keyCode&&""===e.target.value){var lastSelectedOption=this._selectedOptions.length>0?this._selectedOptions[this._selectedOptions.length-1]:null;if(lastSelectedOption){var targetLastSelectedOption=this._multiselect.querySelector('li[data-value="'.concat(lastSelectedOption.value,'"]'));this._handleOption(targetLastSelectedOption),0===this._selectedOptions.length&&(this._domElements.optionsContainer.classList.remove("visible"),this._domElements.optionsContainer.setAttribute("style",style.multiselect__options))}}}},{key:"_handleClearSelectionBtn",value:function _handleClearSelectionBtn(){this._selectedOptions.length>0?this._domElements.clear.style.display="flex":this._domElements.clear.style.display="none"}},{key:"_handleEnter",value:function _handleEnter(event){if(13===event.keyCode){var selected=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected");selected&&(this._handleOption(selected),this._closeList())}}},{key:"_handleOption",value:function _handleOption(target){for(var dispatchEvent=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=0;i\n
                                                            \n ').concat(this._options.length>0&&!this._itemTemplate?this._options.map((function(option){return'\n
                                                          • ').concat(option.text,"
                                                          • \n ")})).join(""):"","\n\n ").concat(this._options.length>0&&this._itemTemplate?this._options.map((function(option,index){return'\n
                                                          • ').concat(_this6._processTemplate(_this6._itemTemplate,index),"
                                                          • \n ")})).join(""):"","\n ").concat(this._showNoData(0===this._options.length),"\n
                                                          \n \n ");this._multiselect.insertAdjacentHTML("beforeend",html)}},{key:"_renderMultiselect",value:function _renderMultiselect(){this._select.style.display="none";var id="iconic-"+this._generateId(20);this._multiselect=document.createElement("div"),this._multiselect.setAttribute("id",id),this._multiselect.setAttribute("class","multiselect__container"),this._multiselect.setAttribute("style",style.multiselect__container);var html='\n
                                                          \n \n
                                                          \n \n ");this._multiselect.innerHTML=html,this._selectContainer.appendChild(this._multiselect)}},{key:"_scrollIntoView",value:function _scrollIntoView(parent,child){var rectParent=parent.getBoundingClientRect(),rectChild=child.getBoundingClientRect();rectParent.toprectChild.top+child.offsetHeight||(parent.scrollTop=child.clientHeight+(child.offsetTop-child.offsetHeight)-(parent.offsetHeight-(child.offsetHeight+(child.offsetHeight-child.clientHeight))))}},{key:"_showNoData",value:function _showNoData(condition){return condition?'

                                                          ').concat(this._noData,"

                                                          "):""}},{key:"_showNoResults",value:function _showNoResults(condition){var dom=this._multiselect.querySelector(".multiselect__options--no-results");if(condition){var html='

                                                          ').concat(this._noResults,"

                                                          ");!dom&&this._domElements.optionsContainerList.insertAdjacentHTML("beforeend",html)}else dom&&dom.parentNode&&dom.parentNode.removeChild(dom)}}]),IconicMultiSelect}()},"./lib/widgets/peoplePicker.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.weak-map.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var _interopRequireDefault=__webpack_require__("./node_modules/@babel/runtime/helpers/interopRequireDefault.js"),_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.Person=exports.PeoplePicker=exports.GroupPicker=exports.GroupBuilder=exports.Group=void 0;var _templateObject,_taggedTemplateLiteral2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js")),_classCallCheck2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js")),_createClass2=_interopRequireDefault(__webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js")),_escapeHtml=_interopRequireDefault(__webpack_require__("./node_modules/escape-html/index.js")),_uuid=_interopRequireDefault(__webpack_require__("./node_modules/uuid/dist/esm-browser/index.js")),rdf=_interopRequireWildcard(__webpack_require__("./node_modules/rdflib/esm/index.js")),debug=_interopRequireWildcard(__webpack_require__("./lib/debug.js")),_dragAndDrop=__webpack_require__("./lib/widgets/dragAndDrop.js"),_error=__webpack_require__("./lib/widgets/error.js"),_iconBase=__webpack_require__("./lib/iconBase.js"),ns=_interopRequireWildcard(__webpack_require__("./lib/ns.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}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&&Object.prototype.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}var kb=__webpack_require__("./node_modules/solid-logic/lib/index.js").solidLogicSingleton.store,GroupPicker=(exports.PeoplePicker=function(){function PeoplePicker(element,typeIndex,groupPickedCb,options){(0,_classCallCheck2.default)(this,PeoplePicker),this.options=options||{},this.element=element,this.typeIndex=typeIndex,this.groupPickedCb=groupPickedCb,this.selectedgroup=this.options.selectedgroup,this.onSelectGroup=this.onSelectGroup.bind(this)}return(0,_createClass2.default)(PeoplePicker,[{key:"render",value:function render(){var _this=this,container=document.createElement("div");if(container.style.maxWidth="350px",container.style.minHeight="200px",container.style.outline="1px solid black",container.style.display="flex",this.selectedgroup){container.style.flexDirection="column";var selectedGroup=document.createElement("div");new Group(selectedGroup,this.selectedgroup).render();var changeGroupButton=document.createElement("button");changeGroupButton.textContent=(0,_escapeHtml.default)("Change group"),changeGroupButton.addEventListener("click",(function(_event){_this.selectedgroup=null,_this.render()})),container.appendChild(selectedGroup),container.appendChild(changeGroupButton)}else this.findAddressBook(this.typeIndex).then((function(_ref){var book=_ref.book,chooseExistingGroupButton=document.createElement("button");chooseExistingGroupButton.textContent=(0,_escapeHtml.default)("Pick an existing group"),chooseExistingGroupButton.style.margin="auto",chooseExistingGroupButton.addEventListener("click",(function(_event){new GroupPicker(container,book,_this.onSelectGroup).render()}));var createNewGroupButton=document.createElement("button");createNewGroupButton.textContent=(0,_escapeHtml.default)("Create a new group"),createNewGroupButton.style.margin="auto",createNewGroupButton.addEventListener("click",(function(_event){_this.createNewGroup(book,_this.options.defaultNewGroupName).then((function(_ref2){var group=_ref2.group;new GroupBuilder(_this.element,book,group,_this.onSelectGroup).render()})).catch((function(errorBody){_this.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("Error creating a new group. (".concat(errorBody,")"))))}))})),container.appendChild(chooseExistingGroupButton),container.appendChild(createNewGroupButton),_this.element.innerHTML="",_this.element.appendChild(container)})).catch((function(err){_this.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("Could find your groups. (".concat(err,")"))))}));return this.element.innerHTML="",this.element.appendChild(container),this}},{key:"findAddressBook",value:function findAddressBook(typeIndex){return new Promise((function(resolve,reject){kb.fetcher.nowOrWhenFetched(typeIndex,(function(ok,err){if(!ok)return reject(err);var bookRegistration=kb.any(null,ns.solid("forClass"),ns.vcard("AddressBook"));if(!bookRegistration)return reject(new Error("no address book registered in the solid type index "+typeIndex));var book=kb.any(bookRegistration,ns.solid("instance"));if(!book)return reject(new Error("incomplete address book registration"));kb.fetcher.load(book).then((function(_xhr){return resolve({book})})).catch((function(err){return reject(new Error("Could not load address book "+err))}))}))}))}},{key:"createNewGroup",value:function createNewGroup(book,defaultNewGroupName){var _indexes=indexes(book),groupIndex=_indexes.groupIndex,groupContainer=_indexes.groupContainer,group=rdf.sym("".concat(groupContainer.uri).concat(_uuid.default.v4().slice(0,8),".ttl#this")),name=defaultNewGroupName||"Untitled Group",patchPromises=[group.doc(),groupIndex].map((function(doc){var typeStatement=rdf.st(group,ns.rdf("type"),ns.vcard("Group"),doc),nameStatement=rdf.st(group,ns.vcard("fn"),name,group.doc(),doc),includesGroupStatement=rdf.st(book,ns.vcard("includesGroup"),group,doc),toIns=doc.equals(groupIndex)?[typeStatement,nameStatement,includesGroupStatement]:[typeStatement,nameStatement];return patch(doc.uri,{toIns}).then((function(){toIns.forEach((function(st){kb.add(st)}))}))}));return Promise.all(patchPromises).then((function(){return{group}})).catch((function(err){throw debug.log("Could not create new group. PATCH failed "+err),new Error("Couldn't create new group. PATCH failed for (".concat(err.xhr?err.xhr.responseURL:""," )"))}))}},{key:"onSelectGroup",value:function onSelectGroup(group){this.selectedgroup=group,this.groupPickedCb(group),this.render()}}]),PeoplePicker}(),exports.GroupPicker=function(){function GroupPicker(element,book,onSelectGroup){(0,_classCallCheck2.default)(this,GroupPicker),this.element=element,this.book=book,this.onSelectGroup=onSelectGroup}return(0,_createClass2.default)(GroupPicker,[{key:"render",value:function render(){var _this2=this;return this.loadGroups().then((function(groups){var container=document.createElement("div");container.style.display="flex",container.style.flexDirection="column",groups.forEach((function(group){var groupButton=document.createElement("button");groupButton.addEventListener("click",_this2.handleClickGroup(group)),new Group(groupButton,group).render(),container.appendChild(groupButton)})),_this2.element.innerHTML="",_this2.element.appendChild(container)})).catch((function(err){_this2.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("There was an error loading your groups. (".concat(err,")"))))})),this}},{key:"loadGroups",value:function loadGroups(){var _this3=this;return new Promise((function(resolve,reject){var groupIndex=indexes(_this3.book).groupIndex;kb.fetcher.nowOrWhenFetched(groupIndex,(function(ok,err){if(!ok)return reject(err);var groups=kb.each(_this3.book,ns.vcard("includesGroup"));return resolve(groups)}))}))}},{key:"handleClickGroup",value:function handleClickGroup(group){var _this4=this;return function(_event){_this4.onSelectGroup(group)}}}]),GroupPicker}()),Group=exports.Group=function(){function Group(element,group){(0,_classCallCheck2.default)(this,Group),this.element=element,this.group=group}return(0,_createClass2.default)(Group,[{key:"render",value:function render(){var container=document.createElement("div");return container.textContent=(0,_escapeHtml.default)(getWithDefault(this.group,ns.vcard("fn"),"[".concat(this.group.value,"]"))),this.element.innerHTML="",this.element.appendChild(container),this}}]),Group}(),GroupBuilder=exports.GroupBuilder=function(){function GroupBuilder(element,book,group,doneBuildingCb,groupChangedCb){(0,_classCallCheck2.default)(this,GroupBuilder),this.element=element,this.book=book,this.group=group,this.onGroupChanged=function(err,changeType,agent){groupChangedCb&&groupChangedCb(err,changeType,agent)},this.groupChangedCb=groupChangedCb,this.doneBuildingCb=doneBuildingCb}return(0,_createClass2.default)(GroupBuilder,[{key:"refresh",value:function refresh(){}},{key:"render",value:function render(){var _this5=this,dropContainer=document.createElement("div");dropContainer.style.maxWidth="350px",dropContainer.style.minHeight="200px",dropContainer.style.outline="1px solid black",dropContainer.style.display="flex",dropContainer.style.flexDirection="column",(0,_dragAndDrop.makeDropTarget)(dropContainer,(function(uris){uris.forEach((function(uri){_this5.add(uri).catch((function(err){_this5.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("Could not add the given WebId. (".concat(err,")"))))}))}))}));var groupNameInput=document.createElement("input");groupNameInput.type="text",groupNameInput.value=getWithDefault(this.group,ns.vcard("fn"),"Untitled Group"),groupNameInput.addEventListener("change",(function(event){_this5.setGroupName(event.target.value).catch((function(err){_this5.element.appendChild((0,_error.errorMessageBlock)(document,"Error changing group name. (".concat(err,")")))}))}));var groupNameLabel=document.createElement("label");if(groupNameLabel.textContent=(0,_escapeHtml.default)("Group Name:"),groupNameLabel.appendChild(groupNameInput),dropContainer.appendChild(groupNameLabel),kb.any(this.group,ns.vcard("hasMember")))kb.match(this.group,ns.vcard("hasMember")).forEach((function(statement){var webIdNode=statement.object,personDiv=document.createElement("div");new Person(personDiv,webIdNode,_this5.handleRemove(webIdNode)).render(),dropContainer.appendChild(personDiv)}));else{var copy=document.createElement("p");copy.textContent=(0,_escapeHtml.default)(_templateObject||(_templateObject=(0,_taggedTemplateLiteral2.default)(["\n To add someone to this group, drag and drop their WebID URL onto the box.\n "]))),dropContainer.appendChild(copy)}var doneBuildingButton=document.createElement("button");return doneBuildingButton.textContent=(0,_escapeHtml.default)("Done"),doneBuildingButton.addEventListener("click",(function(_event){_this5.doneBuildingCb(_this5.group)})),dropContainer.appendChild(doneBuildingButton),this.element.innerHTML="",this.element.appendChild(dropContainer),this}},{key:"add",value:function add(webId){var _this6=this;return new Promise((function(resolve,reject){kb.fetcher.nowOrWhenFetched(webId,(function(ok,err){if(!ok)return _this6.onGroupChanged(err),reject(err);var webIdNode=rdf.namedNode(webId),rdfClass=kb.any(webIdNode,ns.rdf("type"));return rdfClass&&rdfClass.equals(ns.foaf("Person"))?resolve(webIdNode):reject(new Error("Only people supported right now. (tried to add something of type ".concat(rdfClass.value,")")))}))})).then((function(webIdNode){var statement=rdf.st(_this6.group,ns.vcard("hasMember"),webIdNode);return kb.holdsStatement(statement)?webIdNode:patch(_this6.group.doc().uri,{toIns:[statement]}).then((function(){statement.why=_this6.group.doc(),kb.add(statement),_this6.onGroupChanged(null,"added",webIdNode),_this6.render()}))}))}},{key:"handleRemove",value:function handleRemove(webIdNode){var _this7=this;return function(_event){var statement=rdf.st(_this7.group,ns.vcard("hasMember"),webIdNode);return patch(_this7.group.doc().uri,{toDel:[statement]}).then((function(){return kb.remove(statement),_this7.onGroupChanged(null,"removed",webIdNode),_this7.render(),!0})).catch((function(err){var name=kb.any(webIdNode,ns.foaf("name")),errorMessage=name&&name.value?"Could not remove ".concat(name.value,". (").concat(err,")"):"Could not remove ".concat(webIdNode.value,". (").concat(err,")");throw new Error(errorMessage)}))}}},{key:"setGroupName",value:function setGroupName(name){var _this8=this,groupIndex=indexes(this.book).groupIndex,updatePromises=[this.group.doc(),groupIndex].map((function(namedGraph){var oldNameStatements=kb.match(_this8.group,ns.vcard("fn"),null,namedGraph),newNameStatement=rdf.st(_this8.group,ns.vcard("fn"),rdf.literal(name));return patch(namedGraph.value,{toDel:oldNameStatements,toIns:[newNameStatement]}).then((function(_solidResponse){kb.removeStatements(oldNameStatements),newNameStatement.why=namedGraph,kb.add(newNameStatement)}))}));return Promise.all(updatePromises)}}]),GroupBuilder}(),Person=exports.Person=function(){function Person(element,webIdNode,handleRemove){(0,_classCallCheck2.default)(this,Person),this.webIdNode=webIdNode,this.element=element,this.handleRemove=handleRemove}return(0,_createClass2.default)(Person,[{key:"render",value:function render(){var _this9=this,container=document.createElement("div");container.style.display="flex";var imgSrc=getWithDefault(this.webIdNode,ns.foaf("img"),_iconBase.iconBase+"noun_15059.svg"),profileImg=document.createElement("img");profileImg.src=(0,_escapeHtml.default)(imgSrc),profileImg.width="50",profileImg.height="50",profileImg.style.margin="5px";var name=getWithDefault(this.webIdNode,ns.foaf("name"),"[".concat(this.webIdNode,"]")),nameSpan=document.createElement("span");nameSpan.innerHTML=(0,_escapeHtml.default)(name),nameSpan.style.flexGrow="1",nameSpan.style.margin="auto 0";var removeButton=document.createElement("button");return removeButton.textContent="Remove",removeButton.addEventListener("click",(function(_event){return _this9.handleRemove().catch((function(err){_this9.element.appendChild((0,_error.errorMessageBlock)(document,(0,_escapeHtml.default)("".concat(err))))}))})),removeButton.style.margin="5px",container.appendChild(profileImg),container.appendChild(nameSpan),container.appendChild(removeButton),this.element.innerHTML="",this.element.appendChild(container),this}}]),Person}();function getWithDefault(subject,predicate,defaultValue){var object=kb.any(subject,predicate);return object?object.value:defaultValue}function patch(url,_ref3){var toDel=_ref3.toDel,toIns=_ref3.toIns;return new Promise((function(resolve,reject){kb.updater.update(toDel,toIns,(function(uri,success,errorMessage){if(!success)return reject(new Error("PATCH failed for resource <".concat(uri,">: ").concat(errorMessage)));resolve()}))}))}function indexes(book){return{groupIndex:kb.any(book,ns.vcard("groupIndex")),groupContainer:kb.sym(book.dir().uri+"Group/")}}},"./lib/widgets/widgetHelpers.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrapDivInATR=exports.createImageDiv=exports.addClickListenerToElement=void 0;var _style=__webpack_require__("./lib/style.js");exports.wrapDivInATR=function wrapDivInATR(dom,div,obj){var tr=dom.createElement("tr");return tr.appendChild(dom.createElement("td")).appendChild(div),tr.subject=obj,tr},exports.addClickListenerToElement=function addClickListenerToElement(div,onClickFunction){div.addEventListener("click",onClickFunction)},exports.createImageDiv=function createImageDiv(dom,div,image){var imageDiv=div.appendChild(dom.createElement("div"));imageDiv.setAttribute("style",_style.imageDivStyle),imageDiv.appendChild(image),image.setAttribute("draggable","false")}},"./src/stories/decorators.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{b:()=>rawJsonDecorator});var rawJsonDecorator=function rawJsonDecorator(Story){return"
                                                          "+JSON.stringify(Story(),null,2)+"
                                                          "}},"./storybook-init-framework-entry.js":(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__("./node_modules/@storybook/html/dist/esm/client/index.js")},"./src/stories/Buttons.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,buttonWithIcon:()=>buttonWithIcon,cancelButton:()=>cancelButton,continueButton:()=>continueButton,default:()=>__WEBPACK_DEFAULT_EXPORT__,deleteButton:()=>deleteButton,fileUploadButton:()=>fileUploadButton,linkButton:()=>linkButton,linkCustomIcon:()=>linkCustomIcon,linkIcon:()=>linkIcon,primary:()=>primary,primaryNeedsBorder:()=>primaryNeedsBorder,removeButton:()=>removeButton,secondary:()=>secondary,secondaryNeedsBorder:()=>secondaryNeedsBorder});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Buttons",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"button-with-text-no-border"},"Button with text (no border)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Primary",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Primary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Secondary",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary"}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"button-with-text-needs-border"},"Button with text (needs border)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Primary (needs border)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{needsBorder:!0})),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Secondary (needs border)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary",needsBorder:!0}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"continue--cancel-button"},"Continue & Cancel button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Continue button",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.continueButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Cancel button",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.cancelButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"delete-button"},"Delete button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Delete button",mdxType:"Story"},(function(){var div=document.createElement("div");_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.deleteButtonWithCheck(document,div,"something",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("deleted"));return div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"button-with-icon"},"Button with icon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Button with icon",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,"https://solidproject.org/assets/img/solid-emblem.svg","test",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked!")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"file-upload-button"},"File upload button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"File upload button",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.fileUploadButtonDiv(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("uploaded")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"link-button"},"Link button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Link button",mdxType:"Story"},(function(){return document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkButton(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"link-icon"},"Link icon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Link icon",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Link custom icon",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"),"https://solidproject.org/favicon.ico"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"remove-button"},"Remove button"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Remove button",mdxType:"Story"},(function(){var div=document.createElement("div"),p=document.createElement("p");p.appendChild(document.createTextNode("click x to remove me"));var button=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.removeButton(document,p);return div.appendChild(p),div.appendChild(button),div}))))}MDXContent.isMDXComponent=!0;var primary=function primary(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Primary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))};primary.storyName="Primary",primary.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Primary", action("clicked"))'}};var secondary=function secondary(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary"})};secondary.storyName="Secondary",secondary.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Secondary", action("clicked"), {\n buttonColor: "Secondary"\n})'}};var primaryNeedsBorder=function primaryNeedsBorder(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{needsBorder:!0})};primaryNeedsBorder.storyName="Primary (needs border)",primaryNeedsBorder.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Secondary", action("clicked"), {\n needsBorder: true\n})'}};var secondaryNeedsBorder=function secondaryNeedsBorder(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,void 0,"Secondary",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"),{buttonColor:"Secondary",needsBorder:!0})};secondaryNeedsBorder.storyName="Secondary (needs border)",secondaryNeedsBorder.parameters={storySource:{source:'UI.widgets.button(document, undefined, "Secondary", action("clicked"), {\n buttonColor: "Secondary",\n needsBorder: true\n})'}};var continueButton=function continueButton(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.continueButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))};continueButton.storyName="Continue button",continueButton.parameters={storySource:{source:'UI.widgets.continueButton(document, action("clicked"))'}};var cancelButton=function cancelButton(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.cancelButton(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked"))};cancelButton.storyName="Cancel button",cancelButton.parameters={storySource:{source:'UI.widgets.cancelButton(document, action("clicked"))'}};var deleteButton=function deleteButton(){var div=document.createElement("div");_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.deleteButtonWithCheck(document,div,"something",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("deleted"));return div};deleteButton.storyName="Delete button",deleteButton.parameters={storySource:{source:"() => {\n const div = document.createElement(\"div\");\n const result = UI.widgets.deleteButtonWithCheck(document, div, 'something', action('deleted'));\n return div;\n}"}};var buttonWithIcon=function buttonWithIcon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.button(document,"https://solidproject.org/assets/img/solid-emblem.svg","test",(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("clicked!"))};buttonWithIcon.storyName="Button with icon",buttonWithIcon.parameters={storySource:{source:"UI.widgets.button(document, 'https://solidproject.org/assets/img/solid-emblem.svg', 'test', action('clicked!'))"}};var fileUploadButton=function fileUploadButton(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.fileUploadButtonDiv(document,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("uploaded"))};fileUploadButton.storyName="File upload button",fileUploadButton.parameters={storySource:{source:"UI.widgets.fileUploadButtonDiv(document, action('uploaded'))"}};var linkButton=function linkButton(){return document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkButton(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/"))};linkButton.storyName="Link button",linkButton.parameters={storySource:{source:"() => {\n document.outlineManager = {\n GotoSubject: action('go to subject')\n };\n return UI.widgets.linkButton(document, UI.rdf.namedNode('http://example.com/'));\n}"}};var linkIcon=function linkIcon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"))};linkIcon.storyName="Link icon",linkIcon.parameters={storySource:{source:"UI.widgets.linkIcon(document, UI.rdf.namedNode('https://solidproject.org/'))"}};var linkCustomIcon=function linkCustomIcon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.linkIcon(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/"),"https://solidproject.org/favicon.ico")};linkCustomIcon.storyName="Link custom icon",linkCustomIcon.parameters={storySource:{source:"UI.widgets.linkIcon(document, UI.rdf.namedNode('https://solidproject.org/'), 'https://solidproject.org/favicon.ico')"}};var removeButton=function removeButton(){var div=document.createElement("div"),p=document.createElement("p");p.appendChild(document.createTextNode("click x to remove me"));var button=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.removeButton(document,p);return div.appendChild(p),div.appendChild(button),div};removeButton.storyName="Remove button",removeButton.parameters={storySource:{source:"() => {\n const div = document.createElement('div');\n const p = document.createElement('p');\n p.appendChild(document.createTextNode('click x to remove me'));\n const button = UI.widgets.removeButton(document, p);\n div.appendChild(p);\n div.appendChild(button);\n return div;\n}"}};var componentMeta={title:"Buttons",includeStories:["primary","secondary","primaryNeedsBorder","secondaryNeedsBorder","continueButton","cancelButton","deleteButton","buttonWithIcon","fileUploadButton","linkButton","linkIcon","linkCustomIcon","removeButton"]},mdxStoryNameToKey={Primary:"primary",Secondary:"secondary","Primary (needs border)":"primaryNeedsBorder","Secondary (needs border)":"secondaryNeedsBorder","Continue button":"continueButton","Cancel button":"cancelButton","Delete button":"deleteButton","Button with icon":"buttonWithIcon","File upload button":"fileUploadButton","Link button":"linkButton","Link icon":"linkIcon","Link custom icon":"linkCustomIcon","Remove button":"removeButton"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["primary","secondary","primaryNeedsBorder","secondaryNeedsBorder","continueButton","cancelButton","deleteButton","buttonWithIcon","fileUploadButton","linkButton","linkIcon","linkCustomIcon","removeButton"]},"./src/stories/DateTime.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,formatDateTime:()=>formatDateTime,formatDateTimeDate:()=>formatDateTimeDate,formatDateTimeTime:()=>formatDateTimeTime,shortDateNotTodayWithoutTime:()=>shortDateNotTodayWithoutTime,shortDateTodayWithTime:()=>shortDateTodayWithTime,shortDateTodayWithoutTime:()=>shortDateTodayWithoutTime,shortDateWithTimeButNotToday:()=>shortDateWithTimeButNotToday,shortTime:()=>shortTime,timestamp:()=>timestamp});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-iso-string.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.h_,{title:"Date & Time",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"formatdatetime"},"formatDateTime"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#formatdatetime",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"formatDateTime",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"formatDateTime date",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Date}.{Month}.{Year}"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"formatDateTime time",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Hours}:{Minutes}:{Seconds}"))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"shortdate"},"shortDate"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"By default, converts e.g. '2020-02-19T19:35:28.557Z' to '19:35' if today is 19 Feb 2020, and to 'Feb 19' if not."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#shortdate",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (not today & without time)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!0))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (with time, but not today)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!1))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (today & without time)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!0))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortDate (today & with time)",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!1))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"shorttime"},"shortTime"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Get a short string representation of the current time"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#shorttime",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"shortTime",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortTime())),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"timestamp"},"timestamp"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Get a string representation of the current time"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#timestamp",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"timestamp",mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.timestamp())))}MDXContent.isMDXComponent=!0;var formatDateTime=function formatDateTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}")};formatDateTime.storyName="formatDateTime",formatDateTime.parameters={storySource:{source:'UI.widgets.formatDateTime(new Date(), "{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}")'}};var formatDateTimeDate=function formatDateTimeDate(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Date}.{Month}.{Year}")};formatDateTimeDate.storyName="formatDateTime date",formatDateTimeDate.parameters={storySource:{source:'UI.widgets.formatDateTime(new Date(), "{Date}.{Month}.{Year}")'}};var formatDateTimeTime=function formatDateTimeTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.formatDateTime(new Date,"{Hours}:{Minutes}:{Seconds}")};formatDateTimeTime.storyName="formatDateTime time",formatDateTimeTime.parameters={storySource:{source:'UI.widgets.formatDateTime(new Date(), "{Hours}:{Minutes}:{Seconds}")'}};var shortDateNotTodayWithoutTime=function shortDateNotTodayWithoutTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!0)};shortDateNotTodayWithoutTime.storyName="shortDate (not today & without time)",shortDateNotTodayWithoutTime.parameters={storySource:{source:'UI.widgets.shortDate("2020-01-01T15:43", true)'}};var shortDateWithTimeButNotToday=function shortDateWithTimeButNotToday(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate("2020-01-01T15:43",!1)};shortDateWithTimeButNotToday.storyName="shortDate (with time, but not today)",shortDateWithTimeButNotToday.parameters={storySource:{source:'UI.widgets.shortDate("2020-01-01T15:43", false)'}};var shortDateTodayWithoutTime=function shortDateTodayWithoutTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!0)};shortDateTodayWithoutTime.storyName="shortDate (today & without time)",shortDateTodayWithoutTime.parameters={storySource:{source:"UI.widgets.shortDate(new Date().toISOString(), true)"}};var shortDateTodayWithTime=function shortDateTodayWithTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortDate((new Date).toISOString(),!1)};shortDateTodayWithTime.storyName="shortDate (today & with time)",shortDateTodayWithTime.parameters={storySource:{source:"UI.widgets.shortDate(new Date().toISOString(), false)"}};var shortTime=function shortTime(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.shortTime()};shortTime.storyName="shortTime",shortTime.parameters={storySource:{source:"UI.widgets.shortTime()"}};var timestamp=function timestamp(){return _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.timestamp()};timestamp.storyName="timestamp",timestamp.parameters={storySource:{source:"UI.widgets.timestamp()"}};var componentMeta={title:"Date & Time",includeStories:["formatDateTime","formatDateTimeDate","formatDateTimeTime","shortDateNotTodayWithoutTime","shortDateWithTimeButNotToday","shortDateTodayWithoutTime","shortDateTodayWithTime","shortTime","timestamp"]},mdxStoryNameToKey={formatDateTime:"formatDateTime","formatDateTime date":"formatDateTimeDate","formatDateTime time":"formatDateTimeTime","shortDate (not today & without time)":"shortDateNotTodayWithoutTime","shortDate (with time, but not today)":"shortDateWithTimeButNotToday","shortDate (today & without time)":"shortDateTodayWithoutTime","shortDate (today & with time)":"shortDateTodayWithTime",shortTime:"shortTime",timestamp:"timestamp"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["formatDateTime","formatDateTimeDate","formatDateTimeTime","shortDateNotTodayWithoutTime","shortDateWithTimeButNotToday","shortDateTodayWithoutTime","shortDateTodayWithTime","shortTime","timestamp"]},"./src/stories/Display.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,complain:()=>complain,default:()=>__WEBPACK_DEFAULT_EXPORT__,errorMessageBlock:()=>errorMessageBlock,setName:()=>setName});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Display",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"complain"},"complain"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#complain",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"complain",mdxType:"Story"},(function(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.complain({div,dom:document},"not good!"),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"errormessageblock"},"errorMessageBlock"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_error_.html#errormessageblock",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"errorMessageBlock",mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.errorMessageBlock(document,"my error message","#f0f")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"setname"},"setName"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Sets the best name we have and looks up a better one"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#setname",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"setName",mdxType:"Story"},(function(){var div=document.createElement("div"),jane=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://jane.example/person/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(jane,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("name"),"Jane Doe"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setName(div,jane),div}))))}MDXContent.isMDXComponent=!0;var complain=function complain(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.complain({div,dom:document},"not good!"),div};complain.storyName="complain",complain.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n UI.widgets.complain({\n div,\n dom: document\n }, "not good!");\n return div;\n}'}};var errorMessageBlock=function errorMessageBlock(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.errorMessageBlock(document,"my error message","#f0f")};errorMessageBlock.storyName="errorMessageBlock",errorMessageBlock.parameters={storySource:{source:'() => {\n return UI.widgets.errorMessageBlock(document, "my error message", "#f0f");\n}'}};var setName=function setName(){var div=document.createElement("div"),jane=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://jane.example/person/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(jane,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("name"),"Jane Doe"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setName(div,jane),div};setName.storyName="setName",setName.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n const jane = UI.rdf.namedNode("https://jane.example/person/card#me");\n UI.store.add(jane, UI.ns.foaf("name"), "Jane Doe");\n UI.widgets.setName(div, jane);\n return div;\n}'}};var componentMeta={title:"Display",includeStories:["complain","errorMessageBlock","setName"]},mdxStoryNameToKey={complain:"complain",errorMessageBlock:"errorMessageBlock",setName:"setName"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["complain","errorMessageBlock","setName"]},"./src/stories/DomManipulation.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,addStyleSheet:()=>addStyleSheet,clearElement:()=>clearElement,default:()=>__WEBPACK_DEFAULT_EXPORT__,refreshTree:()=>refreshTree});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.h_,{title:"DOM manipulation",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"addstylesheet"},"addStyleSheet"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Stick a stylesheet link the document if not already there"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#addstylesheet",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"addStyleSheet",withSource:"open",decorators:[function(Story){Story();var html=document.querySelector("link").outerHTML,pre=document.createElement("pre"),text=document.createTextNode(html);return pre.appendChild(text),pre}],mdxType:"Story"},(function(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.addStyleSheet(document,"https://linkeddata.github.io/tabulator-firefox/content/tabbedtab.css")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"clearelement"},"clearElement"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Remove all the children of an HTML element"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#clearelement",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"clearElement",mdxType:"Story"},(function(){var counter=0,div=document.createElement("p");return setInterval((function(){if(counter++%2==0){var text=document.createTextNode("Now you see me");div.appendChild(text)}else _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.clearElement(div)}),1e3),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"refreshtree"},"refreshTree"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Refresh a DOM tree recursively"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#refreshtree",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"refreshTree",mdxType:"Story"},(function(){setInterval((function(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.refreshTree(document.body)}),1e3);var refreshable=document.createElement("p");return refreshable.refresh=function(){refreshable.innerText=(new Date).getTime()},refreshable}))))}MDXContent.isMDXComponent=!0;var addStyleSheet=function addStyleSheet(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.addStyleSheet(document,"https://linkeddata.github.io/tabulator-firefox/content/tabbedtab.css")};addStyleSheet.storyName="addStyleSheet",addStyleSheet.parameters={storySource:{source:'() => {\n UI.widgets.addStyleSheet(document, "https://linkeddata.github.io/tabulator-firefox/content/tabbedtab.css");\n}'}},addStyleSheet.decorators=[function(Story){Story();var html=document.querySelector("link").outerHTML,pre=document.createElement("pre"),text=document.createTextNode(html);return pre.appendChild(text),pre}];var clearElement=function clearElement(){var counter=0,div=document.createElement("p");return setInterval((function(){if(counter++%2==0){var text=document.createTextNode("Now you see me");div.appendChild(text)}else _lib__WEBPACK_IMPORTED_MODULE_9__.widgets.clearElement(div)}),1e3),div};clearElement.storyName="clearElement",clearElement.parameters={storySource:{source:'() => {\n let counter = 0;\n const div = document.createElement("p");\n setInterval(() => {\n if (counter++ % 2 === 0) {\n const text = document.createTextNode("Now you see me");\n div.appendChild(text);\n } else {\n UI.widgets.clearElement(div);\n }\n }, 1000);\n return div;\n}'}};var refreshTree=function refreshTree(){setInterval((function(){_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.refreshTree(document.body)}),1e3);var refreshable=document.createElement("p");return refreshable.refresh=function(){refreshable.innerText=(new Date).getTime()},refreshable};refreshTree.storyName="refreshTree",refreshTree.parameters={storySource:{source:'() => {\n setInterval(() => {\n UI.widgets.refreshTree(document.body);\n }, 1000);\n const refreshable = document.createElement("p");\n refreshable.refresh = () => {\n refreshable.innerText = new Date().getTime();\n };\n return refreshable;\n}'}};var componentMeta={title:"DOM manipulation",includeStories:["addStyleSheet","clearElement","refreshTree"]},mdxStoryNameToKey={addStyleSheet:"addStyleSheet",clearElement:"clearElement",refreshTree:"refreshTree"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["addStyleSheet","clearElement","refreshTree"]},"./src/stories/DragAndDrop.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,draggable:()=>draggable,dropTarget:()=>dropTarget,uploadFiles:()=>uploadFiles});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Drag & Drop",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"drag--drop"},"Drag & Drop"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"DragAndDrop has three functions that can be used to handle dragging and dropping of uris, files, and images."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"makeDraggable")," is used to make an element Draggable. Along with the HTML Element, it is also necessary to pass an\nobject with a uri. This is used to set the data on the EventListener for 'dragstart'."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"makeDropTarget")," is used to make an element enabled as a drop target. Along with the HTML Element, it is also\nnecessary to pass in two callback functions; one to handle draggable uris and the other to handle draggable files and images."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"uploadFiles")," is used to process the files that a user is uploading."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,'Drag the message from the "Draggable" story or drag any file or image and drop it on the element in the "Drop Target" story to see it\nwork.'),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Draggable",mdxType:"Story"},(function(){var dragElement=document.createElement("div");dragElement.appendChild(document.createTextNode("Drag me to the target!"));var uri=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://exampleuser.inrupt.net");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDraggable(dragElement,uri),dragElement}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Drop Target",mdxType:"Story"},(function(){var target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop things (URIs, files, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped file")),target}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"uploadfiles"},"uploadFiles"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"The function ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"uploadFiles")," could for example be used in the droppedFileHandler function which is passed to the\nmakeDropTarget function."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Upload Files",args:{fileBase:"https://pod.example/Files",pictureBase:"https://pod.example/Pictures"},mdxType:"Story"},(function(_ref2){var fileBase=_ref2.fileBase,pictureBase=_ref2.pictureBase,target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop a file (document, picture, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(function(files){_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.uploadFiles(_lib__WEBPACK_IMPORTED_MODULE_7__.store.fetcher,files,fileBase,pictureBase,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("file uploaded successfully"))})),target}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.xP,{story:"Upload Files",mdxType:"Props"}))}MDXContent.isMDXComponent=!0;var draggable=function draggable(){var dragElement=document.createElement("div");dragElement.appendChild(document.createTextNode("Drag me to the target!"));var uri=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://exampleuser.inrupt.net");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDraggable(dragElement,uri),dragElement};draggable.storyName="Draggable",draggable.parameters={storySource:{source:'() => {\n const dragElement = document.createElement("div");\n dragElement.appendChild(document.createTextNode("Drag me to the target!"));\n const uri = new UI.rdf.NamedNode(\'https://exampleuser.inrupt.net\');\n UI.widgets.makeDraggable(dragElement, uri);\n return dragElement;\n}'}};var dropTarget=function dropTarget(){var target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop things (URIs, files, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped file")),target};dropTarget.storyName="Drop Target",dropTarget.parameters={storySource:{source:'() => {\n const target = document.createElement("div");\n target.style = "padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px";\n target.appendChild(document.createTextNode("Drop things (URIs, files, ...) here"));\n UI.widgets.makeDropTarget(target, action(\'dropped uri\'), action(\'dropped file\'));\n return target;\n}'}};var uploadFiles=function uploadFiles(_ref3){var fileBase=_ref3.fileBase,pictureBase=_ref3.pictureBase,target=document.createElement("div");return target.style="padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px",target.appendChild(document.createTextNode("Drop a file (document, picture, ...) here")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.makeDropTarget(target,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("dropped uri"),(function(files){_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.uploadFiles(_lib__WEBPACK_IMPORTED_MODULE_7__.store.fetcher,files,fileBase,pictureBase,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("file uploaded successfully"))})),target};uploadFiles.storyName="Upload Files",uploadFiles.args={fileBase:"https://pod.example/Files",pictureBase:"https://pod.example/Pictures"},uploadFiles.parameters={storySource:{source:'({\n fileBase,\n pictureBase\n}) => {\n const target = document.createElement("div");\n target.style = "padding: 1em; text-align:center; border: 1px solid black; width: 100px; height: 100px";\n target.appendChild(document.createTextNode("Drop a file (document, picture, ...) here"));\n UI.widgets.makeDropTarget(target, action(\'dropped uri\'), files => {\n UI.widgets.uploadFiles(UI.store.fetcher, files, fileBase, pictureBase, action(\'file uploaded successfully\'));\n });\n return target;\n}'}};var componentMeta={title:"Drag & Drop",includeStories:["draggable","dropTarget","uploadFiles"]},mdxStoryNameToKey={Draggable:"draggable","Drop Target":"dropTarget","Upload Files":"uploadFiles"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["draggable","dropTarget","uploadFiles"]},"./src/stories/Events.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,openHrefInOutlineMode:()=>openHrefInOutlineMode});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Events",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"openhrefinoutlinemode"},"openHrefInOutlineMode"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Event Handler for links within solid apps."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#openhrefinoutlinemode",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"openHrefInOutlineMode",mdxType:"Story"},(function(){document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")};var anchor=document.createElement("a");return anchor.setAttribute("href","http://example.com"),anchor.onclick=function(e){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.openHrefInOutlineMode(e),!1},anchor.appendChild(document.createTextNode("click me")),anchor}))))}MDXContent.isMDXComponent=!0;var openHrefInOutlineMode=function openHrefInOutlineMode(){document.outlineManager={GotoSubject:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("go to subject")};var anchor=document.createElement("a");return anchor.setAttribute("href","http://example.com"),anchor.onclick=function(e){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.openHrefInOutlineMode(e),!1},anchor.appendChild(document.createTextNode("click me")),anchor};openHrefInOutlineMode.storyName="openHrefInOutlineMode",openHrefInOutlineMode.parameters={storySource:{source:'() => {\n document.outlineManager = {\n GotoSubject: action("go to subject")\n };\n const anchor = document.createElement("a");\n anchor.setAttribute("href", "http://example.com");\n anchor.onclick = e => {\n UI.widgets.openHrefInOutlineMode(e);\n return false;\n };\n anchor.appendChild(document.createTextNode("click me"));\n return anchor;\n}'}};var componentMeta={title:"Events",includeStories:["openHrefInOutlineMode"]},mdxStoryNameToKey={openHrefInOutlineMode:"openHrefInOutlineMode"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["openHrefInOutlineMode"]},"./src/stories/Header.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,header:()=>header,headerDecorator:()=>headerDecorator});__webpack_require__("./node_modules/core-js/modules/web.timers.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var headerDecorator=function headerDecorator(Story){return setTimeout((function(){return Story()}),1),'
                                                          The above div with ID "PageHeader" is replaced by the header component
                                                          '},layoutProps={headerDecorator};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Header",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"header"},"Header"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("div",{id:"PageHeader"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"To experience the full behaviour of the header, you need to log in. This can be done at\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"http://solidos.github.io/solid-ui/examples/header",target:"_blank",rel:"nofollow noopener noreferrer"},"the example page"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"header",decorators:[headerDecorator],mdxType:"Story"},(function(){_lib__WEBPACK_IMPORTED_MODULE_8__.initHeader(_lib__WEBPACK_IMPORTED_MODULE_8__.store,{})}))))}MDXContent.isMDXComponent=!0;var header=function header(){_lib__WEBPACK_IMPORTED_MODULE_8__.initHeader(_lib__WEBPACK_IMPORTED_MODULE_8__.store,{})};header.storyName="header",header.parameters={storySource:{source:"() => {\n const options = {};\n UI.initHeader(UI.store, options);\n}"}},header.decorators=[headerDecorator];var componentMeta={title:"Header",includeStories:["header"]},mdxStoryNameToKey={header:"header"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["headerDecorator","header"]},"./src/stories/Images.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,eMail:()=>eMail,favicon:()=>favicon,forFoafAgent:()=>forFoafAgent,forRdfResource:()=>forRdfResource,imageDecorator:()=>imageDecorator,imagesOf:()=>imagesOf,messageId:()=>messageId,setImage:()=>setImage,withFoafImg:()=>withFoafImg,withVcardHasPhoto:()=>withVcardHasPhoto,withoutFavicon:()=>withoutFavicon});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_decorators__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/stories/decorators.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var imageDecorator=function imageDecorator(Story){var result=Story();return"\n
                                                          Returns:
                                                          \n
                                                          "+result+'
                                                          \n

                                                          Preview:

                                                          \n \n'},layoutProps={imageDecorator};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Images",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"findimage"},"findImage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Find something we have as explicit image data for the thing"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#findimage",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"for-foafagent"},"for foaf:Agent"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"for foaf:Agent",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Agent")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"for-rdfresource"},"for rdf:Resource"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"for rdf:Resource",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("Resource")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"with-vcardhasphoto"},"with vcard:hasPhoto"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"with vcard:hasPhoto",decorators:[imageDecorator],mdxType:"Story"},(function(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/1#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.vcard("hasPhoto"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"with-foafimg"},"with foaf:img"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"with foaf:img",decorators:[imageDecorator],mdxType:"Story"},(function(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/2#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"findimagefromuri"},"findImageFromURI"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Find an image for this thing as a class"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#findimagefromuri",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"without-favicon"},"without favicon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"without favicon",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example.com/")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"favicon"},"favicon"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"favicon",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/some/file.html")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"message-id-mid"},"Message-ID (mid:)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Message-ID",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mid:example")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"e-mail-mailto"},"E-Mail (mailto:)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"E-Mail",decorators:[imageDecorator],mdxType:"Story"},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mailto:user@mail.example")))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h3",{id:"imagesof"},"imagesOf"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Set of suitable images"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#imagesof",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"imagesOf",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://thing.example/resource#it"),avatar=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image1.png"),image=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image2.jpg");return store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.sioc("avatar"),avatar),store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),image),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.imagesOf(thing,store)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"setimage"},"setImage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#setimage",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"setImage",mdxType:"Story"},(function(){var myTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(myTrip,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.trip("Trip"));var img=document.createElement("img");return img.setAttribute("style","height:50px;width:50px;"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setImage(img,myTrip),img}))))}MDXContent.isMDXComponent=!0;var forFoafAgent=function forFoafAgent(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Agent"))};forFoafAgent.storyName="for foaf:Agent",forFoafAgent.parameters={storySource:{source:'UI.widgets.findImage(UI.ns.foaf("Agent"))'}},forFoafAgent.decorators=[imageDecorator];var forRdfResource=function forRdfResource(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("Resource"))};forRdfResource.storyName="for rdf:Resource",forRdfResource.parameters={storySource:{source:'UI.widgets.findImage(UI.ns.rdf("Resource"))'}},forRdfResource.decorators=[imageDecorator];var withVcardHasPhoto=function withVcardHasPhoto(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/1#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.vcard("hasPhoto"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)};withVcardHasPhoto.storyName="with vcard:hasPhoto",withVcardHasPhoto.parameters={storySource:{source:'() => {\n const person = UI.rdf.namedNode("https://person.example/1#me");\n const photo = UI.rdf.namedNode("https://michielbdejong.com/img/me.jpg");\n UI.store.add(person, UI.ns.vcard("hasPhoto"), photo);\n return UI.widgets.findImage(person);\n}'}},withVcardHasPhoto.decorators=[imageDecorator];var withFoafImg=function withFoafImg(){var person=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://person.example/2#me"),photo=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.com/img/me.jpg");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(person,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),photo),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImage(person)};withFoafImg.storyName="with foaf:img",withFoafImg.parameters={storySource:{source:'() => {\n const person = UI.rdf.namedNode("https://person.example/2#me");\n const photo = UI.rdf.namedNode("https://michielbdejong.com/img/me.jpg");\n UI.store.add(person, UI.ns.foaf("img"), photo);\n return UI.widgets.findImage(person);\n}'}},withFoafImg.decorators=[imageDecorator];var withoutFavicon=function withoutFavicon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example.com/"))};withoutFavicon.storyName="without favicon",withoutFavicon.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("https://example.com/"))'}},withoutFavicon.decorators=[imageDecorator];var favicon=function favicon(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://solidproject.org/some/file.html"))};favicon.storyName="favicon",favicon.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("https://solidproject.org/some/file.html"))'}},favicon.decorators=[imageDecorator];var messageId=function messageId(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mid:example"))};messageId.storyName="Message-ID",messageId.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("mid:example"))'}},messageId.decorators=[imageDecorator];var eMail=function eMail(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.findImageFromURI(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("mailto:user@mail.example"))};eMail.storyName="E-Mail",eMail.parameters={storySource:{source:'UI.widgets.findImageFromURI(UI.rdf.namedNode("mailto:user@mail.example"))'}},eMail.decorators=[imageDecorator];var imagesOf=function imagesOf(){var store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://thing.example/resource#it"),avatar=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image1.png"),image=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://pod.example/image2.jpg");return store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.sioc("avatar"),avatar),store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("img"),image),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.imagesOf(thing,store)};imagesOf.storyName="imagesOf",imagesOf.parameters={storySource:{source:'() => {\n const store = UI.rdf.graph();\n const thing = UI.rdf.namedNode("http://thing.example/resource#it");\n const avatar = UI.rdf.namedNode("https://pod.example/image1.png");\n const image = UI.rdf.namedNode("https://pod.example/image2.jpg");\n store.add(thing, UI.ns.sioc("avatar"), avatar);\n store.add(thing, UI.ns.foaf("img"), image);\n return UI.widgets.imagesOf(thing, store);\n}'}},imagesOf.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var setImage=function setImage(){var myTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(myTrip,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.trip("Trip"));var img=document.createElement("img");return img.setAttribute("style","height:50px;width:50px;"),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.setImage(img,myTrip),img};setImage.storyName="setImage",setImage.parameters={storySource:{source:'() => {\n const myTrip = UI.rdf.namedNode("http://example.com/#trip");\n UI.store.add(myTrip, UI.ns.rdf("type"), UI.ns.trip("Trip"));\n const img = document.createElement("img");\n img.setAttribute("style", "height:50px;width:50px;");\n UI.widgets.setImage(img, myTrip);\n return img;\n}'}};var componentMeta={title:"Images",includeStories:["forFoafAgent","forRdfResource","withVcardHasPhoto","withFoafImg","withoutFavicon","favicon","messageId","eMail","imagesOf","setImage"]},mdxStoryNameToKey={"for foaf:Agent":"forFoafAgent","for rdf:Resource":"forRdfResource","with vcard:hasPhoto":"withVcardHasPhoto","with foaf:img":"withFoafImg","without favicon":"withoutFavicon",favicon:"favicon","Message-ID":"messageId","E-Mail":"eMail",imagesOf:"imagesOf",setImage:"setImage"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["imageDecorator","forFoafAgent","forRdfResource","withVcardHasPhoto","withFoafImg","withoutFavicon","favicon","messageId","eMail","imagesOf","setImage"]},"./src/stories/Interactive.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,askName:()=>askName,attachmentList:()=>attachmentList,default:()=>__WEBPACK_DEFAULT_EXPORT__,personTr:()=>personTr,renderAsDiv:()=>renderAsDiv,selectorPanel:()=>selectorPanel,selectorPanelRefresh:()=>selectorPanelRefresh});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Interactive",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"ask-name"},"Ask name"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#askname",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Ask name",mdxType:"Story"},(function(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.askName(document,_lib__WEBPACK_IMPORTED_MODULE_7__.store,div).then((function(name){return window.alert('You picked "'+name+'"')})),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"attachment-list"},"Attachment list"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Component that displays a list of resources, for instance the attachments of a message, or the various documents related to a meeting.\nAccepts dropping URLs onto it to add attachments to it."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#attachmentlist",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Attachment list",mdxType:"Story"},(function(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.wf("attachment"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-attachment")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.attachmentList(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),div),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"persontr"},"personTR"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"A TR to represent a draggable person, etc in a list"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#persontr",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Person TR",mdxType:"Story"},(function(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.personTR(document,null,michiel)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"renderasdiv"},"renderAsDIV"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"A Div to represent a draggable person, etc in a list"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#persontr",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"Render As DIV",mdxType:"Story"},(function(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.renderAsDiv(document,michiel,{wrapInATR:!0})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"selectorpanel"},"selectorPanel"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#selectorpanel",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"selectorPanel",mdxType:"Story"},(function(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanel(document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"selectorpanelrefresh"},"selectorPanelRefresh"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#selectorpanelrefresh",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"selectorPanelRefresh",mdxType:"Story"},(function(){var list=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanelRefresh(list,document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))}))))}MDXContent.isMDXComponent=!0;var askName=function askName(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.askName(document,_lib__WEBPACK_IMPORTED_MODULE_7__.store,div).then((function(name){return window.alert('You picked "'+name+'"')})),div};askName.storyName="Ask name",askName.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n UI.widgets.askName(document, UI.store, div).then(name => window.alert(`You picked "${name}"`));\n return div;\n}'}};var attachmentList=function attachmentList(){var div=document.createElement("div");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.wf("attachment"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-attachment")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.attachmentList(document,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"),div),div};attachmentList.storyName="Attachment list",attachmentList.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n UI.store.add(UI.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"), UI.ns.wf("attachment"), UI.rdf.namedNode("http://example.com/#some-attachment"));\n UI.widgets.attachmentList(document, UI.rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl" + "#this"), div);\n return div;\n}'}};var personTr=function personTr(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.personTR(document,null,michiel)};personTr.storyName="Person TR",personTr.parameters={storySource:{source:'() => {\n const michiel = UI.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");\n return UI.widgets.personTR(document, null, michiel);\n}'}};var renderAsDiv=function renderAsDiv(){var michiel=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.renderAsDiv(document,michiel,{wrapInATR:!0})};renderAsDiv.storyName="Render As DIV",renderAsDiv.parameters={storySource:{source:'() => {\n const michiel = UI.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");\n const options = {\n wrapInATR: true\n };\n return UI.widgets.renderAsDiv(document, michiel, options);\n}'}};var selectorPanel=function selectorPanel(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanel(document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))};selectorPanel.storyName="selectorPanel",selectorPanel.parameters={storySource:{source:'() => {\n const kb = UI.rdf.graph();\n const type = UI.rdf.namedNode("http://example.com/#type");\n const predicate = UI.rdf.namedNode("http://example.com/#pred");\n const inverse = false;\n const possible = [UI.rdf.namedNode("http://example.com/#blue"), UI.rdf.namedNode("http://example.com/#green"), UI.rdf.namedNode("http://example.com/#yellow")];\n const options = {};\n return UI.widgets.selectorPanel(document, kb, type, predicate, inverse, possible, options, action("selection"), action("link clicked"));\n}'}};var selectorPanelRefresh=function selectorPanelRefresh(){var list=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph(),type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#type"),predicate=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#pred"),possible=[_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#blue"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#green"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#yellow")];return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.selectorPanelRefresh(list,document,kb,type,predicate,!1,possible,{},(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("selection"),(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("link clicked"))};selectorPanelRefresh.storyName="selectorPanelRefresh",selectorPanelRefresh.parameters={storySource:{source:'() => {\n const list = document.createElement("div");\n const kb = UI.rdf.graph();\n const type = UI.rdf.namedNode("http://example.com/#type");\n const predicate = UI.rdf.namedNode("http://example.com/#pred");\n const inverse = false;\n const possible = [UI.rdf.namedNode("http://example.com/#blue"), UI.rdf.namedNode("http://example.com/#green"), UI.rdf.namedNode("http://example.com/#yellow")];\n const options = {};\n return UI.widgets.selectorPanelRefresh(list, document, kb, type, predicate, inverse, possible, options, action("selection"), action("link clicked"));\n}'}};var componentMeta={title:"Interactive",includeStories:["askName","attachmentList","personTr","renderAsDiv","selectorPanel","selectorPanelRefresh"]},mdxStoryNameToKey={"Ask name":"askName","Attachment list":"attachmentList","Person TR":"personTr","Render As DIV":"renderAsDiv",selectorPanel:"selectorPanel",selectorPanelRefresh:"selectorPanelRefresh"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["askName","attachmentList","personTr","renderAsDiv","selectorPanel","selectorPanelRefresh"]},"./src/stories/Log.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,alertMessage:()=>alertMessage,buttonDecorator:()=>buttonDecorator,clearMessages:()=>clearMessages,debugMessage:()=>debugMessage,default:()=>__WEBPACK_DEFAULT_EXPORT__,dumpHtml:()=>dumpHtml,errorMessage:()=>errorMessage,infoMessage:()=>infoMessage,logAscending:()=>logAscending,logDescending:()=>logDescending,setLevel:()=>setLevel,simpleMessage:()=>simpleMessage,successMessage:()=>successMessage,warningMessage:()=>warningMessage});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.parse-int.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var buttonDecorator=function buttonDecorator(Story,_ref){var args=_ref.args,button=document.createElement("button");return button.innerText=args.buttonLabel,button.addEventListener("click",(function(){return Story()})),button},layoutProps={buttonDecorator};function MDXContent(_ref2){var components=_ref2.components,props=_objectWithoutProperties(_ref2,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Log",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h1",{id:"the-log-module"},"The Log module"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"On this page you'll find some examples from the log module. See\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_log_",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation"),"\nfor more information."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("div",{style:{background:"white",border:"0.5em solid black",position:"fixed",top:0,right:0,width:"300px",padding:"0.5em"}},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("strong",{parentName:"p"},"Status area:")," This is the playground which the examples will interact with. Click the various\nbuttons to see their effect here."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("div",{id:"status",style:{border:"1px solid red",padding:"0.5em",maxHeight:"50vh",overflow:"auto"}}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Note that by default only ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"msg"),", ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"warn")," and ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("inlineCode",{parentName:"p"},"error")," will add messages to the\nstatus area. You can change this by using ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"?path=/docs/log--set-level"},"setLevel"),".")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logmsg-a-simple-message"},"log.msg: A simple message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"simple message",decorators:[buttonDecorator],args:{buttonLabel:"Add a message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.msg("A simple message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logwarn-a-warning-message"},"log.warn: A warning message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"warning message",decorators:[buttonDecorator],args:{buttonLabel:"Add a warning"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.warn("A warning message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logdebug-a-debug-message"},"log.debug: A debug message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"debug message",decorators:[buttonDecorator],args:{buttonLabel:"Add a debugging message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.debug("A debugging message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"loginfo-an-info-message"},"log.info: An info message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"info message",decorators:[buttonDecorator],args:{buttonLabel:"Add an info message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.info("An info message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logerror-an-error-message"},"log.error: An error message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"error message",decorators:[buttonDecorator],args:{buttonLabel:"Add an error message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.error("An error message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logsuccess-a-success-message"},"log.success: A success message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"success message",decorators:[buttonDecorator],args:{buttonLabel:"Add a success message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.success("A success message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logalert-a-alert-message"},"log.alert: A alert message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"This example uses alert to notify user of a message. It will not log in the status area unless window.alert is not available."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"alert message",decorators:[buttonDecorator],args:{buttonLabel:"Trigger an alert message"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.alert("An alert message")}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logclear-clear-messages"},"log.clear: Clear messages"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"Using this method you can clear the existing messages in the status area."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"clear messages",decorators:[buttonDecorator],args:{buttonLabel:"Clear status area"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.clear()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logsetlevel-configure-which-messages-are-to-be-shown"},"log.setLevel: Configure which messages are to be shown"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"The module uses ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Mask_(computing)",target:"_blank",rel:"nofollow noopener noreferrer"},"bitmask")," to filter which types of messages that will be shown. It assigns the following 10-based\nnumber to each type (binaries in parenthesis):"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("ul",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Error: 1 (000001)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Warning: 2 (000010)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Message: 4 (000100)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Success: 8 (001000)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Info: 16 (010000)"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("li",{parentName:"ul"},"Debug: 32 (100000)")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("p",null,"By default only error, warning, and normal messages will be shown, hence the number 7 that is shown by default in this example. You can set it to show all types of messages by passing 63 (which is the sum of all, and is 111111 in binary)."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"set level",mdxType:"Story"},(function(){var div=document.createElement("div"),input=document.createElement("input");input.type="text",input.inputmode="numeric",input.pattern="[0-9]*",input.value=7,div.appendChild(input);var button=document.createElement("button");return button.innerText="Set level",button.addEventListener("click",(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.setLevel(parseInt(input.value,10))})),div.appendChild(button),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"logdumphtml-dump-all-html-in-body-in-a-log-message"},"log.dumpHTML: Dump all HTML in body in a log message"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"dump html",decorators:[buttonDecorator],args:{buttonLabel:"Dump HTML"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.dumpHTML()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"loglogascending-start-logging-all-messages-in-ascending-order"},"log.logAscending: Start logging all messages in ascending order"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"log ascending",decorators:[buttonDecorator],args:{buttonLabel:"Log ascending"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logAscending()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"loglogdescending-start-logging-all-messages-in-descending-order"},"log.logDescending: Start logging all messages in descending order"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"log descending",decorators:[buttonDecorator],args:{buttonLabel:"Log descending"},mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logDescending()}))))}MDXContent.isMDXComponent=!0;var simpleMessage=function simpleMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.msg("A simple message")};simpleMessage.storyName="simple message",simpleMessage.args={buttonLabel:"Add a message"},simpleMessage.parameters={storySource:{source:'() => UI.log.msg("A simple message")'}},simpleMessage.decorators=[buttonDecorator];var warningMessage=function warningMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.warn("A warning message")};warningMessage.storyName="warning message",warningMessage.args={buttonLabel:"Add a warning"},warningMessage.parameters={storySource:{source:'() => UI.log.warn("A warning message")'}},warningMessage.decorators=[buttonDecorator];var debugMessage=function debugMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.debug("A debugging message")};debugMessage.storyName="debug message",debugMessage.args={buttonLabel:"Add a debugging message"},debugMessage.parameters={storySource:{source:'() => UI.log.debug("A debugging message")'}},debugMessage.decorators=[buttonDecorator];var infoMessage=function infoMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.info("An info message")};infoMessage.storyName="info message",infoMessage.args={buttonLabel:"Add an info message"},infoMessage.parameters={storySource:{source:'() => UI.log.info("An info message")'}},infoMessage.decorators=[buttonDecorator];var errorMessage=function errorMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.error("An error message")};errorMessage.storyName="error message",errorMessage.args={buttonLabel:"Add an error message"},errorMessage.parameters={storySource:{source:'() => UI.log.error("An error message")'}},errorMessage.decorators=[buttonDecorator];var successMessage=function successMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.success("A success message")};successMessage.storyName="success message",successMessage.args={buttonLabel:"Add a success message"},successMessage.parameters={storySource:{source:'() => UI.log.success("A success message")'}},successMessage.decorators=[buttonDecorator];var alertMessage=function alertMessage(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.alert("An alert message")};alertMessage.storyName="alert message",alertMessage.args={buttonLabel:"Trigger an alert message"},alertMessage.parameters={storySource:{source:'() => UI.log.alert("An alert message")'}},alertMessage.decorators=[buttonDecorator];var clearMessages=function clearMessages(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.clear()};clearMessages.storyName="clear messages",clearMessages.args={buttonLabel:"Clear status area"},clearMessages.parameters={storySource:{source:"() => UI.log.clear()"}},clearMessages.decorators=[buttonDecorator];var setLevel=function setLevel(){var div=document.createElement("div"),input=document.createElement("input");input.type="text",input.inputmode="numeric",input.pattern="[0-9]*",input.value=7,div.appendChild(input);var button=document.createElement("button");return button.innerText="Set level",button.addEventListener("click",(function(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.setLevel(parseInt(input.value,10))})),div.appendChild(button),div};setLevel.storyName="set level",setLevel.parameters={storySource:{source:'() => {\n const div = document.createElement("div");\n const input = document.createElement("input");\n input.type = "text";\n input.inputmode = "numeric";\n input.pattern = "[0-9]*";\n input.value = 7;\n div.appendChild(input);\n const button = document.createElement("button");\n button.innerText = "Set level";\n button.addEventListener("click", () => UI.log.setLevel(parseInt(input.value, 10)));\n div.appendChild(button);\n return div;\n}'}};var dumpHtml=function dumpHtml(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.dumpHTML()};dumpHtml.storyName="dump html",dumpHtml.args={buttonLabel:"Dump HTML"},dumpHtml.parameters={storySource:{source:"() => UI.log.dumpHTML()"}},dumpHtml.decorators=[buttonDecorator];var logAscending=function logAscending(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logAscending()};logAscending.storyName="log ascending",logAscending.args={buttonLabel:"Log ascending"},logAscending.parameters={storySource:{source:"() => UI.log.logAscending()"}},logAscending.decorators=[buttonDecorator];var logDescending=function logDescending(){return _lib__WEBPACK_IMPORTED_MODULE_8__.log.logDescending()};logDescending.storyName="log descending",logDescending.args={buttonLabel:"Log descending"},logDescending.parameters={storySource:{source:"() => UI.log.logDescending()"}},logDescending.decorators=[buttonDecorator];var componentMeta={title:"Log",includeStories:["simpleMessage","warningMessage","debugMessage","infoMessage","errorMessage","successMessage","alertMessage","clearMessages","setLevel","dumpHtml","logAscending","logDescending"]},mdxStoryNameToKey={"simple message":"simpleMessage","warning message":"warningMessage","debug message":"debugMessage","info message":"infoMessage","error message":"errorMessage","success message":"successMessage","alert message":"alertMessage","clear messages":"clearMessages","set level":"setLevel","dump html":"dumpHtml","log ascending":"logAscending","log descending":"logDescending"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["buttonDecorator","simpleMessage","warningMessage","debugMessage","infoMessage","errorMessage","successMessage","alertMessage","clearMessages","setLevel","dumpHtml","logAscending","logDescending"]},"./src/stories/Matrix.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,forQuery:()=>forQuery});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Matrix",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h1",{id:"matrix"},"Matrix"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"More complex examples can be investigated on the\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"http://solidos.github.io/solid-ui/examples/matrix/index.html",target:"_blank",rel:"nofollow noopener noreferrer"},"example page"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"for-query"},"for query"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"for query",mdxType:"Story"},(function(){var testDocURI="https://pod.example/",testDoc=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.sym(testDocURI),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store;kb.removeMany(void 0,void 0,void 0,testDoc);_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.parse('@prefix : <#>.\n@prefix foaf: .\n@prefix sched: .\n@prefix cal: .\n@prefix dc: .\n:event1 dc:author :a0;\n a sched:YesNoMaybe ;\n sched:response :r1, :r2 .\n:a0 foaf:name "Zoe" .\n:a1 foaf:name "Alice" .\n:a2 foaf:name "Bob" .\n:r1 dc:author :a1;\n sched:cell\n [ sched:availabilty sched:No; cal:dtstart "2015-01-01" ],\n [ sched:availabilty sched:Yes; cal:dtstart "2015-01-05"] .\n:r2 dc:author :a2;\n sched:cell\n [ sched:availabilty sched:Maybe; cal:dtstart "2015-01-01" ] .\n',kb,testDocURI,"text/turtle");var SCHED=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/ns/pim/schedule#"),DC=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://purl.org/dc/elements/1.1/"),ICAL=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/2002/12/cal/ical#"),invitation=kb.sym(testDocURI+"#event1"),query=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Query("Responses"),variables={time:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("time"),author:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("author"),availabilty:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("value"),response:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("response"),cell:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("cell")};query.pat.add(invitation,SCHED("response"),variables.response),query.pat.add(variables.response,DC("author"),variables.author),query.pat.add(variables.response,SCHED("cell"),variables.cell),query.pat.add(variables.cell,SCHED("availabilty"),variables.availabilty),query.pat.add(variables.cell,ICAL("dtstart"),variables.time);var options={cellFunction:function cellFunction(cell,x,y,value){cell.textContent=value?_lib__WEBPACK_IMPORTED_MODULE_7__.utils.label(value):"-"}};return _lib__WEBPACK_IMPORTED_MODULE_7__.matrix.matrixForQuery(document,query,variables.time,variables.author,variables.availabilty,options,(function(){}))}))))}MDXContent.isMDXComponent=!0;var forQuery=function forQuery(){var testDocURI="https://pod.example/",testDoc=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.sym(testDocURI),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store;kb.removeMany(void 0,void 0,void 0,testDoc);_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.parse('@prefix : <#>.\n@prefix foaf: .\n@prefix sched: .\n@prefix cal: .\n@prefix dc: .\n:event1 dc:author :a0;\n a sched:YesNoMaybe ;\n sched:response :r1, :r2 .\n:a0 foaf:name "Zoe" .\n:a1 foaf:name "Alice" .\n:a2 foaf:name "Bob" .\n:r1 dc:author :a1;\n sched:cell\n [ sched:availabilty sched:No; cal:dtstart "2015-01-01" ],\n [ sched:availabilty sched:Yes; cal:dtstart "2015-01-05"] .\n:r2 dc:author :a2;\n sched:cell\n [ sched:availabilty sched:Maybe; cal:dtstart "2015-01-01" ] .\n',kb,testDocURI,"text/turtle");var SCHED=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/ns/pim/schedule#"),DC=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://purl.org/dc/elements/1.1/"),ICAL=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Namespace("http://www.w3.org/2002/12/cal/ical#"),invitation=kb.sym(testDocURI+"#event1"),query=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.Query("Responses"),variables={time:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("time"),author:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("author"),availabilty:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("value"),response:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("response"),cell:_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.variable("cell")};query.pat.add(invitation,SCHED("response"),variables.response),query.pat.add(variables.response,DC("author"),variables.author),query.pat.add(variables.response,SCHED("cell"),variables.cell),query.pat.add(variables.cell,SCHED("availabilty"),variables.availabilty),query.pat.add(variables.cell,ICAL("dtstart"),variables.time);var options={cellFunction:function cellFunction(cell,x,y,value){cell.textContent=value?_lib__WEBPACK_IMPORTED_MODULE_7__.utils.label(value):"-"}};return _lib__WEBPACK_IMPORTED_MODULE_7__.matrix.matrixForQuery(document,query,variables.time,variables.author,variables.availabilty,options,(function(){}))};forQuery.storyName="for query",forQuery.parameters={storySource:{source:'() => {\n const testDocURI = "https://pod.example/";\n const testDoc = UI.rdf.sym(testDocURI);\n const kb = UI.store;\n kb.removeMany(undefined, undefined, undefined, testDoc);\n const turtle = `@prefix : <#>.\n@prefix foaf: .\n@prefix sched: .\n@prefix cal: .\n@prefix dc: .\n:event1 dc:author :a0;\n a sched:YesNoMaybe ;\n sched:response :r1, :r2 .\n:a0 foaf:name "Zoe" .\n:a1 foaf:name "Alice" .\n:a2 foaf:name "Bob" .\n:r1 dc:author :a1;\n sched:cell\n [ sched:availabilty sched:No; cal:dtstart "2015-01-01" ],\n [ sched:availabilty sched:Yes; cal:dtstart "2015-01-05"] .\n:r2 dc:author :a2;\n sched:cell\n [ sched:availabilty sched:Maybe; cal:dtstart "2015-01-01" ] .\n`;\n UI.rdf.parse(turtle, kb, testDocURI, "text/turtle");\n const SCHED = UI.rdf.Namespace("http://www.w3.org/ns/pim/schedule#");\n const DC = UI.rdf.Namespace("http://purl.org/dc/elements/1.1/");\n const ICAL = UI.rdf.Namespace("http://www.w3.org/2002/12/cal/ical#");\n const invitation = kb.sym(`${testDocURI}#event1`);\n var query = new UI.rdf.Query("Responses");\n const variables = {\n time: UI.rdf.variable("time"),\n author: UI.rdf.variable("author"),\n availabilty: UI.rdf.variable("value"),\n response: UI.rdf.variable("response"),\n cell: UI.rdf.variable("cell")\n };\n query.pat.add(invitation, SCHED("response"), variables.response);\n query.pat.add(variables.response, DC("author"), variables.author);\n query.pat.add(variables.response, SCHED("cell"), variables.cell);\n query.pat.add(variables.cell, SCHED("availabilty"), variables.availabilty);\n query.pat.add(variables.cell, ICAL("dtstart"), variables.time);\n const options = {\n cellFunction: (cell, x, y, value) => {\n cell.textContent = value ? UI.utils.label(value) : "-";\n }\n };\n return UI.matrix.matrixForQuery(document, query, variables.time, variables.author, variables.availabilty, options, function () {});\n}'}};var componentMeta={title:"Matrix",includeStories:["forQuery"]},mdxStoryNameToKey={"for query":"forQuery"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["forQuery"]},"./src/stories/MediaTypes.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,isAudio:()=>isAudio,isImage:()=>isImage,isVideo:()=>isVideo});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_decorators__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/stories/decorators.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Media Types",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"isaudio"},"isAudio"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#isaudio",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"isAudio",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/audio/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isAudio(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"isvideo"},"isVideo"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#isvideo",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"isVideo",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/video/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isVideo(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"isimage"},"isImage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#isvideo",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"isImage",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/image/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isImage(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"))}))))}MDXContent.isMDXComponent=!0;var isAudio=function isAudio(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/audio/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isAudio(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/audio.mpeg"))};isAudio.storyName="isAudio",isAudio.parameters={storySource:{source:'() => {\n const type = UI.rdf.namedNode("http://www.w3.org/ns/iana/media-types/audio/");\n UI.store.add(UI.rdf.namedNode("http://example.com/audio.mpeg"), UI.ns.rdf("type"), type);\n return UI.widgets.isAudio(UI.rdf.namedNode("http://example.com/audio.mpeg"));\n}'}},isAudio.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var isVideo=function isVideo(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/video/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isVideo(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/video.mov"))};isVideo.storyName="isVideo",isVideo.parameters={storySource:{source:'() => {\n const type = UI.rdf.namedNode("http://www.w3.org/ns/iana/media-types/video/");\n UI.store.add(UI.rdf.namedNode("http://example.com/video.mov"), UI.ns.rdf("type"), type);\n return UI.widgets.isVideo(UI.rdf.namedNode("http://example.com/video.mov"));\n}'}},isVideo.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var isImage=function isImage(){var type=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/ns/iana/media-types/image/");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),type),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.isImage(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/image.jpeg"))};isImage.storyName="isImage",isImage.parameters={storySource:{source:'() => {\n const type = UI.rdf.namedNode("http://www.w3.org/ns/iana/media-types/image/");\n UI.store.add(UI.rdf.namedNode("http://example.com/image.jpeg"), UI.ns.rdf("type"), type);\n return UI.widgets.isImage(UI.rdf.namedNode("http://example.com/image.jpeg"));\n}'}},isImage.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var componentMeta={title:"Media Types",includeStories:["isAudio","isVideo","isImage"]},mdxStoryNameToKey={isAudio:"isAudio",isVideo:"isVideo",isImage:"isImage"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["isAudio","isVideo","isImage"]},"./src/stories/Notepad.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,lightColorHash:()=>lightColorHash,manageParticipation:()=>manageParticipation,notepad:()=>notepad,notepadToHtml:()=>notepadToHtml,participationObject:()=>participationObject,renderParticipants:()=>renderParticipants});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Notepad",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"notepad-creates-a-notepad"},"notepad: Creates a notepad"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"In this first example we'll see how you can create a notepad. This method creates input fields\nwhich allow you to provide a notepad component to your application."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"The inputs will be stored to ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://example-user.inrupt.net/public/example-notepad/index.ttl#this",target:"_blank",rel:"nofollow noopener noreferrer"},"https://example-user.inrupt.net/public/example-notepad/index.ttl#this")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"notepad",mdxType:"Story"},(function(){var pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/example-notepad/index.ttl#this"),me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepad(document,pad.doc(),subject,me,{})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"manageparticipation-creates-the-table-to-display-the-participants"},"manageParticipation: Creates the table to display the participants"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"manageParticipation",mdxType:"Story"},(function(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),structure=document.createElement("div"),container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#"),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this"),options={statusArea:container};return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.manageParticipation(document,structure,pad.doc(),subject,me,options)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"notepadtohtml-converts-a-turtle-file-to-an-html"},"notepadToHTML: Converts a Turtle file to an HTML"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"This method converts a pad.ttl document to HTML."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"notepadToHTML",mdxType:"Story"},(function(){var div=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var htmlStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepadToHTML(pad,kb);div.appendChild(document.createTextNode(htmlStr))})),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"lightcolorhash--determines-a-color-to-be-used-for-a-participants-notepad-entry"},"lightColorHash : Determines a color to be used for a participants notepad entry"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"This method returns a hex value for setting the color of the input box of the notepad. It does this by hashing the uri passed in as an argument. Ideally this would be the uri of the person logged in."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"lightColorHash",mdxType:"Story"},(function(){var colorStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.lightColorHash(new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me")),inputBox=document.createElement("INPUT");return inputBox.setAttribute("type","text"),inputBox.style.backgroundColor=colorStr,inputBox}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"renderparticipants-creates-a-table-of-participants-on-a-given-notepad-document"},"renderParticipants: Creates a table of participants on a given notepad document"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Creates the table with the list of participants that have contributed to the given pad that is passed in. This gets called from manageParticipation, but can be used on it's own as well."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"renderParticipants",mdxType:"Story"},(function(){var div=document.createElement("div"),table=document.createElement("table"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var subject=kb.sym("https://test.test#"),tableOfParticipants=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.renderPartipants(document,table,pad,subject,new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me"),{});div.appendChild(tableOfParticipants)})),div}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"participationobject-contains-the-subject-pad-and-uri-for-the-participants"},"participationObject: Contains the subject, pad and URI for the participants"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"participationObject",mdxType:"Story"},(function(){var container=document.createElement("pre"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,subject=kb.sym("https://test.test#"),fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.participationObject(subject,pad,me)})).then((function(node){container.appendChild(document.createTextNode(JSON.stringify(node,null,2)))})),container}))))}MDXContent.isMDXComponent=!0;var notepad=function notepad(){var pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://example-user.inrupt.net/public/example-notepad/index.ttl#this"),me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepad(document,pad.doc(),subject,me,{})};notepad.storyName="notepad",notepad.parameters={storySource:{source:"() => {\n const pad = UI.rdf.namedNode('https://example-user.inrupt.net/public/example-notepad/index.ttl#this');\n const me = new UI.rdf.NamedNode('https://example-user.inrupt.net/profile/card#me');\n const subject = UI.store.sym('https://test.test#');\n const options = {};\n return UI.pad.notepad(document, pad.doc(), subject, me, options);\n}"}};var manageParticipation=function manageParticipation(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://example-user.inrupt.net/profile/card#me"),structure=document.createElement("div"),container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.store.sym("https://test.test#"),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this"),options={statusArea:container};return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.manageParticipation(document,structure,pad.doc(),subject,me,options)};manageParticipation.storyName="manageParticipation",manageParticipation.parameters={storySource:{source:"() => {\n const me = new UI.rdf.NamedNode('https://example-user.inrupt.net/profile/card#me');\n const structure = document.createElement('div');\n const container = document.createElement('div');\n const subject = UI.store.sym('https://test.test#');\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n const options = {\n statusArea: container\n };\n return UI.pad.manageParticipation(document, structure, pad.doc(), subject, me, options);\n}"}};var notepadToHtml=function notepadToHtml(){var div=document.createElement("div"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var htmlStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.notepadToHTML(pad,kb);div.appendChild(document.createTextNode(htmlStr))})),div};notepadToHtml.storyName="notepadToHTML",notepadToHtml.parameters={storySource:{source:"() => {\n const div = document.createElement(\"div\");\n const kb = UI.store;\n const fetcher = UI.rdf.fetcher(kb);\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n fetcher.load(pad.doc()).then(() => {\n const htmlStr = UI.pad.notepadToHTML(pad, kb);\n div.appendChild(document.createTextNode(htmlStr));\n });\n return div;\n}"}};var lightColorHash=function lightColorHash(){var colorStr=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.lightColorHash(new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me")),inputBox=document.createElement("INPUT");return inputBox.setAttribute("type","text"),inputBox.style.backgroundColor=colorStr,inputBox};lightColorHash.storyName="lightColorHash",lightColorHash.parameters={storySource:{source:"() => {\n const colorStr = UI.pad.lightColorHash(new UI.rdf.NamedNode('https://sharonstrats.inrupt.net/profile/card#me'));\n const inputBox = document.createElement('INPUT');\n inputBox.setAttribute(\"type\", \"text\");\n inputBox.style.backgroundColor = colorStr;\n return inputBox;\n}"}};var renderParticipants=function renderParticipants(){var div=document.createElement("div"),table=document.createElement("table"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var subject=kb.sym("https://test.test#"),tableOfParticipants=_lib__WEBPACK_IMPORTED_MODULE_7__.pad.renderPartipants(document,table,pad,subject,new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me"),{});div.appendChild(tableOfParticipants)})),div};renderParticipants.storyName="renderParticipants",renderParticipants.parameters={storySource:{source:"() => {\n const div = document.createElement(\"div\");\n const table = document.createElement('table');\n const kb = UI.store;\n const fetcher = UI.rdf.fetcher(kb);\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n fetcher.load(pad.doc()).then(() => {\n // subject = new NamedNode('test') // this i think the page where a list.. ns.ws('participants') are stored\n const subject = kb.sym('https://test.test#');\n const options = {}; // what to put in options\n //options are used in the button personTR there are the following properties can be defined deleteFunction, link, draggable\n const tableOfParticipants = UI.pad.renderPartipants(document, table, pad, subject, new UI.rdf.NamedNode('https://sharonstrats.inrupt.net/profile/card#me'), options);\n div.appendChild(tableOfParticipants);\n });\n return div;\n}"}};var participationObject=function participationObject(){var container=document.createElement("pre"),kb=_lib__WEBPACK_IMPORTED_MODULE_7__.store,subject=kb.sym("https://test.test#"),fetcher=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.fetcher(kb),pad=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this");return fetcher.load(pad.doc()).then((function(){var me=new _lib__WEBPACK_IMPORTED_MODULE_7__.rdf.NamedNode("https://sharonstrats.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.pad.participationObject(subject,pad,me)})).then((function(node){container.appendChild(document.createTextNode(JSON.stringify(node,null,2)))})),container};participationObject.storyName="participationObject",participationObject.parameters={storySource:{source:"() => {\n const container = document.createElement(\"pre\");\n const kb = UI.store;\n const subject = kb.sym('https://test.test#');\n const fetcher = UI.rdf.fetcher(kb);\n const pad = UI.rdf.namedNode('https://sharonstrats.inrupt.net/public/edu.mit.solid.pane.pad/id1584238219755/index.ttl#this');\n fetcher.load(pad.doc()).then(() => {\n const me = new UI.rdf.NamedNode('https://sharonstrats.inrupt.net/profile/card#me');\n return UI.pad.participationObject(subject, pad, me);\n }).then(node => {\n container.appendChild(document.createTextNode(JSON.stringify(node, null, 2)));\n });\n return container;\n}"}};var componentMeta={title:"Notepad",includeStories:["notepad","manageParticipation","notepadToHtml","lightColorHash","renderParticipants","participationObject"]},mdxStoryNameToKey={notepad:"notepad",manageParticipation:"manageParticipation",notepadToHTML:"notepadToHtml",lightColorHash:"lightColorHash",renderParticipants:"renderParticipants",participationObject:"participationObject"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["notepad","manageParticipation","notepadToHtml","lightColorHash","renderParticipants","participationObject"]},"./src/stories/RdfUtils.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,allClassUris:()=>allClassUris,default:()=>__WEBPACK_DEFAULT_EXPORT__,defaultAnnotationStore:()=>defaultAnnotationStore,extractLogUri:()=>extractLogUri,propertyTriage:()=>propertyTriage});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_decorators__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/stories/decorators.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"RDF utilities",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"allclassuris"},"allClassUris"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Retrieve all RDF class URIs from solid-ui's RDF store"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#allclassuris",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"allClassUris",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.allClassURIs()}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"defaultannotationstore"},"defaultAnnotationStore"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Make a URI in the Tabulator.org annotation store out of the URI of the thing to be annotated."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#defaultannotationstore",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"defaultAnnotationStore",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.defaultAnnotationStore(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/a/b.html"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"extractloguri"},"extractLogURI"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"To figure out the log URI from the full URI used to invoke the reasoner"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#extractloguri",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"extractLogURI",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){return decodeURIComponent(_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.extractLogURI("https://example.com/logFile=http%3A%2F%2Fexample.org%2Flogs.ttl&rulesFile=ttp%3A%2F%2Fexample.org%2Frules.ttl"))}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"propertytriage"},"propertyTriage"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Figuring which properties we know about"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#propertytriage",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"propertyTriage",decorators:[_decorators__WEBPACK_IMPORTED_MODULE_9__.b],mdxType:"Story"},(function(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph();return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.propertyTriage(kb)}))))}MDXContent.isMDXComponent=!0;var allClassUris=function allClassUris(){return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-thing"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#some-other-class")),_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.allClassURIs()};allClassUris.storyName="allClassUris",allClassUris.parameters={storySource:{source:'() => {\n UI.store.add(UI.rdf.namedNode("http://example.com/#some-thing"), UI.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), UI.rdf.namedNode("http://example.com/#some-class"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#some-other-thing"), UI.rdf.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), UI.rdf.namedNode("http://example.com/#some-other-class"));\n return UI.widgets.allClassURIs();\n}'}},allClassUris.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var defaultAnnotationStore=function defaultAnnotationStore(){return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.defaultAnnotationStore(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/a/b.html"))};defaultAnnotationStore.storyName="defaultAnnotationStore",defaultAnnotationStore.parameters={storySource:{source:'() => {\n const url = "http://example.com/a/b.html";\n return UI.widgets.defaultAnnotationStore(UI.rdf.namedNode(url));\n}'}},defaultAnnotationStore.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var extractLogUri=function extractLogUri(){return decodeURIComponent(_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.extractLogURI("https://example.com/logFile=http%3A%2F%2Fexample.org%2Flogs.ttl&rulesFile=ttp%3A%2F%2Fexample.org%2Frules.ttl"))};extractLogUri.storyName="extractLogURI",extractLogUri.parameters={storySource:{source:'() => {\n const url = "https://example.com/logFile=http%3A%2F%2Fexample.org%2Flogs.ttl&rulesFile=ttp%3A%2F%2Fexample.org%2Frules.ttl";\n return decodeURIComponent(UI.widgets.extractLogURI(url));\n}'}},extractLogUri.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var propertyTriage=function propertyTriage(){var kb=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.graph();return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.propertyTriage(kb)};propertyTriage.storyName="propertyTriage",propertyTriage.parameters={storySource:{source:"() => {\n // FIXME: make this example return actual possible properties\n const kb = UI.rdf.graph();\n return UI.widgets.propertyTriage(kb);\n}"}},propertyTriage.decorators=[_decorators__WEBPACK_IMPORTED_MODULE_9__.b];var componentMeta={title:"RDF utilities",includeStories:["allClassUris","defaultAnnotationStore","extractLogUri","propertyTriage"]},mdxStoryNameToKey={allClassUris:"allClassUris",defaultAnnotationStore:"defaultAnnotationStore",extractLogURI:"extractLogUri",propertyTriage:"propertyTriage"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["allClassUris","defaultAnnotationStore","extractLogUri","propertyTriage"]},"./src/stories/Tabs.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,backgroundColor:()=>backgroundColor,default:()=>__WEBPACK_DEFAULT_EXPORT__,loadTurtleDecorator:()=>loadTurtleDecorator,onClose:()=>onClose,optionItems:()=>optionItems,orientation:()=>orientation,rdfCollection:()=>rdfCollection,renderTab:()=>renderTab,renderTabSettings:()=>renderTabSettings,selectedTab:()=>selectedTab,startEmpty:()=>startEmpty,unsortedTriples:()=>unsortedTriples});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var loadTurtleDecorator=function loadTurtleDecorator(Story){var _Story=Story(),render=_Story.render,data=_Story.data;_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.parse(data,_lib__WEBPACK_IMPORTED_MODULE_8__.store,location.origin,"text/turtle",(function(error){error&&console.error(error)}));var div=document.createElement("div"),pre=document.createElement("pre");return pre.appendChild(document.createTextNode(data)),div.appendChild(pre),div.appendChild(render()),div},layoutProps={loadTurtleDecorator};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Tabs",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-populating-content-using-an-rdf-collection"},"tabWidget: Populating content using an RDF collection"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"In this first example we'll see how you can generate a tabs widget using triples that are formatted as a collection in\nRDF. See ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_tabs_.html#tabwidget",target:"_blank",rel:"nofollow noopener noreferrer"},"API documentation")," for more\ninfo about how to use the tabWidget."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"The triples belows shows the minimum data you need to start using the tabWidget in combination with store."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"rdf collection",decorators:[loadTurtleDecorator],mdxType:"Story"},(function(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject1"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate1");return{data:"\n@prefix : <#> .\n:subject1\n :predicate1 ( :item1A :item1B ) .\n ",render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject.uri}})}}}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Note that you would probably use ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.rdf.namedNode")," directly from rdflib.js. (E.g. instead of\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.rdf.namedNode")," you would probably make use of namedNode with\n",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"import { namedNode } from 'rdflib'"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-populating-content-using-unsorted-triples"},"tabWidget: Populating content using unsorted triples"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"In this second example we'll use an unsorted set of triples instead of a collection."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"This is the data we will be working with. Note that we've also added labels to the items to help the widget know how to label the tabs."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Note that we've set option ordered to false in this example."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"unsorted triples",decorators:[loadTurtleDecorator],mdxType:"Story"},(function(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject2"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate2");return{data:'\n@prefix : <#> .\n@prefix rdfs: .\n:subject2\n :predicate2 :item2A, :item2B .\n:item2A\n rdfs:label "Tab 1" .\n:item2B\n rdfs:label "Tab 2" .\n ',render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,ordered:!1,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)}})}}}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-populating-content-using-option-items"},"tabWidget: Populating content using option items"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Finally we can set the items manually by using option items."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"We do not need to use options subject and predicate when using items."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"option items",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"ℹ For the remaining examples we'll use option items to populate our tabs."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-backgroundcolor"},"tabWidget: Option backgroundColor"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Using option ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"backgroundColor")," we can set a specific color (in hex value) to our tabs. It will consider how light a\ncolor is when figuring out which color to set to the text. It will also distinguish between selected and not selected\ntabs by coloring the selected tab a bit darker."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"background color",args:{backgroundColor:"#ff0000"},argTypes:{backgroundColor:{control:{type:"select",options:["#ff0000","#00ff00","#0000ff"]}}},mdxType:"Story"},(function(_ref2){var backgroundColor=_ref2.backgroundColor,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({backgroundColor,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.xP,{story:"background color",mdxType:"Props"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-onclose"},"tabWidget: Option onClose"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"on close",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({onClose:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("closed"),items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-orientation"},"tabWidget: Option orientation"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Using option ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"orientation")," we can set how the tabs and body should be positioned."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"orientation",args:{orientation:"1"},argTypes:{orientation:{control:{type:"select",options:["0","1","2","3"]}}},mdxType:"Story"},">",(function(_ref3){var orientation=_ref3.orientation,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({orientation,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.xP,{story:"orientation",mdxType:"Props"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-rendertab"},"tabWidget: Option renderTab"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderTab")," allows us to override the default behavior for how tabs are rendered, e.g. which text should be shown for each tab."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"renderTab",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.innerText="Go to "+subject.uri}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-rendertabsettings"},"tabWidget: Option renderTabSettings"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderTabSettings")," functions much like ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderMain"),", expect that it is triggered by holding ALT key (Option key on Mac\n) and clicking on a tab."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"renderTabSettings",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTabSettings:function renderTabSettings(bodyMain,subject){bodyMain.innerText="Settings for "+subject.uri}})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-selectedtab"},"tabWidget: Option selectedTab"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"selectedTab")," allows you to set which tab should be opened by when the widget is initially rendered. It must be used\nin junction with ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"renderTab")," since it relies on ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"dataset.name")," being set."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"selectedTab",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.dataset.name=subject.uri,tabDiv.innerText=_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)},selectedTab:item2.uri})}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"tabwidget-option-startempty"},"tabWidget: Option startEmpty"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"startEmpty")," makes it so that the body of a tab isn't shown when initially rendered."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"startEmpty",mdxType:"Story"},(function(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],startEmpty:!0,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})}))))}MDXContent.isMDXComponent=!0;var rdfCollection=function rdfCollection(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject1"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate1");return{data:"\n@prefix : <#> .\n:subject1\n :predicate1 ( :item1A :item1B ) .\n ",render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject.uri}})}}};rdfCollection.storyName="rdf collection",rdfCollection.parameters={storySource:{source:'() => {\n const subject = UI.rdf.namedNode(location.origin + "#subject1");\n const predicate = UI.rdf.namedNode(location.origin + "#predicate1");\n return {\n data: `\n@prefix : <#> .\n:subject1\n :predicate1 ( :item1A :item1B ) .\n `,\n render: () => UI.tabs.tabWidget({\n subject,\n predicate,\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject.uri}`;\n }\n })\n };\n}'}},rdfCollection.decorators=[loadTurtleDecorator];var unsortedTriples=function unsortedTriples(){var subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#subject2"),predicate=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#predicate2");return{data:'\n@prefix : <#> .\n@prefix rdfs: .\n:subject2\n :predicate2 :item2A, :item2B .\n:item2A\n rdfs:label "Tab 1" .\n:item2B\n rdfs:label "Tab 2" .\n ',render:function render(){return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({subject,predicate,ordered:!1,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)}})}}};unsortedTriples.storyName="unsorted triples",unsortedTriples.parameters={storySource:{source:'() => {\n const subject = UI.rdf.namedNode(location.origin + "#subject2");\n const predicate = UI.rdf.namedNode(location.origin + "#predicate2");\n return {\n data: `\n@prefix : <#> .\n@prefix rdfs: .\n:subject2\n :predicate2 :item2A, :item2B .\n:item2A\n rdfs:label "Tab 1" .\n:item2B\n rdfs:label "Tab 2" .\n `,\n render: () => UI.tabs.tabWidget({\n subject,\n predicate,\n ordered: false,\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${UI.utils.label(subject)}`;\n }\n })\n };\n}'}},unsortedTriples.decorators=[loadTurtleDecorator];var optionItems=function optionItems(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};optionItems.storyName="option items",optionItems.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var backgroundColor=function backgroundColor(_ref4){var backgroundColor=_ref4.backgroundColor,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({backgroundColor,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};backgroundColor.storyName="background color",backgroundColor.argTypes={backgroundColor:{control:{type:"select",options:["#ff0000","#00ff00","#0000ff"]}}},backgroundColor.args={backgroundColor:"#ff0000"},backgroundColor.parameters={storySource:{source:'({\n backgroundColor\n}) => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n backgroundColor,\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var onClose=function onClose(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({onClose:(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("closed"),items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};onClose.storyName="on close",onClose.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n onClose: action("closed"),\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var orientation=function orientation(_ref5){var orientation=_ref5.orientation,item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({orientation,items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};orientation.storyName="orientation",orientation.argTypes={orientation:{control:{type:"select",options:["0","1","2","3"]}}},orientation.args={orientation:"1"},orientation.parameters={storySource:{source:'({\n orientation\n}) => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n orientation,\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var renderTab=function renderTab(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.innerText="Go to "+subject.uri}})};renderTab.storyName="renderTab",renderTab.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n },\n renderTab: (tabDiv, subject) => {\n tabDiv.innerText = `Go to ${subject.uri}`;\n }\n });\n}'}};var renderTabSettings=function renderTabSettings(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTabSettings:function renderTabSettings(bodyMain,subject){bodyMain.innerText="Settings for "+subject.uri}})};renderTabSettings.storyName="renderTabSettings",renderTabSettings.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n },\n renderTabSettings: (bodyMain, subject) => {\n bodyMain.innerText = `Settings for ${subject.uri}`;\n }\n });\n}'}};var selectedTab=function selectedTab(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject},renderTab:function renderTab(tabDiv,subject){tabDiv.dataset.name=subject.uri,tabDiv.innerText=_lib__WEBPACK_IMPORTED_MODULE_8__.utils.label(subject)},selectedTab:item2.uri})};selectedTab.storyName="selectedTab",selectedTab.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n },\n renderTab: (tabDiv, subject) => {\n tabDiv.dataset.name = subject.uri;\n tabDiv.innerText = UI.utils.label(subject);\n },\n selectedTab: item2.uri\n });\n}'}};var startEmpty=function startEmpty(){var item1=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3A"),item2=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode(location.origin+"#item3B");return _lib__WEBPACK_IMPORTED_MODULE_8__.tabs.tabWidget({items:[item1,item2],startEmpty:!0,renderMain:function renderMain(bodyMain,subject){bodyMain.innerText="Content of "+subject}})};startEmpty.storyName="startEmpty",startEmpty.parameters={storySource:{source:'() => {\n const item1 = UI.rdf.namedNode(location.origin + "#item3A");\n const item2 = UI.rdf.namedNode(location.origin + "#item3B");\n return UI.tabs.tabWidget({\n items: [item1, item2],\n startEmpty: true,\n renderMain: (bodyMain, subject) => {\n bodyMain.innerText = `Content of ${subject}`;\n }\n });\n}'}};var componentMeta={title:"Tabs",includeStories:["rdfCollection","unsortedTriples","optionItems","backgroundColor","onClose","orientation","renderTab","renderTabSettings","selectedTab","startEmpty"]},mdxStoryNameToKey={"rdf collection":"rdfCollection","unsorted triples":"unsortedTriples","option items":"optionItems","background color":"backgroundColor","on close":"onClose",orientation:"orientation",renderTab:"renderTab",renderTabSettings:"renderTabSettings",selectedTab:"selectedTab",startEmpty:"startEmpty"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["loadTurtleDecorator","rdfCollection","unsortedTriples","optionItems","backgroundColor","onClose","orientation","renderTab","renderTabSettings","selectedTab","startEmpty"]},"./src/stories/Widgets.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,twoLineTransactions:()=>twoLineTransactions,twoLineTrip:()=>twoLineTrip,twoLineWidgetForClass:()=>twoLineWidgetForClass});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Widgets",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"twolinetransactions"},"twoLineTransactions"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Display a transaction"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#twolinetransaction",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"twoLineTransactions",mdxType:"Story"},(function(){var twoLineTransaction=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/2000/10/swap/pim/qif#Transaction"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#transaction");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("payee"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://payee.com/#me")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("date"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("amount"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("20 USD")),twoLineTransaction(document,thing)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"twolinetrip"},"twoLineTrip"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Display a trip"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#twolinetrip",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"twoLineTrip",mdxType:"Story"},(function(){var twoLineTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/ns/pim/trip#Trip"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.dc("title"),"Some trip"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtstart"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtend"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-02-02")),twoLineTrip(document,thing)}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"twolinewidgetforclass"},"twoLineWidgetForClass"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,"Find a function that can create a widget for a given class"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#twolinewidgetforclass",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"twoLineWidgetForClass",mdxType:"Story"},(function(){var rdfClass=_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Person"),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine.widgetForClass(rdfClass)(document,thing)}))))}MDXContent.isMDXComponent=!0;var twoLineTransactions=function twoLineTransactions(){var twoLineTransaction=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/2000/10/swap/pim/qif#Transaction"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#transaction");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("payee"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://payee.com/#me")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("date"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.qu("amount"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("20 USD")),twoLineTransaction(document,thing)};twoLineTransactions.storyName="twoLineTransactions",twoLineTransactions.parameters={storySource:{source:'() => {\n const twoLineTransaction = UI.widgets.index.twoLine["http://www.w3.org/2000/10/swap/pim/qif#Transaction"];\n const thing = UI.rdf.namedNode("http://example.com/#transaction");\n UI.store.add(thing, UI.ns.qu("payee"), UI.rdf.namedNode("https://payee.com/#me"));\n UI.store.add(thing, UI.ns.qu("date"), UI.rdf.literal("2020-01-01"));\n UI.store.add(thing, UI.ns.qu("amount"), UI.rdf.literal("20 USD"));\n return twoLineTransaction(document, thing);\n}'}};var twoLineTrip=function twoLineTrip(){var twoLineTrip=_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine["http://www.w3.org/ns/pim/trip#Trip"],thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://example.com/#trip");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.dc("title"),"Some trip"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtstart"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-01-01")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(thing,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.cal("dtend"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.literal("2020-02-02")),twoLineTrip(document,thing)};twoLineTrip.storyName="twoLineTrip",twoLineTrip.parameters={storySource:{source:'() => {\n const twoLineTrip = UI.widgets.index.twoLine["http://www.w3.org/ns/pim/trip#Trip"];\n const thing = UI.rdf.namedNode("http://example.com/#trip");\n UI.store.add(thing, UI.ns.dc("title"), "Some trip");\n UI.store.add(thing, UI.ns.cal("dtstart"), UI.rdf.literal("2020-01-01"));\n UI.store.add(thing, UI.ns.cal("dtend"), UI.rdf.literal("2020-02-02"));\n return twoLineTrip(document, thing);\n}'}};var twoLineWidgetForClass=function twoLineWidgetForClass(){var rdfClass=_lib__WEBPACK_IMPORTED_MODULE_7__.ns.foaf("Person"),thing=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");return _lib__WEBPACK_IMPORTED_MODULE_7__.widgets.index.twoLine.widgetForClass(rdfClass)(document,thing)};twoLineWidgetForClass.storyName="twoLineWidgetForClass",twoLineWidgetForClass.parameters={storySource:{source:'() => {\n const rdfClass = UI.ns.foaf("Person");\n const thing = UI.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me");\n const widgetFunction = UI.widgets.index.twoLine.widgetForClass(rdfClass);\n const widget = widgetFunction(document, thing);\n return widget;\n}'}};var componentMeta={title:"Widgets",includeStories:["twoLineTransactions","twoLineTrip","twoLineWidgetForClass"]},mdxStoryNameToKey={twoLineTransactions:"twoLineTransactions",twoLineTrip:"twoLineTrip",twoLineWidgetForClass:"twoLineWidgetForClass"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["twoLineTransactions","twoLineTrip","twoLineWidgetForClass"]},"./src/stories/forms/Fields.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,basicFields:()=>basicFields,default:()=>__WEBPACK_DEFAULT_EXPORT__,formGroupNoAlready:()=>formGroupNoAlready,formGroupWithAlready:()=>formGroupWithAlready});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.h_,{title:"Forms/fields",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"basic-fields"},"basic fields"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"basic fields",mdxType:"Story"},(function(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),doc=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/"),callbackFunction=function callbackFunction(ok,errorMessage){console.log(ok,errorMessage,document.getElementById("div-basicField").innerHTML)};return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("property"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#some-property"),doc),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},["PhoneField","EmailField","ColorField","DateField","DateTimeField","TimeField","NumericField","IntegerField","DecimalField","FloatField","TextField","SingleLineTextField","NamedNodeURIField"].forEach((function(fieldName){_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui(fieldName).uri](document,container,already,subject,form,doc,callbackFunction)})),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"uiwidgetsfielduinsuiformuri--uiwidgetsfielduinsuigroupuri-no-already"},"UI.widgets.field","[UI.ns.ui('Form').uri]"," / UI.widgets.field","[UI.ns.ui('Group').uri]",", no already"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"form / group, no already",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store");return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("parts"),new _lib__WEBPACK_IMPORTED_MODULE_8__.rdf.Collection([_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2")]),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 1 of the form]"),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 2 of the form]"),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Form").uri](document,container,{},subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"uiwidgetsfielduinsuiformuri--xuiwidgetsfielduinsuigroupuri-with-already"},"UI.widgets.field","[UI.ns.ui('Form').uri]"," / xUI.widgets.field","[UI.ns.ui('Group').uri]",", with already"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.widgets.field[UI.ns.ui('Group').uri]")," is currently synonymous with ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"UI.widgets.field[UI.ns.ui('Form').uri]"),", but\nthis additional example shows the use of ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("inlineCode",{parentName:"p"},"already"),"."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.oG,{name:"form / group, with already",mdxType:"Story"},(function(){var _already,container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store"),already=((_already={})[subject.toNT()+"|"+form.toNT()]=!0,_already);return document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Group").uri](document,container,already,subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container}))))}MDXContent.isMDXComponent=!0;var basicFields=function basicFields(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),doc=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/"),callbackFunction=function callbackFunction(ok,errorMessage){console.log(ok,errorMessage,document.getElementById("div-basicField").innerHTML)};return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("property"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#some-property"),doc),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},["PhoneField","EmailField","ColorField","DateField","DateTimeField","TimeField","NumericField","IntegerField","DecimalField","FloatField","TextField","SingleLineTextField","NamedNodeURIField"].forEach((function(fieldName){_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui(fieldName).uri](document,container,already,subject,form,doc,callbackFunction)})),container};basicFields.storyName="basic fields",basicFields.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://example.com/#this");\n const form = UI.rdf.namedNode("http://example.com/#form");\n const doc = UI.rdf.namedNode("http://example.com/");\n const callbackFunction = (ok, errorMessage) => {\n console.log(ok, errorMessage, document.getElementById("div-basicField").innerHTML);\n };\n UI.store.add(form, UI.ns.ui("property"), UI.rdf.namedNode("http://example.com/#some-property"), doc);\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n document.outlineManager = {\n appendPropertyTRs: () => {}\n };\n ["PhoneField", "EmailField", "ColorField", "DateField", "DateTimeField", "TimeField", "NumericField", "IntegerField", "DecimalField", "FloatField", "TextField", "SingleLineTextField", "NamedNodeURIField"].forEach(fieldName => {\n UI.widgets.field[UI.ns.ui(fieldName).uri](document, container, already, subject, form, doc, callbackFunction);\n });\n return container;\n}'}};var formGroupNoAlready=function formGroupNoAlready(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store");return _lib__WEBPACK_IMPORTED_MODULE_8__.store.add(form,_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("parts"),new _lib__WEBPACK_IMPORTED_MODULE_8__.rdf.Collection([_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2")]),_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part1"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 1 of the form]"),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_8__.store.add(_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#part2"),_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("contents"),"[this is part 2 of the form]"),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Form").uri](document,container,{},subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container};formGroupNoAlready.storyName="form / group, no already",formGroupNoAlready.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://example.com/#this");\n const form = UI.rdf.namedNode("http://example.com/#form");\n const store = UI.rdf.namedNode("http://example.com/#store");\n UI.store.add(form, UI.ns.ui("parts"), new UI.rdf.Collection([UI.rdf.namedNode("http://example.com/#part1"), UI.rdf.namedNode("http://example.com/#part2")]), UI.rdf.namedNode("http://example.com/"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#part1"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#part1"), UI.ns.ui("contents"), "[this is part 1 of the form]");\n UI.store.add(UI.rdf.namedNode("http://example.com/#part2"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://example.com/#part2"), UI.ns.ui("contents"), "[this is part 2 of the form]");\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n document.outlineManager = {\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Form").uri](document, container, already, subject, form, store, action("callback"));\n return container;\n}'}};var formGroupWithAlready=function formGroupWithAlready(){var _already2,container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#this"),form=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#form"),store=_lib__WEBPACK_IMPORTED_MODULE_8__.rdf.namedNode("http://example.com/#store"),already=((_already2={})[subject.toNT()+"|"+form.toNT()]=!0,_already2);return document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_8__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_8__.ns.ui("Group").uri](document,container,already,subject,form,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_9__.action)("callback")),container};formGroupWithAlready.storyName="form / group, with already",formGroupWithAlready.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const subject = UI.rdf.namedNode("http://example.com/#this");\n const form = UI.rdf.namedNode("http://example.com/#form");\n const store = UI.rdf.namedNode("http://example.com/#store");\n const key = subject.toNT() + "|" + form.toNT();\n const already = {\n [key]: true\n };\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n document.outlineManager = {\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Group").uri](document, container, already, subject, form, store, action("callback"));\n return container;\n}'}};var componentMeta={title:"Forms/fields",includeStories:["basicFields","formGroupNoAlready","formGroupWithAlready"]},mdxStoryNameToKey={"basic fields":"basicFields","form / group, no already":"formGroupNoAlready","form / group, with already":"formGroupWithAlready"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_7__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["basicFields","formGroupNoAlready","formGroupWithAlready"]},"./src/stories/forms/Forms.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,live:()=>live,trivialCommentField:()=>trivialCommentField});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.h_,{title:"Forms/appendForm",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("h2",{id:"appendform"},"appendForm"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("h3",{id:"trivial--comment-field"},"trivial / Comment field"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("p",null,"This example shows a trivial use of the ",(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("inlineCode",{parentName:"p"},"appendForm")," function, in conjunction with a Comment field."),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.oG,{name:"trivial / Comment field",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#subject"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),doc=subject.doc();return _lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("contents"),"[a trivial form with just a comment]"),_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,{},subject,form,doc),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)("h3",{id:"live"},"live"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.oG,{name:"live",mdxType:"Story"},(function(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#form1"),doc=subject.doc(),loadProfile=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(doc),loadForm=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(form.doc());return Promise.all([loadProfile,loadForm]).then((function(){_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,already,subject,form,doc)})),container}))))}MDXContent.isMDXComponent=!0;var trivialCommentField=function trivialCommentField(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#subject"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),doc=subject.doc();return _lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_12__.store.add(_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("http://example.com/#form"),_lib__WEBPACK_IMPORTED_MODULE_12__.ns.ui("contents"),"[a trivial form with just a comment]"),_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,{},subject,form,doc),container};trivialCommentField.storyName="trivial / Comment field",trivialCommentField.parameters={storySource:{source:"() => {\n const container = document.createElement(\"div\");\n const already = {};\n const subject = UI.rdf.namedNode('http://example.com/#subject');\n const form = UI.rdf.namedNode('http://example.com/#form');\n const doc = subject.doc();\n UI.store.add(UI.rdf.namedNode('http://example.com/#form'), UI.ns.rdf('type'), UI.ns.ui('Comment'));\n UI.store.add(UI.rdf.namedNode('http://example.com/#form'), UI.ns.ui('contents'), '[a trivial form with just a comment]');\n UI.widgets.appendForm(document, container, already, subject, form, doc);\n return container;\n}"}};var live=function live(){var container=document.createElement("div"),already={},subject=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me"),form=_lib__WEBPACK_IMPORTED_MODULE_12__.rdf.namedNode("https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#form1"),doc=subject.doc(),loadProfile=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(doc),loadForm=_lib__WEBPACK_IMPORTED_MODULE_12__.store.fetcher.load(form.doc());return Promise.all([loadProfile,loadForm]).then((function(){_lib__WEBPACK_IMPORTED_MODULE_12__.widgets.appendForm(document,container,already,subject,form,doc)})),container};live.storyName="live",live.parameters={storySource:{source:"() => {\n const container = document.createElement(\"div\");\n const already = {};\n const subject = UI.rdf.namedNode('https://michielbdejong.inrupt.net/profile/card#me');\n const form = UI.rdf.namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#form1');\n const doc = subject.doc();\n const loadProfile = UI.store.fetcher.load(doc);\n const loadForm = UI.store.fetcher.load(form.doc());\n Promise.all([loadProfile, loadForm]).then(() => {\n UI.widgets.appendForm(document, container, already, subject, form, doc);\n });\n return container;\n}"}};var componentMeta={title:"Forms/appendForm",includeStories:["trivialCommentField","live"]},mdxStoryNameToKey={"trivial / Comment field":"trivialCommentField",live:"live"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_11__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_13__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["trivialCommentField","live"]},"./src/stories/forms/Intro.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,__page:()=>__page,default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_excluded=(__webpack_require__("./lib/index.js"),["components"]);function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Forms/Documentation",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("h2",{id:"see-also"},"See also"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("ul",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/solid-ui/Documentation/forms-intro.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Forms intro")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/solid-ui//Documentation/form-ecosystem.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Form ecosystem")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/form-playground/playground.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Form Playground")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/form-playground/browse.html",target:"_blank",rel:"nofollow noopener noreferrer"},"Form Browse")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("li",{parentName:"ul"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)("a",{parentName:"li",href:"https://solidos.github.io/solid-ui/Documentation/api/",target:"_blank",rel:"nofollow noopener noreferrer"},"API docs"))))}MDXContent.isMDXComponent=!0;var __page=function __page(){throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};var componentMeta={title:"Forms/Documentation",includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_8__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["__page"]},"./src/stories/forms/Options.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,dependingOn:()=>dependingOn,usingRdfTypes:()=>usingRdfTypes});__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./lib/index.js"),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-actions/dist/esm/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var layoutProps={};function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.h_,{title:"Forms/Options",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"uiwidgetsfielduinsuioptionsuri-using-rdf-types"},"UI.widgets.field","[UI.ns.ui('Options').uri]",", using RDF types"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"using RDF types",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for houses]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for cows]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container}))),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)("h2",{id:"uiwidgetsfielduinsuioptionsuri-using-dependingon"},"UI.widgets.field","[UI.ns.ui('Options').uri]",", using dependingOn"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.Xz,{mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.oG,{name:"depending on",mdxType:"Story"},(function(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("dependingOn"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for developers]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for power users]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container}))))}MDXContent.isMDXComponent=!0;var usingRdfTypes=function usingRdfTypes(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#house"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-house"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-bedrooms"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for houses]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#if-subject-is-cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#number-of-legs"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for cows]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/#cow"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://first.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container};usingRdfTypes.storyName="using RDF types",usingRdfTypes.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://first.example/#this");\n const exampleOptionsField = UI.rdf.namedNode("http://first.example/#exampleOptionsField");\n const store = UI.rdf.namedNode("http://first.example/#store");\n /* UI to display in case subject is a house: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://first.example/#if-subject-is-house"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-house"), UI.ns.ui("for"), UI.rdf.namedNode("http://first.example/#house"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-house"), UI.ns.ui("use"), UI.rdf.namedNode("http://first.example/#number-of-bedrooms"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-bedrooms"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-bedrooms"), UI.ns.ui("contents"), "[UI for houses]");\n /* UI to display in case subject is a cow: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://first.example/#if-subject-is-cow"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-cow"), UI.ns.ui("for"), UI.rdf.namedNode("http://first.example/#cow"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#if-subject-is-cow"), UI.ns.ui("use"), UI.rdf.namedNode("http://first.example/#number-of-legs"), UI.rdf.namedNode("http://first.example/"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-legs"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://first.example/#number-of-legs"), UI.ns.ui("contents"), "[UI for cows]");\n UI.store.add(subject, UI.ns.rdf("type"), UI.rdf.namedNode("http://first.example/#cow"), UI.rdf.namedNode("http://first.example/")); // Subject is a cow, so it should display [UI for cows]\n document.outlineManager = {\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Options").uri](document, container, already, subject, exampleOptionsField, store, action("callback"));\n return container;\n}'}};var dependingOn=function dependingOn(){var container=document.createElement("div"),subject=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#this"),exampleOptionsField=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#exampleOptionsField"),store=_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#store");return _lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("dependingOn"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-developers"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for developers]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(exampleOptionsField,_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("case"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("for"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#if-subject-is-power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("use"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.rdf("type"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Comment")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#ui-for-power-users"),_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("contents"),"[UI for power users]"),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#developer"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),_lib__WEBPACK_IMPORTED_MODULE_7__.store.add(subject,_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#persona"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/#power-user"),_lib__WEBPACK_IMPORTED_MODULE_7__.rdf.namedNode("http://second.example/")),document.outlineManager={appendPropertyTRs:function appendPropertyTRs(){}},_lib__WEBPACK_IMPORTED_MODULE_7__.widgets.field[_lib__WEBPACK_IMPORTED_MODULE_7__.ns.ui("Options").uri](document,container,{},subject,exampleOptionsField,store,(0,_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_8__.action)("callback")),container};dependingOn.storyName="depending on",dependingOn.parameters={storySource:{source:'() => {\n const container = document.createElement("div");\n const already = {};\n const subject = UI.rdf.namedNode("http://second.example/#this");\n const exampleOptionsField = UI.rdf.namedNode("http://second.example/#exampleOptionsField");\n const store = UI.rdf.namedNode("http://second.example/#store");\n /* This form depends on persona: */\n UI.store.add(exampleOptionsField, UI.ns.ui("dependingOn"), UI.rdf.namedNode("http://second.example/#persona"), UI.rdf.namedNode("http://second.example/"));\n /* UI to display in case subject is developer: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://second.example/#if-subject-is-developer"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-developer"), UI.ns.ui("for"), UI.rdf.namedNode("http://second.example/#developer"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-developer"), UI.ns.ui("use"), UI.rdf.namedNode("http://second.example/#ui-for-developers"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-developers"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-developers"), UI.ns.ui("contents"), "[UI for developers]");\n /* UI to display in case subject is power user: */\n UI.store.add(exampleOptionsField, UI.ns.ui("case"), UI.rdf.namedNode("http://second.example/#if-subject-is-power-user"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-power-user"), UI.ns.ui("for"), UI.rdf.namedNode("http://second.example/#power-user"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#if-subject-is-power-user"), UI.ns.ui("use"), UI.rdf.namedNode("http://second.example/#ui-for-power-users"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-power-users"), UI.ns.rdf("type"), UI.ns.ui("Comment"));\n UI.store.add(UI.rdf.namedNode("http://second.example/#ui-for-power-users"), UI.ns.ui("contents"), "[UI for power users]");\n /* Subject is both a developer and a power user, so it should display both [UI for developers] and [UI for\n power users] */\n UI.store.add(subject, UI.rdf.namedNode("http://second.example/#persona"), UI.rdf.namedNode("http://second.example/#developer"), UI.rdf.namedNode("http://second.example/"));\n UI.store.add(subject, UI.rdf.namedNode("http://second.example/#persona"), UI.rdf.namedNode("http://second.example/#power-user"), UI.rdf.namedNode("http://second.example/"));\n document.outlineManager = {\n // FIXME: https://github.com/solidos/solid-ui/issues/239\n appendPropertyTRs: () => {}\n };\n UI.widgets.field[UI.ns.ui("Options").uri](document, container, already, subject, exampleOptionsField, store, action("callback"));\n return container;\n}'}};var componentMeta={title:"Forms/Options",includeStories:["usingRdfTypes","dependingOn"]},mdxStoryNameToKey={"using RDF types":"usingRdfTypes","depending on":"dependingOn"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_6__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_9__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["usingRdfTypes","dependingOn"]},"./src/stories/iconForClass.stories.mdx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,forSolidAppProviderClass:()=>forSolidAppProviderClass,iconDecorator:()=>iconDecorator});__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@mdx-js/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/esm/index.js"),_lib__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./lib/index.js"),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}var iconDecorator=function iconDecorator(Story){return"\n "+Story().map((function(_ref){var className=_ref.className,icon=_ref.icon;return"'})).join("")+"\n
                                                          classNameiconPreview
                                                          "+className+""+icon+'
                                                          "},layoutProps={iconDecorator};function MDXContent(_ref2){var components=_ref2.components,props=_objectWithoutProperties(_ref2,_excluded);return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("wrapper",_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.h_,{title:"iconForClass",mdxType:"Meta"}),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h1",{id:"iconforclass"},"iconForClass"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,"Best logo or avatar or photo etc to represent someone or some group etc"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("p",null,(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("a",{parentName:"p",href:"https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#iconforclass",target:"_blank",rel:"nofollow noopener noreferrer"},"API Documentation")),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)("h2",{id:"for-solidappproviderclass"},"for solid:AppProviderClass"),(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.Xz,{withSource:"open",mdxType:"Canvas"},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.oG,{name:"for solid:AppProviderClass",decorators:[iconDecorator],mdxType:"Story"},(function(){return Object.keys(_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass).map((function(className){return{className,icon:_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass[className]}}))}))))}MDXContent.isMDXComponent=!0;var forSolidAppProviderClass=function forSolidAppProviderClass(){return Object.keys(_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass).map((function(className){return{className,icon:_lib__WEBPACK_IMPORTED_MODULE_9__.widgets.iconForClass[className]}}))};forSolidAppProviderClass.storyName="for solid:AppProviderClass",forSolidAppProviderClass.parameters={storySource:{source:"() => Object.keys(UI.widgets.iconForClass).map(className => {\n const icon = UI.widgets.iconForClass[className];\n return {\n className,\n icon\n };\n})"}},forSolidAppProviderClass.decorators=[iconDecorator];var componentMeta={title:"iconForClass",includeStories:["forSolidAppProviderClass"]},mdxStoryNameToKey={"for solid:AppProviderClass":"forSolidAppProviderClass"};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs=Object.assign({},componentMeta.parameters.docs||{},{page:function page(){return(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_8__.aT,{mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_10__.mdx)(MDXContent,null))}});const __WEBPACK_DEFAULT_EXPORT__=componentMeta;var __namedExportsOrder=["iconDecorator","forSolidAppProviderClass"]},"./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$",module.exports=webpackEmptyContext},"./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$":(module,__unused_webpack_exports,__webpack_require__)=>{var map={"./stories/Buttons.stories.mdx":"./src/stories/Buttons.stories.mdx","./stories/DateTime.stories.mdx":"./src/stories/DateTime.stories.mdx","./stories/Display.stories.mdx":"./src/stories/Display.stories.mdx","./stories/DomManipulation.stories.mdx":"./src/stories/DomManipulation.stories.mdx","./stories/DragAndDrop.stories.mdx":"./src/stories/DragAndDrop.stories.mdx","./stories/Events.stories.mdx":"./src/stories/Events.stories.mdx","./stories/Header.stories.mdx":"./src/stories/Header.stories.mdx","./stories/Images.stories.mdx":"./src/stories/Images.stories.mdx","./stories/Interactive.stories.mdx":"./src/stories/Interactive.stories.mdx","./stories/Log.stories.mdx":"./src/stories/Log.stories.mdx","./stories/Matrix.stories.mdx":"./src/stories/Matrix.stories.mdx","./stories/MediaTypes.stories.mdx":"./src/stories/MediaTypes.stories.mdx","./stories/Notepad.stories.mdx":"./src/stories/Notepad.stories.mdx","./stories/RdfUtils.stories.mdx":"./src/stories/RdfUtils.stories.mdx","./stories/Tabs.stories.mdx":"./src/stories/Tabs.stories.mdx","./stories/Widgets.stories.mdx":"./src/stories/Widgets.stories.mdx","./stories/forms/Fields.stories.mdx":"./src/stories/forms/Fields.stories.mdx","./stories/forms/Forms.stories.mdx":"./src/stories/forms/Forms.stories.mdx","./stories/forms/Intro.stories.mdx":"./src/stories/forms/Intro.stories.mdx","./stories/forms/Options.stories.mdx":"./src/stories/forms/Options.stories.mdx","./stories/iconForClass.stories.mdx":"./src/stories/iconForClass.stories.mdx"};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){if(!__webpack_require__.o(map,req)){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}return map[req]}webpackContext.keys=function webpackContextKeys(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id="./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},"?4f7e":()=>{},"./generated-stories-entry.cjs":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module=__webpack_require__.nmd(module),(0,__webpack_require__("./node_modules/@storybook/html/dist/esm/client/index.js").configure)([__webpack_require__("./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$"),__webpack_require__("./src sync recursive ^\\.(?:(?:^%7C\\/%7C(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$")],module,!1)}},__webpack_require__=>{var __webpack_exec__=moduleId=>__webpack_require__(__webpack_require__.s=moduleId);__webpack_require__.O(0,[333],(()=>(__webpack_exec__("./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js"),__webpack_exec__("./node_modules/@storybook/core-client/dist/esm/globals/globals.js"),__webpack_exec__("./storybook-init-framework-entry.js"),__webpack_exec__("./node_modules/@storybook/html/dist/esm/client/preview/config-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/html/dist/esm/client/docs/config-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-links/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-actions/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-docs/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-backgrounds/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-measure/preview.js-generated-config-entry.js"),__webpack_exec__("./node_modules/@storybook/addon-outline/preview.js-generated-config-entry.js"),__webpack_exec__("./.storybook/preview.js-generated-config-entry.js"),__webpack_exec__("./generated-stories-entry.cjs"))));__webpack_require__.O()}]); \ No newline at end of file diff --git a/examples/storybook/main.844762ea.iframe.bundle.js.LICENSE.txt b/examples/storybook/main.def0ebf5.iframe.bundle.js.LICENSE.txt similarity index 100% rename from examples/storybook/main.844762ea.iframe.bundle.js.LICENSE.txt rename to examples/storybook/main.def0ebf5.iframe.bundle.js.LICENSE.txt diff --git a/examples/storybook/project.json b/examples/storybook/project.json index 86ca7b32..0bd20ee1 100644 --- a/examples/storybook/project.json +++ b/examples/storybook/project.json @@ -1 +1 @@ -{"generatedAt":1698837536731,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"8.19.4"},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addon-docs":{"version":"6.5.16"},"@storybook/builder-webpack5":{"version":"6.5.16"},"@storybook/html":{"version":"6.5.16"},"@storybook/manager-webpack5":{"version":"6.5.16"}},"framework":{"name":"html"},"addons":{"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-essentials":{"version":"6.5.16"}}} +{"generatedAt":1701362762233,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"8.19.4"},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addon-docs":{"version":"6.5.16"},"@storybook/builder-webpack5":{"version":"6.5.16"},"@storybook/html":{"version":"6.5.16"},"@storybook/manager-webpack5":{"version":"6.5.16"}},"framework":{"name":"html"},"addons":{"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-essentials":{"version":"6.5.16"}}} diff --git a/examples/storybook/runtime~main.64a16d0b.iframe.bundle.js b/examples/storybook/runtime~main.3d56b083.iframe.bundle.js similarity index 99% rename from examples/storybook/runtime~main.64a16d0b.iframe.bundle.js rename to examples/storybook/runtime~main.3d56b083.iframe.bundle.js index cff9d015..e3f45336 100644 --- a/examples/storybook/runtime~main.64a16d0b.iframe.bundle.js +++ b/examples/storybook/runtime~main.3d56b083.iframe.bundle.js @@ -1 +1 @@ -(()=>{"use strict";var deferred,leafPrototypes,getProto,inProgress,__webpack_modules__={},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,deferred=[],__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(!chunkIds){var notFulfilled=1/0;for(i=0;i=priority)&&Object.keys(__webpack_require__.O).every((key=>__webpack_require__.O[key](chunkIds[j])))?chunkIds.splice(j--,1):(fulfilled=!1,priority0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority]},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,__webpack_require__.t=function(value,mode){if(1&mode&&(value=this(value)),8&mode)return value;if("object"==typeof value&&value){if(4&mode&&value.__esModule)return value;if(16&mode&&"function"==typeof value.then)return value}var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=2&mode&&value;"object"==typeof current&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach((key=>def[key]=()=>value[key]));return def.default=()=>value,__webpack_require__.d(ns,def),ns},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce(((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises)),[])),__webpack_require__.u=chunkId=>chunkId+"."+{51:"85320abd",229:"6aff01b5",551:"2e8df708",670:"5de0222b",701:"ab2dc852",805:"06e021f2",807:"69991903",834:"1b2ce286",897:"69d03b0b",935:"c18e722f"}[chunkId]+".iframe.bundle.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=module=>((module=Object.create(module)).children||(module.children=[]),Object.defineProperty(module,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+module.id)}}),module),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),inProgress={},__webpack_require__.l=(url,done,key,chunkId)=>{if(inProgress[url])inProgress[url].push(done);else{var script,needAttach;if(void 0!==key)for(var scripts=document.getElementsByTagName("script"),i=0;i{script.onerror=script.onload=null,clearTimeout(timeout);var doneFns=inProgress[url];if(delete inProgress[url],script.parentNode&&script.parentNode.removeChild(script),doneFns&&doneFns.forEach((fn=>fn(event))),prev)return prev(event)},timeout=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:script}),12e4);script.onerror=onScriptComplete.bind(null,script.onerror),script.onload=onScriptComplete.bind(null,script.onload),needAttach&&document.head.appendChild(script)}},__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),__webpack_require__.p="",(()=>{var installedChunks={303:0};__webpack_require__.f.j=(chunkId,promises)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(303!=chunkId){var promise=new Promise(((resolve,reject)=>installedChunkData=installedChunks[chunkId]=[resolve,reject]));promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.u(chunkId),error=new Error;__webpack_require__.l(url,(event=>{if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData)){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}}),"chunk-"+chunkId,chunkId)}else installedChunks[chunkId]=0},__webpack_require__.O.j=chunkId=>0===installedChunks[chunkId];var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var moduleId,chunkId,[chunkIds,moreModules,runtime]=data,i=0;if(chunkIds.some((id=>0!==installedChunks[id]))){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i{"use strict";var deferred,leafPrototypes,getProto,inProgress,__webpack_modules__={},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,deferred=[],__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(!chunkIds){var notFulfilled=1/0;for(i=0;i=priority)&&Object.keys(__webpack_require__.O).every((key=>__webpack_require__.O[key](chunkIds[j])))?chunkIds.splice(j--,1):(fulfilled=!1,priority0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority]},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,__webpack_require__.t=function(value,mode){if(1&mode&&(value=this(value)),8&mode)return value;if("object"==typeof value&&value){if(4&mode&&value.__esModule)return value;if(16&mode&&"function"==typeof value.then)return value}var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=2&mode&&value;"object"==typeof current&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach((key=>def[key]=()=>value[key]));return def.default=()=>value,__webpack_require__.d(ns,def),ns},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce(((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises)),[])),__webpack_require__.u=chunkId=>chunkId+"."+{51:"85320abd",229:"6aff01b5",551:"2e8df708",670:"5de0222b",701:"ab2dc852",805:"6d9f11aa",807:"69991903",834:"1b2ce286",897:"69d03b0b",935:"c18e722f"}[chunkId]+".iframe.bundle.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=module=>((module=Object.create(module)).children||(module.children=[]),Object.defineProperty(module,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+module.id)}}),module),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),inProgress={},__webpack_require__.l=(url,done,key,chunkId)=>{if(inProgress[url])inProgress[url].push(done);else{var script,needAttach;if(void 0!==key)for(var scripts=document.getElementsByTagName("script"),i=0;i{script.onerror=script.onload=null,clearTimeout(timeout);var doneFns=inProgress[url];if(delete inProgress[url],script.parentNode&&script.parentNode.removeChild(script),doneFns&&doneFns.forEach((fn=>fn(event))),prev)return prev(event)},timeout=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:script}),12e4);script.onerror=onScriptComplete.bind(null,script.onerror),script.onload=onScriptComplete.bind(null,script.onload),needAttach&&document.head.appendChild(script)}},__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),__webpack_require__.p="",(()=>{var installedChunks={303:0};__webpack_require__.f.j=(chunkId,promises)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(303!=chunkId){var promise=new Promise(((resolve,reject)=>installedChunkData=installedChunks[chunkId]=[resolve,reject]));promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.u(chunkId),error=new Error;__webpack_require__.l(url,(event=>{if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData)){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}}),"chunk-"+chunkId,chunkId)}else installedChunks[chunkId]=0},__webpack_require__.O.j=chunkId=>0===installedChunks[chunkId];var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var moduleId,chunkId,[chunkIds,moreModules,runtime]=data,i=0;if(chunkIds.some((id=>0!==installedChunks[id]))){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i this.rootElement.appendChild(group))\n if (this.controller.isEditable) {\n this.rootElement.appendChild(this.addAgentButton.render())\n }\n return this.rootElement\n }\n\n private renderGroups (): HTMLElement[] {\n const groupElements: HTMLElement[] = []\n for (let comboIndex = 15; comboIndex > 0; comboIndex--) {\n const combo = kToCombo(comboIndex)\n if ((this.controller.isEditable && RECOMMENDED[comboIndex]) || this.byCombo[combo]) {\n groupElements.push(this.renderGroup(comboIndex, combo))\n }\n }\n return groupElements\n }\n\n private renderGroup (comboIndex: number, combo: string): HTMLElement {\n const groupRow = this.controller.dom.createElement('div')\n groupRow.setAttribute('style', style.accessGroupListItem)\n widgets.makeDropTarget(groupRow, (uris) => this.handleDroppedUris(uris, combo)\n .then(() => this.controller.render())\n .catch(error => this.controller.renderStatus(error)))\n const groupColumns = this.renderGroupElements(comboIndex, combo)\n groupColumns.forEach(column => groupRow.appendChild(column))\n return groupRow\n }\n\n private renderGroupElements (comboIndex, combo): HTMLElement[] {\n const groupNameColumn = this.controller.dom.createElement('div')\n groupNameColumn.setAttribute('style', style.group)\n if (this.controller.isEditable) {\n switch (comboIndex) {\n case 1:\n groupNameColumn.setAttribute('style', style.group1)\n break\n case 2:\n groupNameColumn.setAttribute('style', style.group2)\n break\n case 3:\n groupNameColumn.setAttribute('style', style.group3)\n break\n case 5:\n groupNameColumn.setAttribute('style', style.group5)\n break\n case 9:\n groupNameColumn.setAttribute('style', style.group9)\n break\n case 13:\n groupNameColumn.setAttribute('style', style.group13)\n break\n default:\n groupNameColumn.setAttribute('style', style.group)\n }\n }\n groupNameColumn.innerText = COLLOQUIAL[comboIndex] || ktToList(comboIndex)\n\n const groupAgentsColumn = this.controller.dom.createElement('div')\n groupAgentsColumn.setAttribute('style', style.group)\n if (this.controller.isEditable) {\n switch (comboIndex) {\n case 1:\n groupAgentsColumn.setAttribute('style', style.group1)\n break\n case 2:\n groupAgentsColumn.setAttribute('style', style.group2)\n break\n case 3:\n groupAgentsColumn.setAttribute('style', style.group3)\n break\n case 5:\n groupAgentsColumn.setAttribute('style', style.group5)\n break\n case 9:\n groupAgentsColumn.setAttribute('style', style.group9)\n break\n case 13:\n groupAgentsColumn.setAttribute('style', style.group13)\n break\n default:\n groupAgentsColumn.setAttribute('style', style.group)\n }\n }\n const groupAgentsTable = groupAgentsColumn.appendChild(this.controller.dom.createElement('table'))\n const combos = this.byCombo[combo] || []\n combos\n .map(([pred, obj]) => this.renderAgent(groupAgentsTable, combo, pred, obj))\n .forEach(agentElement => groupAgentsTable.appendChild(agentElement))\n\n const groupDescriptionElement = this.controller.dom.createElement('div')\n groupDescriptionElement.setAttribute('style', style.group)\n if (this.controller.isEditable) {\n switch (comboIndex) {\n case 1:\n groupDescriptionElement.setAttribute('style', style.group1)\n break\n case 2:\n groupDescriptionElement.setAttribute('style', style.group2)\n break\n case 3:\n groupDescriptionElement.setAttribute('style', style.group3)\n break\n case 5:\n groupDescriptionElement.setAttribute('style', style.group5)\n break\n case 9:\n groupDescriptionElement.setAttribute('style', style.group9)\n break\n case 13:\n groupDescriptionElement.setAttribute('style', style.group13)\n break\n default:\n groupDescriptionElement.setAttribute('style', style.group)\n }\n }\n groupDescriptionElement.innerText = EXPLANATION[comboIndex] || 'Unusual combination'\n\n return [groupNameColumn, groupAgentsColumn, groupDescriptionElement]\n }\n\n private renderAgent (groupAgentsTable, combo, pred, obj): HTMLElement {\n const personRow = widgets.personTR(this.controller.dom, ACL(pred), sym(obj), this.controller.isEditable\n ? {\n deleteFunction: () => this.deleteAgent(combo, pred, obj)\n .then(() => groupAgentsTable.removeChild(personRow))\n .catch(error => this.controller.renderStatus(error))\n }\n : {})\n return personRow\n }\n\n private async deleteAgent (combo, pred, obj): Promise {\n const combos = this.byCombo[combo] || []\n const comboToRemove = combos.find(([comboPred, comboObj]) => comboPred === pred && comboObj === obj)\n if (comboToRemove) {\n combos.splice(combos.indexOf(comboToRemove), 1)\n }\n await this.controller.save()\n }\n\n public async addNewURI (uri: string): Promise {\n await this.handleDroppedUri(uri, kToCombo(1))\n await this.controller.save()\n }\n\n private async handleDroppedUris (uris: string[], combo: string): Promise {\n try {\n await Promise.all(uris.map(uri => this.handleDroppedUri(uri, combo)))\n await this.controller.save()\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n private async handleDroppedUri (uri: string, combo: string, secondAttempt: boolean = false): Promise {\n const agent = findAgent(uri, this.store) // eg 'agent', 'origin', agentClass'\n const thing = sym(uri)\n if (!agent && !secondAttempt) {\n debug.log(` Not obvious: looking up dropped thing ${thing}`)\n try {\n await this._store?.fetcher?.load(thing.doc())\n } catch (error) {\n const message = `Ignore error looking up dropped thing: ${error}`\n debug.error(message)\n return Promise.reject(new Error(message))\n }\n return this.handleDroppedUri(uri, combo, true)\n } else if (!agent) {\n const error = ` Error: Drop fails to drop appropriate thing! ${uri}`\n debug.error(error)\n return Promise.reject(new Error(error))\n }\n this.setACLCombo(combo, uri, agent, this.controller.subject)\n }\n\n private setACLCombo (combo: string, uri: string, res: PartialAgentTriple, subject: NamedNode): void {\n if (!(combo in this.byCombo)) {\n this.byCombo[combo] = []\n }\n this.removeAgentFromCombos(uri) // Combos are mutually distinct\n this.byCombo[combo].push([res.pred, res.obj.uri])\n debug.log(`ACL: setting access to ${subject} by ${res.pred}: ${res.obj}`)\n }\n\n private removeAgentFromCombos (uri: string): void {\n for (let k = 0; k < 16; k++) {\n const combos = this.byCombo[kToCombo(k)]\n if (combos) {\n for (let i = 0; i < combos.length; i++) {\n while (i < combos.length && combos[i][1] === uri) {\n combos.splice(i, 1)\n }\n }\n }\n }\n }\n}\n\nfunction kToCombo (k: number): string {\n const y = ['Read', 'Append', 'Write', 'Control']\n const combo: string[] = []\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n combo.push('http://www.w3.org/ns/auth/acl#' + y[i])\n }\n }\n combo.sort()\n return combo.join('\\n')\n}\n\nfunction ktToList (k: number): string {\n let list = ''\n const y = ['Read', 'Append', 'Write', 'Control']\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n list += y[i]\n }\n }\n return list\n}\n\nfunction findAgent (uri, kb): PartialAgentTriple | null {\n const obj = sym(uri)\n const types = kb.findTypeURIs(obj)\n for (const ty in types) {\n debug.log(' drop object type includes: ' + ty)\n }\n // An Origin URI is one like https://fred.github.io eith no trailing slash\n if (uri.startsWith('http') && uri.split('/').length === 3) {\n // there is no third slash\n return { pred: 'origin', obj } // The only way to know an origin alas\n }\n // @@ This is an almighty kludge needed because drag and drop adds extra slashes to origins\n if (\n uri.startsWith('http') &&\n uri.split('/').length === 4 &&\n uri.endsWith('/')\n ) {\n // there IS third slash\n debug.log('Assuming final slash on dragged origin URI was unintended!')\n return { pred: 'origin', obj: sym(uri.slice(0, -1)) } // Fix a URI where the drag and drop system has added a spurious slash\n }\n\n if (ns.vcard('WebID').uri in types) return { pred: 'agent', obj }\n\n if (ns.vcard('Group').uri in types) {\n return { pred: 'agentGroup', obj } // @@ note vcard membership not RDFs\n }\n if (\n obj.sameTerm(ns.foaf('Agent')) ||\n obj.sameTerm(ns.acl('AuthenticatedAgent')) || // AuthenticatedAgent\n obj.sameTerm(ns.rdf('Resource')) ||\n obj.sameTerm(ns.owl('Thing'))\n ) {\n return { pred: 'agentClass', obj }\n }\n if (\n ns.vcard('Individual').uri in types ||\n ns.foaf('Person').uri in types ||\n ns.foaf('Agent').uri in types\n ) {\n const pref = kb.any(obj, ns.foaf('preferredURI'))\n if (pref) return { pred: 'agent', obj: sym(pref) }\n return { pred: 'agent', obj }\n }\n if (ns.solid('AppProvider').uri in types) {\n return { pred: 'origin', obj }\n }\n if (ns.solid('AppProviderClass').uri in types) {\n return { pred: 'originClass', obj }\n }\n debug.log(' Triage fails for ' + uri)\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;AAMA,IAAAA,OAAA,GAAAC,OAA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OAAO;MAAEC,GAAG,EAAE,IAAAO,WAAG,EAACyF,IAAI;IAAE,CAAC;IAClD,OAAO;MAAEjG,IAAI,EAAE,OAAO;MAAEC,GAAG,EAAHA;IAAI,CAAC;EAC/B;EACA,IAAItG,EAAE,CAACwM,KAAK,CAAC,aAAa,CAAC,CAAC7D,GAAG,IAAI+C,KAAK,EAAE;IACxC,OAAO;MAAErF,IAAI,EAAE,QAAQ;MAAEC,GAAG,EAAHA;IAAI,CAAC;EAChC;EACA,IAAItG,EAAE,CAACwM,KAAK,CAAC,kBAAkB,CAAC,CAAC7D,GAAG,IAAI+C,KAAK,EAAE;IAC7C,OAAO;MAAErF,IAAI,EAAE,aAAa;MAAEC,GAAG,EAAHA;IAAI,CAAC;EACrC;EACApG,KAAK,CAACuK,GAAG,CAAC,uBAAuB,GAAG9B,GAAG,CAAC;EACxC,OAAO,IAAI;AACb"} \ No newline at end of file +{"version":3,"file":"access-groups.js","names":["_rdflib","require","_acl","widgets","_interopRequireWildcard","ns","_addAgentButtons","debug","style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ACL","acl","COLLOQUIAL","RECOMMENDED","EXPLANATION","AccessGroups","exports","doc","aclDoc","controller","store","options","arguments","length","undefined","_classCallCheck2","_defineProperty2","defaults","_store","aclMap","readACL","byCombo","ACLbyCombination","addAgentButton","AddAgentButtons","rootElement","dom","createElement","setAttribute","accessGroupList","_createClass2","key","value","render","_this","innerHTML","renderGroups","forEach","group","appendChild","isEditable","groupElements","comboIndex","combo","kToCombo","push","renderGroup","_this2","groupRow","accessGroupListItem","makeDropTarget","uris","handleDroppedUris","then","error","renderStatus","groupColumns","renderGroupElements","column","_this3","groupNameColumn","group1","group2","group3","group5","group9","group13","innerText","ktToList","groupAgentsColumn","groupAgentsTable","combos","map","_ref","_ref2","_slicedToArray2","pred","obj","renderAgent","agentElement","groupDescriptionElement","_this4","personRow","personTR","sym","deleteFunction","deleteAgent","removeChild","_deleteAgent","_asyncToGenerator2","_regenerator","mark","_callee","comboToRemove","wrap","_callee$","_context","prev","next","find","_ref3","_ref4","comboPred","comboObj","splice","indexOf","save","stop","_x","_x2","_x3","apply","_addNewURI","_callee2","uri","_callee2$","_context2","handleDroppedUri","addNewURI","_x4","_handleDroppedUris","_callee3","_this5","_callee3$","_context3","Promise","all","t0","abrupt","reject","_x5","_x6","_handleDroppedUri","_this6","secondAttempt","_callee4","agent","thing","_this6$_store","_this6$_store$fetcher","message","_callee4$","_context4","findAgent","log","concat","fetcher","load","Error","setACLCombo","subject","_x7","_x8","res","removeAgentFromCombos","k","y","sort","join","list","kb","types","findTypeURIs","ty","startsWith","split","endsWith","slice","vcard","sameTerm","foaf","rdf","owl","pref","any","solid"],"sources":["../../src/acl/access-groups.ts"],"sourcesContent":["/**\n * Contains the [[AccessGroups]]\n * and [[AccessGroupsOptions]] classes\n * @packageDocumentation\n */\n\nimport { NamedNode, sym, Store } from 'rdflib'\nimport { ACLbyCombination, readACL } from './acl'\nimport * as widgets from '../widgets'\nimport * as ns from '../ns'\nimport { AccessController } from './access-controller'\nimport { AgentMapMap, ComboList, PartialAgentTriple } from './types'\nimport { AddAgentButtons } from './add-agent-buttons'\nimport * as debug from '../debug'\nimport * as style from '../style'\n\nconst ACL = ns.acl\n\nconst COLLOQUIAL = {\n 13: 'Owners',\n 9: 'Owners (write locked)',\n 5: 'Editors',\n 3: 'Posters',\n 2: 'Submitters',\n 1: 'Viewers'\n}\n\nconst RECOMMENDED = {\n 13: true,\n 5: true,\n 3: true,\n 2: true,\n 1: true\n}\n\nconst EXPLANATION = {\n 13: 'can read, write, and control sharing.',\n 9: 'can read and control sharing, currently write-locked.',\n 5: 'can read and change information',\n 3: 'can add new information, and read but not change existing information',\n 2: 'can add new information but not read any',\n 1: 'can read but not change information'\n}\n\n/**\n * Type for the options parameter of [[AccessGroups]]\n */\nexport interface AccessGroupsOptions {\n defaults?: boolean\n}\n\n/**\n * Renders the table of Owners, Editors, Posters, Submitters, Viewers\n * for https://github.com/solidos/userguide/blob/main/views/sharing/userguide.md\n */\nexport class AccessGroups {\n private readonly defaults: boolean\n public byCombo: ComboList\n public aclMap: AgentMapMap\n private readonly addAgentButton: AddAgentButtons\n private readonly rootElement: HTMLElement\n private _store: Store // @@ was LiveStore but does not need to be connected to web\n\n constructor (\n private doc: NamedNode,\n private aclDoc: NamedNode,\n public controller: AccessController,\n store: Store, // @@ was LiveStore\n private options: AccessGroupsOptions = {}\n ) {\n this.defaults = options.defaults || false\n this._store = store\n this.aclMap = readACL(doc, aclDoc, store, this.defaults)\n this.byCombo = ACLbyCombination(this.aclMap)\n this.addAgentButton = new AddAgentButtons(this)\n this.rootElement = this.controller.dom.createElement('div')\n this.rootElement.setAttribute('style', style.accessGroupList)\n }\n\n public get store () {\n return this._store\n }\n\n public set store (store) {\n this._store = store\n this.aclMap = readACL(this.doc, this.aclDoc, store, this.defaults)\n this.byCombo = ACLbyCombination(this.aclMap)\n }\n\n public render (): HTMLElement {\n this.rootElement.innerHTML = ''\n this.renderGroups().forEach(group => this.rootElement.appendChild(group))\n if (this.controller.isEditable) {\n this.rootElement.appendChild(this.addAgentButton.render())\n }\n return this.rootElement\n }\n\n private renderGroups (): HTMLElement[] {\n const groupElements: HTMLElement[] = []\n for (let comboIndex = 15; comboIndex > 0; comboIndex--) {\n const combo = kToCombo(comboIndex)\n if ((this.controller.isEditable && RECOMMENDED[comboIndex]) || this.byCombo[combo]) {\n groupElements.push(this.renderGroup(comboIndex, combo))\n }\n }\n return groupElements\n }\n\n private renderGroup (comboIndex: number, combo: string): HTMLElement {\n const groupRow = this.controller.dom.createElement('div')\n groupRow.setAttribute('style', style.accessGroupListItem)\n widgets.makeDropTarget(groupRow, (uris) => this.handleDroppedUris(uris, combo)\n .then(() => this.controller.render())\n .catch(error => this.controller.renderStatus(error)))\n const groupColumns = this.renderGroupElements(comboIndex, combo)\n groupColumns.forEach(column => groupRow.appendChild(column))\n return groupRow\n }\n\n private renderGroupElements (comboIndex, combo): HTMLElement[] {\n const groupNameColumn = this.controller.dom.createElement('div')\n groupNameColumn.setAttribute('style', style.group)\n if (this.controller.isEditable) {\n switch (comboIndex) {\n case 1:\n groupNameColumn.setAttribute('style', style.group1)\n break\n case 2:\n groupNameColumn.setAttribute('style', style.group2)\n break\n case 3:\n groupNameColumn.setAttribute('style', style.group3)\n break\n case 5:\n groupNameColumn.setAttribute('style', style.group5)\n break\n case 9:\n groupNameColumn.setAttribute('style', style.group9)\n break\n case 13:\n groupNameColumn.setAttribute('style', style.group13)\n break\n default:\n groupNameColumn.setAttribute('style', style.group)\n }\n }\n groupNameColumn.innerText = COLLOQUIAL[comboIndex] || ktToList(comboIndex)\n\n const groupAgentsColumn = this.controller.dom.createElement('div')\n groupAgentsColumn.setAttribute('style', style.group)\n if (this.controller.isEditable) {\n switch (comboIndex) {\n case 1:\n groupAgentsColumn.setAttribute('style', style.group1)\n break\n case 2:\n groupAgentsColumn.setAttribute('style', style.group2)\n break\n case 3:\n groupAgentsColumn.setAttribute('style', style.group3)\n break\n case 5:\n groupAgentsColumn.setAttribute('style', style.group5)\n break\n case 9:\n groupAgentsColumn.setAttribute('style', style.group9)\n break\n case 13:\n groupAgentsColumn.setAttribute('style', style.group13)\n break\n default:\n groupAgentsColumn.setAttribute('style', style.group)\n }\n }\n const groupAgentsTable = groupAgentsColumn.appendChild(this.controller.dom.createElement('table'))\n const combos = this.byCombo[combo] || []\n combos\n .map(([pred, obj]) => this.renderAgent(groupAgentsTable, combo, pred, obj))\n .forEach(agentElement => groupAgentsTable.appendChild(agentElement))\n\n const groupDescriptionElement = this.controller.dom.createElement('div')\n groupDescriptionElement.setAttribute('style', style.group)\n if (this.controller.isEditable) {\n switch (comboIndex) {\n case 1:\n groupDescriptionElement.setAttribute('style', style.group1)\n break\n case 2:\n groupDescriptionElement.setAttribute('style', style.group2)\n break\n case 3:\n groupDescriptionElement.setAttribute('style', style.group3)\n break\n case 5:\n groupDescriptionElement.setAttribute('style', style.group5)\n break\n case 9:\n groupDescriptionElement.setAttribute('style', style.group9)\n break\n case 13:\n groupDescriptionElement.setAttribute('style', style.group13)\n break\n default:\n groupDescriptionElement.setAttribute('style', style.group)\n }\n }\n groupDescriptionElement.innerText = EXPLANATION[comboIndex] || 'Unusual combination'\n\n return [groupNameColumn, groupAgentsColumn, groupDescriptionElement]\n }\n\n private renderAgent (groupAgentsTable, combo, pred, obj): HTMLElement {\n const personRow = widgets.personTR(this.controller.dom, ACL(pred), sym(obj), this.controller.isEditable\n ? {\n deleteFunction: () => this.deleteAgent(combo, pred, obj)\n .then(() => groupAgentsTable.removeChild(personRow))\n .catch(error => this.controller.renderStatus(error))\n }\n : {})\n return personRow\n }\n\n private async deleteAgent (combo, pred, obj): Promise {\n const combos = this.byCombo[combo] || []\n const comboToRemove = combos.find(([comboPred, comboObj]) => comboPred === pred && comboObj === obj)\n if (comboToRemove) {\n combos.splice(combos.indexOf(comboToRemove), 1)\n }\n await this.controller.save()\n }\n\n public async addNewURI (uri: string): Promise {\n await this.handleDroppedUri(uri, kToCombo(1))\n await this.controller.save()\n }\n\n private async handleDroppedUris (uris: string[], combo: string): Promise {\n try {\n await Promise.all(uris.map(uri => this.handleDroppedUri(uri, combo)))\n await this.controller.save()\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n private async handleDroppedUri (uri: string, combo: string, secondAttempt: boolean = false): Promise {\n const agent = findAgent(uri, this.store) // eg 'agent', 'origin', agentClass'\n const thing = sym(uri)\n if (!agent && !secondAttempt) {\n debug.log(` Not obvious: looking up dropped thing ${thing}`)\n try {\n await this._store?.fetcher?.load(thing.doc())\n } catch (error) {\n const message = `Ignore error looking up dropped thing: ${error}`\n debug.error(message)\n return Promise.reject(new Error(message))\n }\n return this.handleDroppedUri(uri, combo, true)\n } else if (!agent) {\n const error = ` Error: Drop fails to drop appropriate thing! ${uri}`\n debug.error(error)\n return Promise.reject(new Error(error))\n }\n this.setACLCombo(combo, uri, agent, this.controller.subject)\n }\n\n private setACLCombo (combo: string, uri: string, res: PartialAgentTriple, subject: NamedNode): void {\n if (!(combo in this.byCombo)) {\n this.byCombo[combo] = []\n }\n this.removeAgentFromCombos(uri) // Combos are mutually distinct\n this.byCombo[combo].push([res.pred, res.obj.uri])\n debug.log(`ACL: setting access to ${subject} by ${res.pred}: ${res.obj}`)\n }\n\n private removeAgentFromCombos (uri: string): void {\n for (let k = 0; k < 16; k++) {\n const combos = this.byCombo[kToCombo(k)]\n if (combos) {\n for (let i = 0; i < combos.length; i++) {\n while (i < combos.length && combos[i][1] === uri) {\n combos.splice(i, 1)\n }\n }\n }\n }\n }\n}\n\nfunction kToCombo (k: number): string {\n const y = ['Read', 'Append', 'Write', 'Control']\n const combo: string[] = []\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n combo.push('http://www.w3.org/ns/auth/acl#' + y[i])\n }\n }\n combo.sort()\n return combo.join('\\n')\n}\n\nfunction ktToList (k: number): string {\n let list = ''\n const y = ['Read', 'Append', 'Write', 'Control']\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n list += y[i]\n }\n }\n return list\n}\n\nfunction findAgent (uri, kb): PartialAgentTriple | null {\n const obj = sym(uri)\n const types = kb.findTypeURIs(obj)\n for (const ty in types) {\n debug.log(' drop object type includes: ' + ty)\n }\n // An Origin URI is one like https://fred.github.io eith no trailing slash\n if (uri.startsWith('http') && uri.split('/').length === 3) {\n // there is no third slash\n return { pred: 'origin', obj } // The only way to know an origin alas\n }\n // @@ This is an almighty kludge needed because drag and drop adds extra slashes to origins\n if (\n uri.startsWith('http') &&\n uri.split('/').length === 4 &&\n uri.endsWith('/')\n ) {\n // there IS third slash\n debug.log('Assuming final slash on dragged origin URI was unintended!')\n return { pred: 'origin', obj: sym(uri.slice(0, -1)) } // Fix a URI where the drag and drop system has added a spurious slash\n }\n\n if (ns.vcard('WebID').uri in types) return { pred: 'agent', obj }\n\n if (ns.vcard('Group').uri in types) {\n return { pred: 'agentGroup', obj } // @@ note vcard membership not RDFs\n }\n if (\n obj.sameTerm(ns.foaf('Agent')) ||\n obj.sameTerm(ns.acl('AuthenticatedAgent')) || // AuthenticatedAgent\n obj.sameTerm(ns.rdf('Resource')) ||\n obj.sameTerm(ns.owl('Thing'))\n ) {\n return { pred: 'agentClass', obj }\n }\n if (\n ns.vcard('Individual').uri in types ||\n ns.foaf('Person').uri in types ||\n ns.foaf('Agent').uri in types\n ) {\n const pref = kb.any(obj, ns.foaf('preferredURI'))\n if (pref) return { pred: 'agent', obj: sym(pref) }\n return { pred: 'agent', obj }\n }\n if (ns.solid('AppProvider').uri in types) {\n return { pred: 'origin', obj }\n }\n if (ns.solid('AppProviderClass').uri in types) {\n return { pred: 'originClass', obj }\n }\n debug.log(' Triage fails for ' + uri)\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;AAMA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,EAAA,GAAAD,uBAAA,CAAAH,OAAA;AAGA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAH,uBAAA,CAAAH,OAAA;AACA,IAAAO,KAAA,GAAAJ,uBAAA,CAAAH,OAAA;AAAiC,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,O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 +94,6 @@ function readACL(doc, aclDoc) { }); }); }); - return ac; function getDefaultsFallback(kb, ns) { return kb.each(undefined, ns.acl('default'), doc).concat(kb.each(undefined, ns.acl('defaultForNew'), doc)); @@ -432,7 +431,6 @@ function getACLorDefault(doc, callbackFunction) { if (!defaults.length) { return tryParent(uri); // Keep searching } - var defaultHolder = kb.sym(uri); return callbackFunction(true, false, doc, aclDoc, defaultHolder, defaultACLDoc); }); diff --git a/lib/acl/acl.js.map b/lib/acl/acl.js.map index 5aa7ac64..f56d723e 100644 --- a/lib/acl/acl.js.map +++ b/lib/acl/acl.js.map @@ -1 +1 @@ -{"version":3,"file":"acl.js","names":["ns","_interopRequireWildcard","require","_solidLogic","utils","debug","_rdflib","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","kb","solidLogicSingleton","store","adoptACLDefault","doc","aclDoc","defaultResource","defaultACLDoc","ACL","acl","isContainer","uri","slice","defaults","each","undefined","concat","proposed","reduce","accumulatedStatements","da","statementsMatching","rdf","st","kb2","graph","forEach","add","move","subject","predicate","object","sym","symbol","y","length","readACL","arguments","getDefaults","auths","getDefaultsFallback","ac","agent","agentClass","agentGroup","origin","originClass","keys","pred","mode","sameACL","b","contains","ACLunion","list","ag","_loop","k","loadUnionACL","subjectList","callbackFunction","aclList","doList","shift","getACLorDefault","ok","p2","targetDoc","targetACLDoc","defaultHolder","defa","push","ACLbyCombination","byCombo","combo","sort","combo2","join","makeACLGraph","x","makeACLGraphbyCombo","main","pairs","modeURIs","split","short","map","ACLToString","comboToString","str","initials","sameTerm","foaf","label","makeACLString","serialize","putACLObject","putACLbyCombo","_kb$updater","updater","put","message","_kb$fetcher","fetcher","unload","requested","fixIndividualCardACL","person","log","groups","vcard","fixIndividualACL","item","subjects","exists","union","setACL","docURI","aclText","any","ACL_LINK","Error","webOperation","value","data","contentType","then","res","error","nowOrWhenFetched","body","getACL","status","tryParent","right","lastIndexOf","left","indexOf","doc2","nonexistent","response","getProspectiveHolder","_x","_getProspectiveHolder","apply","_asyncToGenerator2","_regenerator","mark","_callee","targetDirectory","wrap","_callee$","_context","prev","next","abrupt","Promise","resolve","reject","isDirectACL","stop"],"sources":["../../src/acl/acl.ts"],"sourcesContent":["/**\n * Non-UI functions for access control.\n * See https://github.com/solidos/web-access-control-spec\n * for the spec that defines how ACL documents work.\n * @packageDocumentation\n */\n\nimport * as ns from '../ns'\nimport { solidLogicSingleton, ACL_LINK } from 'solid-logic'\nimport * as utils from '../utils'\nimport { AgentMapMap, AgentMapUnion, ComboList } from './types'\nimport * as debug from '../debug'\nimport { graph, Store, NamedNode, serialize, st, Statement, sym, LiveStore } from 'rdflib'\n\nconst kb = solidLogicSingleton.store\n\n/**\n * Take the \"default\" ACL and convert it into the equivalent ACL\n * which the resource would have had. Return it as a new separate store.\n * The \"defaultForNew\" predicate is also accepted, as a deprecated\n * synonym for \"default\".\n */\nexport function adoptACLDefault (\n doc: NamedNode,\n aclDoc: NamedNode,\n defaultResource: NamedNode,\n defaultACLDoc: NamedNode\n): Store {\n const ACL = ns.acl\n const isContainer = doc.uri.slice(-1) === '/' // Give default for all directories\n\n const defaults = kb\n .each(undefined, ACL('default'), defaultResource, defaultACLDoc)\n .concat(kb.each(undefined, ACL('defaultForNew'), defaultResource, defaultACLDoc))\n\n const proposed = defaults.reduce((accumulatedStatements, da) => accumulatedStatements\n .concat(kb.statementsMatching(da as NamedNode, ns.rdf('type'), ACL('Authorization'), defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('agent'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('agentClass'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('agentGroup'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('origin'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('originClass'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('mode'), undefined, defaultACLDoc))\n .concat(st(da as NamedNode, ACL('accessTo'), doc, defaultACLDoc))\n .concat(isContainer ? st(da as NamedNode, ACL('default'), doc, defaultACLDoc) : []), [] as Statement[])\n\n const kb2 = graph() // Potential - derived is kept apart\n proposed.forEach(st => kb2.add(move(st.subject), move(st.predicate), move(st.object), sym(aclDoc.uri)))\n return kb2 as LiveStore\n\n function move (symbol) {\n const y = defaultACLDoc.uri.length // The default ACL file\n return sym(\n symbol.uri.slice(0, y) === defaultACLDoc.uri\n ? aclDoc.uri + symbol.uri.slice(y)\n : symbol.uri\n )\n }\n}\n\n/**\n * Read and canonicalize the ACL for x in aclDoc\n *\n * Accumulate the access rights which each agent or class has\n */\nexport function readACL (\n doc: NamedNode,\n aclDoc: NamedNode,\n kb2: Store = kb,\n getDefaults: boolean = false\n): AgentMapMap {\n const auths: Array = getDefaults\n ? getDefaultsFallback(kb2, ns)\n : kb2.each(undefined, ns.acl('accessTo'), doc)\n\n const ACL = ns.acl\n const ac = {\n agent: {},\n agentClass: {},\n agentGroup: {},\n origin: {},\n originClass: {}\n }\n Object.keys(ac).forEach(pred => {\n auths.forEach(function (a) {\n (kb2.each(a, ACL('mode')) as Array).forEach(function (mode) {\n (kb2.each(a, ACL(pred)) as Array).forEach(function (agent) {\n ac[pred][agent.uri] = ac[pred][agent.uri] || {}\n ac[pred][agent.uri][mode.uri] = a // could be \"true\" but leave pointer just in case\n })\n })\n })\n })\n return ac\n\n function getDefaultsFallback (kb, ns) {\n return kb\n .each(undefined, ns.acl('default'), doc)\n .concat(kb.each(undefined, ns.acl('defaultForNew'), doc))\n }\n}\n\n/**\n * Compare two ACLs\n */\nexport function sameACL (a: AgentMapMap | AgentMapUnion, b: AgentMapMap | AgentMapUnion): boolean {\n const contains = function (a, b) {\n for (const pred in {\n agent: true,\n agentClass: true,\n agentGroup: true,\n origin: true,\n originClass: true\n }) {\n if (a[pred]) {\n for (const agent in a[pred]) {\n for (const mode in a[pred][agent]) {\n if (!b[pred][agent] || !b[pred][agent][mode]) {\n return false\n }\n }\n }\n }\n }\n return true\n }\n return contains(a, b) && contains(b, a)\n}\n\n/**\n * Union N ACLs\n */\nexport function ACLunion (list: Array): AgentMapUnion {\n const b = list[0]\n let a, ag\n for (let k = 1; k < list.length; k++) {\n ;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(\n function (pred) {\n a = list[k]\n if (a[pred]) {\n for (ag in a[pred]) {\n for (const mode in a[pred][ag]) {\n if (!b[pred][ag]) b[pred][ag] = []\n b[pred][ag][mode] = true\n }\n }\n }\n }\n )\n }\n return b as AgentMapUnion\n}\n\ntype loadUnionACLCallback = (ok: boolean, message?: string | NamedNode | AgentMapUnion | AgentMapMap) => void\n\n/**\n * Merge ACLs lists from things to form union\n */\nexport function loadUnionACL (subjectList: Array, callbackFunction: loadUnionACLCallback): void {\n const aclList: Array = []\n const doList = function (list) {\n if (list.length) {\n const doc = list.shift().doc()\n getACLorDefault(doc, function (\n ok,\n p2,\n targetDoc,\n targetACLDoc,\n defaultHolder,\n defaultACLDoc\n ) {\n const defa = !p2\n if (!ok || !defaultHolder || !defaultACLDoc) return callbackFunction(ok, targetACLDoc)\n const acl = defa\n ? readACL(defaultHolder, defaultACLDoc)\n : readACL(targetDoc as NamedNode, targetACLDoc as NamedNode)\n aclList.push(acl)\n doList(list.slice(1))\n })\n } else {\n // all gone\n callbackFunction(true, ACLunion(aclList))\n }\n }\n doList(subjectList)\n}\n\n/**\n * Represents these as an RDF graph by combination of modes\n *\n * Each agent can only be in one place in this model, one combination of modes.\n * Combos are like full control, read append, read only etc.\n */\nexport function ACLbyCombination (ac: AgentMapMap | AgentMapUnion): ComboList {\n const byCombo = {}\n ;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(function (pred) {\n for (const agent in ac[pred]) {\n const combo: string[] = []\n for (const mode in ac[pred][agent]) {\n combo.push(mode)\n }\n combo.sort()\n const combo2 = combo.join('\\n')\n if (!byCombo[combo2]) byCombo[combo2] = []\n byCombo[combo2].push([pred, agent])\n }\n })\n return byCombo\n}\n\n/**\n * Write ACL graph to store from AC\n */\nexport function makeACLGraph (kb: Store, x: NamedNode, ac: AgentMapMap, aclDoc: NamedNode): void {\n const byCombo = ACLbyCombination(ac)\n return makeACLGraphbyCombo(kb, x, byCombo, aclDoc)\n}\n\n/**\n * Write ACL graph to store from combo\n */\nexport function makeACLGraphbyCombo (\n kb: Store,\n x: NamedNode,\n byCombo: ComboList,\n aclDoc: NamedNode,\n main?: boolean,\n defa?: boolean\n): void {\n const ACL = ns.acl\n for (const combo in byCombo) {\n const pairs = byCombo[combo]\n if (!pairs.length) continue // do not add to store when no agent\n const modeURIs = combo.split('\\n')\n let short = modeURIs\n .map(function (u) {\n return u.split('#')[1]\n })\n .join('')\n if (defa && !main) short += 'Default' // don't muddle authorizations\n const a = kb.sym(aclDoc.uri + '#' + short)\n kb.add(a, ns.rdf('type'), ACL('Authorization'), aclDoc)\n if (main) {\n kb.add(a, ACL('accessTo'), x, aclDoc)\n }\n if (defa) {\n kb.add(a, ACL('default'), x, aclDoc)\n }\n for (let i = 0; i < modeURIs.length; i++) {\n kb.add(a, ACL('mode'), kb.sym(modeURIs[i]), aclDoc)\n }\n for (let i = 0; i < pairs.length; i++) {\n const pred = pairs[i][0]\n const ag = pairs[i][1]\n kb.add(a, ACL(pred), kb.sym(ag), aclDoc)\n }\n }\n}\n\n/**\n * Debugging short strings for dumping ACL\n * and possibly in the UI\n */\nexport function ACLToString (ac: AgentMapMap): string {\n return comboToString(ACLbyCombination(ac))\n}\n\n/**\n * Convert a [[ComboList]] to a string\n */\nexport function comboToString (byCombo: ComboList): string {\n let str = ''\n for (const combo in byCombo) {\n const modeURIs = combo.split('\\n')\n const initials = modeURIs\n .map(function (u) {\n return u.split('#')[1][0]\n })\n .join('')\n str += initials + ':'\n const pairs = byCombo[combo]\n for (let i = 0; i < pairs.length; i++) {\n const pred = pairs[i][0]\n const ag = sym(pairs[i][1])\n str += pred === 'agent' ? '@' : ''\n str += ag.sameTerm(ns.foaf('Agent')) ? '*' : utils.label(ag)\n if (i < pairs.length - 1) str += ','\n }\n str += ';'\n }\n return '{' + str.slice(0, -1) + '}' // drop extra semicolon\n}\n\n/**\n * Write ACL graph as Turtle\n */\nexport function makeACLString (x: NamedNode, ac: AgentMapMap, aclDoc: NamedNode): string {\n const kb2 = graph()\n makeACLGraph(kb2, x, ac, aclDoc)\n return serialize(aclDoc, kb2, aclDoc.uri, 'text/turtle') || ''\n}\n\n/**\n * Write ACL graph to web\n */\nexport function putACLObject (\n kb: LiveStore,\n x: NamedNode,\n ac: AgentMapMap | AgentMapUnion,\n aclDoc: NamedNode,\n callbackFunction: (ok: boolean, message?: string) => void\n): void {\n const byCombo = ACLbyCombination(ac)\n return putACLbyCombo(kb, x, byCombo, aclDoc, callbackFunction)\n}\n\n/**\n * Write ACL graph to web from a [[ComboList]]\n */\nexport function putACLbyCombo (\n kb: LiveStore,\n x: NamedNode,\n byCombo: ComboList,\n aclDoc: NamedNode,\n callbackFunction: (ok: boolean, message?: string) => void\n): void {\n const kb2 = graph()\n makeACLGraphbyCombo(kb2, x, byCombo, aclDoc, true)\n\n // const str = makeACLString = function(x, ac, aclDoc)\n kb.updater?.put(\n aclDoc,\n kb2.statementsMatching(undefined, undefined, undefined, aclDoc),\n 'text/turtle',\n function (uri, ok, message) {\n if (!ok) {\n callbackFunction(ok, message)\n } else {\n kb.fetcher?.unload(aclDoc)\n makeACLGraphbyCombo(kb, x, byCombo, aclDoc, true)\n kb.fetcher!.requested[aclDoc.uri] = 'done' // missing: save headers\n callbackFunction(ok)\n }\n }\n )\n}\n\ntype fixIndividualCardACLCallback = (ok: boolean, message?: string | NamedNode | AgentMapUnion | AgentMapMap) => void\ntype fixIndividualACLCallback = (ok: boolean, message?: string | NamedNode | AgentMapUnion | AgentMapMap) => void\n\n/**\n * Fix the ACl for an individual card as a function of the groups it is in\n *\n * All group files must be loaded first\n */\nexport function fixIndividualCardACL (person: NamedNode, log: Function, callbackFunction: fixIndividualCardACLCallback): void {\n const groups = kb.each(undefined, ns.vcard('hasMember'), person) as NamedNode[]\n // const doc = person.doc()\n if (groups) {\n fixIndividualACL(person, groups, log, callbackFunction)\n } else {\n log('This card is in no groups')\n callbackFunction(true) // fine, no requirements to access. default should be ok\n }\n // @@ if no groups, then use default for People container or the book top container.?\n}\n\n/**\n * This function is used by [[fixIndividualCardACL]]\n */\nexport function fixIndividualACL (item: NamedNode, subjects: Array, log: Function, callbackFunction: fixIndividualACLCallback): void {\n log = log || debug.log\n const doc = item.doc()\n getACLorDefault(doc, function (\n ok,\n exists,\n targetDoc,\n targetACLDoc,\n defaultHolder,\n defaultACLDoc\n ) {\n if (!ok || !defaultHolder || !defaultACLDoc) return callbackFunction(false, targetACLDoc) // ie message\n const ac = exists\n ? readACL(targetDoc as NamedNode, targetACLDoc as NamedNode)\n : readACL(defaultHolder, defaultACLDoc)\n loadUnionACL(subjects, function (ok, union) {\n if (!ok) return callbackFunction(false, union)\n if (sameACL(union as AgentMapMap | AgentMapUnion, ac)) {\n log('Nice - same ACL. no change ' + utils.label(item) + ' ' + doc)\n } else {\n log('Group ACLs differ for ' + utils.label(item) + ' ' + doc)\n\n // log(\"Group ACLs: \" + makeACLString(targetDoc, union, targetACLDoc))\n // log((exists ? \"Previous set\" : \"Default\") + \" ACLs: \" +\n // makeACLString(targetDoc, ac, targetACLDoc))\n\n putACLObject(\n kb as unknown as LiveStore,\n targetDoc as NamedNode,\n union as AgentMapMap | AgentMapUnion,\n targetACLDoc as NamedNode,\n callbackFunction\n )\n }\n })\n })\n}\n\n/**\n * Set an ACL\n */\nexport function setACL (\n docURI: NamedNode,\n aclText: string,\n callbackFunction: (ok: boolean, message: string) => void\n): void {\n const aclDoc = kb.any(\n docURI,\n ACL_LINK\n ) // @@ check that this get set by web.js\n if (!kb.fetcher) {\n throw new Error('Store has no fetcher')\n }\n if (aclDoc) {\n // Great we already know where it is\n kb.fetcher\n .webOperation('PUT', aclDoc.value, {\n data: aclText,\n contentType: 'text/turtle'\n })\n .then((res) => {\n callbackFunction(res.ok, res.error || '')\n }) // @@@ check params\n } else {\n kb.fetcher.nowOrWhenFetched(docURI, undefined, function (ok, body) {\n if (!ok) return callbackFunction(ok, 'Gettting headers for ACL: ' + body)\n const aclDoc = kb.any(\n docURI,\n ACL_LINK\n ) // @@ check that this get set by web.js\n if (!aclDoc) {\n // complainIfBad(false, \"No Link rel=ACL header for \" + docURI)\n callbackFunction(false, 'No Link rel=ACL header for ' + docURI)\n } else {\n if (!kb.fetcher) {\n throw new Error('Store has no fetcher')\n }\n kb.fetcher\n .webOperation('PUT', aclDoc.value, {\n data: aclText,\n contentType: 'text/turtle'\n })\n .then((res) => {\n callbackFunction(res.ok, res.error || '')\n })\n }\n })\n }\n}\n\n/**\n * Get ACL file or default if necessary\n *\n * @param callbackFunction Will be called in the following ways, in the following cases:\n * * `callbackFunction(true, true, doc, aclDoc)` if the ACL did exist\n * * `callbackFunction(true, false, doc, aclDoc, defaultHolder, defaultACLDoc)` if the ACL file did not exist but a default did\n * * `callbackFunction(false, false, status, message)` when there was an error getting the original\n * * `callbackFunction(false, true, status, message)` when there was an error getting the default\n */\nexport function getACLorDefault (\n doc: NamedNode,\n callbackFunction: (\n a: boolean,\n b: boolean,\n statusOrMessage: number | NamedNode,\n message: string | NamedNode,\n c?: NamedNode,\n d?: NamedNode\n ) => void\n): void {\n getACL(doc, function (ok, status, aclDoc, message): string | void {\n const ACL = ns.acl\n if (!ok) return callbackFunction(false, false, status as number, message as string)\n\n // Recursively search for the ACL file which gives default access\n const tryParent = function (uri) {\n if (uri.slice(-1) === '/') {\n uri = uri.slice(0, -1)\n }\n const right = uri.lastIndexOf('/')\n const left = uri.indexOf('/', uri.indexOf('//') + 2)\n if (left > right) {\n return callbackFunction(false, true, 404, 'Found no ACL resource')\n }\n uri = uri.slice(0, right + 1)\n const doc2 = sym(uri)\n getACL(doc2, function (ok, status, defaultACLDoc: any): NamedNode | void {\n if (!ok) {\n return callbackFunction(\n false,\n true,\n status as number,\n `( No ACL pointer ${uri} ${status})${defaultACLDoc}`\n ) as void\n } else if (status === 403) {\n return callbackFunction(\n false,\n true,\n status,\n `( default ACL file FORBIDDEN. Stop.${uri})`\n )\n } else if (status === 404) {\n return tryParent(uri)\n } else if (status !== 200) {\n return callbackFunction(\n false,\n true,\n status as number,\n `Error status '${status}' searching for default for ${doc2}`\n )\n }\n // 200\n // statusBlock.textContent += (\" ACCESS set at \" + uri + \". End search.\")\n const defaults = kb\n .each(undefined, ACL('default'), kb.sym(uri), defaultACLDoc)\n .concat(\n kb.each(undefined, ACL('defaultForNew'), kb.sym(uri), defaultACLDoc)\n )\n if (!defaults.length) {\n return tryParent(uri) // Keep searching\n }\n const defaultHolder = kb.sym(uri)\n return callbackFunction(\n true,\n false,\n doc,\n aclDoc as NamedNode,\n defaultHolder,\n defaultACLDoc as NamedNode\n )\n })\n } // tryParent\n\n if (!ok) {\n return callbackFunction(\n false,\n false,\n status as number,\n `Error accessing Access Control information for ${doc}) ${message}`\n )\n } else if (status === 404) {\n tryParent(doc.uri) // @@ construct default one - the server should do that\n } else if (status === 403) {\n return callbackFunction(\n false,\n false,\n status,\n `(Sharing not available to you)${message}`\n )\n } else if (status !== 200) {\n return callbackFunction(\n false,\n false,\n status as number,\n `Error ${status} accessing Access Control information for ${doc}: ${message}`\n )\n } else {\n // 200\n return callbackFunction(true, true, doc, aclDoc as NamedNode)\n }\n }) // Call to getACL\n}\n\n/**\n * Calls back `(ok, status, acldoc, message)` as follows\n *\n * * `(false, 900, errormessage)` if no link header\n * * `(true, 403, documentSymbol, fileaccesserror)` if not authorized\n * * `(true, 404, documentSymbol, fileaccesserror)` if does not exist\n * * `(true, 200, documentSymbol)` if file exists and read OK\n */\nexport function getACL (\n doc: NamedNode,\n callbackFunction: (\n ok: boolean,\n messageOrStatus: number | string,\n messageOrDoc?: NamedNode | string,\n message?: string\n ) => void\n): void {\n if (!kb.fetcher) {\n throw new Error('kb has no fetcher')\n }\n kb.fetcher.nowOrWhenFetched(doc, undefined, function (ok, body) {\n if (!ok) {\n return callbackFunction(ok, `Can't get headers to find ACL for ${doc}: ${body}`)\n }\n const aclDoc = kb.any(\n doc,\n ACL_LINK\n ) // @@ check that this get set by web.js\n if (!aclDoc) {\n callbackFunction(false, 900, `No Link rel=ACL header for ${doc}`)\n } else {\n if (!kb.fetcher) {\n throw new Error('kb has no fetcher')\n }\n if (kb.fetcher.nonexistent[aclDoc.value]) {\n return callbackFunction(\n true,\n 404,\n aclDoc as NamedNode,\n `ACL file ${aclDoc} does not exist.`\n )\n }\n kb.fetcher.nowOrWhenFetched(aclDoc as NamedNode, undefined, function (\n ok,\n message,\n response\n ) {\n if (!ok) {\n callbackFunction(\n true,\n response.status,\n aclDoc as NamedNode,\n `Can't read Access Control File ${aclDoc}: ${message}`\n )\n } else {\n callbackFunction(true, 200, aclDoc as NamedNode)\n }\n })\n }\n })\n}\n\n/**\n * Calls [[getACLorDefault]] and then (?)\n */\nexport async function getProspectiveHolder (targetDirectory: string): Promise {\n return new Promise((resolve, reject) => getACLorDefault(sym(targetDirectory), (\n ok,\n isDirectACL,\n targetDoc,\n targetACLDoc,\n defaultHolder\n ) => {\n if (ok) {\n return resolve((isDirectACL ? targetDoc : defaultHolder) as NamedNode)\n }\n return reject(new Error(`Error loading ${targetDirectory}`))\n }))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA0F,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAA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AAC,CAAC;UAAA,EAAC;QAAA;QAAA;UAAA,OAAAG,QAAA,CAAAQ,IAAA;MAAA;IAAA,GAAAZ,OAAA;EAAA,CACJ;EAAA,OAAAL,qBAAA,CAAAC,KAAA,OAAA3G,SAAA;AAAA"} \ No newline at end of file +{"version":3,"file":"acl.js","names":["ns","_interopRequireWildcard","require","_solidLogic","utils","debug","_rdflib","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","kb","solidLogicSingleton","store","adoptACLDefault","doc","aclDoc","defaultResource","defaultACLDoc","ACL","acl","isContainer","uri","slice","defaults","each","undefined","concat","proposed","reduce","accumulatedStatements","da","statementsMatching","rdf","st","kb2","graph","forEach","add","move","subject","predicate","object","sym","symbol","y","length","readACL","arguments","getDefaults","auths","getDefaultsFallback","ac","agent","agentClass","agentGroup","origin","originClass","keys","pred","mode","sameACL","b","contains","ACLunion","list","ag","_loop","k","loadUnionACL","subjectList","callbackFunction","aclList","doList","shift","getACLorDefault","ok","p2","targetDoc","targetACLDoc","defaultHolder","defa","push","ACLbyCombination","byCombo","combo","sort","combo2","join","makeACLGraph","x","makeACLGraphbyCombo","main","pairs","modeURIs","split","short","map","ACLToString","comboToString","str","initials","sameTerm","foaf","label","makeACLString","serialize","putACLObject","putACLbyCombo","_kb$updater","updater","put","message","_kb$fetcher","fetcher","unload","requested","fixIndividualCardACL","person","log","groups","vcard","fixIndividualACL","item","subjects","exists","union","setACL","docURI","aclText","any","ACL_LINK","Error","webOperation","value","data","contentType","then","res","error","nowOrWhenFetched","body","getACL","status","tryParent","right","lastIndexOf","left","indexOf","doc2","nonexistent","response","getProspectiveHolder","_x","_getProspectiveHolder","apply","_asyncToGenerator2","_regenerator","mark","_callee","targetDirectory","wrap","_callee$","_context","prev","next","abrupt","Promise","resolve","reject","isDirectACL","stop"],"sources":["../../src/acl/acl.ts"],"sourcesContent":["/**\n * Non-UI functions for access control.\n * See https://github.com/solidos/web-access-control-spec\n * for the spec that defines how ACL documents work.\n * @packageDocumentation\n */\n\nimport * as ns from '../ns'\nimport { solidLogicSingleton, ACL_LINK } from 'solid-logic'\nimport * as utils from '../utils'\nimport { AgentMapMap, AgentMapUnion, ComboList } from './types'\nimport * as debug from '../debug'\nimport { graph, Store, NamedNode, serialize, st, Statement, sym, LiveStore } from 'rdflib'\n\nconst kb = solidLogicSingleton.store\n\n/**\n * Take the \"default\" ACL and convert it into the equivalent ACL\n * which the resource would have had. Return it as a new separate store.\n * The \"defaultForNew\" predicate is also accepted, as a deprecated\n * synonym for \"default\".\n */\nexport function adoptACLDefault (\n doc: NamedNode,\n aclDoc: NamedNode,\n defaultResource: NamedNode,\n defaultACLDoc: NamedNode\n): Store {\n const ACL = ns.acl\n const isContainer = doc.uri.slice(-1) === '/' // Give default for all directories\n\n const defaults = kb\n .each(undefined, ACL('default'), defaultResource, defaultACLDoc)\n .concat(kb.each(undefined, ACL('defaultForNew'), defaultResource, defaultACLDoc))\n\n const proposed = defaults.reduce((accumulatedStatements, da) => accumulatedStatements\n .concat(kb.statementsMatching(da as NamedNode, ns.rdf('type'), ACL('Authorization'), defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('agent'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('agentClass'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('agentGroup'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('origin'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('originClass'), undefined, defaultACLDoc))\n .concat(kb.statementsMatching(da as NamedNode, ACL('mode'), undefined, defaultACLDoc))\n .concat(st(da as NamedNode, ACL('accessTo'), doc, defaultACLDoc))\n .concat(isContainer ? st(da as NamedNode, ACL('default'), doc, defaultACLDoc) : []), [] as Statement[])\n\n const kb2 = graph() // Potential - derived is kept apart\n proposed.forEach(st => kb2.add(move(st.subject), move(st.predicate), move(st.object), sym(aclDoc.uri)))\n return kb2 as LiveStore\n\n function move (symbol) {\n const y = defaultACLDoc.uri.length // The default ACL file\n return sym(\n symbol.uri.slice(0, y) === defaultACLDoc.uri\n ? aclDoc.uri + symbol.uri.slice(y)\n : symbol.uri\n )\n }\n}\n\n/**\n * Read and canonicalize the ACL for x in aclDoc\n *\n * Accumulate the access rights which each agent or class has\n */\nexport function readACL (\n doc: NamedNode,\n aclDoc: NamedNode,\n kb2: Store = kb,\n getDefaults: boolean = false\n): AgentMapMap {\n const auths: Array = getDefaults\n ? getDefaultsFallback(kb2, ns)\n : kb2.each(undefined, ns.acl('accessTo'), doc)\n\n const ACL = ns.acl\n const ac = {\n agent: {},\n agentClass: {},\n agentGroup: {},\n origin: {},\n originClass: {}\n }\n Object.keys(ac).forEach(pred => {\n auths.forEach(function (a) {\n (kb2.each(a, ACL('mode')) as Array).forEach(function (mode) {\n (kb2.each(a, ACL(pred)) as Array).forEach(function (agent) {\n ac[pred][agent.uri] = ac[pred][agent.uri] || {}\n ac[pred][agent.uri][mode.uri] = a // could be \"true\" but leave pointer just in case\n })\n })\n })\n })\n return ac\n\n function getDefaultsFallback (kb, ns) {\n return kb\n .each(undefined, ns.acl('default'), doc)\n .concat(kb.each(undefined, ns.acl('defaultForNew'), doc))\n }\n}\n\n/**\n * Compare two ACLs\n */\nexport function sameACL (a: AgentMapMap | AgentMapUnion, b: AgentMapMap | AgentMapUnion): boolean {\n const contains = function (a, b) {\n for (const pred in {\n agent: true,\n agentClass: true,\n agentGroup: true,\n origin: true,\n originClass: true\n }) {\n if (a[pred]) {\n for (const agent in a[pred]) {\n for (const mode in a[pred][agent]) {\n if (!b[pred][agent] || !b[pred][agent][mode]) {\n return false\n }\n }\n }\n }\n }\n return true\n }\n return contains(a, b) && contains(b, a)\n}\n\n/**\n * Union N ACLs\n */\nexport function ACLunion (list: Array): AgentMapUnion {\n const b = list[0]\n let a, ag\n for (let k = 1; k < list.length; k++) {\n ;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(\n function (pred) {\n a = list[k]\n if (a[pred]) {\n for (ag in a[pred]) {\n for (const mode in a[pred][ag]) {\n if (!b[pred][ag]) b[pred][ag] = []\n b[pred][ag][mode] = true\n }\n }\n }\n }\n )\n }\n return b as AgentMapUnion\n}\n\ntype loadUnionACLCallback = (ok: boolean, message?: string | NamedNode | AgentMapUnion | AgentMapMap) => void\n\n/**\n * Merge ACLs lists from things to form union\n */\nexport function loadUnionACL (subjectList: Array, callbackFunction: loadUnionACLCallback): void {\n const aclList: Array = []\n const doList = function (list) {\n if (list.length) {\n const doc = list.shift().doc()\n getACLorDefault(doc, function (\n ok,\n p2,\n targetDoc,\n targetACLDoc,\n defaultHolder,\n defaultACLDoc\n ) {\n const defa = !p2\n if (!ok || !defaultHolder || !defaultACLDoc) return callbackFunction(ok, targetACLDoc)\n const acl = defa\n ? readACL(defaultHolder, defaultACLDoc)\n : readACL(targetDoc as NamedNode, targetACLDoc as NamedNode)\n aclList.push(acl)\n doList(list.slice(1))\n })\n } else {\n // all gone\n callbackFunction(true, ACLunion(aclList))\n }\n }\n doList(subjectList)\n}\n\n/**\n * Represents these as an RDF graph by combination of modes\n *\n * Each agent can only be in one place in this model, one combination of modes.\n * Combos are like full control, read append, read only etc.\n */\nexport function ACLbyCombination (ac: AgentMapMap | AgentMapUnion): ComboList {\n const byCombo = {}\n ;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(function (pred) {\n for (const agent in ac[pred]) {\n const combo: string[] = []\n for (const mode in ac[pred][agent]) {\n combo.push(mode)\n }\n combo.sort()\n const combo2 = combo.join('\\n')\n if (!byCombo[combo2]) byCombo[combo2] = []\n byCombo[combo2].push([pred, agent])\n }\n })\n return byCombo\n}\n\n/**\n * Write ACL graph to store from AC\n */\nexport function makeACLGraph (kb: Store, x: NamedNode, ac: AgentMapMap, aclDoc: NamedNode): void {\n const byCombo = ACLbyCombination(ac)\n return makeACLGraphbyCombo(kb, x, byCombo, aclDoc)\n}\n\n/**\n * Write ACL graph to store from combo\n */\nexport function makeACLGraphbyCombo (\n kb: Store,\n x: NamedNode,\n byCombo: ComboList,\n aclDoc: NamedNode,\n main?: boolean,\n defa?: boolean\n): void {\n const ACL = ns.acl\n for (const combo in byCombo) {\n const pairs = byCombo[combo]\n if (!pairs.length) continue // do not add to store when no agent\n const modeURIs = combo.split('\\n')\n let short = modeURIs\n .map(function (u) {\n return u.split('#')[1]\n })\n .join('')\n if (defa && !main) short += 'Default' // don't muddle authorizations\n const a = kb.sym(aclDoc.uri + '#' + short)\n kb.add(a, ns.rdf('type'), ACL('Authorization'), aclDoc)\n if (main) {\n kb.add(a, ACL('accessTo'), x, aclDoc)\n }\n if (defa) {\n kb.add(a, ACL('default'), x, aclDoc)\n }\n for (let i = 0; i < modeURIs.length; i++) {\n kb.add(a, ACL('mode'), kb.sym(modeURIs[i]), aclDoc)\n }\n for (let i = 0; i < pairs.length; i++) {\n const pred = pairs[i][0]\n const ag = pairs[i][1]\n kb.add(a, ACL(pred), kb.sym(ag), aclDoc)\n }\n }\n}\n\n/**\n * Debugging short strings for dumping ACL\n * and possibly in the UI\n */\nexport function ACLToString (ac: AgentMapMap): string {\n return comboToString(ACLbyCombination(ac))\n}\n\n/**\n * Convert a [[ComboList]] to a string\n */\nexport function comboToString (byCombo: ComboList): string {\n let str = ''\n for (const combo in byCombo) {\n const modeURIs = combo.split('\\n')\n const initials = modeURIs\n .map(function (u) {\n return u.split('#')[1][0]\n })\n .join('')\n str += initials + ':'\n const pairs = byCombo[combo]\n for (let i = 0; i < pairs.length; i++) {\n const pred = pairs[i][0]\n const ag = sym(pairs[i][1])\n str += pred === 'agent' ? '@' : ''\n str += ag.sameTerm(ns.foaf('Agent')) ? '*' : utils.label(ag)\n if (i < pairs.length - 1) str += ','\n }\n str += ';'\n }\n return '{' + str.slice(0, -1) + '}' // drop extra semicolon\n}\n\n/**\n * Write ACL graph as Turtle\n */\nexport function makeACLString (x: NamedNode, ac: AgentMapMap, aclDoc: NamedNode): string {\n const kb2 = graph()\n makeACLGraph(kb2, x, ac, aclDoc)\n return serialize(aclDoc, kb2, aclDoc.uri, 'text/turtle') || ''\n}\n\n/**\n * Write ACL graph to web\n */\nexport function putACLObject (\n kb: LiveStore,\n x: NamedNode,\n ac: AgentMapMap | AgentMapUnion,\n aclDoc: NamedNode,\n callbackFunction: (ok: boolean, message?: string) => void\n): void {\n const byCombo = ACLbyCombination(ac)\n return putACLbyCombo(kb, x, byCombo, aclDoc, callbackFunction)\n}\n\n/**\n * Write ACL graph to web from a [[ComboList]]\n */\nexport function putACLbyCombo (\n kb: LiveStore,\n x: NamedNode,\n byCombo: ComboList,\n aclDoc: NamedNode,\n callbackFunction: (ok: boolean, message?: string) => void\n): void {\n const kb2 = graph()\n makeACLGraphbyCombo(kb2, x, byCombo, aclDoc, true)\n\n // const str = makeACLString = function(x, ac, aclDoc)\n kb.updater?.put(\n aclDoc,\n kb2.statementsMatching(undefined, undefined, undefined, aclDoc),\n 'text/turtle',\n function (uri, ok, message) {\n if (!ok) {\n callbackFunction(ok, message)\n } else {\n kb.fetcher?.unload(aclDoc)\n makeACLGraphbyCombo(kb, x, byCombo, aclDoc, true)\n kb.fetcher!.requested[aclDoc.uri] = 'done' // missing: save headers\n callbackFunction(ok)\n }\n }\n )\n}\n\ntype fixIndividualCardACLCallback = (ok: boolean, message?: string | NamedNode | AgentMapUnion | AgentMapMap) => void\ntype fixIndividualACLCallback = (ok: boolean, message?: string | NamedNode | AgentMapUnion | AgentMapMap) => void\n\n/**\n * Fix the ACl for an individual card as a function of the groups it is in\n *\n * All group files must be loaded first\n */\nexport function fixIndividualCardACL (person: NamedNode, log: Function, callbackFunction: fixIndividualCardACLCallback): void {\n const groups = kb.each(undefined, ns.vcard('hasMember'), person) as NamedNode[]\n // const doc = person.doc()\n if (groups) {\n fixIndividualACL(person, groups, log, callbackFunction)\n } else {\n log('This card is in no groups')\n callbackFunction(true) // fine, no requirements to access. default should be ok\n }\n // @@ if no groups, then use default for People container or the book top container.?\n}\n\n/**\n * This function is used by [[fixIndividualCardACL]]\n */\nexport function fixIndividualACL (item: NamedNode, subjects: Array, log: Function, callbackFunction: fixIndividualACLCallback): void {\n log = log || debug.log\n const doc = item.doc()\n getACLorDefault(doc, function (\n ok,\n exists,\n targetDoc,\n targetACLDoc,\n defaultHolder,\n defaultACLDoc\n ) {\n if (!ok || !defaultHolder || !defaultACLDoc) return callbackFunction(false, targetACLDoc) // ie message\n const ac = exists\n ? readACL(targetDoc as NamedNode, targetACLDoc as NamedNode)\n : readACL(defaultHolder, defaultACLDoc)\n loadUnionACL(subjects, function (ok, union) {\n if (!ok) return callbackFunction(false, union)\n if (sameACL(union as AgentMapMap | AgentMapUnion, ac)) {\n log('Nice - same ACL. no change ' + utils.label(item) + ' ' + doc)\n } else {\n log('Group ACLs differ for ' + utils.label(item) + ' ' + doc)\n\n // log(\"Group ACLs: \" + makeACLString(targetDoc, union, targetACLDoc))\n // log((exists ? \"Previous set\" : \"Default\") + \" ACLs: \" +\n // makeACLString(targetDoc, ac, targetACLDoc))\n\n putACLObject(\n kb as unknown as LiveStore,\n targetDoc as NamedNode,\n union as AgentMapMap | AgentMapUnion,\n targetACLDoc as NamedNode,\n callbackFunction\n )\n }\n })\n })\n}\n\n/**\n * Set an ACL\n */\nexport function setACL (\n docURI: NamedNode,\n aclText: string,\n callbackFunction: (ok: boolean, message: string) => void\n): void {\n const aclDoc = kb.any(\n docURI,\n ACL_LINK\n ) // @@ check that this get set by web.js\n if (!kb.fetcher) {\n throw new Error('Store has no fetcher')\n }\n if (aclDoc) {\n // Great we already know where it is\n kb.fetcher\n .webOperation('PUT', aclDoc.value, {\n data: aclText,\n contentType: 'text/turtle'\n })\n .then((res) => {\n callbackFunction(res.ok, res.error || '')\n }) // @@@ check params\n } else {\n kb.fetcher.nowOrWhenFetched(docURI, undefined, function (ok, body) {\n if (!ok) return callbackFunction(ok, 'Gettting headers for ACL: ' + body)\n const aclDoc = kb.any(\n docURI,\n ACL_LINK\n ) // @@ check that this get set by web.js\n if (!aclDoc) {\n // complainIfBad(false, \"No Link rel=ACL header for \" + docURI)\n callbackFunction(false, 'No Link rel=ACL header for ' + docURI)\n } else {\n if (!kb.fetcher) {\n throw new Error('Store has no fetcher')\n }\n kb.fetcher\n .webOperation('PUT', aclDoc.value, {\n data: aclText,\n contentType: 'text/turtle'\n })\n .then((res) => {\n callbackFunction(res.ok, res.error || '')\n })\n }\n })\n }\n}\n\n/**\n * Get ACL file or default if necessary\n *\n * @param callbackFunction Will be called in the following ways, in the following cases:\n * * `callbackFunction(true, true, doc, aclDoc)` if the ACL did exist\n * * `callbackFunction(true, false, doc, aclDoc, defaultHolder, defaultACLDoc)` if the ACL file did not exist but a default did\n * * `callbackFunction(false, false, status, message)` when there was an error getting the original\n * * `callbackFunction(false, true, status, message)` when there was an error getting the default\n */\nexport function getACLorDefault (\n doc: NamedNode,\n callbackFunction: (\n a: boolean,\n b: boolean,\n statusOrMessage: number | NamedNode,\n message: string | NamedNode,\n c?: NamedNode,\n d?: NamedNode\n ) => void\n): void {\n getACL(doc, function (ok, status, aclDoc, message): string | void {\n const ACL = ns.acl\n if (!ok) return callbackFunction(false, false, status as number, message as string)\n\n // Recursively search for the ACL file which gives default access\n const tryParent = function (uri) {\n if (uri.slice(-1) === '/') {\n uri = uri.slice(0, -1)\n }\n const right = uri.lastIndexOf('/')\n const left = uri.indexOf('/', uri.indexOf('//') + 2)\n if (left > right) {\n return callbackFunction(false, true, 404, 'Found no ACL resource')\n }\n uri = uri.slice(0, right + 1)\n const doc2 = sym(uri)\n getACL(doc2, function (ok, status, defaultACLDoc: any): NamedNode | void {\n if (!ok) {\n return callbackFunction(\n false,\n true,\n status as number,\n `( No ACL pointer ${uri} ${status})${defaultACLDoc}`\n ) as void\n } else if (status === 403) {\n return callbackFunction(\n false,\n true,\n status,\n `( default ACL file FORBIDDEN. Stop.${uri})`\n )\n } else if (status === 404) {\n return tryParent(uri)\n } else if (status !== 200) {\n return callbackFunction(\n false,\n true,\n status as number,\n `Error status '${status}' searching for default for ${doc2}`\n )\n }\n // 200\n // statusBlock.textContent += (\" ACCESS set at \" + uri + \". End search.\")\n const defaults = kb\n .each(undefined, ACL('default'), kb.sym(uri), defaultACLDoc)\n .concat(\n kb.each(undefined, ACL('defaultForNew'), kb.sym(uri), defaultACLDoc)\n )\n if (!defaults.length) {\n return tryParent(uri) // Keep searching\n }\n const defaultHolder = kb.sym(uri)\n return callbackFunction(\n true,\n false,\n doc,\n aclDoc as NamedNode,\n defaultHolder,\n defaultACLDoc as NamedNode\n )\n })\n } // tryParent\n\n if (!ok) {\n return callbackFunction(\n false,\n false,\n status as number,\n `Error accessing Access Control information for ${doc}) ${message}`\n )\n } else if (status === 404) {\n tryParent(doc.uri) // @@ construct default one - the server should do that\n } else if (status === 403) {\n return callbackFunction(\n false,\n false,\n status,\n `(Sharing not available to you)${message}`\n )\n } else if (status !== 200) {\n return callbackFunction(\n false,\n false,\n status as number,\n `Error ${status} accessing Access Control information for ${doc}: ${message}`\n )\n } else {\n // 200\n return callbackFunction(true, true, doc, aclDoc as NamedNode)\n }\n }) // Call to getACL\n}\n\n/**\n * Calls back `(ok, status, acldoc, message)` as follows\n *\n * * `(false, 900, errormessage)` if no link header\n * * `(true, 403, documentSymbol, fileaccesserror)` if not authorized\n * * `(true, 404, documentSymbol, fileaccesserror)` if does not exist\n * * `(true, 200, documentSymbol)` if file exists and read OK\n */\nexport function getACL (\n doc: NamedNode,\n callbackFunction: (\n ok: boolean,\n messageOrStatus: number | string,\n messageOrDoc?: NamedNode | string,\n message?: string\n ) => void\n): void {\n if (!kb.fetcher) {\n throw new Error('kb has no fetcher')\n }\n kb.fetcher.nowOrWhenFetched(doc, undefined, function (ok, body) {\n if (!ok) {\n return callbackFunction(ok, `Can't get headers to find ACL for ${doc}: ${body}`)\n }\n const aclDoc = kb.any(\n doc,\n ACL_LINK\n ) // @@ check that this get set by web.js\n if (!aclDoc) {\n callbackFunction(false, 900, `No Link rel=ACL header for ${doc}`)\n } else {\n if (!kb.fetcher) {\n throw new Error('kb has no fetcher')\n }\n if (kb.fetcher.nonexistent[aclDoc.value]) {\n return callbackFunction(\n true,\n 404,\n aclDoc as NamedNode,\n `ACL file ${aclDoc} does not exist.`\n )\n }\n kb.fetcher.nowOrWhenFetched(aclDoc as NamedNode, undefined, function (\n ok,\n message,\n response\n ) {\n if (!ok) {\n callbackFunction(\n true,\n response.status,\n aclDoc as NamedNode,\n `Can't read Access Control File ${aclDoc}: ${message}`\n )\n } else {\n callbackFunction(true, 200, aclDoc as NamedNode)\n }\n })\n }\n })\n}\n\n/**\n * Calls [[getACLorDefault]] and then (?)\n */\nexport async function getProspectiveHolder (targetDirectory: string): Promise {\n return new Promise((resolve, reject) => getACLorDefault(sym(targetDirectory), (\n ok,\n isDirectACL,\n targetDoc,\n targetACLDoc,\n defaultHolder\n ) => {\n if (ok) {\n return resolve((isDirectACL ? targetDoc : defaultHolder) as NamedNode)\n }\n return reject(new Error(`Error loading ${targetDirectory}`))\n }))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA0F,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAA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index 6f003834..5155b8f3 100644 --- a/lib/chat/chatLogic.js +++ b/lib/chat/chatLogic.js @@ -56,7 +56,7 @@ var ChatChannel = exports.ChatChannel = /*#__PURE__*/function () { */ (0, _createClass2["default"])(ChatChannel, [{ key: "createMessage", - value: function () { + value: (function () { var _createMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(text) { return _regenerator["default"].wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { @@ -77,9 +77,10 @@ var ChatChannel = exports.ChatChannel = /*#__PURE__*/function () { as a replacement for an existing one. The old one iis left, and the two are linked */ + ) }, { key: "updateMessage", - value: function () { + value: (function () { var _updateMessage = (0, _asyncToGenerator2["default"])(function (text) { var _this = this; var oldMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; @@ -177,9 +178,10 @@ var ChatChannel = exports.ChatChannel = /*#__PURE__*/function () { * Wee add a new version of the message,m witha deletion flag (deletion date) * so that the deletion can be revoked by adding another non-deleted update */ + ) }, { key: "deleteMessage", - value: function () { + value: (function () { var _deleteMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(message) { return _regenerator["default"].wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { @@ -195,7 +197,7 @@ var ChatChannel = exports.ChatChannel = /*#__PURE__*/function () { return _deleteMessage.apply(this, arguments); } return deleteMessage; - }() + }()) }]); return ChatChannel; }(); // class ChatChannel diff --git a/lib/chat/chatLogic.js.map b/lib/chat/chatLogic.js.map index 7ddba13f..f74b36ab 100644 --- a/lib/chat/chatLogic.js.map +++ b/lib/chat/chatLogic.js.map @@ -1 +1 @@ -{"version":3,"file":"chatLogic.js","names":["debug","_interopRequireWildcard","require","_dateFolder","_solidLogic","ns","$rdf","utils","_signature","_keys","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ChatChannel","exports","channel","options","_classCallCheck2","channelRoot","doc","dateFolder","DateFolder","div","_createClass2","key","value","_createMessage","_asyncToGenerator2","_regenerator","mark","_callee","text","wrap","_callee$","_context","prev","next","abrupt","updateMessage","stop","createMessage","_x","apply","arguments","_updateMessage","_this","oldMsg","length","undefined","deleteIt","_callee2","sts","now","timestamp","dateStamp","chatDocument","message","me","msg","oldMsgMaker","errMsg","privateKey","sig","_errMsg","_callee2$","_context2","Date","getTime","term","leafDocumentFromDate","store","sym","uri","authn","currentUser","getBlankMsg","id","any","foaf","push","st","mostRecentVersion","dct","schema","warn","alert","Error","wf","sioc","literal","content","created","maker","getPrivateKey","sent","signMsg","concat","SEC","lit","updater","update","t0","_x2","_deleteMessage","_callee3","_callee3$","_context3","deleteMessage","_x3","originalVersion","isDeleted","holds","isReplaced","isHidden","nick","person","s","label","_createIfNotExists","_x4","_createIfNotExists2","contentType","data","_callee4","response","_callee4$","_context4","fetcher","load","status","log","webOperation","t1","requested"],"sources":["../../src/chat/chatLogic.js"],"sourcesContent":["/**\n * Contains the [[ChatChannel]] class and logic for Solid Chat\n * @packageDocumentation\n */\n\nimport * as debug from '../debug'\nimport { DateFolder } from './dateFolder'\nimport { store, authn } from 'solid-logic'\nimport * as ns from '../ns'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as utils from '../utils'\nimport { getBlankMsg, signMsg, SEC, verifySignature } from './signature'\nimport { getPrivateKey, getPublicKey } from './keys'\n\n/* The Solid logic for a 'LongChat'\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 */\n\nexport class ChatChannel {\n constructor (channel, options) {\n this.channel = channel\n this.channelRoot = channel.doc()\n this.options = options\n this.dateFolder = new DateFolder(this.channelRoot, 'chat.ttl')\n this.div = null // : HTMLElement\n }\n\n /* Store a new message in the web,\n */\n async createMessage (text) {\n return this.updateMessage(text)\n }\n\n /* Store a new message in the web,\n as a replacement for an existing one.\n The old one iis left, and the two are linked\n */\n async updateMessage (text, oldMsg = null, deleteIt) {\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n const chatDocument = oldMsg ? oldMsg.doc() : this.dateFolder.leafDocumentFromDate(now)\n const message = store.sym(chatDocument.uri + '#' + 'Msg' + timestamp)\n // const content = store.literal(text)\n\n const me = authn.currentUser() // If already logged on\n\n const msg = getBlankMsg()\n msg.id = message.uri\n if (oldMsg) { // edit message replaces old one\n const oldMsgMaker = store.any(oldMsg, ns.foaf('maker')) // may not be needed here, but needed on READ\n if (oldMsgMaker.uri === me.uri) {\n sts.push($rdf.st(mostRecentVersion(oldMsg), ns.dct('isReplacedBy'), message, chatDocument))\n if (deleteIt) { // we need to add a specific signature, else anyone can delete a msg ?\n sts.push($rdf.st(message, ns.schema('dateDeleted'), dateStamp, chatDocument))\n }\n } else {\n const errMsg = 'Error you cannot delete/edit a message from someone else : \\n' + oldMsgMaker.uri\n debug.warn(errMsg)\n alert(errMsg)\n throw new Error(errMsg)\n }\n } else { // link new message to channel\n sts.push($rdf.st(this.channel, ns.wf('message'), message, chatDocument))\n }\n sts.push(\n $rdf.st(message, ns.sioc('content'), store.literal(text), chatDocument)\n )\n msg.content = text\n\n sts.push(\n $rdf.st(message, ns.dct('created'), dateStamp, chatDocument)\n )\n msg.created = dateStamp.value\n if (me) {\n sts.push($rdf.st(message, ns.foaf('maker'), me, chatDocument))\n msg.maker = me.uri\n // privateKey the cached private key of me, cached in store\n const privateKey = await getPrivateKey(me) // me.uri)\n\n const sig = signMsg(msg, privateKey)\n sts.push($rdf.st(message, $rdf.sym(`${SEC}proofValue`), $rdf.lit(sig), chatDocument))\n }\n try {\n await store.updater.update([], sts)\n } catch (err) {\n const errMsg = 'Error saving chat message: ' + err\n debug.warn(errMsg)\n alert(errMsg)\n throw new Error(errMsg)\n }\n return message\n }\n\n /* Mark a message as deleted\n * Wee add a new version of the message,m witha deletion flag (deletion date)\n * so that the deletion can be revoked by adding another non-deleted update\n */\n async deleteMessage (message) {\n return this.updateMessage('(message deleted)', message, true)\n }\n} // class ChatChannel\n\nexport function originalVersion (message) {\n let msg = message\n while (msg) {\n message = msg\n msg = store.any(null, ns.dct('isReplacedBy'), message, message.doc())\n }\n return message\n}\n\nexport function mostRecentVersion (message) {\n let msg = message\n while (msg) {\n message = msg\n msg = store.any(message, ns.dct('isReplacedBy'), null, message.doc())\n }\n return message\n}\n\nexport function isDeleted (message) {\n return store.holds(message, ns.schema('dateDeleted'), null, message.doc())\n}\n\nexport function isReplaced (message) {\n return store.holds(message, ns.dct('isReplacedBy'), null, message.doc())\n}\n\nexport function isHidden (message) {\n return this.isDeleted(message) || this.isReplaced(message)\n}\n\n// A Nickname for a person\n\nexport function nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n}\n\nexport async function _createIfNotExists (doc, contentType = 'text/turtle', data = '') {\n let response\n try {\n response = await store.fetcher.load(doc)\n } catch (err) {\n if (err.response.status === 404) {\n debug.log(\n 'createIfNotExists: doc does NOT exist, will create... ' + doc\n )\n try {\n response = await store.fetcher.webOperation('PUT', doc.uri, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + doc + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[doc.uri] // delete cached 404 error\n // debug.log('createIfNotExists doc created ok ' + doc)\n return response\n } else {\n debug.log(\n 'createIfNotExists doc load error NOT 404: ' + doc + ': ' + err\n )\n throw err\n }\n }\n return response\n}\n// ends\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,IAAA,GAAAL,u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gC,SAAA,CAAA1F,IAAA;YAAA;UAAA;YAAA0F,SAAA,CAAA3F,IAAA;YAAA2F,SAAA,CAAAM,EAAA,GAAAN,SAAA;YAKRhJ,KAAK,CAACoJ,GAAG,CAAC,gCAAgC,GAAG/G,GAAG,GAAG,IAAI,GAAA2G,SAAA,CAAAM,EAAM,CAAC;YAAA,MAAAN,SAAA,CAAAM,EAAA;UAAA;YAGhE,OAAO9D,iBAAK,CAACyD,OAAO,CAACM,SAAS,CAAClH,GAAG,CAACqD,GAAG,CAAC,EAAC;YACxC;YAAA,OAAAsD,SAAA,CAAAzF,MAAA,WACOuF,QAAQ;UAAA;YAEf9I,KAAK,CAACoJ,GAAG,CACP,6CAA6C,GAAG/G,GAAG,GAAG,IAAI,GAAA2G,SAAA,CAAAzB,EAC5D,CAAC;YAAA,MAAAyB,SAAA,CAAAzB,EAAA;UAAA;YAAA,OAAAyB,SAAA,CAAAzF,MAAA,WAIEuF,QAAQ;UAAA;UAAA;YAAA,OAAAE,SAAA,CAAAvF,IAAA;QAAA;MAAA,GAAAoF,QAAA;IAAA;EAAA,CAChB;EAAA,OAAAH,mBAAA,CAAA9E,KAAA,OAAAC,SAAA;AAAA"} \ No newline at end of file +{"version":3,"file":"chatLogic.js","names":["debug","_interopRequireWildcard","require","_dateFolder","_solidLogic","ns","$rdf","utils","_signature","_keys","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ChatChannel","exports","channel","options","_classCallCheck2","channelRoot","doc","dateFolder","DateFolder","div","_createClass2","key","value","_createMessage","_asyncToGenerator2","_regenerator","mark","_callee","text","wrap","_callee$","_context","prev","next","abrupt","updateMessage","stop","createMessage","_x","apply","arguments","_updateMessage","_this","oldMsg","length","undefined","deleteIt","_callee2","sts","now","timestamp","dateStamp","chatDocument","message","me","msg","oldMsgMaker","errMsg","privateKey","sig","_errMsg","_callee2$","_context2","Date","getTime","term","leafDocumentFromDate","store","sym","uri","authn","currentUser","getBlankMsg","id","any","foaf","push","st","mostRecentVersion","dct","schema","warn","alert","Error","wf","sioc","literal","content","created","maker","getPrivateKey","sent","signMsg","concat","SEC","lit","updater","update","t0","_x2","_deleteMessage","_callee3","_callee3$","_context3","deleteMessage","_x3","originalVersion","isDeleted","holds","isReplaced","isHidden","nick","person","s","label","_createIfNotExists","_x4","_createIfNotExists2","contentType","data","_callee4","response","_callee4$","_context4","fetcher","load","status","log","webOperation","t1","requested"],"sources":["../../src/chat/chatLogic.js"],"sourcesContent":["/**\n * Contains the [[ChatChannel]] class and logic for Solid Chat\n * @packageDocumentation\n */\n\nimport * as debug from '../debug'\nimport { DateFolder } from './dateFolder'\nimport { store, authn } from 'solid-logic'\nimport * as ns from '../ns'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as utils from '../utils'\nimport { getBlankMsg, signMsg, SEC, verifySignature } from './signature'\nimport { getPrivateKey, getPublicKey } from './keys'\n\n/* The Solid logic for a 'LongChat'\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 */\n\nexport class ChatChannel {\n constructor (channel, options) {\n this.channel = channel\n this.channelRoot = channel.doc()\n this.options = options\n this.dateFolder = new DateFolder(this.channelRoot, 'chat.ttl')\n this.div = null // : HTMLElement\n }\n\n /* Store a new message in the web,\n */\n async createMessage (text) {\n return this.updateMessage(text)\n }\n\n /* Store a new message in the web,\n as a replacement for an existing one.\n The old one iis left, and the two are linked\n */\n async updateMessage (text, oldMsg = null, deleteIt) {\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n const chatDocument = oldMsg ? oldMsg.doc() : this.dateFolder.leafDocumentFromDate(now)\n const message = store.sym(chatDocument.uri + '#' + 'Msg' + timestamp)\n // const content = store.literal(text)\n\n const me = authn.currentUser() // If already logged on\n\n const msg = getBlankMsg()\n msg.id = message.uri\n if (oldMsg) { // edit message replaces old one\n const oldMsgMaker = store.any(oldMsg, ns.foaf('maker')) // may not be needed here, but needed on READ\n if (oldMsgMaker.uri === me.uri) {\n sts.push($rdf.st(mostRecentVersion(oldMsg), ns.dct('isReplacedBy'), message, chatDocument))\n if (deleteIt) { // we need to add a specific signature, else anyone can delete a msg ?\n sts.push($rdf.st(message, ns.schema('dateDeleted'), dateStamp, chatDocument))\n }\n } else {\n const errMsg = 'Error you cannot delete/edit a message from someone else : \\n' + oldMsgMaker.uri\n debug.warn(errMsg)\n alert(errMsg)\n throw new Error(errMsg)\n }\n } else { // link new message to channel\n sts.push($rdf.st(this.channel, ns.wf('message'), message, chatDocument))\n }\n sts.push(\n $rdf.st(message, ns.sioc('content'), store.literal(text), chatDocument)\n )\n msg.content = text\n\n sts.push(\n $rdf.st(message, ns.dct('created'), dateStamp, chatDocument)\n )\n msg.created = dateStamp.value\n if (me) {\n sts.push($rdf.st(message, ns.foaf('maker'), me, chatDocument))\n msg.maker = me.uri\n // privateKey the cached private key of me, cached in store\n const privateKey = await getPrivateKey(me) // me.uri)\n\n const sig = signMsg(msg, privateKey)\n sts.push($rdf.st(message, $rdf.sym(`${SEC}proofValue`), $rdf.lit(sig), chatDocument))\n }\n try {\n await store.updater.update([], sts)\n } catch (err) {\n const errMsg = 'Error saving chat message: ' + err\n debug.warn(errMsg)\n alert(errMsg)\n throw new Error(errMsg)\n }\n return message\n }\n\n /* Mark a message as deleted\n * Wee add a new version of the message,m witha deletion flag (deletion date)\n * so that the deletion can be revoked by adding another non-deleted update\n */\n async deleteMessage (message) {\n return this.updateMessage('(message deleted)', message, true)\n }\n} // class ChatChannel\n\nexport function originalVersion (message) {\n let msg = message\n while (msg) {\n message = msg\n msg = store.any(null, ns.dct('isReplacedBy'), message, message.doc())\n }\n return message\n}\n\nexport function mostRecentVersion (message) {\n let msg = message\n while (msg) {\n message = msg\n msg = store.any(message, ns.dct('isReplacedBy'), null, message.doc())\n }\n return message\n}\n\nexport function isDeleted (message) {\n return store.holds(message, ns.schema('dateDeleted'), null, message.doc())\n}\n\nexport function isReplaced (message) {\n return store.holds(message, ns.dct('isReplacedBy'), null, message.doc())\n}\n\nexport function isHidden (message) {\n return this.isDeleted(message) || this.isReplaced(message)\n}\n\n// A Nickname for a person\n\nexport function nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n}\n\nexport async function _createIfNotExists (doc, contentType = 'text/turtle', data = '') {\n let response\n try {\n response = await store.fetcher.load(doc)\n } catch (err) {\n if (err.response.status === 404) {\n debug.log(\n 'createIfNotExists: doc does NOT exist, will create... ' + doc\n )\n try {\n response = await store.fetcher.webOperation('PUT', doc.uri, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + doc + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[doc.uri] // delete cached 404 error\n // debug.log('createIfNotExists doc created ok ' + doc)\n return response\n } else {\n debug.log(\n 'createIfNotExists doc load error NOT 404: ' + doc + ': ' + err\n )\n throw err\n }\n }\n return response\n}\n// ends\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,IAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAAoD,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA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yD,OAAO,CAACM,SAAS,CAAClH,GAAG,CAACqD,GAAG,CAAC,EAAC;YACxC;YAAA,OAAAsD,SAAA,CAAAzF,MAAA,WACOuF,QAAQ;UAAA;YAEf9I,KAAK,CAACoJ,GAAG,CACP,6CAA6C,GAAG/G,GAAG,GAAG,IAAI,GAAA2G,SAAA,CAAAzB,EAC5D,CAAC;YAAA,MAAAyB,SAAA,CAAAzB,EAAA;UAAA;YAAA,OAAAyB,SAAA,CAAAzF,MAAA,WAIEuF,QAAQ;UAAA;UAAA;YAAA,OAAAE,SAAA,CAAAvF,IAAA;QAAA;MAAA,GAAAoF,QAAA;IAAA;EAAA,CAChB;EAAA,OAAAH,mBAAA,CAAA9E,KAAA,OAAAC,SAAA;AAAA"} \ No newline at end of file diff --git a/lib/chat/infinite.js b/lib/chat/infinite.js index 0268c676..37aa8068 100644 --- a/lib/chat/infinite.js +++ b/lib/chat/infinite.js @@ -258,7 +258,6 @@ function _infiniteMessageArea() { if (freeze) { div.scrollTop = scrollTop; // while adding below keep same things in view } - if (fixScroll) fixScroll(); if (!done) { _context10.next = 31; @@ -539,7 +538,6 @@ function _infiniteMessageArea() { } else { messageTable.appendChild(tr); // not newestFirst } - messageTable.inputRow = tr; } @@ -579,7 +577,6 @@ function _infiniteMessageArea() { messageTable.appendChild(scrollBackbuttonTR); // newestFirst } } - var sts = _solidLogic.store.statementsMatching(null, ns.wf('message'), null, chatDocument); if (!live && sts.length === 0) { // not todays @@ -717,7 +714,6 @@ function _infiniteMessageArea() { if ((0, _chatLogic.isDeleted)(latest) && !options.showDeletedMessages) { return; // ignore deleted messaged -- @@ could also leave a placeholder } - insertMessageIntoTable(channelObject, messageTable, message, messageTable.fresh, options, userContext); // fresh from elsewhere }; syncMessages = function _syncMessages(about, messageTable) { @@ -778,7 +774,6 @@ function _infiniteMessageArea() { /* Add the live message block with entry field for today */ // Body of main function - options = options || {}; options.authorDateOnLeft = false; // @@ make a user optiosn newestFirst = options.newestFirst === '1' || options.newestFirst === true; // hack for now diff --git a/lib/chat/infinite.js.map b/lib/chat/infinite.js.map index 1ed2bb12..97fc7544 100644 --- a/lib/chat/infinite.js.map +++ b/lib/chat/infinite.js.map @@ -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","prototype","hasOwnProperty","call","i","set","desktopNotification","str","window","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","channelObject","messageTable","message","fresh","options","userContext","messageRow","renderMessageRow","selectedMessage","sameTerm","style","backgroundColor","selectedElement","done","ele","firstChild","nextSibling","newestFirst","newestfirst","dateString","AJAR_date","insertBefore","appendChild","infiniteMessageArea","_x","_x2","_x3","_x4","_infiniteMessageArea","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee12","dom","wasStore","chatChannel","syncMessages","addMessage","insertPreviousMessages","_insertPreviousMessages","removePreviousMessages","createMessageTable","_createMessageTable","renderMessageTable","addNewChatDocumentIfNewDay","_addNewChatDocumentIfNewDay","appendCurrentMessages","_appendCurrentMessages","loadMoreWhereNeeded","_loadMoreWhereNeeded","loadInitialContent","_loadInitialContent","dateFolder","div","statusArea","liveMessageTable","earliest","latest","lock","wrap","_callee12$","_context12","prev","next","_loadInitialContent3","_callee11","yank","fixScroll","live","selectedDocument","now","todayDocument","selectedMessageTable","selectedDate","_callee11$","_context11","_fixScroll","scrollIntoView","block","inputRow","_yank","doc","Date","leafDocumentFromDate","dateFromLeafDocument","sent","setTimeout","addEventListener","solo","document","body","stop","_loadInitialContent2","_loadMoreWhereNeeded3","_callee10","event","freeze","magicZone","scrollBottom","scrollTop","_callee10$","_context10","abrupt","initial","extendBackwards","scrollHeight","log","clientHeight","extendForwards","_loadMoreWhereNeeded2","_x10","_x11","_appendCurrentMessage2","_callee9","chatDocument","_callee9$","_context9","refresh","_callee8","_callee8$","_context8","store","updater","addDownstreamChangeListener","_appendCurrentMessage","_addNewChatDocumentIf2","_callee7","newChatDocument","oldChatDocument","sts","_callee7$","_context7","removeChild","holds","rdfs","st","update","err","alert","_addNewChatDocumentIf","_renderMessageTable","date","scrollBackbutton","scrollForwardButton","_extendBackwards","_callee","_callee$","_context","setAttribute","icons","iconBase","disabled","extendedBack","setScrollBackbuttonIcon","sense","scrollBackIcon","getScrollbackIcon","scrollBackbuttonHandler","_x8","_scrollBackbuttonHandler","_callee2","_event","_callee2$","_context2","_extendForwards","_callee3","_callee3$","_context3","extendedForwards","setScrollForwardButtonIcon","scrollForwardIcon","getScrollForwardButtonIcon","scrollForwardButtonHandler","_x9","_scrollForwardButtonHandler","_callee4","_callee4$","_context4","createElement","tr","renderMessageEditor","infinite","scrollBackbuttonTR","scrollBackbuttonCell","button","dateCell","textContent","shortDate","toISOString","scrollForwardButtonCell","extendedForward","statementsMatching","wf","length","forEach","object","_createMessageTable3","_callee6","statusTR","_callee6$","_context6","fetcher","load","t0","response","status","errorMessageBlock","_createMessageTable2","_x6","_x7","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee5","extremity","todayDoc","newMessageTable","_callee5$","_context5","loadPrevious","concat","_insertPreviousMessag","_x5","_addMessage","mostRecentVersion","isDeleted","showDeletedMessages","_syncMessages","about","displayed","ele2","AJAR_subject","uri","messages","map","stored","m","refreshTree","authorDateOnLeft","ChatChannel"],"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, mostRecentVersion } 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 function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = 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 function syncMessages (about, 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\n const messages = store\n .statementsMatching(\n about,\n ns.wf('message'),\n null,\n messageTable.chatDocument\n )\n .map(st => {\n return st.object\n })\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n 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 function addMessage (message, messageTable) {\n const latest = mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(latest) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n\n /* Add a new messageTable at the top/bottom\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\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.load(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 renderMessageTable(date, live) // no mssage file is fine.. will be craeted 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 renderMessageTable(date, live)\n }\n\n function renderMessageTable (date, live) {\n let scrollBackbutton\n let scrollForwardButton\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 async function scrollBackbuttonHandler (_event) {\n if (messageTable.extendedBack) {\n removePreviousMessages(true, messageTable)\n messageTable.extendedBack = false\n setScrollBackbuttonIcon()\n } else {\n await extendBackwards()\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\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 return done\n }\n\n function setScrollForwardButtonIcon () {\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 const messageTable = dom.createElement('table')\n\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 if (options.infinite) {\n const scrollBackbuttonTR = dom.createElement('tr')\n const scrollBackbuttonCell = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\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 = scrollBackbuttonTR.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 = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\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(scrollBackbuttonTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(scrollBackbuttonTR) // 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 sts.forEach(st => {\n addMessage(st.object, messageTable)\n })\n messageTable.fresh = true\n\n // loadMessageTable(messageTable, chatDocument)\n messageTable.fresh = false\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 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 // console.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // console.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 selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\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\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(selectedDocument)\n }\n let selectedMessageTable\n if (options.selectedMessage && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(selectedDocument)\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 // const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable\n\n let liveMessageTable\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";;;;;;;;;;;;AAKA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAL,uBAAA,CAAAC,OAAA;AAGA,IAAAK,OAAA,GAAAN,uBAAA,CAAAC,OAAA;AAGA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAiE,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0B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U,GAAGtD,aAAa,CAACsD,UAAU;UAErCC,GAAG,GAAGpB,GAAG,CAACiJ,aAAa,CAAC,KAAK,CAAC;UACpCpL,aAAa,CAACuD,GAAG,GAAGA,GAAG;UAEjBC,UAAU,GAAGD,GAAG,CAACjC,WAAW,CAACa,GAAG,CAACiJ,aAAa,CAAC,KAAK,CAAC,CAAC;UACtD/K,WAAW,GAAG;YAAE8B,GAAG,EAAHA,GAAG;YAAEqB,UAAU,EAAVA,UAAU;YAAED,GAAG,EAAEC;UAAW,CAAC,EAAC;UAEzD;UAGME,QAAQ,GAAG;YAAEzD,YAAY,EAAE;UAAK,CAAC,EAAC;UAClC0D,MAAM,GAAG;YAAE1D,YAAY,EAAE;UAAK,CAAC;UAEjC2D,IAAI,GAAG,KAAK;UAAAG,UAAA,CAAAE,IAAA;UAAA,OAEVb,kBAAkB,CAAC,CAAC;QAAA;UAAA,OAAAW,UAAA,CAAAyC,MAAA,WACnBjD,GAAG;QAAA;QAAA;UAAA,OAAAQ,UAAA,CAAA8B,IAAA;MAAA;IAAA,GAAA3D,SAAA;EAAA,CACX;EAAA,OAAAN,oBAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"} \ No newline at end of file +{"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","prototype","hasOwnProperty","call","i","set","desktopNotification","str","window","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","channelObject","messageTable","message","fresh","options","userContext","messageRow","renderMessageRow","selectedMessage","sameTerm","style","backgroundColor","selectedElement","done","ele","firstChild","nextSibling","newestFirst","newestfirst","dateString","AJAR_date","insertBefore","appendChild","infiniteMessageArea","_x","_x2","_x3","_x4","_infiniteMessageArea","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee12","dom","wasStore","chatChannel","syncMessages","addMessage","insertPreviousMessages","_insertPreviousMessages","removePreviousMessages","createMessageTable","_createMessageTable","renderMessageTable","addNewChatDocumentIfNewDay","_addNewChatDocumentIfNewDay","appendCurrentMessages","_appendCurrentMessages","loadMoreWhereNeeded","_loadMoreWhereNeeded","loadInitialContent","_loadInitialContent","dateFolder","div","statusArea","liveMessageTable","earliest","latest","lock","wrap","_callee12$","_context12","prev","next","_loadInitialContent3","_callee11","yank","fixScroll","live","selectedDocument","now","todayDocument","selectedMessageTable","selectedDate","_callee11$","_context11","_fixScroll","scrollIntoView","block","inputRow","_yank","doc","Date","leafDocumentFromDate","dateFromLeafDocument","sent","setTimeout","addEventListener","solo","document","body","stop","_loadInitialContent2","_loadMoreWhereNeeded3","_callee10","event","freeze","magicZone","scrollBottom","scrollTop","_callee10$","_context10","abrupt","initial","extendBackwards","scrollHeight","log","clientHeight","extendForwards","_loadMoreWhereNeeded2","_x10","_x11","_appendCurrentMessage2","_callee9","chatDocument","_callee9$","_context9","refresh","_callee8","_callee8$","_context8","store","updater","addDownstreamChangeListener","_appendCurrentMessage","_addNewChatDocumentIf2","_callee7","newChatDocument","oldChatDocument","sts","_callee7$","_context7","removeChild","holds","rdfs","st","update","err","alert","_addNewChatDocumentIf","_renderMessageTable","date","scrollBackbutton","scrollForwardButton","_extendBackwards","_callee","_callee$","_context","setAttribute","icons","iconBase","disabled","extendedBack","setScrollBackbuttonIcon","sense","scrollBackIcon","getScrollbackIcon","scrollBackbuttonHandler","_x8","_scrollBackbuttonHandler","_callee2","_event","_callee2$","_context2","_extendForwards","_callee3","_callee3$","_context3","extendedForwards","setScrollForwardButtonIcon","scrollForwardIcon","getScrollForwardButtonIcon","scrollForwardButtonHandler","_x9","_scrollForwardButtonHandler","_callee4","_callee4$","_context4","createElement","tr","renderMessageEditor","infinite","scrollBackbuttonTR","scrollBackbuttonCell","button","dateCell","textContent","shortDate","toISOString","scrollForwardButtonCell","extendedForward","statementsMatching","wf","length","forEach","object","_createMessageTable3","_callee6","statusTR","_callee6$","_context6","fetcher","load","t0","response","status","errorMessageBlock","_createMessageTable2","_x6","_x7","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee5","extremity","todayDoc","newMessageTable","_callee5$","_context5","loadPrevious","concat","_insertPreviousMessag","_x5","_addMessage","mostRecentVersion","isDeleted","showDeletedMessages","_syncMessages","about","displayed","ele2","AJAR_subject","uri","messages","map","stored","m","refreshTree","authorDateOnLeft","ChatChannel"],"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, mostRecentVersion } 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 function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = 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 function syncMessages (about, 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\n const messages = store\n .statementsMatching(\n about,\n ns.wf('message'),\n null,\n messageTable.chatDocument\n )\n .map(st => {\n return st.object\n })\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n 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 function addMessage (message, messageTable) {\n const latest = mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(latest) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n\n /* Add a new messageTable at the top/bottom\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\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.load(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 renderMessageTable(date, live) // no mssage file is fine.. will be craeted 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 renderMessageTable(date, live)\n }\n\n function renderMessageTable (date, live) {\n let scrollBackbutton\n let scrollForwardButton\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 async function scrollBackbuttonHandler (_event) {\n if (messageTable.extendedBack) {\n removePreviousMessages(true, messageTable)\n messageTable.extendedBack = false\n setScrollBackbuttonIcon()\n } else {\n await extendBackwards()\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\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 return done\n }\n\n function setScrollForwardButtonIcon () {\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 const messageTable = dom.createElement('table')\n\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 if (options.infinite) {\n const scrollBackbuttonTR = dom.createElement('tr')\n const scrollBackbuttonCell = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\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 = scrollBackbuttonTR.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 = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\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(scrollBackbuttonTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(scrollBackbuttonTR) // 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 sts.forEach(st => {\n addMessage(st.object, messageTable)\n })\n messageTable.fresh = true\n\n // loadMessageTable(messageTable, chatDocument)\n messageTable.fresh = false\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 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 // console.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // console.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 selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\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\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(selectedDocument)\n }\n let selectedMessageTable\n if (options.selectedMessage && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(selectedDocument)\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 // const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable\n\n let liveMessageTable\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";;;;;;;;;;;;AAKA,IAAAA,IAAA,GAAAC,uBAAA,C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UAAA,CAAA8B,IAAA;MAAA;IAAA,GAAA3D,SAAA;EAAA,CACX;EAAA,OAAAN,oBAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"} \ No newline at end of file diff --git a/lib/chat/message.js b/lib/chat/message.js index 7ae7a408..9c0a120c 100644 --- a/lib/chat/message.js +++ b/lib/chat/message.js @@ -34,9 +34,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /** UI code for individual messages: display them, edit them - * - * @packageDocumentation - */ /* global $rdf */ + * + * @packageDocumentation + */ /* global $rdf */ var dom = window.document; var messageBodyStyle = style.messageBodyStyle; var label = utils.label; @@ -72,7 +72,6 @@ var anchor = function anchor(text, term) { a.addEventListener('click', widgets.openHrefInOutlineMode, true); a.setAttribute('style', 'color: #3B5998; text-decoration: none; '); // font-weight: bold } - a.textContent = text; return a; }; @@ -329,7 +328,6 @@ function renderMessageEditor(channelObject, messageTable, userContext, options, oldRow.style.backgroundColor = '#fee'; oldRow.style.visibility = 'hidden'; // @@ FIX THIS AND REMOVE FROM DOM INSTEAD } - messageEditor.parentNode.removeChild(messageEditor); // no longer need editor } else { if (fromMainField) { @@ -343,7 +341,6 @@ function renderMessageEditor(channelObject, messageTable, userContext, options, } // await channelObject.div.refresh() // Add new day if nec @@ add back }; - // const me = authn.currentUser() // Must be logged on or wuld have got login button if (fromMainField) { field.setAttribute('style', messageBodyStyle + 'color: #bbb;'); // pendingedit @@ -560,7 +557,6 @@ function renderMessageEditor(channelObject, messageTable, userContext, options, sortDate = '9999-01-01T00:00:00Z'; // ISO format for field sort // text = '' } - var messageEditor = dom.createElement('tr'); var lhs = dom.createElement('td'); var middle = dom.createElement('td'); diff --git a/lib/chat/message.js.map b/lib/chat/message.js.map index ce5032bb..886946d6 100644 --- a/lib/chat/message.js.map +++ b/lib/chat/message.js.map @@ -1 +1 @@ -{"version":3,"file":"message.js","names":["_infinite","require","_messageTools","_bookmarks","_chatLogic","debug","_interopRequireWildcard","_iconBase","_solidLogic","_login","_index","ns","pad","style","utils","widgets","_signature","_keys","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","dom","window","document","messageBodyStyle","label","elementForImageURI","imageUri","options","img","createElement","height","inlineImageHeightEms","trim","setAttribute","anchor","appendChild","makeDraggable","$rdf","sym","text","term","uri","addEventListener","openHrefInOutlineMode","textContent","nickname","person","store","any","foaf","creatorAndDate","td1","creator","date","message","nickAnchor","fetcher","nowOrWhenFetched","doc","undefined","_ok","_body","creatorAndDateHorizontal","dateBit","fontSize","marginLeft","renderMessageRow","channelObject","fresh","userContext","unsignedMessage","colorizeByAuthor","dct","latestVersion","mostRecentVersion","latestVersionCreator","msgId","content","sioc","signature","concat","SEC","msg","getBlankMsg","id","created","maker","warn","getPublicKey","then","publicKey","log","regex","match","verifySignature","originalMessage","originalVersion","edited","sameTerm","sortDate","the","messageRow","AJAR_date","AJAR_subject","authorDateOnLeft","setImage","shortDate","bothDates","td2","isURI","para","isImage","expandImagesInline","anc","href","bgcolor","lightColorHash","getBgColor","strip","sentimentStripLinked","children","td3","toolsButton","button","icons","iconBase","_event","toolTR","parentNode","removeChild","toolsTR","tools","messageToolbar","nextSibling","parentElement","insertBefore","toolsTD","switchToEditor","messageTable","editRow","renderMessageEditor","originalRow","visibility","revertEditing","messageEditor","handleFieldInput","_x","_handleFieldInput","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee5","wrap","_callee5$","_context6","prev","sendMessage","field","stop","_x2","_x3","_sendMessage","_callee6","fromMainField","sendComplete","statusArea","_callee6$","_context7","_sendComplete","_text2","insertMessageIntoTable","oldRow","backgroundColor","disabled","scrollIntoView","newestFirst","focus","select","updateMessage","sent","t0","errorMessageBlock","abrupt","droppedFileHandler","files","base","chatDocument","dir","uploadFiles","_ref","_callee","theFile","destURI","_callee$","_context2","_x4","_x5","droppedURIHandler","_ref2","_callee2","uris","_iterator","_step","_callee2$","_context3","finish","_x6","turnOnInput","getImageDoc","imageDoc","Date","now","tookPicture","_x7","_tookPicture","_callee4","_callee4$","_context5","menuButton","menuHandler","buttonStyle","rhs","me","authn","currentUser","menuOptions","div","newBase","event","chatChannel","lhs","middle","innerHTML","rows","anyValue","_ref3","_callee3","_callee3$","_context4","code","shiftKey","shiftEnterSendsMessage","_x8","makeDropTarget","sendButton","sendIcon","cancelButton","dateFolder","leafDocumentFromDate","media","cameraButton","recordParticipation","channel","context","ensureLoggedIn","assign","findBookmarkDocument","_context"],"sources":["../../src/chat/message.js"],"sourcesContent":["/** UI code for individual messages: display them, edit them\n *\n * @packageDocumentation\n */\n\n/* global $rdf */\nimport { insertMessageIntoTable } from './infinite'\nimport { messageToolbar, sentimentStripLinked } from './messageTools'\nimport { findBookmarkDocument } from './bookmarks'\nimport { mostRecentVersion, originalVersion } from './chatLogic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { store, authn } from 'solid-logic'\nimport { ensureLoggedIn } from '../login/login'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as pad from '../pad'\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { getBlankMsg, verifySignature, SEC } from './signature'\nimport { getPublicKey } from './keys'\n\nconst dom = window.document\nconst messageBodyStyle = style.messageBodyStyle\n\nconst label = utils.label\n\n/**\n * elementForImageURI\n * HTML component for an image\n * @param imageUri\n * @param options { inlineImageHeightEms }\n * @returns HTMLAnchorElement For Image\n */\nexport function elementForImageURI (imageUri, options) {\n const img = dom.createElement('img')\n let height = '10'\n if (options.inlineImageHeightEms) {\n height = ('' + options.inlineImageHeightEms).trim()\n }\n img.setAttribute(\n 'style',\n 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'\n )\n // widgets.makeDropTarget(img, handleURIsDroppedOnMugshot, droppedFileHandler)\n if (imageUri) img.setAttribute('src', imageUri)\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', imageUri)\n anchor.setAttribute('target', 'images')\n anchor.appendChild(img)\n widgets.makeDraggable(img, $rdf.sym(imageUri))\n return anchor\n}\n\nconst anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n}\n\nfunction nickname (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + label(person)\n}\n\n/**\n * creatorAndDate\n * Displays creator and date for a chat message\n * inside the `td1` element\n * @param td1\n * @param creator\n * @param date\n * @param message\n * @returns HTMLAnchorElement For Image\n */\nexport function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nickname(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nickname(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n}\n\n/**\n * creatorAndDateHorizontal\n * Horizontally displays creator and date for a chat message\n * inside the `td1` element\n * @param td1\n * @param creator\n * @param date\n * @param message\n * @returns HTMLAnchorElement For Image\n */\nexport function creatorAndDateHorizontal (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(label(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nickname(creator)\n })\n }\n const dateBit = td1.appendChild(anchor(date, message))\n dateBit.style.fontSize = '80%'\n dateBit.style.marginLeft = '1em'\n td1.appendChild(dom.createElement('br'))\n}\n\n/**\n * renderMessageRow\n * Renders a chat message, read-only mode\n * @param channelObject\n * @param message\n * @param fresh\n * @param options\n * @param userContext\n * @returns Message Row HTML Table Element\n */\nexport function renderMessageRow (channelObject, message, fresh, options, userContext) {\n let unsignedMessage = false\n const colorizeByAuthor =\n options.colorizeByAuthor === '1' || options.colorizeByAuthor === true\n\n const creator = store.any(message, ns.foaf('maker'))\n const date = store.any(message, ns.dct('created'))\n const latestVersion = mostRecentVersion(message)\n const latestVersionCreator = store.any(latestVersion, ns.foaf('maker'))\n\n // use latest content if same owner, else use original\n const msgId = creator.uri === latestVersionCreator.uri ? latestVersion : message\n const content = store.any(msgId, ns.sioc('content'))\n const signature = store.any(msgId, $rdf.sym(`${SEC}proofValue`))\n\n // set message object\n const msg = getBlankMsg()\n msg.id = msgId.uri\n msg.created = store.any(msgId, ns.dct('created')).value\n msg.content = content.value\n msg.maker = creator.uri\n\n // unsigned message\n if (!signature?.value) {\n unsignedMessage = true\n debug.warn(msgId.uri + ' is unsigned') // TODO replace with UI (colored message ?)\n } else { // signed message, get public key and check signature\n getPublicKey(creator).then(publicKey => {\n debug.log(creator.uri + '\\n' + msg.created + '\\n' + msg.id + '\\n' + publicKey)\n if (!publicKey) {\n // TODO try to recreate the publicKey\n // if(me.uri === creator.uri) await getPrivateKey(creator)\n debug.warn('message is signed but ' + creator.uri + ' is missing publicKey')\n }\n // check that publicKey is a valid hex string\n const regex = /[0-9A-Fa-f]{6}/g\n if (!publicKey?.match(regex)) debug.warn('invalid publicKey hex string\\n' + creator.uri + '\\n' + publicKey)\n // verify signature\n else if (signature?.value && !verifySignature(signature?.value, msg, publicKey)) debug.warn('invalid signature\\n' + msg.id)\n })\n }\n\n const originalMessage = originalVersion(message)\n const edited = !message.sameTerm(originalMessage)\n\n const sortDate = store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()) // In message\n\n const messageRow = dom.createElement('tr')\n if (unsignedMessage) messageRow.setAttribute('style', 'background-color: red')\n messageRow.AJAR_date = sortDate.value\n messageRow.AJAR_subject = message\n\n const td1 = dom.createElement('td')\n messageRow.appendChild(td1)\n if (!options.authorDateOnLeft) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;'\n )\n widgets.setImage(img, creator)\n td1.appendChild(img)\n } else {\n creatorAndDate(td1, creator, widgets.shortDate(sortDate.value), message)\n }\n let bothDates = widgets.shortDate(sortDate.value)\n if (edited) {\n bothDates += ' ... ' + widgets.shortDate(date.value)\n }\n\n // Render the content ot the message itself\n const td2 = messageRow.appendChild(dom.createElement('td'))\n\n if (!options.authorDateOnLeft) {\n creatorAndDateHorizontal(\n td2,\n creator,\n bothDates, // widgets.shortDate(dateString)\n message\n )\n }\n const text = content.value.trim()\n const isURI = /^https?:\\/[^ <>]*$/i.test(text)\n let para = null\n if (isURI) {\n const isImage = /\\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text) // @@ Should use content-type not URI\n if (isImage && options.expandImagesInline) {\n const img = elementForImageURI(text, options)\n td2.appendChild(img)\n } else {\n // Link but not Image\n const anc = td2.appendChild(dom.createElement('a'))\n para = anc.appendChild(dom.createElement('p'))\n anc.href = text\n para.textContent = text\n td2.appendChild(anc)\n }\n } else {\n // text\n para = dom.createElement('p')\n td2.appendChild(para)\n para.textContent = text\n }\n if (para) {\n const bgcolor = colorizeByAuthor\n ? pad.lightColorHash(creator)\n : getBgColor(fresh)\n para.setAttribute(\n 'style',\n messageBodyStyle + 'background-color: ' + bgcolor + ';'\n )\n }\n\n function getBgColor (fresh) {\n return fresh ? '#e8ffe8' : 'white'\n }\n\n // Sentiment strip\n const strip = sentimentStripLinked(message, message.doc())\n if (strip.children.length) {\n td2.appendChild(dom.createElement('br'))\n td2.appendChild(strip)\n }\n\n // Message tool bar button\n const td3 = dom.createElement('td')\n messageRow.appendChild(td3)\n const toolsButton = widgets.button(\n dom,\n icons.iconBase + 'noun_243787.svg',\n '...'\n )\n td3.appendChild(toolsButton)\n toolsButton.addEventListener('click', function (_event) {\n if (messageRow.toolTR) {\n // already got a toolbar? Toogle\n messageRow.parentNode.removeChild(messageRow.toolTR)\n delete messageRow.toolTR\n return\n }\n const toolsTR = dom.createElement('tr')\n const tools = messageToolbar(message, messageRow, userContext, channelObject)\n tools.style =\n 'border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;' // @@ fix\n if (messageRow.nextSibling) {\n messageRow.parentElement.insertBefore(toolsTR, messageRow.nextSibling)\n } else {\n messageRow.parentElement.appendChild(toolsTR)\n }\n messageRow.toolTR = toolsTR\n toolsTR.appendChild(dom.createElement('td')) // left\n const toolsTD = toolsTR.appendChild(dom.createElement('td'))\n toolsTR.appendChild(dom.createElement('td')) // right\n toolsTD.appendChild(tools)\n })\n return messageRow\n} // END OF RENDERMESSAGE\n\nexport function switchToEditor (messageRow, message, channelObject, userContext) {\n const messageTable = messageRow.parentNode\n const editRow = renderMessageEditor(channelObject, messageTable, userContext,\n channelObject.options, mostRecentVersion(message))\n messageTable.insertBefore(editRow, messageRow)\n editRow.originalRow = messageRow\n messageRow.style.visibility = 'hidden' // Hide the original message. unhide if user cancels edit\n}\n/* Control for a new message -- or editing an old message ***************\n *\n */\nexport function renderMessageEditor (channelObject, messageTable, userContext, options, originalMessage) {\n function revertEditing (messageEditor) {\n messageEditor.originalRow.style.visibility = 'visible' // restore read-only version\n messageEditor.parentNode.removeChild(messageEditor)\n }\n\n async function handleFieldInput (_event) {\n await sendMessage(field.value, true)\n }\n\n async function sendMessage (text, fromMainField) {\n function sendComplete (message, _text2) {\n insertMessageIntoTable(channelObject, messageTable, message, false, options, userContext) // not green\n\n if (originalMessage) { // editing another message\n const oldRow = messageEditor.originalRow\n // oldRow.style.display = '' // restore read-only version, re-attack\n if (oldRow.parentNode) {\n oldRow.parentNode.removeChild(oldRow) // No longer needed old version\n } else {\n debug.warn('No parentNode on old message ' + oldRow.textContent)\n oldRow.style.backgroundColor = '#fee'\n oldRow.style.visibility = 'hidden' // @@ FIX THIS AND REMOVE FROM DOM INSTEAD\n }\n messageEditor.parentNode.removeChild(messageEditor) // no longer need editor\n } else {\n if (fromMainField) {\n field.value = '' // clear from out for reuse\n field.setAttribute('style', messageBodyStyle)\n field.disabled = false\n field.scrollIntoView(options.newestFirst) // allign bottom (top)\n field.focus() // Start typing next line immediately\n field.select()\n }\n }\n // await channelObject.div.refresh() // Add new day if nec @@ add back\n }\n\n // const me = authn.currentUser() // Must be logged on or wuld have got login button\n if (fromMainField) {\n field.setAttribute('style', messageBodyStyle + 'color: #bbb;') // pendingedit\n field.disabled = true\n }\n\n let message\n try {\n message = await channelObject.updateMessage(text, originalMessage)\n } catch (err) {\n const statusArea = userContext.statusArea || messageEditor\n statusArea.appendChild(\n widgets.errorMessageBlock(dom, 'Error writing message: ' + err)\n )\n return\n }\n sendComplete(message, text)\n } // sendMessage\n\n // DRAG AND DROP\n function droppedFileHandler (files) {\n const base = messageTable.chatDocument.dir().uri\n widgets.uploadFiles(\n store.fetcher,\n files,\n base + 'Files',\n base + 'Pictures',\n async function (theFile, destURI) {\n // @@@@@@ Wait for each if several\n await sendMessage(destURI)\n }\n )\n }\n\n // When a set of URIs are dropped on the field\n const droppedURIHandler = async function (uris) {\n for (const uri of uris) {\n await sendMessage(uri)\n }\n }\n\n // When we are actually logged on\n function turnOnInput () {\n function getImageDoc () {\n imageDoc = $rdf.sym(\n chatDocument.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await sendMessage(imageDoc.uri)\n }\n }\n\n // Body of turnOnInput\n\n let menuButton\n if (options.menuHandler) {\n const menuButton = widgets.button(\n dom, icons.iconBase + 'noun_243787.svg', 'More')\n menuButton.setAttribute('style', style.buttonStyle + 'float: right;')\n // menuButton.addEventListener('click', _event => sendMessage(), false) (done in turnoninput)\n rhs.appendChild(menuButton)\n }\n\n if (options.menuHandler && menuButton) {\n const me = authn.currentUser()\n const menuOptions = {\n me,\n dom,\n div: null, // @@ was: div\n newBase: messageTable.chatDocument.dir().uri\n }\n menuButton.addEventListener(\n 'click',\n event => {\n options.menuHandler(event, channelObject.chatChannel, menuOptions)\n },\n false\n )\n }\n\n const me = authn.currentUser() // If already logged on\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n if (originalMessage) {\n field.value = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n }\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n // Trap the Enter BEFORE it is used ti make a newline\n\n field.addEventListener(\n 'keydown',\n async function (e) {\n // User preference?\n if (e.code === 'Enter') {\n // if (e.keyCode === 13) { // deprocated https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n if ((!e.shiftKey && !options.shiftEnterSendsMessage) || (e.shiftKey && options.shiftEnterSendsMessage)) {\n // Shift-Enter just adds a new line\n // (note alt-enter doesn't add newline anyway on my setup - so have to use shift.\n await handleFieldInput(e)\n }\n }\n },\n false\n )\n\n widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler)\n\n rhs.innerHTML = ''\n\n sendButton = widgets.button(dom, sendIcon, 'Send')\n sendButton.style.float = 'right'\n sendButton.addEventListener('click', _event => handleFieldInput(), false)\n rhs.appendChild(sendButton)\n\n if (originalMessage) { // Are we editing another message?\n const cancelButton = rhs.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'left'\n // cancelButton.firstChild.style.opacity = '0.3' // moved to buttons\n cancelButton.addEventListener('click', _event => revertEditing(messageEditor), false)\n rhs.appendChild(cancelButton)\n }\n\n const chatDocument = channelObject.dateFolder.leafDocumentFromDate(new Date())\n let imageDoc\n\n middle.appendChild(\n media.cameraButton(dom, store, getImageDoc, tookPicture)\n )\n\n pad.recordParticipation(channelObject.channel, channelObject.channel.doc()) // participation =\n } // turn on inpuut\n\n // Body of renderMessageEditor\n\n let sortDate, sendIcon\n if (originalMessage) {\n sortDate = store.anyValue(originalMessage, ns.dct('created'), null, originalMessage.doc())\n // text = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n sendIcon = icons.iconBase + 'noun_1180158.svg' // Green check\n // cancelIcon = icons.iconBase + 'noun_1180156.svg' // Black cross\n } else {\n sendIcon = icons.iconBase + 'noun_383448.svg'\n sortDate = '9999-01-01T00:00:00Z' // ISO format for field sort\n // text = ''\n }\n const messageEditor = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n messageEditor.appendChild(lhs)\n messageEditor.appendChild(middle)\n messageEditor.appendChild(rhs)\n messageEditor.AJAR_date = sortDate\n // messageEditor.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const context = { div: middle, dom }\n\n ensureLoggedIn(context).then(context => {\n // me = context.me\n turnOnInput()\n Object.assign(context, userContext)\n findBookmarkDocument(context).then(_context => {\n // console.log('Bookmark file: ' + context.bookmarkDocument)\n })\n })\n\n return messageEditor\n} // renderMessageEditor\n"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,EAAA,GAAAL,uBAAA,CAAAL,OAAA;AACA,IAAAW,GAAA,GAAAN,uBAAA,CAAAL,OAAA;AACA,IAAAY,KAAA,GAAAP,uBAAA,CAAAL,OAAA;AACA,IAAAa,KAAA,GAAAR,uBAAA,CAAAL,OAAA;AACA,IAAAc,OAAA,GAAAT,uBAAA,CAAAL,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,KAAA,GAAAhB,OAAA;AAAqC,SAAAiB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAb,wBAAAa,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,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,GAAG,EAAHA;EAAI,CAAC;EAEpC,IAAA4O,qBAAc,EAACD,OAAO,CAAC,CAACtK,IAAI,CAAC,UAAAsK,OAAO,EAAI;IACtC;IACA9C,WAAW,CAAC,CAAC;IACbxO,MAAM,CAACwR,MAAM,CAACF,OAAO,EAAE1L,WAAW,CAAC;IACnC,IAAA6L,+BAAoB,EAACH,OAAO,CAAC,CAACtK,IAAI,CAAC,UAAA0K,QAAQ,EAAI;MAC7C;IAAA,CACD,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOnH,aAAa;AACtB,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"message.js","names":["_infinite","require","_messageTools","_bookmarks","_chatLogic","debug","_interopRequireWildcard","_iconBase","_solidLogic","_login","_index","ns","pad","style","utils","widgets","_signature","_keys","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","dom","window","document","messageBodyStyle","label","elementForImageURI","imageUri","options","img","createElement","height","inlineImageHeightEms","trim","setAttribute","anchor","appendChild","makeDraggable","$rdf","sym","text","term","uri","addEventListener","openHrefInOutlineMode","textContent","nickname","person","store","any","foaf","creatorAndDate","td1","creator","date","message","nickAnchor","fetcher","nowOrWhenFetched","doc","undefined","_ok","_body","creatorAndDateHorizontal","dateBit","fontSize","marginLeft","renderMessageRow","channelObject","fresh","userContext","unsignedMessage","colorizeByAuthor","dct","latestVersion","mostRecentVersion","latestVersionCreator","msgId","content","sioc","signature","concat","SEC","msg","getBlankMsg","id","created","maker","warn","getPublicKey","then","publicKey","log","regex","match","verifySignature","originalMessage","originalVersion","edited","sameTerm","sortDate","the","messageRow","AJAR_date","AJAR_subject","authorDateOnLeft","setImage","shortDate","bothDates","td2","isURI","para","isImage","expandImagesInline","anc","href","bgcolor","lightColorHash","getBgColor","strip","sentimentStripLinked","children","td3","toolsButton","button","icons","iconBase","_event","toolTR","parentNode","removeChild","toolsTR","tools","messageToolbar","nextSibling","parentElement","insertBefore","toolsTD","switchToEditor","messageTable","editRow","renderMessageEditor","originalRow","visibility","revertEditing","messageEditor","handleFieldInput","_x","_handleFieldInput","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee5","wrap","_callee5$","_context6","prev","sendMessage","field","stop","_x2","_x3","_sendMessage","_callee6","fromMainField","sendComplete","statusArea","_callee6$","_context7","_sendComplete","_text2","insertMessageIntoTable","oldRow","backgroundColor","disabled","scrollIntoView","newestFirst","focus","select","updateMessage","sent","t0","errorMessageBlock","abrupt","droppedFileHandler","files","base","chatDocument","dir","uploadFiles","_ref","_callee","theFile","destURI","_callee$","_context2","_x4","_x5","droppedURIHandler","_ref2","_callee2","uris","_iterator","_step","_callee2$","_context3","finish","_x6","turnOnInput","getImageDoc","imageDoc","Date","now","tookPicture","_x7","_tookPicture","_callee4","_callee4$","_context5","menuButton","menuHandler","buttonStyle","rhs","me","authn","currentUser","menuOptions","div","newBase","event","chatChannel","lhs","middle","innerHTML","rows","anyValue","_ref3","_callee3","_callee3$","_context4","code","shiftKey","shiftEnterSendsMessage","_x8","makeDropTarget","sendButton","sendIcon","cancelButton","dateFolder","leafDocumentFromDate","media","cameraButton","recordParticipation","channel","context","ensureLoggedIn","assign","findBookmarkDocument","_context"],"sources":["../../src/chat/message.js"],"sourcesContent":["/** UI code for individual messages: display them, edit them\n *\n * @packageDocumentation\n */\n\n/* global $rdf */\nimport { insertMessageIntoTable } from './infinite'\nimport { messageToolbar, sentimentStripLinked } from './messageTools'\nimport { findBookmarkDocument } from './bookmarks'\nimport { mostRecentVersion, originalVersion } from './chatLogic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { store, authn } from 'solid-logic'\nimport { ensureLoggedIn } from '../login/login'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as pad from '../pad'\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { getBlankMsg, verifySignature, SEC } from './signature'\nimport { getPublicKey } from './keys'\n\nconst dom = window.document\nconst messageBodyStyle = style.messageBodyStyle\n\nconst label = utils.label\n\n/**\n * elementForImageURI\n * HTML component for an image\n * @param imageUri\n * @param options { inlineImageHeightEms }\n * @returns HTMLAnchorElement For Image\n */\nexport function elementForImageURI (imageUri, options) {\n const img = dom.createElement('img')\n let height = '10'\n if (options.inlineImageHeightEms) {\n height = ('' + options.inlineImageHeightEms).trim()\n }\n img.setAttribute(\n 'style',\n 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'\n )\n // widgets.makeDropTarget(img, handleURIsDroppedOnMugshot, droppedFileHandler)\n if (imageUri) img.setAttribute('src', imageUri)\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', imageUri)\n anchor.setAttribute('target', 'images')\n anchor.appendChild(img)\n widgets.makeDraggable(img, $rdf.sym(imageUri))\n return anchor\n}\n\nconst anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n}\n\nfunction nickname (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + label(person)\n}\n\n/**\n * creatorAndDate\n * Displays creator and date for a chat message\n * inside the `td1` element\n * @param td1\n * @param creator\n * @param date\n * @param message\n * @returns HTMLAnchorElement For Image\n */\nexport function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nickname(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nickname(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n}\n\n/**\n * creatorAndDateHorizontal\n * Horizontally displays creator and date for a chat message\n * inside the `td1` element\n * @param td1\n * @param creator\n * @param date\n * @param message\n * @returns HTMLAnchorElement For Image\n */\nexport function creatorAndDateHorizontal (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(label(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nickname(creator)\n })\n }\n const dateBit = td1.appendChild(anchor(date, message))\n dateBit.style.fontSize = '80%'\n dateBit.style.marginLeft = '1em'\n td1.appendChild(dom.createElement('br'))\n}\n\n/**\n * renderMessageRow\n * Renders a chat message, read-only mode\n * @param channelObject\n * @param message\n * @param fresh\n * @param options\n * @param userContext\n * @returns Message Row HTML Table Element\n */\nexport function renderMessageRow (channelObject, message, fresh, options, userContext) {\n let unsignedMessage = false\n const colorizeByAuthor =\n options.colorizeByAuthor === '1' || options.colorizeByAuthor === true\n\n const creator = store.any(message, ns.foaf('maker'))\n const date = store.any(message, ns.dct('created'))\n const latestVersion = mostRecentVersion(message)\n const latestVersionCreator = store.any(latestVersion, ns.foaf('maker'))\n\n // use latest content if same owner, else use original\n const msgId = creator.uri === latestVersionCreator.uri ? latestVersion : message\n const content = store.any(msgId, ns.sioc('content'))\n const signature = store.any(msgId, $rdf.sym(`${SEC}proofValue`))\n\n // set message object\n const msg = getBlankMsg()\n msg.id = msgId.uri\n msg.created = store.any(msgId, ns.dct('created')).value\n msg.content = content.value\n msg.maker = creator.uri\n\n // unsigned message\n if (!signature?.value) {\n unsignedMessage = true\n debug.warn(msgId.uri + ' is unsigned') // TODO replace with UI (colored message ?)\n } else { // signed message, get public key and check signature\n getPublicKey(creator).then(publicKey => {\n debug.log(creator.uri + '\\n' + msg.created + '\\n' + msg.id + '\\n' + publicKey)\n if (!publicKey) {\n // TODO try to recreate the publicKey\n // if(me.uri === creator.uri) await getPrivateKey(creator)\n debug.warn('message is signed but ' + creator.uri + ' is missing publicKey')\n }\n // check that publicKey is a valid hex string\n const regex = /[0-9A-Fa-f]{6}/g\n if (!publicKey?.match(regex)) debug.warn('invalid publicKey hex string\\n' + creator.uri + '\\n' + publicKey)\n // verify signature\n else if (signature?.value && !verifySignature(signature?.value, msg, publicKey)) debug.warn('invalid signature\\n' + msg.id)\n })\n }\n\n const originalMessage = originalVersion(message)\n const edited = !message.sameTerm(originalMessage)\n\n const sortDate = store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()) // In message\n\n const messageRow = dom.createElement('tr')\n if (unsignedMessage) messageRow.setAttribute('style', 'background-color: red')\n messageRow.AJAR_date = sortDate.value\n messageRow.AJAR_subject = message\n\n const td1 = dom.createElement('td')\n messageRow.appendChild(td1)\n if (!options.authorDateOnLeft) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;'\n )\n widgets.setImage(img, creator)\n td1.appendChild(img)\n } else {\n creatorAndDate(td1, creator, widgets.shortDate(sortDate.value), message)\n }\n let bothDates = widgets.shortDate(sortDate.value)\n if (edited) {\n bothDates += ' ... ' + widgets.shortDate(date.value)\n }\n\n // Render the content ot the message itself\n const td2 = messageRow.appendChild(dom.createElement('td'))\n\n if (!options.authorDateOnLeft) {\n creatorAndDateHorizontal(\n td2,\n creator,\n bothDates, // widgets.shortDate(dateString)\n message\n )\n }\n const text = content.value.trim()\n const isURI = /^https?:\\/[^ <>]*$/i.test(text)\n let para = null\n if (isURI) {\n const isImage = /\\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text) // @@ Should use content-type not URI\n if (isImage && options.expandImagesInline) {\n const img = elementForImageURI(text, options)\n td2.appendChild(img)\n } else {\n // Link but not Image\n const anc = td2.appendChild(dom.createElement('a'))\n para = anc.appendChild(dom.createElement('p'))\n anc.href = text\n para.textContent = text\n td2.appendChild(anc)\n }\n } else {\n // text\n para = dom.createElement('p')\n td2.appendChild(para)\n para.textContent = text\n }\n if (para) {\n const bgcolor = colorizeByAuthor\n ? pad.lightColorHash(creator)\n : getBgColor(fresh)\n para.setAttribute(\n 'style',\n messageBodyStyle + 'background-color: ' + bgcolor + ';'\n )\n }\n\n function getBgColor (fresh) {\n return fresh ? '#e8ffe8' : 'white'\n }\n\n // Sentiment strip\n const strip = sentimentStripLinked(message, message.doc())\n if (strip.children.length) {\n td2.appendChild(dom.createElement('br'))\n td2.appendChild(strip)\n }\n\n // Message tool bar button\n const td3 = dom.createElement('td')\n messageRow.appendChild(td3)\n const toolsButton = widgets.button(\n dom,\n icons.iconBase + 'noun_243787.svg',\n '...'\n )\n td3.appendChild(toolsButton)\n toolsButton.addEventListener('click', function (_event) {\n if (messageRow.toolTR) {\n // already got a toolbar? Toogle\n messageRow.parentNode.removeChild(messageRow.toolTR)\n delete messageRow.toolTR\n return\n }\n const toolsTR = dom.createElement('tr')\n const tools = messageToolbar(message, messageRow, userContext, channelObject)\n tools.style =\n 'border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;' // @@ fix\n if (messageRow.nextSibling) {\n messageRow.parentElement.insertBefore(toolsTR, messageRow.nextSibling)\n } else {\n messageRow.parentElement.appendChild(toolsTR)\n }\n messageRow.toolTR = toolsTR\n toolsTR.appendChild(dom.createElement('td')) // left\n const toolsTD = toolsTR.appendChild(dom.createElement('td'))\n toolsTR.appendChild(dom.createElement('td')) // right\n toolsTD.appendChild(tools)\n })\n return messageRow\n} // END OF RENDERMESSAGE\n\nexport function switchToEditor (messageRow, message, channelObject, userContext) {\n const messageTable = messageRow.parentNode\n const editRow = renderMessageEditor(channelObject, messageTable, userContext,\n channelObject.options, mostRecentVersion(message))\n messageTable.insertBefore(editRow, messageRow)\n editRow.originalRow = messageRow\n messageRow.style.visibility = 'hidden' // Hide the original message. unhide if user cancels edit\n}\n/* Control for a new message -- or editing an old message ***************\n *\n */\nexport function renderMessageEditor (channelObject, messageTable, userContext, options, originalMessage) {\n function revertEditing (messageEditor) {\n messageEditor.originalRow.style.visibility = 'visible' // restore read-only version\n messageEditor.parentNode.removeChild(messageEditor)\n }\n\n async function handleFieldInput (_event) {\n await sendMessage(field.value, true)\n }\n\n async function sendMessage (text, fromMainField) {\n function sendComplete (message, _text2) {\n insertMessageIntoTable(channelObject, messageTable, message, false, options, userContext) // not green\n\n if (originalMessage) { // editing another message\n const oldRow = messageEditor.originalRow\n // oldRow.style.display = '' // restore read-only version, re-attack\n if (oldRow.parentNode) {\n oldRow.parentNode.removeChild(oldRow) // No longer needed old version\n } else {\n debug.warn('No parentNode on old message ' + oldRow.textContent)\n oldRow.style.backgroundColor = '#fee'\n oldRow.style.visibility = 'hidden' // @@ FIX THIS AND REMOVE FROM DOM INSTEAD\n }\n messageEditor.parentNode.removeChild(messageEditor) // no longer need editor\n } else {\n if (fromMainField) {\n field.value = '' // clear from out for reuse\n field.setAttribute('style', messageBodyStyle)\n field.disabled = false\n field.scrollIntoView(options.newestFirst) // allign bottom (top)\n field.focus() // Start typing next line immediately\n field.select()\n }\n }\n // await channelObject.div.refresh() // Add new day if nec @@ add back\n }\n\n // const me = authn.currentUser() // Must be logged on or wuld have got login button\n if (fromMainField) {\n field.setAttribute('style', messageBodyStyle + 'color: #bbb;') // pendingedit\n field.disabled = true\n }\n\n let message\n try {\n message = await channelObject.updateMessage(text, originalMessage)\n } catch (err) {\n const statusArea = userContext.statusArea || messageEditor\n statusArea.appendChild(\n widgets.errorMessageBlock(dom, 'Error writing message: ' + err)\n )\n return\n }\n sendComplete(message, text)\n } // sendMessage\n\n // DRAG AND DROP\n function droppedFileHandler (files) {\n const base = messageTable.chatDocument.dir().uri\n widgets.uploadFiles(\n store.fetcher,\n files,\n base + 'Files',\n base + 'Pictures',\n async function (theFile, destURI) {\n // @@@@@@ Wait for each if several\n await sendMessage(destURI)\n }\n )\n }\n\n // When a set of URIs are dropped on the field\n const droppedURIHandler = async function (uris) {\n for (const uri of uris) {\n await sendMessage(uri)\n }\n }\n\n // When we are actually logged on\n function turnOnInput () {\n function getImageDoc () {\n imageDoc = $rdf.sym(\n chatDocument.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await sendMessage(imageDoc.uri)\n }\n }\n\n // Body of turnOnInput\n\n let menuButton\n if (options.menuHandler) {\n const menuButton = widgets.button(\n dom, icons.iconBase + 'noun_243787.svg', 'More')\n menuButton.setAttribute('style', style.buttonStyle + 'float: right;')\n // menuButton.addEventListener('click', _event => sendMessage(), false) (done in turnoninput)\n rhs.appendChild(menuButton)\n }\n\n if (options.menuHandler && menuButton) {\n const me = authn.currentUser()\n const menuOptions = {\n me,\n dom,\n div: null, // @@ was: div\n newBase: messageTable.chatDocument.dir().uri\n }\n menuButton.addEventListener(\n 'click',\n event => {\n options.menuHandler(event, channelObject.chatChannel, menuOptions)\n },\n false\n )\n }\n\n const me = authn.currentUser() // If already logged on\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n if (originalMessage) {\n field.value = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n }\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n // Trap the Enter BEFORE it is used ti make a newline\n\n field.addEventListener(\n 'keydown',\n async function (e) {\n // User preference?\n if (e.code === 'Enter') {\n // if (e.keyCode === 13) { // deprocated https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n if ((!e.shiftKey && !options.shiftEnterSendsMessage) || (e.shiftKey && options.shiftEnterSendsMessage)) {\n // Shift-Enter just adds a new line\n // (note alt-enter doesn't add newline anyway on my setup - so have to use shift.\n await handleFieldInput(e)\n }\n }\n },\n false\n )\n\n widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler)\n\n rhs.innerHTML = ''\n\n sendButton = widgets.button(dom, sendIcon, 'Send')\n sendButton.style.float = 'right'\n sendButton.addEventListener('click', _event => handleFieldInput(), false)\n rhs.appendChild(sendButton)\n\n if (originalMessage) { // Are we editing another message?\n const cancelButton = rhs.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'left'\n // cancelButton.firstChild.style.opacity = '0.3' // moved to buttons\n cancelButton.addEventListener('click', _event => revertEditing(messageEditor), false)\n rhs.appendChild(cancelButton)\n }\n\n const chatDocument = channelObject.dateFolder.leafDocumentFromDate(new Date())\n let imageDoc\n\n middle.appendChild(\n media.cameraButton(dom, store, getImageDoc, tookPicture)\n )\n\n pad.recordParticipation(channelObject.channel, channelObject.channel.doc()) // participation =\n } // turn on inpuut\n\n // Body of renderMessageEditor\n\n let sortDate, sendIcon\n if (originalMessage) {\n sortDate = store.anyValue(originalMessage, ns.dct('created'), null, originalMessage.doc())\n // text = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n sendIcon = icons.iconBase + 'noun_1180158.svg' // Green check\n // cancelIcon = icons.iconBase + 'noun_1180156.svg' // Black cross\n } else {\n sendIcon = icons.iconBase + 'noun_383448.svg'\n sortDate = '9999-01-01T00:00:00Z' // ISO format for field sort\n // text = ''\n }\n const messageEditor = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n messageEditor.appendChild(lhs)\n messageEditor.appendChild(middle)\n messageEditor.appendChild(rhs)\n messageEditor.AJAR_date = sortDate\n // messageEditor.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const context = { div: middle, dom }\n\n ensureLoggedIn(context).then(context => {\n // me = context.me\n turnOnInput()\n Object.assign(context, userContext)\n findBookmarkDocument(context).then(_context => {\n // console.log('Bookmark file: ' + context.bookmarkDocument)\n })\n })\n\n return messageEditor\n} // renderMessageEditor\n"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;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messageTools.js b/lib/chat/messageTools.js index 1c5a259d..a1df719f 100644 --- a/lib/chat/messageTools.js +++ b/lib/chat/messageTools.js @@ -38,6 +38,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; // import * as pad from '../pad' // pull in first avoid cross-refs // import * as style from '../style' + var dom = window.document; // THE UNUSED ICONS are here as reminders for possible future functionality diff --git a/lib/chat/messageTools.js.map b/lib/chat/messageTools.js.map index 2906161a..d18f98f0 100644 --- a/lib/chat/messageTools.js.map +++ b/lib/chat/messageTools.js.map @@ -1 +1 @@ -{"version":3,"file":"messageTools.js","names":["debug","_interopRequireWildcard","require","_iconBase","ns","rdf","utils","widgets","_bookmarks","_solidLogic","_chatLogic","_message","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","dom","window","document","PENCIL_ICON","THUMBS_UP_ICON","THUMBS_DOWN_ICON","emoji","schema","sentimentStrip","target","doc","latest","mostRecentVersion","actions","store","holds","value","each","sentiments","map","any","sort","strings","x","createTextNode","join","sentimentStripLinked","strip","createElement","refresh","innerHTML","uri","forEach","ss","_ss","_slicedToArray2","theClass","agent","res","setAttribute","textContent","appendChild","messageToolbar","message","messageRow","userContext","channelObject","deleteMessage","_deleteMessage","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","author","msg","area","wrap","_callee2$","_context2","prev","next","foaf","me","alert","sameTerm","t0","warn","statusArea","parentNode","errorMessageBlock","removeChild","closeToolbar","stop","editMessage","_x","_editMessage","_callee3","_callee3$","_context3","switchToEditor","div","parentElement","deleteThingThen","_x2","_deleteThingThen","_callee4","_callee4$","_context4","updater","update","connectedStatements","authn","currentUser","deleteButtonWithCheck","button","icons","iconBase","renderBookmarksButton","then","bookmarkButton","sentimentButton","context","icon","actionClass","mutuallyExclusive","setColor","style","backgroundColor","action","label","_ref","_callee","_event","insertMe","dirty","_callee$","_context","newThing","st","length","existingAction","refreshTree","_x3","filter","context1","cancelButton","firstChild","opacity","addEventListener"],"sources":["../../src/chat/messageTools.js"],"sourcesContent":["/**\n * Tools for doing things with a message\n * Let us be creative here. Allow all sorts of things to\n * be done to a message - linking to new or old objects in an open way\n *\n * Ideas: Bookmark, Like, star, pin at top of chat, reply as new thread,\n * If you made it originally: edit, delete, attach\n * @packageDocumentation\n */\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\n// import { media } from '../media/index'\nimport * as ns from '../ns'\n// import * as pad from '../pad'\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\n// import * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { renderBookmarksButton } from './bookmarks'\nimport { authn, store } from 'solid-logic'\n\nimport { mostRecentVersion } from './chatLogic'\nimport { switchToEditor } from './message'\n\nconst dom = window.document\n\n// THE UNUSED ICONS are here as reminders for possible future functionality\n// const BOOKMARK_ICON = 'noun_45961.svg'\n// const HEART_ICON = 'noun_130259.svg' -> Add this to my (private) favorites\n// const MENU_ICON = 'noun_897914.svg'\n// const PAPERCLIP_ICON = 'noun_25830.svg' -> add attachments to this message\n// const PIN_ICON = 'noun_562340.svg' -> pin this message permanently in the chat UI\nconst PENCIL_ICON = 'noun_253504.svg' // edit a message\n// const SPANNER_ICON = 'noun_344563.svg' -> settings\nconst THUMBS_UP_ICON = 'noun_1384132.svg'\nconst THUMBS_DOWN_ICON = 'noun_1384135.svg'\n/**\n * Emoji in Unicode\n */\nconst emoji = {}\nemoji[ns.schema('AgreeAction')] = '👍'\nemoji[ns.schema('DisagreeAction')] = '👎'\nemoji[ns.schema('EndorseAction')] = '⭐️'\nemoji[ns.schema('LikeAction')] = '❤️'\n\n/**\n * Create strip of sentiments expressed\n */\nexport function sentimentStrip (target, doc) { // alain seems not used\n const latest = mostRecentVersion(target)\n const actions = store.holds(latest, ns.schema('dateDeleted').value, null, latest.doc()) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => store.any(a, ns.rdf('type'), null, doc))\n sentiments.sort()\n const strings = sentiments.map(x => emoji[x] || '')\n return dom.createTextNode(strings.join(' '))\n}\n/**\n * Create strip of sentiments expressed, with hyperlinks\n *\n * @param target {NamedNode} - The thing about which they are expressed\n * @param doc {NamedNode} - The document in which they are expressed\n */\nexport function sentimentStripLinked (target, doc) {\n const strip = dom.createElement('span')\n function refresh () {\n strip.innerHTML = ''\n const actions = (mostRecentVersion(target).uri !== ns.schema('dateDeleted').uri) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => [\n store.any(a, ns.rdf('type'), null, doc),\n store.any(a, ns.schema('agent'), null, doc)\n ])\n sentiments.sort()\n sentiments.forEach(ss => {\n const [theClass, agent] = ss\n let res\n if (agent) {\n res = dom.createElement('a')\n res.setAttribute('href', agent.uri)\n } else {\n res = dom.createTextNode('')\n }\n res.textContent = emoji[theClass] || '*'\n strip.appendChild(res)\n })\n }\n refresh()\n strip.refresh = refresh\n return strip\n}\n/**\n * Creates a message toolbar component\n */\nexport function messageToolbar (message, messageRow, userContext, channelObject) {\n async function deleteMessage () {\n const author = store.any(message, ns.foaf('maker'))\n if (!me) {\n alert('You can\\'t delete the message, you are not logged in.')\n } else if (me.sameTerm(author)) {\n try {\n await channelObject.deleteMessage(message)\n } catch (err) {\n const msg = 'Error deleting messaage ' + err\n debug.warn(msg)\n alert(msg)\n const area = userContext.statusArea || messageRow.parentNode\n area.appendChild(widgets.errorMessageBlock(dom, msg))\n }\n messageRow.parentNode.removeChild(messageRow)\n } else {\n alert('You can\\'t delete the message, you are not logged in as the author, ' + author)\n }\n closeToolbar()\n }\n\n async function editMessage (messageRow) {\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n closeToolbar() // edit is a one-off action\n switchToEditor(messageRow, message, channelObject, userContext)\n }\n }\n\n // alain TODO allow chat owner to fully delete message + sentiments and replacing messages\n\n const div = dom.createElement('div')\n // is message deleted ?\n if (mostRecentVersion(message).value === ns.schema('dateDeleted').value) return div\n function closeToolbar () {\n div.parentElement.parentElement.removeChild(div.parentElement) // remive the TR\n }\n\n async function deleteThingThen (x) {\n await store.updater.update(store.connectedStatements(x), [])\n }\n\n // Things only the original author can do\n let me = authn.currentUser() // If already logged on\n if (me && store.holds(message, ns.foaf('maker'), me)) {\n // button to delete the message\n div.appendChild(widgets.deleteButtonWithCheck(dom, div, 'message', deleteMessage))\n // button to edit the message\n div.appendChild(widgets.button(dom, icons.iconBase + PENCIL_ICON, 'edit', () => editMessage(messageRow)))\n } // if mine\n // Things anyone can do if they have a bookmark list async\n /*\n var bookmarkButton = await bookmarks.renderBookmarksButton(userContext)\n if (bookmarkButton) {\n div.appendChild(bookmarkButton)\n }\n */\n // Things anyone can do if they have a bookmark list\n\n renderBookmarksButton(userContext).then(bookmarkButton => {\n if (bookmarkButton) div.appendChild(bookmarkButton)\n })\n\n /** Button to allow user to express a sentiment (like, endorse, etc) about a target\n *\n * @param context {Object} - Provide dom and me\n * @param target {NamedNode} - The thing the user expresses an opnion about\n * @param icon {uristring} - The icon to be used for the button\n * @param actionClass {NamedNode} - The RDF class - typically a subclass of schema:Action\n * @param doc - {NamedNode} - the Solid document iunto which the data should be written\n * @param mutuallyExclusive {Array} - Any RDF classes of sentimentswhich are mutiually exclusive\n */\n function sentimentButton (\n context,\n target,\n icon,\n actionClass,\n doc,\n mutuallyExclusive\n ) {\n function setColor () {\n button.style.backgroundColor = action ? 'yellow' : 'white'\n }\n const button = widgets.button(\n dom,\n icon,\n utils.label(actionClass),\n async function (_event) {\n if (action) {\n await deleteThingThen(action)\n action = null\n setColor()\n } else {\n // no action\n action = widgets.newThing(doc)\n const insertMe = [\n rdf.st(action, ns.schema('agent'), context.me, doc),\n rdf.st(action, ns.rdf('type'), actionClass, doc),\n rdf.st(action, ns.schema('target'), target, doc)\n ]\n await store.updater.update([], insertMe)\n setColor()\n\n if (mutuallyExclusive) {\n // Delete incompative sentiments\n let dirty = false\n for (let i = 0; i < mutuallyExclusive.length; i++) {\n const a = existingAction(mutuallyExclusive[i])\n if (a) {\n await deleteThingThen(a) // but how refresh? refreshTree the parent?\n dirty = true\n }\n }\n if (dirty) {\n // widgets.refreshTree(button.parentNode) // requires them all to be immediate siblings\n widgets.refreshTree(messageRow) // requires them all to be immediate siblings\n }\n }\n }\n }\n )\n function existingAction (actionClass) {\n const actions = store\n .each(null, ns.schema('agent'), context.me, doc)\n .filter(x => store.holds(x, ns.rdf('type'), actionClass, doc))\n .filter(x => store.holds(x, ns.schema('target'), target, doc))\n return actions.length ? actions[0] : null\n }\n function refresh () {\n action = existingAction(actionClass)\n setColor()\n }\n let action\n button.refresh = refresh // If the file changes, refresh live\n refresh()\n return button\n }\n\n // THUMBS_UP_ICON\n // https://schema.org/AgreeAction\n me = authn.currentUser() // If already logged on\n // debug.log('Actions 3' + mostRecentVersion(message).value + ' ' + ns.schema('dateDeleted').value + ' ' + (mostRecentVersion(message).value !== ns.schema('dateDeleted').value))\n\n if (me && (mostRecentVersion(message).value !== ns.schema('dateDeleted').value)) {\n const context1 = { me, dom, div }\n div.appendChild(\n sentimentButton(\n context1,\n message, // @@ TODO use widgets.sentimentButton\n icons.iconBase + THUMBS_UP_ICON,\n ns.schema('AgreeAction'),\n message.doc(),\n [ns.schema('DisagreeAction')]\n )\n )\n // Thumbs down\n div.appendChild(\n sentimentButton(\n context1,\n message,\n icons.iconBase + THUMBS_DOWN_ICON,\n ns.schema('DisagreeAction'),\n message.doc(),\n [ns.schema('AgreeAction')]\n )\n )\n }\n // X button to remove the tool UI itself\n const cancelButton = div.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'right'\n cancelButton.firstChild.style.opacity = '0.3'\n cancelButton.addEventListener('click', closeToolbar)\n return div\n}\n"],"mappings":";;;;;;;;;;;;;AASA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,EAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,GAAA,GA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,CAACvC,EAAE,CAACoC,MAAM,CAAC,aAAa,CAAC,CAC3B,CACF,CAAC;EACH;EACA;EACA,IAAMwH,YAAY,GAAG7C,GAAG,CAACzC,WAAW,CAACnE,OAAO,CAACyJ,YAAY,CAAC/H,GAAG,CAAC,CAAC;EAC/D+H,YAAY,CAACnB,KAAK,SAAM,GAAG,OAAO;EAClCmB,YAAY,CAACC,UAAU,CAACpB,KAAK,CAACqB,OAAO,GAAG,KAAK;EAC7CF,YAAY,CAACG,gBAAgB,CAAC,OAAO,EAAEzD,YAAY,CAAC;EACpD,OAAOS,GAAG;AACZ"} \ No newline at end of file +{"version":3,"file":"messageTools.js","names":["debug","_interopRequireWildcard","require","_iconBase","ns","rdf","utils","widgets","_bookmarks","_solidLogic","_chatLogic","_message","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","dom","window","document","PENCIL_ICON","THUMBS_UP_ICON","THUMBS_DOWN_ICON","emoji","schema","sentimentStrip","target","doc","latest","mostRecentVersion","actions","store","holds","value","each","sentiments","map","any","sort","strings","x","createTextNode","join","sentimentStripLinked","strip","createElement","refresh","innerHTML","uri","forEach","ss","_ss","_slicedToArray2","theClass","agent","res","setAttribute","textContent","appendChild","messageToolbar","message","messageRow","userContext","channelObject","deleteMessage","_deleteMessage","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","author","msg","area","wrap","_callee2$","_context2","prev","next","foaf","me","alert","sameTerm","t0","warn","statusArea","parentNode","errorMessageBlock","removeChild","closeToolbar","stop","editMessage","_x","_editMessage","_callee3","_callee3$","_context3","switchToEditor","div","parentElement","deleteThingThen","_x2","_deleteThingThen","_callee4","_callee4$","_context4","updater","update","connectedStatements","authn","currentUser","deleteButtonWithCheck","button","icons","iconBase","renderBookmarksButton","then","bookmarkButton","sentimentButton","context","icon","actionClass","mutuallyExclusive","setColor","style","backgroundColor","action","label","_ref","_callee","_event","insertMe","dirty","_callee$","_context","newThing","st","length","existingAction","refreshTree","_x3","filter","context1","cancelButton","firstChild","opacity","addEventListener"],"sources":["../../src/chat/messageTools.js"],"sourcesContent":["/**\n * Tools for doing things with a message\n * Let us be creative here. Allow all sorts of things to\n * be done to a message - linking to new or old objects in an open way\n *\n * Ideas: Bookmark, Like, star, pin at top of chat, reply as new thread,\n * If you made it originally: edit, delete, attach\n * @packageDocumentation\n */\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\n// import { media } from '../media/index'\nimport * as ns from '../ns'\n// import * as pad from '../pad'\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\n// import * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { renderBookmarksButton } from './bookmarks'\nimport { authn, store } from 'solid-logic'\n\nimport { mostRecentVersion } from './chatLogic'\nimport { switchToEditor } from './message'\n\nconst dom = window.document\n\n// THE UNUSED ICONS are here as reminders for possible future functionality\n// const BOOKMARK_ICON = 'noun_45961.svg'\n// const HEART_ICON = 'noun_130259.svg' -> Add this to my (private) favorites\n// const MENU_ICON = 'noun_897914.svg'\n// const PAPERCLIP_ICON = 'noun_25830.svg' -> add attachments to this message\n// const PIN_ICON = 'noun_562340.svg' -> pin this message permanently in the chat UI\nconst PENCIL_ICON = 'noun_253504.svg' // edit a message\n// const SPANNER_ICON = 'noun_344563.svg' -> settings\nconst THUMBS_UP_ICON = 'noun_1384132.svg'\nconst THUMBS_DOWN_ICON = 'noun_1384135.svg'\n/**\n * Emoji in Unicode\n */\nconst emoji = {}\nemoji[ns.schema('AgreeAction')] = '👍'\nemoji[ns.schema('DisagreeAction')] = '👎'\nemoji[ns.schema('EndorseAction')] = '⭐️'\nemoji[ns.schema('LikeAction')] = '❤️'\n\n/**\n * Create strip of sentiments expressed\n */\nexport function sentimentStrip (target, doc) { // alain seems not used\n const latest = mostRecentVersion(target)\n const actions = store.holds(latest, ns.schema('dateDeleted').value, null, latest.doc()) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => store.any(a, ns.rdf('type'), null, doc))\n sentiments.sort()\n const strings = sentiments.map(x => emoji[x] || '')\n return dom.createTextNode(strings.join(' '))\n}\n/**\n * Create strip of sentiments expressed, with hyperlinks\n *\n * @param target {NamedNode} - The thing about which they are expressed\n * @param doc {NamedNode} - The document in which they are expressed\n */\nexport function sentimentStripLinked (target, doc) {\n const strip = dom.createElement('span')\n function refresh () {\n strip.innerHTML = ''\n const actions = (mostRecentVersion(target).uri !== ns.schema('dateDeleted').uri) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => [\n store.any(a, ns.rdf('type'), null, doc),\n store.any(a, ns.schema('agent'), null, doc)\n ])\n sentiments.sort()\n sentiments.forEach(ss => {\n const [theClass, agent] = ss\n let res\n if (agent) {\n res = dom.createElement('a')\n res.setAttribute('href', agent.uri)\n } else {\n res = dom.createTextNode('')\n }\n res.textContent = emoji[theClass] || '*'\n strip.appendChild(res)\n })\n }\n refresh()\n strip.refresh = refresh\n return strip\n}\n/**\n * Creates a message toolbar component\n */\nexport function messageToolbar (message, messageRow, userContext, channelObject) {\n async function deleteMessage () {\n const author = store.any(message, ns.foaf('maker'))\n if (!me) {\n alert('You can\\'t delete the message, you are not logged in.')\n } else if (me.sameTerm(author)) {\n try {\n await channelObject.deleteMessage(message)\n } catch (err) {\n const msg = 'Error deleting messaage ' + err\n debug.warn(msg)\n alert(msg)\n const area = userContext.statusArea || messageRow.parentNode\n area.appendChild(widgets.errorMessageBlock(dom, msg))\n }\n messageRow.parentNode.removeChild(messageRow)\n } else {\n alert('You can\\'t delete the message, you are not logged in as the author, ' + author)\n }\n closeToolbar()\n }\n\n async function editMessage (messageRow) {\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n closeToolbar() // edit is a one-off action\n switchToEditor(messageRow, message, channelObject, userContext)\n }\n }\n\n // alain TODO allow chat owner to fully delete message + sentiments and replacing messages\n\n const div = dom.createElement('div')\n // is message deleted ?\n if (mostRecentVersion(message).value === ns.schema('dateDeleted').value) return div\n function closeToolbar () {\n div.parentElement.parentElement.removeChild(div.parentElement) // remive the TR\n }\n\n async function deleteThingThen (x) {\n await store.updater.update(store.connectedStatements(x), [])\n }\n\n // Things only the original author can do\n let me = authn.currentUser() // If already logged on\n if (me && store.holds(message, ns.foaf('maker'), me)) {\n // button to delete the message\n div.appendChild(widgets.deleteButtonWithCheck(dom, div, 'message', deleteMessage))\n // button to edit the message\n div.appendChild(widgets.button(dom, icons.iconBase + PENCIL_ICON, 'edit', () => editMessage(messageRow)))\n } // if mine\n // Things anyone can do if they have a bookmark list async\n /*\n var bookmarkButton = await bookmarks.renderBookmarksButton(userContext)\n if (bookmarkButton) {\n div.appendChild(bookmarkButton)\n }\n */\n // Things anyone can do if they have a bookmark list\n\n renderBookmarksButton(userContext).then(bookmarkButton => {\n if (bookmarkButton) div.appendChild(bookmarkButton)\n })\n\n /** Button to allow user to express a sentiment (like, endorse, etc) about a target\n *\n * @param context {Object} - Provide dom and me\n * @param target {NamedNode} - The thing the user expresses an opnion about\n * @param icon {uristring} - The icon to be used for the button\n * @param actionClass {NamedNode} - The RDF class - typically a subclass of schema:Action\n * @param doc - {NamedNode} - the Solid document iunto which the data should be written\n * @param mutuallyExclusive {Array} - Any RDF classes of sentimentswhich are mutiually exclusive\n */\n function sentimentButton (\n context,\n target,\n icon,\n actionClass,\n doc,\n mutuallyExclusive\n ) {\n function setColor () {\n button.style.backgroundColor = action ? 'yellow' : 'white'\n }\n const button = widgets.button(\n dom,\n icon,\n utils.label(actionClass),\n async function (_event) {\n if (action) {\n await deleteThingThen(action)\n action = null\n setColor()\n } else {\n // no action\n action = widgets.newThing(doc)\n const insertMe = [\n rdf.st(action, ns.schema('agent'), context.me, doc),\n rdf.st(action, ns.rdf('type'), actionClass, doc),\n rdf.st(action, ns.schema('target'), target, doc)\n ]\n await store.updater.update([], insertMe)\n setColor()\n\n if (mutuallyExclusive) {\n // Delete incompative sentiments\n let dirty = false\n for (let i = 0; i < mutuallyExclusive.length; i++) {\n const a = existingAction(mutuallyExclusive[i])\n if (a) {\n await deleteThingThen(a) // but how refresh? refreshTree the parent?\n dirty = true\n }\n }\n if (dirty) {\n // widgets.refreshTree(button.parentNode) // requires them all to be immediate siblings\n widgets.refreshTree(messageRow) // requires them all to be immediate siblings\n }\n }\n }\n }\n )\n function existingAction (actionClass) {\n const actions = store\n .each(null, ns.schema('agent'), context.me, doc)\n .filter(x => store.holds(x, ns.rdf('type'), actionClass, doc))\n .filter(x => store.holds(x, ns.schema('target'), target, doc))\n return actions.length ? actions[0] : null\n }\n function refresh () {\n action = existingAction(actionClass)\n setColor()\n }\n let action\n button.refresh = refresh // If the file changes, refresh live\n refresh()\n return button\n }\n\n // THUMBS_UP_ICON\n // https://schema.org/AgreeAction\n me = authn.currentUser() // If already logged on\n // debug.log('Actions 3' + mostRecentVersion(message).value + ' ' + ns.schema('dateDeleted').value + ' ' + (mostRecentVersion(message).value !== ns.schema('dateDeleted').value))\n\n if (me && (mostRecentVersion(message).value !== ns.schema('dateDeleted').value)) {\n const context1 = { me, dom, div }\n div.appendChild(\n sentimentButton(\n context1,\n message, // @@ TODO use widgets.sentimentButton\n icons.iconBase + THUMBS_UP_ICON,\n ns.schema('AgreeAction'),\n message.doc(),\n [ns.schema('DisagreeAction')]\n )\n )\n // Thumbs down\n div.appendChild(\n sentimentButton(\n context1,\n message,\n icons.iconBase + THUMBS_DOWN_ICON,\n ns.schema('DisagreeAction'),\n message.doc(),\n [ns.schema('AgreeAction')]\n )\n )\n }\n // X button to remove the tool UI itself\n const cancelButton = div.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'right'\n cancelButton.firstChild.style.opacity = '0.3'\n cancelButton.addEventListener('click', closeToolbar)\n return div\n}\n"],"mappings":";;;;;;;;;;;;;AASA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,EAAA,GAAAH,uBAAA,C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OAAO,CAACjC,GAAG,CAAC,CAAC,EACb,CAACvC,EAAE,CAACoC,MAAM,CAAC,aAAa,CAAC,CAC3B,CACF,CAAC;EACH;EACA;EACA,IAAMwH,YAAY,GAAG7C,GAAG,CAACzC,WAAW,CAACnE,OAAO,CAACyJ,YAAY,CAAC/H,GAAG,CAAC,CAAC;EAC/D+H,YAAY,CAACnB,KAAK,SAAM,GAAG,OAAO;EAClCmB,YAAY,CAACC,UAAU,CAACpB,KAAK,CAACqB,OAAO,GAAG,KAAK;EAC7CF,YAAY,CAACG,gBAAgB,CAAC,OAAO,EAAEzD,YAAY,CAAC;EACpD,OAAOS,GAAG;AACZ"} \ No newline at end of file diff --git a/lib/chat/thread.js b/lib/chat/thread.js index 622b17e9..40185424 100644 --- a/lib/chat/thread.js +++ b/lib/chat/thread.js @@ -65,7 +65,6 @@ function thread(dom, kb, subject, messageStore, options) { a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true); a.setAttribute('style', 'color: #3B5998; text-decoration: none; '); // font-weight: bold } - a.textContent = text; return a; }; @@ -341,7 +340,6 @@ function thread(dom, kb, subject, messageStore, options) { }; renderMessage(bindings, true); // fresh from elsewhere }; - var renderMessage = function renderMessage(bindings, fresh) { var creator = bindings['?creator']; var message = bindings['?msg']; @@ -421,7 +419,6 @@ function thread(dom, kb, subject, messageStore, options) { } else { messageTable.appendChild(tr); // not newestFirst } - var query; // Do this with a live query to pull in messages from web if (options.query) { @@ -441,7 +438,6 @@ function thread(dom, kb, subject, messageStore, options) { function doneQuery() { messageTable.fresh = true; // any new are fresh and so will be greenish } - _solidLogic.store.query(query, renderMessage, undefined, doneQuery); div.refresh = function () { syncMessages(subject, messageTable); diff --git a/lib/chat/thread.js.map b/lib/chat/thread.js.map index d17c67e6..e621c67a 100644 --- a/lib/chat/thread.js.map +++ b/lib/chat/thread.js.map @@ -1 +1 @@ -{"version":3,"file":"thread.js","names":["_iconBase","require","_solidLogic","_index","ns","_interopRequireWildcard","login","pad","$rdf","style","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","UI","icons","media","thread","dom","kb","subject","messageStore","options","store","doc","WF","Namespace","DCT","newestFirst","messageBodyStyle","div","createElement","messageTable","me","updater","anchor","text","term","uri","setAttribute","addEventListener","openHrefInOutlineMode","textContent","mention","message","pre","appendChild","createTextNode","announce","log","warn","error","newMessageForm","form","lhs","middle","rhs","AJAR_date","sendMessage","field","disabled","_appendMsg","appendMsg","value","dateStamp","sts","sendComplete","success","body","errorMessageBlock","bindings","literal","renderMessage","update","sendButton","turnOnInput","creatorAndDate","innerHTML","rows","keyCode","altKey","button","iconBase","buttonStyle","context","ensureLoggedIn","then","fieldValue","oldMsg","arguments","length","undefined","now","Date","timestamp","getTime","sym","push","Statement","mostRecentVersion","wf","msgBody","concat","nick","sioc","foaf","person","s","any","label","td1","creator","date","nickAnchor","fetcher","nowOrWhenFetched","_ok","_body","syncMessages","about","displayed","ele","ele2","firstChild","nextSibling","AJAR_subject","messages","each","stored","forEach","m","addMessage","removeChild","msg","statementsMatching","_deleteMessage","_ref","_asyncToGenerator2","_regenerator","mark","_callee","deletions","wrap","_callee$","_context","prev","next","connectedStatements","sent","ok","stop","_x","apply","fresh","content","dateString","tr","done","insertBefore","shortDate","td2","td3","delButton","_event","cancelButton","sureButton","_appendMsg2","query","Query","v","vs","x","vars","variable","pat","add","dct","doneQuery","refresh"],"sources":["../../src/chat/thread.js"],"sourcesContent":["/**\n * Contains the [[thread]] function\n * @packageDocumentation\n */\n\nimport { icons } from '../iconBase'\nimport { store } from 'solid-logic'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as login from '../login/login'\nimport * as pad from '../pad'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst UI = { icons, ns, media, pad, style, utils, widgets }\n\n/**\n * HTML component for a chat thread\n */\nexport function thread (dom, kb, subject, messageStore, options) {\n kb = kb || store\n messageStore = messageStore.doc() // No hash\n const ns = UI.ns\n const WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')\n const DCT = $rdf.Namespace('http://purl.org/dc/terms/')\n\n options = options || {}\n\n const newestFirst = !!options.newestFirst\n\n const messageBodyStyle =\n 'white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;'\n // 'font-size: 100%; margin: 0.1em 1em 0.1em 1em; background-color: white; white-space: pre-wrap; padding: 0.1em;'\n\n const div = dom.createElement('div')\n // eslint-disable-next-line prefer-const\n let messageTable // Shared by initial build and addMessageFromBindings\n\n let me\n\n const updater = store.updater\n\n const anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n }\n\n const mention = function mention (message, style) {\n const pre = dom.createElement('pre')\n pre.setAttribute('style', style || 'color: grey')\n div.appendChild(pre)\n pre.appendChild(dom.createTextNode(message))\n return pre\n }\n\n const announce = {\n log: function (message) {\n mention(message, 'color: #111;')\n },\n warn: function (message) {\n mention(message, 'color: #880;')\n },\n error: function (message) {\n mention(message, 'color: #800;')\n }\n }\n\n /**\n * Form for a new message\n */\n const newMessageForm = function () {\n const form = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n form.appendChild(lhs)\n form.appendChild(middle)\n form.appendChild(rhs)\n form.AJAR_date = '9999-01-01T00:00:00Z' // ISO format for field sort\n\n const sendMessage = function () {\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const { message, dateStamp, sts } = appendMsg(field.value)\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': store.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n }\n form.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const turnOnInput = function () {\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n field.addEventListener(\n 'keyup',\n function (e) {\n // User preference?\n if (e.keyCode === 13) {\n if (!e.altKey) {\n // Alt-Enter just adds a new line\n sendMessage()\n }\n }\n },\n false\n )\n\n rhs.innerHTML = ''\n sendButton = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_383448.svg',\n 'Send'\n )\n sendButton.setAttribute('style', UI.style.buttonStyle + 'float: right;')\n sendButton.addEventListener('click', sendMessage, false)\n rhs.appendChild(sendButton)\n }\n\n const context = { div: middle, dom }\n login.ensureLoggedIn(context).then(context => {\n me = context.me\n turnOnInput()\n })\n\n return form\n }\n\n /* const sendMessage = function (oldMsg, options) { // alain\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = store.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n if (options === 'edit' || options === 'delete') {\n sts.push(\n new $rdf.Statement(mostRecentVersion(oldMsg), DCT('isReplacedBy'), message, messageStore)\n )\n } else {\n sts.push(\n new $rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n }\n // sts.push(new $rdf.Statement(message, ns.dc('title'), store.literal(titlefield.value), messageStore))\n const msgBody = options !== 'delete' ? field.value : `message deleted\\nby ${nick(me)}`\n sts.push(\n new $rdf.Statement(\n message,\n ns.sioc('content'),\n store.literal(msgBody),\n messageStore\n )\n )\n sts.push(\n new $rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new $rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': store.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n } */\n\n const appendMsg = function (fieldValue, oldMsg = {}, options = '') { // alain\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = store.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n if (options === 'edit' || options === 'delete') {\n sts.push(\n new $rdf.Statement(mostRecentVersion(oldMsg), DCT('isReplacedBy'), message, messageStore)\n )\n } else {\n sts.push(\n new $rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n }\n // sts.push(new $rdf.Statement(message, ns.dc('title'), store.literal(titlefield.value), messageStore))\n const msgBody = options !== 'delete' ? fieldValue : `message deleted\\nby ${nick(me)}`\n sts.push(\n new $rdf.Statement(\n message,\n ns.sioc('content'),\n store.literal(msgBody),\n messageStore\n )\n )\n sts.push(\n new $rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new $rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n return { message, dateStamp, sts }\n }\n\n function nick (person) {\n const s = store.any(person, UI.ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n }\n\n function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n }\n\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, 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(about, ns.wf('message'))\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m)\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 }\n\n const mostRecentVersion = function (message) {\n let msg = message\n // const listMsg = []\n while (msg) {\n // listMsg.push(msg)\n msg = store.statementsMatching(message, DCT('isReplacedBy'))\n }\n return msg\n }\n\n const _deleteMessage = async function (message) { // alain: must delete message and all linked with isReplacedBy\n // alain: check that me is not the author and ask for confirmation.\n const deletions = await store.connectedStatements(message, messageStore)\n updater.update(deletions, [], function (uri, ok, body) {\n if (!ok) {\n announce.error('Cant delete messages:' + body)\n } else {\n syncMessages(subject, messageTable)\n }\n })\n }\n\n const addMessage = function (message) {\n const bindings = {\n '?msg': message,\n '?creator': store.any(message, ns.foaf('maker')),\n '?date': store.any(message, DCT('created')),\n '?content': store.any(message, ns.sioc('content'))\n }\n renderMessage(bindings, true) // fresh from elsewhere\n }\n\n const renderMessage = function (bindings, fresh) {\n const creator = bindings['?creator']\n const message = bindings['?msg']\n const date = bindings['?date']\n const content = bindings['?content']\n\n const dateString = date.value\n const tr = dom.createElement('tr')\n tr.AJAR_date = dateString\n tr.AJAR_subject = message\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(tr, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(tr)\n }\n\n const td1 = dom.createElement('td')\n tr.appendChild(td1)\n creatorAndDate(td1, creator, UI.widgets.shortDate(dateString), message)\n\n const td2 = dom.createElement('td')\n tr.appendChild(td2)\n const pre = dom.createElement('p')\n pre.setAttribute(\n 'style',\n messageBodyStyle +\n (fresh ? 'background-color: #e8ffe8;' : 'background-color: #white;')\n )\n td2.appendChild(pre)\n pre.textContent = content.value\n\n const td3 = dom.createElement('td')\n tr.appendChild(td3)\n\n const delButton = dom.createElement('button')\n td3.appendChild(delButton)\n delButton.textContent = '-'\n\n tr.setAttribute('class', 'hoverControl') // See tabbedtab.css (sigh global CSS)\n delButton.setAttribute('class', 'hoverControlHide')\n delButton.setAttribute('style', 'color: red;')\n delButton.addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(delButton) // Ask -- are you sure?\n const cancelButton = dom.createElement('button')\n cancelButton.textContent = 'cancel'\n td3.appendChild(cancelButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n td3.appendChild(delButton)\n },\n false\n )\n const sureButton = dom.createElement('button')\n sureButton.textContent = 'Delete message'\n td3.appendChild(sureButton).addEventListener(\n 'click',\n function (_event) { // alain test for delete or edit depending on me = maker\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n // deleteMessage(message) // alain or sendMessage(message, 'delete' or 'edit') //alain\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n const { sts } = appendMsg() // alain\n updater.update([], sts)\n }\n },\n false\n )\n },\n false\n )\n }\n\n // Messages with date, author etc\n\n messageTable = dom.createElement('table')\n messageTable.fresh = false\n div.appendChild(messageTable)\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n\n const tr = newMessageForm()\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n\n let query\n // Do this with a live query to pull in messages from web\n if (options.query) {\n query = options.query\n } else {\n query = new $rdf.Query('Messages')\n const v = {} // semicolon needed\n const vs = ['msg', 'date', 'creator', 'content']\n vs.forEach(function (x) {\n query.vars.push((v[x] = $rdf.variable(x)))\n })\n query.pat.add(subject, WF('message'), v.msg)\n query.pat.add(v.msg, ns.dct('created'), v.date)\n query.pat.add(v.msg, ns.foaf('maker'), v.creator)\n query.pat.add(v.msg, ns.sioc('content'), v.content)\n }\n\n function doneQuery () {\n messageTable.fresh = true // any new are fresh and so will be greenish\n }\n store.query(query, renderMessage, undefined, doneQuery)\n div.refresh = function () {\n syncMessages(subject, messageTable)\n }\n // syncMessages(subject, messageTable) // no the query will do this async\n return div\n}\n"],"mappings":";;;;;;;;;;AAKA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,GAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,IAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,KAAA,GAAAJ,uBAAA,CAAAJ,OAAA;AACA,IAAAS,KAAA,GAAAL,uBAAA,CAAAJ,OAAA;AACA,IAAAU,OAAA,GAAAN,uBAAA,CAAAJ,OAAA;AAAqC,SAAAW,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,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KAAK,CAACO,GAAG,CAACC,GAAG,CAAC3J,OAAO,EAAEK,EAAE,CAAC,SAAS,CAAC,EAAEgJ,CAAC,CAACpC,GAAG,CAAC;IAC5CkC,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAACpC,GAAG,EAAEpJ,EAAE,CAAC+L,GAAG,CAAC,SAAS,CAAC,EAAEP,CAAC,CAACzD,IAAI,CAAC;IAC/CuD,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAACpC,GAAG,EAAEpJ,EAAE,CAACwH,IAAI,CAAC,OAAO,CAAC,EAAEgE,CAAC,CAAC1D,OAAO,CAAC;IACjDwD,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAACpC,GAAG,EAAEpJ,EAAE,CAACuH,IAAI,CAAC,SAAS,CAAC,EAAEiE,CAAC,CAACf,OAAO,CAAC;EACrD;EAEA,SAASuB,SAASA,CAAA,EAAI;IACpBjJ,YAAY,CAACyH,KAAK,GAAG,IAAI,EAAC;EAC5B;;EACAlI,iBAAK,CAACgJ,KAAK,CAACA,KAAK,EAAE/F,aAAa,EAAEmB,SAAS,EAAEsF,SAAS,CAAC;EACvDnJ,GAAG,CAACoJ,OAAO,GAAG,YAAY;IACxB5D,YAAY,CAAClG,OAAO,EAAEY,YAAY,CAAC;EACrC,CAAC;EACD;EACA,OAAOF,GAAG;AACZ"} \ No newline at end of file +{"version":3,"file":"thread.js","names":["_iconBase","require","_solidLogic","_index","ns","_interopRequireWildcard","login","pad","$rdf","style","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","UI","icons","media","thread","dom","kb","subject","messageStore","options","store","doc","WF","Namespace","DCT","newestFirst","messageBodyStyle","div","createElement","messageTable","me","updater","anchor","text","term","uri","setAttribute","addEventListener","openHrefInOutlineMode","textContent","mention","message","pre","appendChild","createTextNode","announce","log","warn","error","newMessageForm","form","lhs","middle","rhs","AJAR_date","sendMessage","field","disabled","_appendMsg","appendMsg","value","dateStamp","sts","sendComplete","success","body","errorMessageBlock","bindings","literal","renderMessage","update","sendButton","turnOnInput","creatorAndDate","innerHTML","rows","keyCode","altKey","button","iconBase","buttonStyle","context","ensureLoggedIn","then","fieldValue","oldMsg","arguments","length","undefined","now","Date","timestamp","getTime","sym","push","Statement","mostRecentVersion","wf","msgBody","concat","nick","sioc","foaf","person","s","any","label","td1","creator","date","nickAnchor","fetcher","nowOrWhenFetched","_ok","_body","syncMessages","about","displayed","ele","ele2","firstChild","nextSibling","AJAR_subject","messages","each","stored","forEach","m","addMessage","removeChild","msg","statementsMatching","_deleteMessage","_ref","_asyncToGenerator2","_regenerator","mark","_callee","deletions","wrap","_callee$","_context","prev","next","connectedStatements","sent","ok","stop","_x","apply","fresh","content","dateString","tr","done","insertBefore","shortDate","td2","td3","delButton","_event","cancelButton","sureButton","_appendMsg2","query","Query","v","vs","x","vars","variable","pat","add","dct","doneQuery","refresh"],"sources":["../../src/chat/thread.js"],"sourcesContent":["/**\n * Contains the [[thread]] function\n * @packageDocumentation\n */\n\nimport { icons } from '../iconBase'\nimport { store } from 'solid-logic'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as login from '../login/login'\nimport * as pad from '../pad'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst UI = { icons, ns, media, pad, style, utils, widgets }\n\n/**\n * HTML component for a chat thread\n */\nexport function thread (dom, kb, subject, messageStore, options) {\n kb = kb || store\n messageStore = messageStore.doc() // No hash\n const ns = UI.ns\n const WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')\n const DCT = $rdf.Namespace('http://purl.org/dc/terms/')\n\n options = options || {}\n\n const newestFirst = !!options.newestFirst\n\n const messageBodyStyle =\n 'white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;'\n // 'font-size: 100%; margin: 0.1em 1em 0.1em 1em; background-color: white; white-space: pre-wrap; padding: 0.1em;'\n\n const div = dom.createElement('div')\n // eslint-disable-next-line prefer-const\n let messageTable // Shared by initial build and addMessageFromBindings\n\n let me\n\n const updater = store.updater\n\n const anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n }\n\n const mention = function mention (message, style) {\n const pre = dom.createElement('pre')\n pre.setAttribute('style', style || 'color: grey')\n div.appendChild(pre)\n pre.appendChild(dom.createTextNode(message))\n return pre\n }\n\n const announce = {\n log: function (message) {\n mention(message, 'color: #111;')\n },\n warn: function (message) {\n mention(message, 'color: #880;')\n },\n error: function (message) {\n mention(message, 'color: #800;')\n }\n }\n\n /**\n * Form for a new message\n */\n const newMessageForm = function () {\n const form = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n form.appendChild(lhs)\n form.appendChild(middle)\n form.appendChild(rhs)\n form.AJAR_date = '9999-01-01T00:00:00Z' // ISO format for field sort\n\n const sendMessage = function () {\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const { message, dateStamp, sts } = appendMsg(field.value)\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': store.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n }\n form.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const turnOnInput = function () {\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n field.addEventListener(\n 'keyup',\n function (e) {\n // User preference?\n if (e.keyCode === 13) {\n if (!e.altKey) {\n // Alt-Enter just adds a new line\n sendMessage()\n }\n }\n },\n false\n )\n\n rhs.innerHTML = ''\n sendButton = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_383448.svg',\n 'Send'\n )\n sendButton.setAttribute('style', UI.style.buttonStyle + 'float: right;')\n sendButton.addEventListener('click', sendMessage, false)\n rhs.appendChild(sendButton)\n }\n\n const context = { div: middle, dom }\n login.ensureLoggedIn(context).then(context => {\n me = context.me\n turnOnInput()\n })\n\n return form\n }\n\n /* const sendMessage = function (oldMsg, options) { // alain\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = store.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n if (options === 'edit' || options === 'delete') {\n sts.push(\n new $rdf.Statement(mostRecentVersion(oldMsg), DCT('isReplacedBy'), message, messageStore)\n )\n } else {\n sts.push(\n new $rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n }\n // sts.push(new $rdf.Statement(message, ns.dc('title'), store.literal(titlefield.value), messageStore))\n const msgBody = options !== 'delete' ? field.value : `message deleted\\nby ${nick(me)}`\n sts.push(\n new $rdf.Statement(\n message,\n ns.sioc('content'),\n store.literal(msgBody),\n messageStore\n )\n )\n sts.push(\n new $rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new $rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': store.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n } */\n\n const appendMsg = function (fieldValue, oldMsg = {}, options = '') { // alain\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = store.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n if (options === 'edit' || options === 'delete') {\n sts.push(\n new $rdf.Statement(mostRecentVersion(oldMsg), DCT('isReplacedBy'), message, messageStore)\n )\n } else {\n sts.push(\n new $rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n }\n // sts.push(new $rdf.Statement(message, ns.dc('title'), store.literal(titlefield.value), messageStore))\n const msgBody = options !== 'delete' ? fieldValue : `message deleted\\nby ${nick(me)}`\n sts.push(\n new $rdf.Statement(\n message,\n ns.sioc('content'),\n store.literal(msgBody),\n messageStore\n )\n )\n sts.push(\n new $rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new $rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n return { message, dateStamp, sts }\n }\n\n function nick (person) {\n const s = store.any(person, UI.ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n }\n\n function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n }\n\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, 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(about, ns.wf('message'))\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m)\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 }\n\n const mostRecentVersion = function (message) {\n let msg = message\n // const listMsg = []\n while (msg) {\n // listMsg.push(msg)\n msg = store.statementsMatching(message, DCT('isReplacedBy'))\n }\n return msg\n }\n\n const _deleteMessage = async function (message) { // alain: must delete message and all linked with isReplacedBy\n // alain: check that me is not the author and ask for confirmation.\n const deletions = await store.connectedStatements(message, messageStore)\n updater.update(deletions, [], function (uri, ok, body) {\n if (!ok) {\n announce.error('Cant delete messages:' + body)\n } else {\n syncMessages(subject, messageTable)\n }\n })\n }\n\n const addMessage = function (message) {\n const bindings = {\n '?msg': message,\n '?creator': store.any(message, ns.foaf('maker')),\n '?date': store.any(message, DCT('created')),\n '?content': store.any(message, ns.sioc('content'))\n }\n renderMessage(bindings, true) // fresh from elsewhere\n }\n\n const renderMessage = function (bindings, fresh) {\n const creator = bindings['?creator']\n const message = bindings['?msg']\n const date = bindings['?date']\n const content = bindings['?content']\n\n const dateString = date.value\n const tr = dom.createElement('tr')\n tr.AJAR_date = dateString\n tr.AJAR_subject = message\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(tr, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(tr)\n }\n\n const td1 = dom.createElement('td')\n tr.appendChild(td1)\n creatorAndDate(td1, creator, UI.widgets.shortDate(dateString), message)\n\n const td2 = dom.createElement('td')\n tr.appendChild(td2)\n const pre = dom.createElement('p')\n pre.setAttribute(\n 'style',\n messageBodyStyle +\n (fresh ? 'background-color: #e8ffe8;' : 'background-color: #white;')\n )\n td2.appendChild(pre)\n pre.textContent = content.value\n\n const td3 = dom.createElement('td')\n tr.appendChild(td3)\n\n const delButton = dom.createElement('button')\n td3.appendChild(delButton)\n delButton.textContent = '-'\n\n tr.setAttribute('class', 'hoverControl') // See tabbedtab.css (sigh global CSS)\n delButton.setAttribute('class', 'hoverControlHide')\n delButton.setAttribute('style', 'color: red;')\n delButton.addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(delButton) // Ask -- are you sure?\n const cancelButton = dom.createElement('button')\n cancelButton.textContent = 'cancel'\n td3.appendChild(cancelButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n td3.appendChild(delButton)\n },\n false\n )\n const sureButton = dom.createElement('button')\n sureButton.textContent = 'Delete message'\n td3.appendChild(sureButton).addEventListener(\n 'click',\n function (_event) { // alain test for delete or edit depending on me = maker\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n // deleteMessage(message) // alain or sendMessage(message, 'delete' or 'edit') //alain\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n const { sts } = appendMsg() // alain\n updater.update([], sts)\n }\n },\n false\n )\n },\n false\n )\n }\n\n // Messages with date, author etc\n\n messageTable = dom.createElement('table')\n messageTable.fresh = false\n div.appendChild(messageTable)\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n\n const tr = newMessageForm()\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n\n let query\n // Do this with a live query to pull in messages from web\n if (options.query) {\n query = options.query\n } else {\n query = new $rdf.Query('Messages')\n const v = {} // semicolon needed\n const vs = ['msg', 'date', 'creator', 'content']\n vs.forEach(function (x) {\n query.vars.push((v[x] = $rdf.variable(x)))\n })\n query.pat.add(subject, WF('message'), v.msg)\n query.pat.add(v.msg, ns.dct('created'), v.date)\n query.pat.add(v.msg, ns.foaf('maker'), v.creator)\n query.pat.add(v.msg, ns.sioc('content'), v.content)\n }\n\n function doneQuery () {\n messageTable.fresh = true // any new are fresh and so will be greenish\n }\n store.query(query, renderMessage, undefined, doneQuery)\n div.refresh = function () {\n syncMessages(subject, messageTable)\n }\n // syncMessages(subject, messageTable) // no the query will do this async\n return div\n}\n"],"mappings":";;;;;;;;;;AAKA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,GAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,IAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,KAAA,GAAAJ,uBAAA,CAAAJ,OAAA;AACA,IAAAS,KAAA,GAAAL,uBAAA,CAAAJ,OAAA;AACA,IAAAU,OAAA,GAAAN,uBAAA,CAAAJ,OAAA;AAAqC,SAAAW,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,C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C,GAAG,CAACN,CAAC,CAACpC,GAAG,EAAEpJ,EAAE,CAACwH,IAAI,CAAC,OAAO,CAAC,EAAEgE,CAAC,CAAC1D,OAAO,CAAC;IACjDwD,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAACpC,GAAG,EAAEpJ,EAAE,CAACuH,IAAI,CAAC,SAAS,CAAC,EAAEiE,CAAC,CAACf,OAAO,CAAC;EACrD;EAEA,SAASuB,SAASA,CAAA,EAAI;IACpBjJ,YAAY,CAACyH,KAAK,GAAG,IAAI,EAAC;EAC5B;EACAlI,iBAAK,CAACgJ,KAAK,CAACA,KAAK,EAAE/F,aAAa,EAAEmB,SAAS,EAAEsF,SAAS,CAAC;EACvDnJ,GAAG,CAACoJ,OAAO,GAAG,YAAY;IACxB5D,YAAY,CAAClG,OAAO,EAAEY,YAAY,CAAC;EACrC,CAAC;EACD;EACA,OAAOF,GAAG;AACZ"} \ No newline at end of file diff --git a/lib/create/create.js b/lib/create/create.js index 9d705bf0..546b96e3 100644 --- a/lib/create/create.js +++ b/lib/create/create.js @@ -56,7 +56,6 @@ function newThingUI(createContext, dataBrowserContext, thePanes) { iconArray[i].setAttribute('style', st); // eg 'background-color: #ccc;' } } - function selectTool(icon) { styleTheIcons('display: none;'); // 'background-color: #ccc;' icon.setAttribute('style', iconStyle + 'background-color: yellow;'); @@ -111,7 +110,6 @@ function newThingUI(createContext, dataBrowserContext, thePanes) { // selectUI.parentNode.removeChild(selectUI) // Clean up // selectUIParent.removeChild(selectUI) // Clean up } - selectNewTool(); // toggle star to plain and menu vanish again })["catch"](function (err) { complain(err); diff --git a/lib/create/create.js.map b/lib/create/create.js.map index 3f624ef3..5dcc6cfc 100644 --- a/lib/create/create.js.map +++ b/lib/create/create.js.map @@ -1 +1 @@ -{"version":3,"file":"create.js","names":["_solidLogic","require","debug","_interopRequireWildcard","_iconBase","_login","ns","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","kb","solidLogicSingleton","store","newThingUI","createContext","dataBrowserContext","thePanes","dom","div","me","uri","Error","iconStyle","star","appendChild","createElement","visible","setAttribute","icons","iconBase","complain","message","pre","createTextNode","styleTheIcons","style","iconArray","length","st","disabled","selectTool","icon","selectNewTool","_event","addEventListener","makeNewAppInstance","options","Promise","resolve","reject","selectUI","callbackWS","ws","newBase","ensureLoadedProfile","then","_context","newPaneOptions","assign","folder","undefined","workspace","opt","log","concat","pane","name","mintNew","newInstance","tail","slice","isPackage","includes","add","ldp","sym","doc","refreshTarget","refresh","p","innerHTML","noun","err","pa","mintClass","label","appPathSegment","toUpperCase","selectWorkspace","gotName","endsWith","encodeURIComponent","askName","foaf","mintingPanes","values","filter","mintingClassMap","reduce","classMap","forEach","push","event","iconEle","noIndexHTML"],"sources":["../../src/create/create.ts"],"sourcesContent":["/* create.js UI to craete new objects in the solid-app-set world\n **\n */\n\nimport { DataBrowserContext, NewPaneOptions, PaneDefinition } from 'pane-registry'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { ensureLoadedProfile, selectWorkspace } from '../login/login'\nimport * as ns from '../ns'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { CreateContext, NewAppInstanceOptions } from './types'\n\nconst kb = solidLogicSingleton.store\n\n/* newThingUI -- return UI for user to select a new object, folder, etc\n **\n ** context must include: dom, div,\n ** optional: folder: NamedNode -- the folder where the thing is bring put\n ** (suppresses asking for a full URI or workspace)\n **\n */\nexport function newThingUI (\n createContext: CreateContext,\n dataBrowserContext: DataBrowserContext,\n thePanes: Array\n): void {\n const dom = createContext.dom\n const div = createContext.div\n if (createContext.me && !createContext.me.uri) {\n throw new Error('newThingUI: Invalid userid: ' + createContext.me)\n }\n\n const iconStyle = 'padding: 0.7em; width: 2em; height: 2em;' // was: 'padding: 1em; width: 3em; height: 3em;'\n const star = div.appendChild(dom.createElement('img'))\n let visible = false // the inividual tools tools\n // noun_272948.svg = black star\n // noun_34653_green.svg = green plus\n star.setAttribute('src', icons.iconBase + 'noun_34653_green.svg')\n star.setAttribute('style', iconStyle)\n star.setAttribute('title', 'Add another tool')\n\n const complain = function complain (message) {\n const pre = div.appendChild(dom.createElement('pre'))\n pre.setAttribute('style', 'background-color: pink')\n pre.appendChild(dom.createTextNode(message))\n }\n\n function styleTheIcons (style) {\n for (let i = 0; i < iconArray.length; i++) {\n let st = iconStyle + style\n if (iconArray[i].disabled) {\n // @@ unused\n st += 'opacity: 0.3;'\n }\n iconArray[i].setAttribute('style', st) // eg 'background-color: #ccc;'\n }\n }\n\n function selectTool (icon) {\n styleTheIcons('display: none;') // 'background-color: #ccc;'\n icon.setAttribute('style', iconStyle + 'background-color: yellow;')\n }\n\n function selectNewTool (_event?) {\n visible = !visible\n star.setAttribute(\n 'style',\n iconStyle + (visible ? 'background-color: yellow;' : '')\n )\n styleTheIcons(visible ? '' : 'display: none;')\n }\n\n star.addEventListener('click', selectNewTool)\n\n function makeNewAppInstance (options: NewAppInstanceOptions) {\n return new Promise(function (resolve, reject) {\n let selectUI // , selectUIParent\n function callbackWS (ws, newBase) {\n ensureLoadedProfile(createContext).then(\n _context => {\n const newPaneOptions: NewPaneOptions = Object.assign({\n newBase,\n folder: options.folder || undefined,\n workspace: ws\n }, options)\n for (const opt in options) {\n // get div, dom, me, folder, pane, refreshTable\n newPaneOptions[opt] = options[opt]\n }\n debug.log(`newThingUI: Minting new ${newPaneOptions.pane.name} at ${newPaneOptions.newBase}`)\n options.pane\n .mintNew!(dataBrowserContext, newPaneOptions)\n .then(function (newPaneOptions) {\n if (!newPaneOptions || !newPaneOptions.newInstance) {\n throw new Error('Cannot mint new - missing newInstance')\n }\n if (newPaneOptions.folder) {\n const tail = newPaneOptions.newInstance.uri.slice(\n newPaneOptions.folder.uri.length\n )\n const isPackage = tail.includes('/')\n debug.log(' new thing is packge? ' + isPackage)\n if (isPackage) {\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n kb.sym(newPaneOptions.newBase),\n newPaneOptions.folder.doc()\n )\n } else {\n // single file\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n newPaneOptions.newInstance,\n newPaneOptions.folder.doc()\n ) // Ping the patch system?\n }\n // @ts-ignore @@ TODO check whether refresh can exist here. Either fix type or remove unreachable code\n if (newPaneOptions.refreshTarget && newPaneOptions.refreshTarget.refresh) {\n // @@ TODO Remove the need to cast as any\n ;(newPaneOptions.refreshTarget as any).refresh() // Refresh the containing display\n }\n // selectUI.parentNode.removeChild(selectUI) It removes itself\n } else {\n const p = options.div.appendChild(dom.createElement('p'))\n p.setAttribute('style', 'font-size: 120%;')\n // Make link to new thing\n p.innerHTML =\n \"Your new \" +\n options.noun +\n ' is ready to be set up. ' +\n \"

                                                          Go to your new \" +\n options.noun +\n '.'\n // selectUI.parentNode.removeChild(selectUI) // Clean up\n // selectUIParent.removeChild(selectUI) // Clean up\n }\n selectNewTool() // toggle star to plain and menu vanish again\n })\n .catch(function (err) {\n complain(err)\n reject(err)\n })\n },\n err => {\n // login fails\n complain('Error logging on: ' + err)\n }\n )\n } // callbackWS\n\n const pa = options.pane\n // options.appPathSegment = pa.name // was 'edu.mit.solid.pane.'\n options.noun = pa.mintClass ? utils.label(pa.mintClass) : pa.name\n options.appPathSegment = options.noun.slice(0, 1).toUpperCase() + options.noun.slice(1)\n\n if (!options.folder) {\n // No folder given? Ask user for full URI\n selectUI = selectWorkspace(dom, {\n noun: options.noun,\n appPathSegment: options.appPathSegment\n }, callbackWS)\n options.div.appendChild(selectUI)\n // selectUIParent = options.div\n } else {\n const gotName = function (name) {\n if (!name) {\n // selectUIParent.removeChild(selectUI) itremves itself if cancelled\n selectNewTool() // toggle star to plain and menu vanish again\n } else {\n let uri = options.folder!.uri\n if (!uri.endsWith('/')) {\n uri = uri + '/'\n }\n uri = uri + encodeURIComponent(name) + '/'\n callbackWS(null, uri)\n }\n }\n widgets\n .askName(\n dom,\n kb,\n options.div,\n ns.foaf('name'),\n null,\n options.noun\n )\n .then(gotName)\n // selectUI = getNameForm(dom, kb, options.noun, gotName)\n // options.div.appendChild(selectUI)\n // selectUIParent = options.div\n }\n })\n } // makeNewAppInstance\n\n const iconArray: Array = []\n const mintingPanes = Object.values(thePanes).filter(pane => pane.mintNew)\n const mintingClassMap = mintingPanes.reduce((classMap, pane) => {\n if (pane.mintClass) {\n classMap[pane.mintClass.uri] = (classMap[pane.mintClass.uri] || 0) + 1\n }\n return classMap\n }, {})\n mintingPanes.forEach(pane => {\n // @@ TODO Remove the need to cast to any\n const icon: any = createContext.div.appendChild(dom.createElement('img'))\n icon.setAttribute('src', pane.icon)\n const noun = pane.mintClass\n ? mintingClassMap[pane.mintClass.uri] > 1\n ? `${utils.label(pane.mintClass)} (using ${pane.name} pane)`\n : utils.label(pane.mintClass)\n : pane.name + ' @@'\n icon.setAttribute('title', 'Make new ' + noun)\n icon.setAttribute('style', iconStyle + 'display: none;')\n iconArray.push(icon)\n if (!icon.disabled) {\n icon.addEventListener('click', function (e) {\n selectTool(icon)\n makeNewAppInstance({\n event: e,\n folder: createContext.folder || null,\n iconEle: icon,\n pane,\n noun,\n noIndexHTML: true, // do NOT @@ for now write a HTML file\n div: createContext.div,\n me: createContext.me,\n dom: createContext.dom,\n refreshTarget: createContext.refreshTarget\n })\n })\n }\n })\n}\n\n// Form to get the name of a new thing before we create it\n//\n// Used in contacts for new groups, individuals.\n//\n/*\nfunction getNameForm (dom, kb, classLabel, gotNameCallback) {\n const form = dom.createElement('div') // form is broken as HTML behaviour can resurface on js error\n form.innerHTML = '

                                                          Name of new ' + classLabel + ':

                                                          '\n const namefield = dom.createElement('input')\n namefield.setAttribute('type', 'text')\n namefield.setAttribute('size', '30')\n namefield.setAttribute('style', style.textInputStyle)\n namefield.setAttribute('maxLength', '2048') // No arbitrary limits\n namefield.select() // focus next user input\n\n const gotName = function () {\n namefield.setAttribute('class', 'pendingedit')\n namefield.disabled = true\n continueButton.disabled = true\n cancel.disabled = true\n gotNameCallback(true, namefield.value)\n }\n\n namefield.addEventListener('keyup', function (e) {\n if (e.keyCode === 13) {\n gotName()\n }\n }, false)\n form.appendChild(namefield)\n\n form.appendChild(dom.createElement('br'))\n\n const cancel = form.appendChild(widgets.cancelButton(dom))\n cancel.addEventListener('click', function (e) {\n form.parentNode.removeChild(form)\n gotNameCallback(false)\n }, false)\n\n const continueButton = form.appendChild(widgets.continueButton(dom))\n continueButton.addEventListener('click', function (e) {\n gotName()\n }, false)\n\n return form\n}\n*/\n"],"mappings":";;;;;;;AAKA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,EAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAJ,uBAAA,CAAAF,OAAA;AACA,IAAAO,OAAA,GAAAL,uBAAA,CAAAF,OAAA;AAAqC,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAA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AWC,IAAI,CAACC,IAAI,cAClD/E,KAAK,CAACkG,KAAK,CAACpB,IAAI,CAACmB,SAAS,CAAC,GAC7BnB,IAAI,CAACC,IAAI,GAAG,KAAK;IACrBzB,IAAI,CAACd,YAAY,CAAC,OAAO,EAAE,WAAW,GAAGsD,IAAI,CAAC;IAC9CxC,IAAI,CAACd,YAAY,CAAC,OAAO,EAAEL,SAAS,GAAG,gBAAgB,CAAC;IACxDc,SAAS,CAACiE,IAAI,CAAC5D,IAAI,CAAC;IACpB,IAAI,CAACA,IAAI,CAACF,QAAQ,EAAE;MAClBE,IAAI,CAACG,gBAAgB,CAAC,OAAO,EAAE,UAAUtD,CAAC,EAAE;QAC1CkD,UAAU,CAACC,IAAI,CAAC;QAChBI,kBAAkB,CAAC;UACjByD,KAAK,EAAEhH,CAAC;UACRqE,MAAM,EAAE7C,aAAa,CAAC6C,MAAM,IAAI,IAAI;UACpC4C,OAAO,EAAE9D,IAAI;UACbwB,IAAI,EAAJA,IAAI;UACJgB,IAAI,EAAJA,IAAI;UACJuB,WAAW,EAAE,IAAI;UAAE;UACnBtF,GAAG,EAAEJ,aAAa,CAACI,GAAG;UACtBC,EAAE,EAAEL,aAAa,CAACK,EAAE;UACpBF,GAAG,EAAEH,aAAa,CAACG,GAAG;UACtB4D,aAAa,EAAE/D,aAAa,CAAC+D;QAC/B,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"} \ No newline at end of file +{"version":3,"file":"create.js","names":["_solidLogic","require","debug","_interopRequireWildcard","_iconBase","_login","ns","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","kb","solidLogicSingleton","store","newThingUI","createContext","dataBrowserContext","thePanes","dom","div","me","uri","Error","iconStyle","star","appendChild","createElement","visible","setAttribute","icons","iconBase","complain","message","pre","createTextNode","styleTheIcons","style","iconArray","length","st","disabled","selectTool","icon","selectNewTool","_event","addEventListener","makeNewAppInstance","options","Promise","resolve","reject","selectUI","callbackWS","ws","newBase","ensureLoadedProfile","then","_context","newPaneOptions","assign","folder","undefined","workspace","opt","log","concat","pane","name","mintNew","newInstance","tail","slice","isPackage","includes","add","ldp","sym","doc","refreshTarget","refresh","p","innerHTML","noun","err","pa","mintClass","label","appPathSegment","toUpperCase","selectWorkspace","gotName","endsWith","encodeURIComponent","askName","foaf","mintingPanes","values","filter","mintingClassMap","reduce","classMap","forEach","push","event","iconEle","noIndexHTML"],"sources":["../../src/create/create.ts"],"sourcesContent":["/* create.js UI to craete new objects in the solid-app-set world\n **\n */\n\nimport { DataBrowserContext, NewPaneOptions, PaneDefinition } from 'pane-registry'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { ensureLoadedProfile, selectWorkspace } from '../login/login'\nimport * as ns from '../ns'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { CreateContext, NewAppInstanceOptions } from './types'\n\nconst kb = solidLogicSingleton.store\n\n/* newThingUI -- return UI for user to select a new object, folder, etc\n **\n ** context must include: dom, div,\n ** optional: folder: NamedNode -- the folder where the thing is bring put\n ** (suppresses asking for a full URI or workspace)\n **\n */\nexport function newThingUI (\n createContext: CreateContext,\n dataBrowserContext: DataBrowserContext,\n thePanes: Array\n): void {\n const dom = createContext.dom\n const div = createContext.div\n if (createContext.me && !createContext.me.uri) {\n throw new Error('newThingUI: Invalid userid: ' + createContext.me)\n }\n\n const iconStyle = 'padding: 0.7em; width: 2em; height: 2em;' // was: 'padding: 1em; width: 3em; height: 3em;'\n const star = div.appendChild(dom.createElement('img'))\n let visible = false // the inividual tools tools\n // noun_272948.svg = black star\n // noun_34653_green.svg = green plus\n star.setAttribute('src', icons.iconBase + 'noun_34653_green.svg')\n star.setAttribute('style', iconStyle)\n star.setAttribute('title', 'Add another tool')\n\n const complain = function complain (message) {\n const pre = div.appendChild(dom.createElement('pre'))\n pre.setAttribute('style', 'background-color: pink')\n pre.appendChild(dom.createTextNode(message))\n }\n\n function styleTheIcons (style) {\n for (let i = 0; i < iconArray.length; i++) {\n let st = iconStyle + style\n if (iconArray[i].disabled) {\n // @@ unused\n st += 'opacity: 0.3;'\n }\n iconArray[i].setAttribute('style', st) // eg 'background-color: #ccc;'\n }\n }\n\n function selectTool (icon) {\n styleTheIcons('display: none;') // 'background-color: #ccc;'\n icon.setAttribute('style', iconStyle + 'background-color: yellow;')\n }\n\n function selectNewTool (_event?) {\n visible = !visible\n star.setAttribute(\n 'style',\n iconStyle + (visible ? 'background-color: yellow;' : '')\n )\n styleTheIcons(visible ? '' : 'display: none;')\n }\n\n star.addEventListener('click', selectNewTool)\n\n function makeNewAppInstance (options: NewAppInstanceOptions) {\n return new Promise(function (resolve, reject) {\n let selectUI // , selectUIParent\n function callbackWS (ws, newBase) {\n ensureLoadedProfile(createContext).then(\n _context => {\n const newPaneOptions: NewPaneOptions = Object.assign({\n newBase,\n folder: options.folder || undefined,\n workspace: ws\n }, options)\n for (const opt in options) {\n // get div, dom, me, folder, pane, refreshTable\n newPaneOptions[opt] = options[opt]\n }\n debug.log(`newThingUI: Minting new ${newPaneOptions.pane.name} at ${newPaneOptions.newBase}`)\n options.pane\n .mintNew!(dataBrowserContext, newPaneOptions)\n .then(function (newPaneOptions) {\n if (!newPaneOptions || !newPaneOptions.newInstance) {\n throw new Error('Cannot mint new - missing newInstance')\n }\n if (newPaneOptions.folder) {\n const tail = newPaneOptions.newInstance.uri.slice(\n newPaneOptions.folder.uri.length\n )\n const isPackage = tail.includes('/')\n debug.log(' new thing is packge? ' + isPackage)\n if (isPackage) {\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n kb.sym(newPaneOptions.newBase),\n newPaneOptions.folder.doc()\n )\n } else {\n // single file\n kb.add(\n newPaneOptions.folder,\n ns.ldp('contains'),\n newPaneOptions.newInstance,\n newPaneOptions.folder.doc()\n ) // Ping the patch system?\n }\n // @ts-ignore @@ TODO check whether refresh can exist here. Either fix type or remove unreachable code\n if (newPaneOptions.refreshTarget && newPaneOptions.refreshTarget.refresh) {\n // @@ TODO Remove the need to cast as any\n ;(newPaneOptions.refreshTarget as any).refresh() // Refresh the containing display\n }\n // selectUI.parentNode.removeChild(selectUI) It removes itself\n } else {\n const p = options.div.appendChild(dom.createElement('p'))\n p.setAttribute('style', 'font-size: 120%;')\n // Make link to new thing\n p.innerHTML =\n \"Your new \" +\n options.noun +\n ' is ready to be set up. ' +\n \"

                                                          Go to your new \" +\n options.noun +\n '.'\n // selectUI.parentNode.removeChild(selectUI) // Clean up\n // selectUIParent.removeChild(selectUI) // Clean up\n }\n selectNewTool() // toggle star to plain and menu vanish again\n })\n .catch(function (err) {\n complain(err)\n reject(err)\n })\n },\n err => {\n // login fails\n complain('Error logging on: ' + err)\n }\n )\n } // callbackWS\n\n const pa = options.pane\n // options.appPathSegment = pa.name // was 'edu.mit.solid.pane.'\n options.noun = pa.mintClass ? utils.label(pa.mintClass) : pa.name\n options.appPathSegment = options.noun.slice(0, 1).toUpperCase() + options.noun.slice(1)\n\n if (!options.folder) {\n // No folder given? Ask user for full URI\n selectUI = selectWorkspace(dom, {\n noun: options.noun,\n appPathSegment: options.appPathSegment\n }, callbackWS)\n options.div.appendChild(selectUI)\n // selectUIParent = options.div\n } else {\n const gotName = function (name) {\n if (!name) {\n // selectUIParent.removeChild(selectUI) itremves itself if cancelled\n selectNewTool() // toggle star to plain and menu vanish again\n } else {\n let uri = options.folder!.uri\n if (!uri.endsWith('/')) {\n uri = uri + '/'\n }\n uri = uri + encodeURIComponent(name) + '/'\n callbackWS(null, uri)\n }\n }\n widgets\n .askName(\n dom,\n kb,\n options.div,\n ns.foaf('name'),\n null,\n options.noun\n )\n .then(gotName)\n // selectUI = getNameForm(dom, kb, options.noun, gotName)\n // options.div.appendChild(selectUI)\n // selectUIParent = options.div\n }\n })\n } // makeNewAppInstance\n\n const iconArray: Array = []\n const mintingPanes = Object.values(thePanes).filter(pane => pane.mintNew)\n const mintingClassMap = mintingPanes.reduce((classMap, pane) => {\n if (pane.mintClass) {\n classMap[pane.mintClass.uri] = (classMap[pane.mintClass.uri] || 0) + 1\n }\n return classMap\n }, {})\n mintingPanes.forEach(pane => {\n // @@ TODO Remove the need to cast to any\n const icon: any = createContext.div.appendChild(dom.createElement('img'))\n icon.setAttribute('src', pane.icon)\n const noun = pane.mintClass\n ? mintingClassMap[pane.mintClass.uri] > 1\n ? `${utils.label(pane.mintClass)} (using ${pane.name} pane)`\n : utils.label(pane.mintClass)\n : pane.name + ' @@'\n icon.setAttribute('title', 'Make new ' + noun)\n icon.setAttribute('style', iconStyle + 'display: none;')\n iconArray.push(icon)\n if (!icon.disabled) {\n icon.addEventListener('click', function (e) {\n selectTool(icon)\n makeNewAppInstance({\n event: e,\n folder: createContext.folder || null,\n iconEle: icon,\n pane,\n noun,\n noIndexHTML: true, // do NOT @@ for now write a HTML file\n div: createContext.div,\n me: createContext.me,\n dom: createContext.dom,\n refreshTarget: createContext.refreshTarget\n })\n })\n }\n })\n}\n\n// Form to get the name of a new thing before we create it\n//\n// Used in contacts for new groups, individuals.\n//\n/*\nfunction getNameForm (dom, kb, classLabel, gotNameCallback) {\n const form = dom.createElement('div') // form is broken as HTML behaviour can resurface on js error\n form.innerHTML = '

                                                          Name of new ' + classLabel + ':

                                                          '\n const namefield = dom.createElement('input')\n namefield.setAttribute('type', 'text')\n namefield.setAttribute('size', '30')\n namefield.setAttribute('style', style.textInputStyle)\n namefield.setAttribute('maxLength', '2048') // No arbitrary limits\n namefield.select() // focus next user input\n\n const gotName = function () {\n namefield.setAttribute('class', 'pendingedit')\n namefield.disabled = true\n continueButton.disabled = true\n cancel.disabled = true\n gotNameCallback(true, namefield.value)\n }\n\n namefield.addEventListener('keyup', function (e) {\n if (e.keyCode === 13) {\n gotName()\n }\n }, false)\n form.appendChild(namefield)\n\n form.appendChild(dom.createElement('br'))\n\n const cancel = form.appendChild(widgets.cancelButton(dom))\n cancel.addEventListener('click', function (e) {\n form.parentNode.removeChild(form)\n gotNameCallback(false)\n }, false)\n\n const continueButton = form.appendChild(widgets.continueButton(dom))\n continueButton.addEventListener('click', function (e) {\n gotName()\n }, false)\n\n return form\n}\n*/\n"],"mappings":";;;;;;;AAKA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,EAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAJ,uBAAA,CAAAF,OAAA;AACA,IAAAO,OAAA,GAAAL,uBAAA,CAAAF,OAAA;AAAqC,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,M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AAS,CAAC,cAAApB,MAAA,CAAWC,IAAI,CAACC,IAAI,cAClD/E,KAAK,CAACkG,KAAK,CAACpB,IAAI,CAACmB,SAAS,CAAC,GAC7BnB,IAAI,CAACC,IAAI,GAAG,KAAK;IACrBzB,IAAI,CAACd,YAAY,CAAC,OAAO,EAAE,WAAW,GAAGsD,IAAI,CAAC;IAC9CxC,IAAI,CAACd,YAAY,CAAC,OAAO,EAAEL,SAAS,GAAG,gBAAgB,CAAC;IACxDc,SAAS,CAACiE,IAAI,CAAC5D,IAAI,CAAC;IACpB,IAAI,CAACA,IAAI,CAACF,QAAQ,EAAE;MAClBE,IAAI,CAACG,gBAAgB,CAAC,OAAO,EAAE,UAAUtD,CAAC,EAAE;QAC1CkD,UAAU,CAACC,IAAI,CAAC;QAChBI,kBAAkB,CAAC;UACjByD,KAAK,EAAEhH,CAAC;UACRqE,MAAM,EAAE7C,aAAa,CAAC6C,MAAM,IAAI,IAAI;UACpC4C,OAAO,EAAE9D,IAAI;UACbwB,IAAI,EAAJA,IAAI;UACJgB,IAAI,EAAJA,IAAI;UACJuB,WAAW,EAAE,IAAI;UAAE;UACnBtF,GAAG,EAAEJ,aAAa,CAACI,GAAG;UACtBC,EAAE,EAAEL,aAAa,CAACK,EAAE;UACpBF,GAAG,EAAEH,aAAa,CAACG,GAAG;UACtB4D,aAAa,EAAE/D,aAAa,CAAC+D;QAC/B,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"} \ No newline at end of file diff --git a/lib/login/login.js b/lib/login/login.js index 084ebd79..c74352cd 100644 --- a/lib/login/login.js +++ b/lib/login/login.js @@ -35,29 +35,29 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /* eslint-disable camelcase */ /** - * Signing in, signing up, profile and preferences reloading - * Type index management - * - * Many functions in this module take a context object which - * holds various RDF symbols, add to it, and return a promise of it. - * - * * `me` RDF symbol for the user's WebID - * * `publicProfile` The user's public profile, iff loaded - * * `preferencesFile` The user's personal preference file, iff loaded - * * `index.public` The user's public type index file - * * `index.private` The user's private type index file - * - * Not RDF symbols: - * * `noun` A string in english for the type of thing -- like "address book" - * * `instance` An array of nodes which are existing instances - * * `containers` An array of nodes of containers of instances - * * `div` A DOM element where UI can be displayed - * * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages - * * - * * Vocabulary: "load" loads a file if it exists; - * * 'Ensure" CREATES the file if it does not exist (if it can) and then loads it. - * @packageDocumentation - */ // eslint-disable-next-line camelcase + * Signing in, signing up, profile and preferences reloading + * Type index management + * + * Many functions in this module take a context object which + * holds various RDF symbols, add to it, and return a promise of it. + * + * * `me` RDF symbol for the user's WebID + * * `publicProfile` The user's public profile, iff loaded + * * `preferencesFile` The user's personal preference file, iff loaded + * * `index.public` The user's public type index file + * * `index.private` The user's private type index file + * + * Not RDF symbols: + * * `noun` A string in english for the type of thing -- like "address book" + * * `instance` An array of nodes which are existing instances + * * `containers` An array of nodes of containers of instances + * * `div` A DOM element where UI can be displayed + * * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages + * * + * * Vocabulary: "load" loads a file if it exists; + * * 'Ensure" CREATES the file if it does not exist (if it can) and then loads it. + * @packageDocumentation + */ // eslint-disable-next-line camelcase var store = _solidLogic.solidLogicSingleton.store; var _solidLogicSingleton$ = _solidLogic.solidLogicSingleton.profile, loadPreferences = _solidLogicSingleton$.loadPreferences, @@ -95,7 +95,6 @@ function ensureLoggedIn(context) { _solidLogic.authn.saveUser(webIdUri, context); resolve(context); // always pass growing context }); - context.div.appendChild(box); }); }); diff --git a/lib/login/login.js.map b/lib/login/login.js.map index b6c727e5..9477ad70 100644 --- a/lib/login/login.js.map +++ b/lib/login/login.js.map @@ -1 +1 @@ -{"version":3,"file":"login.js","names":["_rdflib","require","_solidLogic","debug","_interopRequireWildcard","style","_log","ns","_signup","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","store","solidLogicSingleton","_solidLogicSingleton$","profile","loadPreferences","loadProfile","_solidLogicSingleton$2","typeIndex","getScopedAppInstances","getRegistrations","loadAllTypeIndexes","getScopedAppsFromIndex","deleteTypeIndexRegistration","ensureLoggedIn","context","me","authn","currentUser","saveUser","Promise","resolve","checkUser","then","webId","log","concat","div","dom","box","loginStatusBox","webIdUri","appendChild","ensureLoadedPreferences","_x","_ensureLoadedPreferences","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee4","progressDisplay","preferencesFile","m2","wrap","_callee4$","_context4","prev","abrupt","ensureLoadedProfile","sent","parentNode","removeChild","t0","UnauthorizedError","alert","CrossOriginForbiddenError","window","location","origin","preferencesFileError","SameOriginForbiddenError","warn","NotEditableError","WebOperationError","FetchError","status","message","Error","stop","_x2","_ensureLoadedProfile","_callee5","logInContext","_callee5$","_context5","publicProfile","errorMessageBlock","findAppInstances","_x3","_x4","_x5","_findAppInstances","_callee6","theClass","isPublic","items","_callee6$","_context6","filter","item","scope","label","instances","map","instance","scopeLabel","mine","sameTerm","agent","registrationControl","_x6","_x7","_x8","_registrationControl","_callee7","registrationStatements","renderScopeCheckbox","scopes","msg","tbody","form","_iterator","_step","row","_callee7$","_context7","_renderScopeCheckbox","statements","index","noun","buildCheckboxForm","_registrationStatemen","registrations","reg","newThing","st","solid","createElement","innerHTML","textContent","setAttribute","children","BlankNode","renderScopeHeadingRow","backgroundColor","cell","backgoundColor","header","textAlign","registrationList","_x9","_x10","_registrationList","_callee9","options","table","_iterator2","_step2","headingRow","_iterator3","_step3","_loop","_callee9$","_context10","firstChild","type","display","_loop$","_context9","personTR","deleteFunction","_deleteFunction","_callee8","_callee8$","_context8","paddingLeft","delegateYield","t1","finish","t2","getDefaultSignInButtonStyle","signInOrSignUpBox","setUserCallback","undefined","signInButtonStyle","buttonStyle","magicClassName","signInPopUpButton","headerBannerLoginInput","authSession","onLogin","webIdURI","uri","divs","getElementsByClassName","parent","addEventListener","offline","offlineTestID","renderSignInPopup","signupButton","_event","signupMgr","Signup","signup","issuerPopup","body","issuerPopupBox","issuerPopupBoxTopMenu","issuerPopupBoxLabel","innerText","issuerPopupBoxCloseButton","remove","loginToIssuer","_ref","_callee","issuerUri","preLoginRedirectHash","locationUrl","_callee$","_context","updater","flagAuthorizationMetadata","URL","href","hash","localStorage","setItem","login","redirectUrl","oidcIssuer","_x11","issuerTextContainer","issuerTextInputContainer","issuerTextLabel","issuerTextInput","getItem","issuerTextGoButton","issuerButtonContainer","issuerBottonLabel","getSuggestedIssuers","forEach","issuerInfo","issuerButton","listener","setIt","newidURI","refresh","logoutButtonHandler","oldMe","logout","logoutButton","logoutLabel","nick","any","foaf","signOutButton","sessionInfo","info","isLoggedIn","sym","clearElement","trackSession","onLogout","_callee2","issuer","wellKnownUri","wellKnownResult","openidConfiguration","_callee2$","_context2","pathname","fetch","json","end_session_endpoint","credentials","reload","selectWorkspace","appDetails","callbackWS","appPathSegment","say","background","figureOutBase","ws","newBaseNode","space","newBaseString","split","now","Date","getTime","displayOptions","makeNewWorkspace","_x12","_makeNewWorkspace","_callee3","newBase","newWs","newData","_callee3$","_context3","padding","encodeURI","askName","update","id","w","each","storages","ldp","file","includes","toLowerCase","p","commentStyle","baseField","textInputStyle","size","autocomplete","button","replace","x","holds","rdf","col1","col2","col3","tr","localStyle","comment","cellStyle","deselectedStyle","anyValue","ui","reduce","b","charCodeAt","bgcolor","target","rdfs","disabled","trLast","newAppInstance","callback","gotWS","base","getUserRoles","_getUserRoles","_callee10","_yield$ensureLoadedPr","_callee10$","_context11","doc","filterAvailablePanes","_x13","_filterAvailablePanes","_callee11","panes","userRoles","_callee11$","_context12","pane","isMatchingAudience","audience","isMatch","audienceRole","find","role","equals"],"sources":["../../src/login/login.ts"],"sourcesContent":["/* eslint-disable camelcase */\n/**\n * Signing in, signing up, profile and preferences reloading\n * Type index management\n *\n * Many functions in this module take a context object which\n * holds various RDF symbols, add to it, and return a promise of it.\n *\n * * `me` RDF symbol for the user's WebID\n * * `publicProfile` The user's public profile, iff loaded\n * * `preferencesFile` The user's personal preference file, iff loaded\n * * `index.public` The user's public type index file\n * * `index.private` The user's private type index file\n *\n * Not RDF symbols:\n * * `noun` A string in english for the type of thing -- like \"address book\"\n * * `instance` An array of nodes which are existing instances\n * * `containers` An array of nodes of containers of instances\n * * `div` A DOM element where UI can be displayed\n * * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages\n * *\n * * Vocabulary: \"load\" loads a file if it exists;\n * * 'Ensure\" CREATES the file if it does not exist (if it can) and then loads it.\n * @packageDocumentation\n */\nimport { PaneDefinition } from 'pane-registry'\nimport { BlankNode, NamedNode, st } from 'rdflib'\n// eslint-disable-next-line camelcase\nimport { Quad_Object } from 'rdflib/lib/tf-types'\nimport {\n AppDetails,\n AuthenticationContext,\n authn,\n authSession,\n CrossOriginForbiddenError,\n FetchError,\n getSuggestedIssuers,\n NotEditableError,\n offlineTestID,\n SameOriginForbiddenError,\n solidLogicSingleton,\n UnauthorizedError,\n WebOperationError\n} from 'solid-logic'\nimport * as debug from '../debug'\nimport * as style from '../style'\nimport { alert } from '../log'\nimport * as ns from '../ns.js'\nimport { Signup } from '../signup/signup.js'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst store = solidLogicSingleton.store\n\nconst {\n loadPreferences,\n loadProfile\n} = solidLogicSingleton.profile\n\nconst {\n getScopedAppInstances,\n getRegistrations,\n loadAllTypeIndexes,\n getScopedAppsFromIndex,\n deleteTypeIndexRegistration\n} = solidLogicSingleton.typeIndex\n\n/**\n * Resolves with the logged in user's WebID\n *\n * @param context\n */\n// used to be logIn\nexport function ensureLoggedIn (context: AuthenticationContext): Promise {\n const me = authn.currentUser()\n if (me) {\n authn.saveUser(me, context)\n return Promise.resolve(context)\n }\n\n return new Promise((resolve) => {\n authn.checkUser().then((webId) => {\n // Already logged in?\n if (webId) {\n debug.log(`logIn: Already logged in as ${webId}`)\n return resolve(context)\n }\n if (!context.div || !context.dom) {\n return resolve(context)\n }\n const box = loginStatusBox(context.dom, (webIdUri) => {\n authn.saveUser(webIdUri, context)\n resolve(context) // always pass growing context\n })\n context.div.appendChild(box)\n })\n })\n}\n\n/**\n * Loads preference file\n * Do this after having done log in and load profile\n *\n * @private\n *\n * @param context\n */\n// used to be logInLoadPreferences\nexport async function ensureLoadedPreferences (\n context: AuthenticationContext\n): Promise {\n if (context.preferencesFile) return Promise.resolve(context) // already done\n\n // const statusArea = context.statusArea || context.div || null\n let progressDisplay\n /* COMPLAIN FUNCTION NOT USED/TAKING IT OUT FOR NOW\n function complain (message) {\n message = `ensureLoadedPreferences: ${message}`\n if (statusArea) {\n // statusArea.innerHTML = ''\n statusArea.appendChild(widgets.errorMessageBlock(context.dom, message))\n }\n debug.log(message)\n // reject(new Error(message))\n } */\n try {\n context = await ensureLoadedProfile(context)\n\n // console.log('back in Solid UI after logInLoadProfile', context)\n const preferencesFile = await loadPreferences(context.me as NamedNode)\n if (progressDisplay) {\n progressDisplay.parentNode.removeChild(progressDisplay)\n }\n context.preferencesFile = preferencesFile\n } catch (err) {\n let m2: string\n if (err instanceof UnauthorizedError) {\n m2 =\n 'Ooops - you are not authenticated (properly logged in) to for me to read your preference file. Try loggin out and logging in?'\n alert(m2)\n } else if (err instanceof CrossOriginForbiddenError) {\n m2 = `Unauthorized: Assuming preference file blocked for origin ${window.location.origin}`\n context.preferencesFileError = m2\n return context\n } else if (err instanceof SameOriginForbiddenError) {\n m2 =\n 'You are not authorized to read your preference file. This may be because you are using an untrusted web app.'\n debug.warn(m2)\n return context\n } else if (err instanceof NotEditableError) {\n m2 =\n 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.'\n debug.warn(m2)\n return context\n } else if (err instanceof WebOperationError) {\n m2 =\n 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.'\n debug.warn(m2)\n } else if (err instanceof FetchError) {\n m2 = `Strange: Error ${err.status} trying to read your preference file.${err.message}`\n alert(m2)\n } else {\n throw new Error(`(via loadPrefs) ${err}`)\n }\n }\n return context\n}\n\n/**\n * Logs the user in and loads their WebID profile document into the store\n *\n * @param context\n *\n * @returns Resolves with the context after login / fetch\n */\n// used to be logInLoadProfile\nexport async function ensureLoadedProfile (\n context: AuthenticationContext\n): Promise {\n if (context.publicProfile) {\n return context\n } // already done\n try {\n const logInContext = await ensureLoggedIn(context)\n if (!logInContext.me) {\n throw new Error('Could not log in')\n }\n context.publicProfile = await loadProfile(logInContext.me)\n } catch (err) {\n if (context.div && context.dom) {\n context.div.appendChild(widgets.errorMessageBlock(context.dom, err.message))\n }\n throw new Error(`Can't log in: ${err}`)\n }\n return context\n}\n\n/**\n * Returns promise of context with arrays of symbols\n *\n * leaving the `isPublic` param undefined will bring in community index things, too\n */\nexport async function findAppInstances (\n context: AuthenticationContext,\n theClass: NamedNode,\n isPublic?: boolean\n): Promise {\n let items = context.me ? await getScopedAppInstances(theClass, context.me) : []\n if (isPublic === true) { // old API - not recommended!\n items = items.filter(item => item.scope.label === 'public')\n } else if (isPublic === false) {\n items = items.filter(item => item.scope.label === 'private')\n }\n context.instances = items.map(item => item.instance)\n return context\n}\n\nexport function scopeLabel (context, scope) {\n const mine = context.me && context.me.sameTerm(scope.agent)\n const name = mine ? '' : utils.label(scope.agent) + ' '\n return `${name}${scope.label}`\n}\n/**\n * UI to control registration of instance\n */\nexport async function registrationControl (\n context: AuthenticationContext,\n instance,\n theClass\n): Promise {\n function registrationStatements (index) {\n const registrations = getRegistrations(instance, theClass)\n const reg = registrations.length ? registrations[0] : widgets.newThing(index)\n return [\n st(reg, ns.solid('instance'), instance, index),\n st(reg, ns.solid('forClass'), theClass, index)\n ]\n }\n\n function renderScopeCheckbox (scope) {\n const statements = registrationStatements(scope.index)\n const name = scopeLabel(context, scope)\n const label = `${name} link to this ${context.noun}`\n return widgets.buildCheckboxForm(\n context.dom,\n solidLogicSingleton.store,\n label,\n null,\n statements,\n form,\n scope.index\n )\n }\n /// / body of registrationControl\n const dom = context.dom\n if (!dom || !context.div) {\n throw new Error('registrationControl: need dom and div')\n }\n const box = dom.createElement('div')\n context.div.appendChild(box)\n context.me = authn.currentUser() // @@\n const me = context.me\n if (!me) {\n box.innerHTML = '

                                                          (Log in to save a link to this)

                                                          '\n return context\n }\n\n let scopes // @@ const\n try {\n scopes = await loadAllTypeIndexes(me)\n } catch (e) {\n let msg\n if (context.div && context.preferencesFileError) {\n msg = '(Lists of stuff not available)'\n context.div.appendChild(dom.createElement('p')).textContent = msg\n } else if (context.div) {\n msg = `registrationControl: Type indexes not available: ${e}`\n context.div.appendChild(widgets.errorMessageBlock(context.dom, e))\n }\n debug.log(msg)\n return context\n }\n\n box.innerHTML = '
                                                          ' // tbody will be inserted anyway\n box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;')\n const tbody = box.children[0].children[0]\n const form = new BlankNode() // @@ say for now\n\n for (const scope of scopes) {\n const row = tbody.appendChild(dom.createElement('tr'))\n row.appendChild(renderScopeCheckbox(scope)) // @@ index\n }\n return context\n}\n\nexport function renderScopeHeadingRow (context, store, scope) {\n const backgroundColor = { private: '#fee', public: '#efe' }\n const { dom } = context\n const name = scopeLabel(context, scope)\n const row = dom.createElement('tr')\n const cell = row.appendChild(dom.createElement('td'))\n cell.setAttribute('colspan', '3')\n cell.style.backgoundColor = backgroundColor[scope.label] || 'white'\n const header = cell.appendChild(dom.createElement('h3'))\n header.textContent = name + ' links'\n header.style.textAlign = 'left'\n return row\n}\n/**\n * UI to List at all registered things\n */\nexport async function registrationList (context: AuthenticationContext, options: {\n private?: boolean\n public?: boolean\n type?: NamedNode\n}): Promise {\n const dom = context.dom as HTMLDocument\n const div = context.div as HTMLElement\n\n const box = dom.createElement('div')\n div.appendChild(box)\n context.me = authn.currentUser() // @@\n if (!context.me) {\n box.innerHTML = '

                                                          (Log in list your stuff)

                                                          '\n return context\n }\n\n const scopes = await loadAllTypeIndexes(context.me) // includes community indexes\n\n // console.log('@@ registrationList ', scopes)\n box.innerHTML = '
                                                          ' // tbody will be inserted anyway\n box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;')\n const table = box.firstChild as HTMLElement\n const tbody = table.firstChild as HTMLElement\n\n for (const scope of scopes) { // need some predicate for listing/adding agents\n const headingRow = renderScopeHeadingRow(context, store, scope)\n tbody.appendChild(headingRow)\n const items = await getScopedAppsFromIndex(scope, options.type || null) // any class\n if (items.length === 0) headingRow.style.display = 'none'\n // console.log(`registrationList: @@ instance items for class ${options.type || 'undefined' }:`, items)\n for (const item of items) {\n const row = widgets.personTR(dom, ns.solid('instance'), item.instance, {\n deleteFunction: async () => {\n await deleteTypeIndexRegistration(item)\n tbody.removeChild(row)\n }\n })\n row.children[0].style.paddingLeft = '3em'\n\n tbody.appendChild(row)\n }\n }\n return context\n} // registrationList\n\nfunction getDefaultSignInButtonStyle (): string {\n return 'padding: 1em; border-radius:0.5em; font-size: 100%;'\n}\n\n/**\n * Bootstrapping identity\n * (Called by `loginStatusBox()`)\n *\n * @param dom\n * @param setUserCallback\n *\n * @returns\n */\nfunction signInOrSignUpBox (\n dom: HTMLDocument,\n setUserCallback: (user: string) => void,\n options: {\n buttonStyle?: string;\n } = {}\n): HTMLElement {\n options = options || {}\n const signInButtonStyle = options.buttonStyle || getDefaultSignInButtonStyle()\n\n const box: any = dom.createElement('div')\n const magicClassName = 'SolidSignInOrSignUpBox'\n debug.log('widgets.signInOrSignUpBox')\n box.setUserCallback = setUserCallback\n box.setAttribute('class', magicClassName)\n box.setAttribute('style', 'display:flex;')\n\n // Sign in button with PopUP\n const signInPopUpButton = dom.createElement('input') // multi\n box.appendChild(signInPopUpButton)\n signInPopUpButton.setAttribute('type', 'button')\n signInPopUpButton.setAttribute('value', 'Log in')\n signInPopUpButton.setAttribute('style', `${signInButtonStyle}background-color: #eef;${style.headerBannerLoginInput}`)\n\n authSession.onLogin(() => {\n const me = authn.currentUser()\n // const sessionInfo = authSession.info\n // if (sessionInfo && sessionInfo.isLoggedIn) {\n if (me) {\n // const webIdURI = sessionInfo.webId\n const webIdURI = me.uri\n // setUserCallback(webIdURI)\n const divs = dom.getElementsByClassName(magicClassName)\n debug.log(`Logged in, ${divs.length} panels to be serviced`)\n // At the same time, satisfy all the other login boxes\n for (let i = 0; i < divs.length; i++) {\n const div: any = divs[i]\n // @@ TODO Remove the need to manipulate HTML elements\n if (div.setUserCallback) {\n try {\n div.setUserCallback(webIdURI)\n const parent = div.parentNode\n if (parent) {\n parent.removeChild(div)\n }\n } catch (e) {\n debug.log(`## Error satisfying login box: ${e}`)\n div.appendChild(widgets.errorMessageBlock(dom, e))\n }\n }\n }\n }\n })\n\n signInPopUpButton.addEventListener(\n 'click',\n () => {\n const offline = offlineTestID()\n if (offline) return setUserCallback(offline.uri)\n\n renderSignInPopup(dom)\n },\n false\n )\n\n // Sign up button\n const signupButton = dom.createElement('input')\n box.appendChild(signupButton)\n signupButton.setAttribute('type', 'button')\n signupButton.setAttribute('value', 'Sign Up for Solid')\n signupButton.setAttribute('style', `${signInButtonStyle}background-color: #efe;${style.headerBannerLoginInput}`)\n\n signupButton.addEventListener(\n 'click',\n function (_event) {\n const signupMgr = new Signup()\n signupMgr.signup().then(function (uri) {\n debug.log('signInOrSignUpBox signed up ' + uri)\n setUserCallback(uri)\n })\n },\n false\n )\n return box\n}\n\nexport function renderSignInPopup (dom: HTMLDocument) {\n /**\n * Issuer Menu\n */\n const issuerPopup = dom.createElement('div')\n issuerPopup.setAttribute(\n 'style',\n 'position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center;'\n )\n dom.body.appendChild(issuerPopup)\n const issuerPopupBox = dom.createElement('div')\n issuerPopupBox.setAttribute(\n 'style',\n `\n background-color: white;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -moz-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -o-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n border-radius: 4px;\n min-width: 400px;\n padding: 10px;\n z-index : 10;\n `\n )\n issuerPopup.appendChild(issuerPopupBox)\n const issuerPopupBoxTopMenu = dom.createElement('div')\n issuerPopupBoxTopMenu.setAttribute(\n 'style',\n `\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n `\n )\n issuerPopupBox.appendChild(issuerPopupBoxTopMenu)\n const issuerPopupBoxLabel = dom.createElement('label')\n issuerPopupBoxLabel.setAttribute('style', 'margin-right: 5px; font-weight: 800')\n issuerPopupBoxLabel.innerText = 'Select an identity provider'\n const issuerPopupBoxCloseButton = dom.createElement('button')\n issuerPopupBoxCloseButton.innerHTML =\n ''\n issuerPopupBoxCloseButton.setAttribute('style', 'background-color: transparent; border: none;')\n issuerPopupBoxCloseButton.addEventListener('click', () => {\n issuerPopup.remove()\n })\n issuerPopupBoxTopMenu.appendChild(issuerPopupBoxLabel)\n issuerPopupBoxTopMenu.appendChild(issuerPopupBoxCloseButton)\n\n const loginToIssuer = async (issuerUri: string) => {\n try {\n // clear authorization metadata from store\n solidLogicSingleton.store.updater.flagAuthorizationMetadata() as any\n // Save hash\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n window.localStorage.setItem('loginIssuer', issuerUri)\n // Login\n const locationUrl = new URL(window.location.href)\n locationUrl.hash = '' // remove hash part\n await authSession.login({\n redirectUrl: locationUrl.href,\n oidcIssuer: issuerUri\n })\n } catch (err) {\n alert(err.message)\n }\n }\n\n /**\n * Text-based idp selection\n */\n const issuerTextContainer = dom.createElement('div')\n issuerTextContainer.setAttribute(\n 'style',\n `\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n `\n )\n const issuerTextInputContainer = dom.createElement('div')\n issuerTextInputContainer.setAttribute(\n 'style',\n `\n display: flex;\n flex-direction: row;\n `\n )\n const issuerTextLabel = dom.createElement('label')\n issuerTextLabel.innerText = 'Enter the URL of your identity provider:'\n issuerTextLabel.setAttribute('style', 'color: #888')\n const issuerTextInput = dom.createElement('input')\n issuerTextInput.setAttribute('type', 'text')\n issuerTextInput.setAttribute(\n 'style',\n 'margin-left: 0 !important; flex: 1; margin-right: 5px !important'\n )\n issuerTextInput.setAttribute('placeholder', 'https://example.com')\n issuerTextInput.value = localStorage.getItem('loginIssuer') || ''\n const issuerTextGoButton = dom.createElement('button')\n issuerTextGoButton.innerText = 'Go'\n issuerTextGoButton.setAttribute('style', 'margin-top: 12px; margin-bottom: 12px;')\n issuerTextGoButton.addEventListener('click', () => {\n loginToIssuer(issuerTextInput.value)\n })\n issuerTextContainer.appendChild(issuerTextLabel)\n issuerTextInputContainer.appendChild(issuerTextInput)\n issuerTextInputContainer.appendChild(issuerTextGoButton)\n issuerTextContainer.appendChild(issuerTextInputContainer)\n issuerPopupBox.appendChild(issuerTextContainer)\n\n /**\n * Button-based idp selection\n */\n const issuerButtonContainer = dom.createElement('div')\n issuerButtonContainer.setAttribute(\n 'style',\n `\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n `\n )\n const issuerBottonLabel = dom.createElement('label')\n issuerBottonLabel.innerText = 'Or pick an identity provider from the list below:'\n issuerBottonLabel.setAttribute('style', 'color: #888')\n issuerButtonContainer.appendChild(issuerBottonLabel)\n getSuggestedIssuers().forEach((issuerInfo) => {\n const issuerButton = dom.createElement('button')\n issuerButton.innerText = issuerInfo.name\n issuerButton.setAttribute('style', 'height: 38px; margin-top: 10px')\n issuerButton.addEventListener('click', () => {\n loginToIssuer(issuerInfo.uri)\n })\n issuerButtonContainer.appendChild(issuerButton)\n })\n issuerPopupBox.appendChild(issuerButtonContainer)\n}\n\n/**\n * Login status box\n *\n * A big sign-up/sign in box or a logout box depending on the state\n *\n * @param dom\n * @param listener\n *\n * @returns\n */\nexport function loginStatusBox (\n dom: HTMLDocument,\n listener: ((uri: string | null) => void) | null = null,\n options: {\n buttonStyle?: string;\n } = {}\n): HTMLElement {\n // 20190630\n let me = offlineTestID()\n // @@ TODO Remove the need to cast HTML element to any\n const box: any = dom.createElement('div')\n\n function setIt (newidURI) {\n if (!newidURI) {\n return\n }\n\n // const uri = newidURI.uri || newidURI\n // me = sym(uri)\n me = authn.saveUser(newidURI)\n box.refresh()\n if (listener) listener(me!.uri)\n }\n\n function logoutButtonHandler (_event) {\n const oldMe = me\n authSession.logout().then(\n function () {\n const message = `Your WebID was ${oldMe}. It has been forgotten.`\n me = null\n try {\n alert(message)\n } catch (e) {\n window.alert(message)\n }\n box.refresh()\n if (listener) listener(null)\n },\n (err) => {\n alert('Fail to log out:' + err)\n }\n )\n }\n\n function logoutButton (me, options) {\n const signInButtonStyle = options.buttonStyle || getDefaultSignInButtonStyle()\n let logoutLabel = 'WebID logout'\n if (me) {\n const nick =\n solidLogicSingleton.store.any(me, ns.foaf('nick')) ||\n solidLogicSingleton.store.any(me, ns.foaf('name'))\n if (nick) {\n logoutLabel = 'Logout ' + nick.value\n }\n }\n const signOutButton = dom.createElement('input')\n // signOutButton.className = 'WebIDCancelButton'\n signOutButton.setAttribute('type', 'button')\n signOutButton.setAttribute('value', logoutLabel)\n signOutButton.setAttribute('style', `${signInButtonStyle}background-color: #eee;`)\n signOutButton.addEventListener('click', logoutButtonHandler, false)\n return signOutButton\n }\n\n box.refresh = function () {\n const sessionInfo = authSession.info\n if (sessionInfo && sessionInfo.webId && sessionInfo.isLoggedIn) {\n me = solidLogicSingleton.store.sym(sessionInfo.webId)\n } else {\n me = null\n }\n if ((me && box.me !== me.uri) || (!me && box.me)) {\n widgets.clearElement(box)\n if (me) {\n box.appendChild(logoutButton(me, options))\n } else {\n box.appendChild(signInOrSignUpBox(dom, setIt, options))\n }\n }\n box.me = me ? me.uri : null\n }\n box.refresh()\n\n function trackSession () {\n me = authn.currentUser()\n box.refresh()\n }\n trackSession()\n\n authSession.onLogin(trackSession)\n authSession.onLogout(trackSession)\n box.me = '99999' // Force refresh\n box.refresh()\n return box\n}\n\nauthSession.onLogout(async () => {\n const issuer = window.localStorage.getItem('loginIssuer')\n if (issuer) {\n try {\n // clear authorization metadata from store\n solidLogicSingleton.store.updater.flagAuthorizationMetadata() as any\n\n const wellKnownUri = new URL(issuer)\n wellKnownUri.pathname = '/.well-known/openid-configuration'\n const wellKnownResult = await fetch(wellKnownUri.toString())\n if (wellKnownResult.status === 200) {\n const openidConfiguration = await wellKnownResult.json()\n if (openidConfiguration && openidConfiguration.end_session_endpoint) {\n await fetch(openidConfiguration.end_session_endpoint, { credentials: 'include' })\n }\n }\n } catch (err) {\n // Do nothing\n }\n }\n window.location.reload()\n})\n\n/**\n * Workspace selection etc\n * See https://github.com/solidos/userguide/issues/16\n */\n\n/**\n * Returns a UI object which, if it selects a workspace,\n * will callback(workspace, newBase).\n * See https://github.com/solidos/userguide/issues/16 for more info on workspaces.\n *\n * If necessary, will get an account, preference file, etc. In sequence:\n *\n * - If not logged in, log in.\n * - Load preference file\n * - Prompt user for workspaces\n * - Allows the user to just type in a URI by hand\n *\n * Calls back with the workspace and the base URI\n *\n * @param dom\n * @param appDetails\n * @param callbackWS\n */\nexport function selectWorkspace (\n dom: HTMLDocument,\n appDetails: AppDetails,\n callbackWS: (workspace: string | null, newBase: string) => void\n): HTMLElement {\n const noun = appDetails.noun\n const appPathSegment = appDetails.appPathSegment\n\n const me = offlineTestID()\n const box = dom.createElement('div')\n const context: AuthenticationContext = { me, dom, div: box }\n\n function say (s, background) {\n box.appendChild(widgets.errorMessageBlock(dom, s, background))\n }\n\n function figureOutBase (ws) {\n const newBaseNode: NamedNode = solidLogicSingleton.store.any(\n ws,\n ns.space('uriPrefix')\n ) as NamedNode\n let newBaseString: string\n if (!newBaseNode) {\n newBaseString = ws.uri.split('#')[0]\n } else {\n newBaseString = newBaseNode.value\n }\n if (newBaseString.slice(-1) !== '/') {\n debug.log(`${appPathSegment}: No / at end of uriPrefix ${newBaseString}`) // @@ paramater?\n newBaseString = `${newBaseString}/`\n }\n const now = new Date()\n newBaseString += `${appPathSegment}/id${now.getTime()}/` // unique id\n return newBaseString\n }\n\n function displayOptions (context) {\n // console.log('displayOptions!', context)\n async function makeNewWorkspace (_event) {\n const row = table.appendChild(dom.createElement('tr'))\n const cell = row.appendChild(dom.createElement('td'))\n cell.setAttribute('colspan', '3')\n cell.style.padding = '0.5em'\n const newBase = encodeURI(\n await widgets.askName(\n dom,\n solidLogicSingleton.store,\n cell,\n ns.solid('URL'),\n ns.space('Workspace'),\n 'Workspace'\n )\n )\n const newWs = widgets.newThing(context.preferencesFile)\n const newData = [\n st(context.me, ns.space('workspace'), newWs, context.preferencesFile),\n // eslint-disable-next-line camelcase\n st(\n newWs,\n ns.space('uriPrefix'),\n newBase as unknown as Quad_Object,\n context.preferencesFile\n )\n ]\n if (!solidLogicSingleton.store.updater) {\n throw new Error('store has no updater')\n }\n await solidLogicSingleton.store.updater.update([], newData)\n // @@ now refresh list of workspaces\n }\n\n // const status = ''\n const id = context.me\n const preferencesFile = context.preferencesFile\n let newBase: any = null\n\n // A workspace specifically defined in the private preference file:\n let w: any = solidLogicSingleton.store.each(\n id,\n ns.space('workspace'),\n undefined,\n preferencesFile\n ) // Only trust preference file here\n\n // A workspace in a storage in the public profile:\n const storages = solidLogicSingleton.store.each(id, ns.space('storage')) // @@ No provenance requirement at the moment\n if (w.length === 0 && storages) {\n say(\n `You don't seem to have any workspaces. You have ${storages.length} storage spaces.`,\n 'white'\n )\n storages\n .map(function (s: any) {\n w = w.concat(solidLogicSingleton.store.each(s, ns.ldp('contains')))\n return w\n })\n .filter((file) => {\n return file.id ? ['public', 'private'].includes(file.id().toLowerCase()) : ''\n })\n }\n\n if (w.length === 1) {\n say(`Workspace used: ${w[0].uri}`, 'white') // @@ allow user to see URI\n newBase = figureOutBase(w[0])\n // callbackWS(w[0], newBase)\n // } else if (w.length === 0) {\n }\n\n // Prompt for ws selection or creation\n // say( w.length + \" workspaces for \" + id + \"Choose one.\");\n const table = dom.createElement('table')\n table.setAttribute('style', 'border-collapse:separate; border-spacing: 0.5em;')\n\n // const popup = window.open(undefined, '_blank', { height: 300, width:400 }, false)\n box.appendChild(table)\n\n // Add a field for directly adding the URI yourself\n\n // const hr = box.appendChild(dom.createElement('hr')) // @@\n box.appendChild(dom.createElement('hr')) // @@\n\n const p = box.appendChild(dom.createElement('p'))\n p.setAttribute('style', style.commentStyle)\n p.textContent = `Where would you like to store the data for the ${noun}?\n Give the URL of the folder where you would like the data stored.\n It can be anywhere in solid world - this URI is just an idea.`\n // @@ TODO Remove the need to cast baseField to any\n const baseField: any = box.appendChild(dom.createElement('input'))\n baseField.setAttribute('type', 'text')\n baseField.setAttribute('style', style.textInputStyle)\n baseField.size = 80 // really a string\n baseField.label = 'base URL'\n baseField.autocomplete = 'on'\n if (newBase) {\n // set to default\n baseField.value = newBase\n }\n\n context.baseField = baseField\n\n box.appendChild(dom.createElement('br')) // @@\n\n const button = box.appendChild(dom.createElement('button'))\n button.setAttribute('style', style.buttonStyle)\n button.textContent = `Start new ${noun} at this URI`\n button.addEventListener('click', function (_event) {\n let newBase = baseField.value.replace(' ', '%20') // do not re-encode in general, as % encodings may exist\n if (newBase.slice(-1) !== '/') {\n newBase += '/'\n }\n callbackWS(null, newBase)\n })\n\n // Now go set up the table of spaces\n\n // const row = 0\n w = w.filter(function (x) {\n return !solidLogicSingleton.store.holds(\n x,\n ns.rdf('type'), // Ignore master workspaces\n ns.space('MasterWorkspace')\n )\n })\n let col1, col2, col3, tr, ws, localStyle, comment\n const cellStyle = 'height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;'\n const deselectedStyle = `${cellStyle}border: 0px;`\n // const selectedStyle = cellStyle + 'border: 1px solid black;'\n for (let i = 0; i < w.length; i++) {\n ws = w[i]\n tr = dom.createElement('tr')\n if (i === 0) {\n col1 = dom.createElement('td')\n col1.setAttribute('rowspan', `${w.length}`)\n col1.textContent = 'Choose a workspace for this:'\n col1.setAttribute('style', 'vertical-align:middle;')\n tr.appendChild(col1)\n }\n col2 = dom.createElement('td')\n localStyle = solidLogicSingleton.store.anyValue(ws, ns.ui('style'))\n if (!localStyle) {\n // Otherwise make up arbitrary colour\n const hash = function (x) {\n return x.split('').reduce(function (a, b) {\n a = (a << 5) - a + b.charCodeAt(0)\n return a & a\n }, 0)\n }\n const bgcolor = `#${((hash(ws.uri) & 0xffffff) | 0xc0c0c0).toString(16)}` // c0c0c0 forces pale\n localStyle = `color: black ; background-color: ${bgcolor};`\n }\n col2.setAttribute('style', deselectedStyle + localStyle)\n tr.target = ws.uri\n let label = solidLogicSingleton.store.any(ws, ns.rdfs('label'))\n if (!label) {\n label = ws.uri.split('/').slice(-1)[0] || ws.uri.split('/').slice(-2)[0]\n }\n col2.textContent = label || '???'\n tr.appendChild(col2)\n if (i === 0) {\n col3 = dom.createElement('td')\n col3.setAttribute('rowspan', `${w.length}1`)\n // col3.textContent = '@@@@@ remove';\n col3.setAttribute('style', 'width:50%;')\n tr.appendChild(col3)\n }\n table.appendChild(tr)\n\n comment = solidLogicSingleton.store.any(ws, ns.rdfs('comment'))\n comment = comment ? comment.value : 'Use this workspace'\n col2.addEventListener(\n 'click',\n function (_event) {\n col3.textContent = comment ? comment.value : ''\n col3.setAttribute('style', deselectedStyle + localStyle)\n const button = dom.createElement('button')\n button.textContent = 'Continue'\n // button.setAttribute('style', style);\n const newBase = figureOutBase(ws)\n baseField.value = newBase // show user proposed URI\n\n button.addEventListener(\n 'click',\n function (_event) {\n button.disabled = true\n callbackWS(ws, newBase)\n button.textContent = '---->'\n },\n true\n ) // capture vs bubble\n col3.appendChild(button)\n },\n true\n ) // capture vs bubble\n }\n\n // last line with \"Make new workspace\"\n const trLast = dom.createElement('tr')\n col2 = dom.createElement('td')\n col2.setAttribute('style', cellStyle)\n col2.textContent = '+ Make a new workspace'\n col2.addEventListener('click', makeNewWorkspace)\n trLast.appendChild(col2)\n table.appendChild(trLast)\n } // displayOptions\n\n // console.log('kicking off async operation')\n ensureLoadedPreferences(context) // kick off async operation\n .then(displayOptions)\n .catch((err) => {\n // console.log(\"err from async op\")\n box.appendChild(widgets.errorMessageBlock(context.dom, err))\n })\n\n return box // return the box element, while login proceeds\n} // selectWorkspace\n\n/**\n * Creates a new instance of an app.\n *\n * An instance of an app could be e.g. an issue tracker for a given project,\n * or a chess game, or calendar, or a health/fitness record for a person.\n *\n * Note that this use of the term 'app' refers more to entries in the user's\n * type index than to actual software applications that use the personal data\n * to which these entries point.\n *\n * @param dom\n * @param appDetails\n * @param callback\n *\n * @returns A div with a button in it for making a new app instance\n */\nexport function newAppInstance (\n dom: HTMLDocument,\n appDetails: AppDetails,\n callback: (workspace: string | null, newBase: string) => void\n): HTMLElement {\n const gotWS = function (ws, base) {\n // log.debug(\"newAppInstance: Selected workspace = \" + (ws? ws.uri : 'none'))\n callback(ws, base)\n }\n const div = dom.createElement('div')\n const b = dom.createElement('button')\n b.setAttribute('type', 'button')\n div.appendChild(b)\n b.innerHTML = `Make new ${appDetails.noun}`\n b.addEventListener(\n 'click',\n (_event) => {\n div.appendChild(selectWorkspace(dom, appDetails, gotWS))\n },\n false\n )\n div.appendChild(b)\n return div\n}\n/**\n * Retrieves whether the currently logged in user is a power user\n * and/or a developer\n */\nexport async function getUserRoles (): Promise> {\n try {\n const { me, preferencesFile, preferencesFileError } = await ensureLoadedPreferences({})\n if (!preferencesFile || preferencesFileError) {\n throw new Error(preferencesFileError)\n }\n return solidLogicSingleton.store.each(\n me,\n ns.rdf('type'),\n null,\n preferencesFile.doc()\n ) as NamedNode[]\n } catch (error) {\n debug.warn('Unable to fetch your preferences - this was the error: ', error)\n }\n return []\n}\n\n/**\n * Filters which panes should be available, based on the result of [[getUserRoles]]\n */\nexport async function filterAvailablePanes (\n panes: Array\n): Promise> {\n const userRoles = await getUserRoles()\n return panes.filter((pane) => isMatchingAudience(pane, userRoles))\n}\n\nfunction isMatchingAudience (pane: PaneDefinition, userRoles: Array): boolean {\n const audience = pane.audience || []\n return audience.reduce(\n (isMatch, audienceRole) => is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AC,IAAA;EAAA,OAAAC,qBAAA,CAAAxT,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAuT,sBAAA;EAAAA,qBAAA,OAAAtT,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAAnC,SAAAqT,UACLC,KAA4B;IAAA,IAAAC,SAAA;IAAA,OAAAxT,YAAA,YAAAM,IAAA,UAAAmT,WAAAC,UAAA;MAAA,kBAAAA,UAAA,CAAAjT,IAAA,GAAAiT,UAAA,CAAA7W,IAAA;QAAA;UAAA6W,UAAA,CAAA7W,IAAA;UAAA,OAEJ+V,YAAY,CAAC,CAAC;QAAA;UAAhCY,SAAS,GAAAE,UAAA,CAAA9S,IAAA;UAAA,OAAA8S,UAAA,CAAAhT,MAAA,WACR6S,KAAK,CAACpQ,MAAM,CAAC,UAACwQ,IAAI;YAAA,OAAKC,kBAAkB,CAACD,IAAI,EAAEH,SAAS,CAAC;UAAA,EAAC;QAAA;QAAA;UAAA,OAAAE,UAAA,CAAA3R,IAAA;MAAA;IAAA,GAAAuR,SAAA;EAAA,CACnE;EAAA,OAAAD,qBAAA,CAAAxT,KAAA,OAAAC,SAAA;AAAA;AAED,SAAS8T,kBAAkBA,CAAED,IAAoB,EAAEH,SAA2B,EAAW;EACvF,IAAMK,QAAQ,GAAGF,IAAI,CAACE,QAAQ,IAAI,EAAE;EACpC,OAAOA,QAAQ,CAAC7B,MAAM,CACpB,UAAC8B,OAAO,EAAEC,YAAY;IAAA,OAAKD,OAAO,IAAI,CAAC,CAACN,SAAS,CAACQ,IAAI,CAAC,UAACC,IAAI;MAAA,OAAKA,IAAI,CAACC,MAAM,CAACH,YAAY,CAAC;IAAA,EAAC;EAAA,GAC3F,IACF,CAAC;AACH"} \ No newline at end of file +{"version":3,"file":"login.js","names":["_rdflib","require","_solidLogic","debug","_interopRequireWildcard","style","_log","ns","_signup","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","store","solidLogicSingleton","_solidLogicSingleton$","profile","loadPreferences","loadProfile","_solidLogicSingleton$2","typeIndex","getScopedAppInstances","getRegistrations","loadAllTypeIndexes","getScopedAppsFromIndex","deleteTypeIndexRegistration","ensureLoggedIn","context","me","authn","currentUser","saveUser","Promise","resolve","checkUser","then","webId","log","concat","div","dom","box","loginStatusBox","webIdUri","appendChild","ensureLoadedPreferences","_x","_ensureLoadedPreferences","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee4","progressDisplay","preferencesFile","m2","wrap","_callee4$","_context4","prev","abrupt","ensureLoadedProfile","sent","parentNode","removeChild","t0","UnauthorizedError","alert","CrossOriginForbiddenError","window","location","origin","preferencesFileError","SameOriginForbiddenError","warn","NotEditableError","WebOperationError","FetchError","status","message","Error","stop","_x2","_ensureLoadedProfile","_callee5","logInContext","_callee5$","_context5","publicProfile","errorMessageBlock","findAppInstances","_x3","_x4","_x5","_findAppInstances","_callee6","theClass","isPublic","items","_callee6$","_context6","filter","item","scope","label","instances","map","instance","scopeLabel","mine","sameTerm","agent","registrationControl","_x6","_x7","_x8","_registrationControl","_callee7","registrationStatements","renderScopeCheckbox","scopes","msg","tbody","form","_iterator","_step","row","_callee7$","_context7","_renderScopeCheckbox","statements","index","noun","buildCheckboxForm","_registrationStatemen","registrations","reg","newThing","st","solid","createElement","innerHTML","textContent","setAttribute","children","BlankNode","renderScopeHeadingRow","backgroundColor","cell","backgoundColor","header","textAlign","registrationList","_x9","_x10","_registrationList","_callee9","options","table","_iterator2","_step2","headingRow","_iterator3","_step3","_loop","_callee9$","_context10","firstChild","type","display","_loop$","_context9","personTR","deleteFunction","_deleteFunction","_callee8","_callee8$","_context8","paddingLeft","delegateYield","t1","finish","t2","getDefaultSignInButtonStyle","signInOrSignUpBox","setUserCallback","undefined","signInButtonStyle","buttonStyle","magicClassName","signInPopUpButton","headerBannerLoginInput","authSession","onLogin","webIdURI","uri","divs","getElementsByClassName","parent","addEventListener","offline","offlineTestID","renderSignInPopup","signupButton","_event","signupMgr","Signup","signup","issuerPopup","body","issuerPopupBox","issuerPopupBoxTopMenu","issuerPopupBoxLabel","innerText","issuerPopupBoxCloseButton","remove","loginToIssuer","_ref","_callee","issuerUri","preLoginRedirectHash","locationUrl","_callee$","_context","updater","flagAuthorizationMetadata","URL","href","hash","localStorage","setItem","login","redirectUrl","oidcIssuer","_x11","issuerTextContainer","issuerTextInputContainer","issuerTextLabel","issuerTextInput","getItem","issuerTextGoButton","issuerButtonContainer","issuerBottonLabel","getSuggestedIssuers","forEach","issuerInfo","issuerButton","listener","setIt","newidURI","refresh","logoutButtonHandler","oldMe","logout","logoutButton","logoutLabel","nick","any","foaf","signOutButton","sessionInfo","info","isLoggedIn","sym","clearElement","trackSession","onLogout","_callee2","issuer","wellKnownUri","wellKnownResult","openidConfiguration","_callee2$","_context2","pathname","fetch","json","end_session_endpoint","credentials","reload","selectWorkspace","appDetails","callbackWS","appPathSegment","say","background","figureOutBase","ws","newBaseNode","space","newBaseString","split","now","Date","getTime","displayOptions","makeNewWorkspace","_x12","_makeNewWorkspace","_callee3","newBase","newWs","newData","_callee3$","_context3","padding","encodeURI","askName","update","id","w","each","storages","ldp","file","includes","toLowerCase","p","commentStyle","baseField","textInputStyle","size","autocomplete","button","replace","x","holds","rdf","col1","col2","col3","tr","localStyle","comment","cellStyle","deselectedStyle","anyValue","ui","reduce","b","charCodeAt","bgcolor","target","rdfs","disabled","trLast","newAppInstance","callback","gotWS","base","getUserRoles","_getUserRoles","_callee10","_yield$ensureLoadedPr","_callee10$","_context11","doc","filterAvailablePanes","_x13","_filterAvailablePanes","_callee11","panes","userRoles","_callee11$","_context12","pane","isMatchingAudience","audience","isMatch","audienceRole","find","role","equals"],"sources":["../../src/login/login.ts"],"sourcesContent":["/* eslint-disable camelcase */\n/**\n * Signing in, signing up, profile and preferences reloading\n * Type index management\n *\n * Many functions in this module take a context object which\n * holds various RDF symbols, add to it, and return a promise of it.\n *\n * * `me` RDF symbol for the user's WebID\n * * `publicProfile` The user's public profile, iff loaded\n * * `preferencesFile` The user's personal preference file, iff loaded\n * * `index.public` The user's public type index file\n * * `index.private` The user's private type index file\n *\n * Not RDF symbols:\n * * `noun` A string in english for the type of thing -- like \"address book\"\n * * `instance` An array of nodes which are existing instances\n * * `containers` An array of nodes of containers of instances\n * * `div` A DOM element where UI can be displayed\n * * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages\n * *\n * * Vocabulary: \"load\" loads a file if it exists;\n * * 'Ensure\" CREATES the file if it does not exist (if it can) and then loads it.\n * @packageDocumentation\n */\nimport { PaneDefinition } from 'pane-registry'\nimport { BlankNode, NamedNode, st } from 'rdflib'\n// eslint-disable-next-line camelcase\nimport { Quad_Object } from 'rdflib/lib/tf-types'\nimport {\n AppDetails,\n AuthenticationContext,\n authn,\n authSession,\n CrossOriginForbiddenError,\n FetchError,\n getSuggestedIssuers,\n NotEditableError,\n offlineTestID,\n SameOriginForbiddenError,\n solidLogicSingleton,\n UnauthorizedError,\n WebOperationError\n} from 'solid-logic'\nimport * as debug from '../debug'\nimport * as style from '../style'\nimport { alert } from '../log'\nimport * as ns from '../ns.js'\nimport { Signup } from '../signup/signup.js'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst store = solidLogicSingleton.store\n\nconst {\n loadPreferences,\n loadProfile\n} = solidLogicSingleton.profile\n\nconst {\n getScopedAppInstances,\n getRegistrations,\n loadAllTypeIndexes,\n getScopedAppsFromIndex,\n deleteTypeIndexRegistration\n} = solidLogicSingleton.typeIndex\n\n/**\n * Resolves with the logged in user's WebID\n *\n * @param context\n */\n// used to be logIn\nexport function ensureLoggedIn (context: AuthenticationContext): Promise {\n const me = authn.currentUser()\n if (me) {\n authn.saveUser(me, context)\n return Promise.resolve(context)\n }\n\n return new Promise((resolve) => {\n authn.checkUser().then((webId) => {\n // Already logged in?\n if (webId) {\n debug.log(`logIn: Already logged in as ${webId}`)\n return resolve(context)\n }\n if (!context.div || !context.dom) {\n return resolve(context)\n }\n const box = loginStatusBox(context.dom, (webIdUri) => {\n authn.saveUser(webIdUri, context)\n resolve(context) // always pass growing context\n })\n context.div.appendChild(box)\n })\n })\n}\n\n/**\n * Loads preference file\n * Do this after having done log in and load profile\n *\n * @private\n *\n * @param context\n */\n// used to be logInLoadPreferences\nexport async function ensureLoadedPreferences (\n context: AuthenticationContext\n): Promise {\n if (context.preferencesFile) return Promise.resolve(context) // already done\n\n // const statusArea = context.statusArea || context.div || null\n let progressDisplay\n /* COMPLAIN FUNCTION NOT USED/TAKING IT OUT FOR NOW\n function complain (message) {\n message = `ensureLoadedPreferences: ${message}`\n if (statusArea) {\n // statusArea.innerHTML = ''\n statusArea.appendChild(widgets.errorMessageBlock(context.dom, message))\n }\n debug.log(message)\n // reject(new Error(message))\n } */\n try {\n context = await ensureLoadedProfile(context)\n\n // console.log('back in Solid UI after logInLoadProfile', context)\n const preferencesFile = await loadPreferences(context.me as NamedNode)\n if (progressDisplay) {\n progressDisplay.parentNode.removeChild(progressDisplay)\n }\n context.preferencesFile = preferencesFile\n } catch (err) {\n let m2: string\n if (err instanceof UnauthorizedError) {\n m2 =\n 'Ooops - you are not authenticated (properly logged in) to for me to read your preference file. Try loggin out and logging in?'\n alert(m2)\n } else if (err instanceof CrossOriginForbiddenError) {\n m2 = `Unauthorized: Assuming preference file blocked for origin ${window.location.origin}`\n context.preferencesFileError = m2\n return context\n } else if (err instanceof SameOriginForbiddenError) {\n m2 =\n 'You are not authorized to read your preference file. This may be because you are using an untrusted web app.'\n debug.warn(m2)\n return context\n } else if (err instanceof NotEditableError) {\n m2 =\n 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.'\n debug.warn(m2)\n return context\n } else if (err instanceof WebOperationError) {\n m2 =\n 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.'\n debug.warn(m2)\n } else if (err instanceof FetchError) {\n m2 = `Strange: Error ${err.status} trying to read your preference file.${err.message}`\n alert(m2)\n } else {\n throw new Error(`(via loadPrefs) ${err}`)\n }\n }\n return context\n}\n\n/**\n * Logs the user in and loads their WebID profile document into the store\n *\n * @param context\n *\n * @returns Resolves with the context after login / fetch\n */\n// used to be logInLoadProfile\nexport async function ensureLoadedProfile (\n context: AuthenticationContext\n): Promise {\n if (context.publicProfile) {\n return context\n } // already done\n try {\n const logInContext = await ensureLoggedIn(context)\n if (!logInContext.me) {\n throw new Error('Could not log in')\n }\n context.publicProfile = await loadProfile(logInContext.me)\n } catch (err) {\n if (context.div && context.dom) {\n context.div.appendChild(widgets.errorMessageBlock(context.dom, err.message))\n }\n throw new Error(`Can't log in: ${err}`)\n }\n return context\n}\n\n/**\n * Returns promise of context with arrays of symbols\n *\n * leaving the `isPublic` param undefined will bring in community index things, too\n */\nexport async function findAppInstances (\n context: AuthenticationContext,\n theClass: NamedNode,\n isPublic?: boolean\n): Promise {\n let items = context.me ? await getScopedAppInstances(theClass, context.me) : []\n if (isPublic === true) { // old API - not recommended!\n items = items.filter(item => item.scope.label === 'public')\n } else if (isPublic === false) {\n items = items.filter(item => item.scope.label === 'private')\n }\n context.instances = items.map(item => item.instance)\n return context\n}\n\nexport function scopeLabel (context, scope) {\n const mine = context.me && context.me.sameTerm(scope.agent)\n const name = mine ? '' : utils.label(scope.agent) + ' '\n return `${name}${scope.label}`\n}\n/**\n * UI to control registration of instance\n */\nexport async function registrationControl (\n context: AuthenticationContext,\n instance,\n theClass\n): Promise {\n function registrationStatements (index) {\n const registrations = getRegistrations(instance, theClass)\n const reg = registrations.length ? registrations[0] : widgets.newThing(index)\n return [\n st(reg, ns.solid('instance'), instance, index),\n st(reg, ns.solid('forClass'), theClass, index)\n ]\n }\n\n function renderScopeCheckbox (scope) {\n const statements = registrationStatements(scope.index)\n const name = scopeLabel(context, scope)\n const label = `${name} link to this ${context.noun}`\n return widgets.buildCheckboxForm(\n context.dom,\n solidLogicSingleton.store,\n label,\n null,\n statements,\n form,\n scope.index\n )\n }\n /// / body of registrationControl\n const dom = context.dom\n if (!dom || !context.div) {\n throw new Error('registrationControl: need dom and div')\n }\n const box = dom.createElement('div')\n context.div.appendChild(box)\n context.me = authn.currentUser() // @@\n const me = context.me\n if (!me) {\n box.innerHTML = '

                                                          (Log in to save a link to this)

                                                          '\n return context\n }\n\n let scopes // @@ const\n try {\n scopes = await loadAllTypeIndexes(me)\n } catch (e) {\n let msg\n if (context.div && context.preferencesFileError) {\n msg = '(Lists of stuff not available)'\n context.div.appendChild(dom.createElement('p')).textContent = msg\n } else if (context.div) {\n msg = `registrationControl: Type indexes not available: ${e}`\n context.div.appendChild(widgets.errorMessageBlock(context.dom, e))\n }\n debug.log(msg)\n return context\n }\n\n box.innerHTML = '
                                                          ' // tbody will be inserted anyway\n box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;')\n const tbody = box.children[0].children[0]\n const form = new BlankNode() // @@ say for now\n\n for (const scope of scopes) {\n const row = tbody.appendChild(dom.createElement('tr'))\n row.appendChild(renderScopeCheckbox(scope)) // @@ index\n }\n return context\n}\n\nexport function renderScopeHeadingRow (context, store, scope) {\n const backgroundColor = { private: '#fee', public: '#efe' }\n const { dom } = context\n const name = scopeLabel(context, scope)\n const row = dom.createElement('tr')\n const cell = row.appendChild(dom.createElement('td'))\n cell.setAttribute('colspan', '3')\n cell.style.backgoundColor = backgroundColor[scope.label] || 'white'\n const header = cell.appendChild(dom.createElement('h3'))\n header.textContent = name + ' links'\n header.style.textAlign = 'left'\n return row\n}\n/**\n * UI to List at all registered things\n */\nexport async function registrationList (context: AuthenticationContext, options: {\n private?: boolean\n public?: boolean\n type?: NamedNode\n}): Promise {\n const dom = context.dom as HTMLDocument\n const div = context.div as HTMLElement\n\n const box = dom.createElement('div')\n div.appendChild(box)\n context.me = authn.currentUser() // @@\n if (!context.me) {\n box.innerHTML = '

                                                          (Log in list your stuff)

                                                          '\n return context\n }\n\n const scopes = await loadAllTypeIndexes(context.me) // includes community indexes\n\n // console.log('@@ registrationList ', scopes)\n box.innerHTML = '
                                                          ' // tbody will be inserted anyway\n box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;')\n const table = box.firstChild as HTMLElement\n const tbody = table.firstChild as HTMLElement\n\n for (const scope of scopes) { // need some predicate for listing/adding agents\n const headingRow = renderScopeHeadingRow(context, store, scope)\n tbody.appendChild(headingRow)\n const items = await getScopedAppsFromIndex(scope, options.type || null) // any class\n if (items.length === 0) headingRow.style.display = 'none'\n // console.log(`registrationList: @@ instance items for class ${options.type || 'undefined' }:`, items)\n for (const item of items) {\n const row = widgets.personTR(dom, ns.solid('instance'), item.instance, {\n deleteFunction: async () => {\n await deleteTypeIndexRegistration(item)\n tbody.removeChild(row)\n }\n })\n row.children[0].style.paddingLeft = '3em'\n\n tbody.appendChild(row)\n }\n }\n return context\n} // registrationList\n\nfunction getDefaultSignInButtonStyle (): string {\n return 'padding: 1em; border-radius:0.5em; font-size: 100%;'\n}\n\n/**\n * Bootstrapping identity\n * (Called by `loginStatusBox()`)\n *\n * @param dom\n * @param setUserCallback\n *\n * @returns\n */\nfunction signInOrSignUpBox (\n dom: HTMLDocument,\n setUserCallback: (user: string) => void,\n options: {\n buttonStyle?: string;\n } = {}\n): HTMLElement {\n options = options || {}\n const signInButtonStyle = options.buttonStyle || getDefaultSignInButtonStyle()\n\n const box: any = dom.createElement('div')\n const magicClassName = 'SolidSignInOrSignUpBox'\n debug.log('widgets.signInOrSignUpBox')\n box.setUserCallback = setUserCallback\n box.setAttribute('class', magicClassName)\n box.setAttribute('style', 'display:flex;')\n\n // Sign in button with PopUP\n const signInPopUpButton = dom.createElement('input') // multi\n box.appendChild(signInPopUpButton)\n signInPopUpButton.setAttribute('type', 'button')\n signInPopUpButton.setAttribute('value', 'Log in')\n signInPopUpButton.setAttribute('style', `${signInButtonStyle}background-color: #eef;${style.headerBannerLoginInput}`)\n\n authSession.onLogin(() => {\n const me = authn.currentUser()\n // const sessionInfo = authSession.info\n // if (sessionInfo && sessionInfo.isLoggedIn) {\n if (me) {\n // const webIdURI = sessionInfo.webId\n const webIdURI = me.uri\n // setUserCallback(webIdURI)\n const divs = dom.getElementsByClassName(magicClassName)\n debug.log(`Logged in, ${divs.length} panels to be serviced`)\n // At the same time, satisfy all the other login boxes\n for (let i = 0; i < divs.length; i++) {\n const div: any = divs[i]\n // @@ TODO Remove the need to manipulate HTML elements\n if (div.setUserCallback) {\n try {\n div.setUserCallback(webIdURI)\n const parent = div.parentNode\n if (parent) {\n parent.removeChild(div)\n }\n } catch (e) {\n debug.log(`## Error satisfying login box: ${e}`)\n div.appendChild(widgets.errorMessageBlock(dom, e))\n }\n }\n }\n }\n })\n\n signInPopUpButton.addEventListener(\n 'click',\n () => {\n const offline = offlineTestID()\n if (offline) return setUserCallback(offline.uri)\n\n renderSignInPopup(dom)\n },\n false\n )\n\n // Sign up button\n const signupButton = dom.createElement('input')\n box.appendChild(signupButton)\n signupButton.setAttribute('type', 'button')\n signupButton.setAttribute('value', 'Sign Up for Solid')\n signupButton.setAttribute('style', `${signInButtonStyle}background-color: #efe;${style.headerBannerLoginInput}`)\n\n signupButton.addEventListener(\n 'click',\n function (_event) {\n const signupMgr = new Signup()\n signupMgr.signup().then(function (uri) {\n debug.log('signInOrSignUpBox signed up ' + uri)\n setUserCallback(uri)\n })\n },\n false\n )\n return box\n}\n\nexport function renderSignInPopup (dom: HTMLDocument) {\n /**\n * Issuer Menu\n */\n const issuerPopup = dom.createElement('div')\n issuerPopup.setAttribute(\n 'style',\n 'position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center;'\n )\n dom.body.appendChild(issuerPopup)\n const issuerPopupBox = dom.createElement('div')\n issuerPopupBox.setAttribute(\n 'style',\n `\n background-color: white;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -moz-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -o-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n border-radius: 4px;\n min-width: 400px;\n padding: 10px;\n z-index : 10;\n `\n )\n issuerPopup.appendChild(issuerPopupBox)\n const issuerPopupBoxTopMenu = dom.createElement('div')\n issuerPopupBoxTopMenu.setAttribute(\n 'style',\n `\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n `\n )\n issuerPopupBox.appendChild(issuerPopupBoxTopMenu)\n const issuerPopupBoxLabel = dom.createElement('label')\n issuerPopupBoxLabel.setAttribute('style', 'margin-right: 5px; font-weight: 800')\n issuerPopupBoxLabel.innerText = 'Select an identity provider'\n const issuerPopupBoxCloseButton = dom.createElement('button')\n issuerPopupBoxCloseButton.innerHTML =\n ''\n issuerPopupBoxCloseButton.setAttribute('style', 'background-color: transparent; border: none;')\n issuerPopupBoxCloseButton.addEventListener('click', () => {\n issuerPopup.remove()\n })\n issuerPopupBoxTopMenu.appendChild(issuerPopupBoxLabel)\n issuerPopupBoxTopMenu.appendChild(issuerPopupBoxCloseButton)\n\n const loginToIssuer = async (issuerUri: string) => {\n try {\n // clear authorization metadata from store\n solidLogicSingleton.store.updater.flagAuthorizationMetadata() as any\n // Save hash\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n window.localStorage.setItem('loginIssuer', issuerUri)\n // Login\n const locationUrl = new URL(window.location.href)\n locationUrl.hash = '' // remove hash part\n await authSession.login({\n redirectUrl: locationUrl.href,\n oidcIssuer: issuerUri\n })\n } catch (err) {\n alert(err.message)\n }\n }\n\n /**\n * Text-based idp selection\n */\n const issuerTextContainer = dom.createElement('div')\n issuerTextContainer.setAttribute(\n 'style',\n `\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n `\n )\n const issuerTextInputContainer = dom.createElement('div')\n issuerTextInputContainer.setAttribute(\n 'style',\n `\n display: flex;\n flex-direction: row;\n `\n )\n const issuerTextLabel = dom.createElement('label')\n issuerTextLabel.innerText = 'Enter the URL of your identity provider:'\n issuerTextLabel.setAttribute('style', 'color: #888')\n const issuerTextInput = dom.createElement('input')\n issuerTextInput.setAttribute('type', 'text')\n issuerTextInput.setAttribute(\n 'style',\n 'margin-left: 0 !important; flex: 1; margin-right: 5px !important'\n )\n issuerTextInput.setAttribute('placeholder', 'https://example.com')\n issuerTextInput.value = localStorage.getItem('loginIssuer') || ''\n const issuerTextGoButton = dom.createElement('button')\n issuerTextGoButton.innerText = 'Go'\n issuerTextGoButton.setAttribute('style', 'margin-top: 12px; margin-bottom: 12px;')\n issuerTextGoButton.addEventListener('click', () => {\n loginToIssuer(issuerTextInput.value)\n })\n issuerTextContainer.appendChild(issuerTextLabel)\n issuerTextInputContainer.appendChild(issuerTextInput)\n issuerTextInputContainer.appendChild(issuerTextGoButton)\n issuerTextContainer.appendChild(issuerTextInputContainer)\n issuerPopupBox.appendChild(issuerTextContainer)\n\n /**\n * Button-based idp selection\n */\n const issuerButtonContainer = dom.createElement('div')\n issuerButtonContainer.setAttribute(\n 'style',\n `\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n `\n )\n const issuerBottonLabel = dom.createElement('label')\n issuerBottonLabel.innerText = 'Or pick an identity provider from the list below:'\n issuerBottonLabel.setAttribute('style', 'color: #888')\n issuerButtonContainer.appendChild(issuerBottonLabel)\n getSuggestedIssuers().forEach((issuerInfo) => {\n const issuerButton = dom.createElement('button')\n issuerButton.innerText = issuerInfo.name\n issuerButton.setAttribute('style', 'height: 38px; margin-top: 10px')\n issuerButton.addEventListener('click', () => {\n loginToIssuer(issuerInfo.uri)\n })\n issuerButtonContainer.appendChild(issuerButton)\n })\n issuerPopupBox.appendChild(issuerButtonContainer)\n}\n\n/**\n * Login status box\n *\n * A big sign-up/sign in box or a logout box depending on the state\n *\n * @param dom\n * @param listener\n *\n * @returns\n */\nexport function loginStatusBox (\n dom: HTMLDocument,\n listener: ((uri: string | null) => void) | null = null,\n options: {\n buttonStyle?: string;\n } = {}\n): HTMLElement {\n // 20190630\n let me = offlineTestID()\n // @@ TODO Remove the need to cast HTML element to any\n const box: any = dom.createElement('div')\n\n function setIt (newidURI) {\n if (!newidURI) {\n return\n }\n\n // const uri = newidURI.uri || newidURI\n // me = sym(uri)\n me = authn.saveUser(newidURI)\n box.refresh()\n if (listener) listener(me!.uri)\n }\n\n function logoutButtonHandler (_event) {\n const oldMe = me\n authSession.logout().then(\n function () {\n const message = `Your WebID was ${oldMe}. It has been forgotten.`\n me = null\n try {\n alert(message)\n } catch (e) {\n window.alert(message)\n }\n box.refresh()\n if (listener) listener(null)\n },\n (err) => {\n alert('Fail to log out:' + err)\n }\n )\n }\n\n function logoutButton (me, options) {\n const signInButtonStyle = options.buttonStyle || getDefaultSignInButtonStyle()\n let logoutLabel = 'WebID logout'\n if (me) {\n const nick =\n solidLogicSingleton.store.any(me, ns.foaf('nick')) ||\n solidLogicSingleton.store.any(me, ns.foaf('name'))\n if (nick) {\n logoutLabel = 'Logout ' + nick.value\n }\n }\n const signOutButton = dom.createElement('input')\n // signOutButton.className = 'WebIDCancelButton'\n signOutButton.setAttribute('type', 'button')\n signOutButton.setAttribute('value', logoutLabel)\n signOutButton.setAttribute('style', `${signInButtonStyle}background-color: #eee;`)\n signOutButton.addEventListener('click', logoutButtonHandler, false)\n return signOutButton\n }\n\n box.refresh = function () {\n const sessionInfo = authSession.info\n if (sessionInfo && sessionInfo.webId && sessionInfo.isLoggedIn) {\n me = solidLogicSingleton.store.sym(sessionInfo.webId)\n } else {\n me = null\n }\n if ((me && box.me !== me.uri) || (!me && box.me)) {\n widgets.clearElement(box)\n if (me) {\n box.appendChild(logoutButton(me, options))\n } else {\n box.appendChild(signInOrSignUpBox(dom, setIt, options))\n }\n }\n box.me = me ? me.uri : null\n }\n box.refresh()\n\n function trackSession () {\n me = authn.currentUser()\n box.refresh()\n }\n trackSession()\n\n authSession.onLogin(trackSession)\n authSession.onLogout(trackSession)\n box.me = '99999' // Force refresh\n box.refresh()\n return box\n}\n\nauthSession.onLogout(async () => {\n const issuer = window.localStorage.getItem('loginIssuer')\n if (issuer) {\n try {\n // clear authorization metadata from store\n solidLogicSingleton.store.updater.flagAuthorizationMetadata() as any\n\n const wellKnownUri = new URL(issuer)\n wellKnownUri.pathname = '/.well-known/openid-configuration'\n const wellKnownResult = await fetch(wellKnownUri.toString())\n if (wellKnownResult.status === 200) {\n const openidConfiguration = await wellKnownResult.json()\n if (openidConfiguration && openidConfiguration.end_session_endpoint) {\n await fetch(openidConfiguration.end_session_endpoint, { credentials: 'include' })\n }\n }\n } catch (err) {\n // Do nothing\n }\n }\n window.location.reload()\n})\n\n/**\n * Workspace selection etc\n * See https://github.com/solidos/userguide/issues/16\n */\n\n/**\n * Returns a UI object which, if it selects a workspace,\n * will callback(workspace, newBase).\n * See https://github.com/solidos/userguide/issues/16 for more info on workspaces.\n *\n * If necessary, will get an account, preference file, etc. In sequence:\n *\n * - If not logged in, log in.\n * - Load preference file\n * - Prompt user for workspaces\n * - Allows the user to just type in a URI by hand\n *\n * Calls back with the workspace and the base URI\n *\n * @param dom\n * @param appDetails\n * @param callbackWS\n */\nexport function selectWorkspace (\n dom: HTMLDocument,\n appDetails: AppDetails,\n callbackWS: (workspace: string | null, newBase: string) => void\n): HTMLElement {\n const noun = appDetails.noun\n const appPathSegment = appDetails.appPathSegment\n\n const me = offlineTestID()\n const box = dom.createElement('div')\n const context: AuthenticationContext = { me, dom, div: box }\n\n function say (s, background) {\n box.appendChild(widgets.errorMessageBlock(dom, s, background))\n }\n\n function figureOutBase (ws) {\n const newBaseNode: NamedNode = solidLogicSingleton.store.any(\n ws,\n ns.space('uriPrefix')\n ) as NamedNode\n let newBaseString: string\n if (!newBaseNode) {\n newBaseString = ws.uri.split('#')[0]\n } else {\n newBaseString = newBaseNode.value\n }\n if (newBaseString.slice(-1) !== '/') {\n debug.log(`${appPathSegment}: No / at end of uriPrefix ${newBaseString}`) // @@ paramater?\n newBaseString = `${newBaseString}/`\n }\n const now = new Date()\n newBaseString += `${appPathSegment}/id${now.getTime()}/` // unique id\n return newBaseString\n }\n\n function displayOptions (context) {\n // console.log('displayOptions!', context)\n async function makeNewWorkspace (_event) {\n const row = table.appendChild(dom.createElement('tr'))\n const cell = row.appendChild(dom.createElement('td'))\n cell.setAttribute('colspan', '3')\n cell.style.padding = '0.5em'\n const newBase = encodeURI(\n await widgets.askName(\n dom,\n solidLogicSingleton.store,\n cell,\n ns.solid('URL'),\n ns.space('Workspace'),\n 'Workspace'\n )\n )\n const newWs = widgets.newThing(context.preferencesFile)\n const newData = [\n st(context.me, ns.space('workspace'), newWs, context.preferencesFile),\n // eslint-disable-next-line camelcase\n st(\n newWs,\n ns.space('uriPrefix'),\n newBase as unknown as Quad_Object,\n context.preferencesFile\n )\n ]\n if (!solidLogicSingleton.store.updater) {\n throw new Error('store has no updater')\n }\n await solidLogicSingleton.store.updater.update([], newData)\n // @@ now refresh list of workspaces\n }\n\n // const status = ''\n const id = context.me\n const preferencesFile = context.preferencesFile\n let newBase: any = null\n\n // A workspace specifically defined in the private preference file:\n let w: any = solidLogicSingleton.store.each(\n id,\n ns.space('workspace'),\n undefined,\n preferencesFile\n ) // Only trust preference file here\n\n // A workspace in a storage in the public profile:\n const storages = solidLogicSingleton.store.each(id, ns.space('storage')) // @@ No provenance requirement at the moment\n if (w.length === 0 && storages) {\n say(\n `You don't seem to have any workspaces. You have ${storages.length} storage spaces.`,\n 'white'\n )\n storages\n .map(function (s: any) {\n w = w.concat(solidLogicSingleton.store.each(s, ns.ldp('contains')))\n return w\n })\n .filter((file) => {\n return file.id ? ['public', 'private'].includes(file.id().toLowerCase()) : ''\n })\n }\n\n if (w.length === 1) {\n say(`Workspace used: ${w[0].uri}`, 'white') // @@ allow user to see URI\n newBase = figureOutBase(w[0])\n // callbackWS(w[0], newBase)\n // } else if (w.length === 0) {\n }\n\n // Prompt for ws selection or creation\n // say( w.length + \" workspaces for \" + id + \"Choose one.\");\n const table = dom.createElement('table')\n table.setAttribute('style', 'border-collapse:separate; border-spacing: 0.5em;')\n\n // const popup = window.open(undefined, '_blank', { height: 300, width:400 }, false)\n box.appendChild(table)\n\n // Add a field for directly adding the URI yourself\n\n // const hr = box.appendChild(dom.createElement('hr')) // @@\n box.appendChild(dom.createElement('hr')) // @@\n\n const p = box.appendChild(dom.createElement('p'))\n p.setAttribute('style', style.commentStyle)\n p.textContent = `Where would you like to store the data for the ${noun}?\n Give the URL of the folder where you would like the data stored.\n It can be anywhere in solid world - this URI is just an idea.`\n // @@ TODO Remove the need to cast baseField to any\n const baseField: any = box.appendChild(dom.createElement('input'))\n baseField.setAttribute('type', 'text')\n baseField.setAttribute('style', style.textInputStyle)\n baseField.size = 80 // really a string\n baseField.label = 'base URL'\n baseField.autocomplete = 'on'\n if (newBase) {\n // set to default\n baseField.value = newBase\n }\n\n context.baseField = baseField\n\n box.appendChild(dom.createElement('br')) // @@\n\n const button = box.appendChild(dom.createElement('button'))\n button.setAttribute('style', style.buttonStyle)\n button.textContent = `Start new ${noun} at this URI`\n button.addEventListener('click', function (_event) {\n let newBase = baseField.value.replace(' ', '%20') // do not re-encode in general, as % encodings may exist\n if (newBase.slice(-1) !== '/') {\n newBase += '/'\n }\n callbackWS(null, newBase)\n })\n\n // Now go set up the table of spaces\n\n // const row = 0\n w = w.filter(function (x) {\n return !solidLogicSingleton.store.holds(\n x,\n ns.rdf('type'), // Ignore master workspaces\n ns.space('MasterWorkspace')\n )\n })\n let col1, col2, col3, tr, ws, localStyle, comment\n const cellStyle = 'height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;'\n const deselectedStyle = `${cellStyle}border: 0px;`\n // const selectedStyle = cellStyle + 'border: 1px solid black;'\n for (let i = 0; i < w.length; i++) {\n ws = w[i]\n tr = dom.createElement('tr')\n if (i === 0) {\n col1 = dom.createElement('td')\n col1.setAttribute('rowspan', `${w.length}`)\n col1.textContent = 'Choose a workspace for this:'\n col1.setAttribute('style', 'vertical-align:middle;')\n tr.appendChild(col1)\n }\n col2 = dom.createElement('td')\n localStyle = solidLogicSingleton.store.anyValue(ws, ns.ui('style'))\n if (!localStyle) {\n // Otherwise make up arbitrary colour\n const hash = function (x) {\n return x.split('').reduce(function (a, b) {\n a = (a << 5) - a + b.charCodeAt(0)\n return a & a\n }, 0)\n }\n const bgcolor = `#${((hash(ws.uri) & 0xffffff) | 0xc0c0c0).toString(16)}` // c0c0c0 forces pale\n localStyle = `color: black ; background-color: ${bgcolor};`\n }\n col2.setAttribute('style', deselectedStyle + localStyle)\n tr.target = ws.uri\n let label = solidLogicSingleton.store.any(ws, ns.rdfs('label'))\n if (!label) {\n label = ws.uri.split('/').slice(-1)[0] || ws.uri.split('/').slice(-2)[0]\n }\n col2.textContent = label || '???'\n tr.appendChild(col2)\n if (i === 0) {\n col3 = dom.createElement('td')\n col3.setAttribute('rowspan', `${w.length}1`)\n // col3.textContent = '@@@@@ remove';\n col3.setAttribute('style', 'width:50%;')\n tr.appendChild(col3)\n }\n table.appendChild(tr)\n\n comment = solidLogicSingleton.store.any(ws, ns.rdfs('comment'))\n comment = comment ? comment.value : 'Use this workspace'\n col2.addEventListener(\n 'click',\n function (_event) {\n col3.textContent = comment ? comment.value : ''\n col3.setAttribute('style', deselectedStyle + localStyle)\n const button = dom.createElement('button')\n button.textContent = 'Continue'\n // button.setAttribute('style', style);\n const newBase = figureOutBase(ws)\n baseField.value = newBase // show user proposed URI\n\n button.addEventListener(\n 'click',\n function (_event) {\n button.disabled = true\n callbackWS(ws, newBase)\n button.textContent = '---->'\n },\n true\n ) // capture vs bubble\n col3.appendChild(button)\n },\n true\n ) // capture vs bubble\n }\n\n // last line with \"Make new workspace\"\n const trLast = dom.createElement('tr')\n col2 = dom.createElement('td')\n col2.setAttribute('style', cellStyle)\n col2.textContent = '+ Make a new workspace'\n col2.addEventListener('click', makeNewWorkspace)\n trLast.appendChild(col2)\n table.appendChild(trLast)\n } // displayOptions\n\n // console.log('kicking off async operation')\n ensureLoadedPreferences(context) // kick off async operation\n .then(displayOptions)\n .catch((err) => {\n // console.log(\"err from async op\")\n box.appendChild(widgets.errorMessageBlock(context.dom, err))\n })\n\n return box // return the box element, while login proceeds\n} // selectWorkspace\n\n/**\n * Creates a new instance of an app.\n *\n * An instance of an app could be e.g. an issue tracker for a given project,\n * or a chess game, or calendar, or a health/fitness record for a person.\n *\n * Note that this use of the term 'app' refers more to entries in the user's\n * type index than to actual software applications that use the personal data\n * to which these entries point.\n *\n * @param dom\n * @param appDetails\n * @param callback\n *\n * @returns A div with a button in it for making a new app instance\n */\nexport function newAppInstance (\n dom: HTMLDocument,\n appDetails: AppDetails,\n callback: (workspace: string | null, newBase: string) => void\n): HTMLElement {\n const gotWS = function (ws, base) {\n // log.debug(\"newAppInstance: Selected workspace = \" + (ws? ws.uri : 'none'))\n callback(ws, base)\n }\n const div = dom.createElement('div')\n const b = dom.createElement('button')\n b.setAttribute('type', 'button')\n div.appendChild(b)\n b.innerHTML = `Make new ${appDetails.noun}`\n b.addEventListener(\n 'click',\n (_event) => {\n div.appendChild(selectWorkspace(dom, appDetails, gotWS))\n },\n false\n )\n div.appendChild(b)\n return div\n}\n/**\n * Retrieves whether the currently logged in user is a power user\n * and/or a developer\n */\nexport async function getUserRoles (): Promise> {\n try {\n const { me, preferencesFile, preferencesFileError } = await ensureLoadedPreferences({})\n if (!preferencesFile || preferencesFileError) {\n throw new Error(preferencesFileError)\n }\n return solidLogicSingleton.store.each(\n me,\n ns.rdf('type'),\n null,\n preferencesFile.doc()\n ) as NamedNode[]\n } catch (error) {\n debug.warn('Unable to fetch your preferences - this was the error: ', error)\n }\n return []\n}\n\n/**\n * Filters which panes should be available, based on the result of [[getUserRoles]]\n */\nexport async function filterAvailablePanes (\n panes: Array\n): Promise> {\n const userRoles = await getUserRoles()\n return panes.filter((pane) => isMatchingAudience(pane, userRoles))\n}\n\nfunction isMatchingAudience (pane: PaneDefinition, userRoles: Array): boolean {\n const audience = pane.audience || []\n return audience.reduce(\n (isMatch, audienceRole) => isMatch && !!userRoles.find((role) => role.equals(audienceRole)),\n true as boolean\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAAA,OAAA,GAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAeA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAD,uBAAA,CAAAH,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,EAAA,GAAAH,uBAAA,CAAAH,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAL,uBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAN,uBAAA,CAAAH,OAAA;AAAqC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAA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\ No newline at end of file diff --git a/lib/matrix/matrix.js b/lib/matrix/matrix.js index 189fcd67..c6a25ca9 100644 --- a/lib/matrix/matrix.js +++ b/lib/matrix/matrix.js @@ -82,10 +82,8 @@ function matrixForQuery(dom, query, vx, vy, vvalue, options, whenDone) { return matrix.insertBefore(tr, ele); // return the tr } } - return matrix.appendChild(tr); // return the tr }; - var columnNumberFor = function columnNumberFor(x1) { var xNT = x1.toNT(); // xNT is a NT string var col = null; diff --git a/lib/matrix/matrix.js.map b/lib/matrix/matrix.js.map index d348ea6b..dc7c4c8b 100644 --- a/lib/matrix/matrix.js.map +++ b/lib/matrix/matrix.js.map @@ -1 +1 @@ -{"version":3,"file":"matrix.js","names":["utils","_interopRequireWildcard","require","$rdf","_solidLogic","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","kb","solidLogicSingleton","store","matrixForQuery","dom","query","vx","vy","vvalue","options","whenDone","matrix","createElement","header","corner","appendChild","setAttribute","lastHeader","columns","rows","setCell","cell","x","y","value","firstChild","removeChild","style","textAlign","cellFunction","textContent","label","old","rowFor","y1","toNT","tr","termType","fetcher","nowOrWhenFetched","uri","split","undefined","ok","_body","_response","length","fromNT","dataValueNT","ele","nextSibling","yDecreasing","insertBefore","columnNumberFor","x1","xNT","col","xDecreasing","slice","concat","push","row","td","j","markOldCells","children","clearOldCells","colsUsed","rowsUsed","set_y","k","set_x","newcolumns","refresh","addCellFromBindings","bindings","toString","colNo"],"sources":["../../src/matrix/matrix.ts"],"sourcesContent":["// Build a 2D matrix of values\n//\n// dom AKA document\n// query a Query object of rdflib.js with a valid pattern\n// vx A variable object, the one to be used for the X variable (horiz)\n// vy A variable object, the one to be used for the Y variable (vertical)\n// vvalue A variable object, the one to be used for the cell value\n// returns A DOM element with the matrix in it, which has a .refresh() function.\n//\n// Options:\n// cellFunction(td, x, y, value) fill the TD element of a single cell\n// xDecreasing set true for x axis to be in decreasing order.\n// yDecreasing set true for y axis to be in decreasing order.\n// set_x array of X values to be define initial rows (order irrelevant)\n// set_y array of Y values to be define initial columns\n//\n// Features:\n// Header row at top (x axis) and left (y-axis) generated automatically.\n// Extra rows and columns are inserted as needed to hold new data points\n// matrix.refresh() will re-run the query and adjust the display\n\nimport * as utils from '../utils'\nimport * as $rdf from 'rdflib'\nimport { MatrixOptions } from './types'\nimport { solidLogicSingleton } from 'solid-logic'\n\nconst kb = solidLogicSingleton.store\n\nexport function matrixForQuery (\n dom: HTMLDocument,\n query: $rdf.Query,\n vx: $rdf.Variable,\n vy: $rdf.Variable,\n vvalue: $rdf.Variable,\n options: MatrixOptions,\n whenDone: () => void\n) {\n // @@ TODO Remove need to cast to any\n const matrix: any = dom.createElement('table')\n const header = dom.createElement('tr')\n const corner = header.appendChild(dom.createElement('td'))\n corner.setAttribute('class', 'MatrixCorner')\n matrix.appendChild(header) // just one for now\n matrix.lastHeader = header // Element before data\n let columns: any[] = [] // Vector\n const rows: any[] = [] // Associative array\n\n const setCell = function (cell, x, y, value) {\n while (cell.firstChild) {\n // Empty any previous\n cell.removeChild(cell.firstChild)\n }\n cell.setAttribute('style', '')\n cell.style.textAlign = 'center'\n\n if (options.cellFunction) {\n options.cellFunction(cell, x, y, value)\n } else {\n cell.textContent = utils.label(value)\n cell.setAttribute('style', 'padding: 0.3em')\n }\n delete cell.old\n }\n\n const rowFor = function (y1) {\n const y = y1.toNT()\n if (rows[y]) return rows[y]\n // @@ TODO Remove need for casting to any\n const tr: any = dom.createElement('tr')\n const header = tr.appendChild(dom.createElement('td'))\n header.setAttribute('style', 'padding: 0.3em;')\n header.textContent = utils.label(y1) // first approximation\n if (y1.termType === 'NamedNode') {\n kb.fetcher!.nowOrWhenFetched(y1.uri.split('#')[0], undefined, function (\n ok,\n _body,\n _response\n ) {\n if (ok) header.textContent = utils.label(y1)\n })\n }\n for (let i = 0; i < columns.length; i++) {\n setCell(\n tr.appendChild(dom.createElement('td')),\n $rdf.fromNT(columns[i]),\n y1,\n null\n )\n }\n tr.dataValueNT = y\n rows[y] = tr\n for (let ele = matrix.lastHeader.nextSibling; ele; ele = ele.nextSibling) {\n // skip header\n if (\n (y > ele.dataValueNT && options && options.yDecreasing) ||\n (y < ele.dataValueNT && !(options && options.yDecreasing))\n ) {\n return matrix.insertBefore(tr, ele) // return the tr\n }\n }\n return matrix.appendChild(tr) // return the tr\n }\n\n const columnNumberFor = function (x1): number {\n const xNT: any = x1.toNT() // xNT is a NT string\n let col: any = null\n // These are data columns (not headings)\n for (let i = 0; i < columns.length; i++) {\n if (columns[i] === xNT) {\n return i\n }\n\n if (\n (xNT > columns[i] && options.xDecreasing) ||\n (xNT < columns[i] && !options.xDecreasing)\n ) {\n columns = columns\n .slice(0, i)\n .concat([xNT])\n .concat(columns.slice(i))\n col = i\n break\n }\n }\n\n if (col === null) {\n col = columns.length\n columns.push(xNT)\n }\n\n // col is the number of the new column, starting from 0\n for (let row = matrix.firstChild; row; row = row.nextSibling) {\n // For every row header or not\n const y = row.dataValueNT\n const td = dom.createElement('td') // Add a new cell\n td.style.textAlign = 'center'\n if (row === matrix.firstChild) {\n td.textContent = utils.label(x1)\n } else {\n setCell(td, x1, $rdf.fromNT(y), null)\n }\n if (col === columns.length - 1) {\n row.appendChild(td)\n } else {\n let t = row.firstChild\n for (let j = 0; j < col + 1; j++) {\n // Skip header col too\n t = t.nextSibling\n }\n row.insertBefore(td, t)\n }\n }\n return col\n }\n\n const markOldCells = function () {\n for (let i = 1; i < matrix.children.length; i++) {\n const row = matrix.children[i]\n for (let j = 1; j < row.children.length; j++) {\n row.children[j].old = true\n }\n }\n }\n\n const clearOldCells = function () {\n let row, cell\n const colsUsed: any[] = []\n const rowsUsed: any[] = []\n\n if (options.set_y) {\n // Knows y values create rows\n for (let k = 0; k < options.set_y.length; k++) {\n rowsUsed[options.set_y[k]] = true\n }\n }\n if (options.set_x) {\n for (let k = 0; k < options.set_x.length; k++) {\n colsUsed[columnNumberFor(options.set_x[k]) + 1] = true\n }\n }\n\n for (let i = 1; i < matrix.children.length; i++) {\n row = matrix.children[i]\n for (let j = 1; j < row.children.length; j++) {\n cell = row.children[j]\n if (cell.old) {\n const y = $rdf.fromNT(row.dataValueNT)\n const x = $rdf.fromNT(columns[j - 1])\n setCell(cell, x, y, null)\n } else {\n rowsUsed[row.dataValueNT] = true\n colsUsed[j] = true\n }\n }\n }\n\n for (let i = 0; i < matrix.children.length; i++) {\n row = matrix.children[i]\n if (i > 0 && !rowsUsed[row.dataValueNT]) {\n delete rows[row.dataValueNT]\n matrix.removeChild(row)\n } else {\n for (let j = row.children.length - 1; j > 0; j--) {\n // backwards\n const cell = row.children[j]\n if (!colsUsed[j]) {\n row.removeChild(cell)\n }\n }\n }\n }\n const newcolumns: any[] = []\n for (let j = 0; j < columns.length; j++) {\n if (colsUsed[j + 1]) {\n newcolumns.push(columns[j])\n }\n }\n columns = newcolumns\n }\n\n matrix.refresh = function () {\n markOldCells()\n kb.query(query, addCellFromBindings, undefined, clearOldCells)\n }\n\n const addCellFromBindings = function (bindings) {\n const x = bindings[vx.toString()]\n const y = bindings[vy.toString()]\n const value = bindings[(vvalue.toString())]\n const row = rowFor(y)\n const colNo = columnNumberFor(x)\n const cell = row.children[colNo + 1] // number of Y axis headings\n setCell(cell, x, y, value)\n }\n\n if (options.set_y) {\n // Knows y values create rows\n for (let k = 0; k < options.set_y.length; k++) {\n rowFor(options.set_y[k])\n }\n }\n if (options.set_x) {\n for (let k = 0; k < options.set_x.length; k++) {\n columnNumberFor(options.set_x[k])\n }\n }\n\n kb.query(query, addCellFromBindings, undefined, whenDone) // Populate the matrix\n return matrix\n}\n"],"mappings":";;;;;;;AAqBA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAF,uBAAA,CAAAC,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAAiD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CA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B,OAAO,CAAC4D,KAAK,CAACC,CAAC,CAAC,CAAC;IAC1B;EACF;EACA,IAAI7D,OAAO,CAAC8D,KAAK,EAAE;IACjB,KAAK,IAAID,GAAC,GAAG,CAAC,EAAEA,GAAC,GAAG7D,OAAO,CAAC8D,KAAK,CAACzB,MAAM,EAAEwB,GAAC,EAAE,EAAE;MAC7CjB,eAAe,CAAC5C,OAAO,CAAC8D,KAAK,CAACD,GAAC,CAAC,CAAC;IACnC;EACF;EAEAtE,EAAE,CAACK,KAAK,CAACA,KAAK,EAAEqE,mBAAmB,EAAEhC,SAAS,EAAEhC,QAAQ,CAAC,EAAC;EAC1D,OAAOC,MAAM;AACf"} \ No newline at end of file +{"version":3,"file":"matrix.js","names":["utils","_interopRequireWildcard","require","$rdf","_solidLogic","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","kb","solidLogicSingleton","store","matrixForQuery","dom","query","vx","vy","vvalue","options","whenDone","matrix","createElement","header","corner","appendChild","setAttribute","lastHeader","columns","rows","setCell","cell","x","y","value","firstChild","removeChild","style","textAlign","cellFunction","textContent","label","old","rowFor","y1","toNT","tr","termType","fetcher","nowOrWhenFetched","uri","split","undefined","ok","_body","_response","length","fromNT","dataValueNT","ele","nextSibling","yDecreasing","insertBefore","columnNumberFor","x1","xNT","col","xDecreasing","slice","concat","push","row","td","j","markOldCells","children","clearOldCells","colsUsed","rowsUsed","set_y","k","set_x","newcolumns","refresh","addCellFromBindings","bindings","toString","colNo"],"sources":["../../src/matrix/matrix.ts"],"sourcesContent":["// Build a 2D matrix of values\n//\n// dom AKA document\n// query a Query object of rdflib.js with a valid pattern\n// vx A variable object, the one to be used for the X variable (horiz)\n// vy A variable object, the one to be used for the Y variable (vertical)\n// vvalue A variable object, the one to be used for the cell value\n// returns A DOM element with the matrix in it, which has a .refresh() function.\n//\n// Options:\n// cellFunction(td, x, y, value) fill the TD element of a single cell\n// xDecreasing set true for x axis to be in decreasing order.\n// yDecreasing set true for y axis to be in decreasing order.\n// set_x array of X values to be define initial rows (order irrelevant)\n// set_y array of Y values to be define initial columns\n//\n// Features:\n// Header row at top (x axis) and left (y-axis) generated automatically.\n// Extra rows and columns are inserted as needed to hold new data points\n// matrix.refresh() will re-run the query and adjust the display\n\nimport * as utils from '../utils'\nimport * as $rdf from 'rdflib'\nimport { MatrixOptions } from './types'\nimport { solidLogicSingleton } from 'solid-logic'\n\nconst kb = solidLogicSingleton.store\n\nexport function matrixForQuery (\n dom: HTMLDocument,\n query: $rdf.Query,\n vx: $rdf.Variable,\n vy: $rdf.Variable,\n vvalue: $rdf.Variable,\n options: MatrixOptions,\n whenDone: () => void\n) {\n // @@ TODO Remove need to cast to any\n const matrix: any = dom.createElement('table')\n const header = dom.createElement('tr')\n const corner = header.appendChild(dom.createElement('td'))\n corner.setAttribute('class', 'MatrixCorner')\n matrix.appendChild(header) // just one for now\n matrix.lastHeader = header // Element before data\n let columns: any[] = [] // Vector\n const rows: any[] = [] // Associative array\n\n const setCell = function (cell, x, y, value) {\n while (cell.firstChild) {\n // Empty any previous\n cell.removeChild(cell.firstChild)\n }\n cell.setAttribute('style', '')\n cell.style.textAlign = 'center'\n\n if (options.cellFunction) {\n options.cellFunction(cell, x, y, value)\n } else {\n cell.textContent = utils.label(value)\n cell.setAttribute('style', 'padding: 0.3em')\n }\n delete cell.old\n }\n\n const rowFor = function (y1) {\n const y = y1.toNT()\n if (rows[y]) return rows[y]\n // @@ TODO Remove need for casting to any\n const tr: any = dom.createElement('tr')\n const header = tr.appendChild(dom.createElement('td'))\n header.setAttribute('style', 'padding: 0.3em;')\n header.textContent = utils.label(y1) // first approximation\n if (y1.termType === 'NamedNode') {\n kb.fetcher!.nowOrWhenFetched(y1.uri.split('#')[0], undefined, function (\n ok,\n _body,\n _response\n ) {\n if (ok) header.textContent = utils.label(y1)\n })\n }\n for (let i = 0; i < columns.length; i++) {\n setCell(\n tr.appendChild(dom.createElement('td')),\n $rdf.fromNT(columns[i]),\n y1,\n null\n )\n }\n tr.dataValueNT = y\n rows[y] = tr\n for (let ele = matrix.lastHeader.nextSibling; ele; ele = ele.nextSibling) {\n // skip header\n if (\n (y > ele.dataValueNT && options && options.yDecreasing) ||\n (y < ele.dataValueNT && !(options && options.yDecreasing))\n ) {\n return matrix.insertBefore(tr, ele) // return the tr\n }\n }\n return matrix.appendChild(tr) // return the tr\n }\n\n const columnNumberFor = function (x1): number {\n const xNT: any = x1.toNT() // xNT is a NT string\n let col: any = null\n // These are data columns (not headings)\n for (let i = 0; i < columns.length; i++) {\n if (columns[i] === xNT) {\n return i\n }\n\n if (\n (xNT > columns[i] && options.xDecreasing) ||\n (xNT < columns[i] && !options.xDecreasing)\n ) {\n columns = columns\n .slice(0, i)\n .concat([xNT])\n .concat(columns.slice(i))\n col = i\n break\n }\n }\n\n if (col === null) {\n col = columns.length\n columns.push(xNT)\n }\n\n // col is the number of the new column, starting from 0\n for (let row = matrix.firstChild; row; row = row.nextSibling) {\n // For every row header or not\n const y = row.dataValueNT\n const td = dom.createElement('td') // Add a new cell\n td.style.textAlign = 'center'\n if (row === matrix.firstChild) {\n td.textContent = utils.label(x1)\n } else {\n setCell(td, x1, $rdf.fromNT(y), null)\n }\n if (col === columns.length - 1) {\n row.appendChild(td)\n } else {\n let t = row.firstChild\n for (let j = 0; j < col + 1; j++) {\n // Skip header col too\n t = t.nextSibling\n }\n row.insertBefore(td, t)\n }\n }\n return col\n }\n\n const markOldCells = function () {\n for (let i = 1; i < matrix.children.length; i++) {\n const row = matrix.children[i]\n for (let j = 1; j < row.children.length; j++) {\n row.children[j].old = true\n }\n }\n }\n\n const clearOldCells = function () {\n let row, cell\n const colsUsed: any[] = []\n const rowsUsed: any[] = []\n\n if (options.set_y) {\n // Knows y values create rows\n for (let k = 0; k < options.set_y.length; k++) {\n rowsUsed[options.set_y[k]] = true\n }\n }\n if (options.set_x) {\n for (let k = 0; k < options.set_x.length; k++) {\n colsUsed[columnNumberFor(options.set_x[k]) + 1] = true\n }\n }\n\n for (let i = 1; i < matrix.children.length; i++) {\n row = matrix.children[i]\n for (let j = 1; j < row.children.length; j++) {\n cell = row.children[j]\n if (cell.old) {\n const y = $rdf.fromNT(row.dataValueNT)\n const x = $rdf.fromNT(columns[j - 1])\n setCell(cell, x, y, null)\n } else {\n rowsUsed[row.dataValueNT] = true\n colsUsed[j] = true\n }\n }\n }\n\n for (let i = 0; i < matrix.children.length; i++) {\n row = matrix.children[i]\n if (i > 0 && !rowsUsed[row.dataValueNT]) {\n delete rows[row.dataValueNT]\n matrix.removeChild(row)\n } else {\n for (let j = row.children.length - 1; j > 0; j--) {\n // backwards\n const cell = row.children[j]\n if (!colsUsed[j]) {\n row.removeChild(cell)\n }\n }\n }\n }\n const newcolumns: any[] = []\n for (let j = 0; j < columns.length; j++) {\n if (colsUsed[j + 1]) {\n newcolumns.push(columns[j])\n }\n }\n columns = newcolumns\n }\n\n matrix.refresh = function () {\n markOldCells()\n kb.query(query, addCellFromBindings, undefined, clearOldCells)\n }\n\n const addCellFromBindings = function (bindings) {\n const x = bindings[vx.toString()]\n const y = bindings[vy.toString()]\n const value = bindings[(vvalue.toString())]\n const row = rowFor(y)\n const colNo = columnNumberFor(x)\n const cell = row.children[colNo + 1] // number of Y axis headings\n setCell(cell, x, y, value)\n }\n\n if (options.set_y) {\n // Knows y values create rows\n for (let k = 0; k < options.set_y.length; k++) {\n rowFor(options.set_y[k])\n }\n }\n if (options.set_x) {\n for (let k = 0; k < options.set_x.length; k++) {\n columnNumberFor(options.set_x[k])\n }\n }\n\n kb.query(query, addCellFromBindings, undefined, whenDone) // Populate the matrix\n return matrix\n}\n"],"mappings":";;;;;;;AAqBA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAF,uBAAA,CAAAC,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAAiD,SAAAG,yBAAAC,CAAA,6BAAA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7CrC,MAAM,CAACxB,OAAO,CAAC4D,KAAK,CAACC,CAAC,CAAC,CAAC;IAC1B;EACF;EACA,IAAI7D,OAAO,CAAC8D,KAAK,EAAE;IACjB,KAAK,IAAID,GAAC,GAAG,CAAC,EAAEA,GAAC,GAAG7D,OAAO,CAAC8D,KAAK,CAACzB,MAAM,EAAEwB,GAAC,EAAE,EAAE;MAC7CjB,eAAe,CAAC5C,OAAO,CAAC8D,KAAK,CAACD,GAAC,CAAC,CAAC;IACnC;EACF;EAEAtE,EAAE,CAACK,KAAK,CAACA,KAAK,EAAEqE,mBAAmB,EAAEhC,SAAS,EAAEhC,QAAQ,CAAC,EAAC;EAC1D,OAAOC,MAAM;AACf"} \ No newline at end of file diff --git a/lib/media/media-capture.js b/lib/media/media-capture.js index 05908d19..0194308d 100644 --- a/lib/media/media-capture.js +++ b/lib/media/media-capture.js @@ -100,7 +100,6 @@ function cameraCaptureControl(dom, store, getImageDoc, doneCallback) { main.removeChild(canvas); displayPlayer(); // Make new one as old one is stuck black } - function grabCanvas() { // Draw the video frame to the canvas. canvas = dom.createElement('canvas'); @@ -120,13 +119,11 @@ function cameraCaptureControl(dom, store, getImageDoc, doneCallback) { // alert(msg) }, contentType); // toBlob } - function reviewImage() { sendButton.style.visibility = 'visible'; retakeButton.style.visibility = 'visible'; shutterButton.style.visibility = 'collapse'; // Hide for now } - function stopVideo() { if (player && player.srcObject) { player.srcObject.getVideoTracks().forEach(function (track) { diff --git a/lib/media/media-capture.js.map b/lib/media/media-capture.js.map index ac4396f3..7df326ca 100644 --- a/lib/media/media-capture.js.map +++ b/lib/media/media-capture.js.map @@ -1 +1 @@ -{"version":3,"file":"media-capture.js","names":["debug","_interopRequireWildcard","require","_iconBase","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","cameraIcon","icons","iconBase","retakeIcon","canvasWidth","canvasHeight","controlStyle","concat","contentType","cameraCaptureControl","dom","store","getImageDoc","doneCallback","div","createElement","destination","imageBlob","player","canvas","table","appendChild","mainTR","main","setAttribute","buttons","cancelButton","addEventListener","_event","stopVideo","retakeButton","button","retake","style","visibility","shutterButton","grabCanvas","sendButton","continueButton","saveBlob","displayPlayer","navigator","mediaDevices","Error","getUserMedia","constraints","then","stream","srcObject","video","removeChild","context","getContext","drawImage","width","height","parentNode","toBlob","blob","msg","type","size","log","reviewImage","getVideoTracks","forEach","track","stop","fetcher","webOperation","uri","data","_resp","err","alert","cameraButton","but","control","restoreButton","_x","_restoreButton","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","imageDoc","wrap","_callee$","_context","prev","next"],"sources":["../../src/media/media-capture.ts"],"sourcesContent":["/// /////////////////////////////////////////////\n//\n// Media input widget\n//\n//\n// Workflow:\n// The HTML5 functionality (on mobille) is to prompt for either\n// a realtime camera capture , OR a selection from images already ont the device\n// (eg camera roll).\n//\n// The solid alternative is to either take a phtoto\n// or access cemra roll (etc) OR to access solid cloud storage of favorite photo almbums.\n// (Especially latest taken ones)\n//\nimport * as debug from '../debug'\n\n/** @module mediaCapture */\n\nimport { icons } from '../iconBase'\nimport * as widgets from '../widgets'\nimport { IndexedFormula, NamedNode } from 'rdflib'\n\nconst cameraIcon = icons.iconBase + 'noun_Camera_1618446_000000.svg' // Get it from github\nconst retakeIcon = icons.iconBase + 'noun_479395.svg' // Get it from github\n\nconst canvasWidth = '640'\nconst canvasHeight = '480'\n\nconst controlStyle = `border-radius: 0.5em; margin: 0.8em; width: ${canvasWidth}; height:${canvasHeight};`\n// const controlStyle = 'border-radius: 0.5em; margin: 0.8em; width: 320; height:240;'\nconst contentType = 'image/png'\n\n/** A control to capture a picture using camera\n * @param {Docuemnt} dom - The Document object\n * @param {IndexedForumla} store - The quadstore to store data in\n * @param {NamedNode} getImageDoc() - NN of the image file to be created\n * @param {function} doneCallback - Called when a picture has been taken\n */\nexport function cameraCaptureControl (\n dom: HTMLDocument,\n store: IndexedFormula,\n getImageDoc: () => NamedNode,\n doneCallback: (imageDoc) => Promise\n) {\n const div = dom.createElement('div')\n let destination, imageBlob, player, canvas\n\n const table = div.appendChild(dom.createElement('table'))\n const mainTR = table.appendChild(dom.createElement('tr'))\n const main = mainTR.appendChild(dom.createElement('td'))\n main.setAttribute('colspan', '4')\n\n const buttons = table.appendChild(dom.createElement('tr'))\n\n buttons\n .appendChild(dom.createElement('td')) // Cancel button\n .appendChild(widgets.cancelButton(dom))\n .addEventListener('click', _event => {\n stopVideo()\n doneCallback(null)\n })\n\n const retakeButton = buttons\n .appendChild(dom.createElement('td')) // Retake button\n .appendChild(widgets.button(dom, retakeIcon, 'Retake'))\n retakeButton.addEventListener('click', _event => {\n retake()\n })\n retakeButton.style.visibility = 'collapse' // Hide for now\n\n const shutterButton = buttons\n .appendChild(dom.createElement('td')) // Trigger capture button\n .appendChild(\n widgets.button(dom, icons.iconBase + 'noun_10636.svg', 'Snap')\n )\n shutterButton.addEventListener('click', grabCanvas)\n shutterButton.style.visibility = 'collapse' // Hide for now\n\n const sendButton = buttons\n .appendChild(dom.createElement('td')) // Confirm and save button\n .appendChild(widgets.continueButton(dom)) // @@ or send icon??\n sendButton.addEventListener('click', _event => {\n saveBlob(imageBlob, destination)\n })\n sendButton.style.visibility = 'collapse' // Hide for now\n\n function displayPlayer () {\n player = main.appendChild(dom.createElement('video'))\n player.setAttribute('controls', '1')\n player.setAttribute('autoplay', '1')\n player.setAttribute('style', controlStyle)\n if (!navigator.mediaDevices) {\n throw new Error('navigator.mediaDevices not available')\n }\n navigator.mediaDevices.getUserMedia(constraints).then(stream => {\n player.srcObject = stream\n shutterButton.style.visibility = 'visible' // Enable\n sendButton.style.visibility = 'collapse'\n retakeButton.style.visibility = 'collapse'\n })\n }\n\n const constraints = {\n video: true\n }\n\n function retake () {\n main.removeChild(canvas)\n displayPlayer() // Make new one as old one is stuck black\n }\n\n function grabCanvas () {\n // Draw the video frame to the canvas.\n canvas = dom.createElement('canvas')\n canvas.setAttribute('width', canvasWidth)\n canvas.setAttribute('height', canvasHeight)\n canvas.setAttribute('style', controlStyle)\n main.appendChild(canvas)\n\n const context = canvas.getContext('2d')\n context.drawImage(player, 0, 0, canvas.width, canvas.height)\n\n player.parentNode.removeChild(player)\n\n canvas.toBlob(blob => {\n const msg = `got blob type ${blob.type} size ${blob.size}`\n debug.log(msg)\n destination = getImageDoc()\n imageBlob = blob // save for review\n reviewImage()\n // alert(msg)\n }, contentType) // toBlob\n }\n\n function reviewImage () {\n sendButton.style.visibility = 'visible'\n retakeButton.style.visibility = 'visible'\n shutterButton.style.visibility = 'collapse' // Hide for now\n }\n\n function stopVideo () {\n if (player && player.srcObject) {\n player.srcObject.getVideoTracks().forEach(track => track.stop())\n }\n }\n function saveBlob (blob, destination) {\n const contentType = blob.type\n // if (!confirm('Save picture to ' + destination + ' ?')) return\n debug.log(\n 'Putting ' + blob.size + ' bytes of ' + contentType + ' to ' + destination\n )\n // @@ TODO Remove casting\n ;(store as any).fetcher\n .webOperation('PUT', destination.uri, {\n data: blob,\n contentType\n })\n .then(\n _resp => {\n debug.log('ok saved ' + destination)\n stopVideo()\n doneCallback(destination)\n },\n err => {\n stopVideo()\n alert(err)\n }\n )\n }\n\n // Attach the video stream to the video element and autoplay.\n displayPlayer()\n return div\n}\n\n/** A button to capture a picture using camera\n * @param {Docuemnt} dom - The Document object\n * @param {IndexedForumla} store - The quadstore to store data in\n * @param {fuunction} getImageDoc - returns NN of the image file to be created\n * @param {function} doneCallback - called with the image taken\n * @returns {DomElement} - A div element with the buton in it\n *\n * This expacts the buttton to a large control when it is pressed\n */\n\nexport function cameraButton (\n dom: HTMLDocument,\n store: IndexedFormula,\n getImageDoc: () => NamedNode,\n doneCallback: (imageDoc) => Promise\n): HTMLElement {\n const div = dom.createElement('div')\n const but = widgets.button(dom, cameraIcon, 'Take picture')\n let control\n async function restoreButton (imageDoc) {\n div.removeChild(control)\n div.appendChild(but)\n doneCallback(imageDoc)\n }\n div.appendChild(but)\n but.addEventListener('click', _event => {\n div.removeChild(but)\n control = cameraCaptureControl(\n dom,\n store,\n getImageDoc,\n restoreButton\n )\n div.appendChild(control)\n })\n return div\n}\n"],"mappings":";;;;;;;;;;;AAcA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAH,uBAAA,CAAAC,OAAA;AAAqC,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CA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AAO,CAAC;YACxB/D,GAAG,CAACO,WAAW,CAACuD,GAAG,CAAC;YACpB/D,YAAY,CAAC0E,QAAQ,CAAC;UAAA;UAAA;YAAA,OAAAG,QAAA,CAAAvB,IAAA;QAAA;MAAA,GAAAmB,OAAA;IAAA,CACvB;IAAA,OAAAN,cAAA,CAAAC,KAAA,OAAAC,SAAA;EAAA;EACDpE,GAAG,CAACO,WAAW,CAACuD,GAAG,CAAC;EACpBA,GAAG,CAACjD,gBAAgB,CAAC,OAAO,EAAE,UAAAC,MAAM,EAAI;IACtCd,GAAG,CAACoC,WAAW,CAAC0B,GAAG,CAAC;IACpBC,OAAO,GAAGpE,oBAAoB,CAC5BC,GAAG,EACHC,KAAK,EACLC,WAAW,EACXkE,aACF,CAAC;IACDhE,GAAG,CAACO,WAAW,CAACwD,OAAO,CAAC;EAC1B,CAAC,CAAC;EACF,OAAO/D,GAAG;AACZ"} \ No newline at end of file +{"version":3,"file":"media-capture.js","names":["debug","_interopRequireWildcard","require","_iconBase","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","cameraIcon","icons","iconBase","retakeIcon","canvasWidth","canvasHeight","controlStyle","concat","contentType","cameraCaptureControl","dom","store","getImageDoc","doneCallback","div","createElement","destination","imageBlob","player","canvas","table","appendChild","mainTR","main","setAttribute","buttons","cancelButton","addEventListener","_event","stopVideo","retakeButton","button","retake","style","visibility","shutterButton","grabCanvas","sendButton","continueButton","saveBlob","displayPlayer","navigator","mediaDevices","Error","getUserMedia","constraints","then","stream","srcObject","video","removeChild","context","getContext","drawImage","width","height","parentNode","toBlob","blob","msg","type","size","log","reviewImage","getVideoTracks","forEach","track","stop","fetcher","webOperation","uri","data","_resp","err","alert","cameraButton","but","control","restoreButton","_x","_restoreButton","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","imageDoc","wrap","_callee$","_context","prev","next"],"sources":["../../src/media/media-capture.ts"],"sourcesContent":["/// /////////////////////////////////////////////\n//\n// Media input widget\n//\n//\n// Workflow:\n// The HTML5 functionality (on mobille) is to prompt for either\n// a realtime camera capture , OR a selection from images already ont the device\n// (eg camera roll).\n//\n// The solid alternative is to either take a phtoto\n// or access cemra roll (etc) OR to access solid cloud storage of favorite photo almbums.\n// (Especially latest taken ones)\n//\nimport * as debug from '../debug'\n\n/** @module mediaCapture */\n\nimport { icons } from '../iconBase'\nimport * as widgets from '../widgets'\nimport { IndexedFormula, NamedNode } from 'rdflib'\n\nconst cameraIcon = icons.iconBase + 'noun_Camera_1618446_000000.svg' // Get it from github\nconst retakeIcon = icons.iconBase + 'noun_479395.svg' // Get it from github\n\nconst canvasWidth = '640'\nconst canvasHeight = '480'\n\nconst controlStyle = `border-radius: 0.5em; margin: 0.8em; width: ${canvasWidth}; height:${canvasHeight};`\n// const controlStyle = 'border-radius: 0.5em; margin: 0.8em; width: 320; height:240;'\nconst contentType = 'image/png'\n\n/** A control to capture a picture using camera\n * @param {Docuemnt} dom - The Document object\n * @param {IndexedForumla} store - The quadstore to store data in\n * @param {NamedNode} getImageDoc() - NN of the image file to be created\n * @param {function} doneCallback - Called when a picture has been taken\n */\nexport function cameraCaptureControl (\n dom: HTMLDocument,\n store: IndexedFormula,\n getImageDoc: () => NamedNode,\n doneCallback: (imageDoc) => Promise\n) {\n const div = dom.createElement('div')\n let destination, imageBlob, player, canvas\n\n const table = div.appendChild(dom.createElement('table'))\n const mainTR = table.appendChild(dom.createElement('tr'))\n const main = mainTR.appendChild(dom.createElement('td'))\n main.setAttribute('colspan', '4')\n\n const buttons = table.appendChild(dom.createElement('tr'))\n\n buttons\n .appendChild(dom.createElement('td')) // Cancel button\n .appendChild(widgets.cancelButton(dom))\n .addEventListener('click', _event => {\n stopVideo()\n doneCallback(null)\n })\n\n const retakeButton = buttons\n .appendChild(dom.createElement('td')) // Retake button\n .appendChild(widgets.button(dom, retakeIcon, 'Retake'))\n retakeButton.addEventListener('click', _event => {\n retake()\n })\n retakeButton.style.visibility = 'collapse' // Hide for now\n\n const shutterButton = buttons\n .appendChild(dom.createElement('td')) // Trigger capture button\n .appendChild(\n widgets.button(dom, icons.iconBase + 'noun_10636.svg', 'Snap')\n )\n shutterButton.addEventListener('click', grabCanvas)\n shutterButton.style.visibility = 'collapse' // Hide for now\n\n const sendButton = buttons\n .appendChild(dom.createElement('td')) // Confirm and save button\n .appendChild(widgets.continueButton(dom)) // @@ or send icon??\n sendButton.addEventListener('click', _event => {\n saveBlob(imageBlob, destination)\n })\n sendButton.style.visibility = 'collapse' // Hide for now\n\n function displayPlayer () {\n player = main.appendChild(dom.createElement('video'))\n player.setAttribute('controls', '1')\n player.setAttribute('autoplay', '1')\n player.setAttribute('style', controlStyle)\n if (!navigator.mediaDevices) {\n throw new Error('navigator.mediaDevices not available')\n }\n navigator.mediaDevices.getUserMedia(constraints).then(stream => {\n player.srcObject = stream\n shutterButton.style.visibility = 'visible' // Enable\n sendButton.style.visibility = 'collapse'\n retakeButton.style.visibility = 'collapse'\n })\n }\n\n const constraints = {\n video: true\n }\n\n function retake () {\n main.removeChild(canvas)\n displayPlayer() // Make new one as old one is stuck black\n }\n\n function grabCanvas () {\n // Draw the video frame to the canvas.\n canvas = dom.createElement('canvas')\n canvas.setAttribute('width', canvasWidth)\n canvas.setAttribute('height', canvasHeight)\n canvas.setAttribute('style', controlStyle)\n main.appendChild(canvas)\n\n const context = canvas.getContext('2d')\n context.drawImage(player, 0, 0, canvas.width, canvas.height)\n\n player.parentNode.removeChild(player)\n\n canvas.toBlob(blob => {\n const msg = `got blob type ${blob.type} size ${blob.size}`\n debug.log(msg)\n destination = getImageDoc()\n imageBlob = blob // save for review\n reviewImage()\n // alert(msg)\n }, contentType) // toBlob\n }\n\n function reviewImage () {\n sendButton.style.visibility = 'visible'\n retakeButton.style.visibility = 'visible'\n shutterButton.style.visibility = 'collapse' // Hide for now\n }\n\n function stopVideo () {\n if (player && player.srcObject) {\n player.srcObject.getVideoTracks().forEach(track => track.stop())\n }\n }\n function saveBlob (blob, destination) {\n const contentType = blob.type\n // if (!confirm('Save picture to ' + destination + ' ?')) return\n debug.log(\n 'Putting ' + blob.size + ' bytes of ' + contentType + ' to ' + destination\n )\n // @@ TODO Remove casting\n ;(store as any).fetcher\n .webOperation('PUT', destination.uri, {\n data: blob,\n contentType\n })\n .then(\n _resp => {\n debug.log('ok saved ' + destination)\n stopVideo()\n doneCallback(destination)\n },\n err => {\n stopVideo()\n alert(err)\n }\n )\n }\n\n // Attach the video stream to the video element and autoplay.\n displayPlayer()\n return div\n}\n\n/** A button to capture a picture using camera\n * @param {Docuemnt} dom - The Document object\n * @param {IndexedForumla} store - The quadstore to store data in\n * @param {fuunction} getImageDoc - returns NN of the image file to be created\n * @param {function} doneCallback - called with the image taken\n * @returns {DomElement} - A div element with the buton in it\n *\n * This expacts the buttton to a large control when it is pressed\n */\n\nexport function cameraButton (\n dom: HTMLDocument,\n store: IndexedFormula,\n getImageDoc: () => NamedNode,\n doneCallback: (imageDoc) => Promise\n): HTMLElement {\n const div = dom.createElement('div')\n const but = widgets.button(dom, cameraIcon, 'Take picture')\n let control\n async function restoreButton (imageDoc) {\n div.removeChild(control)\n div.appendChild(but)\n doneCallback(imageDoc)\n }\n div.appendChild(but)\n but.addEventListener('click', _event => {\n div.removeChild(but)\n control = cameraCaptureControl(\n dom,\n store,\n getImageDoc,\n restoreButton\n )\n div.appendChild(control)\n })\n return div\n}\n"],"mappings":";;;;;;;;;;;AAcA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAH,uBAAA,CAAAC,OAAA;AAAqC,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAA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C,WAAW,EACXkE,aACF,CAAC;IACDhE,GAAG,CAACO,WAAW,CAACwD,OAAO,CAAC;EAC1B,CAAC,CAAC;EACF,OAAO/D,GAAG;AACZ"} \ No newline at end of file diff --git a/lib/messageArea.js b/lib/messageArea.js index 3a0576c9..7d796956 100644 --- a/lib/messageArea.js +++ b/lib/messageArea.js @@ -52,7 +52,6 @@ function messageArea(dom, kb, subject, messageStore, options) { a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true); a.setAttribute('style', 'color: #3B5998; text-decoration: none; '); // font-weight: bold } - a.textContent = text; return a; }; @@ -221,7 +220,6 @@ function messageArea(dom, kb, subject, messageStore, options) { }; renderMessage(bindings, true); // fresh from elsewhere }; - var renderMessage = function renderMessage(bindings, fresh) { var creator = bindings['?creator']; var message = bindings['?msg']; @@ -295,7 +293,6 @@ function messageArea(dom, kb, subject, messageStore, options) { } else { messageTable.appendChild(tr); // not newestFirst } - var query; // Do this with a live query to pull in messages from web if (options.query) { @@ -315,7 +312,6 @@ function messageArea(dom, kb, subject, messageStore, options) { function doneQuery() { messageTable.fresh = true; // any new are fresh and so will be greenish } - kb.query(query, renderMessage, undefined, doneQuery); div.refresh = function () { syncMessages(subject, messageTable); diff --git a/lib/messageArea.js.map b/lib/messageArea.js.map index 8b6f82b4..22019896 100644 --- a/lib/messageArea.js.map +++ b/lib/messageArea.js.map @@ -1 +1 @@ -{"version":3,"file":"messageArea.js","names":["_iconBase","require","login","_interopRequireWildcard","_solidLogic","ns","rdf","style","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","UI","icons","messageArea","dom","kb","subject","messageStore","options","solidLogicSingleton","store","doc","WF","Namespace","DCT","newestFirst","messageBodyStyle","div","createElement","messageTable","me","updater","anchor","text","term","uri","setAttribute","addEventListener","openHrefInOutlineMode","textContent","mention","message","pre","appendChild","createTextNode","announce","log","warn","error","newMessageForm","form","lhs","middle","rhs","AJAR_date","sendMessage","field","disabled","sts","now","Date","timestamp","getTime","dateStamp","sym","push","Statement","wf","sioc","literal","value","foaf","sendComplete","success","body","errorMessageBlock","bindings","renderMessage","update","sendButton","turnOnInput","creatorAndDate","innerHTML","rows","keyCode","altKey","button","iconBase","buttonStyle","context","ensureLoggedIn","then","nick","person","s","any","label","td1","creator","date","nickAnchor","fetcher","nowOrWhenFetched","undefined","_ok","_body","syncMessages","about","displayed","ele","ele2","firstChild","nextSibling","AJAR_subject","messages","each","stored","forEach","m","addMessage","removeChild","deleteMessage","deletions","statementsMatching","concat","ok","fresh","content","dateString","tr","done","insertBefore","shortDate","td2","td3","delButton","_event","cancelButton","sureButton","query","Query","v","vs","x","vars","variable","pat","add","msg","dct","doneQuery","refresh"],"sources":["../src/messageArea.js"],"sourcesContent":["// Common code for a discussion are a of messages about something\n//\n\nimport { icons } from './iconBase'\nimport * as login from './login/login'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as ns from './ns'\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as style from './style'\nimport * as utils from './utils'\nimport * as widgets from './widgets'\n\nconst UI = { icons, ns, rdf, style, widgets }\n\nexport function messageArea (dom, kb, subject, messageStore, options) {\n kb = kb || solidLogicSingleton.store\n messageStore = messageStore.doc() // No hash\n const ns = UI.ns\n const WF = rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')\n const DCT = rdf.Namespace('http://purl.org/dc/terms/')\n\n options = options || {}\n\n const newestFirst = !!options.newestFirst\n\n const messageBodyStyle =\n 'white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;'\n // 'font-size: 100%; margin: 0.1em 1em 0.1em 1em; background-color: white; white-space: pre-wrap; padding: 0.1em;'\n\n const div = dom.createElement('div')\n // eslint-disable-next-line prefer-const\n let messageTable // Shared by initial build and addMessageFromBindings\n\n let me\n\n const updater = solidLogicSingleton.store.updater\n\n const anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n }\n\n const mention = function mention (message, style) {\n const pre = dom.createElement('pre')\n pre.setAttribute('style', style || 'color: grey')\n div.appendChild(pre)\n pre.appendChild(dom.createTextNode(message))\n return pre\n }\n\n const announce = {\n log: function (message) {\n mention(message, 'color: #111;')\n },\n warn: function (message) {\n mention(message, 'color: #880;')\n },\n error: function (message) {\n mention(message, 'color: #800;')\n }\n }\n\n // Form for a new message\n //\n const newMessageForm = function () {\n const form = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n form.appendChild(lhs)\n form.appendChild(middle)\n form.appendChild(rhs)\n form.AJAR_date = '9999-01-01T00:00:00Z' // ISO format for field sort\n\n const sendMessage = function () {\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = kb.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n sts.push(\n new rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n sts.push(\n new rdf.Statement(\n message,\n ns.sioc('content'),\n kb.literal(field.value),\n messageStore\n )\n )\n sts.push(\n new rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': kb.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n }\n form.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const turnOnInput = function () {\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n field.addEventListener(\n 'keyup',\n function (e) {\n // User preference?\n if (e.keyCode === 13) {\n if (!e.altKey) {\n // Alt-Enter just adds a new line\n sendMessage()\n }\n }\n },\n false\n )\n\n rhs.innerHTML = ''\n sendButton = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_383448.svg',\n 'Send'\n )\n sendButton.setAttribute('style', UI.style.buttonStyle + 'float: right;')\n sendButton.addEventListener('click', sendMessage, false)\n rhs.appendChild(sendButton)\n }\n\n const context = { div: middle, dom }\n login.ensureLoggedIn(context).then(context => {\n me = context.me\n turnOnInput()\n })\n\n return form\n }\n\n function nick (person) {\n const s = solidLogicSingleton.store.any(person, UI.ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n }\n\n function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n solidLogicSingleton.store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n }\n\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, 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 = kb.each(about, ns.wf('message'))\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m)\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 }\n\n const deleteMessage = function (message) {\n const deletions = kb\n .statementsMatching(message)\n .concat(kb.statementsMatching(undefined, undefined, message))\n updater.update(deletions, [], function (uri, ok, body) {\n if (!ok) {\n announce.error('Cant delete messages:' + body)\n } else {\n syncMessages(subject, messageTable)\n }\n })\n }\n\n const addMessage = function (message) {\n const bindings = {\n '?msg': message,\n '?creator': kb.any(message, ns.foaf('maker')),\n '?date': kb.any(message, DCT('created')),\n '?content': kb.any(message, ns.sioc('content'))\n }\n renderMessage(bindings, true) // fresh from elsewhere\n }\n\n const renderMessage = function (bindings, fresh) {\n const creator = bindings['?creator']\n const message = bindings['?msg']\n const date = bindings['?date']\n const content = bindings['?content']\n\n const dateString = date.value\n const tr = dom.createElement('tr')\n tr.AJAR_date = dateString\n tr.AJAR_subject = message\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(tr, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(tr)\n }\n\n const td1 = dom.createElement('td')\n tr.appendChild(td1)\n creatorAndDate(td1, creator, UI.widgets.shortDate(dateString), message)\n\n const td2 = dom.createElement('td')\n tr.appendChild(td2)\n const pre = dom.createElement('p')\n pre.setAttribute(\n 'style',\n messageBodyStyle +\n (fresh ? 'background-color: #e8ffe8;' : 'background-color: #white;')\n )\n td2.appendChild(pre)\n pre.textContent = content.value\n\n const td3 = dom.createElement('td')\n tr.appendChild(td3)\n\n const delButton = dom.createElement('button')\n td3.appendChild(delButton)\n delButton.textContent = '-'\n\n tr.setAttribute('class', 'hoverControl') // See tabbedtab.css (sigh global CSS)\n delButton.setAttribute('class', 'hoverControlHide')\n delButton.setAttribute('style', 'color: red;')\n delButton.addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(delButton) // Ask -- are you sure?\n const cancelButton = dom.createElement('button')\n cancelButton.textContent = 'cancel'\n td3.appendChild(cancelButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n td3.appendChild(delButton)\n },\n false\n )\n const sureButton = dom.createElement('button')\n sureButton.textContent = 'Delete message'\n td3.appendChild(sureButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n deleteMessage(message)\n },\n false\n )\n },\n false\n )\n }\n\n // Messages with date, author etc\n\n messageTable = dom.createElement('table')\n messageTable.fresh = false\n div.appendChild(messageTable)\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n\n const tr = newMessageForm()\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n\n let query\n // Do this with a live query to pull in messages from web\n if (options.query) {\n query = options.query\n } else {\n query = new rdf.Query('Messages')\n const v = {} // semicolon needed\n const vs = ['msg', 'date', 'creator', 'content']\n vs.forEach(function (x) {\n query.vars.push((v[x] = rdf.variable(x)))\n })\n query.pat.add(subject, WF('message'), v.msg)\n query.pat.add(v.msg, ns.dct('created'), v.date)\n query.pat.add(v.msg, ns.foaf('maker'), v.creator)\n query.pat.add(v.msg, ns.sioc('content'), v.content)\n }\n function doneQuery () {\n messageTable.fresh = true // any new are fresh and so will be greenish\n }\n kb.query(query, renderMessage, undefined, doneQuery)\n div.refresh = function () {\n syncMessages(subject, messageTable)\n }\n // syncMessages(subject, messageTable) // no the query will do this async\n return div\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF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BzH,YAAY,CAACiG,KAAK,GAAG,IAAI,EAAC;EAC5B;;EACA/G,EAAE,CAAC4H,KAAK,CAACA,KAAK,EAAE9D,aAAa,EAAE0B,SAAS,EAAE+C,SAAS,CAAC;EACpD3H,GAAG,CAAC4H,OAAO,GAAG,YAAY;IACxB7C,YAAY,CAAC1F,OAAO,EAAEa,YAAY,CAAC;EACrC,CAAC;EACD;EACA,OAAOF,GAAG;AACZ"} \ No newline at end of file +{"version":3,"file":"messageArea.js","names":["_iconBase","require","login","_interopRequireWildcard","_solidLogic","ns","rdf","style","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","UI","icons","messageArea","dom","kb","subject","messageStore","options","solidLogicSingleton","store","doc","WF","Namespace","DCT","newestFirst","messageBodyStyle","div","createElement","messageTable","me","updater","anchor","text","term","uri","setAttribute","addEventListener","openHrefInOutlineMode","textContent","mention","message","pre","appendChild","createTextNode","announce","log","warn","error","newMessageForm","form","lhs","middle","rhs","AJAR_date","sendMessage","field","disabled","sts","now","Date","timestamp","getTime","dateStamp","sym","push","Statement","wf","sioc","literal","value","foaf","sendComplete","success","body","errorMessageBlock","bindings","renderMessage","update","sendButton","turnOnInput","creatorAndDate","innerHTML","rows","keyCode","altKey","button","iconBase","buttonStyle","context","ensureLoggedIn","then","nick","person","s","any","label","td1","creator","date","nickAnchor","fetcher","nowOrWhenFetched","undefined","_ok","_body","syncMessages","about","displayed","ele","ele2","firstChild","nextSibling","AJAR_subject","messages","each","stored","forEach","m","addMessage","removeChild","deleteMessage","deletions","statementsMatching","concat","ok","fresh","content","dateString","tr","done","insertBefore","shortDate","td2","td3","delButton","_event","cancelButton","sureButton","query","Query","v","vs","x","vars","variable","pat","add","msg","dct","doneQuery","refresh"],"sources":["../src/messageArea.js"],"sourcesContent":["// Common code for a discussion are a of messages about something\n//\n\nimport { icons } from './iconBase'\nimport * as login from './login/login'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as ns from './ns'\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as style from './style'\nimport * as utils from './utils'\nimport * as widgets from './widgets'\n\nconst UI = { icons, ns, rdf, style, widgets }\n\nexport function messageArea (dom, kb, subject, messageStore, options) {\n kb = kb || solidLogicSingleton.store\n messageStore = messageStore.doc() // No hash\n const ns = UI.ns\n const WF = rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')\n const DCT = rdf.Namespace('http://purl.org/dc/terms/')\n\n options = options || {}\n\n const newestFirst = !!options.newestFirst\n\n const messageBodyStyle =\n 'white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;'\n // 'font-size: 100%; margin: 0.1em 1em 0.1em 1em; background-color: white; white-space: pre-wrap; padding: 0.1em;'\n\n const div = dom.createElement('div')\n // eslint-disable-next-line prefer-const\n let messageTable // Shared by initial build and addMessageFromBindings\n\n let me\n\n const updater = solidLogicSingleton.store.updater\n\n const anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n }\n\n const mention = function mention (message, style) {\n const pre = dom.createElement('pre')\n pre.setAttribute('style', style || 'color: grey')\n div.appendChild(pre)\n pre.appendChild(dom.createTextNode(message))\n return pre\n }\n\n const announce = {\n log: function (message) {\n mention(message, 'color: #111;')\n },\n warn: function (message) {\n mention(message, 'color: #880;')\n },\n error: function (message) {\n mention(message, 'color: #800;')\n }\n }\n\n // Form for a new message\n //\n const newMessageForm = function () {\n const form = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n form.appendChild(lhs)\n form.appendChild(middle)\n form.appendChild(rhs)\n form.AJAR_date = '9999-01-01T00:00:00Z' // ISO format for field sort\n\n const sendMessage = function () {\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = kb.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n sts.push(\n new rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n sts.push(\n new rdf.Statement(\n message,\n ns.sioc('content'),\n kb.literal(field.value),\n messageStore\n )\n )\n sts.push(\n new rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': kb.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n }\n form.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const turnOnInput = function () {\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n field.addEventListener(\n 'keyup',\n function (e) {\n // User preference?\n if (e.keyCode === 13) {\n if (!e.altKey) {\n // Alt-Enter just adds a new line\n sendMessage()\n }\n }\n },\n false\n )\n\n rhs.innerHTML = ''\n sendButton = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_383448.svg',\n 'Send'\n )\n sendButton.setAttribute('style', UI.style.buttonStyle + 'float: right;')\n sendButton.addEventListener('click', sendMessage, false)\n rhs.appendChild(sendButton)\n }\n\n const context = { div: middle, dom }\n login.ensureLoggedIn(context).then(context => {\n me = context.me\n turnOnInput()\n })\n\n return form\n }\n\n function nick (person) {\n const s = solidLogicSingleton.store.any(person, UI.ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n }\n\n function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n solidLogicSingleton.store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n }\n\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, 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 = kb.each(about, ns.wf('message'))\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m)\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 }\n\n const deleteMessage = function (message) {\n const deletions = kb\n .statementsMatching(message)\n .concat(kb.statementsMatching(undefined, undefined, message))\n updater.update(deletions, [], function (uri, ok, body) {\n if (!ok) {\n announce.error('Cant delete messages:' + body)\n } else {\n syncMessages(subject, messageTable)\n }\n })\n }\n\n const addMessage = function (message) {\n const bindings = {\n '?msg': message,\n '?creator': kb.any(message, ns.foaf('maker')),\n '?date': kb.any(message, DCT('created')),\n '?content': kb.any(message, ns.sioc('content'))\n }\n renderMessage(bindings, true) // fresh from elsewhere\n }\n\n const renderMessage = function (bindings, fresh) {\n const creator = bindings['?creator']\n const message = bindings['?msg']\n const date = bindings['?date']\n const content = bindings['?content']\n\n const dateString = date.value\n const tr = dom.createElement('tr')\n tr.AJAR_date = dateString\n tr.AJAR_subject = message\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(tr, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(tr)\n }\n\n const td1 = dom.createElement('td')\n tr.appendChild(td1)\n creatorAndDate(td1, creator, UI.widgets.shortDate(dateString), message)\n\n const td2 = dom.createElement('td')\n tr.appendChild(td2)\n const pre = dom.createElement('p')\n pre.setAttribute(\n 'style',\n messageBodyStyle +\n (fresh ? 'background-color: #e8ffe8;' : 'background-color: #white;')\n )\n td2.appendChild(pre)\n pre.textContent = content.value\n\n const td3 = dom.createElement('td')\n tr.appendChild(td3)\n\n const delButton = dom.createElement('button')\n td3.appendChild(delButton)\n delButton.textContent = '-'\n\n tr.setAttribute('class', 'hoverControl') // See tabbedtab.css (sigh global CSS)\n delButton.setAttribute('class', 'hoverControlHide')\n delButton.setAttribute('style', 'color: red;')\n delButton.addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(delButton) // Ask -- are you sure?\n const cancelButton = dom.createElement('button')\n cancelButton.textContent = 'cancel'\n td3.appendChild(cancelButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n td3.appendChild(delButton)\n },\n false\n )\n const sureButton = dom.createElement('button')\n sureButton.textContent = 'Delete message'\n td3.appendChild(sureButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n deleteMessage(message)\n },\n false\n )\n },\n false\n )\n }\n\n // Messages with date, author etc\n\n messageTable = dom.createElement('table')\n messageTable.fresh = false\n div.appendChild(messageTable)\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n\n const tr = newMessageForm()\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n\n let query\n // Do this with a live query to pull in messages from web\n if (options.query) {\n query = options.query\n } else {\n query = new rdf.Query('Messages')\n const v = {} // semicolon needed\n const vs = ['msg', 'date', 'creator', 'content']\n vs.forEach(function (x) {\n query.vars.push((v[x] = rdf.variable(x)))\n })\n query.pat.add(subject, WF('message'), v.msg)\n query.pat.add(v.msg, ns.dct('created'), v.date)\n query.pat.add(v.msg, ns.foaf('maker'), v.creator)\n query.pat.add(v.msg, ns.sioc('content'), v.content)\n }\n function doneQuery () {\n messageTable.fresh = true // any new are fresh and so will be greenish\n }\n kb.query(query, renderMessage, undefined, doneQuery)\n div.refresh = function () {\n syncMessages(subject, messageTable)\n }\n // syncMessages(subject, messageTable) // no the query will do this async\n return div\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAF,uBAAA,CAAAF,OAAA;AACA,IAAAK,GAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAJ,uBAAA,CAAAF,OAAA;AACA,IAAAO,KAAA,GAAAL,uBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,uBAAA,CAAAF,OAAA;AAAoC,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAA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AAG7J,GAAG,CAAC+J,QAAQ,CAACF,CAAC,CAAE,CAAC;IAC3C,CAAC,CAAC;IACFJ,KAAK,CAACO,GAAG,CAACC,GAAG,CAACnI,OAAO,EAAEM,EAAE,CAAC,SAAS,CAAC,EAAEuH,CAAC,CAACO,GAAG,CAAC;IAC5CT,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAACO,GAAG,EAAEnK,EAAE,CAACoK,GAAG,CAAC,SAAS,CAAC,EAAER,CAAC,CAAC1C,IAAI,CAAC;IAC/CwC,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAACO,GAAG,EAAEnK,EAAE,CAACsF,IAAI,CAAC,OAAO,CAAC,EAAEsE,CAAC,CAAC3C,OAAO,CAAC;IACjDyC,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAACO,GAAG,EAAEnK,EAAE,CAACmF,IAAI,CAAC,SAAS,CAAC,EAAEyE,CAAC,CAACd,OAAO,CAAC;EACrD;EACA,SAASuB,SAASA,CAAA,EAAI;IACpBzH,YAAY,CAACiG,KAAK,GAAG,IAAI,EAAC;EAC5B;EACA/G,EAAE,CAAC4H,KAAK,CAACA,KAAK,EAAE9D,aAAa,EAAE0B,SAAS,EAAE+C,SAAS,CAAC;EACpD3H,GAAG,CAAC4H,OAAO,GAAG,YAAY;IACxB7C,YAAY,CAAC1F,OAAO,EAAEa,YAAY,CAAC;EACrC,CAAC;EACD;EACA,OAAOF,GAAG;AACZ"} \ No newline at end of file diff --git a/lib/pad.js b/lib/pad.js index 4e2b8d54..ba5438de 100644 --- a/lib/pad.js +++ b/lib/pad.js @@ -53,9 +53,9 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return 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 && Object.prototype.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; } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** ************** - * Notepad Widget - */ /** @module pad - */ + * Notepad Widget + */ /** @module pad + */ var store = _solidLogic.solidLogicSingleton.store; var PAD = (0, _rdflib.Namespace)('http://www.w3.org/ns/pim/pad#'); /** @@ -438,7 +438,6 @@ function notepad(dom, padDoc, subject, me, options) { } }); }; - part.addEventListener('input', function inputChangeListener(_event) { // debug.log("input changed "+part.value); setPartStyle(part, undefined, true); // grey out - not synced @@ -697,7 +696,6 @@ function notepad(dom, padDoc, subject, me, options) { (0, _debug.log)(' Already reloading - stop'); return; // once only needed } - reloading = true; var retryTimeout = 1000; // ms var tryReload = function tryReload() { @@ -754,7 +752,6 @@ function notepad(dom, padDoc, subject, me, options) { } }); } - return table; } diff --git a/lib/pad.js.map b/lib/pad.js.map index 35cbbc46..88debced 100644 --- a/lib/pad.js.map +++ b/lib/pad.js.map @@ -1 +1 @@ -{"version":3,"file":"pad.js","names":["ns","_interopRequireWildcard","require","_rdflib","_widgets","_utils","_debug","_solidLogic","_participation","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","store","solidLogicSingleton","PAD","Namespace","NotepadElement","_HTMLElement","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","_wrapNativeSuper2","HTMLElement","NotepadPart","_HTMLElement2","_super2","_this2","_len2","_key2","lightColorHash","author","hash","x","split","reduce","b","charCodeAt","uri","toString","notepad","dom","padDoc","subject","me","options","exists","table","createElement","kb","Error","updater","setAttribute","upstreamStatus","downstreamStatus","statusArea","appendChild","tr","complain","message","upstream","undefined","log","errorMessageBlock","clearStatus","_upsteam","innerHTML","setPartStyle","part","colors","pending","chunk","baseStyle","headingCore","headingStyle","any","dc","bgcolor","indent","value","style","removePart","prev","next","sameTerm","del","statementsMatching","ins","st","NamedNode","label","slice","update","ok","errorMessage","response","row","parentNode","before","previousSibling","removeChild","firstChild","focus","status","state","beep","setTimeout","reloadAndSync","res","changeIndent","delta","current","Number","object","newIndent","errorBody","requestDownstreamAction","addListeners","addEventListener","event","queueProperty","queue","keyCode","shiftKey","newChunk","preventDefault","nextSibling","updateStore","old","sioc","newOne","lastSent","xhr","inputChangeListener","_event","newPartAfter","tr1","text","insertBefore","ele","here","tagName","toLowerCase","newThing","push","_xhr","newPart","newLinesBefore","consistencyCheck","found","failed","complain2","msg","the","k","each","sts","forEach","sync","textContent","manif","children","refreshTree","root","refresh","reloading","checkAndSync","retryTimeout","tryReload","reload","holds","insertables","rdf","Date","getChunks","chunks","xmlEncode","str","replace","notepadToHTML","pad","html","title","anyValue","dct","level","increaseLevel","decreaseLevel","anyJS","rawContent","content","h"],"sources":["../src/pad.ts"],"sourcesContent":["/** **************\n * Notepad Widget\n */\n\n/** @module pad\n */\nimport * as ns from './ns'\nimport { Namespace, NamedNode, st, IndexedFormula } from 'rdflib'\nimport { newThing, errorMessageBlock } from './widgets'\nimport { beep } from './utils'\nimport { log } from './debug'\nimport { solidLogicSingleton } from 'solid-logic'\nexport { renderPartipants, participationObject, manageParticipation, recordParticipation } from './participation'\n\nconst store = solidLogicSingleton.store\n\nconst PAD = Namespace('http://www.w3.org/ns/pim/pad#')\n\ntype notepadOptions = {\n statusArea?: HTMLDivElement\n exists?: boolean\n}\n/**\n * @ignore\n */\nclass NotepadElement extends HTMLElement {\n subject?: NamedNode\n}\n/**\n * @ignore\n */\nclass NotepadPart extends HTMLElement {\n subject?: NamedNode | string\n value?: string\n state?: Number\n lastSent?: String\n}\n/** Figure out a random color from my webid\n *\n * @param {NamedNode} author - The author of text being displayed\n * @returns {String} The CSS color generated, constrained to be light for a background color\n */\nexport function lightColorHash (author?: NamedNode): string {\n const hash = function (x) {\n return x.split('').reduce(function (a, b) {\n a = (a << 5) - a + b.charCodeAt(0)\n return a & a\n }, 0)\n }\n return author && author.uri\n ? '#' + ((hash(author.uri) & 0xffffff) | 0xc0c0c0).toString(16)\n : '#ffffff' // c0c0c0 forces pale\n} // no id -> white\n\n/** notepad\n *\n * @param {HTMLDocument} dom - the web page of the browser\n * @param {NamedNode} padDoc - the document into which the particpation should be shown\n * @param {NamedNode} subject - the thing in which participation is happening\n * @param {NamedNode} me - person who is logged into the pod\n * @param {notepadOptions} options - the options that can be passed in consist of statusArea, exists\n */\nexport function notepad (dom: HTMLDocument, padDoc: NamedNode, subject: NamedNode, me: NamedNode, options?: notepadOptions) {\n options = options || {}\n const exists = options.exists\n const table: any = dom.createElement('table')\n const kb = store\n\n if (me && !me.uri) throw new Error('UI.pad.notepad: Invalid userid')\n\n const updater = store.updater\n\n const PAD = Namespace('http://www.w3.org/ns/pim/pad#')\n\n table.setAttribute(\n 'style',\n 'padding: 1em; overflow: auto; resize: horizontal; min-width: 40em;'\n )\n\n let upstreamStatus: HTMLElement | null = null\n let downstreamStatus: HTMLElement | null = null\n\n if (options.statusArea) {\n const t = options.statusArea.appendChild(dom.createElement('table'))\n const tr = t.appendChild(dom.createElement('tr'))\n upstreamStatus = tr.appendChild(dom.createElement('td'))\n downstreamStatus = tr.appendChild(dom.createElement('td'))\n\n if (upstreamStatus) {\n upstreamStatus.setAttribute('style', 'width:50%')\n }\n if (downstreamStatus) {\n downstreamStatus.setAttribute('style', 'width:50%')\n }\n }\n /* @@ TODO want to look into this, it seems upstream should be a boolean and default to false ?\n *\n */\n const complain = function (message: string, upstream: boolean = false) {\n log(message)\n if ((options as notepadOptions).statusArea) {\n ; (upstream ? upstreamStatus as HTMLElement : downstreamStatus as HTMLElement).appendChild(errorMessageBlock(dom, message, 'pink'))\n }\n }\n // @@ TODO need to refactor so that we don't have to type cast\n const clearStatus = function (_upsteam?: any) {\n if ((options as notepadOptions).statusArea) {\n ((options as notepadOptions).statusArea as HTMLElement).innerHTML = ''\n }\n }\n\n const setPartStyle = function (part: NotepadPart, colors?: string, pending?: any) {\n const chunk = part.subject\n colors = colors || ''\n const baseStyle =\n 'font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;'\n const headingCore =\n 'font-family: sans-serif; font-weight: bold; border: none;'\n const headingStyle = [\n 'font-size: 110%; padding-top: 0.5em; padding-bottom: 0.5em; width: 100%;',\n 'font-size: 120%; padding-top: 1em; padding-bottom: 1em; width: 100%;',\n 'font-size: 150%; padding-top: 1em; padding-bottom: 1em; width: 100%;'\n ]\n\n const author = kb.any(chunk as any, ns.dc('author'))\n if (!colors && author) {\n // Hash the user webid for now -- later allow user selection!\n const bgcolor = lightColorHash(author as any)\n colors =\n 'color: ' +\n (pending ? '#888' : 'black') +\n '; background-color: ' +\n bgcolor +\n ';'\n }\n\n // @@ TODO Need to research when this can be an object with the indent stored in value\n // and when the indent is stored as a Number itself, not in an object.\n let indent: any = kb.any(chunk as any, PAD('indent'))\n\n indent = indent ? indent.value : 0\n const style =\n indent >= 0\n ? baseStyle + 'text-indent: ' + indent * 3 + 'em;'\n : headingCore + headingStyle[-1 - indent]\n // ? baseStyle + 'padding-left: ' + (indent * 3) + 'em;'\n part.setAttribute('style', style + colors)\n }\n\n const removePart = function (part: NotepadPart) {\n const chunk = part.subject\n if (!chunk) throw new Error('No chunk for line to be deleted!') // just in case\n const prev: any = kb.any(undefined, PAD('next'), chunk as any)\n const next: any = kb.any(chunk as any, PAD('next'))\n if (prev.sameTerm(subject) && next.sameTerm(subject)) {\n // Last one\n log(\"You can't delete the only line.\")\n return\n }\n\n const del = kb\n .statementsMatching(chunk as any, undefined, undefined, padDoc)\n .concat(kb.statementsMatching(undefined, undefined, chunk as any, padDoc))\n const ins = [st(prev, PAD('next'), next, padDoc)]\n\n // @@ TODO what should we do if chunk is not a NamedNode should we\n // assume then it is a string?\n if (chunk instanceof NamedNode) {\n const label = chunk.uri.slice(-4)\n\n log('Deleting line ' + label)\n }\n if (!updater) {\n throw new Error('have no updater')\n }\n // @@ TODO below you can see that before is redefined and not a boolean\n updater.update(del, ins, function (uri, ok, errorMessage, response) {\n if (ok) {\n const row = part.parentNode\n if (row) {\n const before: any = row.previousSibling\n if (row.parentNode) {\n row.parentNode.removeChild(row)\n }\n // console.log(' deleted line ' + label + ' ok ' + part.value)\n if (before && before.firstChild) {\n // @@ TODO IMPORTANT FOCUS ISN'T A PROPERTY ON A CHILDNODE\n before.firstChild.focus()\n }\n }\n } else if (response && (response as any).status === 409) {\n // Conflict\n setPartStyle(part, 'color: black; background-color: #ffd;') // yellow\n part.state = 0 // Needs downstream refresh\n beep(0.5, 512) // Ooops clash with other person\n setTimeout(function () {\n // Ideally, beep! @@\n reloadAndSync() // Throw away our changes and\n // updater.requestDownstreamAction(padDoc, reloadAndSync)\n }, 1000)\n } else {\n log(' removePart FAILED ' + chunk + ': ' + errorMessage)\n log(\" removePart was deleteing :'\" + del)\n setPartStyle(part, 'color: black; background-color: #fdd;') // failed\n const res = response ? (response as any).status : ' [no response field] '\n complain('Error ' + res + ' saving changes: ' + (errorMessage as any).true) // upstream,\n // updater.requestDownstreamAction(padDoc, reloadAndSync);\n }\n })\n } // removePart\n\n const changeIndent = function (part: NotepadPart, chunk: string, delta) {\n const del = kb.statementsMatching(chunk as any, PAD('indent'))\n const current = del.length ? Number(del[0].object.value) : 0\n if (current + delta < -3) return // limit negative indent\n const newIndent = current + delta\n const ins = st(chunk as any, PAD('indent'), newIndent, padDoc)\n if (!updater) {\n throw new Error('no updater')\n }\n updater.update(del, ins as any, function (uri, ok, errorBody) {\n if (!ok) {\n log(\n \"Indent change FAILED '\" +\n newIndent +\n \"' for \" +\n padDoc +\n ': ' +\n errorBody\n )\n setPartStyle(part, 'color: black; background-color: #fdd;') // failed\n updater.requestDownstreamAction(padDoc, reloadAndSync)\n } else {\n setPartStyle(part) // Implement the indent\n }\n })\n }\n\n // Use this sort of code to split the line when return pressed in the middle @@\n /*\n function doGetCaretPosition doGetCaretPosition (oField) {\n var iCaretPos = 0\n // IE Support\n if (document.selection) {\n // Set focus on the element to avoid IE bug\n oField.focus()\n // To get cursor position, get empty selection range\n var oSel = document.selection.createRange()\n // Move selection start to 0 position\n oSel.moveStart('character', -oField.value.length)\n // The caret position is selection length\n iCaretPos = oSel.text.length\n // Firefox suppor\n } else if (oField.selectionStart || oField.selectionStart === '0') {\n iCaretPos = oField.selectionStart\n }\n // Return results\n return (iCaretPos)\n }\n */\n const addListeners = function (part: any, chunk: any) {\n part.addEventListener('keydown', function (event) {\n if (!updater) {\n throw new Error('no updater')\n }\n\n let queueProperty, queue\n // up 38; down 40; left 37; right 39 tab 9; shift 16; escape 27\n switch (event.keyCode) {\n case 13: // Return\n {\n const before: NotepadElement = event.shiftKey\n log('enter') // Shift-return inserts before -- only way to add to top of pad.\n if (before) {\n queue = kb.any(undefined, PAD('next'), chunk)\n queueProperty = 'newlinesAfter'\n } else {\n queue = kb.any(chunk, PAD('next'))\n queueProperty = 'newlinesBefore'\n }\n queue[queueProperty] = queue[queueProperty] || 0\n queue[queueProperty] += 1\n if (queue[queueProperty] > 1) {\n log(' queueing newline queue = ' + queue[queueProperty])\n return\n }\n log(' go ahead line before ' + queue[queueProperty])\n newChunk(part, before) // was document.activeElement\n break\n }\n case 8: // Delete\n if (part.value.length === 0) {\n log(\n 'Delete key line ' + chunk.uri.slice(-4) + ' state ' + part.state\n )\n\n switch (part.state) {\n case 1: // contents being sent\n case 2: // contents need to be sent again\n part.state = 4 // delete me\n return\n case 3: // being deleted already\n case 4: // already deleme state\n return\n case undefined:\n case 0:\n part.state = 3 // being deleted\n removePart(part)\n event.preventDefault()\n break // continue\n default:\n throw new Error('pad: Unexpected state ' + part)\n }\n }\n break\n case 9: // Tab\n {\n const delta = event.shiftKey ? -1 : 1\n changeIndent(part, chunk, delta)\n event.preventDefault() // default is to highlight next field\n break\n }\n case 27: // ESC\n log('escape')\n updater.requestDownstreamAction(padDoc, reloadAndSync)\n event.preventDefault()\n break\n\n case 38: // Up\n if (part.parentNode.previousSibling) {\n part.parentNode.previousSibling.firstChild.focus()\n event.preventDefault()\n }\n break\n\n case 40: // Down\n if (part.parentNode.nextSibling) {\n part.parentNode.nextSibling.firstChild.focus()\n event.preventDefault()\n }\n break\n\n default:\n }\n })\n\n const updateStore = function (part: NotepadPart) {\n const chunk: any = part.subject\n setPartStyle(part, undefined, true)\n const old = (kb.any(chunk, ns.sioc('content')) as any).value\n const del = [st(chunk, ns.sioc('content'), old, padDoc)]\n let ins\n if (part.value) {\n ins = [st(chunk, ns.sioc('content'), part.value as any, padDoc)]\n }\n const newOne = part.value\n\n // DEBUGGING ONLY\n if (part.lastSent) {\n if (old !== part.lastSent) {\n throw new Error(\n \"Out of order, last sent expected '\" +\n old +\n \"' but found '\" +\n part.lastSent +\n \"'\"\n )\n }\n }\n part.lastSent = newOne\n\n /* console.log(\n ' Patch proposed to ' +\n chunk.uri.slice(-4) +\n \" '\" +\n old +\n \"' -> '\" +\n newOne +\n \"' \"\n ) */\n if (!updater) {\n throw new Error('no updater')\n }\n\n updater.update(del, ins, function (uri, ok, errorBody, xhr) {\n if (!ok) {\n // alert(\"clash \" + errorBody);\n log(\n ' patch FAILED ' +\n (xhr as any).status +\n \" for '\" +\n old +\n \"' -> '\" +\n newOne +\n \"': \" +\n errorBody\n )\n if ((xhr as any).status === 409) {\n // Conflict - @@ we assume someone else\n setPartStyle(part, 'color: black; background-color: #fdd;')\n part.state = 0 // Needs downstream refresh\n beep(0.5, 512) // Ooops clash with other person\n setTimeout(function () {\n updater.requestDownstreamAction(padDoc, reloadAndSync)\n }, 1000)\n } else {\n setPartStyle(part, 'color: black; background-color: #fdd;') // failed pink\n part.state = 0\n complain(\n ' Error ' + (xhr as any).status + ' sending data: ' + errorBody,\n true\n )\n beep(1.0, 128) // Other\n // @@@ Do soemthing more serious with other errors eg auth, etc\n }\n } else {\n clearStatus(true) // upstream\n setPartStyle(part) // synced\n log(\" Patch ok '\" + old + \"' -> '\" + newOne + \"' \")\n\n if (part.state === 4) {\n // delete me\n part.state = 3\n removePart(part)\n } else if (part.state === 3) {\n // being deleted\n // pass\n } else if (part.state === 2) {\n part.state = 1 // pending: lock\n updateStore(part)\n } else {\n part.state = 0 // clear lock\n }\n }\n })\n }\n\n part.addEventListener('input', function inputChangeListener (_event) {\n // debug.log(\"input changed \"+part.value);\n setPartStyle(part, undefined, true) // grey out - not synced\n log(\n 'Input event state ' + part.state + \" value '\" + part.value + \"'\"\n )\n switch (part.state) {\n case 3: // being deleted\n return\n case 4: // needs to be deleted\n return\n case 2: // needs content updating, we know\n return\n case 1:\n part.state = 2 // lag we need another patch\n return\n case 0:\n case undefined:\n part.state = 1 // being upadted\n updateStore(part)\n }\n }) // listener\n } // addlisteners\n\n // @@ TODO Need to research before as it appears to be used as an Element and a boolean\n const newPartAfter = function (tr1: HTMLTableElement, chunk: String, before?: NotepadElement | boolean) {\n // @@ take chunk and add listeners\n let text: any = kb.any(chunk as any, ns.sioc('content'))\n text = text ? text.value : ''\n const tr = dom.createElement('tr')\n if (before) {\n table.insertBefore(tr, tr1)\n } else {\n // after\n if (tr1 && tr1.nextSibling) {\n table.insertBefore(tr, tr1.nextSibling)\n } else {\n table.appendChild(tr)\n }\n }\n const part: any = tr.appendChild(dom.createElement('input'))\n part.subject = chunk\n part.setAttribute('type', 'text')\n part.value = text\n if (me) {\n setPartStyle(part, '')\n addListeners(part, chunk)\n } else {\n setPartStyle(part, 'color: #222; background-color: #fff')\n log(\"Note can't add listeners - not logged in\")\n }\n return part\n }\n\n /* @@ TODO we need to look at indent, it can be a Number or an Object this doesn't seem correct.\n */\n const newChunk = function (ele?: NotepadElement, before?: NotepadElement) {\n // element of chunk being split\n const kb = store\n let indent: any = 0\n let queueProperty: string | null = null\n let here, prev, next, queue, tr1: any\n\n if (ele) {\n if (ele.tagName.toLowerCase() !== 'input') {\n log('return pressed when current document is: ' + ele.tagName)\n }\n here = ele.subject\n indent = kb.any(here, PAD('indent'))\n indent = indent ? Number(indent.value) : 0\n if (before) {\n prev = kb.any(undefined, PAD('next'), here)\n next = here\n queue = prev\n queueProperty = 'newlinesAfter'\n } else {\n prev = here\n next = kb.any(here, PAD('next'))\n queue = next\n queueProperty = 'newlinesBefore'\n }\n tr1 = ele.parentNode\n } else {\n prev = subject\n next = subject\n tr1 = undefined\n }\n\n const chunk = newThing(padDoc)\n const label = chunk.uri.slice(-4)\n\n const del = [st(prev, PAD('next'), next, padDoc)]\n const ins = [\n st(prev, PAD('next'), chunk, padDoc),\n st(chunk, PAD('next'), next, padDoc),\n st(chunk, ns.dc('author'), me, padDoc),\n st(chunk, ns.sioc('content'), '' as any, padDoc)\n ]\n if (indent > 0) {\n // Do not inherit\n ins.push(st(chunk, PAD('indent'), indent, padDoc))\n }\n\n log(' Fresh chunk ' + label + ' proposed')\n if (!updater) {\n throw new Error('no updater')\n }\n updater.update(del, ins, function (uri, ok, errorBody, _xhr) {\n if (!ok) {\n // alert(\"Error writing new line \" + label + \": \" + errorBody);\n log(' ERROR writing new line ' + label + ': ' + errorBody)\n } else {\n const newPart = newPartAfter(tr1, chunk, before)\n setPartStyle(newPart)\n newPart.focus() // Note this is delayed\n if (queueProperty) {\n log(\n ' Fresh chunk ' +\n label +\n ' updated, queue = ' +\n queue[queueProperty]\n )\n queue[queueProperty] -= 1\n if (queue[queueProperty] > 0) {\n log(\n ' Implementing queued newlines = ' + next.newLinesBefore\n )\n newChunk(newPart, before)\n }\n }\n }\n })\n }\n\n const consistencyCheck = function () {\n const found: { [uri: string]: boolean } = {}\n let failed = 0\n function complain2 (msg) {\n complain(msg)\n failed++\n }\n\n if (!kb.the(subject, PAD('next'))) {\n complain2('No initial next pointer')\n return false // can't do linked list\n }\n // var chunk = kb.the(subject, PAD('next'))\n let prev = subject\n let chunk\n for (; ;) {\n chunk = kb.the(prev, PAD('next'))\n if (!chunk) {\n complain2('No next pointer from ' + prev)\n }\n if (chunk.sameTerm(subject)) {\n break\n }\n prev = chunk\n const label = chunk.uri.split('#')[1]\n if (found[chunk.uri]) {\n complain2('Loop!')\n return false\n }\n\n found[chunk.uri] = true\n let k = kb.each(chunk, PAD('next')).length\n if (k !== 1) {\n complain2('Should be 1 not ' + k + ' next pointer for ' + label)\n }\n\n k = kb.each(chunk, PAD('indent')).length\n if (k > 1) {\n complain2('Should be 0 or 1 not ' + k + ' indent for ' + label)\n }\n\n k = kb.each(chunk, ns.sioc('content')).length\n if (k !== 1) {\n complain2('Should be 1 not ' + k + ' contents for ' + label)\n }\n\n k = kb.each(chunk, ns.dc('author')).length\n if (k !== 1) {\n complain2('Should be 1 not ' + k + ' author for ' + label)\n }\n\n const sts = kb.statementsMatching(undefined, ns.sioc('contents'))\n sts.forEach(function (st) {\n if (!found[st.subject.value]) {\n complain2('Loose chunk! ' + st.subject.value)\n }\n })\n }\n return !failed\n }\n\n // Ensure that the display matches the current state of the\n // @@ TODO really need to refactor this so that we don't need to cast types\n const sync = function () {\n // var first = kb.the(subject, PAD('next'))\n if (kb.each(subject, PAD('next')).length !== 1) {\n const msg =\n 'Pad: Inconsistent data - NEXT pointers: ' +\n kb.each(subject, PAD('next')).length\n log(msg)\n if ((options as notepadOptions).statusArea) {\n ((options as notepadOptions).statusArea as HTMLElement).textContent += msg\n }\n return\n }\n // var last = kb.the(undefined, PAD('previous'), subject)\n // var chunk = first // = kb.the(subject, PAD('next'));\n let row\n\n // First see which of the logical chunks have existing physical manifestations\n const manif: any = []\n // Find which lines correspond to existing chunks\n\n for (\n let chunk = kb.the(subject, PAD('next')) as unknown as any;\n !chunk.sameTerm(subject);\n chunk = kb.the(chunk, PAD('next'))\n ) {\n for (let i = 0; i < table.children.length; i++) {\n const tr: any = table.children[i]\n if (tr.firstChild) {\n if (tr.firstChild.subject.sameTerm(chunk)) {\n manif[chunk.uri] = tr.firstChild\n }\n }\n }\n }\n\n // Remove any deleted lines\n for (let i = table.children.length - 1; i >= 0; i--) {\n row = table.children[i]\n if (!manif[row.firstChild.subject.uri]) {\n table.removeChild(row)\n }\n }\n // Insert any new lines and update old ones\n row = table.firstChild // might be null\n for (\n let chunk = kb.the(subject, PAD('next')) as unknown as any;\n !chunk.sameTerm(subject);\n chunk = kb.the(chunk, PAD('next'))\n ) {\n const text = (kb.any(chunk, ns.sioc('content')) as any).value\n // superstitious -- don't mess with unchanged input fields\n // which may be selected by the user\n if (row && manif[chunk.uri]) {\n const part = row.firstChild\n if (text !== part.value) {\n part.value = text\n }\n setPartStyle(part)\n part.state = 0 // Clear the state machine\n delete part.lastSent // DEBUG ONLY\n row = row.nextSibling\n } else {\n newPartAfter(row, chunk, true) // actually before\n }\n }\n }\n\n // Refresh the DOM tree\n\n const refreshTree = function (root) {\n if (root.refresh) {\n root.refresh()\n return\n }\n for (let i = 0; i < root.children.length; i++) {\n refreshTree(root.children[i])\n }\n }\n\n let reloading = false\n\n const checkAndSync = function () {\n log(' reloaded OK')\n clearStatus()\n if (!consistencyCheck()) {\n complain('CONSITENCY CHECK FAILED')\n } else {\n refreshTree(table)\n }\n }\n\n const reloadAndSync = function () {\n if (reloading) {\n log(' Already reloading - stop')\n return // once only needed\n }\n reloading = true\n let retryTimeout = 1000 // ms\n const tryReload = function () {\n log('try reload - timeout = ' + retryTimeout)\n if (!updater) {\n throw new Error('no updater')\n }\n updater.reload(updater.store, padDoc, function (ok, message, xhr) {\n reloading = false\n if (ok) {\n checkAndSync()\n } else {\n if ((xhr as any).status === 0) {\n complain(\n 'Network error refreshing the pad. Retrying in ' +\n retryTimeout / 1000\n )\n reloading = true\n retryTimeout = retryTimeout * 2\n setTimeout(tryReload, retryTimeout)\n } else {\n complain(\n 'Error ' +\n (xhr as any).status +\n 'refreshing the pad:' +\n message +\n '. Stopped. ' +\n padDoc\n )\n }\n }\n })\n }\n tryReload()\n }\n\n table.refresh = sync // Catch downward propagating refresh events\n table.reloadAndSync = reloadAndSync\n\n if (!me) log('Warning: must be logged in for pad to be edited')\n\n if (exists) {\n log('Existing pad.')\n if (consistencyCheck()) {\n sync()\n if (kb.holds(subject, PAD('next'), subject)) {\n // Empty list untenable\n newChunk() // require at least one line\n }\n } else {\n log((table.textContent = 'Inconsistent data. Abort'))\n }\n } else {\n // Make new pad\n log('No pad exists - making new one.')\n const insertables = [\n st(subject, ns.rdf('type'), PAD('Notepad'), padDoc),\n st(subject, ns.dc('author'), me, padDoc),\n st(subject, ns.dc('created'), new Date() as any, padDoc),\n st(subject, PAD('next'), subject, padDoc)\n ]\n\n if (!updater) {\n throw new Error('no updater')\n }\n updater.update([], insertables, function (uri: string | null | undefined, ok: boolean, errorBody?: string) {\n if (!ok) {\n complain(errorBody || '')\n } else {\n log('Initial pad created')\n newChunk() // Add a first chunck\n // getResults();\n }\n })\n }\n return table\n}\n\n/**\n * Get the chunks of the notepad\n * They are stored in a RDF linked list\n */\n\n// @ignore exporting this only for the unit test\nexport function getChunks (subject: NamedNode, kb: IndexedFormula) {\n const chunks: any[] = []\n for (\n let chunk: any = kb.the(subject, PAD('next'));\n !chunk.sameTerm(subject);\n chunk = kb.the(chunk, PAD('next'))\n ) {\n chunks.push(chunk)\n }\n return chunks\n}\n\n/**\n * Encode content to be put in XML or HTML elements\n */\n// @ignore exporting this only for the unit test\nexport function xmlEncode (str) {\n return str.replace('&', '&').replace('<', '<').replace('>', '>')\n}\n\n/**\n * Convert a notepad to HTML\n * @param { } pad - the notepad\n * @param {store} pad - the data store\n */\nexport function notepadToHTML (pad: any, kb: IndexedFormula) {\n const chunks = getChunks(pad, kb)\n let html = '\\n \\n'\n const title = kb.anyValue(pad, ns.dct('title'))\n if (title) {\n html += ` ${xmlEncode(title)}\\n`\n }\n html += ' \\n \\n'\n let level = 0\n\n function increaseLevel (indent) {\n for (; level < indent; level++) {\n html += '
                                                            \\n'\n }\n }\n\n function decreaseLevel (indent) {\n for (; level > indent; level--) {\n html += '
                                                          \\n'\n }\n }\n chunks.forEach(chunk => {\n const indent = kb.anyJS(chunk, PAD('indent'))\n const rawContent = kb.anyJS(chunk, ns.sioc('content'))\n if (!rawContent) return // seed chunk is dummy\n const content = xmlEncode(rawContent)\n if (indent < 0) { // negative indent levels represent heading levels\n decreaseLevel(0)\n const h = indent >= -3 ? 4 + indent : 1 // -1 -> h4, -2 -> h3\n html += `\\n${content}\\n`\n } else { // >= 0\n if (indent > 0) { // Lists\n decreaseLevel(indent)\n increaseLevel(indent)\n html += `
                                                        • ${content}
                                                        • \\n`\n } else { // indent 0\n decreaseLevel(indent)\n html += `

                                                          ${content}

                                                          \\n`\n }\n }\n }) // foreach chunk\n // At the end decreaseLevel any open ULs\n decreaseLevel(0)\n html += ' \\n\\n'\n return html\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAAiH,SAAA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a,CAAC7G,MAAM,CAAC;QACrBuG,IAAI,UAAAnK,MAAA,CAAU4K,OAAO,WAAQ;MAC/B;IACF;EACF,CAAC,CAAC,EAAC;EACH;EACAH,aAAa,CAAC,CAAC,CAAC;EAChBN,IAAI,IAAI,sBAAsB;EAC9B,OAAOA,IAAI;AACb"} \ No newline at end of file +{"version":3,"file":"pad.js","names":["ns","_interopRequireWildcard","require","_rdflib","_widgets","_utils","_debug","_solidLogic","_participation","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","store","solidLogicSingleton","PAD","Namespace","NotepadElement","_HTMLElement","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","_wrapNativeSuper2","HTMLElement","NotepadPart","_HTMLElement2","_super2","_this2","_len2","_key2","lightColorHash","author","hash","x","split","reduce","b","charCodeAt","uri","toString","notepad","dom","padDoc","subject","me","options","exists","table","createElement","kb","Error","updater","setAttribute","upstreamStatus","downstreamStatus","statusArea","appendChild","tr","complain","message","upstream","undefined","log","errorMessageBlock","clearStatus","_upsteam","innerHTML","setPartStyle","part","colors","pending","chunk","baseStyle","headingCore","headingStyle","any","dc","bgcolor","indent","value","style","removePart","prev","next","sameTerm","del","statementsMatching","ins","st","NamedNode","label","slice","update","ok","errorMessage","response","row","parentNode","before","previousSibling","removeChild","firstChild","focus","status","state","beep","setTimeout","reloadAndSync","res","changeIndent","delta","current","Number","object","newIndent","errorBody","requestDownstreamAction","addListeners","addEventListener","event","queueProperty","queue","keyCode","shiftKey","newChunk","preventDefault","nextSibling","updateStore","old","sioc","newOne","lastSent","xhr","inputChangeListener","_event","newPartAfter","tr1","text","insertBefore","ele","here","tagName","toLowerCase","newThing","push","_xhr","newPart","newLinesBefore","consistencyCheck","found","failed","complain2","msg","the","k","each","sts","forEach","sync","textContent","manif","children","refreshTree","root","refresh","reloading","checkAndSync","retryTimeout","tryReload","reload","holds","insertables","rdf","Date","getChunks","chunks","xmlEncode","str","replace","notepadToHTML","pad","html","title","anyValue","dct","level","increaseLevel","decreaseLevel","anyJS","rawContent","content","h"],"sources":["../src/pad.ts"],"sourcesContent":["/** **************\n * Notepad Widget\n */\n\n/** @module pad\n */\nimport * as ns from './ns'\nimport { Namespace, NamedNode, st, IndexedFormula } from 'rdflib'\nimport { newThing, errorMessageBlock } from './widgets'\nimport { beep } from './utils'\nimport { log } from './debug'\nimport { solidLogicSingleton } from 'solid-logic'\nexport { renderPartipants, participationObject, manageParticipation, recordParticipation } from './participation'\n\nconst store = solidLogicSingleton.store\n\nconst PAD = Namespace('http://www.w3.org/ns/pim/pad#')\n\ntype notepadOptions = {\n statusArea?: HTMLDivElement\n exists?: boolean\n}\n/**\n * @ignore\n */\nclass NotepadElement extends HTMLElement {\n subject?: NamedNode\n}\n/**\n * @ignore\n */\nclass NotepadPart extends HTMLElement {\n subject?: NamedNode | string\n value?: string\n state?: Number\n lastSent?: String\n}\n/** Figure out a random color from my webid\n *\n * @param {NamedNode} author - The author of text being displayed\n * @returns {String} The CSS color generated, constrained to be light for a background color\n */\nexport function lightColorHash (author?: NamedNode): string {\n const hash = function (x) {\n return x.split('').reduce(function (a, b) {\n a = (a << 5) - a + b.charCodeAt(0)\n return a & a\n }, 0)\n }\n return author && author.uri\n ? '#' + ((hash(author.uri) & 0xffffff) | 0xc0c0c0).toString(16)\n : '#ffffff' // c0c0c0 forces pale\n} // no id -> white\n\n/** notepad\n *\n * @param {HTMLDocument} dom - the web page of the browser\n * @param {NamedNode} padDoc - the document into which the particpation should be shown\n * @param {NamedNode} subject - the thing in which participation is happening\n * @param {NamedNode} me - person who is logged into the pod\n * @param {notepadOptions} options - the options that can be passed in consist of statusArea, exists\n */\nexport function notepad (dom: HTMLDocument, padDoc: NamedNode, subject: NamedNode, me: NamedNode, options?: notepadOptions) {\n options = options || {}\n const exists = options.exists\n const table: any = dom.createElement('table')\n const kb = store\n\n if (me && !me.uri) throw new Error('UI.pad.notepad: Invalid userid')\n\n const updater = store.updater\n\n const PAD = Namespace('http://www.w3.org/ns/pim/pad#')\n\n table.setAttribute(\n 'style',\n 'padding: 1em; overflow: auto; resize: horizontal; min-width: 40em;'\n )\n\n let upstreamStatus: HTMLElement | null = null\n let downstreamStatus: HTMLElement | null = null\n\n if (options.statusArea) {\n const t = options.statusArea.appendChild(dom.createElement('table'))\n const tr = t.appendChild(dom.createElement('tr'))\n upstreamStatus = tr.appendChild(dom.createElement('td'))\n downstreamStatus = tr.appendChild(dom.createElement('td'))\n\n if (upstreamStatus) {\n upstreamStatus.setAttribute('style', 'width:50%')\n }\n if (downstreamStatus) {\n downstreamStatus.setAttribute('style', 'width:50%')\n }\n }\n /* @@ TODO want to look into this, it seems upstream should be a boolean and default to false ?\n *\n */\n const complain = function (message: string, upstream: boolean = false) {\n log(message)\n if ((options as notepadOptions).statusArea) {\n ; (upstream ? upstreamStatus as HTMLElement : downstreamStatus as HTMLElement).appendChild(errorMessageBlock(dom, message, 'pink'))\n }\n }\n // @@ TODO need to refactor so that we don't have to type cast\n const clearStatus = function (_upsteam?: any) {\n if ((options as notepadOptions).statusArea) {\n ((options as notepadOptions).statusArea as HTMLElement).innerHTML = ''\n }\n }\n\n const setPartStyle = function (part: NotepadPart, colors?: string, pending?: any) {\n const chunk = part.subject\n colors = colors || ''\n const baseStyle =\n 'font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;'\n const headingCore =\n 'font-family: sans-serif; font-weight: bold; border: none;'\n const headingStyle = [\n 'font-size: 110%; padding-top: 0.5em; padding-bottom: 0.5em; width: 100%;',\n 'font-size: 120%; padding-top: 1em; padding-bottom: 1em; width: 100%;',\n 'font-size: 150%; padding-top: 1em; padding-bottom: 1em; width: 100%;'\n ]\n\n const author = kb.any(chunk as any, ns.dc('author'))\n if (!colors && author) {\n // Hash the user webid for now -- later allow user selection!\n const bgcolor = lightColorHash(author as any)\n colors =\n 'color: ' +\n (pending ? '#888' : 'black') +\n '; background-color: ' +\n bgcolor +\n ';'\n }\n\n // @@ TODO Need to research when this can be an object with the indent stored in value\n // and when the indent is stored as a Number itself, not in an object.\n let indent: any = kb.any(chunk as any, PAD('indent'))\n\n indent = indent ? indent.value : 0\n const style =\n indent >= 0\n ? baseStyle + 'text-indent: ' + indent * 3 + 'em;'\n : headingCore + headingStyle[-1 - indent]\n // ? baseStyle + 'padding-left: ' + (indent * 3) + 'em;'\n part.setAttribute('style', style + colors)\n }\n\n const removePart = function (part: NotepadPart) {\n const chunk = part.subject\n if (!chunk) throw new Error('No chunk for line to be deleted!') // just in case\n const prev: any = kb.any(undefined, PAD('next'), chunk as any)\n const next: any = kb.any(chunk as any, PAD('next'))\n if (prev.sameTerm(subject) && next.sameTerm(subject)) {\n // Last one\n log(\"You can't delete the only line.\")\n return\n }\n\n const del = kb\n .statementsMatching(chunk as any, undefined, undefined, padDoc)\n .concat(kb.statementsMatching(undefined, undefined, chunk as any, padDoc))\n const ins = [st(prev, PAD('next'), next, padDoc)]\n\n // @@ TODO what should we do if chunk is not a NamedNode should we\n // assume then it is a string?\n if (chunk instanceof NamedNode) {\n const label = chunk.uri.slice(-4)\n\n log('Deleting line ' + label)\n }\n if (!updater) {\n throw new Error('have no updater')\n }\n // @@ TODO below you can see that before is redefined and not a boolean\n updater.update(del, ins, function (uri, ok, errorMessage, response) {\n if (ok) {\n const row = part.parentNode\n if (row) {\n const before: any = row.previousSibling\n if (row.parentNode) {\n row.parentNode.removeChild(row)\n }\n // console.log(' deleted line ' + label + ' ok ' + part.value)\n if (before && before.firstChild) {\n // @@ TODO IMPORTANT FOCUS ISN'T A PROPERTY ON A CHILDNODE\n before.firstChild.focus()\n }\n }\n } else if (response && (response as any).status === 409) {\n // Conflict\n setPartStyle(part, 'color: black; background-color: #ffd;') // yellow\n part.state = 0 // Needs downstream refresh\n beep(0.5, 512) // Ooops clash with other person\n setTimeout(function () {\n // Ideally, beep! @@\n reloadAndSync() // Throw away our changes and\n // updater.requestDownstreamAction(padDoc, reloadAndSync)\n }, 1000)\n } else {\n log(' removePart FAILED ' + chunk + ': ' + errorMessage)\n log(\" removePart was deleteing :'\" + del)\n setPartStyle(part, 'color: black; background-color: #fdd;') // failed\n const res = response ? (response as any).status : ' [no response field] '\n complain('Error ' + res + ' saving changes: ' + (errorMessage as any).true) // upstream,\n // updater.requestDownstreamAction(padDoc, reloadAndSync);\n }\n })\n } // removePart\n\n const changeIndent = function (part: NotepadPart, chunk: string, delta) {\n const del = kb.statementsMatching(chunk as any, PAD('indent'))\n const current = del.length ? Number(del[0].object.value) : 0\n if (current + delta < -3) return // limit negative indent\n const newIndent = current + delta\n const ins = st(chunk as any, PAD('indent'), newIndent, padDoc)\n if (!updater) {\n throw new Error('no updater')\n }\n updater.update(del, ins as any, function (uri, ok, errorBody) {\n if (!ok) {\n log(\n \"Indent change FAILED '\" +\n newIndent +\n \"' for \" +\n padDoc +\n ': ' +\n errorBody\n )\n setPartStyle(part, 'color: black; background-color: #fdd;') // failed\n updater.requestDownstreamAction(padDoc, reloadAndSync)\n } else {\n setPartStyle(part) // Implement the indent\n }\n })\n }\n\n // Use this sort of code to split the line when return pressed in the middle @@\n /*\n function doGetCaretPosition doGetCaretPosition (oField) {\n var iCaretPos = 0\n // IE Support\n if (document.selection) {\n // Set focus on the element to avoid IE bug\n oField.focus()\n // To get cursor position, get empty selection range\n var oSel = document.selection.createRange()\n // Move selection start to 0 position\n oSel.moveStart('character', -oField.value.length)\n // The caret position is selection length\n iCaretPos = oSel.text.length\n // Firefox suppor\n } else if (oField.selectionStart || oField.selectionStart === '0') {\n iCaretPos = oField.selectionStart\n }\n // Return results\n return (iCaretPos)\n }\n */\n const addListeners = function (part: any, chunk: any) {\n part.addEventListener('keydown', function (event) {\n if (!updater) {\n throw new Error('no updater')\n }\n\n let queueProperty, queue\n // up 38; down 40; left 37; right 39 tab 9; shift 16; escape 27\n switch (event.keyCode) {\n case 13: // Return\n {\n const before: NotepadElement = event.shiftKey\n log('enter') // Shift-return inserts before -- only way to add to top of pad.\n if (before) {\n queue = kb.any(undefined, PAD('next'), chunk)\n queueProperty = 'newlinesAfter'\n } else {\n queue = kb.any(chunk, PAD('next'))\n queueProperty = 'newlinesBefore'\n }\n queue[queueProperty] = queue[queueProperty] || 0\n queue[queueProperty] += 1\n if (queue[queueProperty] > 1) {\n log(' queueing newline queue = ' + queue[queueProperty])\n return\n }\n log(' go ahead line before ' + queue[queueProperty])\n newChunk(part, before) // was document.activeElement\n break\n }\n case 8: // Delete\n if (part.value.length === 0) {\n log(\n 'Delete key line ' + chunk.uri.slice(-4) + ' state ' + part.state\n )\n\n switch (part.state) {\n case 1: // contents being sent\n case 2: // contents need to be sent again\n part.state = 4 // delete me\n return\n case 3: // being deleted already\n case 4: // already deleme state\n return\n case undefined:\n case 0:\n part.state = 3 // being deleted\n removePart(part)\n event.preventDefault()\n break // continue\n default:\n throw new Error('pad: Unexpected state ' + part)\n }\n }\n break\n case 9: // Tab\n {\n const delta = event.shiftKey ? -1 : 1\n changeIndent(part, chunk, delta)\n event.preventDefault() // default is to highlight next field\n break\n }\n case 27: // ESC\n log('escape')\n updater.requestDownstreamAction(padDoc, reloadAndSync)\n event.preventDefault()\n break\n\n case 38: // Up\n if (part.parentNode.previousSibling) {\n part.parentNode.previousSibling.firstChild.focus()\n event.preventDefault()\n }\n break\n\n case 40: // Down\n if (part.parentNode.nextSibling) {\n part.parentNode.nextSibling.firstChild.focus()\n event.preventDefault()\n }\n break\n\n default:\n }\n })\n\n const updateStore = function (part: NotepadPart) {\n const chunk: any = part.subject\n setPartStyle(part, undefined, true)\n const old = (kb.any(chunk, ns.sioc('content')) as any).value\n const del = [st(chunk, ns.sioc('content'), old, padDoc)]\n let ins\n if (part.value) {\n ins = [st(chunk, ns.sioc('content'), part.value as any, padDoc)]\n }\n const newOne = part.value\n\n // DEBUGGING ONLY\n if (part.lastSent) {\n if (old !== part.lastSent) {\n throw new Error(\n \"Out of order, last sent expected '\" +\n old +\n \"' but found '\" +\n part.lastSent +\n \"'\"\n )\n }\n }\n part.lastSent = newOne\n\n /* console.log(\n ' Patch proposed to ' +\n chunk.uri.slice(-4) +\n \" '\" +\n old +\n \"' -> '\" +\n newOne +\n \"' \"\n ) */\n if (!updater) {\n throw new Error('no updater')\n }\n\n updater.update(del, ins, function (uri, ok, errorBody, xhr) {\n if (!ok) {\n // alert(\"clash \" + errorBody);\n log(\n ' patch FAILED ' +\n (xhr as any).status +\n \" for '\" +\n old +\n \"' -> '\" +\n newOne +\n \"': \" +\n errorBody\n )\n if ((xhr as any).status === 409) {\n // Conflict - @@ we assume someone else\n setPartStyle(part, 'color: black; background-color: #fdd;')\n part.state = 0 // Needs downstream refresh\n beep(0.5, 512) // Ooops clash with other person\n setTimeout(function () {\n updater.requestDownstreamAction(padDoc, reloadAndSync)\n }, 1000)\n } else {\n setPartStyle(part, 'color: black; background-color: #fdd;') // failed pink\n part.state = 0\n complain(\n ' Error ' + (xhr as any).status + ' sending data: ' + errorBody,\n true\n )\n beep(1.0, 128) // Other\n // @@@ Do soemthing more serious with other errors eg auth, etc\n }\n } else {\n clearStatus(true) // upstream\n setPartStyle(part) // synced\n log(\" Patch ok '\" + old + \"' -> '\" + newOne + \"' \")\n\n if (part.state === 4) {\n // delete me\n part.state = 3\n removePart(part)\n } else if (part.state === 3) {\n // being deleted\n // pass\n } else if (part.state === 2) {\n part.state = 1 // pending: lock\n updateStore(part)\n } else {\n part.state = 0 // clear lock\n }\n }\n })\n }\n\n part.addEventListener('input', function inputChangeListener (_event) {\n // debug.log(\"input changed \"+part.value);\n setPartStyle(part, undefined, true) // grey out - not synced\n log(\n 'Input event state ' + part.state + \" value '\" + part.value + \"'\"\n )\n switch (part.state) {\n case 3: // being deleted\n return\n case 4: // needs to be deleted\n return\n case 2: // needs content updating, we know\n return\n case 1:\n part.state = 2 // lag we need another patch\n return\n case 0:\n case undefined:\n part.state = 1 // being upadted\n updateStore(part)\n }\n }) // listener\n } // addlisteners\n\n // @@ TODO Need to research before as it appears to be used as an Element and a boolean\n const newPartAfter = function (tr1: HTMLTableElement, chunk: String, before?: NotepadElement | boolean) {\n // @@ take chunk and add listeners\n let text: any = kb.any(chunk as any, ns.sioc('content'))\n text = text ? text.value : ''\n const tr = dom.createElement('tr')\n if (before) {\n table.insertBefore(tr, tr1)\n } else {\n // after\n if (tr1 && tr1.nextSibling) {\n table.insertBefore(tr, tr1.nextSibling)\n } else {\n table.appendChild(tr)\n }\n }\n const part: any = tr.appendChild(dom.createElement('input'))\n part.subject = chunk\n part.setAttribute('type', 'text')\n part.value = text\n if (me) {\n setPartStyle(part, '')\n addListeners(part, chunk)\n } else {\n setPartStyle(part, 'color: #222; background-color: #fff')\n log(\"Note can't add listeners - not logged in\")\n }\n return part\n }\n\n /* @@ TODO we need to look at indent, it can be a Number or an Object this doesn't seem correct.\n */\n const newChunk = function (ele?: NotepadElement, before?: NotepadElement) {\n // element of chunk being split\n const kb = store\n let indent: any = 0\n let queueProperty: string | null = null\n let here, prev, next, queue, tr1: any\n\n if (ele) {\n if (ele.tagName.toLowerCase() !== 'input') {\n log('return pressed when current document is: ' + ele.tagName)\n }\n here = ele.subject\n indent = kb.any(here, PAD('indent'))\n indent = indent ? Number(indent.value) : 0\n if (before) {\n prev = kb.any(undefined, PAD('next'), here)\n next = here\n queue = prev\n queueProperty = 'newlinesAfter'\n } else {\n prev = here\n next = kb.any(here, PAD('next'))\n queue = next\n queueProperty = 'newlinesBefore'\n }\n tr1 = ele.parentNode\n } else {\n prev = subject\n next = subject\n tr1 = undefined\n }\n\n const chunk = newThing(padDoc)\n const label = chunk.uri.slice(-4)\n\n const del = [st(prev, PAD('next'), next, padDoc)]\n const ins = [\n st(prev, PAD('next'), chunk, padDoc),\n st(chunk, PAD('next'), next, padDoc),\n st(chunk, ns.dc('author'), me, padDoc),\n st(chunk, ns.sioc('content'), '' as any, padDoc)\n ]\n if (indent > 0) {\n // Do not inherit\n ins.push(st(chunk, PAD('indent'), indent, padDoc))\n }\n\n log(' Fresh chunk ' + label + ' proposed')\n if (!updater) {\n throw new Error('no updater')\n }\n updater.update(del, ins, function (uri, ok, errorBody, _xhr) {\n if (!ok) {\n // alert(\"Error writing new line \" + label + \": \" + errorBody);\n log(' ERROR writing new line ' + label + ': ' + errorBody)\n } else {\n const newPart = newPartAfter(tr1, chunk, before)\n setPartStyle(newPart)\n newPart.focus() // Note this is delayed\n if (queueProperty) {\n log(\n ' Fresh chunk ' +\n label +\n ' updated, queue = ' +\n queue[queueProperty]\n )\n queue[queueProperty] -= 1\n if (queue[queueProperty] > 0) {\n log(\n ' Implementing queued newlines = ' + next.newLinesBefore\n )\n newChunk(newPart, before)\n }\n }\n }\n })\n }\n\n const consistencyCheck = function () {\n const found: { [uri: string]: boolean } = {}\n let failed = 0\n function complain2 (msg) {\n complain(msg)\n failed++\n }\n\n if (!kb.the(subject, PAD('next'))) {\n complain2('No initial next pointer')\n return false // can't do linked list\n }\n // var chunk = kb.the(subject, PAD('next'))\n let prev = subject\n let chunk\n for (; ;) {\n chunk = kb.the(prev, PAD('next'))\n if (!chunk) {\n complain2('No next pointer from ' + prev)\n }\n if (chunk.sameTerm(subject)) {\n break\n }\n prev = chunk\n const label = chunk.uri.split('#')[1]\n if (found[chunk.uri]) {\n complain2('Loop!')\n return false\n }\n\n found[chunk.uri] = true\n let k = kb.each(chunk, PAD('next')).length\n if (k !== 1) {\n complain2('Should be 1 not ' + k + ' next pointer for ' + label)\n }\n\n k = kb.each(chunk, PAD('indent')).length\n if (k > 1) {\n complain2('Should be 0 or 1 not ' + k + ' indent for ' + label)\n }\n\n k = kb.each(chunk, ns.sioc('content')).length\n if (k !== 1) {\n complain2('Should be 1 not ' + k + ' contents for ' + label)\n }\n\n k = kb.each(chunk, ns.dc('author')).length\n if (k !== 1) {\n complain2('Should be 1 not ' + k + ' author for ' + label)\n }\n\n const sts = kb.statementsMatching(undefined, ns.sioc('contents'))\n sts.forEach(function (st) {\n if (!found[st.subject.value]) {\n complain2('Loose chunk! ' + st.subject.value)\n }\n })\n }\n return !failed\n }\n\n // Ensure that the display matches the current state of the\n // @@ TODO really need to refactor this so that we don't need to cast types\n const sync = function () {\n // var first = kb.the(subject, PAD('next'))\n if (kb.each(subject, PAD('next')).length !== 1) {\n const msg =\n 'Pad: Inconsistent data - NEXT pointers: ' +\n kb.each(subject, PAD('next')).length\n log(msg)\n if ((options as notepadOptions).statusArea) {\n ((options as notepadOptions).statusArea as HTMLElement).textContent += msg\n }\n return\n }\n // var last = kb.the(undefined, PAD('previous'), subject)\n // var chunk = first // = kb.the(subject, PAD('next'));\n let row\n\n // First see which of the logical chunks have existing physical manifestations\n const manif: any = []\n // Find which lines correspond to existing chunks\n\n for (\n let chunk = kb.the(subject, PAD('next')) as unknown as any;\n !chunk.sameTerm(subject);\n chunk = kb.the(chunk, PAD('next'))\n ) {\n for (let i = 0; i < table.children.length; i++) {\n const tr: any = table.children[i]\n if (tr.firstChild) {\n if (tr.firstChild.subject.sameTerm(chunk)) {\n manif[chunk.uri] = tr.firstChild\n }\n }\n }\n }\n\n // Remove any deleted lines\n for (let i = table.children.length - 1; i >= 0; i--) {\n row = table.children[i]\n if (!manif[row.firstChild.subject.uri]) {\n table.removeChild(row)\n }\n }\n // Insert any new lines and update old ones\n row = table.firstChild // might be null\n for (\n let chunk = kb.the(subject, PAD('next')) as unknown as any;\n !chunk.sameTerm(subject);\n chunk = kb.the(chunk, PAD('next'))\n ) {\n const text = (kb.any(chunk, ns.sioc('content')) as any).value\n // superstitious -- don't mess with unchanged input fields\n // which may be selected by the user\n if (row && manif[chunk.uri]) {\n const part = row.firstChild\n if (text !== part.value) {\n part.value = text\n }\n setPartStyle(part)\n part.state = 0 // Clear the state machine\n delete part.lastSent // DEBUG ONLY\n row = row.nextSibling\n } else {\n newPartAfter(row, chunk, true) // actually before\n }\n }\n }\n\n // Refresh the DOM tree\n\n const refreshTree = function (root) {\n if (root.refresh) {\n root.refresh()\n return\n }\n for (let i = 0; i < root.children.length; i++) {\n refreshTree(root.children[i])\n }\n }\n\n let reloading = false\n\n const checkAndSync = function () {\n log(' reloaded OK')\n clearStatus()\n if (!consistencyCheck()) {\n complain('CONSITENCY CHECK FAILED')\n } else {\n refreshTree(table)\n }\n }\n\n const reloadAndSync = function () {\n if (reloading) {\n log(' Already reloading - stop')\n return // once only needed\n }\n reloading = true\n let retryTimeout = 1000 // ms\n const tryReload = function () {\n log('try reload - timeout = ' + retryTimeout)\n if (!updater) {\n throw new Error('no updater')\n }\n updater.reload(updater.store, padDoc, function (ok, message, xhr) {\n reloading = false\n if (ok) {\n checkAndSync()\n } else {\n if ((xhr as any).status === 0) {\n complain(\n 'Network error refreshing the pad. Retrying in ' +\n retryTimeout / 1000\n )\n reloading = true\n retryTimeout = retryTimeout * 2\n setTimeout(tryReload, retryTimeout)\n } else {\n complain(\n 'Error ' +\n (xhr as any).status +\n 'refreshing the pad:' +\n message +\n '. Stopped. ' +\n padDoc\n )\n }\n }\n })\n }\n tryReload()\n }\n\n table.refresh = sync // Catch downward propagating refresh events\n table.reloadAndSync = reloadAndSync\n\n if (!me) log('Warning: must be logged in for pad to be edited')\n\n if (exists) {\n log('Existing pad.')\n if (consistencyCheck()) {\n sync()\n if (kb.holds(subject, PAD('next'), subject)) {\n // Empty list untenable\n newChunk() // require at least one line\n }\n } else {\n log((table.textContent = 'Inconsistent data. Abort'))\n }\n } else {\n // Make new pad\n log('No pad exists - making new one.')\n const insertables = [\n st(subject, ns.rdf('type'), PAD('Notepad'), padDoc),\n st(subject, ns.dc('author'), me, padDoc),\n st(subject, ns.dc('created'), new Date() as any, padDoc),\n st(subject, PAD('next'), subject, padDoc)\n ]\n\n if (!updater) {\n throw new Error('no updater')\n }\n updater.update([], insertables, function (uri: string | null | undefined, ok: boolean, errorBody?: string) {\n if (!ok) {\n complain(errorBody || '')\n } else {\n log('Initial pad created')\n newChunk() // Add a first chunck\n // getResults();\n }\n })\n }\n return table\n}\n\n/**\n * Get the chunks of the notepad\n * They are stored in a RDF linked list\n */\n\n// @ignore exporting this only for the unit test\nexport function getChunks (subject: NamedNode, kb: IndexedFormula) {\n const chunks: any[] = []\n for (\n let chunk: any = kb.the(subject, PAD('next'));\n !chunk.sameTerm(subject);\n chunk = kb.the(chunk, PAD('next'))\n ) {\n chunks.push(chunk)\n }\n return chunks\n}\n\n/**\n * Encode content to be put in XML or HTML elements\n */\n// @ignore exporting this only for the unit test\nexport function xmlEncode (str) {\n return str.replace('&', '&').replace('<', '<').replace('>', '>')\n}\n\n/**\n * Convert a notepad to HTML\n * @param { } pad - the notepad\n * @param {store} pad - the data store\n */\nexport function notepadToHTML (pad: any, kb: IndexedFormula) {\n const chunks = getChunks(pad, kb)\n let html = '\\n \\n'\n const title = kb.anyValue(pad, ns.dct('title'))\n if (title) {\n html += ` ${xmlEncode(title)}\\n`\n }\n html += ' \\n \\n'\n let level = 0\n\n function increaseLevel (indent) {\n for (; level < indent; level++) {\n html += '
                                                            \\n'\n }\n }\n\n function decreaseLevel (indent) {\n for (; level > indent; level--) {\n html += '
                                                          \\n'\n }\n }\n chunks.forEach(chunk => {\n const indent = kb.anyJS(chunk, PAD('indent'))\n const rawContent = kb.anyJS(chunk, ns.sioc('content'))\n if (!rawContent) return // seed chunk is dummy\n const content = xmlEncode(rawContent)\n if (indent < 0) { // negative indent levels represent heading levels\n decreaseLevel(0)\n const h = indent >= -3 ? 4 + indent : 1 // -1 -> h4, -2 -> h3\n html += `\\n${content}\\n`\n } else { // >= 0\n if (indent > 0) { // Lists\n decreaseLevel(indent)\n increaseLevel(indent)\n html += `
                                                        • ${content}
                                                        • \\n`\n } else { // indent 0\n decreaseLevel(indent)\n html += `

                                                          ${content}

                                                          \\n`\n }\n }\n }) // foreach chunk\n // At the end decreaseLevel any open ULs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GAAG,CAAC,EAAC;MACxCuG,IAAI,WAAAnK,MAAA,CAAW6K,CAAC,OAAA7K,MAAA,CAAI4K,OAAO,SAAA5K,MAAA,CAAM6K,CAAC,QAAK;IACzC,CAAC,MAAM;MAAE;MACP,IAAIjH,MAAM,GAAG,CAAC,EAAE;QAAE;QAChB6G,aAAa,CAAC7G,MAAM,CAAC;QACrB4G,aAAa,CAAC5G,MAAM,CAAC;QACrBuG,IAAI,WAAAnK,MAAA,CAAW4K,OAAO,YAAS;MACjC,CAAC,MAAM;QAAE;QACPH,aAAa,CAAC7G,MAAM,CAAC;QACrBuG,IAAI,UAAAnK,MAAA,CAAU4K,OAAO,WAAQ;MAC/B;IACF;EACF,CAAC,CAAC,EAAC;EACH;EACAH,aAAa,CAAC,CAAC,CAAC;EAChBN,IAAI,IAAI,sBAAsB;EAC9B,OAAOA,IAAI;AACb"} \ No newline at end of file diff --git a/lib/participation.js b/lib/participation.js index d299402d..90d881e8 100644 --- a/lib/participation.js +++ b/lib/participation.js @@ -32,7 +32,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o = function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* Manage a UI for the particpation of a person in any thing - */ // import { currentUser } from './authn/authn' +*/ // import { currentUser } from './authn/authn' var ParticipationTableElement = /*#__PURE__*/function (_HTMLTableElement) { (0, _inherits2["default"])(ParticipationTableElement, _HTMLTableElement); var _super = _createSuper(ParticipationTableElement); @@ -137,7 +137,6 @@ function participationObject(subject, padDoc, me) { resolve(candidates[0][1]); // throw new Error('Multiple records of your participation') } - if (parps.length) { // If I am not already recorded resolve(parps[0]); // returns the particpation object @@ -192,7 +191,6 @@ function recordParticipation(subject, padDoc, refreshable) { } // UI.pad.renderPartipants(dom, table, padDoc, subject, me, options) }); - return participation; } } @@ -217,7 +215,6 @@ function manageParticipation(dom, container, padDoc, subject, me, options) { } catch (e) { container.appendChild((0, _widgets.errorMessageBlock)(dom, 'Error recording your partipation: ' + e)); // Clean up? } - return table; } //# sourceMappingURL=participation.js.map \ No newline at end of file diff --git a/lib/participation.js.map b/lib/participation.js.map index a1a94104..abc0f167 100644 --- a/lib/participation.js.map +++ b/lib/participation.js.map @@ -1 +1 @@ -{"version":3,"file":"participation.js","names":["_debug","_interopRequireWildcard","require","debug","_rdflib","ns","_widgets","_utils","_pad","_solidLogic","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","ParticipationTableElement","_HTMLTableElement","_inherits2","_super","_this","_classCallCheck2","_len","args","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","_wrapNativeSuper2","HTMLTableElement","store","solidLogicSingleton","renderPartipants","dom","table","unused1","subject","unused2","options","setAttribute","newRowForParticpation","parp","person","any","wf","tr","createElement","textContent","bg","anyValue","ui","block","personTR","appendChild","td","insertBefore","firstChild","syncTable","parps","each","map","log","cal","sort","participations","p","syncTableToArray","refresh","participationObject","padDoc","me","Promise","resolve","reject","Error","filter","pn","holds","candidates","_iterator","_step","participation","date","push","warn","newThing","ins","st","Date","lightColorHash","updater","update","uri","ok","errorMessage","recordParticipation","refreshable","authn","currentUser","editable","manageParticipation","container","_participation","errorMessageBlock"],"sources":["../src/participation.ts"],"sourcesContent":["/* Manage a UI for the particpation of a person in any thing\n*/\n\n// import { currentUser } from './authn/authn'\nimport * as debug from './debug'\nimport { LiveStore, NamedNode, st, UpdateManager } from 'rdflib'\nimport * as ns from './ns'\nimport { personTR, newThing, errorMessageBlock } from './widgets'\nimport { syncTableToArray } from './utils'\nimport { lightColorHash } from './pad'\nimport { log } from './debug'\nimport { solidLogicSingleton, authn } from 'solid-logic'\n\ntype ParticipationOptions = {\n deleteFunction?: () => {}\n link?: string\n draggable?: boolean\n}\n\nclass ParticipationTableElement extends HTMLTableElement {\n refresh?: () => void\n}\nconst store = solidLogicSingleton.store as LiveStore\n\n/** Manage participation in this session\n*\n* @param {Document} dom - the web page loaded into the browser\n* @param {HTMLTableElement} table - the table element\n* @param {NamedNode} unused1/document - the document to render (this argument is no longer used, but left in for backwards compatibility)\n* @param {NamedNode} subject - the thing in which the participation is happening\n* @param {NamedNode} unused2/me - user that is logged into the pod (this argument is no longer used, but left in for backwards compatibility)\n* @param {ParticipationOptions} options - the options that can be passed in are deleteFunction, link, and draggable these are used by the personTR button\n*/\nexport function renderPartipants (dom: HTMLDocument, table: ParticipationTableElement, unused1: NamedNode, subject: NamedNode, unused2: NamedNode, options: ParticipationOptions) {\n table.setAttribute('style', 'margin: 0.8em;')\n\n const newRowForParticpation = function (parp) {\n const person = store.any(parp, ns.wf('participant'))\n\n let tr\n if (!person) {\n tr = dom.createElement('tr')\n tr.textContent = '???' // Don't crash - invalid part'n entry\n return tr\n }\n const bg = store.anyValue(parp, ns.ui('backgroundColor')) || 'white'\n\n const block = dom.createElement('div')\n block.setAttribute(\n 'style',\n 'height: 1.5em; width: 1.5em; margin: 0.3em; border 0.01em solid #888; background-color: ' +\n bg\n )\n tr = personTR(dom, null, person, options)\n table.appendChild(tr)\n const td = dom.createElement('td')\n td.setAttribute('style', 'vertical-align: middle;')\n td.appendChild(block)\n tr.insertBefore(td, tr.firstChild)\n return tr\n }\n\n const syncTable = function () {\n const parps = store.each(subject, ns.wf('participation')).map(function (parp) {\n log('in participants')\n return [store.anyValue(parp as any, ns.cal('dtstart')) || '9999-12-31', parp]\n })\n parps.sort() // List in order of joining\n const participations = parps.map(function (p) {\n return p[1]\n })\n syncTableToArray(table, participations, newRowForParticpation)\n }\n table.refresh = syncTable\n syncTable()\n return table\n}\n\n/** Record, or find old, Particpation object\n *\n * A particpaption object is a place to record things specifically about\n * subject and the user, such as preferences, start of membership, etc\n * @param {NamedNode} subject - the thing in which the participation is happening\n * @param {NamedNode} document - where to record the data\n * @param {NamedNode} me - the logged in user\n *\n */\nexport function participationObject (subject: NamedNode, padDoc: NamedNode, me: NamedNode) {\n return new Promise(function (resolve, reject) {\n if (!me) {\n throw new Error('No user id')\n }\n\n const parps = store.each(subject, ns.wf('participation')).filter(function (pn) {\n return store.holds(pn, ns.wf('participant'), me)\n })\n if (parps.length > 1) { // This can happen. https://github.com/solidos/chat-pane/issues/71\n const candidates: (string | NamedNode) [][] = []\n for (const participation of parps) {\n const date = store.anyValue(participation as NamedNode, ns.cal('dtstart'))\n if (date) {\n candidates.push([date, participation as NamedNode])\n }\n }\n candidates.sort() // Pick the earliest\n // @@ Possibly, for extra credit, delete the others, if we have write access\n debug.warn('Multiple particpation objects, picking earliest, in ' + padDoc)\n resolve(candidates[0][1])\n // throw new Error('Multiple records of your participation')\n }\n if (parps.length) {\n // If I am not already recorded\n resolve(parps[0]) // returns the particpation object\n } else {\n const participation = newThing(padDoc)\n const ins = [\n st(subject, ns.wf('participation'), participation, padDoc),\n\n st(participation, ns.wf('participant'), me, padDoc),\n st(participation, ns.cal('dtstart'), new Date() as any, padDoc),\n st(\n participation,\n ns.ui('backgroundColor'),\n lightColorHash(me) as any,\n padDoc\n )\n ];\n (store.updater as UpdateManager).update([], ins, function (uri: string | null | undefined, ok: boolean, errorMessage?: string) {\n if (!ok) {\n reject(new Error('Error recording your partipation: ' + errorMessage))\n } else {\n resolve(participation)\n }\n })\n resolve(participation)\n }\n })\n}\n\n/** Record my participation and display participants\n *\n * @param {NamedNode} subject - the thing in which participation is happening\n * @param {NamedNode} padDoc - the document into which the particpation should be recorded\n * @param {DOMNode} refreshable - a DOM element whose refresh() is to be called if the change works\n *\n */\nexport function recordParticipation (subject: NamedNode, padDoc: NamedNode, refreshable: any) {\n const me = authn.currentUser()\n if (!me) return // Not logged in\n\n const parps = store.each(subject, ns.wf('participation')).filter(function (pn) {\n return store.holds(pn, ns.wf('participant'), me)\n })\n if (parps.length > 1) {\n throw new Error('Multiple records of your participation')\n }\n if (parps.length) {\n // If I am not already recorded\n return parps[0] // returns the particpation object\n } else {\n if (!(store.updater as UpdateManager).editable(padDoc)) {\n debug.log('Not recording participation, as no write acesss as ' + me + ' to ' + padDoc)\n return null\n }\n const participation = newThing(padDoc)\n const ins = [\n st(subject, ns.wf('participation'), participation, padDoc),\n\n st(participation, ns.wf('participant'), me, padDoc),\n st(participation, ns.cal('dtstart'), new Date() as any, padDoc),\n st(\n participation,\n ns.ui('backgroundColor'),\n lightColorHash(me) as any,\n padDoc\n )\n ];\n (store.updater as UpdateManager).update([], ins, function (uri: string | null | undefined, ok: boolean, errorMessage?: string) {\n if (!ok) {\n throw new Error('Error recording your partipation: ' + errorMessage)\n }\n if (refreshable && refreshable.refresh) {\n refreshable.refresh()\n }\n // UI.pad.renderPartipants(dom, table, padDoc, subject, me, options)\n })\n return participation\n }\n}\n\n/** Record my participation and display participants\n*\n* @param {Document} dom - the web page loaded into the browser\n* @param {HTMLDivElement} container - the container element where the participants should be displayed\n* @param {NamedNode} document - the document into which the particpation should be shown\n* @param {NamedNode} subject - the thing in which participation is happening\n* @param {NamedNode} me - the logged in user\n* @param {ParticipationOptions} options - the options that can be passed in are deleteFunction, link, and draggable these are used by the personTR button\n*\n*/\nexport function manageParticipation (\n dom: Document,\n container: HTMLDivElement,\n padDoc: NamedNode,\n subject: NamedNode,\n me: NamedNode,\n options: ParticipationOptions\n) {\n const table = dom.createElement('table')\n container.appendChild(table)\n renderPartipants(dom, table, padDoc, subject, me, options)\n let _participation\n try {\n _participation = recordParticipation(subject, padDoc, table)\n } catch (e) {\n container.appendChild(\n errorMessageBlock(\n dom,\n 'Error recording your partipation: ' + e\n )\n ) // Clean up?\n }\n return table\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgC,IAAAC,KAAA,GAAAH,MAAA;AAChC,IAAAI,OAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAEA,IAAAO,WAAA,GAAAP,OAAA;AAAwD,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,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GAAGoB,YAAY,CAAC;MACtE;MACA,IAAIE,WAAW,IAAIA,WAAW,CAAC7B,OAAO,EAAE;QACtC6B,WAAW,CAAC7B,OAAO,CAAC,CAAC;MACvB;MACA;IACF,CAAC,CAAC;;IACF,OAAOc,aAAa;EACtB;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmB,mBAAmBA,CACjCnE,GAAa,EACboE,SAAyB,EACzBhC,MAAiB,EACjBjC,OAAkB,EAClBkC,EAAa,EACbhC,OAA6B,EAC7B;EACA,IAAMJ,KAAK,GAAGD,GAAG,CAACa,aAAa,CAAC,OAAO,CAAC;EACxCuD,SAAS,CAAChD,WAAW,CAACnB,KAAK,CAAC;EAC5BF,gBAAgB,CAACC,GAAG,EAAEC,KAAK,EAAEmC,MAAM,EAAEjC,OAAO,EAAEkC,EAAE,EAAEhC,OAAO,CAAC;EAC1D,IAAIgE,cAAc;EAClB,IAAI;IACFA,cAAc,GAAGP,mBAAmB,CAAC3D,OAAO,EAAEiC,MAAM,EAAEnC,KAAK,CAAC;EAC9D,CAAC,CAAC,OAAO3F,CAAC,EAAE;IACV8J,SAAS,CAAChD,WAAW,CACnB,IAAAkD,0BAAiB,EACftE,GAAG,EACH,oCAAoC,GAAG1F,CACzC,CACF,CAAC,EAAC;EACJ;;EACA,OAAO2F,KAAK;AACd"} \ No newline at end of file +{"version":3,"file":"participation.js","names":["_debug","_interopRequireWildcard","require","debug","_rdflib","ns","_widgets","_utils","_pad","_solidLogic","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","ParticipationTableElement","_HTMLTableElement","_inherits2","_super","_this","_classCallCheck2","_len","args","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","_wrapNativeSuper2","HTMLTableElement","store","solidLogicSingleton","renderPartipants","dom","table","unused1","subject","unused2","options","setAttribute","newRowForParticpation","parp","person","any","wf","tr","createElement","textContent","bg","anyValue","ui","block","personTR","appendChild","td","insertBefore","firstChild","syncTable","parps","each","map","log","cal","sort","participations","p","syncTableToArray","refresh","participationObject","padDoc","me","Promise","resolve","reject","Error","filter","pn","holds","candidates","_iterator","_step","participation","date","push","warn","newThing","ins","st","Date","lightColorHash","updater","update","uri","ok","errorMessage","recordParticipation","refreshable","authn","currentUser","editable","manageParticipation","container","_participation","errorMessageBlock"],"sources":["../src/participation.ts"],"sourcesContent":["/* Manage a UI for the particpation of a person in any thing\n*/\n\n// import { currentUser } from './authn/authn'\nimport * as debug from './debug'\nimport { LiveStore, NamedNode, st, UpdateManager } from 'rdflib'\nimport * as ns from './ns'\nimport { personTR, newThing, errorMessageBlock } from './widgets'\nimport { syncTableToArray } from './utils'\nimport { lightColorHash } from './pad'\nimport { log } from './debug'\nimport { solidLogicSingleton, authn } from 'solid-logic'\n\ntype ParticipationOptions = {\n deleteFunction?: () => {}\n link?: string\n draggable?: boolean\n}\n\nclass ParticipationTableElement extends HTMLTableElement {\n refresh?: () => void\n}\nconst store = solidLogicSingleton.store as LiveStore\n\n/** Manage participation in this session\n*\n* @param {Document} dom - the web page loaded into the browser\n* @param {HTMLTableElement} table - the table element\n* @param {NamedNode} unused1/document - the document to render (this argument is no longer used, but left in for backwards compatibility)\n* @param {NamedNode} subject - the thing in which the participation is happening\n* @param {NamedNode} unused2/me - user that is logged into the pod (this argument is no longer used, but left in for backwards compatibility)\n* @param {ParticipationOptions} options - the options that can be passed in are deleteFunction, link, and draggable these are used by the personTR button\n*/\nexport function renderPartipants (dom: HTMLDocument, table: ParticipationTableElement, unused1: NamedNode, subject: NamedNode, unused2: NamedNode, options: ParticipationOptions) {\n table.setAttribute('style', 'margin: 0.8em;')\n\n const newRowForParticpation = function (parp) {\n const person = store.any(parp, ns.wf('participant'))\n\n let tr\n if (!person) {\n tr = dom.createElement('tr')\n tr.textContent = '???' // Don't crash - invalid part'n entry\n return tr\n }\n const bg = store.anyValue(parp, ns.ui('backgroundColor')) || 'white'\n\n const block = dom.createElement('div')\n block.setAttribute(\n 'style',\n 'height: 1.5em; width: 1.5em; margin: 0.3em; border 0.01em solid #888; background-color: ' +\n bg\n )\n tr = personTR(dom, null, person, options)\n table.appendChild(tr)\n const td = dom.createElement('td')\n td.setAttribute('style', 'vertical-align: middle;')\n td.appendChild(block)\n tr.insertBefore(td, tr.firstChild)\n return tr\n }\n\n const syncTable = function () {\n const parps = store.each(subject, ns.wf('participation')).map(function (parp) {\n log('in participants')\n return [store.anyValue(parp as any, ns.cal('dtstart')) || '9999-12-31', parp]\n })\n parps.sort() // List in order of joining\n const participations = parps.map(function (p) {\n return p[1]\n })\n syncTableToArray(table, participations, newRowForParticpation)\n }\n table.refresh = syncTable\n syncTable()\n return table\n}\n\n/** Record, or find old, Particpation object\n *\n * A particpaption object is a place to record things specifically about\n * subject and the user, such as preferences, start of membership, etc\n * @param {NamedNode} subject - the thing in which the participation is happening\n * @param {NamedNode} document - where to record the data\n * @param {NamedNode} me - the logged in user\n *\n */\nexport function participationObject (subject: NamedNode, padDoc: NamedNode, me: NamedNode) {\n return new Promise(function (resolve, reject) {\n if (!me) {\n throw new Error('No user id')\n }\n\n const parps = store.each(subject, ns.wf('participation')).filter(function (pn) {\n return store.holds(pn, ns.wf('participant'), me)\n })\n if (parps.length > 1) { // This can happen. https://github.com/solidos/chat-pane/issues/71\n const candidates: (string | NamedNode) [][] = []\n for (const participation of parps) {\n const date = store.anyValue(participation as NamedNode, ns.cal('dtstart'))\n if (date) {\n candidates.push([date, participation as NamedNode])\n }\n }\n candidates.sort() // Pick the earliest\n // @@ Possibly, for extra credit, delete the others, if we have write access\n debug.warn('Multiple particpation objects, picking earliest, in ' + padDoc)\n resolve(candidates[0][1])\n // throw new Error('Multiple records of your participation')\n }\n if (parps.length) {\n // If I am not already recorded\n resolve(parps[0]) // returns the particpation object\n } else {\n const participation = newThing(padDoc)\n const ins = [\n st(subject, ns.wf('participation'), participation, padDoc),\n\n st(participation, ns.wf('participant'), me, padDoc),\n st(participation, ns.cal('dtstart'), new Date() as any, padDoc),\n st(\n participation,\n ns.ui('backgroundColor'),\n lightColorHash(me) as any,\n padDoc\n )\n ];\n (store.updater as UpdateManager).update([], ins, function (uri: string | null | undefined, ok: boolean, errorMessage?: string) {\n if (!ok) {\n reject(new Error('Error recording your partipation: ' + errorMessage))\n } else {\n resolve(participation)\n }\n })\n resolve(participation)\n }\n })\n}\n\n/** Record my participation and display participants\n *\n * @param {NamedNode} subject - the thing in which participation is happening\n * @param {NamedNode} padDoc - the document into which the particpation should be recorded\n * @param {DOMNode} refreshable - a DOM element whose refresh() is to be called if the change works\n *\n */\nexport function recordParticipation (subject: NamedNode, padDoc: NamedNode, refreshable: any) {\n const me = authn.currentUser()\n if (!me) return // Not logged in\n\n const parps = store.each(subject, ns.wf('participation')).filter(function (pn) {\n return store.holds(pn, ns.wf('participant'), me)\n })\n if (parps.length > 1) {\n throw new Error('Multiple records of your participation')\n }\n if (parps.length) {\n // If I am not already recorded\n return parps[0] // returns the particpation object\n } else {\n if (!(store.updater as UpdateManager).editable(padDoc)) {\n debug.log('Not recording participation, as no write acesss as ' + me + ' to ' + padDoc)\n return null\n }\n const participation = newThing(padDoc)\n const ins = [\n st(subject, ns.wf('participation'), participation, padDoc),\n\n st(participation, ns.wf('participant'), me, padDoc),\n st(participation, ns.cal('dtstart'), new Date() as any, padDoc),\n st(\n participation,\n ns.ui('backgroundColor'),\n lightColorHash(me) as any,\n padDoc\n )\n ];\n (store.updater as UpdateManager).update([], ins, function (uri: string | null | undefined, ok: boolean, errorMessage?: string) {\n if (!ok) {\n throw new Error('Error recording your partipation: ' + errorMessage)\n }\n if (refreshable && refreshable.refresh) {\n refreshable.refresh()\n }\n // UI.pad.renderPartipants(dom, table, padDoc, subject, me, options)\n })\n return participation\n }\n}\n\n/** Record my participation and display participants\n*\n* @param {Document} dom - the web page loaded into the browser\n* @param {HTMLDivElement} container - the container element where the participants should be displayed\n* @param {NamedNode} document - the document into which the particpation should be shown\n* @param {NamedNode} subject - the thing in which participation is happening\n* @param {NamedNode} me - the logged in user\n* @param {ParticipationOptions} options - the options that can be passed in are deleteFunction, link, and draggable these are used by the personTR button\n*\n*/\nexport function manageParticipation (\n dom: Document,\n container: HTMLDivElement,\n padDoc: NamedNode,\n subject: NamedNode,\n me: NamedNode,\n options: ParticipationOptions\n) {\n const table = dom.createElement('table')\n container.appendChild(table)\n renderPartipants(dom, table, padDoc, subject, me, options)\n let _participation\n try {\n _participation = recordParticipation(subject, padDoc, table)\n } catch (e) {\n container.appendChild(\n errorMessageBlock(\n dom,\n 'Error recording your partipation: ' + e\n )\n ) // Clean up?\n }\n return table\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgC,IAAAC,KAAA,GAAAH,MAAA;AAChC,IAAAI,OAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAEA,IAAAO,WAAA,GAAAP,OAAA;AAAwD,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA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AiB,CAAC,EACxB,IAAAuC,mBAAc,EAACnB,EAAE,CAAC,EAClBD,MACF,CAAC,CACF;IACAvC,KAAK,CAAC4D,OAAO,CAAmBC,MAAM,CAAC,EAAE,EAAEL,GAAG,EAAE,UAAUM,GAA8B,EAAEC,EAAW,EAAEC,YAAqB,EAAE;MAC7H,IAAI,CAACD,EAAE,EAAE;QACP,MAAM,IAAInB,KAAK,CAAC,oCAAoC,GAAGoB,YAAY,CAAC;MACtE;MACA,IAAIE,WAAW,IAAIA,WAAW,CAAC7B,OAAO,EAAE;QACtC6B,WAAW,CAAC7B,OAAO,CAAC,CAAC;MACvB;MACA;IACF,CAAC,CAAC;IACF,OAAOc,aAAa;EACtB;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmB,mBAAmBA,CACjCnE,GAAa,EACboE,SAAyB,EACzBhC,MAAiB,EACjBjC,OAAkB,EAClBkC,EAAa,EACbhC,OAA6B,EAC7B;EACA,IAAMJ,KAAK,GAAGD,GAAG,CAACa,aAAa,CAAC,OAAO,CAAC;EACxCuD,SAAS,CAAChD,WAAW,CAACnB,KAAK,CAAC;EAC5BF,gBAAgB,CAACC,GAAG,EAAEC,KAAK,EAAEmC,MAAM,EAAEjC,OAAO,EAAEkC,EAAE,EAAEhC,OAAO,CAAC;EAC1D,IAAIgE,cAAc;EAClB,IAAI;IACFA,cAAc,GAAGP,mBAAmB,CAAC3D,OAAO,EAAEiC,MAAM,EAAEnC,KAAK,CAAC;EAC9D,CAAC,CAAC,OAAO3F,CAAC,EAAE;IACV8J,SAAS,CAAChD,WAAW,CACnB,IAAAkD,0BAAiB,EACftE,GAAG,EACH,oCAAoC,GAAG1F,CACzC,CACF,CAAC,EAAC;EACJ;EACA,OAAO2F,KAAK;AACd"} \ No newline at end of file diff --git a/lib/table.js b/lib/table.js index bd39aa6b..40ae945f 100644 --- a/lib/table.js +++ b/lib/table.js @@ -429,7 +429,6 @@ function renderTableViewPane(doc, options) { if (this.predicate.sameTerm(ns.rdf('type')) && this.superClass) { return utils.label(this.superClass, true); // do initial cap } - return utils.label(this.predicate); } else if (this.variable) { return this.variable.toString(); @@ -1264,7 +1263,6 @@ function renderTableViewPane(doc, options) { } } } - tr.appendChild(td); } @@ -1371,7 +1369,6 @@ function renderTableViewPane(doc, options) { // oldStyle = rows[i]._htmlRow.getAttribute('style') || '' // rows[i]._htmlRow.style.background = '#ffe'; //setAttribute('style', ' background-color: #ffe;')// yellow } - var onResult = function onResult(values) { if (!query.running) { return; @@ -1441,7 +1438,6 @@ function renderTableViewPane(doc, options) { } if (options.onDone) options.onDone(resultDiv); // return div makes testing easier }; - kb.query(query, onResult, undefined, onDone); } diff --git a/lib/table.js.map b/lib/table.js.map index a1d35663..d143bddd 100644 --- a/lib/table.js.map +++ b/lib/table.js.map @@ -1 +1 @@ -{"version":3,"file":"table.js","names":["debug","_interopRequireWildcard","require","_iconBase","_solidLogic","log","ns","rdf","utils","widgets","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","UI","icons","renderTableViewPane","doc","options","sourceDocument","tableClass","givenQuery","query","RDFS_LITERAL","kb","store","rowsLookup","FORBIDDEN_COLUMNS","XSD_NUMBER_TYPES","XSD_DATE_TYPES","IMAGE_TYPES","keyVariable","subjectIdCounter","allType","types","typeSelectorDiv","addColumnDiv","lastQuery","mostCommonType","resultDiv","createElement","className","appendChild","generateControlBar","tableDiv","refresh","runQuery","table","logicalRows","columns","renderTableForQuery","s","calculateTable","generateTypeSelector","getMostCommonType","buildFilteredTable","result","setAttribute","tr","addSelectToQuery","type","selectedColumns","getColumns","length","variable","vars","push","setVariable","addWhereToQuery","rowVar","queryType","pat","add","addColumnsToQuery","column","formula","predicate","getVariable","optional","generateQuery","Query","slice","clearElement","generateColumnAddDropdown","updateTable","running","htmlTable","element","childNodes","removeChild","SubjectType","allColumns","useCount","getAllColumns","getUnusedColumns","indexOf","addColumn","removeColumn","filter","x","getLabel","label","addUse","Column","checkedAnyValues","possiblyLiteral","possiblyNumber","constraints","checkValue","term","termType","literalValue","value","match","getKey","toString","getHints","hints","toNT","sameTerm","superClass","setPredicate","inverse","other","concat","each","rdfs","alternatives","undefined","getConstraints","filterFunction","sortKey","toLowerCase","isImageColumn","uri","objectToArray","obj","property","optionElement","createTextNode","dropdown","addEventListener","typeSelectorChanged","selectedType","unusedColumns","sort","b","aLabel","bLabel","columnIndex","Number","getColumnForVariable","variableNT","predicateUri","Error","getColumnForPredicate","getTypeForObject","subjectType","discoverTypes","subjectList","statementsMatching","subjects","object","typeObj","subject","getSubjectProperties","properties","j","identifyColumnsForType","allColumnsList","sortColumns","typeUrl","sortFunction","renderColumnDeleteButton","button","renderTableHeader","linkTd","th","applyColumnSort","rows","reverse","columnKey","row1","row2","row1Value","row2Value","values","parentTable","_htmlRow","parentNode","applyColumnFiltersToRow","row","rowDisplayed","c","columnValue","htmlRow","style","display","applyColumnFilters","literalSort","literalToString","colValue","literalCompare","value1","value2","strValue1","strValue2","renderLiteralSelector","textBox","width","sort1","sort2","substring","renderEnumSelector","list","doMultiple","searchValue","initialSelection","ele","selected","opt","option","index","renderNumberSelector","minSelector","maxSelector","min","max","eventListener","fallbackRenderTableSelector","renderTableSelector","cs","range","choices","owl","elements","renderTableSelectors","td","selector","linkTo","linkText","linkFunction","openHrefInOutlineMode","preventDefault","stopPropagation","target","getTarget","getAttribute","linkToObject","renderImage","height","renderValue","cellFormat","shortDate","datatype","span","textContent","forEach","lastChild","renderTableRowInto","_downstream","_subject","orig","objects","different","originalValues","background","valueInList","key","updateRow","needUpdate","getSubjectId","_subject_id","startTime","Date","now","progressMessage","original","onResult","rowKey","rowKeyId","onDone","elapsedTimeMS","splice","sortBy","sortReverse","inferColumnsFromFormula","statements","statement","inferColumns","queryVar","bestCount","best","typeUri"],"sources":["../src/table.js"],"sourcesContent":["// Table Widget: Format an array of RDF statements as an HTML table.\n//\n// This can operate in one of three modes: when the class of object is given\n// or when the source document from whuch data is taken is given,\n// or if a prepared query object is given.\n// (In principle it could operate with neither class nor document\n// given but typically\n// there would be too much data.)\n// When the tableClass is not given, it looks for common classes in the data,\n// and gives the user the option.\n//\n// 2008 Written, Ilaria Liccardi as the tableViewPane.js\n// 2014 Core table widget moved into common/table.js - timbl\n//\n\nimport * as debug from './debug'\nimport { icons } from './iconBase'\nimport { store } from 'solid-logic'\nimport * as log from './log'\nimport * as ns from './ns'\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as utils from './utils'\nimport * as widgets from './widgets'\n\nconst UI = { icons, log, ns, utils, widgets }\n\n// UI.widgets.renderTableViewPane\nexport function renderTableViewPane (doc, options) {\n const sourceDocument = options.sourceDocument\n const tableClass = options.tableClass\n const givenQuery = options.query\n\n const RDFS_LITERAL = 'http://www.w3.org/2000/01/rdf-schema#Literal'\n const ns = UI.ns\n const kb = store\n const rowsLookup = {} // Persistent mapping of subject URI to dom TR\n\n // Predicates that are never made into columns:\n\n const FORBIDDEN_COLUMNS = {\n 'http://www.w3.org/2002/07/owl#sameAs': true,\n 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type': true\n }\n\n // Number types defined in the XML schema:\n\n const XSD_NUMBER_TYPES = {\n 'http://www.w3.org/2001/XMLSchema#decimal': true,\n 'http://www.w3.org/2001/XMLSchema#float': true,\n 'http://www.w3.org/2001/XMLSchema#double': true,\n 'http://www.w3.org/2001/XMLSchema#integer': true,\n 'http://www.w3.org/2001/XMLSchema#nonNegativeInteger': true,\n 'http://www.w3.org/2001/XMLSchema#positiveInteger': true,\n 'http://www.w3.org/2001/XMLSchema#nonPositiveInteger': true,\n 'http://www.w3.org/2001/XMLSchema#negativeInteger': true,\n 'http://www.w3.org/2001/XMLSchema#long': true,\n 'http://www.w3.org/2001/XMLSchema#int': true,\n 'http://www.w3.org/2001/XMLSchema#short': true,\n 'http://www.w3.org/2001/XMLSchema#byte': true,\n 'http://www.w3.org/2001/XMLSchema#unsignedLong': true,\n 'http://www.w3.org/2001/XMLSchema#unsignedInt': true,\n 'http://www.w3.org/2001/XMLSchema#unsignedShort': true,\n 'http://www.w3.org/2001/XMLSchema#unsignedByte': true\n }\n\n const XSD_DATE_TYPES = {\n 'http://www.w3.org/2001/XMLSchema#dateTime': true,\n 'http://www.w3.org/2001/XMLSchema#date': true\n }\n\n // Classes that indicate an image:\n\n const IMAGE_TYPES = {\n 'http://xmlns.com/foaf/0.1/Image': true,\n 'http://purl.org/dc/terms/Image': true\n }\n\n // Name of the column used as a \"key\" value to look up the row.\n // This is necessary because in the normal view, the columns are\n // all \"optional\" values, meaning that we will get a result set\n // for every individual value that is found. The row key acts\n // as an anchor that can be used to combine this information\n // back into the same row.\n\n const keyVariable = options.keyVariable || '?_row'\n\n let subjectIdCounter = 0\n let allType, types\n let typeSelectorDiv, addColumnDiv\n\n // The last SPARQL query used:\n let lastQuery = null\n let mostCommonType = null\n\n const resultDiv = doc.createElement('div')\n resultDiv.className = 'tableViewPane'\n\n resultDiv.appendChild(generateControlBar()) // sets typeSelectorDiv\n\n const tableDiv = doc.createElement('div')\n resultDiv.appendChild(tableDiv)\n\n // Save a refresh function for use by caller\n resultDiv.refresh = function () {\n runQuery(table.query, table.logicalRows, table.columns, table)\n // updateTable(givenQuery, mostCommonType) // This could be a lot more incremental and efficient\n }\n\n // A specifically asked-for query\n let table\n if (givenQuery) {\n table = renderTableForQuery(givenQuery)\n // lastQuery = givenQuery\n tableDiv.appendChild(table)\n } else {\n // Find the most common type and select it by default\n\n const s = calculateTable()\n allType = s[0]\n types = s[1]\n if (!tableClass) {\n typeSelectorDiv.appendChild(generateTypeSelector(allType, types))\n }\n\n mostCommonType = getMostCommonType(types)\n\n if (mostCommonType) {\n buildFilteredTable(mostCommonType)\n } else {\n buildFilteredTable(allType)\n }\n }\n return resultDiv\n\n // /////////////////////////////////////////////////////////////////\n /*\n function closeDialog (dialog) {\n dialog.parentNode.removeChild(dialog)\n }\n\n function createActionButton (label, callback) {\n var button = doc.createElement('input')\n button.setAttribute('type', 'submit')\n button.setAttribute('value', label)\n button.addEventListener('click', callback, false)\n return button\n }\n// @@ Tdo: put these buttonsback in,\n// to allow user to see and edit and save the sparql query for the table they are looking at\n//\n\n function createSparqlWindow () {\n var dialog = doc.createElement('div')\n\n dialog.setAttribute('class', 'sparqlDialog')\n\n var title = doc.createElement('h3')\n title.appendChild(doc.createTextNode('Edit SPARQL query'))\n\n var inputbox = doc.createElement('textarea')\n inputbox.value = rdf.queryToSPARQL(lastQuery)\n\n dialog.appendChild(title)\n dialog.appendChild(inputbox)\n\n dialog.appendChild(createActionButton('Query', function () {\n var query = rdf.SPARQLToQuery(inputbox.value)\n updateTable(query)\n closeDialog(dialog)\n }))\n\n dialog.appendChild(createActionButton('Close', function () {\n closeDialog(dialog)\n }))\n\n return dialog\n }\n\n function sparqlButtonPressed () {\n var dialog = createSparqlWindow()\n\n resultDiv.appendChild(dialog)\n }\n\n function generateSparqlButton () {\n var image = doc.createElement('img')\n image.setAttribute('class', 'sparqlButton')\n image.setAttribute('src', UI.iconBase + 'icons/1pt5a.gif')\n image.setAttribute('alt', 'Edit SPARQL query')\n\n image.addEventListener('click', sparqlButtonPressed, false)\n\n return image\n }\n*/\n // Generate the control bar displayed at the top of the screen.\n\n function generateControlBar () {\n const result = doc.createElement('table')\n result.setAttribute('class', 'toolbar')\n\n const tr = doc.createElement('tr')\n\n /* @@ Add in later -- not debugged yet\n var sparqlButtonDiv = doc.createElement(\"td\")\n sparqlButtonDiv.appendChild(generateSparqlButton())\n tr.appendChild(sparqlButtonDiv)\n */\n typeSelectorDiv = doc.createElement('td')\n tr.appendChild(typeSelectorDiv)\n\n addColumnDiv = doc.createElement('td')\n tr.appendChild(addColumnDiv)\n\n result.appendChild(tr)\n\n return result\n }\n\n // Add the SELECT details to the query being built.\n\n function addSelectToQuery (query, type) {\n const selectedColumns = type.getColumns()\n\n for (let i = 0; i < selectedColumns.length; ++i) {\n // TODO: autogenerate nicer names for variables\n // variables have to be unambiguous\n\n const variable = kb.variable('_col' + i)\n\n query.vars.push(variable)\n selectedColumns[i].setVariable(variable)\n }\n }\n\n // Add WHERE details to the query being built.\n\n function addWhereToQuery (query, rowVar, type) {\n let queryType = type.type\n\n if (!queryType) {\n queryType = kb.variable('_any')\n }\n\n // _row a type\n query.pat.add(rowVar, UI.ns.rdf('type'), queryType)\n }\n\n // Generate OPTIONAL column selectors.\n\n function addColumnsToQuery (query, rowVar, type) {\n const selectedColumns = type.getColumns()\n\n for (let i = 0; i < selectedColumns.length; ++i) {\n const column = selectedColumns[i]\n\n const formula = kb.formula()\n\n formula.add(rowVar, column.predicate, column.getVariable())\n\n query.pat.optional.push(formula)\n }\n }\n\n // Generate a query object from the currently-selected type\n // object.\n\n function generateQuery (type) {\n const query = new rdf.Query()\n const rowVar = kb.variable(keyVariable.slice(1)) // don't pass '?'\n\n addSelectToQuery(query, type)\n addWhereToQuery(query, rowVar, type)\n addColumnsToQuery(query, rowVar, type)\n\n return query\n }\n\n // Build the contents of the tableDiv element, filtered according\n // to the specified type.\n\n function buildFilteredTable (type) {\n // Generate \"add column\" cell.\n\n clearElement(addColumnDiv)\n addColumnDiv.appendChild(generateColumnAddDropdown(type))\n\n const query = generateQuery(type)\n\n updateTable(query, type)\n }\n\n function updateTable (query, type) {\n // Stop the previous query from doing any updates.\n\n if (lastQuery) {\n lastQuery.running = false\n }\n\n // Render the HTML table.\n\n const htmlTable = renderTableForQuery(query, type)\n\n // Clear the tableDiv element, and replace with the new table.\n\n clearElement(tableDiv)\n tableDiv.appendChild(htmlTable)\n\n // Save the query for the edit dialog.\n\n lastQuery = query\n }\n\n // Remove all subelements of the specified element.\n\n function clearElement (element) {\n while (element.childNodes.length > 0) {\n element.removeChild(element.childNodes[0])\n }\n }\n\n // A SubjectType is created for each rdf:type discovered.\n\n function SubjectType (type) {\n this.type = type\n this.columns = null\n this.allColumns = []\n this.useCount = 0\n\n // Get a list of all columns used by this type.\n\n this.getAllColumns = function () {\n return this.allColumns\n }\n\n // Get a list of the current columns used by this type\n // (subset of allColumns)\n\n this.getColumns = function () {\n // The first time through, get a list of all the columns\n // and select only the six most popular columns.\n\n if (!this.columns) {\n const allColumns = this.getAllColumns()\n this.columns = allColumns.slice(0, 7)\n }\n\n return this.columns\n }\n\n // Get a list of unused columns\n\n this.getUnusedColumns = function () {\n const allColumns = this.getAllColumns()\n const columns = this.getColumns()\n\n const result = []\n\n for (let i = 0; i < allColumns.length; ++i) {\n if (columns.indexOf(allColumns[i]) === -1) {\n result.push(allColumns[i])\n }\n }\n\n return result\n }\n\n this.addColumn = function (column) {\n this.columns.push(column)\n }\n\n this.removeColumn = function (column) {\n this.columns = this.columns.filter(function (x) {\n return x !== column\n })\n }\n\n this.getLabel = function () {\n return utils.label(this.type)\n }\n\n this.addUse = function () {\n this.useCount += 1\n }\n }\n\n // Class representing a column in the table.\n\n function Column () {\n this.useCount = 0\n\n // Have we checked any values for this column yet?\n\n this.checkedAnyValues = false\n\n // If the range is unknown, but we just get literals in this\n // column, then we can generate a literal selector.\n\n this.possiblyLiteral = true\n\n // If the range is unknown, but we just get literals and they\n // match the regular expression for numbers, we can generate\n // a number selector.\n\n this.possiblyNumber = true\n\n // We accumulate classes which things in the column must be a member of\n\n this.constraints = []\n\n // Check values as they are read. If we don't know what the\n // range is, we might be able to infer that it is a literal\n // if all of the values are literals. Similarly, we might\n // be able to determine if the literal values are actually\n // numbers (using regexps).\n\n this.checkValue = function (term) {\n const termType = term.termType\n if (\n this.possiblyLiteral &&\n termType !== 'Literal' &&\n termType !== 'NamedNode'\n ) {\n this.possiblyNumber = false\n this.possiblyLiteral = false\n } else if (this.possiblyNumber) {\n if (termType !== 'Literal') {\n this.possiblyNumber = false\n } else {\n const literalValue = term.value\n\n if (!literalValue.match(/^-?\\d+(\\.\\d*)?$/)) {\n this.possiblyNumber = false\n }\n }\n }\n\n this.checkedAnyValues = true\n }\n\n this.getVariable = function () {\n return this.variable\n }\n\n this.setVariable = function (variable) {\n this.variable = variable\n }\n\n this.getKey = function () {\n return this.variable.toString()\n }\n\n this.addUse = function () {\n this.useCount += 1\n }\n\n this.getHints = function () {\n if (\n options &&\n options.hints &&\n this.variable &&\n options.hints[this.variable.toNT()]\n ) {\n return options.hints[this.variable.toNT()]\n }\n return {}\n }\n\n this.getLabel = function () {\n if (this.getHints().label) {\n return this.getHints().label\n }\n if (this.predicate) {\n if (this.predicate.sameTerm(ns.rdf('type')) && this.superClass) {\n return utils.label(this.superClass, true) // do initial cap\n }\n return utils.label(this.predicate)\n } else if (this.variable) {\n return this.variable.toString()\n } else {\n return 'unlabeled column?'\n }\n }\n\n this.setPredicate = function (predicate, inverse, other) {\n if (inverse) {\n // variable is in the subject pos\n this.inverse = predicate\n this.constraints = this.constraints.concat(\n kb.each(predicate, UI.ns.rdfs('domain'))\n )\n if (\n predicate.sameTerm(ns.rdfs('subClassOf')) &&\n other.termType === 'NamedNode'\n ) {\n this.superClass = other\n this.alternatives = kb.each(undefined, ns.rdfs('subClassOf'), other)\n }\n } else {\n // variable is the object\n this.predicate = predicate\n this.constraints = this.constraints.concat(\n kb.each(predicate, UI.ns.rdfs('range'))\n )\n }\n }\n\n this.getConstraints = function () {\n return this.constraints\n }\n\n this.filterFunction = function () {\n return true\n }\n\n this.sortKey = function () {\n return this.getLabel().toLowerCase()\n }\n\n this.isImageColumn = function () {\n for (let i = 0; i < this.constraints.length; i++) {\n if (this.constraints[i].uri in IMAGE_TYPES) return true\n }\n return false\n }\n }\n\n // Convert an object to an array.\n\n function objectToArray (obj, filter) {\n const result = []\n\n for (const property in obj) {\n // @@@ have to guard against methods\n const value = obj[property]\n\n if (!filter || filter(property, value)) {\n result.push(value)\n }\n }\n\n return result\n }\n\n // Generate an