/** * Skipped minification because the original files appears to be already minified. * Original file: /npm/diagcess@1.4.1/dist/diagcess.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.diagcess=e():t.diagcess=e()}(this,()=>(()=>{"use strict";var t={23(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.colorSchemes_=void 0,e.documentCmlStyle=function(){document.body&&d(document.body,f("div.cml { display:none; }","cacc-cml"))},e.toggleTextVisibility=function(t){r.classList.toggle(t,"cacc-text-invisible")},e.toggleMonochrome=function(t){r.classList.toggle(t,"cacc-text-monochrome")},e.getScheme_=c,e.moleculeStyle=function(t){var e,n,r=new Map,i=l(t);r.set(i.className,i);try{for(var c=o(a(t,0)),s=c.next();!s.done;s=c.next()){var u=s.value;r.set(u.className,u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return r},e.pickScheme=a,e.nodeBackgroundStyle_=s,e.svgBaseStyle_=l,e.regionStyle_=function(t){var e="p.".concat("cacc-message",".").concat("cacc-text-invisible"," { font-size: 0px; }");d(t,f(e,"cacc-region"))},e.svgHighlightStyle_=u,e.svgBackgroundStyle_=p,e.svgForegroundStyle_=h,e.removeStyle_=v,e.replaceStyle_=function(t,e,n){v(t,n),d(t,f(e,n))},e.addStyle=d;var r=n(647),i=n(322);function c(t){return e.colorSchemes_[t%e.colorSchemes_.length]}function a(t,e){var n=c(e);return[p(t,n.bkd),s(t,n.bkd),h(t,n.frgd),u(t,n.active,n.almost)]}function s(t,e){var n="";return f(n+="div.".concat(t.node.id," { background-color: ").concat(e,"; }"),"cacc-general-background")}function l(t){var e="svg."+t.id,n="";return n+="".concat(e," { overflow: hidden; }"),n+="".concat(e," text tspan[baseline-shift] { font-weight: 200; font-size: 13px; }"),n+="".concat(e," line, svg rect { stroke-width: 1.0; stroke-linecap: round; }"),n+="".concat(e," line.").concat("cacc-active",", svg g.").concat("cacc-active"," line { stroke-width: 3.0; }"),n+="".concat(e," line.").concat("cacc-almost",", svg g.").concat("cacc-almost"," line { stroke-width: 2.0; }"),n+="".concat(e," g.").concat("cacc-active"," text { font-weight: bold; }"),n+="".concat(e," g#gridSVG g.").concat("cacc-active"," text { font-weight: bold; }"),n+="ul.".concat("cacc-controls"," { list-style-type: none; }"),n+="".concat(e," polyline.").concat("cacc-active",", svg g.").concat("cacc-active"," polyline { stroke-width: 3.0; }"),n+="".concat(e," polyline.").concat("cacc-almost",", svg g.").concat("cacc-almost"," polyline { stroke-width: 2.0; }"),n+="".concat(e," polygon.").concat("cacc-active",", svg g.").concat("cacc-active"," polygon { stroke-width: 3.0; }"),n+="".concat(e," polygon.").concat("cacc-almost",", svg g.").concat("cacc-almost"," polygon { stroke-width: 2.0; }"),n+="".concat(e," path.").concat("cacc-active",", svg g.").concat("cacc-active"," path { stroke-width: 3.0; }"),n+="".concat(e," path.").concat("cacc-almost",", svg g.").concat("cacc-almost"," path { stroke-width: 2.0; }"),n+="".concat(e," rect.").concat("cacc-active",", svg g.").concat("cacc-active"," rect { stroke-width: 3.0; }"),n+="".concat(e," rect.").concat("cacc-almost",", svg g.").concat("cacc-almost"," rect { stroke-width: 2.0; }"),n+="".concat(e," circle.").concat("cacc-active",", svg g.").concat("cacc-active"," circle { stroke-width: 3.0; }"),n+="".concat(e," circle.").concat("cacc-almost",", svg g.").concat("cacc-almost"," circle { stroke-width: 2.0; }"),n+="".concat(e," ellipse.").concat("cacc-active",", svg g.").concat("cacc-active"," ellipse { stroke-width: 3.0; }"),n+="".concat(e," ellipse.").concat("cacc-almost",", svg g.").concat("cacc-almost"," ellipse { stroke-width: 2.0; }"),n+="".concat(e," use.").concat("cacc-active",", svg g.").concat("cacc-active"," use { stroke-width: 3.0; }"),n+="".concat(e," use.").concat("cacc-almost",", svg g.").concat("cacc-almost"," use { stroke-width: 2.0; }"),n+="".concat(e," g.").concat("cacc-active"," svg { color: ").concat("cacc-active","; }"),f(n+="".concat(e," g.").concat("cacc-almost"," svg { color: ").concat("cacc-almost","; }"),"cacc-base")}function u(t,e,n){var o="svg."+t.id,r="";return r+="".concat(o," line.").concat("cacc-active",", g.").concat("cacc-active"," line { stroke: ").concat(e,"; }"),r+="".concat(o," line.").concat("cacc-almost",", g.").concat("cacc-almost"," line { stroke: ").concat(n,"; }"),r+="".concat(o," g.").concat("cacc-active"," text { fill: ").concat(e,"; }"),r+="".concat(o," g.").concat("cacc-almost"," text { fill: ").concat(n,"; }"),r+="".concat(o," g#gridSVG g.").concat("cacc-active"," text { fill: ").concat(e,"; }"),r+="".concat(o," g#gridSVG g.").concat("cacc-almost"," text { fill: ").concat(n,"; }"),r+="".concat(o," polyline.").concat("cacc-active",", g.").concat("cacc-active"," polyline { stroke: ").concat(e,"; }"),r+="".concat(o," polyline.").concat("cacc-almost",", g.").concat("cacc-almost"," polyline { stroke: ").concat(n,"; }"),r+="".concat(o," polygon.").concat("cacc-active",", g.").concat("cacc-active"," polygon { stroke: ").concat(e,"; }"),r+="".concat(o," polygon.").concat("cacc-almost",", g.").concat("cacc-almost"," polygon { stroke: ").concat(n,"; }"),r+="".concat(o," path.").concat("cacc-active",", g.").concat("cacc-active"," path { stroke: ").concat(e,"; }"),r+="".concat(o," path.").concat("cacc-almost",", g.").concat("cacc-almost"," path { stroke: ").concat(n,"; }"),r+="".concat(o," rect.").concat("cacc-active",", g.").concat("cacc-active"," rect { stroke: ").concat(e,"; }"),r+="".concat(o," rect.").concat("cacc-almost",", g.").concat("cacc-almost"," rect { stroke: ").concat(n,"; }"),r+="".concat(o," circle.").concat("cacc-active",", g.").concat("cacc-active"," circle { stroke: ").concat(e,"; }"),r+="".concat(o," circle.").concat("cacc-almost",", g.").concat("cacc-almost"," circle { stroke: ").concat(n,"; }"),r+="".concat(o," ellipse.").concat("cacc-active",", g.").concat("cacc-active"," ellipse { stroke: ").concat(e,"; }"),r+="".concat(o," ellipse.").concat("cacc-almost",", g.").concat("cacc-almost"," ellipse { stroke: ").concat(n,"; }"),r+="".concat(o," use.").concat("cacc-active",", g.").concat("cacc-active"," use { stroke: ").concat(e,"; }"),r+="".concat(o," use.").concat("cacc-almost",", g.").concat("cacc-almost"," use { stroke: ").concat(n,"; }"),r+="".concat(o," g.").concat("cacc-active"," svg { color: ").concat(e,"; }"),f(r+="".concat(o," g.").concat("cacc-almost"," svg { color: ").concat(n,"; }"),"cacc-color-highlight")}function p(t,e){var n="svg."+t.id,o="";return o+="".concat(n," { background-color: ").concat(e,"; }"),o+="".concat(n," g.atom rect { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="div.container { background-color: ".concat(e,"; }"),o+="p.".concat(t.id,".").concat("cacc-message"," { background-color: ").concat(e,"; }"),f(o+="p.".concat(t.id,".").concat("cacc-message",".").concat("cacc-text-invisible"," { color: ").concat(e,"; }"),"cacc-color-background")}function h(t,e){var n="svg."+t.id,o="";return o+="".concat(n," line { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="".concat(n,".").concat("cacc-text-monochrome"," text"),o+=" { stroke: ".concat(e,"; fill: ").concat(e,"; }"),o+="".concat(n," g#gridSVG text { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="div.container { color: ".concat(e,"; }"),o+="p.".concat(t.id,".").concat("cacc-message"," { color: ").concat(e,"; }"),o+="ul.".concat(t.id,".").concat("cacc-controls"," { color: ").concat(e,"; }"),i.config.POLYLINE&&(o+="".concat(n," polyline { stroke: ").concat(e,"; fill: ").concat(e,"; }")),o+="".concat(n," polygon { stroke: ").concat(e,"; fill: ").concat(e,"; }"),o+="".concat(n," path { stroke: ").concat(e,"; }"),o+="".concat(n," rect { stroke: ").concat(e,"; }"),o+="".concat(n," circle { stroke: ").concat(e,"; }"),o+="".concat(n," ellipse { stroke: ").concat(e,"; }"),o+="".concat(n," use { stroke: ").concat(e,"; }"),f(o+="".concat(n," g svg { color: ").concat(e,"; }"),"cacc-color-elements")}function f(t,e){var n=document.createElement("style");return n.setAttribute("class",e),n.innerHTML=t,n}function v(t,e){var n=t.querySelector("style."+e);return!!n&&(t.removeChild(n),!0)}function d(t,e){t.appendChild(e)}e.colorSchemes_=[{frgd:"#000",bkd:"#fff",active:"#f80",almost:"#6df"},{frgd:"#fff",bkd:"#000",active:"#f80",almost:"#6df"},{frgd:"#3C3",bkd:"#000",active:"#f80",almost:"#6df"},{frgd:"#ee0",bkd:"#00e",active:"#4f4",almost:"#e3e"}]},153(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r0?t.container.update(o[0]):(0,a.noMove)(),e.preventDefault()};this.registerEvent(this.container.molecule.node,s.EventType.KEYDOWN,function(n){switch(n.keyCode){case s.KeyCodes.DOWN:case s.KeyCodes.D:e(n,function(){return t.container.activeElement.getDown()});break;case s.KeyCodes.UP:case s.KeyCodes.E:e(n,function(){return t.container.activeElement.getUp()});break;case s.KeyCodes.RIGHT:case s.KeyCodes.F:e(n,function(){return t.container.activeElement.getRight()});break;case s.KeyCodes.LEFT:case s.KeyCodes.S:e(n,function(){return t.container.activeElement.getLeft()})}return n.stopPropagation(),!1})},e.prototype.getActivationKey=function(){return s.KeyCodes.A},e}(u);e.KeyExplorer=p;var h=function(t){function e(){var e=t.apply(this,c([],i(arguments),!1))||this;return e.name=l.explorers.MENU,e}return r(e,t),e.prototype.setupControls=function(){var t=this,e=this.container.molecule.createElement("ul");e.classList.add("cacc-controls"),e.setAttribute("role","navigation"),this.control_=e;var n=function(e,n){var o=n();o.length>0?t.container.update(o[0]):(0,a.noMove)()},o=function(e,o){t.registerEvent(e,s.EventType.KEYDOWN,function(t){return t.keyCode!==s.KeyCodes.ENTER&&t.keyCode!==s.KeyCodes.SPACE||(n(0,o),t.preventDefault(),t.stopPropagation()),!1}),t.registerEvent(e,s.EventType.CLICK,function(t){return n(0,o),t.stopPropagation(),!1})};o(this.makeButton_("Down",e),function(){return t.container.activeElement.getDown()}),o(this.makeButton_("Up",e),function(){return t.container.activeElement.getUp()}),o(this.makeButton_("Next",e),function(){return t.container.activeElement.getRight()}),o(this.makeButton_("Previous",e),function(){return t.container.activeElement.getLeft()})},e.prototype.addControls=function(){var t=this.container.molecule.node,e=t.querySelector(".cacc-message");e?t.insertBefore(this.control_,e):t.appendChild(this.control_)},e.prototype.removeControls=function(){this.control_.parentNode.removeChild(this.control_)},e.prototype.getActivationKey=function(){return s.KeyCodes.B},e.prototype.makeButton_=function(t,e){var n=this.container.molecule.createElement("li");return n.setAttribute("role","button"),n.setAttribute("aria-controls",this.container.molecule.node.getAttribute("id")),n.classList.add("cacc-button"),n.setAttribute("tabindex","0"),n.setAttribute("title",t),n.appendChild(document.createTextNode(t)),e.appendChild(n),n},e}(u);e.MenuExplorer=h},162(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractController=void 0;var r=n(307),i=function(){function t(t){this.container=t,this._active=!1,this.internalEvents_=[],this.customEvents()}return Object.defineProperty(t.prototype,"active",{get:function(){return this._active},set:function(t){this._active=t},enumerable:!1,configurable:!0}),t.prototype.activate=function(){this.active=!0,this.addEvents()},t.prototype.deactivate=function(){this.removeEvents(),this.active=!1},t.prototype.registerEvent=function(t,e,n){this.internalEvents_.push(new r.CustomEvent(t,e,n))},t.prototype.addEvents=function(){var t,e;try{for(var n=o(this.internalEvents_),r=n.next();!r.done;r=n.next()){r.value.add()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.removeEvents=function(){var t,e;try{for(var n=o(this.internalEvents_),r=n.next();!r.done;r=n.next()){r.value.remove()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t}();e.AbstractController=i},179(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c};Object.defineProperty(e,"__esModule",{value:!0}),e.ViewBox=e.ZoomOptions=void 0;var i=n(647),c=n(790),a=function(){};e.ZoomOptions=a;var s=function(){function t(t){this.svg=t,this.focusgroups=new Map,this.zoomToken_=0,this.defaultZoomOptions={xPad:this.svg.width.baseVal.value/15,yPad:this.svg.height.baseVal.value/15,duration:100,delay:10,wait:0,callback:function(){}},this.originalViewBox=this.svg.getBBox(),this.reset()}return t.prototype.reset=function(){var t=c.Bbox.fromSvgRect(this.svg.getBBox()),e=new Set(Array.from(this.svg.querySelectorAll("svg *[clip-path]")));c.Bbox.performClipping(t,e)},t.prototype.restore=function(){this.setViewBox_(c.Bbox.fromSvgRect(this.originalViewBox),{xPad:0,yPad:0})},t.prototype.setClass=function(t,e){for(var n=0;n=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Languages=void 0;var r=n(322),i=n(551),c=function(){function t(t){this.cmlDocument=t,this.languages={},this.insertLanguages(),this.active=this.defaultActive()}return t.createLanguages=function(e){return 0===Array.from(e.querySelectorAll("messages")).filter(function(t){return t.childNodes.length}).length?null:new t(e)},t.prototype.insertLanguages=function(){var t,e,n=this.cmlDocument.querySelectorAll("messages");try{for(var r=o(Array.from(n)),c=r.next();!c.done;c=r.next()){var a=c.value,s=a.querySelector("language");s&&(this.languages[s.textContent]=new i.Language(a))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.updateActive=function(){this.active=this.languages[r.config.ACTIVE_LANG]?r.config.ACTIVE_LANG:this.defaultActive()},t.prototype.defaultActive=function(){return this.languages[r.config.VOICE_LANG]?r.config.VOICE_LANG:Object.keys(this.languages)[0]},t.prototype.translate=function(t){return this.languages[this.active].translate(t)},t.prototype.nextLanguage=function(){var t=Object.keys(this.languages),e=t.indexOf(this.active)+1;this.active=t.length>e?t[e]:t[0],r.config.ACTIVE_LANG=this.active},t}();e.Languages=c},307(t,e){var n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.CustomEvent=e.EventType=e.KeyCodes=void 0,function(t){t[t.ENTER=13]="ENTER",t[t.ESC=27]="ESC",t[t.SPACE=32]="SPACE",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.COMMA=188]="COMMA",t[t.PERIOD=190]="PERIOD"}(n||(e.KeyCodes=n={})),function(t){t.CLICK="click",t.DBLCLICK="dblclick",t.MOUSEDOWN="mousedown",t.MOUSEUP="mouseup",t.MOUSEOVER="mouseover",t.MOUSEOUT="mouseout",t.MOUSEMOVE="mousemove",t.SELECTSTART="selectstart",t.KEYPRESS="keypress",t.KEYDOWN="keydown",t.KEYUP="keyup",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.TOUCHCANCEL="touchcancel"}(o||(e.EventType=o={}));var r=function(){function t(t,e,n){this.src=t,this.type=e,this.callback=n,this.src=t,this.type=e,this.callback=n}return t.prototype.add=function(){this.src.addEventListener(this.type,this.callback)},t.prototype.remove=function(){this.src.removeEventListener(this.type,this.callback)},t}();e.CustomEvent=r},322(t,e){var n,o,r,i,c,a;Object.defineProperty(e,"__esModule",{value:!0}),e.config=e.options=e.sound=e.speech=e.colors=e.regions=e.magnifiers=e.explorers=e.version=void 0,e.version="1.4.1",function(t){t.KEY="key",t.MENU="menu"}(n||(e.explorers=n={})),function(t){t.DUMMY="dummy",t.STEP="step",t.SIMPLE="simple"}(o||(e.magnifiers=o={})),function(t){t.SUBTITLE="subtitle",t.SPEECH="speech"}(r||(e.regions=r={})),function(t){t.MONOCHROME="monochrome",t.CONTRAST="contrast"}(i||(e.colors=i={})),function(t){t.LANGUAGE="language",t.EXPERT="expert",t.DETAIL="detail"}(c||(e.speech=c={})),function(t){t.OSCILLATOR="oscillator",t.VOICING="voicing"}(a||(e.sound=a={})),e.options={explorers:[n.KEY,n.MENU],magnifiers:[o.STEP,o.SIMPLE,o.DUMMY],regions:[r.SUBTITLE,r.SPEECH],colors:[i.MONOCHROME,i.CONTRAST],speech:[c.LANGUAGE,c.EXPERT,c.DETAIL],sound:[a.OSCILLATOR,a.VOICING]},e.config={MSG_VISIBLE:!0,MAG_ACTIVE:o.STEP,SONIFY:!1,VOICING:!0,VOICE_LANG:"en",ACTIVE_LANG:"en",SUB_VISIBLE:!1,SUBTITLE:null,POLYLINE:!1}},358(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ChemObj=void 0;var r=n(647),i=["circular"],c=function(){function t(t,e){var n,c;this.annotation_=t,this.diagram_=e,this.drawnElements=null,this.attributes=new Map,this.up=null,this.down=[],this.link=!1,this.drawn_=null,this.id_=this.getId_(),this.parent_=this.getParent_(),this.position=this.getPosition_();try{for(var a=o(i),s=a.next();!s.done;s=a.next()){var l=s.value,u=r.getAttribute(t,l);u&&this.attributes.set(l,u)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(c=a.return)&&c.call(a)}finally{if(n)throw n.error}}}return t.prototype.getAnnotation=function(){return this.annotation_},t.prototype.getDiagram=function(){return this.diagram_},t.prototype.getId=function(){return this.id_},t.prototype.setDrawnElement=function(t){this.drawn_=t},t.prototype.getDrawnElement=function(){return this.drawn_},t.prototype.getDrawnElements=function(){return this.drawnElements||(this.drawnElements=[],this.drawn_&&this.drawnElements.push(this.drawn_)),this.drawnElements},t.prototype.complete=function(){if(this.down.length&&this.down.sort(function(t,e){return!t.position&&e.position?1:t.position-e.position}),this.parent_){var t=this.getDiagram().get(this.parent_);this.up=t,t.down.push(this)}},t.prototype.getParent=function(){return this.parent_},t.prototype.getKey=function(){return this.id_+this.parent_},t.prototype.getUp=function(){return this.up?[this.up]:[]},t.prototype.getDown=function(){return this.down},t.prototype.getRight=function(){if(!this.up)return[];var t=this.up.getDown(),e=t.indexOf(this);if(t.length>e+1){var n=t[e+1];return n.position?[n]:[]}return this.up.attributes.get("circular")?[t[0]]:[]},t.prototype.getLeft=function(){if(!this.up)return[];var t=this.up.getDown(),e=t.indexOf(this);if(e>0){var n=t[e-1];return n.position?[n]:[]}return this.up.attributes.get("circular")?[t[t.length-1]]:[]},t.prototype.getId_=function(){var t=this.getAnnotation().firstElementChild;return t?t.textContent:""},t.prototype.getParent_=function(){var t=this.getAnnotation().querySelector("parents > *");return t?r.getTextContent(t):""},t.prototype.getPosition_=function(){return parseInt(r.getTextContent(this.getAnnotation().querySelector("position")),10)},t}();e.ChemObj=c},414(t,e,n){var o;Object.defineProperty(e,"__esModule",{value:!0}),e.SelectedElements=e.SelectedTypes=void 0,e.rewriteTransformations=function(t){var n=i.toArray(t.querySelectorAll(c.join(",")));e.SelectedElements.SUB_SVG=i.toArray(t.querySelectorAll("svg svg"));var o=i.toArray(t.querySelectorAll(c.map(function(t){return"svg svg "+t}).join(",")));e.SelectedElements.SUB_DEFS=i.toArray(t.querySelectorAll(c.map(function(t){return"svg defs "+t}).join(","))),function(t,e){e.forEach(s),t.forEach(s),e.forEach(u),t.forEach(u),e.forEach(function(t){var e=l(t),n=t.getAttribute("transform");n&&(e.setAttribute("transform",n),t.removeAttribute("transform"))}),t.filter(function(t){return t.hasAttribute("id")}).forEach(l)}(n.filter(function(t){return!o.includes(t)&&!e.SelectedElements.SUB_DEFS.includes(t)}),e.SelectedElements.SUB_SVG)},e.rewriteUseElements=function(t){var n=a.map(function(t){return"".concat(t,":inherit;")}).join(" ");e.SelectedElements.SUB_DEFS.forEach(function(t){var o=t.parentElement,r=null==o?void 0:o.parentElement;r&&e.SelectedElements.SUB_SVG.includes(r)||o&&"marker"===o.tagName||t.setAttribute("style",n)})};var r,i=n(647),c=["text","polyline","line","rect","polygon","use","circle","path"],a=["stroke","stroke-width","color","fill","background-color","transform"];function s(t){var e=t,n=[];do{var o=e.getAttribute("transform");o&&n.unshift(o),e=e.parentNode}while("svg"!==e.tagName);t.setAttribute("transform",n.join(" "))}function l(t){var e=document.createElementNS("http://www.w3.org/2000/svg","g"),n=t.getAttribute("id");return n&&(e.setAttribute("id",n),t.removeAttribute("id")),t.parentNode.replaceChild(e,t),e.appendChild(t),e}function u(t){var e=t;do{(e=e.parentNode).removeAttribute("transform")}while("svg"!==e.tagName)}!function(t){t.DEFS="defs",t.SUB_DEFS="subDefs",t.SUB_SVG="subSvg"}(r||(e.SelectedTypes=r={})),e.SelectedElements=((o={})[r.DEFS]=[],o[r.SUB_DEFS]=[],o[r.SUB_SVG]=[],o)},434(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Molecule=void 0;var o=n(647),r=n(672),i=function(){function t(t,e,n){this.node=t,this.svg=e,this.cml=n,this.id=o.getId(),o.classList.add(this.svg,this.id),o.classList.add(this.cml,this.id),this.cmlStructure=new r.CML(this.cml),this.topLevelDescription=this.cmlStructure.getRootElement().getSpeech(),this.combine_()}return t.prototype.createElement=function(t){var e=document.createElement(t);return e.classList.add(this.id),e},t.prototype.combine_=function(){var t=this;this.cmlStructure.getMap().forEach(function(e){var n=t.svg.getElementById(e.getId());n&&e.setDrawnElement(n)})},t}();e.Molecule=i},536(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Diagram=void 0;var n=function(){function t(t){this.languages=t,this.diagram_={}}return t.prototype.set=function(t,e){this.diagram_[t]=e},t.prototype.get=function(t){return this.diagram_[t]},t.prototype.forEach=function(t){for(var e in this.diagram_)t.call(this,this.diagram_[e])},t.prototype.find=function(t){for(var e in this.diagram_){var n=this.diagram_[e];if(t.call(this,n))return n}return null},t.prototype.translate=function(t){return this.languages?this.languages.translate(t):t},t.prototype.nextLanguage=function(){return this.languages?(this.languages.nextLanguage(),this.languages.active):null},t}();e.Diagram=n},551(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Language=void 0;var o=n(647),r=function(){function t(t){this.cmlDocument=t,this.messages={},this.language=this.getLanguage(),this.insertMessages()}return t.prototype.getLanguage=function(){var t=this.cmlDocument.querySelector("language");return t?t.textContent:""},t.prototype.insertMessages=function(){for(var t=this.cmlDocument.querySelectorAll("message"),e=0,n=void 0;n=t[e];e++)this.messages[(0,o.getAttribute)(n,"msg")]=n.textContent},t.prototype.translate=function(t){return this.messages[t]},t}();e.Language=r},553(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.forDocument=function(t){var e,n,r=t||document,a=Array.from(r.querySelectorAll("div.ChemAccess-element")),s={};try{for(var l=o(a),u=l.next();!u.done;u=l.next()){var p=u.value;c(p),p.id||(p.id="ChemAccess-element"+i++),s[p.id]=p}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return s};var r=n(414),i=0;function c(t){if(t.querySelector("div.svg")){t.setAttribute("has-svg","true");var e=t.querySelector("div.svg > svg");r.rewriteTransformations(e),r.rewriteUseElements(e)}else a(t,"svg","data-src",".svg");t.querySelector("div.cml")?t.setAttribute("has-cml","true"):a(t,"cml","data-cml",".xml")}function a(t,e,n,o){var i=t.getAttribute(n)||function(t,e,n){if(!t.id)return null;var o=function(){for(var t,e={},n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),o=0;o0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Sonify=void 0;var r=n(647),i=function(){function t(t){this.path=[],this.points=[],this.context=new AudioContext,this.prepare(t),this.sonifiable=this.path.length}return t.sonify=function(e){var n=e.getAnnotation().querySelectorAll("sonification > *"),o=[];n.length&&(o=Array.from(n).map(function(t){var n=(0,r.getTextContent)(t),o=t.tagName.toLowerCase(),i=n+("active"!==o&&"sre:active"!==o?"":n===e.getId()?e.getParent():e.getId());return e.getDiagram().get(i)}));var i=new t(o);return i.sonifiable?i.sonify():[]},t.prototype.prepare=function(t){var e,n;try{for(var r=o(t),i=r.next();!i.done;i=r.next()){var c=i.value;if(c.getDrawnElement()){for(var a=c.getDrawnElement().querySelectorAll("polyline"),s=0;s20?(r=n/10+.01,i=n/10+.1):(r=n/2+.01,i=n/2+.5),o.start(this.context.currentTime+r),o.stop(this.context.currentTime+i)}return e},t.prototype.sonify=function(){var e,n,o=[],r=this.context.createOscillator();o.push(r),r.type="sine",r.connect(this.context.destination);for(var i=0;i20?(e=i/10+.01,n=i/10):(e=i/2+.01,n=i/2+.5),console.log(e),i?r.frequency.setValueAtTime(this.points[i][1]?t.BASE_FREQUENCY-this.points[i][1]:0,this.context.currentTime+n):(r.frequency.setValueAtTime(t.BASE_FREQUENCY-this.points[i][1],this.context.currentTime),r.start(this.context.currentTime));return r.stop(this.context.currentTime+n),o},t.prototype.smooth=function(){if(this.points.length){for(var e=[this.points[0]],n=0;n0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r atom,active"),e=0,n=void 0;n=t[e];e++){var o=this.getDiagram().get((0,a.getTextContent)(n));o&&this.ends.push(o)}},e}(n(957).NeighbourHood);e.Bond=s},647(t,e){function n(t){return e.prefix_+"-"+t}var o,r;Object.defineProperty(e,"__esModule",{value:!0}),e.attr=e.classList=e.EXPERT_MODE=e.idCounter_=e.prefix_=void 0,e.addPrefix=n,e.getId=function(){return n("Id-"+e.idCounter_++)},e.toArray=function(t){for(var e=[],n=0;n=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ControllerFactory=void 0;var r,i=n(322),c=n(23),a=n(153),s=n(580),l=n(358),u=n(671),p=n(768);!function(t){var e,n=((e={})[i.magnifiers.SIMPLE]=function(t){return new s.SimpleMagnifier(t)},e[i.magnifiers.STEP]=function(t){return new s.StepMagnifier(t)},e[i.magnifiers.DUMMY]=function(t){return new s.DummyMagnifier(t)},e[i.colors.MONOCHROME]=function(t){return new c.Monochrome(t)},e[i.colors.CONTRAST]=function(t){return new c.Contrast(t)},e[i.speech.DETAIL]=function(t){return new p.Detail(t)},e[i.speech.EXPERT]=function(t){return new p.Expert(t)},e[i.speech.LANGUAGE]=function(t){return new p.Language(t)},e[i.regions.SPEECH]=function(t){return new l.Speech(t)},e[i.regions.SUBTITLE]=function(t){return new l.Subtitle(t)},e[i.explorers.KEY]=function(t){return new a.KeyExplorer(t)},e[i.explorers.MENU]=function(t){return new a.MenuExplorer(t)},e[i.sound.OSCILLATOR]=function(t){return new u.Oscillator(t)},e[i.sound.VOICING]=function(t){return new u.Voicing(t)},e);t.get=function(t){var e,r,c=[],a=[].concat(i.options.magnifiers,i.options.regions,i.options.colors,i.options.speech,i.options.sound,i.options.explorers);try{for(var s=o(a),l=s.next();!l.done;l=s.next()){var u=l.value,p=n[u];if(p){var h=p(t);c.push(h)}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return c}}(r||(e.ControllerFactory=r={}))},671(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.CML=void 0;var r=n(536),i=n(302),c=n(995),a=n(987),s=n(615),l=function(){function t(t){this.cmlDocument=t,this.root=null,this.map=new r.Diagram(i.Languages.createLanguages(t)),this.initMap_()}return t.prototype.getMap=function(){return this.map},t.prototype.getRootElement=function(){return this.root||(this.root=this.map.find(function(t){return!(t instanceof s.Bond||t.up)})),this.root},t.prototype.initMap_=function(){var t,e,n=Array.from(this.cmlDocument.querySelectorAll("annotations > annotation"));try{for(var r=o(n),i=r.next();!i.done;i=r.next()){var l=i.value,u=l.firstElementChild;if(u){var p=void 0;switch(u.localName.toLowerCase()){case"atom":case"active":p=new c.Atom(l,this.map),this.map.set(p.getKey(),p);break;case"bond":case"passive":p=new s.Bond(l,this.map),this.map.set(p.getId(),p);break;case"atomset":case"grouped":p=new a.AtomSet(l,this.map),this.map.set(p.getId(),p)}}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.map.forEach(function(t){return t.complete()})},t}();e.CML=l},744(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Via=void 0;var o=n(647),r=function(){function t(t,e){this.neighbour_=t,this.annotation_=e,this.type_=o.getAttribute(this.annotation_,o.attr.TYPE);var n=o.children(this.annotation_);this.connectedBy_=this.getConnectedBy_(n[0]),"Connecting bond"===this.type_&&"external"===this.neighbour_.location&&(this.neighbour_.from().link=!0),void 0!==this.connectedBy_&&(this.connectedBy_.link=!0),this.position_=parseInt(o.getTextContent(n[1]),10)}return t.prototype.getDrawnElements=function(){return this.connectedBy_.getDrawnElements()||[]},t.prototype.getType=function(){return this.type_||""},t.prototype.getPosition=function(){return this.position_},t.prototype.getConnectedBy_=function(t){var e=this.neighbour_.from().getDiagram(),n=o.getTextContent(t),r=e.get(n);return r||e.get(n+this.neighbour_.from().getId())},t}();e.Via=r},768(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var l=n(33),u=n(307),p=n(322),h=n(162),f=n(659),v=n(434),d=n(179),y=function(t){function e(e,n){var o=t.call(this,null)||this;return o.key=e,o.mol=n,o.name="Container",o.controllers=[],o.initElement().then(function(){o.viewBox=new d.ViewBox(o.molecule.svg),o.controllers=o.controllers.concat(f.ControllerFactory.get(o)),o.styles=l.moleculeStyle(o.molecule),o.activeElement=o.molecule.cmlStructure.getRootElement(),o.customEvents(),o.getDefaultExplorer()}).catch(function(){console.error("Failed to initialize element ".concat(e))}),o}return r(e,t),e.loadElement=function(t){return i(this,void 0,void 0,function(){var e;return c(this,function(n){return e=0,[2,new Promise(function(n,o){var r=function(){t.hasAttribute("has-svg")&&t.hasAttribute("has-cml")?n():e>5?o(t):(e++,setTimeout(r,100))};r()}).catch(function(t){"true"!==t.getAttribute("has-svg")&&console.error("Failed to load SVG diagram."),"true"!==t.getAttribute("has-cml")&&console.error("Failed to load XML annotation.")})]})})},e.prototype.initElement=function(){return i(this,void 0,void 0,function(){var t=this;return c(this,function(n){return[2,e.loadElement(this.mol).then(function(){if("true"!==t.mol.getAttribute("has-svg")||"true"!==t.mol.getAttribute("has-cml"))return Promise.reject("Loading of components failed.");var e=t.mol.querySelector("div.svg").children[0],n=t.mol.querySelector("div.cml").children[0];return e&&n?(t.mol.setAttribute("tabindex","0"),t.mol.setAttribute("role","application"),e.setAttribute("aria-hidden","true"),n.setAttribute("aria-hidden","true"),t.mol.hasAttribute("aria-label")||t.mol.setAttribute("aria-label","Navigatable ".concat(n.tagName)),t.molecule=new v.Molecule(t.mol,e,n),Promise.resolve()):Promise.reject("Empty Diagram elements.")}).catch(function(t){console.error("Molecule Structure initialisation failed with:",t)})]})})},e.prototype.update=function(t){t&&(this.activeElement=t),this.controllers.forEach(function(t){t.active&&t.update()})},e.prototype.activate=function(){this.molecule.svg.parentElement&&(t.prototype.activate.call(this),this.addStyles(),this.controllers.forEach(function(t){return t.activate()}))},e.prototype.deactivate=function(){this.update(this.molecule.cmlStructure.getRootElement()),this.controllers.forEach(function(t){return t.deactivate()}),this.removeStyles(),t.prototype.deactivate.call(this)},e.prototype.replaceStyles=function(t){var e,n;this.removeStyles();try{for(var o=a(t),r=o.next();!r.done;r=o.next()){var i=r.value;this.styles.set(i.className,i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}this.addStyles()},e.prototype.customEvents=function(){var t,e=this;(null===(t=this.molecule)||void 0===t?void 0:t.node)&&(this.registerEvent(this.molecule.node,u.EventType.KEYDOWN,function(t){return t.keyCode===u.KeyCodes.SPACE&&(e.update(),t.preventDefault(),t.stopPropagation()),!1}),new u.CustomEvent(this.molecule.node,u.EventType.KEYDOWN,function(t){return e.defaultExplorer&&!e.active&&t.keyCode===u.KeyCodes.ENTER&&(e.defaultExplorer.active=!0,e.activate(),t.preventDefault(),t.stopPropagation()),!1}).add(),new u.CustomEvent(this.molecule.node,u.EventType.CLICK,function(t){return e.defaultExplorer&&!e.active&&(e.defaultExplorer.active=!0,e.activate(),t.stopPropagation()),!1}).add())},e.prototype.getDefaultExplorer=function(){this.defaultExplorer=this.controllers.find(function(t){return t.name===p.explorers.KEY}),this.defaultExplorer||(this.defaultExplorer=this.controllers.find(function(t){return t.name===p.explorers.MENU}))},e.prototype.addStyles=function(){var t,e;try{for(var n=a(this.styles),o=n.next();!o.done;o=n.next()){var r=s(o.value,2)[1];this.molecule.node.appendChild(r)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e.prototype.removeStyles=function(){var t,e;try{for(var n=a(this.styles),o=n.next();!o.done;o=n.next()){var r=s(o.value,2)[1];try{this.molecule.node.removeChild(r)}catch(t){}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e}(h.AbstractController);e.Container=y},790(t,e){var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Bbox=void 0;var o=function(){function t(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}return t.fromSvgRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.fromSvgViewBox=function(e){return new t(e.baseVal.x,e.baseVal.y,e.baseVal.width,e.baseVal.height)},t.getClipBox=function(t,e){var n=t.getBBox();if(0!==n.x||0!==n.y||0!==n.width||0!==n.height)return n;var o=t.cloneNode(!0);return e.appendChild(o),n=o.getBBox(),e.removeChild(o),n},t.combineClips=function(e,n){var o=e.map(function(e){return t.fromSvgRect(t.getClipBox(e,n))});if(1===o.length)return o[0];var r=o[0];return o.slice(1).reduce(function(t,e){return t.combine(e)},r)},t.getBboxStandard=function(t){var e,n,o,r,i,c=t.getBBox();if(0===c.x&&0===c.y&&0===c.width&&0===c.height&&t.childNodes&&(null===(e=t.childNodes[0])||void 0===e?void 0:e.transform)){var a=t.childNodes[0],s=void 0,l=void 0,u=void 0,p=void 0;if(a.x&&a.y&&a.width&&a.height)s=a.x.baseVal.value,l=a.y.baseVal.value,u=a.width.baseVal.value,p=a.height.baseVal.value;else{var h=a.getBBox();s=(null===(n=h.baseVal)||void 0===n?void 0:n.x)||h.x,l=(null===(o=h.baseVal)||void 0===o?void 0:o.y)||h.y,u=(null===(r=h.baseVal)||void 0===r?void 0:r.width)||h.width,p=(null===(i=h.baseVal)||void 0===i?void 0:i.height)||h.height}var f=t.ownerSVGElement.createSVGPoint(),v=a.transform.baseVal;f.x=s,f.y=l;for(var d=v.length-1;d>=0;d--)f=f.matrixTransform(v.getItem(d).matrix);c.x=f.x,c.y=f.y,c.width=u,c.height=p}return c},t.combineBboxes=function(e){var n=new Set,o=function(e){var o=t.getBboxStandard(e);return e.querySelectorAll("*[clip-path]").forEach(function(t){return n.add(t)}),o},r=t.fromSvgRect(o(e[0]));if(1===e.length)return r=t.performClipping(r,n);var i=e.slice(1).reduce(function(t,e){return t.combine(o(e))},r);return i=t.performClipping(i,n)},t.performClipping=function(e,o){var r,i;if(!o.size)return e;var c=o.values().next().value.ownerSVGElement,a=function(t){var e=new Map;return t.querySelectorAll("defs").forEach(function(t){t.childNodes.forEach(function(t){t instanceof SVGElement&&e.set(t.id,t)})}),e}(c),s=new Set;try{for(var l=n(o),u=l.next();!u.done;u=l.next()){var p=u.value.getAttribute("clip-path").match(/^url\(#(.*)\)/),h=p&&a.get(p[1]);h&&s.add(h)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s.forEach(function(n){var o=Array.from(n.childNodes).filter(function(t){return t.getBBox}),r=t.combineClips(o,c);e=e.intersect(r)}),e},t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y,this.width+e.width,this.height+e.height)},t.prototype.difference=function(t,e,n){var o=this.add(t.scale(-1));return e&&(o.x=o.x-e/2,o.width=o.width+e),n&&(o.y=o.y-n/2,o.height=o.height+n),o},t.prototype.scale=function(e){return new t(this.x*e,this.y*e,this.width*e,this.height*e)},t.prototype.combine=function(e){var n=Math.min(this.x,e.x),o=Math.min(this.y,e.y);return new t(n,o,Math.max(this.x+this.width,e.x+e.width)-n,Math.max(this.y+this.height,e.y+e.height)-o)},t.prototype.intersect=function(e){var n=Math.max(this.x,e.x),o=Math.max(this.y,e.y);return new t(n,o,Math.min(this.x+this.width,e.x+e.width)-n,Math.min(this.y+this.height,e.y+e.height)-o)},t.prototype.viewBoxValue=function(){return this.x+" "+this.y+" "+this.width+" "+this.height},t}();e.Bbox=o},815(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Neighbour=void 0;var o=n(647),r=n(744),i=function(){function t(t,e){var n=this;this.from_=t,this.annotation_=e,this.speech=null,this.speech2=null;var i=o.children(this.annotation_);this.to_=this.from_.getDiagram().get(o.getTextContent(i[0])),this.location=o.getAttribute(this.annotation_,o.attr.LOCATION),this.via_=i.slice(1).map(function(t){return new r.Via(n,t)})}return t.prototype.from=function(){return this.from_},t.prototype.to=function(){return this.to_},t.prototype.via=function(){return this.via_},t.prototype.getSpeech=function(){return this.from_.getDiagram().translate(this.getMessage())},t.prototype.getMessage=function(){if(o.EXPERT_MODE){if(this.speech2)return this.speech2;if(this.speech2=o.getAttribute(this.annotation_,o.attr.EXPERT_SPEECH),this.speech2)return this.speech2}return this.speech||(this.speech=o.getAttribute(this.annotation_,o.attr.SIMPLE_SPEECH)),this.speech},t}();e.Neighbour=i},887(t,e,n){var o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c};Object.defineProperty(e,"__esModule",{value:!0}),e.Base=void 0;var i,c=n(778),a=n(647),s=n(33),l=n(322),u=n(553);!function(t){t.molMap={},t.init=function(e){var n,i,p,h;void 0===e&&(e=!1);var f=u.forDocument();if(Object.keys(f).length>0&&(s.documentCmlStyle(),l.config.SUBTITLE=function(){var t=a.getDocument(),e=t.createElement("p");e.classList.add("explorer"),e.classList.add("cacc-message");var n=s.getScheme_(1);e.style.cssText+="position:fixed;left:0;bottom:0;"+"background-color: ".concat(n.bkd,"; color: ").concat(n.frgd),s.regionStyle_(t.body),l.config.SUB_VISIBLE||e.classList.add("cacc-text-invisible");return e}()),e){try{for(var v=o(Object.values(t.molMap)),d=v.next();!d.done;d=v.next()){d.value.removeEvents()}}catch(t){n={error:t}}finally{try{d&&!d.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}t.molMap={}}try{for(var y=o(Object.entries(f)),g=y.next();!g.done;g=y.next()){var m=r(g.value,2),E=m[0],b=m[1];t.molMap[E]||(t.molMap[E]=new c.Container(E,b))}}catch(t){p={error:t}}finally{try{g&&!g.done&&(h=y.return)&&h.call(y)}finally{if(p)throw p.error}}}}(i||(e.Base=i={}))},957(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.NeighbourHood=void 0;var i=n(647),c=n(409),a=n(815),s=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.neighbourhood=[],o}return r(e,t),e.prototype.complete=function(){t.prototype.complete.call(this);for(var e=this.getAnnotation().querySelectorAll("neighbours neighbour"),n=0,o=void 0;o=e[n];n++)this.neighbourhood.push(new a.Neighbour(this,o))},e.prototype.getSpeech=function(){return this.getDiagram().translate(this.getMessage())},e.prototype.getMessage=function(){var t=i.getAttribute(this.getAnnotation(),i.attr.EXPERT_SPEECH),e=i.getAttribute(this.getAnnotation(),i.attr.SIMPLE_SPEECH);return i.EXPERT_MODE?t||e:e||t},e.prototype.getNeighbours=function(){return this.neighbourhood},e}(c.ChemObj);e.NeighbourHood=s},987(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AtomSet=void 0;var c=n(647),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawnElements=function(){var t,e,n=this;if(this.drawnElements)return this.drawnElements;this.drawnElements=[];var o={},r=function(t){o[t.id]||(o[t.id]=!0,n.drawnElements.push(t))},a=this.getDrawnElement();a&&r(a);try{for(var s=i(this.getDown()),l=s.next();!l.done;l=s.next()){(h=l.value).getDrawnElements().forEach(r),(a=h.getDrawnElement())&&r(a)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}for(var u=this.getAnnotation().querySelectorAll("component bond,passive"),p=0;p0)&&!(o=i.next()).done;)c.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return c},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Atom=void 0;var s=n(647),l=function(t){function e(){var e=t.apply(this,c([],i(arguments),!1))||this;return e.speech="",e.links=!1,e}return r(e,t),e.prototype.getSpeech=function(){if(this.link&&this.links)return this.speakLinks();var t=[];this.neighbourhood.forEach(function(e){"external"!==e.location&&t.push(e.getSpeech())});var e=this.getMessage();return this.speech=this.getDiagram().translate(e)+" "+t.join(" "),this.speech},e.prototype.getDrawnElements=function(){if(this.drawnElements)return this.drawnElements;this.drawnElements=[];var t=this.getDrawnElement();t&&this.drawnElements.push(t);for(var e=this.getAnnotation().querySelectorAll("component *"),n=0;n{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.Config=t.Base=void 0;var e=n(322),r=n(887);t.Base=r.Base,t.Config=e.config,t.version=e.version})(),o})());