diff --git a/dist/alpheios-embedded.js b/dist/alpheios-embedded.js
index 8123844..103ff64 100644
--- a/dist/alpheios-embedded.js
+++ b/dist/alpheios-embedded.js
@@ -94,7 +94,7 @@ window["AlpheiosEmbed"] =
/*! exports provided: name, version, build, description, main, directories, scripts, repository, author, license, bugs, homepage, devDependencies, engines, jest, eslintConfig, eslintIgnore, dependencies, default */
/***/ (function(module) {
-module.exports = JSON.parse("{\"name\":\"alpheios-embedded\",\"version\":\"3.0.0\",\"build\":\"37\",\"description\":\"Alpheios Embedded Library\",\"main\":\"dist/alpheios-embedded.js\",\"directories\":{\"doc\":\"doc\"},\"scripts\":{\"test\":\"npm run lint && jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"build\":\"npm run build-dev && npm run build-prod\",\"build-prod\":\"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs all production app config.mjs\",\"build-dev\":\"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs all development app config.mjs\",\"auth0-env-update\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/prod --t=dist/auth0 --f=env-embed.js\",\"auth0-env-dev-update\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/dev --t=dist/auth0 --f=env-embed.js\",\"lint\":\"eslint --fix src/**/*.js\",\"update-dependencies\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-components/dist/ --t=dist/lib && node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-components/dist/style --t=dist/style\",\"build-experimental\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs webpack development app config.mjs\",\"dev\":\"npm run build-experimental && http-server -c-1 -p 8888 & onchange src -- npm run build-experimental\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/alpheios-project/wordsvc.git\"},\"author\":\"The Alpheios Project, Ltd.\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/alpheios-project/wordsvc/issues\"},\"homepage\":\"https://github.com/alpheios-project/wordsvc#readme\",\"devDependencies\":{\"alpheios-client-adapters\":\"github:alpheios-project/client-adapters\",\"alpheios-components\":\"file://../components\",\"alpheios-data-models\":\"github:alpheios-project/data-models\",\"alpheios-experience\":\"github:alpheios-project/experience\",\"alpheios-inflection-tables\":\"github:alpheios-project/inflection-tables\",\"alpheios-node-build\":\"github:alpheios-project/node-build\",\"alpheios-res-client\":\"github:alpheios-project/res-client\",\"alpheios-wordlist\":\"github:alpheios-project/wordlist\",\"copy-webpack-plugin\":\"^5.0.4\",\"coveralls\":\"^3.0.6\",\"css-loader\":\"^3.2.0\",\"eslint\":\"^6.2.2\",\"eslint-config-standard\":\"^12.0.0\",\"eslint-plugin-import\":\"^2.18.2\",\"eslint-plugin-node\":\"^9.1.0\",\"eslint-plugin-promise\":\"^4.2.1\",\"eslint-plugin-standard\":\"^4.0.1\",\"eslint-plugin-vue\":\"^5.2.3\",\"html-loader\":\"^0.5.5\",\"html-loader-jest\":\"^0.2.1\",\"http-server\":\"^0.11.1\",\"interactjs\":\"^1.5.4\",\"intl-messageformat\":\"^2.2.0\",\"jest\":\"^24.9.0\",\"jest-fetch-mock\":\"^2.1.2\",\"onchange\":\"^6.0.0\",\"raw-loader\":\"^3.1.0\",\"sass-loader\":\"^7.3.1\",\"source-map-loader\":\"^0.2.4\",\"style-loader\":\"^0.23.1\",\"url-loader\":\"^2.1.0\",\"vue-loader\":\"^15.7.1\",\"vue-style-loader\":\"^4.1.2\",\"vue-svg-loader\":\"^0.12.0\",\"webpack-dev-server\":\"^3.8.0\"},\"engines\":{\"node\":\">= 9.10.1\",\"npm\":\">= 5.6.0\"},\"jest\":{\"verbose\":true,\"transform\":{\"^.+\\\\.htmlf$\":\"html-loader-jest\",\"^.+\\\\.jsx?$\":\"babel-jest\"},\"transformIgnorePatterns\":[\"node_modules/alpheios-components/\"]},\"eslintConfig\":{\"env\":{\"browser\":true,\"node\":true},\"parser\":\"babel-eslint\",\"parserOptions\":{\"sourceType\":\"module\",\"ecmaVersion\":2019,\"allowImportExportEverywhere\":true}},\"eslintIgnore\":[\"**/dist\"],\"dependencies\":{}}");
+module.exports = JSON.parse("{\"name\":\"alpheios-embedded\",\"version\":\"3.0.0\",\"build\":\"38\",\"description\":\"Alpheios Embedded Library\",\"main\":\"dist/alpheios-embedded.js\",\"directories\":{\"doc\":\"doc\"},\"scripts\":{\"test\":\"npm run lint && jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"build\":\"npm run build-dev && npm run build-prod\",\"build-prod\":\"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs all production app config.mjs\",\"build-dev\":\"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs all development app config.mjs\",\"auth0-env-update\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/prod --t=dist/auth0 --f=env-embed.js\",\"auth0-env-dev-update\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/dev --t=dist/auth0 --f=env-embed.js\",\"lint\":\"eslint --fix src/**/*.js\",\"update-dependencies\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-components/dist/ --t=dist/lib && node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-components/dist/style --t=dist/style\",\"build-experimental\":\"node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs webpack development app config.mjs\",\"dev\":\"npm run build-experimental && http-server -c-1 -p 8888 & onchange src -- npm run build-experimental\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/alpheios-project/wordsvc.git\"},\"author\":\"The Alpheios Project, Ltd.\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/alpheios-project/wordsvc/issues\"},\"homepage\":\"https://github.com/alpheios-project/wordsvc#readme\",\"devDependencies\":{\"alpheios-client-adapters\":\"github:alpheios-project/client-adapters\",\"alpheios-components\":\"github:alpheios-project/components\",\"alpheios-data-models\":\"github:alpheios-project/data-models\",\"alpheios-experience\":\"github:alpheios-project/experience\",\"alpheios-inflection-tables\":\"github:alpheios-project/inflection-tables\",\"alpheios-node-build\":\"github:alpheios-project/node-build\",\"alpheios-res-client\":\"github:alpheios-project/res-client\",\"alpheios-wordlist\":\"github:alpheios-project/wordlist\",\"copy-webpack-plugin\":\"^5.0.4\",\"coveralls\":\"^3.0.6\",\"css-loader\":\"^3.2.0\",\"eslint\":\"^6.2.2\",\"eslint-config-standard\":\"^12.0.0\",\"eslint-plugin-import\":\"^2.18.2\",\"eslint-plugin-node\":\"^9.1.0\",\"eslint-plugin-promise\":\"^4.2.1\",\"eslint-plugin-standard\":\"^4.0.1\",\"eslint-plugin-vue\":\"^5.2.3\",\"html-loader\":\"^0.5.5\",\"html-loader-jest\":\"^0.2.1\",\"http-server\":\"^0.11.1\",\"interactjs\":\"^1.5.4\",\"intl-messageformat\":\"^2.2.0\",\"jest\":\"^24.9.0\",\"jest-fetch-mock\":\"^2.1.2\",\"onchange\":\"^6.0.0\",\"raw-loader\":\"^3.1.0\",\"sass-loader\":\"^7.3.1\",\"source-map-loader\":\"^0.2.4\",\"style-loader\":\"^0.23.1\",\"url-loader\":\"^2.1.0\",\"vue-loader\":\"^15.7.1\",\"vue-style-loader\":\"^4.1.2\",\"vue-svg-loader\":\"^0.12.0\",\"webpack-dev-server\":\"^3.8.0\"},\"engines\":{\"node\":\">= 9.10.1\",\"npm\":\">= 5.6.0\"},\"jest\":{\"verbose\":true,\"transform\":{\"^.+\\\\.htmlf$\":\"html-loader-jest\",\"^.+\\\\.jsx?$\":\"babel-jest\"},\"transformIgnorePatterns\":[\"node_modules/alpheios-components/\"]},\"eslintConfig\":{\"env\":{\"browser\":true,\"node\":true},\"parser\":\"babel-eslint\",\"parserOptions\":{\"sourceType\":\"module\",\"ecmaVersion\":2019,\"allowImportExportEverywhere\":true}},\"eslintIgnore\":[\"**/dist\"],\"dependencies\":{}}");
/***/ }),
@@ -305,6 +305,8 @@ class Embedded {
}
if (this.simpleMode) {
actionPanelParams.showNav = false
+ } else {
+ actionPanelParams.showNav = true
}
let toolbarParams = {}
diff --git a/dist/alpheios-embedded.js.map b/dist/alpheios-embedded.js.map
index ec20e59..d0f16ca 100644
--- a/dist/alpheios-embedded.js.map
+++ b/dist/alpheios-embedded.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack://AlpheiosEmbed/webpack/bootstrap","webpack://AlpheiosEmbed/./embedded.js","webpack://AlpheiosEmbed/./lib/app-authenticator.js","webpack://AlpheiosEmbed/./lib/session-authenticator.js","webpack://AlpheiosEmbed/./state.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAC2B;AAC0F;AAC/D;AACQ;AAC9D;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,gDAAgD;AAC3D;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,qCAAqC;AACrC;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD,wBAAwB;AACxB,0BAA0B;AAC1B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,KAAK;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,8CAAK;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,YAAY,qDAAc,CAAC,GAAG,mDAAY,CAAC,SAAS,yDAAkB,EAAE;AACpF;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,uDAAuD,WAAW,8DAAgB,WAAW;AAC7F,OAAO;AACP,uDAAuD,WAAW,kEAAoB,WAAW;AACjG;AACA,KAAK;AACL,qDAAqD,aAAa;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D,qCAAqC;AACjG,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,0EAA0E,8BAA8B;;AAExG;AACA;;AAEA,KAAK;AACL,6DAA6D,MAAM;AACnE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,WAAW;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAiE;AACjE;AACA;AACA;AACA;AACA,gBAAgB,qDAAqD;;AAErE;AACA;AACA,gBAAgB;AAChB,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iBAAiB;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oBAAoB;AACjD;AACA;;;;;;;;;;;;;ACzVA;AAAA;AAAA;AACA;AACA;AACA;AACe;AACf;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;;;;;;;;;;;;AC1LA;AAAA;AAAA;AACA;AACA;AACA;AACe;AACf;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,yCAAyC,MAAM;AAC/C,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,uCAAuC,MAAM;AAC7C,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACzFA;AAAA;AAAA;AACA;AACA,cAAc,YAAY;AAC1B;AACe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"alpheios-embedded.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./embedded.js\");\n","/* eslint-env jest */\n/* global Event */\nimport State from './state'\nimport { version as packageVersion, build as packageBuild, description as packageDescription } from '../package.json'\nimport AppAuthenticator from './lib/app-authenticator'\nimport SessionAuthenticator from './lib/session-authenticator'\n// A variable that will store an instance of the imported components module\nlet components\n\n/**\n * Imports dynamic dependencies that are required for the embed-lib.\n * @param {object} options - A configuration object of the import function.\n * @param {'production' | 'development' | 'cdn' | 'custom'} options.mode - What type of libraries shall be imported.\n * 'production' - will load minified version of libraries from a `dist/lib` local directory;\n * 'development' - will load non-optimized libraries with source maps from a `dist/lib` local directory;\n * 'cdn' - will load the latest version of minified libraries from JSDelivr (this is a default value);\n * 'custom' - allows to specify your own paths for loading the libraries. The paths shall be specified\n * as values of keys of a `libs` object.\n * @param {object} options.libs - An object whose properties specify paths from where libraries to be loaded.\n * {string} options.libs.components - A path to a components library. Value for a default `production` mode\n * is `./lib/alpheios-components.min.js`.\n * @return {Promise} - A promise that is resolved when all dependencies are loaded\n * or rejected when there was an error during an import.\n */\nexport function importDependencies (options) {\n let libs = {}\n switch (options.mode) {\n case 'production':\n libs.components = './lib/alpheios-components.min.js'\n break\n case 'development':\n libs.components = './lib/alpheios-components.js'\n break\n case 'custom':\n libs = options.libs\n break\n case 'cdn':\n default:\n libs.components = 'https://cdn.jsdelivr.net/npm/alpheios-components@latest/dist/alpheios-components.min.js'\n break\n }\n return new Promise((resolve, reject) => {\n let imports = []\n let componentsImport = import(\n /* webpackIgnore: true */\n libs.components\n ).then(() => {\n components = window.AlpheiosComponents\n })\n imports.push(componentsImport)\n\n Promise.all(imports).then(() => {\n resolve (Embedded)\n }).catch((e) => {\n reject(e)\n })\n })\n}\n\n/**\n * Encapsulation of Alpheios functionality which can be embedded in a webpage\n */\nclass Embedded {\n /**\n * @constructor\n * @param {Object} arguments - object with the following properties:\n * clientId: a string identifying the embedding client or site. Required.\n * authEnv: authentication environment object.(Optional)\n * documentObject: the parent document. Default: window.document\n * enabledSelector: a CSS Selector string identifying the page elements for which Alpheios should be activated\n * Default: \".alpheios-enabled\"\n * disabledSelector: a CSS Selector string identifying the page elements for which Alpheios should be deactivated\n * Default: [data-alpheios-ignore=\"all\"]\n * enabledClass: a CSS class to apply to alpheios/staten enabled elements\n * Default: \"\"\n * disabledClass: a CSS class to apply to alpheios disabled elements\n * Default: \"\"\n * mobileTriggerEvent: DOM Event to trigger word selection on mobile devices\n * Default: longTap\n * desktopTriggerEvent: DOM Event to trigger word selection on desktops\n * Default: \"dblclick\"\n * triggerPreCallback: a callback function which is called when the trigger event handler is invoked, prior to initiating\n * Alpheios functionality. It should return true to proceed with lookup or false to abort.\n * Default: no-op, returns true\n * popupInitialPos: object containing initial css positioning properties for the popup\n * Default { top: 10vh, right: 10vw}\n * toolbarInitialPos: object containing initial css positioning properties for the toolbar\n * Default { top: 10px, right: 15px}\n * actionPanelInitialPos: object containing initial css positioning properties for the action panel (mobile)\n * Default { bottom: 120px, right: 20px}\n * layoutType: 'default' or 'readingTools' (readingTools is used for the Alpheios Reader UI)\n * Default: 'default'\n * disableTextSelection: set to true to disable default browser text selection behavior (not recommended)\n * Default: false\n * textLangCode: default language for lookups via the toolbar\n * Default: null (which will result in the user preferred page language being used)\n * overrideHelp: set to true to disable the default alpheios behavior for the help icon\n * (client code must attach their own handler to the \".alpheios-toolbar__help-control\" element)\n * Default: false\n * simpleMode: set to true to restrict the UI to the popup/morphology panel (with grammar links) and lookup but no other features\n * Default: false\n */\n constructor ({\n clientId = null,\n authEnv = null,\n documentObject = document,\n enabledSelector = '.alpheios-enabled',\n disabledSelector = '',\n enabledClass = '',\n disabledClass = '',\n mobileTriggerEvent = null,\n desktopTriggerEvent = null,\n triggerPreCallback = (evt) => { return true }, // Not used at the moment but can be set as a filter for `this.ui.getSelectedText()` calls\n popupInitialPos = {},\n toolbarInitialPos = {},\n actionPanelInitialPos = {},\n layoutType = 'default', // The other option is 'readingTools'\n // Disable text selection on mobile devices\n disableTextSelection = false,\n textLangCode = null,\n overrideHelp = false,\n simpleMode = false\n } = {}) {\n this.clientId = clientId\n\n if (this.clientId === null) {\n throw new Error('Please identify the site.')\n }\n // TODO at some point in the future we may add authentication of\n // clientId\n this.doc = documentObject\n this.authEnv = authEnv\n this.state = new State()\n this.enabledSelector = enabledSelector\n this.disabledSelector = disabledSelector\n this.enabledClass = enabledClass\n this.disabledClass = disabledClass\n this.desktopTriggerEvent = desktopTriggerEvent\n this.mobileTriggerEvent = mobileTriggerEvent\n this.triggerPreCallback = triggerPreCallback\n this.simpleMode = simpleMode\n\n // Set an initial UI Controller state for activation\n this.state.setPanelClosed() // A default state of the panel is CLOSED\n this.state.tab = 'info' // A default tab is \"info\"\n\n this.ui = components.UIController.create(this.state, {\n storageAdapter: components.LocalStorageArea,\n textQueryTriggerDesktop: this.desktopTriggerEvent,\n textQueryTriggerMobile: this.mobileTriggerEvent,\n textQuerySelector: this.enabledSelector,\n triggerPreCallback: this.triggerPreCallback,\n app: { version:`${packageVersion}.${packageBuild}`, name: packageDescription },\n clientId: this.clientId,\n // Disable text selection on mobile devices\n disableTextSelection: disableTextSelection,\n textLangCode: textLangCode,\n overrideHelp: overrideHelp\n })\n // Environment-specific initializations\n if (this.authEnv) {\n if (authEnv.CLIENT_ID) {\n // Register an authentication module only with authentication environment is loaded\n this.ui.registerModule(components.AuthModule, { auth: new AppAuthenticator(authEnv) })\n } else if (authEnv.LOGIN_URL) {\n this.ui.registerModule(components.AuthModule, { auth: new SessionAuthenticator(authEnv) })\n }\n } else {\n this.ui.registerModule(components.AuthModule, { auth: null })\n }\n // Register UI modules\n let panelParams = {}\n if (this.simpleMode) {\n panelParams.showNav = false\n }\n this.ui.registerModule(components.PanelModule, panelParams)\n\n let popupParams = {}\n if (popupInitialPos && Object.values(popupInitialPos).filter(value => Boolean(value)).length > 0) {\n popupParams.initialPos = popupInitialPos\n }\n if (this.simpleMode) {\n popupParams.showNav = false\n }\n this.ui.registerModule(components.PopupModule, popupParams)\n\n let actionPanelParams = {}\n if (actionPanelInitialPos && Object.values(actionPanelInitialPos).filter(value => Boolean(value)).length > 0) {\n actionPanelParams.initialPos = actionPanelInitialPos\n }\n if (this.simpleMode) {\n actionPanelParams.showNav = false\n }\n\n let toolbarParams = {}\n if (this.simpleMode) {\n toolbarParams.showNav = false\n }\n if (layoutType === 'default') {\n if (toolbarInitialPos && Object.values(toolbarInitialPos).filter(value => Boolean(value)).length > 0) {\n toolbarParams.initialPos = toolbarInitialPos\n }\n\n this.ui.registerModule(components.ToolbarModule, toolbarParams)\n this.ui.registerModule(components.ActionPanelModule, { showNav: actionPanelParams.showNav })\n } else if (layoutType === 'readingTools') {\n // This is a special configuration for Alpheios Reading Tools\n if (this.ui.platform.isDesktop) {\n if (toolbarInitialPos && Object.values(toolbarInitialPos).filter(value => Boolean(value)).length > 0) {\n toolbarParams.initialPos = toolbarInitialPos\n }\n\n this.ui.registerModule(components.ToolbarModule, toolbarParams)\n } else if (this.ui.platform.isMobile) {\n this.ui.registerModule(components.ActionPanelModule, {\n lookupResultsIn: 'panel',\n initialPos: actionPanelParams.initialPos,\n showNav: actionPanelParams.showNav\n })\n }\n }\n }\n\n get platform () {\n return this.ui.platform\n }\n\n notifyExtension () {\n this.doc.body.dispatchEvent(new Event('Alpheios_Embedded_Response'))\n }\n\n async activate () {\n try {\n /**\n * Notify extension that an embedded lib is present.\n * We need to do this right after an activation.\n * If webextension is loaded sooner than the embedded library\n * than the extension will have no information about\n * the embedded library presence unless explicitly notified by us.\n */\n this.notifyExtension()\n\n // await this.ui.init() // Activate will call `init()` if has not been initialized previously\n await this.ui.activate()\n\n // Set a body attribute so the content scrip will know if embedded library is active on a page\n this.doc.body.setAttribute('alpheios-embed-lib-status', 'active')\n this.doc.body.addEventListener('Alpheios_Embedded_Check', event => { this.notifyExtension(event) })\n\n // and set the state on the components\n this.ui.setEmbedLibActive(true)\n\n } catch (error) {\n console.error(`Unexpected error activating Alpheios: ${error}`)\n return\n }\n\n let selector = this.enabledSelector\n\n if (!selector) {\n throw new Error('Configuration must define selector')\n }\n let activateOn = this.doc.querySelectorAll(selector)\n if (activateOn.length === 0) {\n // it could be that we want to activate Alpheios for lookups via the\n // tools even if there isn't any text on the page to activate to on\n // so just print a warning here.\n console.warn(`Alpheios was activated for the page but not any content (no elements matching ${activateOn}).`)\n }\n if (this.enabledClass) {\n for (let elem of activateOn) {\n elem.classList.add(this.enabledClass)\n }\n }\n if (this.disabledSelector) {\n let disableOn = this.doc.querySelectorAll(this.disabledSelector)\n for (let elem of disableOn) {\n elem.setAttribute('data-alpheios-ignore', 'all')\n if (this.disabledClass) {\n elem.classList.add(this.disabledClass)\n }\n }\n }\n\n let alignment = new components.AlignmentSelector(this.doc, {})\n alignment.activate()\n let alignmentTranslation = components.UIController.initAlignedTranslation(this.doc, '.aligned-translation',\n {\n // resize from all edges and corners\n edges: { left: true, right: true, bottom: false, top: false },\n\n // minimum size\n restrictSize: {\n min: { width: 200 }\n },\n\n // keep the edges inside the parent\n restrictEdges: {\n outer: this.doc.body,\n endOnly: true\n },\n inertia: true\n },\n event => {\n let target = event.target\n // update the element's style\n target.style.width = `${event.rect.width}px`\n })\n return this\n }\n\n openToolbar () {\n this.ui.openToolbar()\n }\n\n openActionPanel () {\n if (this.ui.platform.isMobile) {\n this.ui.closePanel()\n }\n this.ui.openActionPanel()\n }\n\n closeActionPanel () {\n this.ui.closeActionPanel()\n }\n\n /**\n * Opens the action panel with toolbar buttons hidden and only the lookup visible.\n */\n openActionPanelLookup () {\n if (this.ui.platform.isMobile) {\n this.ui.closePanel()\n }\n this.ui.openActionPanel({ showNav: false })\n }\n\n /**\n * Opens the action panel with only toolbar buttons visible.\n */\n openActionPanelToolbar () {\n if (this.ui.platform.isMobile) {\n this.ui.closePanel()\n }\n this.ui.openActionPanel({ showLookup: false })\n }\n}\n","/* global Auth0Lock */\n/**\n * Encapsulates Authentication Functionality For a Client Side Application\n */\nexport default class AppAuthenticator {\n /**\n * @constructor\n * @param {Object} env - environment object with the following properties\n * CLIENT_ID - Auth0 client id\n * DOMAIN - Auth0 domain\n * AUDIENCE - Auth0 audience\n * ENDPOINTS - Alpheios user api endpoints\n * LOGOUT_URL - Auth0 logout url\n */\n constructor (env) {\n // An Auth0 Lock widget instance. Will be initialized lazily\n this.auth0Lock = null\n this._auth0profile = null // A user profile from Auth0\n this.env = env\n }\n\n /**\n * a link for login external to the alpheios components\n * @return null for client side login\n */\n loginUrl() {\n return null\n }\n\n /**\n * a link for logout external to the alpheios components\n * @return null for client side login\n */\n logoutUrl() {\n return null\n }\n\n /**\n * session request unimplemented for app auth\n */\n session () {\n return new Promise((resolve,reject) => {\n reject(new Error(\"Session request not supported\"))\n })\n }\n\n /**\n * Authenticates user with an Auth0.\n * @return {Promise}\n */\n authenticate () {\n // TODO we should check to see if we already have a valid idToken before\n // initiating authentication\n return new Promise((resolve, reject) => {\n if (!this.auth0Lock) {\n if (!this.env) {\n let error = `Unable to find Auth0 configuration. Auth0 functionality will be disabled`\n console.error(error)\n reject(error)\n }\n // test environment\n if (this.env.TEST_ID) {\n localStorage.setItem('access_token', this.env.TEST_ID)\n localStorage.setItem('id_token', this.env.TEST_ID)\n localStorage.setItem('is_test_user', true)\n resolve(\"Authenticated\")\n } else {\n // initialize auth0 lock\n this.auth0Lock = new Auth0Lock(this.env.CLIENT_ID, this.env.DOMAIN, {\n theme: {\n logo: 'https://alpheios.net/logos/alpheios_32.png',\n labeledSubmitButton: false,\n primaryColor: '#436476'\n },\n languageDictionary: {\n title: \"Login\",\n signUpTerms: \"By signing up, you agree to our terms of service and privacy policy.\"\n },\n mustAcceptTerms: true,\n auth: {\n redirect: false,\n params: {\n audience: this.env.AUDIENCE,\n scope: 'openid profile email',\n prompt: 'consent select_account',\n },\n responseType: 'token id_token'\n }\n })\n // Handle login\n this.auth0Lock.on('authenticated', (authResult) => {\n this.auth0Lock.hide()\n localStorage.setItem('access_token', authResult.accessToken)\n localStorage.setItem('id_token', authResult.idToken)\n //localStorage.setItem('profile', JSON.stringify(profile))\n resolve(\"Authenticated\")\n })\n\n // Unrecoverable error handler\n this.auth0Lock.on('unrecoverable_error', (error) => {\n console.error(`Auth0 Lock unrecoverable error: `, error)\n reject('Auth0 Lock unrecoverable')\n })\n\n // An authorization error\n this.auth0Lock.on('authorization_error', (error) => {\n console.error(`Auth0 Lock authorization error: `, error)\n reject('Auth0Lock authorization error')\n })\n this.auth0Lock.show()\n // TODO: Handle a situation when `authenticated` event is never fired (is that ever possible)\n // maybe via a Timeout?\n }\n }\n })\n }\n\n /**\n * Retrieves user profile information from Auth0.\n * @return {Promise}\n */\n getProfileData () {\n return new Promise((resolve, reject) => {\n const token = localStorage.getItem('access_token')\n if (!token) {\n console.error('You must login to call this protected endpoint!')\n reject('Login required')\n }\n if (localStorage.getItem('is_test_user')) {\n let testProfile = {\n name: 'Alpheios Test User',\n nickname: 'testuser',\n sub: 'testuser'\n }\n localStorage.setItem('profile', JSON.stringify(testProfile))\n resolve(testProfile)\n } else {\n this.auth0Lock.getUserInfo(token, (error, profile) => {\n if (error) {\n reject(error)\n } else {\n localStorage.setItem('profile', JSON.stringify(profile))\n resolve(profile)\n }\n })\n }\n })\n }\n\n /**\n * Retrieves user data from a remote provider (e.g. Alpheios servers).\n * @return {Promise}\n */\n getUserData () {\n return new Promise((resolve, reject) => {\n const token = localStorage.getItem('access_token')\n\n // block request from happening if no JWT token present\n if (!token) {\n console.error('You must login to call this protected endpoint!')\n reject('Not Authenticated')\n }\n resolve(token)\n })\n }\n\n /**\n * Retrieves the list of configured endpoints for the environment\n * @return {Object}\n */\n getEndPoints () {\n return this.env.ENDPOINTS\n }\n\n /**\n * Respond to a logout request\n */\n logout() {\n localStorage.removeItem('id_token')\n localStorage.removeItem('access_token')\n localStorage.removeItem('profile')\n this.auth0Lock.logout({\n returnTo: this.env.LOGOUT_URL\n })\n }\n\n}\n","/* global Auth0Lock */\n/**\n * Encapsulates Authentication Functionality For a Client Side Application\n */\nexport default class SessionAuthenticator {\n /**\n * @constructor\n * @param {Object} env - environment object with the following properties\n * LOGIN_URL - login url\n * LOGOUT_URL - logout url\n * SESSION_URL - session url\n * TOKEN_URL - token url\n * ENDPOINTS - Alpheios user api endpoints\n */\n constructor (env) {\n this.sessionUrl = env.SESSION_URL\n this.tokenUrl = env.TOKEN_URL\n this.endpoints = env.ENDPOINTS\n this._loginUrl = env.LOGIN_URL\n this._logoutUrl = env.LOGOUT_URL\n }\n\n /**\n * Login link for server\n * @return {String} login link from config\n */\n loginUrl() {\n return this._loginUrl\n }\n\n /**\n * Logout link for server\n * @return {String} logout link from config\n */\n logoutUrl() {\n return this._logoutUrl\n }\n\n session () {\n return new Promise((resolve,reject) => {\n window.fetch(this.sessionUrl).then((resp) => {\n if (! resp.ok) {\n reject(resp.code)\n } else {\n resolve(resp.json())\n }\n }).catch((error) => {\n reject(`Session request failed ${error}`)\n })\n })\n }\n\n authenticate () {\n // TODO we should check to see if we already have a valid idToken before\n // initiating authentication\n return new Promise((resolve, reject) => {\n reject(\"Server Side Authenticator\")\n })\n }\n\n getUserData () {\n return new Promise((resolve,reject) => {\n window.fetch(this.tokenUrl).then((resp) => {\n if (! resp.ok) {\n reject(resp.code)\n } else {\n resolve(resp.json())\n }\n }).catch((error) => {\n reject(`token request failed ${error}`)\n })\n })\n }\n\n /**\n * Retrieves the list of configured endpoints for the environment\n * @return {Object}\n */\n getEndPoints () {\n return this.endpoints\n }\n\n /**\n * Respond to a logout request\n */\n logout() {\n return\n }\n\n}\n","/**\n * Contains Alpheios state\n * @property {panelStatus} panelStatus\n */\nexport default class State {\n constructor (tabID) {\n this.panelStatus = undefined\n this.tab = undefined\n this.watchers = new Map()\n }\n\n static create (source) {\n let copy = new State()\n for (let key of Object.keys(source)) {\n copy[key] = source[key]\n }\n return copy\n }\n\n static get defaults () {\n return {\n panelStatus: State.statuses.panel.OPEN\n }\n }\n\n static get statuses () {\n return {\n embedLib: {\n PENDING: Symbol.for('Alpheios_Status_Pending'), // Has not been fully initialized yet\n ACTIVE: Symbol.for('Alpheios_Status_Active'), // Is loaded and active\n DEACTIVATED: Symbol.for('Alpheios_Status_Deactivated'), // Has been loaded, but is deactivated\n DISABLED: Symbol.for('Alpheios_Status_Disabled') // Has been loaded, but it is disabled\n },\n panel: {\n OPEN: Symbol.for('Alpheios_Status_PanelOpen'), // Panel is open\n CLOSED: Symbol.for('Alpheios_Status_PanelClosed'), // Panel is closed\n DEFAULT: Symbol.for('Alpheios_Status_PanelDefault') // Panel should set its state according to default values\n },\n tab: {\n DEFAULT: 'default' // A tab should be set according to default values\n }\n }\n }\n\n /**\n * Sets a watcher function that is called every time a property is changed using a setItem() method.\n * @param {String} property - A name of a property that should be monitored\n * @param {Function} watchFunc - A function that will be called every time a property changes\n * @return {State} Reference to self for chaining\n */\n setWatcher (property, watchFunc) {\n this.watchers.set(property, watchFunc)\n return this\n }\n\n /**\n * SetItem provides a monitored way to change state. If value is assigned to a data property directly\n * there is no way to know if a property was changed. However, if a property was changed using setItem() method,\n * and if there is a watcher function registered for a changed property name,\n * this function will be called on every property change, passing a changed property name as an argument.\n * @param key\n * @param value\n * @return {State}\n */\n setItem (key, value) {\n this[key] = value\n if (this.watchers && this.watchers.has(key)) {\n this.watchers.get(key)(key, this)\n }\n return this\n }\n\n isPanelOpen () {\n return this.panelStatus === State.statuses.panel.OPEN\n }\n\n isPanelClosed () {\n return this.panelStatus === State.statuses.panel.CLOSED\n }\n\n isPanelStateDefault () {\n return this.panelStatus === State.statuses.panel.DEFAULT\n }\n\n isPanelStateValid () {\n return (\n this.panelStatus === State.statuses.panel.OPEN ||\n this.panelStatus === State.statuses.panel.CLOSED\n )\n }\n\n setPanelOpen () {\n this.setItem('panelStatus', State.statuses.panel.OPEN)\n return this\n }\n\n setPanelClosed () {\n this.setItem('panelStatus', State.statuses.panel.CLOSED)\n return this\n }\n\n changeTab (tabName) {\n this.setItem('tab', tabName)\n return this\n }\n\n activateUI () {\n this.setItem('uiActive', true)\n return this\n }\n\n // TODO: A temporary solution for compatibility with TabScript.\n isActive () {\n return this.status === State.statuses.embedLib.ACTIVE\n }\n\n isDeactivated () {\n return this.status === State.statuses.embedLib.DEACTIVATED\n }\n\n isDisabled () {\n return this.status === State.statuses.embedLib.DISABLED\n }\n\n isTabStateDefault () {\n return this.tab === State.statuses.tab.DEFAULT\n }\n\n uiIsActive () {\n return this.uiActive\n }\n\n activate () {\n this.status = State.statuses.embedLib.ACTIVE\n return this\n }\n\n deactivate () {\n this.status = State.statuses.embedLib.DEACTIVATED\n return this\n }\n\n disable () {\n this.status = State.statuses.embedLib.DISABLED\n return this\n }\n}\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack://AlpheiosEmbed/webpack/bootstrap","webpack://AlpheiosEmbed/./embedded.js","webpack://AlpheiosEmbed/./lib/app-authenticator.js","webpack://AlpheiosEmbed/./lib/session-authenticator.js","webpack://AlpheiosEmbed/./state.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAC2B;AAC0F;AAC/D;AACQ;AAC9D;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,gDAAgD;AAC3D;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA,qCAAqC;AACrC;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD,wBAAwB;AACxB,0BAA0B;AAC1B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,KAAK;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,8CAAK;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,YAAY,qDAAc,CAAC,GAAG,mDAAY,CAAC,SAAS,yDAAkB,EAAE;AACpF;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,uDAAuD,WAAW,8DAAgB,WAAW;AAC7F,OAAO;AACP,uDAAuD,WAAW,kEAAoB,WAAW;AACjG;AACA,KAAK;AACL,qDAAqD,aAAa;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D,qCAAqC;AACjG,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,0EAA0E,8BAA8B;;AAExG;AACA;;AAEA,KAAK;AACL,6DAA6D,MAAM;AACnE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,WAAW;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAiE;AACjE;AACA;AACA;AACA;AACA,gBAAgB,qDAAqD;;AAErE;AACA;AACA,gBAAgB;AAChB,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iBAAiB;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oBAAoB;AACjD;AACA;;;;;;;;;;;;;AC3VA;AAAA;AAAA;AACA;AACA;AACA;AACe;AACf;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;;;;;;;;;;;;AC1LA;AAAA;AAAA;AACA;AACA;AACA;AACe;AACf;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,yCAAyC,MAAM;AAC/C,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,uCAAuC,MAAM;AAC7C,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACzFA;AAAA;AAAA;AACA;AACA,cAAc,YAAY;AAC1B;AACe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"alpheios-embedded.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./embedded.js\");\n","/* eslint-env jest */\n/* global Event */\nimport State from './state'\nimport { version as packageVersion, build as packageBuild, description as packageDescription } from '../package.json'\nimport AppAuthenticator from './lib/app-authenticator'\nimport SessionAuthenticator from './lib/session-authenticator'\n// A variable that will store an instance of the imported components module\nlet components\n\n/**\n * Imports dynamic dependencies that are required for the embed-lib.\n * @param {object} options - A configuration object of the import function.\n * @param {'production' | 'development' | 'cdn' | 'custom'} options.mode - What type of libraries shall be imported.\n * 'production' - will load minified version of libraries from a `dist/lib` local directory;\n * 'development' - will load non-optimized libraries with source maps from a `dist/lib` local directory;\n * 'cdn' - will load the latest version of minified libraries from JSDelivr (this is a default value);\n * 'custom' - allows to specify your own paths for loading the libraries. The paths shall be specified\n * as values of keys of a `libs` object.\n * @param {object} options.libs - An object whose properties specify paths from where libraries to be loaded.\n * {string} options.libs.components - A path to a components library. Value for a default `production` mode\n * is `./lib/alpheios-components.min.js`.\n * @return {Promise} - A promise that is resolved when all dependencies are loaded\n * or rejected when there was an error during an import.\n */\nexport function importDependencies (options) {\n let libs = {}\n switch (options.mode) {\n case 'production':\n libs.components = './lib/alpheios-components.min.js'\n break\n case 'development':\n libs.components = './lib/alpheios-components.js'\n break\n case 'custom':\n libs = options.libs\n break\n case 'cdn':\n default:\n libs.components = 'https://cdn.jsdelivr.net/npm/alpheios-components@latest/dist/alpheios-components.min.js'\n break\n }\n return new Promise((resolve, reject) => {\n let imports = []\n let componentsImport = import(\n /* webpackIgnore: true */\n libs.components\n ).then(() => {\n components = window.AlpheiosComponents\n })\n imports.push(componentsImport)\n\n Promise.all(imports).then(() => {\n resolve (Embedded)\n }).catch((e) => {\n reject(e)\n })\n })\n}\n\n/**\n * Encapsulation of Alpheios functionality which can be embedded in a webpage\n */\nclass Embedded {\n /**\n * @constructor\n * @param {Object} arguments - object with the following properties:\n * clientId: a string identifying the embedding client or site. Required.\n * authEnv: authentication environment object.(Optional)\n * documentObject: the parent document. Default: window.document\n * enabledSelector: a CSS Selector string identifying the page elements for which Alpheios should be activated\n * Default: \".alpheios-enabled\"\n * disabledSelector: a CSS Selector string identifying the page elements for which Alpheios should be deactivated\n * Default: [data-alpheios-ignore=\"all\"]\n * enabledClass: a CSS class to apply to alpheios/staten enabled elements\n * Default: \"\"\n * disabledClass: a CSS class to apply to alpheios disabled elements\n * Default: \"\"\n * mobileTriggerEvent: DOM Event to trigger word selection on mobile devices\n * Default: longTap\n * desktopTriggerEvent: DOM Event to trigger word selection on desktops\n * Default: \"dblclick\"\n * triggerPreCallback: a callback function which is called when the trigger event handler is invoked, prior to initiating\n * Alpheios functionality. It should return true to proceed with lookup or false to abort.\n * Default: no-op, returns true\n * popupInitialPos: object containing initial css positioning properties for the popup\n * Default { top: 10vh, right: 10vw}\n * toolbarInitialPos: object containing initial css positioning properties for the toolbar\n * Default { top: 10px, right: 15px}\n * actionPanelInitialPos: object containing initial css positioning properties for the action panel (mobile)\n * Default { bottom: 120px, right: 20px}\n * layoutType: 'default' or 'readingTools' (readingTools is used for the Alpheios Reader UI)\n * Default: 'default'\n * disableTextSelection: set to true to disable default browser text selection behavior (not recommended)\n * Default: false\n * textLangCode: default language for lookups via the toolbar\n * Default: null (which will result in the user preferred page language being used)\n * overrideHelp: set to true to disable the default alpheios behavior for the help icon\n * (client code must attach their own handler to the \".alpheios-toolbar__help-control\" element)\n * Default: false\n * simpleMode: set to true to restrict the UI to the popup/morphology panel (with grammar links) and lookup but no other features\n * Default: false\n */\n constructor ({\n clientId = null,\n authEnv = null,\n documentObject = document,\n enabledSelector = '.alpheios-enabled',\n disabledSelector = '',\n enabledClass = '',\n disabledClass = '',\n mobileTriggerEvent = null,\n desktopTriggerEvent = null,\n triggerPreCallback = (evt) => { return true }, // Not used at the moment but can be set as a filter for `this.ui.getSelectedText()` calls\n popupInitialPos = {},\n toolbarInitialPos = {},\n actionPanelInitialPos = {},\n layoutType = 'default', // The other option is 'readingTools'\n // Disable text selection on mobile devices\n disableTextSelection = false,\n textLangCode = null,\n overrideHelp = false,\n simpleMode = false\n } = {}) {\n this.clientId = clientId\n\n if (this.clientId === null) {\n throw new Error('Please identify the site.')\n }\n // TODO at some point in the future we may add authentication of\n // clientId\n this.doc = documentObject\n this.authEnv = authEnv\n this.state = new State()\n this.enabledSelector = enabledSelector\n this.disabledSelector = disabledSelector\n this.enabledClass = enabledClass\n this.disabledClass = disabledClass\n this.desktopTriggerEvent = desktopTriggerEvent\n this.mobileTriggerEvent = mobileTriggerEvent\n this.triggerPreCallback = triggerPreCallback\n this.simpleMode = simpleMode\n\n // Set an initial UI Controller state for activation\n this.state.setPanelClosed() // A default state of the panel is CLOSED\n this.state.tab = 'info' // A default tab is \"info\"\n\n this.ui = components.UIController.create(this.state, {\n storageAdapter: components.LocalStorageArea,\n textQueryTriggerDesktop: this.desktopTriggerEvent,\n textQueryTriggerMobile: this.mobileTriggerEvent,\n textQuerySelector: this.enabledSelector,\n triggerPreCallback: this.triggerPreCallback,\n app: { version:`${packageVersion}.${packageBuild}`, name: packageDescription },\n clientId: this.clientId,\n // Disable text selection on mobile devices\n disableTextSelection: disableTextSelection,\n textLangCode: textLangCode,\n overrideHelp: overrideHelp\n })\n // Environment-specific initializations\n if (this.authEnv) {\n if (authEnv.CLIENT_ID) {\n // Register an authentication module only with authentication environment is loaded\n this.ui.registerModule(components.AuthModule, { auth: new AppAuthenticator(authEnv) })\n } else if (authEnv.LOGIN_URL) {\n this.ui.registerModule(components.AuthModule, { auth: new SessionAuthenticator(authEnv) })\n }\n } else {\n this.ui.registerModule(components.AuthModule, { auth: null })\n }\n // Register UI modules\n let panelParams = {}\n if (this.simpleMode) {\n panelParams.showNav = false\n }\n this.ui.registerModule(components.PanelModule, panelParams)\n\n let popupParams = {}\n if (popupInitialPos && Object.values(popupInitialPos).filter(value => Boolean(value)).length > 0) {\n popupParams.initialPos = popupInitialPos\n }\n if (this.simpleMode) {\n popupParams.showNav = false\n }\n this.ui.registerModule(components.PopupModule, popupParams)\n\n let actionPanelParams = {}\n if (actionPanelInitialPos && Object.values(actionPanelInitialPos).filter(value => Boolean(value)).length > 0) {\n actionPanelParams.initialPos = actionPanelInitialPos\n }\n if (this.simpleMode) {\n actionPanelParams.showNav = false\n } else {\n actionPanelParams.showNav = true\n }\n\n let toolbarParams = {}\n if (this.simpleMode) {\n toolbarParams.showNav = false\n }\n if (layoutType === 'default') {\n if (toolbarInitialPos && Object.values(toolbarInitialPos).filter(value => Boolean(value)).length > 0) {\n toolbarParams.initialPos = toolbarInitialPos\n }\n\n this.ui.registerModule(components.ToolbarModule, toolbarParams)\n this.ui.registerModule(components.ActionPanelModule, { showNav: actionPanelParams.showNav })\n } else if (layoutType === 'readingTools') {\n // This is a special configuration for Alpheios Reading Tools\n if (this.ui.platform.isDesktop) {\n if (toolbarInitialPos && Object.values(toolbarInitialPos).filter(value => Boolean(value)).length > 0) {\n toolbarParams.initialPos = toolbarInitialPos\n }\n\n this.ui.registerModule(components.ToolbarModule, toolbarParams)\n } else if (this.ui.platform.isMobile) {\n this.ui.registerModule(components.ActionPanelModule, {\n lookupResultsIn: 'panel',\n initialPos: actionPanelParams.initialPos,\n showNav: actionPanelParams.showNav\n })\n }\n }\n }\n\n get platform () {\n return this.ui.platform\n }\n\n notifyExtension () {\n this.doc.body.dispatchEvent(new Event('Alpheios_Embedded_Response'))\n }\n\n async activate () {\n try {\n /**\n * Notify extension that an embedded lib is present.\n * We need to do this right after an activation.\n * If webextension is loaded sooner than the embedded library\n * than the extension will have no information about\n * the embedded library presence unless explicitly notified by us.\n */\n this.notifyExtension()\n\n // await this.ui.init() // Activate will call `init()` if has not been initialized previously\n await this.ui.activate()\n\n // Set a body attribute so the content scrip will know if embedded library is active on a page\n this.doc.body.setAttribute('alpheios-embed-lib-status', 'active')\n this.doc.body.addEventListener('Alpheios_Embedded_Check', event => { this.notifyExtension(event) })\n\n // and set the state on the components\n this.ui.setEmbedLibActive(true)\n\n } catch (error) {\n console.error(`Unexpected error activating Alpheios: ${error}`)\n return\n }\n\n let selector = this.enabledSelector\n\n if (!selector) {\n throw new Error('Configuration must define selector')\n }\n let activateOn = this.doc.querySelectorAll(selector)\n if (activateOn.length === 0) {\n // it could be that we want to activate Alpheios for lookups via the\n // tools even if there isn't any text on the page to activate to on\n // so just print a warning here.\n console.warn(`Alpheios was activated for the page but not any content (no elements matching ${activateOn}).`)\n }\n if (this.enabledClass) {\n for (let elem of activateOn) {\n elem.classList.add(this.enabledClass)\n }\n }\n if (this.disabledSelector) {\n let disableOn = this.doc.querySelectorAll(this.disabledSelector)\n for (let elem of disableOn) {\n elem.setAttribute('data-alpheios-ignore', 'all')\n if (this.disabledClass) {\n elem.classList.add(this.disabledClass)\n }\n }\n }\n\n let alignment = new components.AlignmentSelector(this.doc, {})\n alignment.activate()\n let alignmentTranslation = components.UIController.initAlignedTranslation(this.doc, '.aligned-translation',\n {\n // resize from all edges and corners\n edges: { left: true, right: true, bottom: false, top: false },\n\n // minimum size\n restrictSize: {\n min: { width: 200 }\n },\n\n // keep the edges inside the parent\n restrictEdges: {\n outer: this.doc.body,\n endOnly: true\n },\n inertia: true\n },\n event => {\n let target = event.target\n // update the element's style\n target.style.width = `${event.rect.width}px`\n })\n return this\n }\n\n openToolbar () {\n this.ui.openToolbar()\n }\n\n openActionPanel () {\n if (this.ui.platform.isMobile) {\n this.ui.closePanel()\n }\n this.ui.openActionPanel()\n }\n\n closeActionPanel () {\n this.ui.closeActionPanel()\n }\n\n /**\n * Opens the action panel with toolbar buttons hidden and only the lookup visible.\n */\n openActionPanelLookup () {\n if (this.ui.platform.isMobile) {\n this.ui.closePanel()\n }\n this.ui.openActionPanel({ showNav: false })\n }\n\n /**\n * Opens the action panel with only toolbar buttons visible.\n */\n openActionPanelToolbar () {\n if (this.ui.platform.isMobile) {\n this.ui.closePanel()\n }\n this.ui.openActionPanel({ showLookup: false })\n }\n}\n","/* global Auth0Lock */\n/**\n * Encapsulates Authentication Functionality For a Client Side Application\n */\nexport default class AppAuthenticator {\n /**\n * @constructor\n * @param {Object} env - environment object with the following properties\n * CLIENT_ID - Auth0 client id\n * DOMAIN - Auth0 domain\n * AUDIENCE - Auth0 audience\n * ENDPOINTS - Alpheios user api endpoints\n * LOGOUT_URL - Auth0 logout url\n */\n constructor (env) {\n // An Auth0 Lock widget instance. Will be initialized lazily\n this.auth0Lock = null\n this._auth0profile = null // A user profile from Auth0\n this.env = env\n }\n\n /**\n * a link for login external to the alpheios components\n * @return null for client side login\n */\n loginUrl() {\n return null\n }\n\n /**\n * a link for logout external to the alpheios components\n * @return null for client side login\n */\n logoutUrl() {\n return null\n }\n\n /**\n * session request unimplemented for app auth\n */\n session () {\n return new Promise((resolve,reject) => {\n reject(new Error(\"Session request not supported\"))\n })\n }\n\n /**\n * Authenticates user with an Auth0.\n * @return {Promise}\n */\n authenticate () {\n // TODO we should check to see if we already have a valid idToken before\n // initiating authentication\n return new Promise((resolve, reject) => {\n if (!this.auth0Lock) {\n if (!this.env) {\n let error = `Unable to find Auth0 configuration. Auth0 functionality will be disabled`\n console.error(error)\n reject(error)\n }\n // test environment\n if (this.env.TEST_ID) {\n localStorage.setItem('access_token', this.env.TEST_ID)\n localStorage.setItem('id_token', this.env.TEST_ID)\n localStorage.setItem('is_test_user', true)\n resolve(\"Authenticated\")\n } else {\n // initialize auth0 lock\n this.auth0Lock = new Auth0Lock(this.env.CLIENT_ID, this.env.DOMAIN, {\n theme: {\n logo: 'https://alpheios.net/logos/alpheios_32.png',\n labeledSubmitButton: false,\n primaryColor: '#436476'\n },\n languageDictionary: {\n title: \"Login\",\n signUpTerms: \"By signing up, you agree to our terms of service and privacy policy.\"\n },\n mustAcceptTerms: true,\n auth: {\n redirect: false,\n params: {\n audience: this.env.AUDIENCE,\n scope: 'openid profile email',\n prompt: 'consent select_account',\n },\n responseType: 'token id_token'\n }\n })\n // Handle login\n this.auth0Lock.on('authenticated', (authResult) => {\n this.auth0Lock.hide()\n localStorage.setItem('access_token', authResult.accessToken)\n localStorage.setItem('id_token', authResult.idToken)\n //localStorage.setItem('profile', JSON.stringify(profile))\n resolve(\"Authenticated\")\n })\n\n // Unrecoverable error handler\n this.auth0Lock.on('unrecoverable_error', (error) => {\n console.error(`Auth0 Lock unrecoverable error: `, error)\n reject('Auth0 Lock unrecoverable')\n })\n\n // An authorization error\n this.auth0Lock.on('authorization_error', (error) => {\n console.error(`Auth0 Lock authorization error: `, error)\n reject('Auth0Lock authorization error')\n })\n this.auth0Lock.show()\n // TODO: Handle a situation when `authenticated` event is never fired (is that ever possible)\n // maybe via a Timeout?\n }\n }\n })\n }\n\n /**\n * Retrieves user profile information from Auth0.\n * @return {Promise}\n */\n getProfileData () {\n return new Promise((resolve, reject) => {\n const token = localStorage.getItem('access_token')\n if (!token) {\n console.error('You must login to call this protected endpoint!')\n reject('Login required')\n }\n if (localStorage.getItem('is_test_user')) {\n let testProfile = {\n name: 'Alpheios Test User',\n nickname: 'testuser',\n sub: 'testuser'\n }\n localStorage.setItem('profile', JSON.stringify(testProfile))\n resolve(testProfile)\n } else {\n this.auth0Lock.getUserInfo(token, (error, profile) => {\n if (error) {\n reject(error)\n } else {\n localStorage.setItem('profile', JSON.stringify(profile))\n resolve(profile)\n }\n })\n }\n })\n }\n\n /**\n * Retrieves user data from a remote provider (e.g. Alpheios servers).\n * @return {Promise}\n */\n getUserData () {\n return new Promise((resolve, reject) => {\n const token = localStorage.getItem('access_token')\n\n // block request from happening if no JWT token present\n if (!token) {\n console.error('You must login to call this protected endpoint!')\n reject('Not Authenticated')\n }\n resolve(token)\n })\n }\n\n /**\n * Retrieves the list of configured endpoints for the environment\n * @return {Object}\n */\n getEndPoints () {\n return this.env.ENDPOINTS\n }\n\n /**\n * Respond to a logout request\n */\n logout() {\n localStorage.removeItem('id_token')\n localStorage.removeItem('access_token')\n localStorage.removeItem('profile')\n this.auth0Lock.logout({\n returnTo: this.env.LOGOUT_URL\n })\n }\n\n}\n","/* global Auth0Lock */\n/**\n * Encapsulates Authentication Functionality For a Client Side Application\n */\nexport default class SessionAuthenticator {\n /**\n * @constructor\n * @param {Object} env - environment object with the following properties\n * LOGIN_URL - login url\n * LOGOUT_URL - logout url\n * SESSION_URL - session url\n * TOKEN_URL - token url\n * ENDPOINTS - Alpheios user api endpoints\n */\n constructor (env) {\n this.sessionUrl = env.SESSION_URL\n this.tokenUrl = env.TOKEN_URL\n this.endpoints = env.ENDPOINTS\n this._loginUrl = env.LOGIN_URL\n this._logoutUrl = env.LOGOUT_URL\n }\n\n /**\n * Login link for server\n * @return {String} login link from config\n */\n loginUrl() {\n return this._loginUrl\n }\n\n /**\n * Logout link for server\n * @return {String} logout link from config\n */\n logoutUrl() {\n return this._logoutUrl\n }\n\n session () {\n return new Promise((resolve,reject) => {\n window.fetch(this.sessionUrl).then((resp) => {\n if (! resp.ok) {\n reject(resp.code)\n } else {\n resolve(resp.json())\n }\n }).catch((error) => {\n reject(`Session request failed ${error}`)\n })\n })\n }\n\n authenticate () {\n // TODO we should check to see if we already have a valid idToken before\n // initiating authentication\n return new Promise((resolve, reject) => {\n reject(\"Server Side Authenticator\")\n })\n }\n\n getUserData () {\n return new Promise((resolve,reject) => {\n window.fetch(this.tokenUrl).then((resp) => {\n if (! resp.ok) {\n reject(resp.code)\n } else {\n resolve(resp.json())\n }\n }).catch((error) => {\n reject(`token request failed ${error}`)\n })\n })\n }\n\n /**\n * Retrieves the list of configured endpoints for the environment\n * @return {Object}\n */\n getEndPoints () {\n return this.endpoints\n }\n\n /**\n * Respond to a logout request\n */\n logout() {\n return\n }\n\n}\n","/**\n * Contains Alpheios state\n * @property {panelStatus} panelStatus\n */\nexport default class State {\n constructor (tabID) {\n this.panelStatus = undefined\n this.tab = undefined\n this.watchers = new Map()\n }\n\n static create (source) {\n let copy = new State()\n for (let key of Object.keys(source)) {\n copy[key] = source[key]\n }\n return copy\n }\n\n static get defaults () {\n return {\n panelStatus: State.statuses.panel.OPEN\n }\n }\n\n static get statuses () {\n return {\n embedLib: {\n PENDING: Symbol.for('Alpheios_Status_Pending'), // Has not been fully initialized yet\n ACTIVE: Symbol.for('Alpheios_Status_Active'), // Is loaded and active\n DEACTIVATED: Symbol.for('Alpheios_Status_Deactivated'), // Has been loaded, but is deactivated\n DISABLED: Symbol.for('Alpheios_Status_Disabled') // Has been loaded, but it is disabled\n },\n panel: {\n OPEN: Symbol.for('Alpheios_Status_PanelOpen'), // Panel is open\n CLOSED: Symbol.for('Alpheios_Status_PanelClosed'), // Panel is closed\n DEFAULT: Symbol.for('Alpheios_Status_PanelDefault') // Panel should set its state according to default values\n },\n tab: {\n DEFAULT: 'default' // A tab should be set according to default values\n }\n }\n }\n\n /**\n * Sets a watcher function that is called every time a property is changed using a setItem() method.\n * @param {String} property - A name of a property that should be monitored\n * @param {Function} watchFunc - A function that will be called every time a property changes\n * @return {State} Reference to self for chaining\n */\n setWatcher (property, watchFunc) {\n this.watchers.set(property, watchFunc)\n return this\n }\n\n /**\n * SetItem provides a monitored way to change state. If value is assigned to a data property directly\n * there is no way to know if a property was changed. However, if a property was changed using setItem() method,\n * and if there is a watcher function registered for a changed property name,\n * this function will be called on every property change, passing a changed property name as an argument.\n * @param key\n * @param value\n * @return {State}\n */\n setItem (key, value) {\n this[key] = value\n if (this.watchers && this.watchers.has(key)) {\n this.watchers.get(key)(key, this)\n }\n return this\n }\n\n isPanelOpen () {\n return this.panelStatus === State.statuses.panel.OPEN\n }\n\n isPanelClosed () {\n return this.panelStatus === State.statuses.panel.CLOSED\n }\n\n isPanelStateDefault () {\n return this.panelStatus === State.statuses.panel.DEFAULT\n }\n\n isPanelStateValid () {\n return (\n this.panelStatus === State.statuses.panel.OPEN ||\n this.panelStatus === State.statuses.panel.CLOSED\n )\n }\n\n setPanelOpen () {\n this.setItem('panelStatus', State.statuses.panel.OPEN)\n return this\n }\n\n setPanelClosed () {\n this.setItem('panelStatus', State.statuses.panel.CLOSED)\n return this\n }\n\n changeTab (tabName) {\n this.setItem('tab', tabName)\n return this\n }\n\n activateUI () {\n this.setItem('uiActive', true)\n return this\n }\n\n // TODO: A temporary solution for compatibility with TabScript.\n isActive () {\n return this.status === State.statuses.embedLib.ACTIVE\n }\n\n isDeactivated () {\n return this.status === State.statuses.embedLib.DEACTIVATED\n }\n\n isDisabled () {\n return this.status === State.statuses.embedLib.DISABLED\n }\n\n isTabStateDefault () {\n return this.tab === State.statuses.tab.DEFAULT\n }\n\n uiIsActive () {\n return this.uiActive\n }\n\n activate () {\n this.status = State.statuses.embedLib.ACTIVE\n return this\n }\n\n deactivate () {\n this.status = State.statuses.embedLib.DEACTIVATED\n return this\n }\n\n disable () {\n this.status = State.statuses.embedLib.DISABLED\n return this\n }\n}\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/alpheios-embedded.min.js b/dist/alpheios-embedded.min.js
index 373f0f4..c309bb6 100644
--- a/dist/alpheios-embedded.min.js
+++ b/dist/alpheios-embedded.min.js
@@ -1 +1 @@
-window.AlpheiosEmbed=function(e){var t={};function __webpack_require__(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,s){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(__webpack_require__.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(s,i,function(t){return e[t]}.bind(null,i));return s},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(e){e.exports=JSON.parse('{"c":"3.0.0","a":"37","b":"Alpheios Embedded Library"}')},function(e,t,s){"use strict";s.r(t);class State{constructor(e){this.panelStatus=void 0,this.tab=void 0,this.watchers=new Map}static create(e){let t=new State;for(let s of Object.keys(e))t[s]=e[s];return t}static get defaults(){return{panelStatus:State.statuses.panel.OPEN}}static get statuses(){return{embedLib:{PENDING:Symbol.for("Alpheios_Status_Pending"),ACTIVE:Symbol.for("Alpheios_Status_Active"),DEACTIVATED:Symbol.for("Alpheios_Status_Deactivated"),DISABLED:Symbol.for("Alpheios_Status_Disabled")},panel:{OPEN:Symbol.for("Alpheios_Status_PanelOpen"),CLOSED:Symbol.for("Alpheios_Status_PanelClosed"),DEFAULT:Symbol.for("Alpheios_Status_PanelDefault")},tab:{DEFAULT:"default"}}}setWatcher(e,t){return this.watchers.set(e,t),this}setItem(e,t){return this[e]=t,this.watchers&&this.watchers.has(e)&&this.watchers.get(e)(e,this),this}isPanelOpen(){return this.panelStatus===State.statuses.panel.OPEN}isPanelClosed(){return this.panelStatus===State.statuses.panel.CLOSED}isPanelStateDefault(){return this.panelStatus===State.statuses.panel.DEFAULT}isPanelStateValid(){return this.panelStatus===State.statuses.panel.OPEN||this.panelStatus===State.statuses.panel.CLOSED}setPanelOpen(){return this.setItem("panelStatus",State.statuses.panel.OPEN),this}setPanelClosed(){return this.setItem("panelStatus",State.statuses.panel.CLOSED),this}changeTab(e){return this.setItem("tab",e),this}activateUI(){return this.setItem("uiActive",!0),this}isActive(){return this.status===State.statuses.embedLib.ACTIVE}isDeactivated(){return this.status===State.statuses.embedLib.DEACTIVATED}isDisabled(){return this.status===State.statuses.embedLib.DISABLED}isTabStateDefault(){return this.tab===State.statuses.tab.DEFAULT}uiIsActive(){return this.uiActive}activate(){return this.status=State.statuses.embedLib.ACTIVE,this}deactivate(){return this.status=State.statuses.embedLib.DEACTIVATED,this}disable(){return this.status=State.statuses.embedLib.DISABLED,this}}var i=s(0);class AppAuthenticator{constructor(e){this.auth0Lock=null,this._auth0profile=null,this.env=e}loginUrl(){return null}logoutUrl(){return null}session(){return new Promise((e,t)=>{t(new Error("Session request not supported"))})}authenticate(){return new Promise((e,t)=>{if(!this.auth0Lock){if(!this.env){let e="Unable to find Auth0 configuration. Auth0 functionality will be disabled";console.error(e),t(e)}this.env.TEST_ID?(localStorage.setItem("access_token",this.env.TEST_ID),localStorage.setItem("id_token",this.env.TEST_ID),localStorage.setItem("is_test_user",!0),e("Authenticated")):(this.auth0Lock=new Auth0Lock(this.env.CLIENT_ID,this.env.DOMAIN,{theme:{logo:"https://alpheios.net/logos/alpheios_32.png",labeledSubmitButton:!1,primaryColor:"#436476"},languageDictionary:{title:"Login",signUpTerms:'By signing up, you agree to our terms of service and privacy policy.'},mustAcceptTerms:!0,auth:{redirect:!1,params:{audience:this.env.AUDIENCE,scope:"openid profile email",prompt:"consent select_account"},responseType:"token id_token"}}),this.auth0Lock.on("authenticated",t=>{this.auth0Lock.hide(),localStorage.setItem("access_token",t.accessToken),localStorage.setItem("id_token",t.idToken),e("Authenticated")}),this.auth0Lock.on("unrecoverable_error",e=>{console.error("Auth0 Lock unrecoverable error: ",e),t("Auth0 Lock unrecoverable")}),this.auth0Lock.on("authorization_error",e=>{console.error("Auth0 Lock authorization error: ",e),t("Auth0Lock authorization error")}),this.auth0Lock.show())}})}getProfileData(){return new Promise((e,t)=>{const s=localStorage.getItem("access_token");if(s||(console.error("You must login to call this protected endpoint!"),t("Login required")),localStorage.getItem("is_test_user")){let t={name:"Alpheios Test User",nickname:"testuser",sub:"testuser"};localStorage.setItem("profile",JSON.stringify(t)),e(t)}else this.auth0Lock.getUserInfo(s,(s,i)=>{s?t(s):(localStorage.setItem("profile",JSON.stringify(i)),e(i))})})}getUserData(){return new Promise((e,t)=>{const s=localStorage.getItem("access_token");s||(console.error("You must login to call this protected endpoint!"),t("Not Authenticated")),e(s)})}getEndPoints(){return this.env.ENDPOINTS}logout(){localStorage.removeItem("id_token"),localStorage.removeItem("access_token"),localStorage.removeItem("profile"),this.auth0Lock.logout({returnTo:this.env.LOGOUT_URL})}}class SessionAuthenticator{constructor(e){this.sessionUrl=e.SESSION_URL,this.tokenUrl=e.TOKEN_URL,this.endpoints=e.ENDPOINTS,this._loginUrl=e.LOGIN_URL,this._logoutUrl=e.LOGOUT_URL}loginUrl(){return this._loginUrl}logoutUrl(){return this._logoutUrl}session(){return new Promise((e,t)=>{window.fetch(this.sessionUrl).then(s=>{s.ok?e(s.json()):t(s.code)}).catch(e=>{t(`Session request failed ${e}`)})})}authenticate(){return new Promise((e,t)=>{t("Server Side Authenticator")})}getUserData(){return new Promise((e,t)=>{window.fetch(this.tokenUrl).then(s=>{s.ok?e(s.json()):t(s.code)}).catch(e=>{t(`token request failed ${e}`)})})}getEndPoints(){return this.endpoints}logout(){}}let o;function importDependencies(e){let t={};switch(e.mode){case"production":t.components="./lib/alpheios-components.min.js";break;case"development":t.components="./lib/alpheios-components.js";break;case"custom":t=e.libs;break;case"cdn":default:t.components="https://cdn.jsdelivr.net/npm/alpheios-components@latest/dist/alpheios-components.min.js"}return new Promise((e,s)=>{let i=[],r=import(t.components).then(()=>{o=window.AlpheiosComponents});i.push(r),Promise.all(i).then(()=>{e(embedded_Embedded)}).catch(e=>{s(e)})})}s.d(t,"importDependencies",function(){return importDependencies});class embedded_Embedded{constructor({clientId:e=null,authEnv:t=null,documentObject:s=document,enabledSelector:r=".alpheios-enabled",disabledSelector:a="",enabledClass:n="",disabledClass:l="",mobileTriggerEvent:u=null,desktopTriggerEvent:c=null,triggerPreCallback:h=(e=>!0),popupInitialPos:d={},toolbarInitialPos:p={},actionPanelInitialPos:_={},layoutType:b="default",disableTextSelection:g=!1,textLangCode:m=null,overrideHelp:S=!1,simpleMode:f=!1}={}){if(this.clientId=e,null===this.clientId)throw new Error("Please identify the site.");this.doc=s,this.authEnv=t,this.state=new State,this.enabledSelector=r,this.disabledSelector=a,this.enabledClass=n,this.disabledClass=l,this.desktopTriggerEvent=c,this.mobileTriggerEvent=u,this.triggerPreCallback=h,this.simpleMode=f,this.state.setPanelClosed(),this.state.tab="info",this.ui=o.UIController.create(this.state,{storageAdapter:o.LocalStorageArea,textQueryTriggerDesktop:this.desktopTriggerEvent,textQueryTriggerMobile:this.mobileTriggerEvent,textQuerySelector:this.enabledSelector,triggerPreCallback:this.triggerPreCallback,app:{version:`${i.c}.${i.a}`,name:i.b},clientId:this.clientId,disableTextSelection:g,textLangCode:m,overrideHelp:S}),this.authEnv?t.CLIENT_ID?this.ui.registerModule(o.AuthModule,{auth:new AppAuthenticator(t)}):t.LOGIN_URL&&this.ui.registerModule(o.AuthModule,{auth:new SessionAuthenticator(t)}):this.ui.registerModule(o.AuthModule,{auth:null});let v={};this.simpleMode&&(v.showNav=!1),this.ui.registerModule(o.PanelModule,v);let A={};d&&Object.values(d).filter(e=>Boolean(e)).length>0&&(A.initialPos=d),this.simpleMode&&(A.showNav=!1),this.ui.registerModule(o.PopupModule,A);let w={};_&&Object.values(_).filter(e=>Boolean(e)).length>0&&(w.initialPos=_),this.simpleMode&&(w.showNav=!1);let k={};this.simpleMode&&(k.showNav=!1),"default"===b?(p&&Object.values(p).filter(e=>Boolean(e)).length>0&&(k.initialPos=p),this.ui.registerModule(o.ToolbarModule,k),this.ui.registerModule(o.ActionPanelModule,{showNav:w.showNav})):"readingTools"===b&&(this.ui.platform.isDesktop?(p&&Object.values(p).filter(e=>Boolean(e)).length>0&&(k.initialPos=p),this.ui.registerModule(o.ToolbarModule,k)):this.ui.platform.isMobile&&this.ui.registerModule(o.ActionPanelModule,{lookupResultsIn:"panel",initialPos:w.initialPos,showNav:w.showNav}))}get platform(){return this.ui.platform}notifyExtension(){this.doc.body.dispatchEvent(new Event("Alpheios_Embedded_Response"))}async activate(){try{this.notifyExtension(),await this.ui.activate(),this.doc.body.setAttribute("alpheios-embed-lib-status","active"),this.doc.body.addEventListener("Alpheios_Embedded_Check",e=>{this.notifyExtension(e)}),this.ui.setEmbedLibActive(!0)}catch(e){return void console.error(`Unexpected error activating Alpheios: ${e}`)}let e=this.enabledSelector;if(!e)throw new Error("Configuration must define selector");let t=this.doc.querySelectorAll(e);if(0===t.length&&console.warn(`Alpheios was activated for the page but not any content (no elements matching ${t}).`),this.enabledClass)for(let e of t)e.classList.add(this.enabledClass);if(this.disabledSelector){let e=this.doc.querySelectorAll(this.disabledSelector);for(let t of e)t.setAttribute("data-alpheios-ignore","all"),this.disabledClass&&t.classList.add(this.disabledClass)}new o.AlignmentSelector(this.doc,{}).activate();o.UIController.initAlignedTranslation(this.doc,".aligned-translation",{edges:{left:!0,right:!0,bottom:!1,top:!1},restrictSize:{min:{width:200}},restrictEdges:{outer:this.doc.body,endOnly:!0},inertia:!0},e=>{e.target.style.width=`${e.rect.width}px`});return this}openToolbar(){this.ui.openToolbar()}openActionPanel(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel()}closeActionPanel(){this.ui.closeActionPanel()}openActionPanelLookup(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showNav:!1})}openActionPanelToolbar(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showLookup:!1})}}}]);
\ No newline at end of file
+window.AlpheiosEmbed=function(e){var t={};function __webpack_require__(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,s){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(__webpack_require__.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(s,i,function(t){return e[t]}.bind(null,i));return s},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(e){e.exports=JSON.parse('{"c":"3.0.0","a":"38","b":"Alpheios Embedded Library"}')},function(e,t,s){"use strict";s.r(t);class State{constructor(e){this.panelStatus=void 0,this.tab=void 0,this.watchers=new Map}static create(e){let t=new State;for(let s of Object.keys(e))t[s]=e[s];return t}static get defaults(){return{panelStatus:State.statuses.panel.OPEN}}static get statuses(){return{embedLib:{PENDING:Symbol.for("Alpheios_Status_Pending"),ACTIVE:Symbol.for("Alpheios_Status_Active"),DEACTIVATED:Symbol.for("Alpheios_Status_Deactivated"),DISABLED:Symbol.for("Alpheios_Status_Disabled")},panel:{OPEN:Symbol.for("Alpheios_Status_PanelOpen"),CLOSED:Symbol.for("Alpheios_Status_PanelClosed"),DEFAULT:Symbol.for("Alpheios_Status_PanelDefault")},tab:{DEFAULT:"default"}}}setWatcher(e,t){return this.watchers.set(e,t),this}setItem(e,t){return this[e]=t,this.watchers&&this.watchers.has(e)&&this.watchers.get(e)(e,this),this}isPanelOpen(){return this.panelStatus===State.statuses.panel.OPEN}isPanelClosed(){return this.panelStatus===State.statuses.panel.CLOSED}isPanelStateDefault(){return this.panelStatus===State.statuses.panel.DEFAULT}isPanelStateValid(){return this.panelStatus===State.statuses.panel.OPEN||this.panelStatus===State.statuses.panel.CLOSED}setPanelOpen(){return this.setItem("panelStatus",State.statuses.panel.OPEN),this}setPanelClosed(){return this.setItem("panelStatus",State.statuses.panel.CLOSED),this}changeTab(e){return this.setItem("tab",e),this}activateUI(){return this.setItem("uiActive",!0),this}isActive(){return this.status===State.statuses.embedLib.ACTIVE}isDeactivated(){return this.status===State.statuses.embedLib.DEACTIVATED}isDisabled(){return this.status===State.statuses.embedLib.DISABLED}isTabStateDefault(){return this.tab===State.statuses.tab.DEFAULT}uiIsActive(){return this.uiActive}activate(){return this.status=State.statuses.embedLib.ACTIVE,this}deactivate(){return this.status=State.statuses.embedLib.DEACTIVATED,this}disable(){return this.status=State.statuses.embedLib.DISABLED,this}}var i=s(0);class AppAuthenticator{constructor(e){this.auth0Lock=null,this._auth0profile=null,this.env=e}loginUrl(){return null}logoutUrl(){return null}session(){return new Promise((e,t)=>{t(new Error("Session request not supported"))})}authenticate(){return new Promise((e,t)=>{if(!this.auth0Lock){if(!this.env){let e="Unable to find Auth0 configuration. Auth0 functionality will be disabled";console.error(e),t(e)}this.env.TEST_ID?(localStorage.setItem("access_token",this.env.TEST_ID),localStorage.setItem("id_token",this.env.TEST_ID),localStorage.setItem("is_test_user",!0),e("Authenticated")):(this.auth0Lock=new Auth0Lock(this.env.CLIENT_ID,this.env.DOMAIN,{theme:{logo:"https://alpheios.net/logos/alpheios_32.png",labeledSubmitButton:!1,primaryColor:"#436476"},languageDictionary:{title:"Login",signUpTerms:'By signing up, you agree to our terms of service and privacy policy.'},mustAcceptTerms:!0,auth:{redirect:!1,params:{audience:this.env.AUDIENCE,scope:"openid profile email",prompt:"consent select_account"},responseType:"token id_token"}}),this.auth0Lock.on("authenticated",t=>{this.auth0Lock.hide(),localStorage.setItem("access_token",t.accessToken),localStorage.setItem("id_token",t.idToken),e("Authenticated")}),this.auth0Lock.on("unrecoverable_error",e=>{console.error("Auth0 Lock unrecoverable error: ",e),t("Auth0 Lock unrecoverable")}),this.auth0Lock.on("authorization_error",e=>{console.error("Auth0 Lock authorization error: ",e),t("Auth0Lock authorization error")}),this.auth0Lock.show())}})}getProfileData(){return new Promise((e,t)=>{const s=localStorage.getItem("access_token");if(s||(console.error("You must login to call this protected endpoint!"),t("Login required")),localStorage.getItem("is_test_user")){let t={name:"Alpheios Test User",nickname:"testuser",sub:"testuser"};localStorage.setItem("profile",JSON.stringify(t)),e(t)}else this.auth0Lock.getUserInfo(s,(s,i)=>{s?t(s):(localStorage.setItem("profile",JSON.stringify(i)),e(i))})})}getUserData(){return new Promise((e,t)=>{const s=localStorage.getItem("access_token");s||(console.error("You must login to call this protected endpoint!"),t("Not Authenticated")),e(s)})}getEndPoints(){return this.env.ENDPOINTS}logout(){localStorage.removeItem("id_token"),localStorage.removeItem("access_token"),localStorage.removeItem("profile"),this.auth0Lock.logout({returnTo:this.env.LOGOUT_URL})}}class SessionAuthenticator{constructor(e){this.sessionUrl=e.SESSION_URL,this.tokenUrl=e.TOKEN_URL,this.endpoints=e.ENDPOINTS,this._loginUrl=e.LOGIN_URL,this._logoutUrl=e.LOGOUT_URL}loginUrl(){return this._loginUrl}logoutUrl(){return this._logoutUrl}session(){return new Promise((e,t)=>{window.fetch(this.sessionUrl).then(s=>{s.ok?e(s.json()):t(s.code)}).catch(e=>{t(`Session request failed ${e}`)})})}authenticate(){return new Promise((e,t)=>{t("Server Side Authenticator")})}getUserData(){return new Promise((e,t)=>{window.fetch(this.tokenUrl).then(s=>{s.ok?e(s.json()):t(s.code)}).catch(e=>{t(`token request failed ${e}`)})})}getEndPoints(){return this.endpoints}logout(){}}let o;function importDependencies(e){let t={};switch(e.mode){case"production":t.components="./lib/alpheios-components.min.js";break;case"development":t.components="./lib/alpheios-components.js";break;case"custom":t=e.libs;break;case"cdn":default:t.components="https://cdn.jsdelivr.net/npm/alpheios-components@latest/dist/alpheios-components.min.js"}return new Promise((e,s)=>{let i=[],r=import(t.components).then(()=>{o=window.AlpheiosComponents});i.push(r),Promise.all(i).then(()=>{e(embedded_Embedded)}).catch(e=>{s(e)})})}s.d(t,"importDependencies",function(){return importDependencies});class embedded_Embedded{constructor({clientId:e=null,authEnv:t=null,documentObject:s=document,enabledSelector:r=".alpheios-enabled",disabledSelector:a="",enabledClass:n="",disabledClass:l="",mobileTriggerEvent:u=null,desktopTriggerEvent:c=null,triggerPreCallback:h=(e=>!0),popupInitialPos:d={},toolbarInitialPos:p={},actionPanelInitialPos:_={},layoutType:b="default",disableTextSelection:g=!1,textLangCode:m=null,overrideHelp:S=!1,simpleMode:f=!1}={}){if(this.clientId=e,null===this.clientId)throw new Error("Please identify the site.");this.doc=s,this.authEnv=t,this.state=new State,this.enabledSelector=r,this.disabledSelector=a,this.enabledClass=n,this.disabledClass=l,this.desktopTriggerEvent=c,this.mobileTriggerEvent=u,this.triggerPreCallback=h,this.simpleMode=f,this.state.setPanelClosed(),this.state.tab="info",this.ui=o.UIController.create(this.state,{storageAdapter:o.LocalStorageArea,textQueryTriggerDesktop:this.desktopTriggerEvent,textQueryTriggerMobile:this.mobileTriggerEvent,textQuerySelector:this.enabledSelector,triggerPreCallback:this.triggerPreCallback,app:{version:`${i.c}.${i.a}`,name:i.b},clientId:this.clientId,disableTextSelection:g,textLangCode:m,overrideHelp:S}),this.authEnv?t.CLIENT_ID?this.ui.registerModule(o.AuthModule,{auth:new AppAuthenticator(t)}):t.LOGIN_URL&&this.ui.registerModule(o.AuthModule,{auth:new SessionAuthenticator(t)}):this.ui.registerModule(o.AuthModule,{auth:null});let v={};this.simpleMode&&(v.showNav=!1),this.ui.registerModule(o.PanelModule,v);let A={};d&&Object.values(d).filter(e=>Boolean(e)).length>0&&(A.initialPos=d),this.simpleMode&&(A.showNav=!1),this.ui.registerModule(o.PopupModule,A);let w={};_&&Object.values(_).filter(e=>Boolean(e)).length>0&&(w.initialPos=_),this.simpleMode?w.showNav=!1:w.showNav=!0;let k={};this.simpleMode&&(k.showNav=!1),"default"===b?(p&&Object.values(p).filter(e=>Boolean(e)).length>0&&(k.initialPos=p),this.ui.registerModule(o.ToolbarModule,k),this.ui.registerModule(o.ActionPanelModule,{showNav:w.showNav})):"readingTools"===b&&(this.ui.platform.isDesktop?(p&&Object.values(p).filter(e=>Boolean(e)).length>0&&(k.initialPos=p),this.ui.registerModule(o.ToolbarModule,k)):this.ui.platform.isMobile&&this.ui.registerModule(o.ActionPanelModule,{lookupResultsIn:"panel",initialPos:w.initialPos,showNav:w.showNav}))}get platform(){return this.ui.platform}notifyExtension(){this.doc.body.dispatchEvent(new Event("Alpheios_Embedded_Response"))}async activate(){try{this.notifyExtension(),await this.ui.activate(),this.doc.body.setAttribute("alpheios-embed-lib-status","active"),this.doc.body.addEventListener("Alpheios_Embedded_Check",e=>{this.notifyExtension(e)}),this.ui.setEmbedLibActive(!0)}catch(e){return void console.error(`Unexpected error activating Alpheios: ${e}`)}let e=this.enabledSelector;if(!e)throw new Error("Configuration must define selector");let t=this.doc.querySelectorAll(e);if(0===t.length&&console.warn(`Alpheios was activated for the page but not any content (no elements matching ${t}).`),this.enabledClass)for(let e of t)e.classList.add(this.enabledClass);if(this.disabledSelector){let e=this.doc.querySelectorAll(this.disabledSelector);for(let t of e)t.setAttribute("data-alpheios-ignore","all"),this.disabledClass&&t.classList.add(this.disabledClass)}new o.AlignmentSelector(this.doc,{}).activate();o.UIController.initAlignedTranslation(this.doc,".aligned-translation",{edges:{left:!0,right:!0,bottom:!1,top:!1},restrictSize:{min:{width:200}},restrictEdges:{outer:this.doc.body,endOnly:!0},inertia:!0},e=>{e.target.style.width=`${e.rect.width}px`});return this}openToolbar(){this.ui.openToolbar()}openActionPanel(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel()}closeActionPanel(){this.ui.closeActionPanel()}openActionPanelLookup(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showNav:!1})}openActionPanelToolbar(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showLookup:!1})}}}]);
\ No newline at end of file
diff --git a/package.json b/package.json
index f0748c4..471ead5 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "alpheios-embedded",
"version": "3.0.0",
- "build": "37",
+ "build": "38",
"description": "Alpheios Embedded Library",
"main": "dist/alpheios-embedded.js",
"directories": {
diff --git a/src/embedded.js b/src/embedded.js
index 25afa63..6243c39 100644
--- a/src/embedded.js
+++ b/src/embedded.js
@@ -190,6 +190,8 @@ class Embedded {
}
if (this.simpleMode) {
actionPanelParams.showNav = false
+ } else {
+ actionPanelParams.showNav = true
}
let toolbarParams = {}