!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=143)}({10:function(t,e,n){var r=n(15),o=n(52);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},11:function(t,e,n){var r=n(35);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},12:function(t,e){function n(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise(function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)})}}},143:function(t,e,n){"use strict";n.r(e),n.d(e,"default",function(){return C});var r=n(3),o=n.n(r),i=n(8),a=n.n(i),c=n(2),s=n.n(c),u=n(12),l=n.n(u),f=n(17),d=n.n(f),h=n(4),p=n.n(h),y=n(5),v=n.n(y),m=n(10),b=n.n(m),g=n(9),E=n.n(g),w=n(11),L=n.n(w),x=(n(149),n(18)),C=function(t){function e(){var t;return p()(this,e),(t=b()(this,E()(e).apply(this,arguments))).editorCitationObserver=new MutationObserver(function(t){var e=!0,n=!1,r=void 0;try{for(var o,i=t[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=o.value,c=!0,s=!1,u=void 0;try{for(var l,f=a.removedNodes[Symbol.iterator]();!(c=(l=f.next()).done);c=!0){var d=l.value;d instanceof Element&&d.classList.contains(x.a.citationClass)&&dispatchEvent(new CustomEvent(x.a.events.CITATION_DELETED))}}catch(t){s=!0,u=t}finally{try{c||null==f.return||f.return()}finally{if(s)throw u}}}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}),t.selectionCache={fresh:!1,selection:"",bookmark:{rng:document.createRange()}},t}return L()(e,t),v()(e,[{key:"alert",value:function(t){this.editor.windowManager.alert(t)}},{key:"composeCitations",value:function(t,e,n){this.editor.focus();for(var r=this.editor.getDoc(),o=r.querySelectorAll("\n #".concat(x.a.footnoteId,",\n #").concat(x.a.bibliographyId,"\n ")),i=Array.from(o),a=0;a2&&void 0!==arguments[2]&&arguments[2]?this.setStaticBibliography(e):this.setStandardBibliography(t,e)}},{key:"setLoadingState",value:function(t){this.editor.setProgressState(t||!1)}},{key:"bindEvents",value:function(){var t=this;this.editor.on("focusin",function(){t.selectionCache=a()({},t.selectionCache,{fresh:!1})}),this.editor.on("focusout",function(){t.selectionCache={fresh:!0,selection:t.selection,bookmark:t.editor.selection.getBookmark(1)}}),this.editor.on("hide",function(){dispatchEvent(new CustomEvent(x.a.events.UNAVAILABLE))}),this.editor.on("show",function(){dispatchEvent(new CustomEvent(x.a.events.AVAILABLE))}),this.editor.on("Undo",function(){dispatchEvent(new CustomEvent(x.a.events.UNDO))}),this.editor.addShortcut("meta+alt+r","Add Reference",function(){return dispatchEvent(new CustomEvent(x.a.events.ADD_REFERENCE))}),this.editor.addShortcut("meta+alt+p","Pin Reference List",function(){return dispatchEvent(new CustomEvent(x.a.events.TOGGLE_PINNED))}),this.editorCitationObserver.observe(this.editor.getBody(),{childList:!0,subtree:!0})}},{key:"composeFootnotes",value:function(){var t=this.editor.getDoc(),e=o()(t.querySelectorAll(".".concat(x.a.citationClass)).entries()).reduce(function(t,e){var n=d()(e,2),r=n[0],i=n[1];i.innerHTML="[".concat(r+1,"]");var a=i.getAttribute("data-footnote");return a?[].concat(o()(t),[a]):t},[]);if(0!==e.length){var n=this.editor.selection.getBookmark(),r=x.a.createFootnoteSection(e,["noselect","mceNonEditable"]),i=this.editor.getBody();this.editor.selection.setCursorLocation(i,i.childNodes.length),this.editor.insertContent(r.outerHTML),this.editor.selection.moveToBookmark(n)}}},{key:"setStandardBibliography",value:function(t,e){if("boolean"!=typeof e&&0!==e.length){var n=x.a.createBibliographyElement(t,e,["noselect","mceNonEditable"]),r=this.editor.selection.getBookmark(),o=this.editor.getBody();this.editor.selection.setCursorLocation(o,o.childNodes.length),this.editor.insertContent(n.outerHTML),this.editor.selection.moveToBookmark(r)}}},{key:"setStaticBibliography",value:function(t){var e="boolean"==typeof t?[]:t,n=x.a.createBibliographyElement({},e,["".concat(x.a.staticBibClass),"noselect","mceNonEditable"]);this.selectionCache.fresh&&this.editor.selection.moveToBookmark(this.selectionCache.bookmark),this.editor.insertContent(n.outerHTML)}},{key:"citationIds",get:function(){var t=this.editor.getDoc().querySelectorAll("*:not(.mce-offscreen-selection) > .".concat(x.a.citationClass));return o()(t).map(function(t){return t.id})}},{key:"citationsByIndex",get:function(){var t=this.editor.getDoc(),e=o()(t.querySelectorAll("\n *:not(.mce-offscreen-selection) >\n .".concat(x.a.citationClass,"\n "))),n=null!==t.querySelector("#".concat(x.a.footnoteId));return e.reduce(function(t,e,r){var i=e.getAttribute("data-reflist");if(!i)return t;var a=JSON.parse(i);return[].concat(o()(t),[{citationID:e.id,citationItems:a.map(function(t){return{id:t}}),properties:{index:r,noteIndex:n?1:0}}])},[])}},{key:"relativeCitationPositions",get:function(){var t=this,e=this.editor.getDoc(),n=(this.selectionCache.fresh?this.selectionCache.bookmark:this.editor.selection.getBookmark(1)).rng.startContainer;return o()(e.querySelectorAll("\n *:not(.mce-offscreen-selection) >\n .".concat(x.a.citationClass,"\n "))).reduce(function(e,r,i){if(!r.parentNode)throw new Error("parentNode not defined for citation");switch(n.compareDocumentPosition(r)){case Node.DOCUMENT_POSITION_PRECEDING:e.itemsPreceding=[].concat(o()(e.itemsPreceding),[[r.id,i]]);break;case Node.DOCUMENT_POSITION_FOLLOWING:e.itemsFollowing=[].concat(o()(e.itemsFollowing),[[r.id,i+1]]);break;default:r.parentElement.removeChild(r),t.editor.selection.moveToBookmark(t.selectionCache.bookmark)}return e},{itemsPreceding:[],itemsFollowing:[]})}},{key:"selection",get:function(){return this.selectionCache.fresh?this.selectionCache.selection:this.editor.selection.getContent({format:"html"})}}]),e}(x.a)},149:function(t,e,n){},15:function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},16:function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},17:function(t,e,n){var r=n(47),o=n(48),i=n(49);t.exports=function(t,e){return r(t)||o(t,e)||i()}},18:function(t,e,n){"use strict";var r,o=n(4),i=n.n(o),a=n(5),c=n.n(a),s=n(10),u=n.n(s),l=n(9),f=n.n(l),d=n(11),h=n.n(d),p=n(26),y=n.n(p),v=n(17),m=n.n(v),b=n(3),g=n.n(b);!function(t){t.ADD_REFERENCE="ADD_REFERENCE",t.AVAILABLE="EDITOR_AVAILABLE",t.CITATION_DELETED="CITATION_DELETED",t.TOGGLE_PINNED="TOGGLE_PINNED",t.UNAVAILABLE="EDITOR_UNAVAILABLE",t.UNDO="UNDO"}(r||(r={}));var E=function(){function t(){i()(this,t)}return c()(t,null,[{key:"createBibliographyElement",value:function(e,n){var r,o,i=e.bib_heading,a=void 0===i?"":i,c=e.bib_heading_level,s=void 0===c?"h3":c,u=e.bibliography,l=void 0===u?"fixed":u,f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],d=document.createElement("div");if(d.id=t.bibliographyId,d.setAttribute("data-reflist",JSON.stringify(n.map(function(t){return t.id}))),(r=d.classList).add.apply(r,[t.bibliographyId].concat(g()(f))),d.classList.contains(t.staticBibClass)&&(d.classList.remove(t.bibliographyId),d.removeAttribute("id"),0===n.length)){var h=top.ABT.i18n.errors.warnings;return d.innerHTML="".concat(h.warning,": ").concat(h.no_bib,"."),d}a&&("toggle"===l?((o=document.createElement("button")).classList.add("".concat(t.bibliographyId,"__heading"),"".concat(t.bibliographyId,"__heading_toggle")),o.setAttribute("aria-expanded","false"),o.setAttribute("aria-controls","".concat(this.bibliographyId,"__container")),o.setAttribute("data-heading-level",s)):(o=document.createElement(s)).classList.add("".concat(t.bibliographyId,"__heading")),o.textContent=a,d.appendChild(o));var p=document.createElement("div");p.id="".concat(this.bibliographyId,"__container"),p.classList.add("".concat(this.bibliographyId,"__container")),d.appendChild(p);var y=!0,v=!1,m=void 0;try{for(var b,E=n[Symbol.iterator]();!(y=(b=E.next()).done);y=!0){var w=b.value,L=document.createElement("div");L.id=w.id,L.innerHTML=w.html,p.appendChild(L)}}catch(t){v=!0,m=t}finally{try{y||null==E.return||E.return()}finally{if(v)throw m}}return d}},{key:"createFootnoteSection",value:function(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=document.createElement("div");o.id=t.footnoteId,(n=o.classList).add.apply(n,[t.footnoteId].concat(g()(r)));var i=document.createElement("div");i.classList.add("".concat(t.footnoteId,"__heading")),i.textContent=top.ABT.i18n.misc.footnotes,o.appendChild(i);for(var a=Array.from(e.entries()),c=0;c=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}},3:function(t,e,n){var r=n(41),o=n(42),i=n(43);t.exports=function(t){return r(t)||o(t)||i()}},35:function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},4:function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},41:function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0||(o[n]=t[n]);return o}},51:function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return S()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=C(a,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=u(t,e,n);if("normal"===s.type){if(r=n.done?h:f,s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l="suspendedStart",f="suspendedYield",d="executing",h="completed",p={};function y(){}function v(){}function m(){}var b={};b[i]=function(){return this};var g=Object.getPrototypeOf,E=g&&g(g(k([])));E&&E!==n&&r.call(E,i)&&(b=E);var w=m.prototype=y.prototype=Object.create(b);function L(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function x(t){var e;this._invoke=function(n,o){function i(){return new Promise(function(e,i){!function e(n,o,i,a){var c=u(t[n],t,o);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){s.value=t,i(s)},function(t){return e("throw",t,i,a)})}a(c.arg)}(n,o,e,i)})}return e=e?e.then(i,i):i()}}function C(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=u(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},52:function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},8:function(t,e,n){var r=n(16);t.exports=function(t){for(var e=1;e