(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("$rdf"), require("SolidLogic")); else if(typeof define === 'function' && define.amd) define(["$rdf", "SolidLogic"], factory); else if(typeof exports === 'object') exports["UI"] = factory(require("$rdf"), require("SolidLogic")); else root["UI"] = factory(root["$rdf"], root["SolidLogic"]); })(this, (__WEBPACK_EXTERNAL_MODULE__264__, __WEBPACK_EXTERNAL_MODULE__663__) => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 49 (__unused_webpack_module, exports, __webpack_require__) { "use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var db = __webpack_require__(598) var extname = (__webpack_require__(466).extname) var mimeScore = __webpack_require__(983) /** * Module variables. * @private */ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ var TEXT_TYPE_REGEXP = /^text\//i /** * Module exports. * @public */ exports.charset = charset exports.charsets = { lookup: charset } exports.contentType = contentType exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) exports._extensionConflicts = [] // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) /** * Get the default charset for a MIME type. * * @param {string} type * @return {false|string} */ function charset (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) var mime = match && db[match[1].toLowerCase()] if (mime && mime.charset) { return mime.charset } // default text/* to utf-8 if (match && TEXT_TYPE_REGEXP.test(match[1])) { return 'UTF-8' } return false } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {false|string} */ function contentType (str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str if (!mime) { return false } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime) if (charset) mime += '; charset=' + charset.toLowerCase() } return mime } /** * Get the default extension for a MIME type. * * @param {string} type * @return {false|string} */ function extension (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) // get extensions var exts = match && exports.extensions[match[1].toLowerCase()] if (!exts || !exts.length) { return false } return exts[0] } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {false|string} */ function lookup (path) { if (!path || typeof path !== 'string') { return false } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() .slice(1) if (!extension) { return false } return exports.types[extension] || false } /** * Populate the extensions and types maps. * @private */ function populateMaps (extensions, types) { Object.keys(db).forEach(function forEachMimeType (type) { var mime = db[type] var exts = mime.extensions if (!exts || !exts.length) { return } // mime -> extensions extensions[type] = exts // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] types[extension] = _preferredType(extension, types[extension], type) // DELETE (eventually): Capture extension->type maps that change as a // result of switching to mime-score. This is just to help make reviewing // PR #119 easier, and can be removed once that PR is approved. const legacyType = _preferredTypeLegacy( extension, types[extension], type ) if (legacyType !== types[extension]) { exports._extensionConflicts.push([extension, legacyType, types[extension]]) } } }) } // Resolve type conflict using mime-score function _preferredType (ext, type0, type1) { var score0 = type0 ? mimeScore(type0, db[type0].source) : 0 var score1 = type1 ? mimeScore(type1, db[type1].source) : 0 return score0 > score1 ? type0 : type1 } // Resolve type conflict using pre-mime-score logic function _preferredTypeLegacy (ext, type0, type1) { var SOURCE_RANK = ['nginx', 'apache', undefined, 'iana'] var score0 = type0 ? SOURCE_RANK.indexOf(db[type0].source) : 0 var score1 = type1 ? SOURCE_RANK.indexOf(db[type1].source) : 0 if ( exports.types[extension] !== 'application/octet-stream' && (score0 > score1 || (score0 === score1 && exports.types[extension]?.slice(0, 12) === 'application/')) ) { return type0 } return score0 > score1 ? type0 : type1 } /***/ }, /***/ 172 (module) { function _OverloadYield(e, d) { this.v = e, this.k = d; } module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 264 (module) { "use strict"; module.exports = __WEBPACK_EXTERNAL_MODULE__264__; /***/ }, /***/ 373 (module) { function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; } module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 378 (module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LN: () => (/* binding */ iconBase), /* harmony export */ Pt: () => (/* binding */ icons), /* harmony export */ i1: () => (/* binding */ originalIconBase) /* harmony export */ }); /* harmony import */ var _debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(423); /* module decorator */ module = __webpack_require__.hmd(module); // Works in FF extension - what about browserify?? // 2021-04-08 Convert to TS /* The Firefox case is left for historical record, as we don't currenly * have a FF extension for mashlib, but we could. This is sthepoint to * hack the place it can find its icons internally * * The $SolidTestEnvironment is important and is used for * example when testing on localhost to specify a place the icons be found * in your test set up. * * You can also use it if you want to just run a mashlib whhich takes its * icons seved by other than github. */ // Do not export. Always us this module to find the icons, as they vary var iconsOnGithub = 'https://solidos.github.io/solid-ui/src'; // changed org 2022-05 var icons = module.scriptURI // Firefox extension ? { iconBase: module.scriptURI.slice(0, module.scriptURI.lastIndexOf('/')) + '/icons/', originalIconBase: module.scriptURI.slice(0, module.scriptURI.lastIndexOf('/')) + '/originalIcons/' } : typeof $SolidTestEnvironment !== 'undefined' && $SolidTestEnvironment.iconBase // Test environemnt ? { iconBase: $SolidTestEnvironment.iconBase, originalIconBase: $SolidTestEnvironment.originalIconBase } : { // Normal case: iconBase: iconsOnGithub + '/icons/', originalIconBase: iconsOnGithub + '/originalIcons/' }; (0,_debug__WEBPACK_IMPORTED_MODULE_0__/* .log */ .Rm)(' icons.iconBase is set to : ' + icons.iconBase); // allow tests etc named-import this directly from this module var iconBase = icons.iconBase; var originalIconBase = icons.originalIconBase; /***/ }, /***/ 386 (module) { /** * Provides a way to access commonly used namespaces * * Usage: * * ``` * const $rdf = require('rdflib'); //or any other RDF/JS-compatible library * const ns = require('solid-namespace')($rdf); * const store = $rdf.graph(); * * let me = ...; * let name = store.any(me, ns.vcard(‘fn’)) || store.any(me, ns.foaf(‘name’)); * ``` * @module vocab */ const aliases = { acl: 'http://www.w3.org/ns/auth/acl#', arg: 'http://www.w3.org/ns/pim/arg#', as: 'https://www.w3.org/ns/activitystreams#', bookmark: 'http://www.w3.org/2002/01/bookmark#', cal: 'http://www.w3.org/2002/12/cal/ical#', cco: 'http://www.ontologyrepository.com/CommonCoreOntologies/', cert: 'http://www.w3.org/ns/auth/cert#', contact: 'http://www.w3.org/2000/10/swap/pim/contact#', dc: 'http://purl.org/dc/elements/1.1/', dct: 'http://purl.org/dc/terms/', doap: 'http://usefulinc.com/ns/doap#', foaf: 'http://xmlns.com/foaf/0.1/', geo: 'http://www.w3.org/2003/01/geo/wgs84_pos#', gpx: 'http://www.w3.org/ns/pim/gpx#', gr: 'http://purl.org/goodrelations/v1#', http: 'http://www.w3.org/2007/ont/http#', httph: 'http://www.w3.org/2007/ont/httph#', icalTZ: 'http://www.w3.org/2002/12/cal/icaltzd#', // Beware: not cal: ldp: 'http://www.w3.org/ns/ldp#', link: 'http://www.w3.org/2007/ont/link#', log: 'http://www.w3.org/2000/10/swap/log#', meeting: 'http://www.w3.org/ns/pim/meeting#', mo: 'http://purl.org/ontology/mo/', org: 'http://www.w3.org/ns/org#', owl: 'http://www.w3.org/2002/07/owl#', pad: 'http://www.w3.org/ns/pim/pad#', patch: 'http://www.w3.org/ns/pim/patch#', prov: 'http://www.w3.org/ns/prov#', pto: 'http://www.productontology.org/id/', qu: 'http://www.w3.org/2000/10/swap/pim/qif#', trip: 'http://www.w3.org/ns/pim/trip#', rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', rdfs: 'http://www.w3.org/2000/01/rdf-schema#', rss: 'http://purl.org/rss/1.0/', sched: 'http://www.w3.org/ns/pim/schedule#', schema: 'http://schema.org/', // @@ beware confusion with documents no 303 sioc: 'http://rdfs.org/sioc/ns#', skos: 'http://www.w3.org/2004/02/skos/core#', solid: 'http://www.w3.org/ns/solid/terms#', space: 'http://www.w3.org/ns/pim/space#', stat: 'http://www.w3.org/ns/posix/stat#', tab: 'http://www.w3.org/2007/ont/link#', tabont: 'http://www.w3.org/2007/ont/link#', ui: 'http://www.w3.org/ns/ui#', vann: 'http://purl.org/vocab/vann/', vcard: 'http://www.w3.org/2006/vcard/ns#', wf: 'http://www.w3.org/2005/01/wf/flow#', xsd: 'http://www.w3.org/2001/XMLSchema#', } /** * @param [rdflib] {RDF} Optional RDF Library (such as rdflib.js or rdf-ext) to inject */ function vocab (rdf = { namedNode: u => u }) { const namespaces = {} for (const alias in aliases) { const expansion = aliases[alias] namespaces[alias] = function (localName = '') { return rdf.namedNode(expansion + localName) } }; return namespaces }; module.exports = vocab /***/ }, /***/ 423 (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ R8: () => (/* binding */ warn), /* harmony export */ Rm: () => (/* binding */ log), /* harmony export */ uP: () => (/* binding */ trace), /* harmony export */ z3: () => (/* binding */ error) /* harmony export */ }); function log() { var _console; (_console = console).log.apply(_console, arguments); } function warn() { var _console2; (_console2 = console).warn.apply(_console2, arguments); } function error() { var _console3; (_console3 = console).error.apply(_console3, arguments); } function trace() { var _console4; (_console4 = console).trace.apply(_console4, arguments); } /***/ }, /***/ 466 () { /* (ignored) */ /***/ }, /***/ 546 (module) { function _regeneratorDefine(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); } module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 579 (module, __unused_webpack_exports, __webpack_require__) { var _typeof = (__webpack_require__(738)["default"]); function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); } module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 580 (module) { "use strict"; /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed */ /** * Module variables. * @private */ var matchHtmlRegExp = /["'&<>]/; /** * Module exports. * @public */ module.exports = escapeHtml; /** * Escape special characters in the given string of html. * * @param {string} string The string to escape for inserting into HTML * @return {string} * @public */ function escapeHtml(string) { var str = '' + string; var match = matchHtmlRegExp.exec(str); if (!match) { return str; } var escape; var html = ''; var index = 0; var lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: // " escape = '"'; break; case 38: // & escape = '&'; break; case 39: // ' escape = '''; break; case 60: // < escape = '<'; break; case 62: // > escape = '>'; break; default: continue; } if (lastIndex !== index) { html += str.substring(lastIndex, index); } lastIndex = index + 1; html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; } /***/ }, /***/ 598 (module, __unused_webpack_exports, __webpack_require__) { /*! * mime-db * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015-2022 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. */ module.exports = __webpack_require__(813) /***/ }, /***/ 633 (module, __unused_webpack_exports, __webpack_require__) { var OverloadYield = __webpack_require__(172); var regenerator = __webpack_require__(993); var regeneratorAsync = __webpack_require__(869); var regeneratorAsyncGen = __webpack_require__(887); var regeneratorAsyncIterator = __webpack_require__(791); var regeneratorKeys = __webpack_require__(373); var regeneratorValues = __webpack_require__(579); function _regeneratorRuntime() { "use strict"; var r = regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new OverloadYield(r, e); }, AsyncIterator: regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); }, keys: regeneratorKeys, values: regeneratorValues }; }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); } module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 663 (module) { "use strict"; module.exports = __WEBPACK_EXTERNAL_MODULE__663__; /***/ }, /***/ 738 (module) { function _typeof(o) { "@babel/helpers - typeof"; return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); } module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 756 (module, __unused_webpack_exports, __webpack_require__) { // TODO(Babel 8): Remove this file. var runtime = __webpack_require__(633)(); module.exports = runtime; // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } /***/ }, /***/ 791 (module, __unused_webpack_exports, __webpack_require__) { var OverloadYield = __webpack_require__(172); var regeneratorDefine = __webpack_require__(546); function AsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), regeneratorDefine(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); } module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 813 (module) { "use strict"; module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/ace+json":{"source":"iana","compressible":true},"application/ace-groupcomm+cbor":{"source":"iana"},"application/ace-trl+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/aif+cbor":{"source":"iana"},"application/aif+json":{"source":"iana","compressible":true},"application/alto-cdni+json":{"source":"iana","compressible":true},"application/alto-cdnifilter+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-propmap+json":{"source":"iana","compressible":true},"application/alto-propmapparams+json":{"source":"iana","compressible":true},"application/alto-tips+json":{"source":"iana","compressible":true},"application/alto-tipsparams+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/appinstaller":{"compressible":false,"extensions":["appinstaller"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/appx":{"compressible":false,"extensions":["appx"]},"application/appxbundle":{"compressible":false,"extensions":["appxbundle"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/automationml-aml+xml":{"source":"iana","compressible":true,"extensions":["aml"]},"application/automationml-amlx+zip":{"source":"iana","compressible":false,"extensions":["amlx"]},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/bufr":{"source":"iana"},"application/c2pa":{"source":"iana"},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/ce+cbor":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/cid-edhoc+cbor-seq":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/city+json-seq":{"source":"iana"},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-eap":{"source":"iana"},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/concise-problem-details+cbor":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cose-x509":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwl":{"source":"iana","extensions":["cwl"]},"application/cwl+json":{"source":"iana","compressible":true},"application/cwl+yaml":{"source":"iana"},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana","extensions":["dcm"]},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dpop+jwt":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/eat+cwt":{"source":"iana"},"application/eat+jwt":{"source":"iana"},"application/eat-bun+cbor":{"source":"iana"},"application/eat-bun+json":{"source":"iana","compressible":true},"application/eat-ucs+cbor":{"source":"iana"},"application/eat-ucs+json":{"source":"iana","compressible":true},"application/ecmascript":{"source":"apache","compressible":true,"extensions":["ecma"]},"application/edhoc+cbor-seq":{"source":"iana"},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.legacyesn+json":{"source":"iana","compressible":true},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/entity-statement+jwt":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdf":{"source":"iana","extensions":["fdf"]},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geopose+json":{"source":"iana","compressible":true},"application/geoxacml+json":{"source":"iana","compressible":true},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gnap-binding-jws":{"source":"iana"},"application/gnap-binding-jwsd":{"source":"iana"},"application/gnap-binding-rotation-jws":{"source":"iana"},"application/gnap-binding-rotation-jwsd":{"source":"iana"},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/grib":{"source":"iana"},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"iana","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"apache","charset":"UTF-8","compressible":true,"extensions":["js"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/jscontact+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jsonpath":{"source":"iana"},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwk-set+jwt":{"source":"iana"},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/linkset":{"source":"iana"},"application/linkset+json":{"source":"iana","compressible":true},"application/load-control+xml":{"source":"iana","compressible":true},"application/logout+jwt":{"source":"iana"},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4","mpg4","mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msix":{"compressible":false,"extensions":["msix"]},"application/msixbundle":{"compressible":false,"extensions":["msixbundle"]},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":true,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/ohttp-keys":{"source":"iana"},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg","one","onea"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["sig","asc"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/private-token-issuer-directory":{"source":"iana"},"application/private-token-request":{"source":"iana"},"application/private-token-response":{"source":"iana"},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/provided-claims+jwt":{"source":"iana"},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.implied-document+xml":{"source":"iana","compressible":true},"application/prs.implied-executable":{"source":"iana"},"application/prs.implied-object+json":{"source":"iana","compressible":true},"application/prs.implied-object+json-seq":{"source":"iana"},"application/prs.implied-object+yaml":{"source":"iana"},"application/prs.implied-structure":{"source":"iana"},"application/prs.mayfile":{"source":"iana"},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.vcfbzip2":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true,"extensions":["xsf"]},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"apache"},"application/reputon+json":{"source":"iana","compressible":true},"application/resolve-response+jwt":{"source":"iana"},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-checklist":{"source":"iana"},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-signed-tal":{"source":"iana"},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"apache"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana","extensions":["sql"]},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/sslkeylogfile":{"source":"iana"},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/st2110-41":{"source":"iana"},"application/stix+json":{"source":"iana","compressible":true},"application/stratum":{"source":"iana"},"application/swid+cbor":{"source":"iana"},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tm+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toc+cbor":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"source":"iana","compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/trust-chain+json":{"source":"iana","compressible":true},"application/trust-mark+jwt":{"source":"iana"},"application/trust-mark-delegation+jwt":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/uccs+cbor":{"source":"iana"},"application/ujcs+json":{"source":"iana","compressible":true},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vc":{"source":"iana"},"application/vc+cose":{"source":"iana"},"application/vc+jwt":{"source":"iana"},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.1ob":{"source":"iana"},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3a+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ach+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc8+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.5gsa2x":{"source":"iana"},"application/vnd.3gpp.5gsa2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gsv2x":{"source":"iana"},"application/vnd.3gpp.5gsv2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.crs+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.current-location-discovery+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-regroup+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-regroup+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-regroup+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.pinapp-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.seal-group-doc+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.seal-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.seal-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.seal-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.seal-network-qos-management-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.seal-ue-config-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.seal-unicast-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.seal-user-profile-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.v2x":{"source":"iana"},"application/vnd.3gpp.vae-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acm.addressxfer+json":{"source":"iana","compressible":true},"application/vnd.acm.chatbot+json":{"source":"iana","compressible":true},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"apache","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"apache"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.parquet":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.apexlang":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"apache"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autodesk.fbx":{"extensions":["fbx"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.belightsoft.lhzd+zip":{"source":"iana","compressible":false},"application/vnd.belightsoft.lhzl+zip":{"source":"iana","compressible":false},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.bzip3":{"source":"iana"},"application/vnd.c3voc.schedule+xml":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.cncf.helm.chart.content.v1.tar+gzip":{"source":"iana"},"application/vnd.cncf.helm.chart.provenance.v1.prov":{"source":"iana"},"application/vnd.cncf.helm.config.v1+json":{"source":"iana","compressible":true},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datalog":{"source":"iana"},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.dcmp+xml":{"source":"iana","compressible":true,"extensions":["dcmp"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.eln+zip":{"source":"iana","compressible":false},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.erofs":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"apache","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.fdsn.stationxml+xml":{"source":"iana","charset":"XML-BASED","compressible":true},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.freelog.comic":{"source":"iana"},"application/vnd.frogans.fnc":{"source":"apache","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"apache","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.ga4gh.passport+jwt":{"source":"iana"},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.genozip":{"source":"iana"},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.gentoo.catmetadata+xml":{"source":"iana","compressible":true},"application/vnd.gentoo.ebuild":{"source":"iana"},"application/vnd.gentoo.eclass":{"source":"iana"},"application/vnd.gentoo.gpkg":{"source":"iana"},"application/vnd.gentoo.manifest":{"source":"iana"},"application/vnd.gentoo.pkgmetadata+xml":{"source":"iana","compressible":true},"application/vnd.gentoo.xpak":{"source":"iana"},"application/vnd.geo+json":{"source":"apache","compressible":true},"application/vnd.geocube+xml":{"source":"apache","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.pinboard":{"source":"iana"},"application/vnd.geogebra.slides":{"source":"iana","extensions":["ggs"]},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.gnu.taler.exchange+json":{"source":"iana","compressible":true},"application/vnd.gnu.taler.merchant+json":{"source":"iana","compressible":true},"application/vnd.google-apps.audio":{},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.drawing":{"compressible":false,"extensions":["gdraw"]},"application/vnd.google-apps.drive-sdk":{"compressible":false},"application/vnd.google-apps.file":{},"application/vnd.google-apps.folder":{"compressible":false},"application/vnd.google-apps.form":{"compressible":false,"extensions":["gform"]},"application/vnd.google-apps.fusiontable":{},"application/vnd.google-apps.jam":{"compressible":false,"extensions":["gjam"]},"application/vnd.google-apps.mail-layout":{},"application/vnd.google-apps.map":{"compressible":false,"extensions":["gmap"]},"application/vnd.google-apps.photo":{},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.script":{"compressible":false,"extensions":["gscript"]},"application/vnd.google-apps.shortcut":{},"application/vnd.google-apps.site":{"compressible":false,"extensions":["gsite"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-apps.unknown":{},"application/vnd.google-apps.video":{},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"apache","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true,"extensions":["xdcf"]},"application/vnd.gpxsee.map+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.hsl":{"source":"iana"},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"apache"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"apache","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"apache"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.ipfs.ipns-record":{"source":"iana"},"application/vnd.ipld.car":{"source":"iana"},"application/vnd.ipld.dag-cbor":{"source":"iana"},"application/vnd.ipld.dag-json":{"source":"iana"},"application/vnd.ipld.raw":{"source":"iana"},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kdl":{"source":"iana"},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.keyman.kmp+zip":{"source":"iana","compressible":false},"application/vnd.keyman.kmx":{"source":"iana"},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.ldev.productlicensing":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.mdl":{"source":"iana"},"application/vnd.mdl-mbsdf":{"source":"iana"},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.medicalholodeck.recordxr":{"source":"iana"},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mermaid":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.modl":{"source":"iana"},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-visio.viewer":{"extensions":["vdx"]},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msgpack":{"source":"iana"},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.nato.bindingdataobject+cbor":{"source":"iana"},"application/vnd.nato.bindingdataobject+json":{"source":"iana","compressible":true},"application/vnd.nato.bindingdataobject+xml":{"source":"iana","compressible":true,"extensions":["bdo"]},"application/vnd.nato.openxmlformats-package.iepd+zip":{"source":"iana","compressible":false},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"apache","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oai.workflows":{"source":"iana"},"application/vnd.oai.workflows+json":{"source":"iana","compressible":true},"application/vnd.oai.workflows+yaml":{"source":"iana"},"application/vnd.oasis.opendocument.base":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"apache","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-master-template":{"source":"iana"},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"apache","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"apache","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.onvif.metadata":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openvpi.dspx+json":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.procrate.brushset":{"extensions":["brushset"]},"application/vnd.procreate.brush":{"extensions":["brush"]},"application/vnd.procreate.dream":{"extensions":["drm"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.pt.mundusmundi":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true,"extensions":["xhtm"]},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.relpipe":{"source":"iana"},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.sketchometry":{"source":"iana"},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.smintio.portals.archive":{"source":"iana"},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sybyl.mol2":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uic.osdm+json":{"source":"iana","compressible":true},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml","uo"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.veraison.tsm-report+cbor":{"source":"iana"},"application/vnd.veraison.tsm-report+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw","vsdx","vtx"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vocalshaper.vsp4":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.wasmflow.wafl":{"source":"iana"},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordlift":{"source":"iana"},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xarin.cpj":{"source":"iana"},"application/vnd.xecrets-encrypted":{"source":"iana"},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/voucher-jws+json":{"source":"iana","compressible":true},"application/vp":{"source":"iana"},"application/vp+cose":{"source":"iana"},"application/vp+jwt":{"source":"iana"},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blender":{"extensions":["blend"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-compressed":{"extensions":["rar"]},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-ipynb+json":{"compressible":true,"extensions":["ipynb"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zip-compressed":{"extensions":["zip"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xfdf":{"source":"iana","extensions":["xfdf"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yaml":{"source":"iana"},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+cbor":{"source":"iana"},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yang-sid+json":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zip+dotlottie":{"extensions":["lottie"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana","extensions":["adts","aac"]},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flac":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/matroska":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/midi-clip":{"source":"iana"},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a","m4b"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"apache"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"source":"iana","compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp","dib"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/dpx":{"source":"iana","extensions":["dpx"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/j2c":{"source":"iana"},"image/jaii":{"source":"iana","extensions":["jaii"]},"image/jais":{"source":"iana","extensions":["jais"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpg","jpeg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm","jpgm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxl":{"source":"iana","extensions":["jxl"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false,"extensions":["jfif"]},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif","btf"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.clip":{"source":"iana"},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"iana","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-adobe-dng":{"extensions":["dng"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-emf":{"source":"iana"},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-wmf":{"source":"iana"},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/bhttp":{"source":"iana"},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/mls":{"source":"iana"},"message/news":{"source":"apache"},"message/ohttp-req":{"source":"iana"},"message/ohttp-res":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime","mht","mhtml"]},"message/s-http":{"source":"apache"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"apache"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/jt":{"source":"iana","extensions":["jt"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/prc":{"source":"iana","extensions":["prc"]},"model/step":{"source":"iana","extensions":["step","stp","stpnc","p21","210"]},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/u3d":{"source":"iana","extensions":["u3d"]},"model/vnd.bary":{"source":"iana","extensions":["bary"]},"model/vnd.cld":{"source":"iana","extensions":["cld"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana","extensions":["pyo","pyox"]},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usda":{"source":"iana","extensions":["usda"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"apache"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/hl7v2":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["md","markdown"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/prs.texi":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.exchangeable":{"source":"iana"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"apache"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.vcf":{"source":"iana"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vnd.zoo.kcl":{"source":"iana"},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/wgsl":{"source":"iana","extensions":["wgsl"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/evc":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/h266":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/lottie+json":{"source":"iana","compressible":true},"video/matroska":{"source":"iana"},"video/matroska-3d":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts","m2t","m2ts","mts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.planar":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"apache"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}'); /***/ }, /***/ 869 (module, __unused_webpack_exports, __webpack_require__) { var regeneratorAsyncGen = __webpack_require__(887); function _regeneratorAsync(n, e, r, t, o) { var a = regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); } module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 887 (module, __unused_webpack_exports, __webpack_require__) { var regenerator = __webpack_require__(993); var regeneratorAsyncIterator = __webpack_require__(791); function _regeneratorAsyncGen(r, e, t, o, n) { return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); } module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 983 (module) { // 'mime-score' back-ported to CommonJS // Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3) var FACET_SCORES = { 'prs.': 100, 'x-': 200, 'x.': 300, 'vnd.': 400, default: 900 } // Score mime source (Logic originally from `jshttp/mime-types` module) var SOURCE_SCORES = { nginx: 10, apache: 20, iana: 40, default: 30 // definitions added by `jshttp/mime-db` project? } var TYPE_SCORES = { // prefer application/xml over text/xml // prefer application/rtf over text/rtf application: 1, // prefer font/woff over application/font-woff font: 2, // prefer video/mp4 over audio/mp4 over application/mp4 // See https://www.rfc-editor.org/rfc/rfc4337.html#section-2 audio: 2, video: 3, default: 0 } /** * Get each component of the score for a mime type. The sum of these is the * total score. The higher the score, the more "official" the type. */ module.exports = function mimeScore (mimeType, source = 'default') { if (mimeType === 'application/octet-stream') { return 0 } const [type, subtype] = mimeType.split('/') const facet = subtype.replace(/(\.|x-).*/, '$1') const facetScore = FACET_SCORES[facet] || FACET_SCORES.default const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default // All else being equal prefer shorter types const lengthScore = 1 - mimeType.length / 100 return facetScore + sourceScore + typeScore + lengthScore } /***/ }, /***/ 993 (module, __unused_webpack_exports, __webpack_require__) { var regeneratorDefine = __webpack_require__(546); function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return regeneratorDefine(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () { return this; }), regeneratorDefine(u, "toString", function () { return "[object Generator]"; }), (module.exports = _regenerator = function _regenerator() { return { w: i, m: f }; }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); } module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ } /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ loaded: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/harmony module decorator */ /******/ (() => { /******/ __webpack_require__.hmd = (module) => { /******/ module = Object.create(module); /******/ if (!module.children) module.children = []; /******/ Object.defineProperty(module, 'exports', { /******/ enumerable: true, /******/ set: () => { /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id); /******/ } /******/ }); /******/ return module; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { acl: () => (/* reexport */ acl), aclControl: () => (/* reexport */ aclControl), create: () => (/* reexport */ create), createTypes: () => (/* reexport */ types_namespaceObject), dom: () => (/* binding */ src_dom), icons: () => (/* reexport */ iconBase/* icons */.Pt), infiniteMessageArea: () => (/* reexport */ infiniteMessageArea), initFooter: () => (/* reexport */ initFooter), initHeader: () => (/* reexport */ initHeader), language: () => (/* reexport */ language_namespaceObject), log: () => (/* reexport */ log_namespaceObject), login: () => (/* reexport */ login_namespaceObject), matrix: () => (/* reexport */ matrix), media: () => (/* reexport */ media), messageArea: () => (/* reexport */ messageArea), ns: () => (/* reexport */ src_ns), pad: () => (/* reexport */ pad_namespaceObject), participation: () => (/* reexport */ participation_namespaceObject), preferences: () => (/* reexport */ preferences_namespaceObject), style: () => (/* reexport */ style), table: () => (/* reexport */ renderTableViewPane), tabs: () => (/* reexport */ tabs_namespaceObject), utils: () => (/* reexport */ utils_namespaceObject), widgets: () => (/* reexport */ widgets_namespaceObject) }); // NAMESPACE OBJECT: ./src/log.ts var log_namespaceObject = {}; __webpack_require__.r(log_namespaceObject); __webpack_require__.d(log_namespaceObject, { LogLevel: () => (LogLevel), alert: () => (log_alert), clear: () => (clear), debug: () => (debug), dumpHTML: () => (dumpHTML), error: () => (error), escapeForXML: () => (escapeForXML), info: () => (info), logAscending: () => (logAscending), logDescending: () => (logDescending), msg: () => (msg), setInternals: () => (setInternals), setLevel: () => (setLevel), success: () => (success), warn: () => (warn) }); // NAMESPACE OBJECT: ./src/utils/index.js var utils_namespaceObject = {}; __webpack_require__.r(utils_namespaceObject); __webpack_require__.d(utils_namespaceObject, { AJARImage: () => (AJARImage), RDFComparePredicateObject: () => (RDFComparePredicateObject), RDFComparePredicateSubject: () => (RDFComparePredicateSubject), addLoadEvent: () => (addLoadEvent), ancestor: () => (ancestor), beep: () => (beep), clearVariableNames: () => (clearVariableNames), emptyNode: () => (emptyNode), escapeForXML: () => (utils_escapeForXML), findPos: () => (findPos), genUuid: () => (genUuid), getAbout: () => (getAbout), getEyeFocus: () => (getEyeFocus), getTarget: () => (getTarget), getTerm: () => (getTerm), hashColor: () => (hashColor), include: () => (include), label: () => (label_label), labelForXML: () => (labelForXML), labelWithOntology: () => (labelWithOntology), newVariableName: () => (newVariableName), ontologyLabel: () => (ontologyLabel), predParentOf: () => (predParentOf), predicateLabel: () => (predicateLabel), predicateLabelForXML: () => (predicateLabelForXML), shortName: () => (shortName), stackString: () => (stackString), syncTableToArray: () => (syncTableToArray), syncTableToArrayReOrdered: () => (syncTableToArrayReOrdered) }); // NAMESPACE OBJECT: ./src/widgets/forms/autocomplete/language.ts var language_namespaceObject = {}; __webpack_require__.r(language_namespaceObject); __webpack_require__.d(language_namespaceObject, { addDefaults: () => (addDefaults), defaultPreferredLanguages: () => (defaultPreferredLanguages), filterByLanguage: () => (filterByLanguage), getPreferredLanguages: () => (getPreferredLanguages), getPreferredLanguagesFor: () => (getPreferredLanguagesFor), languageCodeURIBase: () => (languageCodeURIBase) }); // NAMESPACE OBJECT: ./src/widgets/forms/autocomplete/publicData.ts var publicData_namespaceObject = {}; __webpack_require__.r(publicData_namespaceObject); __webpack_require__.d(publicData_namespaceObject, { AUTOCOMPLETE_LIMIT: () => (AUTOCOMPLETE_LIMIT), ESCOResultToBindings: () => (ESCOResultToBindings), bindingToTerm: () => (bindingToTerm), dbPediaTypeMap: () => (dbPediaTypeMap), dbpediaParameters: () => (dbpediaParameters), escoParameters: () => (escoParameters), fetcherOptionsJsonPublicData: () => (fetcherOptionsJsonPublicData), getDbpediaDetails: () => (getDbpediaDetails), getWikidataDetails: () => (getWikidataDetails), getWikidataDetailsOld: () => (getWikidataDetailsOld), getWikidataLocation: () => (getWikidataLocation), instituteDetailsWikidataQuery: () => (instituteDetailsWikidataQuery), loadFromBindings: () => (loadFromBindings), loadPublicDataThing: () => (loadPublicDataThing), queryESCODataByName: () => (queryESCODataByName), queryPublicDataByName: () => (queryPublicDataByName), queryPublicDataConstruct: () => (queryPublicDataConstruct), queryPublicDataSelect: () => (queryPublicDataSelect), variableNameToPredicateMap: () => (variableNameToPredicateMap), wikidataClasses: () => (wikidataClasses), wikidataIncomingClassMap: () => (wikidataIncomingClassMap), wikidataOutgoingClassMap: () => (wikidataOutgoingClassMap), wikidataParameters: () => (wikidataParameters) }); // NAMESPACE OBJECT: ./src/login/login.ts var login_namespaceObject = {}; __webpack_require__.r(login_namespaceObject); __webpack_require__.d(login_namespaceObject, { ensureLoadedPreferences: () => (ensureLoadedPreferences), ensureLoadedProfile: () => (ensureLoadedProfile), ensureLoggedIn: () => (ensureLoggedIn), filterAvailablePanes: () => (filterAvailablePanes), findAppInstances: () => (findAppInstances), getUserRoles: () => (getUserRoles), loginStatusBox: () => (loginStatusBox), newAppInstance: () => (newAppInstance), registrationControl: () => (registrationControl), registrationList: () => (registrationList), renderScopeHeadingRow: () => (renderScopeHeadingRow), renderSignInPopup: () => (renderSignInPopup), scopeLabel: () => (scopeLabel), selectWorkspace: () => (selectWorkspace) }); // NAMESPACE OBJECT: ./src/widgets/index.js var widgets_namespaceObject = {}; __webpack_require__.r(widgets_namespaceObject); __webpack_require__.d(widgets_namespaceObject, { Group: () => (Group), GroupBuilder: () => (GroupBuilder), GroupPicker: () => (GroupPicker), PeoplePicker: () => (PeoplePicker), Person: () => (Person), addStyleSheet: () => (addStyleSheet), allClassURIs: () => (allClassURIs), appendForm: () => (appendForm), askName: () => (askName), attachmentList: () => (attachmentList), basicField: () => (basicField), buildCheckboxForm: () => (buildCheckboxForm), button: () => (buttons_button), cancelButton: () => (buttons_cancelButton), clearElement: () => (clearElement), complain: () => (complain), continueButton: () => (continueButton), createLinkDiv: () => (createLinkDiv), createLinkForURI: () => (createLinkForURI), createNameDiv: () => (createNameDiv), defaultAnnotationStore: () => (defaultAnnotationStore), deleteButtonWithCheck: () => (deleteButtonWithCheck), editFormButton: () => (editFormButton), errorMessageBlock: () => (errorMessageBlock), extractLogURI: () => (extractLogURI), faviconOrDefault: () => (faviconOrDefault), field: () => (field), fieldFunction: () => (fieldFunction), fieldLabel: () => (fieldLabel), fieldParams: () => (fieldParams), fieldStore: () => (fieldStore), fileUploadButtonDiv: () => (fileUploadButtonDiv), findClosest: () => (findClosest), findImage: () => (findImage), findImageFromURI: () => (findImageFromURI), formatDateTime: () => (formatDateTime), formsFor: () => (formsFor), iconForClass: () => (iconForClass), imagesOf: () => (imagesOf), index: () => (index), isAudio: () => (isAudio), isImage: () => (isImage), isVideo: () => (isVideo), linkButton: () => (linkButton), linkIcon: () => (linkIcon), makeDescription: () => (makeDescription), makeDraggable: () => (makeDraggable), makeDropTarget: () => (makeDropTarget), makeSelectForCategory: () => (makeSelectForCategory), makeSelectForChoice: () => (makeSelectForChoice), makeSelectForClassifierOptions: () => (makeSelectForClassifierOptions), makeSelectForNestedCategory: () => (makeSelectForNestedCategory), makeSelectForOptions: () => (makeSelectForOptions), mostSpecificClassURI: () => (mostSpecificClassURI), newButton: () => (newButton), newThing: () => (newThing), openHrefInOutlineMode: () => (openHrefInOutlineMode), personTR: () => (personTR), promptForNew: () => (promptForNew), propertiesForClass: () => (propertiesForClass), propertyTriage: () => (propertyTriage), publicData: () => (publicData_namespaceObject), refreshTree: () => (refreshTree), removeButton: () => (removeButton), renderAsDiv: () => (renderAsDiv), renderAsRow: () => (renderAsRow), renderAutoComplete: () => (renderAutoComplete), renderAutocompleteControl: () => (renderAutocompleteControl), renderNameValuePair: () => (renderNameValuePair), selectorPanel: () => (selectorPanel), selectorPanelRefresh: () => (selectorPanelRefresh), setImage: () => (setImage), setName: () => (setName), setVisible: () => (setVisible), shortDate: () => (shortDate), shortTime: () => (shortTime), sortByLabel: () => (sortByLabel), sortBySequence: () => (sortBySequence), timestamp: () => (timestamp), uploadFiles: () => (uploadFiles) }); // NAMESPACE OBJECT: ./src/participation.ts var participation_namespaceObject = {}; __webpack_require__.r(participation_namespaceObject); __webpack_require__.d(participation_namespaceObject, { manageParticipation: () => (manageParticipation), participationObject: () => (participationObject), recordParticipation: () => (recordParticipation), renderParticipants: () => (renderParticipants) }); // NAMESPACE OBJECT: ./src/pad.ts var pad_namespaceObject = {}; __webpack_require__.r(pad_namespaceObject); __webpack_require__.d(pad_namespaceObject, { getChunks: () => (getChunks), lightColorHash: () => (lightColorHash), manageParticipation: () => (manageParticipation), notepad: () => (notepad), notepadToHTML: () => (notepadToHTML), participationObject: () => (participationObject), recordParticipation: () => (recordParticipation), renderParticipants: () => (renderParticipants), xmlEncode: () => (xmlEncode) }); // NAMESPACE OBJECT: ./src/preferences.js var preferences_namespaceObject = {}; __webpack_require__.r(preferences_namespaceObject); __webpack_require__.d(preferences_namespaceObject, { get: () => (get), getPreferencesForClass: () => (getPreferencesForClass), recordPersonalDefaults: () => (recordPersonalDefaults), recordSharedPreferences: () => (recordSharedPreferences), renderPreferencesForm: () => (renderPreferencesForm), set: () => (set), value: () => (value) }); // NAMESPACE OBJECT: ./src/tabs.ts var tabs_namespaceObject = {}; __webpack_require__.r(tabs_namespaceObject); __webpack_require__.d(tabs_namespaceObject, { TabWidgetElement: () => (TabWidgetElement), tabWidget: () => (tabWidget) }); // NAMESPACE OBJECT: ./src/create/types.ts var types_namespaceObject = {}; __webpack_require__.r(types_namespaceObject); // EXTERNAL MODULE: ./node_modules/solid-namespace/index.js var solid_namespace = __webpack_require__(386); var solid_namespace_default = /*#__PURE__*/__webpack_require__.n(solid_namespace); // EXTERNAL MODULE: external "$rdf" var external_$rdf_ = __webpack_require__(264); ;// ./src/ns.js // Namespaces we commonly use and have common prefixes for around Solid // Delegate to this which takes RDFlib as param. /* harmony default export */ const src_ns = (solid_namespace_default()(external_$rdf_)); ;// ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function asyncToGenerator_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js var regenerator = __webpack_require__(756); var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator); // EXTERNAL MODULE: external "SolidLogic" var external_SolidLogic_ = __webpack_require__(663); ;// ./src/log.ts // /////////////////////// Logging // // bitmask levels // const TNONE = 0 /** @internal */ var TERROR = 1; /** @internal */ var TWARN = 2; /** @internal */ var TMESG = 4; /** @internal */ var TSUCCESS = 8; /** @internal */ var TINFO = 16; /** @internal */ var TDEBUG = 32; /** @internal */ var TALL = 63; /** @internal */ var LogLevel = /*#__PURE__*/function (LogLevel) { 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"; return LogLevel; }({}); /** @internal */ var _level = TERROR + TWARN + TMESG; /** @internal */ var _ascending = false; /** @internal */ var _dom = document; // must be able to override for tests /** @internal */ var _window = window; // must be able to override for tests /** @internal */ function log(str) { var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TMESG; var typestr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'mesg'; if (!(_level & type)) return; // bitmask if (typeof _dom !== 'undefined') { 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), "
"); if (_ascending) { logArea.insertBefore(addendum, logArea.firstChild); } else { logArea.appendChild(addendum); } } else if (typeof console !== 'undefined') { console.log(str); } } /** * Adds a message to the element with id "status". The messages are prepended with * time and type of message, in this case [mesg]. */ function msg(message) { log(message); } /** * Adds a warning message to the element with id "status". The messages are * prepended with time and type of message, in this case [warn]. */ function warn(message) { log(message, TWARN, 'warn'); } /** * Adds a debugging message to the element with id "status". The messages are * prepended with time and type of message, in this case [dbug]. */ function debug(message) { log(message, TDEBUG, 'dbug'); } /** * Adds a info message to the element with id "status". The messages are * prepended with time and type of message, in this case [info]. */ function info(message) { log(message, TINFO, 'info'); } /** * Adds a error to the element with id "status". The messages are * prepended with time and type of message, in this case [eror]. */ function error(message) { log(message, TERROR, 'eror'); } /** * Adds a success message to the element with id "status". The messages are * prepended with time and type of message, in this case [good]. */ function success(message) { log(message, TSUCCESS, 'good'); } /** * Uses the global alert to send an alert. If global alert is not available, it * will output the message using the method [[warning]]s. */ function log_alert(message) { if (_window && typeof _window.alert !== 'undefined') { _window.alert(message); } else { warn(message); } } /** * Will clear the content of the element with id "status". */ function clear() { var _dom2; var logArea = (_dom2 = _dom) === null || _dom2 === void 0 ? void 0 : _dom2.getElementById('status'); if (!logArea) return; logArea.innerHTML = ''; } /** * Lets you configure which types of messages will be shown. The module uses * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) 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 * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all * types of messages. * * - Error: 1 * - Warning: 2 * - Message: 4 * - Success: 8 * - Info: 16 * - Debug: 32 */ function setLevel(level) { _level = TALL; debug('Log level is now ' + level); _level = level; } /** * Will dump the current HTML using the [[debug]] method. */ function dumpHTML() { var _dom3; if (!_dom) return; var level = _level; _level = TALL; debug(((_dom3 = _dom) === null || _dom3 === void 0 || (_dom3 = _dom3.body) === null || _dom3 === void 0 ? void 0 : _dom3.innerHTML) || ''); _level = level; } /** * Will start prepending messages the list of log messages. */ function logAscending() { _ascending = true; } /** * Will start appending messages the list of log messages. (This is default * behavior.) */ function logDescending() { _ascending = false; } /** @internal */ function escapeForXML(str) { // can be replaced with function utils module when migrating return str.replace(/&/g, '&').replace(//g, '>'); } /** @internal */ function setInternals(window, document) { _window = window; _dom = document; } ;// ./src/utils/label.ts // pull in first avoid cross-refs var UI = { log: log_namespaceObject, ns: src_ns, rdf: external_$rdf_ }; // This ubiquitous function returns the best label for a thing // // The hacks in this code make a major difference to the usability function label_label(thing) { var initialCap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; function doCap(label) { if (initialCap) { return label.slice(0, 1).toUpperCase() + label.slice(1); } return label; } function cleanUp(label) { var result = ''; if (label.slice(-1) === '/') label = label.slice(0, -1); // chop trailing slash for (var i = 0; i < label.length; i++) { if (label[i] === '_' || label[i] === '-') { result += ' '; continue; } result += label[i]; if (i + 1 < label.length && label[i].toUpperCase() !== label[i] && label[i + 1].toLowerCase() !== label[i + 1]) { result += ' '; } } if (result.slice(0, 4) === 'has ') result = result.slice(4); return doCap(result); } var label = getWellKnownLabel(thing); if (label) { return doCap(label.value); } // Default to label just generated from the URI if (thing.termType === 'BlankNode') { return '...'; } if (thing.termType === 'Collection') { return '(' + thing.elements.length + ')'; } var s = thing.uri; if (typeof s === 'undefined') return thing.toString(); // can't be a symbol // s = decodeURI(s) // This can crash is random valid @ signs are presentation // The idea was to clean up eg URIs encoded in query strings // Also encoded character in what was filenames like @ [] {} try { s = s.split('/').map(decodeURIComponent).join('/'); // If it is properly encoded } catch (_e) { // try individual decoding of ASCII code points for (var i = s.length - 3; i > 0; i--) { var hex = '0123456789abcefABCDEF'; // The while upacks multiple layers of encoding while (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'); s = slice(s, '#me'); var hash = s.indexOf('#'); if (hash >= 0) return cleanUp(s.slice(hash + 1)); // Eh? Why not do this? e.g. dc:title needs it only trim URIs, not rdfs:labels var slash = s.lastIndexOf('/', s.length - 2); // (len-2) excludes trailing slash if (slash >= 0 && slash < thing.uri.length) return cleanUp(s.slice(slash + 1)); return doCap(decodeURIComponent(thing.uri)); } function slice(s, suffix) { var length = suffix.length * -1; if (s.slice(length) === suffix) { return s.slice(0, length); } return s; } // Hard coded known label predicates // @@ TBD: Add subproperties of rdfs:label function getWellKnownLabel(thing) { return external_SolidLogic_.store.any(thing, UI.ns.ui('label')) || // Prioritize ui:label external_SolidLogic_.store.any(thing, UI.ns.link('message')) || external_SolidLogic_.store.any(thing, UI.ns.vcard('fn')) || external_SolidLogic_.store.any(thing, UI.ns.foaf('name')) || external_SolidLogic_.store.any(thing, UI.ns.dct('title')) || external_SolidLogic_.store.any(thing, UI.ns.dc('title')) || external_SolidLogic_.store.any(thing, UI.ns.rss('title')) || external_SolidLogic_.store.any(thing, UI.ns.contact('fullName')) || external_SolidLogic_.store.any(thing, external_SolidLogic_.store.sym('http://www.w3.org/2001/04/roadmap/org#name')) || external_SolidLogic_.store.any(thing, UI.ns.cal('summary')) || external_SolidLogic_.store.any(thing, UI.ns.foaf('nick')) || external_SolidLogic_.store.any(thing, UI.ns.as('name')) || external_SolidLogic_.store.any(thing, UI.ns.schema('name')) || external_SolidLogic_.store.any(thing, UI.ns.rdfs('label')) || external_SolidLogic_.store.any(thing, external_SolidLogic_.store.sym('http://www.w3.org/2004/02/skos/core#prefLabel')); } // EXTERNAL MODULE: ./src/debug.ts var src_debug = __webpack_require__(423); ;// ./src/acl/acl.ts /** * Non-UI functions for access control. * See https://github.com/solidos/web-access-control-spec * for the spec that defines how ACL documents work. * @packageDocumentation */ var kb = external_SolidLogic_.solidLogicSingleton.store; /** * Take the "default" ACL and convert it into the equivalent ACL * which the resource would have had. Return it as a new separate store. * The "defaultForNew" predicate is also accepted, as a deprecated * synonym for "default". */ function adoptACLDefault(doc, aclDoc, defaultResource, defaultACLDoc) { var ACL = src_ns.acl; var isContainer = doc.uri.slice(-1) === '/'; // Give default for all directories var defaults = kb.each(undefined, ACL('default'), defaultResource, defaultACLDoc).concat(kb.each(undefined, ACL('defaultForNew'), defaultResource, defaultACLDoc)); var proposed = defaults.reduce(function (accumulatedStatements, da) { return accumulatedStatements.concat(kb.statementsMatching(da, src_ns.rdf('type'), ACL('Authorization'), defaultACLDoc)).concat(kb.statementsMatching(da, ACL('agent'), undefined, defaultACLDoc)).concat(kb.statementsMatching(da, ACL('agentClass'), undefined, defaultACLDoc)).concat(kb.statementsMatching(da, ACL('agentGroup'), undefined, defaultACLDoc)).concat(kb.statementsMatching(da, ACL('origin'), undefined, defaultACLDoc)).concat(kb.statementsMatching(da, ACL('originClass'), undefined, defaultACLDoc)).concat(kb.statementsMatching(da, ACL('mode'), undefined, defaultACLDoc)).concat((0,external_$rdf_.st)(da, ACL('accessTo'), doc, defaultACLDoc)).concat(isContainer ? (0,external_$rdf_.st)(da, ACL('default'), doc, defaultACLDoc) : []); }, []); var kb2 = (0,external_$rdf_.graph)(); // Potential - derived is kept apart proposed.forEach(function (st) { return kb2.add(move(st.subject), move(st.predicate), move(st.object), (0,external_$rdf_.sym)(aclDoc.uri)); }); return kb2; function move(symbol) { var y = defaultACLDoc.uri.length; // The default ACL file return (0,external_$rdf_.sym)(symbol.uri.slice(0, y) === defaultACLDoc.uri ? aclDoc.uri + symbol.uri.slice(y) : symbol.uri); } } /** * Read and canonicalize the ACL for x in aclDoc * * Accumulate the access rights which each agent or class has */ function readACL(doc, aclDoc) { var kb2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : kb; var getDefaults = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; var auths = getDefaults ? getDefaultsFallback(kb2, src_ns) : kb2.each(undefined, src_ns.acl('accessTo'), doc); var ACL = src_ns.acl; var ac = { agent: {}, agentClass: {}, agentGroup: {}, origin: {}, originClass: {} }; 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; // could be "true" but leave pointer just in case }); }); }); }); return ac; function getDefaultsFallback(kb, ns) { return kb.each(undefined, ns.acl('default'), doc).concat(kb.each(undefined, ns.acl('defaultForNew'), doc)); } } /** * Compare two ACLs */ function sameACL(a, b) { var contains = function contains(a, b) { for (var pred in { agent: true, agentClass: true, agentGroup: true, origin: true, originClass: true }) { 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 false; } } } } } return true; }; return contains(a, b) && contains(b, a); } /** * Union N ACLs */ function ACLunion(list) { var b = list[0]; var a, ag; var _loop = function _loop(k) { ; ['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(function (pred) { a = list[k]; if (a[pred]) { for (ag in a[pred]) { for (var mode in a[pred][ag]) { if (!b[pred][ag]) b[pred][ag] = []; b[pred][ag][mode] = true; } } } }); }; for (var k = 1; k < list.length; k++) { _loop(k); } return b; } /** * Merge ACLs lists from things to form union */ function loadUnionACL(subjectList, callbackFunction) { var aclList = []; var _doList = function doList(list) { if (list.length) { var doc = list.shift().doc(); getACLorDefault(doc, function (ok, p2, targetDoc, targetACLDoc, defaultHolder, defaultACLDoc) { var defa = !p2; if (!ok || !defaultHolder || !defaultACLDoc) return callbackFunction(ok, targetACLDoc); var acl = defa ? readACL(defaultHolder, defaultACLDoc) : readACL(targetDoc, targetACLDoc); aclList.push(acl); _doList(list.slice(1)); }); } else { // all gone callbackFunction(true, ACLunion(aclList)); } }; _doList(subjectList); } /** * Represents these as an RDF graph by combination of modes * * Each agent can only be in one place in this model, one combination of modes. * Combos are like full control, read append, read only etc. */ function ACLbyCombination(ac) { var byCombo = {}; ['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(function (pred) { for (var agent in ac[pred]) { var combo = []; for (var mode in ac[pred][agent]) { combo.push(mode); } combo.sort(); var combo2 = combo.join('\n'); if (!byCombo[combo2]) byCombo[combo2] = []; byCombo[combo2].push([pred, agent]); } }); return byCombo; } /** * Write ACL graph to store from AC */ function makeACLGraph(kb, x, ac, aclDoc) { var byCombo = ACLbyCombination(ac); return makeACLGraphbyCombo(kb, x, byCombo, aclDoc); } /** * Write ACL graph to store from combo */ function makeACLGraphbyCombo(kb, x, byCombo, aclDoc, main, defa) { var ACL = src_ns.acl; for (var combo in byCombo) { var pairs = byCombo[combo]; if (!pairs.length) continue; // do not add to store when no agent var modeURIs = combo.split('\n'); var _short = modeURIs.map(function (u) { return u.split('#')[1]; }).join(''); if (defa && !main) _short += 'Default'; // don't muddle authorizations var a = kb.sym(aclDoc.uri + '#' + _short); kb.add(a, src_ns.rdf('type'), ACL('Authorization'), aclDoc); if (main) { kb.add(a, ACL('accessTo'), x, aclDoc); } if (defa) { kb.add(a, ACL('default'), x, aclDoc); } for (var i = 0; i < modeURIs.length; i++) { kb.add(a, ACL('mode'), kb.sym(modeURIs[i]), aclDoc); } for (var _i = 0; _i < pairs.length; _i++) { var pred = pairs[_i][0]; var ag = pairs[_i][1]; kb.add(a, ACL(pred), kb.sym(ag), aclDoc); } } } /** * Debugging short strings for dumping ACL * and possibly in the UI */ function ACLToString(ac) { return comboToString(ACLbyCombination(ac)); } /** * Convert a [[ComboList]] to a string */ function comboToString(byCombo) { var str = ''; for (var combo in byCombo) { var modeURIs = combo.split('\n'); var initials = modeURIs.map(function (u) { return u.split('#')[1][0]; }).join(''); str += initials + ':'; var pairs = byCombo[combo]; for (var i = 0; i < pairs.length; i++) { var pred = pairs[i][0]; var ag = (0,external_$rdf_.sym)(pairs[i][1]); str += pred === 'agent' ? '@' : ''; str += ag.sameTerm(src_ns.foaf('Agent')) ? '*' : label_label(ag); if (i < pairs.length - 1) str += ','; } str += ';'; } return '{' + str.slice(0, -1) + '}'; // drop extra semicolon } /** * Write ACL graph as Turtle */ function makeACLString(x, ac, aclDoc) { var kb2 = (0,external_$rdf_.graph)(); makeACLGraph(kb2, x, ac, aclDoc); return (0,external_$rdf_.serialize)(aclDoc, kb2, aclDoc.uri, 'text/turtle') || ''; } /** * Write ACL graph to web */ function putACLObject(kb, x, ac, aclDoc, callbackFunction) { var byCombo = ACLbyCombination(ac); return putACLbyCombo(kb, x, byCombo, aclDoc, callbackFunction); } /** * Write ACL graph to web from a [[ComboList]] */ function putACLbyCombo(kb, x, byCombo, aclDoc, callbackFunction) { var _kb$updater; var kb2 = (0,external_$rdf_.graph)(); makeACLGraphbyCombo(kb2, x, byCombo, aclDoc, true); // const str = makeACLString = function(x, ac, aclDoc) (_kb$updater = kb.updater) === null || _kb$updater === void 0 || _kb$updater.put(aclDoc, kb2.statementsMatching(undefined, undefined, undefined, aclDoc), 'text/turtle', function (uri, ok, message) { if (!ok) { callbackFunction(ok, message); } else { var _kb$fetcher; (_kb$fetcher = kb.fetcher) === null || _kb$fetcher === void 0 || _kb$fetcher.unload(aclDoc); makeACLGraphbyCombo(kb, x, byCombo, aclDoc, true); kb.fetcher.requested[aclDoc.uri] = 'done'; // missing: save headers callbackFunction(ok); } }); } /** * Fix the ACl for an individual card as a function of the groups it is in * * All group files must be loaded first */ function fixIndividualCardACL(person, log, callbackFunction) { var groups = kb.each(undefined, src_ns.vcard('hasMember'), person); // const doc = person.doc() if (groups) { fixIndividualACL(person, groups, log, callbackFunction); } else { log('This card is in no groups'); callbackFunction(true); // fine, no requirements to access. default should be ok } // @@ if no groups, then use default for People container or the book top container.? } /** * This function is used by [[fixIndividualCardACL]] */ function fixIndividualACL(item, subjects, log, callbackFunction) { log = log || src_debug/* log */.Rm; var doc = item.doc(); getACLorDefault(doc, function (ok, exists, targetDoc, targetACLDoc, defaultHolder, defaultACLDoc) { if (!ok || !defaultHolder || !defaultACLDoc) return callbackFunction(false, targetACLDoc); // ie message var ac = exists ? readACL(targetDoc, targetACLDoc) : readACL(defaultHolder, defaultACLDoc); loadUnionACL(subjects, function (ok, union) { if (!ok) return callbackFunction(false, union); if (sameACL(union, ac)) { log('Nice - same ACL. no change ' + label_label(item) + ' ' + doc); } else { log('Group ACLs differ for ' + label_label(item) + ' ' + doc); // log("Group ACLs: " + makeACLString(targetDoc, union, targetACLDoc)) // log((exists ? "Previous set" : "Default") + " ACLs: " + // makeACLString(targetDoc, ac, targetACLDoc)) putACLObject(kb, targetDoc, union, targetACLDoc, callbackFunction); } }); }); } /** * Set an ACL */ function setACL(docURI, aclText, callbackFunction) { var aclDoc = kb.any(docURI, external_SolidLogic_.ACL_LINK); // @@ check that this get set by web.js if (!kb.fetcher) { throw new Error('Store has no fetcher'); } if (aclDoc) { // Great we already know where it is kb.fetcher.webOperation('PUT', aclDoc.value, { data: aclText, contentType: 'text/turtle' }).then(function (res) { callbackFunction(res.ok, res.error || ''); }); // @@@ check params } else { kb.fetcher.nowOrWhenFetched(docURI, undefined, function (ok, body) { if (!ok) return callbackFunction(ok, 'Gettting headers for ACL: ' + body); var aclDoc = kb.any(docURI, external_SolidLogic_.ACL_LINK); // @@ check that this get set by web.js if (!aclDoc) { // complainIfBad(false, "No Link rel=ACL header for " + docURI) callbackFunction(false, 'No Link rel=ACL header for ' + docURI); } else { 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 || ''); }); } }); } } /** * Get ACL file or default if necessary * * @param callbackFunction Will be called in the following ways, in the following cases: * * `callbackFunction(true, true, doc, aclDoc)` if the ACL did exist * * `callbackFunction(true, false, doc, aclDoc, defaultHolder, defaultACLDoc)` if the ACL file did not exist but a default did * * `callbackFunction(false, false, status, message)` when there was an error getting the original * * `callbackFunction(false, true, status, message)` when there was an error getting the default */ function getACLorDefault(doc, callbackFunction) { getACL(doc, function (ok, status, aclDoc, message) { var ACL = src_ns.acl; if (!ok) return callbackFunction(false, false, status, message); // Recursively search for the ACL file which gives default access var _tryParent = function tryParent(uri) { if (uri.slice(-1) === '/') { uri = uri.slice(0, -1); } var right = uri.lastIndexOf('/'); var left = uri.indexOf('/', uri.indexOf('//') + 2); if (left > right) { return callbackFunction(false, true, 404, 'Found no ACL resource'); } uri = uri.slice(0, right + 1); var doc2 = (0,external_$rdf_.sym)(uri); getACL(doc2, function (ok, status, defaultACLDoc) { if (!ok) { return callbackFunction(false, true, status, "( No ACL pointer ".concat(uri, " ").concat(status, ")").concat(defaultACLDoc)); } else if (status === 403) { return callbackFunction(false, true, status, "( default ACL file FORBIDDEN. Stop.".concat(uri, ")")); } else if (status === 404) { return _tryParent(uri); } else if (status !== 200) { return callbackFunction(false, true, status, "Error status '".concat(status, "' searching for default for ").concat(doc2)); } // 200 // statusBlock.textContent += (" ACCESS set at " + uri + ". End search.") var defaults = kb.each(undefined, ACL('default'), kb.sym(uri), defaultACLDoc).concat(kb.each(undefined, ACL('defaultForNew'), kb.sym(uri), defaultACLDoc)); if (!defaults.length) { return _tryParent(uri); // Keep searching } var defaultHolder = kb.sym(uri); return callbackFunction(true, false, doc, aclDoc, defaultHolder, defaultACLDoc); }); }; // tryParent if (!ok) { return callbackFunction(false, false, status, "Error accessing Access Control information for ".concat(doc, ") ").concat(message)); } else if (status === 404) { _tryParent(doc.uri); // @@ construct default one - the server should do that } else if (status === 403) { return callbackFunction(false, false, status, "(Sharing not available to you)".concat(message)); } else if (status !== 200) { return callbackFunction(false, false, status, "Error ".concat(status, " accessing Access Control information for ").concat(doc, ": ").concat(message)); } else { // 200 return callbackFunction(true, true, doc, aclDoc); } }); // Call to getACL } /** * Calls back `(ok, status, acldoc, message)` as follows * * * `(false, 900, errormessage)` if no link header * * `(true, 403, documentSymbol, fileaccesserror)` if not authorized * * `(true, 404, documentSymbol, fileaccesserror)` if does not exist * * `(true, 200, documentSymbol)` if file exists and read OK */ function getACL(doc, callbackFunction) { if (!kb.fetcher) { throw new Error('kb has no fetcher'); } kb.fetcher.nowOrWhenFetched(doc, undefined, 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, external_SolidLogic_.ACL_LINK); // @@ check that this get set by web.js if (!aclDoc) { callbackFunction(false, 900, "No Link rel=ACL header for ".concat(doc)); } else { if (!kb.fetcher) { throw new Error('kb has no fetcher'); } if (kb.fetcher.nonexistent[aclDoc.value]) { return callbackFunction(true, 404, aclDoc, "ACL file ".concat(aclDoc, " does not exist.")); } kb.fetcher.nowOrWhenFetched(aclDoc, undefined, function (ok, message, response) { if (!ok) { callbackFunction(true, response.status, aclDoc, "Can't read Access Control File ".concat(aclDoc, ": ").concat(message)); } else { callbackFunction(true, 200, aclDoc); } }); } }); } /** * Calls [[getACLorDefault]] and then (?) */ function getProspectiveHolder(_x) { return _getProspectiveHolder.apply(this, arguments); } function _getProspectiveHolder() { _getProspectiveHolder = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(targetDirectory) { return regenerator_default().wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: return _context.abrupt("return", new Promise(function (resolve, reject) { return getACLorDefault((0,external_$rdf_.sym)(targetDirectory), function (ok, isDirectACL, targetDoc, targetACLDoc, defaultHolder) { if (ok) { return resolve(isDirectACL ? targetDoc : defaultHolder); } return reject(new Error("Error loading ".concat(targetDirectory))); }); })); case 1: case "end": return _context.stop(); } }, _callee); })); return _getProspectiveHolder.apply(this, arguments); } ;// ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js function classCallCheck_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } ;// ./node_modules/@babel/runtime/helpers/esm/typeof.js function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } ;// ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js function toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } ;// ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } ;// ./node_modules/@babel/runtime/helpers/esm/createClass.js function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); } } function createClass_createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } ;// ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } ;// ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } ;// ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } ;// ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } ;// ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } // EXTERNAL MODULE: ./node_modules/mime-types/index.js var mime_types = __webpack_require__(49); ;// ./src/styleConstants.js /* harmony default export */ const styleConstants = ({ highlightColor: '#7C4DFF', // Solid lavender https://design.inrupt.com/atomic-core/?cat=Core formBorderColor: '#888888', // Mid-grey formHeadingColor: '#888888', // originally was brown; now grey lowProfileLinkColor: '#3B5998', // Grey-blue, e.g., for field labels linking to ontology formFieldNameBoxWidth: '8em', // The fixed amount to get form fields to line up // We put in the latter when switching away from using tables. However, getting // alignment between fields in different groups is a hard problem. mediaModuleCanvasWidth: '640', mediaModuleCanvasHeight: '480', textInputSize: 20, // Rough default text input size, in characters tabBorderRadius: '0.2em', textInputBackgroundColor: '#eef', textInputBackgroundColorUneditable: '#fff', textInputColor: '#000', textInputColorPending: '#888', defaultErrorBackgroundColor: '#fee', participationDefaultBackground: 'white', basicMaxLength: '4096' }); ;// ./src/style.js // Common readable consistent stylesheet // to avoid using style sheets which are document-global // and make programmable style toggling with selection, drag over, etc easier // These must all end with semicolon so they can be appended to. var style = { // styleModule 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: // Color difference only 'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;', buttonStyle: 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;', // 'background-color: #eef; 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;', // combine with buttonStyle confirmPopupStyle: 'padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;', 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;', // Contacts 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;', // Login buttons signInAndUpButtonStyle: 'padding: 1em; border-radius:0.2em; font-size: 100%;', // was 0.5em radius headerBannerLoginInput: 'margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important;', signUpBackground: 'background-color: #eef;', signInBackground: 'background-color: #efe;', // Forms heading1Style: 'font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;', // originally was brown; now grey heading2Style: 'font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;', // originally was brown; now grey heading3Style: 'font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;', // For example, in large forms or before a small form heading4Style: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // Lowest level used by default in small things formHeadingStyle: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // originally was brown; now grey formTextInput: 'font-size: 100%; margin: 0.1em; padding: 0.1em;', // originally used this formGroupStyle: ["padding-left: 0em; border: 0.0em solid ".concat(styleConstants.formBorderColor, "; border-radius: 0.2em;"), // weight 0 "padding-left: 2em; border: 0.05em solid ".concat(styleConstants.formBorderColor, "; border-radius: 0.2em;"), "padding-left: 2em; border: 0.1em solid ".concat(styleConstants.formBorderColor, "; border-radius: 0.2em;"), "padding-left: 2em; border: 0.2em solid ".concat(styleConstants.formBorderColor, "; border-radius: 0.2em;") // @@ pink ], formFieldLabelStyle: "color: ".concat(styleConstants.lowProfileLinkColor, "; text-decoration: none;"), formFieldNameBoxStyle: "padding: 0.3em; vertical-align: middle; width:".concat(styleConstants.formFieldNameBoxWidth, ";"), multilineTextInputStyle: 'font-size:100%; white-space: pre-wrap; background-color: #eef;' + ' border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;', // Buttons 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;', // ACL 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; border-radius: 1em; border-width: 0.1em;', temporaryStatusInit: 'background: green;', temporaryStatusEnd: 'background: transparent; transition: background 5s linear;', // header 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;', 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;', // may just be 65px round($icon-size * 352 / 322); // footer footer: 'border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em;', // buttons 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;', // media controlStyle: "border-radius: 0.5em; margin: 0.8em; width:".concat(styleConstants.mediaModuleCanvasWidth, "; height:").concat(styleConstants.mediaModuleCanvasHeight, ";"), // dragAndDrop dragEvent: 'background-color: #ccc; border: 0.25em dashed black; border-radius: 0.3em;', dropEvent: 'background-color: white; border: 0em solid black;', restoreStyle: 'background-color: white;', // errors errorCancelButton: 'width: 2em; height: 2em; align: right;', errorMessageBlockStyle: 'margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; color:black;', // pad notepadStyle: 'padding: 1em; overflow: auto; resize: horizontal; min-width: 40em;', upstreamStatus: 'width: 50%;', downstreamStatus: 'width: 50%;', baseStyle: 'font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;', headingCore: 'font-family: sans-serif; font-weight: bold; border: none;', headingStyle: ['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%;'], // participation participantsStyle: 'margin: 0.8em;', participantsBlock: 'height: 1.5em; width: 1.5em; margin: 0.3em; border 0.01em solid #888;', personTableTD: 'vertical-align: middle;', // tabs tabsNavElement: 'margin: 0;', tabsRootElement: 'display: flex; height: 100%; width: 100%;', tabsMainElement: 'margin: 0; width:100%; height: 100%;', tabContainer: 'list-style-type: none; display: flex; height: 100%; width: 100%; margin: 0; padding: 0;', makeNewSlot: 'background: none; border: none; font: inherit; cursor: pointer;', ellipsis: 'position: absolute; right: 0; bottom: 0; width: 20%; background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit;' }; style.setStyle = function setStyle(ele, styleName) { ele.style = style[styleName]; }; ;// ./src/widgets/dragAndDrop.js /* Drag and drop common functionality * * It is easy to make something draggable, or to make it a drag target! * Just call the functions below. In a Solid world, any part of the UI which * represents one thing which has a URI, should be made draggable using makeDraggable. * Any list of things should typically allow you to drag new members of the list * onto it. * The file upload function, uploadFiles, is provided as often as someone drags a file from the computer * desktop. You may want to upload it into the pod. */ /* global FileReader alert */ function makeDropTarget(ele, droppedURIHandler, droppedFileHandler) { var dragoverListener = function dragoverListener(e) { e.preventDefault(); // Need this; otherwise, drop does not work. e.dataTransfer.dropEffect = 'copy'; }; var dragenterListener = function dragenterListener(e) { src_debug/* log */.Rm('dragenter event dropEffect: ' + e.dataTransfer.dropEffect); if (this.localStyle) { // necessary not sure when if (!this.savedStyle) { this.savedStyle = style.dragEvent; } } e.dataTransfer.dropEffect = 'link'; src_debug/* log */.Rm('dragenter event dropEffect 2: ' + e.dataTransfer.dropEffect); }; var dragleaveListener = function dragleaveListener(e) { src_debug/* log */.Rm('dragleave event dropEffect: ' + e.dataTransfer.dropEffect); if (this.savedStyle) { this.localStyle = this.savedStyle; } else { this.localStyle = style.dropEvent; } }; var dropListener = function dropListener(e) { if (e.preventDefault) e.preventDefault(); // stops the browser from redirecting off to the text. src_debug/* log */.Rm('Drop event. dropEffect: ' + e.dataTransfer.dropEffect); src_debug/* log */.Rm('Drop event. types: ' + (e.dataTransfer.types ? e.dataTransfer.types.join(', ') : 'NOPE')); var uris = null; var text; if (e.dataTransfer.types) { for (var t = 0; t < e.dataTransfer.types.length; t++) { var type = e.dataTransfer.types[t]; if (type === 'text/uri-list') { uris = e.dataTransfer.getData(type).split('\n'); // @ ignore those starting with # src_debug/* log */.Rm('Dropped text/uri-list: ' + uris); } else if (type === 'text/plain') { text = e.dataTransfer.getData(type); } else if (type === 'Files' && droppedFileHandler) { var files = e.dataTransfer.files; // FileList object. for (var i = 0; files[i]; i++) { var f = files[i]; src_debug/* log */.Rm('Filename: ' + f.name + ', type: ' + (f.type || 'n/a') + ' size: ' + f.size + ' bytes, last modified: ' + (f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a')); } droppedFileHandler(files); } } if (uris === null && text && text.slice(0, 4) === 'http') { uris = text; src_debug/* log */.Rm('Waring: Poor man\'s drop: using text for URI'); // chrome disables text/uri-list?? } } else { // ... however, if we're IE, we don't have the .types property, so we'll just get the Text value uris = [e.dataTransfer.getData('Text')]; src_debug/* log */.Rm('WARNING non-standard drop event: ' + uris[0]); } src_debug/* log */.Rm('Dropped URI list (2): ' + uris); if (uris) { droppedURIHandler(uris); } this.localStyle = style.restoreStyle; // restore style return false; }; // dropListener var addTargetListeners = function addTargetListeners(ele) { if (!ele) { src_debug/* log */.Rm('@@@ addTargetListeners: ele ' + ele); } ele.addEventListener('dragover', dragoverListener); ele.addEventListener('dragenter', dragenterListener); ele.addEventListener('dragleave', dragleaveListener); ele.addEventListener('drop', dropListener); }; addTargetListeners(ele, droppedURIHandler); } // listen for dropped URIs // Make an HTML element draggable as a URI-identified thing // // Possibly later set the drag image too? // function makeDraggable(tr, obj) { tr.setAttribute('draggable', 'true'); // Stop the image being dragged instead - just the TR 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); src_debug/* log */.Rm('Dragstart: ' + tr + ' -> ' + obj + 'de: ' + e.dataTransfer.dropEffect); }, false); tr.addEventListener('drag', function (e) { e.preventDefault(); e.stopPropagation(); // debug.log('Drag: dropEffect: ' + e.dataTransfer.dropEffect) }, false); tr.addEventListener('dragend', function (e) { tr.style.fontWeight = 'normal'; src_debug/* log */.Rm('Dragend dropeffect: ' + e.dataTransfer.dropEffect); src_debug/* log */.Rm('Dragend: ' + tr + ' -> ' + obj); }, false); } /** uploadFiles ** ** Generic uploader of local files to the web ** typically called from dropped file handler ** ** @param {Fetcher} fetcher instance of class Fetcher as in kb.fetcher ** @param {Array} files Array of file objects ** @param {String} fileBase URI of folder in which to put files (except images) (no trailing slash) ** @param {String } imageBase URI of folder in which to put images ** @param successHandler function(file, uploadedURI) Called after EACH success upload ** With file object an final URI as params */ function uploadFiles(fetcher, files, fileBase, imageBase, successHandler) { for (var i = 0; files[i]; i++) { var f = files[i]; src_debug/* log */.Rm(' dropped: Filename: ' + f.name + ', type: ' + (f.type || 'n/a') + ' size: ' + f.size + ' bytes, last modified: ' + (f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a')); // See e.g. https://www.html5rocks.com/en/tutorials/file/dndfiles/ // @@ Add: progress bar(s) var reader = new FileReader(); reader.onload = function (theFile) { return function (e) { var data = e.target.result; var suffix = ''; src_debug/* log */.Rm(' File read byteLength : ' + data.byteLength); var contentType = theFile.type; if (!theFile.type || theFile.type === '') { // Not known by browser contentType = mime_types.lookup(theFile.name); if (!contentType) { var msg = 'Filename needs to have an extension which gives a type we know: ' + theFile.name; src_debug/* log */.Rm(msg); alert(msg); throw new Error(msg); } } else { var extension = mime_types.extension(theFile.type); // Note not simple: eg .mp3 => audio/mpeg; .mpga => audio/mpeg; audio/mp3 => .mp3 if (extension && extension !== 'false' && !theFile.name.endsWith('.' + extension) && // Not already has preferred extension? and ... theFile.type !== mime_types.lookup(theFile.name)) { // the mime type of this ext is not the right one? suffix = '_.' + extension; // console.log('MIME TYPE MISMATCH: ' + mime.lookup(theFile.name) + ': adding extension: ' + suffix) } } var folderName = theFile.type.startsWith('image/') ? imageBase || fileBase : fileBase; var destURI = folderName + (folderName.endsWith('/') ? '' : '/') + encodeURIComponent(theFile.name) + suffix; fetcher.webOperation('PUT', destURI, { data: data, contentType: contentType }).then(function (_response) { src_debug/* log */.Rm(' Upload: put OK: ' + destURI); successHandler(theFile, destURI); }, function (error) { var msg = ' Upload: FAIL ' + destURI + ', Error: ' + error; src_debug/* log */.Rm(msg); alert(msg); throw new Error(msg); }); }; }(f); reader.readAsArrayBuffer(f); } } // EXTERNAL MODULE: ./src/iconBase.ts var iconBase = __webpack_require__(378); ;// ./src/utils/index.js // Solid-UI general Utilities // ========================== // // This must load AFTER the rdflib.js and log-ext.js (or log.js). // // pull in first avoid cross-refs var utils_UI = { log: log_namespaceObject, ns: src_ns, rdf: external_$rdf_ }; var nextVariable = 0; function newVariableName() { return 'v' + nextVariable++; } function clearVariableNames() { nextVariable = 0; } // http://stackoverflow.com/questions/879152/how-do-i-make-javascript-beep // http://www.tsheffler.com/blog/2013/05/14/audiocontext-noteonnoteoff-and-time-units/ var audioContext; if (typeof AudioContext !== 'undefined') { audioContext = AudioContext; } else if (typeof window !== 'undefined') { audioContext = window.AudioContext || window.webkitAudioContext; } function beep() { if (!audioContext) { return; } // Safari 2015 var ContextClass = audioContext; var ctx = new ContextClass(); return function (duration, frequency, type, finishedCallback) { duration = +(duration || 0.3); // Only 0-4 are valid types. type = type || 'sine'; // sine, square, sawtooth, triangle if (typeof finishedCallback !== 'function') { 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); }; } // Make pseudorandom color from a uri // NOT USED ANYWHERE function hashColor(who) { who = who.uri || who; var hash = function hash(x) { return x.split('').reduce(function (a, b) { a = (a << 5) - a + b.charCodeAt(0); return a & a; }, 0); }; return '#' + (hash(who) & 0xffffff | 0xc0c0c0).toString(16); // c0c0c0 or 808080 forces pale } function genUuid() { // http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0; var v = c === 'x' ? r : r & 0x3 | 0x8; return v.toString(16); }); } /** Sync a DOM table with an array of things * * @param {DomElement} table - will have a tr for each thing * @param {Array} things - ORDERED array of NamedNode objects * @param {function({NamedNode})} createNewRow(thing) returns a TR table row for a new thing * * Tolerates out of order elements but puts new ones in order. * Can be used for any element type; does not have to be a table and tr. */ function syncTableToArray(table, things, createNewRow) { var foundOne; var row; var i; for (i = 0; i < table.children.length; i++) { row = table.children[i]; row.trashMe = true; } for (var g = 0; g < things.length; g++) { var thing = things[g]; foundOne = false; for (i = 0; i < table.children.length; i++) { row = table.children[i]; if (row.subject && row.subject.sameTerm(thing)) { row.trashMe = false; foundOne = true; break; } } if (!foundOne) { var newRow = createNewRow(thing); // Insert new row in position g in the table to match array if (g >= table.children.length) { table.appendChild(newRow); } else { var ele = table.children[g]; table.insertBefore(newRow, ele); } newRow.subject = thing; } // if not foundOne } // loop g for (i = 0; i < table.children.length; i++) { row = table.children[i]; if (row.trashMe) { table.removeChild(row); } } } // syncTableToArray /** Sync a DOM table with an array of things * * @param {DomElement} table - will have a tr for each thing * @param {Array} things - ORDERED array of UNIQUE NamedNode objects. No duplicates * @param {function({NamedNode})} createNewRow(thing) returns a rendering of a new thing * * Ensures order matches exacly. We will re-rder existing elements if necessary * Can be used for any element type; does not have to be a table and tr. * Any RDF node value can only appear ONCE in the array */ function syncTableToArrayReOrdered(table, things, createNewRow) { var elementMap = {}; for (var i = 0; i < table.children.length; i++) { var row = table.children[i]; elementMap[row.subject.toNT()] = row; // More sophisticaed would be to have a bag of duplicates } for (var g = 0; g < things.length; g++) { var thing = things[g]; if (g >= table.children.length) { // table needs extending 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); // Insert existing row in place of this one } else { var _newRow = createNewRow(thing); _row.before(_newRow); // Insert existing row in place of this one _newRow.subject = thing; } } } } // loop g // Lop off any we don't need any more: while (table.children.length > things.length) { table.removeChild(table.children[table.children.length - 1]); } } // syncTableToArrayReOrdered /* Error stack to string for better diagnotsics ** ** See http://snippets.dzone.com/posts/show/6632 */ function stackString(e) { var str = '' + e + '\n'; var i; if (!e.stack) { return str + 'No stack available.\n'; } var lines = e.stack.toString().split('\n'); var toPrint = []; for (i = 0; i < lines.length; i++) { var line = lines[i]; if (line.indexOf('ecmaunit.js') > -1) { // remove useless bit of traceback break; } if (line.charAt(0) === '(') { line = 'function' + line; } var chunks = line.split('@'); toPrint.push(chunks); } // toPrint.reverse(); No - I prefer the latest at the top by the error message -tbl for (i = 0; i < toPrint.length; i++) { str += ' ' + toPrint[i][1] + '\n ' + toPrint[i][0]; } return str; } function emptyNode(node) { var nodes = node.childNodes; var len = nodes.length; for (var i = len - 1; i >= 0; i--) node.removeChild(nodes[i]); return node; } function getTarget(e) { var target; e = e || window.event; if (e.target) target = e.target;else if (e.srcElement) target = e.srcElement; if (target.nodeType === 3) { // defeat Safari bug [sic] target = target.parentNode; } // UI.log.debug("Click on: " + target.tagName) return target; } function ancestor(target, tagName) { var level; for (level = target; level; level = level.parentNode) { // UI.log.debug("looking for "+tagName+" Level: "+level+" "+level.tagName) try { if (level.tagName === tagName) return level; } catch (e) { // can hit "TypeError: can't access dead object" in ffox return undefined; } } return undefined; } function getAbout(kb, target) { var level, aa; for (level = target; level && level.nodeType === 1; level = level.parentNode) { // UI.log.debug("Level "+level + ' '+level.nodeType + ': '+level.tagName) aa = level.getAttribute('about'); if (aa) { // UI.log.debug("kb.fromNT(aa) = " + kb.fromNT(aa)) return kb.fromNT(aa); // } else { // if (level.tagName=='TR') return undefined//this is to prevent literals passing through } } utils_UI.log.debug('getAbout: No about found'); return undefined; } function getTerm(target) { var statementTr = target.parentNode; var st = statementTr ? statementTr.AJAR_statement : undefined; var className = st ? target.className : ''; // if no st then it's necessary to use getAbout switch (className) { case 'pred': case 'pred selected': return st.predicate; case 'obj': case 'obj selected': if (!statementTr.AJAR_inverse) { return st.object; } else { return st.subject; } case '': case 'selected': // header TD return getAbout(external_SolidLogic_.store, target); // kb to be changed case 'undetermined selected': return target.nextSibling ? st.predicate : !statementTr.AJAR_inverse ? st.object : st.subject; } } function include(document, linkstr) { var lnk = document.createElement('script'); lnk.setAttribute('type', 'text/javascript'); lnk.setAttribute('src', linkstr); // TODO:This needs to be fixed or no longer used. // document.getElementsByTagName('head')[0].appendChild(lnk) return lnk; } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload !== 'function') { window.onload = func; } else { window.onload = function () { oldonload(); func(); }; } } // addLoadEvent // Find the position of an object relative to the window function findPos(obj) { // C&P from http://www.quirksmode.org/js/findpos.html var myDocument = obj.ownerDocument; var DocBox = myDocument.documentElement.getBoundingClientRect(); var box = obj.getBoundingClientRect(); return [box.left - DocBox.left, box.top - DocBox.top]; } function getEyeFocus(element, instantly, isBottom, myWindow) { if (!myWindow) myWindow = window; var elementPosY = findPos(element)[1]; var appContext = window.SolidAppContext || {}; var scrollDiff = appContext && appContext.scroll || 52; // 52 = magic number for web-based version var totalScroll = elementPosY - scrollDiff - myWindow.scrollY; if (instantly) { if (isBottom) { myWindow.scrollBy(0, elementPosY + element.clientHeight - (myWindow.scrollY + myWindow.innerHeight)); return; } myWindow.scrollBy(0, totalScroll); return; } var id = myWindow.setInterval(scrollAmount, 50); var times = 0; function scrollAmount() { myWindow.scrollBy(0, totalScroll / 10); times++; if (times === 10) { myWindow.clearInterval(id); } } } function AJARImage(src, alt, tt, doc) { if (!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(); // We want no title data to be written to the clipboard }); // if (typeof alt != 'undefined') // Messes up cut-and-paste of text // image.setAttribute('alt', alt) if (typeof tt !== 'undefined') { image.setAttribute('title', tt); } return image; } // Make short name for ontology function shortName(uri) { var p = uri; if ('#/'.indexOf(p[p.length - 1]) >= 0) p = p.slice(0, -1); var namespaces = []; for (var _ns in this.prefixes) { namespaces[this.prefixes[_ns]] = _ns; // reverse index } var pok; var canUse = function canUse(pp) { // if (!__Serializer.prototype.validPrefix.test(pp)) return false; // bad format if (pp === 'ns') return false; // boring // if (pp in this.namespaces) return false; // already used // this.prefixes[uri] = pp; // this.namespaces[pp] = uri; pok = pp; return true; }; var i; var hash = p.lastIndexOf('#'); if (hash >= 0) p = p.slice(hash - 1); // lop off localid // eslint-disable-next-line no-unreachable-loop for (;;) { var slash = p.lastIndexOf('/'); if (slash >= 0) p = p.slice(slash + 1); i = 0; while (i < p.length) { if (this.prefixchars.indexOf(p[i])) i++;else break; } p = p.slice(0, i); if (p.length < 6 && canUse(p)) return pok; // exact i sbest if (canUse(p.slice(0, 3))) return pok; if (canUse(p.slice(0, 2))) return pok; if (canUse(p.slice(0, 4))) return pok; if (canUse(p.slice(0, 1))) return pok; if (canUse(p.slice(0, 5))) return pok; for (i = 0;; i++) if (canUse(p.slice(0, 3) + i)) return pok; } } // Short name for an ontology function ontologyLabel(term) { if (term.uri === undefined) return '??'; var s = term.uri; var namespaces = []; var i = s.lastIndexOf('#'); var part; if (i >= 0) { s = s.slice(0, i + 1); } else { i = s.lastIndexOf('/'); if (i >= 0) { s = s.slice(0, i + 1); } else { return term.uri + '?!'; // strange should have # or / } } for (var _ns2 in utils_UI.ns) { namespaces[utils_UI.ns[_ns2]] = _ns2; // reverse index } try { return namespaces[s]; } catch (e) {} s = s.slice(0, -1); // Chop off delimiter ... now have just while (s) { i = s.lastIndexOf('/'); if (i >= 0) { part = s.slice(i + 1); s = s.slice(0, i); if (part !== 'ns' && '0123456789'.indexOf(part[0]) < 0) { return part; } } else { return term.uri + '!?'; // strange should have a nice part } } } function labelWithOntology(x, initialCap) { var t = external_SolidLogic_.store.findTypeURIs(x); if (t[utils_UI.ns.rdf('Predicate').uri] || t[utils_UI.ns.rdfs('Class').uri]) { return label_label(x, initialCap) + ' (' + ontologyLabel(x) + ')'; } return label_label(x, initialCap); } function utils_escapeForXML(str) { return str.replace(/&/g, '&').replace(/ - A handler to called when button is clicked * * @returns - the button */ function buttons_button(dom, iconURI, text, handler) { var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { buttonColor: 'Primary', needsBorder: false }; var button = dom.createElement('button'); button.setAttribute('type', 'button'); // button.innerHTML = text // later, user preferences may make text preferred for some if (iconURI) { var img = button.appendChild(dom.createElement('img')); img.setAttribute('src', iconURI); img.setAttribute('style', 'width: 2em; height: 2em;'); // trial and error. 2em disappears img.title = text; button.setAttribute('style', style.buttonStyle); } else { button.textContent = text.toLocaleUpperCase(); button.onmouseover = function () { if (options.buttonColor === 'Secondary') { if (options.needsBorder) { button.setAttribute('style', style.secondaryButtonNoBorderHover); } else { button.setAttribute('style', style.secondaryButtonHover); } } else { if (options.needsBorder) { button.setAttribute('style', style.primaryButtonNoBorderHover); } else { button.setAttribute('style', style.primaryButtonHover); } } }; button.onmouseout = function () { if (options.buttonColor === 'Secondary') { if (options.needsBorder) { button.setAttribute('style', style.secondaryButtonNoBorder); } else { button.setAttribute('style', style.secondaryButton); } } else { if (options.needsBorder) { button.setAttribute('style', style.primaryButtonNoBorder); } else { button.setAttribute('style', style.primaryButton); } } }; if (options.buttonColor === 'Secondary') { if (options.needsBorder) { button.setAttribute('style', style.secondaryButtonNoBorder); } else { button.setAttribute('style', style.secondaryButton); } } else { if (options.needsBorder) { button.setAttribute('style', style.primaryButtonNoBorder); } else { button.setAttribute('style', style.primaryButton); } } } if (handler) { button.addEventListener('click', handler, false); } return button; } /* Make a cancel button * * @param dom - the DOM document object * @param handler - A handler to called when button is clicked * * @returns - the button */ function buttons_cancelButton(dom, handler) { var b = buttons_button(dom, cancelIconURI, 'Cancel', handler); if (b.firstChild) { // sigh for tsc b.firstChild.style.opacity = '0.3'; // Black X is too harsh: current language is grey X } return b; } /* Make a continue button * * @param dom - the DOM document object * @param handler - A handler to called when button is clicked * * @returns - the button */ function continueButton(dom, handler) { return buttons_button(dom, checkIconURI, 'Continue', handler); } /* Grab a name for a new thing * * Form to get the name of a new thing before we create it * @params theClass Misspelt to avoid clashing with the JavaScript keyword * @returns: a promise of (a name or null if cancelled) */ function askName(dom, kb, container, predicate, theClass, noun) { return new Promise(function (resolve, _reject) { var form = dom.createElement('div'); // form is broken as HTML behaviour can resurface on js error // classLabel = utils.label(ns.vcard('Individual')) predicate = predicate || src_ns.foaf('name'); // eg 'name' in user's language noun = noun || (theClass ? label_label(theClass) : ' '); // eg 'folder' in users's language var prompt = noun + ' ' + label_label(predicate) + ': '; form.appendChild(dom.createElement('p')).textContent = prompt; var namefield = dom.createElement('input'); namefield.setAttribute('type', 'text'); namefield.setAttribute('size', '100'); namefield.setAttribute('maxLength', '2048'); // No arbitrary limits namefield.setAttribute('style', style.textInputStyle); namefield.select(); // focus next user input form.appendChild(namefield); container.appendChild(form); // namefield.focus() function gotName() { form.parentNode.removeChild(form); resolve(namefield.value.trim()); } namefield.addEventListener('keyup', function (e) { if (e.keyCode === 13) { gotName(); } }, false); form.appendChild(dom.createElement('br')); form.appendChild(buttons_cancelButton(dom, function (_event) { form.parentNode.removeChild(form); resolve(null); })); form.appendChild(continueButton(dom, function (_event) { gotName(); })); namefield.focus(); }); // Promise } /** * A TR to represent a draggable person, etc in a list * * pred is unused param at the moment */ var personTR = renderAsRow; // The legacy name is used in a lot of places function renderAsRow(dom, pred, obj, options) { var tr = dom.createElement('tr'); options = options || {}; // tr.predObj = [pred.uri, obj.uri] moved to acl-control var td1 = tr.appendChild(dom.createElement('td')); var td2 = tr.appendChild(dom.createElement('td')); var td3 = tr.appendChild(dom.createElement('td')); // const image = td1.appendChild(dom.createElement('img')) var image = options.image || faviconOrDefault(dom, obj); 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); if (options.title) { td2.textContent = options.title; } else { setName(td2, obj); // This is async } if (options.deleteFunction) { deleteButtonWithCheck(dom, td3, options.noun || 'one', options.deleteFunction); } if (obj.uri) { // blank nodes need not apply if (options.link !== false) { var anchor = td3.appendChild(linkIcon(dom, obj)); anchor.classList.add('HoverControlHide'); td3.appendChild(dom.createElement('br')); } if (options.draggable !== false) { // default is on image.setAttribute('draggable', 'false'); // Stop the image being dragged instead - just the TR makeDraggable(tr, obj); } } ; tr.subject = obj; return tr; } /* A helper function for renderAsDiv * creates the NameDiv for the person * Note: could not move it to the helper file because they call exported functions * from buttons * @internal exporting this only for unit tests */ function createNameDiv(dom, div, title, obj) { var nameDiv = div.appendChild(dom.createElement('div')); if (title) { nameDiv.textContent = title; } else { setName(nameDiv, obj); // This is async } } /* A helper function for renderAsDiv * creates the linkDiv for the person * Note: could not move it to the helper file because they call exported functions * from buttons * @internal exporting this only for unit tests */ function createLinkDiv(dom, div, obj, options) { var linkDiv = div.appendChild(dom.createElement('div')); linkDiv.setAttribute('style', style.linkDivStyle); if (options.deleteFunction) { deleteButtonWithCheck(dom, linkDiv, options.noun || 'one', options.deleteFunction); } if (obj.uri) { // blank nodes need not apply if (options.link !== false) { createLinkForURI(dom, linkDiv, obj); } makeDraggable(div, obj); } } /** * A Div to represent a draggable person, etc in a list * configurable to add an onClick listener */ function renderAsDiv(dom, obj, options) { var div = dom.createElement('div'); div.setAttribute('style', style.renderAsDivStyle); options = options || {}; var image = options.image || faviconOrDefault(dom, obj); createImageDiv(dom, div, image); createNameDiv(dom, div, options.title, obj); createLinkDiv(dom, div, obj, options); if (options.clickable && options.onClickFunction) { addClickListenerToElement(div, options.onClickFunction); } // to be compatible with the SolidOS table layout if (options.wrapInATR) { var tr = wrapDivInATR(dom, div, obj); return tr; } return div; } /** * Refresh a DOM tree recursively */ function refreshTree(root) { if (root.refresh) { root.refresh(); return; } for (var i = 0; i < root.children.length; i++) { refreshTree(root.children[i]); } } /** * Options argument for [[attachmentList]] function */ /** * Component that displays a list of resources, for instance * the attachments of a message, or the various documents related * to a meeting. * Accepts dropping URLs onto it to add attachments to it. */ function attachmentList(dom, subject, div) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; // options = options || {} var deleteAttachment = function deleteAttachment(target) { if (!kb.updater) { throw new Error('kb has no updater'); } kb.updater.update((0,external_$rdf_.st)(subject, predicate, target, doc), [], function (uri, ok, errorBody, _xhr) { if (ok) { refresh(); } else { complain(undefined, 'Error deleting one: ' + errorBody); } }); }; function createNewRow(target) { var theTarget = target; var opt = { noun: noun }; if (modify) { opt.deleteFunction = function () { deleteAttachment(theTarget); }; } return personTR(dom, predicate, target, opt); } var refresh = function refresh() { var things = kb.each(subject, predicate); things.sort(); syncTableToArray(attachmentTable, things, createNewRow); }; function droppedURIHandler(uris) { var ins = []; uris.forEach(function (u) { var target = (0,external_$rdf_.sym)(u); // Attachment needs text label to disinguish I think not icon. src_debug/* log */.Rm('Dropped on attachemnt ' + u); // icon was: iconBase + 'noun_25830.svg' ins.push((0,external_$rdf_.st)(subject, predicate, target, doc)); }); if (!kb.updater) { throw new Error('kb has no updater'); } kb.updater.update([], ins, function (uri, ok, errorBody, _xhr) { if (ok) { refresh(); } else { complain(undefined, 'Error adding one: ' + errorBody); } }); } function droppedFileHandler(files) { var _options$uploadFolder, _options$uploadFolder2; uploadFiles(kb.fetcher, files, (_options$uploadFolder = options.uploadFolder) === null || _options$uploadFolder === void 0 ? void 0 : _options$uploadFolder.uri, // Files (_options$uploadFolder2 = options.uploadFolder) === null || _options$uploadFolder2 === void 0 ? void 0 : _options$uploadFolder2.uri, // Pictures function (theFile, destURI) { var ins = [(0,external_$rdf_.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) { if (ok) { refresh(); } else { complain(undefined, 'Error adding link to uploaded file: ' + errorBody); } }); }); } var doc = options.doc || subject.doc(); if (options.modify === undefined) options.modify = true; var modify = options.modify; var promptIcon = options.promptIcon || buttons_iconBase + 'noun_748003.svg'; // target // const promptIcon = options.promptIcon || (iconBase + 'noun_25830.svg') // paperclip var predicate = options.predicate || src_ns.wf('attachment'); var noun = options.noun || 'attachment'; var kb = external_SolidLogic_.store; var attachmentOuter = div.appendChild(dom.createElement('table')); attachmentOuter.setAttribute('style', 'margin-top: 1em; margin-bottom: 1em;'); var attachmentOne = attachmentOuter.appendChild(dom.createElement('tr')); var attachmentLeft = attachmentOne.appendChild(dom.createElement('td')); var attachmentRight = attachmentOne.appendChild(dom.createElement('td')); var attachmentTable = attachmentRight.appendChild(dom.createElement('table')); attachmentTable.appendChild(dom.createElement('tr')) // attachmentTableTop ; attachmentOuter.refresh = refresh; // Participate in downstream changes // ;(attachmentTable as any).refresh = refresh <- outer should be best? refresh(); if (modify) { // const buttonStyle = 'width; 2em; height: 2em; margin: 0.5em; padding: 0.1em;' var paperclip = buttons_button(dom, promptIcon, 'Drop attachments here'); // paperclip.style = buttonStyle // @@ needed? default has white background attachmentLeft.appendChild(paperclip); var fhandler = options.uploadFolder ? droppedFileHandler : null; makeDropTarget(paperclip, droppedURIHandler, fhandler); // beware missing the wire of the paparclip! makeDropTarget(attachmentLeft, droppedURIHandler, fhandler); // just the outer won't do it if (options.uploadFolder) { // Addd an explicit file upload button as well var buttonDiv = fileUploadButtonDiv(dom, droppedFileHandler); attachmentLeft.appendChild(buttonDiv); // buttonDiv.children[1].style = buttonStyle } } return attachmentOuter; } // ///////////////////////////////////////////////////////////////////////////// /** * Event Handler for links within solid apps. * * Note that native links have constraints in Firefox, they * don't work with local files for instance (2011) */ function openHrefInOutlineMode(e) { e.preventDefault(); e.stopPropagation(); var target = getTarget(e); var uri = target.getAttribute('href'); if (!uri) return src_debug/* log */.Rm('openHrefInOutlineMode: No href found!\n'); var dom = window.document; if (dom.outlineManager) { // @@ TODO Remove the use of document as a global object // TODO fix dependency cycle to solid-panes by calling outlineManager ; dom.outlineManager.GotoSubject(external_SolidLogic_.store.sym(uri), true, undefined, true, undefined); } else if (window && window.panes && window.panes.getOutliner) { // @@ TODO Remove the use of window as a global object ; window.panes.getOutliner().GotoSubject(external_SolidLogic_.store.sym(uri), true, undefined, true, undefined); } else { src_debug/* log */.Rm('ERROR: Can\'t access outline manager in this config'); } // dom.outlineManager.GotoSubject(store.sym(uri), true, undefined, true, undefined) } /** * Make a URI in the Tabulator.org annotation store out of the URI of the thing to be annotated. * * @@ Todo: make it a personal preference. */ function defaultAnnotationStore(subject) { if (subject.uri === undefined) return undefined; var s = subject.uri; if (s.slice(0, 7) !== 'http://') return undefined; s = s.slice(7); // Remove var hash = s.indexOf('#'); if (hash >= 0) s = s.slice(0, hash); // Strip trailing else { var slash = s.lastIndexOf('/'); if (slash < 0) return undefined; s = s.slice(0, slash); } return external_SolidLogic_.store.sym('http://tabulator.org/wiki/annnotation/' + s); } /** * Retrieve all RDF class URIs from solid-ui's RDF store * @returns an object `ret` such that `Object.keys(ret)` is * the list of all class URIs. */ function allClassURIs() { var set = {}; external_SolidLogic_.store.statementsMatching(undefined, src_ns.rdf('type'), undefined).forEach(function (st) { if (st.object.value) set[st.object.value] = true; }); external_SolidLogic_.store.statementsMatching(undefined, src_ns.rdfs('subClassOf'), undefined).forEach(function (st) { if (st.object.value) set[st.object.value] = true; if (st.subject.value) set[st.subject.value] = true; }); external_SolidLogic_.store.each(undefined, src_ns.rdf('type'), src_ns.rdfs('Class')).forEach(function (c) { if (c.value) set[c.value] = true; }); return set; } /** * Figuring which properties we know about * * When the user inputs an RDF property, like for a form field * or when specifying the relationship between two arbitrary things, * then er can prompt them with properties the session knows about * * TODO: Look again by catching this somewhere. (On the kb?) * TODO: move to diff module? Not really a button. * @param {Store} kb The quadstore to be searched. */ function propertyTriage(kb) { var possibleProperties = {}; // if (possibleProperties === undefined) possibleProperties = {} // const kb = store var dp = {}; var op = {}; var no = 0; var nd = 0; var nu = 0; var pi = kb.predicateIndex; // One entry for each pred for (var p in pi) { var object = pi[p][0].object; if (object.termType === 'Literal') { dp[p] = true; nd++; } else { op[p] = true; no++; } } // If nothing discovered, then could be either: var ps = kb.each(undefined, src_ns.rdf('type'), src_ns.rdf('Property')); for (var i = 0; i < ps.length; i++) { var _p = ps[i].toNT(); if (!op[_p] && !dp[_p]) { dp[_p] = true; op[_p] = true; nu++; } } possibleProperties.op = op; possibleProperties.dp = dp; info("propertyTriage: ".concat(no, " non-lit, ").concat(nd, " literal. ").concat(nu, " unknown.")); return possibleProperties; } /** * General purpose widgets */ /** * A button for jumping */ function linkButton(dom, object) { var b = dom.createElement('button'); b.setAttribute('type', 'button'); b.textContent = 'Goto ' + label_label(object); b.addEventListener('click', function (_event) { // b.parentNode.removeChild(b) // TODO fix dependency cycle to solid-panes by calling outlineManager ; dom.outlineManager.GotoSubject(object, true, undefined, true, undefined); }, true); return b; } /** * A button to remove some other element from the page */ function removeButton(dom, element) { var b = dom.createElement('button'); b.setAttribute('type', 'button'); b.textContent = '✕'; // MULTIPLICATION X b.addEventListener('click', function (_event) { ; element.parentNode.removeChild(element); }, true); return b; } // Description text area // // Make a box to demand a description or display existing one // // @param dom - the document DOM for the user interface // @param kb - the graph which is the knowledge base we are working with // @param subject - a term, the subject of the statement(s) being edited. // @param predicate - a term, the predicate of the statement(s) being edited // @param store - The web document being edited // @param callbackFunction - takes (boolean ok, string errorBody) // /////////////////////////////////////// Random I/O widgets ///////////// // //// Column Header Buttons // // These are for selecting different modes, sources,styles, etc. // /* buttons.headerButtons = function (dom, kb, name, words) { const box = dom.createElement('table') var i, word, s = '' box.setAttribute('style', 'width: 90%; height: 1.5em') for (i=0; i' } */ // //////////////////////////////////////////////////////////// // // selectorPanel // // A vertical panel for selecting connections to left or right. // // @param inverse means this is the object rather than the subject // function selectorPanel(dom, kb, type, predicate, inverse, possible, options, callbackFunction, linkCallback) { return selectorPanelRefresh(dom.createElement('div'), dom, kb, type, predicate, inverse, possible, options, callbackFunction, linkCallback); } 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;'; var selected = null; list.innerHTML = ''; var refreshItem = function refreshItem(box, x) { // Scope to hold item and x var item; // eslint-disable-next-line prefer-const var image; var setStyle = function setStyle() { var already = inverse ? kb.each(undefined, predicate, x) : kb.each(x, predicate); iconDiv.setAttribute('class', already.length === 0 ? 'hideTillHover' : ''); // See tabbedtab.css image.setAttribute('src', options.connectIcon || buttons_iconBase + 'noun_25830.svg'); image.setAttribute('title', already.length ? already.length : 'attach'); }; var f = index.twoLine.widgetForClass(type); // eslint-disable-next-line prefer-const item = f(dom, x); item.setAttribute('style', style0); var nav = dom.createElement('div'); nav.setAttribute('class', 'hideTillHover'); // See tabbedtab.css 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'); 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) { if (selected === item) { // deselect item.setAttribute('style', style0); selected = null; } else { if (selected) selected.setAttribute('style', style0); item.setAttribute('style', style0 + 'background-color: #ccc; color:black;'); selected = item; } callbackFunction(x, event, selected === item); setStyle(); }, false); image.addEventListener('click', function (event) { linkCallback(x, event, inverse, setStyle); }, false); box.appendChild(item); return box; }; for (var i = 0; i < possible.length; i++) { var box = dom.createElement('div'); list.appendChild(box); refreshItem(box, possible[i]); } return list; } // ########################################################################### // // Small compact views of things // var index = {}; // /////////////////////////////////////////////////////////////////////////// // We need these for anything which is a subject of an attachment. // // These should be moved to type-dependeent UI code. Related panes maybe function twoLineDefault(dom, x) { // Default var box = dom.createElement('div'); box.textContent = label_label(x); return box; } /** * Find a function that can create a widget for a given class * @param c The RDF class for which we want a widget generator function */ function twoLineWidgetForClass(c) { var widget = index.twoLine[c.uri]; var kb = external_SolidLogic_.store; if (widget) return widget; var sup = kb.findSuperClassesNT(c); for (var cl in sup) { widget = index.twoLine[kb.fromNT(cl).uri]; if (widget) return widget; } return index.twoLine['']; } /** * Display a transaction * @param x Should have attributes through triples in store: * * ns.qu('payee') -> a named node * * ns.qu('date) -> a literal * * ns.qu('amount') -> a literal */ function twoLineTransaction(dom, x) { var failed = ''; var enc = function enc(p) { var y = external_SolidLogic_.store.any(x, src_ns.qu(p)); if (!y) failed += '@@ No value for ' + p + '! '; return y ? utils_escapeForXML(y.value) : '?'; // @@@@ }; var box = dom.createElement('table'); box.innerHTML = "\n \n ".concat(enc('payee'), "\n < /tr>\n < tr >\n ").concat(enc('date').slice(0, 10), "\n ").concat(enc('amount'), "\n "); if (failed) { box.innerHTML = "\n \n ").concat(utils_escapeForXML(failed), "\n "); } return box; } /** * Display a trip * @param x Should have attributes through triples in store: * * ns.dc('title') -> a literal * * ns.cal('dtstart') -> a literal * * ns.cal('dtend') -> a literal */ function twoLineTrip(dom, x) { var enc = function enc(p) { var y = external_SolidLogic_.store.any(x, p); return y ? utils_escapeForXML(y.value) : '?'; }; var box = dom.createElement('table'); box.innerHTML = "\n \n ".concat(enc(src_ns.dc('title')), "\n \n \n ").concat(enc(src_ns.cal('dtstart')), "\n ").concat(enc(src_ns.cal('dtend')), "\n "); return box; } /** * Stick a stylesheet link the document if not already there */ function addStyleSheet(dom, href) { var links = dom.querySelectorAll('link'); for (var i = 0; i < links.length; i++) { if ((links[i].getAttribute('rel') || '') === 'stylesheet' && (links[i].getAttribute('href') || '') === href) { return; } } var link = dom.createElement('link'); link.setAttribute('rel', 'stylesheet'); link.setAttribute('type', 'text/css'); link.setAttribute('href', href); dom.getElementsByTagName('head')[0].appendChild(link); } // Figure (or guess) whether this is an image, etc // function isAudio(file) { return isImage(file, 'audio'); } function isVideo(file) { return isImage(file, 'video'); } /** * */ function isImage(file, kind) { var dcCLasses = { audio: 'http://purl.org/dc/dcmitype/Sound', image: 'http://purl.org/dc/dcmitype/Image', video: 'http://purl.org/dc/dcmitype/MovingImage' }; var what = kind || 'image'; // See https://github.com/linkeddata/rdflib.js/blob/e367d5088c/src/formula.ts#L554 // var typeURIs = external_SolidLogic_.store.findTypeURIs(file); // See https://github.com/linkeddata/rdflib.js/blob/d5000f/src/utils-js.js#L14 // e.g.'http://www.w3.org/ns/iana/media-types/audio' var prefix = external_$rdf_.Util.mediaTypeClass(what + '/*').uri.split('*')[0]; for (var t in typeURIs) { if (t.startsWith(prefix)) return true; } if (dcCLasses[what] in typeURIs) return true; return false; } /** * File upload button * @param dom The DOM aka document * @param droppedFileHandler Same handler function as drop, takes array of file objects * @returns {Element} - a div with a button and a inout in it * The input is hidden, as it is uglky - the user clicks on the nice icons and fires the input. */ // See https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications function fileUploadButtonDiv(dom, droppedFileHandler) { var div = dom.createElement('div'); var input = div.appendChild(dom.createElement('input')); input.setAttribute('type', 'file'); input.setAttribute('multiple', 'true'); input.addEventListener('change', function (event) { src_debug/* log */.Rm('File drop event: ', event); if (event.files) { droppedFileHandler(event.files); } else if (event.target && event.target.files) { droppedFileHandler(event.target.files); } else { alert('Sorry no files .. internal error?'); } }, false); input.style = 'display:none'; var buttonElt = div.appendChild(buttons_button(dom, buttons_iconBase + 'noun_Upload_76574_000000.svg', 'Upload files', function (_event) { input.click(); })); makeDropTarget(buttonElt, null, droppedFileHandler); // Can also just drop on button return div; } index = { line: {// Approx 80em }, twoLine: { // Approx 40em * 2.4em '': twoLineDefault, 'http://www.w3.org/2000/10/swap/pim/qif#Transaction': twoLineTransaction, 'http://www.w3.org/ns/pim/trip#Trip': twoLineTrip, widgetForClass: twoLineWidgetForClass } }; ;// ./node_modules/@babel/runtime/helpers/esm/defineProperty.js function _defineProperty(e, r, t) { return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } ;// ./src/signup/config-default.js /** * Provides a simple configuration object for Solid web client and other * modules. * @module config-default */ /* harmony default export */ const config_default = ({ // @@ should not use export default /** * Primary authentication endpoint */ authEndpoint: '', /** * Fallback authentication endpoint */ fallbackAuthEndpoint: 'https://databox.me/', /** * Default signup endpoints (list of identity providers) */ signupEndpoint: 'https://solidproject.org/get_a_pod', /** * Default height of the Signup popup window, in pixels */ signupWindowHeight: 600, /** * Default width of the Signup popup window, in pixels */ signupWindowWidth: 1024, /** * Path to the client private key (only needed when running within node) */ key: '', /** * Path to the client certificate (only needed when running within node) */ cert: '' }); ;// ./src/signup/signup.js /** * Provides functionality for signing up with a Solid provider * @module signup */ /** * Creates a Signup UI manager * @class */ function Signup(config) { this.config = config || config_default; } /** * Sets up an event listener to monitor login messages from child window/iframe * @method listen * @return {Promise} Event listener promise, resolves to user's WebID */ Signup.prototype.listen = function listen() { var promise = new Promise(function (resolve, reject) { var eventMethod = window.addEventListener ? 'addEventListener' : 'attachEvent'; var eventListener = window[eventMethod]; var messageEvent = eventMethod === 'attachEvent' ? 'onmessage' : 'message'; eventListener(messageEvent, function (e) { var u = e.data; if (u.slice(0, 5) === 'User:') { var user = u.slice(5, u.length); if (user && user.length > 0 && user.slice(0, 4) === 'http') { return resolve(user); } else { return reject(user); } } }, true); }); return promise; }; /** * Opens a signup popup window, sets up `listen()`. * @method signup * @static * @param signupUrl {String} Location of a Solid server for user signup. * @return {Promise} Returns a listener promise, resolves with signed * up user's WebID. */ Signup.prototype.signup = function signup(signupUrl) { signupUrl = signupUrl || this.config.signupEndpoint; var width = this.config.signupWindowWidth; var height = this.config.signupWindowHeight; // set borders var leftPosition = window.screen.width / 2 - (width / 2 + 10); // set title and status bars var topPosition = window.screen.height / 2 - (height / 2 + 50); var windowTitle = 'Solid signup'; var windowUrl = signupUrl + '?origin=' + encodeURIComponent(window.location.origin); var windowSpecs = 'resizable,scrollbars,status,width=' + width + ',height=' + height + ',left=' + leftPosition + ',top=' + topPosition; window.open(windowUrl, windowTitle, windowSpecs); var self = this; return new Promise(function (resolve) { self.listen().then(function (webid) { return resolve(webid); }); }); }; ;// ./src/widgets/forms/fieldParams.ts var _fieldParams; /** * The fieldParams object defines various constants * for use in various form fields. Depending on the * field in questions, different values may be read * from here. */ var fieldParams = (_fieldParams = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_fieldParams, src_ns.ui('ColorField').uri, { size: 9, type: 'color', style: 'height: 3em;', // around 1.5em is padding 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*$/ }), src_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*$/ }), src_ns.ui('DateTimeField').uri, { size: 20, type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime 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*$/ }), src_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*$/ }), src_ns.ui('IntegerField').uri, { size: 12, style: 'text-align: right;', dt: 'integer', pattern: /^\s*-?[0-9]+\s*$/ }), src_ns.ui('DecimalField').uri, { size: 12, style: 'text-align: right;', dt: 'decimal', pattern: /^\s*-?[0-9]*(\.[0-9]*)?\s*$/ }), src_ns.ui('FloatField').uri, { size: 12, style: 'text-align: right;', dt: 'float', pattern: /^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/ }), src_ns.ui('SingleLineTextField').uri, {}), src_ns.ui('NamedNodeURIField').uri, { namedNode: true }), src_ns.ui('TextField').uri, {}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_fieldParams, src_ns.ui('PhoneField').uri, { size: 20, uriPrefix: 'tel:', pattern: /^\+?[\d-]+[\d]*$/ }), src_ns.ui('EmailField').uri, { size: 30, uriPrefix: 'mailto:', pattern: /^\s*.*@.*\..*\s*$/ // @@ Get the right regexp here }), src_ns.ui('Group').uri, { style: style.formGroupStyle }), src_ns.ui('Comment').uri, { element: 'p', style: style.commentStyle }), src_ns.ui('Heading').uri, { element: 'h3', style: style.formHeadingStyle })); ;// ./src/widgets/forms/fieldFunction.ts var fieldFunction_store = external_SolidLogic_.solidLogicSingleton.store; var field = {}; // Form field functions by URI of field type. /** * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris * to find the most specific RDF type if there are multiple. * * @param x a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')` * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField` */ function mostSpecificClassURI(x) { var kb = fieldFunction_store; var ft = kb.findTypeURIs(x); var bot = kb.bottomTypeURIs(ft); // most specific var bots = []; for (var b in bot) bots.push(b); // if (bots.length > 1) throw "Didn't expect "+x+" to have multiple bottom types: "+bots return bots[0]; } /** * Returns a function that creates a form widget * @param dom unused * @param fieldInQuestion the field for which to create a form, e.g. namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField') */ function fieldFunction(dom, fieldInQuestion) { var uri = mostSpecificClassURI(fieldInQuestion); // What type // const uri = field.uri var fun = field[uri]; debug('paneUtils: Going to implement field ' + fieldInQuestion + ' of type ' + uri); if (!fun) { return function (dom2, container) { var box = errorMessageBlock(dom2, 'No handler for field ' + fieldInQuestion + ' of type ' + uri); if (container) container.appendChild(box); return box; }; } return fun; } ;// ./src/widgets/forms/formStyle.ts var STYLE_URI_PREFIX = 'https://www.w3.org/ns/css#'; function setFieldStyle(ele, field) { var classUri = mostSpecificClassURI(field); var params = fieldParams[classUri] || {}; var style = external_SolidLogic_.store.any(field, src_ns.ui('style')); if (!style) { if (params.style) { ele.setAttribute('style', params.style); } return; } if (style.termType === 'Literal') { if (style) ele.setAttribute('style', style.value); } else { var sts = external_SolidLogic_.store.statementsMatching(style, null, null, field.doc()); sts.forEach(function (st) { if (st.predicate.uri && st.predicate.uri.startsWith(STYLE_URI_PREFIX)) { var cssAttribute = st.predicate.uri.slice(STYLE_URI_PREFIX.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 || '???', "\"")); } } }); } } ;// ./src/widgets/forms/basic.ts var basic_store = external_SolidLogic_.solidLogicSingleton.store; /* Style and create a name, value pair */ function renderNameValuePair(dom, kb, box, form, label) { // const property = kb.any(form, ns.ui('property')) box.style.display = 'flex'; box.style.flexDirection = 'row'; var lhs = box.appendChild(dom.createElement('div')); lhs.style.width = styleConstants.formFieldNameBoxWidth; var rhs = box.appendChild(dom.createElement('div')); lhs.setAttribute('class', 'formFieldName'); lhs.setAttribute('style', style.formFieldNameBoxStyle); rhs.setAttribute('class', 'formFieldValue'); if (label) { lhs.appendChild(dom.createTextNode(label)); } else if (kb.any(form, src_ns.ui('property'))) { // Assume more space for error on right lhs.appendChild(fieldLabel(dom, kb.any(form, src_ns.ui('property')), form)); } else { rhs.appendChild(errorMessageBlock(dom, 'No property or label given for form field: ' + form)); lhs.appendChild(dom.createTextNode('???')); } return rhs; } /** * Create an anchor element with a label as the anchor text. * * @param dom The DOM * @param property href for the anchor element * @param fieldInQuestion field to produce a label for * * @internal exporting this only for unit tests */ function fieldLabel(dom, property, fieldInQuestion) { var lab = basic_store.any(fieldInQuestion, src_ns.ui('label')); if (!lab) lab = label_label(property, true); // Init capital if (property === undefined) { return dom.createTextNode('@@Internal error: undefined property'); } var anchor = dom.createElement('a'); /* istanbul ignore next */ if (property.uri) anchor.setAttribute('href', property.uri); anchor.setAttribute('style', 'color: #3B5998; text-decoration: none;'); // Not too blue and no underline anchor.textContent = lab; return anchor; } /** * Returns the document for the first quad that matches * the subject and predicate provided, or default if that * store is not editable. * * @param subject Subject about which we want to find an editable RDF document * @param predicate Predicate about which we want to find an editable RDF document * @param def default RDF document to return if none found * * @internal exporting this only for unit tests */ function fieldStore(subject, predicate, def) { var sts = basic_store.statementsMatching(subject, predicate); if (sts.length === 0) return def; // can used default as no data yet if (!basic_store.updater) { throw new Error('Store has no updater'); } if (sts.length > 0 && sts[0].why.value && basic_store.updater.editable(sts[0].why.value, basic_store)) { return basic_store.sym(sts[0].why.value); } return def; } /** * Render a basic form field * * The same function is used for many similar one-value fields, with different * regexps used to validate. * * @param dom The HTML Document object aka Document Object Model * @param container If present, the created widget will be appended to this * @param already A hash table of (form, subject) kept to prevent recursive forms looping * @param subject The thing about which the form displays/edits data * @param form The form or field to be rendered * @param doc The web document in which the data is * @param callbackFunction Called when data is changed? * * @returns The HTML widget created */ function basicField(dom, container, already, subject, form, doc, callbackFunction) { var kb = basic_store; var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know var box = dom.createElement('div'); var property = kb.any(form, src_ns.ui('property')); if (container) container.appendChild(box); if (!property) { return box.appendChild(errorMessageBlock(dom, 'Error: No property given for text field: ' + form)); } var rhs = renderNameValuePair(dom, kb, box, form); // It can be cleaner to just remove empty fields if you can't edit them anyway var suppressEmptyUneditable = kb.anyJS(form, src_ns.ui('suppressEmptyUneditable'), null, formDoc); var uri = mostSpecificClassURI(form); var params = fieldParams[uri]; if (params === undefined) params = { style: '' }; // non-bottom field types can do this var paramStyle = params.style || ''; var inputStyle = style.textInputStyle + paramStyle; var field = dom.createElement('input'); field.style = inputStyle; rhs.appendChild(field); field.setAttribute('type', params.type ? params.type : 'text'); var size = kb.anyJS(form, src_ns.ui('size')) || styleConstants.textInputSize || 20; field.setAttribute('size', size); var maxLength = kb.any(form, src_ns.ui('maxLength')); field.setAttribute('maxLength', maxLength ? '' + maxLength : styleConstants.basicMaxLength); doc = doc || fieldStore(subject, property, doc); var obj = kb.any(subject, property, undefined, doc); if (!obj) { obj = kb.any(form, src_ns.ui('default')); } if (obj && obj.value && params.uriPrefix) { // eg tel: or mailto: field.value = decodeURIComponent(obj.value.replace(params.uriPrefix, '')) // should have no spaces but in case .replace(/ /g, ''); } else if (obj) { /* istanbul ignore next */ field.value = obj.value || obj.value || ''; } field.setAttribute('style', inputStyle); if (!kb.updater) { throw new Error('kb has no updater'); } if (!kb.updater.editable(doc.uri)) { field.readOnly = true // was: disabled. readOnly is better ; field.style = style.textInputStyleUneditable + paramStyle; if (suppressEmptyUneditable && field.value === '') { box.style.display = 'none'; // clutter } return box; } // read-write: field.addEventListener('keyup', function (_e) { if (params.pattern) { field.setAttribute('style', inputStyle + (field.value.match(params.pattern) ? 'color: green;' : 'color: red;')); } }, true); field.addEventListener('change', function (_e) { // i.e. lose focus with changed data if (params.pattern && !field.value.match(params.pattern)) return; field.disabled = true; // See if this stops getting two dates from fumbling e.g the chrome datepicker. field.setAttribute('style', inputStyle + 'color: gray;'); // pending var ds = kb.statementsMatching(subject, property); // remove any multiple values var result; if (params.namedNode) { result = kb.sym(field.value); } else if (params.uriPrefix) { result = encodeURIComponent(field.value.replace(/ /g, '')); result = kb.sym(params.uriPrefix + field.value); } else { if (params.dt) { result = new external_$rdf_.Literal(field.value.trim(), undefined, src_ns.xsd(params.dt)); } else { result = new external_$rdf_.Literal(field.value); } } var is = ds.map(function (statement) { return (0,external_$rdf_.st)(statement.subject, statement.predicate, result, statement.why); }); // can include >1 doc if (is.length === 0) { // or none is = [(0,external_$rdf_.st)(subject, property, result, doc)]; } function updateMany(ds, is, callback) { var docs = []; is.forEach(function (st) { if (!docs.includes(st.why.uri)) docs.push(st.why.uri); }); ds.forEach(function (st) { /* istanbul ignore next */ if (!docs.includes(st.why.uri)) docs.push(st.why.uri); }); /* istanbul ignore next */ if (docs.length === 0) { throw new Error('updateMany has no docs to patch'); } if (!kb.updater) { throw new Error('kb has no updater'); } if (docs.length === 1) { return kb.updater.update(ds, is, callback); } // return kb.updater.update(ds, is, callback) var doc = docs.pop(); var is1 = is.filter(function (st) { return st.why.uri === doc; }); var is2 = is.filter(function (st) { return st.why.uri !== doc; }); var ds1 = ds.filter(function (st) { return st.why.uri === doc; }); var ds2 = ds.filter(function (st) { return st.why.uri !== doc; }); kb.updater.update(ds1, is1, function (uri, ok, body) { if (ok) { updateMany(ds2, is2, callback); } else { callback(uri, ok, body); } }); } updateMany(ds, is, function (uri, ok, body) { // kb.updater.update(ds, is, function (uri, ok, body) { if (ok) { field.disabled = false; field.setAttribute('style', inputStyle); } else { box.appendChild(errorMessageBlock(dom, body)); } callbackFunction(ok, body); }); }, true); return box; } ;// ./src/widgets/forms/autocomplete/language.ts /* Logic to access public data stores * * including filtering resut by natural language etc * See https://solidos.solidcommunity.net/public/2021/01%20Building%20Solid%20Apps%20which%20use%20Public%20Data.html */ // import * as logic from '../index' // import { authn } from '../../../authn/index' // import { Binding } from '../widgets/forms/autocomplete/publicData' // import { nativeNameForLanguageCode, englishNameForLanguageCode } from './nativeNameForLanguageCode' // const { currentUser } = logic.authn var languageCodeURIBase = 'https://www.w3.org/ns/iana/language-code/'; /// @@ unsupported on the web (2021) var defaultPreferredLanguages = ['en', 'fr', 'de', 'it', 'ar']; function addDefaults(array) { if (!array) array = []; return array.concat(defaultPreferredLanguages.filter(function (code) { return !array.includes(code); })); } function getPreferredLanguagesFor(_x) { return _getPreferredLanguagesFor.apply(this, arguments); } /* Get the preferred langauges for the user * * Either from solid preferences or browser preferences or default */ function _getPreferredLanguagesFor() { _getPreferredLanguagesFor = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(person) { var _store$fetcher; var doc, list, languageCodeArray; return regenerator_default().wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: doc = person.doc(); _context.next = 1; return (_store$fetcher = external_SolidLogic_.store.fetcher) === null || _store$fetcher === void 0 ? void 0 : _store$fetcher.load(doc); case 1: list = external_SolidLogic_.store.any(person, src_ns.schema('knowsLanguage'), null, doc); if (list) { _context.next = 2; break; } return _context.abrupt("return", defaultPreferredLanguages); case 2: languageCodeArray = []; list.elements.forEach(function (item) { // console.log('@@ item ' + item) var lang = external_SolidLogic_.store.any(item, src_ns.solid('publicId'), null, doc); if (!lang) { console.warn('getPreferredLanguages: No publiID of language.'); return; } if (!lang.value.startsWith(languageCodeURIBase)) { console.error("What should be a language code ".concat(lang.value, " does not start with ").concat(languageCodeURIBase)); return; } var code = lang.value.slice(languageCodeURIBase.length); languageCodeArray.push(code); }); if (!(languageCodeArray.length > 0)) { _context.next = 3; break; } console.log(" User knows languages with codes: \"".concat(languageCodeArray.join(','), "\"")); return _context.abrupt("return", addDefaults(languageCodeArray)); case 3: return _context.abrupt("return", null); case 4: case "end": return _context.stop(); } }, _callee); })); return _getPreferredLanguagesFor.apply(this, arguments); } function getPreferredLanguages() { return _getPreferredLanguages.apply(this, arguments); } /* From an array of bindings with a names for each row, * remove dupliacte names for the same thing, leaving the user's * preferred language version */ function _getPreferredLanguages() { _getPreferredLanguages = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee2() { var me, solidLanguagePrefs; return regenerator_default().wrap(function (_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: _context2.next = 1; return external_SolidLogic_.authn.currentUser(); case 1: me = _context2.sent; if (!me) { _context2.next = 3; break; } _context2.next = 2; return getPreferredLanguagesFor(me); case 2: solidLanguagePrefs = _context2.sent; if (!solidLanguagePrefs) { _context2.next = 3; break; } return _context2.abrupt("return", solidLanguagePrefs); case 3: if (!(typeof navigator !== 'undefined')) { _context2.next = 5; break; } if (!navigator.languages) { _context2.next = 4; break; } return _context2.abrupt("return", addDefaults(navigator.languages.map(function (longForm) { return longForm.split('-')[0]; }))); case 4: if (!navigator.language) { _context2.next = 5; break; } return _context2.abrupt("return", addDefaults([navigator.language.split('-')[0]])); case 5: return _context2.abrupt("return", defaultPreferredLanguages); case 6: case "end": return _context2.stop(); } }, _callee2); })); return _getPreferredLanguages.apply(this, arguments); } function filterByLanguage(bindings, languagePrefs) { var uris = {}; bindings.forEach(function (binding) { // Organize names by their subject var uri = binding.subject.value; uris[uri] = uris[uri] || []; uris[uri].push(binding); }); var languagePrefs2 = languagePrefs || defaultPreferredLanguages; languagePrefs2.reverse(); // Preferred last var slimmed = []; // console.log(` @@ {languagePrefs2 ${languagePrefs2}`) for (var u in uris) { // needs hasOwnProperty ? var _bindings = uris[u]; var sortMe = _bindings.map(function (binding) { var lang = binding.name['xml:lang']; var index = languagePrefs2.indexOf(lang); var pair = [index, binding]; // console.log(` @@ lang: ${lang}, index: ${index}`) return pair; }); sortMe.sort(); // best at th ebottom sortMe.reverse(); // best at the top // console.debug('@@ sortMe:', sortMe) slimmed.push(sortMe[0][1]); } // map u src_debug/* log */.Rm(" Filter by language: ".concat(bindings.length, " -> ").concat(slimmed.length)); return slimmed; } ;// ./src/widgets/forms/autocomplete/publicData.ts /* Logic to access public data stores * * including filtering resut by natural language etc * See https://solidos.solidcommunity.net/public/2021/01%20Building%20Solid%20Apps%20which%20use%20Public%20Data.html */ var AUTOCOMPLETE_LIMIT = 200; // How many to get from server // With 3000 we could exceed the wikidata timeout var subjectRegexp = /\$\(subject\)/g; // Schema.org seems to suggest NGOs are non-profit and Corporaions are for-profit // but doesn't have explicit classes var wikidataClasses = { Corporation: 'http://www.wikidata.org/entity/Q6881511', // Enterprise is for-profit EducationalOrganization: 'http://www.wikidata.org/entity/Q178706', // insitution GovernmentOrganization: 'http://www.wikidata.org/entity/Q327333', // government agency MedicalOrganization: 'http://www.wikidata.org/entity/Q4287745', MusicGroup: 'http://www.wikidata.org/entity/Q32178211', // music organization NGO: 'http://www.wikidata.org/entity/Q163740', // nonprofit organization @@ Occupation: 'http://www.wikidata.org/entity/Q28640', // Profession // Organization: 'http://www.wikidata.org/entity/Q43229', Project: 'http://www.wikidata.org/entity/Q170584', ResearchOrganization: 'http://www.wikidata.org/entity/Q31855', SportsOrganization: 'http://www.wikidata.org/entity/Q4438121' }; var 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}"; var fetcherOptionsJsonPublicData = { credentials: 'omit', // try to avoid CORS problems. Data is public so no auth headers: new Headers({ Accept: 'application/json' }) }; var escoParameters = { label: 'ESCO', logo: external_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)' // endpoint: undefined // returnFormat: 'ESCO', // targetClass: {} }; var dbpediaParameters = { label: 'DBPedia', logo: external_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/' }; var dbPediaTypeMap = { AcademicInsitution: 'http://umbel.org/umbel/rc/EducationalOrganization' }; var 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' }; var wikidataParameters = { label: 'WikiData', limit: 3000, // Need a high one as very many items, and many languages logo: external_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) ", // was SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } 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}" }; var wikidataIncomingClassMap = { 'http://www.wikidata.org/entity/Q15936437': src_ns.schema('CollegeOrUniversity'), // research university 'http://www.wikidata.org/entity/Q1664720': src_ns.schema('EducationalOrganization'), // insitute @@ 'http://www.wikidata.org/entity/Q43229': src_ns.schema('Organization'), // research university 'http://www.wikidata.org/entity/Q3918': src_ns.schema('CollegeOrUniversity'), // university 'http://www.wikidata.org/entity/Q170584': src_ns.schema('Project'), // university 'http://www.wikidata.org/entity/Q327333': src_ns.schema('GovernmentOrganization'), // govt agency 'http://www.wikidata.org/entity/Q2221906': src_ns.schema('Place'), // geographic location 'http://www.wikidata.org/entity/Q167037': src_ns.schema('Corporation') // Corporation }; var variableNameToPredicateMap = { // allow other mappings to be added in theory hence var // wikidata: targetClass: src_ns.rdf('type'), // logo: ns.schema('logo'), sealImage: src_ns.schema('logo'), // image: ns.schema('image'), defaults to shema shortName: src_ns.foaf('nick'), subsidiary: src_ns.schema('subOrganization'), // dbpedia - : city: src_ns.vcard('locality'), state: src_ns.vcard('region'), country: src_ns.vcard('country-name'), homepage: src_ns.foaf('homepage'), lat: src_ns.schema('latitude'), "long": src_ns.schema('longitude') }; function bindingToTerm(item) { var typ = item.type.toLowerCase(); if (typ === 'uri' || typ === 'iri') { return external_SolidLogic_.store.sym(item.value); } else if (typ === 'literal') { if (item['xml:lang']) { return new external_$rdf_.Literal(item.value, item['xml:lang']); } else { return new external_$rdf_.Literal(item.value); } } else { throw new Error("bindingToTerm: Unexpected type \"".concat(item.type, "\" in sparql binding}")); } } function loadFromBindings(kb, solidSubject, bindings, doc) { var predMap = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : variableNameToPredicateMap; var results = {}; src_debug/* log */.Rm("loadFromBindings: subject: ".concat(solidSubject)); src_debug/* log */.Rm(" doc: ".concat(doc)); bindings.forEach(function (binding) { for (var key in binding) { var result = binding[key]; var combined = JSON.stringify(result); // ( result.type, result.value ) results[key] = results[key] || new Set(); results[key].add(combined); // remove duplicates } }); var _loop = function _loop(key) { var values = results[key]; src_debug/* log */.Rm(" results ".concat(key, " -> ").concat(values)); values.forEach(function (combined) { var result = JSON.parse(combined); var type = result.type, value = result.value; var obj; if (type === 'uri') { obj = kb.sym(value); } else if (type === 'literal') { obj = new external_$rdf_.Literal(value, result.language, result.datatype); } else { throw new Error("loadFromBindings: unexpected type: ".concat(type)); } if (key === 'type') { if (wikidataIncomingClassMap[value]) { obj = wikidataIncomingClassMap[value]; } else { src_debug/* warn */.R8('Unmapped Wikidata Class: ' + value); } } else if (key === 'coordinates') { // const latlong = value // Like 'Point(-71.106111111 42.375)' src_debug/* log */.Rm(' @@@ hey a point: ' + value); // const regexp = /.*\(([-0-9\.-]*) ([-0-9\.-]*)\)/ var regexp = /.*\(([-0-9.-]*) ([-0-9.-]*)\)/; var match = regexp.exec(value); if (match) { var _float = src_ns.xsd('float'); var latitude = new external_$rdf_.Literal(match[1], null, _float); var longitude = new external_$rdf_.Literal(match[2], null, _float); kb.add(solidSubject, src_ns.schema('longitude'), longitude, doc); kb.add(solidSubject, src_ns.schema('latitude'), latitude, doc); } else { src_debug/* log */.Rm('Bad coordinates syntax: ' + value); } } else { var pred = predMap[key] || src_ns.schema(key); // fallback to just using schema.org kb.add(solidSubject, pred, obj, doc); // @@ deal with non-string and objects src_debug/* log */.Rm(" public data ".concat(pred, " ").concat(obj, ".")); } }); }; for (var key in results) { _loop(key); } } /* ESCO sopecific */ function ESCOResultToBindings(json) { var results = json._embedded.results; // Array var bindings = results.map(function (result) { var name = result.title; var uri = result.uri; // like http://data.europa.eu/esco/occupation/57af9090-55b4-4911-b2d0-86db01c00b02 return { name: { value: name, type: 'literal' }, subject: { type: 'IRI', value: uri } }; // simulate SPARQL bindings }); return bindings; } /* Query all entities of given class and partially matching name */ function queryESCODataByName(_x, _x2, _x3) { return _queryESCODataByName.apply(this, arguments); } /* Cope ithe syntax probelm in wikidata timeout responses * * Wikidata bug: https://phabricator.wikimedia.org/T283962 * This will not be needed whn that WDQS bug fixed. * This is aptured in https://github.com/solidos/solid-ui/issues/403 */ function _queryESCODataByName() { _queryESCODataByName = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(filter, theClass, queryTarget) { var _store$fetcher; var limit, queryURI, response, text, json; return regenerator_default().wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: if (queryTarget.searchByNameURI) { _context.next = 1; break; } throw new Error('Missing queryTarget.searchByNameURI on queryESCODataByName'); case 1: limit = queryTarget.limit || AUTOCOMPLETE_LIMIT; queryURI = queryTarget.searchByNameURI.replace('$(name)', filter).replace('$(limit)', '' + limit).replace('$(targetClass)', theClass.toNT()); src_debug/* log */.Rm('Querying ESCO data - uri: ' + queryURI); _context.next = 2; return (_store$fetcher = external_SolidLogic_.store.fetcher) === null || _store$fetcher === void 0 ? void 0 : _store$fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData); case 2: response = _context.sent; text = (response === null || response === void 0 ? void 0 : response.responseText) || ''; src_debug/* log */.Rm(' Query result text' + text.slice(0, 500) + '...'); if (!(text.length === 0)) { _context.next = 3; break; } throw new Error('Wot no text back from ESCO query ' + queryURI); case 3: json = JSON.parse(text); // console.log('Whole JSON return object', json) src_debug/* log */.Rm(' ESCO Query result JSON' + JSON.stringify(json, null, 4).slice(0, 500) + '...'); return _context.abrupt("return", ESCOResultToBindings(json)); case 4: case "end": return _context.stop(); } }, _callee); })); return _queryESCODataByName.apply(this, arguments); } function fixWikidataJSON(str) { var syntaxProblem = str.indexOf('SPARQL-QUERY'); if (syntaxProblem < 0) return str; // console.log('@@ fixWikidataJSON FIXING') src_debug/* warn */.R8(' ### Fixing JSON with wikidata error code injection ' + str.slice(syntaxProblem, syntaxProblem + 200)); var goodness = str.lastIndexOf('}, {'); return str.slice(0, goodness) + ' } ] } } '; // Close binding, array, bindings, results, root object } /* Query all entities of given class and partially matching name */ function queryPublicDataByName(_x4, _x5, _x6, _x7) { return _queryPublicDataByName.apply(this, arguments); } /* Query a database using SPARQL SELECT */ function _queryPublicDataByName() { _queryPublicDataByName = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee2(filter, theClass, languages, queryTarget) { var substituteStrings, languagePrefs, language, sparql, queryURI, response, _store$fetcher2, text, text2, json, bindings, _t, _t2; return regenerator_default().wrap(function (_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: substituteStrings = function _substituteStrings(template) { var limit = queryTarget.limit || AUTOCOMPLETE_LIMIT; var u1 = template.replace('$(name)', filter).replace('$(limit)', '' + limit).replace('$(language)', language); return u1.replace('$(targetClass)', theClass.toNT()); }; if (theClass) { _context2.next = 1; break; } throw new Error('queryPublicDataByName: No class provided'); case 1: _context2.next = 2; return getPreferredLanguages(); case 2: _t = _context2.sent; if (_t) { _context2.next = 3; break; } _t = defaultPreferredLanguages; case 3: languagePrefs = _t; language = languagePrefs[0] || 'en'; if (!queryTarget.searchByNameQuery) { _context2.next = 4; break; } sparql = substituteStrings(queryTarget.searchByNameQuery); src_debug/* log */.Rm('Querying public data - sparql: ' + sparql); return _context2.abrupt("return", queryPublicDataSelect(sparql, queryTarget)); case 4: if (!queryTarget.searchByNameURI) { _context2.next = 13; break; } // not sparql - random API queryURI = substituteStrings(queryTarget.searchByNameURI); _context2.prev = 5; _context2.next = 6; return (_store$fetcher2 = external_SolidLogic_.store.fetcher) === null || _store$fetcher2 === void 0 ? void 0 : _store$fetcher2.webOperation('GET', queryURI, fetcherOptionsJsonPublicData); case 6: response = _context2.sent; _context2.next = 8; break; case 7: _context2.prev = 7; _t2 = _context2["catch"](5); throw new Error("Exception when trying to fetch ".concat(queryURI, " \n ").concat(_t2)); case 8: text = response.responseText || ''; // ts if (!(response.status !== 200)) { _context2.next = 9; break; } throw new Error("HTTP error status ".concat(response.status, " trying to fetch ").concat(queryURI, " ")); case 9: src_debug/* log */.Rm(' Query result text' + text.slice(0, 500) + '...'); if (!(text.length === 0)) { _context2.next = 10; break; } throw new Error('queryPublicDataByName: No text back from public data query ' + queryURI); case 10: text2 = fixWikidataJSON(text); // Kludge: strip of interrupting error message json = JSON.parse(text2); src_debug/* log */.Rm(' API Query result JSON' + JSON.stringify(json, null, 4).slice(0, 500) + '...'); if (!json._embedded) { _context2.next = 11; break; } src_debug/* log */.Rm(' Looks like ESCO'); bindings = ESCOResultToBindings(json); return _context2.abrupt("return", bindings); case 11: alert('Code me: unrecognized API return format'); throw new Error("*** Need to add code to parse unrecognized API JSON return\n".concat(JSON.stringify(json, null, 4))); case 12: _context2.next = 14; break; case 13: throw new Error('Query source must have either rest API or SPARQL endpoint.'); case 14: case "end": return _context2.stop(); } }, _callee2, null, [[5, 7]]); })); return _queryPublicDataByName.apply(this, arguments); } function queryPublicDataSelect(_x8, _x9) { return _queryPublicDataSelect.apply(this, arguments); } /* Load from a database using SPARQL CONSTRUCT */ function _queryPublicDataSelect() { _queryPublicDataSelect = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee3(sparql, queryTarget) { var _store$fetcher3; var myUrlWithParams, queryURI, headers, options, response, text, text2, json, bindings; return regenerator_default().wrap(function (_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: if (queryTarget.endpoint) { _context3.next = 1; break; } throw new Error('Missing queryTarget.endpoint required for queryPublicDataSelect'); case 1: myUrlWithParams = new URL(queryTarget.endpoint); myUrlWithParams.searchParams.append('query', sparql); queryURI = myUrlWithParams.href; src_debug/* log */.Rm(' queryPublicDataSelect uri: ' + queryURI); headers = new Headers(); headers.append('Accept', 'application/json'); options = { credentials: 'omit', // CORS - as we know it is public headers: headers }; _context3.next = 2; return (_store$fetcher3 = external_SolidLogic_.store.fetcher) === null || _store$fetcher3 === void 0 ? void 0 : _store$fetcher3.webOperation('GET', queryURI, options); case 2: response = _context3.sent; text = (response === null || response === void 0 ? void 0 : response.responseText) || ''; if (!(text.length === 0)) { _context3.next = 3; break; } throw new Error('No text back from query ' + queryURI); case 3: text2 = fixWikidataJSON(text); json = JSON.parse(text2); src_debug/* log */.Rm(' Query result JSON' + JSON.stringify(json, null, 4).slice(0, 100) + '...'); bindings = json.results.bindings; return _context3.abrupt("return", bindings); case 4: case "end": return _context3.stop(); } }, _callee3); })); return _queryPublicDataSelect.apply(this, arguments); } function queryPublicDataConstruct(_x0, _x1, _x10) { return _queryPublicDataConstruct.apply(this, arguments); } function _queryPublicDataConstruct() { _queryPublicDataConstruct = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee4(sparql, pubicId, queryTarget) { var _store$fetcher4; var myUrlWithParams, queryURI, headers, options, response, text, report; return regenerator_default().wrap(function (_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: src_debug/* log */.Rm('queryPublicDataConstruct: sparql:', sparql); if (queryTarget.endpoint) { _context4.next = 1; break; } throw new Error('Missing queryTarget.endpoint required for queryPublicDataConstruct'); case 1: myUrlWithParams = new URL(queryTarget.endpoint); myUrlWithParams.searchParams.append('query', sparql); queryURI = myUrlWithParams.href; src_debug/* log */.Rm(' queryPublicDataConstruct uri: ' + queryURI); headers = new Headers(); headers.append('Accept', 'text/turtle'); options = { credentials: 'omit', // CORS // @tsc pain headers: headers // ({ Accept: 'text/turtle' } as Headers) }; _context4.next = 2; return (_store$fetcher4 = external_SolidLogic_.store.fetcher) === null || _store$fetcher4 === void 0 ? void 0 : _store$fetcher4.webOperation('GET', queryURI, options); case 2: response = _context4.sent; text = (response === null || response === void 0 ? void 0 : response.responseText) || 'No response text?'; report = text.length > 500 ? text.slice(0, 200) + ' ... ' + text.slice(-200) : text; src_debug/* log */.Rm(' queryPublicDataConstruct result text:' + report); if (!(text.length === 0)) { _context4.next = 3; break; } throw new Error('queryPublicDataConstruct: No text back from construct query:' + queryURI); case 3: (0,external_$rdf_.parse)(text, external_SolidLogic_.store, pubicId.uri, 'text/turtle'); case 4: case "end": return _context4.stop(); } }, _callee4); })); return _queryPublicDataConstruct.apply(this, arguments); } function loadPublicDataThing(_x11, _x12, _x13) { return _loadPublicDataThing.apply(this, arguments); } function _loadPublicDataThing() { _loadPublicDataThing = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee5(kb, subject, publicDataID) { var iDToFetch, headers; return regenerator_default().wrap(function (_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: if (!publicDataID.uri.startsWith('https://dbpedia.org/resource/')) { _context5.next = 1; break; } return _context5.abrupt("return", getDbpediaDetails(kb, subject, publicDataID)); case 1: if (!publicDataID.uri.match(/^https?:\/\/www\.wikidata\.org\/entity\/.*/)) { _context5.next = 3; break; } _context5.next = 2; return getWikidataDetails(kb, subject, publicDataID); case 2: _context5.next = 4; break; case 3: iDToFetch = publicDataID.uri.startsWith('http:') ? kb.sym('https:' + publicDataID.uri.slice(5)) : publicDataID; headers = new Headers(); headers.append('Accept', 'text/turtle'); return _context5.abrupt("return", kb.fetcher.load(iDToFetch, { credentials: 'omit', headers: headers })); case 4: case "end": return _context5.stop(); } }, _callee5); })); return _loadPublicDataThing.apply(this, arguments); } function getWikidataDetails(_x14, _x15, _x16) { return _getWikidataDetails.apply(this, arguments); } function _getWikidataDetails() { _getWikidataDetails = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee6(kb, solidSubject, publicDataID) { var subjRegexp, sparql; return regenerator_default().wrap(function (_context6) { while (1) switch (_context6.prev = _context6.next) { case 0: subjRegexp = /wd:Q49108/g; sparql = instituteDetailsWikidataQuery.replace(subjRegexp, publicDataID.toNT()); _context6.next = 1; return queryPublicDataConstruct(sparql, publicDataID, wikidataParameters); case 1: src_debug/* log */.Rm('getWikidataDetails: loaded.', publicDataID); case 2: case "end": return _context6.stop(); } }, _callee6); })); return _getWikidataDetails.apply(this, arguments); } function getWikidataDetailsOld(_x17, _x18, _x19) { return _getWikidataDetailsOld.apply(this, arguments); } function _getWikidataDetailsOld() { _getWikidataDetailsOld = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee7(kb, solidSubject, publicDataID) { var sparql, bindings; return regenerator_default().wrap(function (_context7) { while (1) switch (_context7.prev = _context7.next) { case 0: 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 = 1; return queryPublicDataSelect(sparql, wikidataParameters); case 1: bindings = _context7.sent; loadFromBindings(kb, publicDataID, bindings, publicDataID.doc()); // arg2 was solidSubject case 2: case "end": return _context7.stop(); } }, _callee7); })); return _getWikidataDetailsOld.apply(this, arguments); } function getWikidataLocation(_x20, _x21, _x22) { return _getWikidataLocation.apply(this, arguments); } function _getWikidataLocation() { _getWikidataLocation = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee8(kb, solidSubject, publicDataID) { var sparql, bindings; return regenerator_default().wrap(function (_context8) { while (1) switch (_context8.prev = _context8.next) { case 0: 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()); src_debug/* log */.Rm(' location query sparql:' + sparql); _context8.next = 1; return queryPublicDataSelect(sparql, wikidataParameters); case 1: bindings = _context8.sent; src_debug/* log */.Rm(' location query bindings:', bindings); loadFromBindings(kb, publicDataID, bindings, publicDataID.doc()); // was solidSubject case 2: case "end": return _context8.stop(); } }, _callee8); })); return _getWikidataLocation.apply(this, arguments); } function getDbpediaDetails(_x23, _x24, _x25) { return _getDbpediaDetails.apply(this, arguments); } function _getDbpediaDetails() { _getDbpediaDetails = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee9(kb, solidSubject, publicDataID) { var sparql, bindings; return regenerator_default().wrap(function (_context9) { while (1) switch (_context9.prev = _context9.next) { case 0: // Note below the string form of the named node with <> works in SPARQL 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 = 1; return queryPublicDataSelect(sparql, dbpediaParameters); case 1: bindings = _context9.sent; loadFromBindings(kb, publicDataID, bindings, publicDataID.doc()); src_debug/* log */.Rm('Finished getDbpediaDetails.'); case 2: case "end": return _context9.stop(); } }, _callee9); })); return _getDbpediaDetails.apply(this, arguments); } ;// ./src/widgets/forms/autocomplete/autocompletePicker.ts function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = autocompletePicker_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function autocompletePicker_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return autocompletePicker_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? autocompletePicker_arrayLikeToArray(r, a) : void 0; } } function autocompletePicker_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /* Autocomplete Picker: Create and edit data using public data ** ** As the data source is passed as a parameter, all kinds of APIa and query services can be used ** */ var AUTOCOMPLETE_THRESHOLD = 4; // don't check until this many characters typed var AUTOCOMPLETE_ROWS = 20; // 20? var AUTOCOMPLETE_ROWS_STRETCH = 40; /* Autocomplete happens in 6 phases: 1. The search string is too small to bother 2. The search string is big enough, and we have not loaded the array 3. The search string is big enough, and we have loaded array up to the limit Display them and wait for more user input 4. The search string is big enough, and we have loaded array NOT to the limit but including all matches. No more fetches. If user gets more precise, wait for them to select one - or reduce to a single 5. Single one selected. Optionally waiting for accept button to be pressed, OR can change string and go to 5 or 2 6. Locked with a value. Press 'edit' button to return to 5 */ function setVisible(element, visible) { element.style.display = visible ? '' : 'none'; // Do not use visibility, it holds the real estate } // The core of the autocomplete UI function renderAutoComplete(_x, _x2, _x3, _x4) { return _renderAutoComplete.apply(this, arguments); } // renderAutoComplete // ENDS function _renderAutoComplete() { _renderAutoComplete = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee8(dom, acOptions, decoration, callback) { var complain, finish, gotIt, _gotIt, acceptButtonHandler, _acceptButtonHandler, cancelButtonHandler, _cancelButtonHandler, nameMatch, clearList, inputEventHHandler, _inputEventHHandler, loadBindingsAndFilterByLanguage, _loadBindingsAndFilterByLanguage, filterByName, refreshList, _refreshList, initialize, targetClass, lastBindings, loadedEnough, inputEventHandlerLock, allDisplayed, lastFilter, numberOfRows, div, foundName, foundObject, table, head, cell, searchInput, size, searchInputStyle; return regenerator_default().wrap(function (_context8) { while (1) switch (_context8.prev = _context8.next) { case 0: initialize = function _initialize() { if (acOptions.currentObject) { // If have existing value then jump into the endgame of the autocomplete searchInput.value = acOptions.currentName ? acOptions.currentName.value : '??? wot no name for ' + acOptions.currentObject; foundName = acOptions.currentName; lastFilter = acOptions.currentName ? acOptions.currentName.value : undefined; foundObject = acOptions.currentObject; } else { searchInput.value = ''; lastFilter = undefined; foundObject = undefined; } if (decoration.deleteButton) { setVisible(decoration.deleteButton, !!acOptions.currentObject); } if (decoration.acceptButton) { setVisible(decoration.acceptButton, false); // hide until input complete } if (decoration.editButton) { setVisible(decoration.editButton, true); } if (decoration.cancelButton) { setVisible(decoration.cancelButton, false); // only allow cancel when there is something to cancel } inputEventHandlerLock = false; clearList(); }; _refreshList = function _refreshList3() { _refreshList = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee7() { var rowForBinding, compareBindingsByName, languagePrefs, filter, slimmed, displayable, _iterator, _step, binding; return regenerator_default().wrap(function (_context7) { while (1) switch (_context7.prev = _context7.next) { case 0: compareBindingsByName = function _compareBindingsByNam(self, other) { return other.name.value > self.name.value ? 1 : other.name.name < self.name.value ? -1 : 0; }; rowForBinding = function _rowForBinding(binding) { var row = dom.createElement('tr'); style.setStyle(row, 'autocompleteRowStyle'); row.setAttribute('style', 'padding: 0.3em;'); row.style.color = allDisplayed ? '#080' : '#088'; // green means 'you should find it here' row.textContent = binding.name.value; var object = bindingToTerm(binding.subject); var nameTerm = bindingToTerm(binding.name); row.addEventListener('click', /*#__PURE__*/function () { var _ref = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee6(_event) { return regenerator_default().wrap(function (_context6) { while (1) switch (_context6.prev = _context6.next) { case 0: src_debug/* log */.Rm(' click row textContent: ' + row.textContent); src_debug/* log */.Rm(' click name: ' + nameTerm.value); if (object && nameTerm) { gotIt(object, nameTerm); } case 1: case "end": return _context6.stop(); } }, _callee6); })); return function (_x10) { return _ref.apply(this, arguments); }; }()); return row; }; // console.log('@@ refreshList called') // rowForBinding if (!inputEventHandlerLock) { _context7.next = 1; break; } src_debug/* log */.Rm("Ignoring \"".concat(searchInput.value, "\" because of lock ")); return _context7.abrupt("return"); case 1: src_debug/* log */.Rm("Setting lock at \"".concat(searchInput.value, "\"")); inputEventHandlerLock = true; _context7.next = 2; return getPreferredLanguages(); case 2: languagePrefs = _context7.sent; filter = searchInput.value.trim().toLowerCase(); if (!(filter.length < AUTOCOMPLETE_THRESHOLD)) { _context7.next = 3; break; } // too small clearList(); // candidatesLoaded = false numberOfRows = AUTOCOMPLETE_ROWS; _context7.next = 6; break; case 3: if (!(!allDisplayed || !lastFilter || !filter.startsWith(lastFilter))) { _context7.next = 5; break; } src_debug/* log */.Rm(" Querying database at \"".concat(filter, "\" cf last \"").concat(lastFilter, "\".")); _context7.next = 4; return loadBindingsAndFilterByLanguage(filter, languagePrefs); case 4: lastBindings = _context7.sent; case 5: // Trim table as search gets tighter: slimmed = filterByName(filter, lastBindings); if (loadedEnough && slimmed.length <= AUTOCOMPLETE_ROWS_STRETCH) { numberOfRows = slimmed.length; // stretch if it means we get all items } allDisplayed = loadedEnough && slimmed.length <= numberOfRows; src_debug/* log */.Rm(" Filter:\"".concat(filter, "\" lastBindings: ").concat(lastBindings.length, ", slimmed to ").concat(slimmed.length, "; rows: ").concat(numberOfRows, ", Enough? ").concat(loadedEnough, ", All displayed? ").concat(allDisplayed)); displayable = slimmed.slice(0, numberOfRows); displayable.sort(compareBindingsByName); clearList(); _iterator = _createForOfIteratorHelper(displayable); try { for (_iterator.s(); !(_step = _iterator.n()).done;) { binding = _step.value; table.appendChild(rowForBinding(binding)); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } if (slimmed.length === 1) { gotIt(bindingToTerm(slimmed[0].subject), bindingToTerm(slimmed[0].name)); } case 6: // else inputEventHandlerLock = false; case 7: case "end": return _context7.stop(); } }, _callee7); })); return _refreshList.apply(this, arguments); }; refreshList = function _refreshList2() { return _refreshList.apply(this, arguments); }; filterByName = function _filterByName(filter, bindings) { return bindings.filter(function (binding) { return nameMatch(filter, binding.name.value); }); }; _loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte2() { _loadBindingsAndFilterByLanguage = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee5(filter, languagePrefs) { var bindings, slimmed, _t; return regenerator_default().wrap(function (_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: _context5.prev = 0; _context5.next = 1; return queryPublicDataByName(filter, targetClass, languagePrefs || defaultPreferredLanguages, acOptions.queryParams); case 1: bindings = _context5.sent; _context5.next = 3; break; case 2: _context5.prev = 2; _t = _context5["catch"](0); complain('Error querying db of organizations: ' + _t); inputEventHandlerLock = false; return _context5.abrupt("return"); case 3: loadedEnough = bindings.length < AUTOCOMPLETE_LIMIT; if (loadedEnough) { lastFilter = filter; } else { lastFilter = undefined; } clearList(); slimmed = filterByLanguage(bindings, languagePrefs); return _context5.abrupt("return", slimmed); case 4: case "end": return _context5.stop(); } }, _callee5, null, [[0, 2]]); })); return _loadBindingsAndFilterByLanguage.apply(this, arguments); }; loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte(_x0, _x1) { return _loadBindingsAndFilterByLanguage.apply(this, arguments); }; _inputEventHHandler = function _inputEventHHandler3() { _inputEventHHandler = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee4(_event) { return regenerator_default().wrap(function (_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: // console.log('@@ AC inputEventHHandler called') setVisible(decoration.cancelButton, true); // only allow cancel when there is something to cancel refreshList(); /// @@ debounqce does not work with jest /* if (runningTimeout) { clearTimeout(runningTimeout) } runningTimeout = setTimeout(refreshList, AUTOCOMPLETE_DEBOUNCE_MS) */ case 1: case "end": return _context4.stop(); } }, _callee4); })); return _inputEventHHandler.apply(this, arguments); }; inputEventHHandler = function _inputEventHHandler2(_x9) { return _inputEventHHandler.apply(this, arguments); }; clearList = function _clearList() { while (table.children.length > 1) { table.removeChild(table.lastChild); } }; nameMatch = function _nameMatch(filter, candidate) { var parts = filter.split(' '); // Each name part must be somewhere for (var j = 0; j < parts.length; j++) { var word = parts[j]; if (candidate.toLowerCase().indexOf(word) < 0) return false; } return true; }; _cancelButtonHandler = function _cancelButtonHandler3() { _cancelButtonHandler = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee3(_event) { return regenerator_default().wrap(function (_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: src_debug/* log */.Rm('Auto complete: Canceled by user! '); if (acOptions.permanent) { initialize(); } else { if (div.parentNode) { div.parentNode.removeChild(div); } } case 1: case "end": return _context3.stop(); } }, _callee3); })); return _cancelButtonHandler.apply(this, arguments); }; cancelButtonHandler = function _cancelButtonHandler2(_x8) { return _cancelButtonHandler.apply(this, arguments); }; _acceptButtonHandler = function _acceptButtonHandler3() { _acceptButtonHandler = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee2(_event) { return regenerator_default().wrap(function (_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: if (foundName && searchInput.value === foundName.value) { // still finish(foundObject, foundName); } case 1: case "end": return _context2.stop(); } }, _callee2); })); return _acceptButtonHandler.apply(this, arguments); }; acceptButtonHandler = function _acceptButtonHandler2(_x7) { return _acceptButtonHandler.apply(this, arguments); }; _gotIt = function _gotIt3() { _gotIt = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(object, name) { return regenerator_default().wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: if (!decoration.acceptButton) { _context.next = 1; break; } decoration.acceptButton.disbaled = false; setVisible(decoration.acceptButton, true); // now wait for confirmation searchInput.value = name.value; // complete it foundName = name; foundObject = object; src_debug/* log */.Rm('Auto complete: name: ' + name); src_debug/* log */.Rm('Auto complete: waiting for accept ' + object); clearList(); // This may be an option - nice and clean but does not allow change of mind return _context.abrupt("return"); case 1: setVisible(decoration.cancelButton, true); finish(object, name); case 2: case "end": return _context.stop(); } }, _callee); })); return _gotIt.apply(this, arguments); }; gotIt = function _gotIt2(_x5, _x6) { return _gotIt.apply(this, arguments); }; finish = function _finish(object, name) { src_debug/* log */.Rm('Auto complete: finish! ' + object); if (object.termType === 'Literal' && acOptions.queryParams.objectURIBase) { object = external_SolidLogic_.store.sym(acOptions.queryParams.objectURIBase.value + object.value); } // remove(decoration.cancelButton) // remove(decoration.acceptButton) // remove(div) clearList(); callback(object, name); }; complain = function _complain(message) { var errorRow = table.appendChild(dom.createElement('tr')); src_debug/* log */.Rm(message); var err = new Error(message); errorRow.appendChild(errorMessageBlock(dom, err, 'pink')); // errorMessageBlock will log the stack to the console style.setStyle(errorRow, 'autocompleteRowStyle'); errorRow.style.padding = '1em'; }; // refreshList // initialiize // const queryParams: QueryParameters = acOptions.queryParams targetClass = acOptions.targetClass; if (targetClass) { _context8.next = 1; break; } throw new Error('renderAutoComplete: missing targetClass'); case 1: // console.log(`renderAutoComplete: targetClass=${targetClass}` ) if (decoration.acceptButton) { decoration.acceptButton.addEventListener('click', acceptButtonHandler, false); } if (decoration.cancelButton) { decoration.cancelButton.addEventListener('click', cancelButtonHandler, false); } // var candidatesLoaded = false loadedEnough = false; inputEventHandlerLock = false; allDisplayed = false; lastFilter = undefined; numberOfRows = AUTOCOMPLETE_ROWS; // this gets slimmed down div = dom.createElement('div'); foundName = undefined; // once found accepted string must match this foundObject = undefined; table = div.appendChild(dom.createElement('table')); table.setAttribute('data-testid', 'autocomplete-table'); table.setAttribute('style', 'max-width: 30em; margin: 0.5em;'); head = table.appendChild(dom.createElement('tr')); style.setStyle(head, 'autocompleteRowStyle'); // textInputStyle or cell = head.appendChild(dom.createElement('td')); searchInput = cell.appendChild(dom.createElement('input')); searchInput.setAttribute('type', 'text'); initialize(); size = acOptions.size || styleConstants.textInputSize || 20; searchInput.setAttribute('size', size); searchInput.setAttribute('data-testid', 'autocomplete-input'); searchInputStyle = style.textInputStyle || // searchInputStyle ? 'border: 0.1em solid #444; border-radius: 0.5em; width: 100%; font-size: 100%; padding: 0.1em 0.6em'; // @ searchInput.setAttribute('style', searchInputStyle); searchInput.addEventListener('keyup', function (event) { if (event.keyCode === 13) { acceptButtonHandler(event); } }, false); searchInput.addEventListener('input', inputEventHHandler); // console.log('@@ renderAutoComplete returns ' + div.innerHTML) return _context8.abrupt("return", div); case 2: case "end": return _context8.stop(); } }, _callee8); })); return _renderAutoComplete.apply(this, arguments); } ;// ./src/widgets/forms/autocomplete/autocompleteBar.ts function autocompleteBar_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = autocompleteBar_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function autocompleteBar_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return autocompleteBar_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? autocompleteBar_arrayLikeToArray(r, a) : void 0; } } function autocompleteBar_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /* The Autocomplete Control with decorations This control has the buttons which control the state between editing, viewing, searching, accepting and so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work. */ // dbpediaParameters var WEBID_NOUN = 'Solid ID'; var GREEN_PLUS = iconBase/* icons */.Pt.iconBase + 'noun_34653_green.svg'; var SEARCH_ICON = iconBase/* icons */.Pt.iconBase + 'noun_Search_875351.svg'; var EDIT_ICON = iconBase/* icons */.Pt.iconBase + 'noun_253504.svg'; // const DELETE_ICON = icons.iconBase + 'noun_2188_red.svg' function renderAutocompleteControl(_x, _x2, _x3, _x4, _x5, _x6) { return _renderAutocompleteControl.apply(this, arguments); } // renderAutocompleteControl // ends function _renderAutocompleteControl() { _renderAutocompleteControl = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee6(dom, person, barOptions, acOptions, addOneIdAndRefresh, deleteOne) { var autoCompleteDone, _autoCompleteDone, greenButtonHandler, _greenButtonHandler, removeDecorated, displayAutocomplete, _displayAutocomplete, searchButtonHandler, _searchButtonHandler, droppedURIHandler, _droppedURIHandler, acceptButton, cancelButton, deleteButtonContainer, noun, deleteButton, editButton, editing, syncEditingStatus, decoration, decoratedAutocomplete, creationArea, plus; return regenerator_default().wrap(function (_context6) { while (1) switch (_context6.prev = _context6.next) { case 0: syncEditingStatus = function _syncEditingStatus() { if (editing) { setVisible(editButton, false); setVisible(acceptButton, false); // not till got it setVisible(cancelButton, false); } else { setVisible(editButton, true); setVisible(acceptButton, false); setVisible(cancelButton, false); } }; _droppedURIHandler = function _droppedURIHandler3() { _droppedURIHandler = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee5(uris) { var _iterator, _step, webid, _t2; return regenerator_default().wrap(function (_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: _iterator = autocompleteBar_createForOfIteratorHelper(uris); _context5.prev = 1; _iterator.s(); case 2: if ((_step = _iterator.n()).done) { _context5.next = 4; break; } webid = _step.value; _context5.next = 3; return addOneIdAndRefresh(person, webid); case 3: _context5.next = 2; break; case 4: _context5.next = 6; break; case 5: _context5.prev = 5; _t2 = _context5["catch"](1); _iterator.e(_t2); case 6: _context5.prev = 6; _iterator.f(); return _context5.finish(6); case 7: case "end": return _context5.stop(); } }, _callee5, null, [[1, 5, 6, 7]]); })); return _droppedURIHandler.apply(this, arguments); }; droppedURIHandler = function _droppedURIHandler2(_x1) { return _droppedURIHandler.apply(this, arguments); }; _searchButtonHandler = function _searchButtonHandler3() { _searchButtonHandler = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee4(_event) { return regenerator_default().wrap(function (_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: if (!decoratedAutocomplete) { _context4.next = 1; break; } creationArea.removeChild(decoratedAutocomplete); decoratedAutocomplete = undefined; _context4.next = 2; break; case 1: _context4.next = 2; return displayAutocomplete(); case 2: case "end": return _context4.stop(); } }, _callee4); })); return _searchButtonHandler.apply(this, arguments); }; searchButtonHandler = function _searchButtonHandler2(_x0) { return _searchButtonHandler.apply(this, arguments); }; _displayAutocomplete = function _displayAutocomplete3() { _displayAutocomplete = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee3() { var _t; return regenerator_default().wrap(function (_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: decoratedAutocomplete = dom.createElement('div'); decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;'); _t = decoratedAutocomplete; _context3.next = 1; return renderAutoComplete(dom, acOptions, decoration, autoCompleteDone); case 1: _t.appendChild.call(_t, _context3.sent); // console.log('@@ acceptButton', acceptButton) decoratedAutocomplete.appendChild(acceptButton); // console.log('@@ cancelButton', cancelButton) decoratedAutocomplete.appendChild(cancelButton); // console.log('@@ editButton', editButton) decoratedAutocomplete.appendChild(editButton); // console.log('@@ deleteButtonContainer', deleteButtonContainer) decoratedAutocomplete.appendChild(deleteButtonContainer); creationArea.appendChild(decoratedAutocomplete); case 2: case "end": return _context3.stop(); } }, _callee3); })); return _displayAutocomplete.apply(this, arguments); }; displayAutocomplete = function _displayAutocomplete2() { return _displayAutocomplete.apply(this, arguments); }; removeDecorated = function _removeDecorated() { if (decoratedAutocomplete) { creationArea.removeChild(decoratedAutocomplete); decoratedAutocomplete = undefined; } }; _greenButtonHandler = function _greenButtonHandler3() { _greenButtonHandler = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee2(_event) { var webid; return regenerator_default().wrap(function (_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: _context2.next = 1; return askName(dom, external_SolidLogic_.store, creationArea, src_ns.vcard('url'), undefined, WEBID_NOUN); case 1: webid = _context2.sent; if (webid) { _context2.next = 2; break; } return _context2.abrupt("return"); case 2: return _context2.abrupt("return", addOneIdAndRefresh(person, webid)); case 3: case "end": return _context2.stop(); } }, _callee2); })); return _greenButtonHandler.apply(this, arguments); }; greenButtonHandler = function _greenButtonHandler2(_x9) { return _greenButtonHandler.apply(this, arguments); }; _autoCompleteDone = function _autoCompleteDone3() { _autoCompleteDone = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(object, name) { return regenerator_default().wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: if (acOptions.permanent) { // remember to set this in publicid panel setVisible(editButton, true); setVisible(acceptButton, false); setVisible(cancelButton, false); } else { // console.log('temporary - removed decoratiion') removeDecorated(); } return _context.abrupt("return", addOneIdAndRefresh(object, name)); case 1: case "end": return _context.stop(); } }, _callee); })); return _autoCompleteDone.apply(this, arguments); }; autoCompleteDone = function _autoCompleteDone2(_x7, _x8) { return _autoCompleteDone.apply(this, arguments); }; acceptButton = continueButton(dom); acceptButton.setAttribute('data-testid', 'accept-button'); cancelButton = buttons_cancelButton(dom); cancelButton.setAttribute('data-testid', 'cancel-button'); deleteButtonContainer = dom.createElement('div'); noun = acOptions.targetClass ? label_label(acOptions.targetClass) : 'item'; deleteButton = deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne); // need to knock out this UI or caller does that deleteButton.setAttribute('data-testid', 'delete-button'); editButton = buttons_button(dom, EDIT_ICON, 'Edit', function (_event) { editing = !editing; syncEditingStatus(); }); editButton.setAttribute('data-testid', 'edit-button'); editing = true; decoration = { acceptButton: acceptButton, cancelButton: cancelButton, editButton: editButton, deleteButton: deleteButton }; decoratedAutocomplete = undefined; creationArea = dom.createElement('div'); creationArea.style.display = 'flex'; creationArea.style.flexDirection = 'row'; if (!(acOptions.permanent || acOptions.currentObject)) { _context6.next = 1; break; } _context6.next = 1; return displayAutocomplete(); case 1: if (barOptions.editable) { // creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton creationArea.style.width = '100%'; if (barOptions.manualURIEntry) { plus = creationArea.appendChild(buttons_button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler)); makeDropTarget(plus, droppedURIHandler, undefined); } if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) { creationArea.appendChild(buttons_button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler)); } } syncEditingStatus(); return _context6.abrupt("return", creationArea); case 2: case "end": return _context6.stop(); } }, _callee6); })); return _renderAutocompleteControl.apply(this, arguments); } ;// ./src/widgets/forms/autocomplete/autocompleteField.ts /* Form field for doing autocompleete */ /** * Render a autocomplete form field * * The autocomplete form searches for an object in a definitive public database, * and allows the user to search for it by name, displaying a list of objects whose names match * the input to date, and letting the user either click on one of the list, * or just go on untill there is only one. The process then returns two values, * the URiI of the object and its name. * * @param dom The HTML Document object aka Document Object Model * @param container If present, the created widget will be appended to this * @param already A hash table of (form, subject) kept to prevent recursive forms looping * @param subject The thing about which the form displays/edits data * @param form The form or field to be rendered * @param doc The web document in which the data is * @param callbackFunction Called when data is changed so other parts can be refreshed. * * Form properties: * @param ui:property The property to store the object itself * @param ui:labelProperty The property used to store the name of the object * @param ui:category The class of objects to be searched, if fixed (else dep on class of subject) * * @returns The HTML widget created */ function autocompleteField(dom, container, already, subject, form, doc, callbackFunction) { var _kb$updater; function addOneIdAndRefresh(_x, _x2) { return _addOneIdAndRefresh.apply(this, arguments); } function _addOneIdAndRefresh() { _addOneIdAndRefresh = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(result, name) { var oldValue, oldName, deletables, insertables, _kb$updater2, _t; return regenerator_default().wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: if (name) { _context.next = 1; break; } throw new Error('autocompleteField: No name set.'); case 1: oldValue = kb.the(subject, property, null, doc); if (!oldValue) { _context.next = 2; break; } oldName = kb.any(oldValue, labelProperty, null, doc); if (!(oldValue.equals(result) && oldName && oldName.sameTerm(name))) { _context.next = 2; break; } return _context.abrupt("return"); case 2: deletables = oldValue ? kb.statementsMatching(subject, property, oldValue, doc).concat(kb.statementsMatching(oldValue, labelProperty, null, doc)) : []; // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT())) insertables = [(0,external_$rdf_.st)(subject, property, result, doc), (0,external_$rdf_.st)(result, labelProperty, name, doc)]; // @@ track the language of the name too! // console.log(`AC form: ${deletables.length} to delete and ${insertables.length} to insert`) _context.prev = 3; _context.next = 4; return (_kb$updater2 = kb.updater) === null || _kb$updater2 === void 0 ? void 0 : _kb$updater2.updateMany(deletables, insertables); case 4: _context.next = 6; break; case 5: _context.prev = 5; _t = _context["catch"](3); callbackFunction(false, _t); box.appendChild(errorMessageBlock(dom, 'Autocomplete form data update error:' + _t, null, _t)); return _context.abrupt("return"); case 6: callbackFunction(true, ''); case 7: case "end": return _context.stop(); } }, _callee, null, [[3, 5]]); })); return _addOneIdAndRefresh.apply(this, arguments); } function deleteOne(_x3, _x4) { return _deleteOne.apply(this, arguments); } function _deleteOne() { _deleteOne = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee2(_result, _name) { var oldValue, deletables, insertables, _kb$updater3, e2, _t2; return regenerator_default().wrap(function (_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: oldValue = kb.the(subject, property, null, doc); if (oldValue) { _context2.next = 1; break; } callbackFunction(false, 'NO data to elete'); box.appendChild(errorMessageBlock(dom, 'Autocomplete delete: no old data!')); return _context2.abrupt("return"); case 1: // const oldName = kb.any(oldValue as any, labelProperty as any, null, doc) deletables = kb.statementsMatching(subject, property, oldValue, doc).concat(kb.statementsMatching(oldValue, labelProperty, null, doc)); // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT())) insertables = []; // console.log(`AC form delete: ${deletables.length} to delete and ${insertables.length} to insert`) _context2.prev = 2; _context2.next = 3; return (_kb$updater3 = kb.updater) === null || _kb$updater3 === void 0 ? void 0 : _kb$updater3.updateMany(deletables, insertables); case 3: _context2.next = 5; break; case 4: _context2.prev = 4; _t2 = _context2["catch"](2); e2 = new Error('Autocomplete form data delete error:' + _t2); callbackFunction(false, _t2); box.appendChild(errorMessageBlock(dom, e2, null, _t2)); return _context2.abrupt("return"); case 5: callbackFunction(true, ''); // changed case 6: case "end": return _context2.stop(); } }, _callee2, null, [[2, 4]]); })); return _deleteOne.apply(this, arguments); } if (subject.termType !== 'NamedNode') { throw new Error('Sorry this field only works on NamedNode subjects (for editable)'); } var kb = external_SolidLogic_.store; var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know var box = dom.createElement('div'); if (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, src_ns.ui('property')); if (!property) { return box.appendChild(errorMessageBlock(dom, 'Error: No property given for autocomplete field: ' + form)); } var labelProperty = kb.any(form, src_ns.ui('labelProperty')) || src_ns.schema('name'); // Parse the data source into query options var dataSource = kb.any(form, src_ns.ui('dataSource')); if (!dataSource) { // console.log('@@ connectedStatements ACF ', kb.connectedStatements(form).map(x => x.toNT()).join('\n')) return box.appendChild(errorMessageBlock(dom, 'Error: No data source given for autocomplete field: ' + form)); } var queryParams = { // targetClass: kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc()) as NamedNode | undefined, label: kb.anyJS(dataSource, src_ns.schema('name'), null, dataSource.doc()), logo: kb.any(dataSource, src_ns.schema('logo'), null, dataSource.doc()) }; // @@ Should we pass the target class in from the data source definition or use a current type of the subject var targetClass = kb.any(form, src_ns.ui('targetClass'), null, form.doc()) || // class in form takes pecedence kb.any(dataSource, src_ns.ui('targetClass'), null, dataSource.doc()); if (targetClass) { queryParams.targetClass = targetClass; } queryParams.objectURIBase = kb.any(dataSource, src_ns.ui('objectURIBase'), null, dataSource.doc()) || undefined; /* if (!queryParams.targetClass) { const klass = kb.any(subject, ns.rdf('type')) as NamedNode | undefined // @@ be more selective of which class if many // @@ todo: Take ALL classes, and compare them with those the data source knows about // with translation where necessary. Find most specific of the classes for the search. if (!klass) throw new Error('Autocomplete: No class specified or is current type of' + subject) queryParams.targetClass = klass } */ var endpoint = kb.anyJS(dataSource, src_ns.ui('endpoint'), null, dataSource.doc()); if (endpoint) { // SPARQL queryParams.endpoint = endpoint; queryParams.searchByNameQuery = kb.anyJS(dataSource, src_ns.ui('searchByNameQuery'), null, dataSource.doc()); if (!queryParams.searchByNameQuery) { return box.appendChild(errorMessageBlock(dom, 'Error: No searchByNameQuery given for endpoint data Source: ' + form)); } queryParams.insitituteDetailsQuery = kb.anyJS(dataSource, src_ns.ui('insitituteDetailsQuery'), null, dataSource.doc()); } else { // return box.appendChild( // widgets.errorMessageBlock(dom, 'Error: No SPARQL endpoint given for autocomplete field: ' + form)) var searchByNameURI = kb.anyJS(dataSource, src_ns.ui('searchByNameURI')); if (!searchByNameURI) { return box.appendChild(errorMessageBlock(dom, 'Error: No searchByNameURI OR sparql endpoint given for dataSource: ' + dataSource)); } queryParams.searchByNameURI = searchByNameURI; } // It can be cleaner to just remove empty fields if you can't edit them anyway var suppressEmptyUneditable = kb.anyJS(form, src_ns.ui('suppressEmptyUneditable'), null, formDoc); var editable = (_kb$updater = kb.updater) === null || _kb$updater === void 0 ? void 0 : _kb$updater.editable(doc.uri); var autocompleteOptions = { // cancelButton?: HTMLElement, permanent: true, targetClass: queryParams.targetClass, // @@ simplify? queryParams: queryParams }; autocompleteOptions.size = kb.anyJS(form, src_ns.ui('size'), null, formDoc) || undefined; var obj = kb.any(subject, property, undefined, doc); if (!obj) { obj = kb.any(form, src_ns.ui('default')); if (obj) { autocompleteOptions.currentObject = obj; autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc); } else { // No data or default. Should we suprress the whole field? if (suppressEmptyUneditable && !editable) { box.style.display = 'none'; // clutter removal return box; } } } else { // get object and name from target data: autocompleteOptions.currentObject = obj; autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc); } lhs.appendChild(fieldLabel(dom, property, form)); var barOptions = { editable: editable, dbLookup: true }; renderAutocompleteControl(dom, subject, barOptions, autocompleteOptions, addOneIdAndRefresh, deleteOne).then(function (control) { rhs.appendChild(control); }, function (err) { rhs.appendChild(errorMessageBlock(dom, "Error rendering autocomplete ".concat(form, ": ").concat(err), '#fee', err)); // }); return box; } // ends ;// ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } ;// ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } ;// ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } ;// ./src/style_multiSelect.js /* * BASED ON: * IconicMultiSelect v0.7.0 * Licence: MIT * (c) 2021 Sidney Wimart. * repo & configuration: https://github.com/sidneywm/iconic-multiselect */ /** * @version IconicMultiSelect v0.7.0 * @licence MIT */ var style_multiSelect_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__container:after: ` content: ''; min-height:inherit; font-size:0; `, multiselect__container > *: ` color: #656565; font-size: 14px; `, */ 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: ` multiselect__options_ul_li_hover: "\n background-color: #dedede;\n ", /* multiselect__options ul li *: ` pointer-events: none; `, */ 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: ` multiselect__options_ul_li_multiselect__options_selected: "\n background-color: #656565;\n color: #fff;\n ", // multiselect__options ul li.multiselect__options--selected:hover: ` multiselect__options_ul_li_multiselect__options_selected_hover: "\n background-color: #656565;\n ", // multiselect__options ul li.arrow-selected: ` 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_multiSelect_style.setStyle = function setStyle(ele, styleName) { ele.style = style_multiSelect_style[styleName]; }; ;// ./src/widgets/multiSelect.js /* * IconicMultiSelect v0.7.0 * Licence: MIT * (c) 2021 Sidney Wimart. * repo & configuration: https://github.com/sidneywm/iconic-multiselect */ /** * @version IconicMultiSelect v0.7.0 * @licence MIT */ var IconicMultiSelect = /*#__PURE__*/function () { /** * Iconic Multiselect constructor. * @param { Object[] } data - Array of objects. * @param { string } noData - Defines the message when there is no data input. * @param { string } noResults - Defines the message when there is no result if options are filtered. * @param { string } placeholder - Defines the placeholder's text. * @param { string } select - DOM element to be selected. It must be a HTML Select tag - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select * @param { string } textField - Field to select in the object for the text. * @param { string } valueField - Field to select in the object for the value. */ 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; classCallCheck_classCallCheck(this, IconicMultiSelect); _defineProperty(this, "_data", void 0); _defineProperty(this, "_domElements", void 0); _defineProperty(this, "_event", function () {}); _defineProperty(this, "_itemTemplate", void 0); _defineProperty(this, "_multiselect", void 0); _defineProperty(this, "_noData", void 0); _defineProperty(this, "_noResults", void 0); _defineProperty(this, "_options", []); _defineProperty(this, "_placeholder", void 0); _defineProperty(this, "_select", void 0); _defineProperty(this, "_selectContainer", void 0); _defineProperty(this, "_selectedOptions", []); _defineProperty(this, "_tagTemplate", void 0); _defineProperty(this, "_textField", void 0); _defineProperty(this, "_valueField", void 0); _defineProperty(this, "_cross", "\n \n \n \n "); this._data = data !== null && data !== void 0 ? data : []; this._itemTemplate = itemTemplate !== null && itemTemplate !== void 0 ? itemTemplate : null; this._noData = noData !== null && noData !== void 0 ? noData : 'No data found.'; this._noResults = noResults !== null && noResults !== void 0 ? noResults : 'No results found.'; this._placeholder = placeholder !== null && placeholder !== void 0 ? placeholder : 'Select...'; this._select = select; // Timea added a container here this._selectContainer = container; this._tagTemplate = tagTemplate !== null && tagTemplate !== void 0 ? tagTemplate : null; this._textField = textField !== null && textField !== void 0 ? textField : null; this._valueField = valueField !== null && valueField !== void 0 ? valueField : null; } /** * Initialize the Iconic Multiselect component. * @public */ return createClass_createClass(IconicMultiSelect, [{ key: "init", value: function init() { // Timea change to use this._select instead of this._selectContainer if (this._select && this._select.nodeName === 'SELECT') { if (this._itemTemplate && this._data.length === 0) { throw new Error('itemTemplate must be initialized with data from the component settings'); } if (this._tagTemplate && this._data.length === 0) { 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 < this.list.length; i++) { var node = this.list[i]; if (callbackFn(node)) return node; } return undefined; }, some: function some(callbackFn) { for (var i = 0; i < this.list.length; i++) { var node = this.list[i]; if (callbackFn(node, i)) return true; } return false; } } }; this._enableEventListenners(); this._initSelectedList(); } else { throw new Error("The selector '".concat(this._select, "' did not select any valid select tag.")); } } /** * Subscribes to the emitted events. * @param { Function } callback - Callback function which emits a custom event object. * @public */ }, { key: "subscribe", value: function subscribe(callback) { if (typeof callback === 'function') { this._event = callback; } else { throw new Error('parameter in the subscribe method is not a function'); } } /** * Add an option to the selection list. * @param { Object: { text: string; value: string; }} option * @private */ }, { key: "_addOptionToList", value: function _addOptionToList(option, index) { var _this = this; var html = "").concat(this._tagTemplate ? this._processTemplate(this._tagTemplate, index) : option.text, "").concat(this._cross, ""); this._domElements.input.insertAdjacentHTML('beforebegin', html); var _this$_multiselect$qu = this._multiselect.querySelector("span[data-value=\"".concat(option.value, "\"]")), removeBtn = _this$_multiselect$qu.lastElementChild; removeBtn.addEventListener('click', function () { var target = _this._domElements.options.find(function (el) { return el.dataset.value === option.value; }); _this._handleOption(target); }); } /** * Clears all selected options. * @private */ }, { key: "_clearSelection", value: function _clearSelection() { var _this2 = this; var _loop = function _loop() { var option = _this2._selectedOptions[i]; var target = _this2._domElements.options.find(function (el) { return el.dataset.value === option.value; }); target.classList.remove('multiselect__options--selected'); target.setAttribute('style', style_multiSelect_style.multiselect__options); _this2._removeOptionFromList(target.dataset.value); }; for (var i = 0; i < this._selectedOptions.length; i++) { _loop(); } this._selectedOptions = []; this._handleClearSelectionBtn(); this._handlePlaceholder(); this._dispatchEvent({ action: 'CLEAR_ALL_OPTIONS', selection: this._selectedOptions }); } /** * Close the options container. * @private */ }, { key: "_closeList", value: function _closeList() { this._domElements.input.value = ''; this._domElements.optionsContainer.classList.remove('visible'); this._domElements.optionsContainer.setAttribute('style', style_multiSelect_style.multiselect__options); this._filterOptions(''); this._removeAllArrowSelected(); } /** * Dispatches new events. * @param { object : { action: string; selection: { option: string; text: string; }[]; value?: string; } } event * @private */ }, { key: "_dispatchEvent", value: function _dispatchEvent(event) { this._event(event); } /** * Enables all main event listenners. * @private */ }, { key: "_enableEventListenners", value: function _enableEventListenners() { var _this3 = this; document.addEventListener('mouseup', function (_ref2) { var target = _ref2.target; if (!_this3._multiselect.contains(target)) { _this3._filterOptions(''); _this3._closeList(); _this3._handlePlaceholder(); } }); this._domElements.clear.addEventListener('click', function () { _this3._clearSelection(); }); for (var i = 0; i < this._domElements.options.list.length; i++) { var option = this._domElements.options.list[i]; option.addEventListener('click', function (_ref3) { var target = _ref3.target; _this3._handleOption(target); _this3._closeList(); }); } this._domElements.input.addEventListener('focus', function () { _this3._domElements.optionsContainer.classList.add('visible'); _this3._domElements.optionsContainer.setAttribute('style', style_multiSelect_style.multiselect__options_visible); }); this._domElements.input.addEventListener('input', function (_ref4) { var value = _ref4.target.value; if (_this3._domElements.options.list.length > 0) { _this3._filterOptions(value); } }); this._domElements.input.addEventListener('keydown', function (e) { _this3._handleArrows(e); _this3._handleBackspace(e); _this3._handleEnter(e); }); } /** * Filters user input. * @param { string } value * @private */ }, { key: "_filterOptions", value: function _filterOptions(value) { var _this4 = this; var isOpen = this._domElements.optionsContainer.classList.contains('visible'); var valueLowerCase = value.toLowerCase(); if (!isOpen && value.length > 0) { this._domElements.optionsContainer.classList.add('visible'); this._domElements.optionsContainer.setAttribute('style', style_multiSelect_style.multiselect__options_visible); } if (this._domElements.options.list.length > 0) { for (var i = 0; i < this._domElements.options.list.length; i++) { var el = this._domElements.options.list[i]; var text = this._itemTemplate ? this._data[i][this._textField] : el.textContent; if (text.toLowerCase().substring(0, valueLowerCase.length) === valueLowerCase) { this._domElements.optionsContainerList.appendChild(el); } else { el.parentNode && el.parentNode.removeChild(el); } } var hasResults = this._domElements.options.some(function (el, index) { return (_this4._itemTemplate ? _this4._data[index][_this4._textField] : el.textContent).toLowerCase().substring(0, valueLowerCase.length) === valueLowerCase; }); this._showNoResults(!hasResults); } } }, { key: "_generateId", value: function _generateId(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for (var i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } /** * Gets data from select tag. * @private */ }, { key: "_getDataFromSelectTag", value: function _getDataFromSelectTag() { var arr = []; var options = this._select.options; for (var i = 0; i < options.length; i++) { var item = options[i]; arr.push({ text: item.text, value: item.value, selected: item.hasAttribute('selected') }); } return arr; } /** * Gets data from settings. * @private */ }, { key: "_getDataFromSettings", value: function _getDataFromSettings() { if (this._data.length > 0 && this._valueField && this._textField) { var isValueFieldValid = typeof this._valueField === 'string'; var isTextFieldValid = typeof this._textField === 'string'; var arr = []; if (!isValueFieldValid || !isTextFieldValid) { throw new Error('textField and valueField must be of type string'); } for (var i = 0; i < this._data.length; i++) { var item = this._data[i]; arr.push({ value: item[this._valueField], text: item[this._textField], selected: typeof item.selected === 'boolean' ? item.selected : false }); } return arr; } else { return null; } } /** * Handles Arrow up & Down. Selection of an option is also possible with these keys. * @param { Event } event * @private */ }, { key: "_handleArrows", value: function _handleArrows(event) { if (event.keyCode === 40 || event.keyCode === 38) { event.preventDefault(); var isOpen = this._domElements.optionsContainer.classList.contains('visible'); // An updated view of the container is needed because of the filtering option var optionsContainerList = this._multiselect.querySelector('.multiselect__options > ul'); if (!isOpen) { this._domElements.optionsContainer.classList.add('visible'); this._domElements.optionsContainer.setAttribute('style', style_multiSelect_style.multiselect__options_visible); optionsContainerList.firstElementChild.classList.add('arrow-selected'); optionsContainerList.firstElementChild.setAttribute('style', style_multiSelect_style.multiselect__options_ul_li_arrow_selected); optionsContainerList.firstElementChild.scrollIntoView(false); } else { var selected = this._multiselect.querySelector('.multiselect__options ul li.arrow-selected'); var action = { ArrowUp: 'previous', Up: 'previous', ArrowDown: 'next', Down: 'next' }; if (!selected) { optionsContainerList.firstElementChild.classList.add('arrow-selected'); optionsContainerList.firstElementChild.setAttribute('style', style_multiSelect_style.multiselect__options_ul_li_arrow_selected); optionsContainerList.firstElementChild.scrollIntoView(false); return; } selected.classList.remove('arrow-selected'); selected.setAttribute('style', style_multiSelect_style.multiselect__options_ul_li); selected = selected[action[event.key] + 'ElementSibling']; // Go to start or end of the popup list if (!selected) { selected = optionsContainerList.children[action[event.key] === 'next' ? 0 : optionsContainerList.children.length - 1]; selected.classList.add('arrow-selected'); selected.setAttribute('style', style_multiSelect_style.multiselect__options_ul_li_arrow_selected); this._scrollIntoView(optionsContainerList, selected); return; } selected.classList.add('arrow-selected'); selected.setAttribute('style', style_multiSelect_style.multiselect__options_ul_li_arrow_selected); this._scrollIntoView(optionsContainerList, selected); } } } /** * Handles the backspace key event - Deletes the preceding option in the selection list. * @param { Event } e * @private */ }, { key: "_handleBackspace", value: function _handleBackspace(e) { if (e.keyCode === 8 && 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); if (this._selectedOptions.length === 0) { this._domElements.optionsContainer.classList.remove('visible'); this._domElements.optionsContainer.setAttribute('style', style_multiSelect_style.multiselect__options); } } } } /** * Shows clear selection button if some options are selected. * @private */ }, { key: "_handleClearSelectionBtn", value: function _handleClearSelectionBtn() { if (this._selectedOptions.length > 0) { this._domElements.clear.style.display = 'flex'; } else { this._domElements.clear.style.display = 'none'; } } /** * Handles the enter key event. * @param { Event } event * @private */ }, { key: "_handleEnter", value: function _handleEnter(event) { if (event.keyCode === 13) { var selected = this._multiselect.querySelector('.multiselect__options ul li.arrow-selected'); if (selected) { this._handleOption(selected); this._closeList(); } } } }, { key: "_handleOption", value: function _handleOption(target) { var dispatchEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; // Remove for (var i = 0; i < this._selectedOptions.length; i++) { var el = this._selectedOptions[i]; if (el.value === target.dataset.value) { target.classList.remove('multiselect__options--selected'); target.setAttribute('style', style_multiSelect_style.multiselect__options); this._selectedOptions.splice(i, 1); this._removeOptionFromList(target.dataset.value); this._handleClearSelectionBtn(); this._handlePlaceholder(); return dispatchEvent && this._dispatchEvent({ action: 'REMOVE_OPTION', value: target.dataset.value, selection: this._selectedOptions }); } } // Add for (var _i = 0; _i < this._options.length; _i++) { var option = this._options[_i]; if (option.value === target.dataset.value) { target.classList.add('multiselect__options--selected'); target.setAttribute('style', style_multiSelect_style.multiselect__options_selected); this._selectedOptions = [].concat(_toConsumableArray(this._selectedOptions), [option]); this._addOptionToList(option, _i); this._handleClearSelectionBtn(); this._handlePlaceholder(); return dispatchEvent && this._dispatchEvent({ action: 'ADD_OPTION', value: target.dataset.value, selection: this._selectedOptions }); } } } /** * Shows the placeholder if no options are selected. * @private */ }, { key: "_handlePlaceholder", value: function _handlePlaceholder() { this._domElements.input.placeholder = this._placeholder; } }, { key: "_initSelectedList", value: function _initSelectedList() { var _this5 = this; var hasItemsSelected = false; var _loop2 = function _loop2() { var option = _this5._options[i]; if (option.selected) { hasItemsSelected = true; var target = _this5._domElements.options.find(function (el) { return el.dataset.value === option.value; }); target.classList.add('multiselect__options--selected'); target.setAttribute('style', style_multiSelect_style.multiselect__options_selected); _this5._selectedOptions = [].concat(_toConsumableArray(_this5._selectedOptions), [option]); _this5._addOptionToList(option, i); } }; for (var i = 0; i < this._options.length; i++) { _loop2(); } if (hasItemsSelected) { this._handleClearSelectionBtn(); } this._handlePlaceholder(); } /** * Process the custom template. * @param { string } template * @private */ }, { key: "_processTemplate", value: function _processTemplate(template, index) { var processedTemplate = template; var objAttr = template.match(/\$\{(\w+)\}/g).map(function (e) { return e.replace(/\$\{|\}/g, ''); }); for (var i = 0; i < objAttr.length; i++) { var _this$_data$index$att; var attr = objAttr[i]; // eslint-disable-next-line no-useless-escape processedTemplate = processedTemplate.replace("${".concat(attr, "}"), (_this$_data$index$att = this._data[index][attr]) !== null && _this$_data$index$att !== void 0 ? _this$_data$index$att : ''); } return processedTemplate; } }, { key: "_removeAllArrowSelected", value: function _removeAllArrowSelected() { var className = 'arrow-selected'; var target = this._domElements.options.find(function (el) { return el.classList.contains(className); }); target && target.classList.remove(className) && target.setAttribute('style', style_multiSelect_style.multiselect__options_ul_li); } /** * Removes an option from the list. * @param { string } value * @private */ }, { key: "_removeOptionFromList", value: function _removeOptionFromList(value) { var optionDom = this._multiselect.querySelector("span[data-value=\"".concat(value, "\"]")); optionDom && optionDom.parentNode && optionDom.parentNode.removeChild(optionDom); } /** * Renders the multiselect options list view. * @private */ }, { key: "_renderOptionsList", value: function _renderOptionsList() { var _this6 = this; var html = "\n
\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(this._options.length === 0), "\n
\n
\n "); this._multiselect.insertAdjacentHTML('beforeend', html); } /** * Renders the multiselect view. * @private */ }, { key: "_renderMultiselect", value: function _renderMultiselect() { this._select.style.display = 'none'; var id = 'iconic-' + this._generateId(20); // Timea created dedicated div element because previous code was not rendering this._multiselect = document.createElement('div'); this._multiselect.setAttribute('id', id); this._multiselect.setAttribute('class', 'multiselect__container'); this._multiselect.setAttribute('style', style_multiSelect_style.multiselect__container); var html = "\n
\n \n
\n ").concat(this._cross, "\n "); this._multiselect.innerHTML = html; this._selectContainer.appendChild(this._multiselect); } /** * ScrollIntoView - This small utility reproduces the behavior of .scrollIntoView({ block: "nearest", inline: "nearest" }) * This is for IE compatibility without a need of a polyfill * @private */ }, { key: "_scrollIntoView", value: function _scrollIntoView(parent, child) { var rectParent = parent.getBoundingClientRect(); var rectChild = child.getBoundingClientRect(); // Detect if not visible at top and then scroll to the top if (!(rectParent.top < rectChild.bottom - child.offsetHeight)) { parent.scrollTop = child.clientHeight + (child.offsetTop - child.offsetHeight); } // Detect if not visible at bottom and then scroll to the bottom if (!(rectParent.bottom > rectChild.top + child.offsetHeight)) { parent.scrollTop = child.clientHeight + (child.offsetTop - child.offsetHeight) - (parent.offsetHeight - (child.offsetHeight + (child.offsetHeight - child.clientHeight))); } } /** * Shows a no data message. * @param { boolean } condition * @private */ }, { key: "_showNoData", value: function _showNoData(condition) { return condition ? "

").concat(this._noData, "

") : ''; } /** * Shows a no results message. * @param { boolean } condition * @private */ }, { 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); } } }]); }(); ;// ./src/widgets/forms.js function forms_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = forms_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function forms_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return forms_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? forms_arrayLikeToArray(r, a) : void 0; } } function forms_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /* F O R M S * * A Vanilla Dom implementation of the form language */ /* global alert */ // Note default export var checkMarkCharacter = "\u2713"; var cancelCharacter = "\u2715"; var dashCharacter = '-'; var forms_kb = external_SolidLogic_.store; field[src_ns.ui('AutocompleteField').uri] = autocompleteField; // /////////////////////////////////////////////////////////////////////// /* Form Field implementations ** */ /** Group of different fields ** ** One type of form field is an ordered Group of other fields. ** A Form is actually just the same as a group. ** ** @param {Document} dom The HTML Document object aka Document Object Model ** @param {Element?} container If present, the created widget will be appended to this ** @param {Map} already A hash table of (form, subject) kept to prevent recursive forms looping ** @param {Node} subject The thing about which the form displays/edits data ** @param {Node} form The form or field to be rendered ** @param {Node} dataDoc The web document in which the data is ** @param {function(ok, errorMessage)} callbackFunction Called when data is changed? ** ** @returns {Element} The HTML widget created */ function refreshOpionsSubfieldinGroup(dom, already, subject, dataDoc, callbackFunction, groupDiv, subfields) { var eles = groupDiv.children; for (var j = 0; j < subfields.length; j++) { // This is really messy. var _field = subfields[j]; var t = mostSpecificClassURI(_field); // Field type if (t === src_ns.ui('Options').uri) { var optionsRender = fieldFunction(dom, _field); var newOne = optionsRender(dom, null, already, subject, _field, dataDoc, callbackFunction); src_debug/* log */.Rm('Refreshing Options field by replacing it.'); // better to support actual refresh groupDiv.insertBefore(newOne, eles[j]); groupDiv.removeChild(eles[j + 1]); // Remove the old one } } } field[src_ns.ui('Form').uri] = field[src_ns.ui('Group').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) { var box = dom.createElement('div'); var ui = src_ns.ui; if (container) container.appendChild(box); // Prevent loops if (!form) return; var key = subject.toNT() + '|' + form.toNT(); if (already[key]) { // been there done that box.appendChild(dom.createTextNode('Group: see above ' + key)); // TODO fix dependency cycle to solid-panes by calling outlineManager // const plist = [$rdf.st(subject, ns.owl('sameAs'), subject)] // @@ need prev subject // dom.outlineManager.appendPropertyTRs(box, plist) // dom.appendChild(plist) return box; } var already2 = {}; for (var x in already) already2[x] = 1; already2[key] = 1; var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know var weight0 = forms_kb.any(form, ui('weight'), null, formDoc); // Say 0-3 var weight = weight0 ? Number(weight0.value) : 1; if (weight > 3 || weight < 0) return box.appendChild(errorMessageBlock(dom, "Form Group weight ".concat(weight, " should be 0-3"))); box.setAttribute('style', style.formGroupStyle[weight]); // Indent a group box.style.display = 'flex'; box.style.flexDirection = 'column'; box["class"] = 'form-weight-' + weight; var parts = forms_kb.any(form, ui('parts'), null, formDoc); var subfields; if (parts) { subfields = parts.elements; } else { parts = forms_kb.each(form, ui('part'), null, formDoc); // Warning: unordered subfields = sortBySequence(parts); } if (!parts) { return box.appendChild(errorMessageBlock(dom, 'No parts to form! ')); } for (var i = 0; i < subfields.length; i++) { var _field2 = subfields[i]; var subFieldFunction = fieldFunction(dom, _field2); // var itemChanged = function itemChanged(ok, body) { if (ok && body && body.widget && body.widget === 'select') { refreshOpionsSubfieldinGroup(dom, already, subject, dataDoc, callbackFunction, box, subfields); } callbackFunction(ok, { widget: 'group', change: body }); }; box.appendChild(subFieldFunction(dom, null, already2, subject, _field2, dataDoc, itemChanged)); } return box; }; /** Options field: Select one or more cases ** ** @param {Document} dom The HTML Document object aka Document Object Model ** @param {Element?} container If present, the created widget will be appended to this ** @param {Map} already A hash table of (form, subject) kept to prevent recursive forms looping ** @param {Node} subject The thing about which the form displays/edits data ** @param {Node} form The form or field to be rendered ** @param {Node} dataDoc The web document in which the data is ** @param {function(ok, errorMessage)} callbackFunction Called when data is changed? ** ** @returns {Element} The HTML widget created */ field[src_ns.ui('Options').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) { var kb = external_SolidLogic_.store; var box = dom.createElement('div'); var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know var ui = src_ns.ui; if (container) container.appendChild(box); var dependingOn = kb.any(form, ui('dependingOn')); if (!dependingOn) { dependingOn = src_ns.rdf('type'); } // @@ default to type (do we want defaults?) var cases = kb.each(form, ui('case'), null, formDoc); if (!cases) { box.appendChild(errorMessageBlock(dom, 'No cases to Options form. ')); } var values; if (dependingOn.sameTerm(src_ns.rdf('type'))) { values = Object.keys(kb.findTypeURIs(subject)).map(function (uri) { return external_$rdf_.sym(uri); }); // Use RDF-S inference } else { values = kb.each(subject, dependingOn); } for (var i = 0; i < cases.length; i++) { var c = cases[i]; var tests = kb.each(c, ui('for'), null, formDoc); // There can be multiple 'for' var match = false; for (var j = 0; j < tests.length; j++) { var _iterator = forms_createForOfIteratorHelper(values), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var value = _step.value; var test = tests[j]; if (value.sameTerm(tests) || value.termType === test.termType && value.value === test.value) { match = true; } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } if (match) { var _field3 = kb.the(c, ui('use')); if (!_field3) { box.appendChild(errorMessageBlock(dom, 'No "use" part for case in form ' + form)); return box; } else { appendForm(dom, box, already, subject, _field3, dataDoc, callbackFunction); } break; } } // @@ Add box.refresh() to sync fields with values return box; }; /** Multiple field: zero or more similar subFields ** ** @param {Document} dom The HTML Document object aka Document Object Model ** @param {Element?} container If present, the created widget will be appended to this ** @param {Map} already A hash table of (form, subject) kept to prevent recursive forms looping ** @param {Node} subject The thing about which the form displays/edits data ** @param {Node} form The form or field to be rendered ** @param {Node} dataDoc The web document in which the data is ** @param {function(ok, errorMessage)} callbackFunction Called when data is changed? ** ** @returns {Element} The HTML widget created ** ** Form properties: ** @param {Boolean} reverse Make e reverse arc in the data OPS not SPO ** @param {NamedNode} property The property to be written in the data ** @param {Boolean} ordered Is the list an ordered one where the user defined the order */ field[src_ns.ui('Multiple').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) { /** Diagnostic function */ function debugString(values) { return values.map(function (x) { return x.toString().slice(-7); }).join(', '); } /** Add an item to the local quadstore not the UI or the web * * @param {Node} object The RDF object to be represented by this item. */ function addItem() { return _addItem.apply(this, arguments); } /** Make a dom representation for an item * @param {Event} anyEvent if used as an event handler * @param {Node} object The RDF object to be represented by this item. */ function _addItem() { _addItem = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee6() { var object, toBeInserted, msg, _t; return regenerator_default().wrap(function (_context6) { while (1) switch (_context6.prev = _context6.next) { case 0: object = newThing(dataDoc); // by default just add new nodes if (!ordered) { _context6.next = 2; break; } createListIfNecessary(); // Sets list and unsavedList list.elements.push(object); _context6.next = 1; return saveListThenRefresh(); case 1: _context6.next = 7; break; case 2: toBeInserted = reverse ? [external_$rdf_.st(object, property, subject, dataDoc)] : [external_$rdf_.st(subject, property, object, dataDoc)]; _context6.prev = 3; _context6.next = 4; return kb.updater.update([], toBeInserted); case 4: _context6.next = 6; break; case 5: _context6.prev = 5; _t = _context6["catch"](3); msg = 'Error adding to unordered multiple: ' + _t; box.appendChild(errorMessageBlock(dom, msg)); src_debug/* error */.z3(msg); case 6: refresh(); case 7: case "end": return _context6.stop(); } }, _callee6, null, [[3, 5]]); })); return _addItem.apply(this, arguments); } function renderItem(object) { function deleteThisItem() { return _deleteThisItem.apply(this, arguments); } /** Move the object up or down in the ordered list * @param {Event} anyEvent if used as an event handler * @param {Boolean} upwards Move this up (true) or down (false). */ function _deleteThisItem() { _deleteThisItem = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee3() { var i, del; return regenerator_default().wrap(function (_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: if (!ordered) { _context3.next = 5; break; } src_debug/* log */.Rm('pre delete: ' + debugString(list.elements)); i = 0; case 1: if (!(i < list.elements.length)) { _context3.next = 4; break; } if (!list.elements[i].sameTerm(object)) { _context3.next = 3; break; } list.elements.splice(i, 1); _context3.next = 2; return saveListThenRefresh(); case 2: return _context3.abrupt("return"); case 3: i++; _context3.next = 1; break; case 4: _context3.next = 6; break; case 5: // unordered if (kb.holds(subject, property, object, dataDoc)) { del = [external_$rdf_.st(subject, property, object, dataDoc)]; kb.updater.update(del, [], function (uri, ok, message) { if (ok) { body.removeChild(subField); } else { body.appendChild(errorMessageBlock(dom, 'Multiple: delete failed: ' + message)); } }); } case 6: case "end": return _context3.stop(); } }, _callee3); })); return _deleteThisItem.apply(this, arguments); } function moveThisItem(_x, _x2) { return _moveThisItem.apply(this, arguments); } /* A subField has been filled in * * One possibility is to not actually make the link to the thing until * this callback happens to avoid widow links */ function _moveThisItem() { _moveThisItem = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee4(event, upwards) { var i; return regenerator_default().wrap(function (_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: // @@ possibly, allow shift+click to do move to top or bottom? src_debug/* log */.Rm('pre move: ' + debugString(list.elements)); i = 0; case 1: if (!(i < list.elements.length)) { _context4.next = 3; break; } if (!list.elements[i].sameTerm(object)) { _context4.next = 2; break; } return _context4.abrupt("continue", 3); case 2: i++; _context4.next = 1; break; case 3: if (i === list.elements.length) { alert('list move: not found element for ' + object); } if (!upwards) { _context4.next = 5; break; } if (!(i === 0)) { _context4.next = 4; break; } alert('@@ boop - already at top -temp message'); // @@ make boop sound return _context4.abrupt("return"); case 4: list.elements.splice(i - 1, 2, list.elements[i], list.elements[i - 1]); _context4.next = 7; break; case 5: if (!(i === list.elements.length - 1)) { _context4.next = 6; break; } alert('@@ boop - already at bottom -temp message'); // @@ make boop sound return _context4.abrupt("return"); case 6: list.elements.splice(i, 2, list.elements[i + 1], list.elements[i]); case 7: _context4.next = 8; return saveListThenRefresh(); case 8: case "end": return _context4.stop(); } }, _callee4); })); return _moveThisItem.apply(this, arguments); } function itemDone(ok, message) { src_debug/* log */.Rm("Item done callback for item ".concat(object.toString())); if (!ok) { // when does this happen? errors typically deal with upstream src_debug/* error */.z3(' Item done callback: Error: ' + message); } callbackFunction(ok, message); } debug('Multiple: render object: ' + object); var fn = fieldFunction(dom, element); var subField = fn(dom, null, already, object, element, dataDoc, itemDone); // subfields was: body. moving to not passing that subField.subject = object; // Keep a back pointer between the DOM array and the RDF objects // delete button and move buttons if (kb.updater.editable(dataDoc.uri)) { deleteButtonWithCheck(dom, subField, multipleUIlabel, deleteThisItem); if (ordered) { // Add controsl in a frame var frame = dom.createElement('div'); frame.style.display = 'grid'; frame.style.gridTemplateColumns = 'auto 3em'; frame.style.gridTemplateRows = '50% 50%'; var moveUpButton = buttons_button(dom, iconBase/* icons */.Pt.iconBase + 'noun_1369237.svg', 'Move Up', /*#__PURE__*/function () { var _ref = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(event) { return regenerator_default().wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: return _context.abrupt("return", moveThisItem(event, true)); case 1: case "end": return _context.stop(); } }, _callee); })); return function (_x3) { return _ref.apply(this, arguments); }; }()); var moveDownButton = buttons_button(dom, iconBase/* icons */.Pt.iconBase + 'noun_1369241.svg', 'Move Down', /*#__PURE__*/function () { var _ref2 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee2(event) { return regenerator_default().wrap(function (_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: return _context2.abrupt("return", moveThisItem(event, false)); case 1: case "end": return _context2.stop(); } }, _callee2); })); return function (_x4) { return _ref2.apply(this, arguments); }; }()); var _shim = dom.createElement('div'); _shim.appendChild(subField); // Subfield has its own layout frame.appendChild(_shim); frame.appendChild(moveUpButton); frame.appendChild(moveDownButton); moveUpButton.style.gridColumn = 2; moveDownButton.style.gridColumn = 2; moveUpButton.style.gridRow = 1; moveDownButton.style.padding = '0em'; // don't take too much space moveUpButton.style.padding = '0em'; moveDownButton.style.gridRow = 2; _shim.style.gridColumn = 1; _shim.style.gridRowStart = 'span 2'; // Cover both rows // shim.style.gridRowEnd = 2 // Cover both rows return frame; } } return subField; // unused } // renderItem /// ///////// Body of Multiple form field implementation var plusIconURI = iconBase/* icons */.Pt.iconBase + 'noun_19460_green.svg'; // white plus in green circle var kb = external_SolidLogic_.store; var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know var box = dom.createElement('div'); var shim = box; // no shim // We don't indent multiple as it is a sort of a prefix of the next field and has contents of one. // box.setAttribute('style', 'padding-left: 2em; border: 0.05em solid green;') // Indent a multiple var ui = src_ns.ui; if (container) container.appendChild(box); var orderedNode = kb.any(form, ui('ordered')); var ordered = orderedNode ? external_$rdf_.Node.toJS(orderedNode) : false; var property = kb.any(form, ui('property')); var reverse = kb.anyJS(form, ui('reverse'), null, formDoc); if (!property) { box.appendChild(errorMessageBlock(dom, 'No property to multiple: ' + form)); // used for arcs in the data return shim; } var multipleUIlabel = kb.any(form, ui('label')); if (!multipleUIlabel) multipleUIlabel = label_label(property); var min = kb.any(form, ui('min')); // This is the minimum number -- default 0 min = min ? 0 + min.value : 0; var element = kb.any(form, ui('part')); // This is the form to use for each one if (!element) { box.appendChild(errorMessageBlock(dom, 'No part to multiple: ' + form)); return shim; } var body = box.appendChild(dom.createElement('div')); body.style.display = 'flex'; body.style.flexDirection = 'column'; var list; // The RDF collection which keeps the ordered version or null var values; // Initial values - always an array. Even when no list yet. values = reverse ? kb.any(null, property, subject, dataDoc) : kb.any(subject, property, null, dataDoc); if (ordered) { list = reverse ? kb.any(null, property, subject, dataDoc) : kb.any(subject, property, null, dataDoc); if (list) { values = list.elements; } else { values = []; } } else { values = reverse ? kb.each(null, property, subject, dataDoc) : kb.each(subject, property, null, dataDoc); list = null; } // Add control on the bottom for adding more items if (kb.updater.editable(dataDoc.uri)) { var tail = box.appendChild(dom.createElement('div')); tail.style.padding = '0.5em'; var img = tail.appendChild(dom.createElement('img')); img.setAttribute('src', plusIconURI); // plus sign img.setAttribute('style', 'margin: 0.2em; width: 1.5em; height:1.5em'); img.title = 'Click to add another ' + multipleUIlabel; var prompt = dom.createElement('span'); prompt.textContent = (values.length === 0 ? 'Add another ' : 'Add ') + multipleUIlabel; tail.addEventListener('click', /*#__PURE__*/function () { var _ref3 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee5(_eventNotUsed) { return regenerator_default().wrap(function (_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: _context5.next = 1; return addItem(); case 1: case "end": return _context5.stop(); } }, _callee5); })); return function (_x5) { return _ref3.apply(this, arguments); }; }(), true); tail.appendChild(prompt); } function createListIfNecessary() { if (!list) { list = new external_$rdf_.Collection(); if (reverse) { kb.add(list, property, subject, dataDoc); } else { kb.add(subject, property, list, dataDoc); } } } function saveListThenRefresh() { return _saveListThenRefresh.apply(this, arguments); } function _saveListThenRefresh() { _saveListThenRefresh = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee7() { var _t2; return regenerator_default().wrap(function (_context7) { while (1) switch (_context7.prev = _context7.next) { case 0: src_debug/* log */.Rm('save list: ' + debugString(list.elements)); // 20191214 createListIfNecessary(); _context7.prev = 1; _context7.next = 2; return kb.fetcher.putBack(dataDoc); case 2: _context7.next = 4; break; case 3: _context7.prev = 3; _t2 = _context7["catch"](1); box.appendChild(errorMessageBlock(dom, 'Error trying to put back a list: ' + _t2)); return _context7.abrupt("return"); case 4: refresh(); case 5: case "end": return _context7.stop(); } }, _callee7, null, [[1, 3]]); })); return _saveListThenRefresh.apply(this, arguments); } function refresh() { var vals; if (ordered) { var li = reverse ? kb.the(null, property, subject, dataDoc) : kb.the(subject, property, null, dataDoc); vals = li ? li.elements : []; } else { vals = reverse ? kb.each(null, property, subject, dataDoc) : kb.each(subject, property, null, dataDoc); vals.sort(); // achieve consistency on each refresh } syncTableToArrayReOrdered(body, vals, renderItem); } body.refresh = refresh; // Allow live update refresh(); function asyncStuff() { return _asyncStuff.apply(this, arguments); } function _asyncStuff() { _asyncStuff = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee8() { var extra, j; return regenerator_default().wrap(function (_context8) { while (1) switch (_context8.prev = _context8.next) { case 0: extra = min - values.length; if (!(extra > 0)) { _context8.next = 4; break; } j = 0; case 1: if (!(j < extra)) { _context8.next = 3; break; } src_debug/* log */.Rm('Adding extra: min ' + min); _context8.next = 2; return addItem(); case 2: j++; _context8.next = 1; break; case 3: _context8.next = 4; return saveListThenRefresh(); case 4: case "end": return _context8.stop(); } }, _callee8); })); return _asyncStuff.apply(this, arguments); } asyncStuff().then(function () { src_debug/* log */.Rm(' Multiple render: async stuff ok'); }, function (err) { src_debug/* error */.z3(' Multiple render: async stuff fails. #### ', err); }); // async return shim; }; // Multiple /* Text field ** */ // For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm // or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html // field[src_ns.ui('PhoneField').uri] = basicField; field[src_ns.ui('EmailField').uri] = basicField; field[src_ns.ui('ColorField').uri] = basicField; field[src_ns.ui('DateField').uri] = basicField; field[src_ns.ui('DateTimeField').uri] = basicField; field[src_ns.ui('TimeField').uri] = basicField; field[src_ns.ui('NumericField').uri] = basicField; field[src_ns.ui('IntegerField').uri] = basicField; field[src_ns.ui('DecimalField').uri] = basicField; field[src_ns.ui('FloatField').uri] = basicField; field[src_ns.ui('TextField').uri] = basicField; field[src_ns.ui('SingleLineTextField').uri] = basicField; field[src_ns.ui('NamedNodeURIField').uri] = basicField; /* Multiline Text field ** */ field[src_ns.ui('MultiLineTextField').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) { var ui = src_ns.ui; var kb = external_SolidLogic_.store; var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know var property = kb.any(form, ui('property')); if (!property) { return errorMessageBlock(dom, 'No property to text field: ' + form); } var box = dom.createElement('div'); box.style.display = 'flex'; box.style.flexDirection = 'row'; var left = box.appendChild(dom.createElement('div')); left.style.width = styleConstants.formFieldNameBoxWidth; var right = box.appendChild(dom.createElement('div')); left.appendChild(fieldLabel(dom, property, form)); dataDoc = fieldStore(subject, property, dataDoc); var text = kb.anyJS(subject, property, null, dataDoc) || ''; var editable = kb.updater.editable(dataDoc.uri); var suppressEmptyUneditable = form && kb.anyJS(form, src_ns.ui('suppressEmptyUneditable'), null, formDoc); if (!editable && suppressEmptyUneditable && text === '') { box.style.display = 'none'; } var field = makeDescription(dom, kb, subject, property, dataDoc, callbackFunction); right.appendChild(field); if (container) container.appendChild(box); return box; }; /* Boolean field and Tri-state version (true/false/null) ** ** @@ todo: remove tristate param */ function booleanField(dom, container, already, subject, form, dataDoc, callbackFunction, tristate) { var ui = src_ns.ui; var kb = external_SolidLogic_.store; var property = kb.any(form, ui('property')); if (!property) { var errorBlock = errorMessageBlock(dom, 'No property to boolean field: ' + form); if (container) container.appendChild(errorBlock); return errorBlock; } var lab = kb.any(form, ui('label')); if (!lab) lab = label_label(property, true); // Init capital dataDoc = fieldStore(subject, property, dataDoc); var state = kb.any(subject, property); if (state === undefined) { state = false; } // @@ sure we want that -- or three-state? var ins = external_$rdf_.st(subject, property, true, dataDoc); var del = external_$rdf_.st(subject, property, false, dataDoc); var box = buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate); if (container) container.appendChild(box); return box; } field[src_ns.ui('BooleanField').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) { return booleanField(dom, container, already, subject, form, dataDoc, callbackFunction, false); }; field[src_ns.ui('TristateField').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) { return booleanField(dom, container, already, subject, form, dataDoc, callbackFunction, true); }; /* Classifier field ** ** Nested categories ** ** @@ To do: If a classification changes, then change any dependent Options fields. */ field[src_ns.ui('Classifier').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) { var kb = external_SolidLogic_.store; var ui = src_ns.ui; var category = kb.any(form, ui('category')); if (!category) { return errorMessageBlock(dom, 'No category for classifier: ' + form); } debug('Classifier: dataDoc=' + dataDoc); var checkOptions = function checkOptions(ok, body) { if (!ok) return callbackFunction(ok, body); return callbackFunction(ok, body); }; var box = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions); if (container) container.appendChild(box); return box; }; /** Choice field ** ** Not nested. Generates a link to something from a given class. ** Optional subform for the thing selected. ** Generates a subForm based on a ui:use form ** Will look like: **