aldehyde 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1 -0
  3. package/dist/163.js +2 -0
  4. package/dist/163.js.LICENSE.txt +43 -0
  5. package/dist/41.js +1 -0
  6. package/dist/aldehyde.js +2 -0
  7. package/dist/aldehyde.js.LICENSE.txt +122 -0
  8. package/dist/chemstruc-graph.js +1 -0
  9. package/dist/css/163-24392163d3c7b54ea806.css +11 -0
  10. package/dist/css/290-5e8e152675ab7d201c00.css +886 -0
  11. package/dist/css/chemstruc-graph-87868f791bf92fb80db9.css +29 -0
  12. package/dist/css/main-2e6725ec1b56da516cee.css +256 -0
  13. package/dist/html-editor-draft.js +2 -0
  14. package/dist/html-editor-draft.js.LICENSE.txt +5 -0
  15. package/dist/images/logo-06f6a5d8.png +0 -0
  16. package/dist/index.html +4 -0
  17. package/dist/signature.js +2 -0
  18. package/dist/signature.js.LICENSE.txt +17 -0
  19. package/package.json +180 -0
  20. package/src/components/chart/antd/Chart.js +32 -0
  21. package/src/components/chart/antd/Chart10000.js +90 -0
  22. package/src/components/chart/antd/Max2DimLineChart.js +128 -0
  23. package/src/components/chart/antd/PieChart1.js +54 -0
  24. package/src/components/chart/antd/PieChart2.js +56 -0
  25. package/src/components/chart/antd/chart-utils.tsx +50 -0
  26. package/src/components/chart/antd/column-chart-sub.tsx +67 -0
  27. package/src/components/chart/antd/line-chart-sub.tsx +65 -0
  28. package/src/components/chart/antd/pie-chart-sub.tsx +54 -0
  29. package/src/components/chart/antd/statview-d2-chart.tsx +125 -0
  30. package/src/components/chart/statview-l2-chart.tsx +69 -0
  31. package/src/components/controls/action/index.css +9 -0
  32. package/src/components/controls/action/index.tsx +228 -0
  33. package/src/components/controls/action/utils.tsx +122 -0
  34. package/src/components/controls/auto-complete/index.tsx +80 -0
  35. package/src/components/controls/cascader/index.js +97 -0
  36. package/src/components/controls/chemstruc/graph.tsx +150 -0
  37. package/src/components/controls/chemstruc/index.css +28 -0
  38. package/src/components/controls/collapse-card/index.css +9 -0
  39. package/src/components/controls/collapse-card/index.tsx +59 -0
  40. package/src/components/controls/color-picker/index.css +27 -0
  41. package/src/components/controls/color-picker/index.tsx +88 -0
  42. package/src/components/controls/cquery/cquick-button.tsx +117 -0
  43. package/src/components/controls/date-picker/index.tsx +141 -0
  44. package/src/components/controls/entity-select/entity-select.tsx +277 -0
  45. package/src/components/controls/entity-select/index.css +6 -0
  46. package/src/components/controls/entity-select/popover-entity-select.tsx +112 -0
  47. package/src/components/controls/entry-control.tsx +240 -0
  48. package/src/components/controls/enum-badge/index.tsx +28 -0
  49. package/src/components/controls/enum-tag/index.tsx +30 -0
  50. package/src/components/controls/file-view/drawer-file-view.tsx +69 -0
  51. package/src/components/controls/file-view/index.tsx +145 -0
  52. package/src/components/controls/html-editor/draft.tsx +161 -0
  53. package/src/components/controls/html-editor/tinymce.js +55 -0
  54. package/src/components/controls/input-number/index.tsx +101 -0
  55. package/src/components/controls/input-range/index.tsx +48 -0
  56. package/src/components/controls/password-setter/index.css +3 -0
  57. package/src/components/controls/password-setter/index.js +70 -0
  58. package/src/components/controls/progress/index.tsx +61 -0
  59. package/src/components/controls/relation-existion/index.css +4 -0
  60. package/src/components/controls/relation-existion/index.tsx +108 -0
  61. package/src/components/controls/rfield/index.css +4 -0
  62. package/src/components/controls/rfield/index.tsx +161 -0
  63. package/src/components/controls/signature/index.tsx +162 -0
  64. package/src/components/controls/steps/index.tsx +58 -0
  65. package/src/components/controls/text/ellipsis-text.tsx +70 -0
  66. package/src/components/controls/upload/index.tsx +122 -0
  67. package/src/components/controls/view-control.tsx +177 -0
  68. package/src/components/detail/button/cquery-button-bar.tsx +112 -0
  69. package/src/components/detail/button/index.css +43 -0
  70. package/src/components/detail/button/submit-button-bar.tsx +151 -0
  71. package/src/components/detail/dtmpl.css +53 -0
  72. package/src/components/detail/edit/dtmpl-edit.tsx +218 -0
  73. package/src/components/detail/edit/fields-edit-card.tsx +103 -0
  74. package/src/components/detail/edit/modal-dtmpl-edit.tsx +198 -0
  75. package/src/components/detail/edit/modal-row-edit.tsx +72 -0
  76. package/src/components/detail/edit/post-result/index.tsx +52 -0
  77. package/src/components/detail/edit/row-edit-card.tsx +125 -0
  78. package/src/components/detail/edit/row-editor.tsx +71 -0
  79. package/src/components/detail/rightbar/index.css +35 -0
  80. package/src/components/detail/rightbar/index.tsx +76 -0
  81. package/src/components/detail/view/act-dtmpl-view.tsx +155 -0
  82. package/src/components/detail/view/dtmpl-view.tsx +143 -0
  83. package/src/components/detail/view/field-view-group.tsx +73 -0
  84. package/src/components/detail/view/modal-dtmpl-view.tsx +56 -0
  85. package/src/components/detail/view/snapshot-timeline.tsx +130 -0
  86. package/src/components/exportor/export-frame.css +3 -0
  87. package/src/components/exportor/export-frame.tsx +194 -0
  88. package/src/components/exportor/index.tsx +60 -0
  89. package/src/components/form/criteria-form.tsx +241 -0
  90. package/src/components/form/dtmpl-form.css +4 -0
  91. package/src/components/form/dtmpl-form.tsx +272 -0
  92. package/src/components/form/field-group-form.tsx +75 -0
  93. package/src/components/form/fields-form.tsx +51 -0
  94. package/src/components/form/form-Item-group.tsx +99 -0
  95. package/src/components/form/index.css +13 -0
  96. package/src/components/import/excel-import.tsx +316 -0
  97. package/src/components/import/index.css +54 -0
  98. package/src/components/import/template-builder.js +474 -0
  99. package/src/components/import/template.css +51 -0
  100. package/src/components/layout/MainPage.tsx +230 -0
  101. package/src/components/layout/footer/index.css +6 -0
  102. package/src/components/layout/footer/index.js +17 -0
  103. package/src/components/layout/header/index.css +86 -0
  104. package/src/components/layout/header/index.tsx +58 -0
  105. package/src/components/layout/menu/block.tsx +88 -0
  106. package/src/components/layout/menu/l2menu-message-bar.tsx +118 -0
  107. package/src/components/layout/menu/l2menu-quick-bar.tsx +132 -0
  108. package/src/components/layout/menu/menu-2layers.tsx +92 -0
  109. package/src/components/layout/menu/menu-render.tsx +49 -0
  110. package/src/components/layout/menu/reset-password.tsx +185 -0
  111. package/src/components/layout/menu/user-bar.tsx +97 -0
  112. package/src/components/layout/menu/userinfo-bar.tsx +70 -0
  113. package/src/components/layout/sidebar/index.css +26 -0
  114. package/src/components/layout/sidebar/index.tsx +38 -0
  115. package/src/components/login.js +137 -0
  116. package/src/components/module/criteria-page.tsx +175 -0
  117. package/src/components/module/dtmpl-page.tsx +70 -0
  118. package/src/components/module/ltmpl-page.tsx +181 -0
  119. package/src/components/routable/dtmpl-route.tsx +96 -0
  120. package/src/components/routable/import-route.tsx +28 -0
  121. package/src/components/routable/ltmpl-route.tsx +158 -0
  122. package/src/components/table/act-table.tsx +635 -0
  123. package/src/components/table/column/column-selector.tsx +79 -0
  124. package/src/components/table/column/index.css +14 -0
  125. package/src/components/table/index.css +45 -0
  126. package/src/components/table/l2-act-table.tsx +85 -0
  127. package/src/components/table/modal-select-table.tsx +248 -0
  128. package/src/components/table/pagination.css +15 -0
  129. package/src/components/table/pagination.tsx +72 -0
  130. package/src/components/table/query-table.tsx +331 -0
  131. package/src/components/table/relation-table.tsx +600 -0
  132. package/src/components/table/select-table.tsx +247 -0
  133. package/src/components/table/selected-rows-card.tsx +62 -0
  134. package/src/components/table/stat/restat.tsx +79 -0
  135. package/src/components/table/table-util.tsx +33 -0
  136. package/src/components/tmpl/control-type-supportor.tsx +97 -0
  137. package/src/components/tmpl/hc-data-source.tsx +230 -0
  138. package/src/components/tmpl/hcservice-v3.tsx +624 -0
  139. package/src/components/tmpl/interface.tsx +308 -0
  140. package/src/components/tmpl/superagent.js +93 -0
  141. package/src/components/tmpl/tmpl-config-analysis.tsx +111 -0
  142. package/src/components/units/EncryptUtils.js +38 -0
  143. package/src/components/units/image.d.ts +8 -0
  144. package/src/components/units/index.tsx +536 -0
  145. package/src/components/units/logo.png +0 -0
  146. package/src/components/units/storage.js +3 -0
  147. package/src/components/welcome/HCWelcome.js +232 -0
  148. package/src/components/welcome/index.css +13 -0
  149. package/src/components/welcome/logo.png +0 -0
  150. package/src/components/welcome/quick-entrance.tsx +77 -0
  151. package/src/components/welcome/workbench.tsx +76 -0
  152. package/src/index.js +4 -0
  153. package/src/style/common.css +79 -0
  154. package/src/style/coverstyle.css +49 -0
  155. package/src/style/transstyle.css +24 -0
  156. package/tsconfig.json +106 -0
package/dist/163.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 163.js.LICENSE.txt */
2
+ (self.webpackChunkaldehyde=self.webpackChunkaldehyde||[]).push([[163],{48965:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),o=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 01-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0165.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"}}]},name:"deployment-unit",theme:"outlined"},a=n(41390),s=function(t,e){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:i}))};s.displayName="DeploymentUnitOutlined";var u=o.forwardRef(s)},86254:function(t,e,n){"use strict";n.r(e),n.d(e,{ResizeObserver:function(){return z},ResizeObserverEntry:function(){return E},ResizeObserverSize:function(){return u}});var r,o=[],i="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(r||(r={}));var a,s=function(t){return Object.freeze(t)},u=function(t,e){this.inlineSize=t,this.blockSize=e,s(this)},c=function(){function t(t,e,n,r){return this.x=t,this.y=e,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,s(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),l=function(t){return t instanceof SVGElement&&"getBBox"in t},f=function(t){if(l(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},h=function(t){var e,n;if(t instanceof Element)return!0;var r=null===(n=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&t instanceof r.Element)},d="undefined"!=typeof window?window:{},p=new WeakMap,v=/auto|scroll/,m=/^tb|vertical/,g=/msie|trident/i.test(d.navigator&&d.navigator.userAgent),y=function(t){return parseFloat(t||"0")},b=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new u((n?e:t)||0,(n?t:e)||0)},w=s({devicePixelContentBoxSize:b(),borderBoxSize:b(),contentBoxSize:b(),contentRect:new c(0,0,0,0)}),x=function(t,e){if(void 0===e&&(e=!1),p.has(t)&&!e)return p.get(t);if(f(t))return p.set(t,w),w;var n=getComputedStyle(t),r=l(t)&&t.ownerSVGElement&&t.getBBox(),o=!g&&"border-box"===n.boxSizing,i=m.test(n.writingMode||""),a=!r&&v.test(n.overflowY||""),u=!r&&v.test(n.overflowX||""),h=r?0:y(n.paddingTop),d=r?0:y(n.paddingRight),x=r?0:y(n.paddingBottom),O=r?0:y(n.paddingLeft),E=r?0:y(n.borderTopWidth),_=r?0:y(n.borderRightWidth),S=r?0:y(n.borderBottomWidth),j=O+d,A=h+x,P=(r?0:y(n.borderLeftWidth))+_,k=E+S,T=u?t.offsetHeight-k-t.clientHeight:0,C=a?t.offsetWidth-P-t.clientWidth:0,R=o?j+P:0,M=o?A+k:0,I=r?r.width:y(n.width)-R-C,N=r?r.height:y(n.height)-M-T,B=I+j+C+P,Z=N+A+T+k,L=s({devicePixelContentBoxSize:b(Math.round(I*devicePixelRatio),Math.round(N*devicePixelRatio),i),borderBoxSize:b(B,Z,i),contentBoxSize:b(I,N,i),contentRect:new c(O,h,I,N)});return p.set(t,L),L},O=function(t,e,n){var o=x(t,n),i=o.borderBoxSize,a=o.contentBoxSize,s=o.devicePixelContentBoxSize;switch(e){case r.DEVICE_PIXEL_CONTENT_BOX:return s;case r.BORDER_BOX:return i;default:return a}},E=function(t){var e=x(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=s([e.borderBoxSize]),this.contentBoxSize=s([e.contentBoxSize]),this.devicePixelContentBoxSize=s([e.devicePixelContentBoxSize])},_=function(t){if(f(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},S=function(){var t=1/0,e=[];o.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(e){var n=new E(e.target),o=_(e.target);r.push(n),e.lastReportedSize=O(e.target,e.observedBox),o<t&&(t=o)})),e.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=e;n<r.length;n++)(0,r[n])();return t},j=function(t){o.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(_(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},A=[],P=0,k={attributes:!0,characterData:!0,childList:!0,subtree:!0},T=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],C=function(t){return void 0===t&&(t=0),Date.now()+t},R=!1,M=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!R){R=!0;var n,r=C(t);n=function(){var n=!1;try{n=function(){var t,e=0;for(j(e);o.some((function(t){return t.activeTargets.length>0}));)e=S(),j(e);return o.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:i}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=i),window.dispatchEvent(t)),e>0}()}finally{if(R=!1,t=r-C(),!P)return;n?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!a){var e=0,n=document.createTextNode("");new MutationObserver((function(){return A.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),a=function(){n.textContent=""+(e?e--:e++)}}A.push(t),a()}((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,k)};document.body?e():d.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),T.forEach((function(e){return d.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),T.forEach((function(e){return d.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),I=function(t){!P&&t>0&&M.start(),!(P+=t)&&M.stop()},N=function(){function t(t,e){this.target=t,this.observedBox=e||r.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=O(this.target,this.observedBox,!0);return t=this.target,l(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),B=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Z=new WeakMap,L=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},D=function(){function t(){}return t.connect=function(t,e){var n=new B(t,e);Z.set(t,n)},t.observe=function(t,e,n){var r=Z.get(t),i=0===r.observationTargets.length;L(r.observationTargets,e)<0&&(i&&o.push(r),r.observationTargets.push(new N(e,n&&n.box)),I(1),M.schedule())},t.unobserve=function(t,e){var n=Z.get(t),r=L(n.observationTargets,e),i=1===n.observationTargets.length;r>=0&&(i&&o.splice(o.indexOf(n),1),n.observationTargets.splice(r,1),I(-1))},t.disconnect=function(t){var e=this,n=Z.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),z=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");D.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!h(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");D.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!h(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");D.unobserve(this,t)},t.prototype.disconnect=function(){D.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}()},69282:function(t,e,n){"use strict";function r(t){return r="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},r(t)}var o,i,a=n(62136).codes,s=a.ERR_AMBIGUOUS_ARGUMENT,u=a.ERR_INVALID_ARG_TYPE,c=a.ERR_INVALID_ARG_VALUE,l=a.ERR_INVALID_RETURN_VALUE,f=a.ERR_MISSING_ARGS,h=n(25961),d=n(89539).inspect,p=n(89539).types,v=p.isPromise,m=p.isRegExp,g=Object.assign?Object.assign:n(8091).assign,y=Object.is?Object.is:n(20609);function b(){var t=n(19158);o=t.isDeepEqual,i=t.isDeepStrictEqual}new Map;var w=!1,x=t.exports=S,O={};function E(t){if(t.message instanceof Error)throw t.message;throw new h(t)}function _(t,e,n,r){if(!n){var o=!1;if(0===e)o=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var i=new h({actual:n,expected:!0,message:r,operator:"==",stackStartFn:t});throw i.generatedMessage=o,i}}function S(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];_.apply(void 0,[S,e.length].concat(e))}x.fail=function t(e,n,r,o,i){var a,s=arguments.length;if(0===s)a="Failed";else if(1===s)r=e,e=void 0;else{if(!1===w){w=!0;var u={env:{}}.emitWarning?{env:{}}.emitWarning:console.warn.bind(console);u("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===s&&(o="!=")}if(r instanceof Error)throw r;var c={actual:e,expected:n,operator:void 0===o?"fail":o,stackStartFn:i||t};void 0!==r&&(c.message=r);var l=new h(c);throw a&&(l.message=a,l.generatedMessage=!0),l},x.AssertionError=h,x.ok=S,x.equal=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");e!=n&&E({actual:e,expected:n,message:r,operator:"==",stackStartFn:t})},x.notEqual=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");e==n&&E({actual:e,expected:n,message:r,operator:"!=",stackStartFn:t})},x.deepEqual=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&b(),o(e,n)||E({actual:e,expected:n,message:r,operator:"deepEqual",stackStartFn:t})},x.notDeepEqual=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&b(),o(e,n)&&E({actual:e,expected:n,message:r,operator:"notDeepEqual",stackStartFn:t})},x.deepStrictEqual=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&b(),i(e,n)||E({actual:e,expected:n,message:r,operator:"deepStrictEqual",stackStartFn:t})},x.notDeepStrictEqual=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&b(),i(e,n)&&E({actual:e,expected:n,message:r,operator:"notDeepStrictEqual",stackStartFn:t})},x.strictEqual=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");y(e,n)||E({actual:e,expected:n,message:r,operator:"strictEqual",stackStartFn:t})},x.notStrictEqual=function t(e,n,r){if(arguments.length<2)throw new f("actual","expected");y(e,n)&&E({actual:e,expected:n,message:r,operator:"notStrictEqual",stackStartFn:t})};var j=function t(e,n,r){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n.forEach((function(t){t in e&&(void 0!==r&&"string"==typeof r[t]&&m(e[t])&&e[t].test(r[t])?o[t]=r[t]:o[t]=e[t])}))};function A(t,e,n,r,o,a){if(!(n in t)||!i(t[n],e[n])){if(!r){var s=new j(t,o),u=new j(e,o,t),c=new h({actual:s,expected:u,operator:"deepStrictEqual",stackStartFn:a});throw c.actual=t,c.expected=e,c.operator=a.name,c}E({actual:t,expected:e,message:r,operator:a.name,stackStartFn:a})}}function P(t,e,n,i){if("function"!=typeof e){if(m(e))return e.test(t);if(2===arguments.length)throw new u("expected",["Function","RegExp"],e);if("object"!==r(t)||null===t){var a=new h({actual:t,expected:e,message:n,operator:"deepStrictEqual",stackStartFn:i});throw a.operator=i.name,a}var s=Object.keys(e);if(e instanceof Error)s.push("name","message");else if(0===s.length)throw new c("error",e,"may not be an empty object");return void 0===o&&b(),s.forEach((function(r){"string"==typeof t[r]&&m(e[r])&&e[r].test(t[r])||A(t,e,r,n,s,i)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function k(t){if("function"!=typeof t)throw new u("fn","Function",t);try{t()}catch(t){return t}return O}function T(t){return v(t)||null!==t&&"object"===r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function C(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!T(e=t()))throw new l("instance of Promise","promiseFn",e)}else{if(!T(t))throw new u("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return O})).catch((function(t){return t}))}))}function R(t,e,n,o){if("string"==typeof n){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],n);if("object"===r(e)&&null!==e){if(e.message===n)throw new s("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===n)throw new s("error/message",'The error "'.concat(e,'" is identical to the message.'));o=n,n=void 0}else if(null!=n&&"object"!==r(n)&&"function"!=typeof n)throw new u("error",["Object","Error","Function","RegExp"],n);if(e===O){var i="";n&&n.name&&(i+=" (".concat(n.name,")")),i+=o?": ".concat(o):".";var a="rejects"===t.name?"rejection":"exception";E({actual:void 0,expected:n,operator:t.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:t})}if(n&&!P(e,n,o,t))throw e}function M(t,e,n,r){if(e!==O){if("string"==typeof n&&(r=n,n=void 0),!n||P(e,n)){var o=r?": ".concat(r):".",i="doesNotReject"===t.name?"rejection":"exception";E({actual:e,expected:n,operator:t.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function I(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];_.apply(void 0,[I,e.length].concat(e))}x.throws=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];R.apply(void 0,[t,k(e)].concat(r))},x.rejects=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return C(e).then((function(e){return R.apply(void 0,[t,e].concat(r))}))},x.doesNotThrow=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];M.apply(void 0,[t,k(e)].concat(r))},x.doesNotReject=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return C(e).then((function(e){return M.apply(void 0,[t,e].concat(r))}))},x.ifError=function t(e){if(null!=e){var n="ifError got unwanted exception: ";"object"===r(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?n+=e.constructor.name:n+=e.message:n+=d(e);var o=new h({actual:e,expected:null,operator:"ifError",message:n,stackStartFn:t}),i=e.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=o.stack.split("\n"),u=0;u<a.length;u++){var c=s.indexOf(a[u]);if(-1!==c){s=s.slice(0,c);break}}o.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw o}},x.strict=g(I,x,{equal:x.strictEqual,deepEqual:x.deepStrictEqual,notEqual:x.notStrictEqual,notDeepEqual:x.notDeepStrictEqual}),x.strict.strict=x.strict},25961:function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?a(t):e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t){var e="function"==typeof Map?new Map:void 0;return s=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return c(t,arguments,f(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)},s(t)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function c(t,e,n){return c=u()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&l(o,n.prototype),o},c.apply(null,arguments)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function h(t){return h="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},h(t)}var d=n(89539).inspect,p=n(62136).codes.ERR_INVALID_ARG_TYPE;function v(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}var m="",g="",y="",b="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function x(t){var e=Object.keys(t),n=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){n[e]=t[e]})),Object.defineProperty(n,"message",{value:t.message}),n}function O(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var E=function(t){function e(t){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==h(t)||null===t)throw new p("options","Object",t);var r=t.message,o=t.operator,s=t.stackStartFn,u=t.actual,c=t.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)n=i(this,f(e).call(this,String(r)));else if({env:{}}.stderr&&{env:{}}.stderr.isTTY&&({env:{}}.stderr&&{env:{}}.stderr.getColorDepth&&1!=={env:{}}.stderr.getColorDepth()?(m="",g="",b="",y=""):(m="",g="",b="",y="")),"object"===h(u)&&null!==u&&"object"===h(c)&&null!==c&&"stack"in u&&u instanceof Error&&"stack"in c&&c instanceof Error&&(u=x(u),c=x(c)),"deepStrictEqual"===o||"strictEqual"===o)n=i(this,f(e).call(this,function(t,e,n){var r="",o="",i=0,a="",s=!1,u=O(t),c=u.split("\n"),l=O(e).split("\n"),f=0,d="";if("strictEqual"===n&&"object"===h(t)&&"object"===h(e)&&null!==t&&null!==e&&(n="strictEqualObject"),1===c.length&&1===l.length&&c[0]!==l[0]){var p=c[0].length+l[0].length;if(p<=10){if(!("object"===h(t)&&null!==t||"object"===h(e)&&null!==e||0===t&&0===e))return"".concat(w[n],"\n\n")+"".concat(c[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==n&&p<({env:{}}.stderr&&{env:{}}.stderr.isTTY?{env:{}}.stderr.columns:80)){for(;c[0][f]===l[0][f];)f++;f>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var n=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,n-t.length)}(" ",f),"^"),f=0)}}for(var x=c[c.length-1],E=l[l.length-1];x===E&&(f++<2?a="\n ".concat(x).concat(a):r=x,c.pop(),l.pop(),0!==c.length&&0!==l.length);)x=c[c.length-1],E=l[l.length-1];var _=Math.max(c.length,l.length);if(0===_){var S=u.split("\n");if(S.length>30)for(S[26]="".concat(m,"...").concat(b);S.length>27;)S.pop();return"".concat(w.notIdentical,"\n\n").concat(S.join("\n"),"\n")}f>3&&(a="\n".concat(m,"...").concat(b).concat(a),s=!0),""!==r&&(a="\n ".concat(r).concat(a),r="");var j=0,A=w[n]+"\n".concat(g,"+ actual").concat(b," ").concat(y,"- expected").concat(b),P=" ".concat(m,"...").concat(b," Lines skipped");for(f=0;f<_;f++){var k=f-i;if(c.length<f+1)k>1&&f>2&&(k>4?(o+="\n".concat(m,"...").concat(b),s=!0):k>3&&(o+="\n ".concat(l[f-2]),j++),o+="\n ".concat(l[f-1]),j++),i=f,r+="\n".concat(y,"-").concat(b," ").concat(l[f]),j++;else if(l.length<f+1)k>1&&f>2&&(k>4?(o+="\n".concat(m,"...").concat(b),s=!0):k>3&&(o+="\n ".concat(c[f-2]),j++),o+="\n ".concat(c[f-1]),j++),i=f,o+="\n".concat(g,"+").concat(b," ").concat(c[f]),j++;else{var T=l[f],C=c[f],R=C!==T&&(!v(C,",")||C.slice(0,-1)!==T);R&&v(T,",")&&T.slice(0,-1)===C&&(R=!1,C+=","),R?(k>1&&f>2&&(k>4?(o+="\n".concat(m,"...").concat(b),s=!0):k>3&&(o+="\n ".concat(c[f-2]),j++),o+="\n ".concat(c[f-1]),j++),i=f,o+="\n".concat(g,"+").concat(b," ").concat(C),r+="\n".concat(y,"-").concat(b," ").concat(T),j+=2):(o+=r,r="",1!==k&&0!==f||(o+="\n ".concat(C),j++))}if(j>20&&f<_-2)return"".concat(A).concat(P,"\n").concat(o,"\n").concat(m,"...").concat(b).concat(r,"\n")+"".concat(m,"...").concat(b)}return"".concat(A).concat(s?P:"","\n").concat(o).concat(r).concat(a).concat(d)}(u,c,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var d=w[o],E=O(u).split("\n");if("notStrictEqual"===o&&"object"===h(u)&&null!==u&&(d=w.notStrictEqualObject),E.length>30)for(E[26]="".concat(m,"...").concat(b);E.length>27;)E.pop();n=1===E.length?i(this,f(e).call(this,"".concat(d," ").concat(E[0]))):i(this,f(e).call(this,"".concat(d,"\n\n").concat(E.join("\n"),"\n")))}else{var _=O(u),S="",j=w[o];"notDeepEqual"===o||"notEqual"===o?(_="".concat(w[o],"\n\n").concat(_)).length>1024&&(_="".concat(_.slice(0,1021),"...")):(S="".concat(O(c)),_.length>512&&(_="".concat(_.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===o||"equal"===o?_="".concat(j,"\n\n").concat(_,"\n\nshould equal\n\n"):S=" ".concat(o," ").concat(S)),n=i(this,f(e).call(this,"".concat(_).concat(S)))}return Error.stackTraceLimit=l,n.generatedMessage=!r,Object.defineProperty(a(n),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),n.code="ERR_ASSERTION",n.actual=u,n.expected=c,n.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(n),s),n.stack,n.name="AssertionError",i(n)}var n,s;return 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&&l(t,e)}(e,t),n=e,s=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:d.custom,value:function(t,e){return d(this,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),o.forEach((function(e){r(t,e,n[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],s&&o(n.prototype,s),e}(s(Error));t.exports=E},62136:function(t,e,n){"use strict";function r(t){return r="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},r(t)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}var a,s,u={};function c(t,e,n){n||(n=Error);var a=function(n){function a(n,i,s){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),u=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,o(a).call(this,function(t,n,r){return"string"==typeof e?e:e(t,n,r)}(n,i,s))),u.code=t,u}return 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&&i(t,e)}(a,n),a}(n);u[t]=a}function l(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(t,e,o){var i,s,u,c,f;if(void 0===a&&(a=n(69282)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(0,s.length)===s)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))u="The ".concat(t," ").concat(i," ").concat(l(e,"type"));else{var h=("number"!=typeof f&&(f=0),f+".".length>(c=t).length||-1===c.indexOf(".",f)?"argument":"property");u='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(l(e,"type"))}return u+". Received type ".concat(r(o))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=n(89539));var o=s.inspect(e);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(o)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(t,e,n){var o;return o=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(o,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];void 0===a&&(a=n(69282)),a(e.length>0,"At least one arg needs to be specified");var o="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:o+="".concat(e[0]," argument");break;case 2:o+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:o+=e.slice(0,i-1).join(", "),o+=", and ".concat(e[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),t.exports.codes=u},19158:function(t,e,n){"use strict";function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return o="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},o(t)}var i=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},s=function(t){var e=[];return t.forEach((function(t,n){return e.push([n,t])})),e},u=Object.is?Object.is:n(20609),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:n(20360);function f(t){return t.call.bind(t)}var h=f(Object.prototype.hasOwnProperty),d=f(Object.prototype.propertyIsEnumerable),p=f(Object.prototype.toString),v=n(89539).types,m=v.isAnyArrayBuffer,g=v.isArrayBufferView,y=v.isDate,b=v.isMap,w=v.isRegExp,x=v.isSet,O=v.isNativeError,E=v.isBoxedPrimitive,_=v.isNumberObject,S=v.isStringObject,j=v.isBooleanObject,A=v.isBigIntObject,P=v.isSymbolObject,k=v.isFloat32Array,T=v.isFloat64Array;function C(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var n=t.charCodeAt(e);if(n<48||n>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function R(t){return Object.keys(t).filter(C).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function M(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0}function I(t,e,n,r){if(t===e)return 0!==t||!n||u(t,e);if(n){if("object"!==o(t))return"number"==typeof t&&l(t)&&l(e);if("object"!==o(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==o(t))return(null===e||"object"!==o(e))&&t==e;if(null===e||"object"!==o(e))return!1}var a,s,c,f,h=p(t);if(h!==p(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var d=R(t),v=R(e);return d.length===v.length&&B(t,e,n,r,1,d)}if("[object Object]"===h&&(!b(t)&&b(e)||!x(t)&&x(e)))return!1;if(y(t)){if(!y(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(c=t,f=e,!(i?c.source===f.source&&c.flags===f.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(f))))return!1}else if(O(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(g(t)){if(n||!k(t)&&!T(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===M(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var n=0;n<t.byteLength;n++)if(t[n]!==e[n])return!1;return!0}(t,e))return!1;var C=R(t),I=R(e);return C.length===I.length&&B(t,e,n,r,0,C)}if(x(t))return!(!x(e)||t.size!==e.size)&&B(t,e,n,r,2);if(b(t))return!(!b(e)||t.size!==e.size)&&B(t,e,n,r,3);if(m(t)){if(s=e,(a=t).byteLength!==s.byteLength||0!==M(new Uint8Array(a),new Uint8Array(s)))return!1}else if(E(t)&&!function(t,e){return _(t)?_(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):S(t)?S(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):j(t)?j(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):A(t)?A(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):P(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return B(t,e,n,r,0)}function N(t,e){return e.filter((function(e){return d(t,e)}))}function B(t,e,n,r,o,i){if(5===arguments.length){i=Object.keys(t);var a=Object.keys(e);if(i.length!==a.length)return!1}for(var s=0;s<i.length;s++)if(!h(e,i[s]))return!1;if(n&&5===arguments.length){var u=c(t);if(0!==u.length){var l=0;for(s=0;s<u.length;s++){var f=u[s];if(d(t,f)){if(!d(e,f))return!1;i.push(f),l++}else if(d(e,f))return!1}var p=c(e);if(u.length!==p.length&&N(e,p).length!==l)return!1}else{var v=c(e);if(0!==v.length&&0!==N(e,v).length)return!1}}if(0===i.length&&(0===o||1===o&&0===t.length||0===t.size))return!0;if(void 0===r)r={val1:new Map,val2:new Map,position:0};else{var m=r.val1.get(t);if(void 0!==m){var g=r.val2.get(e);if(void 0!==g)return m===g}r.position++}r.val1.set(t,r.position),r.val2.set(e,r.position);var y=G(t,e,n,i,r,o);return r.val1.delete(t),r.val2.delete(e),y}function Z(t,e,n,r){for(var o=a(t),i=0;i<o.length;i++){var s=o[i];if(I(e,s,n,r))return t.delete(s),!0}return!1}function L(t){switch(o(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function D(t,e,n){var r=L(n);return null!=r?r:e.has(r)&&!t.has(r)}function z(t,e,n,r,o){var i=L(n);if(null!=i)return i;var a=e.get(i);return!(void 0===a&&!e.has(i)||!I(r,a,!1,o))&&!t.has(i)&&I(r,a,!1,o)}function F(t,e,n,r,o,i){for(var s=a(t),u=0;u<s.length;u++){var c=s[u];if(I(n,c,o,i)&&I(r,e.get(c),o,i))return t.delete(c),!0}return!1}function G(t,e,n,i,u,c){var l=0;if(2===c){if(!function(t,e,n,r){for(var i=null,s=a(t),u=0;u<s.length;u++){var c=s[u];if("object"===o(c)&&null!==c)null===i&&(i=new Set),i.add(c);else if(!e.has(c)){if(n)return!1;if(!D(t,e,c))return!1;null===i&&(i=new Set),i.add(c)}}if(null!==i){for(var l=a(e),f=0;f<l.length;f++){var h=l[f];if("object"===o(h)&&null!==h){if(!Z(i,h,n,r))return!1}else if(!n&&!t.has(h)&&!Z(i,h,n,r))return!1}return 0===i.size}return!0}(t,e,n,u))return!1}else if(3===c){if(!function(t,e,n,i){for(var a=null,u=s(t),c=0;c<u.length;c++){var l=r(u[c],2),f=l[0],h=l[1];if("object"===o(f)&&null!==f)null===a&&(a=new Set),a.add(f);else{var d=e.get(f);if(void 0===d&&!e.has(f)||!I(h,d,n,i)){if(n)return!1;if(!z(t,e,f,h,i))return!1;null===a&&(a=new Set),a.add(f)}}}if(null!==a){for(var p=s(e),v=0;v<p.length;v++){var m=r(p[v],2),g=(f=m[0],m[1]);if("object"===o(f)&&null!==f){if(!F(a,t,f,g,n,i))return!1}else if(!(n||t.has(f)&&I(t.get(f),g,!1,i)||F(a,t,f,g,!1,i)))return!1}return 0===a.size}return!0}(t,e,n,u))return!1}else if(1===c)for(;l<t.length;l++){if(!h(t,l)){if(h(e,l))return!1;for(var f=Object.keys(t);l<f.length;l++){var d=f[l];if(!h(e,d)||!I(t[d],e[d],n,u))return!1}return f.length===Object.keys(e).length}if(!h(e,l)||!I(t[l],e[l],n,u))return!1}for(l=0;l<i.length;l++){var p=i[l];if(!I(t[p],e[p],n,u))return!1}return!0}t.exports={isDeepEqual:function(t,e){return I(t,e,!1)},isDeepStrictEqual:function(t,e){return I(t,e,!0)}}},21924:function(t,e,n){"use strict";var r=n(40210),o=n(55559),i=o(r("String.prototype.indexOf"));t.exports=function(t,e){var n=r(t,!!e);return"function"==typeof n&&i(t,".prototype.")>-1?o(n):n}},55559:function(t,e,n){"use strict";var r=n(58612),o=n(40210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(r,a,arguments);if(u&&c){var n=u(e,"length");n.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return s(r,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},4289:function(t,e,n){"use strict";var r=n(82215),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=n(31044)(),c=s&&u,l=function(t,e,n,r){var o;(!(e in t)||"function"==typeof(o=r)&&"[object Function]"===i.call(o)&&r())&&(c?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},f=function(t,e){var n=arguments.length>2?arguments[2]:{},i=r(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s<i.length;s+=1)l(t,i[s],e[i[s]],n[i[s]])};f.supportsDescriptors=!!c,t.exports=f},23106:function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(37163),i=n(43393),a=u(n(76884)),s=u(n(47044));function u(t){return t&&t.__esModule?t:{default:t}}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l="CUSTOM_",f=function(t,e){return(n=h(t),function(t){var e=t.getCurrentContent(),r=t.getSelection(),o=e.getBlockMap(),a=r.getStartKey(),s=r.getStartOffset(),u=r.getEndKey(),c=r.getEndOffset(),l=o.skipUntil((function(t,e){return e===a})).takeUntil((function(t,e){return e===u})).concat((0,i.Map)([[u,o.get(u)]])).map((function(t,e){var r=void 0,o=void 0;a===u?(r=s,o=c):(r=e===a?s:0,o=e===u?c:t.getLength());for(var i=t.getCharacterList(),l=void 0;r<o;){l=i.get(r);var f=n(l);i=i.set(r,f),r++}return t.set("characterList",i)}));return e.merge({blockMap:o.merge(l),selectionBefore:r,selectionAfter:r})})(e);var n},h=function(t){return function(e){var n=e.get("style").filter((function(e){return!e.startsWith(t)}));return e.set("style",n)}},d=function(t){return function(e,n){var r=t+n,i=o.Modifier.applyInlineStyle(f(t,e),e.getSelection(),r);return e.getSelection().isCollapsed()?m(t,r,e):o.EditorState.push(e,i,"change-inline-style")}},p=function(t){return function(e){return o.EditorState.push(e,f(t,e),"change-inline-style")}},v=function(t,e){return e.filter((function(e){return!e.startsWith(t)}))},m=function(t,e,n){var r=n.getCurrentInlineStyle(),i=v(t,r);return o.EditorState.setInlineStyleOverride(n,i.add(e))},g=function(t){return function(e,n){var r=t+n,i=e.getCurrentInlineStyle();if(e.getSelection().isCollapsed())return function(t,e,n){var r=n.getCurrentInlineStyle(),i=v(t,r),a=r.has(e)?i.remove(e):i.add(e);return o.EditorState.setInlineStyleOverride(n,a)}(t,r,e);if(!i.has(r))return d(t)(e,n);var a=o.EditorState.push(e,f(t,e),"change-inline-style");return o.EditorState.forceSelection(a,e.getSelection())}},y=function(t,e){return function(n){if(!n.size)return{};var r=n.filter((function(e){return e.startsWith(t)})).first();if(r){var o=r.replace(t,"");return c({},(0,a.default)(e),o)}return{}}},b=function(t){return function(e){var n=e.getCurrentInlineStyle();if(!n.size)return"";var r=n.filter((function(e){return e.startsWith(t)})).first();return r?r.replace(t,""):r}},w=function(t,e){return e.reduce((function(e,n){var o=(0,a.default)(n),i=""+t+(0,s.default)(n).toUpperCase()+"_",u=r({},e);return u[o]={add:d(i),remove:p(i),toggle:g(i),current:b(i),styleFn:y(i,n)},u}),{})},x=function(t){return function(e){return t.reduce((function(t,n){return r({},t,n(e))}),{})}},O=function(t,e){var n=e.inlineStyleRanges;if(n&&n.length){var r=n.map((function(t){return t.style}));return t.concat(r)}return t},E=function(t,e){return function(n){var r=(0,o.convertToRaw)(n.getCurrentContent()).blocks.reduce(O,[]);return r.length?r.reduce(function(t,e){return function(n,r){if(o.DefaultDraftInlineStyle[r])return Object.assign({},n,c({},r,{style:o.DefaultDraftInlineStyle[r]}));if(e[r])return Object.assign({},n,c({},r,{style:e[r]}));var i=new RegExp(t+"(.+)_(.+)"),s=r.match(i);if(!s||!s[1]||!s[2])return n;var u=s[1].toLowerCase(),l=s[2],f=c({},r,{style:c({},(0,a.default)(u),l)});return Object.assign({},n,f)}}(t,e),{}):{}}},_=function(t){return"string"==typeof t&&t.length?t.match(/.+_$/)?t:t+"_":l};e.ZP=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return console.log("Expecting an array with css properties"),{styles:{}};if(!Array.isArray(t)||!t.length)return console.log("createStyles expects first parameter to be an array with css properties"),{styles:{}};var r=_(e),o=w(r,t),i=Object.keys(o).map((function(t){return o[t].styleFn})),a=x(i),s=E(r,n);return{styles:o,customStyleFn:a,exporter:s}}},10232:function(){"undefined"!=typeof Element&&(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}))},8091:function(t){"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var n=Object(t),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var i=Object.keys(Object(o)),a=0,s=i.length;a<s;a++){var u=i[a],c=Object.getOwnPropertyDescriptor(o,u);void 0!==c&&c.enumerable&&(n[u]=o[u])}}return n}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},93162:function(t,e,n){var r;void 0===(r=function(){"use strict";function e(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){s(r.response,e,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function o(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(t,n,a){var s=i.URL||i.webkitURL,u=document.createElement("a");n=n||t.name||"download",u.download=n,u.rel="noopener","string"==typeof t?(u.href=t,u.origin===location.origin?o(u):r(u.href)?e(t,n,a):o(u,u.target="_blank")):(u.href=s.createObjectURL(t),setTimeout((function(){s.revokeObjectURL(u.href)}),4e4),setTimeout((function(){o(u)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,i){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,i),n);else if(r(t))e(t,n,i);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout((function(){o(a)}))}}:function(t,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,r);var s="application/octet-stream"===t.type,u=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&u||a)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var t=l.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},l.readAsDataURL(t)}else{var f=i.URL||i.webkitURL,h=f.createObjectURL(t);o?o.location=h:location.href=h,o=null,setTimeout((function(){f.revokeObjectURL(h)}),4e4)}});i.saveAs=s.saveAs=s,t.exports=s}.apply(e,[]))||(t.exports=r)},98346:function(t){var e={task:void 0,next:null},n=e,r=!1,o=void 0,i=!1;function a(){for(;e.next;){var t=(e=e.next).task;e.task=void 0;var n=e.domain;n&&(e.domain=void 0,n.enter());try{t()}catch(t){if(i)throw n&&n.exit(),setTimeout(a,0),n&&n.enter(),t;setTimeout((function(){throw t}),0)}n&&n.exit()}r=!1}if({env:{}}.nextTick)i=!0,o=function(){({env:{}}).nextTick(a)};else if("function"==typeof setImmediate)o="undefined"!=typeof window?setImmediate.bind(window,a):function(){setImmediate(a)};else if("undefined"!=typeof MessageChannel){var s=new MessageChannel;s.port1.onmessage=a,o=function(){s.port2.postMessage(0)}}else o=function(){setTimeout(a,0)};t.exports=function(t){n=n.next={task:t,domain:i&&{env:{}}.domain,next:null},r||(r=!0,o())}},15223:function(t,e,n){"use strict";t.exports=n(8859),n(9134),n(922),n(350)},8859:function(t,e,n){"use strict";var r=n(98346);function o(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function i(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}t.exports=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");var e=null,n=null,a=[],s=this;function u(t){null!==e?r((function(){var r=e?t.onFulfilled:t.onRejected;if(null!==r){var o;try{o=r(n)}catch(e){return void t.reject(e)}t.resolve(o)}else(e?t.resolve:t.reject)(n)})):a.push(t)}function c(t){e=!1,n=t,l()}function l(){for(var t=0,e=a.length;t<e;t++)u(a[t]);a=null}this.then=function(t,e){return new s.constructor((function(n,r){u(new o(t,e,n,r))}))},i(t,(function t(r){try{if(r===s)throw new TypeError("A promise cannot be resolved with itself.");if(r&&("object"==typeof r||"function"==typeof r)){var o=r.then;if("function"==typeof o)return void i(o.bind(r),t,c)}e=!0,n=r,l()}catch(t){c(t)}}),c)}},9134:function(t,e,n){"use strict";var r=n(8859),o=n(98346);t.exports=r,r.prototype.done=function(t,e){var n=arguments.length?this.then.apply(this,arguments):this;n.then(null,(function(t){o((function(){throw t}))}))}},922:function(t,e,n){"use strict";var r=n(8859),o=n(98346);function i(t){this.then=function(e){return"function"!=typeof e?this:new r((function(n,r){o((function(){try{n(e(t))}catch(t){r(t)}}))}))}}t.exports=r,i.prototype=r.prototype;var a=new i(!0),s=new i(!1),u=new i(null),c=new i(void 0),l=new i(0),f=new i("");r.resolve=function(t){if(t instanceof r)return t;if(null===t)return u;if(void 0===t)return c;if(!0===t)return a;if(!1===t)return s;if(0===t)return l;if(""===t)return f;if("object"==typeof t||"function"==typeof t)try{var e=t.then;if("function"==typeof e)return new r(e.bind(t))}catch(t){return new r((function(e,n){n(t)}))}return new i(t)},r.all=function(t){var e=Array.prototype.slice.call(t);return new r((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},r.reject=function(t){return new r((function(e,n){n(t)}))},r.race=function(t){return new r((function(e,n){t.forEach((function(t){r.resolve(t).then(e,n)}))}))},r.prototype.catch=function(t){return this.then(null,t)}},350:function(t,e,n){"use strict";var r=n(8859),o=n(98346);t.exports=r,r.denodeify=function(t,e){return e=e||1/0,function(){var n=this,o=Array.prototype.slice.call(arguments);return new r((function(r,i){for(;o.length&&o.length>e;)o.pop();o.push((function(t,e){t?i(t):r(e)}));var a=t.apply(n,o);!a||"object"!=typeof a&&"function"!=typeof a||"function"!=typeof a.then||r(a)}))}},r.nodeify=function(t){return function(){var e=Array.prototype.slice.call(arguments),n="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return t.apply(this,arguments).nodeify(n,i)}catch(t){if(null==n)return new r((function(e,n){n(t)}));o((function(){n.call(i,t)}))}}},r.prototype.nodeify=function(t,e){if("function"!=typeof t)return this;this.then((function(n){o((function(){t.call(e,null,n)}))}),(function(n){o((function(){t.call(e,n)}))}))}},5554:function(t){var e={};t.exports=e,e.createElement=function(t){return document.createElement(t)},e.createText=function(t){return document.createTextNode(t)},e.style=function(t,e){t.style.cssText=e},e.append=function(t,e){t.appendChild(e)},e.remove=function(t,e){t.removeChild(e)}},84474:function(t,e,n){var r=n(15223),o=n(5554),i=n(57296),a=function(t,e){e=e||{weight:"normal"},this.family=t,this.style=e.style||"normal",this.variant=e.variant||"normal",this.weight=e.weight||"normal",this.stretch=e.stretch||"stretch",this.featureSettings=e.featureSettings||"normal"};t.exports=a,a.HAS_WEBKIT_FALLBACK_BUG=null,a.DEFAULT_TIMEOUT=3e3,a.getUserAgent=function(){return window.navigator.userAgent},a.hasWebKitFallbackBug=function(){if(null===a.HAS_WEBKIT_FALLBACK_BUG){var t=/AppleWeb[kK]it\/([0-9]+)(?:\.([0-9]+))/.exec(a.getUserAgent());a.HAS_WEBKIT_FALLBACK_BUG=!!t&&(parseInt(t[1],10)<536||536===parseInt(t[1],10)&&parseInt(t[2],10)<=11)}return a.HAS_WEBKIT_FALLBACK_BUG},a.prototype.getStyle=function(){return"font-style:"+this.style+";font-variant:"+this.variant+";font-weight:"+this.weight+";font-stretch:"+this.stretch+";font-feature-settings:"+this.featureSettings+";-moz-font-feature-settings:"+this.featureSettings+";-webkit-font-feature-settings:"+this.featureSettings+";"},a.prototype.check=function(t,e){var n,s,u,c=t||"BESbswy",l=e||a.DEFAULT_TIMEOUT,f=this.getStyle(),h=o.createElement("div"),d=new i(c),p=new i(c),v=new i(c),m=-1,g=-1,y=-1,b=this;return d.setFont('"Times New Roman", sans-serif',f),p.setFont("serif",f),v.setFont("monospace",f),o.append(h,d.getElement()),o.append(h,p.getElement()),o.append(h,v.getElement()),o.append(document.body,h),n=d.getWidth(),s=p.getWidth(),u=v.getWidth(),new r((function(t,e){function r(){null!==h.parentNode&&o.remove(document.body,h)}function i(){-1!==m&&-1!==g&&-1!==y&&m===g&&g===y&&(a.hasWebKitFallbackBug()&&(m===n&&g===n&&y===n||m===s&&g===s&&y===s||m===u&&g===u&&y===u)||(r(),t(b)))}setTimeout((function(){r(),e(b)}),l),d.onResize((function(t){m=t,i()})),d.setFont(b.family+",sans-serif",f),p.onResize((function(t){g=t,i()})),p.setFont(b.family+",serif",f),v.onResize((function(t){y=t,i()})),v.setFont(b.family+",monospace",f)}))}},57296:function(t,e,n){var r=n(5554),o=function(t){var e="display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;";this.element=r.createElement("div"),this.element.setAttribute("aria-hidden","true"),r.append(this.element,r.createText(t)),this.collapsible=r.createElement("span"),this.expandable=r.createElement("span"),this.collapsibleInner=r.createElement("span"),this.expandableInner=r.createElement("span"),this.lastOffsetWidth=-1,r.style(this.collapsible,e),r.style(this.expandable,e),r.style(this.expandableInner,e),r.style(this.collapsibleInner,"display:inline-block;width:200%;height:200%;"),r.append(this.collapsible,this.collapsibleInner),r.append(this.expandable,this.expandableInner),r.append(this.element,this.collapsible),r.append(this.element,this.expandable)};t.exports=o,o.prototype.getElement=function(){return this.element},o.prototype.setFont=function(t,e){r.style(this.element,"min-width:20px;min-height:20px;display:inline-block;position:absolute;width:auto;margin:0;padding:0;top:-999px;left:-999px;white-space:nowrap;font-size:100px;font-family:"+t+";"+e)},o.prototype.getWidth=function(){return this.element.offsetWidth},o.prototype.setWidth=function(t){this.element.style.width=t+"px"},o.prototype.reset=function(){var t=this.getWidth(),e=t+100;return this.expandableInner.style.width=e+"px",this.expandable.scrollLeft=e,this.collapsible.scrollLeft=this.collapsible.scrollWidth+100,this.lastOffsetWidth!==t&&(this.lastOffsetWidth=t,!0)},o.prototype.onScroll=function(t){this.reset()&&null!==this.element.parentNode&&t(this.lastOffsetWidth)},o.prototype.onResize=function(t){var e=this;this.collapsible.addEventListener("scroll",(function(){e.onScroll(t)}),!1),this.expandable.addEventListener("scroll",(function(){e.onScroll(t)}),!1),this.reset()}},49804:function(t){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(t,r,o){if("[object Function]"!==n.call(r))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a<i;a++)r.call(o,t[a],a,t);else for(var s in t)e.call(t,s)&&r.call(o,t[s],s,t)}},17648:function(t){"use strict";var e="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,o="[object Function]";t.exports=function(t){var i=this;if("function"!=typeof i||r.call(i)!==o)throw new TypeError(e+i);for(var a,s=n.call(arguments,1),u=function(){if(this instanceof a){var e=i.apply(this,s.concat(n.call(arguments)));return Object(e)===e?e:this}return i.apply(t,s.concat(n.call(arguments)))},c=Math.max(0,i.length-s.length),l=[],f=0;f<c;f++)l.push("$"+f);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(u),i.prototype){var h=function(){};h.prototype=i.prototype,a.prototype=new h,h.prototype=null}return a}},58612:function(t,e,n){"use strict";var r=n(17648);t.exports=Function.prototype.bind||r},40210:function(t,e,n){"use strict";var r,o=SyntaxError,i=Function,a=TypeError,s=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new a},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,f=n(41405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"==typeof Uint8Array?r:h(Uint8Array),v={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":f?h([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?h(h([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?h((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?h((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?h(""[Symbol.iterator]()):r,"%Symbol%":f?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},m=function t(e){var n;if("%AsyncFunction%"===e)n=s("async function () {}");else if("%GeneratorFunction%"===e)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=s("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(n=h(o.prototype))}return v[e]=n,n},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},y=n(58612),b=n(17642),w=y.call(Function.call,Array.prototype.concat),x=y.call(Function.apply,Array.prototype.splice),O=y.call(Function.call,String.prototype.replace),E=y.call(Function.call,String.prototype.slice),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,j=function(t){var e=E(t,0,1),n=E(t,-1);if("%"===e&&"%"!==n)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var r=[];return O(t,_,(function(t,e,n,o){r[r.length]=n?O(o,S,"$1"):e||t})),r},A=function(t,e){var n,r=t;if(b(g,r)&&(r="%"+(n=g[r])[0]+"%"),b(v,r)){var i=v[r];if(i===d&&(i=m(r)),void 0===i&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');var n=j(t),r=n.length>0?n[0]:"",i=A("%"+r+"%",e),s=i.name,c=i.value,l=!1,f=i.alias;f&&(r=f[0],x(n,w([0,1],f)));for(var h=1,d=!0;h<n.length;h+=1){var p=n[h],m=E(p,0,1),g=E(p,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new o("property names with quotes must have matching quotes");if("constructor"!==p&&d||(l=!0),b(v,s="%"+(r+="."+p)+"%"))c=v[s];else if(null!=c){if(!(p in c)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&h+1>=n.length){var y=u(c,p);c=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else d=b(c,p),c=c[p];d&&!l&&(v[s]=c)}}return c}},31044:function(t,e,n){"use strict";var r=n(40210)("%Object.defineProperty%",!0),o=function(){if(r)try{return r({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},41405:function(t,e,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(55419);t.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},55419:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},96410:function(t,e,n){"use strict";var r=n(55419);t.exports=function(){return r()&&!!Symbol.toStringTag}},17642:function(t,e,n){"use strict";var r=n(58612);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},35717:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},66337:function(){!function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=function(t){for(var e=window.document,n=o(e);n;)n=o(e=n.ownerDocument);return e}(),e=[],n=null,r=null;a.prototype.THROTTLE_TIMEOUT=100,a.prototype.POLL_INTERVAL=null,a.prototype.USE_MUTATION_OBSERVER=!0,a._setupCrossOriginUpdater=function(){return n||(n=function(t,n){r=t&&n?f(t,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.forEach((function(t){t._checkForIntersections()}))}),n},a._resetCrossOriginUpdater=function(){n=null,r=null},a.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},a.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},a.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},a.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},a.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},a.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},a.prototype._monitorIntersections=function(e){var n=e.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(e)){var r=this._checkForIntersections,i=null,a=null;this.POLL_INTERVAL?i=n.setInterval(r,this.POLL_INTERVAL):(s(n,"resize",r,!0),s(e,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(a=new n.MutationObserver(r)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push((function(){var t=e.defaultView;t&&(i&&t.clearInterval(i),u(t,"resize",r,!0)),u(e,"scroll",r,!0),a&&a.disconnect()}));var c=this.root&&(this.root.ownerDocument||this.root)||t;if(e!=c){var l=o(e);l&&this._monitorIntersections(l.ownerDocument)}}},a.prototype._unmonitorIntersections=function(e){var n=this._monitoringDocuments.indexOf(e);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||t,i=this._observationTargets.some((function(t){var n=t.element.ownerDocument;if(n==e)return!0;for(;n&&n!=r;){var i=o(n);if((n=i&&i.ownerDocument)==e)return!0}return!1}));if(!i){var a=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),a(),e!=r){var s=o(e);s&&this._unmonitorIntersections(s.ownerDocument)}}}},a.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e<t.length;e++)t[e]()},a.prototype._checkForIntersections=function(){if(this.root||!n||r){var t=this._rootIsInDom(),e=t?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var o=r.element,a=c(o),s=this._rootContainsTarget(o),u=r.entry,l=t&&s&&this._computeTargetAndRootIntersection(o,a,e),f=null;this._rootContainsTarget(o)?n&&!this.root||(f=e):f={top:0,bottom:0,left:0,right:0,width:0,height:0};var h=r.entry=new i({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:a,rootBounds:f,intersectionRect:l});u?t&&s?this._hasCrossedThreshold(u,h)&&this._queuedEntries.push(h):u&&u.isIntersecting&&this._queuedEntries.push(h):this._queuedEntries.push(h)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},a.prototype._computeTargetAndRootIntersection=function(e,o,i){if("none"!=window.getComputedStyle(e).display){for(var a,s,u,l,h,p,v,m,g=o,y=d(e),b=!1;!b&&y;){var w=null,x=1==y.nodeType?window.getComputedStyle(y):{};if("none"==x.display)return null;if(y==this.root||9==y.nodeType)if(b=!0,y==this.root||y==t)n&&!this.root?!r||0==r.width&&0==r.height?(y=null,w=null,g=null):w=r:w=i;else{var O=d(y),E=O&&c(O),_=O&&this._computeTargetAndRootIntersection(O,E,i);E&&_?(y=O,w=f(E,_)):(y=null,g=null)}else{var S=y.ownerDocument;y!=S.body&&y!=S.documentElement&&"visible"!=x.overflow&&(w=c(y))}if(w&&(a=w,s=g,void 0,void 0,void 0,void 0,void 0,void 0,u=Math.max(a.top,s.top),l=Math.min(a.bottom,s.bottom),h=Math.max(a.left,s.left),m=l-u,g=(v=(p=Math.min(a.right,s.right))-h)>=0&&m>=0&&{top:u,bottom:l,left:h,right:p,width:v,height:m}||null),!g)break;y=y&&d(y)}return g}},a.prototype._getRootRect=function(){var e;if(this.root&&!p(this.root))e=c(this.root);else{var n=p(this.root)?this.root:t,r=n.documentElement,o=n.body;e={top:0,left:0,right:r.clientWidth||o.clientWidth,width:r.clientWidth||o.clientWidth,bottom:r.clientHeight||o.clientHeight,height:r.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(e)},a.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},a.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==r)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==n||i==r||i<n!=i<r)return!0}},a.prototype._rootIsInDom=function(){return!this.root||h(t,this.root)},a.prototype._rootContainsTarget=function(e){var n=this.root&&(this.root.ownerDocument||this.root)||t;return h(n,e)&&(!this.root||n==e.ownerDocument)},a.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},a.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},window.IntersectionObserver=a,window.IntersectionObserverEntry=i}function o(t){try{return t.defaultView&&t.defaultView.frameElement||null}catch(t){return null}}function i(t){this.time=t.time,this.target=t.target,this.rootBounds=l(t.rootBounds),this.boundingClientRect=l(t.boundingClientRect),this.intersectionRect=l(t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function a(t,e){var n,r,o,i=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType&&9!=i.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout((function(){n(),o=null}),r))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function s(t,e,n,r){"function"==typeof t.addEventListener?t.addEventListener(e,n,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function u(t,e,n,r){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function c(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function l(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function f(t,e){var n=e.top-t.top,r=e.left-t.left;return{top:n,left:r,height:e.height,width:e.width,bottom:n+e.height,right:r+e.width}}function h(t,e){for(var n=e;n;){if(n==t)return!0;n=d(n)}return!1}function d(e){var n=e.parentNode;return 9==e.nodeType&&e!=t?o(e):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function p(t){return t&&9===t.nodeType}}()},82584:function(t,e,n){"use strict";var r=n(96410)(),o=n(21924)("Object.prototype.toString"),i=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=s?i:a},48662:function(t,e,n){"use strict";var r,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=n(96410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(t);if(!u)return!1;if(void 0===r){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&u(e)}return u(t)===r}},98611:function(t){"use strict";t.exports=function(t){return t!=t}},20360:function(t,e,n){"use strict";var r=n(55559),o=n(4289),i=n(98611),a=n(29415),s=n(23194),u=r(a(),Number);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},29415:function(t,e,n){"use strict";var r=n(98611);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}},23194:function(t,e,n){"use strict";var r=n(4289),o=n(29415);t.exports=function(){var t=o();return r(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},85692:function(t,e,n){"use strict";var r=n(49804),o=n(63083),i=n(21924),a=i("Object.prototype.toString"),s=n(96410)(),u="undefined"==typeof globalThis?n.g:globalThis,c=o(),l=i("Array.prototype.indexOf",!0)||function(t,e){for(var n=0;n<t.length;n+=1)if(t[n]===e)return n;return-1},f=i("String.prototype.slice"),h={},d=n(20882),p=Object.getPrototypeOf;s&&d&&p&&r(c,(function(t){var e=new u[t];if(Symbol.toStringTag in e){var n=p(e),r=d(n,Symbol.toStringTag);if(!r){var o=p(n);r=d(o,Symbol.toStringTag)}h[t]=r.get}})),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s||!(Symbol.toStringTag in t)){var e=f(a(t),8,-1);return l(c,e)>-1}return!!d&&function(t){var e=!1;return r(h,(function(n,r){if(!e)try{e=n.call(t)===r}catch(t){}})),e}(t)}},96481:function(t,e,n){"use strict";var r=n(59177),o=r.ValidatorResult,i=r.SchemaError,a={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0}},s=a.validators={};function u(t,e,n,r,o){var i=e.throwError,a=e.throwAll;e.throwError=!1,e.throwAll=!1;var s=this.validateSchema(t,o,e,n);return e.throwError=i,e.throwAll=a,!s.valid&&r instanceof Function&&r(s),s.valid}function c(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t)for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}function l(t,e,n,r,o,i){if(this.types.object(t)&&(!e.properties||void 0===e.properties[o]))if(!1===e.additionalProperties)i.addError({name:"additionalProperties",argument:o,message:"is not allowed to have the additional property "+JSON.stringify(o)});else{var a=e.additionalProperties||{};"function"==typeof n.preValidateProperty&&n.preValidateProperty(t,o,a,n,r);var s=this.validateSchema(t[o],a,n,r.makeChild(a,o));s.instance!==i.instance[o]&&(i.instance[o]=s.instance),i.importErrors(s)}}s.type=function(t,e,n,r){if(void 0===t)return null;var i=new o(t,e,n,r),a=Array.isArray(e.type)?e.type:[e.type];if(!a.some(this.testType.bind(this,t,e,n,r))){var s=a.map((function(t){if(t){var e=t.$id||t.id;return e?"<"+e+">":t+""}}));i.addError({name:"type",argument:s,message:"is not of a type(s) "+s})}return i},s.anyOf=function(t,e,n,r){if(void 0===t)return null;var a=new o(t,e,n,r),s=new o(t,e,n,r);if(!Array.isArray(e.anyOf))throw new i("anyOf must be an array");if(!e.anyOf.some(u.bind(this,t,n,r,(function(t){s.importErrors(t)})))){var c=e.anyOf.map((function(t,e){var n=t.$id||t.id;return n?"<"+n+">":t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+e+"]"}));n.nestedErrors&&a.importErrors(s),a.addError({name:"anyOf",argument:c,message:"is not any of "+c.join(",")})}return a},s.allOf=function(t,e,n,r){if(void 0===t)return null;if(!Array.isArray(e.allOf))throw new i("allOf must be an array");var a=new o(t,e,n,r),s=this;return e.allOf.forEach((function(e,o){var i=s.validateSchema(t,e,n,r);if(!i.valid){var u=e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+o+"]";a.addError({name:"allOf",argument:{id:u,length:i.errors.length,valid:i},message:"does not match allOf schema "+u+" with "+i.errors.length+" error[s]:"}),a.importErrors(i)}})),a},s.oneOf=function(t,e,n,r){if(void 0===t)return null;if(!Array.isArray(e.oneOf))throw new i("oneOf must be an array");var a=new o(t,e,n,r),s=new o(t,e,n,r),c=e.oneOf.filter(u.bind(this,t,n,r,(function(t){s.importErrors(t)}))).length,l=e.oneOf.map((function(t,e){return t.$id||t.id||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+e+"]"}));return 1!==c&&(n.nestedErrors&&a.importErrors(s),a.addError({name:"oneOf",argument:l,message:"is not exactly one from "+l.join(",")})),a},s.if=function(t,e,n,i){if(void 0===t)return null;if(!r.isSchema(e.if))throw new Error('Expected "if" keyword to be a schema');var a,s=u.call(this,t,n,i,null,e.if),c=new o(t,e,n,i);if(s){if(void 0===e.then)return;if(!r.isSchema(e.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(t,e.then,n,i.makeChild(e.then)),c.importErrors(a)}else{if(void 0===e.else)return;if(!r.isSchema(e.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(t,e.else,n,i.makeChild(e.else)),c.importErrors(a)}return c},s.propertyNames=function(t,e,n,a){if(this.types.object(t)){var s=new o(t,e,n,a),u=void 0!==e.propertyNames?e.propertyNames:{};if(!r.isSchema(u))throw new i('Expected "propertyNames" to be a schema (object or boolean)');for(var l in t)if(void 0!==c(t,l)){var f=this.validateSchema(l,u,n,a.makeChild(u));s.importErrors(f)}return s}},s.properties=function(t,e,n,r){if(this.types.object(t)){var a=new o(t,e,n,r),s=e.properties||{};for(var u in s){var l=s[u];if(void 0!==l){if(null===l)throw new i('Unexpected null, expected schema in "properties"');"function"==typeof n.preValidateProperty&&n.preValidateProperty(t,u,l,n,r);var f=c(t,u),h=this.validateSchema(f,l,n,r.makeChild(l,u));h.instance!==a.instance[u]&&(a.instance[u]=h.instance),a.importErrors(h)}}return a}},s.patternProperties=function(t,e,n,r){if(this.types.object(t)){var a=new o(t,e,n,r),s=e.patternProperties||{};for(var u in t){var c=!0;for(var f in s){var h=s[f];if(void 0!==h){if(null===h)throw new i('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(f,"u")}catch(t){d=new RegExp(f)}if(d.test(u)){c=!1,"function"==typeof n.preValidateProperty&&n.preValidateProperty(t,u,h,n,r);var p=this.validateSchema(t[u],h,n,r.makeChild(h,u));p.instance!==a.instance[u]&&(a.instance[u]=p.instance),a.importErrors(p)}}}c&&l.call(this,t,e,n,r,u,a)}return a}},s.additionalProperties=function(t,e,n,r){if(this.types.object(t)){if(e.patternProperties)return null;var i=new o(t,e,n,r);for(var a in t)l.call(this,t,e,n,r,a,i);return i}},s.minProperties=function(t,e,n,r){if(this.types.object(t)){var i=new o(t,e,n,r);return Object.keys(t).length>=e.minProperties||i.addError({name:"minProperties",argument:e.minProperties,message:"does not meet minimum property length of "+e.minProperties}),i}},s.maxProperties=function(t,e,n,r){if(this.types.object(t)){var i=new o(t,e,n,r);return Object.keys(t).length<=e.maxProperties||i.addError({name:"maxProperties",argument:e.maxProperties,message:"does not meet maximum property length of "+e.maxProperties}),i}},s.items=function(t,e,n,r){var i=this;if(this.types.array(t)&&e.items){var a=new o(t,e,n,r);return t.every((function(t,o){var s=Array.isArray(e.items)?e.items[o]||e.additionalItems:e.items;if(void 0===s)return!0;if(!1===s)return a.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=i.validateSchema(t,s,n,r.makeChild(s,o));return u.instance!==a.instance[o]&&(a.instance[o]=u.instance),a.importErrors(u),!0})),a}},s.minimum=function(t,e,n,r){if(this.types.number(t)){var i=new o(t,e,n,r);return e.exclusiveMinimum&&!0===e.exclusiveMinimum?t>e.minimum||i.addError({name:"minimum",argument:e.minimum,message:"must be greater than "+e.minimum}):t>=e.minimum||i.addError({name:"minimum",argument:e.minimum,message:"must be greater than or equal to "+e.minimum}),i}},s.maximum=function(t,e,n,r){if(this.types.number(t)){var i=new o(t,e,n,r);return e.exclusiveMaximum&&!0===e.exclusiveMaximum?t<e.maximum||i.addError({name:"maximum",argument:e.maximum,message:"must be less than "+e.maximum}):t<=e.maximum||i.addError({name:"maximum",argument:e.maximum,message:"must be less than or equal to "+e.maximum}),i}},s.exclusiveMinimum=function(t,e,n,r){if("boolean"!=typeof e.exclusiveMaximum&&this.types.number(t)){var i=new o(t,e,n,r);return t>e.exclusiveMinimum||i.addError({name:"exclusiveMinimum",argument:e.exclusiveMinimum,message:"must be strictly greater than "+e.exclusiveMinimum}),i}},s.exclusiveMaximum=function(t,e,n,r){if("boolean"!=typeof e.exclusiveMaximum&&this.types.number(t)){var i=new o(t,e,n,r);return t<e.exclusiveMaximum||i.addError({name:"exclusiveMaximum",argument:e.exclusiveMaximum,message:"must be strictly less than "+e.exclusiveMaximum}),i}};var f=function(t,e,n,a,s,u){if(this.types.number(t)){var c=e[s];if(0==c)throw new i(s+" cannot be zero");var l=new o(t,e,n,a),f=r.getDecimalPlaces(t),h=r.getDecimalPlaces(c),d=Math.max(f,h),p=Math.pow(10,d);return Math.round(t*p)%Math.round(c*p)!=0&&l.addError({name:s,argument:c,message:u+JSON.stringify(c)}),l}};function h(t,e,n){var o,i=n.length;for(o=e+1;o<i;o++)if(r.deepCompareStrict(t,n[o]))return!1;return!0}s.multipleOf=function(t,e,n,r){return f.call(this,t,e,n,r,"multipleOf","is not a multiple of (divisible by) ")},s.divisibleBy=function(t,e,n,r){return f.call(this,t,e,n,r,"divisibleBy","is not divisible by (multiple of) ")},s.required=function(t,e,n,r){var i=new o(t,e,n,r);return void 0===t&&!0===e.required?i.addError({name:"required",message:"is required"}):this.types.object(t)&&Array.isArray(e.required)&&e.required.forEach((function(e){void 0===c(t,e)&&i.addError({name:"required",argument:e,message:"requires property "+JSON.stringify(e)})})),i},s.pattern=function(t,e,n,r){if(this.types.string(t)){var i=new o(t,e,n,r),a=e.pattern;try{var s=new RegExp(a,"u")}catch(t){s=new RegExp(a)}return t.match(s)||i.addError({name:"pattern",argument:e.pattern,message:"does not match pattern "+JSON.stringify(e.pattern.toString())}),i}},s.format=function(t,e,n,i){if(void 0!==t){var a=new o(t,e,n,i);return a.disableFormat||r.isFormat(t,e.format,this)||a.addError({name:"format",argument:e.format,message:"does not conform to the "+JSON.stringify(e.format)+" format"}),a}},s.minLength=function(t,e,n,r){if(this.types.string(t)){var i=new o(t,e,n,r),a=t.match(/[\uDC00-\uDFFF]/g);return t.length-(a?a.length:0)>=e.minLength||i.addError({name:"minLength",argument:e.minLength,message:"does not meet minimum length of "+e.minLength}),i}},s.maxLength=function(t,e,n,r){if(this.types.string(t)){var i=new o(t,e,n,r),a=t.match(/[\uDC00-\uDFFF]/g);return t.length-(a?a.length:0)<=e.maxLength||i.addError({name:"maxLength",argument:e.maxLength,message:"does not meet maximum length of "+e.maxLength}),i}},s.minItems=function(t,e,n,r){if(this.types.array(t)){var i=new o(t,e,n,r);return t.length>=e.minItems||i.addError({name:"minItems",argument:e.minItems,message:"does not meet minimum length of "+e.minItems}),i}},s.maxItems=function(t,e,n,r){if(this.types.array(t)){var i=new o(t,e,n,r);return t.length<=e.maxItems||i.addError({name:"maxItems",argument:e.maxItems,message:"does not meet maximum length of "+e.maxItems}),i}},s.uniqueItems=function(t,e,n,r){if(!0===e.uniqueItems&&this.types.array(t)){var i=new o(t,e,n,r);return t.every(h)||i.addError({name:"uniqueItems",message:"contains duplicate item"}),i}},s.dependencies=function(t,e,n,r){if(this.types.object(t)){var i=new o(t,e,n,r);for(var a in e.dependencies)if(void 0!==t[a]){var s=e.dependencies[a],u=r.makeChild(s,a);if("string"==typeof s&&(s=[s]),Array.isArray(s))s.forEach((function(e){void 0===t[e]&&i.addError({name:"dependencies",argument:u.propertyPath,message:"property "+e+" not found, required by "+u.propertyPath})}));else{var c=this.validateSchema(t,s,n,u);i.instance!==c.instance&&(i.instance=c.instance),c&&c.errors.length&&(i.addError({name:"dependencies",argument:u.propertyPath,message:"does not meet dependency required by "+u.propertyPath}),i.importErrors(c))}}return i}},s.enum=function(t,e,n,a){if(void 0===t)return null;if(!Array.isArray(e.enum))throw new i("enum expects an array",e);var s=new o(t,e,n,a);return e.enum.some(r.deepCompareStrict.bind(null,t))||s.addError({name:"enum",argument:e.enum,message:"is not one of enum values: "+e.enum.map(String).join(",")}),s},s.const=function(t,e,n,i){if(void 0===t)return null;var a=new o(t,e,n,i);return r.deepCompareStrict(e.const,t)||a.addError({name:"const",argument:e.const,message:"does not exactly match expected constant: "+e.const}),a},s.not=s.disallow=function(t,e,n,r){var i=this;if(void 0===t)return null;var a=new o(t,e,n,r),s=e.not||e.disallow;return s?(Array.isArray(s)||(s=[s]),s.forEach((function(o){if(i.testType(t,e,n,r,o)){var s=o&&(o.$id||o.id)||o;a.addError({name:"not",argument:s,message:"is of prohibited type "+s})}})),a):null},t.exports=a},59177:function(t,e,n){"use strict";var r=n(8575),o=e.ValidationError=function(t,e,n,r,o,i){if(Array.isArray(r)?(this.path=r,this.property=r.reduce((function(t,e){return t+f(e)}),"instance")):void 0!==r&&(this.property=r),t&&(this.message=t),n){var a=n.$id||n.id;this.schema=a||n}void 0!==e&&(this.instance=e),this.name=o,this.argument=i,this.stack=this.toString()};o.prototype.toString=function(){return this.property+" "+this.message};var i=e.ValidatorResult=function(t,e,n,r){this.instance=t,this.schema=e,this.options=n,this.path=r.path,this.propertyPath=r.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&!0===n.disableFormat};function a(t,e){return e+": "+t.toString()+"\n"}function s(t){Error.captureStackTrace&&Error.captureStackTrace(this,s),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}i.prototype.addError=function(t){var e;if("string"==typeof t)e=new o(t,this.instance,this.schema,this.path);else{if(!t)throw new Error("Missing error detail");if(!t.message)throw new Error("Missing error message");if(!t.name)throw new Error("Missing validator type");e=new o(t.message,this.instance,this.schema,this.path,t.name,t.argument)}if(this.errors.push(e),this.throwFirst)throw new s(this);if(this.throwError)throw e;return e},i.prototype.importErrors=function(t){"string"==typeof t||t&&t.validatorType?this.addError(t):t&&t.errors&&Array.prototype.push.apply(this.errors,t.errors)},i.prototype.toString=function(t){return this.errors.map(a).join("")},Object.defineProperty(i.prototype,"valid",{get:function(){return!this.errors.length}}),t.exports.ValidatorResultError=s,s.prototype=new Error,s.prototype.constructor=s,s.prototype.name="Validation Error";var u=e.SchemaError=function t(e,n){this.message=e,this.schema=n,Error.call(this,e),Error.captureStackTrace(this,t)};u.prototype=Object.create(Error.prototype,{constructor:{value:u,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var c=e.SchemaContext=function(t,e,n,r,o){this.schema=t,this.options=e,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce((function(t,e){return t+f(e)}),"instance")):this.propertyPath=n,this.base=r,this.schemas=o};c.prototype.resolve=function(t){return r.resolve(this.base,t)},c.prototype.makeChild=function(t,e){var n=void 0===e?this.path:this.path.concat([e]),o=t.$id||t.id,i=r.resolve(this.base,o||""),a=new c(t,this.options,n,i,Object.create(this.schemas));return o&&!a.schemas[i]&&(a.schemas[i]=t),a};var l=e.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/,"utc-millisec":function(t){return"string"==typeof t&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch(t){e=!1}return e},style:/\s*(.+?):\s*([^;]+);?/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/};l.regexp=l.regex,l.pattern=l.regex,l.ipv4=l["ip-address"],e.isFormat=function(t,e,n){if("string"==typeof t&&void 0!==l[e]){if(l[e]instanceof RegExp)return l[e].test(t);if("function"==typeof l[e])return l[e](t)}else if(n&&n.customFormats&&"function"==typeof n.customFormats[e])return n.customFormats[e](t);return!0};var f=e.makeSuffix=function(t){return(t=t.toString()).match(/[.\s\[\]]/)||t.match(/^[\d]/)?t.match(/^\d+$/)?"["+t+"]":"["+JSON.stringify(t)+"]":"."+t};function h(t,e,n,r){"object"==typeof n?e[r]=v(t[r],n):-1===t.indexOf(n)&&e.push(n)}function d(t,e,n){e[n]=t[n]}function p(t,e,n,r){"object"==typeof e[r]&&e[r]&&t[r]?n[r]=v(t[r],e[r]):n[r]=e[r]}function v(t,e){var n=Array.isArray(e),r=n&&[]||{};return n?(t=t||[],r=r.concat(t),e.forEach(h.bind(null,t,r))):(t&&"object"==typeof t&&Object.keys(t).forEach(d.bind(null,t,r)),Object.keys(e).forEach(p.bind(null,t,e,r))),r}function m(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}e.deepCompareStrict=function t(e,n){if(typeof e!=typeof n)return!1;if(Array.isArray(e))return!!Array.isArray(n)&&e.length===n.length&&e.every((function(r,o){return t(e[o],n[o])}));if("object"==typeof e){if(!e||!n)return e===n;var r=Object.keys(e),o=Object.keys(n);return r.length===o.length&&r.every((function(r){return t(e[r],n[r])}))}return e===n},t.exports.deepMerge=v,e.objectGetPath=function(t,e){for(var n,r=e.split("/").slice(1);"string"==typeof(n=r.shift());){var o=decodeURIComponent(n.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in t))return;t=t[o]}return t},e.encodePath=function(t){return t.map(m).join("")},e.getDecimalPlaces=function(t){var e=0;if(isNaN(t))return e;"number"!=typeof t&&(t=Number(t));var n=t.toString().split("e");if(2===n.length){if("-"!==n[1][0])return e;e=Number(n[1].slice(1))}var r=n[0].split(".");return 2===r.length&&(e+=r[1].length),e},e.isSchema=function(t){return"object"==typeof t&&t||"boolean"==typeof t}},40660:function(t,e,n){"use strict";t.exports.Validator=n(43058);n(59177).ValidatorResult,n(59177).ValidatorResultError,n(59177).ValidationError,n(59177).SchemaError,n(31287),n(31287).R},31287:function(t,e,n){"use strict";var r=n(8575),o=n(59177);function i(t,e){this.id=t,this.ref=e}t.exports.R=function(t,e){function n(t,e){if(e&&"object"==typeof e)if(e.$ref){var i=r.resolve(t,e.$ref);c[i]=c[i]?c[i]+1:0}else{var l=e.$id||e.id,f=l?r.resolve(t,l):t;if(f){if(f.indexOf("#")<0&&(f+="#"),u[f]){if(!o.deepCompareStrict(u[f],e))throw new Error("Schema <"+f+"> already exists with different definition");return u[f]}u[f]=e,"#"==f[f.length-1]&&(u[f.substring(0,f.length-1)]=e)}a(f+"/items",Array.isArray(e.items)?e.items:[e.items]),a(f+"/extends",Array.isArray(e.extends)?e.extends:[e.extends]),n(f+"/additionalItems",e.additionalItems),s(f+"/properties",e.properties),n(f+"/additionalProperties",e.additionalProperties),s(f+"/definitions",e.definitions),s(f+"/patternProperties",e.patternProperties),s(f+"/dependencies",e.dependencies),a(f+"/disallow",e.disallow),a(f+"/allOf",e.allOf),a(f+"/anyOf",e.anyOf),a(f+"/oneOf",e.oneOf),n(f+"/not",e.not)}}function a(t,e){if(Array.isArray(e))for(var r=0;r<e.length;r++)n(t+"/"+r,e[r])}function s(t,e){if(e&&"object"==typeof e)for(var r in e)n(t+"/"+r,e[r])}var u={},c={};return n(t,e),new i(u,c)}},43058:function(t,e,n){"use strict";var r=n(8575),o=n(96481),i=n(59177),a=n(31287).R,s=i.ValidatorResult,u=i.ValidatorResultError,c=i.SchemaError,l=i.SchemaContext,f=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(d),this.attributes=Object.create(o.validators)};function h(t){var e="string"==typeof t?t:t.$ref;return"string"==typeof e&&e}f.prototype.customFormats={},f.prototype.schemas=null,f.prototype.types=null,f.prototype.attributes=null,f.prototype.unresolvedRefs=null,f.prototype.addSchema=function(t,e){var n=this;if(!t)return null;var r=a(e||"/",t),o=e||t.$id||t.id;for(var i in r.id)this.schemas[i]=r.id[i];for(var i in r.ref)this.unresolvedRefs.push(i);return this.unresolvedRefs=this.unresolvedRefs.filter((function(t){return void 0===n.schemas[t]})),this.schemas[o]},f.prototype.addSubSchemaArray=function(t,e){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addSubSchema(t,e[n])},f.prototype.addSubSchemaObject=function(t,e){if(e&&"object"==typeof e)for(var n in e)this.addSubSchema(t,e[n])},f.prototype.setSchemas=function(t){this.schemas=t},f.prototype.getSchema=function(t){return this.schemas[t]},f.prototype.validate=function(t,e,n,o){if("boolean"!=typeof e&&"object"!=typeof e||null===e)throw new c("Expected `schema` to be an object or boolean");n||(n={});var i,f=e.$id||e.id,h=r.resolve(n.base||"/",f||"");if(!o){(o=new l(e,n,[],h,Object.create(this.schemas))).schemas[h]||(o.schemas[h]=e);var d=a(h,e);for(var p in d.id){var v=d.id[p];o.schemas[p]=v}}if(n.required&&void 0===t)return(i=new s(t,e,n,o)).addError("is required, but is undefined"),i;if(!(i=this.validateSchema(t,e,n,o)))throw new Error("Result undefined");if(n.throwAll&&i.errors.length)throw new u(i);return i},f.prototype.validateSchema=function(t,e,n,r){var a=new s(t,e,n,r);if("boolean"==typeof e)!0===e?e={}:!1===e&&(e={type:[]});else if(!e)throw new Error("schema is undefined");if(e.extends)if(Array.isArray(e.extends)){var u={schema:e,ctx:r};e.extends.forEach(this.schemaTraverser.bind(this,u)),e=u.schema,u.schema=null,u.ctx=null,u=null}else e=i.deepMerge(e,this.superResolve(e.extends,r));var f=h(e);if(f){var d=this.resolve(e,f,r),p=new l(d.subschema,n,r.path,d.switchSchema,r.schemas);return this.validateSchema(t,d.subschema,n,p)}var v=n&&n.skipAttributes||[];for(var m in e)if(!o.ignoreProperties[m]&&v.indexOf(m)<0){var g=null,y=this.attributes[m];if(y)g=y.call(this,t,e,n,r);else if(!1===n.allowUnknownAttributes)throw new c("Unsupported attribute: "+m,e);g&&a.importErrors(g)}if("function"==typeof n.rewrite){var b=n.rewrite.call(this,t,e,n,r);a.instance=b}return a},f.prototype.schemaTraverser=function(t,e){t.schema=i.deepMerge(t.schema,this.superResolve(e,t.ctx))},f.prototype.superResolve=function(t,e){var n=h(t);return n?this.resolve(t,n,e).subschema:t},f.prototype.resolve=function(t,e,n){if(e=n.resolve(e),n.schemas[e])return{subschema:n.schemas[e],switchSchema:e};var o=r.parse(e),a=o&&o.hash,s=a&&a.length&&e.substr(0,e.length-a.length);if(!s||!n.schemas[s])throw new c("no such schema <"+e+">",t);var u=i.objectGetPath(n.schemas[s],a.substr(1));if(void 0===u)throw new c("no such schema "+a+" located in <"+s+">",t);return{subschema:u,switchSchema:e}},f.prototype.testType=function(t,e,n,r,o){if(void 0!==o){if(null===o)throw new c('Unexpected null in "type" keyword');if("function"==typeof this.types[o])return this.types[o].call(this,t);if(o&&"object"==typeof o){var i=this.validateSchema(t,o,n,r);return void 0===i||!(i&&i.errors.length)}return!0}};var d=f.prototype.types={};d.string=function(t){return"string"==typeof t},d.number=function(t){return"number"==typeof t&&isFinite(t)},d.integer=function(t){return"number"==typeof t&&t%1==0},d.boolean=function(t){return"boolean"==typeof t},d.array=function(t){return Array.isArray(t)},d.null=function(t){return null===t},d.date=function(t){return t instanceof Date},d.any=function(t){return!0},d.object=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!(t instanceof Date)},t.exports=f},58469:function(t,e,n){"use strict";n.d(e,{aUM:function(){return Go},hgN:function(){return W},Ilx:function(){return D},fYe:function(){return $},hxV:function(){return Xe},wql:function(){return M},eKO:function(){return B},Yyn:function(){return wn},HYg:function(){return tt},J41:function(){return ht},uMq:function(){return rt},X6G:function(){return Z},F_l:function(){return Ht},VA:function(){return ja},jWx:function(){return Ge},C8:function(){return Mr},UE_:function(){return V},vfe:function(){return vt},YlQ:function(){return on},Hrh:function(){return Cr},mWk:function(){return lt},j1n:function(){return at},Ciz:function(){return et},Ruh:function(){return tn},I6H:function(){return ya},gN2:function(){return mt},xKj:function(){return mn},SZr:function(){return vn},Jj2:function(){return Y},YkY:function(){return H},AUF:function(){return At},Cv7:function(){return jt},Sgu:function(){return z},Mqr:function(){return Oi},tIy:function(){return wt},f0f:function(){return ti},xz_:function(){return sn},jD1:function(){return ba},OnW:function(){return qi},OAk:function(){return Yi},gHo:function(){return Wi},f8s:function(){return _i},dBq:function(){return Si},QXZ:function(){return gi},HIi:function(){return ta},Wa4:function(){return yi},bDx:function(){return Ri},NZY:function(){return Ci},Hlm:function(){return Ji},nHA:function(){return Hi},Ksv:function(){return ga},atm:function(){return ma},ghY:function(){return Mi},DYm:function(){return Bi},oEw:function(){return Ti},RmL:function(){return zi},k_5:function(){return Gi},lI3:function(){return Vi},v$W:function(){return $i},QqH:function(){return Ki},dmV:function(){return oi},GoV:function(){return ii},TPF:function(){return Qi},V4S:function(){return si},Hwe:function(){return hi},U9$:function(){return li},g5D:function(){return ra},ltA:function(){return na},cMT:function(){return oa},Eps:function(){return Zi},ksM:function(){return aa},e9t:function(){return sa},m81:function(){return ia},$Tq:function(){return ca},NmG:function(){return fa},rzF:function(){return la},Dps:function(){return ai},QOv:function(){return Ni},z8H:function(){return Ii},ymK:function(){return un},jnZ:function(){return wi},lv1:function(){return xn},wSe:function(){return ui}});var r=n(15671),o=n(43144),i=n(4942),a=n(69282),s=n.n(a),u=n(60136),c=n(82963),l=n(61120),f=n(89611),h=n(78814);function d(t,e,n){return d=(0,h.Z)()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&(0,f.Z)(o,n.prototype),o},d.apply(null,arguments)}function p(t){var e="function"==typeof Map?new Map:void 0;return p=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return d(t,arguments,(0,l.Z)(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,f.Z)(r,t)},p(t)}var v=n(93433),m=n(13092),g=n(86033),y=n(29439),b=n(97326);function w(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=(0,l.Z)(t)););return t}function x(){return x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=w(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},x.apply(this,arguments)}var O=n(40660),E=n(15861),_=n(87757),S=n.n(_),j=n(45987),A=n(67079),P=n.n(A),k=n(66721),T=n.n(k),C=n(78230),R=n(96486),M={H:"#000000",He:"#89a1a1",Li:"#bd77ed",Be:"#8fbc00",B:"#c18989",C:"#000000",N:"#304ff7",O:"#ff0d0d",F:"#78bc42",Ne:"#80a2af",Na:"#ab5cf2",Mg:"#6fcd00",Al:"#a99393",Si:"#b29478",P:"#ff8000",S:"#c99a19",Cl:"#1fd01f",Ar:"#69acba",K:"#8f40d4",Ca:"#38e900",Sc:"#999999",Ti:"#979a9e",V:"#99999e",Cr:"#8a99c7",Mn:"#9c7ac7",Fe:"#e06633",Co:"#d37e8e",Ni:"#4ece4e",Cu:"#c78033",Zn:"#7d80b0",Ga:"#bc8b8b",Ge:"#668f8f",As:"#b87ddd",Se:"#e59100",Br:"#a62929",Kr:"#59b1c9",Rb:"#702eb0",Sr:"#00ff00",Y:"#66afaf",Zr:"#71abab",Nb:"#67aeb4",Mo:"#54b5b5",Tc:"#3b9e9e",Ru:"#248f8f",Rh:"#0a7d8c",Pd:"#006985",Ag:"#9a9a9a",Cd:"#b29764",In:"#a67573",Sn:"#668080",Sb:"#9e63b5",Te:"#d47a00",I:"#940094",Xe:"#429eb0",Cs:"#57178f",Ba:"#00c900",La:"#5caed1",Ce:"#9d9d7b",Pr:"#8ca581",Nd:"#84a984",Pm:"#71b18a",Sm:"#66b68e",Eu:"#4ac298",Gd:"#37cb9e",Tb:"#28d1a4",Dy:"#1bd7a8",Ho:"#00e98f",Er:"#00e675",Tm:"#00d452",Yb:"#00bf38",Lu:"#00ab24",Hf:"#47b3ec",Ta:"#4da6ff",W:"#2194d6",Re:"#267dab",Os:"#266696",Ir:"#175487",Pt:"#9898a3",Au:"#c19e1c",Hg:"#9797ac",Tl:"#a6544d",Pb:"#575961",Bi:"#9e4fb5",Po:"#ab5c00",At:"#754f45",Rn:"#428296",Fr:"#420066",Ra:"#007d00",Ac:"#6aa2ec",Th:"#00baff",Pa:"#00a1ff",U:"#008fff",Np:"#0080ff",Pu:"#006bff",Am:"#545cf2",Cm:"#785ce3",Bk:"#8a4fe3",Cf:"#a136d4",Es:"#b31fd4",Fm:"#000000",Md:"#000000",No:"#000000",Lr:"#000000",Rf:"#47b3ec",Db:"#4da6ff",Sg:"#2194d6",Bh:"#267dab",Hs:"#266696",Mt:"#175487",Ds:"#9898a3",Rg:"#c19e1c",Cn:"#9797ac",Nh:"#000000",Fl:"#000000",Mc:"#000000",Lv:"#000000",Ts:"#000000",Og:"#000000"},I=[{number:1,label:"H",period:1,group:1,title:"Hydrogen",state:"gas",origin:"primordial",type:"diatomic",mass:1.00794},{number:2,label:"He",period:1,group:8,title:"Helium",state:"gas",origin:"primordial",type:"noble",mass:4.0026022},{number:3,label:"Li",period:2,group:1,title:"Lithium",state:"solid",origin:"primordial",type:"alkali",mass:6.94},{number:4,label:"Be",period:2,group:2,title:"Beryllium",state:"solid",origin:"primordial",type:"alkaline-earth",mass:9.01218315},{number:5,label:"B",period:2,group:3,title:"Boron",state:"solid",origin:"primordial",type:"metalloid",mass:10.81},{number:6,label:"C",period:2,group:4,title:"Carbon",state:"solid",origin:"primordial",type:"polyatomic",mass:12.011},{number:7,label:"N",period:2,group:5,title:"Nitrogen",state:"gas",origin:"primordial",type:"diatomic",mass:14.007},{number:8,label:"O",period:2,group:6,leftH:!0,title:"Oxygen",state:"gas",origin:"primordial",type:"diatomic",mass:15.999},{number:9,label:"F",period:2,group:7,leftH:!0,title:"Fluorine",state:"gas",origin:"primordial",type:"diatomic",mass:18.9984031636},{number:10,label:"Ne",period:2,group:8,title:"Neon",state:"gas",origin:"primordial",type:"noble",mass:20.17976},{number:11,label:"Na",period:3,group:1,title:"Sodium",state:"solid",origin:"primordial",type:"alkali",mass:22.989769282},{number:12,label:"Mg",period:3,group:2,title:"Magnesium",state:"solid",origin:"primordial",type:"alkaline-earth",mass:24.305},{number:13,label:"Al",period:3,group:3,title:"Aluminium",state:"solid",origin:"primordial",type:"post-transition",mass:26.98153857},{number:14,label:"Si",period:3,group:4,title:"Silicon",state:"solid",origin:"primordial",type:"metalloid",mass:28.085},{number:15,label:"P",period:3,group:5,title:"Phosphorus",state:"solid",origin:"primordial",type:"polyatomic",mass:30.9737619985},{number:16,label:"S",period:3,group:6,leftH:!0,title:"Sulfur",state:"solid",origin:"primordial",type:"polyatomic",mass:32.06},{number:17,label:"Cl",period:3,group:7,leftH:!0,title:"Chlorine",state:"gas",origin:"primordial",type:"diatomic",mass:35.45},{number:18,label:"Ar",period:3,group:8,title:"Argon",state:"gas",origin:"primordial",type:"noble",mass:39.9481},{number:19,label:"K",period:4,group:1,title:"Potassium",state:"solid",origin:"primordial",type:"alkali",mass:39.09831},{number:20,label:"Ca",period:4,group:2,title:"Calcium",state:"solid",origin:"primordial",type:"alkaline-earth",mass:40.0784},{number:21,label:"Sc",period:4,group:3,title:"Scandium",state:"solid",origin:"primordial",type:"transition",mass:44.9559085},{number:22,label:"Ti",period:4,group:4,title:"Titanium",state:"solid",origin:"primordial",type:"transition",mass:47.8671},{number:23,label:"V",period:4,group:5,title:"Vanadium",state:"solid",origin:"primordial",type:"transition",mass:50.94151},{number:24,label:"Cr",period:4,group:6,title:"Chromium",state:"solid",origin:"primordial",type:"transition",mass:51.99616},{number:25,label:"Mn",period:4,group:7,title:"Manganese",state:"solid",origin:"primordial",type:"transition",mass:54.9380443},{number:26,label:"Fe",period:4,group:8,title:"Iron",state:"solid",origin:"primordial",type:"transition",mass:55.8452},{number:27,label:"Co",period:4,group:8,title:"Cobalt",state:"solid",origin:"primordial",type:"transition",mass:58.9331944},{number:28,label:"Ni",period:4,group:8,title:"Nickel",state:"solid",origin:"primordial",type:"transition",mass:58.69344},{number:29,label:"Cu",period:4,group:1,title:"Copper",state:"solid",origin:"primordial",type:"transition",mass:63.5463},{number:30,label:"Zn",period:4,group:2,title:"Zinc",state:"solid",origin:"primordial",type:"transition",mass:65.382},{number:31,label:"Ga",period:4,group:3,title:"Gallium",state:"solid",origin:"primordial",type:"post-transition",mass:69.7231},{number:32,label:"Ge",period:4,group:4,title:"Germanium",state:"solid",origin:"primordial",type:"metalloid",mass:72.6308},{number:33,label:"As",period:4,group:5,title:"Arsenic",state:"solid",origin:"primordial",type:"metalloid",mass:74.9215956},{number:34,label:"Se",period:4,group:6,leftH:!0,title:"Selenium",state:"solid",origin:"primordial",type:"polyatomic",mass:78.9718},{number:35,label:"Br",period:4,group:7,leftH:!0,title:"Bromine",state:"liquid",origin:"primordial",type:"diatomic",mass:79.904},{number:36,label:"Kr",period:4,group:8,title:"Krypton",state:"gas",origin:"primordial",type:"noble",mass:83.7982},{number:37,label:"Rb",period:5,group:1,title:"Rubidium",state:"solid",origin:"primordial",type:"alkali",mass:85.46783},{number:38,label:"Sr",period:5,group:2,title:"Strontium",state:"solid",origin:"primordial",type:"alkaline-earth",mass:87.621},{number:39,label:"Y",period:5,group:3,title:"Yttrium",state:"solid",origin:"primordial",type:"transition",mass:88.905842},{number:40,label:"Zr",period:5,group:4,title:"Zirconium",state:"solid",origin:"primordial",type:"transition",mass:91.2242},{number:41,label:"Nb",period:5,group:5,title:"Niobium",state:"solid",origin:"primordial",type:"transition",mass:92.906372},{number:42,label:"Mo",period:5,group:6,title:"Molybdenum",state:"solid",origin:"primordial",type:"transition",mass:95.951},{number:43,label:"Tc",period:5,group:7,title:"Technetium",state:"solid",origin:"decay",type:"transition",mass:98},{number:44,label:"Ru",period:5,group:8,title:"Ruthenium",state:"solid",origin:"primordial",type:"transition",mass:101.072},{number:45,label:"Rh",period:5,group:8,title:"Rhodium",state:"solid",origin:"primordial",type:"transition",mass:102.905502},{number:46,label:"Pd",period:5,group:8,title:"Palladium",state:"solid",origin:"primordial",type:"transition",mass:106.421},{number:47,label:"Ag",period:5,group:1,title:"Silver",state:"solid",origin:"primordial",type:"transition",mass:107.86822},{number:48,label:"Cd",period:5,group:2,title:"Cadmium",state:"solid",origin:"primordial",type:"transition",mass:112.4144},{number:49,label:"In",period:5,group:3,title:"Indium",state:"solid",origin:"primordial",type:"post-transition",mass:114.8181},{number:50,label:"Sn",period:5,group:4,title:"Tin",state:"solid",origin:"primordial",type:"post-transition",mass:118.7107},{number:51,label:"Sb",period:5,group:5,title:"Antimony",state:"solid",origin:"primordial",type:"metalloid",mass:121.7601},{number:52,label:"Te",period:5,group:6,title:"Tellurium",state:"solid",origin:"primordial",type:"metalloid",mass:127.603},{number:53,label:"I",period:5,group:7,leftH:!0,title:"Iodine",state:"solid",origin:"primordial",type:"diatomic",mass:126.904473},{number:54,label:"Xe",period:5,group:8,title:"Xenon",state:"gas",origin:"primordial",type:"noble",mass:131.2936},{number:55,label:"Cs",period:6,group:1,title:"Caesium",state:"solid",origin:"primordial",type:"alkali",mass:132.905451966},{number:56,label:"Ba",period:6,group:2,title:"Barium",state:"solid",origin:"primordial",type:"alkaline-earth",mass:137.3277},{number:57,label:"La",period:6,group:3,title:"Lanthanum",state:"solid",origin:"primordial",type:"lanthanide",mass:138.905477},{number:58,label:"Ce",period:6,group:3,title:"Cerium",state:"solid",origin:"primordial",type:"lanthanide",mass:140.1161},{number:59,label:"Pr",period:6,group:3,title:"Praseodymium",state:"solid",origin:"primordial",type:"lanthanide",mass:140.907662},{number:60,label:"Nd",period:6,group:3,title:"Neodymium",state:"solid",origin:"primordial",type:"lanthanide",mass:144.2423},{number:61,label:"Pm",period:6,group:3,title:"Promethium",state:"solid",origin:"decay",type:"lanthanide",mass:145},{number:62,label:"Sm",period:6,group:3,title:"Samarium",state:"solid",origin:"primordial",type:"lanthanide",mass:150.362},{number:63,label:"Eu",period:6,group:3,title:"Europium",state:"solid",origin:"primordial",type:"lanthanide",mass:151.9641},{number:64,label:"Gd",period:6,group:3,title:"Gadolinium",state:"solid",origin:"primordial",type:"lanthanide",mass:157.253},{number:65,label:"Tb",period:6,group:3,title:"Terbium",state:"solid",origin:"primordial",type:"lanthanide",mass:158.925352},{number:66,label:"Dy",period:6,group:3,title:"Dysprosium",state:"solid",origin:"primordial",type:"lanthanide",mass:162.5001},{number:67,label:"Ho",period:6,group:3,title:"Holmium",state:"solid",origin:"primordial",type:"lanthanide",mass:164.930332},{number:68,label:"Er",period:6,group:3,title:"Erbium",state:"solid",origin:"primordial",type:"lanthanide",mass:167.2593},{number:69,label:"Tm",period:6,group:3,title:"Thulium",state:"solid",origin:"primordial",type:"lanthanide",mass:168.934222},{number:70,label:"Yb",period:6,group:3,title:"Ytterbium",state:"solid",origin:"primordial",type:"lanthanide",mass:173.0451},{number:71,label:"Lu",period:6,group:3,title:"Lutetium",state:"solid",origin:"primordial",type:"lanthanide",mass:174.96681},{number:72,label:"Hf",period:6,group:4,title:"Hafnium",state:"solid",origin:"primordial",type:"transition",mass:178.492},{number:73,label:"Ta",period:6,group:5,title:"Tantalum",state:"solid",origin:"primordial",type:"transition",mass:180.947882},{number:74,label:"W",period:6,group:6,title:"Tungsten",state:"solid",origin:"primordial",type:"transition",mass:183.841},{number:75,label:"Re",period:6,group:7,title:"Rhenium",state:"solid",origin:"primordial",type:"transition",mass:186.2071},{number:76,label:"Os",period:6,group:8,title:"Osmium",state:"solid",origin:"primordial",type:"transition",mass:190.233},{number:77,label:"Ir",period:6,group:8,title:"Iridium",state:"solid",origin:"primordial",type:"transition",mass:192.2173},{number:78,label:"Pt",period:6,group:8,title:"Platinum",state:"solid",origin:"primordial",type:"transition",mass:195.0849},{number:79,label:"Au",period:6,group:1,title:"Gold",state:"solid",origin:"primordial",type:"transition",mass:196.9665695},{number:80,label:"Hg",period:6,group:2,title:"Mercury",state:"liquid",origin:"primordial",type:"transition",mass:200.5923},{number:81,label:"Tl",period:6,group:3,title:"Thallium",state:"solid",origin:"primordial",type:"post-transition",mass:204.38},{number:82,label:"Pb",period:6,group:4,title:"Lead",state:"solid",origin:"primordial",type:"post-transition",mass:207.21},{number:83,label:"Bi",period:6,group:5,title:"Bismuth",state:"solid",origin:"primordial",type:"post-transition",mass:208.980401},{number:84,label:"Po",period:6,group:6,title:"Polonium",state:"solid",origin:"decay",type:"post-transition",mass:209},{number:85,label:"At",period:6,group:7,title:"Astatine",state:"solid",origin:"decay",type:"metalloid",mass:210},{number:86,label:"Rn",period:6,group:8,title:"Radon",state:"gas",origin:"decay",type:"noble",mass:222},{number:87,label:"Fr",period:7,group:1,title:"Francium",state:"solid",origin:"decay",type:"alkali",mass:223},{number:88,label:"Ra",period:7,group:2,title:"Radium",state:"solid",origin:"decay",type:"alkaline-earth",mass:226},{number:89,label:"Ac",period:7,group:3,title:"Actinium",state:"solid",origin:"decay",type:"actinide",mass:227},{number:90,label:"Th",period:7,group:3,title:"Thorium",state:"solid",origin:"primordial",type:"actinide",mass:232.03774},{number:91,label:"Pa",period:7,group:3,title:"Protactinium",state:"solid",origin:"decay",type:"actinide",mass:231.035882},{number:92,label:"U",period:7,group:3,title:"Uranium",state:"solid",origin:"primordial",type:"actinide",mass:238.028913},{number:93,label:"Np",period:7,group:3,title:"Neptunium",state:"solid",origin:"decay",type:"actinide",mass:237},{number:94,label:"Pu",period:7,group:3,title:"Plutonium",state:"solid",origin:"decay",type:"actinide",mass:244},{number:95,label:"Am",period:7,group:3,title:"Americium",state:"solid",origin:"synthetic",type:"actinide",mass:243},{number:96,label:"Cm",period:7,group:3,title:"Curium",state:"solid",origin:"synthetic",type:"actinide",mass:247},{number:97,label:"Bk",period:7,group:3,title:"Berkelium",state:"solid",origin:"synthetic",type:"actinide",mass:247},{number:98,label:"Cf",period:7,group:3,title:"Californium",state:"solid",origin:"synthetic",type:"actinide",mass:251},{number:99,label:"Es",period:7,group:3,title:"Einsteinium",state:"solid",origin:"synthetic",type:"actinide",mass:252},{number:100,label:"Fm",period:7,group:3,title:"Fermium",origin:"synthetic",type:"actinide",mass:257},{number:101,label:"Md",period:7,group:3,title:"Mendelevium",origin:"synthetic",type:"actinide",mass:258},{number:102,label:"No",period:7,group:3,title:"Nobelium",origin:"synthetic",type:"actinide",mass:259},{number:103,label:"Lr",period:7,group:3,title:"Lawrencium",origin:"synthetic",type:"actinide",mass:266},{number:104,label:"Rf",period:7,group:4,title:"Rutherfordium",origin:"synthetic",type:"transition",mass:267},{number:105,label:"Db",period:7,group:5,title:"Dubnium",origin:"synthetic",type:"transition",mass:268},{number:106,label:"Sg",period:7,group:6,title:"Seaborgium",origin:"synthetic",type:"transition",mass:269},{number:107,label:"Bh",period:7,group:7,title:"Bohrium",origin:"synthetic",type:"transition",mass:270},{number:108,label:"Hs",period:7,group:8,title:"Hassium",origin:"synthetic",type:"transition",mass:269},{number:109,label:"Mt",period:7,group:8,title:"Meitnerium",origin:"synthetic",mass:278},{number:110,label:"Ds",period:7,group:8,title:"Darmstadtium",origin:"synthetic",mass:281},{number:111,label:"Rg",period:7,group:1,title:"Roentgenium",origin:"synthetic",mass:282},{number:112,label:"Cn",period:7,group:2,title:"Copernicium",origin:"synthetic",type:"transition",mass:285},{number:113,label:"Nh",period:7,group:3,title:"Nihonium",origin:"synthetic",mass:286},{number:114,label:"Fl",period:7,group:4,title:"Flerovium",origin:"synthetic",type:"post-transition",mass:289},{number:115,label:"Mc",period:7,group:5,title:"Moscovium",origin:"synthetic",mass:289},{number:116,label:"Lv",period:7,group:6,title:"Livermorium",origin:"synthetic",mass:293},{number:117,label:"Ts",period:7,group:7,title:"Tennessine",origin:"synthetic",mass:294},{number:118,label:"Og",period:7,group:8,title:"Oganesson",origin:"synthetic",mass:294}],N=I.reduce((function(t,e){return t.set(e.label,e),t.set(e.number,e),t}),new Map),B={get:function(t){return N.get(t)},filter:function(t){return I.filter(t)}},Z={atom:{any:{labels:["A","AH"]},"no-carbon":{labels:["Q","QH"]},metal:{labels:["M","MH"]},halogen:{labels:["X","XH"]}},group:{labels:["G","GH","G*","GH*"],acyclic:{labels:["ACY","ACH"],carbo:{labels:["ABC","ABH"],alkynyl:{labels:["AYL","AYH"]},alkyl:{labels:["ALK","ALH"]},alkenyl:{labels:["AEL","AEH"]}},hetero:{labels:["AHC","AHH"],alkoxy:{labels:["AOX","AOH"]}}},cyclic:{labels:["CYC","CYH"],"no-carbon":{labels:["CXX","CXH"]},carbo:{labels:["CBC","CBH"],aryl:{labels:["ARY","ARH"]},cycloalkyl:{labels:["CAL","CAH"]},cycloalkenyl:{labels:["CEL","CEH"]}},hetero:{labels:["CHC","CHH"],aryl:{labels:["HAR","HAH"]}}}},special:{labels:["H+","D","T","R","Pol"]}};function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var D=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"notList",void 0),(0,i.Z)(this,"ids",void 0),this.notList=e.notList,this.ids=e.ids}return(0,o.Z)(t,[{key:"labelList",value:function(){var t,e=[],n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(this.ids);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=B.get(r);o&&e.push(o.label)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"label",value:function(){var t="["+this.labelList().join(",")+"]";return this.notList&&(t="!"+t),t}},{key:"equals",value:function(t){return this.notList===t.notList&&(this.ids||[]).sort().toString()===(t.ids||[]).sort().toString()}}]),t}(),z=function(){function t(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];if((0,r.Z)(this,t),(0,i.Z)(this,"x",void 0),(0,i.Z)(this,"y",void 0),(0,i.Z)(this,"z",void 0),0===n.length)this.x=0,this.y=0,this.z=0;else if(1===arguments.length)this.x=parseFloat(n[0].x||0),this.y=parseFloat(n[0].y||0),this.z=parseFloat(n[0].z||0);else if(2===arguments.length)this.x=parseFloat(n[0]||0),this.y=parseFloat(n[1]||0),this.z=0;else{if(3!==arguments.length)throw new Error("Vec2(): invalid arguments");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])}}return(0,o.Z)(t,[{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"equals",value:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}},{key:"add",value:function(e){return new t(this.x+e.x,this.y+e.y,this.z+e.z)}},{key:"add_",value:function(t){this.x+=t.x,this.y+=t.y,this.z+=t.z}},{key:"get_xy0",value:function(){return new t(this.x,this.y)}},{key:"sub",value:function(e){return new t(this.x-e.x,this.y-e.y,this.z-e.z)}},{key:"scaled",value:function(e){return new t(this.x*e,this.y*e,this.z*e)}},{key:"negated",value:function(){return new t(-this.x,-this.y,-this.z)}},{key:"yComplement",value:function(e){return e=e||0,new t(this.x,e-this.y,this.z)}},{key:"addScaled",value:function(e,n){return new t(this.x+e.x*n,this.y+e.y*n,this.z+e.z*n)}},{key:"normalized",value:function(){return this.scaled(1/this.length())}},{key:"normalize",value:function(){var t=this.length();return!(t<1e-6||(this.x/=t,this.y/=t,0))}},{key:"turnLeft",value:function(){return new t(-this.y,this.x,this.z)}},{key:"coordStr",value:function(){return this.x.toString()+" , "+this.y.toString()}},{key:"toString",value:function(){return"("+this.x.toFixed(2)+","+this.y.toFixed(2)+")"}},{key:"max",value:function(e){return s()(null!=e),t.max(this,e)}},{key:"min",value:function(e){return t.min(this,e)}},{key:"ceil",value:function(){return new t(Math.ceil(this.x),Math.ceil(this.y),Math.ceil(this.z))}},{key:"floor",value:function(){return new t(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z))}},{key:"rotate",value:function(t){var e=Math.sin(t),n=Math.cos(t);return this.rotateSC(e,n)}},{key:"rotateSC",value:function(e,n){return s()(0===e||!!e),s()(0===n||!!n),new t(this.x*n-this.y*e,this.x*e+this.y*n,this.z)}},{key:"oxAngle",value:function(){return Math.atan2(this.y,this.x)}}],[{key:"dist",value:function(e,n){return t.diff(e,n).length()}},{key:"max",value:function(e,n){return new t(Math.max(e.x,n.x),Math.max(e.y,n.y),Math.max(e.z,n.z))}},{key:"min",value:function(e,n){return new t(Math.min(e.x,n.x),Math.min(e.y,n.y),Math.min(e.z,n.z))}},{key:"sum",value:function(e,n){return new t(e.x+n.x,e.y+n.y,e.z+n.z)}},{key:"dot",value:function(t,e){return t.x*e.x+t.y*e.y}},{key:"cross",value:function(t,e){return t.x*e.y-t.y*e.x}},{key:"angle",value:function(e,n){return Math.atan2(t.cross(e,n),t.dot(e,n))}},{key:"diff",value:function(e,n){return new t(e.x-n.x,e.y-n.y,e.z-n.z)}},{key:"lc",value:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var o=new t,i=0;i<arguments.length/2;++i)o=o.addScaled(n[2*i],n[2*i+1]);return o}},{key:"lc2",value:function(e,n,r,o){return new t(e.x*n+r.x*o,e.y*n+r.y*o,e.z*n+r.z*o)}},{key:"centre",value:function(e,n){return t.lc2(e,.5,n,.5)}}]),t}();function F(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return G(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}(0,i.Z)(z,"ZERO",new z(0,0)),(0,i.Z)(z,"UNIT",new z(1,1));var H,V=function(t){(0,u.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function a(){return(0,r.Z)(this,a),i.apply(this,arguments)}return(0,o.Z)(a,[{key:"find",value:function(t){var e,n=F(this);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(t(r))return r}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"equals",value:function(t){return this.isSuperset(t)&&t.isSuperset(this)}},{key:"isSuperset",value:function(t){var e,n=F(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!this.has(r))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"filter",value:function(t){return new a(Array.from(this).filter(t))}},{key:"union",value:function(t){var e,n=new a(this),r=F(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;n.add(o)}}catch(t){r.e(t)}finally{r.f()}return n}}]),a}(p(Set));function U(t,e){return void 0!==t?t:e}function q(t){return(t-=0)===W.PATTERN.RADICAL.DOUPLET?1:t===W.PATTERN.RADICAL.SINGLET||t===W.PATTERN.RADICAL.TRIPLET?2:0}!function(t){t.Abs="abs",t.And="&",t.Or="or"}(H||(H={}));var W=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"label",void 0),(0,i.Z)(this,"fragment",void 0),(0,i.Z)(this,"atomList",void 0),(0,i.Z)(this,"attpnt",void 0),(0,i.Z)(this,"isotope",void 0),(0,i.Z)(this,"hCount",void 0),(0,i.Z)(this,"radical",void 0),(0,i.Z)(this,"charge",void 0),(0,i.Z)(this,"explicitValence",void 0),(0,i.Z)(this,"ringBondCount",void 0),(0,i.Z)(this,"unsaturatedAtom",void 0),(0,i.Z)(this,"substitutionCount",void 0),(0,i.Z)(this,"valence",void 0),(0,i.Z)(this,"implicitH",void 0),(0,i.Z)(this,"pp",void 0),(0,i.Z)(this,"neighbors",void 0),(0,i.Z)(this,"sgs",void 0),(0,i.Z)(this,"badConn",void 0),(0,i.Z)(this,"alias",void 0),(0,i.Z)(this,"rglabel",void 0),(0,i.Z)(this,"aam",void 0),(0,i.Z)(this,"invRet",void 0),(0,i.Z)(this,"exactChangeFlag",void 0),(0,i.Z)(this,"rxnFragmentType",void 0),(0,i.Z)(this,"stereoLabel",void 0),(0,i.Z)(this,"stereoParity",void 0),(0,i.Z)(this,"hasImplicitH",void 0),(0,i.Z)(this,"pseudo",void 0),this.label=e.label,this.fragment=U(e.fragment,-1),this.alias=U(e.alias,t.attrlist.alias),this.isotope=U(e.isotope,t.attrlist.isotope),this.radical=U(e.radical,t.attrlist.radical),this.charge=U(e.charge,t.attrlist.charge),this.rglabel=U(e.rglabel,t.attrlist.rglabel),this.attpnt=U(e.attpnt,t.attrlist.attpnt),this.explicitValence=U(e.explicitValence,t.attrlist.explicitValence),this.valence=0,this.implicitH=e.implicitH||0,this.pp=e.pp?new z(e.pp):new z,this.sgs=new V,this.ringBondCount=U(e.ringBondCount,t.attrlist.ringBondCount),this.substitutionCount=U(e.substitutionCount,t.attrlist.substitutionCount),this.unsaturatedAtom=U(e.unsaturatedAtom,t.attrlist.unsaturatedAtom),this.hCount=U(e.hCount,t.attrlist.hCount),this.aam=U(e.aam,t.attrlist.aam),this.invRet=U(e.invRet,t.attrlist.invRet),this.exactChangeFlag=U(e.exactChangeFlag,t.attrlist.exactChangeFlag),this.rxnFragmentType=U(e.rxnFragmentType,-1),this.stereoLabel=U(e.stereoLabel,t.attrlist.stereoLabel),this.stereoParity=U(e.stereoParity,t.attrlist.stereoParity),this.atomList=e.atomList?new D(e.atomList):null,this.neighbors=[],this.badConn=!1,Object.defineProperty(this,"pseudo",{enumerable:!0,get:function(){return t=this.label,B.get(t)||"L"===t||"L#"===t||"R#"===t?"":t;var t}})}return(0,o.Z)(t,[{key:"clone",value:function(e){var n=new t(this);return e&&e.has(this.fragment)&&(n.fragment=e.get(this.fragment)),n}},{key:"isQuery",value:function(){return null!==this.atomList||"A"===this.label||this.attpnt||this.hCount}},{key:"pureHydrogen",value:function(){return"H"===this.label&&0===this.isotope}},{key:"isPlainCarbon",value:function(){return"C"===this.label&&0===this.isotope&&0===this.radical&&0===this.charge&&this.explicitValence<0&&0===this.ringBondCount&&0===this.substitutionCount&&0===this.unsaturatedAtom&&0===this.hCount&&!this.atomList}},{key:"isPseudo",value:function(){return!this.atomList&&!this.rglabel&&!B.get(this.label)}},{key:"hasRxnProps",value:function(){return!!(this.invRet||this.exactChangeFlag||null!==this.attpnt||this.aam)}},{key:"calcValence",value:function(t){var e=this.label,n=this.charge;if(this.isQuery())return this.implicitH=0,!0;var r=B.get(e);if(!r)return this.implicitH=0,!0;var o=r.group,i=q(this.radical),a=t,s=0,u=Math.abs(n);return 1===o?"H"!==e&&"Li"!==e&&"Na"!==e&&"K"!==e&&"Rb"!==e&&"Cs"!==e&&"Fr"!==e||(a=1,s=1-i-t-u):2===o?t+i+u===2||t+i+u===0?a=2:s=-1:3===o?"B"===e||"Al"===e||"Ga"===e||"In"===e?-1===n?(a=4,s=4-i-t):(a=3,s=3-i-t-u):"Tl"===e&&(-1===n?i+t<=2?(a=2,s=2-i-t):(a=4,s=4-i-t):-2===n?i+t<=3?(a=3,s=3-i-t):(a=5,s=5-i-t):i+t+u<=1?(a=1,s=1-i-t-u):(a=3,s=3-i-t-u)):4===o?"C"===e||"Si"===e||"Ge"===e?(a=4,s=4-i-t-u):"Sn"!==e&&"Pb"!==e||(t+i+u<=2?(a=2,s=2-i-t-u):(a=4,s=4-i-t-u)):5===o?"N"===e||"P"===e?1===n?(a=4,s=4-i-t):2===n?(a=3,s=3-i-t):"N"===e||i+t+u<=3?(a=3,s=3-i-t-u):(a=5,s=5-i-t-u):"Bi"!==e&&"Sb"!==e&&"As"!==e||(1===n?i+t<=2&&"As"!==e?(a=2,s=2-i-t):(a=4,s=4-i-t):2===n?(a=3,s=3-i-t):i+t<=3?(a=3,s=3-i-t-u):(a=5,s=5-i-t-u)):6===o?"O"===e?n>=1?(a=3,s=3-i-t):(a=2,s=2-i-t-u):"S"===e||"Se"===e||"Po"===e?1===n?t<=3?(a=3,s=3-i-t):(a=5,s=5-i-t):t+i+u<=2?(a=2,s=2-i-t-u):t+i+u<=4?(a=4,s=4-i-t-u):(a=6,s=6-i-t-u):"Te"===e&&(-1===n?t<=2&&(a=2,s=2-i-t-u):0!==n&&2!==n||(t<=2?(a=2,s=2-i-t-u):t<=4?(a=4,s=4-i-t-u):0===n&&t<=6?(a=6,s=6-i-t-u):s=-1)):7===o?"F"===e?(a=1,s=1-i-t-u):"Cl"!==e&&"Br"!==e&&"I"!==e&&"At"!==e||(1===n?t<=2?(a=2,s=2-i-t):(3===t||5===t||t>=7)&&(s=-1):0===n&&(t<=1?(a=1,s=1-i-t):2===t||4===t||6===t?1===i?(a=t,s=0):s=-1:t>7&&(s=-1))):8===o&&(t+i+u===0?a=1:s=-1),this.valence=a,this.implicitH=s,!(this.implicitH<0&&(this.valence=t,this.implicitH=0,this.badConn=!0,1))}},{key:"calcValenceMinusHyd",value:function(t){var e=this.charge,n=this.label,r=B.get(this.label);if(!r)return this.implicitH=0,0;var o=r.group,i=q(this.radical);if(3===o){if(("B"===n||"Al"===n||"Ga"===n||"In"===n)&&-1===e&&i+t<=4)return i+t}else if(5===o){if("N"===n||"P"===n){if(1===e)return i+t;if(2===e)return i+t}else if("Sb"===n||"Bi"===n||"As"===n){if(1===e)return i+t;if(2===e)return i+t}}else if(6===o){if("O"===n){if(e>=1)return i+t}else if(("S"===n||"Se"===n||"Po"===n)&&1===e)return i+t}else if(7===o&&("Cl"===n||"Br"===n||"I"===n||"At"===n)&&1===e)return i+t;return i+t+Math.abs(e)}}],[{key:"getAttrHash",value:function(e){var n={};for(var r in t.attrlist)void 0!==e[r]&&(n[r]=e[r]);return n}},{key:"attrGetDefault",value:function(e){if(e in t.attrlist)return t.attrlist[e]}}]),t}();(0,i.Z)(W,"PATTERN",{RADICAL:{NONE:0,SINGLET:1,DOUPLET:2,TRIPLET:3},STEREO_PARITY:{NONE:0,ODD:1,EVEN:2,EITHER:3}}),(0,i.Z)(W,"attrlist",{alias:null,label:"C",isotope:0,radical:0,charge:0,explicitValence:-1,ringBondCount:0,substitutionCount:0,unsaturatedAtom:0,hCount:0,atomList:null,invRet:0,exactChangeFlag:0,rglabel:null,attpnt:null,aam:0,stereoLabel:null,stereoParity:0});var Y,$=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"begin",void 0),(0,i.Z)(this,"end",void 0),(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"xxx",void 0),(0,i.Z)(this,"stereo",void 0),(0,i.Z)(this,"topology",void 0),(0,i.Z)(this,"reactingCenterStatus",void 0),(0,i.Z)(this,"len",void 0),(0,i.Z)(this,"sb",void 0),(0,i.Z)(this,"sa",void 0),(0,i.Z)(this,"hb1",void 0),(0,i.Z)(this,"hb2",void 0),(0,i.Z)(this,"angle",void 0),(0,i.Z)(this,"center",void 0),this.begin=e.begin,this.end=e.end,this.type=e.type,this.xxx=e.xxx||"",this.stereo=t.PATTERN.STEREO.NONE,this.topology=t.PATTERN.TOPOLOGY.EITHER,this.reactingCenterStatus=0,this.len=0,this.sb=0,this.sa=0,this.angle=0,e.stereo&&(this.stereo=e.stereo),e.topology&&(this.topology=e.topology),e.reactingCenterStatus&&(this.reactingCenterStatus=e.reactingCenterStatus),this.center=new z}return(0,o.Z)(t,[{key:"hasRxnProps",value:function(){return!!this.reactingCenterStatus}},{key:"getCenter",value:function(t){var e=t.atoms.get(this.begin).pp,n=t.atoms.get(this.end).pp;return z.lc2(e,.5,n,.5)}},{key:"getDir",value:function(t){var e=t.atoms.get(this.begin).pp;return t.atoms.get(this.end).pp.sub(e).normalized()}},{key:"clone",value:function(e){var n=new t(this);return e&&(n.begin=e.get(n.begin),n.end=e.get(n.end)),n}}],[{key:"getAttrHash",value:function(e){var n={};for(var r in t.attrlist)(e[r]||"stereo"===r)&&(n[r]=e[r]);return n}},{key:"attrGetDefault",value:function(e){if(e in t.attrlist)return t.attrlist[e]}}]),t}();function K(t,e,n){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,n)}function J(t,e){if(e&&0!==e.length){var n=e.map((function(e){return t.atoms.get(e)})).filter((function(t){return null==t?void 0:t.stereoLabel}));if(n.length){var r,o=n[0].stereoLabel;if(n.some((function(t){return(null==t?void 0:t.stereoLabel)!==o})))r=Y.Mixed;else{var i,a=null===(i=o.match(/\D+/g))||void 0===i?void 0:i[0];switch(a){case H.Abs:r=Y.Abs;break;case H.And:r=Y.And;break;case H.Or:r=Y.Or;break;default:throw new Error("Unsupported stereo label: ".concat(a,"."))}}return r}}}(0,i.Z)($,"PATTERN",{TYPE:{SINGLE:1,DOUBLE:2,TRIPLE:3,AROMATIC:4,SINGLE_OR_DOUBLE:5,SINGLE_OR_AROMATIC:6,DOUBLE_OR_AROMATIC:7,ANY:8,DATIVE:9,HYDROGEN:10},STEREO:{NONE:0,UP:1,EITHER:4,DOWN:6,CIS_TRANS:3},TOPOLOGY:{EITHER:0,RING:1,CHAIN:2},REACTING_CENTER:{NOT_CENTER:-1,UNMARKED:0,CENTER:1,UNCHANGED:2,MADE_OR_BROKEN:4,ORDER_CHANGED:8,MADE_OR_BROKEN_AND_CHANGED:12}}),(0,i.Z)($,"attrlist",{type:$.PATTERN.TYPE.SINGLE,stereo:$.PATTERN.STEREO.NONE,topology:$.PATTERN.TOPOLOGY.EITHER,reactingCenterStatus:$.PATTERN.REACTING_CENTER.UNMARKED}),function(t){t.Mixed="MIXED",t.Abs="ABS",t.And="AND",t.Or="OR"}(Y||(Y={}));var X=new WeakMap,Q=new WeakMap,tt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;(0,r.Z)(this,t),K(this,X,{writable:!0,value:void 0}),(0,i.Z)(this,"stereoFlagPosition",void 0),K(this,Q,{writable:!0,value:void 0}),n&&(this.stereoFlagPosition=new z(n)),(0,m.Z)(this,Q,e)}return(0,o.Z)(t,[{key:"stereoAtoms",get:function(){return(0,v.Z)((0,g.Z)(this,Q))}},{key:"enhancedStereoFlag",get:function(){return(0,g.Z)(this,X)}},{key:"clone",value:function(e){var n=new t((0,g.Z)(this,Q).map((function(t){return e.get(t)})),this.stereoFlagPosition);return(0,m.Z)(n,X,(0,g.Z)(this,X)),n}},{key:"updateStereoFlag",value:function(t){return(0,m.Z)(this,X,J(t,this.stereoAtoms)),(0,g.Z)(this,X)}},{key:"updateStereoAtom",value:function(t,e,n,r){var o;r&&!(0,g.Z)(this,Q).includes(e)&&(0,g.Z)(this,Q).push(e),r||(null===(o=t.atoms.get(e))||void 0===o?void 0:o.fragment)===n&&Array.from(t.bonds.values()).filter((function(t){return t.stereo&&t.type!==$.PATTERN.TYPE.DOUBLE})).some((function(t){return t.begin===e}))||(0,m.Z)(this,Q,this.stereoAtoms.filter((function(t){return t!==e}))),(0,m.Z)(this,X,J(t,this.stereoAtoms))}},{key:"addStereoAtom",value:function(t){return!(0,g.Z)(this,Q).includes(t)&&(this.stereoAtoms.push(t),!0)}},{key:"deleteStereoAtom",value:function(t,e,n){var r;return!((null===(r=t.atoms.get(n))||void 0===r?void 0:r.fragment)===e&&Array.from(t.bonds.values()).filter((function(t){return t.stereo&&t.type!==$.PATTERN.TYPE.DOUBLE})).some((function(t){return t.begin===n}))||((0,m.Z)(this,Q,(0,g.Z)(this,Q).filter((function(t){return t!==n}))),0))}}],[{key:"getDefaultStereoFlagPosition",value:function(t,e){var n=t.getFragment(e);if(n){var r=n.getCoordBoundingBox();return new z(r.max.x,r.min.y-1)}}}]),t}(),et={scaled2obj:function(t,e){return t.scaled(1/e.scale)},obj2scaled:function(t,e){return t.scaled(e.scale)}},nt=function(t,e,n,r){var o,i=r.atoms.get(t.begin),a=NaN;return 2===(null==n?void 0:n.length)&&(a=n[0].aid===t.begin?n[1].aid:n[0].aid),t.stereo>0&&(1!==(null==n?void 0:n.length)||2!==(null==e?void 0:e.length)||Number(null==i?void 0:i.implicitH)%2!=0)&&(2!==(null==n?void 0:n.length)||2!==(null==e?void 0:e.length)||Number(null==i?void 0:i.implicitH)%2!=0||1!==(null===(o=r.atomGetNeighbors(a))||void 0===o?void 0:o.length))&&1!==(null==e?void 0:e.length)},rt=function(){function t(){(0,r.Z)(this,t),(0,i.Z)(this,"functionalGroupsList",void 0),this.functionalGroupsList=[]}return(0,o.Z)(t,[{key:"getFunctionalGroupsList",value:function(){return this.functionalGroupsList}},{key:"setFunctionalGroupsList",value:function(t){this.functionalGroupsList=t}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();(0,i.Z)(rt,"instance",void 0);var ot=function(){function t(){(0,r.Z)(this,t),(0,i.Z)(this,"p0",void 0),(0,i.Z)(this,"p1",void 0);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];if(1===n.length&&"min"in n[0]&&"max"in n[0]&&(this.p0=n[0].min,this.p1=n[0].max),2===n.length)this.p0=n[0],this.p1=n[1];else if(4===n.length)this.p0=new z(n[0],n[1]),this.p1=new z(n[2],n[3]);else{if(0!==n.length)throw new Error("Box2Abs constructor only accepts 4 numbers or 2 vectors or no args!");this.p0=new z,this.p1=new z}}return(0,o.Z)(t,[{key:"toString",value:function(){return this.p0.toString()+" "+this.p1.toString()}},{key:"clone",value:function(){return new t(this.p0,this.p1)}},{key:"extend",value:function(e,n){return n=n||e,new t(this.p0.sub(e),this.p1.add(n))}},{key:"include",value:function(e){return s()(null!=e),new t(this.p0.min(e),this.p1.max(e))}},{key:"contains",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return s()(null!=t),t.x>=this.p0.x-e&&t.x<=this.p1.x+e&&t.y>=this.p0.y-e&&t.y<=this.p1.y+e}},{key:"translate",value:function(e){return new t(this.p0.add(e),this.p1.add(e))}},{key:"transform",value:function(e,n){return s()("function"==typeof e),new t(e(this.p0,n),e(this.p1,n))}},{key:"sz",value:function(){return this.p1.sub(this.p0)}},{key:"centre",value:function(){return z.centre(this.p0,this.p1)}},{key:"pos",value:function(){return this.p0}}],[{key:"fromRelBox",value:function(e){return new t(e.x,e.y,e.x+e.width,e.y+e.height)}},{key:"union",value:function(e,n){return new t(z.min(e.p0,n.p0),z.max(e.p1,n.p1))}},{key:"segmentIntersection",value:function(t,e,n,r){var o=(t.x-n.x)*(e.y-n.y)-(t.y-n.y)*(e.x-n.x),i=(t.x-r.x)*(e.y-r.y)-(t.y-r.y)*(e.x-r.x),a=(n.x-t.x)*(r.y-t.y)-(n.y-t.y)*(r.x-t.x),s=(n.x-e.x)*(r.y-e.y)-(n.y-e.y)*(r.x-e.x);return o*i<=0&&a*s<=0}}]),t}(),it=function t(e,n,o,a){(0,r.Z)(this,t),(0,i.Z)(this,"c",void 0),(0,i.Z)(this,"d",void 0),(0,i.Z)(this,"n",void 0),(0,i.Z)(this,"w",void 0),(0,i.Z)(this,"h",void 0),this.c=e,this.d=n,this.n=n.rotateSC(1,0),this.w=o,this.h=a},at=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"label",void 0),(0,i.Z)(this,"bracketBox",void 0),(0,i.Z)(this,"bracketDir",void 0),(0,i.Z)(this,"areas",void 0),(0,i.Z)(this,"hover",void 0),(0,i.Z)(this,"hovering",void 0),(0,i.Z)(this,"selected",void 0),(0,i.Z)(this,"selectionPlate",void 0),(0,i.Z)(this,"atoms",void 0),(0,i.Z)(this,"atomSet",void 0),(0,i.Z)(this,"parentAtomSet",void 0),(0,i.Z)(this,"patoms",void 0),(0,i.Z)(this,"allAtoms",void 0),(0,i.Z)(this,"bonds",void 0),(0,i.Z)(this,"xBonds",void 0),(0,i.Z)(this,"neiAtoms",void 0),(0,i.Z)(this,"pp",void 0),(0,i.Z)(this,"data",void 0),this.type=e,this.id=-1,this.label=-1,this.bracketBox=null,this.bracketDir=new z(1,0),this.areas=[],this.hover=!1,this.hovering=null,this.selected=!1,this.selectionPlate=null,this.atoms=[],this.patoms=[],this.bonds=[],this.xBonds=[],this.neiAtoms=[],this.pp=null,this.data={mul:1,connectivity:"ht",name:"",subscript:"n",expanded:void 0,attached:!1,absolute:!0,showUnits:!1,nCharsToDisplay:-1,tagChar:"",daspPos:1,fieldType:"F",fieldName:"",fieldValue:"",units:"",query:"",queryOp:""}}return(0,o.Z)(t,[{key:"getAttr",value:function(t){return this.data[t]}},{key:"getAttrs",value:function(){var t=this,e={};return Object.keys(this.data).forEach((function(n){e[n]=t.data[n]})),e}},{key:"setAttr",value:function(t,e){var n=this.data[t];return this.data[t]=e,n}},{key:"checkAttr",value:function(t,e){return this.data[t]===e}},{key:"updateOffset",value:function(t){this.pp=z.sum(this.bracketBox.p1,t)}},{key:"calculatePP",value:function(e){var n;if("Atom"===this.data.context||"Bond"===this.data.context){var r=[],o=null,i=new z(1,0);this.atoms.forEach((function(t){var n=e.atoms.get(t),o=new z(n.pp),i=new z(.05*3,.05*3),a=new ot(o,o).extend(i,i);r.push(a)})),r.forEach((function(t){var e=null;[t.p0.x,t.p1.x].forEach((function(n){[t.p0.y,t.p1.y].forEach((function(t){var r=new z(n,t),o=new z(z.dot(r,i),z.dot(r,i.rotateSC(1,0)));e=e?e.include(o):new ot(o,o)}))})),o=o?ot.union(o,e):e})),n=o.p0}else n=this.bracketBox.p1.add(new z(.5,.5));for(var a=Array.from(e.sgroups.values()),s=0;s<e.sgroups.size&&st(a,n);++s)n=n.add(new z(0,.5));if("INDIGO_CIP_DESC"===this.data.fieldName)if(1===this.atoms.length){var u,c=this.atoms[0],l=null===(u=e.atoms.get(c))||void 0===u?void 0:u.pp;l&&(n=l)}else n=t.getMassCentre(e,this.atoms);this.pp=n}}],[{key:"getOffset",value:function(t){return null!=t&&t.pp?z.diff(t.pp,t.bracketBox.p1):null}},{key:"filterAtoms",value:function(t,e){for(var n=[],r=0;r<t.length;++r){var o=t[r];"number"!=typeof e[o]?n.push(o):e[o]>=0?n.push(e[o]):n.push(-1)}return n}},{key:"removeNegative",value:function(t){for(var e=[],n=0;n<t.length;++n)t[n]>=0&&e.push(t[n]);return e}},{key:"filter",value:function(e,n,r){n.atoms=t.removeNegative(t.filterAtoms(n.atoms,r))}},{key:"clone",value:function(e,n){var r=new t(e.type);return Object.keys(e.data).forEach((function(t){r.data[t]=e.data[t]})),r.atoms=e.atoms.map((function(t){return n.get(t)})),r.pp=e.pp,r.bracketBox=e.bracketBox,r.patoms=null,r.bonds=null,r.allAtoms=e.allAtoms,r.data.expanded=e.data.expanded,r}},{key:"addAtom",value:function(t,e){t.atoms.push(e)}},{key:"removeAtom",value:function(t,e){for(var n=0;n<t.atoms.length;++n)if(t.atoms[n]===e)return void t.atoms.splice(n,1)}},{key:"getCrossBonds",value:function(t,e){var n={};return t.bonds.forEach((function(t,r){e.has(t.begin)&&!e.has(t.end)?(n[t.begin]||(n[t.begin]=[]),n[t.begin].push(r)):e.has(t.end)&&!e.has(t.begin)&&(n[t.end]||(n[t.end]=[]),n[t.end].push(r))})),n}},{key:"bracketPos",value:function(t,e,n){var r=t.atoms,o=Object.values(n).flat();if(o&&2===o.length){var i=e.bonds.get(o[0]).getCenter(e),a=e.bonds.get(o[1]).getCenter(e);t.bracketDir=z.diff(a,i).normalized()}else t.bracketDir=new z(1,0);var s=t.bracketDir,u=null,c=[];r.forEach((function(t){var n=e.atoms.get(t),r=new z(n.pp),o=new z(.05*3,.05*3),i=new ot(r,r).extend(o,o);c.push(i)})),c.forEach((function(t){var e=null;[t.p0.x,t.p1.x].forEach((function(n){[t.p0.y,t.p1.y].forEach((function(t){var r=new z(n,t),o=new z(z.dot(r,s),z.dot(r,s.rotateSC(1,0)));e=e?e.include(o):new ot(o,o)}))})),u=u?ot.union(u,e):e}));var l=new z(.2,.4);u&&(u=u.extend(l,l)),t.bracketBox=u}},{key:"getBracketParameters",value:function(t,e,n,r,o,i){var a,s,u,c,l,f,h=[],d=Object.values(e),p=d.flat();return p.length<2?function(){o=o||new z(1,0),i=i||o.rotateSC(1,0);var t=Math.min(.25,.3*r.sz().x),e=z.lc2(o,r.p0.x,i,.5*(r.p0.y+r.p1.y)),n=z.lc2(o,r.p1.x,i,.5*(r.p0.y+r.p1.y)),a=r.sz().y;h.push(new it(e,o.negated(),t,a),new it(n,o,t,a))}():2===p.length&&2===d.length?(a=t.bonds.get(p[0]),s=t.bonds.get(p[1]),u=a.getCenter(t),c=s.getCenter(t),f=(l=z.diff(c,u).normalized()).negated(),h.push(new it(u.addScaled(f,0),f,.25,1.5),new it(c.addScaled(l,0),l,.25,1.5))):function(){for(var e=0;e<p.length;++e){var r=t.bonds.get(p[e]),o=r.getCenter(t),i=n.has(r.begin)?r.getDir(t):r.getDir(t).negated();h.push(new it(o,i,.2,1))}}(),h}},{key:"getObjBBox",value:function(t,e){for(var n=e.atoms.get(t[0]).pp,r=new ot(n,n),o=1;o<t.length;++o){var i=t[o],a=e.atoms.get(i).pp;r=r.include(a)}return r}},{key:"getAtoms",value:function(t,e){if(!e.allAtoms)return e.atoms;var n=[];return t.atoms.forEach((function(t,e){n.push(e)})),n}},{key:"getBonds",value:function(e,n){var r=t.getAtoms(e,n),o=[];return e.bonds.forEach((function(t,e){r.indexOf(t.begin)>=0&&r.indexOf(t.end)>=0&&o.push(e)})),o}},{key:"prepareMulForSaving",value:function(t,e){t.atoms.sort((function(t,e){return t-e})),t.atomSet=new V(t.atoms),t.parentAtomSet=new V(t.atomSet);var n=[],r=[];if(e.bonds.forEach((function(e,o){t.parentAtomSet.has(e.begin)&&t.parentAtomSet.has(e.end)?n.push(o):(t.parentAtomSet.has(e.begin)||t.parentAtomSet.has(e.end))&&r.push(o)})),0!==r.length&&2!==r.length)throw Error("Unsupported cross-bonds number");var o=-1,i=-1,a=null;if(2===r.length){var s=e.bonds.get(r[0]);o=t.parentAtomSet.has(s.begin)?s.begin:s.end;var u=e.bonds.get(r[1]);i=t.parentAtomSet.has(u.begin)?u.begin:u.end,a=u}for(var c=i,l=[],f=function(){var r={};t.atoms.forEach((function(n){var o=e.atoms.get(n),i=e.atoms.add(new W(o));l.push(i),t.atomSet.add(i),r[n]=i})),n.forEach((function(t){var n=e.bonds.get(t),o=new $(n);o.begin=r[o.begin],o.end=r[o.end],e.bonds.add(o)})),null!==a&&((d=new $(a)).begin=c,d.end=r[o],e.bonds.add(d),c=r[i])},h=0;h<t.data.mul-1;h++){var d;f()}if(c>=0){var p=e.bonds.get(r[1]);p.begin===i?p.begin=c:p.end=c}t.bonds=r,l.forEach((function(n){e.sGroupForest.getPathToRoot(t.id).reverse().forEach((function(t){e.atomAddToSGroup(t,n)}))}))}},{key:"getMassCentre",value:function(t,e){for(var n=new z,r=0;r<e.length;++r)n=n.addScaled(t.atoms.get(e[r]).pp,1/e.length);return n}}]),t}();function st(t,e){return t.some((function(t){if(!t.pp)return!1;var n=t.pp.add(new z(.5,.5)),r=e.add(new z(.5,.5));return ot.segmentIntersection(t.pp,n,e,r)}))}function ut(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ct(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}(0,i.Z)(at,"TYPES",{SUP:"SUP",MUL:"MUL",SRU:"SRU",MON:"MON",MER:"MER",COP:"COP",CRO:"CRO",MOD:"MOD",GRA:"GRA",COM:"COM",MIX:"MIX",FOR:"FOR",DAT:"DAT",ANY:"ANY",GEN:"GEN"});var lt,ft=new WeakMap,ht=function(){function t(e){var n,o,i;(0,r.Z)(this,t),i={writable:!0,value:void 0},function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,o=ft),o.set(n,i),s()(null!=e),(0,m.Z)(this,ft,e)}return(0,o.Z)(t,[{key:"name",get:function(){return(0,g.Z)(this,ft).data.name}},{key:"relatedSGroupId",get:function(){return(0,g.Z)(this,ft).id}},{key:"isExpanded",get:function(){return(0,g.Z)(this,ft).data.expanded}},{key:"relatedSGroup",get:function(){return(0,g.Z)(this,ft)}}],[{key:"isFunctionalGroup",value:function(t){return rt.getInstance().getFunctionalGroupsList().some((function(e){return e.name===t.data.name}))&&"SUP"===t.type}},{key:"atomsInFunctionalGroup",value:function(t,e){if(0===t.size)return null;var n,r=ut(t.values());try{for(r.s();!(n=r.n()).done;)if(n.value.relatedSGroup.atoms.includes(e))return e}catch(t){r.e(t)}finally{r.f()}return null}},{key:"bondsInFunctionalGroup",value:function(t,e,n){if(0===e.size)return null;var r,o=ut(e.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;if(at.getBonds(t,i.relatedSGroup).includes(n))return n}}catch(t){o.e(t)}finally{o.f()}return null}},{key:"findFunctionalGroupByAtom",value:function(t,e){var n,r=ut(t.values());try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.relatedSGroup.atoms.includes(e))return o.relatedSGroupId}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"findFunctionalGroupByBond",value:function(t,e,n){var r,o=ut(e.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;if(at.getBonds(t,i.relatedSGroup).includes(n))return i.relatedSGroupId}}catch(t){o.e(t)}finally{o.f()}return null}},{key:"clone",value:function(e){return new t((0,g.Z)(e,ft))}},{key:"isFirstAtomInFunctionalGroup",value:function(e,n){var r,o=ut(e.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;if(t.isFunctionalGroup(i)&&n===i.atoms[0])return!0}}catch(t){o.e(t)}finally{o.f()}return!1}},{key:"isAtomInContractedFunctionalGroup",value:function(e,n,r,o){var i=[];return o?n.forEach((function(e){t.isContractedFunctionalGroup(e.item.id,r)&&i.push(e.item.id)})):n.forEach((function(e){t.isContractedFunctionalGroup(e.id,r)&&i.push(e.id)})),i.some((function(t){return e.sgs.has(t)}))}},{key:"isBondInContractedFunctionalGroup",value:function(e,n,r,o){var i=[];return o?n.forEach((function(e){t.isContractedFunctionalGroup(e.item.id,r)&&i.push.apply(i,(0,v.Z)(e.item.atoms))})):n.forEach((function(e){t.isContractedFunctionalGroup(e.id,r)&&i.push.apply(i,(0,v.Z)(e.atoms))})),i.includes(e.begin)&&i.includes(e.end)}},{key:"isContractedFunctionalGroup",value:function(t,e){var n=!1,r=!1;return e.forEach((function(e){e.relatedSGroupId===t&&(n=!0,r=e.isExpanded)})),!r&&n}}]),t}(),dt=function t(e,n,o){(0,r.Z)(this,t),(0,i.Z)(this,"begin",void 0),(0,i.Z)(this,"end",void 0),(0,i.Z)(this,"bid",void 0),(0,i.Z)(this,"dir",void 0),(0,i.Z)(this,"norm",void 0),(0,i.Z)(this,"ang",void 0),(0,i.Z)(this,"p",void 0),(0,i.Z)(this,"loop",void 0),(0,i.Z)(this,"contra",void 0),(0,i.Z)(this,"next",void 0),(0,i.Z)(this,"leftSin",void 0),(0,i.Z)(this,"leftCos",void 0),(0,i.Z)(this,"leftNeighbor",void 0),(0,i.Z)(this,"rightSin",void 0),(0,i.Z)(this,"rightCos",void 0),(0,i.Z)(this,"rightNeighbor",void 0),s()(3===arguments.length,"Invalid parameter number."),this.begin=e,this.end=n,this.bid=o,this.dir=new z,this.norm=new z,this.ang=0,this.p=new z,this.loop=-1,this.contra=-1,this.next=-1,this.leftSin=0,this.leftCos=0,this.leftNeighbor=0,this.rightSin=0,this.rightCos=0,this.rightNeighbor=0},pt=function t(e,n,o){var a=this;(0,r.Z)(this,t),(0,i.Z)(this,"hbs",void 0),(0,i.Z)(this,"dblBonds",void 0),(0,i.Z)(this,"aromatic",void 0),(0,i.Z)(this,"convex",void 0),this.hbs=e,this.dblBonds=0,this.aromatic=!0,this.convex=o||!1,e.forEach((function(t){var e=n.bonds.get(n.halfBonds.get(t).bid);e.type!==$.PATTERN.TYPE.AROMATIC&&(a.aromatic=!1),e.type===$.PATTERN.TYPE.DOUBLE&&a.dblBonds++}))},vt=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"frags",void 0),(0,i.Z)(this,"resth",void 0),(0,i.Z)(this,"range",void 0),(0,i.Z)(this,"ifthen",void 0),this.frags=new V,this.resth=(null==e?void 0:e.resth)||!1,this.range=(null==e?void 0:e.range)||"",this.ifthen=(null==e?void 0:e.ifthen)||0}return(0,o.Z)(t,[{key:"getAttrs",value:function(){return{resth:this.resth,range:this.range,ifthen:this.ifthen}}},{key:"clone",value:function(e){var n=new t(this);return this.frags.forEach((function(t){n.frags.add(e?e.get(t):t)})),n}}],[{key:"findRGroupByFragment",value:function(t,e){return t.find((function(t,n){return n.frags.has(e)}))}}]),t}();!function(t){t.OpenAngle="open-angle",t.FilledTriangle="filled-triangle",t.FilledBow="filled-bow",t.DashedOpenAngle="dashed-open-angle",t.Failed="failed",t.BothEndsFilledTriangle="both-ends-filled-triangle",t.EquilibriumFilledTriangle="equilibrium-filled-triangle",t.EquilibriumFilledHalfBow="equilibrium-filled-half-bow",t.EquilibriumOpenAngle="equilibrium-open-angle",t.UnbalancedEquilibriumFilledHalfBow="unbalanced-equilibrium-filled-half-bow",t.UnbalancedEquilibriumOpenHalfAngle="unbalanced-equilibrium-open-half-angle",t.UnbalancedEquilibriumLargeFilledHalfBow="unbalanced-equilibrium-large-filled-half-bow",t.UnbalancedEquilibriumFilleHalfTriangle="unbalanced-equilibrium-fille-half-triangle"}(lt||(lt={}));var mt,gt=function(){function t(e){if((0,r.Z)(this,t),(0,i.Z)(this,"mode",void 0),(0,i.Z)(this,"pos",void 0),this.pos=[],e.pos)for(var n=0;n<e.pos.length;n++){var o=e.pos[n];this.pos[n]=o?new z(e.pos[n]):new z}this.mode=e.mode}return(0,o.Z)(t,[{key:"clone",value:function(){return new t(this)}},{key:"center",value:function(){return z.centre(this.pos[0],this.pos[1])}}]),t}(),yt=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"pp",void 0),this.pp=null!=e&&e.pp?new z(e.pp):new z}return(0,o.Z)(t,[{key:"clone",value:function(){return new t(this)}}]),t}(),bt=function(){function t(){(0,r.Z)(this,t),(0,i.Z)(this,"parent",void 0),(0,i.Z)(this,"children",void 0),(0,i.Z)(this,"atomSets",void 0),this.parent=new Map,this.children=new Map,this.children.set(-1,[]),this.atomSets=new Map}return(0,o.Z)(t,[{key:"getSGroupsBFS",value:function(){for(var t=[],e=Array.from(this.children.get(-1));e.length>0;){var n=e.shift();if("number"!=typeof n)break;var r=this.children.get(n);if(void 0===r)break;r.forEach((function(t){e.push(t)})),t.push(n)}return t}},{key:"getAtomSetRelations",value:function(t,e){var n=this,r=new Map,o=new Map;this.atomSets.delete(t),this.atomSets.forEach((function(t,n){o.set(n,t.isSuperset(e)),r.set(n,e.isSuperset(t)&&!t.equals(e))}));var i=Array.from(this.atomSets.keys()).filter((function(t){if(!o.get(t))return!1;var e=n.children.get(t);return e&&e.findIndex((function(t){return o.get(t)}))<0}));return{children:Array.from(this.atomSets.keys()).filter((function(t){return r.get(t)&&!r.get(n.parent.get(t))})),parent:0===i.length?-1:i[0]}}},{key:"getPathToRoot",value:function(t){for(var e=[],n=t;n>=0;n=this.parent.get(n))e.push(n);return e}},{key:"insert",value:function(t,e,n){var r,o=this,i=t.id,a=t.atoms;if(s()(!this.parent.has(i),"sgid already present in the forest"),s()(!this.children.has(i),"sgid already present in the forest"),!e||!n){var u=this.getAtomSetRelations(i,new V(a));e=u.parent,n=u.children}return n.forEach((function(t){o.resetParentLink(t,i)})),this.children.set(i,n.filter((function(t){return o.parent.get(t)}))),this.parent.set(i,e),null===(r=this.children.get(e))||void 0===r||r.push(i),this.atomSets.set(i,new V(a)),{parent:e,children:n}}},{key:"resetParentLink",value:function(t,e){var n=this.parent.get(t);if(void 0!==n){var r=this.children.get(n);if(r){var o=r.indexOf(t);r.splice(o,1),this.parent.set(t,e)}}}},{key:"remove",value:function(t){var e,n=this;s()(this.parent.has(t),"sgid is not in the forest"),s()(this.children.has(t),"sgid is not in the forest");var r=this.parent.get(t),o=this.children.get(r);null===(e=this.children.get(t))||void 0===e||e.forEach((function(t){var e;n.parent.set(t,r),null===(e=n.children.get(r))||void 0===e||e.push(t)}));var i=o.indexOf(t);o.splice(i,1),this.children.delete(t),this.parent.delete(t),this.atomSets.delete(t)}}]),t}();function wt(t,e){var n=e.reduce((function(e,n){var r=t.atoms.get(n);return e.union(r.sgs)}),new V);return Array.from(n).some((function(n){var r=t.sgroups.get(n);if("DAT"===r.type)return!1;var o=at.getAtoms(t,r);return o.length<e.length?o.findIndex((function(t){return-1===e.indexOf(t)}))>=0:e.findIndex((function(t){return-1===o.indexOf(t)}))>=0}))}!function(t){t.ellipse="ellipse",t.rectangle="rectangle",t.line="line"}(mt||(mt={}));var xt=function(){function t(e){if((0,r.Z)(this,t),(0,i.Z)(this,"pos",void 0),(0,i.Z)(this,"mode",void 0),this.pos=[],null!=e&&e.pos)for(var n=0;n<e.pos.length;n++){var o=e.pos[n];this.pos[n]=o?new z(e.pos[n]):new z}this.mode=(null==e?void 0:e.mode)||mt.line}return(0,o.Z)(t,[{key:"clone",value:function(){return new t(this)}},{key:"center",value:function(){return this.mode===mt.rectangle?z.centre(this.pos[0],this.pos[1]):this.pos[0]}}]),t}();function Ot(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Et(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Et(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var _t=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(){var t;(0,r.Z)(this,s);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,i.Z)((0,b.Z)(t),"nextId",0),t}return(0,o.Z)(s,[{key:"add",value:function(t){var e=this.nextId++;return x((0,l.Z)(s.prototype),"set",this).call(this,e,t),e}},{key:"newId",value:function(){return this.nextId++}},{key:"keyOf",value:function(t){var e,n=Ot(this.entries());try{for(n.s();!(e=n.n()).done;){var r=(0,y.Z)(e.value,2),o=r[0];if(r[1]===t)return o}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"find",value:function(t){var e,n=Ot(this.entries());try{for(n.s();!(e=n.n()).done;){var r=(0,y.Z)(e.value,2),o=r[0];if(t(o,r[1]))return o}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"filter",value:function(t){return new s(Array.from(this).filter((function(e){var n=(0,y.Z)(e,2),r=n[0],o=n[1];return t(r,o)})))}},{key:"some",value:function(t){var e,n=Ot(this.values());try{for(n.s();!(e=n.n()).done;)if(t(e.value))return!0}catch(t){n.e(t)}finally{n.f()}return!1}}]),s}(p(Map));function St(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return!1;return t.push(e),!0}var jt,At=function(){function t(){(0,r.Z)(this,t),(0,i.Z)(this,"atoms",void 0),(0,i.Z)(this,"bonds",void 0),(0,i.Z)(this,"sgroups",void 0),(0,i.Z)(this,"halfBonds",void 0),(0,i.Z)(this,"loops",void 0),(0,i.Z)(this,"isReaction",void 0),(0,i.Z)(this,"rxnArrows",void 0),(0,i.Z)(this,"rxnPluses",void 0),(0,i.Z)(this,"frags",void 0),(0,i.Z)(this,"rgroups",void 0),(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"sGroupForest",void 0),(0,i.Z)(this,"simpleObjects",void 0),(0,i.Z)(this,"texts",void 0),(0,i.Z)(this,"functionalGroups",void 0),(0,i.Z)(this,"highlights",void 0),this.atoms=new _t,this.bonds=new _t,this.sgroups=new _t,this.halfBonds=new _t,this.loops=new _t,this.isReaction=!1,this.rxnArrows=new _t,this.rxnPluses=new _t,this.frags=new _t,this.rgroups=new _t,this.name="",this.sGroupForest=new bt,this.simpleObjects=new _t,this.texts=new _t,this.functionalGroups=new _t,this.highlights=new _t}return(0,o.Z)(t,[{key:"hasRxnProps",value:function(){return!(!this.atoms.find((function(t,e){return e.hasRxnProps()}))&&!this.bonds.find((function(t,e){return e.hasRxnProps()})))}},{key:"hasRxnArrow",value:function(){return 1===this.rxnArrows.size}},{key:"hasRxnPluses",value:function(){return this.rxnPluses.size>0}},{key:"isRxn",value:function(){return this.hasRxnArrow()||this.hasRxnPluses()}},{key:"isBlank",value:function(){return 0===this.atoms.size&&0===this.rxnArrows.size&&0===this.rxnPluses.size&&0===this.simpleObjects.size&&0===this.texts.size}},{key:"clone",value:function(e,n,r,o,i,a){return this.mergeInto(new t,e,n,r,!1,o,i,a)}},{key:"getScaffold",value:function(){var t=this,e=new V;return this.atoms.forEach((function(t,n){e.add(n)})),this.rgroups.forEach((function(n){n.frags.forEach((function(n,r){t.atoms.forEach((function(t,n){t.fragment===r&&e.delete(n)}))}))})),this.clone(e)}},{key:"getFragmentIds",value:function(t){var e=new V;return this.atoms.forEach((function(n,r){n.fragment===t&&e.add(r)})),e}},{key:"getFragment",value:function(t){return this.clone(this.getFragmentIds(t),null,!0)}},{key:"mergeInto",value:function(t,e,n,r,o,i,a,s){var u=this;e=e||new V(this.atoms.keys()),n=n||new V(this.bonds.keys()),a=a||new V(this.simpleObjects.keys()),s=s||new V(this.texts.keys()),i=i||new Map,n=n.filter((function(t){var n=u.bonds.get(t);return e.has(n.begin)&&e.has(n.end)}));var c=new V;this.atoms.forEach((function(t,n){e.has(n)&&c.add(t.fragment)}));var l=new Map;this.frags.forEach((function(e,n){c.has(n)&&l.set(n,t.frags.add(null))}));var f=[];this.rgroups.forEach((function(e,n){var r=o;if(r||(e.frags.forEach((function(t,e){f.push(e),c.has(e)&&(r=!0)})),r)){var i=t.rgroups.get(n);i?e.frags.forEach((function(t,e){f.push(e),c.has(e)&&i.frags.add(l.get(e))})):t.rgroups.set(n,e.clone(l))}})),this.atoms.forEach((function(n,r){e.has(r)&&-1===f.indexOf(n.fragment)&&i.set(r,t.atoms.add(n.clone(l)))})),this.atoms.forEach((function(n,r){e.has(r)&&-1!==f.indexOf(n.fragment)&&i.set(r,t.atoms.add(n.clone(l)))})),l.forEach((function(e,n){var r=u.frags.get(n);r&&r instanceof tt&&t.frags.set(e,u.frags.get(n).clone(i))}));var h=new Map;return this.bonds.forEach((function(e,r){n.has(r)&&h.set(r,t.bonds.add(e.clone(i)))})),this.sgroups.forEach((function(n){if(!n.atoms.some((function(t){return!e.has(t)}))){n=at.clone(n,i);var r=t.sgroups.add(n);n.id=r,n.atoms.forEach((function(e){var n=t.atoms.get(e);n&&n.sgs.add(r)})),"DAT"===n.type?t.sGroupForest.insert(n,-1,[]):t.sGroupForest.insert(n)}})),this.functionalGroups.forEach((function(e){e=ht.clone(e),t.functionalGroups.add(e)})),a.forEach((function(e){t.simpleObjects.add(u.simpleObjects.get(e).clone())})),s.forEach((function(e){t.texts.add(u.texts.get(e).clone())})),r||(t.isReaction=this.isReaction,this.rxnArrows.forEach((function(e){t.rxnArrows.add(e.clone())})),this.rxnPluses.forEach((function(e){t.rxnPluses.add(e.clone())}))),t.name=this.name,t}},{key:"prepareLoopStructure",value:function(){this.initHalfBonds(),this.initNeighbors(),this.updateHalfBonds(Array.from(this.atoms.keys())),this.sortNeighbors(Array.from(this.atoms.keys())),this.findLoops()}},{key:"atomAddToSGroup",value:function(t,e){at.addAtom(this.sgroups.get(t),e),this.atoms.get(e).sgs.add(t)}},{key:"calcConn",value:function(t){for(var e=0,n=0;n<t.neighbors.length;++n){var r=this.halfBonds.get(t.neighbors[n]);switch(this.bonds.get(r.bid).type){case $.PATTERN.TYPE.SINGLE:e+=1;break;case $.PATTERN.TYPE.DOUBLE:e+=2;break;case $.PATTERN.TYPE.TRIPLE:e+=3;break;case $.PATTERN.TYPE.DATIVE:case $.PATTERN.TYPE.HYDROGEN:break;case $.PATTERN.TYPE.AROMATIC:return 1===t.neighbors.length?[-1,!0]:[t.neighbors.length,!0];default:return[-1,!1]}}return[e,!1]}},{key:"findBondId",value:function(t,e){return this.bonds.find((function(n,r){return r.begin===t&&r.end===e||r.begin===e&&r.end===t}))}},{key:"initNeighbors",value:function(){var t=this;this.atoms.forEach((function(t){t.neighbors=[]})),this.bonds.forEach((function(e){var n=t.atoms.get(e.begin),r=t.atoms.get(e.end);n.neighbors.push(e.hb1),r.neighbors.push(e.hb2)}))}},{key:"bondInitHalfBonds",value:function(t,e){(e=e||this.bonds.get(t)).hb1=2*t,e.hb2=2*t+1,this.halfBonds.set(e.hb1,new dt(e.begin,e.end,t)),this.halfBonds.set(e.hb2,new dt(e.end,e.begin,t));var n=this.halfBonds.get(e.hb1),r=this.halfBonds.get(e.hb2);n.contra=e.hb2,r.contra=e.hb1}},{key:"halfBondUpdate",value:function(t){var e=this.halfBonds.get(t),n=this.atoms.get(e.begin).pp,r=this.atoms.get(e.end).pp,o=z.diff(r,n).normalized();e.dir=z.dist(r,n)>1e-4?o:new z(1,0),e.norm=e.dir.turnLeft(),e.ang=e.dir.oxAngle(),e.loop<0&&(e.loop=-1)}},{key:"initHalfBonds",value:function(){var t=this;this.halfBonds.clear(),this.bonds.forEach((function(e,n){t.bondInitHalfBonds(n,e)}))}},{key:"setHbNext",value:function(t,e){this.halfBonds.get(this.halfBonds.get(t).contra).next=e}},{key:"halfBondSetAngle",value:function(t,e){var n=this.halfBonds.get(t),r=this.halfBonds.get(e);r.rightCos=z.dot(r.dir,n.dir),n.leftCos=z.dot(r.dir,n.dir),r.rightSin=z.cross(r.dir,n.dir),n.leftSin=z.cross(r.dir,n.dir),n.leftNeighbor=e,r.rightNeighbor=t}},{key:"atomAddNeighbor",value:function(t){for(var e=this.halfBonds.get(t),n=this.atoms.get(e.begin),r=0;r<n.neighbors.length&&!(this.halfBonds.get(n.neighbors[r]).ang>e.ang);++r);n.neighbors.splice(r,0,t);var o=n.neighbors[(r+1)%n.neighbors.length],i=n.neighbors[(r+n.neighbors.length-1)%n.neighbors.length];this.setHbNext(i,t),this.setHbNext(t,o),this.halfBondSetAngle(t,i),this.halfBondSetAngle(o,t)}},{key:"atomSortNeighbors",value:function(t){var e=this,n=this.atoms.get(t),r=this.halfBonds;n.neighbors.sort((function(t,e){return r.get(t).ang-r.get(e).ang})).forEach((function(t,r){var o=n.neighbors[(r+1)%n.neighbors.length];e.halfBonds.get(e.halfBonds.get(t).contra).next=o,e.halfBondSetAngle(o,t)}))}},{key:"sortNeighbors",value:function(t){var e=this;t?t.forEach((function(t){e.atomSortNeighbors(t)})):this.atoms.forEach((function(t,n){e.atomSortNeighbors(n)}))}},{key:"atomUpdateHalfBonds",value:function(t){var e=this;this.atoms.get(t).neighbors.forEach((function(t){e.halfBondUpdate(t),e.halfBondUpdate(e.halfBonds.get(t).contra)}))}},{key:"updateHalfBonds",value:function(t){var e=this;t?t.forEach((function(t){e.atomUpdateHalfBonds(t)})):this.atoms.forEach((function(t,n){e.atomUpdateHalfBonds(n)}))}},{key:"sGroupsRecalcCrossBonds",value:function(){var t=this;this.sgroups.forEach((function(t){t.xBonds=[],t.neiAtoms=[]})),this.bonds.forEach((function(e,n){var r=t.atoms.get(e.begin),o=t.atoms.get(e.end);r.sgs.forEach((function(r){if(!o.sgs.has(r)){var i=t.sgroups.get(r);i.xBonds.push(n),St(i.neiAtoms,e.end)}})),o.sgs.forEach((function(o){if(!r.sgs.has(o)){var i=t.sgroups.get(o);i.xBonds.push(n),St(i.neiAtoms,e.begin)}}))}))}},{key:"sGroupDelete",value:function(t){var e=this;this.sgroups.get(t).atoms.forEach((function(n){e.atoms.get(n).sgs.delete(t)})),this.sGroupForest.remove(t),this.sgroups.delete(t)}},{key:"atomSetPos",value:function(t,e){this.atoms.get(t).pp=e}},{key:"rxnPlusSetPos",value:function(t,e){this.rxnPluses.get(t).pp=e}},{key:"rxnArrowSetPos",value:function(t,e){var n=this.rxnArrows.get(t);n&&(n.pos=e)}},{key:"simpleObjectSetPos",value:function(t,e){this.simpleObjects.get(t).pos=e}},{key:"textSetPosition",value:function(t,e){var n=this.texts.get(t);n&&(n.position=e)}},{key:"getCoordBoundingBox",value:function(t){var e=null;function n(t){e?t instanceof Array?t.forEach((function(t){e.min=z.min(e.min,t),e.max=z.max(e.max,t)})):(e.min=z.min(e.min,t),e.max=z.max(e.max,t)):e={min:t,max:t}}var r=!t||0===t.size;return this.atoms.forEach((function(e,o){(r||t.has(o))&&n(e.pp)})),r&&(this.rxnPluses.forEach((function(t){n(t.pp)})),this.rxnArrows.forEach((function(t){n(t.pos)})),this.simpleObjects.forEach((function(t){n(t.pos)})),this.texts.forEach((function(t){n(t.position)}))),!e&&r&&(e={min:new z(0,0),max:new z(1,1)}),e}},{key:"getCoordBoundingBoxObj",value:function(){var t=null;return this.atoms.forEach((function(e){var n;n=e.pp,t?(t.min=z.min(t.min,n),t.max=z.max(t.max,n)):t={min:new z(n),max:new z(n)}})),t}},{key:"getBondLengthData",value:function(){var t=this,e=0,n=0;return this.bonds.forEach((function(r){e+=z.dist(t.atoms.get(r.begin).pp,t.atoms.get(r.end).pp),n++})),{cnt:n,totalLength:e}}},{key:"getAvgBondLength",value:function(){var t=this.getBondLengthData();return t.cnt>0?t.totalLength/t.cnt:-1}},{key:"getAvgClosestAtomDistance",value:function(){var t,e,n,r=0,o=0,i=Array.from(this.atoms.keys());for(e=0;e<i.length;++e){for(t=-1,n=0;n<i.length;++n)n!==e&&(o=z.dist(this.atoms.get(i[n]).pp,this.atoms.get(i[e]).pp),(t<0||t>o)&&(t=o));r+=t}return i.length>0?r/i.length:-1}},{key:"checkBondExists",value:function(t,e){return void 0!==this.bonds.find((function(n,r){return r.begin===t&&r.end===e||r.end===t&&r.begin===e}))}},{key:"findConnectedComponent",value:function(t){for(var e=this,n=[t],r=new V;n.length>0;){var o=n.pop();r.add(o),this.atoms.get(o).neighbors.forEach((function(t){var o=e.halfBonds.get(t).end;r.has(o)||n.push(o)}))}return r}},{key:"findConnectedComponents",value:function(t){var e=this;this.halfBonds.size||(this.initHalfBonds(),this.initNeighbors(),this.updateHalfBonds(Array.from(this.atoms.keys())),this.sortNeighbors(Array.from(this.atoms.keys())));var n=new V,r=[];return this.atoms.forEach((function(o,i){if((t||o.fragment<0)&&!n.has(i)){var a=e.findConnectedComponent(i);r.push(a),n=n.union(a)}})),r}},{key:"markFragment",value:function(t){var e=this,n=new tt,r=this.frags.add(n);t.forEach((function(t){var o=e.atoms.get(t);o.stereoLabel&&n.updateStereoAtom(e,t,r,!0),o.fragment=r}))}},{key:"markFragments",value:function(){var t=this;this.findConnectedComponents().forEach((function(e){t.markFragment(e)}))}},{key:"scale",value:function(t){1!==t&&(this.atoms.forEach((function(e){e.pp=e.pp.scaled(t)})),this.rxnPluses.forEach((function(e){e.pp=e.pp.scaled(t)})),this.rxnArrows.forEach((function(e){e.pos=e.pos.map((function(e){return e.scaled(t)}))})),this.sgroups.forEach((function(e){e.pp=e.pp?e.pp.scaled(t):null})))}},{key:"rescale",value:function(){var t=this.getAvgBondLength();t<0&&!this.isReaction&&(t=this.getAvgClosestAtomDistance()),t<.001&&(t=1);var e=1/t;this.scale(e)}},{key:"loopHasSelfIntersections",value:function(t){for(var e=0;e<t.length;++e)for(var n=this.halfBonds.get(t[e]),r=this.atoms.get(n.begin).pp,o=this.atoms.get(n.end).pp,i=new V([n.begin,n.end]),a=e+2;a<t.length;++a){var s=this.halfBonds.get(t[a]);if(!i.has(s.begin)&&!i.has(s.end)){var u=this.atoms.get(s.begin).pp,c=this.atoms.get(s.end).pp;if(ot.segmentIntersection(r,o,u,c))return!0}}return!1}},{key:"partitionLoop",value:function(t){for(var e=[],n=!0;n;){var r={};n=!1;for(var o=0;o<t.length;++o){var i=t[o],a=this.halfBonds.get(i).begin,s=this.halfBonds.get(i).end;if(s in r){var u=r[s],c=t.slice(u,o+1);e.push(c),o<t.length&&t.splice(u,o-u+1),n=!0;break}r[a]=o}n||e.push(t)}return e}},{key:"halfBondAngle",value:function(t,e){var n=this.halfBonds.get(t),r=this.halfBonds.get(e);return Math.atan2(z.cross(n.dir,r.dir),z.dot(n.dir,r.dir))}},{key:"loopIsConvex",value:function(t){var e=this;return t.every((function(t,n,r){return e.halfBondAngle(t,r[(n+1)%r.length])<=0}))}},{key:"loopIsInner",value:function(t){var e=this,n=2*Math.PI;return t.forEach((function(t,r,o){var i=o[(r+1)%o.length],a=e.halfBonds.get(i),s=e.halfBondAngle(t,i);n+=a.contra===t?Math.PI:s})),Math.abs(n)<Math.PI}},{key:"findLoops",value:function(){var t,e,n,r=this,o=[],i=new V;return this.halfBonds.forEach((function(a,s){if(-1===a.loop)for(t=s,e=0,n=[];e<=r.halfBonds.size;t=r.halfBonds.get(t).next,++e){if(e>0&&t===s){r.partitionLoop(n).forEach((function(t){var e;r.loopIsInner(t)&&!r.loopHasSelfIntersections(t)?(e=Math.min.apply(Math,(0,v.Z)(t)),r.loops.set(e,new pt(t,r,r.loopIsConvex(t)))):e=-2,t.forEach((function(t){r.halfBonds.get(t).loop=e,i.add(r.halfBonds.get(t).bid)})),e>=0&&o.push(e)}));break}n.push(t)}})),{newLoops:o,bondsToMark:Array.from(i)}}},{key:"calcImplicitHydrogen",value:function(t){var e=this.atoms.get(t),n=this.calcConn(e),r=(0,y.Z)(n,2),o=r[0],i=r[1],a=o;if(e.badConn=!1,i)if("C"===e.label&&0===e.charge){if(3===o)return void(e.implicitH=-q(e.radical));if(2===o)return void(e.implicitH=1-q(e.radical))}else{if("O"===e.label&&0===e.charge||"N"===e.label&&0===e.charge&&3===o||"N"===e.label&&1===e.charge&&3===o||"S"===e.label&&0===e.charge&&3===o)return void(e.implicitH=0);e.hasImplicitH||a++}if(a<0||e.isQuery())e.implicitH=0;else if(e.explicitValence>=0){var s=B.get(e.label);e.implicitH=s?e.explicitValence-e.calcValenceMinusHyd(a):0,e.implicitH<0&&(e.implicitH=0,e.badConn=!0)}else e.calcValence(a)}},{key:"setImplicitHydrogen",value:function(t){var e=this;this.sgroups.forEach((function(t){"MRV_IMPLICIT_H"===t.data.fieldName&&(e.atoms.get(t.atoms[0]).hasImplicitH=!0)})),t?t.forEach((function(t){e.atoms.get(t)&&e.calcImplicitHydrogen(t)})):this.atoms.forEach((function(t,n){e.calcImplicitHydrogen(n)}))}},{key:"atomGetNeighbors",value:function(t){var e,n=this;return null===(e=this.atoms.get(t))||void 0===e?void 0:e.neighbors.map((function(t){var e=n.halfBonds.get(t);return{aid:e.end,bid:e.bid}}))}},{key:"getComponents",value:function(){var t=this,e=this.findConnectedComponents(!0),n=[],r=null;this.rxnArrows.forEach((function(t){r=t.center().x})),this.rxnPluses.forEach((function(t){n.push(t.pp.x)})),null!==r&&n.push(r),n.sort((function(t,e){return t-e}));var o=[];e.forEach((function(e){for(var r=t.getCoordBoundingBox(e),i=z.lc2(r.min,.5,r.max,.5),a=0;i.x>n[a];)++a;o[a]=o[a]||new V,o[a]=o[a].union(e)}));var i=[],a=[];return o.forEach((function(e){e&&(1===t.defineRxnFragmentTypeForAtomset(e,r||0)?i.push(e):a.push(e))})),{reactants:i,products:a}}},{key:"defineRxnFragmentTypeForAtomset",value:function(t,e){var n=this.getCoordBoundingBox(t);return z.lc2(n.min,.5,n.max,.5).x<e?1:2}},{key:"getBondFragment",value:function(t){var e,n,r=null===(e=this.bonds.get(t))||void 0===e?void 0:e.begin;return r&&(null===(n=this.atoms.get(r))||void 0===n?void 0:n.fragment)}},{key:"bindSGroupsToFunctionalGroups",value:function(){var t=this;this.sgroups.forEach((function(e){ht.isFunctionalGroup(e)&&t.functionalGroups.add(new ht(e))}))}}]),t}();!function(t){t.Bold="BOLD",t.Italic="ITALIC",t.Subscript="SUBSCRIPT",t.Superscript="SUPERSCRIPT",t.FontSize="CUSTOM_FONT_SIZE"}(jt||(jt={}));var Pt=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"content",void 0),(0,i.Z)(this,"position",void 0),this.content=(null==e?void 0:e.content)||"",this.position=null!=e&&e.position?new z(e.position):new z}return(0,o.Z)(t,[{key:"clone",value:function(){return new t(this)}}]),t}(),kt=function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"atoms",void 0),(0,i.Z)(this,"bonds",void 0),(0,i.Z)(this,"color",void 0);var n=e.atoms,o=e.bonds,a=e.color;this.color=a,this.atoms=n,this.bonds=o};function Tt(t,e,n,r){null==n||n===r||Array.isArray(n)&&0===n.length||(t[e]=n)}function Ct(t){return("number"==typeof t?t:parseFloat(t)).toFixed(8)}function Rt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mt(t){var e={atoms:Array.from(t.atoms.values()).map((function(t){return"R#"===t.label?function(t){var e={type:"rg-label"};return Tt(e,"location",[t.pp.x,t.pp.y,t.pp.z]),Tt(e,"attachmentPoints",t.attpnt,0),Tt(e,"$refs",function(t){var e,n,r=[];for(e=0;e<32;e++)t&1<<e&&(n=e+1,r.push(n));return r}(t.rglabel).map((function(t){return"rg-".concat(t)}))),e}(t):"L#"===t.label?(Tt(n={type:"atom-list"},"location",[(e=t).pp.x,e.pp.y,e.pp.z]),Tt(n,"attachmentPoints",e.attpnt,0),Tt(n,"elements",e.atomList.labelList()),Tt(n,"notList",e.atomList.notList,!1),n):function(t){var e={};return Tt(e,"label",t.label),Tt(e,"alias",t.alias),Tt(e,"location",[t.pp.x,-t.pp.y,t.pp.z]),Tt(e,"charge",t.charge,0),Tt(e,"explicitValence",t.explicitValence,-1),Tt(e,"isotope",t.isotope,0),Tt(e,"radical",t.radical,0),Tt(e,"attachmentPoints",t.attpnt,0),Tt(e,"stereoLabel",t.stereoLabel,null),Tt(e,"stereoParity",t.stereoCare,0),Tt(e,"weight",t.weight,0),Tt(e,"ringBondCount",t.ringBondCount,0),Tt(e,"substitutionCount",t.substitutionCount,0),Tt(e,"unsaturatedAtom",!!t.unsaturatedAtom,!1),Tt(e,"hCount",t.hCount,0),Tt(e,"mapping",parseInt(t.aam),0),Tt(e,"invRet",t.invRet,0),Tt(e,"exactChangeFlag",!!t.exactChangeFlag,!1),e}(t);var e,n}))};0!==t.bonds.size&&(e.bonds=Array.from(t.bonds.values()).map(It)),0!==t.sgroups.size&&(e.sgroups=Array.from(t.sgroups.values()).map((function(e){return function(t,e){var n={};switch(Tt(n,"type",e.type),Tt(n,"atoms",e.atoms),e.type){case"GEN":break;case"MUL":Tt(n,"mul",e.data.mul||1);break;case"SRU":Tt(n,"subscript",e.data.subscript||"n"),Tt(n,"connectivity",e.data.connectivity.toUpperCase()||"ht");break;case"SUP":Tt(n,"name",e.data.name||""),Tt(n,"expanded",e.data.expanded),Tt(n,"id",e.id);break;case"DAT":var r=e.data;Tt(n,"placement",r.absolute,!0),Tt(n,"display",r.attached,!1),Tt(n,"context",r.context),Tt(n,"fieldName",r.fieldName),Tt(n,"fieldData",r.fieldValue),Tt(n,"bonds",at.getBonds(t,e))}return n}(t,e)})));var n=t.frags.get(0);return n&&Tt(e,"stereoFlagPosition",n.stereoFlagPosition,null),function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rt(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({type:"molecule"},e)}function It(t){var e={};return Tt(e,"type",t.type),Tt(e,"atoms",[t.begin,t.end]),Tt(e,"stereo",t.stereo,0),Tt(e,"topology",t.topology,0),Tt(e,"center",t.reactingCenterStatus,0),e}function Nt(t){var e=new At;return t.atoms.forEach((function(t){var n,r;"rg-label"===t.type&&e.atoms.add(function(t){var e,n,r={label:"R#"};return Tt(r,"pp",{x:t.location[0],y:t.location[1],z:t.location[2]||0}),Tt(r,"attpnt",t.attachmentPoints),Tt(r,"rglabel",(e=t.$refs.map((function(t){return parseInt(t.slice(3))})),n=0,e.forEach((function(t){n|=1<<t-1})),n)),new W(r)}(t)),"atom-list"===t.type&&e.atoms.add(function(t){var e={label:"L#"};return Tt(e,"pp",{x:t.location[0],y:t.location[1],z:t.location[2]||0}),Tt(e,"attpnt",t.attachmentPoints),Tt(e,"atomList",{ids:t.elements.map((function(t){var e;return null===(e=B.get(t))||void 0===e?void 0:e.number})).filter((function(t){return t})),notList:t.notList}),new W(e)}(t)),t.type||e.atoms.add((Tt(r={},"label",(n=t).label),Tt(r,"alias",n.alias),Tt(r,"pp",{x:n.location[0],y:-n.location[1],z:n.location[2]||0}),Tt(r,"charge",n.charge),Tt(r,"explicitValence",n.explicitValence),Tt(r,"isotope",n.isotope),Tt(r,"radical",n.radical),Tt(r,"attpnt",n.attachmentPoints),Tt(r,"stereoLabel",n.stereoLabel),Tt(r,"stereoParity",n.stereoParity),Tt(r,"weight",n.weight),Tt(r,"ringBondCount",n.ringBondCount),Tt(r,"substitutionCount",n.substitutionCount),Tt(r,"unsaturatedAtom",n.unsaturatedAtom),Tt(r,"hCount",n.hCount),Tt(r,"aam",n.mapping),Tt(r,"invRet",n.invRet),Tt(r,"exactChangeFlag",!!n.exactChangeFlag),new W(r)))})),t.bonds&&t.bonds.forEach((function(t){return e.bonds.add((Tt(r={},"type",(n=t).type),Tt(r,"topology",n.topology),Tt(r,"reactingCenterStatus",n.center),Tt(r,"stereo",n.stereo),Tt(r,"begin",n.atoms[0]),Tt(r,"end",n.atoms[1]),new $(r)));var n,r})),t.sgroups&&t.sgroups.forEach((function(t){return e.sgroups.add(function(t){var e=new at(t.type);switch(Tt(e,"atoms",t.atoms),t.type){case"GEN":break;case"MUL":Tt(e.data,"mul",t.mul);break;case"SRU":Tt(e.data,"subscript",t.subscript),Tt(e.data,"connectivity",t.connectivity.toLowerCase());break;case"SUP":Tt(e.data,"name",t.name),Tt(e.data,"expanded",t.expanded),Tt(e,"id",t.id);break;case"DAT":Tt(e.data,"absolute",t.placement),Tt(e.data,"attached",t.display),Tt(e.data,"context",t.context),Tt(e.data,"fieldName",t.fieldName),Tt(e.data,"fieldValue",t.fieldData)}return e}(t))})),e.initHalfBonds(),e.initNeighbors(),e.markFragments(),e.bindSGroupsToFunctionalGroups(),e}function Bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zt(t,e){var n=t.getCoordBoundingBox(e);return z.centre(n.min,n.max)}function Lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lt(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function zt(t,e){var n={};return Tt(n,"number",t),Tt(n,"range",e.range,""),Tt(n,"resth",e.resth,!1),Tt(n,"ifthen",e.ifthen,0),n}var Ft={$schema:"http://json-schema.org/draft-07/schema#",title:"ket",description:"Ketcher format schema",type:"object",required:["root"],properties:{root:{type:"object",required:["nodes"],properties:{nodes:{type:"array",minItems:0,items:{oneOf:[{$ref:"#/definitions/simpleObject"},{$ref:"#/definitions/text"},{$ref:"#/definitions/arrow"},{$ref:"#/definitions/plus"},{type:"object",required:["$ref"],properties:{$ref:{type:"string",pattern:"^(mol\\d+|rg[1-9]\\d*)"}}}]}}}}},patternProperties:{"^rg[1-9]\\d*":{$ref:"#/definitions/rgroup"},"^mol\\d+":{$ref:"#/definitions/molecule"}},additionalProperties:!1,definitions:{rsite:{type:"object",required:["type","location"],properties:{type:{const:"rg-label"},location:{type:"array",minItems:2,maxItems:3,items:{type:"number"}},$refs:{type:"array",items:{type:"string",pattern:"^rg-[1-9]\\d*"}},attachmentPoints:{type:"integer",enum:[0,1,2,3]}}},atom:{type:"object",required:["label"],properties:{label:{type:"string"},location:{type:"array",minItems:2,maxItems:3,items:{type:"number"}},charge:{type:"integer",minimum:-1e3,maximum:1e3},explicitValence:{type:"integer",enum:[-1,0,1,2,3,4,5,6,7,8,9,10,11,12]},isotope:{type:"integer",minimum:0,maximum:1e3},radical:{type:"integer",enum:[0,2,1,3]},attachmentPoints:{type:"integer",enum:[0,1,2,3]},stereoLabel:{type:"string",pattern:"(?:(?:^&|or)[0-9]+$)|(?:^abs$)"},stereoParity:{type:"integer",enum:[0,1,2,3]},ringBondCount:{type:"integer",enum:[0,-2,-1,2,3,4]},substitutionCount:{type:"integer",enum:[0,-2,-1,1,2,3,4,5,6]},unsaturatedAtom:{type:"boolean"},hCount:{type:"integer",enum:[-1,0,1,2,3,4,5]},mapping:{type:"integer",minimum:0},invRet:{type:"integer",enum:[0,1,2]},exactChangeFlag:{type:"boolean"}},additionalProperties:!1},atomlist:{type:"object",required:["type","location"],properties:{type:{enum:["atom-list"]},notList:{type:"boolean"},location:{type:"array",minItems:2,maxItems:3,items:{type:"number"}},elements:{type:"array",minItems:2,items:{type:"string",minLength:1}},attachmentPoints:{type:"integer",enum:[0,1,2,3]}}},bond:{type:"object",required:["atoms","type"],properties:{type:{type:"integer",enum:[1,2,3,4,5,6,7,8,9,10,11,12]},atoms:{type:"array",minItems:2,maxItems:2,items:{type:"integer",minimum:0,uniqueItems:!0}},stereo:{type:"integer",enum:[0,1,3,4,6]},topology:{type:"integer",enum:[0,1,2]},center:{type:"integer",enum:[0,-1,1,2,4,8,12]},stereobox:{type:"integer",enum:[0,1]}}},rgroup:{type:"object",required:["rlogic","type"],properties:{type:{const:"rgroup"},rlogic:{type:"object",required:["number"],properties:{number:{type:"integer",minimum:1},range:{type:"string",maxLength:50,default:""},resth:{type:"boolean",default:!1},ifthen:{type:"integer",minimum:0,default:0}}}},allOf:[{$ref:"#/definitions/structure"}]},molecule:{type:"object",required:["type"],properties:{type:{const:"molecule"}},allOf:[{$ref:"#/definitions/structure"}]},structure:{type:"object",required:["atoms"],properties:{stereoFlagPosition:{type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"}}},atoms:{type:"array",items:{oneOf:[{$ref:"#/definitions/atom"},{$ref:"#/definitions/rsite"},{$ref:"#/definitions/atomlist"}]}},bonds:{type:"array",items:{$ref:"#/definitions/bond"}},highlight:{$ref:"#/definitions/subset"},selection:{$ref:"#/definitions/subset"},sgroups:{$ref:"#/definitions/sgroups"}}},subset:{type:"array",minItems:1,maxItems:2,items:{oneOf:[{type:"object",required:["entityType","items"],properties:{entityType:{type:"string",const:"atoms"},items:{type:"array",items:{type:"integer",minimum:0,uniqueItems:!0}}}},{type:"object",required:["entityType","items"],properties:{entityType:{type:"string",const:"bonds"},items:{type:"array",items:{type:"integer",minimum:0,uniqueItems:!0}}}}]}},sgroups:{type:"array",items:{required:["atoms","type"],properties:{atoms:{type:"array",items:{type:"integer",minimum:0}},type:{type:"string",enum:["GEN","MUL","SRU","SUP","DAT"]}},if:{properties:{type:{const:"DAT"}}},then:{required:["fieldName"],properties:{context:{enum:["Fragment","Multifragment","Bond","Atom","Group"]},fieldName:{type:"string"},fieldValue:{type:"string",minLength:1},display:{type:"boolean"},placement:{type:"boolean"},bonds:{type:"array",items:{type:"integer",minimum:0}}}}}},plus:{type:"object",required:["type","location"],properties:{type:{const:"plus"},location:{type:"array",minItems:2,maxItems:3,items:{type:"number"}}}},arrow:{type:"object",required:["type","data"],properties:{type:{const:"arrow"},data:{type:"object",required:["mode"],properties:{mode:{type:"string"},pos:{type:"array",items:{type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}}}}}}}},simpleObject:{type:"object",required:["type","data"],properties:{type:{const:"simpleObject"},data:{type:"object",required:["mode"],properties:{mode:{type:"string",enum:["line","rectangle","circle","ellipse","polyline"]}},if:{properties:{mode:{const:"polyline"}}},then:{required:["pos"],properties:{pos:{type:"array",minItems:2,items:{type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}}}}}},else:{required:["pos"],properties:{pos:{type:"array",minItems:2,maxItems:2,items:{type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}}}}}}}}},text:{type:"object",required:["type","data"],properties:{type:{const:"text"},data:{type:"object",required:["content","position"],properties:{content:{type:"string"},position:{type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"}}}}}}}}};function Gt(t,e){switch(t.type){case"arrow":case"plus":!function(t,e){"arrow"===t.type?e.rxnArrows.add(new gt(t.data)):e.rxnPluses.add(new yt({pp:{x:t.location[0],y:t.location[1],z:t.location[2]}}))}(t,e);break;case"simpleObject":!function(t,e){var n="circle"===t.data.mode?function(t){var e=z.dist(t.data.pos[1],t.data.pos[0]),n=t.data.pos[0];return{mode:mt.ellipse,pos:[{x:n.x-Math.abs(e),y:n.y-Math.abs(e),z:n.z-Math.abs(e)},{x:n.x+Math.abs(e),y:n.y+Math.abs(e),z:n.z+Math.abs(e)}]}}(t):t.data;e.simpleObjects.add(new xt(n))}(t,e);break;case"molecule":var n=Nt(t);t.stereoFlagPosition&&(n.frags.get(0).stereoFlagPosition=new z(t.stereoFlagPosition)),n.mergeInto(e);break;case"rgroup":(function(t){var e,n,r=Nt(t),o=(Tt(n={},"range",(e=t.rlogic).range),Tt(n,"resth",e.resth),Tt(n,"ifthen",e.ifthen),new vt(n));return r.frags.forEach((function(t,e){o.frags.add(e)})),t.rlogic&&r.rgroups.set(t.rlogic.number,o),r})(t).mergeInto(e);break;case"text":!function(t,e){var n=t.data;e.texts.add(new Pt(n))}(t,e)}}var Ht=function(){function t(){(0,r.Z)(this,t)}return(0,o.Z)(t,[{key:"deserialize",value:function(t){var e=new At,n=JSON.parse(t);if(!function(t){return(new O.Validator).validate(t,Ft).valid}(n))throw new Error("Cannot deserialize input JSON.");e.name=n.header?n.header.moleculeName:null;var r=n.root.nodes;return Object.keys(r).forEach((function(t){r[t].type?Gt(r[t],e):r[t].$ref&&Gt(n[r[t].$ref],e)})),e}},{key:"serialize",value:function(t){var e={root:{nodes:[]}},n=function(t){var e={};return Tt(e,"moleculeName",t.name,""),Tt(e,"creatorProgram",null,""),Tt(e,"comment",null,""),0!==Object.keys(e).length?e:null}(t);n&&(e.header=n);var r=function(t){var e,n=[],r=new Set,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Bt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t.rgroups.entries());try{for(o.s();!(e=o.n()).done;){var i=(0,y.Z)(e.value,2),a=i[0],s=i[1];s.frags.forEach((function(t){return r.add(t)}));var u=Array.from(s.frags.values()).reduce((function(e,n){return e.union(t.getFragmentIds(n))}),new V);n.push({type:"rgroup",fragment:t.clone(u),center:Zt(t,u),data:{rgnumber:a,rgroup:s}})}}catch(t){o.e(t)}finally{o.f()}return Array.from(t.frags.keys()).filter((function(t){return!r.has(t)})).forEach((function(e){var r=t.getFragmentIds(e);n.push({type:"molecule",fragment:t.clone(r),center:Zt(t,r)})})),t.rxnArrows.forEach((function(t){n.push({type:"arrow",center:t.pos[0],data:{mode:t.mode,pos:t.pos}})})),t.rxnPluses.forEach((function(t){n.push({type:"plus",center:t.pp,data:{}})})),t.simpleObjects.forEach((function(t){n.push({type:"simpleObject",center:t.pos[0],data:{mode:t.mode,pos:t.pos}})})),t.texts.forEach((function(t){n.push({type:"text",center:t.position,data:{content:t.content,position:t.position}})})),n.forEach((function(t){if(t.fragment){var e=Array.from(t.fragment.sgroups.values()).filter((function(t){return t.atoms.every((function(t){return void 0!==t}))})),n=new Map;e.forEach((function(t,e){n.set(e,t)})),t.fragment.sgroups=n}})),n}(t),o=0;return r.forEach((function(t){switch(t.type){case"molecule":e.root.nodes.push({$ref:"mol".concat(o)}),e["mol".concat(o++)]=Mt(t.fragment);break;case"rgroup":e.root.nodes.push({$ref:"rg".concat(t.data.rgnumber)}),e["rg".concat(t.data.rgnumber)]=function(t,e){var n=Dt({rlogic:zt(e.rgnumber,e.rgroup)},Mt(t));return Dt(Dt({},n),{},{type:"rgroup"})}(t.fragment,t.data);break;case"plus":e.root.nodes.push({type:"plus",location:[(r=(n=t).center).x,r.y,r.z],prop:n.data});break;case"arrow":e.root.nodes.push({type:"arrow",data:t.data});break;case"simpleObject":e.root.nodes.push({type:"simpleObject",data:t.data});break;case"text":e.root.nodes.push({type:"text",data:t.data})}var n,r})),JSON.stringify(e,null,4)}}]),t}(),Vt={bondTypeMap:{1:$.PATTERN.TYPE.SINGLE,2:$.PATTERN.TYPE.DOUBLE,3:$.PATTERN.TYPE.TRIPLE,4:$.PATTERN.TYPE.AROMATIC,5:$.PATTERN.TYPE.SINGLE_OR_DOUBLE,6:$.PATTERN.TYPE.SINGLE_OR_AROMATIC,7:$.PATTERN.TYPE.DOUBLE_OR_AROMATIC,8:$.PATTERN.TYPE.ANY,9:$.PATTERN.TYPE.DATIVE,10:$.PATTERN.TYPE.HYDROGEN},bondStereoMap:{0:$.PATTERN.STEREO.NONE,1:$.PATTERN.STEREO.UP,4:$.PATTERN.STEREO.EITHER,6:$.PATTERN.STEREO.DOWN,3:$.PATTERN.STEREO.CIS_TRANS},v30bondStereoMap:{0:$.PATTERN.STEREO.NONE,1:$.PATTERN.STEREO.UP,2:$.PATTERN.STEREO.EITHER,3:$.PATTERN.STEREO.DOWN},bondTopologyMap:{0:$.PATTERN.TOPOLOGY.EITHER,1:$.PATTERN.TOPOLOGY.RING,2:$.PATTERN.TOPOLOGY.CHAIN},countsLinePartition:[3,3,3,3,3,3,3,3,3,3,3,6],atomLinePartition:[10,10,10,1,3,2,3,3,3,3,3,3,3,3,3,3,3],bondLinePartition:[3,3,3,3,3,3,3],atomListHeaderPartition:[3,1,1,4,1,1],atomListHeaderLength:11,atomListHeaderItemLength:4,chargeMap:[0,3,2,1,0,-1,-2,-3],valenceMap:[void 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0],implicitHydrogenMap:[void 0,0,1,2,3,4],v30atomPropMap:{CHG:"charge",RAD:"radical",MASS:"isotope",VAL:"explicitValence",HCOUNT:"hCount",INVRET:"invRet",SUBST:"substitutionCount",UNSAT:"unsaturatedAtom",RBCNT:"ringBondCount"},rxnItemsPartition:[3,3,3]},Ut={fmtInfo:Vt,paddedNum:function(t,e,n){var r=(t=parseFloat(t)).toFixed(n||0).replace(",",".");if(r.length>e)throw new Error("number does not fit");return r.padStart(e)},parseDecimalInt:function(t){var e=parseInt(t,10);return isNaN(e)?0:e},partitionLine:function(t,e,n){for(var r=[],o=0,i=0;o<e.length;++o)r.push(t.slice(i,i+e[o])),n&&i++,i+=e[o];return r},partitionLineFixed:function(t,e,n){for(var r=[],o=0;o<t.length;o+=e)r.push(t.slice(o,o+e)),n&&o++;return r},rxnMerge:function(t,e,n,r,o){var i,a=new At,s=[],u=[],c=[],l=[],f=[],h=[],d={cnt:0,totalLength:0};for(i=0;i<t.length;++i){var p=t[i],v=p.getBondLengthData();d.cnt+=v.cnt,d.totalLength+=v.totalLength}var m,g,y,b,w=1/(0==d.cnt?1:d.totalLength/d.cnt);for(i=0;i<t.length;++i)(p=t[i]).scale(w);for(i=0;i<t.length;++i){var x=(p=t[i]).getCoordBoundingBoxObj();if(x){var O=i<e?1:i<e+n?2:3;1==O?(s.push(x),l.push(p)):3==O?(u.push(x),f.push(p)):2==O&&(c.push(x),h.push(p)),p.atoms.forEach((function(t){t.rxnFragmentType=O}))}}function E(t,e,n,r,o){var i=new z(r-n.min.x,o?1-n.min.y:-(n.min.y+n.max.y)/2);return e.atoms.forEach((function(t){t.pp.add_(i)})),e.sgroups.forEach((function(t){t.pp&&t.pp.add_(i)})),n.min.add_(i),n.max.add_(i),e.mergeInto(t),n.max.x-n.min.x}if(o){var _=0;for(i=0;i<l.length;++i)_+=E(a,l[i],s[i],_,!1)+2;for(_+=2,i=0;i<f.length;++i)_+=E(a,f[i],u[i],_,!0)+2;for(_+=2,i=0;i<h.length;++i)_+=E(a,h[i],c[i],_,!1)+2}else{for(i=0;i<l.length;++i)l[i].mergeInto(a);for(i=0;i<f.length;++i)f[i].mergeInto(a);for(i=0;i<h.length;++i)h[i].mergeInto(a)}var S=null,j=null;for(i=0;i<s.length-1;++i)m=s[i],g=s[i+1],y=(m.max.x+g.min.x)/2,b=(m.max.y+m.min.y+g.max.y+g.min.y)/4,a.rxnPluses.add(new yt({pp:new z(y,b)}));for(i=0;i<s.length;++i)0==i?((S={}).max=new z(s[i].max),S.min=new z(s[i].min)):(S.max=z.max(S.max,s[i].max),S.min=z.min(S.min,s[i].min));for(i=0;i<c.length-1;++i)m=c[i],g=c[i+1],y=(m.max.x+g.min.x)/2,b=(m.max.y+m.min.y+g.max.y+g.min.y)/4,a.rxnPluses.add(new yt({pp:new z(y,b)}));for(i=0;i<c.length;++i)0==i?((j={}).max=new z(c[i].max),j.min=new z(c[i].min)):(j.max=z.max(j.max,c[i].max),j.min=z.min(j.min,c[i].min));if(g=j,(m=S)||g){var A=m?new z(m.max.x,(m.max.y+m.min.y)/2):null,P=g?new z(g.min.x,(g.max.y+g.min.y)/2):null;A||(A=new z(P.x-3,P.y)),P||(P=new z(A.x+3,A.y));var k=z.lc2(A,.5,P,.5),T=new z(k.x-1,k.y,k.z),C=new z(k.x+1,k.y,k.z);a.rxnArrows.add(new gt({mode:"open-angle",pos:[T,C]}))}else a.rxnArrows.add(new gt({mode:"open-angle",pos:[new z(0,0),new z(2,0)]}));return a.isReaction=!0,a},rgMerge:function(t,e){var n=new At;return t.mergeInto(n,null,null,!1,!0),Object.keys(e).forEach((function(t){for(var r=parseInt(t,10),o=function(t){var o=e[r][t];o.rgroups.set(r,new vt);var i=new tt,a=o.frags.add(i);o.rgroups.get(r).frags.add(a),o.atoms.forEach((function(t){t.fragment=a})),o.mergeInto(n)},i=0;i<e[r].length;++i)o(i)})),n}};function qt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Wt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yt(t,e){for(var n=new _t,r=Ut.partitionLineFixed(t,3,!0),o=Ut.parseDecimalInt(r[0]),i=0;i<o;++i){var a=Ut.parseDecimalInt(r[2*i+1])-1,s=e?r[2*i+2].trim():Ut.parseDecimalInt(r[2*i+2]);n.set(a,s)}return n}function $t(t,e,n){t.data.mul=t.data.subscript-0;var r={};t.atoms=at.filterAtoms(t.atoms,n),t.patoms=at.filterAtoms(t.patoms,n);for(var o=1;o<t.data.mul;++o)for(var i=0;i<t.patoms.length;++i){var a=t.atoms[o*t.patoms.length+i];if(!(a<0)){if(t.patoms[i]<0)throw new Error("parent atom missing");r[a]=t.patoms[i]}}t.patoms=at.removeNegative(t.patoms);var s=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=t[n];return e}(t.patoms),u=[];e.bonds.forEach((function(t,e){var n=t.begin in r,o=t.end in r;n&&o||n&&t.end in s||o&&t.begin in s?u.push(e):n?t.begin=r[t.begin]:o&&(t.end=r[t.end])}),t);for(var c=0;c<u.length;++c)e.bonds.delete(u[c]);for(var l in r)e.atoms.delete(+l),n[l]=-1;t.atoms=t.patoms,t.patoms=null}function Kt(t){t.data.connectivity=(t.data.connectivity||"EU").trim().toLowerCase()}function Jt(t){t.data.name=(t.data.subscript||"").trim(),t.data.subscript=""}function Xt(t,e,n){}function Qt(t,e){t.data.absolute||(t.pp=t.pp.add(at.getMassCentre(e,t.atoms)))}function te(t){}function ee(t){}function ne(t){}function re(t){}function oe(t){}function ie(t){}function ae(t){}function se(t){}function ue(t){}function ce(t){}function le(t,e){var n=Ut.partitionLine(e,[10,10,4,1,1,1,3,3,3,3,2,3,2],!1),r=parseFloat(n[0]),o=parseFloat(n[1]),i="A"==n[3].trim(),a="A"==n[4].trim(),s="U"==n[5].trim(),u=n[7].trim();u="ALL"==u?-1:Ut.parseDecimalInt(u);var c=n[10].trim(),l=Ut.parseDecimalInt(n[11].trim());t.pp=new z(r,-o),t.data.attached=i,t.data.absolute=a,t.data.showUnits=s,t.data.nCharsToDisplay=u,t.data.tagChar=c,t.data.daspPos=l}function fe(t,e,n){t.data.fieldValue=(t.data.fieldValue||"")+e,n&&(t.data.fieldValue=t.data.fieldValue.replace(/\s+$/,""),t.data.fieldValue.startsWith('"')&&t.data.fieldValue.endsWith('"')&&(t.data.fieldValue=t.data.fieldValue.substr(1,t.data.fieldValue.length-2)))}var he={readKeyValuePairs:Yt,readKeyMultiValuePairs:function(t,e){for(var n=[],r=Ut.partitionLineFixed(t,3,!0),o=Ut.parseDecimalInt(r[0]),i=0;i<o;++i)n.push([Ut.parseDecimalInt(r[2*i+1])-1,e?r[2*i+2].trim():Ut.parseDecimalInt(r[2*i+2])]);return n},loadSGroup:function(t,e,n){var r={SUP:Jt,MUL:$t,SRU:Kt,MON:te,MER:ee,COP:ne,CRO:re,MOD:oe,GRA:ie,COM:ae,MIX:se,FOR:ue,DAT:Qt,ANY:ce,GEN:Xt};e.id=t.sgroups.add(e),r[e.type](e,t,n);for(var o=0;o<e.atoms.length;++o)t.atoms.has(e.atoms[o])&&t.atoms.get(e.atoms[o]).sgs.add(e.id);return"DAT"===e.type?t.sGroupForest.insert(e,-1,[]):t.sGroupForest.insert(e),e.id},initSGroup:function(t,e){var n,r=qt(Yt(e,!0));try{for(r.s();!(n=r.n()).done;){var o=(0,y.Z)(n.value,2),i=o[0],a=o[1],s=new at(a);s.number=i,t[i]=s}}catch(t){r.e(t)}finally{r.f()}},applySGroupProp:function(t,e,n,r,o){var i,a=Yt(n,!r),s=qt(a.keys());try{for(s.s();!(i=s.n()).done;){var u=i.value;(o?t[u]:t[u].data)[e]=a.get(u)}}catch(t){s.e(t)}finally{s.f()}},applySGroupArrayProp:function(t,e,n,r){var o=Ut.parseDecimalInt(n.slice(1,4))-1,i=Ut.parseDecimalInt(n.slice(4,8)),a=function(t){for(var e=[],n=0;n<t.length;++n)e[n]=Ut.parseDecimalInt(t[n]);return e}(Ut.partitionLineFixed(n.slice(8),3,!0));if(a.length!==i)throw new Error("File format invalid");r&&(a=a.map((function(t){return t+r}))),t[o][e]=t[o][e].concat(a)},applyDataSGroupName:function(t,e){t.data.fieldName=e},applyDataSGroupQuery:function(t,e){t.data.query=e},applyDataSGroupQueryOp:function(t,e){t.data.queryOp=e},applyDataSGroupDesc:function(t,e){var n=Ut.partitionLine(e,[4,31,2,20,2,3],!1),r=Ut.parseDecimalInt(n[0])-1,o=n[1].trim(),i=n[2].trim(),a=n[3].trim(),s=n[4].trim(),u=n[5].trim(),c=t[r];c.data.fieldType=i,c.data.fieldName=o,c.data.units=a,c.data.query=s,c.data.queryOp=u},applyDataSGroupInfo:le,applyDataSGroupData:fe,applyDataSGroupInfoLine:function(t,e){le(t[Ut.parseDecimalInt(e.substr(0,4))-1],e.substr(5))},applyDataSGroupDataLine:function(t,e,n){var r=Ut.parseDecimalInt(e.substr(0,5))-1,o=e.substr(5);fe(t[r],o,n)},applyDataSGroupExpand:function(t,e){t.data.expanded=e}};function de(t){var e=Ut.partitionLine(t,Ut.fmtInfo.atomLinePartition),n={pp:new z(parseFloat(e[0]),-parseFloat(e[1]),parseFloat(e[2])),label:e[4].trim(),explicitValence:Ut.fmtInfo.valenceMap[Ut.parseDecimalInt(e[10])],massDifference:Ut.parseDecimalInt(e[5]),charge:Ut.fmtInfo.chargeMap[Ut.parseDecimalInt(e[6])],hCount:Ut.parseDecimalInt(Ut.parseDecimalInt(e[8])),stereoCare:0!==Ut.parseDecimalInt(e[9]),aam:Ut.parseDecimalInt(e[14]),invRet:Ut.parseDecimalInt(e[15]),exactChangeFlag:0!==Ut.parseDecimalInt(e[16])};return new W(n)}function pe(t){var e=Ut.partitionLine(t,Ut.fmtInfo.bondLinePartition),n={begin:Ut.parseDecimalInt(e[0])-1,end:Ut.parseDecimalInt(e[1])-1,type:Ut.fmtInfo.bondTypeMap[Ut.parseDecimalInt(e[2])],stereo:Ut.fmtInfo.bondStereoMap[Ut.parseDecimalInt(e[3])],xxx:e[4],topology:Ut.fmtInfo.bondTopologyMap[Ut.parseDecimalInt(e[5])],reactingCenterStatus:Ut.parseDecimalInt(e[6])};return new $(n)}function ve(t){for(var e=Ut.partitionLine(t,Ut.fmtInfo.atomListHeaderPartition),n=Ut.parseDecimalInt(e[0])-1,r="T"===e[2].trim(),o=Ut.parseDecimalInt(e[4].trim()),i=t.slice(Ut.fmtInfo.atomListHeaderLength),a=[],s=Ut.fmtInfo.atomListHeaderItemLength,u=0;u<o;++u)a[u]=Ut.parseDecimalInt(i.slice(u*s,(u+1)*s-1));return{aid:n,atomList:new D({notList:r,ids:a})}}function me(t,e){var n,r=new At,o=Ut.parseDecimalInt(e[0]),i=Ut.parseDecimalInt(e[1]),a=Ut.parseDecimalInt(e[2]),s=1===Ut.parseDecimalInt(e[4]),u=0===Ut.parseDecimalInt(e[4]),c=Ut.parseDecimalInt(e[5]),l=Ut.parseDecimalInt(e[10]),f=0,h=t.slice(f,f+o);f+=o;var d=t.slice(f,f+i);f+=i;var p=t.slice(f,f+a);f+=a+c,h.map(de).forEach((function(t){return r.atoms.add(t)})),d.map(pe).forEach((function(t){t.stereo&&s&&(r.atoms.get(t.begin).stereoLabel=H.Abs),t.stereo&&u&&(r.atoms.get(t.begin).stereoLabel="".concat(H.And,"1")),r.bonds.add(t)})),p.map(ve).forEach((function(t){r.atoms.get(t.aid).atomList=t.atomList,r.atoms.get(t.aid).label="L#"}));var v={},m={},g=function(t,e,n,r,o,i){for(var a=new _t;n<r;){var s=e[n];if("A"===s.charAt(0)){var u=e[++n],c=/'.+'/.test(u);c&&!a.get("pseudo")&&a.set("pseudo",new _t),c||a.get("alias")||a.set("alias",new _t),c&&(u=u.replace(/'/g,"")),a.get(c?"pseudo":"alias").set(Ut.parseDecimalInt(s.slice(3,6))-1,u)}else if("M"===s.charAt(0)){var l=s.slice(3,6),f=s.slice(6);if("END"===l)break;if("CHG"===l)a.get("charge")||a.set("charge",he.readKeyValuePairs(f));else if("RAD"===l)a.get("radical")||a.set("radical",he.readKeyValuePairs(f));else if("ISO"===l)a.get("isotope")||a.set("isotope",he.readKeyValuePairs(f));else if("RBC"===l)a.get("ringBondCount")||a.set("ringBondCount",he.readKeyValuePairs(f));else if("SUB"===l)a.get("substitutionCount")||a.set("substitutionCount",he.readKeyValuePairs(f));else if("UNS"===l)a.get("unsaturatedAtom")||a.set("unsaturatedAtom",he.readKeyValuePairs(f));else if("RGP"===l){a.get("rglabel")||a.set("rglabel",new _t);for(var h=a.get("rglabel"),d=he.readKeyMultiValuePairs(f),p=0;p<d.length;p++){var v=d[p];h.set(v[0],(h.get(v[0])||0)|1<<v[1]-1)}}else if("LOG"===l){f=f.slice(4);var m=Ut.parseDecimalInt(f.slice(0,3).trim()),g=Ut.parseDecimalInt(f.slice(4,7).trim()),y=Ut.parseDecimalInt(f.slice(8,11).trim()),b=f.slice(12).trim(),w={};g>0&&(w.ifthen=g),w.resth=1===y,w.range=b,i[m]=w}else if("APO"===l)a.get("attpnt")||a.set("attpnt",he.readKeyValuePairs(f));else if("ALS"===l){var x=(E=Ut.partitionLine(f,[1,3,3,1,1,1]),_=Ut.partitionLineFixed(f.slice(10),4,!1),S=void 0,j=void 0,A=void 0,P=void 0,k=void 0,S=Ut.parseDecimalInt(E[1])-1,j=Ut.parseDecimalInt(E[2]),A="T"===E[4].trim(),P=function(t){for(var e=[],n=0;n<t.length;++n){var r=B.get(t[n].trim());r&&e.push(r.number)}return e}(_.slice(0,j)),(k=new _t).set(S,new D({notList:A,ids:P})),k);a.get("atomList")||a.set("atomList",new _t),a.get("label")||a.set("label",new _t),x.forEach((function(t,e){a.get("label").set(e,"L#"),a.get("atomList").set(e,t)}))}else if("STY"===l)he.initSGroup(o,f);else if("SST"===l)he.applySGroupProp(o,"subtype",f);else if("SLB"===l)he.applySGroupProp(o,"label",f,!0);else if("SPL"===l)he.applySGroupProp(o,"parent",f,!0,!0);else if("SCN"===l)he.applySGroupProp(o,"connectivity",f);else if("SAL"===l)he.applySGroupArrayProp(o,"atoms",f,-1);else if("SBL"===l)he.applySGroupArrayProp(o,"bonds",f,-1);else if("SPA"===l)he.applySGroupArrayProp(o,"patoms",f,-1);else if("SMT"===l){var O=Ut.parseDecimalInt(f.slice(0,4))-1;o[O].data.subscript=f.slice(4).trim()}else"SDT"===l?he.applyDataSGroupDesc(o,f):"SDD"===l?he.applyDataSGroupInfoLine(o,f):"SCD"===l?he.applyDataSGroupDataLine(o,f,!1):"SED"===l?he.applyDataSGroupDataLine(o,f,!0):"SDS"===l&&f.slice(7).trim().split(" ").forEach((function(t){var e=Number(t)-1;o[e].data.expanded=!0}))}++n}var E,_,S,j,A,P,k;return a}(0,t,f,Math.min(t.length,f+l),v,m);g.forEach((function(t,e){!function(t,e,n){e.forEach((function(e,r){t.get(r)[n]=e}))}(r.atoms,t,e)}));var y,b={};for(y in v){var w=v[y];if("DAT"===w.type&&0===w.atoms.length){var x=v[y].parent;if(x>=0){var O=v[x-1];"GEN"===O.type&&(w.atoms=[].slice.call(O.atoms))}}}for(y in v)he.loadSGroup(r,v[y],b);var E=[];for(y in v)at.filter(r,v[y],b),0!==v[y].atoms.length||v[y].allAtoms||E.push(+y);for(n=0;n<E.length;++n)r.sGroupForest.remove(E[n]),r.sgroups.delete(E[n]);for(var _ in m){var S=parseInt(_,10);r.rgroups.set(S,new vt(m[S]))}return r}function ge(t){if("$CTAB"!==(t=t.slice(7))[0].trim())throw new Error("RGFile format invalid");for(var e=1;"$"!==t[e].charAt(0);)e++;if("$END CTAB"!==t[e].trim())throw new Error("RGFile format invalid");var n=t.slice(1,e);t=t.slice(e+1);for(var r={};;){if(0===t.length)throw new Error("Unexpected end of file");var o=t[0].trim();if("$END MOL"===o){t=t.slice(1);break}if("$RGP"!==o)throw new Error("RGFile format invalid");var i=parseInt(t[1].trim(),10);for(r[i]=[],t=t.slice(2);;){if(0===t.length)throw new Error("Unexpected end of file");if("$END RGP"===(o=t[0].trim())){t=t.slice(1);break}if("$CTAB"!==o)throw new Error("RGFile format invalid");for(e=1;"$"!==t[e].charAt(0);)e++;if("$END CTAB"!==t[e].trim())throw new Error("RGFile format invalid");r[i].push(t.slice(1,e)),t=t.slice(e+1)}}var a=ye(n),s={};for(var u in r){var c=parseInt(u,10);s[c]=[];for(var l=0;l<r[c].length;++l)s[c].push(ye(r[c][l]))}return Ut.rgMerge(a,s)}function ye(t){var e=Ut.partitionLine(t[0],Ut.fmtInfo.countsLinePartition);return me(t=t.slice(1),e)}var be={parseCTabV2000:me,parseRg2000:ge,parseRxn2000:function(t,e){t=t.slice(4);var n=Ut.partitionLine(t[0],Ut.fmtInfo.rxnItemsPartition),r=n[0]-0,o=n[1]-0,i=n[2]-0;t=t.slice(1);for(var a=[];t.length>0&&"$MOL"===t[0].substr(0,4);){t=t.slice(1);for(var s=0;s<t.length&&"$MOL"!==t[s].substr(0,4);)s++;var u,c=t.slice(0,s);0===c[0].search("\\$MDL")?u=ge(c):(u=ye(c.slice(3))).name=c[0].trim(),a.push(u),t=t.slice(s)}return Ut.rxnMerge(a,r,o,i,e)}};function we(t){var e,n,r,o,i;e=je(t);var a={pp:new z(parseFloat(e[2]),-parseFloat(e[3]),parseFloat(e[4])),aam:e[5].trim()},s=e[1].trim();if('"'==s.charAt(0)&&'"'==s.charAt(s.length-1)&&(s=s.substr(1,s.length-2)),"]"==s.charAt(s.length-1)){var u={notList:!1},c=(s=s.substr(0,s.length-1)).match(/NOT ?\[/);if(c){u.notList=!0;var l=(0,y.Z)(c,1)[0];s=s.substr(l.length)}else{if("["!=s.charAt(0))throw new Error("Error: atom list expected, found '"+s+"'");s=s.substr(1)}u.ids=function(t){for(var e=[],n=0;n<t.length;++n){var r=B.get(t[n].trim());r&&e.push(r.number)}return e}(s.split(",")),a.atomList=new D(u),a.label="L#"}else a.label=s;for(e.splice(0,6),i=0;i<e.length;++i)if(r=(n=Ae(e[i],"="))[0],o=n[1],r in Ut.fmtInfo.v30atomPropMap){var f=Ut.parseDecimalInt(o);if("VAL"==r){if(0==f)continue;-1==f&&(f=0)}a[Ut.fmtInfo.v30atomPropMap[r]]=f}else if("RGROUPS"==r){var h=(o=o.trim().substr(1,o.length-2)).split(" ").slice(1);a.rglabel=0;for(var d=0;d<h.length;++d)a.rglabel|=1<<h[d]-1}else"ATTCHPT"==r&&(a.attpnt=o.trim()-0);return new W(a)}function xe(t){var e,n,r,o,i;e=je(t);var a={begin:Ut.parseDecimalInt(e[2])-1,end:Ut.parseDecimalInt(e[3])-1,type:Ut.fmtInfo.bondTypeMap[Ut.parseDecimalInt(e[1])]};for(e.splice(0,4),i=0;i<e.length;++i)r=(n=Ae(e[i],"="))[0],o=n[1],"CFG"==r?(a.stereo=Ut.fmtInfo.v30bondStereoMap[Ut.parseDecimalInt(o)],a.type==$.PATTERN.TYPE.DOUBLE&&a.stereo==$.PATTERN.STEREO.EITHER&&(a.stereo=$.PATTERN.STEREO.CIS_TRANS)):"TOPO"==r?a.topology=Ut.fmtInfo.bondTopologyMap[Ut.parseDecimalInt(o)]:"RXCTR"==r?a.reactingCenterStatus=Ut.parseDecimalInt(o):"STBOX"==r&&(a.stereoCare=Ut.parseDecimalInt(o));return new $(a)}function Oe(t,e,n){for(n++;"M V30 END COLLECTION"!=e[n].trim();)n++;return++n}function Ee(t,e,n,r,o){var i,a="";for(o++;o<e.length;){if("END SGROUP"==(a=Te(e[o++]).trim()).trim())return o;for(;"-"==a.charAt(a.length-1);)a=(a.substr(0,a.length-1)+Te(e[o++])).trim();var s=Pe(a),u=s[1],c=new at(u);c.number=s[0]-0,c.type=u,c.label=s[2]-0,n[c.number]=c;for(var l={},f=3;f<s.length;++f){var h=Ae(s[f],"=");if(2!=h.length)throw new Error("A record of form AAA=BBB or AAA=(...) expected, got '"+s[f]+"'");var d=h[0];d in l||(l[d]=[]),l[d].push(h[1])}c.atoms=ke(l.ATOMS[0],-1),l.PATOMS&&(c.patoms=ke(l.PATOMS[0],-1)),c.bonds=l.BONDS?ke(l.BONDS[0],-1):[];var p=l.BRKXYZ;if(c.brkxyz=[],p)for(var v=0;v<p.length;++v)c.brkxyz.push(ke(p[v]));l.MULT&&(c.data.subscript=l.MULT[0]-0),l.LABEL&&(c.data.subscript=l.LABEL[0].trim()),l.CONNECT&&(c.data.connectivity=l.CONNECT[0].toLowerCase()),l.FIELDDISP&&he.applyDataSGroupInfo(c,'"'===(i=l.FIELDDISP[0])[0]&&'"'===i[i.length-1]?i.substr(1,i.length-2):i),l.FIELDDATA&&he.applyDataSGroupData(c,l.FIELDDATA[0],!0),l.FIELDNAME&&he.applyDataSGroupName(c,l.FIELDNAME[0]),l.QUERYTYPE&&he.applyDataSGroupQuery(c,l.QUERYTYPE[0]),l.QUERYOP&&he.applyDataSGroupQueryOp(c,l.QUERYOP[0]),he.loadSGroup(t,c,r),l.ESTATE&&he.applyDataSGroupExpand(c,l.ESTATE[0])}throw new Error("S-group declaration incomplete.")}function _e(t,e){var n=new At,r=0;if("M V30 BEGIN CTAB"!==t[r++].trim())throw Error("CTAB V3000 invalid");if("M V30 COUNTS"!==t[r].slice(0,13))throw Error("CTAB V3000 invalid");var o=t[r].slice(14).split(" "),i=1===Ut.parseDecimalInt(o[4]);if("M V30 BEGIN ATOM"===t[++r].trim()){var a;for(r++;r<t.length&&"END ATOM"!==(a=Te(t[r++]).trim());){for(;"-"===a.charAt(a.length-1);)a=(a.substring(0,a.length-1)+Te(t[r++])).trim();n.atoms.add(we(a))}if("M V30 BEGIN BOND"===t[r].trim())for(r++;r<t.length&&"END BOND"!==(a=Te(t[r++]).trim());){for(;"-"===a.charAt(a.length-1);)a=(a.substring(0,a.length-1)+Te(t[r++])).trim();var s=xe(a);s.stereo&&i&&(n.atoms.get(s.begin).stereoLabel="abs"),n.bonds.add(s)}for(var u={},c={};"M V30 END CTAB"!==t[r].trim();)if("M V30 BEGIN COLLECTION"===t[r].trim())r=Oe(0,t,r);else{if("M V30 BEGIN SGROUP"!==t[r].trim())throw Error("CTAB V3000 invalid");r=Ee(n,t,u,c,r)}}if("M V30 END CTAB"!==t[r++].trim())throw Error("CTAB V3000 invalid");return e||Se(n,t.slice(r)),n}function Se(t,e){for(var n={},r={},o=0;o<e.length&&0===e[o].search("M V30 BEGIN RGROUP");){var i=e[o++].split(" ").pop();for(n[i]=[],r[i]={};;){var a=e[o].trim();if(0!==a.search("M V30 RLOGIC")){if("M V30 BEGIN CTAB"!=a)throw Error("CTAB V3000 invalid");for(var s=0;s<e.length&&"M V30 END CTAB"!=e[o+s].trim();++s);var u=_e(e.slice(o,o+s+1),!0);if(n[i].push(u),"M V30 END RGROUP"==e[o=o+s+1].trim()){o++;break}}else{var c=(a=a.slice(13)).trim().split(/\s+/g),l=Ut.parseDecimalInt(c[0]),f=Ut.parseDecimalInt(c[1]),h=c.slice(2).join(" "),d={};l>0&&(d.ifthen=l),d.resth=1==f,d.range=h,r[i]=d,o++}}}Object.keys(n).forEach((function(e){n[e].forEach((function(n){n.rgroups.set(e,new vt(r[e]));var o=n.frags.add({});n.rgroups.get(e).frags.add(o),n.atoms.forEach((function(t){t.fragment=o})),n.mergeInto(t)}))}))}function je(t){for(var e=[],n=0,r=0,o=-1,i=!1;r<t.length;r+=1){var a=t[r];if("NOT"===t.substr(r,3)){var s=t.indexOf("]");e.push(t.slice(r,s+1)),o=r=s+1}else"("===a?n+=1:")"===a?n-=1:'"'===a?i=!i:i||" "!==t[r]||0!==n||(r>o+1&&e.push(t.slice(o+1,r)),o=r)}return r>o+1&&e.push(t.slice(o+1,r)),e}function Ae(t,e){var n=t.indexOf(e);return[t.slice(0,n),t.slice(n+1)]}function Pe(t){for(var e=[],n=0,r=!1,o=0;o<t.length;++o){var i=t.charAt(o);'"'==i?r=!r:r||("("==i?n++:")"==i?n--:" "==i&&0==n&&(e.push(t.slice(0,o)),t=t.slice(o+1).trim(),o=0))}if(0!=n)throw new Error("Brace balance broken. S-group properies invalid!");return t.length>0&&e.push(t.trim()),e}function ke(t,e){if(!t)return null;var n=[],r=(t=(t=t.trim()).substr(1,t.length-2)).split(" ");e=e||0;for(var o=1;o<r.length;++o){var i=parseInt(r[o]);isNaN(i)||n.push(i+e)}return n}function Te(t){if("M V30 "!=t.slice(0,7))throw new Error("Prefix invalid");return t.slice(7)}var Ce={parseCTabV3000:_e,readRGroups3000:Se,parseRxn3000:function(t,e){var n=(t=t.slice(4))[0].split(/\s+/g).slice(3),r=n[0]-0,o=n[1]-0,i=n.length>2?n[2]-0:0;function a(e){for(var n=e;n<t.length;++n)if("M V30 END CTAB"==t[n].trim())return n}function s(e){for(var n=e;n<t.length;++n)if("M V30 END RGROUP"==t[n].trim())return n}for(var u=[],c=[],l=null,f=[],h=0;h<t.length;++h){var d,p=t[h].trim();if(p.startsWith("M V30 COUNTS"));else{if("M END"===p)break;if("M V30 BEGIN PRODUCT"===p)l=c;else if("M V30 END PRODUCT"===p)l=null;else if("M V30 BEGIN REACTANT"===p)l=u;else if("M V30 END REACTANT"===p)l=null;else if(p.startsWith("M V30 BEGIN RGROUP"))d=s(h),f.push(t.slice(h,d+1)),h=d;else{if("M V30 BEGIN CTAB"!==p)throw new Error("line unrecognized: "+p);d=a(h),l.push(t.slice(h,d+1)),h=d}}}var v=[],m=u.concat(c);for(d=0;d<m.length;++d){var g=_e(m[d],n);v.push(g)}var y=Ut.rxnMerge(v,r,o,i,e);return Se(y,function(t){for(var e=[],n=0;n<t.length;++n)e=e.concat(t[n]);return e}(f)),y}};function Re(t){var e=function(t,e,n){for(var r=[],o=0,i=0;o<e.length;++o)r.push(t.slice(i,i+e[o])),i+=e[o];return r}(t[0],Ut.fmtInfo.countsLinePartition),n=e[11].trim();if(t=t.slice(1),"V2000"===n)return be.parseCTabV2000(t,e);if("V3000"===n)return Ce.parseCTabV3000(t,!1);throw new Error("Molfile version unknown: "+n)}var Me={MUL:at.prepareMulForSaving,SRU:function(t,e){var n=[];if(e.bonds.forEach((function(r,o){var i=e.atoms.get(r.begin),a=e.atoms.get(r.end);(i.sgs.has(t.id)&&!a.sgs.has(t.id)||a.sgs.has(t.id)&&!i.sgs.has(t.id))&&n.push(o)}),t),0!==n.length&&2!==n.length)throw{id:t.id,"error-type":"cross-bond-number",message:"Unsupported cross-bonds number"};t.bonds=n},SUP:function(t,e){var n=[];e.bonds.forEach((function(r,o){var i=e.atoms.get(r.begin),a=e.atoms.get(r.end);(i.sgs.has(t.id)&&!a.sgs.has(t.id)||a.sgs.has(t.id)&&!i.sgs.has(t.id))&&n.push(o)}),t),t.bonds=n},DAT:function(t,e){t.atoms=at.getAtoms(e,t)},GEN:function(t,e){}},Ie={MUL:function(t,e,n,r,o){var i=(n[t.id]+"").padStart(3),a=[];a=(a=(a=a.concat(Ne("SAL",i,Array.from(t.atomSet.values()),r))).concat(Ne("SPA",i,Array.from(t.parentAtomSet.values()),r))).concat(Ne("SBL",i,t.bonds,o));var s="M SMT "+i+" "+t.data.mul;return a.push(s),(a=a.concat(Be(e,t,i))).join("\n")},SRU:function(t,e,n,r,o){var i=(n[t.id]+"").padStart(3),a=[];return(a=(a=(a=a.concat(Ne("SAL",i,t.atoms,r))).concat(Ne("SBL",i,t.bonds,o))).concat(Be(e,t,i))).join("\n")},SUP:function(t,e,n,r,o){var i=(n[t.id]+"").padStart(3),a=[];return a=(a=a.concat(Ne("SAL",i,t.atoms,r))).concat(Ne("SBL",i,t.bonds,o)),t.data.name&&""!==t.data.name&&a.push("M SMT "+i+" "+t.data.name),a.join("\n")},DAT:function(t,e,n,r){var o=(n[t.id]+"").padStart(3),i=t.data,a=t.pp;i.absolute||(a=a.sub(at.getMassCentre(e,t.atoms)));var s=[];s=s.concat(Ne("SAL",o,t.atoms,r));var u="M SDT "+o+" "+(i.fieldName||"").padEnd(30)+(i.fieldType||"").padStart(2)+(i.units||"").padEnd(20)+(i.query||"").padStart(2);i.queryOp&&(u+=i.queryOp.padEnd(15)),s.push(u);var c,l="M SDD "+o+" "+Ut.paddedNum(a.x,10,4)+Ut.paddedNum(-a.y,10,4)+" "+(i.attached?"A":"D")+(i.absolute?"A":"R")+(i.showUnits?"U":" ")+" "+(i.nCharnCharsToDisplay>=0?Ut.paddedNum(i.nCharnCharsToDisplay,3):"ALL")+" 1 "+(i.tagChar||" ")+" "+Ut.paddedNum(i.daspPos,1)+" ";return s.push(l),(c=i.fieldValue,c.replace(Ze,"\n")).replace(/\n*$/,"").split("\n").forEach((function(t){for(;t.length>69;)s.push("M SCD "+o+" "+t.slice(0,69)),t=t.slice(69);s.push("M SED "+o+" "+t)})),s.join("\n")},GEN:function(t,e,n,r,o){var i=(n[t.id]+"").padStart(3),a=[];return(a=(a=(a=a.concat(Ne("SAL",i,t.atoms,r))).concat(Ne("SBL",i,t.bonds,o))).concat(Be(e,t,i))).join("\n")}};function Ne(t,e,n,r){if(!n)return[];for(var o=[],i=0;i<Math.floor((n.length+14)/15);++i){for(var a=Math.min(n.length-15*i,15),s="M "+t+" "+e+" "+Ut.paddedNum(a,2),u=0;u<a;++u)s+=" "+Ut.paddedNum(r[n[15*i+u]],3);o.push(s)}return o}function Be(t,e,n){var r=new V(e.atoms),o=at.getCrossBonds(t,r);at.bracketPos(e,t,o);for(var i=e.bracketBox,a=e.bracketDir,s=a.rotateSC(1,0),u=at.getBracketParameters(t,o,r,i,a,s),c=[],l=0;l<u.length;++l){for(var f=u[l],h=f.c.addScaled(f.n,-.5*f.h).yComplement(),d=f.c.addScaled(f.n,.5*f.h).yComplement(),p="M SDI "+n+Ut.paddedNum(4,3),v=[h.x,h.y,d.x,d.y],m=0;m<v.length;++m)p+=Ut.paddedNum(v[m],10,4);c.push(p)}return c}var Ze=/\r\n|[\n\r]/g,Le={parseCTab:Re,parseMol:function(t){if(0===t[0].search("\\$MDL")){var e=be.parseRg2000(t);return e.name=t[3].trim(),e}var n=Re(t.slice(3));return n.name=t[0].trim(),n},parseRxn:function(t,e){var n=t[0].trim().split(" ");if(n.length>1&&"V3000"===n[1])return Ce.parseRxn3000(t,e);var r=be.parseRxn2000(t,e);return r.name=t[1].trim(),r},prepareForSaving:Me,saveToMolfile:Ie},De=function(){function t(){(0,r.Z)(this,t),(0,i.Z)(this,"molecule",void 0),(0,i.Z)(this,"molfile",void 0),(0,i.Z)(this,"reaction",void 0),(0,i.Z)(this,"mapping",void 0),(0,i.Z)(this,"bondMapping",void 0),this.molecule=null,this.molfile=null,this.reaction=!1,this.mapping={},this.bondMapping={}}return(0,o.Z)(t,[{key:"parseCTFile",value:function(t,e){var n;return(n=0===t[0].search("\\$RXN")?Le.parseRxn(t,e):Le.parseMol(t)).initHalfBonds(),n.initNeighbors(),n.bindSGroupsToFunctionalGroups(),n}},{key:"prepareSGroups",value:function(t,e){var n=this.molecule,r=[],o=0;if(this.molecule.sGroupForest.getSGroupsBFS().reverse().forEach((function(i){var a=n.sgroups.get(i),s=!1;try{Le.prepareForSaving[a.type](a,n)}catch(e){if(!t||"number"!=typeof e.id)throw new Error("Error: ".concat(e.message));s=!0}(s||!e&&/^INDIGO_.+_DESC$/i.test(a.data.fieldName))&&(o+=s,r.push(a.id))}),this),o)throw new Error("Warning: "+o+" invalid S-groups were detected. They will be omitted.");for(var i=0;i<r.length;++i)n.sGroupDelete(r[i])}},{key:"getCTab",value:function(t,e){return this.molecule=t.clone(),this.prepareSGroups(!1,!1),this.molfile="",this.writeCTab2000(e),this.molfile}},{key:"saveMolecule",value:function(e,n,r,o){var i=this;if(this.reaction=e.hasRxnArrow(),this.molfile=""+e.name,this.reaction){if(e.rgroups.size>0)throw new Error("Reactions with r-groups are not supported at the moment");var a=e.getComponents(),s=a.reactants,u=a.products,c=s.concat(u);this.molfile="$RXN\n"+e.name+"\n\n\n"+Ut.paddedNum(s.length,3)+Ut.paddedNum(u.length,3)+Ut.paddedNum(0,3)+"\n";for(var l=0;l<c.length;++l){var f=new t,h=e.clone(c[l],null,!0),d=f.saveMolecule(h,!1,!0);this.molfile+="$MOL\n"+d}return this.molfile}if(e.rgroups.size>0){if(!r){var p=(new t).getCTab(e.getScaffold(),e.rgroups);return this.molfile="$MDL REV 1\n$MOL\n$HDR\n"+e.name+"\n\n\n$END HDR\n",this.molfile+="$CTAB\n"+p+"$END CTAB\n",e.rgroups.forEach((function(n,r){i.molfile+="$RGP\n",i.writePaddedNumber(r,3),i.molfile+="\n",n.frags.forEach((function(n){var r=(new t).getCTab(e.getFragment(n));i.molfile+="$CTAB\n"+r+"$END CTAB\n"})),i.molfile+="$END RGP\n"})),this.molfile+="$END MOL\n",this.molfile}e=e.getScaffold()}return this.molecule=e.clone(),this.prepareSGroups(n,o),this.writeHeader(),this.writeCTab2000(),this.molfile}},{key:"writeHeader",value:function(){var t=new Date;this.writeCR(),this.writeWhiteSpace(2),this.write("Ketcher"),this.writeWhiteSpace(),this.writeCR((t.getMonth()+1+"").padStart(2)+(t.getDate()+"").padStart(2)+(t.getFullYear()%100+"").padStart(2)+(t.getHours()+"").padStart(2)+(t.getMinutes()+"").padStart(2)+"2D 1 1.00000 0.00000 0"),this.writeCR()}},{key:"write",value:function(t){this.molfile+=t}},{key:"writeCR",value:function(t){0===arguments.length&&(t=""),this.molfile+=t+"\n"}},{key:"writeWhiteSpace",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0===arguments.length&&(t=1),this.write(" ".repeat(Math.max(t,0)))}},{key:"writePadded",value:function(t,e){this.write(t),this.writeWhiteSpace(e-t.length)}},{key:"writePaddedNumber",value:function(t,e){var n=(t-0).toString();this.writeWhiteSpace(e-n.length),this.write(n)}},{key:"writePaddedFloat",value:function(t,e,n){this.write(Ut.paddedNum(t,e,n))}},{key:"writeCTab2000Header",value:function(){this.writePaddedNumber(this.molecule.atoms.size,3),this.writePaddedNumber(this.molecule.bonds.size,3),this.writePaddedNumber(0,3),this.writePaddedNumber(0,3);var t=Array.from(this.molecule.frags.values()).some((function(t){return!!t&&t.enhancedStereoFlag===Y.Abs}));this.writePaddedNumber(t?1:0,3),this.writePaddedNumber(0,3),this.writeWhiteSpace(12),this.writePaddedNumber(999,3),this.writeCR(" V2000")}},{key:"writeCTab2000",value:function(t){var e=this;this.writeCTab2000Header(),this.mapping={};var n=1,r=[],o=[];for(this.molecule.atoms.forEach((function(t,i){var a=t.label;null!=t.atomList?(a="L",r.push(i)):t.pseudo?t.pseudo.length>3&&(a="A",o.push({id:i,value:"'".concat(t.pseudo,"'")})):t.alias?o.push({id:i,value:t.alias}):B.get(t.label)||-1!==["A","Q","X","*","R#"].indexOf(t.label)||(a="C",o.push({id:i,value:t.label})),e.writeAtom(t,a),e.mapping[i]=n++}),this),this.bondMapping={},n=1,this.molecule.bonds.forEach((function(t,r){e.bondMapping[r]=n++,e.writeBond(t)}),this);o.length>0;)this.writeAtomProps(o[0]),o.splice(0,1);var i=[],a=[],s=[],u=[],c=[],l=[],f=[],h=[],d=[];this.molecule.atoms.forEach((function(t,e){if(0!==t.charge&&i.push([e,t.charge]),0!==t.isotope&&a.push([e,t.isotope]),0!==t.radical&&s.push([e,t.radical]),null!=t.rglabel&&"R#"===t.label)for(var n=0;n<32;n++)t.rglabel&1<<n&&u.push([e,n+1]);null!=t.attpnt&&l.push([e,t.attpnt]),0!==t.ringBondCount&&f.push([e,t.ringBondCount]),0!==t.substitutionCount&&d.push([e,t.substitutionCount]),0!==t.unsaturatedAtom&&h.push([e,t.unsaturatedAtom])})),t&&t.forEach((function(t,e){if(t.resth||t.ifthen>0||t.range.length>0){var n=" 1 "+Ut.paddedNum(e,3)+" "+Ut.paddedNum(t.ifthen,3)+" "+Ut.paddedNum(t.resth?1:0,3)+" "+t.range;c.push(n)}})),this.writeAtomPropList("M CHG",i),this.writeAtomPropList("M ISO",a),this.writeAtomPropList("M RAD",s),this.writeAtomPropList("M RGP",u);for(var p=0;p<c.length;++p)this.write("M LOG"+c[p]+"\n");if(this.writeAtomPropList("M APO",l),this.writeAtomPropList("M RBC",f),this.writeAtomPropList("M SUB",d),this.writeAtomPropList("M UNS",h),r.length>0)for(var v=0;v<r.length;++v){var m=r[v],g=this.molecule.atoms.get(m).atomList;this.write("M ALS"),this.writePaddedNumber(m+1,4),this.writePaddedNumber(g.ids.length,3),this.writeWhiteSpace(),this.write(g.notList?"T":"F");for(var y=g.labelList(),b=0;b<y.length;++b)this.writeWhiteSpace(),this.writePadded(y[b],3);this.writeCR()}var w={},x=1,O={};this.molecule.sGroupForest.getSGroupsBFS().forEach((function(t){O[x]=t,w[t]=x++}));for(var E=1;E<x;++E){var _=O[E],S=this.molecule.sgroups.get(_);this.write("M STY"),this.writePaddedNumber(1,3),this.writeWhiteSpace(1),this.writePaddedNumber(E,3),this.writeWhiteSpace(1),this.writePadded(S.type,3),this.writeCR(),this.write("M SLB"),this.writePaddedNumber(1,3),this.writeWhiteSpace(1),this.writePaddedNumber(E,3),this.writeWhiteSpace(1),this.writePaddedNumber(E,3),this.writeCR();var j=this.molecule.sGroupForest.parent.get(_);if(j>=0&&(this.write("M SPL"),this.writePaddedNumber(1,3),this.writeWhiteSpace(1),this.writePaddedNumber(E,3),this.writeWhiteSpace(1),this.writePaddedNumber(w[j],3),this.writeCR()),"SRU"===S.type&&S.data.connectivity){var A=" ".concat(E.toString().padStart(3)," ").concat((S.data.connectivity||"").padEnd(3));this.write("M SCN"),this.writePaddedNumber(1,3),this.write(A.toUpperCase()),this.writeCR()}"SRU"===S.type&&(this.write("M SMT "),this.writePaddedNumber(E,3),this.writeWhiteSpace(),this.write(S.data.subscript||"n"),this.writeCR()),this.writeCR(Le.saveToMolfile[S.type](S,this.molecule,w,this.mapping,this.bondMapping))}var P=[];if(this.molecule.sgroups.forEach((function(t){t.data.expanded&&P.push(t.id+1)})),P.length){var k="M SDS EXP ".concat(P.length," ").concat(P.join(" "));this.writeCR(k)}this.writeCR("M END")}},{key:"writeAtom",value:function(t,e){var n;this.writePaddedFloat(t.pp.x,10,4),this.writePaddedFloat(-t.pp.y,10,4),this.writePaddedFloat(t.pp.z,10,4),this.writeWhiteSpace(),this.writePadded(e,3),this.writePaddedNumber(0,2),this.writePaddedNumber(0,3),this.writePaddedNumber(0,3),void 0===t.hCount&&(t.hCount=0),this.writePaddedNumber(t.hCount,3),void 0===t.stereoCare&&(t.stereoCare=0),this.writePaddedNumber(t.stereoCare,3),n=t.explicitValence<0?0:0===t.explicitValence?15:t.explicitValence,this.writePaddedNumber(n,3),this.writePaddedNumber(0,3),this.writePaddedNumber(0,3),this.writePaddedNumber(0,3),void 0===t.aam&&(t.aam=0),this.writePaddedNumber(t.aam,3),void 0===t.invRet&&(t.invRet=0),this.writePaddedNumber(t.invRet,3),void 0===t.exactChangeFlag&&(t.exactChangeFlag=0),this.writePaddedNumber(t.exactChangeFlag,3),this.writeCR()}},{key:"writeBond",value:function(t){this.writePaddedNumber(this.mapping[t.begin],3),this.writePaddedNumber(this.mapping[t.end],3),this.writePaddedNumber(t.type,3),void 0===t.stereo&&(t.stereo=0),this.writePaddedNumber(t.stereo,3),this.writePadded(t.xxx,3),void 0===t.topology&&(t.topology=0),this.writePaddedNumber(t.topology,3),void 0===t.reactingCenterStatus&&(t.reactingCenterStatus=0),this.writePaddedNumber(t.reactingCenterStatus,3),this.writeCR()}},{key:"writeAtomProps",value:function(t){this.write("A "),this.writePaddedNumber(t.id+1,3),this.writeCR(),this.writeCR(t.value)}},{key:"writeAtomPropList",value:function(t,e){for(var n=this;e.length>0;){for(var r=[];e.length>0&&r.length<8;)r.push(e[0]),e.splice(0,1);this.write(t),this.writePaddedNumber(r.length,3),r.forEach((function(t){n.writeWhiteSpace(),n.writePaddedNumber(n.mapping[t[0]],3),n.writeWhiteSpace(),n.writePaddedNumber(t[1],3)})),this.writeCR()}}}]),t}();function ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Fe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ze(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ge=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"options",void 0),this.options=Fe(Fe({},t.DefaultOptions),e)}return(0,o.Z)(t,[{key:"deserialize",value:function(t){var e=new De,n=null==t?void 0:t.split(/\r\n|[\n\r]/g);try{return e.parseCTFile(n,this.options.reactionRelayout)}catch(t){if(this.options.badHeaderRecover){try{return e.parseCTFile(n.slice(1),this.options.reactionRelayout)}catch(t){}try{return e.parseCTFile([""].concat(n),this.options.reactionRelayout)}catch(t){}}throw t}}},{key:"serialize",value:function(t){return(new De).saveMolecule(t,this.options.ignoreErrors,this.options.noRgroups,this.options.preserveIndigoDesc)}}]),t}();function He(t,e,n){this.molecule=t,this.bonds=new _t,this.getNeighbors=e,this.context=n}function Ve(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Ue(t,e,n,r){var o=this;this.molecule=t,this.atom_data=e,this.components=n,this.nComponentsInReactants=-1,this.nReactants=r,this.vertices=new Array(this.molecule.atoms.size),this.molecule.atoms.forEach((function(t,e){o.vertices[e]=new Ue.VertexDesc}),this),this.edges=new Array(this.molecule.bonds.size),this.molecule.bonds.forEach((function(t,e){o.edges[e]=new Ue.EdgeDesc}),this),this.v_seq=[]}function qe(t,e,n){this.molecule=t,this.atoms=new _t,this.getNeighbors=e,this.context=n}function We(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Ye(){this.smiles="",this.writtenAtoms=[],this.writtenComponents=0,this.ignoreErrors=!1}function $e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ke(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$e(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}(0,i.Z)(Ge,"DefaultOptions",{badHeaderRecover:!1,ignoreErrors:!1,noRgroups:!1,preserveIndigoDesc:!1,reactionRelayout:!1}),He.PARITY={NONE:0,CIS:1,TRANS:2},He.prototype.each=function(t){this.bonds.forEach(t)},He.prototype.getParity=function(t){return this.bonds.get(t).parity},He.prototype.getSubstituents=function(t){return this.bonds.get(t).substituents},He.prototype.sameside=function(t,e,n,r){var o=z.diff(t,e),i=new z(-o.y,o.x);if(!i.normalize())return 0;var a=z.diff(n,t),s=z.diff(r,e);if(!a.normalize())return 0;if(!s.normalize())return 0;var u=z.dot(a,i),c=z.dot(s,i);return Math.abs(u)<.001||Math.abs(c)<.001?0:u*c>0?1:-1},He.prototype.samesides=function(t,e,n,r){return this.sameside(this.molecule.atoms.get(t).pp,this.molecule.atoms.get(e).pp,this.molecule.atoms.get(n).pp,this.molecule.atoms.get(r).pp)},He.prototype.sortSubstituents=function(t){var e=this.molecule.atoms.get(t[0]).pureHydrogen(),n=t[1]<0||this.molecule.atoms.get(t[1]).pureHydrogen(),r=this.molecule.atoms.get(t[2]).pureHydrogen(),o=t[3]<0||this.molecule.atoms.get(t[3]).pureHydrogen();return!(e&&n||r&&o||(n?t[1]=-1:e?(t[0]=t[1],t[1]=-1):t[0]>t[1]&&Ve(t,0,1),o?t[3]=-1:r?(t[2]=t[3],t[3]=-1):t[2]>t[3]&&Ve(t,2,3),0))},He.prototype.isGeomStereoBond=function(t,e){var n=this.molecule.bonds.get(t);if(n.type!=$.PATTERN.TYPE.DOUBLE)return!1;var r=this.molecule.atoms.get(n.begin).label,o=this.molecule.atoms.get(n.end).label;if("C"!=r&&"N"!=r&&"Si"!=r&&"Ge"!=r)return!1;if("C"!=o&&"N"!=o&&"Si"!=o&&"Ge"!=o)return!1;var i,a,s=this.getNeighbors.call(this.context,n.begin),u=this.getNeighbors.call(this.context,n.end);if(s.length<2||s.length>3||u.length<2||u.length>3)return!1;for(e[0]=-1,e[1]=-1,e[2]=-1,e[3]=-1,i=0;i<s.length;i++)if((a=s[i]).bid!=t){if(this.molecule.bonds.get(a.bid).type!=$.PATTERN.TYPE.SINGLE)return!1;-1==e[0]?e[0]=a.aid:e[1]=a.aid}for(i=0;i<u.length;i++)if((a=u[i]).bid!=t){if(this.molecule.bonds.get(a.bid).type!=$.PATTERN.TYPE.SINGLE)return!1;-1==e[2]?e[2]=a.aid:e[3]=a.aid}return!(-1!=e[1]&&-1!=this.samesides(n.begin,n.end,e[0],e[1])||-1!=e[3]&&-1!=this.samesides(n.begin,n.end,e[2],e[3]))},He.prototype.build=function(t){var e=this;this.molecule.bonds.forEach((function(n,r){var o={parity:0,substituents:[]};if(e.bonds.set(r,o),(!Array.isArray(t)||!t[r])&&e.isGeomStereoBond(r,o.substituents)&&e.sortSubstituents(o.substituents)){var i=e.samesides(n.begin,n.end,o.substituents[0],o.substituents[2]);1===i?o.parity=He.PARITY.CIS:-1===i&&(o.parity=He.PARITY.TRANS)}}))},Ue.VertexDesc=function(){this.dfs_state=0,this.parent_vertex=0,this.parent_edge=0,this.branches=0},Ue.EdgeDesc=function(){this.opening_cycles=0,this.closing_cycle=0},Ue.SeqElem=function(t,e,n){this.idx=t,this.parent_vertex=e,this.parent_edge=n},Ue.prototype.walk=function(){for(var t,e,n=this,r=[],o=0,i=0;;){if(r.length<1){for(var a=-1;o<this.components.length&&-1==a;)null===(a=this.components[o].find((function(t){return 0===n.vertices[t].dfs_state&&(a=t,!0)})))&&(a=-1,o++),o==this.nReactants&&(this.nComponentsInReactants=i);if(a<-1&&this.molecule.atoms.find((function(t){return 0===n.vertices[t].dfs_state&&(a=t,!0)})),-1==a)break;this.vertices[a].parent_vertex=-1,this.vertices[a].parent_edge=-1,r.push(a),i++}var s=r.pop(),u=this.vertices[s].parent_vertex,c=new Ue.SeqElem(s,u,this.vertices[s].parent_edge);this.v_seq.push(c),this.vertices[s].dfs_state=2;var l=this.atom_data[s];for(t=0;t<l.neighbours.length;t++){var f=l.neighbours[t].aid,h=l.neighbours[t].bid;if(f!=u)if(2==this.vertices[f].dfs_state){for(this.edges[h].closing_cycle=1,e=s;-1!=e&&this.vertices[e].parent_vertex!=f;)e=this.vertices[e].parent_vertex;if(-1==e)throw new Error("cycle unwind error");this.edges[this.vertices[e].parent_edge].opening_cycles++,this.vertices[s].branches++,c=new Ue.SeqElem(f,s,h),this.v_seq.push(c)}else{if(1==this.vertices[f].dfs_state){if(-1==(e=r.indexOf(f)))throw new Error("internal: removing vertex from stack");r.splice(e,1);var d=this.vertices[f].parent_vertex;d>=0&&this.vertices[d].branches--}this.vertices[s].branches++,this.vertices[f].parent_vertex=s,this.vertices[f].parent_edge=h,this.vertices[f].dfs_state=1,r.push(f)}}}},Ue.prototype.edgeClosingCycle=function(t){return 0!==this.edges[t].closing_cycle},Ue.prototype.numBranches=function(t){return this.vertices[t].branches},Ue.prototype.numOpeningCycles=function(t){return this.edges[t].opening_cycles},Ue.prototype.toString=function(){var t="";return this.v_seq.forEach((function(e){t+=e.idx+" -> "})),t+="*"},qe.prototype.each=function(t,e){this.atoms.forEach(t,e)},qe.prototype.buildFromBonds=function(t){var e=this,n=this.molecule.atoms,r=this.molecule.bonds,o=new V;n.forEach((function(t,i){var a=e.getNeighbors.call(e.context,i);if(2!==a.length)return!1;var s=a[0],u=a[1];if([i,s.aid,u.aid].findIndex((function(t){return["C","Si"].indexOf(n.get(t).label)<0}),e)>=0)return!1;if([s.bid,u.bid].findIndex((function(t){return r.get(t).type!==$.PATTERN.TYPE.DOUBLE}),e)>=0)return!1;var c=e.getNeighbors.call(e.context,s.aid).filter((function(t){return t.aid!=i})),l=e.getNeighbors.call(e.context,u.aid).filter((function(t){return t.aid!=i}));return!(c.length<1||c.length>2||l.length<1||l.length>2||c.concat(l).findIndex((function(t){return r.get(t.bid).type!=$.PATTERN.TYPE.SINGLE}),e)>=0||c.concat(l).findIndex((function(t){return r.get(t.bid).stereo==$.PATTERN.STEREO.EITHER}),e)>=0||(o.add(s.aid).add(u.aid),0))})),o.size>0&&n.forEach((function(t,n){if(!o.has(n)){var r=e.getNeighbors.call(e.context,n),i=!1;r.find((function(t){var e=this.molecule.bonds.get(t.bid);return e.type===$.PATTERN.TYPE.SINGLE&&e.begin==n&&(e.stereo===$.PATTERN.STEREO.UP||e.stereo==$.PATTERN.STEREO.DOWN)&&(i=!0,!0)}),e),i&&e.buildOneCenter(n)}}))},qe.allowed_stereocenters=[{elem:"C",charge:0,degree:3,n_double_bonds:0,implicit_degree:4},{elem:"C",charge:0,degree:4,n_double_bonds:0,implicit_degree:4},{elem:"Si",charge:0,degree:3,n_double_bonds:0,implicit_degree:4},{elem:"Si",charge:0,degree:4,n_double_bonds:0,implicit_degree:4},{elem:"N",charge:1,degree:3,n_double_bonds:0,implicit_degree:4},{elem:"N",charge:1,degree:4,n_double_bonds:0,implicit_degree:4},{elem:"N",charge:0,degree:3,n_double_bonds:0,implicit_degree:3},{elem:"S",charge:0,degree:4,n_double_bonds:2,implicit_degree:4},{elem:"S",charge:1,degree:3,n_double_bonds:0,implicit_degree:3},{elem:"S",charge:0,degree:3,n_double_bonds:1,implicit_degree:3},{elem:"P",charge:0,degree:3,n_double_bonds:0,implicit_degree:3},{elem:"P",charge:1,degree:4,n_double_bonds:0,implicit_degree:4},{elem:"P",charge:0,degree:4,n_double_bonds:1,implicit_degree:4}],qe.prototype.buildOneCenter=function(t){var e=this,n=this.molecule.atoms.get(t),r=this.getNeighbors.call(this.context,t),o=r.length,i=-1,a={group:0,type:0,pyramid:[]},s=[],u=0,c=0;a.pyramid[0]=-1,a.pyramid[1]=-1,a.pyramid[2]=-1,a.pyramid[3]=-1;var l=0;if(o>4)throw new Error("stereocenter with %d bonds are not supported"+o);if(r.forEach((function(t,r){var o=e.molecule.atoms.get(t.aid),i=e.molecule.bonds.get(t.bid);if(s[r]={edge_idx:t.bid,nei_idx:t.aid,rank:t.aid,vec:z.diff(o.pp,n.pp).yComplement()},o.pureHydrogen()?(l++,s[r].rank=1e4):"H"===o.label&&(s[r].rank=5e3),!s[r].vec.normalize())throw new Error("zero bond length");if(i.type===$.PATTERN.TYPE.TRIPLE)throw new Error("non-single bonds not allowed near stereocenter");if(i.type===$.PATTERN.TYPE.AROMATIC)throw new Error("aromatic bonds not allowed near stereocenter");i.type===$.PATTERN.TYPE.DOUBLE&&c++})),qe.allowed_stereocenters.find((function(t){return t.elem===n.label&&t.charge===n.charge&&t.degree===o&&t.n_double_bonds===c&&(i=t.implicit_degree,!0)})),-1===i)throw new Error("unknown stereocenter configuration: "+n.label+", charge "+n.charge+", "+o+" bonds ("+c+" double)");if(4===o&&l>1)throw new Error(l+" hydrogens near stereocenter");if(3===o&&4===i&&l>0)throw new Error("have hydrogen(s) besides implicit hydrogen near stereocenter");if(4===o){s[0].rank>s[1].rank&&We(s,0,1),s[1].rank>s[2].rank&&We(s,1,2),s[2].rank>s[3].rank&&We(s,2,3),s[1].rank>s[2].rank&&We(s,1,2),s[0].rank>s[1].rank&&We(s,0,1),s[1].rank>s[2].rank&&We(s,1,2);for(var f,h,d=-1,p=-1,v=-1,m=-1,g=0,y=0;y<4;y++){var b=this.getBondStereo(t,s[y].edge_idx);if(b===$.PATTERN.STEREO.UP||b==$.PATTERN.STEREO.DOWN){d=y,g=b;break}}if(-1===d)throw new Error("none of 4 bonds going from stereocenter is stereobond");if(-1===p&&((f=qe.xyzzy(s[d].vec,s[(d+1)%4].vec,s[(d+2)%4].vec))+(h=qe.xyzzy(s[d].vec,s[(d+1)%4].vec,s[(d+3)%4].vec))!=3&&f+h!=12||(p=(d+1)%4,v=(d+2)%4,m=(d+3)%4)),-1==p&&((f=qe.xyzzy(s[d].vec,s[(d+2)%4].vec,s[(d+1)%4].vec))+(h=qe.xyzzy(s[d].vec,s[(d+2)%4].vec,s[(d+3)%4].vec))!=3&&f+h!=12||(p=(d+2)%4,v=(d+1)%4,m=(d+3)%4)),-1==p&&((f=qe.xyzzy(s[d].vec,s[(d+3)%4].vec,s[(d+1)%4].vec))+(h=qe.xyzzy(s[d].vec,s[(d+3)%4].vec,s[(d+2)%4].vec))!=3&&f+h!=12||(p=(d+3)%4,v=(d+2)%4,m=(d+1)%4)),-1==p)throw new Error("internal error: can not find opposite bond");if(g==$.PATTERN.STEREO.UP&&this.getBondStereo(t,s[p].edge_idx)==$.PATTERN.STEREO.DOWN)throw new Error("stereo types of the opposite bonds mismatch");if(g==$.PATTERN.STEREO.DOWN&&this.getBondStereo(t,s[p].edge_idx)==$.PATTERN.STEREO.UP)throw new Error("stereo types of the opposite bonds mismatch");if(g==this.getBondStereo(t,s[v].edge_idx))throw new Error("stereo types of non-opposite bonds match");if(g==this.getBondStereo(t,s[m].edge_idx))throw new Error("stereo types of non-opposite bonds match");u=3==d||3==p?g:g==$.PATTERN.STEREO.UP?$.PATTERN.STEREO.DOWN:$.PATTERN.STEREO.UP,j=qe.sign(s[0].vec,s[1].vec,s[2].vec),u==$.PATTERN.STEREO.UP&&j>0||u==$.PATTERN.STEREO.DOWN&&j<0?(a.pyramid[0]=s[0].nei_idx,a.pyramid[1]=s[1].nei_idx,a.pyramid[2]=s[2].nei_idx):(a.pyramid[0]=s[0].nei_idx,a.pyramid[1]=s[2].nei_idx,a.pyramid[2]=s[1].nei_idx),a.pyramid[3]=s[3].nei_idx}else if(3===o){s[0].rank>s[1].rank&&We(s,0,1),s[1].rank>s[2].rank&&We(s,1,2),s[0].rank>s[1].rank&&We(s,0,1);var w=this.getBondStereo(t,s[0].edge_idx),x=this.getBondStereo(t,s[1].edge_idx),O=this.getBondStereo(t,s[2].edge_idx),E=0,_=0;if(E+=w===$.PATTERN.STEREO.UP?1:0,E+=x===$.PATTERN.STEREO.UP?1:0,E+=O===$.PATTERN.STEREO.UP?1:0,_+=w===$.PATTERN.STEREO.DOWN?1:0,_+=x===$.PATTERN.STEREO.DOWN?1:0,_+=O===$.PATTERN.STEREO.DOWN?1:0,4==i){if(3==E)throw new Error("all 3 bonds up near stereoatom");if(3==_)throw new Error("all 3 bonds down near stereoatom");if(0==E&&0==_)throw new Error("no up/down bonds near stereoatom -- indefinite case");if(1==E&&1==_)throw new Error("one bond up, one bond down -- indefinite case");if(g=0,2==E)u=$.PATTERN.STEREO.DOWN;else if(2==_)u=$.PATTERN.STEREO.UP;else{for(d=-1,v=-1,m=-1,y=0;y<3;y++)if((A=this.getBondStereo(t,s[y].edge_idx))==$.PATTERN.STEREO.UP||A==$.PATTERN.STEREO.DOWN){d=y,g=A,v=(y+1)%3,m=(y+2)%3;break}if(-1==d)throw new Error("internal error: can not find up or down bond");var S=qe.xyzzy(s[v].vec,s[m].vec,s[d].vec);if(3==S||4==S)throw new Error("degenerate case for 3 bonds near stereoatom");u=1==S?g:g==$.PATTERN.STEREO.UP?$.PATTERN.STEREO.DOWN:$.PATTERN.STEREO.UP}var j=qe.sign(s[0].vec,s[1].vec,s[2].vec);u==$.PATTERN.STEREO.UP&&j>0||u==$.PATTERN.STEREO.DOWN&&j<0?(a.pyramid[0]=s[0].nei_idx,a.pyramid[1]=s[1].nei_idx,a.pyramid[2]=s[2].nei_idx):(a.pyramid[0]=s[0].nei_idx,a.pyramid[1]=s[2].nei_idx,a.pyramid[2]=s[1].nei_idx),a.pyramid[3]=-1}else{var A;if(_>0&&E>0)throw new Error("one bond up, one bond down -- indefinite case");if(0==_&&0==E)throw new Error("no up-down bonds attached to stereocenter");A=E>0?1:-1,1!==qe.xyzzy(s[0].vec,s[1].vec,s[2].vec)&&1!==qe.xyzzy(s[0].vec,s[2].vec,s[1].vec)&&1!==qe.xyzzy(s[2].vec,s[1].vec,s[0].vec)||(A=-A),(j=qe.sign(s[0].vec,s[1].vec,s[2].vec))==A?(a.pyramid[0]=s[0].nei_idx,a.pyramid[1]=s[2].nei_idx,a.pyramid[2]=s[1].nei_idx):(a.pyramid[0]=s[0].nei_idx,a.pyramid[1]=s[1].nei_idx,a.pyramid[2]=s[2].nei_idx),a.pyramid[3]=-1}}this.atoms.set(t,a)},qe.prototype.getBondStereo=function(t,e){var n=this.molecule.bonds.get(e);return t!=n.begin?0:n.stereo},qe.xyzzy=function(t,e,n){var r=.001,o=z.cross(t,e),i=z.dot(t,e),a=z.cross(t,n),s=z.dot(t,n);if(Math.abs(o)<r){if(Math.abs(a)<r)throw new Error("degenerate case -- bonds overlap");return a>0?4:8}return o*a<-r*r||s<i?2:1},qe.sign=function(t,e,n){var r=(t.x-n.x)*(e.y-n.y)-(t.y-n.y)*(e.x-n.x);if(r>.001)return 1;if(r<-.001)return-1;throw new Error("degenerate triangle")},qe.isPyramidMappingRigid=function(t){var e=t.slice(),n=!0;return e[0]>e[1]&&(We(e,0,1),n=!n),e[1]>e[2]&&(We(e,1,2),n=!n),e[2]>e[3]&&(We(e,2,3),n=!n),e[1]>e[2]&&(We(e,1,2),n=!n),e[0]>e[1]&&(We(e,0,1),n=!n),e[1]>e[2]&&(We(e,1,2),n=!n),n},Ye._Atom=function(t){this.neighbours=[],this.aromatic=!1,this.lowercase=!1,this.chirality=0,this.branch_cnt=0,this.paren_written=!1,this.h_count=t,this.parent=-1},Ye.prototype.isBondInRing=function(t){return this.inLoop[t]},Ye.prototype.saveMolecule=function(t,e){var n,r,o,i=this;e||(this.ignoreErrors=e),(t=t.clone(void 0,void 0,!t.hasRxnArrow(),void 0,void 0,void 0)).initHalfBonds(),t.initNeighbors(),t.sortNeighbors(),t.setImplicitHydrogen(),t.sgroups.forEach((function(e){if("MUL"===e.type)try{at.prepareMulForSaving(e,t)}catch(t){throw Error("Bad s-group ("+t.message+")")}})),this.atoms=new Array(t.atoms.size),t.atoms.forEach((function(t,e){i.atoms[e]=new Ye._Atom(t.implicitH)}));var a=["B","C","N","O","P","S","Se","As"];t.bonds.forEach((function(e,n){e.type===$.PATTERN.TYPE.AROMATIC&&(i.atoms[e.begin].aromatic=!0,-1!==a.indexOf(t.atoms.get(e.begin).label)&&(i.atoms[e.begin].lowercase=!0),i.atoms[e.end].aromatic=!0,-1!==a.indexOf(t.atoms.get(e.end).label)&&(i.atoms[e.end].lowercase=!0)),i.atoms[e.begin].neighbours.push({aid:e.end,bid:n}),i.atoms[e.end].neighbours.push({aid:e.begin,bid:n})})),this.inLoop=function(){t.prepareLoopStructure();var e=new V;t.loops.forEach((function(n){if(n.hbs.length<=6){var r=n.hbs.map((function(e){return t.halfBonds.get(e).bid}));e=e.union(new V(r))}}));var n={};return e.forEach((function(t){n[t]=1})),n}(),this.touchedCistransbonds=0,this.markCisTrans(t);var s=t.getComponents(),u=s.reactants.concat(s.products),c=new Ue(t,this.atoms,u,s.reactants.length);for(c.walk(),this.atoms.forEach((function(t){t.neighbours=[]})),n=0;n<c.v_seq.length;n++){var l=c.v_seq[n],f=l.idx,h=l.parent_edge,d=l.parent_vertex;if(h>=0){var p=this.atoms[f],v=c.numOpeningCycles(h);for(r=0;r<v;r++)this.atoms[d].neighbours.push({aid:-1,bid:-1});if(c.edgeClosingCycle(h)){for(o=0;o<p.neighbours.length;o++)if(-1===p.neighbours[o].aid){p.neighbours[o].aid=d,p.neighbours[o].bid=h;break}if(o===p.neighbours.length)throw new Error("internal: can not put closing bond to its place")}else p.neighbours.push({aid:d,bid:h}),p.parent=d;this.atoms[d].neighbours.push({aid:f,bid:h})}}try{var m=new qe(t,(function(t){return this.atoms[t].neighbours}),this);m.buildFromBonds(this.ignoreErrors),m.each((function(t,e){var n=-1;-1==t.pyramid[3]&&(n=3);var a=[],s=0,u=i.atoms[e];if(-1!=u.parent)for(o=0;o<4;o++)if(t.pyramid[o]==u.parent){a[s++]=o;break}for(-1!==n&&(a[s++]=n),r=0;r!==u.neighbours.length;r++)if(u.neighbours[r].aid!=u.parent)for(o=0;o<4;o++)if(u.neighbours[r].aid==t.pyramid[o]){if(s>=4)throw new Error("internal: pyramid overflow");a[s++]=o;break}if(4===s)s=a[0],a[0]=a[1],a[1]=a[2],a[2]=a[3],a[3]=s;else if(3!==s)throw new Error("cannot calculate chirality");qe.isPyramidMappingRigid(a)?i.atoms[e].chirality=1:i.atoms[e].chirality=2}))}catch(t){}var g=[];g.push(0);var y=!0;for(n=0;n<c.v_seq.length;n++){f=(l=c.v_seq[n]).idx,h=l.parent_edge;var b=!0;if((d=l.parent_vertex)>=0){for(c.numBranches(d)>1&&this.atoms[d].branch_cnt>0&&this.atoms[d].paren_written&&(this.smiles+=")"),v=c.numOpeningCycles(h),r=0;r<v;r++){for(o=1;o<g.length&&-1!=g[o];o++);o===g.length?g.push(d):g[o]=d,this.writeCycleNumber(o)}if(d>=0){var w=c.numBranches(d);if(w>1&&this.atoms[d].branch_cnt<w-1&&(c.edgeClosingCycle(h)?this.atoms[d].paren_written=!1:(this.smiles+="(",this.atoms[d].paren_written=!0)),this.atoms[d].branch_cnt++,this.atoms[d].branch_cnt>w)throw new Error("unexpected branch")}var x=t.bonds.get(h),O=0;if(x.type==$.PATTERN.TYPE.SINGLE&&(O=this.calcBondDirection(t,h,d)),1==O&&f==x.end||2==O&&f==x.begin?this.smiles+="/":2==O&&f==x.end||1==O&&f==x.begin?this.smiles+="\\":x.type==$.PATTERN.TYPE.ANY?this.smiles+="~":x.type==$.PATTERN.TYPE.DOUBLE?this.smiles+="=":x.type==$.PATTERN.TYPE.TRIPLE?this.smiles+="#":x.type==$.PATTERN.TYPE.SINGLE_OR_AROMATIC?this.smiles+="-,:":x.type==$.PATTERN.TYPE.DOUBLE_OR_AROMATIC?this.smiles+="=,:":x.type==$.PATTERN.TYPE.SINGLE_OR_DOUBLE?this.smiles+="-,=":x.type!=$.PATTERN.TYPE.AROMATIC||this.atoms[x.begin].lowercase&&this.atoms[x.end].lowercase&&this.isBondInRing(h)?x.type==$.PATTERN.TYPE.SINGLE&&this.atoms[x.begin].aromatic&&this.atoms[x.end].aromatic&&(this.smiles+="-"):this.smiles+=":",c.edgeClosingCycle(h)){for(r=1;r<g.length&&g[r]!=f;r++);if(r===g.length)throw new Error("cycle number not found");this.writeCycleNumber(r),g[r]=-1,b=!1}}else y||(this.smiles+=this.writtenComponents===c.nComponentsInReactants&&0!==c.nReactants?">>":"."),y=!1,this.writtenComponents++;b&&(this.writeAtom(t,f,this.atoms[f].aromatic,this.atoms[f].lowercase,this.atoms[f].chirality),this.writtenAtoms.push(l.idx))}return this.comma=!1,this.writeRadicals(t),this.comma&&(this.smiles+="|"),this.smiles},Ye.prototype.writeCycleNumber=function(t){if(t>0&&t<10)this.smiles+=t;else if(t>=10&&t<100)this.smiles+="%"+t;else{if(!(t>=100&&t<1e3))throw new Error("bad cycle number: "+t);this.smiles+="%%"+t}},Ye.prototype.writeAtom=function(t,e,n,r,o){var i,a=t.atoms.get(e),s=!1,u=-1;if("A"!==a.label)if("R"!==a.label&&"R#"!==a.label){i=a.aam,"C"!==a.label&&"P"!==a.label&&"N"!==a.label&&"S"!==a.label&&"O"!==a.label&&"Cl"!==a.label&&"F"!==a.label&&"Br"!==a.label&&"B"!==a.label&&"I"!==a.label&&(s=!0),(a.explicitValence>=0||0!==a.radical||o>0||n&&"C"!==a.label&&"O"!==a.label||n&&"C"===a.label&&this.atoms[e].neighbours.length<3&&0===this.atoms[e].h_count)&&(u=this.atoms[e].h_count);var c=a.label;if(a.atomList&&!a.atomList.notList?(c=a.atomList.label(),s=!1):a.isPseudo()||a.atomList&&a.atomList.notList?(c="*",s=!1):(o||0!==a.charge||a.isotope>0||u>=0||i>0)&&(s=!0),s&&(-1===u&&(u=this.atoms[e].h_count),this.smiles+="["),a.isotope>0&&(this.smiles+=a.isotope),this.smiles+=r?c.toLowerCase():c,o>0&&(this.smiles+=1===o?"@":"@@",a.implicitH>1))throw new Error(a.implicitH+" implicit H near stereocenter");"H"!==a.label&&(u>1||0===u&&!s?this.smiles+="H"+u:1===u&&(this.smiles+="H")),a.charge>1?this.smiles+="+"+a.charge:a.charge<-1?this.smiles+=a.charge:1===a.charge?this.smiles+="+":-1===a.charge&&(this.smiles+="-"),i>0&&(this.smiles+=":"+i),s&&(this.smiles+="]")}else this.smiles+="[*]";else this.smiles+="*"},Ye.prototype.markCisTrans=function(t){var e=this;this.cis_trans=new He(t,(function(t){return this.atoms[t].neighbours}),this),this.cis_trans.build(),this.dbonds=new Array(t.bonds.size),t.bonds.forEach((function(t,n){e.dbonds[n]={ctbond_beg:-1,ctbond_end:-1,saved:0}})),this.cis_trans.each((function(n,r){var o=t.bonds.get(r);if(0!==n.parity&&!e.isBondInRing(r)){var i=e.atoms[o.begin].neighbours,a=e.atoms[o.end].neighbours,s=!0,u=!0;if(i.forEach((function(e){e.bid!==r&&t.bonds.get(e.bid).type===$.PATTERN.TYPE.SINGLE&&(s=!1)})),a.forEach((function(e){e.bid!==r&&t.bonds.get(e.bid).type===$.PATTERN.TYPE.SINGLE&&(u=!1)})),s||u)return;i.forEach((function(n){n.bid!==r&&(t.bonds.get(n.bid).begin===o.begin?e.dbonds[n.bid].ctbond_beg=r:e.dbonds[n.bid].ctbond_end=r)})),a.forEach((function(n){n.bid!==r&&(t.bonds.get(n.bid).begin===o.end?e.dbonds[n.bid].ctbond_beg=r:e.dbonds[n.bid].ctbond_end=r)}))}}))},Ye.prototype.updateSideBonds=function(t,e){var n=t.bonds.get(e),r=this.cis_trans.getSubstituents(e),o=this.cis_trans.getParity(e),i=[-1,-1,-1,-1];i[0]=t.findBondId(r[0],n.begin),-1!=r[1]&&(i[1]=t.findBondId(r[1],n.begin)),i[2]=t.findBondId(r[2],n.end),-1!=r[3]&&(i[3]=t.findBondId(r[3],n.end));var a=0,s=0,u=0,c=0;if(0!=this.dbonds[i[0]].saved&&(1==this.dbonds[i[0]].saved&&t.bonds.get(i[0]).begin==n.begin||2==this.dbonds[i[0]].saved&&t.bonds.get(i[0]).end==n.begin?a++:s++),-1!=i[1]&&0!=this.dbonds[i[1]].saved&&(2==this.dbonds[i[1]].saved&&t.bonds.get(i[1]).begin==n.begin||1==this.dbonds[i[1]].saved&&t.bonds.get(i[1]).end==n.begin?a++:s++),0!=this.dbonds[i[2]].saved&&(1==this.dbonds[i[2]].saved&&t.bonds.get(i[2]).begin==n.end||2==this.dbonds[i[2]].saved&&t.bonds.get(i[2]).end==n.end?u++:c++),-1!=i[3]&&0!=this.dbonds[i[3]].saved&&(2==this.dbonds[i[3]].saved&&t.bonds.get(i[3]).begin==n.end||1==this.dbonds[i[3]].saved&&t.bonds.get(i[3]).end==n.end?u++:c++),o==He.PARITY.CIS?(a+=u,s+=c):(a+=c,s+=u),a>0&&s>0)throw new Error("incompatible cis-trans configuration");return(0!==a||0!==s)&&(a>0&&(this.dbonds[i[0]].saved=t.bonds.get(i[0]).begin==n.begin?1:2,-1!=i[1]&&(this.dbonds[i[1]].saved=t.bonds.get(i[1]).begin==n.begin?2:1),this.dbonds[i[2]].saved=t.bonds.get(i[2]).begin==n.end==(o==He.PARITY.CIS)?1:2,-1!=i[3]&&(this.dbonds[i[3]].saved=t.bonds.get(i[3]).begin==n.end==(o==He.PARITY.CIS)?2:1)),s>0&&(this.dbonds[i[0]].saved=t.bonds.get(i[0]).begin==n.begin?2:1,-1!=i[1]&&(this.dbonds[i[1]].saved=t.bonds.get(i[1]).begin==n.begin?1:2),this.dbonds[i[2]].saved=t.bonds.get(i[2]).begin==n.end==(o==He.PARITY.CIS)?2:1,-1!=i[3]&&(this.dbonds[i[3]].saved=t.bonds.get(i[3]).begin==n.end==(o==He.PARITY.CIS)?1:2)),!0)},Ye.prototype.calcBondDirection=function(t,e,n){var r,o=this;if(-1==this.dbonds[e].ctbond_beg&&-1==this.dbonds[e].ctbond_end)return 0;if(t.bonds.get(e).type!=$.PATTERN.TYPE.SINGLE)throw new Error("internal: directed bond type "+t.bonds.get(e).type);for(;r=0,this.cis_trans.each((function(e,n){0===e.parity||o.isBondInRing(n)||o.updateSideBonds(t,n)&&r++})),r!==this.touchedCistransbonds;)this.touchedCistransbonds=r;return 0===this.dbonds[e].saved&&(n===t.bonds.get(e).begin?this.dbonds[e].saved=1:this.dbonds[e].saved=2),this.dbonds[e].saved},Ye.prototype.writeRadicals=function(t){var e,n,r=new Array(this.writtenAtoms.length);for(e=0;e<this.writtenAtoms.length;e++)if(!r[e]){var o=t.atoms.get(this.writtenAtoms[e]).radical;if(0!==o)for(this.comma?this.smiles+=",":(this.smiles+=" |",this.comma=!0),o==W.PATTERN.RADICAL.SINGLET?this.smiles+="^3:":o==W.PATTERN.RADICAL.DOUPLET?this.smiles+="^1:":this.smiles+="^4:",this.smiles+=e,n=e+1;n<this.writtenAtoms.length;n++)t.atoms.get(this.writtenAtoms[n]).radical===o&&(r[n]=!0,this.smiles+=","+n)}};var Je=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"options",void 0),this.options=Ke(Ke({},t.DefaultOptions),e)}return(0,o.Z)(t,[{key:"deserialize",value:function(t){throw new Error("Not implemented yet.")}},{key:"serialize",value:function(t){return(new Ye).saveMolecule(t,this.options.ignoreErrors)}}]),t}();(0,i.Z)(Je,"DefaultOptions",{ignoreErrors:!1});var Xe,Qe=/^[^]+?\$\$\$\$$/gm,tn=function(){function t(){(0,r.Z)(this,t)}return(0,o.Z)(t,[{key:"deserialize",value:function(t){for(var e,n=[],r=new Ge;null!==(e=Qe.exec(t));){var o=e[0].replace(/\r/g,"").trim(),i=o.indexOf("M END");if(-1!==i){var a=o.substr(i+7).trim().split(/^$\n?/m),s=r.deserialize(o.substring(0,i+6)),u=a.reduce((function(t,e){var n=e.match(/^> [ \d]*<(\S+)>/);if(n){var r=n[1],o=e.split("\n")[1].trim();t[r]=Number.isFinite(o)?+o:o.toString()}return t}),{});n.push({struct:s,props:u})}}return n}},{key:"serialize",value:function(t){var e=new Ge;return t.reduce((function(t,n){return t+=e.serialize(n.struct),Object.keys(n.props).forEach((function(e){t+="> <"+e+">\n",t+=n.props[e]+"\n\n"})),t+"$$$$"}),"")}}]),t}();function en(t,e,n,r,o){var i=e;n&&"GET"===t&&(i=function(t,e){return t.replace(/:(\w+)/g,(function(t,n){return e[n]}))}(e,n));var a=fetch(i,{method:t,headers:Object.assign({Accept:"application/json"},r),body:"GET"!==t?n:void 0,credentials:"same-origin"});return o?o(a):a.then((function(t){return t.json().then((function(e){return t.ok?e:Promise.reject(e.error)}))}))}function nn(t,e,n,r){return function(o,i,a){var s=Object.assign({},o);return s.options=Object.assign(s.options||{},r,i),en(t,n+e,JSON.stringify(s),{"Content-Type":"application/json"},a)}}!function(t){t.Mol="chemical/x-mdl-molfile",t.Rxn="chemical/x-mdl-rxnfile",t.DaylightSmiles="chemical/x-daylight-smiles",t.ExtendedSmiles="chemical/x-chemaxon-cxsmiles",t.DaylightSmarts="chemical/x-daylight-smarts",t.InChI="chemical/x-inchi",t.InChIAuxInfo="chemical/x-inchi-aux",t.CDXML="chemical/x-cdxml",t.CML="chemical/x-cml",t.KET="chemical/x-indigo-ket"}(Xe||(Xe={}));var rn=function(){function t(e,n){(0,r.Z)(this,t),(0,i.Z)(this,"apiPath",void 0),(0,i.Z)(this,"defaultOptions",void 0),this.apiPath=e,this.defaultOptions=n}var e;return(0,o.Z)(t,[{key:"info",value:(e=(0,E.Z)(S().mark((function t(){var e,n,r,o;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=!1,t.prev=1,t.next=4,en("GET",this.apiPath+"info");case 4:o=t.sent,e=o.indigo_version,n=o.imago_versions,r=!0,t.next=15;break;case 10:t.prev=10,t.t0=t.catch(1),e="",n=[],r=!1;case 15:return t.abrupt("return",{indigoVersion:e,imagoVersions:n,isAvailable:r});case 16:case"end":return t.stop()}}),t,this,[[1,10]])}))),function(){return e.apply(this,arguments)})},{key:"convert",value:function(t,e){return nn("POST","indigo/convert",this.apiPath,this.defaultOptions)(t,e)}},{key:"layout",value:function(t,e){return nn("POST","indigo/layout",this.apiPath,this.defaultOptions)(t,e)}},{key:"clean",value:function(t,e){return nn("POST","indigo/clean",this.apiPath,this.defaultOptions)(t,e)}},{key:"aromatize",value:function(t,e){return nn("POST","indigo/aromatize",this.apiPath,this.defaultOptions)(t,e)}},{key:"dearomatize",value:function(t,e){return nn("POST","indigo/dearomatize",this.apiPath,this.defaultOptions)(t,e)}},{key:"calculateCip",value:function(t,e){return nn("POST","indigo/calculate_cip",this.apiPath,this.defaultOptions)(t,e)}},{key:"automap",value:function(t,e){return nn("POST","indigo/automap",this.apiPath,this.defaultOptions)(t,e)}},{key:"check",value:function(t,e){return nn("POST","indigo/check",this.apiPath,this.defaultOptions)(t,e)}},{key:"calculate",value:function(t,e){return nn("POST","indigo/calculate",this.apiPath,this.defaultOptions)(t,e)}},{key:"recognize",value:function(t,e){var n=e?"?version=".concat(e):"",r=en("POST",this.apiPath+"imago/uploads".concat(n),t,{"Content-Type":t.type||"application/octet-stream"}),o=en.bind(null,"GET",this.apiPath+"imago/uploads/:id");return r.then((function(t){return e=o.bind(null,{id:t.upload_id}),n=function(t){if("FAILURE"===t.state)throw t;return"SUCCESS"===t.state},500,300,new Promise((function(t,r){setTimeout((function o(){e().then((function(e){try{n(e)?t(e):setTimeout(o,500)}catch(t){r(t)}}),(function(t){return r(t)}))}),300)}));var e,n})).then((function(t){return{struct:t.metadata.mol_str}}))}},{key:"generateImageAsBase64",value:function(t,e){var n=(null==e?void 0:e.outputFormat)||"png";return nn("POST","indigo/render",this.apiPath,this.defaultOptions)({struct:t},{"render-output-format":n},(function(t){return t.then((function(t){return t.text()}))}))}}]),t}(),on=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"apiPath",void 0),(0,i.Z)(this,"mode","remote");var n=e,o=new URLSearchParams(document.location.search);o.has("api_path")&&(n=o.get("api_path")),this.apiPath=!n||/\/$/.test(n)?n:n+"/"}return(0,o.Z)(t,[{key:"createStructService",value:function(t){return new rn(this.apiPath,t)}}]),t}(),an=function t(e,n,o,a,s){(0,r.Z)(this,t),(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"mime",void 0),(0,i.Z)(this,"extensions",void 0),(0,i.Z)(this,"supportsCoords",void 0),(0,i.Z)(this,"options",void 0),this.name=e,this.mime=n,this.extensions=o,this.supportsCoords=a||!1,this.options=s||{}},sn={mol:new an("MDL Molfile V2000",Xe.Mol,[".mol"],!0),molV3000:new an("MDL Molfile V3000",Xe.Mol,[".mol"],!0,{"molfile-saving-mode":"3000"}),rxn:new an("MDL Rxnfile V2000",Xe.Rxn,[".rxn"],!0),rxnV3000:new an("MDL Rxnfile V3000",Xe.Rxn,[".rxn"],!0,{"molfile-saving-mode":"3000"}),smiles:new an("Daylight SMILES",Xe.DaylightSmiles,[".smi",".smiles"]),smilesExt:new an("Extended SMILES",Xe.ExtendedSmiles,[".cxsmi",".cxsmiles"]),smarts:new an("Daylight SMARTS",Xe.DaylightSmarts,[".smarts"]),inChI:new an("InChI",Xe.InChI,[".inchi"]),inChIAuxInfo:new an("InChI AuxInfo",Xe.InChIAuxInfo,[".inchi"]),cml:new an("CML",Xe.CML,[".cml",".mrv"],!0),ket:new an("Ket Format",Xe.KET,[".ket"]),cdxml:new an("CDXML",Xe.CDXML,[".cdxml"],!0)};function un(t){return sn[t]}var cn=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"serializer",void 0),this.serializer=e}var e,n;return(0,o.Z)(t,[{key:"getStructureFromStructAsync",value:(n=(0,E.Z)(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.serializer.serialize(e),t.abrupt("return",n);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"getStructureFromStringAsync",value:(e=(0,E.Z)(S().mark((function t(e){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.serializer.deserialize(e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),ln=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"molfileManager",void 0),this.molfileManager=e}var e,n;return(0,o.Z)(t,[{key:"getStructureFromStructAsync",value:(n=(0,E.Z)(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.molfileManager.serialize(e),t.abrupt("return",n);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"getStructureFromStringAsync",value:(e=(0,E.Z)(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.molfileManager.deserialize(e),t.abrupt("return",n);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),fn=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"molfileManager",void 0),this.molfileManager=e}var e,n;return(0,o.Z)(t,[{key:"getStructureFromStructAsync",value:(n=(0,E.Z)(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.molfileManager.serialize(e),t.abrupt("return",n);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"getStructureFromStringAsync",value:(e=(0,E.Z)(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.molfileManager.deserialize(e),t.abrupt("return",n);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}();function hn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hn(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var pn,vn,mn,gn=function(){function t(e,n,o,a){(0,r.Z)(this,t),(0,i.Z)(this,"structService",void 0),(0,i.Z)(this,"ketSerializer",void 0),(0,i.Z)(this,"format",void 0),(0,i.Z)(this,"options",void 0),this.structService=e,this.ketSerializer=n,this.format=o,this.options=a}var e,n;return(0,o.Z)(t,[{key:"getStructureFromStructAsync",value:(n=(0,E.Z)(S().mark((function t(e){var n,r,o,i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.structService.info();case 2:if(t.sent.isAvailable){t.next=5;break}throw new Error("Server is not available");case 5:return n=un(this.format),t.prev=6,r=this.ketSerializer.serialize(e),t.next=10,this.structService.convert({struct:r,output_format:n.mime},dn(dn({},this.options),n.options));case 10:return o=t.sent,t.abrupt("return",o.struct);case 14:throw t.prev=14,t.t0=t.catch(6),i="Server is not compatible"===t.t0.message?"".concat(n.name," is not supported."):"Convert error!\n".concat(t.t0.message||t.t0),new Error(i);case 18:case"end":return t.stop()}}),t,this,[[6,14]])}))),function(t){return n.apply(this,arguments)})},{key:"getStructureFromStringAsync",value:(e=(0,E.Z)(S().mark((function t(e){var n,r,o,i,a,s;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.structService.info();case 2:if(t.sent.isAvailable){t.next=5;break}throw new Error("Server is not available");case 5:return r={struct:void 0,output_format:un("ket").mime},(o=un(this.format).supportsCoords)?(n=this.structService.convert,r.struct=e):(n=this.structService.layout,r.struct=e.trim()),t.prev=8,t.next=11,n(r,this.options);case 11:return i=t.sent,a=this.ketSerializer.deserialize(i.struct),o||a.rescale(),t.abrupt("return",a);case 17:if(t.prev=17,t.t0=t.catch(8),"Server is not compatible"===t.t0.message){t.next=21;break}throw Error("Convert error!\n".concat(t.t0.message||t.t0));case 21:throw s="smiles"===this.format?"".concat(un("smilesExt").name," and opening of ").concat(un("smiles").name):un(this.format).name,Error("".concat(s," is not supported in standalone mode."));case 23:case"end":return t.stop()}}),t,this,[[8,17]])}))),function(t){return e.apply(this,arguments)})}]),t}(),yn=function(){function t(e,n,o,a,s){(0,r.Z)(this,t),(0,i.Z)(this,"smiSerializer",void 0),(0,i.Z)(this,"structService",void 0),(0,i.Z)(this,"ketSerializer",void 0),(0,i.Z)(this,"format",void 0),(0,i.Z)(this,"options",void 0),this.smiSerializer=e,this.structService=n,this.ketSerializer=o,this.format=a,this.options=s}var e;return(0,o.Z)(t,[{key:"getStructureFromStructAsync",value:(e=(0,E.Z)(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.smiSerializer.serialize(e),t.abrupt("return",n);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"getStructureFromStringAsync",value:function(t){return new gn(this.structService,this.ketSerializer,this.format,this.options).getStructureFromStringAsync(t)}}]),t}(),bn=["reactionRelayout","badHeaderRecover"],wn=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"structService",void 0),this.structService=e}return(0,o.Z)(t,[{key:"separateOptions",value:function(t){if(!t)return[{},{}];var e=t.reactionRelayout,n=t.badHeaderRecover,r=(0,j.Z)(t,bn),o={};return"boolean"==typeof e&&(o.reactionRelayout=e),"boolean"==typeof n&&(o.badHeaderRecover=n),[o,r]}},{key:"create",value:function(t,e){var n,r=this.separateOptions(e),o=(0,y.Z)(r,2),i=o[0],a=o[1];switch(t){case"ket":n=new cn(new Ht);break;case"mol":n=new ln(new Ge(i));break;case"rxn":n=new fn(new Ge(i));break;case"smiles":n=new yn(new Je,this.structService,new Ht,t,a);break;default:n=new gn(this.structService,new Ht,t,a)}return n}}]),t}();function xn(t){var e=t.trim();try{if(JSON.parse(e))return"ket"}catch(t){}if(-1!==e.indexOf("$RXN"))return"rxn";if(-1!==e.indexOf("V3000"))return"molV3000";var n=e.match(/^(M {2}END|\$END MOL)$/m);if(n){var r=(n.index||0)+n[0].length;if(r===e.length||-1!==e.slice(r,r+20).search(/^\$(MOL|END CTAB)$/m))return"mol"}return"<"===e[0]&&-1!==e.indexOf("<molecule")?"cml":"InChI"===e.slice(0,5)?"inChI":-1===e.indexOf("\n")?"smiles":-1!==e.indexOf("<CDXML")?"cdxml":"mol"}P().el.translateAbs=function(t,e){this.delta=this.delta||new z,this.delta.x+=t-0,this.delta.y+=e-0,this.transform("t"+this.delta.x.toString()+","+this.delta.y.toString())},P().st.translateAbs=function(t,e){this.forEach((function(n){n.translateAbs(t,e)}))},function(t){t.background="background",t.selectionPlate="selectionPlate",t.hovering="hovering",t.warnings="warnings",t.data="data",t.indices="indices"}(pn||(pn={})),function(t){t.LabelsOnly="LabelsOnly",t.BondsOnly="BondsOnly",t.LabelsAndBonds="LabelsAndBonds",t.Off="Off"}(vn||(vn={})),function(t){t.IUPAC="Iupac",t.Classic="Classic",t.On="On",t.Off="Off"}(mn||(mn={}));var On=function(){function t(e){(0,r.Z)(this,t),this.type=e,this.paths=[],this.boxes=[],this.boundingBox=null,this.exts=[]}return(0,o.Z)(t,[{key:"add",value:function(t,e,n){this.paths.push(t),e&&(this.boxes.push(e),this.boundingBox=null==this.boundingBox?e:ot.union(this.boundingBox,e)),n&&this.exts.push(n)}},{key:"clear",value:function(){this.paths=[],this.boxes=[],this.exts=[],this.boundingBox=null}},{key:"translate",value:function(){if(arguments.length>2)throw new Error("One vector or two scalar arguments expected");if(1===arguments.length){var t=arguments.length<=0?void 0:arguments[0];this.translate(t.x,t.y)}else{for(var e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],r=new z(e,n),o=0;o<this.paths.length;++o)this.paths[o].translateAbs(e,n);for(var i=0;i<this.boxes.length;++i)this.boxes[i]=this.boxes[i].translate(r);null!==this.boundingBox&&(this.boundingBox=this.boundingBox.translate(r))}}}]),t}(),En=function(){function t(e){(0,r.Z)(this,t),(0,i.Z)(this,"visel",void 0),(0,i.Z)(this,"hover",!1),(0,i.Z)(this,"hovering",null),(0,i.Z)(this,"selected",!1),(0,i.Z)(this,"selectionPlate",null),this.visel=new On(e)}return(0,o.Z)(t,[{key:"getVBoxObj",value:function(t){var e=this.visel.boundingBox;return null===e?null:(t.options.offset&&(e=e.translate(t.options.offset.negated())),e.transform(et.scaled2obj,t.options))}},{key:"setHover",value:function(t,e){if(t){var n="hovering"in this&&null!==this.hovering;if(n)if("set"===this.hovering.type){if(!this.hovering[0])return;n=!this.hovering[0].removed}else n=!this.hovering.removed;n?this.hovering.show():(e.paper.setStart(),this.drawHover(e),this.hovering=e.paper.setFinish())}else this.hovering&&this.hovering.hide();this.hover=t}},{key:"drawHover",value:function(t){throw new Error("ReObject.drawHover is not overridden.")}},{key:"makeSelectionPlate",value:function(t,e,n){throw new Error("ReObject.makeSelectionPlate is not overridden")}}]),t}(),_n=function(t){return parseFloat(t).toFixed(8)},Sn=function(t){return{x:t.x,y:t.y,width:t.width,height:t.height}},jn=function(t,e,n){s()(!!t),s()(!!e),s()(!!n);var r=[n.p0,new z(n.p1.x,n.p0.y),n.p1,new z(n.p0.x,n.p1.y)].map((function(e){return e.sub(t)}));e=e.normalized();for(var o=r.map((function(t){return z.cross(t,e)})),i=r.map((function(t){return z.dot(t,e)})),a=-1,u=-1,c=0;c<4;++c)o[c]>0?(a<0||i[a]<i[c])&&(a=c):(u<0||i[u]<i[c])&&(u=c);if(u<0||a<0)return 0;var l=i[a]>i[u]?u:a,f=i[a]>i[u]?a:u;return i[l]+Math.abs(o[l])*(i[f]-i[l])/(Math.abs(o[l])+Math.abs(o[f]))};function An(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?An(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var kn=_n;function Tn(t,e){return"M"+kn(t.x)+","+kn(t.y)+"L"+kn(e.x)+","+kn(e.y)+"\t"}function Cn(t,e,n){for(var r=0,o=z.dist(t,e),i=z.diff(e,t).normalized(),a=!0,s="",u=0;r<o;){var c=n[u%n.length],l=r+Math.min(c,o-r);a&&(s+="M "+t.addScaled(i,r).coordStr()+" L "+t.addScaled(i,l).coordStr()),r+=c,a=!a,u++}return s}function Rn(t,e){if(P().vml){var n=.16*e.height;t.translateAbs(0,n),e.y+=n}}var Mn,In={recenterText:Rn,arrow:function(t,e,n,r,o,i,a){switch(a){case lt.OpenAngle:return function(t,e,n,r,o,i){var a=e.x+r,s="M".concat(kn(e.x),",").concat(kn(e.y))+"L".concat(kn(a),",").concat(kn(e.y))+"L".concat(kn(a-7),",").concat(kn(e.y-5))+"M".concat(kn(a),",").concat(kn(e.y))+"L".concat(kn(a-7),", ").concat(kn(e.y+5)),u=T()(s).rotate(o,e.x,e.y).toString();return t.path(u).attr(i.lineattr)}(t,e,0,r,o,i);case lt.FilledTriangle:return function(t,e,n,r,o,i){var a=e.x+r,s="M".concat(kn(e.x),",").concat(kn(e.y))+"L".concat(kn(a),",").concat(kn(e.y))+"L".concat(kn(a-10),",").concat(kn(e.y+5))+"L".concat(kn(a-10),",").concat(kn(e.y-5))+"L".concat(kn(a),",").concat(kn(e.y),"Z"),u=T()(s).rotate(o,e.x,e.y).toString();return t.path(u).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.FilledBow:return function(t,e,n,r,o,i){var a=e.x+r,s="M".concat(kn(e.x),",").concat(kn(e.y))+"L".concat(kn(a),",").concat(kn(e.y))+"L".concat(kn(a-10),",").concat(kn(e.y+5))+"L".concat(kn(a-10+4),",").concat(kn(e.y))+"L".concat(kn(a-10),",").concat(kn(e.y-5))+"L".concat(kn(a),",").concat(kn(e.y),"Z"),u=T()(s).rotate(o,e.x,e.y).toString();return t.path(u).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.DashedOpenAngle:return function(t,e,n,r,o,i){for(var a=[],s=e.x+r,u=0;u<r/3.5;u++)u%2?a.push("L".concat(kn(e.x+3.5*u),",").concat(kn(e.y))):a.push("M".concat(kn(e.x+3.5*u),",").concat(kn(e.y)));a.push("M".concat(kn(s),",").concat(kn(e.y))+"L".concat(kn(s-10),",").concat(kn(e.y+5))+"M".concat(kn(s),",").concat(kn(e.y))+"L".concat(kn(s-10),",").concat(kn(e.y-5)));var c=T()(a.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.Failed:return function(t,e,n,r,o,i){var a=e.x+r,s=a-(a-e.x)/2,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y))+"L".concat(kn(a),",").concat(kn(e.y))+"L".concat(kn(a-10),",").concat(kn(e.y+5))+"L".concat(kn(a-10+4),",").concat(kn(e.y))+"L".concat(kn(a-10),",").concat(kn(e.y-5))+"L".concat(kn(a),",").concat(kn(e.y),"Z")),u.push("M".concat(kn(s+8),",").concat(kn(e.y+8))+"L".concat(kn(s-8),",").concat(kn(e.y-8))),u.push("M".concat(kn(s+8),",").concat(kn(e.y-8))+"L".concat(kn(s-8),",").concat(kn(e.y+8)));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.BothEndsFilledTriangle:return function(t,e,n,r,o,i){var a=e.x+r,s="M".concat(kn(e.x),",").concat(kn(e.y))+"L".concat(kn(a),",").concat(kn(e.y))+"L".concat(kn(a-10),",").concat(kn(e.y+5))+"L".concat(kn(a-10),",").concat(kn(e.y-5))+"L".concat(kn(a),",").concat(kn(e.y))+"M".concat(kn(e.x),",").concat(kn(e.y))+"L".concat(kn(e.x+10),",").concat(kn(e.y-5))+"L".concat(kn(e.x+10),",").concat(kn(e.y+5))+"L".concat(kn(e.x),",").concat(kn(e.y)),u=T()(s).rotate(o,e.x,e.y).toString();return t.path(u).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.EquilibriumFilledHalfBow:return function(t,e,n,r,o,i){var a=3.5,s=e.x+r,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y-a))+"L".concat(kn(s),",").concat(kn(e.y-a))+"L".concat(kn(s-9),",").concat(kn(e.y-7))+"L".concat(kn(s-9+2),",").concat(kn(e.y-a),"Z")),u.push("M".concat(kn(s),",").concat(kn(e.y+a))+"L".concat(kn(e.x),",").concat(kn(e.y+a))+"L".concat(kn(e.x+9),",").concat(kn(e.y+7))+"L".concat(kn(e.x+9-2),",").concat(e.y+a,"Z"));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.EquilibriumFilledTriangle:return function(t,e,n,r,o,i){var a=3.5,s=e.x+r,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y-a))+"L".concat(kn(s),",").concat(kn(e.y-a))+"L".concat(kn(s-9),",").concat(kn(e.y-7))+"L".concat(kn(s-9),",").concat(kn(e.y-a))+"L".concat(kn(s-9),",").concat(kn(e.y))+"L".concat(kn(s),",").concat(kn(e.y-a),"Z")),u.push("M".concat(kn(e.x),",").concat(kn(e.y+a))+"L".concat(kn(s),",").concat(kn(e.y+a))+"M".concat(kn(e.x),",").concat(kn(e.y+a))+"L".concat(kn(e.x+9),",").concat(kn(e.y+7))+"L".concat(kn(e.x+9),",").concat(e.y+a,"Z")+"L".concat(kn(e.x+9),",").concat(kn(e.y))+"L".concat(kn(e.x+9),",").concat(e.y+a,"Z"));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.EquilibriumOpenAngle:return function(t,e,n,r,o,i){var a=3.5,s=e.x+r,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y-a))+"L".concat(kn(s),",").concat(kn(e.y-a))+"L".concat(kn(s-7),",").concat(kn(e.y-5-a))),u.push("M".concat(kn(e.x),",").concat(kn(e.y+a))+"L".concat(kn(s),",").concat(kn(e.y+a))+"M".concat(kn(e.x),",").concat(kn(e.y+a))+"L".concat(kn(e.x+9),",").concat(kn(e.y+a+5)));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(i.lineattr)}(t,e,0,r,o,i);case lt.UnbalancedEquilibriumFilledHalfBow:return function(t,e,n,r,o,i){var a=3.5,s=e.x+r,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y-a))+"L".concat(kn(s),",").concat(kn(e.y-a))+"L".concat(kn(s-9),",").concat(kn(e.y-7))+"L".concat(kn(s-9+2),",").concat(kn(e.y-a),"Z")),u.push("M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(s-15),",").concat(kn(e.y+a))+"M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(e.x+9+15),",").concat(kn(e.y+7))+"L".concat(kn(e.x+9-2+15),",").concat(e.y+a,"Z"));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.UnbalancedEquilibriumOpenHalfAngle:return function(t,e,n,r,o,i){var a=3.5,s=e.x+r,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y-a))+"L".concat(kn(s),",").concat(kn(e.y-a))+"L".concat(kn(s-7),",").concat(kn(e.y-5-a))),u.push("M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(s-15),",").concat(kn(e.y+a))+"M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(e.x+9+15),",").concat(kn(e.y+a+5)));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(i.lineattr)}(t,e,0,r,o,i);case lt.UnbalancedEquilibriumLargeFilledHalfBow:return function(t,e,n,r,o,i){var a=3.5,s=e.x+r,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y-a))+"L".concat(kn(s),",").concat(kn(e.y-a))+"L".concat(kn(s-9),",").concat(kn(e.y-10))+"L".concat(kn(s-9+2),",").concat(kn(e.y-a),"Z")),u.push("M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(s-15),",").concat(kn(e.y+a))+"M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(e.x+9+15),",").concat(kn(e.y+10))+"L".concat(kn(e.x+9-2+15),",").concat(e.y+a,"Z"));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i);case lt.UnbalancedEquilibriumFilleHalfTriangle:return function(t,e,n,r,o,i){var a=3.5,s=e.x+r,u=[];u.push("M".concat(kn(e.x),",").concat(kn(e.y-a))+"L".concat(kn(s),",").concat(kn(e.y-a))+"L".concat(kn(s-9),",").concat(kn(e.y-7))+"L".concat(kn(s-9),",").concat(kn(e.y-a),"Z")),u.push("M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(s-15),",").concat(kn(e.y+a))+"M".concat(kn(e.x+15),",").concat(kn(e.y+a))+"L".concat(kn(e.x+9+15),",").concat(kn(e.y+7))+"L".concat(kn(e.x+9+15),",").concat(e.y+a,"Z"));var c=T()(u.join("")).rotate(o,e.x,e.y).toString();return t.path(c).attr(Pn(Pn({},i.lineattr),{},{fill:"#000"}))}(t,e,0,r,o,i)}},plus:function(t,e,n){var r=n.scale/5;return t.path("M{0},{4}L{0},{5}M{2},{1}L{3},{1}",kn(e.x),kn(e.y),kn(e.x-r),kn(e.x+r),kn(e.y-r),kn(e.y+r)).attr(n.lineattr)},aromaticBondPaths:function(t,e,n,r,o,i){return[i&&1&o?Cn(t,n,i):Tn(t,n),i&&2&o?Cn(e,r,i):Tn(e,r)]},bondSingle:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"#000",i=e.p,a=n.p;return t.path(Tn(i,a)).attr(r.lineattr).attr({fill:o,stroke:o})},bondSingleUp:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"#000";return t.path("M{0},{1}L{2},{3}L{4},{5}Z",kn(e.x),kn(e.y),kn(n.x),kn(n.y),kn(r.x),kn(r.y)).attr(o.lineattr).attr({fill:i,stroke:i})},bondSingleStereoBold:function(t,e,n,r,o,i){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"#000",s=t.path("M{0},{1}L{2},{3}L{4},{5}L{6},{7}Z",kn(e.x),kn(e.y),kn(n.x),kn(n.y),kn(r.x),kn(r.y),kn(o.x),kn(o.y)).attr(i.lineattr);return s.attr({stroke:a,fill:a}),s},bondDoubleStereoBold:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"#000";return t.set([e,t.path("M{0},{1}L{2},{3}",kn(n.x),kn(n.y),kn(r.x),kn(r.y)).attr(o.lineattr).attr({stroke:i,fill:i})])},bondSingleDown:function(t,e,n,r,o,i){for(var a,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"#000",u=e.p,c=e.norm,l=.7*i.stereoBond,f="",h=0;h<r;++h)f+=Tn((a=u.addScaled(n,o*h)).addScaled(c,l*(h+.5)/(r-.5)),a.addScaled(c,-l*(h+.5)/(r-.5)));return t.path(f).attr(i.lineattr).attr({fill:s,stroke:s})},bondSingleEither:function(t,e,n,r,o,i){for(var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"#000",s=e.p,u=e.norm,c=.7*i.stereoBond,l="M"+kn(s.x)+","+kn(s.y),f=s,h=0;h<r;++h)f=s.addScaled(n,o*(h+.5)).addScaled(u,(1&h?-1:1)*c*(h+.5)/(r-.5)),l+="L"+kn(f.x)+","+kn(f.y);return t.path(l).attr(i.lineattr).attr({fill:a,stroke:a})},bondDouble:function(t,e,n,r,o,i,a){return t.path(i?"M{0},{1}L{6},{7}M{4},{5}L{2},{3}":"M{0},{1}L{2},{3}M{4},{5}L{6},{7}",kn(e.x),kn(e.y),kn(r.x),kn(r.y),kn(n.x),kn(n.y),kn(o.x),kn(o.y)).attr(a.lineattr)},bondSingleOrDouble:function(t,e,n,r,o){for(var i,a=e.p,s=n.p,u=e.norm,c=o.bondSpace/2,l="",f=a,h=1;h<=r;++h)i=z.lc2(a,(r-h)/r,s,h/r),1&h?l+=Tn(f,i):(l+=Tn(f.addScaled(u,c),i.addScaled(u,c)),l+=Tn(f.addScaled(u,-c),i.addScaled(u,-c))),f=i;return t.path(l).attr(o.lineattr)},bondTriple:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"#000",i=e.p,a=n.p,s=e.norm,u=i.addScaled(s,r.bondSpace),c=a.addScaled(s,r.bondSpace),l=i.addScaled(s,-r.bondSpace),f=a.addScaled(s,-r.bondSpace);return t.path(Tn(i,a)+Tn(u,c)+Tn(l,f)).attr(r.lineattr).attr({fill:o,stroke:o})},bondAromatic:function(t,e,n,r){var o=t.path(e[0]).attr(r.lineattr),i=t.path(e[1]).attr(r.lineattr);return null!=n&&(n>0?o:i).attr({"stroke-dasharray":"- "}),t.set([o,i])},bondAny:function(t,e,n,r){var o=e.p,i=n.p;return t.path(Tn(o,i)).attr(r.lineattr).attr({"stroke-dasharray":"- "})},bondHydrogen:function(t,e,n,r){var o=e.p,i=n.p;return t.path(Tn(o,i)).attr(r.lineattr).attr({"stroke-dasharray":".","stroke-linecap":"square"})},bondDative:function(t,e,n,r){var o=e.p,i=n.p;return t.path(Tn(o,i)).attr(r.lineattr).attr({"arrow-end":"block-midium-long"})},reactingCenter:function(t,e,n){for(var r="",o=0;o<e.length/2;++o)r+=Tn(e[2*o],e[2*o+1]);return t.path(r).attr(n.lineattr)},topologyMark:function(t,e,n,r){var o=t.text(e.x,e.y,n).attr({font:r.font,"font-size":r.fontszsub,fill:"#000"}),i=Sn(o.getBBox());return Rn(o,i),o},radicalCap:function(t,e,n){var r=.9*n.lineWidth,o=r,i=2*r;return t.path("M{0},{1}L{2},{3}L{4},{5}",kn(e.x-o),kn(e.y+i),kn(e.x),kn(e.y),kn(e.x+o),kn(e.y+i)).attr({stroke:"#000","stroke-width":.7*n.lineWidth,"stroke-linecap":"square","stroke-linejoin":"miter"})},radicalBullet:function(t,e,n){return t.circle(kn(e.x),kn(e.y),n.lineWidth).attr({stroke:null,fill:"#000"})},bracket:function(t,e,n,r,o,i,a){o=o||.25,i=i||1;var s=r.addScaled(n,-.5*i),u=r.addScaled(n,.5*i),c=s.addScaled(e,-o),l=u.addScaled(e,-o);return t.path("M{0},{1}L{2},{3}L{4},{5}L{6},{7}",kn(c.x),kn(c.y),kn(s.x),kn(s.y),kn(u.x),kn(u.y),kn(l.x),kn(l.y)).attr(a.sgroupBracketStyle)},selectionRectangle:function(t,e,n,r){return t.rect(kn(Math.min(e.x,n.x)),kn(Math.min(e.y,n.y)),kn(Math.abs(n.x-e.x)),kn(Math.abs(n.y-e.y))).attr(r.lassoStyle)},selectionPolygon:function(t,e,n){for(var r=e[e.length-1],o="M"+kn(r.x)+","+kn(r.y),i=0;i<e.length;++i)o+="L"+kn(e[i].x)+","+kn(e[i].y);return t.path(o).attr(n.lassoStyle)},selectionLine:function(t,e,n,r){return t.path(Tn(e,n)).attr(r.lassoStyle)},ellipse:function(t,e,n){var r=z.diff(e[1],e[0]),o=r.x/2,i=r.y/2;return t.ellipse(e[0].x+o,e[0].y+i,Math.abs(o),Math.abs(i))},rectangle:function(t,e,n){return t.rect(kn(Math.min(e[0].x,e[1].x)),kn(Math.min(e[0].y,e[1].y)),kn(Math.abs(e[1].x-e[0].x)),kn(Math.abs(e[1].y-e[0].y)))},rectangleWithAngle:function(t,e,n,r,o,i){var a=e.x+r,s="M".concat(kn(e.x-5),",").concat(kn(e.y))+"L".concat(kn(e.x-5),",").concat(kn(e.y+8))+"L".concat(kn(a+5),",").concat(kn(e.y+8))+"L".concat(kn(a+5),",").concat(kn(e.y-8))+"L".concat(kn(e.x-5),",").concat(kn(e.y-8),"Z");return T()(s).rotate(o,e.x,e.y).toString()},polyline:function(t,e,n){for(var r=["M",e[0].x,e[0].y],o=1;o<e.length;o++)r.push("L",e[o].x,e[o].y);return t.path(r)},line:function(t,e,n){var r=["M",e[0].x,e[0].y];return r.push("L",e[1].x,e[1].y),t.path(r)}};function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t){t.Off="off",t.Hetero="Hetero",t.Terminal="Terminal",t.TerminalAndHetero="Terminal and Hetero",t.On="on"}(Mn||(Mn={}));var Bn=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,"atom"),(0,i.Z)((0,b.Z)(e),"a",void 0),(0,i.Z)((0,b.Z)(e),"showLabel",void 0),(0,i.Z)((0,b.Z)(e),"hydrogenOnTheLeft",void 0),(0,i.Z)((0,b.Z)(e),"color",void 0),(0,i.Z)((0,b.Z)(e),"component",void 0),(0,i.Z)((0,b.Z)(e),"label",void 0),e.a=t,e.showLabel=!1,e.hydrogenOnTheLeft=!1,e.color="#000000",e.component=-1,e}return(0,o.Z)(s,[{key:"getVBoxObj",value:function(t){return this.visel.boundingBox?En.prototype.getVBoxObj.call(this,t):new ot(this.a.pp,this.a.pp)}},{key:"drawHover",value:function(t){var e=this.makeHoverPlate(t);return t.ctab.addReObjectPath(pn.hovering,this.visel,e),e}},{key:"makeHoverPlate",value:function(t){var e=t.paper,n=t.options,r=et.obj2scaled(this.a.pp,n),o=this.a,i=t.ctab.sgroups,a=t.ctab.molecule.functionalGroups;return ht.isAtomInContractedFunctionalGroup(o,i,a,!0)?null:e.circle(r.x,r.y,n.atomSelectionPlateRadius).attr(n.hoverStyle)}},{key:"makeSelectionPlate",value:function(t,e,n){var r=this.a,o=t.render.ctab.sgroups,i=t.render.ctab.molecule.functionalGroups;if(ht.isAtomInContractedFunctionalGroup(r,o,i,!0))return null;var a=et.obj2scaled(this.a.pp,t.render.options);return e.circle(a.x,a.y,n.atomSelectionPlateRadius).attr(n.selectionStyle)}},{key:"show",value:function(t,e,n){var r,o=t.molecule.atoms.get(e),i=t.molecule.sgroups,a=t.molecule.functionalGroups,s=t.render,u=et.obj2scaled(this.a.pp,s.options);if(ht.isAtomInContractedFunctionalGroup(o,i,a,!1)){if(ht.isFirstAtomInFunctionalGroup(i,e)){var c,l,f=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(i.values());try{for(f.s();!(l=f.n()).done;){var h=l.value;e===h.atoms[0]&&(c=h.data.name)}}catch(t){f.e(t)}finally{f.f()}var d=s.paper.text(u.x,u.y,c).attr({"font-weight":700,"font-size":14});t.addReObjectPath(pn.data,this.visel,d,u,!0)}}else{var p,v,m,g,y,b;this.hydrogenOnTheLeft=function(t,e){if(0===e.a.neighbors.length){var n=B.get(e.a.label);return!n||Boolean(n.leftH)}var r=1,o=1,i=0,a=0;return e.a.neighbors.forEach((function(e){var n=t.halfBonds.get(e).dir;n.x<=0?(r=Math.min(r,Math.abs(n.y)),i++):(o=Math.min(o,Math.abs(n.y)),a++)})),r<.51||o<.51?o<r:a>i}(t.molecule,this),this.showLabel=function(t,e,n){var r=e.showHydrogenLabels!==Mn.Off&&e.showHydrogenLabels!==Mn.Hetero;if(0===n.a.neighbors.length||n.a.neighbors.length<2&&r||e.carbonExplicitly||n.a.alias||0!==n.a.isotope||0!==n.a.radical||0!==n.a.charge||n.a.explicitValence>=0||null!==n.a.atomList||null!==n.a.rglabel||n.a.badConn&&e.showValenceWarnings||"c"!==n.a.label.toLowerCase())return!0;if(2===n.a.neighbors.length){var o=n.a.neighbors[0],i=n.a.neighbors[1],a=t.molecule.halfBonds.get(o),s=t.molecule.halfBonds.get(i),u=t.bonds.get(a.bid),c=t.bonds.get(s.bid);if(u.b.type===c.b.type&&u.b.stereo===$.PATTERN.STEREO.NONE&&c.b.stereo===$.PATTERN.STEREO.NONE&&Math.abs(z.cross(a.dir,s.dir))<.2)return!0}return!1}(t,s.options,this),this.color="black";var w=null;if(this.showLabel&&(b=function(t,e,n,r){var o={};if(o.text=function(t){if(null!==t.atomList)return t.atomList.label();if(t.pseudo)return t.pseudo;if(t.alias)return t.alias;if("R#"===t.label&&null!==t.rglabel){for(var e="",n=0;n<32;n++)t.rglabel&1<<n&&(e+="R"+(n+1).toString());return e}return t.label}(t.a),""===o.text&&(o="R#"),o.text===t.a.label){var i=B.get(o.text);r.atomColoring&&i&&(t.color=M[o.text]||"#000")}return o.path=e.text(n.x,n.y,o.text).attr({font:r.font,"font-size":r.fontsz,fill:t.color,"font-style":t.a.pseudo?"italic":""}),o.rbb=Sn(o.path.getBBox()),In.recenterText(o.path,o.rbb),null!==t.a.atomList&&Ln(o.path,o.rbb,(t.hydrogenOnTheLeft?-1:1)*(o.rbb.width-o.rbb.height)/2,0),t.label=o,o}(this,s.paper,u,n),p=.5*n.lineWidth,v=b.rbb.width/2*(n.zoom>1?1:n.zoom),m=-b.rbb.width/2*(n.zoom>1?1:n.zoom),g=Math.floor(this.a.implicitH),y="H"===b.text,t.addReObjectPath(pn.data,this.visel,b.path,u,!0),n.showAtomIds&&((w={}).text=e.toString(),w.path=s.paper.text(u.x,u.y,w.text).attr({font:n.font,"font-size":n.fontszsub,fill:"#070"}),w.rbb=Sn(w.path.getBBox()),In.recenterText(w.path,w.rbb),t.addReObjectPath(pn.indices,this.visel,w.path,u)),this.setHover(this.hover,s)),this.showLabel&&!this.a.pseudo){var x=null;if(y&&g>0&&(x=function(t,e,n,r){var o=et.obj2scaled(t.a.pp,e.options),i=e.options,a=.5*i.lineWidth,s={};return s.text=(n+1).toString(),s.path=e.paper.text(o.x,o.y,s.text).attr({font:i.font,"font-size":i.fontszsub,fill:t.color}),s.rbb=Sn(s.path.getBBox()),In.recenterText(s.path,s.rbb),Ln(s.path,s.rbb,r+.5*s.rbb.width+a,.2*t.label.rbb.height),s}(this,s,g,v),v+=x.rbb.width+p,t.addReObjectPath(pn.data,this.visel,x.path,u,!0)),0!=this.a.radical){var O=function(t,e){var n,r=et.obj2scaled(t.a.pp,e.options),o=e.options,i=e.paper,a={};switch(t.a.radical){case 1:a.path=i.set(),n=1.6*o.lineWidth,a.path.push(In.radicalBullet(i,r.add(new z(-n,0)),o),In.radicalBullet(i,r.add(new z(n,0)),o)),a.path.attr("fill",t.color);break;case 2:a.path=i.set(),a.path.push(In.radicalBullet(i,r,o)),a.path.attr("fill",t.color);break;case 3:a.path=i.set(),n=1.6*o.lineWidth,a.path.push(In.radicalCap(i,r.add(new z(-n,0)),o),In.radicalCap(i,r.add(new z(n,0)),o)),a.path.attr("stroke",t.color)}a.rbb=Sn(a.path.getBBox());var s=-.5*(t.label.rbb.height+a.rbb.height);return 3===t.a.radical&&(s-=o.lineWidth/2),Ln(a.path,a.rbb,0,s),a}(this,s);t.addReObjectPath(pn.data,this.visel,O.path,u,!0)}if(0!=this.a.isotope){var E=function(t,e,n){var r=et.obj2scaled(t.a.pp,e.options),o=e.options,i=.5*o.lineWidth,a={};return a.text=t.a.isotope.toString(),a.path=e.paper.text(r.x,r.y,a.text).attr({font:o.font,"font-size":o.fontszsub,fill:t.color}),a.rbb=Sn(a.path.getBBox()),In.recenterText(a.path,a.rbb),Ln(a.path,a.rbb,n-.5*a.rbb.width-i,-.3*t.label.rbb.height),a}(this,s,m);m-=E.rbb.width+p,t.addReObjectPath(pn.data,this.visel,E.path,u,!0)}if(!y&&!this.a.alias&&g>0&&function(t,e){return t===Mn.On||t===Mn.Terminal&&e.a.neighbors.length<2||t===Mn.Hetero&&"c"!==e.label.text.toLowerCase()||t===Mn.TerminalAndHetero&&(e.a.neighbors.length<2||"c"!==e.label.text.toLowerCase())}(n.showHydrogenLabels,this)){var _=function(t,e,n,r){var o=r.hydroIndex,i=t.hydrogenOnTheLeft,a=et.obj2scaled(t.a.pp,e.options),s=e.options,u=.5*s.lineWidth,c=r.hydrogen;return c.text="H",c.path=e.paper.text(a.x,a.y,c.text).attr({font:s.font,"font-size":s.fontsz,fill:t.color}),c.rbb=Sn(c.path.getBBox()),In.recenterText(c.path,c.rbb),i||(Ln(c.path,c.rbb,r.rightMargin+.5*c.rbb.width+u,0),r.rightMargin+=c.rbb.width+u),n>1&&((o={}).text=n.toString(),o.path=e.paper.text(a.x,a.y,o.text).attr({font:s.font,"font-size":s.fontszsub,fill:t.color}),o.rbb=Sn(o.path.getBBox()),In.recenterText(o.path,o.rbb),i||(Ln(o.path,o.rbb,r.rightMargin+.5*o.rbb.width*(s.zoom>1?1:s.zoom)+u,.2*t.label.rbb.height),r.rightMargin+=o.rbb.width+u)),i&&(null!=o&&(Ln(o.path,o.rbb,r.leftMargin-.5*o.rbb.width-u,.2*t.label.rbb.height),r.leftMargin-=o.rbb.width+u),Ln(c.path,c.rbb,r.leftMargin-.5*c.rbb.width*(n>1&&s.zoom<1?s.zoom:1)-u,0),r.leftMargin-=c.rbb.width+u),Object.assign(r,{hydrogen:c,hydroIndex:o})}(this,s,g,{hydrogen:{},hydroIndex:x,rightMargin:v,leftMargin:m}),S=_.hydrogen;x=_.hydroIndex,v=_.rightMargin,m=_.leftMargin,t.addReObjectPath(pn.data,this.visel,S.path,u,!0),null!=x&&t.addReObjectPath(pn.data,this.visel,x.path,u,!0)}if(0!=this.a.charge&&n.showCharge){var j=function(t,e,n){var r=et.obj2scaled(t.a.pp,e.options),o=e.options,i=.5*o.lineWidth,a={text:""},s=Math.abs(t.a.charge);return 1!==s&&(a.text=s.toString()),t.a.charge<0?a.text+="–":a.text+="+",a.path=e.paper.text(r.x,r.y,a.text).attr({font:o.font,"font-size":o.fontszsub,fill:t.color}),a.rbb=Sn(a.path.getBBox()),In.recenterText(a.path,a.rbb),Ln(a.path,a.rbb,n+.5*a.rbb.width+i,-.3*t.label.rbb.height),a}(this,s,v);v+=j.rbb.width+p,t.addReObjectPath(pn.data,this.visel,j.path,u,!0)}if(this.a.explicitValence>=0&&n.showValence){var A=function(t,e,n){var r=et.obj2scaled(t.a.pp,e.options),o=e.options,i=.5*o.lineWidth,a={};if(a.text={0:"0",1:"I",2:"II",3:"III",4:"IV",5:"V",6:"VI",7:"VII",8:"VIII",9:"IX",10:"X",11:"XI",12:"XII",13:"XIII",14:"XIV"}[t.a.explicitValence],!a.text)throw new Error("invalid valence "+t.a.explicitValence.toString());return a.text="("+a.text+")",a.path=e.paper.text(r.x,r.y,a.text).attr({font:o.font,"font-size":o.fontszsub,fill:t.color}),a.rbb=Sn(a.path.getBBox()),In.recenterText(a.path,a.rbb),Ln(a.path,a.rbb,n+.5*a.rbb.width+i,-.3*t.label.rbb.height),a}(this,s,v);v+=A.rbb.width+p,t.addReObjectPath(pn.data,this.visel,A.path,u,!0)}if(this.a.badConn&&n.showValenceWarnings){var P=function(t,e,n,r){var o=et.obj2scaled(t.a.pp,e.options),i=.5*e.options.lineWidth,a=_n,s={},u=o.y+t.label.rbb.height/2+i;return s.path=e.paper.path("M{0},{1}L{2},{3}",a(o.x+n),a(u),a(o.x+r),a(u)).attr(e.options.lineattr).attr({stroke:"#F00"}),s.rbb=Sn(s.path.getBBox()),s}(this,s,m,v);t.addReObjectPath(pn.warnings,this.visel,P.path,u,!0)}w&&Ln(w.path,w.rbb,-.5*b.rbb.width-.5*w.rbb.width-p,.3*b.rbb.height)}this.a.attpnt&&function(t,e,n,r){var o,i,a=et.obj2scaled(t.a.pp,e.options),s=e.options,u=_n;for(o=0;o<4;++o){var c="";if(t.a.attpnt&1<<o){for(c.length>0&&(c+=" "),c+="∗",i=0;i<(0==o?0:o+1);++i)c+="'";var l=new z(a),f=a.addScaled(n,.7*s.scale),h=e.paper.text(f.x,f.y,c).attr({font:s.font,"font-size":s.fontsz,fill:t.color}),d=Sn(h.getBBox());In.recenterText(h,d);var p=n.negated();f=f.addScaled(p,jn(f,p,ot.fromRelBox(d))+s.lineWidth/2),l=zn(t,l,n,s.lineWidth);var v=n.rotateSC(1,0),m=f.addScaled(v,.05*s.scale).addScaled(p,.09*s.scale),g=f.addScaled(v,-.05*s.scale).addScaled(p,.09*s.scale),y=e.paper.set();y.push(h,e.paper.path("M{0},{1}L{2},{3}M{4},{5}L{2},{3}L{6},{7}",u(l.x),u(l.y),u(f.x),u(f.y),u(m.x),u(m.y),u(g.x),u(g.y)).attr(e.options.lineattr).attr({"stroke-width":s.lineWidth/2})),r(pn.indices,t.visel,y,a),n=n.rotate(Math.PI/6)}}}(this,s,Dn(this,t.molecule),t.addReObjectPath.bind(t));var k=this.a.stereoLabel,T=function(t){var e="";if(t.a.aam>0&&(e+=t.a.aam),t.a.invRet>0)if(e.length>0&&(e+=","),1==t.a.invRet)e+="Inv";else{if(2!=t.a.invRet)throw new Error("Invalid value for the invert/retain flag");e+="Ret"}if(t.a.exactChangeFlag>0){if(e.length>0&&(e+=","),1!=t.a.exactChangeFlag)throw new Error("Invalid value for the exact change flag");e+="ext"}return e}(this),C=this.a.pseudo?"":function(t){var e="";if(0!=t.a.ringBondCount)if(t.a.ringBondCount>0)e+="rb"+t.a.ringBondCount.toString();else if(-1==t.a.ringBondCount)e+="rb0";else{if(-2!=t.a.ringBondCount)throw new Error("Ring bond count invalid");e+="rb*"}if(0!=t.a.substitutionCount)if(e.length>0&&(e+=","),t.a.substitutionCount>0)e+="s"+t.a.substitutionCount.toString();else if(-1==t.a.substitutionCount)e+="s0";else{if(-2!=t.a.substitutionCount)throw new Error("Substitution count invalid");e+="s*"}if(t.a.unsaturatedAtom>0){if(e.length>0&&(e+=","),1!=t.a.unsaturatedAtom)throw new Error("Unsaturated atom invalid value");e+="u"}return t.a.hCount>0&&(e.length>0&&(e+=","),e+="H"+(t.a.hCount-1).toString()),e}(this),R=Number(null===(r=t.atoms.get(e))||void 0===r?void 0:r.a.fragment),I=t.molecule.frags.get(R),N=(function(t,e,n){if(!t)return!1;var r=t.match(/\D+/g)[0];switch(e){case mn.Off:return!1;case mn.On:return!0;case mn.Classic:return n===Y.Mixed||r===H.Or;case mn.IUPAC:return n===Y.Mixed&&r!==H.Abs;default:return!0}}(k,n.stereoLabelStyle,null==I?void 0:I.enhancedStereoFlag)?"".concat(k,"\n"):"")+(C.length>0?"".concat(C,"\n"):"")+(T.length>0?".".concat(T,"."):"");if(N.length>0){var Z=B.get(this.a.label),L=s.paper.text(u.x,u.y,N).attr({font:n.font,"font-size":n.fontszsub,fill:n.atomColoring&&Z?M[this.a.label]:"#000"});if(k){var D=function(t,e){return e&&t.colorStereogenicCenters!==vn.Off&&t.colorStereogenicCenters!==vn.BondsOnly?Zn(t,e):"#000"}(s.options,k);L.node.childNodes[0].setAttribute("fill",D);var F=function(t,e){var n=e.match(/\D+/g)[0],r=+e.replace(n,"");return t.autoFadeOfStereoLabels&&n!==H.Abs&&t.colorStereogenicCenters!==vn.Off&&t.colorStereogenicCenters!==vn.BondsOnly?Math.max(1-(r-1)/10,.3):1}(s.options,k);L.node.childNodes[0].setAttribute("fill-opacity",F)}var G=Sn(L.getBBox());In.recenterText(L,G);for(var V=this.visel,U=3,q=Dn(this,t.molecule),W=0;W<V.exts.length;++W)U=Math.max(U,jn(u,q,V.exts[W].translate(u)));U+=jn(u,q.negated(),ot.fromRelBox(G)),Ln(L,G,(q=q.scaled(8+U)).x,q.y),t.addReObjectPath(pn.data,this.visel,L,u,!0)}var K=t.molecule.highlights,J=!1,X="";if(K.forEach((function(t){var n,r=null===(n=t.atoms)||void 0===n?void 0:n.includes(e);J=J||r,r&&(X=t.color)})),J){var Q={fill:X,stroke:"none"},tt=et.obj2scaled(this.a.pp,t.render.options),nt=s.paper.circle(tt.x,tt.y,.8*n.atomSelectionPlateRadius).attr(Q);t.addReObjectPath(pn.hovering,this.visel,nt)}}}}],[{key:"isSelectable",value:function(){return!0}}]),s}(En);function Zn(t,e){switch(e.match(/\D+/g)[0]){case H.And:return t.colorOfAndCenters;case H.Or:return t.colorOfOrCenters;case H.Abs:return t.colorOfAbsoluteCenters;default:return"#000"}}function Ln(t,e,n,r){t.translateAbs(n,r),e.x+=n,e.y+=r}function Dn(t,e){var n=[];t.a.neighbors.forEach((function(t){var r=e.halfBonds.get(t);r&&n.push(r.ang)})),n=n.sort((function(t,e){return t-e}));for(var r=[],o=0;o<n.length-1;++o)r.push(n[(o+1)%n.length]-n[o]);r.push(n[0]-n[n.length-1]+2*Math.PI);for(var i=0,a=-Math.PI/2,s=0;s<n.length;++s)r[s]>i&&(i=r[s],a=n[s]+r[s]/2);return new z(Math.cos(a),Math.sin(a))}function zn(t,e,n,r){for(var o=0,i=t.visel,a=0;a<i.exts.length;++a){var s=i.exts[a].translate(e);o=Math.max(o,jn(e,n,s))}return o>0&&(e=e.addScaled(n,o+r)),e}var Fn=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,"bond"),(0,i.Z)((0,b.Z)(e),"b",void 0),(0,i.Z)((0,b.Z)(e),"doubleBondShift",void 0),(0,i.Z)((0,b.Z)(e),"path",void 0),(0,i.Z)((0,b.Z)(e),"neihbid1",-1),(0,i.Z)((0,b.Z)(e),"neihbid2",-1),(0,i.Z)((0,b.Z)(e),"boldStereo",void 0),(0,i.Z)((0,b.Z)(e),"rbb",void 0),e.b=t,e.doubleBondShift=0,e}return(0,o.Z)(s,[{key:"drawHover",value:function(t){var e=this.makeHoverPlate(t);return t.ctab.addReObjectPath(pn.hovering,this.visel,e),e}},{key:"makeHoverPlate",value:function(t){var e=t.options;Kn(this,t.ctab,e);var n=this.b,r=t.ctab.sgroups,o=t.ctab.molecule.functionalGroups;if(ht.isBondInContractedFunctionalGroup(n,r,o,!0))return null;var i=et.obj2scaled(this.b.center,e);return t.paper.circle(i.x,i.y,.8*e.atomSelectionPlateRadius).attr(e.hoverStyle)}},{key:"makeSelectionPlate",value:function(t,e,n){Kn(this,t,n);var r=this.b,o=t.render.ctab.sgroups,i=t.render.ctab.molecule.functionalGroups;if(ht.isBondInContractedFunctionalGroup(r,o,i,!0))return null;var a=et.obj2scaled(this.b.center,n);return e.circle(a.x,a.y,.8*n.atomSelectionPlateRadius).attr(n.selectionStyle)}},{key:"show",value:function(t,e,n){var r=t.render,o=t.molecule,i=t.molecule.bonds.get(e),a=t.molecule.sgroups,s=t.molecule.functionalGroups;if(!ht.isBondInContractedFunctionalGroup(i,a,s,!1)){var u=r.paper,c=void 0!==this.b.hb1?o.halfBonds.get(this.b.hb1):null,l=void 0!==this.b.hb2?o.halfBonds.get(this.b.hb2):null;if(function(t,e,n){var r=[e.b.begin,e.b.end].map((function(e){var r=n.molecule.atoms.get(e),o=Gn(r,t,!1,n);return o<0?-1:r.neighbors[o]}));e.boldStereo=r[0]>=0&&r[1]>=0}(e,this,t),Kn(this,t,n),function(t,e){var n,r,o,i,a=t.b.hb1,s=t.b.hb2;if(!a&&0!==a||!s&&0!==s)t.doubleBondShift=Xn(e,t);else if(o=null===(n=e.halfBonds.get(a))||void 0===n?void 0:n.loop,i=null===(r=e.halfBonds.get(s))||void 0===r?void 0:r.loop,o>=0&&i>=0){var u=e.loops.get(o).dblBonds,c=e.loops.get(i).dblBonds,l=e.loops.get(o).hbs.length,f=e.loops.get(i).hbs.length;t.doubleBondShift=function(t,e,n,r){return 6==t&&6!=e&&(n>1||1==r)?-1:6==e&&6!=t&&(r>1||1==n)?1:e*n>t*r?-1:e*n<t*r?1:e>t?-1:1}(l,f,u,c)}else t.doubleBondShift=o>=0?-1:i>=0?1:Xn(e,t)}(this,o),c&&l){this.path=function(t,e,n,r){var o,i,a,s,u=null,c=t.render,l=t.molecule,f=!(null!==(o=t.atoms.get(n.begin))&&void 0!==o&&o.showLabel),h=!(null!==(i=t.atoms.get(r.begin))&&void 0!==i&&i.showLabel);switch(e.b.type){case $.PATTERN.TYPE.SINGLE:switch(e.b.stereo){case $.PATTERN.STEREO.UP:Hn(n.bid,e,t),u=e.boldStereo&&e.neihbid1>=0&&e.neihbid2>=0?Un(c,n,r,e,l):function(t,e,n,r,o){var i=e.p,a=n.p,s=e.norm,u=t.options,c=.7*u.stereoBond,l=a.addScaled(s,c),f=a.addScaled(s,-c);if(r.neihbid2>=0){var h=Wn(n,r.neihbid2,u.stereoBond,o);l=h[0],f=h[1]}return In.bondSingleUp(t.paper,i,l,f,u,Vn(u,r,o))}(c,n,r,e,l);break;case $.PATTERN.STEREO.DOWN:u=function(t,e,n,r,o){var i=e.p,a=n.p,s=t.options,u=a.sub(i),c=u.length()+.2;u=u.normalized();var l=1.2*s.lineWidth,f=Math.max(Math.floor((c-s.lineWidth)/(s.lineWidth+l)),0)+2,h=c/(f-1);return In.bondSingleDown(t.paper,e,u,f,h,s,Vn(s,r,o))}(c,n,r,e,l);break;case $.PATTERN.STEREO.EITHER:u=function(t,e,n,r,o){var i=e.p,a=n.p,s=t.options,u=a.sub(i),c=u.length();u=u.normalized();var l=.6*s.lineWidth,f=Math.max(Math.floor((c-s.lineWidth)/(s.lineWidth+l)),0)+2,h=c/(f-.5);return In.bondSingleEither(t.paper,e,u,f,h,s,Vn(s,r,o))}(c,n,r,e,l);break;default:u=In.bondSingle(c.paper,n,r,c.options,Vn(c.options,e,l))}break;case $.PATTERN.TYPE.DOUBLE:Hn(n.bid,e,t),u=e.b.stereo===$.PATTERN.STEREO.NONE&&e.boldStereo&&e.neihbid1>=0&&e.neihbid2>=0?function(t,e,n,r,o,i,a){var s=e.p,u=n.p,c=e.norm,l=r.doubleBondShift,f=1.5*t.options.stereoBond,h=s.addScaled(c,f*l),d=u.addScaled(c,f*l);l>0?(i&&(h=h.addScaled(e.dir,f*qn(e.rightCos,e.rightSin))),a&&(d=d.addScaled(e.dir,-f*qn(n.leftCos,n.leftSin)))):l<0&&(i&&(h=h.addScaled(e.dir,f*qn(e.leftCos,e.leftSin))),a&&(d=d.addScaled(e.dir,-f*qn(n.rightCos,n.rightSin))));var p=Un(t,e,n,r,o);return In.bondDoubleStereoBold(t.paper,p,h,d,t.options,Vn(t.options,r,o))}(c,n,r,e,l,f,h):function(t,e,n,r,o,i){var a=r.b.stereo===$.PATTERN.STEREO.CIS_TRANS,s=e.p,u=n.p,c=e.norm,l=a?0:r.doubleBondShift,f=t.options,h=f.bondSpace/2,d=h+l*h,p=l*h-h,v=s.addScaled(c,d),m=u.addScaled(c,d),g=s.addScaled(c,p),y=u.addScaled(c,p);return l>0?(o&&(v=v.addScaled(e.dir,f.bondSpace*qn(e.rightCos,e.rightSin))),i&&(m=m.addScaled(e.dir,-f.bondSpace*qn(n.leftCos,n.leftSin)))):l<0&&(o&&(g=g.addScaled(e.dir,f.bondSpace*qn(e.leftCos,e.leftSin))),i&&(y=y.addScaled(e.dir,-f.bondSpace*qn(n.rightCos,n.rightSin)))),In.bondDouble(t.paper,v,g,m,y,a,f)}(c,n,r,e,f,h);break;case $.PATTERN.TYPE.TRIPLE:u=In.bondTriple(c.paper,n,r,c.options);break;case $.PATTERN.TYPE.AROMATIC:u=n.loop>=0&&(null===(a=l.loops.get(n.loop))||void 0===a?void 0:a.aromatic)||r.loop>=0&&(null===(s=l.loops.get(r.loop))||void 0===s?void 0:s.aromatic)?In.bondSingle(c.paper,n,r,c.options):Yn(c,n,r,e,f,h);break;case $.PATTERN.TYPE.SINGLE_OR_DOUBLE:u=function(t,e,n){var r=e.p,o=n.p,i=t.options,a=z.dist(r,o)/Number((i.bondSpace+i.lineWidth).toFixed());return 1&a||(a+=1),In.bondSingleOrDouble(t.paper,e,n,a,i)}(c,n,r);break;case $.PATTERN.TYPE.SINGLE_OR_AROMATIC:case $.PATTERN.TYPE.DOUBLE_OR_AROMATIC:u=Yn(c,n,r,e,f,h);break;case $.PATTERN.TYPE.ANY:u=In.bondAny(c.paper,n,r,c.options);break;case $.PATTERN.TYPE.HYDROGEN:u=In.bondHydrogen(c.paper,n,r,c.options);break;case $.PATTERN.TYPE.DATIVE:u=In.bondDative(c.paper,n,r,c.options);break;default:throw new Error("Bond type "+e.b.type+" not supported")}return u}(t,this,c,l),this.rbb=Sn(this.path.getBBox()),t.addReObjectPath(pn.data,this.visel,this.path,null,!0);var f={};f.path=function(t,e,n,r){var o=n.p,i=r.p,a=i.add(o).scaled(.5),s=i.sub(o).normalized(),u=s.rotateSC(1,0),c=[],l=t.options.lineWidth,f=t.options.bondSpace/2,h=l,d=2*l,p=1.5*f,v=1.5*f,m=3*f,g=.2;switch(e.b.reactingCenterStatus){case $.PATTERN.REACTING_CENTER.NOT_CENTER:c.push(a.addScaled(u,m).addScaled(s,g*m)),c.push(a.addScaled(u,-m).addScaled(s,-.2*m)),c.push(a.addScaled(u,m).addScaled(s,-.2*m)),c.push(a.addScaled(u,-m).addScaled(s,g*m));break;case $.PATTERN.REACTING_CENTER.CENTER:c.push(a.addScaled(u,m).addScaled(s,g*m).addScaled(s,h)),c.push(a.addScaled(u,-m).addScaled(s,-.2*m).addScaled(s,h)),c.push(a.addScaled(u,m).addScaled(s,g*m).addScaled(s,-h)),c.push(a.addScaled(u,-m).addScaled(s,-.2*m).addScaled(s,-h)),c.push(a.addScaled(s,p).addScaled(u,v)),c.push(a.addScaled(s,-p).addScaled(u,v)),c.push(a.addScaled(s,p).addScaled(u,-v)),c.push(a.addScaled(s,-p).addScaled(u,-v));break;case $.PATTERN.REACTING_CENTER.MADE_OR_BROKEN:c.push(a.addScaled(u,m).addScaled(s,d)),c.push(a.addScaled(u,-m).addScaled(s,d)),c.push(a.addScaled(u,m).addScaled(s,-d)),c.push(a.addScaled(u,-m).addScaled(s,-d));break;case $.PATTERN.REACTING_CENTER.ORDER_CHANGED:c.push(a.addScaled(u,m)),c.push(a.addScaled(u,-m));break;case $.PATTERN.REACTING_CENTER.MADE_OR_BROKEN_AND_CHANGED:c.push(a.addScaled(u,m).addScaled(s,d)),c.push(a.addScaled(u,-m).addScaled(s,d)),c.push(a.addScaled(u,m).addScaled(s,-d)),c.push(a.addScaled(u,-m).addScaled(s,-d)),c.push(a.addScaled(u,m)),c.push(a.addScaled(u,-m));break;default:return null}return In.reactingCenter(t.paper,c,t.options)}(r,this,c,l),f.path&&(f.rbb=Sn(f.path.getBBox()),t.addReObjectPath(pn.data,this.visel,f.path,null,!0));var h={};h.path=function(t,e,n,r){var o=t.options,i=null;if(e.b.topology===$.PATTERN.TOPOLOGY.RING)i="rng";else{if(e.b.topology!==$.PATTERN.TOPOLOGY.CHAIN)return null;i="chn"}var a=n.p,s=r.p,u=s.add(a).scaled(.5),c=s.sub(a).normalized().rotateSC(1,0),l=o.lineWidth;e.doubleBondShift>0?c=c.scaled(-e.doubleBondShift):0==e.doubleBondShift&&(l+=o.bondSpace/2);var f=new z(2,1).scaled(o.bondSpace);e.b.type==$.PATTERN.TYPE.TRIPLE&&(l+=o.bondSpace);var h=u.add(new z(c.x*(f.x+l),c.y*(f.y+l)));return In.topologyMark(t.paper,h,i,o)}(r,this,c,l),h.path&&(h.rbb=Sn(h.path.getBBox()),t.addReObjectPath(pn.data,this.visel,h.path,null,!0)),this.setHover(this.hover,r);var d=null,p=.6*n.subFontSize;n.showBondIds&&(d=$n(e,u,c,l,p,.5,.5,c.norm),t.addReObjectPath(pn.indices,this.visel,d)),n.showHalfBondIds&&(d=$n(this.b.hb1,u,c,l,p,.8,.2,c.norm),t.addReObjectPath(pn.indices,this.visel,d),d=$n(this.b.hb2,u,c,l,p,.2,.8,l.norm),t.addReObjectPath(pn.indices,this.visel,d)),n.showLoopIds&&!n.showBondIds&&(d=$n(c.loop,u,c,l,p,.5,.5,l.norm),t.addReObjectPath(pn.indices,this.visel,d),d=$n(l.loop,u,c,l,p,.5,.5,c.norm),t.addReObjectPath(pn.indices,this.visel,d));var v=t.molecule.highlights,m=!1,g="";if(v.forEach((function(t){var n,r=null===(n=t.bonds)||void 0===n?void 0:n.includes(e);m=m||r,r&&(g=t.color)})),m){var y={fill:g,stroke:g,"stroke-width":7*n.lineattr["stroke-width"],"stroke-linecap":"round"},b=et.obj2scaled(this.b.center,t.render.options),w=function(t,e,n){var r={x:e.p.x,y:e.p.y},o={x:n.p.x,y:n.p.y},i=t.render.paper,a="M".concat(r.x,",").concat(r.y," L").concat(o.x,",").concat(o.y);return i.path(a)}(t,c,l);w.attr(y),t.addReObjectPath(pn.hovering,this.visel,w,b,!0)}}}}}],[{key:"isSelectable",value:function(){return!0}}]),s}(En);function Gn(t,e,n,r){return t.neighbors.findIndex((function(t){var o=r.molecule.halfBonds.get(t);if(!o||o.bid===e)return!1;var i=r.bonds.get(o.bid);return!!i&&(i.b.type===$.PATTERN.TYPE.SINGLE&&i.b.stereo===$.PATTERN.STEREO.UP?i.b.end===o.begin||i.boldStereo&&n:!(i.b.type!==$.PATTERN.TYPE.DOUBLE||i.b.stereo!==$.PATTERN.STEREO.NONE||!n||!i.boldStereo))}))}function Hn(t,e,n){var r,o,i=[e.b.begin,e.b.end].map((function(e){var r=n.molecule.atoms.get(e);if(!r)return-1;var o=Gn(r,t,!0,n);return o<0?-1:r.neighbors[o]}));e.neihbid1=null!==(r=n.atoms.get(e.b.begin))&&void 0!==r&&r.showLabel?-1:i[0],e.neihbid2=null!==(o=n.atoms.get(e.b.end))&&void 0!==o&&o.showLabel?-1:i[1]}function Vn(t,e,n){var r,o,i="#000";if(0===e.b.stereo)return i;var a=null===(r=n.atoms.get(e.b.begin))||void 0===r?void 0:r.stereoLabel,s=null===(o=n.atoms.get(e.b.end))||void 0===o?void 0:o.stereoLabel,u="";return a&&!s?u=a:!a&&s&&(u=s),u&&t.colorStereogenicCenters!==vn.Off&&t.colorStereogenicCenters!==vn.LabelsOnly?Zn(t,u):i}function Un(t,e,n,r,o){var i=t.options,a=Wn(e,r.neihbid1,i.stereoBond,o),s=Wn(n,r.neihbid2,i.stereoBond,o),u=a[0],c=a[1],l=s[0],f=s[1];return In.bondSingleStereoBold(t.paper,u,c,l,f,i,Vn(i,r,o))}function qn(t,e){return e<0||Math.abs(t)>.9?0:e/(1-t)}function Wn(t,e,n,r){var o=r.halfBonds.get(e),i=z.dot(t.dir,o.dir),a=z.cross(t.dir,o.dir),s=Math.sqrt(.5*(1-i)),u=o.dir.rotateSC((a>=0?-1:1)*s,Math.sqrt(.5*(1+i))),c=t.p.addScaled(u,.7*n/(s+.3)),l=t.p.addScaled(u.negated(),.7*n/(s+.3));return a>0?[c,l]:[l,c]}function Yn(t,e,n,r,o,i){var a=[.125,.125,.005,.125],s=null,u=null,c=t.options,l=r.doubleBondShift;r.b.type===$.PATTERN.TYPE.SINGLE_OR_AROMATIC&&(s=l>0?1:2,u=a.map((function(t){return t*c.scale}))),r.b.type===$.PATTERN.TYPE.DOUBLE_OR_AROMATIC&&(s=3,u=a.map((function(t){return t*c.scale})));var f=function(t,e,n,r,o,i,a,s){var u=t.p,c=e.p,l=t.norm,f=i/2,h=f+n*f,d=n*f-f,p=u.addScaled(l,h),v=c.addScaled(l,h),m=u.addScaled(l,d),g=c.addScaled(l,d);return n>0?(r&&(p=p.addScaled(t.dir,i*qn(t.rightCos,t.rightSin))),o&&(v=v.addScaled(t.dir,-i*qn(e.leftCos,e.leftSin)))):n<0&&(r&&(m=m.addScaled(t.dir,i*qn(t.leftCos,t.leftSin))),o&&(g=g.addScaled(t.dir,-i*qn(e.rightCos,e.rightSin)))),In.aromaticBondPaths(p,m,v,g,a,s)}(e,n,l,o,i,c.bondSpace,s,u);return In.bondAromatic(t.paper,f,l,c)}function $n(t,e,n,r,o,i,a,s){var u=z.lc(n.p,i,r.p,a,s,o),c=e.text(u.x,u.y,t.toString()),l=Sn(c.getBBox());return In.recenterText(c,l),c}function Kn(t,e,n){var r=e.render,o=e.atoms.get(t.b.begin),i=e.atoms.get(t.b.end);if(o&&i&&void 0!==t.b.hb1&&void 0!==t.b.hb2){var a=et.obj2scaled(o.a.pp,r.options),s=et.obj2scaled(i.a.pp,r.options),u=e.molecule.halfBonds.get(t.b.hb1),c=e.molecule.halfBonds.get(t.b.hb2);null!=u&&u.dir&&null!=c&&c.dir&&(u.p=Jn(o,a,u.dir,2*n.lineWidth),c.p=Jn(i,s,c.dir,2*n.lineWidth),t.b.center=z.lc2(o.a.pp,.5,i.a.pp,.5),t.b.len=z.dist(a,s),t.b.sb=5*n.lineWidth,t.b.sa=Math.max(t.b.sb,t.b.len/2-2*n.lineWidth),t.b.angle=180*Math.atan2(u.dir.y,u.dir.x)/Math.PI)}}function Jn(t,e,n,r){for(var o=0,i=t.visel,a=0;a<i.exts.length;++a){var s=i.exts[a].translate(e);o=Math.max(o,jn(e,n,s))}return o>0&&(e=e.addScaled(n,o+r)),e}function Xn(t,e){if(!e.b.hb1&&0!==e.b.hb1||!e.b.hb2&&0!==e.b.hb2)return 0;var n=t.halfBonds.get(e.b.hb1),r=t.halfBonds.get(e.b.hb2);if(!n||!r)return 0;var o=(n.leftSin>.3?1:0)+(r.rightSin>.3?1:0),i=(r.leftSin>.3?1:0)+(n.rightSin>.3?1:0);return o>i?-1:o<i||(n.leftSin>.3?1:0)+(n.rightSin>.3?1:0)==1?1:0}var Qn=new WeakMap,tr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(){var t,e,n,o;return(0,r.Z)(this,s),t=a.call(this,"enhancedFlag"),e=(0,b.Z)(t),o={writable:!0,value:void 0},function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,n=Qn),n.set(e,o),t}return(0,o.Z)(s,[{key:"hoverPath",value:function(t){var e=ot.fromRelBox((0,g.Z)(this,Qn).getBBox()),n=e.p1.sub(e.p0),r=e.p0.sub(t.options.offset);return t.paper.rect(r.x,r.y,n.x,n.y)}},{key:"drawHover",value:function(t){var e;if(null===(e=(0,g.Z)(this,Qn))||void 0===e||!e.attrs)return null;var n=this.hoverPath(t).attr(t.options.hoverStyle);return t.ctab.addReObjectPath(pn.hovering,this.visel,n),n}},{key:"makeSelectionPlate",value:function(t,e,n){var r;return null!==(r=(0,g.Z)(this,Qn))&&void 0!==r&&r.attrs?this.hoverPath(t.render).attr(n.selectionStyle):null}},{key:"show",value:function(t,e,n){var r,o=t.render,a=t.molecule.frags.get(e);if(null!=a&&a.enhancedStereoFlag){var s=a.stereoFlagPosition?a.stereoFlagPosition:tt.getDefaultStereoFlagPosition(t.molecule,e),u=o.paper,c=et.obj2scaled(s,n),l=(r={},(0,i.Z)(r,Y.Abs,n.absFlagLabel),(0,i.Z)(r,Y.And,n.andFlagLabel),(0,i.Z)(r,Y.Mixed,n.mixedFlagLabel),(0,i.Z)(r,Y.Or,n.orFlagLabel),r);n.showStereoFlags&&(0,m.Z)(this,Qn,u.text(c.x,c.y,a.enhancedStereoFlag?l[a.enhancedStereoFlag]:"").attr({font:n.font,"font-size":n.fontsz,fill:"#000"})),o.ctab.addReObjectPath(pn.data,this.visel,(0,g.Z)(this,Qn),null,!0)}}}],[{key:"isSelectable",value:function(){return!0}}]),s}(En);var er=function(t){(0,u.Z)(s,t);var e,i,a=(e=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,l.Z)(e);if(i){var r=(0,l.Z)(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),(e=a.call(this,"frag")).item=t,e}return(0,o.Z)(s,[{key:"fragGetAtoms",value:function(t,e){return Array.from(t.atoms.keys()).filter((function(n){return t.atoms.get(n).a.fragment===e}))}},{key:"fragGetBonds",value:function(t,e){return Array.from(t.bonds.keys()).filter((function(n){var r=t.bonds.get(n).b,o=t.atoms.get(r.begin).a.fragment,i=t.atoms.get(r.end).a.fragment;return o===e&&i===e}))}},{key:"calcBBox",value:function(t,e,r){var o;return t.atoms.forEach((function(t){if(t.a.fragment===e){var i=t.visel.boundingBox;if(i)r||(r=n.g._ui_editor.render),i=i.translate((r.options.offset||new z).negated()).transform(et.scaled2obj,r.options);else{i=new ot(t.a.pp,t.a.pp);var a=new z(.05*3,.05*3);i=i.extend(a,a)}o=o?ot.union(o,i):i}})),o}},{key:"_draw",value:function(t,e,n){var r=this.calcBBox(t.ctab,e,t);if(r){var o=et.obj2scaled(new z(r.p0.x,r.p0.y),t.options),i=et.obj2scaled(new z(r.p1.x,r.p1.y),t.options);return t.paper.rect(o.x,o.y,i.x-o.x,i.y-o.y,0).attr(n)}}},{key:"draw",value:function(t){return null}},{key:"drawHover",value:function(t){}},{key:"setHover",value:function(t,e){var n=e.ctab.frags.keyOf(this);(n||0===n)&&(n=parseInt(n,10),e.ctab.atoms.forEach((function(r){r.a.fragment===n&&r.setHover(t,e)})),e.ctab.bonds.forEach((function(r){e.ctab.atoms.get(r.b.begin).a.fragment===n&&r.setHover(t,e)})))}}],[{key:"isSelectable",value:function(){return!1}}]),s}(En);var nr=new z(.05*3,.05*3),rr=function(t){(0,u.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function a(t){var e;return(0,r.Z)(this,a),(e=i.call(this,"rgroup")).labelBox=null,e.item=t,e}return(0,o.Z)(a,[{key:"getAtoms",value:function(t){var e=[];return this.item.frags.forEach((function(n){e=e.concat(t.ctab.frags.get(n).fragGetAtoms(t.ctab,n))})),e}},{key:"getBonds",value:function(t){var e=[];return this.item.frags.forEach((function(n){e=e.concat(t.ctab.frags.get(n).fragGetBonds(t.ctab,n))})),e}},{key:"calcBBox",value:function(t){var e=null;return this.item.frags.forEach((function(n){var r=t.ctab.frags.get(n).calcBBox(t.ctab,n,t);r&&(e=e?ot.union(e,r):r)})),e&&(e=e.extend(nr,nr)),e}},{key:"draw",value:function(t,e){var n=this.calcBBox(t);if(!n)return{};var r={data:[]},o=et.obj2scaled(n.p0,e),i=et.obj2scaled(n.p1,e),a=t.paper.set();(function(t,e,n,r){r=et.obj2scaled(r||new z(1,0),e.options);var o=Math.min(.25,.3*n.sz().x),i=n.p1.y-n.p0.y,a=.5*(n.p1.y+n.p0.y),s=In.bracket(e.paper,r.negated(),r.negated().rotateSC(1,0),et.obj2scaled(new z(n.p0.x,a),e.options),o,i,e.options),u=In.bracket(e.paper,r,r.rotateSC(1,0),et.obj2scaled(new z(n.p1.x,a),e.options),o,i,e.options);t.push(s,u)})(a,t,n),r.data.push(a);var s=t.ctab.rgroups.keyOf(this),u=t.paper.set(),c=t.paper.text(o.x,(o.y+i.y)/2,"R"+s+"=").attr({font:e.font,"font-size":e.fontRLabel,fill:"black"}),l=Sn(c.getBBox());c.translateAbs(-l.width/2-e.lineWidth,0),u.push(c);for(var f={font:e.font,"font-size":e.fontRLogic,fill:"black"},h=[or(s,this.item)],d=l.height/2+e.lineWidth/2,p=0;p<h.length;++p){var v=t.paper.text(o.x,(o.y+i.y)/2,h[p]).attr(f),m=Sn(v.getBBox());d+=m.height/2,v.translateAbs(-m.width/2-6*e.lineWidth,d),d+=m.height/2+e.lineWidth/2,r.data.push(v),u.push(v)}return r.data.push(c),this.labelBox=ot.fromRelBox(u.getBBox()).transform(et.scaled2obj,t.options),r}},{key:"_draw",value:function(t,e,n){if(!this.getVBoxObj(t))return null;var r=this.getVBoxObj(t).extend(nr,nr);if(!r)return null;var o=et.obj2scaled(r.p0,t.options),i=et.obj2scaled(r.p1,t.options);return t.paper.rect(o.x,o.y,i.x-o.x,i.y-o.y,0).attr(n)}},{key:"drawHover",value:function(t){var e=t.ctab.rgroups.keyOf(this);if(!e)return null;var n=this._draw(t,e,t.options.hoverStyle);return t.ctab.addReObjectPath(pn.hovering,this.visel,n),this.item.frags.forEach((function(e,n){t.ctab.frags.get(n).drawHover(t)})),n}},{key:"show",value:function(t,e,n){var r=this,o=this.draw(t.render,n);Object.keys(o).forEach((function(e){for(;o[e].length>0;)t.addReObjectPath(pn.data,r.visel,o[e].shift(),null,!0)}))}}],[{key:"isSelectable",value:function(){return!1}}]),a}(En);function or(t,e){var n,r=e.ifthen>0?"IF ":"",o=e.range.startsWith(">")||e.range.startsWith("<")||e.range.startsWith("=");n=e.range.length>0?o?e.range:"="+e.range:">0";var i=e.resth?" (RestH)":"",a=e.ifthen>0?"\nTHEN R"+e.ifthen.toString():"";return"".concat(r,"R").concat(t.toString()).concat(n).concat(i).concat(a)}var ir=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,"rxnArrow"),(0,i.Z)((0,b.Z)(e),"item",void 0),e.item=t,e}return(0,o.Z)(s,[{key:"calcDistance",value:function(t,e){var n,r,o=new z(t.x,t.y);n=function(t,e){var n;if((e.x<Math.min(t[0].x,t[1].x)||e.x>Math.max(t[0].x,t[1].x))&&(e.y<Math.min(t[0].y,t[1].y)||e.y>Math.max(t[0].y,t[1].y)))n=Math.min(z.dist(t[0],e),z.dist(t[1],e));else{var r=z.dist(t[0],t[1]),o=z.dist(t[0],e),i=z.dist(t[1],e),a=(r+o+i)/2;n=2/r*Math.sqrt(a*(a-r)*(a-o)*(a-i))}return n}(this.item.pos,o);var i=(r=this.getReferencePointDistance(t)).minDist<=8/e?r.refPoint:null;return{minDist:n=Math.min(r.minDist,n),refPoint:i}}},{key:"getReferencePointDistance",value:function(t){var e=[];return this.getReferencePoints().forEach((function(n){e.push({minDist:Math.abs(z.dist(t,n)),refPoint:n})})),e.reduce((function(t,e){return t&&t.minDist<e.minDist?t:e}),null)}},{key:"hoverPath",value:function(t){var e=this.generatePath(t,t.options,"selection");return t.paper.path(e)}},{key:"drawHover",value:function(t){var e=this.hoverPath(t).attr(t.options.hoverStyle);return t.ctab.addReObjectPath(pn.hovering,this.visel,e),e}},{key:"getReferencePoints",value:function(){var t=[];return this.item.pos.forEach((function(e){return t.push(new z(e.x,e.y,0))})),t}},{key:"makeSelectionPlate",value:function(t,e,n){var r=t.render,o=t.render.options,i=this.getReferencePoints(),a=o.scale,s=t.render.paper.set();return s.push(r.paper.path(this.generatePath(r,o,"selection")).attr(n.selectionStyle)),i.forEach((function(e){var n=et.obj2scaled(e,t.render.options);s.push(t.render.paper.circle(n.x,n.y,a/8).attr({fill:"black"}))})),s}},{key:"generatePath",value:function(t,e,n){var r,o=this.item.pos.map((function(t){return et.obj2scaled(t,e)||new z})),i=this.getArrowParams(o[0].x,o[0].y,o[1].x,o[1].y),a=new z(o[0].x,o[0].y),s=new z(o[1].x,o[1].y);switch(n){case"selection":r=In.rectangleWithAngle(t.paper,a,s,i.length,i.angle,e);break;case"arrow":r=In.arrow(t.paper,a,s,i.length,i.angle,e,this.item.mode)}return r}},{key:"getArrowParams",value:function(t,e,n,r){return{length:Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),angle:P().angle(t,e,n,r)-180}}},{key:"show",value:function(t,e,n){var r=this.generatePath(t.render,n,"arrow"),o=n.offset;null!=o&&r.translateAbs(o.x,o.y),this.visel.add(r,ot.fromRelBox(Sn(r.getBBox())))}}],[{key:"isSelectable",value:function(){return!0}}]),s}(En);var ar=function(t){(0,u.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function a(t){var e;return(0,r.Z)(this,a),(e=i.call(this,"rxnPlus")).item=t,e}return(0,o.Z)(a,[{key:"hoverPath",value:function(t){var e=et.obj2scaled(this.item.pp,t.options),n=t.options.scale;return t.paper.rect(e.x-n/4,e.y-n/4,n/2,n/2,n/8)}},{key:"drawHover",value:function(t){var e=this.hoverPath(t).attr(t.options.hoverStyle);return t.ctab.addReObjectPath(pn.hovering,this.visel,e),e}},{key:"makeSelectionPlate",value:function(t,e,n){return this.hoverPath(t.render).attr(n.selectionStyle)}},{key:"show",value:function(t,e,n){var r=t.render,o=et.obj2scaled(this.item.pp,n),i=In.plus(r.paper,o,n),a=n.offset;null!=a&&i.translateAbs(a.x,a.y),this.visel.add(i,ot.fromRelBox(Sn(i.getBBox())))}}],[{key:"isSelectable",value:function(){return!0}}]),a}(En);var sr=function(t){(0,u.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function a(t){var e;return(0,r.Z)(this,a),(e=i.call(this,"sgroupData")).sgroup=t,e}return(0,o.Z)(a,[{key:"hoverPath",value:function(t){var e=this.sgroup.dataArea,n=et.obj2scaled(e.p0,t.options),r=et.obj2scaled(e.p1,t.options).sub(n);return t.paper.rect(n.x,n.y,r.x,r.y)}},{key:"drawHover",value:function(t){var e=this.hoverPath(t).attr(t.options.hoverStyle);return t.ctab.addReObjectPath(pn.hovering,this.visel,e),e}},{key:"makeSelectionPlate",value:function(t,e,n){return this.hoverPath(t.render).attr(n.selectionStyle)}}],[{key:"isSelectable",value:function(){return!0}}]),a}(En);var ur=_n,cr=function(t){(0,u.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function a(t){var e;return(0,r.Z)(this,a),(e=i.call(this,"sgroup")).item=t,e}return(0,o.Z)(a,[{key:"draw",value:function(t,e){this.render=t.render;var n=this.render.paper.set(),r=new V(e.atoms),o=at.getCrossBonds(t.molecule,r);at.bracketPos(e,t.molecule,o);var i=e.bracketBox,a=e.bracketDir;e.areas=[i];var s=t.molecule.functionalGroups;if(ht.isContractedFunctionalGroup(e.id,s))e.firstSgroupAtom=t.molecule.atoms.get(e.atoms[0]),e.functionalGroup=!0;else switch(e.type){case"MUL":lr(n,this.render,e,o,r,i,a,e.data.mul);break;case"SRU":var u=e.data.connectivity||"eu";"ht"===u&&(u="");var c=e.data.subscript||"n";lr(n,this.render,e,o,r,i,a,c,u);break;case"SUP":lr(n,this.render,e,o,r,i,a,e.data.name,null,{"font-style":"italic"});break;case"GEN":lr(n,this.render,e,o,r,i,a);break;case"DAT":n=function(t,e){return e.areas=e.bracketBox?[e.bracketBox]:[],null===e.pp&&e.calculatePP(t.molecule),e.data.attached?function(t,e){var n=t.render,r=n.options,o=n.paper,i=o.set();return at.getAtoms(t,e).forEach((function(a){var s=t.atoms.get(a),u=et.obj2scaled(s.a.pp,r),c=s.visel.boundingBox;null!==c&&(u.x=Math.max(u.x,c.p1.x)),u.x+=r.lineWidth;var l=fr(o,u,e,r),f=Sn(l.getBBox());l.translateAbs(.5*f.width,-.3*f.height),i.push(l);var h=ot.fromRelBox(Sn(l.getBBox()));h=h.transform(et.scaled2obj,n.options),e.areas.push(h)})),i}(t,e):function(t,e){var n=t.render,r=n.options,o=n.paper,i=o.set(),a=fr(o,e.pp.scaled(r.scale),e,r),s=Sn(a.getBBox());a.translateAbs(.5*s.width,-.5*s.height),i.push(a);var u=ot.fromRelBox(Sn(a.getBBox()));return e.dataArea=u.transform(et.scaled2obj,n.options),t.sgroupData.has(e.id)||t.sgroupData.set(e.id,new sr(e)),i}(t,e)}(t,e)}return n}},{key:"makeSelectionPlate",value:function(t,e,n){var r=this.item,o=hr(r,n),i=o.startX,a=o.startY,s=o.size,u=t.molecule.functionalGroups;if(ht.isContractedFunctionalGroup(r.id,u))return e.rect(i,a,s,s).attr(n.selectionStyle)}},{key:"drawHover",value:function(t){var e=t.options,n=t.paper,r=this.item,o=hr(r,e),i=o.a0,a=o.a1,s=o.b0,u=o.b1,c=t.ctab.molecule.functionalGroups,l=n.set();if(ht.isContractedFunctionalGroup(r.id,c)){var f=hr(r,e),h=f.startX,d=f.startY,p=f.size;r.hovering=n.rect(h,d,p,p).attr(e.hoverStyle)}else r.hovering=n.path("M{0},{1}L{2},{3}L{4},{5}L{6},{7}L{0},{1}",ur(i.x),ur(i.y),ur(a.x),ur(a.y),ur(u.x),ur(u.y),ur(s.x),ur(s.y)).attr(e.hoverStyle);l.push(r.hovering),at.getAtoms(t.ctab.molecule,r).forEach((function(e){l.push(t.ctab.atoms.get(e).makeHoverPlate(t))}),this),at.getBonds(t.ctab.molecule,r).forEach((function(e){l.push(t.ctab.bonds.get(e).makeHoverPlate(t))}),this),t.ctab.addReObjectPath(pn.hovering,this.visel,l)}},{key:"show",value:function(t){var e=t.render,n=this.item;if("MRV_IMPLICIT_H"!==n.data.fieldName){var r=e.ctab,o=this.draw(r,n);t.addReObjectPath(pn.data,this.visel,o,null,!0),this.setHover(this.hover,e)}}}],[{key:"isSelectable",value:function(){return!1}}]),a}(En);function lr(t,e,n,r,o,i,a,s,u,c){for(var l=function(t,e,n,r,o,i,a){function s(t,e,n,r){this.c=t,this.d=e,this.n=e.rotateSC(1,0),this.w=n,this.h=r}var u=[],c=o.rotateSC(1,0),l=Object.values(e),f=l.flat();return f.length<2?function(){o=o||new z(1,0),c=c||o.rotateSC(1,0);var t=Math.min(.25,.3*r.sz().x),e=z.lc2(o,r.p0.x,c,.5*(r.p0.y+r.p1.y)),n=z.lc2(o,r.p1.x,c,.5*(r.p0.y+r.p1.y)),i=r.sz().y;u.push(new s(e,o.negated(),t,i),new s(n,o,t,i))}():2===f.length&&2===l.length?function(){var e=t.bonds.get(f[0]),n=t.bonds.get(f[1]),r=e.getCenter(t),o=n.getCenter(t),c=-1,l=-1,h=-1,d=-1,p=z.centre(r,o),v=z.diff(o,r).normalized(),m=v.negated(),g=v.rotateSC(1,0),y=g.negated();t.sGroupForest.children.get(a).forEach((function(t){var e=i.ctab.sgroups.get(t).visel.boundingBox;e=e.translate((i.options.offset||new z).negated()).transform(et.scaled2obj,i.options),c=Math.max(c,jn(r,m,e)),l=Math.max(l,jn(o,v,e)),h=Math.max(h,jn(p,g,e)),d=Math.max(d,jn(p,y,e))}),this),c=Math.max(c+.2,0),l=Math.max(l+.2,0);var b=1.5+(h=Math.max(Math.max(h,d)+.1,0));u.push(new s(r.addScaled(m,c),m,.25,b),new s(o.addScaled(v,l),v,.25,b))}():function(){for(var e=0;e<f.length;++e){var r=t.bonds.get(f[e]),o=r.getCenter(t),i=n.has(r.begin)?r.getDir(t):r.getDir(t).negated();u.push(new s(o,i,.2,1))}}(),u}(e.ctab.molecule,r,o,i,a,e,n.id),f=-1,h=0;h<l.length;++h){var d=l[h],p=In.bracket(e.paper,et.obj2scaled(d.d,e.options),et.obj2scaled(d.n,e.options),et.obj2scaled(d.c,e.options),d.w,d.h,e.options);t.push(p),(f<0||l[f].d.x<d.d.x||l[f].d.x===d.d.x&&l[f].d.y>d.d.y)&&(f=h)}var v=l[f];function m(n,r){var o=et.obj2scaled(v.c.addScaled(v.n,r*v.h),e.options),i=e.paper.text(o.x,o.y,n).attr({font:e.options.font,"font-size":e.options.fontszsub});c&&i.attr(c);var a=ot.fromRelBox(Sn(i.getBBox())),s=Math.max(jn(o,v.d.negated(),a),3)+2;i.translateAbs(s*v.d.x,s*v.d.y),t.push(i)}s&&m(s,.5),u&&m(u,-.5)}function fr(t,e,n,r){var o=t.text(e.x,e.y,n.data.fieldValue).attr({font:r.font,"font-size":r.fontsz}),i=o.getBBox(),a=t.rect(i.x-1,i.y-1,i.width+2,i.height+2,3,3);a=n.selected?a.attr(r.selectionStyle):a.attr({fill:"#fff",stroke:"#fff"});var s=t.set();return s.push(a,o.toFront()),s}function hr(t,e){var n=t.bracketBox.transform(et.obj2scaled,e),r=e.lineWidth,o=new z(4*r,6*r);n=n.extend(o,o);var i=t.bracketDir,a=i.rotateSC(1,0),s=z.lc2(i,n.p0.x,a,n.p0.y),u=z.lc2(i,n.p0.x,a,n.p1.y),c=z.lc2(i,n.p1.x,a,n.p0.y),l=z.lc2(i,n.p1.x,a,n.p1.y),f=e.contractedFunctionalGroupSize,h=(c.x+s.x)/2-f/2,d=(u.y+s.y)/2-f/2;if(t.firstSgroupAtom){var p=new z(f/2,f/2,0),v=z.diff(t.firstSgroupAtom.pp.scaled(40),p);h=v.x,d=v.y}return{a0:s,a1:u,b0:c,b1:l,startX:h,startY:d,size:f}}var dr=_n,pr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,"simpleObject"),(0,i.Z)((0,b.Z)(e),"item",void 0),e.item=t,e}return(0,o.Z)(s,[{key:"calcDistance",value:function(t,e){var n,r,o=new z(t.x,t.y),i=this.item,a=i.mode,s=i.pos;switch(a){case mt.ellipse:var u=z.diff(s[1],s[0]),c=u.x/2,l=u.y/2,f=z.sum(s[0],new z(c,l)),h=z.diff(o,f);n=0!==c&&0!==l?Math.abs(1-h.x*h.x/(c*c)-h.y*h.y/(l*l)):vr(s,o);break;case mt.rectangle:var d=Math.min(s[0].x,s[1].x),p=Math.min(s[0].y,s[1].y),v=Math.max(s[0].x,s[1].x),m=Math.max(s[0].y,s[1].y),g=[];o.x>=d&&o.x<=v&&(o.y<p?g.push(p-o.y):o.y>m?g.push(o.y-m):g.push(o.y-p,m-o.y)),o.x<d&&o.y<p&&g.push(z.dist(new z(d,p),o)),o.x>v&&o.y>m&&g.push(z.dist(new z(v,m),o)),o.x<d&&o.y>m&&g.push(z.dist(new z(d,m),o)),o.x>v&&o.y<p&&g.push(z.dist(new z(v,p),o)),o.y>=p&&o.y<=m&&(o.x<d?g.push(d-o.x):o.x>v?g.push(o.x-v):g.push(o.x-d,v-o.x)),n=Math.min.apply(Math,g);break;case mt.line:n=vr(s,o);break;default:throw new Error("Unsupported shape type")}var y=(r=this.getReferencePointDistance(t)).minDist<=8/e?r.refPoint:null;return{minDist:n=Math.min(r.minDist,n),refPoint:y}}},{key:"getReferencePointDistance",value:function(t){var e=[];return this.getReferencePoints().forEach((function(n){e.push({minDist:Math.abs(z.dist(t,n)),refPoint:n})})),e.reduce((function(t,e){return t&&t.minDist<e.minDist?t:e}),null)}},{key:"getReferencePoints",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=[];switch(this.item.mode){case mt.ellipse:case mt.rectangle:var n=new z(Math.min(this.item.pos[0].x,this.item.pos[1].x),Math.min(this.item.pos[0].y,this.item.pos[1].y)),r=Math.abs(z.diff(this.item.pos[0],this.item.pos[1]).x),o=Math.abs(z.diff(this.item.pos[0],this.item.pos[1]).y);e.push(new z(n.x+.5*r,n.y),new z(n.x+r,n.y+.5*o),new z(n.x+.5*r,n.y+o),new z(n.x,n.y+.5*o)),t&&this.item.mode!==mt.rectangle||e.push(n,new z(n.x,n.y+o),new z(n.x+r,n.y+o),new z(n.x+r,n.y));break;case mt.line:this.item.pos.forEach((function(t){return e.push(new z(t.x,t.y,0))}));break;default:throw new Error("Unsupported shape type")}return e}},{key:"hoverPath",value:function(t){var e=[];this.item.pos.forEach((function(n,r){e[r]=et.obj2scaled(n,t.options)}));var n=t.options.scale,r=[];switch(this.item.mode){case mt.ellipse:var o=z.diff(e[1],e[0]),i=o.x/2,a=o.y/2;r.push(t.paper.ellipse(dr(e[0].x+i),dr(e[0].y+a),dr(Math.abs(i)+n/8),dr(Math.abs(a)+n/8))),Math.abs(i)-n/8>0&&Math.abs(a)-n/8>0&&r.push(t.paper.ellipse(dr(e[0].x+i),dr(e[0].y+a),dr(Math.abs(i)-n/8),dr(Math.abs(a)-n/8)));break;case mt.rectangle:r.push(t.paper.rect(dr(Math.min(e[0].x,e[1].x)-n/8),dr(Math.min(e[0].y,e[1].y)-n/8),dr(Math.max(e[0].x,e[1].x)-Math.min(e[0].x,e[1].x)+n/4),dr(Math.max(e[0].y,e[1].y)-Math.min(e[0].y,e[1].y)+n/4))),Math.max(e[0].x,e[1].x)-Math.min(e[0].x,e[1].x)-n/4>0&&Math.max(e[0].y,e[1].y)-Math.min(e[0].y,e[1].y)-n/4>0&&r.push(t.paper.rect(dr(Math.min(e[0].x,e[1].x)+n/8),dr(Math.min(e[0].y,e[1].y)+n/8),dr(Math.max(e[0].x,e[1].x)-Math.min(e[0].x,e[1].x)-n/4),dr(Math.max(e[0].y,e[1].y)-Math.min(e[0].y,e[1].y)-n/4)));break;case mt.line:var s=[],u=Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x)),c={x:0,y:0},l={x:0,y:0},f=e[0].x>e[1].x?-1:1;c.x=e[0].x-f*(n/8*Math.cos(u)),c.y=e[0].y-f*(n/8*Math.sin(u)),l.x=e[1].x+f*(n/8*Math.cos(u)),l.y=e[1].y+f*(n/8*Math.sin(u)),s.push("M",c.x+f*n/8*Math.sin(u),c.y-f*n/8*Math.cos(u)),s.push("L",l.x+f*n/8*Math.sin(u),l.y-f*n/8*Math.cos(u)),s.push("L",l.x-f*n/8*Math.sin(u),l.y+f*n/8*Math.cos(u)),s.push("L",c.x-f*n/8*Math.sin(u),c.y+f*n/8*Math.cos(u)),s.push("L",c.x+f*n/8*Math.sin(u),c.y-f*n/8*Math.cos(u)),r.push(t.paper.path(s));break;default:throw new Error("Unsupported shape type")}return r.map((function(t){return{path:t,stylesApplied:!1}}))}},{key:"drawHover",value:function(t){var e=this.hoverPath(t).map((function(e){return e.stylesApplied?e.path:e.path.attr(t.options.hoverStyle)}));return t.ctab.addReObjectPath(pn.hovering,this.visel,e),e}},{key:"makeSelectionPlate",value:function(t,e,n){var r=this.item.pos.map((function(e){return et.obj2scaled(e,t.render.options)||new z})),o=this.getReferencePoints(),i=t.render.options.scale,a=t.render.paper.set();return a.push(mr(this.item.mode,e,r).attr(n.hoverStyleSimpleObject)),o.forEach((function(e){var n=et.obj2scaled(e,t.render.options);a.push(t.render.paper.circle(n.x,n.y,i/8).attr({fill:"black"}))})),a}},{key:"show",value:function(t,e){var n=t.render,r=this.item.pos.map((function(t){return et.obj2scaled(t,e)||new z})),o=mr(this.item.mode,n.paper,r,e),i=e.offset;null!=i&&o.translateAbs(i.x,i.y),this.visel.add(o,ot.fromRelBox(Sn(o.getBBox())))}}],[{key:"isSelectable",value:function(){return!0}}]),s}(En);function vr(t,e){var n;if((e.x<Math.min(t[0].x,t[1].x)||e.x>Math.max(t[0].x,t[1].x))&&(e.y<Math.min(t[0].y,t[1].y)||e.y>Math.max(t[0].y,t[1].y)))n=Math.min(z.dist(t[0],e),z.dist(t[1],e));else{var r=z.dist(t[0],t[1]),o=z.dist(t[0],e),i=z.dist(t[1],e),a=(r+o+i)/2;n=2/r*Math.sqrt(a*(a-r)*(a-o)*(a-i))}return n}function mr(t,e,n,r){var o;switch(t){case mt.ellipse:o=In.ellipse(e,n,r);break;case mt.rectangle:o=In.rectangle(e,n,r);break;case mt.line:o=In.line(e,n,r);break;default:throw new Error("Unsupported shape type")}return o}var gr=_n,yr=function(t){(0,u.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function a(t){var e;return(0,r.Z)(this,a),(e=i.call(this,"loop")).loop=t,e.centre=new z,e.radius=new z,e}return(0,o.Z)(a,[{key:"show",value:function(t,e,n){var r=this,o=t.render.paper,i=t.molecule,a=this.loop;this.centre=new z,a.hbs.forEach((function(e){var o=i.halfBonds.get(e),s=t.bonds.get(o.bid),u=et.obj2scaled(t.atoms.get(o.begin).a.pp,n);s.b.type!==$.PATTERN.TYPE.AROMATIC&&(a.aromatic=!1),r.centre.add_(u)})),a.convex=!0;for(var s=0;s<this.loop.hbs.length;++s){var u=i.halfBonds.get(a.hbs[s]),c=i.halfBonds.get(a.hbs[(s+1)%a.hbs.length]),l=Math.atan2(z.cross(u.dir,c.dir),z.dot(u.dir,c.dir));l>0&&(a.convex=!1)}if(this.centre=this.centre.scaled(1/a.hbs.length),this.radius=-1,a.hbs.forEach((function(e){var o=i.halfBonds.get(e),a=et.obj2scaled(t.atoms.get(o.begin).a.pp,n),s=et.obj2scaled(t.atoms.get(o.end).a.pp,n),u=z.diff(s,a).rotateSC(1,0).normalized(),c=z.dot(z.diff(a,r.centre),u);r.radius=r.radius<0?c:Math.min(r.radius,c)})),this.radius*=.7,a.aromatic){var f=null;if(a.convex&&n.aromaticCircle)f=o.circle(this.centre.x,this.centre.y,this.radius).attr({stroke:"#000","stroke-width":n.lineattr["stroke-width"]});else{var h="";for(s=0;s<a.hbs.length;++s){u=i.halfBonds.get(a.hbs[s]),c=i.halfBonds.get(a.hbs[(s+1)%a.hbs.length]),l=Math.atan2(z.cross(u.dir,c.dir),z.dot(u.dir,c.dir));var d=(Math.PI-l)/2,p=c.dir.rotate(d),v=et.obj2scaled(t.atoms.get(c.begin).a.pp,n),m=Math.sin(d);Math.abs(m)<.1&&(m=.1*m/Math.abs(m));var g=n.bondSpace/m,y=v.addScaled(p,-g);h+=0===s?"M":"L",h+=gr(y.x)+","+gr(y.y)}h+="Z",f=o.path(h).attr({stroke:"#000","stroke-width":n.lineattr["stroke-width"],"stroke-dasharray":"- "})}t.addReObjectPath(pn.data,this.visel,f,null,!0)}}},{key:"isValid",value:function(t,e){var n=t.halfBonds;return this.loop.hbs.every((function(t){return n.has(t)&&n.get(t).loop===e}))}}],[{key:"isSelectable",value:function(){return!1}}]),a}(En);function br(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var wr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,"text"),(0,i.Z)((0,b.Z)(e),"item",void 0),(0,i.Z)((0,b.Z)(e),"paths",[]),e.item=t,e}return(0,o.Z)(s,[{key:"getReferencePoints",value:function(){var t=this.getRelBox(this.paths),e=t.p0,n=t.p1,r=this.item.position,o=Math.abs(z.diff(e,n).x)/40,i=Math.abs(z.diff(e,n).y)/40,a=[];return a.push(this.item.position,new z(r.x,r.y+i),new z(r.x+o,r.y+i),new z(r.x+o,r.y)),a}},{key:"hoverPath",value:function(t){var e=this.getRelBox(this.paths),n=e.p0,r=e.p1,o=n.sub(t.options.offset),i=r.sub(n),a=i.x,s=i.y;return t.paper.rect(o.x,o.y,a,s,5)}},{key:"getRelBox",value:function(t){var e=this,n=t[0][0].getBBox().x,r=t[0],o=Math.min.apply(Math,(0,v.Z)(r.map((function(t){return t.getBBox().y})))),i=t.reduce((function(t,n){return e.getRowWidth(n)>e.getRowWidth(t)?n:t}),t[0]),a=i[i.length-1],s=a.getBBox().x+a.getBBox().width,u=t[t.length-1],c=Math.max.apply(Math,(0,v.Z)(u.map((function(t){return t.getBBox().y+t.getBBox().height}))));return{p0:new z(n,o),p1:new z(s,c)}}},{key:"getRowWidth",value:function(t){return t.reduce((function(t,e){return t+e.getBBox().width}),0)}},{key:"drawHover",value:function(t){if(!this.paths.length)return null;var e=this.hoverPath(t).attr(t.options.hoverStyle);return t.ctab.addReObjectPath(pn.hovering,this.visel,e),e}},{key:"makeSelectionPlate",value:function(t,e,n){return this.paths.length&&e?this.hoverPath(t.render).attr(n.selectionStyle):null}},{key:"show",value:function(t,e,n){var r=this,o=t.render,a=o.paper,s=et.obj2scaled(this.item.position,n),u=0;this.paths=[];var c=this.item.content?JSON.parse(this.item.content):null;c&&(c.blocks.forEach((function(t){var e=r.getRanges(t,n),o=0,c=[];e.forEach((function(e){var r=(0,y.Z)(e,3),l=r[0],f=r[1],h=r[2];t.text=t.text.replace(/[^\S\r\n]/g," ");var d=a.text(s.x,s.y,t.text.substring(l,f+1)||" ").attr(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?br(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):br(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({font:n.font,"font-size":n.fontsz,"text-anchor":"start",fill:"#000000"},h));d.translateAbs(o,u+(h.shiftY||0)),c.push(d),o+=d.getBBox().width})),r.paths.push(c);var l=r.getRelBox([c]),f=l.p0,h=l.p1;u+=Math.abs(z.diff(f,h).y)})),o.ctab.addReObjectPath(pn.data,this.visel,(0,C.flatten)(this.paths),null,!0))}},{key:"getRanges",value:function(t,e){for(var n=[],r=0,o=this.getStyles(t,r,e),i=1;i<t.text.length;i++){var a=this.getStyles(t,i,e);(0,C.isEqual)(o,a)||(n.push([r,i-1,o]),o=a,r=i)}return n.push([r,t.text.length-1,o]),n}},{key:"getStyles",value:function(t,e,n){var r=t.inlineStyleRanges.filter((function(t){return t.offset<=e&&e<t.offset+t.length})),o=r.reduce((function(t,e){var n;return e.style.includes(jt.FontSize)?null===(n=e.style.match(/\d+/))||void 0===n?void 0:n[0]:t}),null);return r.reduce((function(t,e){var r=o||n.fontsz,i=.8*(o||n.fontszsub);switch(e.style){case jt.Bold:t["font-weight"]="bold";break;case jt.Italic:t["font-style"]="italic";break;case jt.Subscript:t["font-size"]=i+"px",t.shiftY=r/3;break;case jt.Superscript:t["font-size"]=i+"px",t.shiftY=-r/3;break;case"".concat(jt.FontSize,"_").concat(o,"px"):t["font-size"]=o+"px"}return t}),{})}}],[{key:"isSelectable",value:function(){return!0}}]),s}(En);function xr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Or(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Or(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Or(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Er=function(){function t(e,n){var o=this;(0,r.Z)(this,t),(0,i.Z)(this,"render",void 0),(0,i.Z)(this,"molecule",void 0),(0,i.Z)(this,"atoms",new Map),(0,i.Z)(this,"bonds",new Map),(0,i.Z)(this,"reloops",new Map),(0,i.Z)(this,"rxnPluses",new Map),(0,i.Z)(this,"rxnArrows",new Map),(0,i.Z)(this,"frags",new _t),(0,i.Z)(this,"rgroups",new _t),(0,i.Z)(this,"sgroups",new Map),(0,i.Z)(this,"sgroupData",new Map),(0,i.Z)(this,"enhancedFlags",new Map),(0,i.Z)(this,"simpleObjects",new Map),(0,i.Z)(this,"texts",new Map),(0,i.Z)(this,"initialized",!1),(0,i.Z)(this,"layers",[]),(0,i.Z)(this,"connectedComponents",new _t),(0,i.Z)(this,"ccFragmentType",new _t),(0,i.Z)(this,"structChanged",!1),(0,i.Z)(this,"atomsChanged",new Map),(0,i.Z)(this,"simpleObjectsChanged",new Map),(0,i.Z)(this,"rxnArrowsChanged",new Map),(0,i.Z)(this,"rxnPlusesChanged",new Map),(0,i.Z)(this,"enhancedFlagsChanged",new Map),(0,i.Z)(this,"bondsChanged",new Map),(0,i.Z)(this,"textsChanged",new Map),this.render=n,this.molecule=e||new At,this.initLayers(),this.clearMarks(),e.atoms.forEach((function(t,e){o.atoms.set(e,new Bn(t))})),e.bonds.forEach((function(t,e){o.bonds.set(e,new Fn(t))})),e.loops.forEach((function(t,e){o.reloops.set(e,new yr(t))})),e.rxnPluses.forEach((function(t,e){o.rxnPluses.set(e,new ar(t))})),e.rxnArrows.forEach((function(t,e){o.rxnArrows.set(e,new ir(t))})),e.simpleObjects.forEach((function(t,e){o.simpleObjects.set(e,new pr(t))})),e.texts.forEach((function(t,e){o.texts.set(e,new wr(t))})),e.frags.forEach((function(t,e){o.frags.set(e,new er(t)),t&&o.enhancedFlags.set(e,new tr)})),e.rgroups.forEach((function(t,e){o.rgroups.set(e,new rr(t))})),e.sgroups.forEach((function(t,e){o.sgroups.set(e,new cr(t)),"DAT"!==t.type||t.data.attached||o.sgroupData.set(e,new sr(t)),ht.isFunctionalGroup(t)&&o.molecule.functionalGroups.set(e,new ht(t))}))}return(0,o.Z)(t,[{key:"connectedComponentRemoveAtom",value:function(t,e){var n=e||this.atoms.get(t);if(n&&!(n.component<0)){var r=this.connectedComponents.get(n.component);r.delete(t),r.size<1&&this.connectedComponents.delete(n.component),n.component=-1}}},{key:"clearConnectedComponents",value:function(){this.connectedComponents.clear(),this.atoms.forEach((function(t){t.component=-1}))}},{key:"getConnectedComponent",value:function(t,e){for(var n=this,r=Array.isArray(t)?Array.from(t):[t],o=new V;r.length>0;){var i=r.pop();o.add(i);var a=this.atoms.get(i);a&&(a.component>=0&&e.add(a.component),a.a.neighbors.forEach((function(t){var e=n.molecule.halfBonds.get(t);if(e){var i=e.end;o.has(i)||r.push(i)}})))}return o}},{key:"addConnectedComponent",value:function(t){var e=this,n=this.connectedComponents.add(t),r=new V,o=this.getConnectedComponent(Array.from(t),r);r.delete(n);var i=-1;return o.forEach((function(t){var r=e.atoms.get(t);r&&(r.component=n,-1!==r.a.rxnFragmentType&&(i=r.a.rxnFragmentType))})),this.ccFragmentType.set(n,i),n}},{key:"removeConnectedComponent",value:function(t){var e=this;return this.connectedComponents.get(t).forEach((function(t){var n=e.atoms.get(t);n&&(n.component=-1)})),this.connectedComponents.delete(t)}},{key:"assignConnectedComponents",value:function(){var t=this;this.atoms.forEach((function(e,n){if(!(e.component>=0)){var r=new V,o=t.getConnectedComponent(n,r);r.forEach((function(e){t.removeConnectedComponent(e)})),t.addConnectedComponent(o)}}))}},{key:"initLayers",value:function(){for(var t in pn)this.layers[pn[t]]=this.render.paper.rect(0,0,10,10).attr({class:t+"Layer",fill:"#000",opacity:"0.0"}).toFront()}},{key:"addReObjectPath",value:function(t,e,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(n&&this.layers[t].node.parentNode){var a=Array.isArray(n)?n:[n];a.forEach((function(n){var a=r.render.options.offset,s=i?ot.fromRelBox(Sn(n.getBBox())):null,u=o&&s?s.translate(o.negated()):null;null!==a&&(n.translateAbs(a.x,a.y),s=s?s.translate(a):null),e.add(n,s,u),n.insertBefore(r.layers[pn[t]])}))}}},{key:"clearMarks",value:function(){var e=this;Object.keys(t.maps).forEach((function(t){e[t+"Changed"]=new Map})),this.structChanged=!1}},{key:"markItemRemoved",value:function(){this.structChanged=!0}},{key:"markBond",value:function(t,e){this.markItem("bonds",t,e)}},{key:"markAtom",value:function(t,e){this.markItem("atoms",t,e)}},{key:"markItem",value:function(t,e,n){var r=this[t+"Changed"],o=r.has(e)?Math.max(n,r.get(e)):n;r.set(e,o),this[t].has(e)&&this.clearVisel(this[t].get(e).visel)}},{key:"clearVisel",value:function(t){t.paths.forEach((function(t){t.remove()})),t.clear()}},{key:"eachItem",value:function(e){var n=this;Object.keys(t.maps).forEach((function(t){n[t].forEach(e)}))}},{key:"getVBoxObj",value:function(e){var n=this;_r(e=e||{})&&Object.keys(t.maps).forEach((function(t){e[t]=Array.from(n[t].keys())}));var r=null;return Object.keys(t.maps).forEach((function(t){e[t]&&e[t].forEach((function(e){var o=n[t].get(e).getVBoxObj(n.render);o&&(r=r?ot.union(r,o):o.clone())}))})),r=r||new ot(0,0,0,0)}},{key:"translate",value:function(t){this.eachItem((function(e){return e.visel.translate(t)}))}},{key:"scale",value:function(t){this.eachItem((function(e){return function(t,e){for(var n=0;n<t.paths.length;++n)Sr(t.paths[n],e)}(e.visel,t)}))}},{key:"clearVisels",value:function(){var t=this;this.eachItem((function(e){return t.clearVisel(e.visel)}))}},{key:"update",value:function(e){var n=this;e=e||!this.initialized,Object.keys(t.maps).forEach((function(t){var r=n[t+"Changed"];e?n[t].forEach((function(t,e){return r.set(e,1)})):r.forEach((function(e,o){n[t].has(o)||r.delete(o)}))})),this.atomsChanged.forEach((function(t,e){return n.connectedComponentRemoveAtom(e)})),this.frags.filter((function(t,e){return!e.calcBBox(n.render.ctab,t,n.render)})).forEach((function(t,e){n.clearVisel(t.visel),n.frags.delete(e),n.molecule.frags.delete(e)})),Object.keys(t.maps).forEach((function(t){var e=n[t+"Changed"];e.forEach((function(r,o){n.clearVisel(n[t].get(o).visel),n.structChanged=n.structChanged||e.get(o)>0}))})),this.sgroups.forEach((function(t){n.clearVisel(t.visel),t.hovering=null,t.selectionPlate=null})),this.frags.forEach((function(t){n.clearVisel(t.visel)})),this.rgroups.forEach((function(t){n.clearVisel(t.visel)})),e&&(this.clearConnectedComponents(),this.molecule.initHalfBonds(),this.molecule.initNeighbors());var r=Array.from(this.atomsChanged.keys());this.molecule.updateHalfBonds(r),this.molecule.sortNeighbors(r),this.assignConnectedComponents(),this.initialized=!0,this.verifyLoops();var o=e||this.structChanged;return o&&this.updateLoops(),this.showLabels(),this.showBonds(),o&&this.showLoops(),this.showReactionSymbols(),this.showSGroups(),this.showFragments(),this.showRGroups(),this.showEnhancedFlags(),this.showSimpleObjects(),this.showTexts(),this.clearMarks(),!0}},{key:"updateLoops",value:function(){var t=this;this.reloops.forEach((function(e){t.clearVisel(e.visel)}));var e=this.molecule.findLoops();e.bondsToMark.forEach((function(e){t.markBond(e,1)})),e.newLoops.forEach((function(e){t.reloops.set(e,new yr(t.molecule.loops.get(e)))}))}},{key:"showLoops",value:function(){var t=this,e=this.render.options;this.reloops.forEach((function(n,r){n.show(t,r,e)}))}},{key:"showSimpleObjects",value:function(){var t=this,e=this.render.options;this.simpleObjectsChanged.forEach((function(n,r){var o=t.simpleObjects.get(r);o&&o.show(t,e)}))}},{key:"showTexts",value:function(){var t=this,e=this.render.options;this.textsChanged.forEach((function(n,r){var o=t.texts.get(r);o&&o.show(t,r,e)}))}},{key:"showReactionSymbols",value:function(){var t=this,e=this.render.options;this.rxnArrowsChanged.forEach((function(n,r){var o=t.rxnArrows.get(r);o&&o.show(t,r,e)})),this.rxnPlusesChanged.forEach((function(n,r){var o=t.rxnPluses.get(r);o&&o.show(t,r,e)}))}},{key:"showSGroups",value:function(){var t=this;this.molecule.sGroupForest.getSGroupsBFS().reverse().forEach((function(e){var n=t.sgroups.get(e);n&&n.show(t)}))}},{key:"showFragments",value:function(){var t=this;this.frags.forEach((function(e,n){var r=e.draw(t.render,n);r&&t.addReObjectPath(pn.data,e.visel,r,null,!0)}))}},{key:"showRGroups",value:function(){var t=this,e=this.render.options;this.rgroups.forEach((function(n,r){n.show(t,r,e)}))}},{key:"loopRemove",value:function(t){var e=this,n=this.reloops.get(t);if(n){this.clearVisel(n.visel);var r=[];n.loop.hbs.forEach((function(t){var n=e.molecule.halfBonds.get(t);n&&(n.loop=-1,e.markBond(n.bid,1),e.markAtom(n.begin,1),r.push(n.bid))})),this.reloops.delete(t),this.molecule.loops.delete(t)}}},{key:"verifyLoops",value:function(){var t=this;this.reloops.forEach((function(e,n){e.isValid(t.molecule,n)||t.loopRemove(n)}))}},{key:"showLabels",value:function(){var t=this,e=this.render.options;this.atomsChanged.forEach((function(n,r){var o=t.atoms.get(r);o&&o.show(t,r,e)}))}},{key:"showEnhancedFlags",value:function(){var t=this,e=this.render.options;this.enhancedFlagsChanged.forEach((function(n,r){var o=t.enhancedFlags.get(r);o&&o.show(t,r,e)}))}},{key:"showBonds",value:function(){var t=this,e=this.render.options;this.bondsChanged.forEach((function(n,r){var o=t.bonds.get(r);o&&o.show(t,r,e)}))}},{key:"setSelection",value:function(e){var n=this,r=0===arguments.length,o=[];Object.keys(t.maps).forEach((function(i){var a=n[i].values(),s=(0,y.Z)(a,1)[0];(t.maps[i].isSelectable()||s instanceof cr)&&n[i].forEach((function(t,a){if(t instanceof Bn){var s,u,c=xr(t.a.sgs.values());try{for(c.s();!(u=c.n()).done;)s=u.value}catch(t){c.e(t)}finally{c.f()}o.push({selected:t.selected,sgroup:s})}if(t instanceof cr&&ht.isContractedFunctionalGroup(t.item.id,n.molecule.functionalGroups)){var l=o.filter((function(e){return e.sgroup===t.item.id}));t.selected=l.length>0&&l[0].selected}var f=r?t.selected:e&&e[i]&&e[i].indexOf(a)>-1;n.showItemSelection(t,f)}))}))}},{key:"showItemSelection",value:function(t,e){var n=function(t){var e,n,r,o;return t&&null!==t.selectionPlate&&(!(null!==(e=t.selectionPlate)&&void 0!==e&&e.items)&&!(null!==(n=t.selectionPlate)&&void 0!==n&&n.removed)||Array.isArray(null===(r=t.selectionPlate)||void 0===r?void 0:r.items)&&!(null!==(o=t.selectionPlate[0])&&void 0!==o&&o.removed))}(t);if(t.selected=e,t instanceof sr&&(t.sgroup.selected=e),e){if(!n){var r=this.render,o=r.options,i=r.paper;t.selectionPlate=t.makeSelectionPlate(this,i,o),this.addReObjectPath(pn.selectionPlate,t.visel,t.selectionPlate)}t.selectionPlate&&t.selectionPlate.show()}else n&&t.selectionPlate&&t.selectionPlate.hide()}}]),t}();function _r(t){return!t||!Object.keys(Er.maps).some((function(e){return t[e]&&t[e].length>0}))}function Sr(t,e){if("set"==t.type)for(var n=0;n<t.length;++n)Sr(t[n],e);else void 0!==t.attrs&&("font-size"in t.attrs?t.attr("font-size",t.attrs["font-size"]*e):"stroke-width"in t.attrs&&t.attr("stroke-width",t.attrs["stroke-width"]*e)),t.scale(e,e,0,0)}(0,i.Z)(Er,"maps",{atoms:Bn,bonds:Fn,rxnPluses:ar,rxnArrows:ir,frags:er,rgroups:rr,sgroupData:sr,enhancedFlags:tr,sgroups:cr,reloops:yr,simpleObjects:pr,texts:wr});var jr=Math.PI/12;function Ar(t,e){var n=z.diff(e,t);return Math.atan2(n.y,n.x)}function Pr(t,e){return e&&(t=Ar(t,e)),Math.round(t/jr)*jr}function kr(t){var e=Math.round(t/Math.PI*180);return e>180?e-=360:e<=-180&&(e+=360),e}var Tr={calcAngle:Ar,fracAngle:Pr,calcNewAtomPos:function(t,e,n){var r=new z(1,0).rotate(n?Ar(t,e):Pr(t,e));return r.add_(t),r},degrees:kr,setFracAngle:function(t){jr=Math.PI/180*t},mergeBondsParams:function(t,e,n,r){var o=t.atoms.get(e.begin),i=n.atoms.get(r.begin),a=t.atoms.get(e.end),s=n.atoms.get(r.end),u=Ar(o.pp,a.pp)-Ar(i.pp,s.pp),c=Math.abs(kr(u)%180),l=z.dist(o.pp,a.pp)/z.dist(i.pp,s.pp);return{merged:!(0,R.inRange)(c,10,170)&&(0,R.inRange)(l,.8,1.2),angle:u,scale:l,cross:Math.abs(kr(u))>90}}};function Cr(t,e){var n=t.clientWidth-10,r=t.clientHeight-10;n=n>0?n:0,r=r>0?r:0,this.userOpts=e,this.clientArea=t,this.paper=new(P())(t,n,r),this.sz=z.ZERO,this.ctab=new Er(new At,this),this.options=function(t){var e=t.scale||100;t.rotationStep&&Tr.setFracAngle(t.rotationStep);var n=Math.ceil(e/6*1.9),r=Math.ceil(.7*n),o={showAtomIds:!1,showBondIds:!1,showHalfBondIds:!1,showLoopIds:!1,showValenceWarnings:!0,autoScale:!1,autoScaleMargin:0,maxBondLength:0,atomColoring:!0,hideImplicitHydrogen:!1,hideTerminalLabels:!1,carbonExplicitly:!1,showCharge:!0,showHydrogenLabels:"on",showValence:!0,aromaticCircle:!0,scale:e,zoom:1,offset:new z,lineWidth:e/20,bondSpace:t.doubleBondWidth||e/7,stereoBond:t.stereoBondWidth||e/7,subFontSize:r,font:"30px Arial",fontsz:n,fontszsub:r,fontRLabel:1.2*n,fontRLogic:.7*n,lineattr:{stroke:"#000","stroke-width":t.bondThickness||e/20,"stroke-linecap":"round","stroke-linejoin":"round"},selectionStyle:{fill:"#7f7",stroke:"none"},hoverStyle:{stroke:"#0c0","stroke-width":.6*e/20},sgroupBracketStyle:{stroke:"darkgray","stroke-width":.5*e/20},lassoStyle:{stroke:"gray","stroke-width":"1px"},hoverStyleSimpleObject:{stroke:"#0c0","stroke-width":e/4,"stroke-linecap":"round","stroke-opacity":.6},atomSelectionPlateRadius:1.2*n,contractedFunctionalGroupSize:50};return Object.assign({},o,t)}(this.userOpts)}Cr.prototype.selectionPolygon=function(t){return In.selectionPolygon(this.paper,t,this.options)},Cr.prototype.selectionLine=function(t,e){return In.selectionLine(this.paper,t,e,this.options)},Cr.prototype.selectionRectangle=function(t,e){return In.selectionRectangle(this.paper,t,e,this.options)},Cr.prototype.view2obj=function(t,e){var n=this.scrollPos();return this.useOldZoom||(t=t.scaled(1/this.options.zoom),n=n.scaled(1/this.options.zoom)),t=e?t:t.add(n).sub(this.options.offset),et.scaled2obj(t,this.options)},Cr.prototype.obj2view=function(t,e){var n=et.obj2scaled(t,this.options);return n=e?n:n.add(this.options.offset).sub(this.scrollPos().scaled(1/this.options.zoom)),this.useOldZoom||(n=n.scaled(this.options.zoom)),n},Cr.prototype.scrollPos=function(){return new z(this.clientArea.scrollLeft,this.clientArea.scrollTop)},Cr.prototype.page2obj=function(t){var e=function(t){var e=0,n=0;if(t.parentNode)do{e+=t.offsetTop||0,n+=t.offsetLeft||0,t=t.offsetParent}while(t);return{left:n,top:e}}(this.clientArea),n=new z(t.pageX-e.left,t.pageY-e.top);return this.view2obj(n)},Cr.prototype.setPaperSize=function(t){this.sz=t,this.paper.setSize(t.x*this.options.zoom,t.y*this.options.zoom),this.setViewBox(this.options.zoom)},Cr.prototype.setOffset=function(t){var e=new z(t.x-this.options.offset.x,t.y-this.options.offset.y);this.clientArea.scrollLeft+=e.x,this.clientArea.scrollTop+=e.y,this.options.offset=t},Cr.prototype.setZoom=function(t){this.options.zoom=t,this.paper.setSize(this.sz.x*t,this.sz.y*t),this.setViewBox(t)},Cr.prototype.setScrollOffset=function(t,e){var n,r,o,i,a,s,u,c=this.clientArea,l=c.clientWidth,f=c.clientHeight,h=(n=this.sz.scaled(this.options.zoom),r=t,o=e,i=l+t,a=f+e,s=r<0?-r:0,u=o<0?-o:0,n.x<i&&(s+=i-n.x),n.y<a&&(u+=a-n.y),new z(s,u)).scaled(1/this.options.zoom);if(h.x>0||h.y>0){this.setPaperSize(this.sz.add(h));var d=new z(t<0?-t:0,e<0?-e:0).scaled(1/this.options.zoom);(d.x>0||d.y>0)&&(this.ctab.translate(d),this.setOffset(this.options.offset.add(d)))}c.scrollLeft=t,c.scrollTop=e,this.update(!1)},Cr.prototype.setScale=function(t){this.options.offset&&(this.options.offset=this.options.offset.scaled(1/t).scaled(t)),this.userOpts.scale*=t,this.options=null,this.update(!0)},Cr.prototype.setViewBox=function(t){this.useOldZoom?this.setScale(t):this.paper.canvas.setAttribute("viewBox","0 0 "+this.sz.x+" "+this.sz.y)},Cr.prototype.setMolecule=function(t){this.paper.clear(),this.ctab=new Er(t,this),this.options.offset=new z,this.update(!1)},Cr.prototype.update=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=e||new z(this.clientArea.clientWidth||100,this.clientArea.clientHeight||100);var n=this.ctab.update(t);if(this.ctab.setSelection(),n){var r=this.options.scale,o=this.ctab.getVBoxObj().transform(et.obj2scaled,this.options).translate(this.options.offset||new z);if(this.options.autoScale){var i=o.sz(),a=this.options.autoScaleMargin,s=new z(a,a),u=e;if(u.x<2*a+1||u.y<2*a+1)throw new Error("View box too small for the given margin");var c=Math.max(i.x/(u.x-2*a),i.y/(u.y-2*a));this.options.maxBondLength/c>1&&(c=1);var l=i.add(s.scaled(2*c));this.paper.setViewBox(o.pos().x-a*c-(u.x*c-l.x)/2,o.pos().y-a*c-(u.y*c-l.y)/2,u.x*c,u.y*c)}else{var f=z.UNIT.scaled(r),h=o.sz().length()>0?o.extend(f,f):o,d=new ot(this.scrollPos(),e.scaled(1/this.options.zoom).sub(z.UNIT.scaled(20))),p=ot.union(d,h);this.oldCb||(this.oldCb=new ot);var v=p.sz().floor(),m=this.oldCb.p0.sub(p.p0).ceil();this.oldBb=o,this.sz&&v.x==this.sz.x&&v.y==this.sz.y||this.setPaperSize(v),this.options.offset=this.options.offset||new z,0==m.x&&0==m.y||(this.setOffset(this.options.offset.add(m)),this.ctab.translate(m))}}};var Rr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,r.Z)(this,t),(0,i.Z)(this,"_inverted",void 0),(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"priority",void 0),this.type=e,this.priority=n}return(0,o.Z)(t,[{key:"execute",value:function(t){throw new Error("Operation.execute() is not implemented")}},{key:"perform",value:function(t){return this.execute(t),this._inverted||(this._inverted=this.invert(),this._inverted._inverted=this),this._inverted}},{key:"invert",value:function(){throw new Error("Operation.invert() is not implemented")}},{key:"isDummy",value:function(t){return!1}}],[{key:"invalidateAtom",value:function(e,n,r){var o=e.atoms.get(n);if(o){e.markAtom(n,r?1:0);var i=e.molecule.halfBonds;o.a.neighbors.forEach((function(n){if(i.has(n)){var o=i.get(n);o&&(e.markBond(o.bid,1),e.markAtom(o.end,0),r&&t.invalidateLoop(e,o.bid))}}));var a=o.a.fragment,s=e.render.options.stereoLabelStyle;e.atoms.forEach((function(t,n){s!==mn.IUPAC&&s!==mn.Classic||t.a.fragment===a&&e.markAtom(n,0)}))}}},{key:"invalidateLoop",value:function(t,e){var n=t.bonds.get(e);if(n&&n.b.hb1&&n.b.hb2){var r=t.molecule.halfBonds.get(n.b.hb1),o=t.molecule.halfBonds.get(n.b.hb2);r&&r.loop>=0&&t.loopRemove(r.loop),o&&o.loop>=0&&t.loopRemove(o.loop)}}},{key:"invalidateBond",value:function(e,n){t.invalidateLoop(e,n);var r=e.bonds.get(n);r&&(t.invalidateAtom(e,r.b.begin,0),t.invalidateAtom(e,r.b.end,0))}},{key:"invalidateItem",value:function(e,n,r,o){if("atoms"!==n)return"bonds"===n?(t.invalidateBond(e,r),void(o>0&&t.invalidateLoop(e,r))):void e.markItem(n,r,o);t.invalidateAtom(e,r,o)}},{key:"invalidateEnhancedFlag",value:function(e,n){t.invalidateItem(e,"enhancedFlags",n,1)}}]),t}(),Mr=Object.freeze({ATOM_ADD:"Add atom",ATOM_DELETE:"Delete atom",ATOM_ATTR:"Set atom attribute",ATOM_MOVE:"Move atom",CALC_IMPLICIT_H:"Calculate implicit hydrogen",BOND_ADD:"Add bond",BOND_DELETE:"Delete bond",BOND_ATTR:"Set bond attribute",BOND_MOVE:"Move bond",LOOP_MOVE:"Move loop",S_GROUP_ATOM_ADD:"Add atom to s-group",S_GROUP_ATOM_REMOVE:"Remove atom from s-group",S_GROUP_ATTR:"Set s-group attribute",S_GROUP_CREATE:"Create s-group",S_GROUP_DELETE:"Delete s-group",S_GROUP_ADD_TO_HIERACHY:"Add s-group to hierarchy",S_GROUP_REMOVE_FROM_HIERACHY:"Delete s-group from hierarchy",R_GROUP_ATTR:"Set r-group attribute",R_GROUP_FRAGMENT:"R-group fragment",UPDATE_IF_THEN:"Update",RESTORE_IF_THEN:"Restore",RXN_ARROW_ADD:"Add rxn arrow",RXN_ARROW_DELETE:"Delete rxn arrow",RXN_ARROW_MOVE:"Move rxn arrow",RXN_ARROW_RESIZE:"Resize rxn arrow",RXN_PLUS_ADD:"Add rxn plus",RXN_PLUS_DELETE:"Delete rxn plus",RXN_PLUS_MOVE:"Move rxn plus",S_GROUP_DATA_MOVE:"Move s-group data",CANVAS_LOAD:"Load canvas",ALIGN_DESCRIPTORS:"Align descriptors",SIMPLE_OBJECT_ADD:"Add simple object",SIMPLE_OBJECT_DELETE:"Delete simple object",SIMPLE_OBJECT_MOVE:"Move simple object",SIMPLE_OBJECT_RESIZE:"Resize simple object",RESTORE_DESCRIPTORS_POSITION:"Restore descriptors position",FRAGMENT_ADD:"Add fragment",FRAGMENT_DELETE:"Delete fragment",FRAGMENT_STEREO_FLAG:"Add fragment stereo flag",FRAGMENT_ADD_STEREO_ATOM:"Add stereo atom to fragment",FRAGMENT_DELETE_STEREO_ATOM:"Delete stereo atom from fragment",ENHANCED_FLAG_MOVE:"Move enhanced flag",TEXT_CREATE:"Add text",TEXT_UPDATE:"Edit text",TEXT_DELETE:"Delete text",TEXT_MOVE:"Move text",ADD_HIGHLIGHT:"Highlight",UPDATE_HIGHLIGHT:"Update highlight",REMOVE_HIGHLIGHT:"Remove highlight"});var Ir=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.ATOM_ATTR,1),(0,i.Z)((0,b.Z)(o),"data",void 0),(0,i.Z)((0,b.Z)(o),"data2",void 0),o.data={aid:t,attribute:e,value:n},o.data2=null,o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data,n=e.aid,r=e.attribute,o=e.value,i=t.molecule.atoms.get(n);this.data2||(this.data2={aid:n,attribute:r,value:i[r]}),i[r]=o,Rr.invalidateAtom(t,n)}},{key:"invert",value:function(){var t=new s;return t.data=this.data2,t.data2=this.data,t}},{key:"isDummy",value:function(t){return t.molecule.atoms.get(this.data.aid)[this.data.attribute]===this.data.value}}]),s}(Rr);var Nr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.ATOM_MOVE,2),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={aid:t,d:e,noinvalidate:n},o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=t.molecule,n=this.data,r=n.aid,o=n.d,i=e.atoms.get(r);if(i){i.pp.add_(o);var a=t.atoms.get(r);if(a){var s=et.obj2scaled(o,t.render.options);a.visel.translate(s)}this.data.d=o.negated(),this.data.noinvalidate||Rr.invalidateAtom(t,r,1)}}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}},{key:"isDummy",value:function(){var t=this.data.d;return 0===t.x&&0===t.y}}]),s}(Rr);function Br(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Zr=function(t){(0,u.Z)(n,t);var e=Br(n);function n(t,o){var a;return(0,r.Z)(this,n),a=e.call(this,Mr.ATOM_ADD),(0,i.Z)((0,b.Z)(a),"data",void 0),a.data={atom:t,pos:o,aid:null},a}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.atom,r=e.pos,o=t.molecule,i={};n&&Object.keys(n).forEach((function(t){i[t]=n[t]})),i.label=i.label||"C","number"!=typeof this.data.aid?this.data.aid=o.atoms.add(new W(i)):o.atoms.set(this.data.aid,new W(i));var a=this.data.aid,s=new Bn(o.atoms.get(a));s.component=t.connectedComponents.add(new V([a])),t.atoms.set(a,s),t.markAtom(a,1),o.atomSetPos(a,new z(r));var u=o.rxnArrows.get(0);u&&(o.atoms.get(a).rxnFragmentType=o.defineRxnFragmentTypeForAtomset(new V([a]),u.pos[0].x))}},{key:"invert",value:function(){var t=new Lr;return t.data=this.data,t}}]),n}(Rr),Lr=function(t){(0,u.Z)(n,t);var e=Br(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.ATOM_DELETE,5),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={aid:t,atom:null,pos:null},o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data.aid,n=t.molecule;this.data.atom||(this.data.atom=n.atoms.get(e),this.data.pos=this.data.atom.pp);var r=t.atoms.get(e);if(r){var o=t.connectedComponents.get(r.component);o.delete(e),0===o.size&&t.connectedComponents.delete(r.component),t.clearVisel(r.visel),t.atoms.delete(e),t.markItemRemoved(),n.atoms.delete(e)}}},{key:"invert",value:function(){var t=new Zr;return t.data=this.data,t}}]),n}(Rr);var Dr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.BOND_ATTR,2),(0,i.Z)((0,b.Z)(o),"data",void 0),(0,i.Z)((0,b.Z)(o),"data2",void 0),o.data={bid:t,attribute:e,value:n},o.data2=null,o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data,n=e.attribute,r=e.bid,o=e.value,i=t.molecule.bonds.get(r);this.data2||(this.data2={bid:r,attribute:n,value:i[n]}),i[n]=o,Rr.invalidateBond(t,r),"type"===n&&Rr.invalidateLoop(t,r)}},{key:"isDummy",value:function(t){var e=this.data,n=e.attribute,r=e.bid,o=e.value;return t.molecule.bonds.get(r)[n]===o}},{key:"invert",value:function(){var t=new s;return t.data=this.data2,t.data2=this.data,t}}]),s}(Rr);var zr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e){var n;return(0,r.Z)(this,s),n=a.call(this,Mr.BOND_MOVE,2),(0,i.Z)((0,b.Z)(n),"data",void 0),n.data={bid:t,d:e},n}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data,n=e.bid,r=e.d,o=t.bonds.get(n);if(o){var i=et.obj2scaled(r,t.render.options);o.visel.translate(i),this.data.d=r.negated()}}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}}]),s}(Rr);function Fr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Gr=function(t){(0,u.Z)(n,t);var e=Fr(n);function n(t,o,a){var s;return(0,r.Z)(this,n),s=e.call(this,Mr.BOND_ADD,1),(0,i.Z)((0,b.Z)(s),"data",void 0),s.data={bond:a,begin:t,end:o,bid:null},s}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.begin,r=e.bond,o=e.end,i=t.molecule;if(n===o)throw new Error("Distinct atoms expected");Rr.invalidateAtom(t,n,1),Rr.invalidateAtom(t,o,1);var a={};r&&Object.keys(r).forEach((function(t){a[t]=r[t]})),a.type=a.type||$.PATTERN.TYPE.SINGLE,a.begin=n,a.end=o;var s=new $(a);"number"==typeof this.data.bid?i.bonds.set(this.data.bid,s):this.data.bid=i.bonds.add(s);var u=this.data.bid,c=i.bonds.get(u);i.bondInitHalfBonds(u),i.atomAddNeighbor(c.hb1),i.atomAddNeighbor(c.hb2),t.bonds.set(u,new Fn(c)),t.markBond(u,1)}},{key:"invert",value:function(){var t=new Hr;return t.data=this.data,t}}]),n}(Rr),Hr=function(t){(0,u.Z)(n,t);var e=Fr(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.BOND_DELETE,3),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={bid:t,bond:null,begin:null,end:null},o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data.bid,n=t.molecule;this.data.bond||(this.data.bond=n.bonds.get(e),this.data.begin=this.data.bond.begin,this.data.end=this.data.bond.end),Rr.invalidateBond(t,e);var r=t.bonds.get(e);if(r){[r.b.hb1,r.b.hb2].forEach((function(e){if(void 0!==e){var n=t.molecule.halfBonds.get(e);n&&n.loop>=0&&t.loopRemove(n.loop)}}),t),t.clearVisel(r.visel),t.bonds.delete(e),t.markItemRemoved();var o=n.bonds.get(e);[o.hb1,o.hb2].forEach((function(t){var e=n.halfBonds.get(t);if(e){var r=n.atoms.get(e.begin),o=r.neighbors.indexOf(t),i=(o+r.neighbors.length-1)%r.neighbors.length,a=(o+1)%r.neighbors.length;n.setHbNext(r.neighbors[i],r.neighbors[a]),r.neighbors.splice(o,1)}})),n.halfBonds.delete(o.hb1),n.halfBonds.delete(o.hb2),n.bonds.delete(e)}}},{key:"invert",value:function(){var t=new Gr;return t.data=this.data,t}}]),n}(Rr);var Vr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,Mr.CANVAS_LOAD),(0,i.Z)((0,b.Z)(e),"data",void 0),e.data={struct:t},e}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=t.molecule;t.clearVisels(),t.render.setMolecule(this.data.struct),this.data.struct=e}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}}]),s}(Rr);function Ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var qr=function(t){(0,u.Z)(n,t);var e=Ur(n);function n(){var t;return(0,r.Z)(this,n),t=e.call(this,Mr.ALIGN_DESCRIPTORS),(0,i.Z)((0,b.Z)(t),"history",void 0),t.history={},t}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this,n=t.molecule,r=Array.from(n.sgroups.values()).reverse(),o=n.getCoordBoundingBoxObj(),i=new z(o.max.x,o.min.y).add(new z(2,-1));r.forEach((function(r){e.history[r.id]=new z(r.pp),i=i.add(new z(0,.5)),r.pp=i,n.sgroups.set(r.id,r),Rr.invalidateItem(t,"sgroupData",r.id,1)}))}},{key:"invert",value:function(){return new Wr(this.history)}}]),n}(Rr),Wr=function(t){(0,u.Z)(n,t);var e=Ur(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.RESTORE_DESCRIPTORS_POSITION),(0,i.Z)((0,b.Z)(o),"history",void 0),o.history=t,o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this,n=t.molecule;Array.from(n.sgroups.values()).forEach((function(r){r.pp=e.history[r.id],n.sgroups.set(r.id,r),Rr.invalidateItem(t,"sgroupData",r.id,1)}))}},{key:"invert",value:function(){return new qr}}]),n}(Rr);var Yr=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e){var n;return(0,r.Z)(this,s),n=a.call(this,Mr.ENHANCED_FLAG_MOVE),(0,i.Z)((0,b.Z)(n),"data",void 0),n.data={frid:t,p:e},n}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data.frid,n=this.data.p,r=t.molecule.frags.get(e);if(r){var o=r.stereoFlagPosition?new z(r.stereoFlagPosition.x,r.stereoFlagPosition.y):tt.getDefaultStereoFlagPosition(t.molecule,e),i=z.sum(o,n);r.stereoFlagPosition=i,this.data.p=n.negated(),Rr.invalidateItem(t,"enhancedFlags",e,1)}}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}}]),s}(Rr);function $r(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Kr=function(t){(0,u.Z)(n,t);var e=$r(n);function n(t,o){var a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,r.Z)(this,n),a=e.call(this,Mr.UPDATE_IF_THEN),(0,i.Z)((0,b.Z)(a),"rgid_new",void 0),(0,i.Z)((0,b.Z)(a),"rgid_old",void 0),(0,i.Z)((0,b.Z)(a),"ifThenHistory",void 0),(0,i.Z)((0,b.Z)(a),"skipRgids",void 0),a.rgid_new=t,a.rgid_old=o,a.ifThenHistory=new Map,a.skipRgids=s||[],a}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this,n=t.molecule;n.rgroups.forEach((function(t,r){t.ifthen!==e.rgid_old||e.skipRgids.includes(r)||(t.ifthen=e.rgid_new,e.ifThenHistory.set(r,e.rgid_old),n.rgroups.set(r,t))}))}},{key:"invert",value:function(){return new Jr(this.rgid_new,this.rgid_old,this.ifThenHistory)}}]),n}(Rr),Jr=function(t){(0,u.Z)(n,t);var e=$r(n);function n(t,o,a){var s;return(0,r.Z)(this,n),s=e.call(this,Mr.RESTORE_IF_THEN),(0,i.Z)((0,b.Z)(s),"rgid_new",void 0),(0,i.Z)((0,b.Z)(s),"rgid_old",void 0),(0,i.Z)((0,b.Z)(s),"ifThenHistory",void 0),s.rgid_new=t,s.rgid_old=o,s.ifThenHistory=a||new Map,s}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule;this.ifThenHistory.forEach((function(t,n){var r=e.rgroups.get(n);r.ifthen=t,e.rgroups.set(n,r)}))}},{key:"invert",value:function(){return new Kr(this.rgid_old,this.rgid_new)}}]),n}(Rr);function Xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Qr=function(t){(0,u.Z)(n,t);var e=Xr(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.FRAGMENT_ADD),(0,i.Z)((0,b.Z)(o),"frid",void 0),o.frid=void 0===t?null:t,o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=new tt;null===this.frid?this.frid=e.frags.add(n):e.frags.set(this.frid,n),t.frags.set(this.frid,new er(n)),t.enhancedFlags.set(this.frid,new tr)}},{key:"invert",value:function(){return new to(this.frid)}}]),n}(Rr),to=function(t){(0,u.Z)(n,t);var e=Xr(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.FRAGMENT_DELETE,100),(0,i.Z)((0,b.Z)(o),"frid",void 0),o.frid=t,o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule;if(e.frags.get(this.frid)){Rr.invalidateItem(t,"frags",this.frid,1),t.frags.delete(this.frid),e.frags.delete(this.frid);var n=t.enhancedFlags.get(this.frid);n&&(t.clearVisel(n.visel),t.enhancedFlags.delete(this.frid))}}},{key:"invert",value:function(){return new Qr(this.frid)}}]),n}(Rr);function eo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var no=function(t){(0,u.Z)(n,t);var e=eo(n);function n(t,o){var a;return(0,r.Z)(this,n),a=e.call(this,Mr.FRAGMENT_ADD_STEREO_ATOM,100),(0,i.Z)((0,b.Z)(a),"data",void 0),a.data={frid:t,aid:o},a}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.aid,r=e.frid,o=t.molecule.frags.get(r);o&&(o.updateStereoAtom(t.molecule,n,r,!0),Rr.invalidateEnhancedFlag(t,r))}},{key:"invert",value:function(){return new ro(this.data.frid,this.data.aid)}}]),n}(Rr),ro=function(t){(0,u.Z)(n,t);var e=eo(n);function n(t,o){var a;return(0,r.Z)(this,n),a=e.call(this,Mr.FRAGMENT_DELETE_STEREO_ATOM,90),(0,i.Z)((0,b.Z)(a),"data",void 0),a.data={frid:t,aid:o},a}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.aid,r=e.frid,o=t.molecule.frags.get(r);o&&(o.updateStereoAtom(t.molecule,n,r,!1),Rr.invalidateEnhancedFlag(t,r))}},{key:"invert",value:function(){var t=this.data,e=t.aid,n=t.frid;return new no(n,e)}}]),n}(Rr);var oo=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,Mr.FRAGMENT_STEREO_FLAG,6),(0,i.Z)((0,b.Z)(e),"frid",void 0),e.frid=t,e}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=t.molecule;e.frags.get(this.frid).updateStereoFlag(e),Rr.invalidateEnhancedFlag(t,this.frid)}},{key:"invert",value:function(){return new s(this.frid)}}]),s}(Rr);var io=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t){var e;return(0,r.Z)(this,s),e=a.call(this,Mr.CALC_IMPLICIT_H,10),(0,i.Z)((0,b.Z)(e),"atomIds",void 0),e.atomIds=t,e}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.atomIds;t.molecule.setImplicitHydrogen(e)}},{key:"invert",value:function(){return new s(this.atomIds)}}]),s}(Rr);var ao=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e){var n;return(0,r.Z)(this,s),n=a.call(this,Mr.LOOP_MOVE),(0,i.Z)((0,b.Z)(n),"data",void 0),n.data={id:t,d:e},n}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data,n=e.id,r=e.d,o=t.reloops.get(n);if(o&&o.visel){var i=et.obj2scaled(r,t.render.options);o.visel.translate(i)}this.data.d=r.negated()}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}}]),s}(Rr);var so=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.R_GROUP_ATTR),(0,i.Z)((0,b.Z)(o),"data",void 0),(0,i.Z)((0,b.Z)(o),"data2",void 0),o.data={rgid:t,attribute:e,value:n},o.data2=null,o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data,n=e.rgid,r=e.attribute,o=e.value,i=t.molecule.rgroups.get(n);i&&(this.data2||(this.data2={rgid:n,attribute:r,value:i[r]}),i[r]=o,Rr.invalidateItem(t,"rgroups",n))}},{key:"invert",value:function(){var t=new s;return t.data=this.data2,t.data2=this.data,t}},{key:"isDummy",value:function(t){var e=this.data,n=e.rgid,r=e.attribute,o=e.value;return t.molecule.rgroups.get(n)[r]===o}}]),s}(Rr);var uo=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.R_GROUP_FRAGMENT),(0,i.Z)((0,b.Z)(o),"rgid_new",void 0),(0,i.Z)((0,b.Z)(o),"rg_new",void 0),(0,i.Z)((0,b.Z)(o),"rgid_old",void 0),(0,i.Z)((0,b.Z)(o),"rg_old",void 0),(0,i.Z)((0,b.Z)(o),"frid",void 0),o.rgid_new=t,o.rg_new=n,o.rgid_old=null,o.rg_old=null,o.frid=e,o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=t.molecule;this.rgid_old=this.rgid_old||vt.findRGroupByFragment(e.rgroups,this.frid),this.rg_old=this.rgid_old?e.rgroups.get(this.rgid_old):null,this.removeOld(e,t),this.setNew(e,t)}},{key:"removeOld",value:function(t,e){this.rg_old&&(this.rg_old.frags.delete(this.frid),e.clearVisel(e.rgroups.get(this.rgid_old).visel),0===this.rg_old.frags.size?(e.rgroups.delete(this.rgid_old),t.rgroups.delete(this.rgid_old),e.markItemRemoved()):e.markItem("rgroups",this.rgid_old,1))}},{key:"setNew",value:function(t,e){if(this.rgid_new){var n=t.rgroups.get(this.rgid_new);n?e.markItem("rgroups",this.rgid_new,1):(n=this.rg_new||new vt,t.rgroups.set(this.rgid_new,n),e.rgroups.set(this.rgid_new,new rr(n))),n.frags.add(this.frid)}}},{key:"invert",value:function(){return new s(this.rgid_old,this.frid,this.rg_old)}}]),s}(Rr);var co=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.RXN_ARROW_MOVE),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={id:t,d:e,noinvalidate:n},o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=t.molecule,n=this.data.id,r=this.data.d;e.rxnArrows.get(n).pos.forEach((function(t){return t.add_(r)})),t.rxnArrows.get(n).visel.translate(et.obj2scaled(r,t.render.options)),this.data.d=r.negated(),this.data.noinvalidate||Rr.invalidateItem(t,"rxnArrows",n,1)}},{key:"invert",value:function(){var t=new s(this.data.id,this.data.d,this.data.noinvalidate);return t.data=this.data,t}}]),s}(Rr);var lo=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n,o,u){var c;return(0,r.Z)(this,s),c=a.call(this,Mr.RXN_ARROW_RESIZE),(0,i.Z)((0,b.Z)(c),"data",void 0),c.data={id:t,d:e,current:n,anchor:o,noinvalidate:u},c}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=t.molecule,n=this.data.id,r=this.data.d,o=this.data.current,i=e.rxnArrows.get(n),a=this.data.anchor;if(a){var s=i.pos[0].get_xy0(),u=i.pos[1].get_xy0();Ct(a.x)===Ct(i.pos[1].x)&&Ct(a.y)===Ct(i.pos[1].y)&&(i.pos[1].x=a.x=o.x,o.x=u.x,i.pos[1].y=a.y=o.y,o.y=u.y),Ct(a.x)===Ct(i.pos[0].x)&&Ct(a.y)===Ct(i.pos[0].y)&&(i.pos[0].x=a.x=o.x,o.x=s.x,i.pos[0].y=a.y=o.y,o.y=s.y)}else i.pos[1].add_(r);t.rxnArrows.get(n).visel.translate(et.obj2scaled(r,t.render.options)),this.data.d=r.negated(),this.data.noinvalidate||Rr.invalidateItem(t,"rxnArrows",n,1)}},{key:"invert",value:function(){return new s(this.data.id,this.data.d,this.data.current,this.data.anchor,this.data.noinvalidate)}}]),s}(Rr);var fo=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.RXN_PLUS_MOVE),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={id:t,d:e,noinvalidate:n},o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data,n=e.id,r=e.d,o=e.noinvalidate;t.molecule.rxnPluses.get(n).pp.add_(r);var i=t.rxnPluses.get(n),a=et.obj2scaled(r,t.render.options);i.visel.translate(a),this.data.d=r.negated(),o||Rr.invalidateItem(t,"rxnPluses",n,1)}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}}]),s}(Rr);function ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var po=function(t){(0,u.Z)(n,t);var e=ho(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.RXN_PLUS_ADD),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={plid:null,pos:t},o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=new yt;"number"==typeof this.data.plid?e.rxnPluses.set(this.data.plid,n):this.data.plid=e.rxnPluses.add(n);var r=this.data,o=r.pos,i=r.plid,a=e.rxnPluses.get(i);t.rxnPluses.set(i,new ar(a)),e.rxnPlusSetPos(i,new z(o)),Rr.invalidateItem(t,"rxnPluses",i,1)}},{key:"invert",value:function(){var t=new vo;return t.data=this.data,t}}]),n}(Rr),vo=function(t){(0,u.Z)(n,t);var e=ho(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.RXN_PLUS_DELETE),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={plid:t,pos:null},o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data.plid,n=t.molecule;this.data.pos||(this.data.pos=n.rxnPluses.get(e).pp),t.markItemRemoved();var r=t.rxnPluses.get(e);r&&(t.clearVisel(r.visel),t.rxnPluses.delete(e),n.rxnPluses.delete(e))}},{key:"invert",value:function(){var t=new po;return t.data=this.data,t}}]),n}(Rr);function mo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var go=function(t){(0,u.Z)(n,t);var e=mo(n);function n(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lt.OpenAngle,s=arguments.length>2?arguments[2]:void 0;return(0,r.Z)(this,n),t=e.call(this,Mr.RXN_ARROW_ADD),(0,i.Z)((0,b.Z)(t),"data",void 0),t.data={pos:o,mode:a,id:s},t}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=new gt({mode:this.data.mode});if(null==this.data.id){var r=e.rxnArrows.add(n);this.data.id=r}else e.rxnArrows.set(this.data.id,n);var o=this.data.id;t.rxnArrows.set(o,new ir(n));var i=(0,v.Z)(this.data.pos);e.rxnArrowSetPos(o,i.map((function(t){return new z(t)}))),Rr.invalidateItem(t,"rxnArrows",o,1)}},{key:"invert",value:function(){return new yo(this.data.id)}}]),n}(Rr),yo=function(t){(0,u.Z)(n,t);var e=mo(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.RXN_ARROW_DELETE),(0,i.Z)((0,b.Z)(o),"data",void 0),(0,i.Z)((0,b.Z)(o),"performed",void 0),o.data={id:t,pos:[],mode:lt.OpenAngle},o.performed=!1,o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=e.rxnArrows.get(this.data.id);this.data.pos=n.pos,this.data.mode=n.mode,this.performed=!0,t.markItemRemoved(),t.clearVisel(t.rxnArrows.get(this.data.id).visel),t.rxnArrows.delete(this.data.id),e.rxnArrows.delete(this.data.id)}},{key:"invert",value:function(){return new go(this.data.pos,this.data.mode,this.data.id)}}]),n}(Rr);function bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var wo=function(t){(0,u.Z)(n,t);var e=bo(n);function n(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mt.line,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=arguments.length>3?arguments[3]:void 0;return(0,r.Z)(this,n),t=e.call(this,Mr.SIMPLE_OBJECT_ADD),(0,i.Z)((0,b.Z)(t),"data",void 0),t.data={pos:o,mode:a,toCircle:s,id:u},t}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=new xt({mode:this.data.mode});if(null==this.data.id){var r=e.simpleObjects.add(n);this.data.id=r}else e.simpleObjects.set(this.data.id,n);var o=this.data.id;t.simpleObjects.set(o,new pr(n));var i=(0,v.Z)(this.data.pos);this.data.toCircle&&(i[1]=So(i[0],i[1])),e.simpleObjectSetPos(o,i.map((function(t){return new z(t)}))),Rr.invalidateItem(t,"simpleObjects",o,1)}},{key:"invert",value:function(){return new xo(this.data.id)}}]),n}(Rr),xo=function(t){(0,u.Z)(n,t);var e=bo(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.SIMPLE_OBJECT_DELETE),(0,i.Z)((0,b.Z)(o),"data",void 0),(0,i.Z)((0,b.Z)(o),"performed",void 0),o.data={id:t,pos:[],mode:mt.line,toCircle:!1},o.performed=!1,o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=e.simpleObjects.get(this.data.id);this.data.pos=n.pos,this.data.mode=n.mode,this.data.toCircle=n.toCircle,this.performed=!0,t.markItemRemoved(),t.clearVisel(t.simpleObjects.get(this.data.id).visel),t.simpleObjects.delete(this.data.id),e.simpleObjects.delete(this.data.id)}},{key:"invert",value:function(){return new wo(this.data.pos,this.data.mode,this.data.toCircle,this.data.id)}}]),n}(Rr),Oo=function(t){(0,u.Z)(n,t);var e=bo(n);function n(t,o,a){var s;return(0,r.Z)(this,n),s=e.call(this,Mr.SIMPLE_OBJECT_MOVE),(0,i.Z)((0,b.Z)(s),"data",void 0),s.data={id:t,d:o,noinvalidate:a},s}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=this.data.id,r=this.data.d;e.simpleObjects.get(n).pos.forEach((function(t){return t.add_(r)})),t.simpleObjects.get(n).visel.translate(et.obj2scaled(r,t.render.options)),this.data.d=r.negated(),this.data.noinvalidate||Rr.invalidateItem(t,"simpleObjects",n,1)}},{key:"invert",value:function(){var t=new n(this.data.id,this.data.d,this.data.noinvalidate);return t.data=this.data,t}}]),n}(Rr);function Eo(t,e,n){var r=t.pos[0].get_xy0(),o=t.pos[1].get_xy0();Ct(e.x)===Ct(t.pos[1].x)&&(t.pos[1].x=e.x=n.x,n.x=o.x),Ct(e.y)===Ct(t.pos[1].y)&&(t.pos[1].y=e.y=n.y,n.y=o.y),Ct(e.x)===Ct(t.pos[0].x)&&(t.pos[0].x=e.x=n.x,n.x=r.x),Ct(e.y)===Ct(t.pos[0].y)&&(t.pos[0].y=e.y=n.y,n.y=r.y)}var _o=function(t){(0,u.Z)(n,t);var e=bo(n);function n(t,o,a,s,u,c){var l;return(0,r.Z)(this,n),l=e.call(this,Mr.SIMPLE_OBJECT_RESIZE),(0,i.Z)((0,b.Z)(l),"data",void 0),l.data={id:t,d:o,current:a,anchor:s,noinvalidate:u,toCircle:c},l}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=this.data.id,r=this.data.d,o=this.data.current,i=e.simpleObjects.get(n),a=this.data.anchor;if(i.mode===mt.ellipse)if(a)Eo(i,a,o);else if(this.data.toCircle){var s=i.pos[1].get_xy0(),u=So(i.pos[0],o);i.pos[1].x=u.x,i.pos[1].y=u.y,this.data.current=s}else{var c=i.pos[1].get_xy0();i.pos[1].x=o.x,i.pos[1].y=o.y,this.data.current=c}else if(i.mode===mt.line&&a){var l=i.pos[0].get_xy0(),f=i.pos[1].get_xy0();Ct(a.x)===Ct(i.pos[1].x)&&Ct(a.y)===Ct(i.pos[1].y)&&(i.pos[1].x=a.x=o.x,o.x=f.x,i.pos[1].y=a.y=o.y,o.y=f.y),Ct(a.x)===Ct(i.pos[0].x)&&Ct(a.y)===Ct(i.pos[0].y)&&(i.pos[0].x=a.x=o.x,o.x=l.x,i.pos[0].y=a.y=o.y,o.y=l.y)}else i.mode===mt.rectangle&&a?Eo(i,a,o):i.pos[1].add_(r);t.simpleObjects.get(n).visel.translate(et.obj2scaled(r,t.render.options)),this.data.d=r.negated(),this.data.noinvalidate||Rr.invalidateItem(t,"simpleObjects",n,1)}},{key:"invert",value:function(){return new n(this.data.id,this.data.d,this.data.current,this.data.anchor,this.data.noinvalidate,this.data.toCircle)}}]),n}(Rr);function So(t,e){var n=z.diff(e,t),r=Math.abs(n.x)<Math.abs(n.y)?n.x:n.y;return new z(t.x+(n.x>0?1:-1)*Math.abs(r),t.y+(n.y>0?1:-1)*Math.abs(r),0)}function jo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Ao=function(t){(0,u.Z)(n,t);var e=jo(n);function n(t,o){var a;return(0,r.Z)(this,n),a=e.call(this,Mr.S_GROUP_ATOM_ADD,3),(0,i.Z)((0,b.Z)(a),"data",void 0),a.data={sgid:t,aid:o},a}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.aid,r=e.sgid,o=t.molecule,i=o.atoms.get(n);if(o.sgroups.get(r).atoms.indexOf(n)>=0)throw new Error("The same atom cannot be added to an S-group more than once");if(!i)throw new Error("OpSGroupAtomAdd: Atom "+n+" not found");o.atomAddToSGroup(r,n),Rr.invalidateAtom(t,n)}},{key:"invert",value:function(){var t=new Po;return t.data=this.data,t}}]),n}(Rr),Po=function(t){(0,u.Z)(n,t);var e=jo(n);function n(t,o){var a;return(0,r.Z)(this,n),a=e.call(this,Mr.S_GROUP_ATOM_REMOVE,4),(0,i.Z)((0,b.Z)(a),"data",void 0),a.data={sgid:t,aid:o},a}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.aid,r=e.sgid,o=t.molecule,i=o.atoms.get(n),a=o.sgroups.get(r);at.removeAtom(a,n),i.sgs.delete(r),Rr.invalidateAtom(t,n)}},{key:"invert",value:function(){var t=new Ao;return t.data=this.data,t}}]),n}(Rr);var ko=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.S_GROUP_ATTR,4),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={sgid:t,attr:e,value:n},o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=t.molecule,n=this.data.sgid,r=e.sgroups.get(n),o=t.sgroupData.get(n);"DAT"===r.type&&o&&(t.clearVisel(o.visel),t.sgroupData.delete(n)),this.data.value=r.setAttr(this.data.attr,this.data.value)}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}}]),s}(Rr);var To=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e){var n;return(0,r.Z)(this,s),n=a.call(this,Mr.S_GROUP_DATA_MOVE),(0,i.Z)((0,b.Z)(n),"data",void 0),n.data={id:t,d:e},n}return(0,o.Z)(s,[{key:"execute",value:function(t){var e,n=this.data,r=n.d,o=n.id;null===(e=t.molecule.sgroups.get(o).pp)||void 0===e||e.add_(r),this.data.d=r.negated(),Rr.invalidateItem(t,"sgroupData",o,1)}},{key:"invert",value:function(){var t=new s;return t.data=this.data,t}}]),s}(Rr);function Co(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Ro=function(t){(0,u.Z)(n,t);var e=Co(n);function n(t,o,a){var s;return(0,r.Z)(this,n),s=e.call(this,Mr.S_GROUP_ADD_TO_HIERACHY,100),(0,i.Z)((0,b.Z)(s),"data",void 0),s.data={sgid:t,parent:o,children:a},s}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.sgid,r=e.parent,o=e.children,i=t.molecule,a=i.sgroups.get(n),s=i.sGroupForest.insert(a,r,o);this.data.parent=s.parent,this.data.children=s.children}},{key:"invert",value:function(){var t=new Mo;return t.data=this.data,t}}]),n}(Rr),Mo=function(t){(0,u.Z)(n,t);var e=Co(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.S_GROUP_REMOVE_FROM_HIERACHY,110),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={sgid:t},o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data.sgid,n=t.molecule;this.data.parent=n.sGroupForest.parent.get(e),this.data.children=n.sGroupForest.children.get(e),n.sGroupForest.remove(e)}},{key:"invert",value:function(){var t=new Ro;return t.data=this.data,t}}]),n}(Rr);function Io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var No=function(t){(0,u.Z)(n,t);var e=Io(n);function n(t,o,a,s,u){var c;return(0,r.Z)(this,n),c=e.call(this,Mr.S_GROUP_CREATE),(0,i.Z)((0,b.Z)(c),"data",void 0),c.data={sgid:t,type:o,pp:a,expanded:s,name:u},c}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=new at(this.data.type),r=this.data,o=r.sgid,i=r.pp,a=r.expanded,s=r.name;n.id=o,e.sgroups.set(o,n),i&&(e.sgroups.get(o).pp=new z(i)),a&&(n.data.expanded=a),s&&(n.data.name=s),t.sgroups.set(o,new cr(e.sgroups.get(o))),ht.isFunctionalGroup(n)&&t.molecule.functionalGroups.add(new ht(n)),this.data.sgid=o}},{key:"invert",value:function(){var t=new Bo;return t.data=this.data,t}}]),n}(Rr),Bo=function(t){(0,u.Z)(n,t);var e=Io(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.S_GROUP_DELETE,95),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={sgid:t},o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=this.data.sgid,r=t.sgroups.get(n),o=t.sgroupData.get(n);if(r){if(this.data.type=r.item.type,this.data.pp=r.item.pp,"DAT"===r.item.type&&o&&(t.clearVisel(o.visel),t.sgroupData.delete(n)),t.clearVisel(r.visel),0!==r.item.atoms.length)throw new Error("S-Group not empty!");var i;ht.isFunctionalGroup(r.item)&&(this.data.name=r.item.data.name,this.data.expanded=r.item.expanded,t.molecule.functionalGroups.forEach((function(t,e){t.relatedSGroupId===n&&(i=e)})),t.molecule.functionalGroups.delete(i)),t.sgroups.delete(n),e.sgroups.delete(n)}}},{key:"invert",value:function(){var t=new No;return t.data=this.data,t}}]),n}(Rr);function Zo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var Lo=function(t){(0,u.Z)(n,t);var e=Zo(n);function n(t,o,a){var s;return(0,r.Z)(this,n),s=e.call(this,Mr.TEXT_CREATE),(0,i.Z)((0,b.Z)(s),"data",void 0),s.data={content:t,position:o,id:a},s}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=new Pt(this.data);if(null==this.data.id){var r=e.texts.add(n);this.data.id=r}else e.texts.set(this.data.id,n);var o=this.data.id;t.texts.set(o,new wr(n)),e.textSetPosition(o,new z(this.data.position)),Rr.invalidateItem(t,"texts",o,1)}},{key:"invert",value:function(){return new Do(this.data.id)}}]),n}(Rr),Do=function(t){(0,u.Z)(n,t);var e=Zo(n);function n(t){var o;return(0,r.Z)(this,n),o=e.call(this,Mr.TEXT_DELETE),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={id:t},o}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=t.molecule,n=e.texts.get(this.data.id);n&&(this.data.content=n.content,this.data.position=n.position,t.markItemRemoved(),t.clearVisel(t.texts.get(this.data.id).visel),t.texts.delete(this.data.id),e.texts.delete(this.data.id))}},{key:"invert",value:function(){return new Lo(this.data.content,this.data.position,this.data.id)}}]),n}(Rr);var zo=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e){var n;return(0,r.Z)(this,s),n=a.call(this,Mr.TEXT_UPDATE),(0,i.Z)((0,b.Z)(n),"data",void 0),n.data={id:t,content:e},n}return(0,o.Z)(s,[{key:"execute",value:function(t){var e=this.data,n=e.id,r=e.content,o=t.molecule.texts.get(n);o&&(this.data.previousContent=o.content,o.content=r),Rr.invalidateItem(t,"texts",n,1)}},{key:"invert",value:function(){var t=new s(this.data.id,this.data.previousContent);return t.data.previousContent=this.data.content,t}}]),s}(Rr);var Fo=function(t){(0,u.Z)(s,t);var e,n,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var o=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,c.Z)(this,t)});function s(t,e,n){var o;return(0,r.Z)(this,s),o=a.call(this,Mr.TEXT_MOVE),(0,i.Z)((0,b.Z)(o),"data",void 0),o.data={id:t,d:e,noinvalidate:n},o}return(0,o.Z)(s,[{key:"execute",value:function(t){var e,n,r=t.molecule,o=this.data.id,i=this.data.d,a=r.texts.get(o);null==a||null===(e=a.position)||void 0===e||e.add_(i),null===(n=t.texts.get(o))||void 0===n||n.visel.translate(et.obj2scaled(i,t.render.options)),this.data.d=i.negated(),this.data.noinvalidate||Rr.invalidateItem(t,"texts",o,1)}},{key:"invert",value:function(){var t=new s(this.data.id,this.data.d,this.data.noinvalidate);return t.data=this.data,t}}]),s}(Rr),Go=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,r.Z)(this,t),(0,i.Z)(this,"operations",void 0),this.operations=e}return(0,o.Z)(t,[{key:"addOp",value:function(t,e){return e&&t.isDummy(e)||this.operations.push(t),t}},{key:"mergeWith",value:function(t){return this.operations=this.operations.concat(t.operations),this}},{key:"perform",value:function(e){var n=new t;return(0,v.Z)(this.operations).sort((function(t,e){return t.priority-e.priority})).forEach((function(t){var r=t.perform(e);n.addOp(r)})),n}},{key:"isDummy",value:function(t){return void 0===this.operations.find((function(e){return!t||!e.isDummy(t)}))}}]),t}();var Ho=["id","dist"];function Vo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Uo=.4,qo={atoms:Wo,bonds:Yo,enhancedFlags:function(t,e){var n,r=null;return t.enhancedFlags.forEach((function(o,i){var a=t.molecule.frags.get(i);if(a){var s=a.stereoFlagPosition?new z(a.stereoFlagPosition.x,a.stereoFlagPosition.y):tt.getDefaultStereoFlagPosition(t.molecule,i);if(s&&!(Math.abs(e.x-s.x)>=1)){var u=Math.abs(e.y-s.y);u<.3&&(!r||u<n)&&(r={id:i,dist:n=u})}}})),r},sgroupData:function(t,e){var n=null,r=null;return t.sgroupData.forEach((function(t,o){if("DAT"!==t.sgroup.type)throw new Error("Data group expected");if("MRV_IMPLICIT_H"!==t.sgroup.data.fieldName){var i=t.sgroup.dataArea,a=i.p0.y<e.y&&i.p1.y>e.y&&i.p0.x<e.x&&i.p1.x>e.x,s=Math.min(Math.abs(i.p0.x-e.x),Math.abs(i.p1.x-e.x));a&&(null===r||s<n)&&(r={id:o,dist:s},n=s)}})),r},sgroups:function(t,e){var n=null,r=Uo;return t.molecule.sgroups.forEach((function(t,o){if(t.functionalGroup&&!t.expanded){var i=t.firstSgroupAtom.pp,a=t.bracketDir,s=a.rotateSC(1,0),u=new z(z.dot(e,a),z.dot(e,s)),c=new z(.625,.625),l={p0:z.diff(i,c),p1:z.sum(i,c)},f=l.p0.y<u.y&&l.p1.y>u.y&&l.p0.x<u.x&&l.p1.x>u.x,h=Math.min(Math.abs(l.p0.x-u.x),Math.abs(l.p1.x-u.x));f&&(null===n||h<r)&&(n=o,r=h)}else{var d=t.bracketDir,p=d.rotateSC(1,0),v=new z(z.dot(e,d),z.dot(e,p));t.areas.forEach((function(t){var e=t.p0.y<v.y&&t.p1.y>v.y&&t.p0.x<v.x&&t.p1.x>v.x,i=Math.min(Math.abs(t.p0.x-v.x),Math.abs(t.p1.x-v.x));e&&(null===n||i<r)&&(n=o,r=i)}))}})),null!==n?{id:n,dist:r}:null},rxnArrows:function(t,e){var n=null,r=null,o=null;return t.rxnArrows.forEach((function(i,a){var s=i.calcDistance(e,t.render.options.scale);s.minDist<.3&&(!o||s.minDist<n)&&(n=s.minDist,r=s.refPoint,o={id:a,dist:n,ref:r})})),o},rxnPluses:function(t,e){var n=null,r=null;return t.rxnPluses.forEach((function(t,o){var i=t.item.pp,a=Math.max(Math.abs(e.x-i.x),Math.abs(e.y-i.y));a<.3&&(!r||a<n)&&(r={id:o,dist:n=a})})),r},frags:function(t,e,n,r,o){r=Math.min(r||Uo,Uo);var i=t.molecule,a=Wo(t,e,n,r);if(a)return{id:i.atoms.get(a.id).fragment,dist:a.dist};var s=Yo(t,e,n,r,o);if(s){var u=i.bonds.get(s.id).begin;return{id:i.atoms.get(u).fragment,dist:s.dist}}return null},rgroups:function(t,e,n,r){r=Math.min(r||Uo,Uo);var o=null;return t.rgroups.forEach((function(t,i){if(i!==n&&t.labelBox&&t.labelBox.contains(e,.5)){var a=z.dist(t.labelBox.centre(),e);(!o||a<r)&&(o={id:i,dist:r=a})}})),o},simpleObjects:function(t,e){var n=null,r=null,o=null;return t.simpleObjects.forEach((function(i,a){var s=i.calcDistance(e,t.render.options.scale);s.minDist<.3&&(!o||s.minDist<n)&&(n=s.minDist,r=s.refPoint,o={id:a,dist:n,ref:r})})),o},texts:function(t,e){var n=null,r=null;return t.texts.forEach((function(o,i){var a=o.getReferencePoints(t),s=a[0].x,u=a[0].y,c=a[2].x,l=a[2].y,f=[];e.x>=s&&e.x<=c&&(e.y<u?f.push(u-e.y):e.y>l?f.push(e.y-l):f.push(e.y-u,l-e.y)),e.x<s&&e.y<u&&f.push(z.dist(new z(s,u),e)),e.x>c&&e.y>l&&f.push(z.dist(new z(c,l),e)),e.x<s&&e.y>l&&f.push(z.dist(new z(s,l),e)),e.x>c&&e.y<u&&f.push(z.dist(new z(c,u),e)),e.y>=u&&e.y<=l&&(e.x<s?f.push(s-e.x):e.x>c?f.push(e.x-c):f.push(0));var h=Math.min.apply(Math,f);h<Uo&&(!r||h<n)&&(r={id:i,dist:n=h})})),r}};function Wo(t,e,n,r){var o=null,i=n&&"atoms"===n.map?n.id:null;return r=r||.4,r=Math.min(r,.4),t.atoms.forEach((function(t,n){if(n!==i){var a=z.dist(e,t.a.pp);a<r&&(o=n,r=a)}})),null!==o?{id:o,dist:r}:null}function Yo(t,e,n,r,o){var i=null,a=null,s=.32000000000000006,u=n&&"bonds"===n.map?n.id:null;r=r||s;var c=r=Math.min(r,s);return t.bonds.forEach((function(n,r){if(r!==u){var o=t.atoms.get(n.b.begin).a.pp,i=t.atoms.get(n.b.end).a.pp,s=z.lc2(o,.5,i,.5),l=z.dist(e,s);l<c&&(c=l,a=r)}})),t.bonds.forEach((function(n,o){if(o!==u){var a=t.molecule.halfBonds.get(n.b.hb1),s=a.dir,c=a.norm,l=t.atoms.get(n.b.begin).a.pp,f=t.atoms.get(n.b.end).a.pp;if(z.dot(e.sub(l),s)*z.dot(e.sub(f),s)<0){var h=Math.abs(z.dot(e.sub(l),c));h<r&&(i=o,r=h)}}})),null!==a?{id:a,dist:c}:null!==i&&r>Uo*o?{id:i,dist:r}:null}var $o={atom:Wo,item:function(t,e,n,r,o){return(n=n||Object.keys(qo)).reduce((function(n,a){var s=n?n.dist:null,u=qo[a](t,e,r,s,o);return null!==u&&(null===n||u.dist<n.dist)?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vo(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({map:a,id:u.id,dist:u.dist},(0,j.Z)(u,Ho)):n}),null)},merge:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["atoms","bonds"],r=arguments.length>3?arguments[3]:void 0,o={atoms:new Map,bonds:new Map},i=t.molecule;e.atoms.forEach((function(t){o.atoms.set(t,i.atoms.get(t).pp)})),e.bonds.forEach((function(t){var e=i.bonds.get(t);o.bonds.set(t,z.lc2(i.atoms.get(e.begin).pp,.5,i.atoms.get(e.end).pp,.5))}));var a={};return n.forEach((function(n){a[n]=Array.from(o[n].keys()).reduce((function(i,a){var s={map:n,id:a},u=qo[n](t,o[n].get(a),s,null,r);return u&&!e[n].includes(u.id)&&i.set(a,u.id),i}),new Map)})),a}};function Ko(t,e,n){return t.molecule.atoms.get(e)[n]}function Jo(t,e){return t.atoms.get(e).a.neighbors.length}function Xo(t,e){return Array.from(t.atoms.get(e).a.sgs)}function Qo(t,e){return t.molecule.atoms.get(e).pp}function ti(t,e){return e.filter((function(e){return null!==t.atoms.get(e).stereoLabel}))}function ei(t){return["atoms","bonds","frags","sgroups","rgroups","rxnArrows","rxnPluses","simpleObjects","texts"].reduce((function(e,n){return e[n]=Array.from(t[n].keys()),e}),{})}function ni(t,e,n){var r,o=[],i=Qo(t,e),a=t.molecule.findBondId(e,t.molecule.atomGetNeighbors(e)[0].aid),s=t.molecule.bonds.get(a).type;t.molecule.atomGetNeighbors(e).forEach((function(e){var n=Qo(t,e.aid);z.dist(i,n)<.1||o.push({id:e.aid,v:z.diff(n,i)})})),o.sort((function(t,e){return Math.atan2(t.v.y,t.v.x)-Math.atan2(e.v.y,e.v.x)}));var u,c=0,l=0;for(r=0;r<o.length;r++)(u=z.angle(o[r].v,o[(r+1)%o.length].v))<0&&(u+=2*Math.PI),u>l&&(c=r,l=u);var f=new z(1,0);if(o.length>0){if(1===o.length){l=-4*Math.PI/3;var h=t.molecule.atomGetNeighbors(e)[0];if(Jo(t,h.aid)>1){var d=[],p=Qo(t,h.aid),v=z.diff(i,p),m=Math.atan2(v.y,v.x);t.molecule.atomGetNeighbors(h.aid).forEach((function(e){var n=Qo(t,e.aid);if(!(e.bid===h.bid||z.dist(p,n)<.1)){var r=z.diff(n,p),o=Math.atan2(r.y,r.x)-m;o<0&&(o+=2*Math.PI),d.push(o)}})),d.sort((function(t,e){return t-e})),d[0]<=1.01*Math.PI&&d[d.length-1]<=1.01*Math.PI&&(l*=-1)}}if(1===o.length&&s===(null==n?void 0:n.type)&&((null==n?void 0:n.type)===$.PATTERN.TYPE.DOUBLE||(null==n?void 0:n.type)===$.PATTERN.TYPE.TRIPLE)||s===$.PATTERN.TYPE.SINGLE&&(null==n?void 0:n.type)===$.PATTERN.TYPE.TRIPLE||s===$.PATTERN.TYPE.TRIPLE&&(null==n?void 0:n.type)===$.PATTERN.TYPE.SINGLE){var g=t.molecule.bonds.get(a).angle;u=g>-90&&g<90&&o[0].v.x>0?g*Math.PI/180+Math.PI:g*Math.PI/180}else u=l/2+Math.atan2(o[c].v.y,o[c].v.x);f=f.rotate(u)}f.add_(i);var y=$o.atom(t,f,null,.1);return{atom:y=null===y?{label:"C"}:y.id,pos:f}}function ri(t,e){return t.molecule.sgroups.filter((function(t,n){return!n.data.attached&&!n.data.absolute&&0===(0,R.difference)(n.atoms,e).length}))}function oi(t,e,n){var r=new Go;return Object.keys(n).forEach((function(t){r.addOp(new so(e,t,n[t]))})),r.perform(t)}function ii(t,e,n){var r=new Go;return r.addOp(new uo(e,n)),r.perform(t)}function ai(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=new Go;return t.molecule.rgroups.get(n)||o.addOp(new Kr(e,n,r)),o.perform(t)}function si(t,e,n,r){var o=r.fieldValue;return"string"==typeof o||"DAT"!==e?fi(t,e,n,r,t.molecule.sgroups.newId()):o.reduce((function(o,i){var a=Object.assign({},r);return a.fieldValue=i,o.mergeWith(fi(t,e,n,a,t.molecule.sgroups.newId()))}),new Go)}function ui(t,e,n){var r=new Go;Object.keys(n).forEach((function(t){r.addOp(new ko(e,t,n[t]))}));var o=t.molecule.sgroups.get(e);return o.firstSgroupAtom&&delete o.firstSgroupAtom,at.getAtoms(t,o).forEach((function(e){r.mergeWith(Si(t,e,t.atoms.get(e).a,!1))})),r.perform(t)}function ci(t,e){var n=new Go;return Object.keys(e).forEach((function(r){n.addOp(new ko(t,r,e[r]))})),n}function li(t,e){var n=new Go,r=t.molecule,o=t.sgroups.get(e).item;"SRU"===o.type&&(r.sGroupsRecalcCrossBonds(),o.neiAtoms.forEach((function(e){"*"===Ko(t,e,"label")&&n.addOp(new Ir(e,"label","C"))})));var i=r.sgroups.get(e),a=at.getAtoms(r,i),s=i.getAttrs();return n.addOp(new Mo(e)),a.forEach((function(t){n.addOp(new Po(e,t))})),n.addOp(new Bo(e)),(n=n.perform(t)).mergeWith(ci(e,s)),n}function fi(t,e,n,r,o,i,a,s){var u=new Go;if(o=o-0===o?o:t.molecule.sgroups.newId(),"SUP"===e?u.addOp(new No(o,e,i,a,s)):u.addOp(new No(o,e,i)),n.forEach((function(t){u.addOp(new Ao(o,t))})),u.addOp("DAT"!==e?new Ro(o):new Ro(o,-1,[])),u=u.perform(t),"SRU"===e){t.molecule.sGroupsRecalcCrossBonds();var c=new Go;t.sgroups.get(o).item.neiAtoms.forEach((function(e){var n=t.atoms.get(e).a.isPlainCarbon();1===Jo(t,e)&&n&&c.addOp(new Ir(e,"label","*"))})),(c=c.perform(t)).mergeWith(u),u=c}return function(t,e,n){var r=new Go;return Object.keys(n).forEach((function(t){r.addOp(new ko(e,t,n[t]))})),r.perform(t)}(t,o,r).mergeWith(u)}function hi(t,e,n,r,o){if(t===ya.Bond)return function(t,e,n,r){var o=t.molecule,i=mi(o,n);return r.bonds&&(i=(0,C.uniq)(i.concat(r.bonds))),i.reduce((function(n,r){var i=o.bonds.get(r);return n.action=n.action.mergeWith(si(t,e.type,[i.begin,i.end],e.attrs)),n.selection.bonds.push(r),n}),{action:new Go,selection:{atoms:n,bonds:[]}})}(e,n,r,o);var i,a=(i=e.molecule,(o.bonds||[]).reduce((function(t,e){var n=i.bonds.get(e);return t.concat([n.begin,n.end])}),[])),s=(0,C.uniq)(r.concat(a));return t===ya.Fragment?di(e,n,s,Array.from(e.atoms.keys())):t===ya.Multifragment?function(t,e,n){var r=mi(t.molecule,n);return{action:si(t,e.type,n,e.attrs),selection:{atoms:n,bonds:r}}}(e,n,s):t===ya.Group?di(e,n,s,s):t===ya.Atom?function(t,e,n){return n.reduce((function(n,r){return n.action=n.action.mergeWith(si(t,e.type,[r],e.attrs)),n}),{action:new Go,selection:{atoms:n,bonds:[]}})}(e,n,s):{action:si(e,n.type,r,n.attrs)}}function di(t,e,n,r){var o=new V(n.map((function(e){return t.atoms.get(e).a.fragment})));return Array.from(o).reduce((function(n,o){var i=r.reduce((function(e,n){var r=t.atoms.get(n).a;return o===r.fragment&&e.push(n),e}),[]),a=mi(t.molecule,i);return n.action=n.action.mergeWith(si(t,e.type,i,e.attrs)),n.selection.atoms=n.selection.atoms.concat(i),n.selection.bonds=n.selection.bonds.concat(a),n}),{action:new Go,selection:{atoms:[],bonds:[]}})}function pi(t,e,n){var r=Xo(e,n);return r.length>0&&(r.forEach((function(e){t.addOp(new Po(e,n))})),!0)}function vi(t,e,n){var r=e.molecule,o=new Map;n.forEach((function(t){Xo(e,t).forEach((function(t){o.set(t,o.has(t)?o.get(t)+1:1)}))})),o.forEach((function(n,o){var i=e.sgroups.get(o).item;if(at.getAtoms(e.molecule,i).length===n){var a=r.sgroups.get(o);t.mergeWith(ci(o,a.getAttrs())),t.addOp(new Mo(o)),t.addOp(new Bo(o))}}))}function mi(t,e){var n=new V(e);return Array.from(t.bonds.keys()).filter((function(e){var r=t.bonds.get(e);return n.has(r.begin)&&n.has(r.end)}))}function gi(t,e,n,r,o,i){var a;if(void 0===r){var s=ni(t,n,e);r=s.atom,o=s.pos}var u=new Go,c=t.molecule,l=!1,f=null;"number"!=typeof n?"number"==typeof r&&(f=Ko(t,r,"fragment")):(f=Ko(t,n,"fragment"),"number"==typeof r&&(l=!0)),null==f&&(f=u.addOp((new Qr).perform(t)).frid),"number"!=typeof n?(n.fragment=f,n=u.addOp(new Zr(n,o).perform(t)).data.aid,"number"==typeof r&&ki(u,t,[n],r),o=i):"*"===Ko(t,n,"label")&&u.addOp(new Ir(n,"label","C").perform(t)),"number"!=typeof r?(r.fragment=f,r=u.addOp(new Zr(r,o).perform(t)).data.aid,"number"==typeof n&&ki(u,t,[r],n)):"*"===Ko(t,r,"label")&&u.addOp(new Ir(r,"label","C").perform(t));var h=u.addOp(new Gr(n,r,e).perform(t)).data.bid,d=c.bonds.get(h);return d&&(u.addOp(new io([d.begin,d.end]).perform(t)),u.mergeWith(bi(t,d))),u.operations.reverse(),l&&Pi(u,t,n,r),null!==(a=c.frags.get(f||0))&&void 0!==a&&a.stereoAtoms&&!e.stereo&&u.addOp(new oo(f||0).perform(t)),[u,n,r,h]}function yi(t,e,n,r){var o=t.molecule,i=new Go;return(Array.isArray(e)?e:[e]).forEach((function(e){Object.keys($.attrlist).forEach((function(a){if(a in n||r){var s=a in n?n[a]:$.attrGetDefault(a);if(i.addOp(new Dr(e,a,s).perform(t)),"stereo"===a&&a in n){var u=o.bonds.get(e);u&&(i.addOp(new io([u.begin,u.end]).perform(t)),i.mergeWith(bi(t,u)))}}}))})),i}function bi(t,e,n){var r,o,i=new Go,a=t.molecule,s=null===(r=a.atoms.get(null==e?void 0:e.begin))||void 0===r?void 0:r.fragment,u=null===(o=a.atoms.get(null==e?void 0:e.end))||void 0===o?void 0:o.fragment,c=[];return a.bonds.forEach((function(t){var e,n;(null===(e=a.atoms.get(t.begin))||void 0===e?void 0:e.fragment)===s&&c.push(t),s!==u&&(null===(n=a.atoms.get(t.begin))||void 0===n?void 0:n.fragment)===u&&c.push(t)})),wi(a,c,e).forEach((function(e,r){var o;(null===(o=a.atoms.get(r))||void 0===o?void 0:o.stereoLabel)!==e.stereoLabel&&i.mergeWith(function(t,e,n,r){var o=new Go,i=t.molecule.atoms.get(e);if(i){var a=i.fragment;"stereoParity"in n&&o.addOp(new Ir(e,"stereoParity",n.stereoParity).perform(t)),"stereoLabel"in n&&(o.addOp(new Ir(e,"stereoLabel",n.stereoLabel).perform(t)),null===n.stereoLabel?o.addOp(new ro(a,e).perform(t)):o.addOp(new no(a,e).perform(t))),r&&o.operations.reverse()}return o}(t,r,e,n))})),i}function wi(t,e,n){var r=new Map,o=[];return e.forEach((function(e){if(e){var n=t.atomGetNeighbors(e.begin),i=t.atomGetNeighbors(e.end);if(nt(e,n,i,t)){var a,s,u=null===(a=t.atoms.get(e.begin))||void 0===a?void 0:a.stereoLabel;null!=u&&null!=(null===(s=r.get(e.begin))||void 0===s?void 0:s.stereoLabel)||r.set(e.begin,{stereoParity:xi(e.stereo),stereoLabel:u||"".concat(H.Abs)}),o.push(e.begin)}else o.includes(e.begin)||r.set(e.begin,{stereoParity:W.PATTERN.STEREO_PARITY.NONE,stereoLabel:null}),o.includes(e.end)||r.set(e.end,{stereoParity:W.PATTERN.STEREO_PARITY.NONE,stereoLabel:null})}})),n&&(o.includes(n.begin)||r.set(n.begin,{stereoParity:W.PATTERN.STEREO_PARITY.NONE,stereoLabel:null}),o.includes(n.end)||r.set(n.end,{stereoParity:W.PATTERN.STEREO_PARITY.NONE,stereoLabel:null})),r}function xi(t){var e=null;switch(t){case $.PATTERN.STEREO.UP:e=W.PATTERN.STEREO_PARITY.ODD;break;case $.PATTERN.STEREO.EITHER:e=W.PATTERN.STEREO_PARITY.EITHER;break;case $.PATTERN.STEREO.DOWN:e=W.PATTERN.STEREO_PARITY.EVEN}return e}function Oi(t,e,n,r){var o=new Go,i=e;(r.stereo!==$.PATTERN.STEREO.NONE&&r.type===$.PATTERN.TYPE.SINGLE||n.type===$.PATTERN.TYPE.DATIVE)&&n.type===r.type&&n.stereo===r.stereo&&(o.mergeWith(function(t,e){var n=t.molecule.bonds.get(e),r=new Go;return r.addOp(new Hr(e).perform(t)),Number.isInteger(null==n?void 0:n.end)&&Number.isInteger(null==n?void 0:n.begin)&&r.addOp(new Gr(null==n?void 0:n.end,null==n?void 0:n.begin,n).perform(t)),r}(t,e)),i=o.operations[1].data.bid);var a=Ei.includes(r.type)?Ei:null;return r.stereo===$.PATTERN.STEREO.NONE&&r.type===$.PATTERN.TYPE.SINGLE&&n.stereo===$.PATTERN.STEREO.NONE&&a&&(r.type=a[(a.indexOf(n.type)+1)%a.length]),yi(t,i,r).mergeWith(o)}var Ei=[$.PATTERN.TYPE.SINGLE,$.PATTERN.TYPE.DOUBLE,$.PATTERN.TYPE.TRIPLE];function _i(t,e,n){n=Object.assign({},n);var r=new Go;n.fragment=r.addOp((new Qr).perform(t)).frid;var o=r.addOp(new Zr(n,e).perform(t)).data.aid;return r.addOp(new io([o]).perform(t)),r}function Si(t,e,n,r){var o=new Go;return(Array.isArray(e)?e:[e]).forEach((function(e){var i;Object.keys(W.attrlist).forEach((function(i){if(("attpnt"!==i||i in n)&&(i in n||r)){var a=i in n?n[i]:W.attrGetDefault(i);switch(i){case"stereoLabel":case"stereoParity":i in n&&a&&o.addOp(new Ir(e,i,a).perform(t));break;default:o.addOp(new Ir(e,i,a).perform(t))}}})),r||!("label"in n)||null===n.label||"L#"===n.label||n.atomList||o.addOp(new Ir(e,"atomList",null).perform(t)),o.addOp(new io([e]).perform(t));var a=t.molecule.atomGetNeighbors(e),s=t.molecule.bonds.get(null===(i=a[0])||void 0===i?void 0:i.bid);s&&o.mergeWith(bi(t,s))})),o}function ji(t,e,n){var r=new Go;return e.forEach((function(e){var o=t.molecule.atoms.get(e),i=o.fragment;r.addOp(new Ir(e,"fragment",n)),null!==o.stereoLabel&&(r.addOp(new no(n,e)),r.addOp(new ro(i,e)))})),r.perform(t)}function Ai(t,e,n){var r,o;if(e===n)return new Go;var i=new Go;Pi(i,t,e,n);var a=new Go,s=t.molecule.atomGetNeighbors(e);s.forEach((function(e){var r=t.molecule.bonds.get(e.bid);if(n!==r.begin&&n!==r.end){var o=r.begin===e.aid?e.aid:n,i=r.begin===e.aid?n:e.aid,s=t.molecule.findBondId(o,i);if(null===s)a.addOp(new Gr(o,i,r));else{var u=$.getAttrHash(r);Object.keys(u).forEach((function(t){a.addOp(new Dr(s,t,u[t]))}))}a.addOp(new Hr(e.bid))}else a.addOp(new Hr(e.bid))}));var u=W.getAttrHash(t.molecule.atoms.get(e));1===Jo(t,e)&&"*"===u.label&&(u.label="C"),Object.keys(u).forEach((function(t){"stereoLabel"!==t&&"stereoParity"!==t&&a.addOp(new Ir(n,t,u[t]))})),pi(a,t,e)&&vi(a,t,[e]),a.addOp(new Lr(e)),a.addOp(new io([n]));var c=t.molecule.atomGetNeighbors(n),l=t.molecule.bonds.get((null===(r=c[0])||void 0===r?void 0:r.bid)||(null===(o=s[0])||void 0===o?void 0:o.bid));return a.perform(t).mergeWith(i).mergeWith(bi(t,l))}function Pi(t,e,n,r){var o=Ko(e,n,"fragment"),i=Ko(e,r,"fragment");if(i!==o&&"number"==typeof i){var a=e.molecule,s=vt.findRGroupByFragment(a.rgroups,i);void 0!==s&&t.mergeWith(ii(e,null,i)).mergeWith(ai(e,0,s));var u=a.getFragmentIds(o),c=[];a.atoms.forEach((function(t,e){t.fragment===i&&c.push(e)}));var l=ji(e,c,o);ki(t,e,u,r),t.addOp(new to(i).perform(e)),t.mergeWith(l)}}function ki(t,e,n,r){Xo(e,r).forEach((function(r){var o=e.molecule.sgroups.get(r);"DAT"===o.type&&["Atom","Bond","Group"].includes(o.data.context)||(0,C.without)(o.atoms,n).forEach((function(n){return t.addOp(new Ao(r,n).perform(e))}))}))}function Ti(t,e){var n=new Go;return n.addOp(new Vr(e)),n.perform(t)}function Ci(t){var e=new Go;return e.addOp(new qr),e.perform(t)}function Ri(t,e,n,r,o){var i=Math.cos(Math.PI/6),a=Math.sin(Math.PI/6),s=new Go,u=null!==o?Ko(t,o,"fragment"):s.addOp((new Qr).perform(t)).frid,c={atoms:[],bonds:[]},l=null!==o?o:s.addOp(new Zr({label:"C",fragment:u},e).perform(t)).data.aid;c.atoms.push(l),s.operations.reverse();for(var f=0;f<r;f++){var h=gi(t,{},l,{},new z(i*(f+1),1&f?0:a).rotate(n).add(e));s=h[0].mergeWith(s),l=h[2],c.bonds.push(h[3]),c.atoms.push(l)}return[s,c]}function Mi(t,e){var n=new Go;if(!e)return n;var r=new Set;return e.atoms.forEach((function(e,o){r.has(e)||r.has(o)||(n=Ai(t,o,e).mergeWith(n),r.add(e).add(o))})),n=function(t,e){var n=t.molecule,r=new Map,o=new Go;return e.forEach((function(t,e){var o=n.bonds.get(e),i=n.bonds.get(t);if(o&&i){var a=Tr.mergeBondsParams(n,o,n,i);a.merged&&(r.set(o.begin,a.cross?i.end:i.begin),r.set(o.end,a.cross?i.begin:i.end))}})),r.forEach((function(e,n){o=Ai(t,n,e).mergeWith(o)})),o}(t,e.bonds).mergeWith(n),n}function Ii(t,e){var n=t.render.ctab.molecule,r=e||{atoms:Array.from(n.atoms.keys()),bonds:Array.from(n.bonds.keys())};return function(t,e){var n={atoms:new Map(e.atoms),bonds:new Map(e.bonds)};return e.bonds.forEach((function(e,r){var o=t.bonds.get(r),i=t.bonds.get(e);Tr.mergeBondsParams(t,o,t,i).merged?(n.atoms.delete(o.begin),n.atoms.delete(o.end)):n.bonds.delete(r)})),0===n.atoms.size&&0===n.bonds.size?null:n}(n,t.findMerge(r,["atoms","bonds"]))}function Ni(t){if(!t)return null;var e={atoms:Array.from(t.atoms.values()),bonds:Array.from(t.bonds.values())};return{map:"merge",id:+Date.now(),items:e}}function Bi(t,e,n){n=new z(n);var r=new Go,o=t.molecule,i=new V,a=new V;if(e.atoms){var s=new V(e.atoms),u=[];t.bonds.forEach((function(t,e){if(s.has(t.b.begin)&&s.has(t.b.end))return u.push(e),void["hb1","hb2"].forEach((function(e){var n=o.halfBonds.get(t.b[e]).loop;n>=0&&i.add(n)}));s.has(t.b.begin)?a.add(t.b.begin):s.has(t.b.end)&&a.add(t.b.end)})),u.forEach((function(t){r.addOp(new zr(t,n))})),i.forEach((function(e){t.reloops.get(e)&&t.reloops.get(e).visel&&r.addOp(new ao(e,n))})),e.atoms.forEach((function(t){r.addOp(new Nr(t,n,!a.has(t)))})),e.sgroupData&&0===e.sgroupData.length&&ri(t,e.atoms).forEach((function(t){r.addOp(new To(t.id,n))}))}return e.rxnArrows&&e.rxnArrows.forEach((function(t){r.addOp(new co(t,n,!0))})),e.rxnPluses&&e.rxnPluses.forEach((function(t){r.addOp(new fo(t,n,!0))})),e.simpleObjects&&e.simpleObjects.forEach((function(t){r.addOp(new Oo(t,n,!0))})),e.sgroupData&&e.sgroupData.forEach((function(t){r.addOp(new To(t,n))})),e.enhancedFlags&&e.enhancedFlags.forEach((function(t){r.addOp(new Yr(t,n))})),e.texts&&e.texts.forEach((function(t){r.addOp(new Fo(t,n,!0))})),r.perform(t)}function Zi(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=new Go;if(!n){var o=t.molecule,i=t.molecule.frags.get(e);i.stereoAtoms.forEach((function(t){null===o.atoms.get(t).stereoLabel&&r.addOp(new ro(e,t))}))}return r.addOp(new oo(e)),r.perform(t)}function Li(t,e,n,r){for(var o=[e],i=new V(o);o.length>0;){var a=o.shift();t.molecule.atomGetNeighbors(a).forEach((function(e){t.molecule.atoms.get(e.aid).fragment!==n||i.has(e.aid)||(i.add(e.aid),o.push(e.aid))}))}return ji(t,i,r)}function Di(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=new Go,o=vt.findRGroupByFragment(t.molecule.rgroups,e);return t.molecule.atoms.forEach((function(n,i){if(n.fragment===e){var a=r.addOp((new Qr).perform(t)).frid;r.mergeWith(Li(t,i,e,a)),o&&r.mergeWith(ii(t,o,a))}})),-1!==e&&(r.mergeWith(ii(t,0,e)),r.addOp(new to(e).perform(t)),r.mergeWith(ai(t,0,o,n))),r.operations.reverse(),r}function zi(t,e){return Hi(t,{atoms:[e]})}function Fi(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=new Go,o=t.molecule.bonds.get(e),i=[];return r.addOp(new Hr(e)),n.includes(o.begin)||1!==Jo(t,o.begin)||(pi(r,t,o.begin)&&i.push(o.begin),r.addOp(new Lr(o.begin))),n.includes(o.end)||1!==Jo(t,o.end)||(pi(r,t,o.end)&&i.push(o.end),r.addOp(new Lr(o.end))),vi(r,t,i),(r=r.perform(t)).addOp(new io([o.begin,o.end]).perform(t)),r.mergeWith(bi(t,o,!1)),r.operations.reverse(),r}function Gi(t,e){var n=t.molecule.getBondFragment(e),r=Fi(t,e);return Di(t,n).mergeWith(r)}function Hi(t,e){s()(null!=!!e);var n=new Go,r=[],o=[];e={atoms:e.atoms||[],bonds:e.bonds||[],rxnPluses:e.rxnPluses||[],rxnArrows:e.rxnArrows||[],sgroupData:e.sgroupData||[],simpleObjects:e.simpleObjects||[],texts:e.texts||[]};var i=new Go;t.molecule.sgroups.forEach((function(n,r){(e.sgroupData.includes(r)||new V(e.atoms).isSuperset(new V(n.atoms)))&&i.mergeWith(li(t,r))})),e.atoms.forEach((function(n){t.molecule.atomGetNeighbors(n).forEach((function(t){-1===e.bonds.indexOf(t.bid)&&(e.bonds=e.bonds.concat([t.bid]))}))}));var a=new Go;e.bonds.forEach((function(n){var r=t.molecule.getBondFragment(n);o.indexOf(r)<0&&o.push(r),a.mergeWith(Fi(t,n,e.atoms))})),e.atoms.forEach((function(e){var i=t.molecule.atoms.get(e).fragment;o.indexOf(i)<0&&o.push(i),pi(n,t,e)&&r.push(e),n.addOp(new Lr(e))})),vi(n,t,r),e.rxnArrows.forEach((function(t){n.addOp(new yo(t))})),e.rxnPluses.forEach((function(t){n.addOp(new vo(t))})),e.simpleObjects.forEach((function(t){n.addOp(new xo(t))})),e.texts.forEach((function(t){n.addOp(new Do(t))})),(n=n.perform(t)).mergeWith(a);for(var u=o.map((function(e){return vt.findRGroupByFragment(t.molecule.rgroups,e)}));o.length>0;)n=Di(t,o.pop(),u).mergeWith(n);return n.mergeWith(i),n}function Vi(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=Ui(e),i=z.diff(n,o),a=new Go,s=new Map,u=new Map,c={atoms:[],bonds:[]};return e.atoms.forEach((function(e,i){u.has(e.fragment)||u.set(e.fragment,a.addOp((new Qr).perform(t)).frid);var l=Object.assign(e.clone(),{fragment:u.get(e.fragment)}),f=new Zr(l,z.diff(e.pp,o).rotate(r).add(n)).perform(t);a.addOp(f),s.set(i,f.data.aid),c.atoms.push(f.data.aid)})),e.frags.forEach((function(e,n){e&&e.stereoAtoms.forEach((function(e){return a.addOp(new no(u.get(n),s.get(e)).perform(t))}))})),e.bonds.forEach((function(e){var n=new Gr(s.get(e.begin),s.get(e.end),e).perform(t);a.addOp(n),c.bonds.push(n.data.bid)})),e.sgroups.forEach((function(e){var n=t.molecule.sgroups.newId(),r=e.atoms.map((function(t){return s.get(t)}));fi(t,e.type,r,e.data,n,e.pp?e.pp.add(i):null,"SUP"===e.type?e.data.expanded:null,e.data.name).operations.reverse().forEach((function(t){a.addOp(t)}))})),e.rxnArrows.forEach((function(e){a.addOp(new go(e.pos.map((function(t){return t.add(i)})),e.mode).perform(t))})),e.rxnPluses.forEach((function(e){a.addOp(new po(e.pp.add(i)).perform(t))})),e.simpleObjects.forEach((function(e){a.addOp(new wo(e.pos.map((function(t){return t.add(i)})),e.mode).perform(t))})),e.texts.forEach((function(e){a.addOp(new Lo(e.content,e.position.add(i)).perform(t))})),e.rgroups.forEach((function(n,r){n.frags.forEach((function(e,n){a.addOp(new uo(r,u.get(n)).perform(t))}));var o=e.rgroups.get(r).ifthen,i=e.rgroups.get(o)?o:0;a.mergeWith(oi(t,r,n.getAttrs())).mergeWith(ai(t,i,n.ifthen))})),a.operations.reverse(),[a,c]}function Ui(t){var e=t.sgroups.keys().next().value;if(1===t.sgroups.size&&!t.sgroups.get(e).data.expanded)return t.atoms.get(0).pp;if(t.atoms.size>0){var n=1e50,r=n,o=-n,i=-r;return t.atoms.forEach((function(t){n=Math.min(n,t.pp.x),r=Math.min(r,t.pp.y),o=Math.max(o,t.pp.x),i=Math.max(i,t.pp.y)})),new z((n+o)/2,(r+i)/2)}return t.rxnArrows.size>0?t.rxnArrows.get(0).center():t.rxnPluses.size>0?t.rxnPluses.get(0).pp:t.simpleObjects.size>0?t.simpleObjects.get(0).center():t.texts.size>0?t.texts.get(0).position:null}function qi(t,e,n){var r=new Go;return r.addOp(new go(e,n)),r.perform(t)}function Wi(t,e,n,r,o){var i=new Go;return i.addOp(new lo(e,n,r,o,!1)),i.perform(t)}function Yi(t,e){var n=new Go;return n.addOp(new yo(e)),n.perform(t)}function $i(t,e){var n=new Go;return n.addOp(new po(e).perform(t)),n}function Ki(t,e){var n=new Go;return n.addOp(new vo(e)),n.perform(t)}function Ji(t,e,n,r){var o=t.molecule,i=new Go;if(e||(e=ei(o)),!e.atoms)return i.perform(t);var a=e.atoms.reduce((function(t,e){var n=o.atoms.get(e);return t[n.fragment]||(t[n.fragment]=[]),t[n.fragment].push(e),t}),{});return"number"==typeof Object.keys(a).map((function(t){return parseInt(t,10)})).find((function(t){var e=o.getFragmentIds(t),n=new V(a[t]);return!e.equals(n)}))?i:(Object.keys(a).forEach((function(e){var s=new V(a[e]),u=o.getCoordBoundingBox(s),c=r||new z((u.max.x+u.min.x)/2,(u.max.y+u.min.y)/2);s.forEach((function(t){var e=Xi(o.atoms.get(t),c,n);i.addOp(new Nr(t,e))})),ri(t,Array.from(s)).forEach((function(t){var e=Xi(t,c,n);i.addOp(new To(t.id,e))}))})),e.bonds&&e.bonds.forEach((function(t){var e=o.bonds.get(t);e.type===$.PATTERN.TYPE.SINGLE&&(e.stereo!==$.PATTERN.STEREO.UP?e.stereo===$.PATTERN.STEREO.DOWN&&i.addOp(new Dr(t,"stereo",$.PATTERN.STEREO.UP)):i.addOp(new Dr(t,"stereo",$.PATTERN.STEREO.DOWN)))})),i.perform(t))}function Xi(t,e,n){var r=new z;return"horizontal"===n?r.x=e.x>t.pp.x?2*(e.x-t.pp.x):-2*(t.pp.x-e.x):r.y=e.y>t.pp.y?2*(e.y-t.pp.y):-2*(t.pp.y-e.y),r}function Qi(t,e,n,r){var o=t.molecule,i=new Go;e||(e=ei(o)),e.atoms&&(e.atoms.forEach((function(t){var e=o.atoms.get(t);i.addOp(new Nr(t,ea(e.pp,n,r)))})),e.sgroupData||ri(t,e.atoms).forEach((function(t){i.addOp(new To(t.id,ea(t.pp,n,r)))}))),e.rxnArrows&&e.rxnArrows.forEach((function(t){var e=o.rxnArrows.get(t);i.addOp(new co(t,ea(e.center(),n,r)))})),e.rxnPluses&&e.rxnPluses.forEach((function(t){var e=o.rxnPluses.get(t);i.addOp(new fo(t,ea(e.pp,n,r)))})),e.sgroupData&&e.sgroupData.forEach((function(t){var e=o.sgroups.get(t);i.addOp(new To(t,ea(e.pp,n,r)))}));var a=e.enhancedFlags||Array.from(t.enhancedFlags.keys());return a&&a.forEach((function(e){var o=e,a=t.molecule.frags.get(o);i.addOp(new Yr(e,ea(a.stereoFlagPosition||tt.getDefaultStereoFlagPosition(t.molecule,o),n,r)))})),i.perform(t)}function ta(t,e,n){var r=t.molecule,o=r.bonds.get(e),i=r.atoms.get(o.begin),a=r.atoms.get(o.end),s=i.pp.add(a.pp).scaled(.5),u=Tr.calcAngle(i.pp,a.pp),c=Array.from(r.getFragmentIds(i.fragment));return 0==(u="horizontal"===n?-u:Math.PI/2-u)||Math.abs(u)===Math.PI?Ji(t,{atoms:c},n,s):Qi(t,{atoms:c},s,u)}function ea(t,e,n){var r=t.sub(e);return(r=r.rotate(n)).add_(e),r.sub(t)}function na(t,e){var n=new Go;return n.addOp(new xo(e)),n.perform(t)}function ra(t,e,n,r){var o=new Go;return o.addOp(new wo(e,n,r)),o.perform(t)}function oa(t,e,n,r,o,i){var a=new Go;return a.addOp(new _o(e,n,r,o,!1,i)),a.perform(t)}function ia(t,e,n,r){var o=Vi(t,e.molecule,n,r),i=(0,y.Z)(o,2),a=i[0],s=i[1];return a.addOp(new io(s.atoms).perform(t)),[a,s]}function aa(t,e,n,r,o){var i=new Go,a=e.molecule,s=t.molecule,u=s.atoms.get(n),c=n,l=null;if(o){var f=function(t,e,n){var r=new Go,o=Ko(t,e,"fragment"),i=null;if(null===n){var a=ni(t,e),s=gi(t,{type:1},e,a.atom,a.pos.get_xy0());(r=s[0]).operations.reverse(),i=s[2]}else{var u=new Zr({label:"C",fragment:o},new z(1,0).rotate(n).add(t.molecule.atoms.get(e).pp).get_xy0()).perform(t);r.addOp(u),r.addOp(new Gr(e,u.data.aid,{type:1}).perform(t)),i=u.data.aid}return{action:r,aid1:i}}(t,n,r);i=f.action,c=f.aid1,u=s.atoms.get(c),l=Tr.calcAngle(s.atoms.get(n).pp,u.pp)-e.angle0}else null===r&&(r=Tr.calcAngle(u.pp,ni(t,n).pos)),l=r-e.angle0;var h=new Map,d=a.atoms.get(e.aid).pp,p=Ko(t,n,"fragment"),v={atoms:[],bonds:[]};return a.atoms.forEach((function(n,r){var o=W.getAttrHash(n);if(o.fragment=p,r===e.aid)i.mergeWith(Si(t,c,o,!0)),h.set(r,c),v.atoms.push(c);else{var a=z.diff(n.pp,d).rotate(l).add(u.pp),s=new Zr(o,a.get_xy0()).perform(t);i.addOp(s),h.set(r,s.data.aid),v.atoms.push(s.data.aid)}})),ki(i,t,v.atoms,n),a.bonds.forEach((function(e){var n=new Gr(h.get(e.begin),h.get(e.end),e).perform(t);i.addOp(n),v.bonds.push(n.data.bid)})),a.sgroups.forEach((function(e){var n=t.molecule.sgroups.newId(),r=e.atoms.map((function(t){return h.get(t)}));fi(t,e.type,r,e.data,n,u.pp,"SUP"===e.type?e.expanded:null,e.data.name).operations.reverse().forEach((function(t){i.addOp(t)}))})),i.operations.reverse(),i.addOp(new io(v.atoms).perform(t)),i.mergeWith(bi(t,t.molecule.bonds.get(v.bonds[0]))),[i,v]}function sa(t,e,n,r,o,i){return i?function(t,e,n,r,o){e.molecule;var i=t.molecule,a=i.getBondFragment(n);!function(t,e){var n=t.getFragmentIds(e),r=Array.from(n),o=t.clone(n),i=new Map;o.bonds.forEach((function(e,n){i.set(n,t.findBondId(r[e.begin],r[e.end]))}))}(i,a);var s=new Go;return s=o(t,e,n),Promise.resolve(s)}(t,e,n,0,(function(t,e,n){return ua(t,e,n,o)})):ua(t,e,n,o)}function ua(t,e,n,r){var o=new Go,i=e.molecule,a=t.molecule,s=a.bonds.get(n),u=i.bonds.get(e.bid),c=i.atoms.get(r?u.end:u.begin),l=new Map([[u.begin,r?s.end:s.begin],[u.end,r?s.begin:s.end]]),f={begin:r?u.end:u.begin,end:r?u.begin:u.end},h=Tr.mergeBondsParams(a,s,i,f),d=h.angle,p=h.scale,m=a.getBondFragment(n),g={atoms:[],bonds:[]};return i.atoms.forEach((function(e,n){var r=W.getAttrHash(e);if(r.fragment=m,n!==u.begin&&n!==u.end){var i=z.diff(e.pp,c.pp).rotate(d).scaled(p).add(a.atoms.get(s.begin).pp),f=$o.atom(t,i,null,.1);if(null===f){var h=new Zr(r,i).perform(t);o.addOp(h),l.set(n,h.data.aid),g.atoms.push(h.data.aid)}else l.set(n,f.id),o.mergeWith(Si(t,l.get(n),r,!0))}else o.mergeWith(Si(t,l.get(n),r,!0))})),ki(o,t,g.atoms,s.begin),i.bonds.forEach((function(e){var n=a.findBondId(l.get(e.begin),l.get(e.end));if(null===n){var r=new Gr(l.get(e.begin),l.get(e.end),e).perform(t);o.addOp(r),g.bonds.push(r.data.bid)}else o.mergeWith(yi(t,n,u,!0))})),g.atoms.length&&o.addOp(new io([s.begin,s.end].concat((0,v.Z)(g.atoms))).perform(t)),g.bonds.length&&o.mergeWith(bi(t,t.molecule.bonds.get(g.bonds[0]))),o.operations.reverse(),[o,g]}function ca(t,e,n){var r=new Go;return r.addOp(new Lo(e,n)),r.perform(t)}function la(t,e,n){var r=new Go;return r.addOp(new zo(e,n)),r.perform(t)}function fa(t,e){var n=new Go;return n.addOp(new Do(e)),n.perform(t)}function ha(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var da=function(t){(0,u.Z)(n,t);var e=ha(n);function n(t,o,a,s){var u;return(0,r.Z)(this,n),u=e.call(this,Mr.ADD_HIGHLIGHT),(0,i.Z)((0,b.Z)(u),"data",void 0),u.data={atoms:t,bonds:o,color:a,highlightId:s},u}return(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.data,n=e.atoms,r=e.bonds,o=e.color;if(o){var i=t.molecule,a=new kt({atoms:n,bonds:r,color:o});"number"!=typeof this.data.highlightId?this.data.highlightId=i.highlights.add(a):i.highlights.set(this.data.highlightId,a),va(t,n,r)}}},{key:"invert",value:function(){var t=this.data,e=t.atoms,n=t.bonds,r=t.color,o=t.highlightId;return new pa(o,e,n,r)}}]),n}(Rr),pa=function(t){(0,u.Z)(n,t);var e=ha(n);function n(t,o,a,s){var u;return(0,r.Z)(this,n),u=e.call(this,Mr.REMOVE_HIGHLIGHT,5),(0,i.Z)((0,b.Z)(u),"data",void 0),u.data={highlightId:t,atoms:o||[],bonds:a||[],color:s||"white"},u}return(0,o.Z)(n,[{key:"execute",value:function(t){if("number"==typeof this.data.highlightId){var e=t.molecule,n=e.highlights.get(this.data.highlightId);if(void 0===n)return;var r=n.atoms,o=n.bonds,i=n.color;this.data.atoms=r,this.data.bonds=o,this.data.color=i,e.highlights.delete(this.data.highlightId),va(t,r,o)}}},{key:"invert",value:function(){var t=this.data,e=t.atoms,n=t.bonds,r=t.color,o=t.highlightId,i=new da(e,n,r,o);return i.data=this.data,i}}]),n}(Rr);function va(t,e,n){var r=t.atoms,o=t.bonds;e&&e.forEach((function(e){void 0!==r.get(e)&&t.markAtom(e,1)})),n&&n.forEach((function(e){void 0!==o.get(e)&&t.markBond(e,1)}))}function ma(t,e){var n=new Go;return e.forEach((function(t){var e=t.atoms,r=t.bonds,o=t.color;n.addOp(new da(e,r,o))})),n.perform(t)}function ga(t){var e=new Go;return t.molecule.highlights.forEach((function(t,n){e.addOp(new pa(n))})),e.perform(t)}!function(t){(0,u.Z)(n,t);var e=ha(n);function n(t,o,a,s){var u;return(0,r.Z)(this,n),u=e.call(this,Mr.UPDATE_HIGHLIGHT),(0,i.Z)((0,b.Z)(u),"newData",void 0),(0,i.Z)((0,b.Z)(u),"oldData",void 0),u.newData={atoms:o,bonds:a,color:s,highlightId:t},u.oldData={atoms:o,bonds:a,color:s,highlightId:t},u}(0,o.Z)(n,[{key:"execute",value:function(t){var e=this.newData,n=e.atoms,r=e.bonds,o=e.color;if(o){var i=this.newData.highlightId,a=t.molecule,s=a.highlights.get(i);if(s){var u=s.atoms,c=s.bonds,l=s.color;this.oldData={atoms:u,bonds:c,color:l,highlightId:i};var f=new kt({atoms:n,bonds:r,color:o});a.highlights.set(this.newData.highlightId,f),va(t,[].concat((0,v.Z)(n),(0,v.Z)(u)),[].concat((0,v.Z)(r),(0,v.Z)(c)))}}}},{key:"invert",value:function(){var t=this.oldData,e=t.atoms,r=t.bonds,o=t.color;return new n(this.newData.highlightId,e,r,o)}}])}(Rr);var ya={Fragment:"Fragment",Multifragment:"Multifragment",Bond:"Bond",Atom:"Atom",Group:"Group"},ba=Tr.fracAngle;function wa(t,e,n){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,n)}function xa(t,e){var n=xn(t);return new wn(e).create(n).getStructureFromStringAsync(t)}function Oa(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rxn",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=e.create(t);return r.getStructureFromStructAsync(n)}var Ea=new WeakMap,_a=new WeakMap,Sa=new WeakMap,ja=function(){function t(e,n,o){(0,r.Z)(this,t),wa(this,Ea,{writable:!0,value:void 0}),wa(this,_a,{writable:!0,value:void 0}),wa(this,Sa,{writable:!0,value:void 0}),s()(null!=e),s()(null!=n),s()(null!=o),(0,m.Z)(this,Sa,e),(0,m.Z)(this,Ea,n),(0,m.Z)(this,_a,o)}var e,n,i,a,u;return(0,o.Z)(t,[{key:"editor",get:function(){return(0,g.Z)(this,Sa)}},{key:"getSmiles",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=t?"smilesExt":"smiles";return Oa(e,(0,g.Z)(this,_a),this.editor.struct())}},{key:"getMolfile",value:(u=(0,E.Z)(S().mark((function t(){var e,n,r,o=arguments;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=o.length>0&&void 0!==o[0]?o[0]:"v2000",!this.containsReaction()){t.next=3;break}throw Error("The structure cannot be saved as *.MOL due to reaction arrrows.");case 3:return n="v3000"===e?"molV3000":"mol",t.next=6,Oa(n,(0,g.Z)(this,_a),(0,g.Z)(this,Sa).struct());case 6:return r=t.sent,t.abrupt("return",r);case 8:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"getRxn",value:(a=(0,E.Z)(S().mark((function t(){var e,n,r,o=arguments;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=o.length>0&&void 0!==o[0]?o[0]:"v2000",this.containsReaction()){t.next=3;break}throw Error("The structure cannot be saved as *.RXN: there is no reaction arrows.");case 3:return n="v3000"===e?"rxnV3000":"rxn",t.next=6,Oa(n,(0,g.Z)(this,_a),(0,g.Z)(this,Sa).struct());case 6:return r=t.sent,t.abrupt("return",r);case 8:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getKet",value:function(){return Oa("ket",(0,g.Z)(this,_a),(0,g.Z)(this,Sa).struct())}},{key:"getSmarts",value:function(){return Oa("smarts",(0,g.Z)(this,_a),(0,g.Z)(this,Sa).struct())}},{key:"getCml",value:function(){return Oa("cml",(0,g.Z)(this,_a),(0,g.Z)(this,Sa).struct())}},{key:"getInchi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Oa(t?"inChIAuxInfo":"inChI",(0,g.Z)(this,_a),(0,g.Z)(this,Sa).struct())}},{key:"containsReaction",value:function(){return this.editor.struct().hasRxnArrow()}},{key:"setMolecule",value:(i=(0,E.Z)(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s()("string"==typeof e),t.next=3,xa(e,(0,g.Z)(this,Ea));case 3:(n=t.sent).initHalfBonds(),n.initNeighbors(),n.setImplicitHydrogen(),n.markFragments(),(0,g.Z)(this,Sa).struct(n);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"addFragment",value:(n=(0,E.Z)(S().mark((function t(e){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw s()("string"==typeof e),Error("not implemented yet");case 2:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"generateImage",value:(e=(0,E.Z)(S().mark((function t(e){var n,r,o,i,a,s,u,c,l=arguments;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=l.length>1&&void 0!==l[1]?l[1]:{outputFormat:"png"},r="",t.t0=n.outputFormat,t.next="svg"===t.t0?5:(t.t0,7);break;case 5:return r="image/svg+xml",t.abrupt("break",9);case 7:r="image/png",n.outputFormat="png";case 9:return t.next=11,(0,g.Z)(this,Ea).generateImageAsBase64(e,n);case 11:for(o=t.sent,i=atob(o),a=new Array(i.length),s=0;s<i.length;s++)a[s]=i.charCodeAt(s);return u=new Uint8Array(a),c=new Blob([u],{type:r}),t.abrupt("return",c);case 18:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}();function Aa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Aa(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Aa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ka={"smart-layout":!0,"ignore-stereochemistry-errors":!0,"mass-skip-error-on-pseudoatoms":!1,"gross-formula-add-rsites":!0,"aromatize-skip-superatoms":!0},Ta=new WeakMap;(0,o.Z)((function t(){var e,n,o;(0,r.Z)(this,t),o={writable:!0,value:void 0},function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,n=Ta),n.set(e,o)}),[{key:"withStructServiceProvider",value:function(t){return(0,m.Z)(this,Ta,t),this}},{key:"build",value:function(t,e){s()(null!=t),s()(null!=(0,g.Z)(this,Ta));var n=Pa(Pa({},ka),e),r=(0,g.Z)(this,Ta).createStructService(n),o=new ja(t,r,new wn(r));return o[(0,g.Z)(this,Ta).mode]=!0,o}}])},41847:function(t,e,n){"use strict";n.d(e,{M:function(){return Dg}});var r=n(4942),o=n(48521),i=(n(66337),n(10232),n(35666),n(35449),"undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==i&&i),a="URLSearchParams"in i,s="Symbol"in i&&"iterator"in Symbol,u="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(t){return!1}}(),c="FormData"in i,l="ArrayBuffer"in i;if(l)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(t){return t&&f.indexOf(Object.prototype.toString.call(t))>-1};function d(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function v(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return s&&(e[Symbol.iterator]=function(){return e}),e}function m(t){this.map={},t instanceof m?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function g(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function y(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function b(t){var e=new FileReader,n=y(e);return e.readAsArrayBuffer(t),n}function w(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:u&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:c&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:a&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():l&&u&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=w(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l&&(ArrayBuffer.prototype.isPrototypeOf(t)||h(t))?this._bodyArrayBuffer=w(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u&&(this.blob=function(){var t=g(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(b)}),this.text=function(){var t,e,n,r=g(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,n=y(e=new FileReader),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}m.prototype.append=function(t,e){t=d(t),e=p(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},m.prototype.delete=function(t){delete this.map[d(t)]},m.prototype.get=function(t){return t=d(t),this.has(t)?this.map[t]:null},m.prototype.has=function(t){return this.map.hasOwnProperty(d(t))},m.prototype.set=function(t,e){this.map[d(t)]=p(e)},m.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},m.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),v(t)},m.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),v(t)},m.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),v(t)},s&&(m.prototype[Symbol.iterator]=m.prototype.entries);var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function E(t,e){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,o=(e=e||{}).body;if(t instanceof E){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new m(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new m(e.headers)),this.method=(r=(n=e.method||this.method||"GET").toUpperCase(),O.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function _(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}})),e}function S(t,e){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new m(e.headers),this.url=e.url||"",this._initBody(t)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})},x.call(E.prototype),x.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},S.error=function(){var t=new S(null,{status:0,statusText:""});return t.type="error",t};var j=[301,302,303,307,308];S.redirect=function(t,e){if(-1===j.indexOf(e))throw new RangeError("Invalid status code");return new S(null,{status:e,headers:{location:t}})};var A=i.DOMException;try{new A}catch(t){(A=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),A.prototype.constructor=A}function P(t,e){return new Promise((function(n,r){var o=new E(t,e);if(o.signal&&o.signal.aborted)return r(new A("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new m,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;setTimeout((function(){n(new S(o,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new A("Aborted","AbortError"))}),0)},a.open(o.method,function(t){try{return""===t&&i.location.href?i.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&(u?a.responseType="blob":l&&o.headers.get("Content-Type")&&-1!==o.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!e||"object"!=typeof e.headers||e.headers instanceof m?o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})):Object.getOwnPropertyNames(e.headers).forEach((function(t){a.setRequestHeader(t,p(e.headers[t]))})),o.signal&&(o.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",s)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}P.polyfill=!0,i.fetch||(i.fetch=P,i.Headers=m,i.Request=E,i.Response=S);var k=n(15861),T=n(87757),C=n.n(T),R=n(15671),M=n(43144),I=n(58469),N=n(67294),B=n(45987),Z=n(60136),L=n(82963),D=n(61120);function z(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=z(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function F(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=z(t))&&(r&&(r+=" "),r+=e);return r}var G=n(71002),H=n(40660),V=n(78230),U=n(29439),q=n(97326),W=n(73935),Y=N.createContext(null),$=function(t){t()},K=function(){return $},J={notify:function(){},get:function(){return[]}};function X(t,e){var n,r=J;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=e?e.addNestedSub(o):t.subscribe(o),r=function(){var t=K(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t((function(){for(var t=e;t;)t.callback(),t=t.next}))},get:function(){for(var t=[],n=e;n;)t.push(n),n=n.next;return t},subscribe:function(t){var r=!0,o=n={callback:t,next:null,prev:n};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}var a={addNestedSub:function(t){return i(),r.subscribe(t)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=J)},getListeners:function(){return r}};return a}var Q="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?N.useLayoutEffect:N.useEffect,tt=function(t){var e=t.store,n=t.context,r=t.children,o=(0,N.useMemo)((function(){var t=X(e);return{store:e,subscription:t}}),[e]),i=(0,N.useMemo)((function(){return e.getState()}),[e]);Q((function(){var t=o.subscription;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),function(){t.tryUnsubscribe(),t.onStateChange=null}}),[o,i]);var a=n||Y;return N.createElement(a.Provider,{value:o},r)},et=n(87462),nt=n(63366),rt=n(8679),ot=n.n(rt),it=n(72973),at=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],st=["reactReduxForwardedRef"],ut=[],ct=[null,null];function lt(t,e){var n=t[1];return[e.payload,n+1]}function ft(t,e,n){Q((function(){return t.apply(void 0,e)}),n)}function ht(t,e,n,r,o,i,a){t.current=r,e.current=o,n.current=!1,i.current&&(i.current=null,a())}function dt(t,e,n,r,o,i,a,s,u,c){if(t){var l=!1,f=null,h=function(){if(!l){var t,n,h=e.getState();try{t=r(h,o.current)}catch(t){n=t,f=t}n||(f=null),t===i.current?a.current||u():(i.current=t,s.current=t,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=h,n.trySubscribe(),h(),function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var pt=function(){return[null,0]};function vt(t,e){void 0===e&&(e={});var n=e,r=n.getDisplayName,o=void 0===r?function(t){return"ConnectAdvanced("+t+")"}:r,i=n.methodName,a=void 0===i?"connectAdvanced":i,s=n.renderCountProp,u=void 0===s?void 0:s,c=n.shouldHandleStateChanges,l=void 0===c||c,f=n.storeKey,h=void 0===f?"store":f,d=(n.withRef,n.forwardRef),p=void 0!==d&&d,v=n.context,m=void 0===v?Y:v,g=(0,nt.Z)(n,at),y=m;return function(e){var n=e.displayName||e.name||"Component",r=o(n),i=(0,et.Z)({},g,{getDisplayName:o,methodName:a,renderCountProp:u,shouldHandleStateChanges:l,storeKey:h,displayName:r,wrappedComponentName:n,WrappedComponent:e}),s=g.pure,c=s?N.useMemo:function(t){return t()};function f(n){var r=(0,N.useMemo)((function(){var t=n.reactReduxForwardedRef,e=(0,nt.Z)(n,st);return[n.context,t,e]}),[n]),o=r[0],a=r[1],s=r[2],u=(0,N.useMemo)((function(){return o&&o.Consumer&&(0,it.isContextConsumer)(N.createElement(o.Consumer,null))?o:y}),[o,y]),f=(0,N.useContext)(u),h=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var d=h?n.store:f.store,p=(0,N.useMemo)((function(){return function(e){return t(e.dispatch,i)}(d)}),[d]),v=(0,N.useMemo)((function(){if(!l)return ct;var t=X(d,h?null:f.subscription),e=t.notifyNestedSubs.bind(t);return[t,e]}),[d,h,f]),m=v[0],g=v[1],b=(0,N.useMemo)((function(){return h?f:(0,et.Z)({},f,{subscription:m})}),[h,f,m]),w=(0,N.useReducer)(lt,ut,pt),x=w[0][0],O=w[1];if(x&&x.error)throw x.error;var E=(0,N.useRef)(),_=(0,N.useRef)(s),S=(0,N.useRef)(),j=(0,N.useRef)(!1),A=c((function(){return S.current&&s===_.current?S.current:p(d.getState(),s)}),[d,x,s]);ft(ht,[_,E,j,s,A,S,g]),ft(dt,[l,d,m,p,_,E,j,S,g,O],[d,m,p]);var P=(0,N.useMemo)((function(){return N.createElement(e,(0,et.Z)({},A,{ref:a}))}),[a,e,A]);return(0,N.useMemo)((function(){return l?N.createElement(u.Provider,{value:b},P):P}),[u,P,b])}var d=s?N.memo(f):f;if(d.WrappedComponent=e,d.displayName=f.displayName=r,p){var v=N.forwardRef((function(t,e){return N.createElement(d,(0,et.Z)({},t,{reactReduxForwardedRef:e}))}));return v.displayName=r,v.WrappedComponent=e,ot()(v,e)}return ot()(d,e)}}function mt(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function gt(t,e){if(mt(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(e,n[o])||!mt(t[n[o]],e[n[o]]))return!1;return!0}function yt(t){return function(e,n){var r=t(e,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function bt(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?Boolean(t.dependsOnOwnProps):1!==t.length}function wt(t,e){return function(e,n){n.displayName;var r=function(t,e){return r.dependsOnOwnProps?r.mapToProps(t,e):r.mapToProps(t)};return r.dependsOnOwnProps=!0,r.mapToProps=function(e,n){r.mapToProps=t,r.dependsOnOwnProps=bt(t);var o=r(e,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=bt(o),o=r(e,n)),o},r}}var xt=[function(t){return"function"==typeof t?wt(t):void 0},function(t){return t?void 0:yt((function(t){return{dispatch:t}}))},function(t){return t&&"object"==typeof t?yt((function(e){return function(t,e){var n={},r=function(r){var o=t[r];"function"==typeof o&&(n[r]=function(){return e(o.apply(void 0,arguments))})};for(var o in t)r(o);return n}(t,e)})):void 0}],Ot=[function(t){return"function"==typeof t?wt(t):void 0},function(t){return t?void 0:yt((function(){return{}}))}];function Et(t,e,n){return(0,et.Z)({},n,t,e)}var _t=[function(t){return"function"==typeof t?function(t){return function(e,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(e,n,s){var u=t(e,n,s);return a?o&&i(u,r)||(r=u):(a=!0,r=u),r}}}(t):void 0},function(t){return t?void 0:function(){return Et}}],St=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function jt(t,e,n,r){return function(o,i){return n(t(o,i),e(r,i),i)}}function At(t,e,n,r,o){var i,a,s,u,c,l=o.areStatesEqual,f=o.areOwnPropsEqual,h=o.areStatePropsEqual,d=!1;return function(o,p){return d?function(o,d){var p,v,m=!f(d,a),g=!l(o,i);return i=o,a=d,m&&g?(s=t(i,a),e.dependsOnOwnProps&&(u=e(r,a)),c=n(s,u,a)):m?(t.dependsOnOwnProps&&(s=t(i,a)),e.dependsOnOwnProps&&(u=e(r,a)),c=n(s,u,a)):g?(p=t(i,a),v=!h(p,s),s=p,v&&(c=n(s,u,a)),c):c}(o,p):(s=t(i=o,a=p),u=e(r,a),c=n(s,u,a),d=!0,c)}}function Pt(t,e){var n=e.initMapStateToProps,r=e.initMapDispatchToProps,o=e.initMergeProps,i=(0,nt.Z)(e,St),a=n(t,i),s=r(t,i),u=o(t,i);return(i.pure?At:jt)(a,s,u,t,i)}var kt=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function Tt(t,e,n){for(var r=e.length-1;r>=0;r--){var o=e[r](t);if(o)return o}return function(e,r){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Ct(t,e){return t===e}function Rt(t){var e=void 0===t?{}:t,n=e.connectHOC,r=void 0===n?vt:n,o=e.mapStateToPropsFactories,i=void 0===o?Ot:o,a=e.mapDispatchToPropsFactories,s=void 0===a?xt:a,u=e.mergePropsFactories,c=void 0===u?_t:u,l=e.selectorFactory,f=void 0===l?Pt:l;return function(t,e,n,o){void 0===o&&(o={});var a=o,u=a.pure,l=void 0===u||u,h=a.areStatesEqual,d=void 0===h?Ct:h,p=a.areOwnPropsEqual,v=void 0===p?gt:p,m=a.areStatePropsEqual,g=void 0===m?gt:m,y=a.areMergedPropsEqual,b=void 0===y?gt:y,w=(0,nt.Z)(a,kt),x=Tt(t,i,"mapStateToProps"),O=Tt(e,s,"mapDispatchToProps"),E=Tt(n,c,"mergeProps");return r(f,(0,et.Z)({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:x,initMapDispatchToProps:O,initMergeProps:E,pure:l,areStatesEqual:d,areOwnPropsEqual:v,areStatePropsEqual:g,areMergedPropsEqual:b},w))}}var Mt=Rt();function It(){return(0,N.useContext)(Y)}function Nt(t){void 0===t&&(t=Y);var e=t===Y?It:function(){return(0,N.useContext)(t)};return function(){return e().store}}var Bt=Nt();function Zt(t){void 0===t&&(t=Y);var e=t===Y?Bt:Nt(t);return function(){return e().dispatch}}var Lt=Zt(),Dt=function(t,e){return t===e};function zt(t){void 0===t&&(t=Y);var e=t===Y?It:function(){return(0,N.useContext)(t)};return function(t,n){void 0===n&&(n=Dt);var r=e(),o=function(t,e,n,r){var o,i=(0,N.useReducer)((function(t){return t+1}),0),a=i[1],s=(0,N.useMemo)((function(){return X(n,r)}),[n,r]),u=(0,N.useRef)(),c=(0,N.useRef)(),l=(0,N.useRef)(),f=(0,N.useRef)(),h=n.getState();try{if(t!==c.current||h!==l.current||u.current){var d=t(h);o=void 0!==f.current&&e(d,f.current)?f.current:d}else o=f.current}catch(t){throw u.current&&(t.message+="\nThe error may be correlated with this previous error:\n"+u.current.stack+"\n\n"),t}return Q((function(){c.current=t,l.current=h,f.current=o,u.current=void 0})),Q((function(){function t(){try{var t=n.getState();if(t===l.current)return;var r=c.current(t);if(e(r,f.current))return;f.current=r,l.current=t}catch(t){u.current=t}a()}return s.onStateChange=t,s.trySubscribe(),t(),function(){return s.tryUnsubscribe()}}),[n,s]),o}(t,n,r.store,r.subscription);return(0,N.useDebugValue)(o),o}}var Ft,Gt=zt();Ft=W.unstable_batchedUpdates,$=Ft;var Ht=n(1413);function Vt(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Ut="function"==typeof Symbol&&Symbol.observable||"@@observable",qt=function(){return Math.random().toString(36).substring(7).split("").join(".")},Wt={INIT:"@@redux/INIT"+qt(),REPLACE:"@@redux/REPLACE"+qt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+qt()}};function Yt(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function $t(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Vt(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Vt(1));return n($t)(t,e)}if("function"!=typeof t)throw new Error(Vt(2));var o=t,i=e,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function l(){if(u)throw new Error(Vt(3));return i}function f(t){if("function"!=typeof t)throw new Error(Vt(4));if(u)throw new Error(Vt(5));var e=!0;return c(),s.push(t),function(){if(e){if(u)throw new Error(Vt(6));e=!1,c();var n=s.indexOf(t);s.splice(n,1),a=null}}}function h(t){if(!Yt(t))throw new Error(Vt(7));if(void 0===t.type)throw new Error(Vt(8));if(u)throw new Error(Vt(9));try{u=!0,i=o(i,t)}finally{u=!1}for(var e=a=s,n=0;n<e.length;n++)(0,e[n])();return t}function d(t){if("function"!=typeof t)throw new Error(Vt(10));o=t,h({type:Wt.REPLACE})}function p(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(Vt(11));function n(){t.next&&t.next(l())}return n(),{unsubscribe:e(n)}}})[Ut]=function(){return this},t}return h({type:Wt.INIT}),(r={dispatch:h,subscribe:f,getState:l,replaceReducer:d})[Ut]=p,r}function Kt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function Jt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error(Vt(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return r=Kt.apply(void 0,i)(n.dispatch),(0,Ht.Z)((0,Ht.Z)({},n),{},{dispatch:r})}}}function Xt(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(o){return"function"==typeof o?o(n,r,t):e(o)}}}}n(94500);var Qt=Xt();Qt.withExtraArgument=Xt;var te=Qt,ee=n(93433),ne=n(96486),re=n(8107),oe=n.n(re);function ie(){return ie=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ie.apply(this,arguments)}function ae(t,e){return ae=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ae(t,e)}var se=new Map,ue=new WeakMap,ce=0;function le(t,e,n,r){if(void 0===n&&(n={}),void 0===r&&(r=undefined),void 0===window.IntersectionObserver&&void 0!==r){var o=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),function(){}}var i=function(t){var e=function(t){return Object.keys(t).sort().filter((function(e){return void 0!==t[e]})).map((function(e){return e+"_"+("root"===e?(n=t.root)?(ue.has(n)||(ce+=1,ue.set(n,ce.toString())),ue.get(n)):"0":t[e]);var n})).toString()}(t),n=se.get(e);if(!n){var r,o=new Map,i=new IntersectionObserver((function(e){e.forEach((function(e){var n,i=e.isIntersecting&&r.some((function(t){return e.intersectionRatio>=t}));t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=i),null==(n=o.get(e.target))||n.forEach((function(t){t(i,e)}))}))}),t);r=i.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:i,elements:o},se.set(e,n)}return n}(n),a=i.id,s=i.observer,u=i.elements,c=u.get(t)||[];return u.has(t)||u.set(t,c),c.push(e),s.observe(t),function(){c.splice(c.indexOf(e),1),0===c.length&&(u.delete(t),s.unobserve(t)),0===u.size&&(s.disconnect(),se.delete(a))}}var fe=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function he(t){return"function"!=typeof t.children}var de=function(t){var e,n;function r(e){var n;return(n=t.call(this,e)||this).node=null,n._unobserveCb=null,n.handleNode=function(t){n.node&&(n.unobserve(),t||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=t||null,n.observeNode()},n.handleChange=function(t,e){t&&n.props.triggerOnce&&n.unobserve(),he(n.props)||n.setState({inView:t,entry:e}),n.props.onChange&&n.props.onChange(t,e)},n.state={inView:!!e.initialInView,entry:void 0},n}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,ae(e,n);var o=r.prototype;return o.componentDidUpdate=function(t){t.rootMargin===this.props.rootMargin&&t.root===this.props.root&&t.threshold===this.props.threshold&&t.skip===this.props.skip&&t.trackVisibility===this.props.trackVisibility&&t.delay===this.props.delay||(this.unobserve(),this.observeNode())},o.componentWillUnmount=function(){this.unobserve(),this.node=null},o.observeNode=function(){if(this.node&&!this.props.skip){var t=this.props,e=t.threshold,n=t.root,r=t.rootMargin,o=t.trackVisibility,i=t.delay,a=t.fallbackInView;this._unobserveCb=le(this.node,this.handleChange,{threshold:e,root:n,rootMargin:r,trackVisibility:o,delay:i},a)}},o.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},o.render=function(){if(!he(this.props)){var t=this.state,e=t.inView,n=t.entry;return this.props.children({inView:e,entry:n,ref:this.handleNode})}var r=this.props,o=r.children,i=r.as,a=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(r,fe);return N.createElement(i||"div",ie({ref:this.handleNode},a),o)},r}(N.Component);function pe(t){var e=void 0===t?{}:t,n=e.threshold,r=e.delay,o=e.trackVisibility,i=e.rootMargin,a=e.root,s=e.triggerOnce,u=e.skip,c=e.initialInView,l=e.fallbackInView,f=N.useRef(),h=N.useState({inView:!!c}),d=h[0],p=h[1],v=N.useCallback((function(t){void 0!==f.current&&(f.current(),f.current=void 0),u||t&&(f.current=le(t,(function(t,e){p({inView:t,entry:e}),e.isIntersecting&&s&&f.current&&(f.current(),f.current=void 0)}),{root:a,rootMargin:i,threshold:n,trackVisibility:o,delay:r},l))}),[Array.isArray(n)?n.toString():n,a,i,s,u,o,l,r]);(0,N.useEffect)((function(){f.current||!d.entry||s||u||p({inView:!!c})}));var m=[v,d.inView,d.entry];return m.ref=m[0],m.inView=m[1],m.entry=m[2],m}de.displayName="InView",de.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};for(var ve={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},me={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},ge="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),ye="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),be="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),we="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),xe="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Oe=ge&&(we||+ge[1]<57)||be&&we,Ee=0;Ee<10;Ee++)ve[48+Ee]=ve[96+Ee]=String(Ee);for(Ee=1;Ee<=24;Ee++)ve[Ee+111]="F"+Ee;for(Ee=65;Ee<=90;Ee++)ve[Ee]=String.fromCharCode(Ee+32),me[Ee]=String.fromCharCode(Ee);for(var _e in ve)me.hasOwnProperty(_e)||(me[_e]=ve[_e]);function Se(t){var e=!(Oe&&(t.ctrlKey||t.altKey||t.metaKey)||(ye||xe)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?me:ve)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}var je=n(13092),Ae=n(86033),Pe=n(99622),ke=n(84506),Te=n(45697),Ce=n.n(Te),Re=n(94184),Me=n.n(Re),Ie=n(27418),Ne=n.n(Ie);function Be(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return"function"==typeof t&&t.apply(void 0,n)}function Ze(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Le="react-contextmenu",De="react-contextmenu--visible",ze="react-contextmenu-item",Fe="react-contextmenu-item--disabled",Ge="react-contextmenu-item--selected",He={},Ve=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Ue="REACT_CONTEXTMENU_SHOW",qe="REACT_CONTEXTMENU_HIDE";function We(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=void 0;"function"==typeof window.CustomEvent?r=new window.CustomEvent(t,{detail:e}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,!1,!0,e),n&&(n.dispatchEvent(r),Ne()(He,e))}function Ye(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];We(Ue,Ne()({},t,{type:Ue}),e)}function $e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];We(qe,Ne()({},t,{type:qe}),e)}var Ke=new function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.handleShowEvent=function(t){for(var n in e.callbacks)Ze(e.callbacks,n)&&e.callbacks[n].show(t)},this.handleHideEvent=function(t){for(var n in e.callbacks)Ze(e.callbacks,n)&&e.callbacks[n].hide(t)},this.register=function(t,n){var r=Math.random().toString(36).substring(7);return e.callbacks[r]={show:t,hide:n},r},this.unregister=function(t){t&&e.callbacks[t]&&delete e.callbacks[t]},this.callbacks={},Ve&&(window.addEventListener(Ue,this.handleShowEvent),window.addEventListener(qe,this.handleHideEvent))},Je=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xe=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function Qe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function en(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var nn=function(t){function e(){var t,n,r;tn(this,e);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=en(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i))),r.handleClick=function(t){0!==t.button&&1!==t.button&&t.preventDefault(),r.props.disabled||r.props.divider||(Be(r.props.onClick,t,Ne()({},r.props.data,He.data),He.target),r.props.preventClose||$e())},en(r,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Xe(e,[{key:"render",value:function(){var t,e=this,n=this.props,r=n.attributes,o=n.children,i=n.className,a=n.disabled,s=n.divider,u=n.selected,c=Me()(i,ze,r.className,(Qe(t={},Me()(Fe,r.disabledClassName),a),Qe(t,Me()("react-contextmenu-item--divider",r.dividerClassName),s),Qe(t,Me()(Ge,r.selectedClassName),u),t));return N.createElement("div",Je({},r,{className:c,role:"menuitem",tabIndex:"-1","aria-disabled":a?"true":"false","aria-orientation":s?"horizontal":null,ref:function(t){e.ref=t},onMouseMove:this.props.onMouseMove,onMouseLeave:this.props.onMouseLeave,onTouchEnd:this.handleClick,onClick:this.handleClick}),s?null:o)}}]),e}(N.Component);nn.propTypes={attributes:Ce().object,children:Ce().node,className:Ce().string,data:Ce().object,disabled:Ce().bool,divider:Ce().bool,onClick:Ce().func,onMouseLeave:Ce().func,onMouseMove:Ce().func,preventClose:Ce().bool,selected:Ce().bool},nn.defaultProps={attributes:{},children:null,className:"",data:{},disabled:!1,divider:!1,onClick:function(){return null},onMouseMove:function(){return null},onMouseLeave:function(){return null},preventClose:!1,selected:!1};var rn=nn,on=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return an.call(n),n.seletedItemRef=null,n.state={selectedItem:null,forceSubMenuOpen:!1},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(N.Component);on.propTypes={children:Ce().node.isRequired};var an=function(){var t=this;this.handleKeyNavigation=function(e){if(!1!==t.state.isVisible)switch(e.keyCode){case 37:case 27:e.preventDefault(),t.hideMenu(e);break;case 38:e.preventDefault(),t.selectChildren(!0);break;case 40:e.preventDefault(),t.selectChildren(!1);break;case 39:t.tryToOpenSubMenu(e);break;case 13:e.preventDefault(),t.tryToOpenSubMenu(e);var n=t.seletedItemRef&&t.seletedItemRef.props&&t.seletedItemRef.props.disabled;t.seletedItemRef&&t.seletedItemRef.ref instanceof HTMLElement&&!n?t.seletedItemRef.ref.click():t.hideMenu(e)}},this.handleForceClose=function(){t.setState({forceSubMenuOpen:!1})},this.tryToOpenSubMenu=function(e){t.state.selectedItem&&t.state.selectedItem.type===t.getSubMenuType()&&(e.preventDefault(),t.setState({forceSubMenuOpen:!0}))},this.selectChildren=function(e){var n=t.state.selectedItem,r=[],o=0,i={};if(N.Children.forEach(t.props.children,(function e(n,a){n&&([rn,t.getSubMenuType()].indexOf(n.type)<0?N.Children.forEach(n.props.children,e):n.props.divider||(n.props.disabled&&(++o,i[a]=!0),r.push(n)))})),o!==r.length){var a=function(t){var n=t;do{e?--n:++n,n<0?n=r.length-1:n>=r.length&&(n=0)}while(n!==t&&i[n]);return n===t?null:n}(r.indexOf(n));null!==a&&t.setState({selectedItem:r[a],forceSubMenuOpen:!1})}},this.onChildMouseMove=function(e){t.state.selectedItem!==e&&t.setState({selectedItem:e,forceSubMenuOpen:!1})},this.onChildMouseLeave=function(){t.setState({selectedItem:null,forceSubMenuOpen:!1})},this.renderChildren=function(e){return N.Children.map(e,(function(e){var n={};return N.isValidElement(e)?[rn,t.getSubMenuType()].indexOf(e.type)<0?(n.children=t.renderChildren(e.props.children),N.cloneElement(e,n)):(n.onMouseLeave=t.onChildMouseLeave.bind(t),e.type===t.getSubMenuType()&&(n.forceOpen=t.state.forceSubMenuOpen&&t.state.selectedItem===e,n.forceClose=t.handleForceClose,n.parentKeyNavigationHandler=t.handleKeyNavigation),e.props.divider||t.state.selectedItem!==e?(n.onMouseMove=function(){return t.onChildMouseMove(e)},N.cloneElement(e,n)):(n.selected=!0,n.ref=function(e){t.seletedItemRef=e},N.cloneElement(e,n))):e}))}},sn=on,un=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function ln(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fn=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.getMenuPosition=function(){var t=window,e=t.innerWidth,r=t.innerHeight,o=n.subMenu.getBoundingClientRect(),i={};return o.bottom>r?i.bottom=0:i.top=0,o.right<e?i.left="100%":i.right="100%",i},n.getRTLMenuPosition=function(){var t=window.innerHeight,e=n.subMenu.getBoundingClientRect(),r={};return e.bottom>t?r.bottom=0:r.top=0,e.left<0?r.left="100%":r.right="100%",r},n.hideSubMenu=function(t){t.detail&&t.detail.id&&n.menu&&t.detail.id!==n.menu.id||(n.props.forceOpen&&n.props.forceClose(),n.setState({visible:!1,selectedItem:null}),n.unregisterHandlers())},n.handleClick=function(t){t.preventDefault(),n.props.disabled||(Be(n.props.onClick,t,Ne()({},n.props.data,He.data),He.target),n.props.onClick&&!n.props.preventCloseOnClick&&$e())},n.handleMouseEnter=function(){n.closetimer&&clearTimeout(n.closetimer),n.props.disabled||n.state.visible||(n.opentimer=setTimeout((function(){return n.setState({visible:!0,selectedItem:null})}),n.props.hoverDelay))},n.handleMouseLeave=function(){n.opentimer&&clearTimeout(n.opentimer),n.state.visible&&(n.closetimer=setTimeout((function(){return n.setState({visible:!1,selectedItem:null})}),n.props.hoverDelay))},n.menuRef=function(t){n.menu=t},n.subMenuRef=function(t){n.subMenu=t},n.registerHandlers=function(){document.removeEventListener("keydown",n.props.parentKeyNavigationHandler),document.addEventListener("keydown",n.handleKeyNavigation)},n.unregisterHandlers=function(t){document.removeEventListener("keydown",n.handleKeyNavigation),t||document.addEventListener("keydown",n.props.parentKeyNavigationHandler)},n.state=Ne()({},n.state,{visible:!1}),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),cn(e,[{key:"componentDidMount",value:function(){this.listenId=Ke.register((function(){}),this.hideSubMenu)}},{key:"getSubMenuType",value:function(){return e}},{key:"shouldComponentUpdate",value:function(t,e){return this.isVisibilityChange=!(this.state.visible===e.visible&&this.props.forceOpen===t.forceOpen||this.state.visible&&t.forceOpen||this.props.forceOpen&&e.visible),!0}},{key:"componentDidUpdate",value:function(){var t=this;this.isVisibilityChange&&(this.props.forceOpen||this.state.visible?(window.requestAnimationFrame||setTimeout)((function(){var e=t.props.rtl?t.getRTLMenuPosition():t.getMenuPosition();t.subMenu.style.removeProperty("top"),t.subMenu.style.removeProperty("bottom"),t.subMenu.style.removeProperty("left"),t.subMenu.style.removeProperty("right"),Ze(e,"top")&&(t.subMenu.style.top=e.top),Ze(e,"left")&&(t.subMenu.style.left=e.left),Ze(e,"bottom")&&(t.subMenu.style.bottom=e.bottom),Ze(e,"right")&&(t.subMenu.style.right=e.right),t.subMenu.classList.add(De),t.registerHandlers(),t.setState({selectedItem:null})})):(this.subMenu.addEventListener("transitionend",(function e(){t.subMenu.removeEventListener("transitionend",e),t.subMenu.style.removeProperty("bottom"),t.subMenu.style.removeProperty("right"),t.subMenu.style.top=0,t.subMenu.style.left="100%",t.unregisterHandlers()})),this.subMenu.classList.remove(De)))}},{key:"componentWillUnmount",value:function(){this.listenId&&Ke.unregister(this.listenId),this.opentimer&&clearTimeout(this.opentimer),this.closetimer&&clearTimeout(this.closetimer),this.unregisterHandlers(!0)}},{key:"render",value:function(){var t,e=this.props,n=e.children,r=e.attributes,o=e.disabled,i=e.title,a=e.selected,s=this.state.visible,u={ref:this.menuRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,className:Me()(ze,"react-contextmenu-submenu",r.listClassName),style:{position:"relative"}},c={className:Me()(ze,r.className,(t={},ln(t,Me()(Fe,r.disabledClassName),o),ln(t,Me()("react-contextmenu-item--active",r.visibleClassName),s),ln(t,Me()(Ge,r.selectedClassName),a),t)),onMouseMove:this.props.onMouseMove,onMouseOut:this.props.onMouseOut,onClick:this.handleClick},l={ref:this.subMenuRef,style:{position:"absolute",transition:"opacity 1ms",top:0,left:"100%"},className:Me()(Le,this.props.className)};return N.createElement("nav",un({},u,{role:"menuitem",tabIndex:"-1","aria-haspopup":"true"}),N.createElement("div",un({},r,c),i),N.createElement("nav",un({},l,{role:"menu",tabIndex:"-1"}),this.renderChildren(n)))}}]),e}(sn);fn.propTypes={children:Ce().node.isRequired,attributes:Ce().object,title:Ce().node.isRequired,className:Ce().string,disabled:Ce().bool,hoverDelay:Ce().number,rtl:Ce().bool,selected:Ce().bool,onMouseMove:Ce().func,onMouseOut:Ce().func,forceOpen:Ce().bool,forceClose:Ce().func,parentKeyNavigationHandler:Ce().func},fn.defaultProps={disabled:!1,hoverDelay:500,attributes:{},className:"",rtl:!1,selected:!1,onMouseMove:function(){return null},onMouseOut:function(){return null},forceOpen:!1,forceClose:function(){return null},parentKeyNavigationHandler:function(){return null}};var hn=fn,dn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),pn=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.registerHandlers=function(){document.addEventListener("mousedown",n.handleOutsideClick),document.addEventListener("touchstart",n.handleOutsideClick),n.props.preventHideOnScroll||document.addEventListener("scroll",n.handleHide),n.props.preventHideOnContextMenu||document.addEventListener("contextmenu",n.handleHide),document.addEventListener("keydown",n.handleKeyNavigation),n.props.preventHideOnResize||window.addEventListener("resize",n.handleHide)},n.unregisterHandlers=function(){document.removeEventListener("mousedown",n.handleOutsideClick),document.removeEventListener("touchstart",n.handleOutsideClick),document.removeEventListener("scroll",n.handleHide),document.removeEventListener("contextmenu",n.handleHide),document.removeEventListener("keydown",n.handleKeyNavigation),window.removeEventListener("resize",n.handleHide)},n.handleShow=function(t){if(t.detail.id===n.props.id&&!n.state.isVisible){var e=t.detail.position,r=e.x,o=e.y;n.setState({isVisible:!0,x:r,y:o}),n.registerHandlers(),Be(n.props.onShow,t)}},n.handleHide=function(t){!n.state.isVisible||t.detail&&t.detail.id&&t.detail.id!==n.props.id||(n.unregisterHandlers(),n.setState({isVisible:!1,selectedItem:null,forceSubMenuOpen:!1}),Be(n.props.onHide,t))},n.handleOutsideClick=function(t){n.menu.contains(t.target)||$e()},n.handleMouseLeave=function(t){t.preventDefault(),Be(n.props.onMouseLeave,t,Ne()({},n.props.data,He.data),He.target),n.props.hideOnLeave&&$e()},n.handleContextMenu=function(t){t.preventDefault(),n.handleHide(t)},n.hideMenu=function(t){27!==t.keyCode&&13!==t.keyCode||$e()},n.getMenuPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r={top:e,left:t};if(!n.menu)return r;var o=window,i=o.innerWidth,a=o.innerHeight,s=n.menu.getBoundingClientRect();return e+s.height>a&&(r.top-=s.height),t+s.width>i&&(r.left-=s.width),r.top<0&&(r.top=s.height<a?(a-s.height)/2:0),r.left<0&&(r.left=s.width<i?(i-s.width)/2:0),r},n.getRTLMenuPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r={top:e,left:t};if(!n.menu)return r;var o=window,i=o.innerWidth,a=o.innerHeight,s=n.menu.getBoundingClientRect();return r.left=t-s.width,e+s.height>a&&(r.top-=s.height),r.left<0&&(r.left+=s.width),r.top<0&&(r.top=s.height<a?(a-s.height)/2:0),r.left+s.width>i&&(r.left=s.width<i?(i-s.width)/2:0),r},n.menuRef=function(t){n.menu=t},n.state=Ne()({},n.state,{x:0,y:0,isVisible:!1}),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),dn(e,[{key:"getSubMenuType",value:function(){return hn}},{key:"componentDidMount",value:function(){this.listenId=Ke.register(this.handleShow,this.handleHide)}},{key:"componentDidUpdate",value:function(){var t=this,e=window.requestAnimationFrame||setTimeout;this.state.isVisible?e((function(){var n=t.state,r=n.x,o=n.y,i=t.props.rtl?t.getRTLMenuPosition(r,o):t.getMenuPosition(r,o),a=i.top,s=i.left;e((function(){t.menu&&(t.menu.style.top=a+"px",t.menu.style.left=s+"px",t.menu.style.opacity=1,t.menu.style.pointerEvents="auto")}))})):e((function(){t.menu&&(t.menu.style.opacity=0,t.menu.style.pointerEvents="none")}))}},{key:"componentWillUnmount",value:function(){this.listenId&&Ke.unregister(this.listenId),this.unregisterHandlers()}},{key:"render",value:function(){var t,e,n,r=this.props,o=r.children,i=r.className,a=r.style,s=this.state.isVisible,u=Ne()({},a,{position:"fixed",opacity:0,pointerEvents:"none"}),c=Me()(Le,i,(n=s,(e=De)in(t={})?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t));return N.createElement("nav",{role:"menu",tabIndex:"-1",ref:this.menuRef,style:u,className:c,onContextMenu:this.handleContextMenu,onMouseLeave:this.handleMouseLeave},this.renderChildren(o))}}]),e}(sn);pn.propTypes={id:Ce().string.isRequired,children:Ce().node.isRequired,data:Ce().object,className:Ce().string,hideOnLeave:Ce().bool,rtl:Ce().bool,onHide:Ce().func,onMouseLeave:Ce().func,onShow:Ce().func,preventHideOnContextMenu:Ce().bool,preventHideOnResize:Ce().bool,preventHideOnScroll:Ce().bool,style:Ce().object},pn.defaultProps={className:"",data:{},hideOnLeave:!1,rtl:!1,onHide:function(){return null},onMouseLeave:function(){return null},onShow:function(){return null},preventHideOnContextMenu:!1,preventHideOnResize:!1,preventHideOnScroll:!1,style:{}};var vn=pn,mn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function gn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var bn=function(t){function e(){var t,n,r;gn(this,e);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=yn(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i))),r.touchHandled=!1,r.handleMouseDown=function(t){r.props.holdToDisplay>=0&&0===t.button&&(t.persist(),t.stopPropagation(),r.mouseDownTimeoutId=setTimeout((function(){return r.handleContextClick(t)}),r.props.holdToDisplay)),Be(r.props.attributes.onMouseDown,t)},r.handleMouseUp=function(t){0===t.button&&clearTimeout(r.mouseDownTimeoutId),Be(r.props.attributes.onMouseUp,t)},r.handleMouseOut=function(t){0===t.button&&clearTimeout(r.mouseDownTimeoutId),Be(r.props.attributes.onMouseOut,t)},r.handleTouchstart=function(t){r.touchHandled=!1,r.props.holdToDisplay>=0&&(t.persist(),t.stopPropagation(),r.touchstartTimeoutId=setTimeout((function(){r.handleContextClick(t),r.touchHandled=!0}),r.props.holdToDisplay)),Be(r.props.attributes.onTouchStart,t)},r.handleTouchEnd=function(t){r.touchHandled&&t.preventDefault(),clearTimeout(r.touchstartTimeoutId),Be(r.props.attributes.onTouchEnd,t)},r.handleContextMenu=function(t){t.button===r.props.mouseButton&&r.handleContextClick(t),Be(r.props.attributes.onContextMenu,t)},r.handleMouseClick=function(t){t.button===r.props.mouseButton&&r.handleContextClick(t),Be(r.props.attributes.onClick,t)},r.handleContextClick=function(t){if(!(r.props.disable||r.props.disableIfShiftIsPressed&&t.shiftKey)){t.preventDefault(),t.stopPropagation();var e=t.clientX||t.touches&&t.touches[0].pageX,n=t.clientY||t.touches&&t.touches[0].pageY;r.props.posX&&(e-=r.props.posX),r.props.posY&&(n-=r.props.posY),$e();var o=Be(r.props.collect,r.props),i={position:{x:e,y:n},target:r.elem,id:r.props.id};o&&"function"==typeof o.then?o.then((function(e){i.data=Ne()({},e,{target:t.target}),Ye(i)})):(i.data=Ne()({},o,{target:t.target}),Ye(i))}},r.elemRef=function(t){r.elem=t},yn(r,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),mn(e,[{key:"render",value:function(){var t=this.props,e=t.renderTag,n=t.attributes,r=t.children,o=Ne()({},n,{className:Me()("react-contextmenu-wrapper",n.className),onContextMenu:this.handleContextMenu,onClick:this.handleMouseClick,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onTouchStart:this.handleTouchstart,onTouchEnd:this.handleTouchEnd,onMouseOut:this.handleMouseOut,ref:this.elemRef});return N.createElement(e,o,r)}}]),e}(N.Component);bn.propTypes={id:Ce().string.isRequired,children:Ce().node.isRequired,attributes:Ce().object,collect:Ce().func,disable:Ce().bool,holdToDisplay:Ce().number,posX:Ce().number,posY:Ce().number,renderTag:Ce().elementType,mouseButton:Ce().number,disableIfShiftIsPressed:Ce().bool},bn.defaultProps={attributes:{},collect:function(){return null},disable:!1,holdToDisplay:1e3,renderTag:"div",posX:0,posY:0,mouseButton:2,disableIfShiftIsPressed:!1};var wn=bn;function xn(){return(xn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function On(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}function En(t){var e=(0,N.useRef)(t),n=(0,N.useRef)((function(t){e.current&&e.current(t)}));return e.current=t,n.current}Object.assign,[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(Object.keys(wn.propTypes)),["children"]);var _n=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=1),t>n?n:t<e?e:t},Sn=function(t){return"touches"in t},jn=function(t){return t&&t.ownerDocument.defaultView||self},An=function(t,e,n){var r=t.getBoundingClientRect(),o=Sn(e)?function(t,e){for(var n=0;n<t.length;n++)if(t[n].identifier===e)return t[n];return t[0]}(e.touches,n):e;return{left:_n((o.pageX-(r.left+jn(t).pageXOffset))/r.width),top:_n((o.pageY-(r.top+jn(t).pageYOffset))/r.height)}},Pn=function(t){!Sn(t)&&t.preventDefault()},kn=N.memo((function(t){var e=t.onMove,n=t.onKey,r=On(t,["onMove","onKey"]),o=(0,N.useRef)(null),i=En(e),a=En(n),s=(0,N.useRef)(null),u=(0,N.useRef)(!1),c=(0,N.useMemo)((function(){var t=function(t){Pn(t),(Sn(t)?t.touches.length>0:t.buttons>0)&&o.current?i(An(o.current,t,s.current)):n(!1)},e=function(){return n(!1)};function n(n){var r=u.current,i=jn(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",t),a(r?"touchend":"mouseup",e)}return[function(t){var e=t.nativeEvent,r=o.current;if(r&&(Pn(e),!function(t,e){return e&&!Sn(t)}(e,u.current)&&r)){if(Sn(e)){u.current=!0;var a=e.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(An(r,e,s.current)),n(!0)}},function(t){var e=t.which||t.keyCode;e<37||e>40||(t.preventDefault(),a({left:39===e?.05:37===e?-.05:0,top:40===e?.05:38===e?-.05:0}))},n]}),[a,i]),l=c[0],f=c[1],h=c[2];return(0,N.useEffect)((function(){return h}),[h]),N.createElement("div",xn({},r,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))})),Tn=function(t){return t.filter(Boolean).join(" ")},Cn=function(t){var e=t.color,n=t.left,r=t.top,o=void 0===r?.5:r,i=Tn(["react-colorful__pointer",t.className]);return N.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Rn=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=Math.pow(10,e)),Math.round(n*t)/n},Mn=(Math.PI,function(t){return"#"===t[0]&&(t=t.substr(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:1}:{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:1}}),In=function(t){var e=function(t){var e=t.s,n=t.v,r=t.a,o=(200-e)*n/100;return{h:Rn(t.h),s:Rn(o>0&&o<200?e*n/100/(o<=100?o:200-o)*100:0),l:Rn(o/2),a:Rn(r,2)}}(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},Nn=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Bn=N.memo((function(t){var e=t.hue,n=t.onChange,r=Tn(["react-colorful__hue",t.className]);return N.createElement("div",{className:r},N.createElement(kn,{onMove:function(t){n({h:360*t.left})},onKey:function(t){n({h:_n(e+360*t.left,0,360)})},"aria-label":"Hue","aria-valuetext":Rn(e)},N.createElement(Cn,{className:"react-colorful__hue-pointer",left:e/360,color:In({h:e,s:100,v:100,a:1})})))})),Zn=N.memo((function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:In({h:e.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(kn,{onMove:function(t){n({s:100*t.left,v:100-100*t.top})},onKey:function(t){n({s:_n(e.s+100*t.left,0,100),v:_n(e.v-100*t.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Rn(e.s)+"%, Brightness "+Rn(e.v)+"%"},N.createElement(Cn,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:In(e)})))})),Ln=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0};var Dn="undefined"!=typeof window?N.useLayoutEffect:N.useEffect,zn=new Map,Fn=function(t){var e,r=t.className,o=t.colorModel,i=t.color,a=void 0===i?o.defaultColor:i,s=t.onChange,u=On(t,["className","colorModel","color","onChange"]),c=(0,N.useRef)(null);e=c,Dn((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!zn.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',zn.set(t,r);var o=n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[]);var l=function(t,e,n){var r=En(n),o=(0,N.useState)((function(){return t.toHsva(e)})),i=o[0],a=o[1],s=(0,N.useRef)({color:e,hsva:i});(0,N.useEffect)((function(){if(!t.equal(e,s.current.color)){var n=t.toHsva(e);s.current={hsva:n,color:e},a(n)}}),[e,t]),(0,N.useEffect)((function(){var e;Ln(i,s.current.hsva)||t.equal(e=t.fromHsva(i),s.current.color)||(s.current={hsva:i,color:e},r(e))}),[i,t,r]);var u=(0,N.useCallback)((function(t){a((function(e){return Object.assign({},e,t)}))}),[]);return[i,u]}(o,a,s),f=l[0],h=l[1],d=Tn(["react-colorful",r]);return N.createElement("div",xn({},u,{ref:c,className:d}),N.createElement(Zn,{hsva:f,onChange:h}),N.createElement(Bn,{hue:f.h,onChange:h,className:"react-colorful__last-control"}))},Gn={defaultColor:"000",toHsva:function(t){return function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=Math.max(e,n,r),a=i-Math.min(e,n,r),s=a?i===e?(n-r)/a:i===n?2+(r-e)/a:4+(e-n)/a:0;return{h:Rn(60*(s<0?s+6:s)),s:Rn(i?a/i*100:0),v:Rn(i/255*100),a:o}}(Mn(t))},fromHsva:function(t){return n=(e=function(t){var e=t.h,n=t.s,r=t.v,o=t.a;e=e/360*6,n/=100,r/=100;var i=Math.floor(e),a=r*(1-n),s=r*(1-(e-i)*n),u=r*(1-(1-e+i)*n),c=i%6;return{r:Rn(255*[r,s,a,a,u,r][c]),g:Rn(255*[u,r,r,s,a,a][c]),b:Rn(255*[a,a,u,r,r,s][c]),a:Rn(o,2)}}(t)).g,r=e.b,"#"+Nn(e.r)+Nn(n)+Nn(r);var e,n,r},equal:function(t,e){return t.toLowerCase()===e.toLowerCase()||Ln(Mn(t),Mn(e))}},Hn=function(t){return N.createElement(Fn,xn({},t,{colorModel:Gn}))},Vn=/^#?([0-9A-F]{3,8})$/i,Un=function(t){var e=t.color,n=void 0===e?"":e,r=t.onChange,o=t.onBlur,i=t.escape,a=t.validate,s=t.format,u=t.process,c=On(t,["color","onChange","onBlur","escape","validate","format","process"]),l=(0,N.useState)((function(){return i(n)})),f=l[0],h=l[1],d=En(r),p=En(o),v=(0,N.useCallback)((function(t){var e=i(t.target.value);h(e),a(e)&&d(u?u(e):e)}),[i,u,a,d]),m=(0,N.useCallback)((function(t){a(t.target.value)||h(i(n)),p(t)}),[n,i,a,p]);return(0,N.useEffect)((function(){h(i(n))}),[n,i]),N.createElement("input",xn({},c,{value:s?s(f):f,spellCheck:"false",onChange:v,onBlur:m}))},qn=function(t){return"#"+t},Wn=function(t){var e=t.prefixed,n=t.alpha,r=On(t,["prefixed","alpha"]),o=(0,N.useCallback)((function(t){return t.replace(/([^0-9A-F]+)/gi,"").substr(0,n?8:6)}),[n]),i=(0,N.useCallback)((function(t){return function(t,e){var n=Vn.exec(t),r=n?n[1].length:0;return 3===r||6===r||!!e&&4===r||!!e&&8===r}(t,n)}),[n]);return N.createElement(Un,xn({},r,{escape:o,format:e?qn:void 0,process:qn,validate:i}))},Yn=n(93162),$n=n(84474),Kn=n.n($n),Jn="NOT_FOUND",Xn=function(t,e){return t===e};function Qn(t,e){var n,r,o="object"==typeof e?e:{equalityCheck:e},i=o.equalityCheck,a=void 0===i?Xn:i,s=o.maxSize,u=void 0===s?1:s,c=o.resultEqualityCheck,l=function(t){return function(e,n){if(null===e||null===n||e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t(e[o],n[o]))return!1;return!0}}(a),f=1===u?(n=l,{get:function(t){return r&&n(r.key,t)?r.value:Jn},put:function(t,e){r={key:t,value:e}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(t,e){var n=[];function r(t){var r=n.findIndex((function(n){return e(t,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return Jn}return{get:r,put:function(e,o){r(e)===Jn&&(n.unshift({key:e,value:o}),n.length>t&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(u,l);function h(){var e=f.get(arguments);if(e===Jn){if(e=t.apply(null,arguments),c){var n=f.getEntries(),r=n.find((function(t){return c(t.value,e)}));r&&(e=r.value)}f.put(arguments,e)}return e}return h.clearCache=function(){return f.clear()},h}function tr(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every((function(t){return"function"==typeof t}))){var n=e.map((function(t){return"function"==typeof t?"function "+(t.name||"unnamed")+"()":typeof t})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return e}function er(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i,a=0,s={memoizeOptions:void 0},u=r.pop();if("object"==typeof u&&(s=u,u=r.pop()),"function"!=typeof u)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof u+"]");var c=s,l=c.memoizeOptions,f=void 0===l?n:l,h=Array.isArray(f)?f:[f],d=tr(r),p=t.apply(void 0,[function(){return a++,u.apply(null,arguments)}].concat(h)),v=t((function(){for(var t=[],e=d.length,n=0;n<e;n++)t.push(d[n].apply(null,arguments));return i=p.apply(null,t)}));return Object.assign(v,{resultFunc:u,memoizedResultFunc:p,dependencies:d,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),v};return o}var nr=er(Qn),rr=n(37163),or=n(23106);function ir(t,e){var n=t.createStructService(e),r=n.info();return Object.assign(r,{info:n.info.bind(n),convert:n.convert.bind(n),layout:n.layout.bind(n),clean:n.clean.bind(n),aromatize:n.aromatize.bind(n),dearomatize:n.dearomatize.bind(n),calculateCip:n.calculateCip.bind(n),automap:n.automap.bind(n),check:n.check.bind(n),calculate:n.calculate.bind(n),recognize:n.recognize.bind(n),generateImageAsBase64:n.generateImageAsBase64.bind(n)})}var ar=N.createContext({}),sr=N.createContext({}),ur=N.createContext({}),cr=N.createContext(null),lr=["H","C","N","O","S","P","F","Cl","Br","I"],fr={H:"h",C:"c",N:"n",O:"o",S:"s",P:"p",F:"f",Cl:"Shift+c",Br:"Shift+b",I:"i",A:"a"},hr=Object.keys(fr).reduce((function(t,e){return t["atom-".concat(e.toLowerCase())]={title:"Atom ".concat(e),shortcut:fr[e],action:{tool:"atom",opts:{label:e}}},t}),{});function dr(t){var e,r=n.g.currentState.editor,o=r.structSelected(),i=r.errorHandler;try{if(e="mol"===t?new I.jWx:new I.F_l,Boolean(o.simpleObjects.size||o.texts.size)&&e instanceof I.jWx)return i("This feature is not available for Simple objects and Text objects"),null;var a=e.serialize(o);window.clipboardData?window.clipboardData.setData("text",a):navigator.clipboard.writeText(a)}catch(t){i("This feature is not available in your browser")}}function pr(){return pr=(0,k.Z)(C().mark((function t(){var e,o,i,a,s,u,c,l,f,h,d,p;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.g.currentState,o=e.editor,i=e.server,a=e.options,s=o.structSelected(),u=o.errorHandler,t.prev=6,c=new I.Yyn(i),l=c.create("mol",a),t.next=11,l.getStructureFromStructAsync(s);case 11:return f=t.sent,h=new I.VA(o,i,{},c),t.next=15,h.generateImage(f,{outputFormat:"png",backgroundColor:"255, 255, 255"});case 15:return d=t.sent,p=new ClipboardItem((0,r.Z)({},d.type,d)),t.next=19,navigator.clipboard.write([p]);case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(6),u("This feature is not available in your browser");case 24:case"end":return t.stop()}}),t,null,[[6,21]])}))),pr.apply(this,arguments)}function vr(t,e){var n,r;return Boolean(null===(n=t.buttons)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.hidden)}var mr={"force-update":{shortcut:"Ctrl+Shift+r",action:function(t){t.update(!0)},hidden:function(t){return vr(t,"force-update")}},"qs-serialize":{shortcut:"Alt+Shift+r",action:function(t){var e=(new I.jWx).serialize(t.struct()),n="mol="+encodeURIComponent(e).replace(/%20/g,"+"),r=document.location.search;document.location.search=r?-1===r.search("mol=")?r+"&"+n:r.replace(/mol=[^&$]*/,n):"?"+n}},hidden:function(t){return vr(t,"qs-serialize")}};var gr=window.clipboardData,yr=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e;return(0,R.Z)(this,i),(e=r.call(this,t)).textAreaRef=(0,N.createRef)(),e}return(0,M.Z)(i,[{key:"componentDidMount",value:function(){var t=this,e=this.textAreaRef.current;this.target=this.props.target||e.parentNode,this.listeners={mouseup:function(n){var r;(e===n.target||!br(n.target)&&t.props.focused())&&((r=e).value=" ",r.focus(),r.select())},mousedown:function(t){t.shiftKey&&!br(t.target)&&t.preventDefault()},copy:function(e){if(t.props.focused()&&t.props.onCopy){var n=t.props.onCopy();n&&wr(e.clipboardData,n),e.preventDefault()}},cut:function(e){if(t.props.focused()&&t.props.onCut){var n=t.props.onCut();n&&wr(e.clipboardData,n),e.preventDefault()}},paste:function(e){if(t.props.focused()&&t.props.onPaste){var n=function(t,e){var n={};return!t&&gr?n["text/plain"]=gr.getData("text"):(n["text/plain"]=t.getData("text/plain"),n=e.reduce((function(e,n){var r=t.getData(n);return r&&(e[n]=r),e}),n)),n}(e.clipboardData,t.props.formats);n&&t.props.onPaste(n),e.preventDefault()}}},Object.keys(this.listeners).forEach((function(e){t.target.addEventListener(e,t.listeners[e])}))}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillUnmount",value:function(){var t=this;Object.keys(this.listeners).forEach((function(e){t.target.removeEventListener(e,t.listeners[e])}))}},{key:"render",value:function(){return(0,o.jsx)("textarea",{ref:this.textAreaRef,className:F("cliparea","cliparea-module_cliparea__2bRGh"),contentEditable:!0,autoFocus:!0,suppressContentEditableWarning:!0})}}]),i}(N.Component);function br(t){return("INPUT"!==t.tagName||"button"!==t.type)&&["INPUT","SELECT","TEXTAREA","OPTION","LABEL"].includes(t.tagName)}function wr(t,e){if(!t&&gr)gr.setData("text",e["text/plain"]);else{t.setData("text/plain",e["text/plain"]);try{Object.keys(e).forEach((function(n){t.setData(n,e[n])}))}catch(t){}}}var xr=["cut","copy","paste"];function Or(t){var e=document.queryCommandSupported(t);if(e)try{e=document.execCommand(t)||window.ClipboardEvent||gr}catch(t){e=!1}return e}function Er(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Er(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Sr={showValenceWarnings:{title:"Show valence warnings",type:"boolean",default:!0},atomColoring:{title:"Atom coloring",type:"boolean",default:!0},showStereoFlags:{title:"Show the Stereo flags",type:"boolean",default:!0},stereoLabelStyle:{title:"Label display at stereogenic centers",enum:[I.xKj.IUPAC,I.xKj.Classic,I.xKj.On,I.xKj.Off],enumNames:["IUPAC style","Classic","On","Off"],default:I.xKj.IUPAC},colorOfAbsoluteCenters:{title:" Color of Absolute Center",type:"string",default:"#ff0000"},colorOfAndCenters:{title:"Color of AND Centers",type:"string",default:"#0000cd"},colorOfOrCenters:{title:"Color of OR Centers",type:"string",default:"#228b22"},colorStereogenicCenters:{title:"Color stereogenic centers",enum:[I.SZr.LabelsOnly,I.SZr.BondsOnly,I.SZr.LabelsAndBonds,I.SZr.Off],enumNames:["Labels Only","Bonds Only","Labels And Bonds","Off"],default:I.SZr.LabelsOnly},autoFadeOfStereoLabels:{title:"Auto fade And/Or center labels",type:"boolean",default:!0},absFlagLabel:{title:"Text of Absolute flag",type:"String",default:"ABS (Chiral)"},andFlagLabel:{title:"Text of AND flag",type:"String",default:"AND Enantiomer"},mixedFlagLabel:{title:"Text of Mixed flag",type:"String",default:"Mixed"},orFlagLabel:{title:"Text of OR flag",type:"String",default:"OR Enantiomer"},font:{title:"Font",type:"string",default:"30px Arial"},fontsz:{title:"Font size",type:"integer",default:13,minimum:1,maximum:96},fontszsub:{title:"Sub font size",type:"integer",default:13,minimum:1,maximum:96},carbonExplicitly:{title:"Display carbon explicitly",type:"boolean",default:!1},showCharge:{title:"Display charge",type:"boolean",default:!0},showValence:{title:"Display valence",type:"boolean",default:!0},showHydrogenLabels:{title:"Show hydrogen labels",enum:["off","Hetero","Terminal","Terminal and Hetero","on"],default:"on"},aromaticCircle:{title:"Aromatic Bonds as circle",type:"boolean",default:!0},doubleBondWidth:{title:"Double bond width",type:"integer",default:6,minimum:1,maximum:96},bondThickness:{title:"Bond thickness",type:"integer",default:2,minimum:1,maximum:96},stereoBondWidth:{title:"Stereo (Wedge) bond width",type:"integer",default:6,minimum:1,maximum:96}},jr={"smart-layout":{title:"Smart-layout",type:"boolean",default:!0},"ignore-stereochemistry-errors":{title:"Ignore stereochemistry errors",type:"boolean",default:!0},"mass-skip-error-on-pseudoatoms":{title:"Ignore pseudoatoms at mass",type:"boolean",default:!1},"gross-formula-add-rsites":{title:"Add Rsites at mass calculation",type:"boolean",default:!0},"gross-formula-add-isotopes":{title:"Add Isotopes at mass calculation",type:"boolean",default:!0}},Ar=Object.keys(jr),Pr={miewMode:{title:"Display mode",enum:["LN","BS","LC"],enumNames:["Lines","Balls and Sticks","Licorice"],default:"LN"},miewTheme:{title:"Background color",enum:["light","dark"],enumNames:["Light","Dark"],default:"light"},miewAtomLabel:{title:"Label coloring",enum:["no","bright","blackAndWhite","black"],enumNames:["No","Bright","Black and White","Black"],default:"bright"}},kr=Object.keys(Pr),Tr={title:"Settings",type:"object",required:[],properties:_r(_r(_r(_r(_r({},{resetToSelect:{title:"Reset to Select Tool",enum:[!0,"paste",!1],enumNames:["on","After Paste","off"],default:"paste"},rotationStep:{title:"Rotation Step, º",type:"integer",minimum:1,maximum:90,default:15}}),Sr),jr),{showAtomIds:{title:"Show atom Ids",type:"boolean",default:!1},showBondIds:{title:"Show bonds Ids",type:"boolean",default:!1},showHalfBondIds:{title:"Show half bonds Ids",type:"boolean",default:!1},showLoopIds:{title:"Show loop Ids",type:"boolean",default:!1}}),Pr)};function Cr(){return Tr.properties?Object.keys(Tr.properties).reduce((function(t,e){return t[e]=Tr.properties[e].default,t}),{}):{}}var Rr="Your changes will be lost after the tab closing. See Help (Note 2).",Mr=function(){try{return localStorage}catch(t){return!1}},Ir=function(t){var e=null;try{e=JSON.parse(localStorage.getItem(t))}catch(t){}return e},Nr=function(t,e){var n=null;try{localStorage.setItem(t,JSON.stringify(e)),n=!0}catch(t){n=!1}return n};function Br(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Br(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Br(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Lr={app:{server:!1,templates:!1,functionalGroups:!1},analyse:{values:null,roundWeight:3,roundMass:3,roundElAnalysis:1},check:{checkOptions:["valence","radicals","pseudoatoms","stereo","query","overlapping_atoms","overlapping_bonds","rgroups","chiral","3d","chiral_flag"]},recognize:{file:null,structStr:null,fragment:!1,version:null},settings:Object.assign(Cr(),function(t){if("object"!==(0,G.Z)(t)||null===t)return null;var e=(new H.Validator).validate(t,Tr).errors.map((function(t){return t.property.split(".")[1]}));return Object.keys(t).reduce((function(n,r){return Tr.properties?(Tr.properties[r]&&-1===e.indexOf(r)&&(n[r]=t[r]),n):n}),{})}(Ir("ketcher-opts"))),getServerSettings:function(){return(0,V.pick)(Ar,this.settings)}};function Dr(t){return function(e){e({type:"APP_OPTIONS",data:t}),e({type:"UPDATE"})}}var zr=["SET_RECOGNIZE_STRUCT","CHANGE_RECOGNIZE_FILE","CHANGE_IMAGO_VERSION","IS_FRAGMENT_RECOGNIZE"];function Fr(t){return{type:"SET_RECOGNIZE_STRUCT",data:{structStr:t}}}function Gr(t,e){return t.oneOf.reduce((function(t,n){return t[function(t,e){var n=t.properties[e];return n.constant||n.enum[0]}(n,e)]=n,t}),{})}var Hr={enum:["Absolute","Relative","Attached"],default:"Absolute"},Vr={title:"Context",enum:["Fragment","Multifragment","Bond","Atom","Group"],default:"Fragment"},Ur={Fragment:{title:"Fragment",type:"Object",oneOf:[{key:"FRG_STR",title:"MDLBG_FRAGMENT_STEREO",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_FRAGMENT_STEREO"],default:"MDLBG_FRAGMENT_STEREO"},fieldValue:{title:"Field value",type:"array",items:{enum:["abs","(+)-enantiomer","(-)-enantiomer","racemate","steric","rel","R(a)","S(a)","R(p)","S(p)"]},default:["abs"]},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]},{key:"FRG_COEFF",title:"MDLBG_FRAGMENT_COEFFICIENT",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_FRAGMENT_COEFFICIENT"],default:"MDLBG_FRAGMENT_COEFFICIENT"},fieldValue:{title:"Field value",type:"string",default:"",minLength:1,invalidMessage:"Please, specify field name"},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]},{key:"FRG_CHRG",title:"MDLBG_FRAGMENT_CHARGE",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_FRAGMENT_CHARGE"],default:"MDLBG_FRAGMENT_CHARGE"},fieldValue:{title:"Field value",type:"string",default:"",minLength:1,invalidMessage:"Please, specify field name"},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]},{key:"FRG_RAD",title:"MDLBG_FRAGMENT_RADICALS",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_FRAGMENT_RADICALS"],default:"MDLBG_FRAGMENT_RADICALS"},fieldValue:{title:"Field value",type:"string",default:"",minLength:1,invalidMessage:"Please, specify field name"},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]}]},Multifragment:{title:"Multifragment",type:"Object",oneOf:[{key:"MLT_FRG",title:"KETCHER_MULTIPLE_FRAGMENT",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["KETCHER_MULTIPLE_FRAGMENT"],default:"KETCHER_MULTIPLE_FRAGMENT"},fieldValue:{title:"Field value",type:"array",items:{enum:["aerosol","alloy","catenane","complex","composite","co-polymer","emulsion","host-guest complex","mixture","rotaxane","suspension"]},default:["aerosol"]},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]}]},Bond:{title:"Bond",type:"Object",oneOf:[{key:"SB_STR",title:"MDLBG_STEREO_KEY",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_STEREO_KEY"],default:"MDLBG_STEREO_KEY"},fieldValue:{title:"Field value",type:"array",items:{enum:["erythro","threo","alpha","beta","endo","exo","anti","syn","ECL","STG"]},default:["erythro"]},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]},{key:"SB_BND",title:"MDLBG_BOND_KEY",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_BOND_KEY"],default:"MDLBG_BOND_KEY"},fieldValue:{title:"Field value",type:"array",items:{enum:["Value=4"]},default:["Value=4"]},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]}]},Atom:{title:"Atom",type:"Object",oneOf:[{key:"AT_STR",title:"MDLBG_STEREO_KEY",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_STEREO_KEY"],default:"MDLBG_STEREO_KEY"},fieldValue:{title:"Field value",type:"array",items:{enum:["RS","SR","P-3","P-3-PI","SP-4","SP-4-PI","T-4","T-4-PI","SP-5","SP-5-PI","TB-5","TB-5-PI","OC-6","TP-6","PB-7","CU-8","SA-8","DD-8","HB-9","TPS-9"]},default:["RS"]},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]}]},Group:{title:"Group",type:"Object",oneOf:[{key:"GRP_STR",title:"MDLBG_STEREO_KEY",properties:{type:{enum:["DAT"]},fieldName:{title:"Field name",enum:["MDLBG_STEREO_KEY"],default:"MDLBG_STEREO_KEY"},fieldValue:{title:"Field value",type:"array",items:{enum:["cis","trans"]},default:["cis"]},radiobuttons:Hr},required:["fieldName","fieldValue","radiobuttons"]}]}},qr={key:"Custom",properties:{type:{enum:["DAT"]},context:{title:"Context",enum:["Fragment","Multifragment","Bond","Atom","Group"],default:"Fragment"},fieldName:{title:"Field name",type:"string",default:"",minLength:1,invalidMessage:"Please, specify field name"},fieldValue:{title:"Field value",type:"string",default:"",minLength:1,invalidMessage:"Please, specify field value"},radiobuttons:{enum:["Absolute","Relative","Attached"],default:"Absolute"}},required:["context","fieldName","fieldValue","radiobuttons"]},Wr=Object.keys(Ur).reduce((function(t,e){return t[e]=Gr(Ur[e],"fieldName"),Object.keys(t[e]).forEach((function(n){t[e][n].properties.context=Vr})),t}),{});function Yr(t){return Object.keys(t)[0]}function $r(t,e){return t||e?e?Wr[t][e]?Wr[t][e].properties.fieldValue.default:"":Yr(Wr[t]):Yr(Wr)}function Kr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Jr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kr(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xr,Qr,to=function(t,e){var n=e.valid,r=e.errors,o=t.result,i=o.fieldName,a=o.fieldValue;return{result:t.result,valid:n&&!!i&&!!a,errors:r}},eo={atomProps:{errors:{},valid:!0,result:{label:"",charge:0,explicitValence:-1,hCount:0,invRet:0,isotope:0,radical:0,ringBondCount:0,substitutionCount:0}},attachmentPoints:{errors:{},valid:!0,result:{primary:!1,secondary:!1}},automap:{errors:{},valid:!0,result:{mode:"discard"}},bondProps:{errors:{},valid:!0,result:{type:"single",topology:0,center:0}},check:{errors:{},moleculeErrors:{}},labelEdit:{errors:{},valid:!0,result:{label:""}},rgroup:{errors:{},valid:!0,result:{values:[]}},rgroupLogic:{errors:{},valid:!0,result:{ifthen:0,range:">0",resth:!1}},save:{errors:{},valid:!0,result:{filename:"ketcher",format:"mol"}},settings:{errors:{},valid:!0,result:Cr()},sgroup:{errors:{},valid:!0,result:{type:"GEN"}},text:{errors:{},valid:!0,result:{}},attach:{errors:{},valid:!0,result:{}},sdata:(Xr=$r(),Qr=$r(Xr),{errors:{},valid:!0,result:{context:Xr,fieldName:Qr,fieldValue:$r(Xr,Qr),radiobuttons:"Absolute",type:"DAT"}})};function no(t){return{type:"UPDATE_FORM",data:t}}function ro(t,e,n){return"sdata"===n?function(t,e){if(e.data.result.init)return to(Jr(Jr({},t),{},{result:Object.assign({},t.result,e.data.result)}),e.data);var n=e.data.result.context,r=e.data.result.fieldName,o=null;return n!==t.result.context?o=function(t,e){var n=e.context,r=e.fieldValue,o=$r(n),i=r;return i===t.result.fieldValue&&(i=$r(n,o)),{result:Jr(Jr({},e),{},{context:n,fieldName:o,fieldValue:i})}}(t,e.data.result):r!==t.result.fieldName&&(o=function(t,e){var n=e.fieldName,r=t.result.context,o=e.fieldValue;return Wr[r][n]&&(o=$r(r,n)),o===t.result.fieldValue&&Wr[r][t.result.fieldName]&&(o=""),{result:Jr(Jr({},e),{},{fieldName:n,fieldValue:o})}}(t,e.data.result)),o=o||Jr(Jr({},t),{},{result:Object.assign({},t.result,e.data.result)}),to(o,e.data)}(t,e):Object.assign({},t,e.data)}var oo="INDIGO_VERIFICATION";function io(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ao(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?io(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):io(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function so(t){return{type:oo,data:t}}var uo={indigoVerification:!1},co={MUL:"MUL",SRU:"SRU",SUP:"SUP",DAT:"DAT",GEN:"GEN"},lo={title:"Atom",type:"object",required:"label",properties:{label:{title:"Label",type:"string",maxLength:3,invalidMessage:"Wrong label"},alias:{title:"Alias",type:"string",invalidMessage:"Leading and trailing spaces are not allowed"},charge:{title:"Charge",type:"string",pattern:/^([+-]?)(\d{1,3}|1000)([+-]?)$/,maxLength:5,default:"0",invalidMessage:"Invalid charge value"},explicitValence:{title:"Valence",enum:[-1,0,1,2,3,4,5,6,7,8],enumNames:["","0","I","II","III","IV","V","VI","VII","VIII"],default:-1},isotope:{title:"Isotope",type:"integer",minimum:0,default:0,invalidMessage:"There must be integer"},radical:{title:"Radical",enum:[0,2,1,3],enumNames:["","Monoradical","Diradical (singlet)","Diradical (triplet)"],default:0},ringBondCount:{title:"Ring bond count",enum:[0,-2,-1,2,3,4],enumNames:["","As drawn","0","2","3","4"],default:0},hCount:{title:"H count",enum:[0,1,2,3,4,5],enumNames:["","0","1","2","3","4"],default:0},substitutionCount:{title:"Substitution count",enum:[0,-2,-1,1,2,3,4,5,6],enumNames:["","As drawn","0","1","2","3","4","5","6"],default:0},unsaturatedAtom:{title:"Unsaturated",type:"boolean",default:!1},invRet:{title:"Inversion",enum:[0,1,2],enumNames:["","Inverts","Retains"],default:0},exactChangeFlag:{title:"Exact change",type:"boolean",default:!1}}},fo={title:"R-group",type:"object",properties:{values:{type:"array",items:{type:"string",enum:(0,V.range)(1,33),enumNames:(0,V.range)(1,33).map((function(t){return"R"+t}))}}}},ho={title:"Label Edit",type:"object",required:["label"],properties:{label:{title:"Atom",default:"",invalidMessage:"Wrong atom symbol"}}},po={title:"Attachment Points",type:"object",properties:{primary:{title:"Primary attachment point",type:"boolean"},secondary:{title:"Secondary attachment point",type:"boolean"}}},vo={title:"Bond",type:"object",required:["type"],properties:{type:{title:"Type",enum:["single","up","down","updown","double","crossed","triple","aromatic","any","hydrogen","singledouble","singlearomatic","doublearomatic","dative"],enumNames:["Single","Single Up","Single Down","Single Up/Down","Double","Double Cis/Trans","Triple","Aromatic","Any","Hydrogen","Single/Double","Single/Aromatic","Double/Aromatic","Dative"],default:"single"},topology:{title:"Topology",enum:[0,1,2],enumNames:["Either","Ring","Chain"],default:0},center:{title:"Reacting Center",enum:[0,-1,1,2,4,8,12],enumNames:["Unmarked","Not center","Center","No change","Made/broken","Order changes","Made/broken and changes"],default:0}}},mo=Gr({title:"SGroup",type:"object",required:["type"],oneOf:[{key:"GEN",title:"Generic",properties:{type:{enum:["GEN"]}}},{key:"MUL",title:"Multiple group",type:"object",properties:{type:{enum:["MUL"]},mul:{title:"Repeat count",type:"integer",default:1,minimum:1,maximum:1e3,invalidMessage:"Value out of range: must be between 1 and 1000"}},required:["mul"]},{key:"SRU",title:"SRU polymer",properties:{type:{enum:["SRU"]},subscript:{title:"Polymer label",type:"string",default:"n",pattern:/^[a-zA-Z]$/,invalidMessage:"SRU subscript should consist of a single letter"},connectivity:{title:"Repeat Pattern",enum:["ht","hh","eu"],enumNames:["Head-to-tail","Head-to-head","Either unknown"],default:"ht"}},required:["subscript","connectivity"]},{key:"SUP",title:"Superatom",properties:{type:{enum:["SUP"]},name:{title:"Name",type:"string",default:"",minLength:1,invalidMessage:"Please, provide a name for the superatom"}},required:["name"]}]},"type"),go={title:"R-Group",type:"object",properties:{range:{title:"Occurrence",type:"string",maxLength:50,invalidMessage:"Wrong value"},resth:{title:"RestH",type:"boolean"},ifthen:{title:"Condition",type:"integer",minium:0}}},yo={title:"Template Edit",type:"object",required:["name"],properties:{name:{title:"Template name",type:"string",minLength:1,maxLength:128,invalidMessage:"Template must have a unique name and no more than 128 symbols in length"}}},bo=["type","radiobuttons"];function wo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wo(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Oo(t){return"R#"===t.label?xo({type:"rlabel",values:So(t.rglabel)},t):"L#"===t.label?{type:(e=t).atomList.notList?"not-list":"list",values:e.atomList.ids.map((function(t){return I.eKO.get(t).label}))}:I.eKO.get(t.label)?function(t){var e=t.alias||"",n=t.charge.toString();return{alias:e,label:t.label,charge:n,isotope:t.isotope,explicitValence:t.explicitValence,radical:t.radical,invRet:t.invRet,exactChangeFlag:!!t.exactChangeFlag,ringBondCount:t.ringBondCount,substitutionCount:t.substitutionCount,unsaturatedAtom:!!t.unsaturatedAtom,hCount:t.hCount,stereoParity:t.stereoParity}}(t):!t.label&&"attpnt"in t?{ap:(n=t.attpnt,{primary:(1&(n||0))>0,secondary:(2&(n||0))>0})}:t;var e,n}function Eo(t){return"rlabel"===t.type?{label:t.values.length?"R#":"C",rglabel:0===t.values.length?null:(e=t.values,n=0,e.forEach((function(t){n|=1<<t-1})),n)}:"list"===t.type||"not-list"===t.type?function(t){return{pseudo:null,label:"L#",atomList:new I.Ilx({notList:"not-list"===t.type,ids:t.values.map((function(t){return I.eKO.get(t).number}))})}}(t):!t.label&&"ap"in t?{attpnt:(r=t.ap,(r.primary&&1)+(r.secondary&&2))}:I.eKO.get((0,V.capitalize)(t.label))?_o(t):"A"===t.label||"*"===t.label||"Q"===t.label||"X"===t.label||"R"===t.label?(t.pseudo=t.label,_o(t)):t;var e,n,r}function _o(t){var e=lo.properties.charge.pattern.exec(t.charge),n=e?parseInt(e[1]+e[3]+e[2]):t.charge,r=Object.assign({},t,{label:(0,V.capitalize)(t.label),alias:t.alias||null});return void 0!==n&&(r.charge=n),r}function So(t){var e,n,r=[];for(e=0;e<32;e++)t&1<<e&&(n=e+1,r.push(n));return r}function jo(t){return xo({topology:t.topology,reactingCenterStatus:t.center},Ao(t.type))}function Ao(t){return Object.assign({},ko[t])}function Po(t,e){for(var n in ko)if(ko[n].type===t&&ko[n].stereo===e)return n;throw Error("No such bond caption")}var ko={single:{type:I.fYe.PATTERN.TYPE.SINGLE,stereo:I.fYe.PATTERN.STEREO.NONE},up:{type:I.fYe.PATTERN.TYPE.SINGLE,stereo:I.fYe.PATTERN.STEREO.UP},down:{type:I.fYe.PATTERN.TYPE.SINGLE,stereo:I.fYe.PATTERN.STEREO.DOWN},updown:{type:I.fYe.PATTERN.TYPE.SINGLE,stereo:I.fYe.PATTERN.STEREO.EITHER},double:{type:I.fYe.PATTERN.TYPE.DOUBLE,stereo:I.fYe.PATTERN.STEREO.NONE},crossed:{type:I.fYe.PATTERN.TYPE.DOUBLE,stereo:I.fYe.PATTERN.STEREO.CIS_TRANS},triple:{type:I.fYe.PATTERN.TYPE.TRIPLE,stereo:I.fYe.PATTERN.STEREO.NONE},aromatic:{type:I.fYe.PATTERN.TYPE.AROMATIC,stereo:I.fYe.PATTERN.STEREO.NONE},singledouble:{type:I.fYe.PATTERN.TYPE.SINGLE_OR_DOUBLE,stereo:I.fYe.PATTERN.STEREO.NONE},singlearomatic:{type:I.fYe.PATTERN.TYPE.SINGLE_OR_AROMATIC,stereo:I.fYe.PATTERN.STEREO.NONE},doublearomatic:{type:I.fYe.PATTERN.TYPE.DOUBLE_OR_AROMATIC,stereo:I.fYe.PATTERN.STEREO.NONE},any:{type:I.fYe.PATTERN.TYPE.ANY,stereo:I.fYe.PATTERN.STEREO.NONE},hydrogen:{type:I.fYe.PATTERN.TYPE.HYDROGEN,stereo:I.fYe.PATTERN.STEREO.NONE},dative:{type:I.fYe.PATTERN.TYPE.DATIVE,stereo:I.fYe.PATTERN.STEREO.NONE}};function To(t){var e=t.type||"GEN",n=t.attrs,r=n.context,o=n.fieldName,i=n.fieldValue,a=n.absolute,s=n.attached;return t.attrs.radiobuttons=!1===a&&!1===s?"Relative":s?"Attached":"Absolute",Wr[r][o]&&Wr[r][o].properties.fieldValue.items&&(t.attrs.fieldValue=i.split("\n")),Object.assign({type:e},t.attrs)}function Co(t){var e=t.type,n=t.radiobuttons,r=xo({},(0,B.Z)(t,bo));switch(n){case"Absolute":r.absolute=!0,r.attached=!1;break;case"Attached":r.absolute=!1,r.attached=!0;break;case"Relative":r.absolute=!1,r.attached=!1}return r.fieldName&&(r.fieldName=r.fieldName.trim()),r.fieldValue&&(r.fieldValue="string"==typeof r.fieldValue?r.fieldValue.trim():r.fieldValue),{type:e,attrs:r}}var Ro={"select-lasso":{title:"Lasso Selection",shortcut:"Escape",action:{tool:"select",opts:"lasso"}},"select-rectangle":{title:"Rectangle Selection",shortcut:"Escape",action:{tool:"select",opts:"rectangle"},hidden:function(t){return vr(t,"select-rectangle")}},"select-fragment":{title:"Fragment Selection",shortcut:"Escape",action:{tool:"select",opts:"fragment"},hidden:function(t){return vr(t,"select-fragment")}},erase:{title:"Erase",shortcut:["Delete","Backspace"],action:{tool:"eraser",opts:1},hidden:function(t){return vr(t,"erase")}},chain:{title:"Chain",action:{tool:"chain"},hidden:function(t){return vr(t,"chain")}},"enhanced-stereo":{shortcut:"Alt+e",title:"Stereochemistry",action:{tool:"enhancedStereo"},hidden:function(t){return vr(t,"enhanced-stereo")}},"charge-plus":{shortcut:"5",title:"Charge Plus",action:{tool:"charge",opts:1},hidden:function(t){return vr(t,"charge-plus")}},"charge-minus":{shortcut:"5",title:"Charge Minus",action:{tool:"charge",opts:-1},hidden:function(t){return vr(t,"charge-minus")}},transforms:{hidden:function(t){return vr(t,"transforms")}},"transform-rotate":{shortcut:"Alt+r",title:"Rotate Tool",action:{tool:"rotate"},hidden:function(t){return vr(t,"transform-rotate")}},"transform-flip-h":{shortcut:"Alt+h",title:"Horizontal Flip",action:{tool:"rotate",opts:"horizontal"},hidden:function(t){return vr(t,"transform-flip-h")}},"transform-flip-v":{shortcut:"Alt+v",title:"Vertical Flip",action:{tool:"rotate",opts:"vertical"},hidden:function(t){return vr(t,"transform-flip-v")}},sgroup:{shortcut:"Mod+g",title:"S-Group",action:{tool:"sgroup"},hidden:function(t){return vr(t,"sgroup")}},"sgroup-data":{shortcut:"Mod+g",title:"Data S-Group",action:{tool:"sgroup",opts:"DAT"},hidden:function(t){return vr(t,"sgroup-data")}},arrows:{hidden:function(t){return vr(t,"arrows")}},"reaction-arrow-open-angle":{title:"Arrow Open Angle Tool",action:{tool:"reactionarrow",opts:I.mWk.OpenAngle},hidden:function(t){return vr(t,"reaction-arrow-open-angle")}},"reaction-arrow-filled-triangle":{title:"Arrow Filled Triangle",action:{tool:"reactionarrow",opts:I.mWk.FilledTriangle},hidden:function(t){return vr(t,"reaction-arrow-filled-triangle")}},"reaction-arrow-filled-bow":{title:"Arrow Filled Bow Tool",action:{tool:"reactionarrow",opts:I.mWk.FilledBow},hidden:function(t){return vr(t,"reaction-arrow-filled-bow")}},"reaction-arrow-dashed-open-angle":{title:"Arrow Dashed Open Angle Tool",action:{tool:"reactionarrow",opts:I.mWk.DashedOpenAngle},hidden:function(t){return vr(t,"reaction-arrow-dashed-open-angle")}},"reaction-arrow-failed":{title:"Failed Arrow Tool",action:{tool:"reactionarrow",opts:I.mWk.Failed},hidden:function(t){return vr(t,"reaction-arrow-failed")}},"reaction-arrow-both-ends-filled-triangle":{title:"Arrow Both Ends Filled Triangle Tool",action:{tool:"reactionarrow",opts:I.mWk.BothEndsFilledTriangle},hidden:function(t){return vr(t,"reaction-arrow-both-ends-filled-triangle")}},"reaction-arrow-equilibrium-filled-half-bow":{title:"Arrow Equilibrium Filled Half Bow Tool",action:{tool:"reactionarrow",opts:I.mWk.EquilibriumFilledHalfBow},hidden:function(t){return vr(t,"reaction-arrow-equilibrium-filled-half-bow")}},"reaction-arrow-equilibrium-filled-triangle":{title:"Arrow Equilibrium Filled Triangle Tool",action:{tool:"reactionarrow",opts:I.mWk.EquilibriumFilledTriangle},hidden:function(t){return vr(t,"reaction-arrow-equilibrium-filled-triangle")}},"reaction-arrow-equilibrium-open-angle":{title:"Arrow Equilibrium Open Angle Tool",action:{tool:"reactionarrow",opts:I.mWk.EquilibriumOpenAngle},hidden:function(t){return vr(t,"reaction-arrow-equilibrium-open-angle")}},"reaction-arrow-unbalanced-equilibrium-filled-half-bow":{title:"Arrow Unbalanced Equilibrium Filled Half Bow Tool",action:{tool:"reactionarrow",opts:I.mWk.UnbalancedEquilibriumFilledHalfBow},hidden:function(t){return vr(t,"reaction-arrow-unbalanced-equilibrium-filled-half-bow")}},"reaction-arrow-unbalanced-equilibrium-open-half-angle":{title:"Arrow Unbalanced Equilibrium Open Half Angle Tool",action:{tool:"reactionarrow",opts:I.mWk.UnbalancedEquilibriumOpenHalfAngle},hidden:function(t){return vr(t,"reaction-arrow-unbalanced-equilibrium-open-half-angle")}},"reaction-arrow-unbalanced-equilibrium-large-filled-half-bow":{title:"Arrow Unbalanced Equilibrium Large Filled Half Bow Tool",action:{tool:"reactionarrow",opts:I.mWk.UnbalancedEquilibriumLargeFilledHalfBow},hidden:function(t){return vr(t,"reaction-arrow-unbalanced-equilibrium-large-filled-half-bow")}},"reaction-arrow-unbalanced-equilibrium-filled-half-triangle":{title:"Arrow Unbalanced Equilibrium Filled Half Triangle Tool",action:{tool:"reactionarrow",opts:I.mWk.UnbalancedEquilibriumFilleHalfTriangle},hidden:function(t){return vr(t,"reaction-arrow-unbalanced-equilibrium-filled-half-triangle")}},"reaction-plus":{title:"Reaction Plus Tool",action:{tool:"reactionplus"},hidden:function(t){return vr(t,"reaction-plus")}},"reaction-mapping-tools":{hidden:function(t){return vr(t,"reaction-mapping-tools")}},"reaction-map":{title:"Reaction Mapping Tool",action:{tool:"reactionmap"},hidden:function(t){return vr(t,"reaction-map")}},"reaction-unmap":{title:"Reaction Unmapping Tool",action:{tool:"reactionunmap"},hidden:function(t){return vr(t,"reaction-unmap")}},rgroup:{hidden:function(t){return vr(t,"rgroup")}},"rgroup-label":{shortcut:"Mod+r",title:"R-Group Label Tool",action:{tool:"rgroupatom"},hidden:function(t){return vr(t,"rgroup-label")}},"rgroup-fragment":{shortcut:["Mod+Shift+r","Mod+r"],title:"R-Group Fragment Tool",action:{tool:"rgroupfragment"},hidden:function(t){return vr(t,"rgroup-fragment")}},"rgroup-attpoints":{shortcut:"Mod+r",title:"Attachment Point Tool",action:{tool:"apoint"},hidden:function(t){return vr(t,"rgroup-attpoints")}},shapes:{hidden:function(t){return vr(t,"shapes")}},"shape-ellipse":{title:"Shape Ellipse",action:{tool:"simpleobject",opts:I.gN2.ellipse},hidden:function(t){return vr(t,"shape-ellipse")}},"shape-rectangle":{title:"Shape Rectangle",action:{tool:"simpleobject",opts:I.gN2.rectangle},hidden:function(t){return vr(t,"shape-rectangle")}},"shape-line":{title:"Shape Line",action:{tool:"simpleobject",opts:I.gN2.line},hidden:function(t){return vr(t,"shape-line")}},text:{title:"Add text",action:{tool:"text"},hidden:function(t){return vr(t,"text")}},bonds:{hidden:function(t){return vr(t,"bonds")}}},Mo={single:"1",double:"2",triple:"3",up:"1",down:"1",updown:"1",crossed:"2",any:"0",aromatic:"4"},Io=vo.properties.type,No=Io.enum.reduce((function(t,e,n){return t["bond-".concat(e)]={title:"".concat(Io.enumNames[n]," Bond"),shortcut:Mo[e],action:{tool:"bond",opts:Ao(e)},hidden:function(t){return vr(t,"bond-".concat(e))}},t}),Ro),Bo=["rescale","fragment"];function Zo(t){return t&&t.dialog?{type:"MODAL_OPEN",data:{name:t.dialog}}:t&&t.thunk?t.thunk:{type:"ACTION",action:t}}function Lo(t,e){return function(n,r){var o=r(),i=o.editor,a=o.server,s=i.errorHandler;return function(t,e,n){if("string"==typeof t){var r=n=n||{};r.rescale,r.fragment;var o=(0,B.Z)(r,Bo),i=(0,I.lv1)(t);return new I.Yyn(e).create(i,o).getStructureFromStringAsync(t)}return Promise.resolve(t)}(t,a,e=e||{}).then((function(t){var r=e.fragment;if(t.sgroups.some((function(t){return!co[t.type]}))){if(!window.confirm("Unsupported S-group type found. Would you like to import structure without it?"))return;t.sgroups=t.sgroups.filter((function(t,e){return co[e.type]}))}if(t.rescale(),i.struct().atoms.size){var o=i.struct().clone();t.sgroups.forEach((function(e,n){var r=I.j1n.getOffset(o.sgroups.get(n)),i=new I.UE_(e.atoms),a=I.j1n.getCrossBonds(t,i);I.j1n.bracketPos(e,t,a),r&&e.updateOffset(r)}))}t.findConnectedComponents(),t.setImplicitHydrogen();var a=(0,I.jnZ)(t,Array.from(t.bonds.values()));t.atoms.forEach((function(e,n){if(0===t.atomGetNeighbors(n).length)e.stereoLabel=null,e.stereoParity=0;else{var r=a.get(n);r&&(e.stereoLabel=r.stereoLabel,e.stereoParity=r.stereoParity)}})),t.markFragments(),r?t.isBlank()?n({type:"ACTION",action:No["select-lasso"].action}):n(Zo({tool:"paste",opts:t})):i.struct(t),n({type:"MODAL_CLOSE"})}),(function(t){s(t.message)})).catch((function(t){s(t.message)}))}}function Do(t){return function(e,n){var r=n(),o=r.editor,i=r.server,a=function(t,e){var n={};if(e.includes("chiral_flag")&&Array.from(t.frags.values()).some((function(t){return!!t&&"abs"===t.enhancedStereoFlag}))&&(n.chiral_flag="Chiral flag is present on the canvas"),e.includes("valence")){var r=0;t.atoms.forEach((function(t){return t.badConn&&r++})),r>0&&(n.valence="Structure contains ".concat(r," atom").concat(1!==r?"s":""," with bad valence"))}return n}(o.struct(),t),s=n().options.getServerSettings();return s.data={types:(0,V.without)(["valence","chiral_flag"],t)},Fo(o,i,"check",s).then((function(t){t=Object.assign(t,a),e({type:"UPDATE_FORM",data:{moleculeErrors:t}})})).catch((function(t){o.errorHandler(t)}))}}function zo(t,e,n){return function(r,o){var i=o(),a=i.options.getServerSettings();a.data=e,r(so(!0)),Fo(i.editor,i.server,t,a,n).then((function(e){var n=(new I.F_l).deserialize(e.struct);return r(Lo(n,{rescale:"layout"===t,reactionRelayout:"clean"===t}))})).catch((function(t){i.editor.errorHandler(t)})).finally((function(){r(so(!1))}))}}function Fo(t,e,n,r,o){var i=t.selection(),a=[],s=new Map,u=(o||t.struct()).clone(null,null,!1,s);i&&(a=(i.atoms?i.atoms:t.explicitSelected().atoms).map((function(t){return s.get(t)})));var c=new I.F_l;return e.then((function(){return e[n](Object.assign({struct:c.serialize(u)},"calculate"!==n&&"check"!==n?{output_format:I.hxV.KET}:null,a&&a.length>0?{selected:a}:null,r.data),(0,V.omit)("data",r))}))}var Go={layout:{shortcut:"Mod+l",title:"Layout",action:{thunk:zo("layout")},disabled:function(t,e,n){return!n.app.server},hidden:function(t){return vr(t,"layout")}},clean:{shortcut:"Mod+Shift+l",title:"Clean Up",action:{thunk:zo("clean")},disabled:function(t,e,n){return!n.app.server},hidden:function(t){return vr(t,"clean")}},arom:{title:"Aromatize",action:{thunk:zo("aromatize")},disabled:function(t,e,n){return!n.app.server},hidden:function(t){return vr(t,"arom")}},dearom:{title:"Dearomatize",action:{thunk:zo("dearomatize")},disabled:function(t,e,n){return!n.app.server},hidden:function(t){return vr(t,"dearom")}},cip:{shortcut:"Mod+p",title:"Calculate CIP",action:{thunk:zo("calculateCip")},disabled:function(t,e,n){return!n.app.server},hidden:function(t){return vr(t,"cip")}},check:{title:"Check Structure",action:{dialog:"check"},disabled:function(t,e,n){return!n.app.server},hidden:function(t){return vr(t,"check")}},analyse:{title:"Calculated Values",action:{dialog:"analyse"},disabled:function(t,e,n){return!n.app.server},hidden:function(t){return vr(t,"analyse")}},recognize:{title:"Recognize Molecule",action:{dialog:"recognize"},disabled:function(t,e,r){return!r.app.server||n.g.ketcher.standalone||!r.app.imagoVersions},hidden:function(t){return vr(t,"recognize")}},miew:{title:"3D Viewer",action:{dialog:"miew"},disabled:function(){return!window.Miew},hidden:function(t){return vr(t,"miew")}}},Ho=new I.jWx,Vo=["Benzene\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 6 6 0 0 0 999 V2000\n 0.8660 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7320 1.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7320 0.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.8660 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.0000 0.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.0000 1.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 2 0 0 0\n 3 4 1 0 0 0\n 4 5 2 0 0 0\n 5 6 1 0 0 0\n 6 1 2 0 0 0\nM END\n","Cyclopentadiene\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 5 5 0 0 0 999 V2000\n 0.0000 1.4257 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.8090 0.8379 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.5000 -0.1132 0.0000 C 0 0 0 0 0 0 0 0 0\n -0.5000 -0.1132 0.0000 C 0 0 0 0 0 0 0 0 0\n -0.8090 0.8379 0.0000 C 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 2 0 0 0\n 3 4 1 0 0 0\n 4 5 2 0 0 0\n 5 1 1 0 0 0\nM END\n","Cyclohexane\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 6 6 0 0 0 999 V2000\n 0.8660 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7320 1.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7320 0.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.8660 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.0000 0.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.0000 1.5000 0.0000 C 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 6 1 0 0 0\n 6 1 1 0 0 0\nM END\n","Cyclopentane\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 5 5 0 0 0 999 V2000\n 0.8090 1.5389 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.6180 0.9511 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.3090 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.3090 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.0000 0.9511 0.0000 C 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\nM END\n","Cyclopropane\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 3 3 0 0 0 999 V2000\n -3.2250 -0.2750 0.0000 C 0 0 0 0 0 0 0 0 0\n -2.2250 -0.2750 0.0000 C 0 0 0 0 0 0 0 0 0\n -2.7250 0.5910 0.0000 C 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 1 3 1 0 0 0\nM END\n","Cyclobutane\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 4 4 0 0 0 999 V2000\n -3.8250 1.5500 0.0000 C 0 0 0 0 0 0 0 0 0\n -3.8250 0.5500 0.0000 C 0 0 0 0 0 0 0 0 0\n -2.8250 1.5500 0.0000 C 0 0 0 0 0 0 0 0 0\n -2.8250 0.5500 0.0000 C 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 1 3 1 0 0 0\n 3 4 1 0 0 0\n 4 2 1 0 0 0\nM END\n","Cycloheptane\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 7 7 0 0 0 999 V2000\n 0.0000 1.6293 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.7835 2.2465 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7559 2.0242 0.0000 C 0 0 0 0 0 0 0 0 0\n 2.1897 1.1289 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.0000 0.6228 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7566 0.2224 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.7835 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 6 7 1 0 0 0\n 5 7 1 0 0 0\n 1 5 1 0 0 0\n 4 6 1 0 0 0\n 3 4 1 0 0 0\n 2 3 1 0 0 0\n 1 2 1 0 0 0\nM END\n","Cyclooctane\n Ketcher 11161218352D 1 1.00000 0.00000 0\n\n 8 8 0 0 0 999 V2000\n 0.0000 0.7053 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.0000 1.7078 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.7053 2.4131 0.0000 C 0 0 0 0 0 0 0 0 0\n 0.7056 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7079 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0\n 2.4133 0.7053 0.0000 C 0 0 0 0 0 0 0 0 0\n 2.4133 1.7078 0.0000 C 0 0 0 0 0 0 0 0 0\n 1.7079 2.4131 0.0000 C 0 0 0 0 0 0 0 0 0\n 8 3 1 0 0 0\n 7 8 1 0 0 0\n 6 7 1 0 0 0\n 5 6 1 0 0 0\n 4 5 1 0 0 0\n 1 4 1 0 0 0\n 2 3 1 0 0 0\n 1 2 1 0 0 0\nM END\n"].map((function(t){return Ho.deserialize(t)})),Uo={"template-lib":{shortcut:"Shift+t",title:"Custom Templates",action:{dialog:"templates"},selected:function(t){return"classic"===t._tool.mode},disabled:function(t,e,n){return!n.app.templates},hidden:function(t){return vr(t,"template-lib")}}},qo=Vo.reduce((function(t,e,n){return t["template-".concat(n)]={title:"".concat(e.name),shortcut:"t",action:{tool:"template",opts:{struct:e}}},t}),Uo),Wo=[.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,1.7,2,2.5,3,3.5,4],Yo={zoom:{selected:function(t){return t.zoom()},hidden:function(t){return vr(t,"zoom")}},"zoom-out":{shortcut:["-","_","Shift+-"],title:"Zoom Out",disabled:function(t){return t.zoom()<=Wo[0]},action:function(t){var e=t.zoom(),n=(0,V.findIndex)((function(t){return t>=e}),Wo);t.zoom(Wo[Wo[n]===e&&n>0?n-1:n])},hidden:function(t){return vr(t,"zoom-out")}},"zoom-in":{shortcut:["+","=","Shift+="],title:"Zoom In",disabled:function(t){return Wo[Wo.length-1]<=t.zoom()},action:function(t){var e=t.zoom(),n=(0,V.findLastIndex)((function(t){return t<=e}),Wo);t.zoom(Wo[Wo[n]===e&&n<Wo.length-1?n+1:n])},hidden:function(t){return vr(t,"zoom-in")}},"zoom-list":{hidden:function(t){return vr(t,"zoom-list")}}},$o={"functional-groups":{shortcut:"Shift+f",title:"Functional Groups",action:{dialog:"fGroups"},selected:function(t){return"fg"===t._tool.mode},disabled:function(t,e,n){return!n.app.functionalGroups},hidden:function(t){return vr(t,"functional-groups")}}};function Ko(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Jo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ko(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ko(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xo,Qo,ti,ei,ni,ri,oi,ii,ai,si,ui,ci,li,fi,hi,di,pi,vi,mi,gi,yi,bi,wi,xi,Oi,Ei,_i,Si,ji,Ai,Pi,ki,Ti,Ci,Ri,Mi,Ii,Ni,Bi,Zi,Li,Di,zi,Fi,Gi,Hi,Vi,Ui,qi,Wi,Yi,$i,Ki,Ji,Xi,Qi,ta,ea,na,ra,oa,ia,aa,sa,ua,ca,la,fa,ha,da,pa,va,ma,ga,ya,ba,wa,xa,Oa,Ea,_a,Sa,ja,Aa,Pa,ka,Ta,Ca,Ra,Ma,Ia,Na,Ba,Za,La,Da,za,Fa,Ga,Ha,Va,Ua,qa,Wa,Ya,$a,Ka,Ja,Xa,Qa,ts,es,ns,rs,os,is,as,ss,us,cs,ls,fs,hs,ds,ps,vs=Jo(Jo(Jo(Jo(Jo(Jo(Jo({clear:{shortcut:"Mod+Delete",title:"Clear Canvas",action:{thunk:function(t,e){var n=e().editor;n.struct().isBlank()||n.struct(null),t({type:"ACTION",action:No["select-lasso"].action})}},hidden:function(t){return vr(t,"clear")}},open:{shortcut:"Mod+o",title:"Open…",action:{dialog:"open"},hidden:function(t){return vr(t,"open")}},save:{shortcut:"Mod+s",title:"Save As…",action:{dialog:"save"},hidden:function(t){return vr(t,"save")}},undo:{shortcut:"Mod+z",title:"Undo",action:function(t){t.undo()},disabled:function(t){return 0===t.historySize().undo},hidden:function(t){return vr(t,"undo")}},redo:{shortcut:["Mod+Shift+z","Mod+y"],title:"Redo",action:function(t){t.redo()},disabled:function(t){return 0===t.historySize().redo},hidden:function(t){return vr(t,"redo")}},cut:{shortcut:"Mod+x",title:"Cut",action:function(t){Or("cut")||gs("Cut",t.errorHandler)},disabled:function(t){return!ms(t)},hidden:function(t){return vr(t,"cut")}},copies:{disabled:function(t){return!ms(t)},hidden:function(t){return vr(t,"copies")}},copy:{shortcut:"Mod+c",title:"Copy",action:function(t){Or("copy")||gs("Copy",t.errorHandler)},disabled:function(t){return!ms(t)},hidden:function(t){return vr(t,"copy")}},"copy-image":{shortcut:"Mod+Shift+f",title:"Copy Image",action:function(){!function(){pr.apply(this,arguments)}()},disabled:function(t){return!ms(t)},hidden:function(t){return vr(t,"copy-image")}},"copy-mol":{shortcut:"Mod+m",title:"Copy as MOL",action:function(){dr("mol")},disabled:function(t){return!ms(t)},hidden:function(t){return vr(t,"copy-mol")}},"copy-ket":{shortcut:"Mod+Shift+k",title:"Copy as KET",action:function(){dr("ket")},disabled:function(t){return!ms(t)},hidden:function(t){return vr(t,"copy-ket")}},paste:{shortcut:"Mod+v",title:"Paste",action:function(t){Or("paste")||gs("Paste",t.errorHandler)},selected:function(t){var e=t.actions;return e&&e.active&&"paste"===e.active.tool},hidden:function(t){return vr(t,"paste")}},settings:{title:"Settings",action:{dialog:"settings"},hidden:function(t){return vr(t,"settings")}},help:{hidden:function(t){return vr(t,"help")}},about:{title:"About",action:{dialog:"about"},hidden:function(t){return vr(t,"about")}},"reaction-automap":{title:"Reaction Auto-Mapping Tool",action:{dialog:"automap"},hidden:function(t){return vr(t,"reaction-automap")},disabled:function(t,e,n){return!n.app.server||!t.struct().hasRxnArrow()}},"period-table":{title:"Periodic Table",action:{dialog:"period-table"},hidden:function(t){return vr(t,"period-table")}},"select-all":{title:"Select All",shortcut:"Mod+a",action:{thunk:function(t,e){e().editor.selection("all");var n=e().toolbar.visibleTools.select;t({type:"ACTION",action:No[n].action})}},hidden:function(t){return vr(t,"select-all")}},"deselect-all":{title:"Deselect All",shortcut:"Mod+Shift+a",action:function(t){t.selection(null)},hidden:function(t){return vr(t,"deselect-all")}},"select-descriptors":{title:"Select descriptors",shortcut:"Mod+d",action:{thunk:function(t,e){var n=e().toolbar.visibleTools.select,r=e().editor;r.alignDescriptors(),r.selection("descriptors"),t({type:"ACTION",action:No[n].action})}},hidden:function(t){return vr(t,"select-descriptors")}}},Go),mr),No),hr),Yo),qo),$o);function ms(t){var e=t.selection();return e&&Object.keys(e).filter((function(t){return!["sgroupData"].includes(t)})).length>0}function gs(t,e){e("This action is unavailable via menu.\nInstead, use shortcut to "+t+".")}function ys(){return ys=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ys.apply(this,arguments)}function bs(){return bs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bs.apply(this,arguments)}function ws(){return ws=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ws.apply(this,arguments)}function xs(){return xs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xs.apply(this,arguments)}function Os(){return Os=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Os.apply(this,arguments)}function Es(){return Es=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Es.apply(this,arguments)}function _s(){return _s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_s.apply(this,arguments)}function Ss(){return Ss=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ss.apply(this,arguments)}function js(){return js=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},js.apply(this,arguments)}function As(){return As=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},As.apply(this,arguments)}function Ps(){return Ps=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ps.apply(this,arguments)}function ks(){return ks=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ks.apply(this,arguments)}function Ts(){return Ts=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ts.apply(this,arguments)}function Cs(){return Cs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Cs.apply(this,arguments)}function Rs(){return Rs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Rs.apply(this,arguments)}function Ms(){return Ms=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ms.apply(this,arguments)}function Is(){return Is=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Is.apply(this,arguments)}function Ns(){return Ns=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ns.apply(this,arguments)}function Bs(){return Bs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Bs.apply(this,arguments)}function Zs(){return Zs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Zs.apply(this,arguments)}function Ls(){return Ls=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ls.apply(this,arguments)}function Ds(){return Ds=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ds.apply(this,arguments)}function zs(){return zs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zs.apply(this,arguments)}function Fs(){return Fs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Fs.apply(this,arguments)}function Gs(){return Gs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Gs.apply(this,arguments)}function Hs(t){return N.createElement("svg",Gs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),_i||(_i=N.createElement("path",{d:"M233.625 137.25c-15.751 0-27.469 13.865-27.469 29.063V946.03c0 15.216 11.72 28.969 27.469 28.969h591.656l3.688-3.406L959.656 850.53l4.125-3.781V166.312c0-15.295-11.722-29.062-27.468-29.062zm0 25.688h702.688c.275 0 1.78.697 1.78 3.375V835.53L815.25 949.313H233.625c-.376 0-1.813-.73-1.813-3.282V166.313c0-2.776 1.337-3.375 1.813-3.375zm124.774 606.965h472.74v21.362H358.4zm0-113.538h472.74v21.413H358.4zm0-113.59h472.74v21.414H358.4zm0-113.537h472.74v21.413H358.4zm0-113.538h472.74v21.362H358.4zM63.687 25C47.883 25 36.22 38.927 36.22 54.125v779.594c0 15.23 11.611 29.125 27.468 29.125h142.47v-25.657H63.686c-.266 0-1.78-.83-1.78-3.468V54.125c0-2.775 1.359-3.438 1.78-3.438h702.688c.22 0 1.813.76 1.813 3.438v83.125h25.656V54.125C793.844 38.83 782.176 25 766.375 25z"})))}function Vs(){return Vs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Vs.apply(this,arguments)}function Us(){return Us=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Us.apply(this,arguments)}function qs(){return qs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},qs.apply(this,arguments)}function Ws(){return Ws=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ws.apply(this,arguments)}function Ys(){return Ys=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ys.apply(this,arguments)}function $s(){return $s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$s.apply(this,arguments)}function Ks(){return Ks=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ks.apply(this,arguments)}function Js(){return Js=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Js.apply(this,arguments)}function Xs(){return Xs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xs.apply(this,arguments)}function Qs(){return Qs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qs.apply(this,arguments)}function tu(){return tu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tu.apply(this,arguments)}function eu(){return eu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},eu.apply(this,arguments)}function nu(){return nu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nu.apply(this,arguments)}function ru(){return ru=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ru.apply(this,arguments)}function ou(){return ou=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ou.apply(this,arguments)}function iu(){return iu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},iu.apply(this,arguments)}function au(){return au=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},au.apply(this,arguments)}function su(){return su=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},su.apply(this,arguments)}function uu(){return uu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},uu.apply(this,arguments)}function cu(){return cu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cu.apply(this,arguments)}function lu(){return lu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lu.apply(this,arguments)}function fu(){return fu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fu.apply(this,arguments)}function hu(){return hu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},hu.apply(this,arguments)}function du(){return du=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},du.apply(this,arguments)}function pu(){return pu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pu.apply(this,arguments)}function vu(){return vu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vu.apply(this,arguments)}function mu(){return mu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},mu.apply(this,arguments)}function gu(){return gu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gu.apply(this,arguments)}function yu(){return yu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yu.apply(this,arguments)}function bu(){return bu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bu.apply(this,arguments)}function wu(){return wu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},wu.apply(this,arguments)}function xu(){return xu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xu.apply(this,arguments)}function Ou(){return Ou=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ou.apply(this,arguments)}function Eu(){return Eu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Eu.apply(this,arguments)}function _u(){return _u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_u.apply(this,arguments)}function Su(){return Su=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Su.apply(this,arguments)}function ju(){return ju=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ju.apply(this,arguments)}function Au(){return Au=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Au.apply(this,arguments)}function Pu(){return Pu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Pu.apply(this,arguments)}function ku(){return ku=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ku.apply(this,arguments)}function Tu(){return Tu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Tu.apply(this,arguments)}function Cu(){return Cu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Cu.apply(this,arguments)}function Ru(){return Ru=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ru.apply(this,arguments)}function Mu(){return Mu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Mu.apply(this,arguments)}function Iu(){return Iu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Iu.apply(this,arguments)}function Nu(){return Nu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Nu.apply(this,arguments)}function Bu(){return Bu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Bu.apply(this,arguments)}function Zu(){return Zu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Zu.apply(this,arguments)}function Lu(){return Lu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Lu.apply(this,arguments)}function Du(){return Du=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Du.apply(this,arguments)}function zu(){return zu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zu.apply(this,arguments)}function Fu(){return Fu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Fu.apply(this,arguments)}function Gu(){return Gu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Gu.apply(this,arguments)}function Hu(){return Hu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hu.apply(this,arguments)}function Vu(){return Vu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Vu.apply(this,arguments)}function Uu(){return Uu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Uu.apply(this,arguments)}function qu(){return qu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},qu.apply(this,arguments)}function Wu(){return Wu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Wu.apply(this,arguments)}function Yu(){return Yu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Yu.apply(this,arguments)}function $u(){return $u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$u.apply(this,arguments)}function Ku(){return Ku=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ku.apply(this,arguments)}function Ju(){return Ju=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ju.apply(this,arguments)}function Xu(){return Xu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xu.apply(this,arguments)}function Qu(){return Qu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qu.apply(this,arguments)}function tc(){return tc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tc.apply(this,arguments)}function ec(){return ec=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ec.apply(this,arguments)}function nc(){return nc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nc.apply(this,arguments)}function rc(){return rc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},rc.apply(this,arguments)}function oc(){return oc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},oc.apply(this,arguments)}function ic(){return ic=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ic.apply(this,arguments)}function ac(){return ac=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ac.apply(this,arguments)}var sc={about:function(t){return N.createElement("svg",ys({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Xo||(Xo=N.createElement("path",{d:"M666.667 812.5V708.333c0-11.718-9.115-20.833-20.834-20.833h-62.5V354.167c0-11.72-9.114-20.834-20.833-20.834H354.167c-11.72 0-20.834 9.115-20.834 20.834v104.166c0 11.72 9.115 20.834 20.834 20.834h62.5V687.5h-62.5c-11.72 0-20.834 9.115-20.834 20.833V812.5c0 11.719 9.115 20.833 20.834 20.833h291.666c11.72 0 20.834-9.114 20.834-20.833zm-83.334-583.333V125c0-11.719-9.114-20.833-20.833-20.833h-125c-11.719 0-20.833 9.114-20.833 20.833v104.167c0 11.718 9.114 20.833 20.833 20.833h125c11.719 0 20.833-9.115 20.833-20.833zM1000 500c0 276.042-223.958 500-500 500C223.958 1000 0 776.042 0 500 0 223.958 223.958 0 500 0c276.042 0 500 223.958 500 500z"})))},analyse:function(t){return N.createElement("svg",bs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Qo||(Qo=N.createElement("path",{d:"M585.781 276.055l-8.73 15.797H559.59s-24.945 0-31.598 34.921l-7.066 34.922h47.808l-8.73 17.461H518.43l-24.942 122.23c-10.394 52.384-47.812 52.384-47.812 52.384h-54.047l7.07-17.461h17.043s26.61 0 33.676-34.922l24.945-122.23H435.7l8.73-17.462h33.676l7.067-34.922c10.394-52.382 47.808-52.382 47.808-52.382zm0 186.668l-33.676-46.149-12.054 7.485-12.059 7.898 34.508 52.8-57.79 55.708 19.958 19.957 54.047-51.969 37 56.125 12.058-7.898 12.055-7.485-41.574-60.699 57.371-55.293-9.977-9.976-9.976-10.395zm166.297-23.282c-.367 91.606-55.082 174.254-139.273 210.364a113.081 113.081 0 01-14.137 38.25c-19.602 35.312-55.742 58.308-96.035 61.113H110.172a118.487 118.487 0 01-93.543-60.7 124.736 124.736 0 01-4.574-115.16l180.851-356.706a41.618 41.618 0 005.82-17.461V80.238c-15.167-4.71-25.246-19.058-24.53-34.922C173.78 16.215 196.23.832 225.331.832h162.14a41.57 41.57 0 0148.641 44.066c.91 17.106-11.008 32.23-27.855 35.34v118.489c0 6.234 5.406 12.054 8.316 17.46l7.899 12.473c71.336-30.547 153.21-23.472 218.25 18.856 65.039 42.332 104.66 114.328 105.613 191.925M87.723 644.816c4.988 7.899 13.304 21.204 22.863 21.204h369.18c-111.414-17.891-193.543-113.74-194.149-226.58a228.229 228.229 0 0169.012-163.386l-12.473-22.453a127.586 127.586 0 01-17.875-54.875V83.98h-41.574v114.747a133.024 133.024 0 01-14.555 56.957L86.472 614.469a34.522 34.522 0 000 29.933m430.298-16.629c103.734-1.148 187.007-85.964 186.246-189.703-.762-103.738-85.27-187.328-189.012-186.949-103.738.379-187.64 84.578-187.645 188.32.684 104.54 85.868 188.79 190.41 188.332"})))},arom:function(t){return N.createElement("svg",ws({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),ti||(ti=N.createElement("path",{d:"M461.486 555.69l-18.127 65.268h-59.567l77.694-254.138h75.436l78.773 254.138h-61.879l-19.565-65.267zm64.446-43.032l-15.867-53.919c-4.468-14.994-9.038-33.892-12.787-48.989h-.77c-3.8 14.995-7.549 34.303-11.708 48.99l-15.046 53.918zM261.5 86.968C182.017 224.667 102.5 362.344 23 500.032a1681288.366 1681288.366 0 01238.5 413h477c79.487-137.674 158.974-275.348 238.5-413C897.5 362.343 817.983 224.666 738.5 86.97h-477zm14.844 25.657h447.312L947.313 500 723.655 887.375H276.344L52.688 500l223.656-387.375zM500 242c-125.952-2.705-242.477 100.031-255.956 225.208C225.71 589.9 309.658 716.56 429.414 748.259c116.773 35.718 252.289-25.562 303.155-136.43 55.154-109.081 17.748-253.408-83.244-322.18C606.108 258.73 553.14 241.836 500 242zm0 25.656c115.575-2.723 222.028 93.37 231.177 208.593 14.12 112.839-67.364 226.9-178.639 250.184-108.48 27.437-229.859-36.275-268.812-141.166-43.073-103.399 2.26-233.034 100.548-286.842 34.99-20.191 75.338-30.85 115.726-30.769z"})))},"bond-any":function(t){return N.createElement("svg",xs({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",height:1e3,width:1e3},t),ei||(ei=N.createElement("path",{d:"M807.589 373.705l-17.417-30.746 167.411-82.28L975 291.377zM550.192 497.027l-17.417-30.746 174.483-84.455 17.417 30.746zm-252.7 118.971l-17.417-30.697 167.411-82.376 17.417 30.794zM42.417 739.321L25 708.526l174.483-84.454 17.417 30.746z"})))},"bond-aromatic":function(t){return N.createElement("svg",Os({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),ni||(ni=N.createElement("path",{d:"M354.558 455.59l-16.99-32.66 206.568-108.165 16.937 32.66zm312.57-163.196l-16.938-32.66 206.568-108.165 16.937 32.66zM41.936 618.786L25 586.126l206.568-108.164 16.937 32.66zm100.896 229.645l-16.897-32.607 832.167-431.22L975 417.21z"})))},"bond-crossed":function(t){return N.createElement("svg",Es({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),ri||(ri=N.createElement("path",{d:"M214.927 956.465c-25.124-12.22-44.919-25.594-17.643-49.159l556.362-863.77c25.123 12.22 44.91 25.595 17.636 49.158l-556.355 863.77zM39.649 756.733c-15.73-23.086-26.341-44.555 9.056-51.484l911.646-473.856c15.73 23.086 26.341 44.555-9.056 51.484L39.649 756.733z"})))},"bond-hydrogen":function(t){return N.createElement("svg",Ps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",height:1e3,width:1e3},t),ci||(ci=N.createElement("g",{stroke:"#000",strokeWidth:1.341},N.createElement("path",{d:"M76.608 740.895l68.143-33.732-23.797-40.964-68.144 33.667zM212.896 673.496l68.144-33.731-23.798-40.964-68.144 33.667zM349.185 606.162l68.144-33.731-23.798-40.964-68.144 33.667zM485.473 538.764l68.144-33.732-23.798-40.964-68.144 33.667zM621.761 471.365l68.144-33.732-23.797-40.964-68.145 33.667zM758.05 403.966l68.143-33.732-23.797-40.964-68.145 33.667zM894.338 336.567l68.144-33.732-23.798-40.964-68.144 33.667z"}))))},"bond-dative":function(t){return N.createElement("svg",_s({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),oi||(oi=N.createElement("path",{d:"M43.96 760.205L25 723.728l811.184-410.525 18.967 36.476z"})),ii||(ii=N.createElement("path",{d:"M582.994 371.14l88.158 133.348 264.181-224.716z"})))},"bond-double":function(t){return N.createElement("svg",js({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),si||(si=N.createElement("path",{d:"M41.85 615.302L25 582.793l830.184-430.195 16.85 32.515zm103.48 232.1l-16.883-32.495 829.67-431.244L975 416.151z"})))},"bond-doublearomatic":function(t){return N.createElement("svg",Ss({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),ai||(ai=N.createElement("path",{d:"M924.756 388.797H975v50.614h-50.244zm-110.042-238.82h50.244v50.667h-50.244zm-458.797 245.84h50.244v50.614h-50.244zM470.603 634.53h50.244v50.666h-50.244zm147.514-30.348l-17.259-33.302 210.425-110.095 17.311 33.25zm-468.14 245.84l-17.258-33.304 210.373-110.147 17.31 33.303zm346.487-477.587l-17.311-33.303 210.425-110.147 17.258 33.303zM42.258 613.578L25 580.275l210.425-110.147 17.258 33.303z"})))},"bond-down":function(t){return N.createElement("svg",As({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),ui||(ui=N.createElement("path",{d:"M935.166 651.48L599.147 136.378l39.834-25.98L975 625.493zm-111.422 30.486l-297.193-455.74 39.742-26.02 297.193 455.635zm-111.42 30.387L453.887 316.035l39.782-25.947L752.11 686.406zM600.861 742.66L381.147 405.672l39.795-26.02 219.715 336.936zM489.5 773.008L308.471 495.395l39.795-26.072 180.976 277.666zM378.14 803.356l-142.29-218.344 39.742-25.966 142.237 218.29zm-111.375 30.261L163.186 674.762l39.749-25.914 103.577 158.855zM155.256 864.05l-64.864-99.486 39.795-26.02 64.864 99.434zM51.165 889.602L25 849.444l39.801-25.927 26.165 40.15z"})))},"bond-single":function(t){return N.createElement("svg",Cs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),hi||(hi=N.createElement("path",{d:"M43.96 760.205L25 723.728l931.033-483.933L975 276.272z"})))},"bond-singlearomatic":function(t){return N.createElement("svg",ks({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),li||(li=N.createElement("path",{d:"M144.817 842.643l-16.837-32.52L958.17 380.26 975 412.772zM798.4 157.357h49.277v49.594h-49.277zM349.049 398.046h49.224v49.594H349.05zm137.649-22.898l-16.936-32.553 206.079-107.893 16.883 32.553zM41.936 611.352L25 578.747l206.026-107.893 16.935 32.605z"})))},"bond-singledouble":function(t){return N.createElement("svg",Ts({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),fi||(fi=N.createElement("path",{d:"M407.502 572.415l-17.154-33.093 209.117-109.468 17.154 33.041zm358.328-186.21l-17.154-33.04 209.17-109.52L975 276.737zM42.101 763.217L25 730.124l209.117-109.467 17.154 33.04zm637.644-72.098l-17.154-33.094 209.17-109.467 17.154 33.041zM326.06 877.329l-17.154-33.093 209.118-109.52 17.153 33.04zm160.56-612.098l-17.155-33.093L678.584 122.67l17.153 33.04zM128.238 456.034l-17.154-33.041 209.118-109.52 17.153 33.04z"})))},"bond-triple":function(t){return N.createElement("svg",Rs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),di||(di=N.createElement("path",{d:"M226.323 893.87L211.13 864.54l748.683-387.867L975 505.994zm-95.685-183.373l-15.241-29.301L863.4 292.062l15.24 29.294zm-90.443-187.17L25 494.004l748.683-387.874 15.188 29.32z"})))},"bond-up":function(t){return N.createElement("svg",Ms({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),pi||(pi=N.createElement("path",{d:"M25 889.025l636.975-778.05L975 595.845z"})))},"bond-updown":function(t){return N.createElement("svg",Is({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),vi||(vi=N.createElement("path",{d:"M56.508 883.351L25 866.041l86.08-157.49 152.898 56.578-14.092-251.591 230.428 172.319-94.736-367.333 306.005 284.26L509.025 116.65 975 587.849l-25.544 25.28L601.86 261.735l177.017 471.252-327.75-304.527 89.51 347.436-250.535-187.361 12.878 229.372-175.223-64.811z"})))},chain:function(t){return N.createElement("svg",Ns({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),mi||(mi=N.createElement("path",{d:"M337.18 647.039L25 429.964V352.96l312.18 212.167L645.35 352.96 975 565.128v81.91L645.35 429.965z"})))},"charge-minus":function(t){return N.createElement("svg",Bs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),gi||(gi=N.createElement("path",{d:"M620.546 105.63v130.925H975V105.63H620.546zm25.546 25.546h303.362v79.832H646.092v-79.832zM315.588 54.538C217.793 351.168 121.288 648.316 25 945.462h138.908c25.114-91.085 55.768-180.853 83.025-271.428h274.622c28.958 90.558 60.417 180.46 87.815 271.428h140.504C654.061 648.335 558.182 351.157 460.882 54.538H315.588zm17.563 25.546H443.32l271.429 839.832h-86.219c-29.461-90.408-57.413-181.36-87.815-271.429H229.37c-29.515 90.014-56.198 181.03-84.622 271.429H61.723L333.15 80.084zm38.32 73.445c-31.053 145.824-82.742 286.157-127.652 428.08 5.085 10.533 37.958 1.603 53.79 4.61h228.736c-42.854-144.445-99.192-285.093-130.925-432.69h-23.95zm12.773 54.286c27.149 120.238 71.648 235.466 108.571 352.857H277.27c36.636-117.314 81.094-232.463 106.975-352.857z"})))},"charge-plus":function(t){return N.createElement("svg",Zs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),yi||(yi=N.createElement("path",{d:"M731.656 44.188V156.28H619.5v131.25h112.156v112.094h131.282V287.531H975v-131.25H862.937V44.187h-131.28zm25.657 25.656h79.968v112.125h112.032v79.875H837.28v112.125h-79.968V261.844H645.155v-79.875h112.157V69.844zM310.906 61.78C213.953 359.78 117.082 657.805 20.156 955.813h138.875c28.26-91.036 56.476-182.085 84.719-273.125h274.531c29.48 91.041 58.956 182.084 88.438 273.125h141.156C650.997 657.803 554.108 359.797 457.25 61.78H310.906zm18.656 25.688h109.032L712.53 930.156h-87.125C595.926 839.104 566.451 748.051 536.97 657H224.844c-28.261 91.045-56.476 182.105-84.719 273.156H55.5L329.563 87.47zM367.625 161c-28.523 141.514-79.739 276.783-122.475 414.3-8.888 16.338-5.537 23.76 13.53 19.763h264.57C473.04 438.166 426.802 305.382 391.719 161h-24.094zm12.594 60.875c29.77 117.653 71.46 231.798 107.719 347.531H274c35.996-115.647 78.14-229.583 106.219-347.531z"})))},check:function(t){return N.createElement("svg",Ls({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),bi||(bi=N.createElement("path",{d:"M361.875 603.375L141.75 375h104.625l106.5 112.5 165.75-235.875L612 249zM375 0C167.895 0 0 167.895 0 375s167.895 375 375 375 375-167.895 375-375S582.105 0 375 0zm0 0"})))},"chiral-flag":function(t){return N.createElement("svg",Ds({"data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -5 70 35"},t),wi||(wi=N.createElement("path",{d:"M0 25h69V0H0zM68 1v23H1V1z"})),xi||(xi=N.createElement("path",{d:"M21 18.14a3.85 3.85 0 002.71-.93 3.07 3.07 0 001-2.43H23.1a2.09 2.09 0 01-.53 1.54 2.09 2.09 0 01-1.55.53 1.94 1.94 0 01-1.64-.8 3.31 3.31 0 01-.6-2v-1.98a3.33 3.33 0 01.59-2 1.89 1.89 0 011.6-.8 2.18 2.18 0 011.59.53 2 2 0 01.54 1.53h1.61a3 3 0 00-1-2.45A4 4 0 0021 7.9a3.58 3.58 0 00-2.78 1.18 4.3 4.3 0 00-1.07 3V14a4.25 4.25 0 001.08 3A3.65 3.65 0 0021 18.14zM27.77 12.54a1.67 1.67 0 01.64-.52 2.09 2.09 0 01.92-.19 1.26 1.26 0 011 .39 1.91 1.91 0 01.34 1.26V18h1.66v-4.51a3.36 3.36 0 00-.66-2.29 2.33 2.33 0 00-1.84-.74 2.42 2.42 0 00-1.17.29 2.63 2.63 0 00-.9.81V7.34h-1.65V18h1.66zM34.16 7.34h1.66V8.8h-1.66zM34.16 10.6h1.66V18h-1.66zM39.32 12.86a1.35 1.35 0 01.5-.58 1.49 1.49 0 01.81-.21h.71l.2-1.55-.24-.06h-.28a1.68 1.68 0 00-1 .32 2.38 2.38 0 00-.72.89l-.11-1.07h-1.53V18h1.66zM45.49 13.65a4.08 4.08 0 00-2.39.6 1.93 1.93 0 00-.85 1.67 2.16 2.16 0 00.62 1.63 2.46 2.46 0 001.77.59 2.3 2.3 0 001.25-.35 2.85 2.85 0 00.9-.87 4 4 0 00.08.53q.06.27.15.55h1.68a4.59 4.59 0 01-.2-.82 6 6 0 01-.06-.88V13a2.31 2.31 0 00-.79-1.89 3.17 3.17 0 00-2.08-.66 3.32 3.32 0 00-2.16.68 1.83 1.83 0 00-.78 1.55h1.6a.86.86 0 01.33-.7 1.39 1.39 0 01.9-.27 1.35 1.35 0 011 .33 1.21 1.21 0 01.34.91v.65zm1.29 2.13a1.59 1.59 0 01-.67.72 2.07 2.07 0 01-1.12.31 1.15 1.15 0 01-.8-.25.86.86 0 01-.28-.67 1.09 1.09 0 01.41-.84 1.67 1.67 0 011.13-.36h1.32zM50.27 7.34h1.66V18h-1.66z"})))},cip:function(t){return N.createElement("svg",zs({xmlns:"http://www.w3.org/2000/svg",viewBox:"-125 -125 1000 1000",height:1e3,width:1e3},t),Oi||(Oi=N.createElement("path",{d:"M376.223 700.95L750 169.991 503.375 44.156l-128.2 650.504L246.974 44.156 0 169.992 373.777 700.95v4.895l2.098-3.145 2.094 3.145zM82.789 190.612l123.313-62.918 65.324 331.02zm0 0"})))},clean:function(t){return N.createElement("svg",Fs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Ei||(Ei=N.createElement("path",{d:"M750 625c.598 49.754-28.371 95.125-73.758 115.52-45.383 20.394-98.543 11.925-135.347-21.555-36.81-33.485-50.25-85.61-34.227-132.715L375 447.918 243.332 586.25c16.805 51.543-1.527 108.04-45.394 139.895-43.864 31.855-103.266 31.8-147.075-.13C7.055 694.083-11.18 637.552 5.72 586.04 22.613 534.527 70.789 499.777 125 500a125.019 125.019 0 0164.582 18.75L333.332 375V242.5c-57.394-20.293-91.828-78.984-81.531-138.988C262.094 43.508 314.12-.352 375-.352s112.906 43.86 123.2 103.864c10.296 60.004-24.137 118.695-81.532 138.988V375l143.75 143.75c38.488-23.227 86.48-24 125.695-2.02C725.328 538.707 749.723 580.047 750 625zm0 0"})))},copies:Hs,copy:Hs,"copy-image":function(t){return N.createElement("svg",Vs({width:1e3,height:1e3,viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),Si||(Si=N.createElement("path",{d:"M233.625 137.25c-15.751 0-27.469 13.865-27.469 29.062v779.719c0 15.216 11.72 28.969 27.469 28.969h591.656l3.688-3.406 130.687-121.063 4.125-3.781V166.312c0-15.295-11.722-29.062-27.469-29.062H233.625zm0 25.688h702.687c.276 0 1.782.697 1.782 3.374v669.219L815.25 949.312H233.625c-.376 0-1.813-.729-1.813-3.281V166.312c0-2.775 1.337-3.374 1.813-3.374zM63.687 25C47.883 25 36.22 38.927 36.22 54.125v779.594c0 15.231 11.611 29.125 27.468 29.125h142.469v-25.656H63.687c-.266 0-1.78-.83-1.78-3.469V54.125c0-2.775 1.359-3.438 1.78-3.438h702.688c.22 0 1.813.76 1.813 3.438v83.125h25.656V54.125C793.844 38.83 782.176 25 766.375 25H63.687z",fill:"#000"})),ji||(ji=N.createElement("mask",{id:"copy-image_svg__a",fill:"#fff"},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M358 355c0-22.091 17.909-40 40-40h393c22.091 0 40 17.909 40 40v137c-164.134 0-297 133.904-297 298.848h34C568 644.471 685.854 526 831 526v225c0 22.091-17.909 40-40 40H398c-22.091 0-40-17.909-40-40V355zm129.5 170c37.832 0 68.5-30.668 68.5-68.5S525.332 388 487.5 388 419 418.668 419 456.5s30.668 68.5 68.5 68.5z"}))),Ai||(Ai=N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M358 355c0-22.091 17.909-40 40-40h393c22.091 0 40 17.909 40 40v137c-164.134 0-297 133.904-297 298.848h34C568 644.471 685.854 526 831 526v225c0 22.091-17.909 40-40 40H398c-22.091 0-40-17.909-40-40V355zm129.5 170c37.832 0 68.5-30.668 68.5-68.5S525.332 388 487.5 388 419 418.668 419 456.5s30.668 68.5 68.5 68.5z",fill:"#000"})),Pi||(Pi=N.createElement("path",{d:"M831 492v21h21v-21h-21zM534 790.848h-21v21h21v-21zm34 0v21h21v-21h-21zM831 526h21v-21h-21v21zM398 294c-33.689 0-61 27.311-61 61h42c0-10.493 8.507-19 19-19v-42zm393 0H398v42h393v-42zm61 61c0-33.689-27.311-61-61-61v42c10.493 0 19 8.507 19 19h42zm0 137V355h-42v137h42zM555 790.848C555 637.37 678.596 513 831 513v-42c-175.864 0-318 143.439-318 319.848h42zm13-21h-34v42h34v-42zM831 505c-156.871 0-284 128.001-284 285.848h42C589 655.941 697.58 547 831 547v-42zm21 246V526h-42v225h42zm-61 61c33.689 0 61-27.311 61-61h-42c0 10.493-8.507 19-19 19v42zm-393 0h393v-42H398v42zm-61-61c0 33.689 27.311 61 61 61v-42c-10.493 0-19-8.507-19-19h-42zm0-396v396h42V355h-42zm198 101.5c0 26.234-21.266 47.5-47.5 47.5v42c49.429 0 89.5-40.071 89.5-89.5h-42zM487.5 409c26.234 0 47.5 21.266 47.5 47.5h42c0-49.429-40.071-89.5-89.5-89.5v42zM440 456.5c0-26.234 21.266-47.5 47.5-47.5v-42c-49.429 0-89.5 40.071-89.5 89.5h42zm47.5 47.5c-26.234 0-47.5-21.266-47.5-47.5h-42c0 49.429 40.071 89.5 89.5 89.5v-42z",fill:"#000",mask:"url(#copy-image_svg__a)"})))},"copy-mol":function(t){return N.createElement("svg",qs({width:1e3,height:1e3,viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),Ci||(Ci=N.createElement("path",{d:"M233.625 137.25c-15.751 0-27.469 13.865-27.469 29.062v779.719c0 15.216 11.72 28.969 27.469 28.969h591.656l3.688-3.406 130.687-121.063 4.125-3.781V166.312c0-15.295-11.722-29.062-27.469-29.062H233.625zm0 25.688h702.687c.276 0 1.782.697 1.782 3.374v669.219L815.25 949.312H233.625c-.376 0-1.813-.729-1.813-3.281V166.312c0-2.775 1.337-3.374 1.813-3.374zM63.687 25C47.883 25 36.22 38.927 36.22 54.125v779.594c0 15.231 11.611 29.125 27.468 29.125h142.469v-25.656H63.687c-.266 0-1.78-.83-1.78-3.469V54.125c0-2.775 1.359-3.438 1.78-3.438h702.688c.22 0 1.813.76 1.813 3.438v83.125h25.656V54.125C793.844 38.83 782.176 25 766.375 25H63.687z",fill:"#000"})),Ri||(Ri=N.createElement("path",{d:"M473.807 381.531L590.018 671.57l116.211-290.039h60.791V737h-46.875V598.572l4.394-149.414L607.84 737h-35.889L455.496 449.891l4.639 148.681V737H413.26V381.531h60.547z",fill:"#000"})))},"copy-ket":function(t){return N.createElement("svg",Us({width:928,height:950,viewBox:"0 0 928 950",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),ki||(ki=N.createElement("path",{d:"M197.625 112.25c-15.751 0-27.469 13.865-27.469 29.062v779.719c0 15.216 11.72 28.969 27.469 28.969h591.656l3.688-3.406 130.687-121.063 4.125-3.781V141.312c0-15.295-11.722-29.062-27.469-29.062H197.625zm0 25.688h702.687c.276 0 1.782.697 1.782 3.374v669.219L779.25 924.312H197.625c-.376 0-1.813-.729-1.813-3.281V141.312c0-2.775 1.337-3.374 1.813-3.374zM27.687 0C11.883 0 .22 13.927.22 29.125v779.594c0 15.231 11.611 29.125 27.468 29.125h142.469v-25.656H27.687c-.266 0-1.78-.83-1.78-3.469V29.125c0-2.775 1.359-3.438 1.78-3.438h702.688c.22 0 1.813.76 1.813 3.438v83.125h25.656V29.125C757.844 13.83 746.176 0 730.375 0H27.687z",fill:"#000"})),Ti||(Ti=N.createElement("path",{d:"M525.592 546.717l-43.457 45.166V712H435.26V356.531h46.875v175.781l157.959-175.781h56.64L556.842 513.514 707.721 712h-56.153L525.592 546.717z",fill:"#000"})))},cut:function(t){return N.createElement("svg",Ws({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Mi||(Mi=N.createElement("path",{d:"M188.594 20.563c-41.974 25.386-41.937 82.3-39.58 125.68 7.163 84.366 69.363 147.928 116.482 213.413 43.805 56.067 89.439 110.677 135.598 164.813l-58.563 71.906c-73.596-17.177-141.836 30.819-186.28 85.053-46.468 50.918-91.788 124.353-60.508 194.533 32.385 82.176 135.85 121.6 215.95 86.166 76.857-32.008 134.032-101.74 165.264-177.37 23.654-38.596-4.39-87.694-1.488-118.84 15.148-23.227 30.195-33.856 45.331-4.265 18.201 27.333-24.521 71.748-2.155 108.895 24.009 74.261 77.109 139.99 144.247 179.717 73.622 45.364 181.713 26.6 227.655-48.931 41.133-55.22 23.891-131.074-16.193-181.546-46.283-62.842-110.682-132.456-196.096-126.287-24.12 12.137-32.516-14.591-46.333-28.502l-33.019-40.56c81.095-97.832 167.177-193.194 231.35-303.417 25.599-55.314 31.862-124.326 3.775-179.872-13.44-28.26-30.205-18.095-41.362 2.297L499.969 403C396.174 275.523 292.402 148.028 188.594 20.562zm-2.469 37.624c104.607 128.496 209.274 256.943 313.844 385.47 104.608-128.495 209.23-256.98 313.844-385.47 28.596 66.964 6.737 145.906-37.271 201.115-64.808 92.513-137.952 178.802-211.01 264.823 27.372 33.665 54.793 67.29 82.187 100.938 60.435-21.826 122.88 12.717 162.386 57.553 42.652 46.805 95.462 108.671 73.69 176.742-25.08 73.56-115.979 110.517-186.173 78.816-71.736-30.476-125.173-96.809-152.528-168.486-12.485-32.966-6.032-72.234 20.531-96.407a6746.21 6746.21 0 01-65.594-73.812c-21.745 24.708-43.48 49.428-65.625 73.781 35.39 31.3 31.09 84.49 10.005 122.664-39.926 76.233-109.977 153.708-202.64 153.422-77.323.7-153.183-80.457-124.952-158.08 24.729-61.991 71.15-115.733 126.448-152.748 32.18-20.335 72.89-25.512 109.046-13.445 27.346-33.678 54.8-67.269 82.156-100.938-83.32-99.646-170.363-197.475-238.563-308.438-24.368-47.417-31.22-107.845-9.781-157.5zm489.563 614.344c-47.42-4.126-79.364 47.448-66.035 90.395 15.345 62.162 66.237 115.746 126.952 135.428 48.764 15.22 101.548-31.226 90.89-81.998-10.859-72.363-77.626-139.564-151.808-143.825zm-351.407.032c-76.431 5.218-143.68 73.383-152.274 148.81-8.155 54.132 53.298 95.856 101.43 73.94 59.468-25.671 111.895-81.437 118.94-147.774 4.98-40.653-26.74-77.638-68.096-74.976zm-.187 25.656c56.192-1.759 48.731 72.64 22.644 102.778-25.885 35.895-63.168 74.471-110.48 74.285-48.469-8.669-45.67-71.252-21.339-102.787 23.466-37.908 63.096-71.548 109.175-74.276zm351.781 0c65.121 6.376 123.103 66.698 126.602 132.073-.04 47.127-62.09 57.596-91.73 28.273-42.198-29.476-84.988-77.461-75.808-132.63 4.237-18.255 22.99-28.824 40.936-27.716z"})))},dearom:function(t){return N.createElement("svg",Ys({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ii||(Ii=N.createElement("path",{d:"M464.67 555.69l-18.127 65.268h-59.567L464.67 366.82h75.435l78.773 254.138H557l-19.565-65.267zm64.446-43.032L513.25 458.74c-4.468-14.994-9.038-33.892-12.787-48.989h-.77c-3.8 14.995-7.549 34.303-11.708 48.99l-15.046 53.918zM360.22 190.906l-.313 25.657 260.938 3.125.281-25.657-260.906-3.125zm400.687 323.875L625.688 744.25l22.125 13.031L783.03 527.813l-22.125-13.032zm-553.281 0L185.5 527.813 320.719 757.28l22.125-13.031-135.219-229.469zM261.5 86.97C182.017 224.666 102.5 362.343 23 500.03a1681288.366 1681288.366 0 01238.5 413h477c79.487-137.674 158.974-275.348 238.5-413C897.5 362.343 817.983 224.666 738.5 86.97h-477zm14.844 25.656h447.312L947.313 500 723.655 887.375H276.344L52.688 500l223.656-387.375z"})))},dropdown:function(t){return N.createElement("svg",$s({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ni||(Ni=N.createElement("path",{d:"M876.337 751.055c0 70.936-57.736 128.672-128.672 128.672H201.297c-70.936 0-128.557-57.736-128.557-128.672L747.55 76.36c70.936 0 128.672 57.506 128.672 128.557v546.138z"})))},"enhanced-stereo":function(t){return N.createElement("svg",Ks({width:83,height:82,viewBox:"0 0 83 82",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),Bi||(Bi=N.createElement("path",{d:"M41.506 29.35L44.47 1h-5.928l2.964 28.35z",fill:"#313131",stroke:"#313131",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Zi||(Zi=N.createElement("path",{d:"M41.506 30.97l39.518 16.2M41.506 30.97L1 47.17",stroke:"#313131",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Li||(Li=N.createElement("g",{clipPath:"url(#enhanced-stereo_svg__clip0)"},N.createElement("path",{d:"M14.427 50.637H11.35v26.941h3.077v2.45H8.353v-31.84h6.074v2.449zM27.785 75c-.172-.344-.311-.956-.419-1.837-1.386 1.44-3.04 2.16-4.963 2.16-1.718 0-3.131-.484-4.237-1.45-1.096-.979-1.644-2.214-1.644-3.707 0-1.815.688-3.223 2.063-4.222 1.385-1.01 3.33-1.514 5.832-1.514h2.9v-1.37c0-1.042-.31-1.87-.934-2.481-.623-.623-1.541-.935-2.755-.935-1.064 0-1.955.269-2.675.806-.72.537-1.08 1.187-1.08 1.95h-2.997c0-.87.307-1.709.919-2.514.623-.817 1.46-1.461 2.514-1.934 1.063-.472 2.229-.709 3.496-.709 2.009 0 3.583.505 4.721 1.515 1.139.999 1.73 2.38 1.773 4.14v8.025c0 1.6.204 2.874.612 3.82V75h-3.126zm-4.947-2.272a5.24 5.24 0 002.66-.725c.837-.484 1.444-1.112 1.82-1.885V66.54H24.98c-3.652 0-5.478 1.07-5.478 3.207 0 .935.311 1.665.934 2.192.623.526 1.424.789 2.401.789zm26.893-6.252c0 2.664-.612 4.807-1.837 6.43-1.224 1.61-2.868 2.416-4.93 2.416-2.202 0-3.905-.779-5.108-2.336L37.711 75h-2.74V50.25h2.982v9.233c1.203-1.493 2.862-2.24 4.979-2.24 2.116 0 3.776.8 4.979 2.401 1.213 1.6 1.82 3.792 1.82 6.574v.258zm-2.98-.338c0-2.03-.393-3.599-1.177-4.705-.784-1.107-1.912-1.66-3.384-1.66-1.965 0-3.378.913-4.237 2.74v7.54c.913 1.826 2.336 2.74 4.27 2.74 1.428 0 2.54-.554 3.335-1.66.795-1.107 1.193-2.772 1.193-4.995zm16.902 4.237c0-.805-.306-1.428-.918-1.869-.602-.45-1.66-.838-3.175-1.16-1.503-.322-2.701-.709-3.593-1.16-.88-.451-1.536-.988-1.965-1.611-.42-.623-.629-1.365-.629-2.224 0-1.429.602-2.637 1.805-3.625 1.214-.989 2.76-1.483 4.64-1.483 1.977 0 3.578.51 4.802 1.53 1.236 1.021 1.853 2.327 1.853 3.916h-2.997c0-.816-.349-1.52-1.047-2.11-.688-.591-1.558-.887-2.61-.887-1.086 0-1.934.237-2.547.71-.612.472-.918 1.09-.918 1.852 0 .72.285 1.263.854 1.628.57.365 1.595.714 3.078 1.047 1.493.333 2.701.73 3.625 1.193.924.462 1.606 1.02 2.046 1.675.452.645.677 1.434.677 2.369 0 1.558-.623 2.81-1.869 3.754-1.246.935-2.863 1.402-4.85 1.402-1.396 0-2.632-.247-3.706-.74-1.074-.495-1.918-1.183-2.53-2.063-.601-.892-.902-1.854-.902-2.885h2.98c.055 1 .452 1.794 1.193 2.385.752.58 1.74.87 2.965.87 1.128 0 2.03-.225 2.707-.677.688-.462 1.031-1.074 1.031-1.837zm4.754-22.188h6.09v31.84h-6.09v-2.449h3.11V50.637h-3.11v-2.45z",fill:"#000"}))),Di||(Di=N.createElement("defs",null,N.createElement("clipPath",{id:"enhanced-stereo_svg__clip0"},N.createElement("path",{fill:"#fff",transform:"translate(8 39)",d:"M0 0h75v43H0z"})))))},erase:function(t){return N.createElement("svg",Js({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),zi||(zi=N.createElement("path",{d:"M935.125 131.531c-16.775.337-31.692 9.735-48.156 21.563l-.094.062L326.844 548.47l-.032.031-.062.031c-16.263 11.715-30.435 23.848-42.313 44-11.877 20.153-21.594 47.63-32.156 91.438v.125l-48.125 208.531-.687 3 .719 2.938c5.282 21.522 18.66 37.784 36.5 43.875 17.797 6.076 38.371 1.747 56.625-11.344.043-.031.082-.063.125-.094L928.28 489.312l.844-.593.75-.719c34.183-33.262 47.501-69.646 44.688-116.75h.03l-2.312-201.813-.031-1.468-.344-1.438c-2.595-10.545-6.499-19.164-12.906-25.562-6.407-6.399-15.472-9.606-23.875-9.438zm.5 25.688c2.792-.056 3.519.208 5.219 1.906 1.601 1.6 3.93 5.467 5.781 12.344l2.281 200.094v.312l.032.344c2.649 42.15-6.436 67.397-36.407 96.781L282.563 910.063l-.063.062-.063.031c-13.245 9.536-24.765 10.93-33.437 7.97-8.13-2.776-15.187-9.716-19.094-23l47.344-205.157c.006-.025.025-.038.031-.063v-.062c10.274-42.587 19.537-67.716 29.282-84.25 9.734-16.517 19.828-25.155 35.093-36.157l.094-.062 560.031-395.313.032-.03.062-.032c15.08-10.838 28.167-16.67 33.75-16.781zM736.062 48.906c-2.06.023-4.117.077-6.187.188-27.589 1.48-55.785 10.782-77.969 26.75-.011.008-.02.023-.031.031L151.156 434h-.031c-16.27 11.693-30.435 23.854-42.313 44-11.803 20.02-21.483 47.313-31.968 90.594-.54 1.387-16.671 43.008-30.938 90.25-7.253 24.017-13.988 49.26-17.781 71.468-3.793 22.21-6.24 40.66 1.437 56.25 6.559 13.32 20.806 27.178 40.657 45.407 19.85 18.229 44.805 38.86 70.343 57.781 25.54 18.92 51.522 36.112 73.938 47.469 11.208 5.678 21.49 9.922 31.062 12.125 9.573 2.203 19.586 3.022 28.438-3.375l1.344-.969 1.062-1.281 2.094-2.532c-12.829 4.718-25.942 5.303-37.813 1.25-16.689-5.697-29.47-20.3-35.375-39.78-15.549-9.401-32.625-21.054-49.468-33.532-24.794-18.369-49.23-38.567-68.281-56.063-19.052-17.495-33.208-34.267-34.97-37.843-1.565-3.18-2.642-20.181.844-40.594 3.487-20.413 9.957-44.948 17.032-68.375 14.15-46.854 30.656-89.25 30.656-89.25l.313-.781.187-.844c10.287-42.62 19.557-67.797 29.313-84.344 9.747-16.532 19.864-25.164 35.156-36.156.012-.009.018-.022.031-.031L666.844 96.75l.031-.031c20.747-14.945 51.759-22.69 78.094-21.5 8.778.397 17.031 1.772 24.218 4.219 20.81 7.102 64.082 27.028 101.22 44.906a4145.242 4145.242 0 0134.562 16.844c9.884-5.69 19.65-9.446 30.156-9.657 4.077-.082 8.304.639 12.313 2.125a4232.941 4232.941 0 00-65.875-32.437c-37.402-18.005-79.918-37.81-104.094-46.063v-.031c-12.843-4.372-26.98-6.378-41.407-6.219z"})))},"functional-groups":function(t){return N.createElement("svg",ac({width:900,height:900,viewBox:"0 0 900 900",xmlns:"http://www.w3.org/2000/svg"},t),ds||(ds=N.createElement("path",{stroke:"null",d:"M910.62 704.168H754.876V853.92h-47.921V704.17H551.214v-47.923h157.238V494.514h46.425v161.732H910.62v47.922z"})),ps||(ps=N.createElement("path",{stroke:"null",d:"M73.222 448.971L366.096 45.866 839.974 199.84v294.288h39.378V171.23L351.055-.424 24.55 448.971l326.505 449.395 198.111-64.37v-41.402l-183.07 59.482L73.222 448.97z",clipRule:"evenodd",fillRule:"evenodd"})))},"generic-groups":function(t){return N.createElement("svg",Xs({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 750 750",height:1e3,width:1e3},t),Fi||(Fi=N.createElement("path",{d:"M73.129 209.914v403.543h403.226v73.371H62.133c-34.418 0-62.317-27.922-62.317-62.367V209.914zM304.07 343.45l103.004-103.086-48.754-49.89c-10.734-10.73-28.12-10.73-38.855 0l-63.05 64.199c-10.72 10.742-10.72 28.144 0 38.887zm132.696-73.37L334.859 373.53l311.95 313.297 103.375-103.086zm186.218 123.265V136.543c0-53.195-19.43-73.371-73.316-73.371H183.102c-56.454 0-73.317 16.875-73.317 73.371v366.855c0 54.297 16.863 73.372 73.317 73.372h293.253l-73.312-73.372H183.102V136.543h366.566v183.43zm0 0"})))},help:function(t){return N.createElement("svg",Qs({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Gi||(Gi=N.createElement("path",{d:"M583.333 812.5v-125c0-11.719-9.114-20.833-20.833-20.833h-125c-11.719 0-20.833 9.114-20.833 20.833v125c0 11.719 9.114 20.833 20.833 20.833h125c11.719 0 20.833-9.114 20.833-20.833zM750 375c0-119.14-125-208.333-236.98-208.333-106.119 0-185.546 45.573-241.536 138.672-5.859 9.114-3.255 20.833 5.209 27.343l85.937 65.104c3.255 2.605 7.813 3.907 12.37 3.907 5.86 0 12.37-2.604 16.276-7.813 30.599-39.062 43.62-50.781 55.99-59.896 11.067-7.812 32.552-15.625 55.99-15.625 41.666 0 80.077 26.693 80.077 55.339 0 33.854-17.578 50.781-57.291 69.01-46.224 20.834-109.375 74.87-109.375 138.021v23.438c0 11.718 9.114 20.833 20.833 20.833h125c11.719 0 20.833-9.115 20.833-20.833 0-14.974 18.88-46.875 49.48-64.453C682.292 511.719 750 473.958 750 375zm250 125c0 276.042-223.958 500-500 500C223.958 1000 0 776.042 0 500 0 223.958 223.958 0 500 0c276.042 0 500 223.958 500 500z"})))},layout:function(t){return N.createElement("svg",tu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Hi||(Hi=N.createElement("path",{d:"M76.82 637.959h670.903v74.543H76.82c-41.168 0-74.543-33.375-74.543-74.543V116.146H76.82zm505.04-250.844a68.954 68.954 0 00-39.88 13.047l-94.67-101.754v-91.316c34.52-11.758 56.43-45.703 52.925-82-1.02-48.965-41.222-88.008-90.199-87.59-49.094-.445-89.68 38.16-91.687 87.219-2.946 36.496 19.343 70.308 54.043 81.996v91.691l-97.282 101.38a81.98 81.98 0 00-43.98-13.044c-38.3-.027-72.254 24.637-84.078 61.066-11.82 36.434 1.18 76.333 32.199 98.805 31.016 22.469 72.98 22.39 103.914-.195 30.934-22.59 43.785-62.535 31.828-98.922l92.063-96.91 92.062 96.91c-11.629 35.96 1.227 75.32 31.844 97.484 30.617 22.16 72.023 22.082 102.555-.195 30.53-22.281 43.234-61.691 31.468-97.61-11.765-35.913-45.328-60.167-83.125-60.062"})))},logo:function(t){return N.createElement("svg",eu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3},t),Vi||(Vi=N.createElement("path",{d:"M26.773 102.744h181.755c-.074 123.9-8.793 247.613-8.866 371.514 89.984-124.193 181.422-247.321 271.406-371.514H692.64C590.987 240.298 444.471 342.58 363.684 495.732c77.74 155.676 224.317 259.543 320.493 402.076h-215.4c-70.105-101.553-117.732-223.956-219.713-299.423-39.122-14.846-40.087 60.14-46.238 87.253-5.736 70.546-2.166 141.45-3.164 212.17H25c.007-265.023 1.766-530.041 1.773-795.064zm424.242 392.988c102.855-141.27 241.813-251.718 344.669-392.988 59.768-.743 119.55-1.267 179.316 0C872.393 239.74 719.748 333.773 632.325 482.93c-7.765 45.896 45.968 88.282 71.47 126.581 86.444 99.165 194.622 178.714 269.432 288.074-63.035-.013-126.069.437-189.104.437-100.95-142.27-232.05-260.11-333.108-402.29z"})))},miew:function(t){return N.createElement("svg",nu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Ui||(Ui=N.createElement("path",{d:"M354.531 0l119.063 120 41.562-41.563c105.004 48.915 176.317 149.704 187.5 265h46.875C733.105 148.988 570.297-.366 375.156 0zM517.97 381.25a136.494 136.494 0 01-4.375 35.313 75.984 75.984 0 01-13.438 26.562 58.417 58.417 0 01-22.187 16.563 80.293 80.293 0 01-31.25 5.625h-28.44V285h31.25a62.498 62.498 0 0151.25 21.563 93.76 93.76 0 0117.813 62.5zm12.187-100a104.02 104.02 0 00-35.625-24.063A117.53 117.53 0 00448.906 250h-73.75v250h71.875a126.896 126.896 0 0047.188-8.438 102.808 102.808 0 0036.25-22.812 105.25 105.25 0 0023.125-37.188 142.735 142.735 0 008.125-49.062V370a142.735 142.735 0 00-8.125-49.063 109.069 109.069 0 00-23.438-39.687zM262.97 468.75c-5.516.031-11-.813-16.25-2.5a33.403 33.403 0 01-12.5-7.5 31.24 31.24 0 01-8.125-11.563 37.209 37.209 0 01-2.813-14.687h-40.625a62.504 62.504 0 006.563 29.688 69.065 69.065 0 0017.5 21.562 79.08 79.08 0 0025.625 12.813 93.693 93.693 0 0031.25 4.687 105.27 105.27 0 0031.25-4.688 76.263 76.263 0 0025.937-13.75 62.517 62.517 0 0017.188-22.5 73.146 73.146 0 006.25-31.25 65.637 65.637 0 00-2.188-17.5 52.264 52.264 0 00-7.187-15.937 56.249 56.249 0 00-12.5-13.438 64.36 64.36 0 00-19.063-9.687 65.575 65.575 0 0016.25-10.313 64.72 64.72 0 0011.563-13.125 55.026 55.026 0 006.875-14.375 49.668 49.668 0 002.187-15 75.576 75.576 0 00-5.625-31.25 55.644 55.644 0 00-15.937-21.562 64.386 64.386 0 00-24.063-13.438 113.802 113.802 0 00-31.25-4.375 93.721 93.721 0 00-31.25 5 79.392 79.392 0 00-24.687 14.063A70.333 70.333 0 00189.219 290a62.535 62.535 0 00-5.625 26.563h40.625a33.112 33.112 0 012.812-14.063 29.362 29.362 0 017.813-10.625A37.17 37.17 0 01246.719 285a45.638 45.638 0 0116.25-3.75 35.94 35.94 0 0127.812 9.688 37.8 37.8 0 019.063 26.875 47.79 47.79 0 01-2.5 15.312 27.19 27.19 0 01-7.813 11.563 39.684 39.684 0 01-12.812 7.5A52.543 52.543 0 01258.594 355H234.53v31.25h24.063a70.241 70.241 0 0118.75 2.188 37.512 37.512 0 0114.062 7.187 36.923 36.923 0 019.063 12.5 44.375 44.375 0 013.125 17.813A37.488 37.488 0 01292.656 455a40.001 40.001 0 01-29.687 13.75zM235.156 672.5C130.242 623.012 59.293 521.758 48.594 406.25H1.719C17.96 600.465 180.266 749.867 375.156 750h20.625L276.72 630zm0 0"})))},clear:function(t){return N.createElement("svg",ru({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),qi||(qi=N.createElement("path",{d:"M825.5 171.563c-47.256 0-83.464 9.788-106.719 32.437-23.341 22.733-33.468 58.865-33.468 106.219 0 52.563 18.534 125.27 54.906 220.312 10.783 28.222 17.013 44.051 21.687 52.25l.094.157.094.156C774.704 603.797 794 616.49 816 616.437h.031c24.381-.009 45.457-10.866 57.781-30.437v-.063l.032-.03c6.068-9.81 11.647-26.35 21.468-55.97v-.03c18.839-57.443 33.002-103.73 42.5-139.063 9.499-35.333 14.532-58.903 14.532-74.72 0-45.76-9.879-82.033-31.657-107.187-21.777-25.153-54.738-37.375-95.187-37.375zm0 25.687c35.501 0 59.545 9.716 75.781 28.469 16.236 18.753 25.375 48.354 25.375 90.406 0 9.45-4.359 33.447-13.656 68.031-9.293 34.57-23.323 80.544-42.063 137.688-.008.024-.023.038-.03.062-9.652 29.097-17.383 48.006-18.845 50.407-8.108 12.875-18.347 18.437-36.062 18.437h-.031c-13.02.038-22.353-5.396-31.75-20.688-.005-.008-.027-.085-.032-.093-1.623-2.874-9.318-20.72-19.968-48.594v-.031c-35.831-93.629-53.25-164.783-53.25-211.125 0-43.644 9.62-72.134 25.718-87.813 16.185-15.762 45.174-25.156 88.813-25.156zM820 636.875c-25.872 0-49.422 9.64-68.125 27.938l-.031.03c-18.637 18.29-28.625 41.783-28.625 67.75s9.909 49.487 28.687 67.75v.032c18.7 18.228 42.23 27.875 68.094 27.875 25.845 0 49.415-9.578 68.125-27.875v-.031c18.641-18.243 28.687-41.746 28.687-67.75 0-25.924-10.034-49.418-28.656-67.75v-.032h-.031c-18.692-18.228-42.234-27.937-68.125-27.937zm0 25.656c19.798 0 35.683 6.524 50.156 20.625l.032.032c14.324 14.114 20.937 29.743 20.937 49.406 0 19.794-6.62 35.402-20.937 49.406-14.461 14.148-30.336 20.594-50.188 20.594-19.832 0-35.715-6.48-50.187-20.594l-.032-.031c-14.384-13.984-20.906-29.542-20.906-49.375 0-19.722 6.628-35.35 20.938-49.407l.03-.03c14.463-14.136 30.34-20.626 50.157-20.626zM75.844 25c-16.825 0-28.188 15.321-28.188 31.281v885.813c0 15.929 11.4 31.261 28.157 31.281h.03c.032 0 180.95.544 362.407 1 90.736.228 181.588.423 250.031.531 34.222.054 62.831.099 83.032.094 10.1-.002 18.1-.01 23.656-.031 2.778-.01 4.955-.015 6.5-.032.772-.008 1.372-.02 1.875-.03.251-.007.46-.022.718-.032.25-.01.03.112 1.72-.156.023-.004.038-.028.062-.032 21.28-3.383 33.397-23.027 33.468-41.656v-.063c0-.866.172-83.603.22-106.625-6.332 1.265-12.853 1.907-19.532 1.907-2.068 0-4.12-.065-6.156-.188-.05 22.423-.219 103.549-.219 104.844v.063c-.053 7.96-4.27 14.87-11.406 16.25-.307.005-.567.026-1.032.031-1.435.015-3.563.02-6.312.031-5.497.021-13.478.03-23.563.032-20.17.005-48.786-.008-83-.063-68.427-.108-159.268-.334-250-.562-181.463-.456-362.437-.97-362.437-.97h-.031c-.275 0-2.5-1.125-2.5-5.624V56.28c0-4.375 2.378-5.593 2.5-5.593H813.03c.122 0 2.487 1.217 2.5 5.562v.031l-.25 115.438c3.351-.107 6.748-.156 10.219-.156 5.287 0 10.446.205 15.469.625.06-26.71.25-115.875.25-115.875v-.032c0-15.96-11.363-31.281-28.188-31.281zM840 612.594c-7.439 2.528-15.506 3.84-23.969 3.843H816c-.563.001-1.129-.016-1.688-.03-.02 9.4-.01 11.54-.03 20.655 1.894-.106 3.796-.187 5.718-.187 6.828 0 13.482.702 19.937 2.031.025-11.615.037-14.239.063-26.312zM207.366 808.848c0 13.044-10.578 23.571-23.57 23.571h-24.29c-12.993 0-23.571-10.578-23.571-23.57v-27.166c0-13.044 10.578-23.571 23.57-23.571h24.29c12.993 0 23.571 10.527 23.571 23.57zm0-196.064c0 12.992-10.578 23.52-23.57 23.52h-24.29c-12.993 0-23.571-10.58-23.571-23.52v-27.269c0-12.992 10.578-23.52 23.57-23.52h24.29c12.993 0 23.571 10.528 23.571 23.52zm0-196.22c0 12.993-10.578 23.52-23.57 23.52h-24.29c-12.993 0-23.571-10.578-23.571-23.52v-27.268c0-12.992 10.578-23.57 23.57-23.57h24.29c12.993 0 23.571 10.578 23.571 23.57zm0-196.167c0 12.941-10.578 23.52-23.57 23.52h-24.29c-12.993 0-23.571-10.579-23.571-23.52V193.13c0-12.992 10.578-23.52 23.57-23.52h24.29c12.993 0 23.571 10.579 23.571 23.52z"})))},open:function(t){return N.createElement("svg",ou({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Wi||(Wi=N.createElement("path",{d:"M244.594 393.594c-6.44-.041-12.385 1.563-17.656 4.406-5.272 2.843-10.281 6.928-12.907 13.844l-182.5 483.469c-2.635 6.942-.311 16.243 4.844 21.062 5.155 4.82 11.518 6.428 17.969 6.469h.031l706.156 3.343h.094c6.45.066 12.386-1.544 17.656-4.375 5.272-2.831 10.341-6.868 12.969-13.875.012-.032.02-.061.031-.093l182.407-483.438c2.627-6.986.191-16.385-5.032-21.156-5.206-4.756-11.54-6.303-17.968-6.313h-.063l-706.031-3.343zm-.156 25.687h.03l702.47 3.281-179.72 476.313v.031l-.03.032c.024-.067.009-.005.03-.063.476-1.247.318-.429-1.062.313-1.443.775-3.736 1.363-5.312 1.343h-.094L58.281 897.22l179.75-476.281c-.52 1.37-.323.451 1.094-.313s3.64-1.354 5.313-1.344zm45.468-345.469c-9.18.037-18.405.167-27.437.344-48.173.943-90.906 3.5-90.906 3.5l-1.22.063-1.155.312c-20.523 5.163-32.505 21.47-35.75 37.375l-26.625 87.875H53.437C38.61 203.281 25 214.575 25 230.094v669.343c0 15.463 13.596 26.75 28.438 26.75h1.124l1.094-.187 17.5-3.063-18.781-.093h-.031c-6.45-.041-12.814-1.65-17.969-6.469-5.155-4.82-7.48-14.12-4.844-21.063l19.157-50.75V230.095c0 .114.426-1.125 2.75-1.125h72.374l2.782-9.125 29.406-97 .25-.781.125-.813c1.324-7.909 5.455-14.985 16.156-18.031 2.16-.129 42.142-2.5 88.438-3.406 11.889-.233 24.095-.377 36.031-.344 11.936.033 23.6.233 34.375.656 20.959.822 39.048 2.824 47.375 5.156-.793-.113 2.378 1.452 5.5 4.281 3.62 3.282 8.312 8.07 13.531 13.782 10.438 11.425 23.014 26.493 35.031 41.406 24.035 29.825 45.907 59.063 45.907 59.063l3.844 5.156h317.406c2.463 0 2.843 1.136 2.843 1.125V396.25l25.657.125V230.094c0-15.519-13.71-26.813-28.5-26.813H497.375c-4.954-6.582-21.551-28.551-42.563-54.625-12.2-15.14-24.976-30.49-36.062-42.625-5.543-6.067-10.632-11.314-15.25-15.5s-7.606-7.502-14.594-9.625h-.031c-13.399-4.053-32.13-5.56-54.5-6.437-11.185-.44-23.14-.623-35.313-.656-3.043-.009-6.095-.013-9.156 0z"})))},paste:function(t){return N.createElement("svg",iu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Yi||(Yi=N.createElement("path",{d:"M361.281 25c-30.817 0-56.031 25.269-56.031 56.031 0 30.781 25.25 56.031 56.031 56.031H650.22c30.817 0 56.093-25.25 56.093-56.03C706.313 50.25 681.037 25 650.22 25zm0 25.688H650.22c16.94 0 30.406 13.47 30.406 30.343 0 16.873-13.467 30.344-30.406 30.344H361.28c-16.873 0-30.344-13.47-30.344-30.344 0-16.891 13.405-30.344 30.344-30.344zm-66.199 653.844H732.34v21.465H295.082zm0-114.256H732.34v21.516H295.082zm0-114.36H732.34v21.568H295.082zm0-114.308H732.34v21.568H295.082zm0-114.308H732.34v21.516H295.082zM179.594 67.781c-15.828 0-26.406 14.332-26.406 29.156v784.907c0 14.806 10.578 29.125 26.406 29.125H727.53l3.75-3.813 121-121.906L856 781.5V96.937c0-14.775-10.585-29.156-26.406-29.156H704.687a55.371 55.371 0 011.625 13.25c0 4.263-.52 8.409-1.437 12.406h124.5c-.258.084.938.613.938 3.5v674l-113.47 114.344h-537.25c.936 0-.718-.27-.718-3.437V96.937c0-3.25 1.654-3.5.719-3.5h127.094c-.917-3.997-1.438-8.143-1.438-12.406a55.5 55.5 0 011.625-13.25zM79.063 51.97c-16.802 0-30.376 14.117-30.376 30.812v861.407c0 16.711 13.62 30.812 30.376 30.812h841.78c16.816 0 30.47-14.073 30.47-30.813V82.782c0-16.8-13.713-30.812-30.47-30.812h-222.75c4.648 7.58 7.556 16.313 8.126 25.656h214.625c2.552 0 4.781 2.032 4.781 5.156v861.407c0 3.081-2.185 5.125-4.781 5.125H79.062c-2.552 0-4.687-1.913-4.687-5.125V82.78c0-3.126 2.18-5.156 4.688-5.156h226.28c.57-9.338 3.487-18.076 8.126-25.656z"})))},"period-table":function(t){return N.createElement("svg",au({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),$i||($i=N.createElement("path",{d:"M939.757 670.75h-75.171v247.117c0 14.211-3.176 24.831-9.527 31.65-6.35 6.924-14.524 10.36-24.623 10.36-10.203 0-18.48-3.488-24.936-10.463-6.455-6.976-9.682-17.492-9.682-31.547V670.749h-75.172c-11.765 0-20.51-2.603-26.237-7.756-5.674-5.206-8.59-12.026-8.59-20.563 0-8.798 3.02-15.774 8.955-20.875 5.934-5.102 14.576-7.6 25.872-7.6h219.059c11.921 0 20.77 2.602 26.601 7.86 5.779 5.258 8.694 12.13 8.694 20.615 0 8.485-2.967 15.357-8.798 20.563-5.83 5.153-14.68 7.756-26.445 7.756zM533.916 821.56H470.77v96.307c0 13.795-3.28 24.259-9.735 31.39-6.507 7.132-14.732 10.672-24.623 10.672-10.36 0-18.69-3.54-25.04-10.567-6.351-7.08-9.527-17.388-9.527-31.027V656.121c0-15.149 3.488-25.977 10.464-32.484 6.924-6.455 18.012-9.735 33.16-9.735h88.447c26.132 0 46.279 1.978 60.282 5.987 13.952 3.852 25.977 10.307 36.076 19.261 10.152 9.006 17.856 19.99 23.062 32.953 5.31 13.014 7.913 27.642 7.913 43.884 0 34.67-10.672 60.908-32.016 78.815-21.291 17.804-53.099 26.758-95.317 26.758zm-16.711-155.913H470.77v103.96h46.435c16.242 0 29.83-1.718 40.71-5.154 10.931-3.384 19.208-8.954 24.935-16.71 5.674-7.705 8.59-17.856 8.59-30.402 0-14.993-4.426-27.174-13.275-36.649-9.787-10.047-30.142-15.045-60.96-15.045zm2.857-625.585v461.72h263.625V40.061H520.063zm26.032 26.032h211.562V475.75H546.094V66.094zM25 40.063v243.843h758.688V40.062H25zm26.031 26.03h706.625v191.782H51.031V66.094zM25 40.064v758.75h263.625V40.063H25zm26.031 26.03h211.563v706.688H51.03V66.094zM25 40.064V501.78h758.688V40.062H25zm26.031 26.03h706.625V475.75H51.031V66.094z"})))},"reaction-arrow-open-angle":function(t){return N.createElement("svg",vu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ma||(ma=N.createElement("path",{d:"M750 375L375 750l-66.094-66.094L570.47 421.875H0v-93.75h570.469L308.906 66.094 375 0zm0 0"})))},"reaction-arrow-filled-triangle":function(t){return N.createElement("svg",pu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),pa||(pa=N.createElement("path",{d:"M-10.431 340.003h690.425v93.394H-10.431z"})),va||(va=N.createElement("path",{d:"M356.736 763.914V-14.935l382.44 406.993z",stroke:"#000",strokeWidth:2.29})))},"reaction-arrow-filled-bow":function(t){return N.createElement("svg",du({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ha||(ha=N.createElement("path",{d:"M27.105 322.531H717.53v93.394H27.105z"})),da||(da=N.createElement("path",{d:"M394.272 746.442c117.734-288.125 101.763-542.095 0-778.848l382.44 406.992z",stroke:"#000",strokeWidth:2.29})))},"reaction-arrow-dashed-open-angle":function(t){return N.createElement("svg",uu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Xi||(Xi=N.createElement("path",{d:"M424.66 119.77l79.535-76.723 306.282 334.441-79.536 76.724zM-24.658 343.896h128.916v92.771H-24.658zM194.017 338.474h128.916v92.771H194.017zM415.084 339.679H544v92.771H415.084z"})),Qi||(Qi=N.createElement("path",{d:"M497.05 703.131l-76.871-79.393 333.874-306.9 76.87 79.393z"})))},"reaction-arrow-failed":function(t){return N.createElement("svg",hu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ua||(ua=N.createElement("path",{d:"M1.804 345.315h690.425v93.394H1.804z"})),ca||(ca=N.createElement("path",{d:"M368.971 769.225c117.734-288.125 101.763-542.095 0-778.848l382.44 406.992z",stroke:"#000",strokeWidth:2.29})),la||(la=N.createElement("path",{d:"M84.755 223.701l286.652 295.997-24.234 23.469L60.521 247.17z"})),fa||(fa=N.createElement("path",{d:"M68.496 529.121l282.418-300.039 24.565 23.123L93.06 552.243z"})))},"reaction-arrow-both-ends-filled-triangle":function(t){return N.createElement("svg",su({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Ki||(Ki=N.createElement("path",{d:"M37.818 326.207h690.425v93.394H37.818z"})),Ji||(Ji=N.createElement("path",{d:"M575.992 672.99V54.758l260.844 323.06zM186.163 680.021V61.791l-260.845 323.06z",stroke:"#000",strokeWidth:1.685})))},"reaction-arrow-equilibrium-filled-half-bow":function(t){return N.createElement("svg",cu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ta||(ta=N.createElement("path",{d:"M770.726 302.117c0-1.163-.72-3.255-1.572-4.65-.85-1.395-63.251-71.143-138.682-155.307C555.107 58.23 493.034-11.054 492.576-11.519c-.59-.93 39.082 67.44 55.546 138.321l12.133 52.236-226.725.09c-87.02.93-197.94 1.627-246.524 1.627H-1.26v54.636c0 34.874.262 54.636.655 54.636.327 0 .655 3.255.655 6.975v6.975h385.337c211.953 0 385.338-.93 385.338-1.86zM-12.292 450.293c0 1.162.72 3.255 1.571 4.65.851 1.395 63.252 71.143 138.682 155.306 75.365 83.93 137.439 153.214 137.897 153.68.59.93-39.082-67.44-55.546-138.321l-12.133-52.236 226.725-.09c87.02-.93 197.94-1.627 246.524-1.627h88.264v-54.636c0-34.875-.262-54.637-.654-54.637-.328 0-.655-3.255-.655-6.974v-6.975H373.045c-211.952 0-385.337.93-385.337 1.86z"})))},"reaction-arrow-equilibrium-filled-triangle":function(t){return N.createElement("svg",lu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ea||(ea=N.createElement("path",{d:"M-11.449 132.17h690.425v93.394H-11.449z"})),na||(na=N.createElement("path",{d:"M432.132 340.34V14.554l383.826 170.24z",stroke:"#000",strokeWidth:1.484})),ra||(ra=N.createElement("path",{d:"M783.629 494.803H93.204v93.394h690.425z"})),oa||(oa=N.createElement("path",{d:"M340.047 702.972V377.188l-383.825 170.24z",stroke:"#000",strokeWidth:1.484})))},"reaction-arrow-equilibrium-open-angle":function(t){return N.createElement("svg",fu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ia||(ia=N.createElement("path",{d:"M739.403 211.565H9.283v99.167h730.12z"})),aa||(aa=N.createElement("path",{d:"M394.558 46.921l-63.308 70.664L676.095 282.23l63.308-70.664zM3.916 531.418h730.12v-99.167H3.916z"})),sa||(sa=N.createElement("path",{d:"M348.76 696.062l63.308-70.664L67.223 460.754 3.916 531.418z"})))},"reaction-arrow-unbalanced-equilibrium-filled-half-bow":function(t){return N.createElement("svg",mu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ga||(ga=N.createElement("path",{d:"M767.714 314.435c0-.994-.72-2.783-1.572-3.975-.85-1.193-63.251-60.82-138.682-132.77-75.365-71.751-137.438-130.981-137.896-131.379-.59-.795 39.082 57.654 55.546 118.25l12.133 44.655-226.725.076c-87.02.795-197.94 1.392-246.524 1.392H-4.271v46.708c0 29.813.262 46.708.655 46.708.327 0 .655 2.782.655 5.962v5.963h385.337c211.952 0 385.338-.795 385.338-1.59zM131.684 471.752c0 1.02.45 2.857.983 4.082.532 1.224 39.56 62.45 86.736 136.328 47.137 73.675 85.96 89.914 86.246 90.322.369.816-24.443-14.62-34.74-76.84l-7.589-45.853 141.802-.078c54.426-.817 123.8-1.429 154.186-1.429h55.204v-47.96c0-30.612-.164-47.96-.41-47.96-.205 0-.41-2.857-.41-6.122v-6.123H372.689c-132.563 0-241.004.817-241.004 1.633z"})))},"reaction-arrow-unbalanced-equilibrium-open-half-angle":function(t){return N.createElement("svg",bu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),wa||(wa=N.createElement("path",{d:"M747.563 205.719H17.443v92.928h730.12z"})),xa||(xa=N.createElement("path",{d:"M463.18 13.566l-52.207 82.471L695.355 288.19l52.207-82.47zM155.614 486.606h466.02v-85.028h-466.02z"})),Oa||(Oa=N.createElement("path",{d:"M364.205 669.392l38.294-78.451-208.59-182.787-38.294 78.452z"})))},"reaction-arrow-unbalanced-equilibrium-large-filled-half-bow":function(t){return N.createElement("svg",yu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ba||(ba=N.createElement("path",{d:"M871.836 283.935c0-1.29-.916-3.61-1.999-5.157-1.082-1.548-80.428-78.91-176.342-172.26-95.831-93.094-174.76-169.94-175.343-170.456-.75-1.032 49.695 74.801 70.63 153.42l15.427 57.938-288.293.1c-110.652 1.03-251.692 1.804-313.47 1.804h-112.234v60.6c0 38.682.334 60.602.833 60.602.416 0 .833 3.61.833 7.736v7.736h489.979c269.509 0 489.979-1.031 489.979-2.063zM63.086 488.044c0 1.324.573 3.707 1.25 5.296.677 1.588 50.303 81.024 110.291 176.877 59.936 95.588 109.302 116.657 109.666 117.186.47 1.06-31.08-18.968-44.174-99.694l-9.65-59.491 180.31-.102c69.206-1.06 157.418-1.853 196.056-1.853h70.195v-62.225c0-39.718-.208-62.225-.52-62.225-.261 0-.521-3.707-.521-7.944v-7.943H369.537c-168.56 0-306.45 1.059-306.45 2.118z"})))},"reaction-arrow-unbalanced-equilibrium-filled-half-triangle":function(t){return N.createElement("svg",gu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ya||(ya=N.createElement("path",{d:"M784.932 289.269c0-1.076-.766-3.014-1.672-4.305-.906-1.292-67.3-65.874-147.559-143.802C555.512 63.449 489.466-.702 488.978-1.133c-.627-.861 7.483 61.387 9.704 129.279l1.464 44.752-180.393 2.492c-92.59.861-210.61 1.507-262.304 1.507h-93.914v50.589c0 32.29.279 50.589.697 50.589.348 0 .697 3.014.697 6.458v6.458H374.93c225.519 0 410.002-.86 410.002-1.722zM108.192 459.657c0 1.106.479 3.095 1.045 4.421.567 1.327 47.13 65.78 100.735 140.686 56.969 69.146 83.015 104.354 83.32 104.796.392.884.067-15.802.095-84.076l.02-46.68 105.725-2.216c57.91-.884 131.723-1.547 164.055-1.547h58.737v-51.945c0-33.156-.174-51.944-.436-51.944-.218 0-.436-3.095-.436-6.632v-6.63h-256.43c-141.048 0-256.43.883-256.43 1.767z"})))},"reaction-automap":function(t){return N.createElement("svg",wu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Ea||(Ea=N.createElement("path",{d:"M153.324 0v306.648h-73.89V73.891H5.543V0zm443.352 443.352v70.195h73.89V750h73.891V443.352zm-99.754-110.84l-73.89 69.828-143.724-143.72-52.094 52.094 142.242 142.242-68.348 64.285h195.813zm0 0"})))},"reaction-map":function(t){return N.createElement("svg",xu({xmlns:"http://www.w3.org/2000/svg",viewBox:"-125 -125 1000 1000",height:1e3,width:1e3},t),_a||(_a=N.createElement("path",{d:"M333.296 750V116.666H166.481V0h291.926v750zM41.37 583.335h125.111V500H41.37zm542.149 0H708.63V500H583.519zm0 0"})))},"reaction-plus":function(t){return N.createElement("svg",Ou({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Sa||(Sa=N.createElement("path",{d:"M450 300h300v150H450v300H300V450H0V300h300V0h150zm0 0"})))},"reaction-unmap":function(t){return N.createElement("svg",Eu({xmlns:"http://www.w3.org/2000/svg",viewBox:"-125 -125 1000 1000",height:1e3,width:1e3},t),ja||(ja=N.createElement("path",{d:"M96.84 44.171l609.284 609.16-52.963 52.915-194.754-194.998v238.748h-125.11V386.249L43.876 97.086zm361.567 291.663V.004H166.484V41.67l83.406 75h83.407v91.667zM41.374 583.332h125.11V500H41.374zm667.252 0V500H625.22zm0 0"})))},recognize:function(t){return N.createElement("svg",_u({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),Aa||(Aa=N.createElement("path",{d:"M519.29 474.242L641.601 596.56l-44.68 45.41-122.313-123.047zM706.054 596.56c0-7.325-2.442-13.43-7.325-18.313L160.398 39.918c-4.882-4.883-10.984-7.324-18.308-7.324s-13.672 2.441-19.043 7.324L40.28 122.68c-5.367 4.882-8.054 11.23-8.054 19.043 0 7.812 2.687 13.918 8.054 18.312l538.332 538.328c4.883 5.371 10.989 8.059 18.309 8.059 7.328 0 13.672-2.688 19.047-8.059l82.761-82.761c4.883-4.883 7.325-11.23 7.325-19.043zm-565.43 79.832l41.016-12.45-41.016-12.453-12.453-41.015-12.45 41.015-41.015 12.453 41.016 12.45 12.449 41.015zm146.484-68.114l82.032-24.902-82.032-24.902-24.902-82.032-24.902 82.032-82.032 24.902 82.032 24.902 24.902 82.032zm389.649-199.953l41.015-12.449-41.015-12.453-12.453-41.016-12.45 41.016-41.015 12.453 41.015 12.45 12.45 41.015zM408.69 676.391l41.016-12.45-41.016-12.453-12.449-41.015-12.453 41.015-41.016 12.453 41.016 12.45 12.453 41.015zm0 0"})))},redo:function(t){return N.createElement("svg",Su({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Pa||(Pa=N.createElement("path",{d:"M516.535 183.482c-42.511-3.244-84.89.665-126.774 12.838-166.696 48.452-311.99 227.933-362.668 601.774-.254 1.873-1.356 2.931-1.605 4.814l-9.629 65.794 33.7-57.77c113.495-200.68 220.912-288.903 311.317-308.108 90.406-19.205 166.973 27.93 223.058 110.726-.15 1.044-.856 3.722-3.21 8.024-4.706 8.603-13.412 21.578-25.675 36.908-24.526 30.661-61.65 71.78-97.889 121.96l-14.442 20.861h25.675c132.691 0 364.082-4.623 494.257-6.419l12.838-1.604v-12.838s-3.21-373.383-3.21-505.49v-30.49l-22.466 22.466c-29.89 29.89-68.797 64.785-101.098 96.284-88.105-100.114-208.858-170.318-332.179-179.73zm-1.605 25.676c119.433 9.385 239.23 78.63 324.156 179.73l8.023 11.233 9.629-11.233c26.536-26.495 59.982-56.526 89.865-85.05.344 144.968 3.051 448.397 3.21 465.37-125.038 1.834-325.007 5.912-455.744 6.42 29.225-38.47 59.383-75.03 80.236-101.098 12.553-15.693 22.561-28.558 28.886-40.118 3.162-5.78 5.534-11.524 6.418-17.653.797-5.515-.768-12.485-4.814-17.652-.236-.349-1.367.349-1.604 0-59.698-87.544-145.64-143.518-247.129-121.959-90.757 19.28-190.036 110.26-292.06 271.2C120.47 420.83 252 262.763 397.784 220.39c38.758-11.265 77.334-14.361 117.145-11.233z"})))},"rgroup-attpoints":function(t){return N.createElement("svg",ju({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"-125 -125 1000 1000"},t),ka||(ka=N.createElement("path",{d:"M10.941 699.883L363.883 346.94H185.648v-70.59h299.293v298.942h-70.59v-178.94L61.412 749.293zm550.59-611.649l-97.765 14.118 70.586 67.058-17.645 98.824 88.234-45.882 88.235 45.882-17.645-98.824 70.586-67.058-98.824-14.118L604.941 0zm0 0"})))},"rgroup-fragment":function(t){return N.createElement("svg",Au({xmlns:"http://www.w3.org/2000/svg",viewBox:"-125 -125 1000 1000",height:1e3,width:1e3},t),Ta||(Ta=N.createElement("path",{d:"M340.91 68h-68.183v68.223h68.183zM136.363 477.332v68.223h68.184v-68.223zm0-136.441v68.218h68.184v-68.218zm0 272.886c2.477 36.606 31.602 65.746 68.184 68.223v-68.223zM204.547 68c-36.582 2.477-65.707 31.617-68.184 68.223h68.184zm409.09 545.777h-68.184V682h68.184zm0-545.777h-68.184v68.223h68.184zm-306.82 545.777h-68.18V682h68.18zm170.456 0H409.09V682h68.183zM204.547 204.445h-68.184v68.223h68.184zM681.817 68v68.223H750C747.527 99.617 718.398 70.477 681.816 68zM750 204.445h-68.184v68.223H750zM477.273 68H409.09v68.223h68.183zM750 613.777h-68.184V682c36.582-2.477 65.711-31.617 68.184-68.223zm0-272.886h-68.184v68.218H750zm0 136.441h-68.184v68.223H750zm-102.273 68.223h-68.18V272.668h-68.184v-68.223h136.364zm-159.204 0l-70.57-124.504c35.586-15.133 57.73-51.11 55.23-89.715a123.191 123.191 0 00-34.695-89.508 123.035 123.035 0 00-88.375-37.383H238.637l3.41 341.11h64.77V433.328h43.636l58.637 112.227zM306.816 272.668h37.5c38.868 0 60 12.621 60 48.777 0 36.157-21.132 55.262-60 55.262h-37.5zm-170.453 110.52L25.91 493.706 0 467.781l84.203-84.594L0 298.59l25.91-25.922zm0 0"})))},"rgroup-label":function(t){return N.createElement("svg",Pu({xmlns:"http://www.w3.org/2000/svg",viewBox:"-125 -125 1000 1000",height:1e3,width:1e3},t),Ca||(Ca=N.createElement("path",{d:"M750 572.5h-78.95v-316h-78.945v-79H750zm-276.316 0l-68.29-130.746h-50.132V572.5h-75.79l-3.156-395h129.868a142.468 142.468 0 01101.894 42.875 142.625 142.625 0 0140.606 102.879c2.898 44.707-22.746 86.363-63.946 103.887L565.656 572.5zM355.262 375h43.422c45 0 69.472-21.723 69.472-63.988 0-42.266-24.472-54.512-69.472-54.512h-43.422zM30 256.5L0 285.73l97.5 97.961L0 481.254l30 30.023 127.895-127.586zm0 0"})))},save:function(t){return N.createElement("svg",ku({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ra||(Ra=N.createElement("path",{d:"M295.39 753.522c-12.297 0-22.913 1.56-32.094 4.814-4.59 1.626-9.05 4.854-12.838 8.023-3.789 3.17-8.024 7.579-8.024 14.443v166.892c0 6.845 4.229 12.868 8.024 16.047 3.795 3.18 8.244 4.796 12.838 6.42 9.187 3.246 19.807 4.813 32.095 4.813h470.185c12.275 0 22.92-1.56 32.095-4.814 4.587-1.627 9.05-3.25 12.838-6.419 3.787-3.169 8.023-9.183 8.023-16.047V780.802c0-6.85-4.24-11.27-8.023-14.443-3.784-3.172-8.252-6.395-12.838-8.023-9.173-3.256-19.797-4.814-32.095-4.814zm0 25.675h470.186c9.835 0 18.776 1.33 24.071 3.21 1.63.578 2.412 1.151 3.21 1.604v160.473c-.802.455-1.577 1.026-3.21 1.605-5.306 1.882-14.264 3.21-24.07 3.21H295.39c-9.845 0-18.764-1.334-24.071-3.21-1.633-.577-2.412-1.152-3.21-1.605V784.011c.802-.454 1.575-1.025 3.21-1.604 5.312-1.882 14.235-3.21 24.07-3.21zM202.317 24.974c-15.675 0-28.631 2.277-40.118 8.024-11.487 5.747-22.466 16.568-22.466 30.49v465.371c0 13.907 9.378 24.724 20.861 30.49 11.484 5.766 26.017 8.024 41.723 8.024h595.355c15.684 0 30.237-2.26 41.723-8.024 11.486-5.763 20.861-16.567 20.861-30.49V63.488c0-13.922-10.984-24.737-22.466-30.49-11.482-5.753-24.434-8.024-40.118-8.024zm0 25.676h595.355c12.2 0 22.073 3.006 28.885 6.419 6.812 3.413 8.024 6.373 8.024 6.419v465.371c0 .097-1.216 3.004-8.024 6.42-6.808 3.415-16.685 6.418-28.885 6.418H202.316c-12.229 0-22.087-3.005-28.885-6.419-6.798-3.413-8.024-6.306-8.024-6.419V63.488c0-.097 1.217-3.013 8.024-6.42 6.807-3.405 16.677-6.418 28.885-6.418zm-97.879-25.681c-44.063 0-78.656 36.186-78.656 80.25V894.75c0 44.064 34.593 80.219 78.656 80.219h190.938c-12.287 0-22.907-1.566-32.094-4.813-4.593-1.623-9.017-3.227-12.812-6.406-3.493-2.926-7.377-8.27-7.969-14.438H104.437c-30.19 0-52.968-24.372-52.968-54.562V105.219c0-30.19 22.778-54.563 52.968-54.563h38.594c4.107-7.743 11.508-13.83 19.156-17.656 11.487-5.747 24.45-8.031 40.125-8.031zm693.22 0c15.683 0 28.642 2.278 40.124 8.031 7.644 3.83 15.048 9.917 19.157 17.656h38.625c30.19 0 54.562 24.384 54.562 54.563V894.75c0 30.178-24.372 54.563-54.563 54.563h-77.125c-.593 6.18-4.452 11.52-7.937 14.437-3.787 3.169-8.256 4.78-12.844 6.406-9.174 3.254-19.819 4.813-32.093 4.813h130c44.063 0 80.218-36.143 80.218-80.219V105.219c0-44.076-36.155-80.25-80.218-80.25z"})))},"select-fragment":function(t){return N.createElement("svg",Tu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ma||(Ma=N.createElement("path",{d:"M394.594 339.531l137.969 603.407 107.406-179.032L784.53 923.031l127.282-123.343-148.5-163.063 161.75-50.406zm29.031 37l453.219 209.406-149.907 41.97 146.844 167.03L780.5 887.25 633 724.906 540.812 888.47zm45.438 56.031l84.468 368.625 72.125-128.156 154.907 169.157 49.937-48.25-150.75-177.22 127.313-37.093zM328.418 171.168h353.295v31.825H328.419zM843.344 464.25l-37.813 66.375 29 13.5 36.532-64.094zM326.387 810.135L142.28 479.951l27.8-15.497L354.19 794.64zm402.238 51.334l-8.688 15.562H572.095l-18.813 31.375H737.5l12.844-23zm187.031-272.313l-42.437 13.219-53.625 96.063 21.75 23.875zM262.5 57.063L25 482.813l237.5 425.593h262.156l-7.156-31.375H279.969L60.03 482.875 279.97 88.531h440l219.937 394.344-48.843 87.531 27.843 12.938L975 482.812 737.5 57.063z"})))},"select-lasso":function(t){return N.createElement("svg",Cu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ia||(Ia=N.createElement("path",{d:"M384.469 319.844L526.563 941.25l110.625-184.344 148.875 163.907L917.155 793.78l-152.937-168 166.625-51.906zm31.875 38.094l466.812 215.718-154.375 43.157L880 788.875l-96.063 95.063L632 716.688l-94.938 168.5zm46.812 57.687l86.969 379.688 74.313-132 159.5 174.218 51.468-49.656-155.281-182.5 131.094-38.281zm64.438-356.344l3.531 26.657s1.257.037 3.031.093V59.5c-4.01-.15-6.562-.2-6.562-.219zm-55.813.188c-4.705.225-8.312.406-15.625.75v26.468l15.625-.593zm15.594.531v25.5l6.344-.25zm62.406.375v26.469c4.804.35 10.13.872 15.594 1.531V61.844c-5.423-.648-10.707-1.11-15.594-1.469zm-109.218.938c-7.676.892-9.783 1.13-15.594 1.812v26.906l15.594-1.687zm140.406 2.156V90.03c5.85.708 11.223 1.49 15.593 2.188V65.53a436.22 436.22 0 00-15.593-2.062zm-171.594 1.468l-4.75.563 4.75 9.375zm-44.438 7.844s-2.032.43-2.375.5v27.906c1.941-.504 4.517-1.186 6.22-1.624 5.627-1.092 7.924-1.535 9.374-1.813V93.5zm285 2.969l-6.125 25.688s6.35 1.521 15.157 3.843V78c-5.204-1.317-9.032-2.25-9.032-2.25zM346.97 76.813c-4.769 1.283-10.004 2.703-15.594 4.218v28.219a199.197 199.197 0 0111.938-3.094c1.332-.34 2.332-.596 3.656-.937zm327.594 5.28v27.47c2.042.596 4.098 1.242 6.156 1.874 3.206 1.107 6.322 2.157 9.437 3.22v-27.97l-.093-.03a530.587 530.587 0 00-15.5-4.563zM315.78 85.22c-5.716 1.649-11.087 3.43-15.625 5.125v20.094l6.688 7.062s3.708-1.332 8.937-3.094zm390 6.844v27.906c6.76 2.141 11.094 4.052 11.094 4l4.5-8.594V97.406c-1.32-.466-2.73-.929-4.313-1.437-3.088-1.06-7.528-2.614-11.28-3.906zm-457.25 18.312c-1.096.136-5.153 2.001-10.75 4.813v32.406a1001.547 1001.547 0 0115.594-8.094v-25.063l-4.531-4.03c-.03-.058-.15-.052-.313-.032zm519.625 7.156v30.188c4.921 2.603 9.943 5.288 15.625 8.281v-30.063c-5.622-3.028-14.97-8.053-15.625-8.406zm-546 5.813c-5.095 2.73-10.42 5.625-15.594 8.5v33.312c2.85-1.909 8.634-5.24 15.594-9.094zm46.813 5.031v3.594c1.59-.672 2.631-1.025 2.937-.969zm530.406 5.969v31.625c6.266 4.078 14.55 9.476 15.594 10.156v-31.969c-4.06-2.664-7.566-4.975-11.907-7.812-1.849-.994-1.858-1.016-3.687-2zM752.562 137l-1.25 1.813s1.136.595 1.25.656zm-561.593 3.719c-8.26 4.823-14.037 8.454-13.719 8.969l13.719 8.593zm639.593 13.687V165.5l7.125-6.406s-3.994-2.624-7.125-4.688zM145 173.22s-.661.516-.844.656v40.656c.346-.308.682-.631 1.031-.937 4.89-5.005 10.008-9.688 14.594-13.625V181zm724.188 11.187l-7.407 5.344v25.344c3.86 3.779 8.058 7.98 12.157 12.344 1.25 1.462 2.2 2.555 3.437 4v-39.344a554.283 554.283 0 00-8.188-7.688zm-740.625 2.563c-4.459 3.984-9.3 8.51-13.938 13.375-.56.505-1.105 1.02-1.656 1.531v37.594l6.25 2.156s3.105-3.626 7.75-9.063c.503-.633 1.041-1.304 1.594-1.968zm764.406 20.656v42.25c3.246 4.296 5.031 7.219 5.031 7.219l10.563-4.563V225.47c-3.394-4.016-6.426-7.602-10.094-11.969a369.97 369.97 0 00-5.5-5.875zM97.375 218.469c-.65.804-1.288 1.61-1.875 2.375l-8.156 9.75 10.031 3.469zM64.25 263.094s-3.093 4.064-6.313 11.031c-2.003 3.977-4.81 9.558-7.374 14.656v51.188l15.593 1.75v-78.125zm17.531 4.656v32.75c3.385-6.59 6.848-13.328 9.406-18.281 3.062-6.492 6.063-10.344 6.063-10.344zm858 14.125l-15.625 4.938v15.062c2.87 6.174 6.117 13.913 8.625 22.094 3.599 8.585 5.582 17.683 7 24.687zM955.375 302v57.563l15.594-1.594v-2.094c-.29-1.33-.926-4.22-2.25-10.531-1.478-7.6-3.583-17.676-7.594-27.281-1.675-5.623-3.712-11.104-5.75-16.063zM34.969 328.906c-1.722 5.392-2.707 8.943-2.375 9.031l2.375.282zm-8.75 48.406s-2.702 20.378-.063 40.75c.37 20.531 7.345 40.114 6.5 40.22l2.313-.25v-80.376zm24.343.938v78.031l15.594-1.75v-4.406c-1.684-6.512-5.149-19.648-5.375-33.344-2.48-19.053.063-38.156.063-38.156zm904.813 19.906v79.719l5.469 1.156s1.705-4.873 4.343-12.156a14299.35 14299.35 0 005.782-26.813v-41.906zm-15.594 49.219c-1.164 5.316-2.28 10.366-3.156 14.531-2.48 6.703-4.063 11.219-4.063 11.219l7.22 1.5zM66.156 492.313l-15.594 2.875V507.5c3.434 6.861 8.122 15.961 13.22 24.875.862 1.298 1.517 2.273 2.374 3.563zm15.625 3.468v63.281c3.175 4.152 5.458 6.563 5.5 6.563l10.094-3.5v-37.5c-.24-.35-.417-.619-.656-.969-6.279-10.788-11.746-21.481-14.938-27.875zm842.375 13.625v41.063c5.458-8.383 11.312-16.443 15-23 .378-.75.276-.558.625-1.25v-11.875zm-15.593 14.156c-3.276 4.982-7.257 10.551-11.032 16.25-1.409 2.3-2.966 4.478-4.562 6.563v34.219l4.968 2.812s3.32-3.91 8.282-9.875c.731-.896 1.525-1.821 2.343-2.781zm-795.594 23.72v9.468l6.187-2.156s-2.627-2.673-6.187-7.313zm764.406 17.562a2034.665 2034.665 0 01-3.969 4.625l3.969 2.25zm-732.781 17.312l-.438.188v40.093c.041.033.084.062.125.094 5.204 4.494 10.584 8.63 15.5 12.219v-38.313c-2.442-2.099-4.66-4.132-6.531-6.062a980.41 980.41 0 00-8.656-8.219zm-16.031 6.875l-14.625 6.25s3.636 3.554 9.124 8.938c1.607 1.686 3.482 3.451 5.5 5.281zm717.593 6.844c-.554.498-3.607 3.237-8.906 7.188-1.819 1.427-4.538 3.511-6.688 5.187v33.625c3.11-2.034 3.215-2.112 6.438-4.219 3.322-2.627 5.963-4.722 9.156-7.25zm15.625 10.563v11.593c4.583-3.656 7.393-6.218 7.438-6.218zm-686.406 2.437v36.563c.766.484 1.844 1.156 1.844 1.156l13.75-8.625V620.53c-4.764-3.304-10.212-7.282-15.594-11.656zm639.594 11.313l-15.594 10.03V657l2.938 3.375s8.887-5.812 12.656-8.281zm-573.25 28.687c-1.207 1.495-2.549 2.951-3.938 4.406v34.407a224.779 224.779 0 015.188 4.718A118.45 118.45 0 00237.78 694v35.219c4.916-2.487 10.136-4.393 15.594-5.844v-65.438c-3.965-3.289-7.809-6.283-11.5-8.875-.053-.105-.104-.082-.156-.187zm-19.563 18.375c-1.699 1.393-3.389 2.792-5.094 4.188 1.65 1.158 3.49 2.611 5.094 3.812zM268.97 672v48.375c.146-.02.29-.044.437-.063a468.42 468.42 0 0115.156 18.844V686.25c-.53.028-1.06.062-1.593.094a370.663 370.663 0 00-14-14.344zm62.406 13.25V718c5.166.044 10.367.228 15.594.531V685.72c-5.2-.266-10.401-.435-15.594-.469zm-15.594.219l-9.594.187c-1.95.028-4.013.06-6.03.094v75.094a479.371 479.371 0 019.406 14.406c-.634.317-1.098.705-1.625.969a105.8 105.8 0 01-7.782 4.28v35.47a118.074 118.074 0 0015.625-6.563V726.47a542.501 542.501 0 00-6.031-8.094l6.031-.156v-32.75zm46.781 1.343v80.407c1.038-1.438 2.092-2.896 3.125-4.407 4.54-6.491 7.426-13.502 9.907-19.625a203.687 203.687 0 012.562-6.093v-48.688a535.108 535.108 0 00-15.594-1.593zm31.22 3.625v33.125c5.206.755 10.4 1.53 15.593 2.344V692.75a1073.13 1073.13 0 00-15.594-2.313zm31.187 4.813v33.156c.549.09 1.108.161 1.656.25 4.616.744 9.277 1.524 13.938 2.282V697.75c-2.878-.466-5.756-.91-8.657-1.375-2.304-.377-4.624-.749-6.937-1.125zm31.187 4.938v6.218l.188-6.187-.188-.032zm-234 .343a99.585 99.585 0 00-10.594 6.282 102.446 102.446 0 00-5 3.718v91.188c4.639 3.321 9.861 6.269 15.594 8.843V772.22c-4.825-4.324-7.786-9.163-8.281-13.938-.612-5.7 2.31-11.87 8.281-17.875zM346.97 726.5c-.614 1.455-1.223 2.895-1.781 4.281-2.059 5.067-3.936 9.818-6.47 13.407a315.472 315.472 0 01-5.5 7.593c-.612-.955-1.226-1.896-1.843-2.843v65.25c6.04 12.274 11.317 24.687 15.594 36.937zm-156 .281c-9.713 13.952-10.48 27.003-9.656 35.063.947 8.813 4.273 17.138 9.656 24.593zm46.812 54.782v34.812c5.265 1.592 10.453 2.79 15.594 3.594v-33.407c-5.04-1.13-10.218-2.8-15.594-5zm46.781 4.78c-5.175 1.31-10.352 1.985-15.593 2v32.845a95.481 95.481 0 0015.594-1.313zm78 17.313V933.22l15.594 3.25V841.5c-4.345-12.648-9.616-25.323-15.594-37.844z"})))},"select-rectangle":function(t){return N.createElement("svg",Ru({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Na||(Na=N.createElement("path",{d:"M370 332l146.965 643 114.506-190.844 154.028 169.688 135.72-131.531-158.372-173.844 172.43-53.719zm30.835 39.156l483.079 223.25-159.745 44.782 156.496 178-99.447 98.375-157.183-173.094-98.26 174.469zm48.489 59.813l89.948 392.969 76.952-136.625 165.057 180.343 53.27-51.468L673.835 627.25l135.72-39.531zM145.228 817H35V706h110.228zm-76.3-34H111v-43H68.929zM855 706.406v42.938L916.063 817H965V706.406zM888.663 740H931v42.719c-45.278 3.257-42.337.156-42.337-42.406zM965 135H855V25h110zm-76.352-34H931V59h-42.352zm-743.42 34H35V25h110.228zm-76.3-34H111V59H68.929zM111.3 744H188v33h-76.7zm113.605 0H336v33H224.905zM373 743.562V777h98.663l-7.592-33.438zM73.572 146H107v109H73.572zm0 436H107v109H73.572zm0-145H107v109H73.572zm0-145H107v109H73.572zm816.922-146H924v109h-33.506zm33.099 452.375L891 608.688V691h32.593zM890.494 437H924v109h-33.506zm0-145H924v109h-33.506zM111.3 65H188v33h-76.7zm557.42 0H780v33H668.72zm147.85 0H877v33h-60.43zm-591.665 0H336v33H224.905zm147.903 0H484v33H372.808zm148.008 0H632v33H520.816z"})))},settings:function(t){return N.createElement("svg",Mu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ba||(Ba=N.createElement("path",{d:"M666.667 500c0-91.797-74.87-166.667-166.667-166.667S333.333 408.203 333.333 500 408.203 666.667 500 666.667 666.667 591.797 666.667 500zM1000 429.036v144.532c0 9.765-7.813 21.484-18.23 23.437l-120.442 18.23c-7.161 20.833-14.974 40.364-25.39 59.244 22.135 31.901 45.572 60.547 69.661 89.844 3.906 4.557 6.51 10.417 6.51 16.276 0 5.86-1.953 10.417-5.859 14.974-15.625 20.833-103.516 116.536-125.651 116.536-5.86 0-11.719-2.604-16.927-5.859l-89.844-70.312c-18.88 9.765-39.062 18.229-59.245 24.74-4.557 39.713-8.463 82.03-18.88 121.093C593.1 992.188 583.984 1000 572.266 1000H427.734c-11.718 0-22.135-8.464-23.437-19.531l-18.23-119.792c-20.182-6.51-39.713-14.323-58.593-24.088l-91.797 69.661c-4.557 3.906-10.417 5.86-16.276 5.86-5.86 0-11.719-2.605-16.276-7.162-34.505-31.25-80.078-71.615-107.422-109.375-3.255-4.557-4.557-9.766-4.557-14.974 0-5.86 1.953-10.417 5.208-14.974 22.136-29.948 46.224-58.594 68.36-89.193-11.068-20.833-20.183-42.317-26.693-64.453L18.88 594.401C7.811 592.448 0 582.031 0 570.964V426.432c0-9.765 7.813-21.484 17.578-23.437l121.094-18.23c6.51-20.833 14.974-40.364 25.39-59.895-22.135-31.25-45.572-60.547-69.661-89.844-3.906-4.557-6.51-9.766-6.51-15.625 0-5.86 2.604-10.417 5.859-14.974 15.625-21.484 103.516-116.536 125.651-116.536 5.86 0 11.719 2.604 16.927 6.51l89.844 69.661c18.88-9.765 39.062-18.229 59.245-24.74 4.557-39.713 8.463-82.03 18.88-121.093C406.9 7.813 416.016 0 427.734 0h144.532c11.718 0 22.135 8.464 23.437 19.531l18.23 119.792c20.182 6.51 39.713 14.323 58.593 24.088l92.448-69.661c3.906-3.906 9.766-5.86 15.625-5.86 5.86 0 11.719 2.605 16.276 6.511 34.505 31.901 80.078 72.266 107.422 110.677 3.255 3.906 4.557 9.115 4.557 14.323 0 5.86-1.953 10.417-5.208 14.974-22.136 29.948-46.224 58.594-68.36 89.193 11.068 20.833 20.183 42.317 26.693 63.802l119.14 18.229c11.068 1.953 18.881 12.37 18.881 23.437z"})))},"sgroup-data":function(t){return N.createElement("svg",Iu({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",width:1e3,height:1e3},t),Za||(Za=N.createElement("path",{d:"M976.996 677.429q0-57.429-22.286-110.572-22.285-53.143-63.428-94.286L507.28 92l-53.143 52.286 384 380.572q63.43 61.715 63.43 152.572 0 76.286-49.715 126.857-49.714 50.572-126.857 49.715-87.43 0-154.287-64.286L148.137 370.57q-50.571-50.571-50.571-114 0-48.857 31.714-80.572 31.714-31.714 80.572-30.857 64.285 0 114.857 50.572L647.852 514.57q45.43 47.143 45.43 83.143 0 18-13.715 28.286-13.714 10.286-32.572 10.286-41.143 0-73.714-34.286L281.85 314l-52.285 52.285 290.572 288.001q56.571 56.572 126.857 56.572 49.715 0 85.715-31.715 36-31.714 36-80.571 0-66.858-67.715-136.286L377.852 143.428q-72-72-168-72-79.715 0-132.858 52.285-53.143 52.286-54 132.858 0 94.286 72 166.286l422.572 419.144q89.144 86.571 207.43 86.571 107.143 0 180-72t72-179.143z"})))},sgroup:function(t){return N.createElement("svg",Nu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),La||(La=N.createElement("path",{d:"M791.333 67.143v52.408h131.153v760.845H791.333v52.461H975V67.143zM225.028 880.396H75.138V119.55h149.89V67.143H25v865.714h200.028z"})))},"template-0":function(t){return N.createElement("svg",zu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ha||(Ha=N.createElement("path",{d:"M758.79 684.716l.652-363.85 33.725.066-.653 363.85zM201.521 362.534l310.986-188.872 17.503 28.823-310.98 188.872zM510.839 841.63L199.345 653.597l17.43-28.877 311.494 188.041zM500 975L85.906 742.303V267.356L500 25l414.094 232.644v475zM124.908 722.458L500 936.156l380.264-222.459V277.542L500 63.95 124.908 286.408z"})))},"template-1":function(t){return N.createElement("svg",Fu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Va||(Va=N.createElement("path",{d:"M690.455 792.468l-31.469-11.512 122.696-335.442 31.475 11.512zm-386.683-.534L189.205 448.199l31.845-10.615 114.567 343.735zM793.55 951.778h-587.1L25 393.336 500 48.222 975 393.39zM230.833 918.21H769.22l166.356-512.103L500.053 89.653 64.478 406.108z"})))},"template-2":function(t){return N.createElement("svg",Gu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ua||(Ua=N.createElement("path",{d:"M500 975L85.906 742.303V267.356L500 25l414.094 232.644v475zM124.908 722.458L500 936.156l380.264-222.459V277.542L500 63.95 124.908 286.408z"})))},"template-3":function(t){return N.createElement("svg",Hu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),qa||(qa=N.createElement("path",{d:"M793.55 951.778h-587.1L25 393.336 500 48.222 975 393.39zM230.833 918.21H769.22l166.356-512.103L500.053 89.653 64.478 406.108z"})))},"template-4":function(t){return N.createElement("svg",Vu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Wa||(Wa=N.createElement("path",{d:"M975 911.35H25l475-822.7zM83.003 877.836H917.05L500 155.572z"})))},"template-5":function(t){return N.createElement("svg",Uu({xmlns:"http://www.w3.org/2000/svg",width:"500pt",height:"500pt",viewBox:"0 0 500 500"},t),Ya||(Ya=N.createElement("path",{d:"M487.5 487.5h-475v-475h475zM29.785 470.242h440.43V30.785H30.785zm1 0"})))},"template-6":function(t){return N.createElement("svg",qu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),$a||($a=N.createElement("path",{d:"M289.35 963.31L25 633.31l93.148-412.33L498.654 36.69l381.404 182.6L975 631.252 712.234 962.308zM61.572 624.813l243.978 304.563 390.217-.897 242.553-305.566-87.659-380.19-351.955-168.51-351.111 170.146z"})))},"template-7":function(t){return N.createElement("svg",Wu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ka||(Ka=N.createElement("path",{d:"M696.793 975H303.26L25 696.793V303.26L303.26 25h393.533L975 303.26v393.533zm-379.546-33.674h365.612l258.52-258.414V317.247l-258.52-258.52H317.247l-258.52 258.52v365.665z"})))},"template-lib":function(t){return N.createElement("svg",Yu({xmlns:"http://www.w3.org/2000/svg",viewBox:"-125 -125 1000 1000",height:1e3,width:1e3},t),Ja||(Ja=N.createElement("path",{d:"M218.75 468.75l140.625-187.5L468.75 422.187l78.125-93.75L656.25 468.75zM687.5 125h-250L375 62.5H187.5c-34.52 0-62.5 27.98-62.5 62.5v375c0 34.52 27.98 62.5 62.5 62.5h500c34.52 0 62.5-27.98 62.5-62.5V187.5c0-34.52-27.98-62.5-62.5-62.5zm-625 62.5H0V625c0 34.52 27.98 62.5 62.5 62.5H625V625H62.5zm0 0"})))},text:function(t){return N.createElement("svg",Ku({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg"},t),ts||(ts=N.createElement("path",{d:"M15 114.235c8.284 0 15-6.716 15-15V30h69.235c8.284 0 15-6.716 15-15s-6.716-15-15-15H15C6.716 0 0 6.716 0 15v84.235c0 8.285 6.716 15 15 15zM497 0h-84.235c-8.284 0-15 6.716-15 15s6.716 15 15 15H482v69.235c0 8.284 6.716 15 15 15s15-6.716 15-15V15c0-8.284-6.716-15-15-15zM497 397.765c-8.284 0-15 6.716-15 15V482h-69.235c-8.284 0-15 6.716-15 15s6.716 15 15 15H497c8.284 0 15-6.716 15-15v-84.235c0-8.285-6.716-15-15-15zM99.235 482H30v-69.235c0-8.284-6.716-15-15-15s-15 6.716-15 15V497c0 8.284 6.716 15 15 15h84.235c8.284 0 15-6.716 15-15s-6.715-15-15-15zM419.66 191.38V96.65c0-4.7-3.81-8.51-8.52-8.51H100.86c-4.71 0-8.52 3.81-8.52 8.51v94.73c0 4.71 3.81 8.52 8.52 8.52h45.24c4.7 0 8.51-3.81 8.51-8.52v-32.45a8.52 8.52 0 018.52-8.52h53.21c4.71 0 8.52 3.81 8.52 8.52v234.14c0 4.71-3.81 8.52-8.52 8.52h-23.27c-4.71 0-8.52 3.81-8.52 8.52v45.24c0 4.7 3.81 8.51 8.52 8.51h125.86c4.71 0 8.52-3.81 8.52-8.51v-45.24c0-4.71-3.81-8.52-8.52-8.52h-23.27c-4.71 0-8.52-3.81-8.52-8.52V158.93c0-4.71 3.81-8.52 8.52-8.52h53.21c4.7 0 8.52 3.81 8.52 8.52v32.45c0 4.71 3.81 8.52 8.51 8.52h45.24c4.71 0 8.52-3.81 8.52-8.52z"})))},"text-bold":function(t){return N.createElement("svg",$u({xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 0 24 24",width:24},t),Xa||(Xa=N.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})),Qa||(Qa=N.createElement("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"})))},"text-italic":function(t){return N.createElement("svg",Ju({xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 0 24 24",width:24},t),es||(es=N.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})),ns||(ns=N.createElement("path",{d:"M6 15v3h8v-3h-2.21l3.42-8H18V4h-8v3h2.21l-3.42 8z"})))},"text-subscript":function(t){return N.createElement("svg",Xu({xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 0 24 24",width:24},t),rs||(rs=N.createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),os||(os=N.createElement("path",{d:"M22 18h-2v1h3v1h-4v-2c0-.55.45-1 1-1h2v-1h-3v-1h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1zM5.88 18h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 4h-2.68l-3.07 4.99h-.12L8.85 4H6.19l4.32 6.73L5.88 18z"})))},"text-superscript":function(t){return N.createElement("svg",Qu({xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 0 24 24",width:24},t),is||(is=N.createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),as||(as=N.createElement("path",{d:"M22 7h-2v1h3v1h-4V7c0-.55.45-1 1-1h2V5h-3V4h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1zM5.88 20h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 6h-2.68l-3.07 4.99h-.12L8.85 6H6.19l4.32 6.73L5.88 20z"})))},"transform-flip-h":function(t){return N.createElement("svg",ec({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),us||(us=N.createElement("path",{d:"M975 500L797.825 368.583l42.803 115.742H159.319l42.803-115.742L25 500l177.122 131.417-41.747-112.84h679.144l-41.694 112.84z"})))},"transform-flip-v":function(t){return N.createElement("svg",nc({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),cs||(cs=N.createElement("path",{d:"M500 25L368.583 202.175l115.742-42.803v681.309l-115.742-42.803L500 975l131.417-177.122-112.84 41.747V160.481l112.84 41.694z"})))},"transform-rotate":function(t){return N.createElement("svg",tc({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),ss||(ss=N.createElement("path",{d:"M852.49 687.559C879.934 630.757 895.7 567.292 895.7 500c0-240.073-195.277-435.35-435.35-435.35C220.278 64.65 25 259.926 25 500c0 240.073 195.278 435.35 435.35 435.35 69.601 0 135.31-16.822 193.63-45.982l-12.602-33.316c-54.36 27.774-115.78 43.74-181.027 43.74-220.414 0-399.858-179.313-399.858-399.792 0-220.48 179.379-399.858 399.858-399.858 220.545 0 399.857 179.379 399.857 399.858 0 61.156-14.646 118.618-39.451 170.406l-2.639-1.65-81.278-94.537 29.952 226.68L975 706.427z"})))},undo:function(t){return N.createElement("svg",rc({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),ls||(ls=N.createElement("path",{d:"M474.812 183.482c42.511-3.244 84.89.665 126.774 12.838 166.696 48.452 311.991 227.933 362.669 601.774.254 1.873 1.355 2.931 1.604 4.814l9.629 65.794-33.7-57.77c-113.495-200.68-220.912-288.903-311.317-308.108-90.405-19.205-166.973 27.93-223.057 110.726.15 1.044.856 3.722 3.209 8.024 4.707 8.603 13.413 21.578 25.676 36.908 24.526 30.661 61.649 71.78 97.888 121.96l14.443 20.861h-25.676c-132.691 0-364.081-4.623-494.257-6.419L15.86 793.28v-12.838s3.21-373.383 3.21-505.49v-30.49l22.466 22.466c29.89 29.89 68.798 64.785 101.098 96.284 88.106-100.114 208.859-170.318 332.18-179.73zm1.605 25.676c-119.433 9.385-239.23 78.63-324.156 179.73l-8.023 11.233-9.629-11.233c-26.536-26.495-59.981-56.526-89.864-85.05-.345 144.968-3.052 448.397-3.21 465.37 125.037 1.834 325.006 5.912 455.743 6.42-29.225-38.47-59.383-75.03-80.236-101.098-12.553-15.693-22.561-28.558-28.885-40.118-3.162-5.78-5.534-11.524-6.42-17.653-.795-5.515.77-12.485 4.815-17.652.237-.349 1.367.349 1.605 0 59.697-87.544 145.64-143.518 247.128-121.959 90.757 19.28 190.036 110.26 292.06 271.2C870.878 420.83 739.347 262.763 593.563 220.39c-38.758-11.265-77.334-14.361-117.145-11.233z"})))},"zoom-in":function(t){return N.createElement("svg",oc({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),fs||(fs=N.createElement("path",{d:"M312.5 112.281c-125.718 0-227.906 102.188-227.906 227.906 0 125.719 102.188 227.907 227.906 227.907s227.906-102.188 227.906-227.907c0-125.718-102.188-227.906-227.906-227.906zm0 24.688c112.375 0 203.219 90.844 203.219 203.219 0 112.374-90.844 203.218-203.219 203.218s-203.219-90.844-203.219-203.218c0-112.375 90.844-203.22 203.219-203.22zm-.063-84.219C174.692 49.882 46.61 159.983 28.315 296.444 4.99 430.188 91.115 571.324 220.298 612.51c74.609 25.626 159.667 18.33 228.733-19.854C562.64 707.741 675.265 823.88 789.485 938.308c49.238 44.192 137.416 13.003 147.28-52.625 11.157-44.223-19.799-80.152-49.866-107.752l-313.243-318.65c58.598-120.77 15.778-277.983-94.87-353.464-48.148-34.437-107.154-53.25-166.349-53.067zm0 24.688C440.74 74.544 559.563 179.1 573.11 306.69c7.157 53.927-3.7 109.63-29.141 157.591C662.272 584.97 781.267 705.074 899.18 826.085c36.076 40.15 1.724 111.32-52.063 108.365-42.866-.758-64.88-42.353-93.898-67.544-99.947-101.689-199.904-203.367-299.845-305.062-103.604 68.778-253.74 48.687-335.487-44.925-88.773-93.62-90.672-253.023-4.183-348.748 49.053-57.228 123.333-91.223 198.733-90.733zm427.47-36.5v108.406h-108.5v126.812h108.5V384.47h126.75V276.156H975V149.344H866.656V40.938h-126.75zm24.687 24.687h77.375v108.406h108.343v77.406H841.97v108.344h-77.375V251.437h-108.5v-77.406h108.5V65.625z"})))},"zoom-out":function(t){return N.createElement("svg",ic({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),hs||(hs=N.createElement("path",{d:"M312.875 105.875c-125.888 0-228.188 102.3-228.188 228.188 0 125.888 102.3 228.218 228.188 228.218 125.888 0 228.219-102.33 228.219-228.218 0-125.889-102.33-228.188-228.219-228.188zm0 24.719c112.527 0 203.5 90.942 203.5 203.469 0 112.526-90.973 203.468-203.5 203.468S109.406 446.59 109.406 334.063c0-112.527 90.942-203.47 203.469-203.47zm-.031-84.375c-137.939-2.868-266.2 107.39-284.524 244.04C4.96 424.193 91.217 565.522 220.578 606.769c74.712 25.667 159.889 18.353 229.047-19.894 113.754 115.25 226.548 231.5 340.9 346.129 49.31 44.232 137.597 12.992 147.486-52.71 11.152-44.27-19.824-80.262-49.93-107.896L574.406 453.344c58.667-120.945 15.807-278.381-94.994-353.98-48.21-34.488-107.294-53.328-166.568-53.145zm0 24.718C441.32 68.04 560.274 172.766 573.827 300.52c7.134 53.985-3.634 109.795-29.17 157.793 118.503 120.826 237.63 241.135 355.717 362.31 36.097 40.2 1.709 111.429-52.121 108.51-43-.744-64.986-42.4-94.064-67.638-100.088-101.817-200.143-203.667-300.251-305.464-103.737 68.89-254.066 48.744-335.918-44.989-88.903-93.75-90.805-253.38-4.189-349.237 49.123-57.308 123.506-91.357 199.013-90.868zm345.031 23.438v118.344H975V94.375H657.875zm24.75 24.75h267.656V188H682.625v-68.875z"})))},"shape-ellipse":function(t){return N.createElement("svg",Bu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Da||(Da=N.createElement("ellipse",{cx:500,cy:500,rx:450,ry:300,fill:"#fff",stroke:"#000",strokeWidth:40})))},"shape-rectangle":function(t){return N.createElement("svg",Du({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Ga||(Ga=N.createElement("path",{fill:"#fff",stroke:"#000",strokeWidth:40,d:"M100 150h800v700H100z"})))},"shape-polyline":function(t){return N.createElement("svg",Lu({xmlns:"http://www.w3.org/2000/svg",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),Fa||(Fa=N.createElement("path",{d:"M200 210l100 590 80-600 140 600h180l150-650",fill:"#fff",stroke:"#000",strokeWidth:40})))},"shape-line":function(t){return N.createElement("svg",Zu({xmlns:"http://www.w3.org/2000/svg",fill:"#fff",stroke:"#000",width:1e3,height:1e3,viewBox:"0 0 1000 1000"},t),za||(za=N.createElement("path",{d:"M200 210l600 590",strokeWidth:40})))}};function uc(){return null}var cc=["name"];function lc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fc(t){var e=t.name,n=(0,B.Z)(t,cc),i=function(t){return t&&sc.hasOwnProperty(t)?sc[t]:uc}(e);return(0,o.jsx)(i,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lc(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},n))}var hc="ActionButton-module_button__1aDHe",dc="ActionButton-module_selected__3ZHhG",pc={Escape:"Esc",Delete:"Del",Mod:/Mac/.test(navigator.platform)?"⌘":"Ctrl"};function vc(t){return t?(Array.isArray(t)?t[0]:t).replace(/(\b[a-z]\b$|Mod|Escape|Delete)/g,(function(t){return pc[t]||t.toUpperCase()})):""}var mc=function(t){var e=t.name,n=t.action,i=t.status,a=void 0===i?{}:i,s=t.selected,u=void 0!==s&&s,c=t.disableableButtons,l=t.indigoVerification,f=t.className,h=t.onAction;if(a.hidden)return null;var d=vc(null==n?void 0:n.shortcut),p=a.disabled||l&&c.includes(e);return(0,o.jsxs)("button",Object.assign({disabled:p,onClick:function(t){null!=n&&n.action&&h(n.action),t.stopPropagation()},title:d?"".concat(null==n?void 0:n.title," (").concat(d,")"):null==n?void 0:n.title,className:F(hc,(0,r.Z)({},dc,u),f)},{children:[(0,o.jsx)(fc,{name:e},void 0),(0,o.jsx)("kbd",{children:d},void 0)]}),void 0)};var gc=function(t){(0,Z.Z)(i,t);var e,n,o=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e;return(0,R.Z)(this,i),e=o.call(this,t),(0,r.Z)((0,q.Z)(e),"element",void 0),(0,r.Z)((0,q.Z)(e),"isElementInDom",void 0),e.element=document.createElement("div"),e.isElementInDom=!1,e}return(0,M.Z)(i,[{key:"componentDidMount",value:function(){!this.isElementInDom&&this.props.isOpen&&this.addElementInDOM();var t=this.props,e=t.className,n=t.style;e&&this.addClassName(e),n&&this.updateStyle(n)}},{key:"componentWillUnmount",value:function(){this.isElementInDom&&this.removeElementFromDOM()}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.isOpen,r=e.className,o=e.style;r!==t.className&&(this.removeClassNames(t.className),this.addClassName(r)),o!==t.style&&this.updateStyle(o,t.style),n!==t.isOpen&&(n&&!this.isElementInDom?this.addElementInDOM():this.isElementInDom&&this.removeElementFromDOM())}},{key:"addElementInDOM",value:function(){var t;null===(t=document.querySelector("body"))||void 0===t||t.appendChild(this.element),this.isElementInDom=!0}},{key:"removeElementFromDOM",value:function(){var t;null===(t=document.querySelector("body"))||void 0===t||t.removeChild(this.element),this.isElementInDom=!1}},{key:"removeClassNames",value:function(t){var e=this;t&&t.split(" ").forEach((function(t){e.element.classList.remove(t)}))}},{key:"addClassName",value:function(t){var e=this;t&&t.split(" ").forEach((function(t){e.element.classList.add(t)}))}},{key:"updateStyle",value:function(t,e){var n=this;e&&Object.keys(e).forEach((function(t){n.element.style[t]=""}),this),t&&Object.keys(t).forEach((function(e){n.element.style[e]=t[e]}),this)}},{key:"render",value:function(){var t=this.props.children;return W.createPortal(t,this.element)}}]),i}(N.Component),yc="DefaultMultiTool-module_default__-Mx03",bc=function(t){var e=t.options,n=t.status,r=t.disableableButtons,i=t.indigoVerification,a=t.onAction;return(0,o.jsx)(o.Fragment,{children:e.map((function(t){var e=n[t.id];return(0,o.jsx)(mc,{name:t.id,action:vs[t.id],status:e,selected:!(null==e||!e.selected),disableableButtons:r,indigoVerification:i,onAction:a},t.id)}))},void 0)},wc=function(t){var e=t.groups,n=t.options,r=t.status,i=t.disableableButtons,a=t.indigoVerification,s=t.onAction;return e?(0,o.jsx)(o.Fragment,{children:e.map((function(t){return(0,o.jsx)("div",Object.assign({className:"GroupedMultiTool-module_group__12r63"},{children:n.slice(t.start,t.end).map((function(t){var e=r[t.id];return(0,o.jsx)(mc,{name:t.id,action:vs[t.id],status:e,selected:!(null==e||!e.selected),disableableButtons:i,indigoVerification:a,onAction:s},t.id)}))}),t.start)}))},void 0):null},xc=function(t){var e=t.id,n=t.options,r=t.groups,i=t.variant,a=t.status,s=t.opened,u=t.indigoVerification,c=t.disableableButtons,l=t.className,f=t.vertical,h=t.onAction,d=t.onOpen,p=(0,N.useRef)(null),v=function(t){var e=(0,U.Z)(t,3),n=e[0],r=e[1],o=e[2],i=(0,N.useState)(!1),a=(0,U.Z)(i,2),s=a[0],u=a[1];return(0,N.useEffect)((function(){var t=o.length&&o[0].id||"";u(r===n||r===t)}),[r,o]),[s]}([e,s,n]),m=(0,U.Z)(v,1)[0],g=function(t){var e=(0,U.Z)(t,2),n=e[0],r=e[1],o=(0,N.useState)({}),i=(0,U.Z)(o,2),a=i[0],s=i[1];return(0,N.useEffect)((function(){var t;if(n.current){var e=n.current.getBoundingClientRect(),r=(null===(t=document.scrollingElement)||void 0===t?void 0:t.scrollTop)||0,o=e.top+r,i=e.left+e.width+4;s({top:"".concat(o,"px"),left:"".concat(i,"px")})}}),[n,n.current,r]),[a]}([p,m]),y=(0,U.Z)(g,1)[0],b=!1,w=e,x=n.find((function(t){var e;return null===(e=a[t.id])||void 0===e?void 0:e.selected}));x&&(w=x.id,b=!0);var O=a[w];b=b||Boolean(null==O?void 0:O.selected);var E,_=!(n.every((function(t){var e;return null===(e=a[t.id])||void 0===e?void 0:e.hidden}))||null!=O&&O.hidden);!O&&n.length&&(w=(null===(E=n.filter((function(t){var e;return!(null!==(e=a[t.id])&&void 0!==e&&e.hidden)}))[0])||void 0===E?void 0:E.id)||n[0].id);var S={disableableButtons:c,indigoVerification:u,onAction:h},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";switch(t){case"default":return[bc,yc];case"grouped":return[wc];default:throw new Error("Unsupported variant ".concat(t))}}(i),A=(0,U.Z)(j,2),P=A[0],k=A[1];return _?(0,o.jsxs)("div",Object.assign({ref:p,className:"ToolbarMultiToolItem-module_root__3rfIy"},{children:[(0,o.jsx)(mc,Object.assign({},S,{className:l,name:w,action:vs[w],status:O,selected:b}),void 0),(0,o.jsx)(fc,{className:"ToolbarMultiToolItem-module_icon__3Gg-c",name:"dropdown",onClick:function(){d(e,Boolean(null==O?void 0:O.selected))}},void 0),m?(0,o.jsx)(gc,Object.assign({isOpen:m,className:F("ToolbarMultiToolItem-module_portal__yDg5_",f&&"ToolbarMultiToolItem-module_portal-vertical__3ALtv",k),style:y},{children:(0,o.jsx)(P,{options:n,groups:r,status:a,disableableButtons:c,indigoVerification:u,onAction:h},void 0)}),void 0):null]}),void 0):null},Oc=function(t){var e,n=t.id,r=t.options,i=t.status,a=t.className,s=t.opened,u=t.indigoVerification,c=t.disableableButtons,l=t.vertical,f=t.onAction,h=t.onOpen;return null!=r&&r.length?(0,o.jsx)(xc,{className:a,id:n,options:r,status:i,opened:s,disableableButtons:c,indigoVerification:u,onAction:f,onOpen:h,vertical:l},void 0):(0,o.jsx)(mc,{className:a,name:n,action:vs[n],status:i[n],selected:!(null===(e=i[n])||void 0===e||!e.selected),indigoVerification:u,disableableButtons:c,onAction:f},void 0)},Ec=function(t){var e=t.active,n=t.disableableButtons,r=t.indigoVerification,i=t.onAction,a=e&&"template"===e.tool,s=function(t,e){return{shortcut:vs["template-".concat(e)].shortcut,action:{tool:"template",opts:{struct:t}},title:t.name}};return(0,o.jsx)(o.Fragment,{children:Vo.map((function(t,u){return(0,o.jsx)(mc,{name:"template-".concat(u),action:s(t,u),onAction:i,selected:a&&e&&e.opts.struct===t,status:vs["template-".concat(u)],disableableButtons:n,indigoVerification:r},"template-".concat(u))}))},void 0)},_c=["className"],Sc=function(t){var e=t.children,n=t.className;return(0,o.jsx)("div",Object.assign({className:F("BottomToolbar-module_group__7cfMv",n)},{children:e}),void 0)};function jc(t){return{type:"TMPL_INIT",data:{lib:t}}}var Ac=function(t,e,n){var r=new I.Ruh;return Pc("".concat(t,"/templates/").concat(n)).then((function(n){var o=r.deserialize(n),i=function(t,e,n){var r=t.reduce((function(t,e){var n=kc(e).file;return n&&-1===t.indexOf(n)&&t.push(n),t}),[]);return Promise.all(r.map((function(t){return Pc(e+t).catch((function(){return null}))}))).then((function(t){return t.forEach((function(t){t&&(n.innerHTML+=t)})),r.filter((function(e,n){return!!t[n]}))}))}(o,t+"/templates/",e);return i.then((function(t){return o.map((function(e){var n=kc(e);return n.file&&(e.props.prerender=-1!==t.indexOf(n.file)?"#".concat(n.id):""),e}))}))}))};function Pc(t){return fetch(t,{credentials:"same-origin"}).then((function(e){if(e.ok)return e.text();throw Error("Could not fetch "+t)}))}function kc(t){var e=t.props.prerender,n=e&&e.split("#",2);return{file:e&&n[0],id:e&&n[1]}}function Tc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Cc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Tc(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Rc(t,e,n){return new Promise((function(r,o){t({type:"MODAL_OPEN",data:{name:e,prop:Cc(Cc({},n),{},{onResult:r,onCancel:o})}})}))}function Mc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ic(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mc(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Nc(t){var e=new I.jWx,n=t.filter((function(t){return"User Templates"===t.props.group})).map((function(t){return{struct:e.serialize(t.struct),props:Object.assign({},(0,V.omit)(["group"],t.props))}}));Nr("ketcher-tmpls",n)}var Bc={lib:[],selected:null,filter:"",group:null,attach:{},mode:"classic"},Zc=["TMPL_INIT","TMPL_SELECT","TMPL_CHANGE_GROUP","TMPL_CHANGE_FILTER"],Lc=["INIT_ATTACH","SET_ATTACH_POINTS","SET_TMPL_NAME"],Dc=["type","action"];function zc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Fc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zc(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Gc(t,e){var n=e.action,r=e.editor,o=e.server,i=e.options;if(n.tool){if(r.tool(n.tool,n.opts))return n}else"function"==typeof n&&n(r,o,i);return t}function Hc(t,e,n){var r=n.editor,o=n.server;return"function"==typeof t.selected?t.selected(r,o):!(!t.action||!t.action.tool)&&(0,V.isEqual)(e,t.action)}function Vc(t,e){var n=e.editor,r=e.server,o=e.options;return"function"==typeof t.disabled&&t.disabled(n,r,o)}function Uc(t,e){var n=e.options;return"function"==typeof t.hidden&&t.hidden(n)}function qc(t,e,n){var r=vs[t];return(0,V.pickBy)((function(t){return t}),{selected:Hc(r,e,n),disabled:Vc(r,n),hidden:Uc(r,n)})}function Wc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wc(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var $c={freqAtoms:[],currentAtom:0,opened:null,visibleTools:{select:"select-lasso"}};function Kc(t,e){var n=/(bond)(-)(common|stereo|query)/,r=window.innerHeight;return Object.keys(t).reduce((function(e,o){return"bond"===o&&r>700||"transform"===o&&r>800||"rgroup"===o&&r>850||"shape"===o&&r>900||(!o.match(n)||r>700)&&(e[o]=t[o]),e}),Yc({},e))}function Jc(t,e,n){return t=(0,V.capitalize)(t),lr.indexOf(t)>-1||-1!==e.indexOf(t)?{freqAtoms:e}:(e[n]=t,{freqAtoms:e,currentAtom:n=(n+1)%7})}function Xc(t){var e=Object.keys(No).find((function(e){return(0,V.isEqual)(t,No[e].action)})),n=document.getElementById(e),o=n&&function(t,e){e=e||document.body;for(var n=t;n&&"hidden"!==window.getComputedStyle(n).overflow&&!n.classList.contains("opened");){if(n===e)return null;n=n.parentNode}return n}(n);return o&&""!==o.id?(0,r.Z)({},o.id,n.id):null}function Qc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function tl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qc(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var el={lib:[],mode:"fg"},nl=function(t){return{type:"FG_INIT",payload:{lib:t}}},rl=["type"],ol=["buttons"];function il(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function al(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?il(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):il(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var sl=function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var o=e[r];"function"==typeof t[o]&&(n[o]=t[o])}var i,a=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:Wt.INIT}))throw new Error(Vt(12));if(void 0===n(void 0,{type:Wt.PROBE_UNKNOWN_ACTION()}))throw new Error(Vt(13))}))}(n)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var r=!1,o={},s=0;s<a.length;s++){var u=a[s],c=n[u],l=t[u],f=c(l,e);if(void 0===f)throw e&&e.type,new Error(Vt(14));o[u]=f,r=r||f!==l}return(r=r||a.length!==Object.keys(t).length)?o:t}}({actionState:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=n.action,i=(0,B.Z)(n,Dc);switch(r){case"INIT":o=vs["select-lasso"].action;case"ACTION":t=Gc(e&&e.activeTool,Fc(Fc({},i),{},{action:o}));case"UPDATE":return Object.keys(vs).reduce((function(t,e){var n=qc(e,t.activeTool,i);return(0,V.isEmpty)(n)||(t[e]=n),t}),{activeTool:t||e.activeTool});default:return e}},toolbar:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$c,e=arguments.length>1?arguments[1]:void 0,n=e.type,r=e.data;switch(n){case"ACTION":var o=Xc(e.action);return Yc(Yc({},t),{},o?{opened:null,visibleTools:Yc(Yc({},t.visibleTools),o)}:{opened:null});case"ADD_ATOMS":var i=Jc(r,t.freqAtoms,t.currentAtom);return Yc(Yc({},t),i);case"CLEAR_VISIBLE":var a=Xc(e.data),s=Kc(t.visibleTools,a);return Yc(Yc({},t),{},{opened:null,visibleTools:Yc({},s)});case"OPENED":return r.isSelected&&t.opened?Yc(Yc({},t),{},{opened:null}):Yc(Yc({},t),{},{opened:r.menuName});case"UPDATE":case"MODAL_OPEN":return Yc(Yc({},t),{},{opened:null});default:return t}},modal:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=e.type,r=e.data;if("UPDATE_FORM"===n){var o=ro(t.form,e,t.name);return Cc(Cc({},t),{},{form:o})}switch(n){case"MODAL_CLOSE":return null;case"MODAL_OPEN":return{name:r.name,form:eo[r.name]||null,prop:r.prop||null};default:return t}},server:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t},editor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t},options:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=e.type,r=e.data;return"APP_OPTIONS"===n?Zr(Zr({},t),{},{app:Zr(Zr({},t.app),r)}):"SAVE_SETTINGS"===n?Zr(Zr({},t),{},{settings:r}):"SAVE_CHECK_OPTS"===n?Zr(Zr({},t),{},{check:r}):"CHANGE_ANALYSE"===n?Zr(Zr({},t),{},{analyse:Zr(Zr(Zr({},t.analyse),r),{},{loading:!1})}):"ANALYSE_LOADING"===n?Zr(Zr({},t),{},{analyse:Zr(Zr({},t.analyse),{},{loading:!0})}):zr.includes(n)?Zr(Zr({},t),{},{recognize:Zr(Zr({},t.recognize),r)}):t},templates:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bc,e=arguments.length>1?arguments[1]:void 0;if(Zc.includes(e.type))return Object.assign({},t,e.data);if(Lc.includes(e.type)){var n=Object.assign({},t.attach,e.data);return Ic(Ic({},t),{},{attach:n})}if("TMPL_DELETE"===e.type){var r=Object.assign({},t),o=r.lib.filter((function(t){return t!==e.data.tmpl}));return Ic(Ic({},r),{},{lib:o})}return t},functionalGroups:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:el,e=arguments.length>1?arguments[1]:void 0,n=e.type,r=e.payload;return"FG_INIT"===n?tl(tl({},t),r):t},requestsStatuses:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uo,e=arguments.length>1?arguments[1]:void 0,n=e.type,r=e.data;return n===oo?ao(ao({},t),{},{indigoVerification:r}):t}});function ul(t,e,r){var o=t.buttons,i=void 0===o?{}:o,a=(0,B.Z)(t,ol),s={actionState:null,editor:null,modal:null,options:Object.assign(Lr,{app:a,buttons:i}),server:e||Promise.reject(new Error("Standalone mode!")),templates:Bc},u=[te],c=function(t){return function(e,r){switch(r.type){case"INIT":t(r.editor);case"UPDATE":r.type;var o=(0,B.Z)(r,rl);o&&(e=al(al({},e),o))}var i=sl(e,al(al({},r),(0,V.pick)(["editor","server","options"],e))),a=i===e.shared?e:al(al({},e),i);return n.g.currentState=a,a}}(r);return $t(c,s,Jt.apply(void 0,u))}var cl=Mt((function(t){return{active:t.actionState&&t.actionState.activeTool,status:t.actionState||{},opened:t.toolbar.opened,indigoVerification:t.requestsStatuses.indigoVerification,disableableButtons:[]}}),(function(t){return{onAction:function(e){return t(Zo(e))},onOpen:function(e,n){return t({type:"OPENED",data:{menuName:e,isSelected:n}})}}}))((function(t){var e=t.className,n=(0,B.Z)(t,_c),r=n.active,i=n.disableableButtons,a=n.indigoVerification,s=n.onAction;return(0,o.jsxs)("div",Object.assign({className:F("BottomToolbar-module_root__2DfHp",e)},{children:[(0,o.jsx)(Sc,{children:(0,o.jsx)(Ec,{active:r,indigoVerification:a,disableableButtons:i,onAction:s},void 0)},void 0),(0,o.jsxs)(Sc,{children:[(0,o.jsx)(Oc,Object.assign({id:"template-lib"},n),void 0),(0,o.jsx)(Oc,Object.assign({id:"functional-groups"},n),void 0)]},void 0)]}),void 0)}));function ll(t){return t.map((function(t){return{id:t}}))}var fl=ll(["bond-single","bond-double","bond-triple"]),hl=ll(["bond-up","bond-down","bond-updown","bond-crossed"]),dl=ll(["bond-any","bond-aromatic","bond-singledouble","bond-singlearomatic","bond-doublearomatic"]),pl=ll(["bond-dative","bond-hydrogen"]),vl=[fl,hl,dl,pl],ml=vl.flat(),gl=vl.reduce((function(t,e,n){var r,o=(null===(r=t[n-1])||void 0===r?void 0:r.end)||0;return t.push({start:o,end:o+e.length}),t}),[]),yl=ll(["rgroup-label","rgroup-fragment","rgroup-attpoints"]),bl=ll(["shape-ellipse","shape-rectangle","shape-line"]),wl=ll(["transform-rotate","transform-flip-h","transform-flip-v"]),xl=ll(["select-lasso","select-rectangle","select-fragment"]),Ol=ll(["reaction-arrow-open-angle","reaction-arrow-filled-triangle","reaction-arrow-filled-bow","reaction-arrow-dashed-open-angle","reaction-arrow-failed","reaction-arrow-both-ends-filled-triangle","reaction-arrow-equilibrium-filled-half-bow","reaction-arrow-equilibrium-filled-triangle","reaction-arrow-equilibrium-open-angle","reaction-arrow-unbalanced-equilibrium-filled-half-bow","reaction-arrow-unbalanced-equilibrium-open-half-angle","reaction-arrow-unbalanced-equilibrium-large-filled-half-bow","reaction-arrow-unbalanced-equilibrium-filled-half-triangle"]),El=ll(["reaction-map","reaction-unmap","reaction-automap"]),_l="ArrowScroll-module_button__3mL76";function Sl(){return N.useContext(ur)}function jl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Al(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jl(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Pl(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,N.useState)({height:void 0,width:void 0}),n=(0,U.Z)(e,2),r=n[0],o=n[1],i=(0,N.useMemo)((function(){return(0,ne.throttle)(o,100)}),[]),a=oe()(Al({onResize:i},t)),s=a.ref;return Al({ref:s},r)}function kl(){return N.useContext(cr)}var Tl=function(){return N.useContext(ar)},Cl=function(t,e){var n=(0,N.useRef)(t);(0,N.useEffect)((function(){n.current=t}),[t]),(0,N.useEffect)((function(){if(null!==e){var t=setInterval((function(){return n.current()}),e);return function(){return clearInterval(t)}}}),[e])},Rl=function(t){var e=t.startInView,n=t.endInView,r=t.scrollUp,i=t.scrollDown,a=(0,N.useState)(!1),s=(0,U.Z)(a,2),u=s[0],c=s[1],l=(0,N.useState)(!1),f=(0,U.Z)(l,2),h=f[0],d=f[1];return Cl(i,u?100:null),Cl(r,h?100:null),(0,N.useEffect)((function(){return function(){d(!1)}}),[e]),(0,N.useEffect)((function(){return function(){c(!1)}}),[n]),(0,o.jsxs)("div",Object.assign({className:"ArrowScroll-module_scroll__1OJeU"},{children:[n?(0,o.jsx)(o.Fragment,{},void 0):(0,o.jsx)("button",Object.assign({onClick:function(){return i()},onMouseUp:function(){return c(!1)},onMouseDown:function(){return c(!0)},className:F(_l,"ArrowScroll-module_down__14fPO")},{children:"▼"}),void 0),e?(0,o.jsx)(o.Fragment,{},void 0):(0,o.jsx)("button",Object.assign({onClick:function(){return r()},onMouseUp:function(){return d(!1)},onMouseDown:function(){return d(!0)},className:F(_l,"ArrowScroll-module_up__20IXa")},{children:"▲"}),void 0)]}),void 0)},Ml=["height"],Il=function(t){var e=t.height,n=(0,B.Z)(t,Ml);return e&&e<=770?(0,o.jsx)(xc,Object.assign({id:"bonds",options:ml,variant:"grouped",groups:gl},n),void 0):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(xc,Object.assign({id:"bond-common",options:fl},n),void 0),(0,o.jsx)(xc,Object.assign({id:"bond-stereo",options:hl},n),void 0),(0,o.jsx)(xc,Object.assign({id:"bond-query",options:dl},n),void 0),(0,o.jsx)(xc,Object.assign({id:"bond-special",options:pl},n),void 0)]},void 0)},Nl=function(t){return(0,o.jsx)(Oc,Object.assign({id:"rgroup",options:yl},t),void 0)},Bl=function(t){return(0,o.jsx)(Oc,Object.assign({id:"shapes",options:bl},t),void 0)},Zl=["height"],Ll=function(t){var e=t.height,n=(0,B.Z)(t,Zl);return e&&e<=870?(0,o.jsx)(Oc,Object.assign({id:"transforms",options:wl},n),void 0):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Oc,Object.assign({id:"transform-rotate"},n),void 0),(0,o.jsx)(Oc,Object.assign({id:"transform-flip-h"},n),void 0),(0,o.jsx)(Oc,Object.assign({id:"transform-flip-v"},n),void 0)]},void 0)},Dl="LeftToolbar-module_listener__3IRt_",zl=["className"];function Fl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fl(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Hl=Mt((function(t){return{status:t.actionState||{},opened:t.toolbar.opened,indigoVerification:t.requestsStatuses.indigoVerification,disableableButtons:[]}}),(function(t){return{onAction:function(e){return t(Zo(e))},onOpen:function(e,n){return t({type:"OPENED",data:{menuName:e,isSelected:n}})}}}))((function(t){var e=t.className,n=(0,B.Z)(t,zl),r=Pl(),i=r.ref,a=r.height,s=(0,N.useRef)(),u=pe({threshold:.8}),c=(0,U.Z)(u,2),l=c[0],f=c[1],h=pe({threshold:.8}),d=(0,U.Z)(h,2),p=d[0],v=d[1],m=(0,N.useRef)(),g=function(t){var e=t.id,r=t.options;return Oc(Gl({id:e,options:r},n))},y=n.status,b=function(t){var e=t.items,r=t.className,i=[];return e&&e.forEach((function(t){var e,n,r=!0;(null!==(e=y[t.id])&&void 0!==e&&e.hidden||null!==(n=t.options)&&void 0!==n&&n.every((function(t){var e;return null===(e=y[t.id])||void 0===e?void 0:e.hidden})))&&(r=!1),r&&i.push(t)})),i.length?(0,o.jsx)("div",Object.assign({className:F("LeftToolbar-module_group__Zftfu",r)},{children:i.map((function(t){switch(t.id){case"bond-common":return(0,N.createElement)(Il,Gl(Gl({},n),{},{height:a,key:t.id}));case"transform-rotate":return(0,N.createElement)(Ll,Gl(Gl({},n),{},{height:a,key:t.id}));case"rgroup":return(0,N.createElement)(Nl,Gl(Gl({},n),{},{key:t.id}));case"shapes":return(0,N.createElement)(Bl,Gl(Gl({},n),{},{key:t.id}));default:return(0,o.jsx)(g,{id:t.id,options:t.options},t.id)}}))}),void 0):null};return(0,o.jsxs)("div",Object.assign({className:F("LeftToolbar-module_root__1pZPV",e),ref:i},{children:[(0,o.jsxs)("div",Object.assign({className:"LeftToolbar-module_buttons__qe7KG",ref:s},{children:[(0,o.jsx)("div",Object.assign({className:Dl,ref:l},{children:(0,o.jsx)(b,{items:[{id:"select",options:xl},{id:"erase"}]},void 0)}),void 0),(0,o.jsx)(b,{items:[{id:"bonds",options:[].concat((0,ee.Z)(fl),(0,ee.Z)(dl),(0,ee.Z)(pl),(0,ee.Z)(hl))},{id:"chain"}]},void 0),(0,o.jsx)(b,{items:[{id:"charge-plus"},{id:"charge-minus"}]},void 0),(0,o.jsx)(b,{items:[{id:"transforms",options:wl}]},void 0),(0,o.jsx)(b,{items:[{id:"sgroup"},{id:"sgroup-data"}]},void 0),(0,o.jsx)(b,{items:[{id:"reaction-plus"},{id:"arrows",options:Ol},{id:"reaction-mapping-tools",options:El}]},void 0),(0,o.jsx)("div",Object.assign({className:Dl,ref:m},{children:(0,o.jsx)(b,{items:[{id:"rgroup",options:yl}]},void 0)}),void 0),(0,o.jsx)(b,{items:[{id:"shapes",options:bl}]},void 0),(0,o.jsx)("div",Object.assign({ref:p},{children:(0,o.jsx)(b,{items:[{id:"text"}]},void 0)}),void 0)]}),void 0),(0,o.jsx)(Rl,{startInView:f,endInView:v,scrollUp:function(){s.current.scrollTop-=m.current.offsetHeight},scrollDown:function(){s.current.scrollTop+=m.current.offsetHeight}},void 0)]}),void 0)})),Vl=["el","shortcut","className"];function Ul(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ql(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ul(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wl(t){var e=t.el,n=t.shortcut,r=t.className,i=(0,B.Z)(t,Vl);return(0,o.jsx)("button",ql(ql({title:n?"".concat(e.title," (").concat(n,")"):e.title,className:r,style:{color:I.wql[e.label]},value:e.number},i),{},{children:(0,o.jsx)("span",{children:e.label})}))}var Yl=(0,N.forwardRef)((function(t,e){var n=t.atoms,i=t.active,a=t.onAction,s=i&&"atom"===i.tool;return(0,o.jsx)(o.Fragment,{children:n.map((function(t){var n=I.eKO.get(t),u=lr.indexOf(t)>-1?vc(fr[t]):null;return 0===lr.indexOf(t)?(0,o.jsx)("div",Object.assign({ref:e},{children:(0,o.jsx)(Wl,{el:n,shortcut:u,className:F(hc,(0,r.Z)({},dc,s&&i&&i.opts.label===t)),onClick:function(){return a({tool:"atom",opts:{label:t}})}},t)}),t):(0,o.jsx)(Wl,{el:n,shortcut:u,className:F(hc,(0,r.Z)({},dc,s&&i&&i.opts.label===t)),onClick:function(){return a({tool:"atom",opts:{label:t}})}},t)}))},void 0)})),$l=["className"],Kl=function(t){var e=t.children,n=t.className;return(0,o.jsx)("div",Object.assign({className:F("RightToolbar-module_group__27rWT",n)},{children:e}),void 0)},Jl=Mt((function(t){return{active:t.actionState&&t.actionState.activeTool,status:t.actionState||{},freqAtoms:t.toolbar.freqAtoms,opened:t.toolbar.opened,indigoVerification:t.requestsStatuses.indigoVerification,disableableButtons:[]}}),(function(t){return{onAction:function(e){return t(Zo(e))},onOpen:function(e,n){return t({type:"OPENED",data:{menuName:e,isSelected:n}})}}}))((function(t){var e=t.className,n=(0,B.Z)(t,$l),r=n.active,i=n.onAction,a=n.freqAtoms,s=pe({threshold:.9}),u=(0,U.Z)(s,2),c=u[0],l=u[1],f=pe({threshold:.9}),h=(0,U.Z)(f,2),d=h[0],p=h[1],v=(0,N.useRef)(),m=(0,N.useRef)();return(0,o.jsxs)("div",Object.assign({className:F("RightToolbar-module_root__2mWed",e)},{children:[(0,o.jsxs)("div",Object.assign({className:"RightToolbar-module_buttons__YEBUb",ref:m},{children:[(0,o.jsxs)(Kl,{children:[(0,o.jsx)(Yl,{ref:c,atoms:lr,active:r,onAction:i},void 0),(0,o.jsx)(Yl,{atoms:a,active:r,onAction:i},void 0)]},void 0),(0,o.jsx)(Kl,{children:(0,o.jsx)("div",Object.assign({ref:v},{children:(0,o.jsx)(Oc,Object.assign({id:"period-table"},n),void 0)}),void 0)},void 0),(0,o.jsx)("div",Object.assign({ref:d},{children:(0,o.jsx)(Kl,{children:(0,o.jsx)(Oc,Object.assign({id:"enhanced-stereo"},n),void 0)},void 0)}),void 0)]}),void 0),(0,o.jsx)(Rl,{startInView:l,endInView:p,scrollUp:function(){m.current.scrollTop-=v.current.offsetHeight},scrollDown:function(){m.current.scrollTop+=v.current.offsetHeight}},void 0)]}),void 0)}));function Xl(t){return(100*t).toFixed()}var Ql=function(t){var e=t.status,n=void 0===e?{}:e,r=t.onAction,i=n.zoom&&n.zoom.selected;return(0,o.jsx)("select",Object.assign({value:i,onChange:function(t){var e=parseFloat(t.target.value);r((function(t){return t.zoom(e)}))}},{children:Wo.map((function(t){return(0,o.jsxs)("option",Object.assign({value:t},{children:[Xl(t),"%"]}),t.toString())}))}),void 0)},tf=function(t){var e=t.status;if(null!=e&&e.hidden)return null;var n=vc(["?","&","Shift+/"]);return(0,o.jsxs)("a",Object.assign({target:"_blank",className:"HelpLink-module_button__2LM6B",title:"Help (".concat(n,")"),href:"https://github.com/epam/ketcher/blob/".concat("release/2.4","/documentation/help.md#ketcher-overview"),rel:"noreferrer"},{children:[(0,o.jsx)(fc,{name:"help"},void 0),(0,o.jsx)("kbd",{children:n},void 0)]}),void 0)},ef=["className","status"];function nf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var rf=function(t){var e=t.children,n=t.className;return(0,o.jsx)("div",Object.assign({className:F("TopToolbar-module_group__mQuYh",n)},{children:e}),void 0)},of=ll(["copy","copy-mol","copy-ket","copy-image"]),af=Mt((function(t){return{status:t.actionState||{},opened:t.toolbar.opened,indigoVerification:t.requestsStatuses.indigoVerification,disableableButtons:["layout","clean","arom","dearom","cip"]}}),(function(t){return{onAction:function(e){return t(Zo(e))},onOpen:function(e,n){return t({type:"OPENED",data:{menuName:e,isSelected:n}})}}}))((function(t){var e,n=t.className,i=t.status,a=(0,B.Z)(t,ef),s=Pl(),u=s.ref,c=s.width,l=!(null!==(e=i["zoom-list"])&&void 0!==e&&e.hidden),f=function(t){var e=t.id,n=t.options,o=t.className,s=t.vertical;return Oc(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nf(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({id:e,options:n,className:o,vertical:s,status:i},a))};return(0,o.jsxs)("div",Object.assign({ref:u,className:F("TopToolbar-module_root__1vz2h",n,(0,r.Z)({},"TopToolbar-module_hideSeparators__2hPXE",c&&c<1080))},{children:[(0,o.jsxs)(rf,{children:[(0,o.jsx)(f,{id:"clear"},void 0),(0,o.jsx)(f,{id:"open"},void 0),(0,o.jsx)(f,{id:"save"},void 0)]},void 0),(0,o.jsxs)(rf,{children:[(0,o.jsx)(f,{id:"undo"},void 0),(0,o.jsx)(f,{id:"redo"},void 0),(0,o.jsx)(f,{id:"cut"},void 0),(0,o.jsx)(f,{id:"copies",options:of,vertical:!0},void 0),(0,o.jsx)(f,{id:"paste"},void 0)]},void 0),(0,o.jsxs)(rf,{children:[c&&c>=780?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f,{id:"zoom-in"},void 0),(0,o.jsx)(f,{id:"zoom-out"},void 0)]},void 0):null,l&&(0,o.jsx)(Ql,{status:i,onAction:a.onAction},void 0)]},void 0),(0,o.jsxs)(rf,{children:[(0,o.jsx)(f,{id:"layout"},void 0),(0,o.jsx)(f,{id:"clean"},void 0),(0,o.jsx)(f,{id:"arom"},void 0),(0,o.jsx)(f,{id:"dearom"},void 0),(0,o.jsx)(f,{id:"cip"},void 0),(0,o.jsx)(f,{id:"check"},void 0),(0,o.jsx)(f,{id:"analyse"},void 0)]},void 0),(0,o.jsxs)(rf,Object.assign({className:"TopToolbar-module_recognize__mEhId"},{children:[(0,o.jsx)(f,{id:"recognize"},void 0),(0,o.jsx)(f,{id:"miew"},void 0)]}),void 0),(0,o.jsxs)(rf,Object.assign({className:"TopToolbar-module_meta__1kpxI"},{children:[(0,o.jsx)(f,{id:"settings"},void 0),c&&c>=790?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tf,{status:i.help},void 0),(0,o.jsx)(f,{id:"about"},void 0)]},void 0):null]}),void 0)]}),void 0)})),sf="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function uf(t){var e,n,r,o,i=t.split(/\+(?!$)/),a=i[i.length-1];"Space"===a&&(a=" ");for(var s=0;s<i.length-1;s++){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))e=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);sf?o=!0:n=!0}}return e&&(a="Alt+"+a),n&&(a="Ctrl+"+a),o&&(a="Meta+"+a),r&&(a="Shift+"+a),a}function cf(t){var e=Object.create(null);return Object.keys(t).forEach((function(n){e[uf(n)]=t[n]})),e}function lf(t,e,n){return e.altKey&&(t="Alt+"+t),e.ctrlKey&&(t="Ctrl+"+t),e.metaKey&&(t="Meta+"+t),!1!==n&&e.shiftKey&&(t="Shift+"+t),t}function ff(t,e){return t.replace(/[а-я]/,ve[e.keyCode]).replace(/[А-Я]/,me[e.keyCode])}function hf(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ff(Se(t),t),r=1===n.length&&" "!==n;return r&&!e?lf(n,t,!r):lf(ve[t.keyCode],t,!0)}function df(t){return t instanceof KeyboardEvent?hf.apply(void 0,arguments):"object"===(0,G.Z)(t)?cf(t):uf(t)}function pf(t,e,n){Array.isArray(n[t])?n[t].push(e):n[t]=[e]}df.lookup=function(t,e){var n=ff(Se(e),e);"Add"===n&&(n="+"),"Subtract"===n&&(n="-");var r,o=1===n.length&&" "!==n,i=t[lf(n,e,!o)];return e.shiftKey&&o&&(r=ve[e.keyCode])&&(i=t[lf(r,e,!0)]||i),i};var vf=/\$RXN\n+\s+0\s+0\s+0\n*/;function mf(t,e){var r=Object.keys(I.xz_).map((function(t){return I.xz_[t].mime})),o=(0,V.debounce)(0,(function(e){return t(Zo(e))})),i=(0,V.debounce)(0,(function(e,n){return t(Lo(e,n))}));return{formats:r,focused:function(){return!n.g.currentState.modal},onCut:function(){var t=n.g.currentState.editor,e=gf(t);return e?o({tool:"eraser",opts:1}):t.selection(null),e},onCopy:function(){var t=n.g.currentState.editor,e=gf(t);return t.selection(null),e},onPaste:function(t){var e=t[I.hxV.KET]||t[I.hxV.Mol]||t[I.hxV.Rxn]||t["text/plain"];!e&&vf.test(t["text/plain"])||i(e,{fragment:!0})}}}function gf(t){var e={},n=t.structSelected(),r=t.errorHandler;if(n.isBlank())return null;if(Boolean(n.simpleObjects.size||n.texts.size)&&window.clipboardData)return r('The structure you are trying to copy contains Simple object or/and Text object.To copy Simple object or Text object in Internet Explorer try "Copy as KET" button'),null;var o=new I.jWx;try{var i=(new I.F_l).serialize(n);e[I.hxV.KET]=i;var a=n.isReaction?I.hxV.Mol:I.hxV.Rxn,s=o.serialize(n);return e["text/plain"]=s,e[a]=s,e}catch(t){r(t.message)}return null}var yf=Mt(null,(function(t){return t(mf)}))(yr),bf=Mt(null,(function(t){return{onInitTmpls:function(e,n){!function(t,e,n){Ac(e,n,"library.sdf").then((function(e){var n=e.concat(function(){var t=Ir("ketcher-tmpls");if(!Array.isArray(t)||0===t.length)return[];var e=new I.jWx;return t.map((function(t){try{return""===t.props&&(t.props={}),t.props.group="User Templates",{struct:e.deserialize(t.struct),props:t.props}}catch(t){return null}})).filter((function(t){return null!==t}))}());t(jc(n)),t(Dr({templates:!0}))}))}(t,n,e)}}}))((function(t){var e=t.onInitTmpls,n=(0,N.useRef)(null),r=Sl().staticResourcesUrl;return(0,N.useEffect)((function(){e(n.current,r)}),[]),(0,o.jsx)("div",{style:{display:"none"},ref:n},void 0)})),wf=["children","title","params","result","valid","buttons","className"],xf=function(t){var e=t.children,n=t.title,r=t.params,i=t.result,a=void 0===i?function(){return null}:i,s=t.valid,u=void 0===s?function(){return!!a()}:s,c=t.buttons,l=void 0===c?["Cancel","OK"]:c,f=t.className,h=(0,B.Z)(t,wf),d=(0,N.useRef)(null);(0,N.useLayoutEffect)((function(){return d.current.focus(),function(){var t,e;null===(t=d.current)||void 0===t||null===(e=t.closest(".Ketcher-root"))||void 0===e||e.getElementsByClassName("cliparea")[0].focus()}}),[]);var p=function(t){var e="OK"===t?"onOk":"onCancel";r&&e in r&&("onOk"!==e||u())&&r[e](a())};return(0,o.jsxs)("div",Object.assign({ref:d,role:"dialog",onSubmit:function(t){return t.preventDefault()},onKeyDown:function(t){var e=Se(t),n=document.activeElement,r=n&&"TEXTAREA"===n.tagName;("Escape"===e||"Enter"===e&&!r)&&(p("Enter"===e?"OK":"Cancel"),t.preventDefault(),t.stopPropagation())},tabIndex:-1,className:F("Dialog-module_form__128Rp",f,r.className)},h,{children:[(0,o.jsx)("header",{children:n},void 0),(0,o.jsx)("div",Object.assign({className:"Dialog-module_dialog_body__22kuG"},{children:e}),void 0),(0,o.jsx)("footer",{children:l.map((function(t){return"string"!=typeof t?t:(0,o.jsx)("input",{type:"button",className:"OK"===t?"Dialog-module_ok__3h8AF":"Dialog-module_cancel__1bFeD",value:t,disabled:"OK"===t&&!u(),onClick:function(){return p(t)}},t)}))},void 0)]}),void 0)};function Of(){return(0,o.jsx)("div",{className:"Spinner-module_spinner__1tgbi"},void 0)}var Ef=["id","dist"];function _f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Sf=.4,jf={atoms:Af,bonds:Pf,enhancedFlags:function(t,e){var n,r=null;return t.enhancedFlags.forEach((function(o,i){var a=t.molecule.frags.get(i);if(a){var s=a.stereoFlagPosition?new I.Sgu(a.stereoFlagPosition.x,a.stereoFlagPosition.y):I.HYg.getDefaultStereoFlagPosition(t.molecule,i);if(s&&!(Math.abs(e.x-s.x)>=1)){var u=Math.abs(e.y-s.y);u<.3&&(!r||u<n)&&(r={id:i,dist:n=u})}}})),r},sgroupData:function(t,e){var n=null,r=null;return t.sgroupData.forEach((function(t,o){if("DAT"!==t.sgroup.type)throw new Error("Data group expected");if("MRV_IMPLICIT_H"!==t.sgroup.data.fieldName){var i=t.sgroup.dataArea,a=i.p0.y<e.y&&i.p1.y>e.y&&i.p0.x<e.x&&i.p1.x>e.x,s=Math.min(Math.abs(i.p0.x-e.x),Math.abs(i.p1.x-e.x));a&&(null===r||s<n)&&(r={id:o,dist:s},n=s)}})),r},sgroups:function(t,e){var n=null,r=Sf;return t.molecule.sgroups.forEach((function(t,o){if(t.functionalGroup&&!t.expanded&&t.firstSgroupAtom)return null;var i=t.bracketDir,a=i.rotateSC(1,0),s=new I.Sgu(I.Sgu.dot(e,i),I.Sgu.dot(e,a));t.areas.forEach((function(t){var e=t.p0.y<s.y&&t.p1.y>s.y&&t.p0.x<s.x&&t.p1.x>s.x,i=Math.min(Math.abs(t.p0.x-s.x),Math.abs(t.p1.x-s.x));e&&(null===n||i<r)&&(n=o,r=i)}))})),null!==n?{id:n,dist:r}:null},functionalGroups:function(t,e){var n=null,r=Sf;return t.molecule.sgroups.forEach((function(t,o){if(t.functionalGroup&&!t.data.expanded&&t.firstSgroupAtom){var i=t.firstSgroupAtom.pp,a=new I.Sgu(.625,.625),s={p0:I.Sgu.diff(i,a),p1:I.Sgu.sum(i,a)},u=s.p0.y<e.y&&s.p1.y>e.y&&s.p0.x<e.x&&s.p1.x>e.x,c=Math.min(Math.abs(s.p0.x-e.x),Math.abs(s.p0.y-e.y),Math.abs(s.p1.x-e.x),Math.abs(s.p0.y-e.y));u&&(null===n||c<r)&&(n=o,r=c)}})),null!==n?{id:n,dist:r}:null},rxnArrows:function(t,e){var n=null,r=null,o=null;return t.rxnArrows.forEach((function(i,a){var s=i.calcDistance(e,t.render.options.scale);s.minDist<.3&&(!o||s.minDist<n)&&(n=s.minDist,r=s.refPoint,o={id:a,dist:n,ref:r})})),o},rxnPluses:function(t,e){var n=null,r=null;return t.rxnPluses.forEach((function(t,o){var i=t.item.pp,a=Math.max(Math.abs(e.x-i.x),Math.abs(e.y-i.y));a<.3&&(!r||a<n)&&(r={id:o,dist:n=a})})),r},frags:function(t,e,n,r,o){r=Math.min(r||Sf,Sf);var i=t.molecule,a=Af(t,e,n,r);if(a)return{id:i.atoms.get(a.id).fragment,dist:a.dist};var s=Pf(t,e,n,r,o);if(s){var u=i.bonds.get(s.id).begin;return{id:i.atoms.get(u).fragment,dist:s.dist}}return null},rgroups:function(t,e,n,r){r=Math.min(r||Sf,Sf);var o=null;return t.rgroups.forEach((function(t,i){if(i!==n&&t.labelBox&&t.labelBox.contains(e,.5)){var a=I.Sgu.dist(t.labelBox.centre(),e);(!o||a<r)&&(o={id:i,dist:r=a})}})),o},simpleObjects:function(t,e){var n=null,r=null,o=null;return t.simpleObjects.forEach((function(i,a){var s=i.calcDistance(e,t.render.options.scale);s.minDist<.3&&(!o||s.minDist<n)&&(n=s.minDist,r=s.refPoint,o={id:a,dist:n,ref:r})})),o},texts:function(t,e){var n=null,r=null;return t.texts.forEach((function(o,i){var a=o.getReferencePoints(t),s=a[0].x,u=a[0].y,c=a[2].x,l=a[2].y,f=[];e.x>=s&&e.x<=c&&(e.y<u?f.push(u-e.y):e.y>l?f.push(e.y-l):f.push(e.y-u,l-e.y)),e.x<s&&e.y<u&&f.push(I.Sgu.dist(new I.Sgu(s,u),e)),e.x>c&&e.y>l&&f.push(I.Sgu.dist(new I.Sgu(c,l),e)),e.x<s&&e.y>l&&f.push(I.Sgu.dist(new I.Sgu(s,l),e)),e.x>c&&e.y<u&&f.push(I.Sgu.dist(new I.Sgu(c,u),e)),e.y>=u&&e.y<=l&&(e.x<s?f.push(s-e.x):e.x>c?f.push(e.x-c):f.push(0));var h=Math.min.apply(Math,f);h<Sf&&(!r||h<n)&&(r={id:i,dist:n=h})})),r}};function Af(t,e,n,r){var o=null,i=n&&"atoms"===n.map?n.id:null,a=t.sgroups,s=t.molecule.functionalGroups;return r=r||.4,r=Math.min(r,.4),t.atoms.forEach((function(t,n){if(I.J41.isAtomInContractedFunctionalGroup(t.a,a,s,!0))return null;if(n!==i){var u=I.Sgu.dist(e,t.a.pp);u<r&&(o=n,r=u)}})),null!==o?{id:o,dist:r}:null}function Pf(t,e,n,r,o){var i=null,a=null,s=.32000000000000006,u=n&&"bonds"===n.map?n.id:null,c=t.sgroups,l=t.molecule.functionalGroups;r=r||s;var f=r=Math.min(r,s);return t.bonds.forEach((function(n,r){if(r!==u){var o=t.atoms.get(n.b.begin).a,i=t.atoms.get(n.b.end).a;if(I.J41.isBondInContractedFunctionalGroup(n.b,c,l,!0))return null;var s=I.Sgu.lc2(o.pp,.5,i.pp,.5),h=I.Sgu.dist(e,s);h<f&&(f=h,a=r)}})),t.bonds.forEach((function(n,o){if(o!==u){if(I.J41.isBondInContractedFunctionalGroup(n.b,c,l,!0))return null;var a=t.molecule.halfBonds.get(n.b.hb1),s=a.dir,f=a.norm,h=t.atoms.get(n.b.begin).a.pp,d=t.atoms.get(n.b.end).a.pp;if(I.Sgu.dot(e.sub(h),s)*I.Sgu.dot(e.sub(d),s)<0){var p=Math.abs(I.Sgu.dot(e.sub(h),f));p<r&&(i=o,r=p)}}})),null!==a?{id:a,dist:f}:null!==i&&r>Sf*o?{id:i,dist:r}:null}var kf=function(t,e,n,o,i){return(n=n||Object.keys(jf)).reduce((function(n,a){var s=n?n.dist:null,u=jf[a](t,e,o,s,i);return null!==u&&(null===n||u.dist<n.dist)?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_f(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({map:a,id:u.id,dist:u.dist},(0,B.Z)(u,Ef)):n}),null)},Tf=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["atoms","bonds"],r=arguments.length>3?arguments[3]:void 0,o={atoms:new Map,bonds:new Map},i=t.molecule;e.atoms.forEach((function(t){o.atoms.set(t,i.atoms.get(t).pp)})),e.bonds.forEach((function(t){var e=i.bonds.get(t);o.bonds.set(t,I.Sgu.lc2(i.atoms.get(e.begin).pp,.5,i.atoms.get(e.end).pp,.5))}));var a={};return n.forEach((function(n){a[n]=Array.from(o[n].keys()).reduce((function(i,a){var s={map:n,id:a},u=jf[n](t,o[n].get(a),s,null,r);return u&&!e[n].includes(u.id)&&i.set(a,u.id),i}),new Map)})),a};function Cf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rf(t){if(!(this instanceof Rf))return new Rf(t);this.editor=t,this.sgroups=t.render.ctab.sgroups,this.struct=t.render.ctab,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups,this.editor.selection(null)}function Mf(t,e){var n=I.Sgu.diff(e,t);return Math.atan2(n.y,n.x)}function If(t){var e=Math.round(t/Math.PI*180);return e>180?e-=360:e<=-180&&(e+=360),e}Rf.prototype.mousemove=function(t){var e=this.editor.render.ctab.molecule,n=this.editor.findItem(t,["atoms"]);if(n){var r=e.atoms.get(n.id);"R#"!==r.label&&null===r.rglabel&&this.editor.hover(n)}else this.editor.hover(null)},Rf.prototype.click=function(t){var e=this.editor,n=e.render.ctab.molecule,r=e.findItem(t,["atoms"]),o=[],i=[];if(r&&this.functionalGroups.size&&"atoms"===r.map){var a=I.J41.atomsInFunctionalGroup(this.functionalGroups,r.id);null!==a&&o.push(a)}if(!(o.length>0)){if(r&&"atoms"===r.map){this.editor.hover(null);var s=n.atoms.get(r.id);if("R#"===s.label&&null!==s.rglabel)return;var u=e.event.elementEdit.dispatch({attpnt:s.attpnt});return Promise.resolve(u).then((function(t){if(s.attpnt!==t.attpnt){var n=(0,I.dBq)(e.render.ctab,r.id,t);e.update(n)}})).catch((function(){return null})),!0}return!0}var c,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Cf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cf(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(o);try{for(l.s();!(c=l.n()).done;){var f=c.value,h=I.J41.findFunctionalGroupByAtom(this.functionalGroups,f);null===h||i.includes(h)||i.push(h)}}catch(t){l.e(t)}finally{l.f()}this.editor.event.removeFG.dispatch({fgIds:i})};var Nf={calcAngle:Mf,fracAngle:I.jD1,calcNewAtomPos:function(t,e,n){var r=new I.Sgu(1,0).rotate(n?Mf(t,e):(0,I.jD1)(t,e));return r.add_(t),r},degrees:If,mergeBondsParams:function(t,e,n,r){var o=t.atoms.get(e.begin),i=n.atoms.get(r.begin),a=t.atoms.get(e.end),s=n.atoms.get(r.end),u=Mf(o.pp,a.pp)-Mf(i.pp,s.pp),c=Math.abs(If(u)%180),l=I.Sgu.dist(o.pp,a.pp)/I.Sgu.dist(i.pp,s.pp);return{merged:!(0,ne.inRange)(c,10,170)&&(0,ne.inRange)(l,.8,1.2),angle:u,scale:l,cross:Math.abs(If(u))>90}}};function Bf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Zf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zf(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Zf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lf(t,e){if(!(this instanceof Lf)){if(!t.selection()||!t.selection().atoms)return new Lf(t,e);var n=(0,I.dBq)(t.render.ctab,t.selection().atoms,e,!0);return t.update(n),t.selection(null),null}this.editor=t,this.atomProps=e,this.struct=t.render.ctab,this.bondProps={type:1,stereo:I.fYe.PATTERN.STEREO.NONE},this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups}function Df(t,e){var n,r=t.dragCtx,o=t.editor,i=null===(n=r.item)||void 0===n?void 0:n.id,a=e.ctab.molecule.functionalGroups,s=null!=i?e.ctab.molecule.atoms.get(i):new I.hgN({label:""}),u=I.J41.findFunctionalGroupByAtom(a,i);r.timeout=setTimeout((function(){if(delete t.dragCtx,null==u){o.selection(null);var n=o.event.quickEdit.dispatch(s);Promise.resolve(n).then((function(t){var n=i?(0,I.dBq)(e.ctab,i,t):(0,I.f8s)(e.ctab,r.xy0,t);o.update(n)})).catch((function(){return null}))}else o.event.removeFG.dispatch({fgIds:[u]})}),750),r.stopTapping=function(){r.timeout&&(clearTimeout(r.timeout),delete r.timeout)}}function zf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ff(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ff(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ff(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Gf(t,e){if(!(this instanceof Gf))return new Gf(t,e);this.attach={atomid:e.atomid||0,bondid:e.bondid||0},this.editor=t,this.struct=t.render.ctab,this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups,this.editor.selection({atoms:[this.attach.atomid],bonds:[this.attach.bondid]})}function Hf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Vf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vf(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Vf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Uf(t,e){if(!(this instanceof Uf)){if(!t.selection()||!t.selection().bonds)return new Uf(t,e);var n=(0,I.Wa4)(t.render.ctab,t.selection().bonds,e);return t.update(n),t.selection(null),null}this.editor=t,this.atomProps={label:"C"},this.bondProps=e,this.struct=t.render.ctab,this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups}function qf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Wf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wf(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Wf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yf(t){if(!(this instanceof Yf))return new Yf(t);this.editor=t,this.editor.selection(null),this.struct=t.render.ctab,this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups}function $f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Kf(t,e){if(!(this instanceof Kf))return new Kf(t,e);this.editor=t,this.editor.selection(null),this.charge=e,this.struct=t.render.ctab,this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups}function Jf(t,e){for(var n=new I.Sgu(0,1),r=n.rotate(Math.PI/2),o=I.Sgu.diff(t[t.length-1],e),i=I.Sgu.dot(r,o),a=I.Sgu.dot(n,o),s=null,u=0,c=1e-5,l=!1,f=!1,h=0;h<t.length;++h){var d=I.Sgu.diff(t[h],e),p=I.Sgu.diff(d,o),v=I.Sgu.dot(r,d),m=I.Sgu.dot(n,d);l=!1,v*i<0&&(m*a>-c?a>-c&&(l=!0):(Math.abs(i)*Math.abs(m)-Math.abs(v)*Math.abs(a))*m>0&&(l=!0)),l&&f&&I.Sgu.dot(p,r)*I.Sgu.dot(s,r)>=0&&(l=!1),l&&u++,o=d,i=v,a=m,s=p,f=l}return u%2!=0}Lf.prototype.mousedown=function(t){this.editor.hover(null),this.editor.selection(null);var e=this.editor.findItem(t,["atoms","functionalGroups"]);if(e&&"functionalGroups"===e.map&&this.functionalGroups&&I.J41.isContractedFunctionalGroup(e.id,this.functionalGroups)){var n=new I.aUM,r=this.sgroups.get(e.id),o=I.j1n.getAtoms(this.molecule,r.item),i=(0,ke.Z)(o),a=i[0],s=i.slice(1),u=this.struct.molecule.atomGetNeighbors(a).some((function(t){return!o.includes(t.aid)}));if(u)n.mergeWith((0,I.U9$)(this.struct,e.id)),n.mergeWith((0,I.nHA)(this.struct,{atoms:s})),n.mergeWith((0,I.dBq)(this.struct,a,this.atomProps,!0));else{var c=this.struct.atoms.get(a).a.pp;n.mergeWith((0,I.nHA)(this.struct,{atoms:I.j1n.getAtoms(this.molecule,r.item),bonds:I.j1n.getBonds(this.molecule,r.item)})),n.mergeWith((0,I.f8s)(this.struct,c,this.atomProps))}this.editor.update(n)}var l=[],f=[];if(e&&this.functionalGroups.size&&"atoms"===e.map){var h=I.J41.atomsInFunctionalGroup(this.functionalGroups,e.id);null!==h&&l.push(h)}if(l.length>0){var d,p=Bf(l);try{for(p.s();!(d=p.n()).done;){var v=d.value,m=I.J41.findFunctionalGroupByAtom(this.functionalGroups,v);null===m||f.includes(m)||f.push(m)}}catch(t){p.e(t)}finally{p.f()}this.editor.event.removeFG.dispatch({fgIds:f})}else e?"atoms"===e.map&&(this.dragCtx={item:e}):this.dragCtx={}},Lf.prototype.mousemove=function(t){var e=this.editor.render;if(this.dragCtx&&this.dragCtx.item){var n=this.dragCtx,r=this.editor.findItem(t,["atoms"]);if(r&&"atoms"===r.map&&r.id===n.item.id)this.editor.hover(this.editor.findItem(t,["atoms"]));else{var o=e.ctab.molecule.atoms.get(n.item.id),i=Nf.calcAngle(o.pp,e.page2obj(t));t.ctrlKey||(i=Nf.fracAngle(i));var a=Nf.degrees(i);this.editor.event.message.dispatch({info:a+"º"});var s=Nf.calcNewAtomPos(o.pp,e.page2obj(t),t.ctrlKey);n.action&&n.action.perform(e.ctab),n.action=(0,I.QXZ)(e.ctab,this.bondProps,n.item.id,Object.assign({},this.atomProps),s,s)[0],this.editor.update(n.action,!0)}}else this.editor.hover(this.editor.findItem(t,["atoms","functionalGroups"]))},Lf.prototype.mouseup=function(t){var e=this.editor.findItem(t,["atoms","bonds"]),n=[],r=[];if(e&&this.functionalGroups&&"atoms"===e.map){var o=I.J41.atomsInFunctionalGroup(this.functionalGroups,e.id);null!==o&&n.push(o)}if(n.length>0){var i,a=Bf(n);try{for(a.s();!(i=a.n()).done;){var s=i.value,u=I.J41.findFunctionalGroupByAtom(this.functionalGroups,s);null===u||r.includes(u)||r.push(u)}}catch(t){a.e(t)}finally{a.f()}this.editor.event.removeFG.dispatch({fgIds:r})}else{if(this.dragCtx){var c=this.dragCtx,l=this.editor.render;this.editor.update(c.action||(c.item?(0,I.dBq)(l.ctab,c.item.id,this.atomProps,!0):(0,I.f8s)(l.ctab,l.page2obj(t),this.atomProps))),delete this.dragCtx}this.editor.event.message.dispatch({info:!1})}},Gf.prototype.mousemove=function(t){var e,n=this.editor.render,r=this.editor.findItem(t,["atoms","bonds"]),o=n.ctab.molecule;return r&&("atoms"===r.map&&I.eKO.get(null===(e=o.atoms.get(r.id))||void 0===e?void 0:e.label)||"bonds"===r.map)?this.editor.hover(r):this.editor.hover(null),!0},Gf.prototype.click=function(t){var e,n=this.editor,r=n.render.ctab.molecule,o=n.findItem(t,["atoms","bonds"]),i=[],a=[],s=[];if(o&&this.functionalGroups.size&&"atoms"===o.map){var u=I.J41.atomsInFunctionalGroup(this.functionalGroups,o.id);null!==u&&i.push(u)}if(o&&this.functionalGroups.size&&"bonds"===o.map){var c=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,o.id);null!==c&&a.push(c)}if(i.length>0){var l,f=zf(i);try{for(f.s();!(l=f.n()).done;){var h=l.value,d=I.J41.findFunctionalGroupByAtom(this.functionalGroups,h);null===d||s.includes(d)||s.push(d)}}catch(t){f.e(t)}finally{f.f()}this.editor.event.removeFG.dispatch({fgIds:s})}else{if(!(a.length>0))return o&&("atoms"===o.map&&I.eKO.get(null===(e=r.atoms.get(o.id))||void 0===e?void 0:e.label)||"bonds"===o.map)&&("atoms"===o.map?this.attach.atomid=o.id:this.attach.bondid=o.id,this.editor.selection({atoms:[this.attach.atomid],bonds:[this.attach.bondid]}),this.editor.event.attachEdit.dispatch(this.attach)),!0;var p,v=zf(a);try{for(v.s();!(p=v.n()).done;){var m=p.value,g=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,m);null===g||s.includes(g)||s.push(g)}}catch(t){v.e(t)}finally{v.f()}this.editor.event.removeFG.dispatch({fgIds:s})}},Uf.prototype.mousedown=function(t){if(!this.dragCtx){var e=this.editor.findItem(t,["atoms","bonds"]),n=[],r=[],o=[];if(e&&this.functionalGroups.size&&"atoms"===e.map){var i=I.J41.atomsInFunctionalGroup(this.functionalGroups,e.id);null!==i&&n.push(i)}if(e&&this.functionalGroups.size&&"bonds"===e.map){var a=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,e.id);null!==a&&r.push(a)}if(n.length>0){var s,u=Hf(n);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=I.J41.findFunctionalGroupByAtom(this.functionalGroups,c);null===l||o.includes(l)||o.push(l)}}catch(t){u.e(t)}finally{u.f()}this.editor.event.removeFG.dispatch({fgIds:o})}else{if(!(r.length>0)){var f=this.editor.render;return this.editor.hover(null),this.editor.selection(null),this.dragCtx={xy0:f.page2obj(t),item:this.editor.findItem(t,["atoms","bonds"])},this.dragCtx.item||delete this.dragCtx.item,!0}var h,d=Hf(r);try{for(d.s();!(h=d.n()).done;){var p=h.value,v=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,p);null===v||o.includes(v)||o.push(v)}}catch(t){d.e(t)}finally{d.f()}this.editor.event.removeFG.dispatch({fgIds:o})}}},Uf.prototype.mousemove=function(t){var e=this.editor,n=e.render;if("dragCtx"in this){var r=this.dragCtx,o=n.page2obj(t),i=Nf.calcAngle(r.xy0,o);t.ctrlKey||(i=Nf.fracAngle(i));var a=Nf.degrees(i);if(this.editor.event.message.dispatch({info:a+"º"}),!("item"in r)||"atoms"===r.item.map){var s,u,c,l;"action"in r&&r.action.perform(n.ctab);var f=[];if("item"in r&&"atoms"===r.item.map){s=r.item.id,u=e.findItem(t,["atoms"],r.item);var h=e.findItem(t,["functionalGroups"]);if(h&&I.J41.isContractedFunctionalGroup(h.id,this.functionalGroups)){var d=this.sgroups.get(h.id);u={id:I.j1n.getAtoms(this.molecule,d.item)[0],map:"atoms"}}var p=u&&I.J41.findFunctionalGroupByAtom(this.functionalGroups,u.id),v="number"==typeof p&&this.sgroups.get(p),m=v&&I.j1n.getAtoms(this.molecule,v.item);u&&v&&u.id!==m[0]&&(this.editor.event.removeFG.dispatch({fgIds:[p]}),u=null),u&&v&&u.id===m[0]&&this.molecule.atomGetNeighbors(u.id).forEach((function(t){!m.includes(t.aid)&&!f.includes(t.aid)&&f.push(t.aid)})),f.length>=1&&(u=null)}else{s=this.atomProps,c=r.xy0;var g=[],y=[];if((u=e.findItem(t,["atoms"]))&&"atoms"===u.map&&this.functionalGroups.size&&this.dragCtx){var b=I.J41.atomsInFunctionalGroup(this.functionalGroups,u.id);null!==b&&g.push(b)}if(g.length>0){var w,x=Hf(g);try{for(x.s();!(w=x.n()).done;){var O=w.value,E=I.J41.findFunctionalGroupByAtom(this.functionalGroups,O);null!==E&&!y.includes(E)&&y.push(E)}}catch(t){x.e(t)}finally{x.f()}}if(y.length>0)return this.editor.event.removeFG.dispatch({fgIds:y}),void delete this.dragCtx}var _=Number.MAX_VALUE;if(u&&"atoms"===u.map)u=u.id;else{u=this.atomProps;var S=n.page2obj(t);if(_=I.Sgu.dist(r.xy0,S),c)l=Nf.calcNewAtomPos(c,S,t.ctrlKey);else{var j=n.ctab.molecule.atoms.get(s);c=Nf.calcNewAtomPos(j.pp.get_xy0(),S,t.ctrlKey)}}return _>.3?r.action=(0,I.QXZ)(n.ctab,this.bondProps,s,u,c,l)[0]:delete r.action,this.editor.update(r.action,!0),!0}}return this.editor.hover(this.editor.findItem(t,["atoms","bonds"])),!0},Uf.prototype.mouseup=function(t){if("dragCtx"in this){var e=this.dragCtx,n=this.editor.render,r=n.ctab.molecule;if("action"in e)this.editor.update(e.action);else if("item"in e){if("atoms"===e.item.map)this.editor.update((0,I.QXZ)(n.ctab,this.bondProps,e.item.id)[0]);else if("bonds"===e.item.map){var o=Object.assign({},this.bondProps),i=r.bonds.get(e.item.id);this.editor.update((0,I.Mqr)(n.ctab,e.item.id,i,o))}}else{var a=n.page2obj(t),s=new I.Sgu(.5,0).rotate(this.bondProps.type===I.fYe.PATTERN.TYPE.SINGLE?-Math.PI/6:0),u=(0,I.QXZ)(n.ctab,this.bondProps,{label:"C"},{label:"C"},I.Sgu.diff(a,s),I.Sgu.sum(a,s));this.editor.update(u[0])}delete this.dragCtx}return this.editor.event.message.dispatch({info:!1}),!0},Yf.prototype.mousedown=function(t){if(!this.dragCtx){var e=this.editor.render,n=this.editor.findItem(t,["atoms","bonds"]),r=[],o=[],i=[];if(n&&this.functionalGroups.size&&"atoms"===n.map){var a=I.J41.atomsInFunctionalGroup(this.functionalGroups,n.id);null!==a&&r.push(a)}if(n&&this.functionalGroups.size&&"bonds"===n.map){var s=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,n.id);null!==s&&o.push(s)}if(r.length>0){var u,c=qf(r);try{for(c.s();!(u=c.n()).done;){var l=u.value,f=I.J41.findFunctionalGroupByAtom(this.functionalGroups,l);null===f||i.includes(f)||i.push(f)}}catch(t){c.e(t)}finally{c.f()}this.editor.event.removeFG.dispatch({fgIds:i})}else{if(!(o.length>0))return this.editor.hover(null),this.dragCtx={xy0:e.page2obj(t),item:n},n&&"atoms"===n.map&&(this.editor.selection({atoms:[n.id]}),Df(this,e)),this.dragCtx.item||delete this.dragCtx.item,!0;var h,d=qf(o);try{for(d.s();!(h=d.n()).done;){var p=h.value,v=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,p);null===v||i.includes(v)||i.push(v)}}catch(t){d.e(t)}finally{d.f()}this.editor.event.removeFG.dispatch({fgIds:i})}}},Yf.prototype.mousemove=function(t){var e=this.editor,n=e.render.ctab,r=this.dragCtx;if(e.hover(this.editor.findItem(t,["atoms","bonds"])),!r)return!0;if(r&&r.stopTapping&&r.stopTapping(),e.selection(null),!r.item||"atoms"===r.item.map){r.action&&r.action.perform(n);var o=n.molecule.atoms,i=r.item?o.get(r.item.id).pp:r.xy0,a=e.render.page2obj(t),s=Math.ceil(I.Sgu.diff(a,i).length()),u=t.ctrlKey?Nf.calcAngle(i,a):Nf.fracAngle(i,a),c=(0,I.bDx)(n,i,u,s,r.item?r.item.id:null),l=(0,U.Z)(c,2),f=l[0],h=l[1];return e.event.message.dispatch({info:s+" sectors"}),r.action=f,e.update(r.action,!0),r.mergeItems=(0,I.z8H)(e,h),e.hover((0,I.QOv)(r.mergeItems)),!0}return!0},Yf.prototype.mouseup=function(){var t,e=[],n=[];if(this.dragCtx&&this.dragCtx.mergeItems&&this.functionalGroups.size&&(t=this.dragCtx.mergeItems.atoms.values().next().value),t){var r=I.J41.atomsInFunctionalGroup(this.functionalGroups,t);null!==r&&e.push(r)}if(!(e.length>0)){var o=this.dragCtx;if(!o)return!0;delete this.dragCtx;var i=this.editor,a=i.render.ctab,s=a.molecule;if(o.stopTapping&&o.stopTapping(),!o.action&&o.item&&"bonds"===o.item.map){var u=s.bonds.get(o.item.id);o.action=(0,I.Mqr)(a,o.item.id,u,{type:I.fYe.PATTERN.TYPE.SINGLE,stereo:I.fYe.PATTERN.STEREO.NONE})}else o.action=o.action?(0,I.ghY)(a,o.mergeItems).mergeWith(o.action):(0,I.ghY)(a,o.mergeItems);return i.selection(null),i.hover(null),o.action&&i.update(o.action),i.event.message.dispatch({info:!1}),!0}var c,l=qf(e);try{for(l.s();!(c=l.n()).done;){var f=c.value,h=I.J41.findFunctionalGroupByAtom(this.functionalGroups,f);null===h||n.includes(h)||n.push(h)}}catch(t){l.e(t)}finally{l.f()}this.editor.event.removeFG.dispatch({fgIds:n})},Yf.prototype.cancel=Yf.prototype.mouseup,Yf.prototype.mouseleave=Yf.prototype.mouseup,Kf.prototype.mousemove=function(t){var e,n=this.editor.render,r=this.editor.findItem(t,["atoms"]),o=n.ctab.molecule;return r&&"atoms"===r.map&&I.eKO.get(null===(e=o.atoms.get(r.id))||void 0===e?void 0:e.label)?this.editor.hover(r):this.editor.hover(null),!0},Kf.prototype.click=function(t){var e,n=this.editor,r=n.render,o=r.ctab.molecule,i=n.findItem(t,["atoms","bonds"]),a=[],s=[];if(i&&this.functionalGroups.size&&"atoms"===i.map){var u=I.J41.atomsInFunctionalGroup(this.functionalGroups,i.id);null!==u&&a.push(u)}if(!(a.length>0))return i&&"atoms"===i.map&&I.eKO.get(null===(e=o.atoms.get(i.id))||void 0===e?void 0:e.label)&&(this.editor.hover(null),this.editor.update((0,I.dBq)(r.ctab,i.id,{charge:o.atoms.get(i.id).charge+this.charge}))),!0;var c,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$f(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(a);try{for(l.s();!(c=l.n()).done;){var f=c.value,h=I.J41.findFunctionalGroupByAtom(this.functionalGroups,f);null===h||s.includes(h)||s.push(h)}}catch(t){l.e(t)}finally{l.f()}this.editor.event.removeFG.dispatch({fgIds:s})};var Xf=function(t,e,n){var r=[],o=[],i=t.sgroups,a=t.molecule.functionalGroups,s=Math.min(e.x,n.x),u=Math.max(e.x,n.x),c=Math.min(e.y,n.y),l=Math.max(e.y,n.y);t.bonds.forEach((function(e,n){var o=I.Sgu.lc2(t.atoms.get(e.b.begin).a.pp,.5,t.atoms.get(e.b.end).a.pp,.5);o.x>s&&o.x<u&&o.y>c&&o.y<l&&!I.J41.isBondInContractedFunctionalGroup(e.b,i,a,!0)&&r.push(n)})),t.atoms.forEach((function(e,n){var r=I.J41.findFunctionalGroupByAtom(a,n),f=t.sgroups.get(r);e.a.pp.x>s&&e.a.pp.x<u&&e.a.pp.y>c&&e.a.pp.y<l&&(!I.J41.isAtomInContractedFunctionalGroup(e.a,i,a,!0)||n===f.item.atoms[0])&&o.push(n)}));var f=[],h=[],d=[];t.rxnArrows.forEach((function(t,e){t.item.center().x>s&&t.item.center().x<u&&t.item.center().y>c&&t.item.center().y<l&&f.push(e)})),t.rxnPluses.forEach((function(t,e){t.item.pp.x>s&&t.item.pp.x<u&&t.item.pp.y>c&&t.item.pp.y<l&&h.push(e)})),t.simpleObjects.forEach((function(t,e){t.getReferencePoints(!0).find((function(t){return t.x>s&&t.x<u&&t.y>c&&t.y<l}))&&d.push(e)}));var p=[];t.enhancedFlags.forEach((function(t,e){t.pp&&t.pp.x>s&&t.pp.x<u&&t.pp.y>c&&t.pp.y<l&&p.push(e)}));var v=[];t.sgroupData.forEach((function(t,e){t.sgroup.pp.x>s&&t.sgroup.pp.x<u&&t.sgroup.pp.y>c&&t.sgroup.pp.y<l&&v.push(e)}));var m=[];return t.texts.forEach((function(t,e){t.getReferencePoints().find((function(t){return t.x>s&&t.x<u&&t.y>c&&t.y<l}))&&m.push(e)})),{atoms:o,bonds:r,rxnArrows:f,rxnPluses:h,enhancedFlags:p,sgroupData:v,simpleObjects:d,texts:m}},Qf=function(t,e){for(var n=[],r=[],o=[],i=t.sgroups,a=t.molecule.functionalGroups,s=0;s<e.length;++s)o[s]=new I.Sgu(e[s].x,e[s].y);t.bonds.forEach((function(e,r){var s=I.Sgu.lc2(t.atoms.get(e.b.begin).a.pp,.5,t.atoms.get(e.b.end).a.pp,.5);Jf(o,s)&&!I.J41.isBondInContractedFunctionalGroup(e.b,i,a,!0)&&n.push(r)})),t.atoms.forEach((function(e,n){var s=I.J41.findFunctionalGroupByAtom(a,n),u=t.sgroups.get(s);!Jf(o,e.a.pp)||I.J41.isAtomInContractedFunctionalGroup(e.a,i,a,!0)&&n!==u.item.atoms[0]||r.push(n)}));var u=[],c=[],l=[],f=[];t.rxnArrows.forEach((function(t,e){t.getReferencePoints(!0).find((function(t){return Jf(o,t)}))&&u.push(e)})),t.rxnPluses.forEach((function(t,e){Jf(o,t.item.pp)&&c.push(e)})),t.simpleObjects.forEach((function(t,e){t.getReferencePoints(!0).find((function(t){return Jf(o,t)}))&&l.push(e)})),t.texts.forEach((function(t,e){t.getReferencePoints().find((function(t){return Jf(o,t)}))&&f.push(e)}));var h=[];t.enhancedFlags.forEach((function(t,e){t.pp&&Jf(o,t.pp)&&h.push(e)}));var d=[];return t.sgroupData.forEach((function(t,e){Jf(o,t.sgroup.pp)&&d.push(e)})),{atoms:r,bonds:n,rxnArrows:u,rxnPluses:c,enhancedFlags:h,sgroupData:d,simpleObjects:l,texts:f}};function th(t,e,n){this.mode=t,this.fragment=n,this.editor=e}function eh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return nh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function nh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}th.prototype.getSelection=function(){var t=this.editor.render;if(0===this.mode)return Qf(t.ctab,this.points);if(1===this.mode)return Xf(t.ctab,this.points[0],this.points[1]);throw new Error("Selector mode unknown")},th.prototype.begin=function(t){var e=this.editor.render;this.points=[e.page2obj(t)],1===this.mode&&this.points.push(this.points[0])},th.prototype.running=function(){return!!this.points},th.prototype.addPoint=function(t){if(!this.points)return null;var e=this.editor.render;return 0===this.mode?this.points.push(e.page2obj(t)):1===this.mode&&(this.points=[this.points[0],e.page2obj(t)]),this.update(),this.getSelection()},th.prototype.update=function(){if(this.selection&&(this.selection.remove(),this.selection=null),this.points&&this.points.length>1){var t=this.editor.render,e=this.points.map((function(e){return I.Ciz.obj2scaled(e,t.options).add(t.options.offset)}));this.selection=0===this.mode?t.selectionPolygon(e):t.selectionRectangle(e[0],e[1])}},th.prototype.end=function(){var t=this.getSelection();return this.points=null,this.update(null),t},th.prototype.cancel=function(){this.points=null,this.update(null)};var rh=["atoms","bonds","sgroups","functionalGroups","sgroupData"];function oh(t,e){if(!(this instanceof oh)){var n=t.selection()||{};if(!n.atoms&&!n.bonds)return new oh(t,e);var r,o,i=t.render.ctab.molecule.sgroups,a=t.selection().atoms,s=t.render.ctab.molecule,u=t.render.ctab,c={atoms:[],bonds:[]},l=[],f=t.render.ctab.molecule.functionalGroups,h=[],d=i.find((function(t,e){return(0,V.isEqual)(e.atoms,a)}));if(a&&f.size){var p,v=eh(a);try{for(v.s();!(p=v.n()).done;){var m=p.value,g=I.J41.atomsInFunctionalGroup(f,m);null==g&&(o=!0);var y=null!==g&&u.atoms.get(g).a;if(y){var b,w=eh(y.sgs.values());try{for(w.s();!(b=w.n()).done;)r=b.value}catch(t){w.e(t)}finally{w.f()}}if(y&&I.J41.isAtomInContractedFunctionalGroup(y,i,f,!1)){var x,O,E=void 0!==r&&I.j1n.getAtoms(s,i.get(r)),_=void 0!==r&&I.j1n.getBonds(s,i.get(r));m===E[0]&&(x=c.atoms).push.apply(x,(0,ee.Z)(E))&&(O=c.bonds).push.apply(O,(0,ee.Z)(_))}y&&l.push(g)}}catch(t){v.e(t)}finally{v.f()}}if(o&&(l=[]),l&&l.length>0){var S,j=eh(l);try{for(j.s();!(S=j.n()).done;){var A=S.value,P=I.J41.findFunctionalGroupByAtom(f,A);null===P||h.includes(P)||h.push(P)}}catch(t){j.e(t)}finally{j.f()}}return h.length?(t.selection(null),void t.event.removeFG.dispatch({fgIds:h})):(ih(t,void 0!==d?d:null,e),null)}this.editor=t,this.struct=t.render.ctab,this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups,this.type=e,this.lassoHelper=new th(1,t),this.editor.selection(null)}function ih(t,e,n){var r=t.render.ctab,o=r.molecule,i=t.selection()||{},a=null!==e?o.sgroups.get(e):null,s=a?a.type:n,u="DAT"===s?"sdataEdit":"sgroupEdit";if(i.atoms||i.bonds||a){var c=null;a?(c=a.getAttrs()).context=function(t,e){var n=t.molecule;if(1===e.length)return I.I6H.Atom;if(ch(t,e))return I.I6H.Multifragment;if(uh(t,e))return I.I6H.Fragment;var r=new I.UE_(e),o=Array.from(n.bonds.values()).filter((function(t){return r.has(t.begin)&&r.has(t.end)}));return sh(o)?I.I6H.Group:I.I6H.Bond}(r,a.atoms):c={context:ah(r,i)};var l=t.event[u].dispatch({type:s,attrs:c});Promise.resolve(l).then((function(n){if("DAT"!==n.type&&(0,I.tIy)(o,i.atoms||[]))t.event.message.dispatch({error:"Partial S-group overlapping is not allowed."});else{if(!(a||"DAT"===n.type||i.atoms&&0!==i.atoms.length))return;if(a&&a.getAttrs().context===n.attrs.context){var s=(0,I.V4S)(r,n.type,a.atoms,n.attrs).mergeWith((0,I.U9$)(r,e));return t.update(s),void t.selection(i)}var u=function(t,e,n,r){var o=e.render.ctab,i=o.molecule.sgroups.get(t),a=i&&i.atoms||r.atoms||[],s=n.attrs.context,u=(0,I.Hwe)(s,o,n,a,r);return u.selection=u.selection||r,null!=t&&(u.action=u.action.mergeWith((0,I.U9$)(o,t))),e.selection(u.selection),u}(e,t,n,i);t.update(u.action),t.selection(null)}})).catch((function(){return null}))}}function ah(t,e){var n=t.molecule;if(e.atoms&&!e.bonds)return I.I6H.Atom;var r=e.bonds.map((function(t){return n.bonds.get(t)}));if(!sh(r))return I.I6H.Bond;e.atoms=e.atoms||[];var o=new I.UE_(e.atoms),i=r.every((function(t){return o.has(t.begin)&&o.has(t.end)}));return uh(t,e.atoms)&&i?I.I6H.Fragment:ch(t,e.atoms)?I.I6H.Multifragment:I.I6H.Group}function sh(t){if(0===t.length)return!0;for(var e=0;e<t.length;++e)for(var n=t[e],r=0;r<t.length;++r)if(e!==r){var o=t[r];if(n.end===o.begin||n.end===o.end)return!0}return!1}function uh(t,e){return 1===lh(t,e)}function ch(t,e){return lh(t,e)>1}function lh(t,e){var n=new I.UE_(e);return Array.from(t.connectedComponents.values()).reduce((function(t,e){return t+(n.isSuperset(e)?1:0)}),0)}function fh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function hh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fh(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function dh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ph(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ph(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ph(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vh(t,e,n){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,n)}oh.prototype.mousedown=function(t){var e=this.editor.findItem(t,rh),n=[],r=[],o=[];if(e&&this.functionalGroups.size&&"atoms"===e.map){var i=I.J41.atomsInFunctionalGroup(this.functionalGroups,e.id),a=null!==i&&this.struct.atoms.get(i).a;a&&!I.J41.isAtomInContractedFunctionalGroup(a,this.sgroups,this.functionalGroups,!0)&&n.push(i)}if(e&&this.functionalGroups.size&&"bonds"===e.map){var s=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,e.id),u=null!==s&&this.struct.bonds.get(s).b;u&&!I.J41.isBondInContractedFunctionalGroup(u,this.sgroups,this.functionalGroups,!0)&&r.push(s)}if(e&&this.functionalGroups.size&&"functionalGroups"===e.map){var c=this.sgroups.get(e.id);if(I.J41.isFunctionalGroup(c.item))return void this.editor.event.removeFG.dispatch({fgIds:[e.id]})}if(n.length>0){var l,f=eh(n);try{for(f.s();!(l=f.n()).done;){var h=l.value,d=I.J41.findFunctionalGroupByAtom(this.functionalGroups,h);null===d||o.includes(d)||o.push(d)}}catch(t){f.e(t)}finally{f.f()}this.editor.event.removeFG.dispatch({fgIds:o})}else if(r.length>0){var p,v=eh(r);try{for(v.s();!(p=v.n()).done;){var m=p.value,g=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,m);null===g||o.includes(g)||o.push(g)}}catch(t){v.e(t)}finally{v.f()}this.editor.event.removeFG.dispatch({fgIds:o})}else e||this.lassoHelper.begin(t)},oh.prototype.mousemove=function(t){this.lassoHelper.running(t)?this.editor.selection(this.lassoHelper.addPoint(t)):this.editor.hover(this.editor.findItem(t,rh))},oh.prototype.mouseleave=function(t){this.lassoHelper.running(t)&&this.lassoHelper.end(t)},oh.prototype.mouseup=function(t){var e,n,r,o=this,i=this.editor.findItem(t,rh),a=this.editor.selection(),s={atoms:[],bonds:[]},u=[],c=[],l=[];if(!(i&&"functionalGroups"===i.map&&this.functionalGroups.size&&I.J41.isContractedFunctionalGroup(i.id,this.functionalGroups))){if(a&&this.functionalGroups.size&&a.atoms){var f,h=eh(a.atoms);try{for(h.s();!(f=h.n()).done;){var d=f.value,p=I.J41.atomsInFunctionalGroup(this.functionalGroups,d);null==p&&(n=!0);var v=null!==p&&this.struct.atoms.get(p).a;if(v){var m,g=eh(v.sgs.values());try{for(g.s();!(m=g.n()).done;)e=m.value}catch(t){g.e(t)}finally{g.f()}}if(v&&I.J41.isAtomInContractedFunctionalGroup(v,this.sgroups,this.functionalGroups,!0)){var y,b,w=void 0!==e&&I.j1n.getAtoms(this.molecule,this.struct.sgroups.get(e).item),x=void 0!==e&&I.j1n.getBonds(this.molecule,this.struct.sgroups.get(e).item);d===w[0]&&(y=s.atoms).push.apply(y,(0,ee.Z)(w))&&(b=s.bonds).push.apply(b,(0,ee.Z)(x))}v&&u.push(p)}}catch(t){h.e(t)}finally{h.f()}}if(a&&this.functionalGroups.size&&a.bonds){var O,E=eh(a.bonds);try{for(E.s();!(O=E.n()).done;){var _=O.value,S=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,_);null===S&&(r=!0),null!==S&&this.struct.bonds.get(S).b&&c.push(S)}}catch(t){E.e(t)}finally{E.f()}}if(u.length&&u.forEach((function(t){var e,n=I.J41.findFunctionalGroupByAtom(o.functionalGroups,t),r=I.j1n.getAtoms(o.molecule,o.struct.sgroups.get(n).item);(e=s.atoms).push.apply(e,(0,ee.Z)(r))})),c.length&&c.forEach((function(t){var e,n=I.J41.findFunctionalGroupByBond(o.molecule,o.functionalGroups,t),r=I.j1n.getBonds(o.molecule,o.struct.sgroups.get(n).item);(e=s.bonds).push.apply(e,(0,ee.Z)(r))})),(n||r)&&(u=null,c=null),u&&u.length>0){var j,A=eh(u);try{for(A.s();!(j=A.n()).done;){var P=j.value,k=I.J41.findFunctionalGroupByAtom(this.functionalGroups,P);null===k||l.includes(k)||l.push(k)}}catch(t){A.e(t)}finally{A.f()}}if(c&&c.length>0){var T,C=eh(c);try{for(C.s();!(T=C.n()).done;){var R=T.value,M=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,R);null===M||l.includes(M)||l.push(M)}}catch(t){C.e(t)}finally{C.f()}}if(1===l.length)return this.editor.selection(null),this.lassoHelper.cancel(),void this.editor.event.removeFG.dispatch({fgIds:l});var N=null,B=null;if(this.lassoHelper.running(t))B=s.atoms.length>0?wh(this.lassoHelper.end(t),s):this.lassoHelper.end(t),this.editor.selection(B);else{if(!i)return;if(this.editor.hover(null),"atoms"===i.map)B={atoms:[i.id]};else if("bonds"===i.map){var Z=this.editor.render.ctab.bonds.get(i.id);B={atoms:[Z.b.begin,Z.b.end]}}else{if("sgroups"!==i.map&&"sgroupData"!==i.map)return;N=i.id}}(null!==N||B&&B.atoms)&&ih(this.editor,N,this.type)}},oh.prototype.cancel=function(){this.lassoHelper.running()&&this.lassoHelper.end(),this.editor.selection(null)};var mh=new WeakMap,gh=new WeakMap,yh=function(){function t(e,n){(0,R.Z)(this,t),vh(this,mh,{writable:!0,value:void 0}),vh(this,gh,{writable:!0,value:void 0}),(0,r.Z)(this,"editor",void 0),(0,r.Z)(this,"dragCtx",void 0),this.editor=e,(0,je.Z)(this,mh,n),(0,je.Z)(this,gh,new th("lasso"===(0,Ae.Z)(this,mh)?0:1,e,"fragment"===(0,Ae.Z)(this,mh)))}return(0,M.Z)(t,[{key:"mousedown",value:function(t){var e,n=this.editor.render,r=n.ctab,o=r.molecule,i=o.functionalGroups,a=[],s={atoms:[],bonds:[]};this.editor.hover(null);var u=(0,Ae.Z)(this,gh).fragment||t.ctrlKey,c=this.editor.findItem(t,u?["frags","sgroups","functionalGroups","sgroupData","rgroups","rxnArrows","rxnPluses","enhancedFlags","simpleObjects","texts"]:["atoms","bonds","sgroups","functionalGroups","sgroupData","rgroups","rxnArrows","rxnPluses","enhancedFlags","simpleObjects","texts"],null);if(c&&"atoms"===c.map&&i.size){var l,f=null!==I.J41.atomsInFunctionalGroup(i,c.id)&&(null===(l=r.atoms.get(c.id))||void 0===l?void 0:l.a);if(f){var h,d=dh(f.sgs.values());try{for(d.s();!(h=d.n()).done;)e=h.value}catch(t){d.e(t)}finally{d.f()}}f&&void 0!==e&&!a.includes(e)&&a.push(e)}if(c&&"bonds"===c.map&&i.size){var p=I.J41.bondsInFunctionalGroup(o,i,c.id),v=I.J41.findFunctionalGroupByBond(o,i,p);null===v||a.includes(v)||a.push(v)}if(a.length){var m,g=dh(a);try{for(g.s();!(m=g.n()).done;){var y=m.value,b=r.sgroups.get(y);if(b){var w,x,O=I.j1n.getAtoms(o,b.item),E=I.j1n.getBonds(o,b.item);(w=s.atoms).push.apply(w,(0,ee.Z)(O))&&(x=s.bonds).push.apply(x,(0,ee.Z)(E))}}}catch(t){g.e(t)}finally{g.f()}this.editor.selection(s)}if(this.dragCtx={item:c,xy0:n.page2obj(t)},c&&"atoms"!==c.map||Df(this,n),!c)return this.editor.selection(null),delete this.dragCtx.item,(0,Ae.Z)(this,gh).fragment||(0,Ae.Z)(this,gh).begin(t),!0;var _=bh(c),S=r.sgroups.get(c.id),j=this.editor.selection();if("frags"===c.map){var A=r.frags.get(c.id);_={atoms:A.fragGetAtoms(r,c.id),bonds:A.fragGetBonds(r,c.id)}}else if("sgroups"!==c.map&&"functionalGroups"!==c.map||!S){if("rgroups"===c.map){var P=r.rgroups.get(c.id);_={atoms:P.getAtoms(n),bonds:P.getBonds(n)}}else if("sgroupData"===c.map&&xh(j,c))return!0}else{var k=S.item;_={atoms:I.j1n.getAtoms(o,k),bonds:I.j1n.getBonds(o,k)}}return t.shiftKey?this.editor.selection(wh(_,j,!0)):this.editor.selection(xh(j,c)?j:_),!0}},{key:"mousemove",value:function(t){var e=this.editor,n=e.render,r=e.render.ctab,o=this.dragCtx;if(o&&o.stopTapping&&o.stopTapping(),o&&o.item){var i,a,s=r.molecule.atoms,u=e.selection();if("atoms"===o.item.map&&1===(null==s||null===(i=s.get(o.item.id))||void 0===i?void 0:i.neighbors.length)&&1===(null==u||null===(a=u.atoms)||void 0===a?void 0:a.length)&&!u.bonds){var c=n.page2obj(t),l=Nf.calcAngle(o.xy0,c),f=Nf.degrees(l);this.editor.event.message.dispatch({info:f+"º"})}if("simpleObjects"===o.item.map&&o.item.ref){null!=o&&o.action&&o.action.perform(n.ctab);var h=n.page2obj(t),d=h.sub(this.dragCtx.xy0);return o.action=(0,I.cMT)(n.ctab,o.item.id,d,h,o.item.ref,t.shiftKey),e.update(o.action,!0),!0}if("rxnArrows"===o.item.map&&o.item.ref){null!=o&&o.action&&o.action.perform(n.ctab);var p=n.page2obj(t),v=p.sub(o.xy0);return o.previous=p,o.action=(0,I.gHo)(n.ctab,o.item.id,v,p,o.item.ref),e.update(o.action,!0),!0}o.action&&(o.action.perform(r),e.update(o.action,!0));var m=e.explicitSelected();return o.action=(0,I.DYm)(r,m,e.render.page2obj(t).sub(o.xy0)),o.mergeItems=(0,I.z8H)(e,m),e.hover((0,I.QOv)(o.mergeItems)),e.update(o.action,!0),!0}if((0,Ae.Z)(this,gh).running()){var g=(0,Ae.Z)(this,gh).addPoint(t);return e.selection(t.shiftKey?wh(g,e.selection(),!1):g),!0}var y=(0,Ae.Z)(this,gh).fragment||t.ctrlKey?["frags","sgroups","functionalGroups","sgroupData","rgroups","rxnArrows","rxnPluses","enhancedFlags","simpleObjects","texts"]:["atoms","bonds","sgroups","functionalGroups","sgroupData","rgroups","rxnArrows","rxnPluses","enhancedFlags","simpleObjects","texts"];return e.hover(e.findItem(t,y,null)),!0}},{key:"mouseup",value:function(t){var e,n=this.editor,r=n.selection(),o=n.render.ctab,i=o.molecule,a=i.functionalGroups,s=[],u={atoms:[],bonds:[]};if(r&&a.size&&r.atoms){var c,l=dh(r.atoms);try{for(l.s();!(c=l.n()).done;){var f,h=c.value,d=I.J41.atomsInFunctionalGroup(a,h),p=null!==d&&(null===(f=o.atoms.get(d))||void 0===f?void 0:f.a);if(p){var v,m=dh(p.sgs.values());try{for(m.s();!(v=m.n()).done;)e=v.value}catch(t){m.e(t)}finally{m.f()}}p&&void 0!==e&&!s.includes(e)&&s.push(e)}}catch(t){l.e(t)}finally{l.f()}}if(r&&a.size&&r.bonds){var g,y=dh(r.bonds);try{for(y.s();!(g=y.n()).done;){var b=g.value,w=I.J41.bondsInFunctionalGroup(i,a,b),x=I.J41.findFunctionalGroupByBond(i,a,w);null===x||s.includes(x)||s.push(x)}}catch(t){y.e(t)}finally{y.f()}}if(s.length){var O,E=dh(s);try{for(E.s();!(O=E.n()).done;){var _=O.value,S=o.sgroups.get(_);if(S){var j,A,P=I.j1n.getAtoms(i,S.item),k=I.j1n.getBonds(i,S.item);(j=u.atoms).push.apply(j,(0,ee.Z)(P))&&(A=u.bonds).push.apply(A,(0,ee.Z)(k))}}}catch(t){E.e(t)}finally{E.f()}}var T=this.dragCtx;if(T&&T.stopTapping&&T.stopTapping(),T&&T.item)T.action=T.action?(0,I.ghY)(o,T.mergeItems).mergeWith(T.action):(0,I.ghY)(o,T.mergeItems),n.hover(null),T.mergeItems&&n.selection(null),0!==T.action.operations.length&&n.update(T.action),delete this.dragCtx;else if((0,Ae.Z)(this,gh).running()){var C=u.atoms.length>0?wh((0,Ae.Z)(this,gh).end(),u,!1):(0,Ae.Z)(this,gh).end();n.selection(t.shiftKey?wh(C,n.selection(),!1):C)}else(0,Ae.Z)(this,gh).fragment&&(t.shiftKey||n.selection(null));return n.event.message.dispatch({info:!1}),!0}},{key:"dblclick",value:function(t){var e=this.editor,n=e.render.ctab,r=n.molecule,o=n.sgroups,i=r.functionalGroups,a=e.render,s=e.findItem(t,["atoms","bonds","sgroups","functionalGroups","sgroupData","texts"],null),u=[],c=[],l=[];if(s&&i&&"atoms"===s.map){var f,h=I.J41.atomsInFunctionalGroup(i,s.id),d=null!==h&&(null===(f=n.atoms.get(h))||void 0===f?void 0:f.a);null===h||I.J41.isAtomInContractedFunctionalGroup(d,o,i,!0)||u.push(h)}if(s&&i&&"bonds"===s.map){var p,v=I.J41.bondsInFunctionalGroup(r,i,s.id),m=null!==v&&(null===(p=n.bonds.get(v))||void 0===p?void 0:p.b);null===v||I.J41.isBondInContractedFunctionalGroup(m,o,i,!0)||c.push(v)}if(u.length>0){var g,y=dh(u);try{for(y.s();!(g=y.n()).done;){var b=g.value,w=I.J41.findFunctionalGroupByAtom(i,b);null===w||l.includes(w)||l.push(w)}}catch(t){y.e(t)}finally{y.f()}e.event.removeFG.dispatch({fgIds:l})}else{if(!(c.length>0)){if(!s)return!0;var x=this.editor.selection();if("atoms"===s.map){var O=new I.aUM,E=r.atoms.get(s.id),_=e.event.elementEdit.dispatch(E);if(null!=x&&x.atoms){var S=x.atoms;Promise.resolve(_).then((function(t){S.forEach((function(e){O.mergeWith((0,I.dBq)(n,e,t,!1))})),e.update(O)})).catch((function(){return null}))}}else if("bonds"===s.map){var j,A=null===(j=a.ctab.bonds.get(s.id))||void 0===j?void 0:j.b,P=e.event.bondEdit.dispatch(A);if(null!=x&&x.bonds){var k=new I.aUM,T=x.bonds;Promise.resolve(P).then((function(t){T.forEach((function(e){k.mergeWith((0,I.Wa4)(n,e,t))})),e.update(k)})).catch((function(){return null}))}}else if("sgroups"===s.map&&!I.J41.isFunctionalGroup(r.sgroups.get(s.id))||"sgroupData"===s.map)e.selection(bh(s)),ih(e,s.id);else if("texts"===s.map){e.selection(bh(s));var C=r.texts.get(s.id);e.event.elementEdit.dispatch(hh(hh({},C),{},{type:"text"})).then((function(t){var r=t.content;r?r!==(null==C?void 0:C.content)&&e.update((0,I.rzF)(n,s.id,r)):e.update((0,I.NmG)(n,s.id))})).catch((function(){return null}))}return!0}var R,M=dh(c);try{for(M.s();!(R=M.n()).done;){var N=R.value,B=I.J41.findFunctionalGroupByBond(r,i,N);null===B||l.includes(B)||l.push(B)}}catch(t){M.e(t)}finally{M.f()}this.editor.event.removeFG.dispatch({fgIds:l})}}},{key:"mouseleave",value:function(t){if(this.dragCtx&&this.dragCtx.stopTapping&&this.dragCtx.stopTapping(),this.dragCtx&&this.dragCtx.action){var e=this.dragCtx.action;this.editor.update(e)}(0,Ae.Z)(this,gh).running()&&this.editor.selection((0,Ae.Z)(this,gh).end()),delete this.dragCtx,this.editor.hover(null)}}]),t}();function bh(t){var e={};return e[t.map]=[t.id],e}function wh(t,e,n){return e&&Object.keys(e).forEach((function(r){t[r]?t[r]=function(t,e,n){return e.reduce((function(e,r){return n?t=(0,V.xor)(t,[r]):t.includes(r)||t.push(r),t}),[])}(t[r],e[r],n):t[r]=e[r].slice()})),t}function xh(t,e){return t&&t[e.map]&&t[e.map].includes(e.id)}function Oh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Eh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Eh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _h(t,e){if(!(this instanceof _h)){if(!t.selection())return new _h(t,e);var n=(0,I.nHA)(t.render.ctab,t.selection());return t.update(n),t.selection(null),null}this.editor=t,this.sgroups=t.render.ctab.sgroups,this.struct=t.render.ctab,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups,this.maps=["atoms","bonds","rxnArrows","rxnPluses","sgroups","functionalGroups","sgroupData","simpleObjects","texts"],this.lassoHelper=new th(e||0,t)}function Sh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return jh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function jh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ah(t,e){if(!(this instanceof Ah))return new Ah(t,e);this.editor=t,this.editor.selection(null),this.struct=e,this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups;var n=t.render,r=n.clientArea,o=r.clientHeight,i=r.clientWidth,a=t.lastEvent?n.page2obj(t.lastEvent):n.page2obj({pageX:i/2,pageY:o/2}),s=(0,I.lI3)(n.ctab,this.struct,a),u=(0,U.Z)(s,2),c=u[0],l=u[1];this.action=c,this.editor.update(this.action,!0),this.mergeItems=(0,I.z8H)(this.editor,l),this.editor.hover((0,I.QOv)(this.mergeItems),this)}function Ph(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function kh(t){if(!(this instanceof kh))return t.selection(null),new kh(t);this.editor=t,this.struct=t.render.ctab,this.sgroups=t.render.ctab.sgroups,this.functionalGroups=t.render.ctab.molecule.functionalGroups}function Th(t,e,n){var r=t.render.ctab.molecule,o=e||0===e?r.atoms.get(e):null,i=o?o.rglabel:0,a=o?o.label:"R#",s=t.event.elementEdit.dispatch({label:"R#",rglabel:i,fragId:o?o.fragment:null});Promise.resolve(s).then((function(r){r=Object.assign({},I.hgN.attrlist,r),!e&&0!==e&&r.rglabel?t.update((0,I.f8s)(t.render.ctab,n,r)):i!==r.rglabel&&(r.aam=o.aam,r.attpnt=o.attpnt,r.rglabel||"R#"===a||(r.label=a),t.update((0,I.dBq)(t.render.ctab,e,r)))})).catch((function(){return null}))}function Ch(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Rh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Rh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Mh(t){if(!(this instanceof Mh))return t.selection(null),new Mh(t);this.editor=t,this.struct=t.render.ctab,this.sgroups=t.render.ctab.sgroups,this.molecule=t.render.ctab.molecule,this.functionalGroups=this.molecule.functionalGroups}function Ih(t,e){if(!(this instanceof Ih))return new Ih(t,e);this.mode=e,this.editor=t,this.editor.selection(null)}function Nh(t,e){if(!e)return new I.Sgu(t.x+2,t.y);var n,r,o,i,a,s,u=(n=t.x,r=t.y,o=e.x,i=e.y,a=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),s=function(t,e,n,r){var o=t-n,i=e-r;return o||i?(180+180*Math.atan2(-i,-o)/Math.PI+360)%360:0}(o,i,n,r),{length:a,angle:s});if(u.length<=1.5){var c=new I.Sgu;return c.x=t.x+2*Math.cos(Math.PI*u.angle/180),c.y=t.y+2*Math.sin(Math.PI*u.angle/180),c}return e}function Bh(t){if(!(this instanceof Bh))return new Bh(t);this.editor=t,this.editor.selection(null)}function Zh(t,e,n){for(var r,o,i=0;(!r||!o)&&i<t.reactants.length;i++){var a=Array.from(t.reactants[i]);!r&&a.indexOf(e)>=0&&(r="r"),!o&&a.indexOf(n)>=0&&(o="r")}for(var s=0;(!r||!o)&&s<t.products.length;s++){var u=Array.from(t.products[s]);!r&&u.indexOf(e)>=0&&(r="p"),!o&&u.indexOf(n)>=0&&(o="p")}return r&&o&&r!==o}function Lh(t){if(!(this instanceof Lh))return new Lh(t);this.editor=t,this.editor.selection(null)}function Dh(t){if(!(this instanceof Dh))return new Dh(t);this.editor=t,this.editor.selection(null)}function zh(t,e){if(!(this instanceof zh)){if(!e)return new zh(t);var n=t.render.ctab,r=t.selection(),o=r&&r.bonds&&1===Object.keys(r).length&&1===r.bonds.length?(0,I.HIi)(n,r.bonds[0],e):(0,I.Hlm)(n,r,e);return t.update(o),null}this.editor=t,t.selection()&&t.selection().atoms||this.editor.selection(null)}function Fh(t,e){if(!(this instanceof Fh))return new Fh(t,e);this.mode=e,this.editor=t,this.editor.selection(null)}function Gh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Hh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Hh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Vh(t,e){if(!(this instanceof Vh))return new Vh(t,e);this.editor=t,this.mode=e.mode,this.struct=t.render.ctab,this.sgroups=this.struct.sgroups,this.molecule=this.struct.molecule,this.functionalGroups=this.molecule.functionalGroups,this.editor.selection(null),this.template={aid:parseInt(e.aid)||0,bid:parseInt(e.bid)||0};var n=e.struct;n.rescale();var r=new I.Sgu;n.atoms.forEach((function(t){r.add_(t.pp)})),this.template.molecule=n,this.findItems=[],this.template.xy0=r.scaled(1/(n.atoms.size||1));var o=n.atoms.get(this.template.aid);o&&(this.template.angle0=Nf.calcAngle(o.pp,this.template.xy0),this.findItems.push("atoms"));var i=n.bonds.get(this.template.bid);i&&"fg"!==this.mode&&(this.template.sign=Uh(n,i,this.template.xy0),this.findItems.push("bonds")),n.sgroups.size&&this.findItems.push("sgroups")}function Uh(t,e,n){var r=t.atoms.get(e.begin).pp,o=t.atoms.get(e.end).pp,i=I.Sgu.cross(I.Sgu.diff(r,o),I.Sgu.diff(n,o));return i>0?1:i<0?-1:0}_h.prototype.mousedown=function(t){this.editor.findItem(t,this.maps)||this.lassoHelper.begin(t)},_h.prototype.mousemove=function(t){this.lassoHelper.running()?this.editor.selection(this.lassoHelper.addPoint(t)):this.editor.hover(this.editor.findItem(t,this.maps))},_h.prototype.mouseup=function(t){var e,n=this.editor.selection(),r={atoms:[],bonds:[]},o=[],i=[],a=[];if(n&&this.functionalGroups.size&&n.atoms){var s,u=Oh(n.atoms);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=I.J41.atomsInFunctionalGroup(this.functionalGroups,c),f=null!==l&&this.struct.atoms.get(l).a;if(f){var h,d=Oh(f.sgs.values());try{for(d.s();!(h=d.n()).done;)e=h.value}catch(t){d.e(t)}finally{d.f()}}if(f&&I.J41.isAtomInContractedFunctionalGroup(f,this.sgroups,this.functionalGroups,!0)){var p,v,m=void 0!==e&&I.j1n.getAtoms(this.molecule,this.struct.sgroups.get(e).item),g=void 0!==e&&I.j1n.getBonds(this.molecule,this.struct.sgroups.get(e).item);c===m[0]&&(p=r.atoms).push.apply(p,(0,ee.Z)(m))&&(v=r.bonds).push.apply(v,(0,ee.Z)(g))}f&&!I.J41.isAtomInContractedFunctionalGroup(f,this.sgroups,this.functionalGroups,!0)&&o.push(l)}}catch(t){u.e(t)}finally{u.f()}}if(n&&this.functionalGroups.size&&n.bonds){var y,b=Oh(n.bonds);try{for(b.s();!(y=b.n()).done;){var w=y.value,x=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,w),O=null!==x&&this.struct.bonds.get(x).b;O&&!I.J41.isBondInContractedFunctionalGroup(O,this.sgroups,this.functionalGroups,!0)&&i.push(x)}}catch(t){b.e(t)}finally{b.f()}}if(o.length>0){var E,_=Oh(o);try{for(_.s();!(E=_.n()).done;){var S=E.value,j=I.J41.findFunctionalGroupByAtom(this.functionalGroups,S);null!==j&&!a.includes(j)&&a.push(j)}}catch(t){_.e(t)}finally{_.f()}}if(i.length>0){var A,P=Oh(i);try{for(P.s();!(A=P.n()).done;){var k=A.value,T=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,k);null!==T&&!a.includes(T)&&a.push(T)}}catch(t){P.e(t)}finally{P.f()}}if(a.length>0){var C=[],R=this.sgroups;a.forEach((function(t){R.get(t).item.atoms.forEach((function(e){!o.includes(e)&&!C.includes(t)&&C.push(t)}))})),C.length>0&&(this.editor.selection(null),this.editor.event.removeFG.dispatch({fgIds:C}),this.lassoHelper.cancel())}var M=this.editor.render;if(this.lassoHelper.running()){var N=r.atoms.length>0?wh(this.lassoHelper.end(t),r):this.lassoHelper.end(t);this.editor.update((0,I.nHA)(M.ctab,N)),this.editor.selection(null)}},_h.prototype.click=function(t){var e=this.editor.render,n=this.editor.render.ctab,r=this.editor.findItem(t,this.maps),o=[],i=[],a=[];if(r&&this.functionalGroups&&"functionalGroups"===r.map&&!I.J41.isContractedFunctionalGroup(r.id,this.functionalGroups)){var s=this.sgroups.get(r.id);I.J41.isFunctionalGroup(s.item)&&a.push(r.id)}else if(r&&this.functionalGroups&&"atoms"===r.map){var u=I.J41.atomsInFunctionalGroup(this.functionalGroups,r.id),c=null!==u&&this.struct.atoms.get(u).a;c&&!I.J41.isAtomInContractedFunctionalGroup(c,this.sgroups,this.functionalGroups,!0)&&o.push(u)}else if(r&&this.functionalGroups&&"bonds"===r.map){var l=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,r.id),f=null!==l&&this.struct.bonds.get(l).b;f&&!I.J41.isBondInContractedFunctionalGroup(f,this.sgroups,this.functionalGroups,!0)&&i.push(l)}if(o.length){var h,d=Oh(o);try{for(d.s();!(h=d.n()).done;){var p=h.value,v=I.J41.findFunctionalGroupByAtom(this.functionalGroups,p);null===v||a.includes(v)||a.push(v)}}catch(t){d.e(t)}finally{d.f()}}else if(i.length){var m,g=Oh(i);try{for(g.s();!(m=g.n()).done;){var y=m.value,b=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,y);null===b||a.includes(b)||a.push(b)}}catch(t){g.e(t)}finally{g.f()}}if(a.length)this.editor.event.removeFG.dispatch({fgIds:a});else if(r){if(this.editor.hover(null),"atoms"===r.map)this.editor.update((0,I.RmL)(n,r.id));else if("bonds"===r.map)this.editor.update((0,I.k_5)(n,r.id));else if("functionalGroups"===r.map&&I.J41.isContractedFunctionalGroup(r.id,this.functionalGroups)){var w=this.sgroups.get(r.id);this.editor.update((0,I.nHA)(e.ctab,{atoms:(0,ee.Z)(I.j1n.getAtoms(this.molecule,w.item)),bonds:(0,ee.Z)(I.j1n.getBonds(this.molecule,w.item))}))}else if("sgroups"===r.map||"sgroupData"===r.map){var x=this.sgroups.get(r.id);I.J41.isFunctionalGroup(x.item)?this.editor.event.removeFG.dispatch({fgIds:[r.id]}):this.editor.update((0,I.U9$)(n,r.id))}else if("rxnArrows"===r.map)this.editor.update((0,I.OAk)(n,r.id));else if("rxnPluses"===r.map)this.editor.update((0,I.QqH)(n,r.id));else if("simpleObjects"===r.map)this.editor.update((0,I.ltA)(n,r.id));else{if("texts"!==r.map)return;this.editor.update((0,I.NmG)(n,r.id))}this.editor.selection(null)}},_h.prototype.mouseleave=_h.prototype.mouseup,_h.prototype.cancel=function(){this.lassoHelper.running()&&this.lassoHelper.end(),this.editor.selection(null)},Ah.prototype.mousemove=function(t){var e=this.editor.render;this.action&&this.action.perform(e.ctab);var n=(0,I.lI3)(e.ctab,this.struct,e.page2obj(t)),r=(0,U.Z)(n,2),o=r[0],i=r[1];this.action=o,this.editor.update(this.action,!0),this.mergeItems=(0,I.z8H)(this.editor,i),this.editor.hover((0,I.QOv)(this.mergeItems))},Ah.prototype.mouseup=function(){var t=[],e=[],n=[];if(this.mergeItems&&this.functionalGroups.size&&this.mergeItems.atoms.size){var r,o=Sh(this.mergeItems.atoms.values());try{for(o.s();!(r=o.n()).done;){var i=r.value,a=I.J41.atomsInFunctionalGroup(this.functionalGroups,i);null!==a&&t.push(a)}}catch(t){o.e(t)}finally{o.f()}}if(this.mergeItems&&this.functionalGroups.size&&this.mergeItems.bonds.size){var s,u=Sh(this.mergeItems.bonds.values());try{for(u.s();!(s=u.n()).done;){var c=s.value,l=I.J41.atomsInFunctionalGroup(this.functionalGroups,c);null!==l&&e.push(l)}}catch(t){u.e(t)}finally{u.f()}}if(t.length>0){var f,h=Sh(t);try{for(h.s();!(f=h.n()).done;){var d=f.value,p=I.J41.findFunctionalGroupByAtom(this.functionalGroups,d);null===p||n.includes(p)||n.push(p)}}catch(t){h.e(t)}finally{h.f()}this.editor.event.removeFG.dispatch({fgIds:n})}else if(e.length>0){var v,m=Sh(e);try{for(m.s();!(v=m.n()).done;){var g=v.value,y=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,g);null===y||n.includes(y)||n.push(y)}}catch(t){m.e(t)}finally{m.f()}this.editor.event.removeFG.dispatch({fgIds:n})}else{var b=this.editor,w=b.render.ctab;if(b.selection(null),this.action=this.action?(0,I.ghY)(w,this.mergeItems).mergeWith(this.action):(0,I.ghY)(w,this.mergeItems),b.hover(null),this.action){var x=this.action;delete this.action,this.editor.update(x)}}},Ah.prototype.cancel=function(){var t=this.editor.render;this.editor.hover(null),this.action&&(this.action.perform(t.ctab),delete this.action,t.update())},Ah.prototype.mouseleave=Ah.prototype.cancel,kh.prototype.mousemove=function(t){var e=this.editor.render.ctab.molecule,n=this.editor.findItem(t,["atoms"]);n?null===e.atoms.get(n.id).attpnt&&this.editor.hover(n):this.editor.hover(null)},kh.prototype.click=function(t){var e=this.editor.render,n=this.editor.findItem(t,["atoms"]),r=[],o=[];if(n&&this.functionalGroups&&"atoms"===n.map){var i=I.J41.atomsInFunctionalGroup(this.functionalGroups,n.id);null!==i&&r.push(i)}if(!(r.length>0)){if(!n)return this.editor.hover(null),Th(this.editor,null,e.page2obj(t)),!0;if("atoms"===n.map){if(this.editor.hover(null),null!==this.editor.render.ctab.molecule.atoms.get(n.id).attpnt)return;return Th(this.editor,n.id),!0}return!0}var a,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ph(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ph(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(r);try{for(s.s();!(a=s.n()).done;){var u=a.value,c=I.J41.findFunctionalGroupByAtom(this.functionalGroups,u);null===c||o.includes(c)||o.push(c)}}catch(t){s.e(t)}finally{s.f()}this.editor.event.removeFG.dispatch({fgIds:o})},Mh.prototype.mousemove=function(t){this.editor.hover(this.editor.findItem(t,["frags","rgroups"]))},Mh.prototype.click=function(t){var e=this.editor,n=e.render.ctab.molecule,r=e.findItem(t,["frags","rgroups"]),o=e.findItem(t,["atoms","bonds"]),i=[],a=[],s=[];if(o&&this.functionalGroups&&"atoms"===o.map){var u=I.J41.atomsInFunctionalGroup(this.functionalGroups,o.id);null!==u&&i.push(u)}if(o&&this.functionalGroups&&"bonds"===o.map){var c=I.J41.bondsInFunctionalGroup(this.molecule,this.functionalGroups,o.id);null!==c&&a.push(c)}if(i.length>0){var l,f=Ch(i);try{for(f.s();!(l=f.n()).done;){var h=l.value,d=I.J41.findFunctionalGroupByAtom(this.functionalGroups,h);null===d||s.includes(d)||s.push(d)}}catch(t){f.e(t)}finally{f.f()}this.editor.event.removeFG.dispatch({fgIds:s})}else{if(!(a.length>0)){if(!r)return!0;this.editor.hover(null);var p="rgroups"===r.map?r.id:I.vfe.findRGroupByFragment(n.rgroups,r.id),v=Object.assign({label:p},"frags"===r.map?{fragId:r.id}:n.rgroups.get(r.id)),m=e.event.rgroupEdit.dispatch(v);return Promise.resolve(m).then((function(t){var n=e.render.ctab,o=null;if("rgroups"!==r.map){var i=I.vfe.findRGroupByFragment(n.molecule.rgroups,r.id);o=(0,I.GoV)(n,t.label,r.id).mergeWith((0,I.Dps)(n,t.label,i))}else o=(0,I.dmV)(n,r.id,t);e.update(o)})).catch((function(){return null})),!0}var g,y=Ch(a);try{for(y.s();!(g=y.n()).done;){var b=g.value,w=I.J41.findFunctionalGroupByBond(this.molecule,this.functionalGroups,b);null===w||s.includes(w)||s.push(w)}}catch(t){y.e(t)}finally{y.f()}this.editor.event.removeFG.dispatch({fgIds:s})}},Mh.prototype.cancel=function(){this.editor.hover(null)},Ih.prototype.mousedown=function(t){var e=this.editor.render.page2obj(t);this.dragCtx={p0:e};var n=this.editor.findItem(t,["rxnArrows"]);n&&"rxnArrows"===n.map?(this.editor.hover(null),this.editor.selection({rxnArrows:[n.id]}),this.dragCtx.ci=n):(this.dragCtx.isNew=!0,this.editor.selection(null))},Ih.prototype.mousemove=function(t){var e=this.editor.render;if(this.dragCtx){var n=e.page2obj(t),r=n.sub(this.dragCtx.p0);if(this.dragCtx.previous=n,this.dragCtx.ci)this.dragCtx.action&&this.dragCtx.action.perform(e.ctab),this.dragCtx.ci.ref?this.dragCtx.action=(0,I.gHo)(e.ctab,this.dragCtx.ci.id,r,n,this.dragCtx.ci.ref):this.dragCtx.action=(0,I.DYm)(e.ctab,this.editor.selection()||{},r),this.editor.update(this.dragCtx.action,!0);else{if(this.dragCtx.action)this.dragCtx.action.perform(e.ctab);else{var o=(0,I.OnW)(e.ctab,[this.dragCtx.p0,this.dragCtx.p0],this.mode),i=o.operations[0].data.id;this.dragCtx.itemId=i,this.dragCtx.action=o,this.editor.update(this.dragCtx.action,!0)}this.dragCtx.action=(0,I.gHo)(e.ctab,this.dragCtx.itemId,r,n,null),this.editor.update(this.dragCtx.action,!0)}}else{var a=this.editor.findItem(t,["rxnArrows"]);this.editor.hover(a)}},Ih.prototype.mouseup=function(t){if(!this.dragCtx)return!0;var e=this.editor.render,n=this.dragCtx.p0,r=Nh(n,this.dragCtx.previous);return this.dragCtx.action&&(this.dragCtx.isNew&&(this.editor.update((0,I.OAk)(e.ctab,this.dragCtx.itemId),!0),this.dragCtx.action=(0,I.OnW)(e.ctab,[n,r],this.mode)),this.editor.update(this.dragCtx.action)),delete this.dragCtx,!0},Ih.prototype.click=function(t){var e=this.editor.render,n=this.editor.findItem(t,["rxnArrows"]),r=e.page2obj(t);n||this.editor.update((0,I.OnW)(e.ctab,[r,Nh(r)],this.mode))},Bh.prototype.mousedown=function(t){var e=this.editor.render;this.rcs=e.ctab.molecule.getComponents();var n=this.editor.findItem(t,["atoms"]);n&&"atoms"===n.map&&(this.editor.hover(null),this.dragCtx={item:n,xy0:e.page2obj(t)})},Bh.prototype.mousemove=function(t){var e=this.editor.render;if("dragCtx"in this){var n=this.editor.findItem(t,["atoms"],this.dragCtx.item),r=e.ctab.molecule.atoms;n&&"atoms"===n.map&&Zh(this.rcs,this.dragCtx.item.id,n.id)?(this.editor.hover(n),this.updateLine(r.get(this.dragCtx.item.id).pp,r.get(n.id).pp)):(this.editor.hover(null),this.updateLine(r.get(this.dragCtx.item.id).pp,e.page2obj(t)))}else this.editor.hover(this.editor.findItem(t,["atoms"]))},Bh.prototype.updateLine=function(t,e){if(this.line&&(this.line.remove(),this.line=null),t&&e){var n=this.editor.render;this.line=n.selectionLine(I.Ciz.obj2scaled(t,n.options).add(n.options.offset),I.Ciz.obj2scaled(e,n.options).add(n.options.offset))}},Bh.prototype.mouseup=function(t){var e=this;if("dragCtx"in this){var n=this.editor.render,r=this.editor.findItem(t,["atoms"],this.dragCtx.item);if(r&&"atoms"===r.map&&Zh(this.rcs,this.dragCtx.item.id,r.id)){var o=new I.aUM,i=n.ctab.molecule.atoms,a=i.get(this.dragCtx.item.id),s=i.get(r.id),u=a.aam,c=s.aam;if(!u||u!==c){if((u&&u!==c||!u&&c)&&i.forEach((function(t,r){r!==e.dragCtx.item.id&&(u&&t.aam===u||c&&t.aam===c)&&o.mergeWith((0,I.dBq)(n.ctab,r,{aam:0}))})),u)o.mergeWith((0,I.dBq)(n.ctab,r.id,{aam:u}));else{var l=0;i.forEach((function(t){l=Math.max(l,t.aam||0)})),o.mergeWith((0,I.dBq)(n.ctab,this.dragCtx.item.id,{aam:l+1})),o.mergeWith((0,I.dBq)(n.ctab,r.id,{aam:l+1}))}this.editor.update(o)}}this.updateLine(null),delete this.dragCtx}this.editor.hover(null)},Lh.prototype.mousedown=function(t){var e=this.editor.render,n=this.editor.findItem(t,["rxnPluses"]);n&&"rxnPluses"===n.map&&(this.editor.hover(null),this.editor.selection({rxnPluses:[n.id]}),this.dragCtx={xy0:e.page2obj(t)})},Lh.prototype.mousemove=function(t){var e=this.editor.render;"dragCtx"in this?(this.dragCtx.action&&this.dragCtx.action.perform(e.ctab),this.dragCtx.action=(0,I.DYm)(e.ctab,this.editor.selection()||{},e.page2obj(t).sub(this.dragCtx.xy0)),this.editor.update(this.dragCtx.action,!0)):this.editor.hover(this.editor.findItem(t,["rxnPluses"]))},Lh.prototype.mouseup=function(){return!this.dragCtx||(this.dragCtx.action&&this.editor.update(this.dragCtx.action),delete this.dragCtx,!0)},Lh.prototype.click=function(t){var e=this.editor.render;this.editor.findItem(t,["rxnPluses"])||this.editor.update((0,I.v$W)(e.ctab,e.page2obj(t)))},Dh.prototype.mousemove=function(t){var e=this.editor.findItem(t,["atoms"]);e&&"atoms"===e.map?this.editor.hover(this.editor.render.ctab.molecule.atoms.get(e.id).aam?e:null):this.editor.hover(null)},Dh.prototype.mouseup=function(t){var e=this,n=this.editor.findItem(t,["atoms"]),r=this.editor.render.ctab.molecule.atoms;if(n&&"atoms"===n.map&&r.get(n.id).aam){var o=new I.aUM,i=r.get(n.id).aam;r.forEach((function(t,n){t.aam===i&&o.mergeWith((0,I.dBq)(e.editor.render.ctab,n,{aam:0}))})),this.editor.update(o)}this.editor.hover(null)},zh.prototype.mousedown=function(t){var e,n=new I.Sgu,r=this.editor.selection(),o=this.editor.render,i=o.ctab.molecule;if(r&&r.atoms){var a=null,s=!1;r.atoms.forEach((function(t){var e=i.atoms.get(t);n.add_(e.pp),s||e.neighbors.find((function(e){var n=i.halfBonds.get(e);if(-1===r.atoms.indexOf(n.end)){if(n.loop>=0&&!i.atoms.get(t).neighbors.find((function(t){var e=i.halfBonds.get(t);return e.loop>=0&&-1!==r.atoms.indexOf(e.end)})))return s=!0,!0;if(null==a)a=t;else if(a!==t)return s=!0,!0}return!1}))})),n=s||null===a?n.scaled(1/r.atoms.length):i.atoms.get(a).pp}else null!==(e=i.atoms)&&void 0!==e&&e.size?(i.atoms.forEach((function(t){n.add_(t.pp)})),n=n.scaled(1/i.atoms.size)):n=o.page2obj(t);return this.dragCtx={xy0:n,angle1:Nf.calcAngle(n,o.page2obj(t))},!0},zh.prototype.mousemove=function(t){if(!this.dragCtx)return!0;var e=this.editor.render,n=this.dragCtx,r=e.page2obj(t),o=Nf.calcAngle(n.xy0,r)-n.angle1;t.ctrlKey||(o=Nf.fracAngle(o));var i=Nf.degrees(o);if("angle"in n&&n.angle===i)return!0;"action"in n&&n.action.perform(e.ctab),n.angle=i,n.action=(0,I.TPF)(e.ctab,this.editor.selection(),n.xy0,o),this.editor.event.message.dispatch({info:i+"º"});var a=this.editor.explicitSelected();return n.mergeItems=(0,I.z8H)(this.editor,a),this.editor.hover((0,I.QOv)(n.mergeItems)),this.editor.update(n.action,!0),!0},zh.prototype.mouseup=function(){if(!this.dragCtx)return!0;var t=this.dragCtx,e=this.editor.render.ctab,n=t.action?(0,I.ghY)(e,t.mergeItems).mergeWith(t.action):(0,I.ghY)(e,t.mergeItems);return delete this.dragCtx,this.editor.update(n),this.editor.hover(null),t.mergeItems&&this.editor.selection(null),this.editor.event.message.dispatch({info:!1}),!0},zh.prototype.cancel=zh.prototype.mouseup,zh.prototype.mouseleave=zh.prototype.mouseup,Fh.prototype.mousedown=function(t){var e=this.editor.render.page2obj(t);this.dragCtx={p0:e};var n=this.editor.findItem(t,["simpleObjects"]);n&&"simpleObjects"===n.map?(this.editor.hover(null),this.editor.selection({simpleObjects:[n.id]}),this.dragCtx.ci=n):(this.dragCtx.isNew=!0,this.editor.selection(null))},Fh.prototype.mousemove=function(t){var e=this.editor.render;if(this.dragCtx){var n=e.page2obj(t),r=n.sub(this.dragCtx.p0);if(this.dragCtx.previous=n,this.dragCtx.ci)this.dragCtx.action&&this.dragCtx.action.perform(e.ctab),this.dragCtx.ci.ref?this.dragCtx.action=(0,I.cMT)(e.ctab,this.dragCtx.ci.id,r,n,this.dragCtx.ci.ref,t.shiftKey):this.dragCtx.action=(0,I.DYm)(e.ctab,this.editor.selection()||{},r),this.editor.update(this.dragCtx.action,!0);else{if(this.dragCtx.action)this.dragCtx.action.perform(e.ctab);else{var o=(0,I.g5D)(e.ctab,[this.dragCtx.p0,this.dragCtx.p0],this.mode),i=o.operations[0].data.id;this.dragCtx.itemId=i,this.dragCtx.action=o,this.editor.update(this.dragCtx.action,!0)}this.dragCtx.action=(0,I.cMT)(e.ctab,this.dragCtx.itemId,r,n,null,t.shiftKey),this.editor.update(this.dragCtx.action,!0)}}else{var a=this.editor.findItem(t,["simpleObjects"]);this.editor.hover(a)}},Fh.prototype.mouseup=function(t){if(!this.dragCtx)return!0;if(this.dragCtx.action){if(this.dragCtx.isNew){var e=this.editor.render;this.editor.update((0,I.ltA)(e.ctab,this.dragCtx.itemId),!0),this.dragCtx.action=(0,I.g5D)(e.ctab,[this.dragCtx.p0,this.dragCtx.previous],this.mode,t.shiftKey)}this.editor.update(this.dragCtx.action)}return delete this.dragCtx,!0},Vh.prototype.mousedown=function(t){var e=this.editor.findItem(t,["atoms","bonds","sgroups","functionalGroups"]),n=this.editor.struct(),r=[],o=[],i=[],a=[];if(e&&n.functionalGroups.size&&"functionalGroups"===e.map&&I.J41.isContractedFunctionalGroup(e.id,n.functionalGroups)&&i.push(e.id),e&&n.functionalGroups.size&&"atoms"===e.map){var s=I.J41.atomsInFunctionalGroup(n.functionalGroups,e.id);null!==s&&r.push(s)}if(e&&n.functionalGroups.size&&"bonds"===e.map){var u=I.J41.bondsInFunctionalGroup(this.molecule,n.functionalGroups,e.id);null!==u&&o.push(u)}if(i.length>0){var c,l=Gh(i);try{for(l.s();!(c=l.n()).done;){var f=c.value;a.includes(f)||a.push(f)}}catch(t){l.e(t)}finally{l.f()}}if(r.length>0){var h,d=Gh(r);try{for(d.s();!(h=d.n()).done;){var p=h.value,v=I.J41.findFunctionalGroupByAtom(n.functionalGroups,p);null===v||a.includes(v)||a.push(v)}}catch(t){d.e(t)}finally{d.f()}}if(o.length>0){var m,g=Gh(o);try{for(g.s();!(m=g.n()).done;){var y=m.value,b=I.J41.findFunctionalGroupByBond(this.molecule,n.functionalGroups,y);null===b||a.includes(b)||a.push(b)}}catch(t){g.e(t)}finally{g.f()}}if(!a.length){var w=this.editor,x=w.render.ctab;this.editor.hover(null),this.dragCtx={xy0:w.render.page2obj(t),item:w.findItem(t,this.findItems)};var O=this.dragCtx,E=O.item;if(!E)return delete O.item,!0;if("bonds"===E.map&&"fg"!==this.mode){var _=x.molecule,S=new I.Sgu,j=_.bonds.get(E.id),A=_.atoms.get(j.begin).fragment,P=_.getFragmentIds(A),k=0,T=_.halfBonds.get(j.hb1).loop;T<0&&(T=_.halfBonds.get(j.hb2).loop),T>=0?_.loops.get(T).hbs.forEach((function(t){S.add_(_.atoms.get(_.halfBonds.get(t).begin).pp),k++})):P.forEach((function(t){S.add_(_.atoms.get(t).pp),k++})),O.v0=S.scaled(1/k);var C=Uh(_,j,O.v0);O.sign1=C||1,O.sign2=this.template.sign}return!0}this.editor.event.removeFG.dispatch({fgIds:a})},Vh.prototype.mousemove=function(t){var e=this.editor.render.ctab;if(!this.dragCtx)return this.editor.hover(this.editor.findItem(t,this.findItems)),!0;var n=this.dragCtx,r=n.item,o=null,i=this.editor.render.page2obj(t),a=e.molecule;if(r&&"bonds"===r.map&&"fg"!==this.mode){var s=a.bonds.get(r.id),u=Uh(a,s,i);if(n.sign1*this.template.sign>0&&(u=-u),u!==n.sign2||!n.action){n.action&&n.action.perform(e),n.sign2=u;var c=(0,I.e9t)(e,this.template,r.id,this.editor.event,n.sign1*n.sign2>0,!1),l=(0,U.Z)(c,2),f=l[0],h=l[1];n.action=f,this.editor.update(n.action,!0),n.mergeItems=(0,I.z8H)(this.editor,h),this.editor.hover((0,I.QOv)(n.mergeItems))}return!0}var d=null;r?"atoms"===r.map&&(o=a.atoms.get(r.id).pp,d="fg"===this.mode||I.Sgu.dist(o,i)>1):o=n.xy0;var p=Nf.calcAngle(o,i);t.ctrlKey||(p=Nf.fracAngle(p));var v=Nf.degrees(p);if(this.editor.event.message.dispatch({info:v+"º"}),n.hasOwnProperty("angle")&&n.angle===v&&(!n.hasOwnProperty("extra_bond")||n.extra_bond===d))return!0;n.action&&n.action.perform(e),n.angle=v;var m,g=null;if(r){if("atoms"===r.map){var y=(0,I.ksM)(e,this.template,r.id,p,d),b=(0,U.Z)(y,2);g=b[0],m=b[1],n.extra_bond=d}}else{var w=(0,I.m81)(e,this.template,o,p),x=(0,U.Z)(w,2);g=x[0],m=x[1]}return n.action=g,this.editor.update(n.action,!0),"fg"!==this.mode&&(n.mergeItems=(0,I.z8H)(this.editor,m),this.editor.hover((0,I.QOv)(n.mergeItems))),!0},Vh.prototype.mouseup=function(t){var e=this,n=this.dragCtx;if(!n)return!0;delete this.dragCtx;var r,o=this.editor.render.ctab,i=o.molecule,a=n.item;if(n.action&&a&&"bonds"===a.map&&"fg"!==this.mode)return n.action.perform(o),(0,I.e9t)(o,this.template,a.id,this.editor.event,n.sign1*n.sign2>0,!0).then((function(t){var n=(0,U.Z)(t,2),r=n[0],i=n[1],a=(0,I.z8H)(e.editor,i);r=(0,I.ghY)(o,a).mergeWith(r),e.editor.update(r)})),!0;var s=null;if(!n.action)if(a){if("atoms"===a.map){var u,c,l=o.atoms.get(a.id).a.neighbors.length;if(l>1)u=null,c=!0;else if(1===l){var f=i.atoms.get(a.id),h=i.halfBonds.get(f.neighbors[0]).end,d=i.atoms.get(h);u=t.ctrlKey?Nf.calcAngle(d.pp,f.pp):Nf.fracAngle(Nf.calcAngle(d.pp,f.pp)),c=!1}else u=0,c=!1;var p=(0,I.ksM)(o,this.template,a.id,u,c),v=(0,U.Z)(p,2);r=v[0],s=v[1],n.action=r}else if("bonds"===a.map&&"fg"!==this.mode)return(0,I.e9t)(o,this.template,a.id,this.editor.event,n.sign1*n.sign2>0,!0).then((function(t){var n=(0,U.Z)(t,2),r=n[0],i=n[1];if("fg"!==e.mode){var a=(0,I.z8H)(e.editor,i);r=(0,I.ghY)(o,a).mergeWith(r),e.editor.update(r)}})),!0}else{var m=(0,I.m81)(o,this.template,n.xy0,0),g=(0,U.Z)(m,2);r=g[0],s=g[1],n.action=r}this.editor.selection(null),!n.mergeItems&&s&&"fg"!==this.mode&&(n.mergeItems=(0,I.z8H)(this.editor,s)),n.action=n.action?(0,I.ghY)(o,n.mergeItems).mergeWith(n.action):(0,I.ghY)(o,n.mergeItems),this.editor.hover(null);var y=n.action;return y&&!y.isDummy()&&this.editor.update(y),this.editor.event.message.dispatch({info:!1}),!0},Vh.prototype.cancel=Vh.prototype.mouseup,Vh.prototype.mouseleave=Vh.prototype.mouseup;var qh=function(){function t(e){(0,R.Z)(this,t),(0,r.Z)(this,"editor",void 0),(0,r.Z)(this,"dragCtx",void 0),this.editor=e,this.editor.selection(null)}return(0,M.Z)(t,[{key:"mousedown",value:function(t){var e=this.editor.render,n=this.editor.findItem(t,["texts"]);this.editor.selection(null),n&&"texts"===n.map&&(this.editor.hover(null),this.editor.selection({texts:[n.id]}),this.dragCtx={xy0:e.page2obj(t),action:new I.aUM})}},{key:"mousemove",value:function(t){var e=this.editor.render;this.dragCtx?(this.dragCtx.action&&this.dragCtx.action.perform(e.ctab),this.dragCtx.action=(0,I.DYm)(e.ctab,this.editor.selection()||{},e.page2obj(t).sub(this.dragCtx.xy0)),this.editor.update(this.dragCtx.action,!0)):this.editor.hover(this.editor.findItem(t,["texts"]))}},{key:"mouseup",value:function(){return this.dragCtx&&(this.editor.update(this.dragCtx.action),delete this.dragCtx),!0}},{key:"click",value:function(t){var e=this.editor.render,n=this.editor.findItem(t,["texts"]);return this.editor.hover(null),n||Wh(this.editor,null,e.page2obj(t)),!0}},{key:"dblclick",value:function(t){var e=this.editor.findItem(t,["texts"]);return this.editor.hover(null),"texts"===e.map&&Wh(this.editor,e.id,e.position),!0}}]),t}();function Wh(t,e,n){var r=t.render.ctab.molecule,o=e||0===e?r.texts.get(e):null,i=o?o.content:"";t.event.elementEdit.dispatch({content:i,id:e,position:n,type:"text"}).then((function(r){var o=r.content;!e&&0!==e&&o?t.update((0,I.$Tq)(t.render.ctab,o,n)):o?o!==i&&t.update((0,I.rzF)(t.render.ctab,e,o)):t.update((0,I.NmG)(t.render.ctab,e))})).catch((function(){return null}))}var Yh={rgroupatom:kh,select:yh,sgroup:oh,eraser:_h,atom:Lf,bond:Uf,chain:Yf,template:Vh,charge:Kf,rgroupfragment:Mh,apoint:Rf,attach:Gf,reactionarrow:Ih,reactionplus:Lh,reactionmap:Bh,reactionunmap:Dh,paste:Ah,rotate:zh,enhancedStereo:function t(e){if(!(this instanceof t)){var n=e.selection(),r=(0,I.f0f)(e.struct(),n?n.atoms||[]:Array.from(e.struct().atoms.keys()));if(0===r.length)return null;(function(t,e){var n=t.struct(),r=t.render.ctab,o=e.map((function(t){var e=n.atoms.get(t);return e&&e.stereoLabel})),i=o.some((function(t){return t!==o[0]}));return t.event.enhancedStereoEdit.dispatch({stereoLabel:i?null:o[0]}).then((function(t){if(!t)return null;var o=e.reduce((function(t,e){var o;return t.mergeWith((0,I.Eps)(r,null===(o=n.atoms.get(e))||void 0===o?void 0:o.fragment))}),(0,I.dBq)(r,e,{stereoLabel:t},!1));return o.operations.reverse(),o}))})(e,r).then((function(t){return t&&e.update(t)}))}},simpleobject:Fh,text:function(t){return new qh(t)}},$h=function(){function t(e){(0,R.Z)(this,t),(0,r.Z)(this,"editor",void 0),this.editor=e}return(0,M.Z)(t,[{key:"getAll",value:function(){var t=this.editor.render.ctab.molecule.highlights;return(0,ee.Z)(t).map((function(t){var e=(0,U.Z)(t,2);return{id:e[0],highlight:e[1]}}))}},{key:"create",value:function(){for(var t=this,e=[],n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];r.forEach((function(n){var r=n.atoms,o=n.bonds,i=n.color;if("string"==typeof i&&(r||o)){var a=Kh(t.editor.render.ctab.molecule,r,o),s=a.validAtoms,u=a.validBonds;0===s.length&&0===u.length||e.push({atoms:s,bonds:u,color:i})}}));var i=(0,I.atm)(this.editor.render.ctab,e);this.editor.update(i)}},{key:"clear",value:function(){var t=(0,I.Ksv)(this.editor.render.ctab);this.editor.update(t)}}]),t}();function Kh(t,e,n){Array.isArray(e)||(e=[]),Array.isArray(n)||(n=[]);var r=t.atoms,o=t.bonds;return e.length>0&&(e=e.filter((function(t){return r.has(t)}))),n.length>0&&(n=n.filter((function(t){return o.has(t)}))),{validAtoms:e,validBonds:n}}var Jh=["atoms","bonds","frags","sgroups","sgroupData","rgroups","rxnArrows","rxnPluses","enhancedFlags","simpleObjects","texts"],Xh=["atoms","bonds","rxnArrows","rxnPluses","functionalGroups","frags","merge","rgroups","sgroups","sgroupData","enhancedFlags","simpleObjects","texts"];function Qh(t,e){var n={};t.forEach((function(t,e){n[t.fragment]?n[t.fragment].push(e):n[t.fragment]=[e]}));var r=[];return Object.keys(n).forEach((function(t){var o=!0;n[t].forEach((function(t){e.includes(t)||(o=!1)})),o&&r.push(Number(t))})),r}var td=new WeakMap,ed=function(){function t(e,n){var o,i,a;(0,R.Z)(this,t),a={writable:!0,value:void 0},function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(o=this,i=td),i.set(o,a),(0,r.Z)(this,"render",void 0),(0,r.Z)(this,"_selection",void 0),(0,r.Z)(this,"_tool",void 0),(0,r.Z)(this,"historyStack",void 0),(0,r.Z)(this,"historyPtr",void 0),(0,r.Z)(this,"errorHandler",void 0),(0,r.Z)(this,"highlights",void 0),(0,r.Z)(this,"event",void 0),(0,r.Z)(this,"lastEvent",void 0),this.render=new I.Hrh(e,Object.assign({scale:40},n)),this._selection=null,this._tool=null,this.historyStack=[],this.historyPtr=0,this.errorHandler=null,this.highlights=new $h(this),this.event={message:new Pe.w0,elementEdit:new Pe.he,bondEdit:new Pe.he,rgroupEdit:new Pe.he,sgroupEdit:new Pe.he,sdataEdit:new Pe.he,quickEdit:new Pe.he,attachEdit:new Pe.he,removeFG:new Pe.he,change:new Pe.w0,selectionChange:new Pe.he,aromatizeStruct:new Pe.he,dearomatizeStruct:new Pe.he,enhancedStereoEdit:new Pe.he},function(t,e){["click","dblclick","mousedown","mousemove","mouseup","mouseleave"].forEach((function(n){t.event[n]=new Pe.ZN;var r=t.event[n];e.addEventListener(n,r.dispatch.bind(r)),r.add((function(e){if("mouseup"!==n&&"mouseleave"!==n&&(function(t){return t.which&&3===t.which||t.button&&2===t.button}(e)||!e.target||"DIV"===e.target.nodeName))return t.hover(null),!0;var r=t.tool();return t.lastEvent=e,r&&n in r&&r[n](e),!0}),-1)}))}(this,e)}return(0,M.Z)(t,[{key:"isDitrty",value:function(){var t=this.historyPtr;return!(!this.historyStack.length||!(0,Ae.Z)(this,td)||(0,V.isEqual)(this.historyStack[t-1],(0,Ae.Z)(this,td)))}},{key:"setOrigin",value:function(){var t=this.historyPtr;(0,je.Z)(this,td,t?this.historyStack[t-1]:null)}},{key:"tool",value:function(t,e){return 0===arguments.length?this._tool:(this._tool&&this._tool.cancel&&this._tool.cancel(),(n="select"===t?new Yh[t](this,e):Yh[t](this,e))?(this._tool=n,this._tool):null);var n}},{key:"clear",value:function(){this.struct(void 0)}},{key:"struct",value:function(t){if(0===arguments.length)return this.render.ctab.molecule;this.selection(null);var e=t||new I.AUF,n=(0,I.oEw)(this.render.ctab,e);return this.update(n),rd(this.render.ctab),nd(this),this.render.ctab.molecule}},{key:"options",value:function(t){if(0===arguments.length)return this.render.options;var e=this.render.ctab.molecule,n=this.render.options.zoom;return this.render.clientArea.innerHTML="",this.render=new I.Hrh(this.render.clientArea,Object.assign({scale:40},t)),this.render.setMolecule(e),this.render.setZoom(n),this.render.update(),this.render.options}},{key:"zoom",value:function(t){if(0===arguments.length)return this.render.options.zoom;this.render.setZoom(t);var e=this.selection();return rd(this.render.ctab,e),nd(this),this.render.update(),this.render.options.zoom}},{key:"selection",value:function(t){if(0===arguments.length)return this._selection;var e=this.render.ctab;if(this._selection=null,"all"===t&&(t=Jh.reduce((function(t,n){return t[n]=Array.from(e[n].keys()),t}),{})),"descriptors"===t&&(e=this.render.ctab,t={sgroupData:Array.from(e.sgroupData.keys())}),t){var n={};Object.keys(t).forEach((function(e){t[e].length>0&&(n[e]=t[e].slice())})),0!==Object.keys(n).length&&(this._selection=n);var r=Qh(this.struct().atoms,this.explicitSelected().atoms);0!==r.length&&(this._selection&&this._selection.enhancedFlags?this._selection.enhancedFlags=Array.from(new Set([].concat((0,ee.Z)(this._selection.enhancedFlags),(0,ee.Z)(r)))):n.enhancedFlags=r)}return this.render.ctab.setSelection(this._selection),this.event.selectionChange.dispatch(this._selection),this.render.update(),this._selection}},{key:"hover",value:function(t,e){var n=e||this._tool;!("ci"in n)||t&&n.ci.map===t.map&&n.ci.id===t.id||(od(n.ci,!1,this.render),delete n.ci),t&&od(t,!0,this.render)&&(n.ci=t)}},{key:"update",value:function(t,e){!0===t?this.render.update(!0):(e||t.isDummy()||(this.historyStack.splice(this.historyPtr,33,t),this.historyStack.length>32&&this.historyStack.shift(),this.historyPtr=this.historyStack.length,this.event.change.dispatch(t)),this.render.update())}},{key:"historySize",value:function(){return{undo:this.historyPtr,redo:this.historyStack.length-this.historyPtr}}},{key:"undo",value:function(){if(0===this.historyPtr)throw new Error("Undo stack is empty");if(this.tool()&&this.tool().cancel&&this.tool().cancel(),this.selection(null),this._tool instanceof Yh.paste)this.event.change.dispatch();else{this.historyPtr--;var t=this.historyStack[this.historyPtr].perform(this.render.ctab);this.historyStack[this.historyPtr]=t,this.event.change.dispatch(t),this.render.update()}}},{key:"redo",value:function(){if(this.historyPtr===this.historyStack.length)throw new Error("Redo stack is empty");if(this.tool()&&this.tool().cancel&&this.tool().cancel(),this.selection(null),this._tool instanceof Yh.paste)this.event.change.dispatch();else{var t=this.historyStack[this.historyPtr].perform(this.render.ctab);this.historyStack[this.historyPtr]=t,this.historyPtr++,this.event.change.dispatch(t),this.render.update()}}},{key:"subscribe",value:function(t,e){var n={handler:e};if("change"===t){var r=function(t){return function(t,e){var n=[];return t.operations.reverse().forEach((function(t){var e=t._inverted;switch(e.type){case I.C8.ATOM_ADD:case I.C8.ATOM_DELETE:n.push({operation:e.type,id:e.data.aid,label:e.data.atom.label?e.data.atom.label:"",position:{x:+e.data.pos.x.toFixed(2),y:+e.data.pos.y.toFixed(2)}});break;case I.C8.ATOM_ATTR:n.push({operation:t.type,id:t.data.aid,attribute:t.data.attribute,from:t.data.value,to:t.data2.value});break;case I.C8.ATOM_MOVE:n.push({operation:e.type,id:e.data.aid,position:{x:+e.data.d.x.toFixed(2),y:+e.data.d.y.toFixed(2)}});break;case I.C8.BOND_ADD:case I.C8.BOND_DELETE:n.push({operation:e.type,id:e.data.bid});break;case I.C8.FRAGMENT_ADD:case I.C8.FRAGMENT_DELETE:n.push({operation:e.type,id:e.frid});break;case I.C8.FRAGMENT_ADD_STEREO_ATOM:case I.C8.FRAGMENT_DELETE_STEREO_ATOM:n.push({operation:e.type,atomId:e.data.aid,fragId:e.data.frid});break;case I.C8.S_GROUP_ATOM_ADD:case I.C8.S_GROUP_ATOM_REMOVE:n.push({operation:e.type,atomId:e.data.aid,sGroupId:e.data.sgid});break;case I.C8.S_GROUP_CREATE:case I.C8.S_GROUP_DELETE:n.push({operation:e.type,type:e.data.type,sGroupId:e.data.sgid});break;case I.C8.RXN_ARROW_ADD:case I.C8.RXN_ARROW_DELETE:n.push({operation:e.type,id:e.data.arid,position:{x:+e.data.pos.x.toFixed(2),y:+e.data.pos.y.toFixed(2)}});break;case I.C8.RXN_ARROW_RESIZE:n.push({operation:e.type,id:e.data.id});break;case I.C8.RXN_ARROW_MOVE:n.push({operation:e.type,id:e.data.id,position:{x:+e.data.d.x.toFixed(2),y:+e.data.d.y.toFixed(2)}});break;case I.C8.R_GROUP_FRAGMENT:n.push({operation:t.type,id:e.frid});break;case I.C8.SIMPLE_OBJECT_ADD:case I.C8.SIMPLE_OBJECT_DELETE:n.push({operation:e.type,id:e.data.id,mode:e.data.mode});break;case I.C8.SIMPLE_OBJECT_RESIZE:n.push({operation:e.type,id:e.data.id});break;case I.C8.SIMPLE_OBJECT_MOVE:n.push({operation:t.type,id:t.data.id,position:{x:+t.data.d.x.toFixed(2),y:+t.data.d.y.toFixed(2)}});break;default:n.push({operation:e.type})}})),e(n)}(t,e)};n.handler=r,this.event[t].add(r)}else this.event[t].add(e);return n}},{key:"unsubscribe",value:function(t,e){this.event[t].remove(e.handler)}},{key:"findItem",value:function(t,e,n){var r=new I.Sgu(this.render.page2obj(t));return kf(this.render.ctab,r,e,n,this.render.options)}},{key:"findMerge",value:function(t,e){return Tf(this.render.ctab,t,e,this.render.options)}},{key:"explicitSelected",value:function(){var t=this.selection()||{},e=Jh.reduce((function(e,n){return e[n]=t[n]?t[n].slice():[],e}),{}),n=this.render.ctab.molecule;return e.bonds&&e.bonds.forEach((function(t){var r=n.bonds.get(t);e.atoms=e.atoms||[],e.atoms.indexOf(r.begin)<0&&e.atoms.push(r.begin),e.atoms.indexOf(r.end)<0&&e.atoms.push(r.end)})),e.atoms&&e.bonds&&n.bonds.forEach((function(t,n){e.bonds.indexOf(n)>=0&&e.atoms.indexOf(t.begin)>=0&&e.atoms.indexOf(t.end)>=0&&(e.bonds=e.bonds||[],e.bonds.push(n))})),e}},{key:"structSelected",value:function(){var t=this.render.ctab.molecule,e=this.explicitSelected(),n=t.clone(new I.UE_(e.atoms),new I.UE_(e.bonds),!0,null,new I.UE_(e.simpleObjects),new I.UE_(e.texts));return t.rxnArrows.forEach((function(t,r){-1!==e.rxnArrows.indexOf(r)&&n.rxnArrows.add(t.clone())})),t.rxnPluses.forEach((function(t,r){-1!==e.rxnPluses.indexOf(r)&&n.rxnPluses.add(t.clone())})),n.isReaction=t.isReaction&&t.isRxn(),n}},{key:"alignDescriptors",value:function(){this.selection(null);var t=(0,I.NZY)(this.render.ctab);this.update(t),this.render.update(!0)}}]),t}();function nd(t,e){t.render.setScrollOffset(0,0)}function rd(t,e){var n=t.getVBoxObj(e||{});return I.Sgu.lc2(n.p0,.5,n.p1,.5)}function od(t,e,n){if(-1===Xh.indexOf(t.map))return!1;var r=null;if("merge"===t.map)return Object.keys(t.items).forEach((function(o){t.items[o].forEach((function(t){(r=n.ctab[o].get(t))&&r.setHover(e,n)}))})),!0;if("functionalGroups"===t.map&&(t.map="sgroups"),!(r=n.ctab[t.map].get(t.id)))return!0;if("sgroups"===t.map&&"DAT"===r.item.type||"sgroupData"===t.map){var o=n.ctab.sgroups.get(t.id);o&&o.setHover(e,n);var i=n.ctab.sgroupData.get(t.id);i&&i.setHover(e,n)}else r.setHover(e,n);return!0}var id="StructEditor-module_visible__l4qPY",ad=function(){var t=Tl().getKetcherInstance,e=(0,N.useState)(!1),n=(0,U.Z)(e,2),i=n[0],a=n[1],s=(0,N.useState)([]),u=(0,U.Z)(s,2),c=u[0],l=u[1];return(0,o.jsxs)(vn,Object.assign({id:"contextmenu",onShow:function(e){return function(e){var n=t().editor,r=n.struct(),o=n.selection();a(!1),l([]);var i,s=[],u=n.findItem({pageX:e.detail.position.x,pageY:e.detail.position.y},["sgroups","functionalGroups","atoms","bonds"]);if(u)switch(u.map){case"atoms":null!==(i=I.J41.findFunctionalGroupByAtom(r.functionalGroups,u.id))&&r.functionalGroups.forEach((function(t){t.relatedSGroupId===i&&!s.includes(t)&&s.push(t)}));break;case"bonds":null!==(i=I.J41.findFunctionalGroupByBond(r,r.functionalGroups,u.id))&&r.functionalGroups.forEach((function(t){t.relatedSGroupId===i&&!s.includes(t)&&s.push(t)}));break;case"sgroups":var c=r.sgroups.get(u.id);I.J41.isFunctionalGroup(c)&&r.functionalGroups.forEach((function(t){t.relatedSGroupId===(null==c?void 0:c.id)&&!s.includes(t)&&s.push(t)}));break;case"functionalGroups":var f=r.sgroups.get(u.id);I.J41.isFunctionalGroup(f)&&r.functionalGroups.forEach((function(t){t.relatedSGroupId===(null==f?void 0:f.id)&&!s.includes(t)&&s.push(t)}))}o&&o.atoms&&o.atoms.forEach((function(t){var e=I.J41.findFunctionalGroupByAtom(r.functionalGroups,t);null!==e&&r.functionalGroups.forEach((function(t){t.relatedSGroupId===e&&!s.includes(t)&&s.push(t)}))})),s.length&&(l(s),a(!0))}(e)},className:F((0,r.Z)({},"ContextMenu-module_isHidden__rKY3u",!i))},{children:[(0,o.jsxs)(rn,Object.assign({onClick:function(){var e=t().editor,n=new I.aUM,r=c[0].isExpanded;null==c||c.forEach((function(t){n.mergeWith((0,I.wSe)(e.render.ctab,t.relatedSGroupId,{expanded:!r}))})),e.update(n),a(!1),l([])}},{children:[c.length&&c[0].isExpanded?"Contract ":"Expand ","Abbreviation"]}),void 0),(0,o.jsx)(rn,{divider:!0},void 0),(0,o.jsx)(rn,Object.assign({onClick:function(){var e=t().editor,n=new I.aUM;null==c||c.forEach((function(t){n.mergeWith((0,I.U9$)(e.render.ctab,t.relatedSGroupId))})),e.update(n),a(!1),l([])}},{children:"Remove Abbreviation"}),void 0)]}),void 0)},sd=["Tag","struct","tool","toolOpts","options","onInit","onSelectionChange","onElementEdit","onEnhancedStereoEdit","onQuickEdit","onBondEdit","onRgroupEdit","onSgroupEdit","onSdataEdit","onRemoveFG","onMessage","onAromatizeStruct","onDearomatizeStruct","onAttachEdit","indigoVerification","onCipChange","className"];function ud(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function cd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ud(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ud(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ld(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.struct,o=e.tool,i=e.toolOpts,a=e.options;r!==n.struct&&t.struct(r),o===n.tool&&i===n.toolOpts||(t.tool(o,i),i!==n.toolOpts&&t.event.message.dispatch({info:JSON.stringify(i)})),n.options&&a!==n.options&&t.options(a),Object.keys(t.event).forEach((function(r){var o="on".concat((0,V.upperFirst)(r));e[o]!==n[o]&&(n[o]&&t.event[r].remove(n[o]),e[o]&&t.event[r].add(e[o]))}))}var fd,hd,dd=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e;return(0,R.Z)(this,i),(e=r.call(this,t)).editorRef=(0,N.createRef)(),e.logRef=(0,N.createRef)(),e}return(0,M.Z)(i,[{key:"shouldComponentUpdate",value:function(t){return this.props.indigoVerification!==t.indigoVerification}},{key:"UNSAFE_componentWillReceiveProps",value:function(t){ld(this.editor,t,this.props)}},{key:"componentDidMount",value:function(){var t=this;this.editor=new ed(this.editorRef.current,cd({},this.props.options)),ld(this.editor,this.props),this.props.onInit&&this.props.onInit(this.editor),this.editor.event.message.add((function(e){var n=t.logRef.current;if(e.info){try{var r=JSON.parse(e.info);n.innerHTML="Atom Id: ".concat(r.atomid,", Bond Id: ").concat(r.bondid)}catch(t){n.innerHTML=e.info}n.classList.add(id)}else n.classList.remove(id)})),this.editor.event.message.dispatch({info:JSON.stringify(this.props.toolOpts)})}},{key:"componentWillUnmount",value:function(){var t,e;t=this.editor,e=this.props,Object.keys(t.event).forEach((function(n){var r="on".concat((0,V.upperFirst)(n));e[r]&&t.event[n].remove(e[r])}))}},{key:"render",value:function(){var t=this.props,e=t.Tag,n=void 0===e?"div":e;t.struct,t.tool,t.toolOpts,t.options,t.onInit,t.onSelectionChange,t.onElementEdit,t.onEnhancedStereoEdit,t.onQuickEdit,t.onBondEdit,t.onRgroupEdit,t.onSgroupEdit,t.onSdataEdit,t.onRemoveFG,t.onMessage,t.onAromatizeStruct,t.onDearomatizeStruct,t.onAttachEdit;var r=t.indigoVerification;t.onCipChange;var i=t.className,a=(0,B.Z)(t,sd);return(0,o.jsxs)(n,cd(cd({className:F("StructEditor-module_canvas__3PrVC",i),onMouseDown:function(t){return t.preventDefault()}},a),{},{children:[(0,o.jsxs)(wn,{id:"contextmenu",attributes:{onClick:$e},holdToDisplay:-1,children:[(0,o.jsx)("div",{ref:this.editorRef,className:F("StructEditor-module_intermediateCanvas__jP3l0"),onMouseDown:function(t){return t.preventDefault()}}),(0,o.jsx)("div",{className:"StructEditor-module_measureLog__3FnNR",ref:this.logRef}),r&&(0,o.jsx)("div",{className:"StructEditor-module_spinnerOverlay__Q8idX",children:(0,o.jsx)(Of,{})})]}),(0,o.jsx)(ad,{})]}))}}]),i}(N.Component);function pd(){return pd=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pd.apply(this,arguments)}function vd(t){return N.createElement("svg",pd({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2236.62 885.56"},t),fd||(fd=N.createElement("defs",null,N.createElement("linearGradient",{id:"logo_svg__linear-gradient",x1:732.63,y1:161.04,x2:427.29,y2:483.83,gradientUnits:"userSpaceOnUse"},N.createElement("stop",{offset:0,stopColor:"#3bc2d7"}),N.createElement("stop",{offset:.74,stopColor:"#1d9db1"})),N.createElement("clipPath",{id:"logo_svg__clip-path"},N.createElement("path",{d:"M58 179L339.06 16.7a115.52 115.52 0 01115.52 0L735.65 179a115.52 115.52 0 0157.76 100v324.57a115.52 115.52 0 01-57.76 100L454.57 865.89a115.52 115.52 0 01-115.52 0L58 703.62a115.52 115.52 0 01-57.76-100V279A115.52 115.52 0 0158 179z",fill:"none"})),N.createElement("style",null,".logo_svg__cls-3{fill:#676767}.logo_svg__cls-8{fill:#474648}"))),N.createElement("g",{style:{isolation:"isolate"}},hd||(hd=N.createElement("g",{id:"logo_svg__Layer_1","data-name":"Layer 1"},N.createElement("path",{className:"logo_svg__cls-3",d:"M498.45 698.74c-25.06-23.58-50.08-47.09-75.29-70.82-25.84-24.32-51.75-48.63-77.75-73.2V669q0 23.78.24 47.56c0 1.8-.24 3.33-.24 4.66v75.3c0 30.75 0 57.43.08 74.53l10.29 6c26.51 11.06 52.9 11.31 79.36 1.22l157.34-91.1c-13.23-12.04-51.48-48.34-94.03-88.43zM227.24 715.47v-40.25c.06-205.24.16-585.06.16-592.87v-.09L46.53 186.71c-31 21.68-46.45 52.51-46.45 92C.1 387.34.28 496 0 604.59c-.1 39.84 14.67 70.56 44.71 92.85l182.52 105.38V717.3c.02-.59.01-1.19.01-1.83z"}),N.createElement("path",{d:"M749.63 188.31L437.25 8c-26.48-10.67-53.66-10.71-81.85.42l-10 5.11s0 382.81 1.55 409.92c11.47-11.58 84.28-85.1 137.78-139.86q14.17-14.59 28.34-29.26c5.43-5.62 10.75-7.87 18.55-7.81-7.81-.06-13.12 2.21-18.55 7.82q-13.63 14.09-27.28 28.15c6.44-6.6 12.59-12.91 18.31-18.79 3-3.09 6-6 9-9.06 5.43-5.62 10.75-7.51 18.55-7.51h43.8q-21.89 0-43.78-.2 21.9.16 43.79.2H690.1c-.83 4-4.16 6.62-6.5 9-30.55 31.62-221.39 230.77-225 234.34 4.11-.26 234.95 232.77 240.4 235.58h.12l52.52-30.32c27.59-21.31 41.79-50.45 41.79-87.34V277.25c-.01-37.83-14.84-67.53-43.8-88.94z",fill:"url(#logo_svg__linear-gradient)"}),N.createElement("g",{clipPath:"url(#logo_svg__clip-path)"},N.createElement("path",{d:"M458.64 490.41v-.06c4.55-4.55 290.45-302.23 290.45-302.23l-109.34-63.33s-281.42 287-292.89 298.63c-1.52-27-1.64-407.12-1.64-409.9L227.45 82.27v.09c0 7.8-.21 715-.22 720.46l.09.05c0-26.48.13-26.48.11 0v-.05.05L345.22 871V554.72c26.07 24.57 234 220.36 247.26 232.87l106.54-61.51S462.75 490.14 458.64 490.41z",fill:"#ccc"})),N.createElement("path",{className:"logo_svg__cls-8",d:"M1118.72 604.25h-49.22L968.72 440.2v164.05h-42.18V276.14h42.18v159.37l91.4-159.37h49.22l-96.09 161.71zM1299.18 501.13h-121.87q0 23 3.75 38.2t11.48 24.37a42.83 42.83 0 0020.15 13.12q12.41 4 30.23 4h46.87v18.75a176.28 176.28 0 01-26.48 6.56 169 169 0 01-29.76 2.81q-26.26 0-45-5.86a64.57 64.57 0 01-30.7-19.92q-12-14.06-17.34-37.5t-5.39-58.59q0-35.15 5.16-58.59t15.47-37.5a56.23 56.23 0 0125.78-19.92q15.47-5.86 35.62-5.86t35.62 5.86a56.27 56.27 0 0125.78 19.94q10.3 14.06 15.47 37.5t5.16 58.59zM1257 473q0-23.91-3.28-39.61t-8.72-25.07q-5.4-9.37-12.66-13.36a31.12 31.12 0 00-30.47 0q-7.27 4-12.66 13.36t-8.67 25.08q-3.28 15.71-3.28 39.61zM1399.95 405v124.26q0 15.94 3 26t8 15.7a26.22 26.22 0 0010.78 7.73 32.59 32.59 0 0011 2.11h42.19v18.75a65.4 65.4 0 01-11 3.52q-6.8 1.65-14.06 3t-14.3 2.11q-7 .7-12.19.7a98.27 98.27 0 01-26-3.28 47.33 47.33 0 01-20.86-12q-8.91-8.67-13.83-24.14t-4.92-40.31V405h-28.12v-30.42h28.12v-56.25h42.19v56.25h65.62v21.09a176.28 176.28 0 01-26.48 6.56 169 169 0 01-29.76 2.81zM1594.47 393.33a59.66 59.66 0 00-23.2 4.22q-10.09 4.22-16.87 14.76t-10.31 28.59q-3.51 18-3.51 46.17t3.51 46.4q3.52 18.28 10.78 28.83a37.36 37.36 0 0018.28 14.53q11 4 26 4H1646v18.75a176.28 176.28 0 01-26.48 6.56 169 169 0 01-29.76 2.81q-23.91 0-41-5.86a60.8 60.8 0 01-28.36-19.92q-11.25-14.06-16.64-37.5t-5.39-58.59q0-35.15 5.39-58.59t16.17-37.5a58.55 58.55 0 0127-19.92q16.17-5.86 38.2-5.86a169.19 169.19 0 0129.76 2.81 177.32 177.32 0 0126.48 6.56v18.75zM1728.05 604.25h-42.18V276.14h42.18v100.78a131.72 131.72 0 0123.2-8.44 111.52 111.52 0 0128.36-3.28 115.33 115.33 0 0127.42 3 50.74 50.74 0 0121.56 11q9.14 8 14.06 21.56t4.92 34.69v168.8h-42.17V435.51q0-12.18-3.28-20.39a31.59 31.59 0 00-9.37-13.12 34.79 34.79 0 00-14.06-6.8 78.22 78.22 0 00-17.81-1.87 63.45 63.45 0 00-18.28 2.81q-9.38 2.81-14.53 6.56zM2063.19 501.13h-121.86q0 23 3.75 38.2t11.48 24.37a42.83 42.83 0 0020.15 13.12q12.41 4 30.23 4h46.87v18.75a176.28 176.28 0 01-26.48 6.56 169 169 0 01-29.76 2.81q-26.26 0-45-5.86a64.57 64.57 0 01-30.7-19.92q-12-14.06-17.34-37.5t-5.39-58.59q0-35.15 5.16-58.59t15.47-37.5a56.23 56.23 0 0125.78-19.92q15.47-5.86 35.62-5.86t35.62 5.86a56.27 56.27 0 0125.78 19.94q10.3 14.06 15.47 37.5t5.16 58.59zM2021 473q0-23.91-3.28-39.61t-8.67-25.08q-5.4-9.37-12.66-13.36a31.12 31.12 0 00-30.47 0q-7.27 4-12.66 13.36t-8.67 25.08q-3.28 15.71-3.28 39.61zM2156.93 604.25h-42.19V369.89h35.62l2.34 18.75h2.34q8.44-7 22.73-12.89t35.39-5.86h23.44V405h-46.87a71.27 71.27 0 00-17.34 2.11 44 44 0 00-15.47 7.26z"})))))}function md(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var gd=Mt((function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?md(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):md(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t.options.app)}))((function(t){var e=t.indigoVersion&&t.indigoVersion.split(".r");return(0,o.jsxs)(xf,{title:"About",className:"About-module_about__1a4h4",params:t,buttons:["Close"],children:[(0,o.jsx)("a",{href:"http://lifescience.opensource.epam.com/ketcher/",target:"_blank",rel:"noopener noreferrer",children:(0,o.jsx)(vd,{})}),(0,o.jsxs)("dl",{children:[(0,o.jsx)("dt",{children:(0,o.jsx)("a",{href:"http://lifescience.opensource.epam.com/ketcher/help.html",target:"_blank",rel:"noopener noreferrer",children:"Ketcher"})}),(0,o.jsxs)("dd",{children:["version",(0,o.jsx)("var",{children:t.version})]}),(0,o.jsxs)("dd",{children:["build at ",(0,o.jsx)("time",{children:t.buildDate})]}),t.indigoVersion?(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:(0,o.jsx)("a",{href:"http://lifescience.opensource.epam.com/indigo/",target:"_blank",rel:"noopener noreferrer",children:"Indigo Toolkit"})}),(0,o.jsxs)("dd",{children:["version",(0,o.jsx)("var",{children:e[0]})]}),(0,o.jsxs)("dd",{children:["build #",(0,o.jsx)("var",{children:e[1]})]})]}):(0,o.jsx)("dd",{children:"standalone"}),(0,o.jsx)("dt",{children:(0,o.jsx)("a",{href:"http://lifescience.opensource.epam.com/",target:"_blank",rel:"noopener noreferrer",children:"EPAM Life Sciences"})}),(0,o.jsx)("dd",{children:(0,o.jsx)("a",{href:"http://lifescience.opensource.epam.com/ketcher/#feedback",target:"_blank",rel:"noopener noreferrer",children:"Feedback"})})]})]})})),yd=["schema","value","onChange","type"],bd=["schema","value","onChange"],wd=["schema","value","onChange"],xd=["schema","value","selected","onSelect","type","checked"],Od=["children","onChange","style"],Ed=["children","onChange"];function _d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Sd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_d(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function jd(t){t.schema;var e=t.value,n=void 0===e?"":e,r=t.onChange,i=t.type,a=void 0===i?"text":i,s=(0,B.Z)(t,yd);return(0,o.jsx)("input",Sd({type:a,value:n,onInput:r,onChange:r},s))}function Ad(t){t.schema;var e=t.value,n=t.onChange,r=(0,B.Z)(t,bd);return(0,o.jsx)("textarea",Sd({value:e,onInput:n},r))}function Pd(t){t.schema;var e=t.value,n=void 0===e?"":e,r=t.onChange,i=(0,B.Z)(t,wd);return(0,o.jsx)("input",Sd({type:"checkbox",checked:n,onClick:r,onChange:r},i))}function kd(t){var e=t.schema,n=t.value,r=t.name,i=t.onSelect,a=t.className,s=t.multiple,u=void 0!==s&&s;return(0,o.jsx)("select",{onChange:i,value:n,name:r,multiple:u,className:a,children:Cd(e,(function(t,e){return(0,o.jsx)("option",{value:e,children:t},e)}))})}function Td(t){var e=t.schema,n=t.value,r=t.selected,i=t.onSelect,a=t.type,s=void 0===a?"radio":a,u=t.checked,c=(0,B.Z)(t,xd);return(0,o.jsx)("fieldset",{onClick:i,className:"radio",children:Cd(e,(function(t,e){return(0,o.jsx)("li",{className:"input-module_fieldSetItem__1B6Qg",children:(0,o.jsxs)("label",{className:"input-module_fieldSetLabel__3-etE",children:[(0,o.jsx)("input",Sd({type:s,defaultChecked:r(e,"radio"===s?u:n),value:"object"!==(0,G.Z)(e)&&e},c)),"checkbox"===s&&(0,o.jsx)("span",{className:"input-module_customCheckbox__1W2bW"}),t]})},t)}))})}function Cd(t,e){var n=Array.isArray(t);if(!n&&t.items&&(t=t.items),"function"==typeof e)return(n?t:t.enum).map((function(r,o){var i=n?r.title:t.enumNames&&t.enumNames[o];return e(void 0!==i?i:r,r&&void 0!==r.value?r.value:r)}));if(!n)return t.enum[e];var r=t[e];return void 0!==r.value?r.value:r}jd.val=function(t,e){var n=t.target,r="number"===n.type||"range"===n.type||e&&("number"===e.type||"integer"===e.type),o=r?n.value.replace(/,/g,"."):n.value;return r&&!isNaN(o-0)?o-0:o},Ad.val=function(t){return t.target.value},Pd.val=function(t){return t.stopPropagation(),!!t.target.checked},kd.val=function(t,e){var n=t.target;return n.multiple?[].reduce.call(n.options,(function(t,n,r){return n.selected?[Cd(e,r)].concat((0,ee.Z)(t)):t}),[]):Cd(e,n.selectedIndex)},Td.val=function(t,e){var n=t.target;if("INPUT"===t.target.tagName){var r=n.parentNode.parentNode.parentNode,o=[].reduce.call(r.querySelectorAll("input"),(function(t,n,r){return n.checked?[Cd(e,r)].concat((0,ee.Z)(t)):t}),[]);return"radio"===n.type?o[0]:o}t.stopPropagation()};var Rd=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e;(0,R.Z)(this,i);var n,o,a,s,u=(e=r.call(this,t)).props.component;return e.component=u||(o=(n=t).schema,a=n.type,s=n.multiple,o&&(o.enum||o.items||Array.isArray(o))?s||"array"===o.type?"checkbox"===a?Td:kd:"radio"===a?Td:kd:"checkbox"===a||o&&"boolean"===o.type?Pd:"textarea"===a?Ad:jd),e.ctrl=function(t,e){var n=e.schema,r=e.multiple,o=e.onChange;return n&&(n.enum||n.items||Array.isArray(n))&&"string"!==n.type?r||"array"===n.type?function(t,e,n){return{multiple:!0,selected:function(t,e){return e&&e.indexOf(t)>=0},onSelect:function(r,o){if(t.val){var i=t.val(r,e);void 0!==i&&n(i)}else{var a=o?o.indexOf(r):-1;n(a<0?o?[r].concat((0,ee.Z)(o)):[r]:[].concat((0,ee.Z)(o.slice(0,a)),(0,ee.Z)(o.slice(a+1))))}}}}(t,n,o):function(t,e,n){return{selected:function(t,e){return e===t},onSelect:function(r){var o=t.val?t.val(r,e):r;void 0!==o&&n(o)}}}(t,n,o):function(t,e,n){var r={};return e&&("number"!==e.type&&"integer"!==e.type||(r={type:"text"})),Sd({onChange:function(r){var o=t.val?t.val(r,e):r;n(o)}},r)}(t,n,o)}(e.component,t),e}return(0,M.Z)(i,[{key:"shouldComponentUpdate",value:function(t){t.children,t.onChange,t.style;var e=(0,B.Z)(t,Od);return function(t,e){for(var n in t)if(!(n in e))return!0;for(var r in e)if(t[r]!==e[r])return!0;return!1}((0,V.omit)(this.props,["children","onChange","style"]),e)}},{key:"render",value:function(){var t=this.props;t.children,t.onChange;var e=(0,B.Z)(t,Ed),n=this.component;return(0,o.jsx)(n,Sd(Sd({},this.ctrl),e))}}]),i}(N.Component),Md=["schema","result","customValid"],Id=["labelPos","title","children"],Nd=["name","onChange","component","labelPos"],Bd=["dataError"],Zd=["title","name","schema"];function Ld(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ld(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ld(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var zd=function(t){(0,Z.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function a(t){var e;(0,R.Z)(this,a);var n=(e=i.call(this,t)).props,r=n.onUpdate,o=n.schema,s=n.init;if(e.schema=Ud(o,t),s){var u=e.schema.serialize(s),c=u.valid,l=Yd(u.errors);r(Dd(Dd({},s),{},{init:!0}),c,l)}return e}return(0,M.Z)(a,[{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.schema,r=e.result;e.customValid;var o=(0,B.Z)(e,Md);n.key&&n.key!==t.schema.key&&(this.schema=Ud(n,o),this.schema.serialize(r),this.updateState(r))}},{key:"updateState",value:function(t){var e=this.props.onUpdate,n=this.schema.serialize(t);e(n.instance,n.valid,Yd(n.errors))}},{key:"field",value:function(t,e){var n=this.props,o=n.result,i=n.errors,a=o[t],s=this;return{dataError:i&&i[t],value:a,onChange:function(n){var o=Object.assign({},s.props.result,(0,r.Z)({},t,n));s.updateState(o),e&&e(n)}}}},{key:"render",value:function(){var t=this.props,e=t.schema,n=t.children;return(0,o.jsx)("form",{children:(0,o.jsx)(cr.Provider,{value:{schema:e,stateStore:this},children:n})})}}]),a}(N.Component),Fd=Mt(null,(function(t){return{onUpdate:function(e,n,r){t(no({result:e,valid:n,errors:r}))}}}))(zd);function Gd(t){var e=t.labelPos,n=t.title,r=t.children,i=(0,B.Z)(t,Id);return(0,o.jsxs)("label",Dd(Dd({},i),{},{children:[n&&"after"!==e?"".concat(n,":"):"",r,n&&"after"===e?n:""]}))}function Hd(t){var e=t.name,n=t.onChange,i=t.component,a=t.labelPos,s=(0,B.Z)(t,Nd),u=kl(),c=u.schema,l=u.stateStore,f=s.schema||c.properties[e],h=l.field(e,n),d=h.dataError,p=(0,B.Z)(h,Bd),v=i,m=i?(0,o.jsx)(v,Dd(Dd({name:e,schema:f},p),s)):(0,o.jsx)(Rd,Dd(Dd({name:e,schema:f},p),s));return!1===a?m:(0,o.jsx)(Gd,{className:F((0,r.Z)({},"form-module_dataError__3okY_",d)),error:d,title:s.title||f.title,labelPos:a,children:m})}var Vd=function(t){var e=t.title,n=t.name,r=t.schema,i=(0,B.Z)(t,Zd),a={title:e,enum:[],enumNames:[]};return Object.keys(r).forEach((function(t){a.enum.push(t),a.enumNames.push(r[t].title||t)})),(0,o.jsx)(Hd,Dd({name:n,schema:a},i))};function Ud(t,e){var n=e.customValid,r=e.serialize,o=void 0===r?{}:r,i=e.deserialize,a=void 0===i?{}:i,s=new H.Validator;return n&&((t=Object.assign({},t)).properties=Object.keys(n).reduce((function(t,e){return s.customFormats[e]=n[e],t[e]=Dd({format:e},t[e]),t}),t.properties)),{key:t.key||"",serialize:function(e){return s.validate(e,t,{rewrite:qd.bind(null,o)})},deserialize:function(e){return s.validate(e,t,{rewrite:Wd.bind(null,a)})}}}function qd(t,e,n){var r={};return"object"===(0,G.Z)(e)&&n.properties?(Object.keys(n.properties).forEach((function(n){n in e&&(r[n]=e[t[n]]||e[n])})),r):void 0!==e?e:n.default}function Wd(t,e){return e}function Yd(t){var e,n={};return t.forEach((function(t){e=t.property.split(".")[1],n[e]||(n[e]=function(t){return t.schema.invalidMessage?"function"==typeof t.schema.invalidMessage?t.schema.invalidMessage(t.instance):t.schema.invalidMessage:t.message}(t))})),n}var $d=["children"];var Kd=function(t){(0,Z.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function a(t){var e;return(0,R.Z)(this,a),(e=i.call(this,t)).state={active:t.active||[]},e}return(0,M.Z)(a,[{key:"onActive",value:function(t){var e=this.props.multiple;void 0===e||e?this.setState((function(e){return{active:(0,V.xor)(e.active,[t])}})):this.setState({active:[t]})}},{key:"groupIsActive",value:function(t){return this.state.active.includes(t)}},{key:"render",value:function(){var t=this,e=this.props;e.children;var n=(0,B.Z)(e,$d),r=N.Children.map(this.props.children,(function(e,n){var r={isActive:t.groupIsActive.bind(t),onActive:t.onActive.bind(t),index:n};return N.isValidElement(e)?N.cloneElement(e,r):e}));return(0,o.jsx)("ul",Object.assign({},n,{children:r}),void 0)}}],[{key:"Group",value:function(t){var e=t.caption,n=t.isActive,i=t.onActive,a=t.index,s=t.children;return(0,o.jsxs)("li",Object.assign({className:F("Accordion-module_accordion_tab__2QnRN",(0,r.Z)({},"Accordion-module_hidden__1uz3S",!n(a)))},{children:[(0,o.jsx)("a",Object.assign({onClick:function(){return i(a)}},{children:e}),void 0),s]}),void 0)}}]),a}(N.Component),Jd=function(t){var e=(0,N.useState)(!1),n=(0,U.Z)(e,2),r=n[0],i=n[1],a=t.onChange,s=t.value,u=(0,N.useCallback)((function(t){a(t)}),[a]);return(0,o.jsxs)("div",Object.assign({className:"ColorPicker-module_colorPickerInput__2GTGr"},{children:[(0,o.jsxs)("div",Object.assign({className:"ColorPicker-module_colorPickerBtn__MP1x2",onClick:function(){i((function(t){return!t}))},"data-testid":"color-picker-btn"},{children:[t.value,(0,o.jsx)("span",{className:"ColorPicker-module_colorPickerPreview__30h0H","data-testid":"color-picker-preview",style:{backgroundColor:s}},void 0)]}),void 0),(0,o.jsx)("div",Object.assign({className:"ColorPicker-module_colorPickerWrap__x9LyI"},{children:r?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"ColorPicker-module_colorPickerOverlay__3w0lD",onClick:function(){i(!1)},"data-testid":"color-picker-overlay"},void 0),(0,o.jsxs)("div",Object.assign({className:"ColorPicker-module_colorPicker__3Po9u"},{children:[(0,o.jsx)(Hn,{color:s,onChange:u},void 0),(0,o.jsx)(Wn,{"data-testid":"color-picker-input",color:s,onChange:u},void 0)]}),void 0)]},void 0):null}),void 0)]}),void 0)},Xd=["schema","value","onChange"];function Qd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function tp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qd(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ep=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e;return(0,R.Z)(this,i),(e=r.call(this,t)).state={cust:t.value||t.schema.default,meas:"px"},e.calcValue=e.calcValue.bind((0,q.Z)(e)),e.handleChange=e.handleChange.bind((0,q.Z)(e)),e.handleMeasChange=e.handleMeasChange.bind((0,q.Z)(e)),e}return(0,M.Z)(i,[{key:"handleChange",value:function(t){var e=rp(t,this.state.meas,"px");this.state.cust=t,this.props.onChange(e)}},{key:"handleMeasChange",value:function(t){this.setState((function(e){return{meas:t,cust:rp(e.cust,e.meas,t)}}))}},{key:"calcValue",value:function(){var t=this;this.setState((function(e){return{cust:rp(t.props.value,"px",e.meas)}}))}},{key:"render",value:function(){var t=this.state,e=t.meas,n=t.cust,r=this.props,i=r.schema,a=r.value;r.onChange;var s=(0,B.Z)(r,Xd);return"px"===e&&n.toFixed()-0!==a&&this.setState({meas:"px",cust:a}),(0,o.jsxs)("div",tp(tp({style:{display:"inline-flex"}},s),{},{children:[(0,o.jsx)(Rd,{schema:i,step:"px"===e||"pt"===e?"1":"0.001",style:{width:"75%"},value:n,onChange:this.handleChange,onBlur:this.calcValue}),(0,o.jsx)(Rd,{schema:{enum:["cm","px","pt","inch"]},style:{width:"25%"},value:e,onChange:this.handleMeasChange})]}))}}]),i}(N.Component),np={px:1,cm:37.795278,pt:1.333333,inch:96};function rp(t,e,n){return!t&&0!==t||isNaN(t)?null:"px"===n||"pt"===n?(t*np[e]/np[n]).toFixed()-0:(t*np[e]/np[n]).toFixed(3)-0}var op=["children","type","server"];function ip(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ap(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ip(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ip(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var sp=function(t){(0,Z.Z)(a,t);var e,r,i=(e=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,D.Z)(e);if(r){var o=(0,D.Z)(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return(0,L.Z)(this,t)});function a(t){var e;return(0,R.Z)(this,a),(e=i.call(this,t)).state={},t.server&&function(t){return new Promise((function(e,r){if(n.g.FileReader)e(up);else if(n.g.ActiveXObject)try{var o=new ActiveXObject("Scripting.FileSystemObject");e((function(t){return Promise.resolve(function(t,e){var n=t.OpenTextFile(e.name,1),r=n.ReadAll();return n.Close(),r}(o,t))}))}catch(t){r(t)}else t?e(t.then((function(){throw Error("Server doesn't still support echo method")}))):r(new Error("Your browser does not support opening files locally"))}))}(t.server).then((function(t){e.setState({opener:t})})),e}return(0,M.Z)(a,[{key:"open",value:function(t){var e=t.target.files,n=function(){return null},r=this.props,o=r.onLoad,i=void 0===o?n:o,a=r.onError,s=void 0===a?n:a;this.state.opener&&e.length?this.state.opener(e[0]).then(i,s):e.length&&i(e[0]),t.target.value=null,t.preventDefault()}},{key:"render",value:function(){var t=this,e=this.props,n=e.children,r=e.type;e.server;var i=(0,B.Z)(e,op);return(0,o.jsxs)("button",ap(ap({onClick:function(){return t.btn.click()},className:"buttons-module_openButton___L4I1"},i),{},{children:[(0,o.jsx)("input",{onChange:function(e){return t.open(e)},accept:r,type:"file",ref:function(e){t.btn=e}}),n]}))}}]),a}(N.Component);function up(t){return new Promise((function(e,n){var r=new FileReader;r.onload=function(){var n=r.result;t.msClose&&t.msClose(),e(n)},r.onerror=function(t){n(t)},r.readAsText(t,"UTF-8")}))}function cp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?cp(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var fp=function(t){var e=function(){return null},n=t.server,r=t.filename,i=void 0===r?"unnamed":r,a=t.outputFormat,s=t.data,u=t.type,c=t.mode,l=void 0===c?"saveFile":c,f=t.onSave,h=void 0===f?e:f,d=t.onError,p=void 0===d?e:d,v=Tl().getKetcherInstance;return(0,o.jsx)("button",lp(lp({onClick:function(t){!function(t){t.preventDefault(),"saveImage"===l?v().generateImage(s,{outputFormat:a}).then((function(t){(0,Yn.saveAs)(t,"".concat(i,".").concat(a)),h()})).catch((function(t){p(t)})):function(){if(s)try{hp(n).then((function(t){t(s,i,u),h()}))}catch(t){p(t)}}()}(t)}},t),{},{children:t.children}))},hp=function(t){return new Promise((function(e,r){n.g.Blob&&Yn.saveAs?e((function(t,e,n){var r=new Blob([t],{type:n});(0,Yn.saveAs)(r,e)})):t?e(t.then((function(){throw Error("Server doesn't still support echo method")}))):r(new Error("Your browser does not support opening files locally"))}))},dp=["schema"];function pp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vp(t){var e=t.schema,n=(0,B.Z)(t,dp),i=e;return"boolean"===e.type&&(i={title:e.title,enum:[!0,!1],enumNames:["on","off"],default:e.default}),(0,o.jsx)(Rd,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pp(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({schema:i},n))}var mp=["Arial","Arial Black","Comic Sans MS","Courier New","Georgia","Impact","Charcoal","Lucida Console","Monaco","Palatino Linotype","Book Antiqua","Palatino","Tahoma","Geneva","Times New Roman","Times","Verdana","Symbol","MS Serif","MS Sans Serif","New York","Droid Sans","Droid Serif","Droid Sans Mono","Roboto"];function gp(t){var e=(0,N.useState)(null),n=(0,U.Z)(e,2),r=n[0],i=n[1],a=t.value,s=t.onChange,u=(0,N.useCallback)((function(t){s(t.target.value)}),[s]);return(0,N.useEffect)((function(){var t,e=!0;return(t=mp.map((function(t){return new(Kn())(t).check().then((function(){return t}),(function(){return null}))})),Promise.all(t)).then((function(t){var n=t.filter((function(t){return null!==t})).map((function(t){return{value:"30px ".concat(t),label:t}}));e&&i(n)})),function(){return e=!1}}),[]),(0,o.jsx)("select",{disabled:null==r,value:a,onChange:u,children:null==r?void 0:r.map((function(t){var e=t.value,n=t.label;return(0,o.jsx)("option",{value:e,children:n},e)}))})}var yp=["initState","formState","server","onOpenFile","onReset","appOpts"],bp=Mt((function(t){return{server:t.options.app.server?t.server:null,appOpts:t.options.app,initState:t.options.settings,formState:t.modal.form}}),(function(t,e){return{onOpenFile:function(e){try{t(no({result:JSON.parse(e)}))}catch(t){}},onReset:function(){return t({type:"UPDATE_FORM",data:{result:Cr(),valid:!0,errors:{}}})},onOk:function(n){var r;t((Nr("ketcher-opts",r=n),{type:"SAVE_SETTINGS",data:r})),e.onOk(n)}}}))((function(t){var e=t.initState,n=t.formState,r=t.server,i=t.onOpenFile,a=t.onReset,s=t.appOpts,u=(0,B.Z)(t,yp);return(0,o.jsx)(xf,Object.assign({title:"Settings",className:"Settings-module_settings__1BBve",result:function(){return n.result},valid:function(){return n.valid},params:u,buttons:[(0,o.jsx)(sp,Object.assign({server:r,onLoad:i},{children:"Open From File…"}),"settings"),(0,o.jsx)(fp,Object.assign({data:JSON.stringify(n.result),filename:"ketcher-settings"},{children:"Save To File…"}),"ketcher-settings"),(0,o.jsx)("button",Object.assign({onClick:a},{children:"Reset"}),"settings-button"),"Cancel","OK"]},{children:(0,o.jsxs)(Fd,Object.assign({schema:Tr,init:e},n,{children:[(0,o.jsxs)(Kd,Object.assign({className:"Settings-module_accordion__3Z9nL",multiple:!1,active:[0]},{children:[(0,o.jsx)(Kd.Group,Object.assign({caption:"General"},{children:(0,o.jsxs)("fieldset",Object.assign({className:"Settings-module_general__3cmXi"},{children:[(0,o.jsx)(Hd,{name:"resetToSelect"},void 0),(0,o.jsx)(Hd,{name:"rotationStep"},void 0),(0,o.jsx)(Hd,{name:"showValenceWarnings",component:vp},void 0),(0,o.jsx)(Hd,{name:"atomColoring",component:vp},void 0),(0,o.jsx)(Hd,{name:"font",component:gp},void 0),(0,o.jsx)(Hd,{name:"fontsz",component:ep},void 0),(0,o.jsx)(Hd,{name:"fontszsub",component:ep},void 0)]}),void 0)}),void 0),(0,o.jsx)(Kd.Group,Object.assign({caption:"Stereochemistry"},{children:(0,o.jsxs)("fieldset",Object.assign({className:"Settings-module_stereochemistry__Ce-bh"},{children:[(0,o.jsx)(Hd,{name:"showStereoFlags",component:vp},void 0),(0,o.jsx)(Hd,{name:"stereoLabelStyle"},void 0),(0,o.jsx)(Hd,{name:"colorOfAbsoluteCenters",component:Jd},void 0),(0,o.jsx)(Hd,{name:"colorOfAndCenters",component:Jd},void 0),(0,o.jsx)(Hd,{name:"colorOfOrCenters",component:Jd},void 0),(0,o.jsx)(Hd,{name:"colorStereogenicCenters"},void 0),(0,o.jsx)(Hd,{name:"autoFadeOfStereoLabels",component:vp},void 0),(0,o.jsx)(Hd,{name:"absFlagLabel"},void 0),(0,o.jsx)(Hd,{name:"andFlagLabel"},void 0),(0,o.jsx)(Hd,{name:"orFlagLabel"},void 0),(0,o.jsx)(Hd,{name:"mixedFlagLabel"},void 0)]}),void 0)}),void 0),(0,o.jsx)(Kd.Group,Object.assign({caption:"Atoms"},{children:(0,o.jsxs)("fieldset",{children:[(0,o.jsx)(Hd,{name:"carbonExplicitly",component:vp},void 0),(0,o.jsx)(Hd,{name:"showCharge",component:vp},void 0),(0,o.jsx)(Hd,{name:"showValence",component:vp},void 0),(0,o.jsx)(Hd,{name:"showHydrogenLabels",component:vp},void 0)]},void 0)}),void 0),(0,o.jsx)(Kd.Group,Object.assign({caption:"Bonds"},{children:(0,o.jsxs)("fieldset",{children:[(0,o.jsx)(Hd,{name:"aromaticCircle",component:vp},void 0),(0,o.jsx)(Hd,{name:"doubleBondWidth",component:ep},void 0),(0,o.jsx)(Hd,{name:"bondThickness",component:ep},void 0),(0,o.jsx)(Hd,{name:"stereoBondWidth",component:ep},void 0)]},void 0)}),void 0),(0,o.jsx)(Kd.Group,Object.assign({caption:"Server"},{children:(0,o.jsxs)("fieldset",Object.assign({className:"Settings-module_server__2nYEf",disabled:!s.server},{children:[(0,o.jsx)(Hd,{name:"smart-layout",component:vp},void 0),(0,o.jsx)(Hd,{name:"ignore-stereochemistry-errors",component:vp},void 0),(0,o.jsx)(Hd,{name:"mass-skip-error-on-pseudoatoms",component:vp},void 0),(0,o.jsx)(Hd,{name:"gross-formula-add-rsites",component:vp},void 0),(0,o.jsx)(Hd,{name:"gross-formula-add-isotopes",component:vp},void 0)]}),void 0)}),void 0),(0,o.jsx)(Kd.Group,Object.assign({caption:"3D Viewer"},{children:(0,o.jsxs)("fieldset",Object.assign({className:"Settings-module_viewer__2AqMZ",disabled:!window.Miew},{children:[(0,o.jsx)(Hd,{name:"miewMode"},void 0),(0,o.jsx)(Hd,{name:"miewTheme"},void 0),(0,o.jsx)(Hd,{name:"miewAtomLabel"},void 0)]}),void 0)}),void 0),(0,o.jsx)(Kd.Group,Object.assign({caption:"Options for debugging"},{children:(0,o.jsxs)("fieldset",{children:[(0,o.jsx)(Hd,{name:"showAtomIds",component:vp},void 0),(0,o.jsx)(Hd,{name:"showBondIds",component:vp},void 0),(0,o.jsx)(Hd,{name:"showHalfBondIds",component:vp},void 0),(0,o.jsx)(Hd,{name:"showLoopIds",component:vp},void 0)]},void 0)}),void 0)]}),void 0),Mr()?null:(0,o.jsx)("div",Object.assign({className:"Settings-module_warning__j904H"},{children:Rr}),void 0)]}),void 0)}),void 0)}));function wp(t){var e=t.moleculeErrors,n=t.checkSchema,r=Object.keys(e);return(0,o.jsx)("fieldset",{children:0===r.length?(0,o.jsx)("dt",{children:"No errors found"}):r.map((function(t){return(0,o.jsxs)("div",{children:[(0,o.jsxs)("dt",{children:[(r=t,i=n.properties.checkOptions.items,a=i.enum.indexOf(r),i.enumNames[a])," warning:"]}),(0,o.jsx)("dd",{children:e[t]})]});var r,i,a}))})}function xp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Op(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xp(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ep=function(t){(0,Z.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function a(t){var e;return(0,R.Z)(this,a),(e=i.call(this,t)).state={},e.state.tabIndex=t.tabIndex||0,e.props.changeTab(e.state.tabIndex),e}return(0,M.Z)(a,[{key:"changeTab",value:function(t,e){this.setState({tabIndex:e}),this.props.changeTab&&this.props.changeTab(e)}},{key:"render",value:function(){var t=this,e=this.props,n=e.tabs,i=e.contentClassName,a=e.className,s=e.tabIndex,u=n[this.state.tabIndex],c=null==u?void 0:u.component,l=null==u?void 0:u.props;return(0,o.jsxs)("div",{children:[(0,o.jsx)("ul",{className:a,tabIndex:s,children:(0,o.jsx)("li",{className:"Tabs-module_tabs__1z9yo",children:n.map((function(e,n){return(0,o.jsx)("a",{className:F((0,r.Z)({},"Tabs-module_active__1c5a4",t.state.tabIndex===n)),onClick:function(e){return t.changeTab(e,n)},children:e.caption},n)}))})}),u&&(0,o.jsx)("div",{className:i,children:(0,o.jsx)(c,Op({},l))})]})}}]),a}(N.Component),_p=["formState","checkState","onCheck"];function Sp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Sp(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ap={title:"Check",type:"object",properties:{checkOptions:{type:"array",items:{type:"string",enum:["valence","radicals","pseudoatoms","stereo","query","overlapping_atoms","overlapping_bonds","rgroups","chiral","3d","chiral_flag"],enumNames:["Valence","Radical","Pseudoatom","Stereochemistry","Query","Overlapping Atoms","Overlapping Bonds","R-Groups","Chirality","3D Structure","Chiral flag"]}}}},Pp=Mt((function(t){return{formState:t.modal.form,checkState:t.options.check}}),(function(t,e){return{onCheck:function(n){return t(Do(n)).catch(e.onCancel)},onOk:function(n){t({type:"SAVE_CHECK_OPTS",data:n}),e.onOk(n)}}}))((function(t){var e=t.formState,n=t.checkState,r=t.onCheck,i=(0,B.Z)(t,_p),a=e.result,s=void 0===a?n:a,u=e.moleculeErrors,c=[{caption:"Check",component:wp,props:{moleculeErrors:u,checkSchema:Ap}},{caption:"Settings",component:Hd,props:{name:"checkOptions",multiple:!0,type:"checkbox",labelPos:!1}}];return(0,o.jsx)(xf,{title:"Structure Check",className:"Check-module_check__26L3I",result:function(){return s},params:i,children:(0,o.jsx)(Fd,jp(jp({schema:Ap,init:n},e),{},{children:(0,o.jsxs)(Ep,{className:"Check-module_tabs__3el-i",captions:c,changeTab:function(t){return 0===t?r(s.checkOptions):null},tabs:c,children:[(0,o.jsx)(wp,{moleculeErrors:u,checkSchema:Ap}),(0,o.jsx)(Hd,{name:"checkOptions",multiple:!0,type:"checkbox",labelPos:!1})]})}))})})),kp=/\b(\d*)([A-Z][a-z]{0,3}#?)(\d*)\s*\b/g,Tp=/error:.*/g;function Cp(t){return(0,o.jsx)("div",{className:"FormulaInput-module_chem_input__1ip3S",onKeyPress:function(t){return t.preventDefault()},onPaste:function(t){return t.preventDefault()},onKeyDown:function(t){if(8===t.keyCode)return t.preventDefault(),!1},contentEditable:!0,suppressContentEditableWarning:!0,children:t})}function Rp(t){var e=t.value;if(Tp.test(e))return Cp(e);for(var n,r=[],i=0;null!==(n=kp.exec(e));)n[1].length>0&&r.push((0,o.jsx)("sup",{children:n[1]},r.length)),r.push(e.substring(i,n.index)+n[2]),n[3].length>0&&r.push((0,o.jsx)("sub",{children:n[3]},r.length)),i=n.index+n[0].length;return 0===i?r.push(e):r.push(e.substring(i,e.length)),Cp(r)}function Mp(t){var e=t.value;return(0,o.jsx)("input",{type:"text",spellCheck:!1,value:e,onChange:function(t){return t.preventDefault()}})}var Ip=["values","round","loading","onAnalyse","onChangeRound"];function Np(t,e){return"number"==typeof t?t.toFixed(e):t.replace(/[0-9]*\.[0-9]+/g,(function(t){return(+t).toFixed(e)}))}var Bp=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){return(0,R.Z)(this,i),r.call(this,t)}return(0,M.Z)(i,[{key:"componentDidMount",value:function(){this.props.onAnalyse()}},{key:"render",value:function(){var t=this.props,e=t.values,n=t.round,r=t.loading;t.onAnalyse;var i=t.onChangeRound,a=(0,B.Z)(t,Ip);return(0,o.jsx)(xf,{title:"Calculated Values",className:"Analyse-module_analyse__1aHI_",buttons:["Close"],params:a,children:(0,o.jsx)("ul",{children:[{name:"Chemical Formula",key:"gross",withSelector:!1},{name:"Molecular Weight",key:"molecular-weight",round:"roundWeight",withSelector:!0},{name:"Exact Mass",key:"monoisotopic-mass",round:"roundMass",withSelector:!0},{name:"Elemental Analysis",key:"mass-composition",round:"roundElAnalysis",withSelector:!1}].map((function(t){return(0,o.jsxs)("li",{children:[(0,o.jsxs)("label",{children:[t.name,":"]}),"gross"===t.key?(0,o.jsx)(Rp,{value:e&&!r?e[t.key]:""}):(0,o.jsx)(Mp,{value:e&&!r?Np(e[t.key],n[t.round]):0}),t.withSelector?(0,o.jsx)(Rd,{schema:{enum:(0,V.range)(0,8),enumNames:(0,V.range)(0,8).map((function(t){return"".concat(t," decimal places")}))},value:n[t.round],onChange:function(e){return i(t.round,e)}}):null]},t.key)}))})})}}]),i}(N.Component);(0,r.Z)(Bp,"contextType",sr);var Zp=Mt((function(t){return{values:t.options.analyse.values,loading:t.options.analyse.loading,round:{roundWeight:t.options.analyse.roundWeight,roundMass:t.options.analyse.roundMass,roundElAnalysis:t.options.analyse.roundElAnalysis}}}),(function(t){return{onAnalyse:function(){return t((function(t,e){t({type:"ANALYSE_LOADING"});var n=e(),r=n.editor,o=n.server,i=n.options.getServerSettings();return i.data={properties:["molecular-weight","most-abundant-mass","monoisotopic-mass","gross","mass-composition"]},Fo(r,o,"calculate",i).then((function(e){return t({type:"CHANGE_ANALYSE",data:{values:e}})})).catch((function(t){r.errorHandler(t)}))}))},onChangeRound:function(e,n){return t(function(t,e){return{type:"CHANGE_ANALYSE",data:(0,r.Z)({},t,e)}}(e,n))}}}))(Bp);function Lp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dp(t){var e=(0,et.Z)({},t);return(0,o.jsx)("div",function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lp(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({className:"spin-module_ketSpinner__2jeLy"},e))}var zp=["struct","Tag"];function Fp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fp(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Hp=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e;return(0,R.Z)(this,i),(e=r.call(this,t)).tagRef=(0,N.createRef)(),e}return(0,M.Z)(i,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentDidMount",value:function(){var t,e=this.tagRef.current,n=this.props,r=n.struct,o=n.options;if(r instanceof I.AUF)t=r;else try{t=(new I.jWx).deserialize(r)}catch(e){t=null}!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t)if(null!=e&&e.prerender)t.innerHTML=e.prerender;else if(e){var r=new I.Hrh(t,Gp({autoScale:!0},n));r.setMolecule(e),r.update()}}(e,t,o)}},{key:"render",value:function(){var t=this.props,e=t.struct,n=t.Tag,r=void 0===n?"div":n,i=(0,B.Z)(t,zp);return(0,o.jsx)(r,Gp(Gp({ref:this.tagRef},i),{},{children:e?null:"No molecule"}))}}]),i}(N.Component),Vp=["file","structStr","fragment","version","imagoVersions"],Up=["onRecognize","isFragment","onImage","onChangeImago"];function qp(t){var e;return null==t||null===(e=t.type)||void 0===e?void 0:e.includes("image")}function Wp(t){if(!t)return null;var e=window.URL||window.webkitURL;return e?e.createObjectURL(t):"No preview"}var Yp=Mt((function(t){return{imagoVersions:t.options.app.imagoVersions,file:t.options.recognize.file,structStr:t.options.recognize.structStr,fragment:t.options.recognize.fragment,version:t.options.recognize.version||t.options.app.imagoVersions[0]}}),(function(t){return{isFragment:function(e){return t({type:"IS_FRAGMENT_RECOGNIZE",data:{fragment:e}})},onImage:function(e){return t(function(t){return{type:"CHANGE_RECOGNIZE_FILE",data:{file:t,structStr:null}}}(e))},onRecognize:function(e,n){return t(function(t,e){return function(n,r){var o=r().server.recognize,i=r().editor,a=o(t,e).then((function(t){n(Fr(t.struct))}),(function(t){n(Fr(null)),i.errorHandler(t)}));n(Fr(a))}}(e,n))},onChangeImago:function(e){return t({type:"CHANGE_IMAGO_VERSION",data:{version:e}})},onOk:function(e){t(Lo(e.structStr,{rescale:!0,fragment:e.fragment}))}}}))((function(t){var e=t.file,n=t.structStr,r=t.fragment,i=t.version,a=t.imagoVersions,s=(0,B.Z)(t,Vp),u=s.onRecognize,c=s.isFragment,l=s.onImage,f=s.onChangeImago,h=(0,B.Z)(s,Up),d=(0,N.useState)(!0),p=(0,U.Z)(d,2),v=p[0],m=p[1],g=(0,N.useCallback)((function(){return l(null),!0}),[l]);return(0,o.jsxs)(xf,{title:"Import From Image",className:"Recognize-module_recognize__rQrHd",params:h,result:function(){return!n||n instanceof Promise?null:{structStr:n,fragment:r}},buttons:[(0,o.jsx)(sp,{onLoad:l,type:"image/*",children:"Choose file…"},"choose"),(0,o.jsx)("span",{className:"Recognize-module_open_filename__2xNsW",children:e?e.name:null},"open-file"),e&&(0,o.jsx)("button",{onClick:function(){return u(e,i)},disabled:n&&"string"!=typeof n,children:"Recognize"},"recognize"),"Cancel","OK"],children:[(0,o.jsxs)("label",{className:"Recognize-module_change_version__1o76l",children:["Imago version:",(0,o.jsx)(Rd,{schema:{enum:a,enumNames:(0,V.range)(1,a.length+1).map((function(t){return"Version ".concat(t)}))},value:i,onChange:f})]}),(0,o.jsxs)("div",{className:"Recognize-module_picture__2xXV-",children:[e&&qp(e)&&v&&(0,o.jsx)("img",{alt:"",id:"pic",src:Wp(e)||"",onError:function(){m(!1)}}),e&&qp(e)&&!v&&(0,o.jsxs)("div",{children:["Preview of '",e.type,"' MIME type does not supported by current browser"]}),(!e||!qp(e)&&g())&&(0,o.jsx)("div",{children:"Please choose image"})]}),(0,o.jsx)("div",{className:"Recognize-module_output__1FWiN",children:n&&(n instanceof Promise||"string"!=typeof n?(0,o.jsx)(Dp,{}):(0,o.jsx)(Hp,{className:"Recognize-module_struct__3xGZ9",struct:n}))}),(0,o.jsxs)("label",{children:[(0,o.jsx)(Rd,{type:"checkbox",value:r,onChange:c}),"Load as a fragment"]})]})})),$p=["miewOpts","server","struct"];var Kp={dark:"0x202020",light:"0xcccccc"},Jp={no:null,bright:{colorer:"EL"},blackAndWhite:{colorer:["UN",{color:16777215}],bg:"0x000"},black:{colorer:["UN",{color:0}]}};var Xp=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(){return(0,R.Z)(this,i),r.apply(this,arguments)}return(0,M.Z)(i,[{key:"componentDidMount",value:function(){var t=this,e=this.props,n=e.struct,r=e.server,o=e.miewOpts,i=window.Miew;this.viewer=new i({container:this.miewContainer}),this.viewer.init()&&this.viewer.run(),new I.Yyn(r).create("cml").getStructureFromStructAsync(n).then((function(e){return t.viewer.load(e,{sourceType:"immediate",fileType:"cml"})})).then((function(){return t.viewer.setOptions(o)})).catch((function(t){}))}},{key:"exportCML",value:function(){var t=this.viewer.exportCML();t&&this.props.onExportCML(t)}},{key:"render",value:function(){var t=this,e=this.props;e.miewOpts,e.server,e.struct;var n=(0,B.Z)(e,$p);return(0,o.jsx)(xf,{title:"Miew",params:n,buttons:[(0,o.jsx)("div",{className:"Miew-module_warning__3D24r",children:"Stereocenters can be changed after the strong 3D rotation"},"warning"),"Close",(0,o.jsx)("button",{onClick:function(){return t.exportCML()},children:"Apply"},"apply")],children:(0,o.jsx)("div",{className:"Miew-module_dialog_body__2nm4k",children:(0,o.jsx)("div",{ref:function(e){t.miewContainer=e},className:"Miew-module_miewContainer__27GNL",style:{width:"1024px",height:"600px",position:"relative"}})})})}}]),i}(N.Component),Qp=Mt((function(t){return{miewOpts:(e=(0,V.pick)(kr,t.options.settings),n={settings:{bg:{color:Number(Kp[e.miewTheme])},autoPreset:!1,editing:!0,inversePanning:!0},reps:[{mode:e.miewMode}]},r=function(t){var e=t.miewAtomLabel;return null===Jp[e]?null:{colorer:Jp[e].colorer,selector:"not elem C",mode:["TX",{bg:Jp[e].bg||Kp[t.miewTheme],showBg:!0,template:"{{elem}}"}]}}(e),r&&n.reps.push(r),n),server:t.options.app.server?t.server:null,struct:t.editor.struct()};var e,n,r}),(function(t){return{onExportCML:function(e){t(Lo(e))}}}))(Xp),tv=function(t){var e,n=t.label,r=(null===(e=I.eKO.get((0,V.capitalize)(n)))||void 0===e?void 0:e.number)||"";return(0,o.jsxs)("label",{children:["Number:",(0,o.jsx)("input",{type:"text",readOnly:!0,value:r},void 0)]},void 0)},ev=["formState","stereoParity"],nv=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e=t.formState;t.stereoParity;var n=(0,B.Z)(t,ev),r=(0,N.useState)(n.label),i=(0,U.Z)(r,2),a=i[0],s=i[1],u=(0,N.useCallback)((function(t){s(t)}),[]);return(0,o.jsx)(xf,Object.assign({title:"Atom Properties",className:"Atom-module_atomProps__2KzKA",result:function(){return e.result},valid:function(){return e.valid},params:n},{children:(0,o.jsxs)(Fd,Object.assign({schema:lo,customValid:{label:function(t){return(e=t)&&!!I.eKO.get((0,V.capitalize)(e));var e},charge:function(t){return e=t,(n=lo.properties.charge.pattern.exec(e))&&(""===n[1]||""===n[3]);var e,n}},init:n},e,{children:[(0,o.jsxs)("fieldset",Object.assign({className:"Atom-module_main__10Vl_"},{children:[(0,o.jsx)(Hd,{name:"label",onChange:u,autoFocus:!0},void 0),(0,o.jsx)(Hd,{name:"alias"},void 0),(0,o.jsx)(tv,{label:a},void 0),(0,o.jsx)(Hd,{name:"charge",maxLength:"5"},void 0),(0,o.jsx)(Hd,{name:"explicitValence"},void 0),(0,o.jsx)(Hd,{name:"isotope"},void 0),(0,o.jsx)(Hd,{name:"radical"},void 0)]}),void 0),(0,o.jsxs)("fieldset",Object.assign({className:"Atom-module_query__1FSWe"},{children:[(0,o.jsx)("legend",{children:"Query specific"},void 0),(0,o.jsx)(Hd,{name:"ringBondCount"},void 0),(0,o.jsx)(Hd,{name:"hCount"},void 0),(0,o.jsx)(Hd,{name:"substitutionCount"},void 0),(0,o.jsx)(Hd,{name:"unsaturatedAtom"},void 0)]}),void 0),(0,o.jsxs)("fieldset",Object.assign({className:"Atom-module_reaction__13XUc"},{children:[(0,o.jsx)("legend",{children:"Reaction flags"},void 0),(0,o.jsx)(Hd,{name:"invRet"},void 0),(0,o.jsx)(Hd,{name:"exactChangeFlag"},void 0)]}),void 0)]}),void 0)}),void 0)})),rv=["formState"],ov=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e=t.formState,n=(0,B.Z)(t,rv);return(0,o.jsx)(xf,Object.assign({title:"Attachment Points",className:"Attach-module_attachPoints__9wf7s",result:function(){return e.result},valid:function(){return e.valid},params:n},{children:(0,o.jsxs)(Fd,Object.assign({schema:po,init:n},e,{children:[(0,o.jsx)(Hd,{name:"primary"},void 0),(0,o.jsx)(Hd,{name:"secondary"},void 0)]}),void 0)}),void 0)})),iv=["formState"],av={title:"Reaction Auto-Mapping",type:"object",required:["mode"],properties:{mode:{title:"Mode",enum:["discard","keep","alter","clear"],enumNames:["Discard","Keep","Alter","Clear"],default:"discard"}}},sv=Mt((function(t){return{formState:t.modal.form}}),(function(t,e){return{onOk:function(n){t(zo("automap",n)),e.onOk(n)}}}))((function(t){var e=t.formState,n=(0,B.Z)(t,iv);return(0,o.jsx)(xf,Object.assign({title:"Reaction Auto-Mapping",className:"Automap-module_automap__1PNe3",result:function(){return e.result},valid:function(){return e.valid},params:n},{children:(0,o.jsx)(Fd,Object.assign({schema:av},e,{children:(0,o.jsx)(Hd,{name:"mode"},void 0)}),void 0)}),void 0)})),uv=["formState"],cv=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e=t.formState,n=(0,B.Z)(t,uv);return(0,o.jsx)(xf,Object.assign({title:"Bond Properties",className:"Bond-module_bond__3nb-U",result:function(){return e.result},valid:function(){return e.valid},params:n},{children:(0,o.jsxs)(Fd,Object.assign({schema:vo,init:n},e,{children:[(0,o.jsx)(Hd,{name:"type"},void 0),(0,o.jsx)(Hd,{name:"topology"},void 0),(0,o.jsx)(Hd,{name:"center"},void 0)]}),void 0)}),void 0)})),lv=function(t){var e=t.rgroupLabels,n=t.label,r=t.name,i={title:kl().schema.properties[r].title,enum:[0],enumNames:["Always"]};return e.forEach((function(t){n!==t&&(i.enum.push(t),i.enumNames.push("IF R".concat(n," THEN R").concat(t)))})),(0,o.jsx)(Hd,Object.assign({schema:i,className:"IfThenSelect-module_field__3L_It"},t),void 0)},fv=["formState","label","rgroupLabels"],hv=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e=t.formState,n=t.label,r=t.rgroupLabels,i=(0,B.Z)(t,fv);return(0,o.jsx)(xf,Object.assign({title:"R-Group Logic",className:"RgroupLogic-module_rgroupLogic___cYsG",result:function(){return e.result},valid:function(){return e.valid},params:i},{children:(0,o.jsxs)(Fd,Object.assign({schema:go,customValid:{range:function(t){return t.replace(/\s*/g,"").replace(/,+/g,",").replace(/^,/,"").replace(/,$/,"").split(",").every((function(t){return t.match(/^[>,<=]?[0-9]+$/g)||t.match(/^[0-9]+-[0-9]+$/g)}))}},init:i},e,{children:[(0,o.jsx)(Hd,{name:"range"},void 0),(0,o.jsx)(Hd,{name:"resth"},void 0),(0,o.jsx)(lv,{name:"ifthen",label:n,rgroupLabels:r},void 0)]}),void 0)}),void 0)})),dv=["server"],pv=Mt((function(t){return{server:t.server}}),(function(t){return{onOk:function(e){e.fragment&&Or("copy"),t(Lo(e.structStr,{badHeaderRecover:!0,fragment:e.fragment}))}}}))((function(t){var e=(0,N.useState)(""),n=(0,U.Z)(e,2),r=n[0],i=n[1],a=(0,N.useState)(!1),s=(0,U.Z)(a,2),u=s[0],c=s[1],l=t.server,f=(0,B.Z)(t,dv),h=function(){return Array.from(new Set(Object.keys(I.xz_).reduce((function(t,e){return t.concat.apply(t,[I.xz_[e].mime].concat((0,ee.Z)(I.xz_[e].extensions)))}),[]))).join(",")};return(0,o.jsxs)(xf,Object.assign({title:"Open Structure",className:"Open-module_open__9iwld",result:function(){return r?{structStr:r,fragment:u}:null},params:f,buttons:[(0,o.jsx)(sp,Object.assign({server:l,type:h(),onLoad:i},{children:"Open From File…"}),h().toString()),"Cancel","OK"]},{children:[(0,o.jsx)("textarea",{value:r,onChange:function(t){return i(t.target.value)}},void 0),(0,o.jsxs)("label",{children:[(0,o.jsx)("input",{type:"checkbox",checked:u,onChange:function(t){return c(t.target.checked)}},void 0),"Load as a fragment and copy to the Clipboard"]},void 0),(0,o.jsx)(yr,{focused:function(){return!0},onCopy:function(){return{"text/plain":r}}},void 0)]}),void 0)})),vv=function(t){var e=t.changeImageFormat;return(0,o.jsx)("div",{className:"Save-module_saveImageContainer__3A7Ab",children:(0,o.jsxs)("label",{children:["Image Format:  ",(0,o.jsx)("select",{onChange:function(t){var n=t.target;e(n.value)},children:[{extension:"svg",text:"SVG Document"},{extension:"png",text:"PNG Image"}].map((function(t){var e=t.extension,n=t.text;return(0,o.jsx)("option",{value:e,children:n},e)}))})]})})};function mv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mv(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var yv={title:"Save",type:"object",properties:{filename:{title:"Filename",type:"string",maxLength:128,pattern:/^[^.<>:?"*|/\\][^<>:?"*|/\\]*$/,invalidMessage:function(t){return t?t.length>128?"Filename is too long":"A filename cannot contain characters: \\ / : * ? \" < > | and cannot start with '.'":"Filename should contain at least one character"}},format:{title:"Format",enum:Object.keys(I.xz_),enumNames:Object.keys(I.xz_).map((function(t){return I.xz_[t].name}))}}},bv=function(t){(0,Z.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function a(t){var e;(0,R.Z)(this,a),e=i.call(this,t),(0,r.Z)((0,q.Z)(e),"showStructWarningMessage",(function(t){var n=e.props.formState.errors;return"mol"!==t&&Object.keys(n).length>0})),(0,r.Z)((0,q.Z)(e),"changeType",(function(t){var n=e.context.errorHandler;e.setState({disableControls:!0});var r=e.props,o=r.struct,i=r.server,a=r.options,s=r.formState;return new I.Yyn(i).create(t,a).getStructureFromStructAsync(o).then((function(t){e.setState({structStr:t}),setTimeout((function(){e.textAreaRef.current&&e.textAreaRef.current.select()}),10)}),(function(t){return n(t.message),e.props.onResetForm(s),t})).finally((function(){e.setState({disableControls:!1})}))})),(0,r.Z)((0,q.Z)(e),"getWarnings",(function(t){var n=e.props,r=n.struct,o=n.moleculeErrors,i=[],a=function(t,e){var n=[],r=(0,I.ymK)(e).name,o=t.rxnArrows.size,i=t.hasRxnArrow();if("smiles"!==e&&"smarts"!==e||n.push("Structure contains query properties of atoms and bonds that are not supported in the ".concat(null==e?void 0:e.toUpperCase(),". Query properties will not be reflected in the file saved.")),"smiles"===e){var a=Array.from(t.atoms.values()).some((function(t){return t.pseudo}));a&&n.push("Structure contains generic atoms. They will be saved as any atom (*).")}if("ket"!==e){if(i){var s=Array.from(t.rxnArrows.values())[0].mode;s!==I.mWk.OpenAngle&&n.push("The ".concat(r," format does not support drawn elements: the reaction ").concat(s," arrow will be replaced with the reaction arrow"))}o>1&&n.push("The ".concat(r," format does not support drawn elements: reaction arrows will be lost."))}if(["inChI","inChIAuxInfo","smiles","smilesExt"].includes(e)){0!==t.rgroups.size&&n.push("In ".concat(r," the structure will be saved without R-group fragments"));var u=(t=t.clone()).atoms.find((function(t,e){return"R#"===e.label}));null!==u&&n.push("In ".concat(r," the structure will be saved without R-group members")),null!==t.sgroups.find((function(t,e){return"MUL"!==e.type&&!/^INDIGO_.+_DESC$/i.test(e.data.fieldName)}))&&n.push("In ".concat(r," the structure will be saved without S-groups"))}if(["smiles","smilesExt","smarts","inChI","inChIAuxInfo","cml"].includes(e)){var c=t.atoms.find((function(t,e){return e.explicitValence>=0}));null!==c&&n.push("In ".concat(r," valence is not supported"))}return["mol","rxn"].includes(e)&&Array.from(t.frags.values()).some((function(t){return!(null==t||!t.enhancedStereoFlag)&&t.enhancedStereoFlag!==I.Jj2.Abs}))&&n.push("Structure contains enhanced stereochemistry features. Information will be partly lost."),["inChI","inChIAuxInfo","smiles","smilesExt"].includes(e)&&0!==t.functionalGroups.size&&n.push("In ".concat(r," the structure will be saved without functional groups.")),["cml"].includes(e)&&0!==t.functionalGroups.size&&n.push("Structure contains functional groups. In ".concat(r," information will be partly lost.")),0!==n.length?n.join("\n"):null}(r,t);return e.showStructWarningMessage(t)&&i.push("Structure contains errors, please check the data, otherwise you can lose some properties or the whole structure after saving in this format."),a&&i.push(a),o&&i.push.apply(i,(0,ee.Z)(Object.values(o))),i})),(0,r.Z)((0,q.Z)(e),"changeTab",(function(t){e.setState({tabIndex:t})})),(0,r.Z)((0,q.Z)(e),"changeImageFormat",(function(t){e.setState({imageFormat:t})})),(0,r.Z)((0,q.Z)(e),"renderSaveFile",(function(){var t=Object.assign({},e.props.formState);delete t.moleculeErrors;var n=t.result,r=n.filename,i=n.format,a=e.getWarnings(i),s=e.state.structStr;return(0,o.jsxs)("div",{className:"Save-module_formContainer__1nz39",children:[(0,o.jsxs)(Fd,gv(gv({schema:e.saveSchema,init:{filename:r,format:e.isRxn?"rxn":"mol"}},t),{},{children:[(0,o.jsx)(Hd,{name:"filename"}),(0,o.jsx)(Hd,{name:"format",onChange:e.changeType})]})),(0,o.jsx)("textarea",{value:s,className:"Save-module_previewArea__3dnoI",readOnly:!0,ref:e.textAreaRef}),a.length?(0,o.jsx)("div",{className:"Save-module_warnings__2c1LO",children:a.map((function(t){return(0,o.jsxs)("div",{className:"Save-module_warningsContainer__1ufoa",children:[(0,o.jsx)("div",{className:"Save-module_warning__3bJTI"}),(0,o.jsx)("div",{className:"Save-module_warningsArr__2ODO0",children:t})]})}))}):null]})})),(0,r.Z)((0,q.Z)(e),"getButtons",(function(){var t=e.state,n=t.disableControls,r=t.imageFormat,i=t.structStr,a=t.tabIndex,s=e.props.formState,u=s.result,c=u.filename,l=u.format,f=e.props.struct.isBlank(),h=e.props.struct.atoms.size&&e.props.struct.bonds.size;return[[(0,o.jsx)(fp,{mode:"saveFile",data:i,filename:c+(0,I.ymK)(l).extensions[0],type:l.mime,server:e.props.server,onSave:e.props.onOk,disabled:n||!s.valid||f,children:"Save To File"},"save-file-button"),(0,o.jsx)("button",{className:"Save-module_saveTmpl__2EQ_f",disabled:n||f||!h,onClick:function(){return e.props.onTmplSave(e.props.struct)},children:"Save to Templates..."},"save-tmpl"),"Close"],[(0,o.jsx)(fp,{mode:"saveImage",data:i,filename:c,outputFormat:r,type:"image/svg+xml",onSave:e.props.onOk,disabled:n||!s.valid||f||!e.props.server,children:"Save As Image"},"save-image-button"),"Close"]][a]})),e.state={disableControls:!0,imageFormat:"svg",tabIndex:0},e.isRxn=e.props.struct.hasRxnArrow(),e.textAreaRef=(0,N.createRef)();var n=[e.isRxn?"rxn":"mol","smiles","ket"];return e.props.server&&n.push(e.isRxn?"rxnV3000":"molV3000","smilesExt","smarts","inChI","inChIAuxInfo","cml"),e.saveSchema=yv,e.saveSchema.properties.format=Object.assign(e.saveSchema.properties.format,{enum:n,enumNames:n.map((function(t){return(0,I.ymK)(t).name}))}),e}return(0,M.Z)(a,[{key:"componentDidMount",value:function(){var t=this,e=this.props.checkState.checkOptions;this.props.onCheck(e),this.changeType(this.isRxn?"rxn":"mol").then((function(e){return e instanceof Error&&t.setState({disableControls:!0})}))}},{key:"render",value:function(){var t=this,e=[{caption:"Structure",component:this.renderSaveFile},{caption:"Image",component:vv,props:{changeImageFormat:this.changeImageFormat}}];return(0,o.jsx)(xf,{title:"Save Structure",className:"Save-module_save__2n3pO",params:this.props,buttons:this.getButtons(),children:(0,o.jsx)(Ep,{tabs:e,changeTab:function(e){t.changeTab(e)}})})}}]),a}(N.Component);(0,r.Z)(bv,"contextType",sr);var wv=Mt((function(t){return{server:t.options.app.server?t.server:null,struct:t.editor.struct(),options:t.options.getServerSettings(),formState:t.modal.form,moleculeErrors:t.modal.form.moleculeErrors,checkState:t.options.check}}),(function(t){return{onCheck:function(e){return t(Do(e))},onTmplSave:function(e){return t(function(t){var e={struct:t.clone(),props:{}};return function(t,n){Rc(t,"attach",{tmpl:e}).then((function(r){var o=r.name,i=r.attach;e.struct.name=o.trim(),e.props=Ic(Ic({},i),{},{group:"User Templates"});var a=n().templates.lib.concat(e);t(jc(a)),Nc(a)})).catch((function(){return null}))}}(e))},onResetForm:function(e){return t(no(e))}}}))(bv),xv="enhancedStereo-module_stereoLabelItem__2yo2m",Ov="enhancedStereo-module_labelGroupSelect__1JnDA",Ev=["struct","formState","init"],_v=Mt((function(t){return{formState:t.modal.form||{result:{},valid:!1},struct:t.editor.struct()}}))((function(t){var e,n=t.struct,r=t.formState,i=t.init,a=(0,B.Z)(t,Ev),s=r.result,u=r.valid,c=function(t,e){return e.filter((function(e){return null!==t.atoms.get(e).stereoLabel})).map((function(e){return t.atoms.get(e).stereoLabel}))}(n,Array.from(n.atoms.keys())),l=(e=c.map((function(t){var e;return t.match(/&/)?+(null===(e=t.match(/\d+/))||void 0===e?void 0:e.join()):0})),Math.max.apply(Math,(0,ee.Z)(e))),f=function(t){var e=t.map((function(t){var e;return t.match(/or/)?+(null===(e=t.match(/\d+/))||void 0===e?void 0:e.join()):0}));return Math.max.apply(Math,(0,ee.Z)(e))}(c);return(0,o.jsx)(xf,Object.assign({title:"Enhanced Stereochemistry",className:"enhancedStereo-module_enhancedStereo__3TQaX",params:a,result:function(){return s},valid:function(){return u},buttons:["Cancel","OK"]},{children:(0,o.jsx)(Fd,Object.assign({schema:{title:"Enhanced Stereo",type:"object",properties:{type:{type:"string"},andNumber:{type:"integer"},orNumber:{type:"integer"}}},init:i},r,{children:(0,o.jsxs)("fieldset",{children:[(0,o.jsxs)("label",Object.assign({className:xv},{children:[(0,o.jsx)(Hd,{name:"type",labelPos:!1,type:"radio",value:I.YkY.Abs,checked:s.type===I.YkY.Abs},void 0),"ABS"]}),void 0),0!==l&&(0,o.jsxs)("label",Object.assign({className:xv},{children:[(0,o.jsx)(Hd,{name:"type",labelPos:!1,type:"radio",value:I.YkY.And,checked:s.type===I.YkY.And},void 0),"Add to AND",(0,o.jsx)(Hd,{name:"andNumber",schema:(0,ne.range)(1,l+1),type:"text",className:Ov},void 0),"Group"]}),void 0),0!==f&&(0,o.jsxs)("label",Object.assign({className:xv},{children:[(0,o.jsx)(Hd,{name:"type",labelPos:!1,type:"radio",value:I.YkY.Or,checked:s.type===I.YkY.Or},void 0),"Add to OR",(0,o.jsx)(Hd,{name:"orNumber",schema:(0,ne.range)(1,f+1),type:"text",className:Ov},void 0),"Group"]}),void 0),(0,o.jsxs)("label",Object.assign({className:xv},{children:[(0,o.jsx)(Hd,{name:"type",labelPos:!1,type:"radio",value:"&".concat(l+1)},void 0),"Create new AND Group"]}),void 0),(0,o.jsxs)("label",Object.assign({className:xv},{children:[(0,o.jsx)(Hd,{name:"type",labelPos:!1,type:"radio",value:"or".concat(f+1)},void 0),"Create new OR Group"]}),void 0)]},void 0)}),void 0)}),void 0)})),Sv=function(t){var e=t.textInfo;return(0,o.jsx)("div",Object.assign({className:"emptySearchResult-module_emptySearch__OJFcG"},{children:e}),void 0)},jv="TemplateTable-module_td__5kmsK",Av={Alpha:"A",alpha:"α",Beta:"B",beta:"β",Gamma:"Г",gamma:"γ"},Pv=new RegExp("\\b"+Object.keys(Av).join("\\b|\\b")+"\\b","g");function kv(t){return t.replace(Pv,(function(t){return Av[t]}))}var Tv=["tmpl"];function Cv(t,e){return t.struct.name||"".concat(t.props.group," template ").concat(e+1)}var Rv=function(t){var e=t.tmpl,n=(0,B.Z)(t,Tv);return e.props&&e.props.prerender?(0,o.jsx)("svg",Object.assign({},n,{children:(0,o.jsx)("use",{href:e.props.prerender},void 0)}),void 0):(0,o.jsx)(Hp,Object.assign({struct:e.struct,options:{autoScaleMargin:15}},n),void 0)},Mv=function(t){var e=t.templates,n=t.selected,r=t.onSelect,i=t.onDelete,a=t.onAttach,s=e?e.length:0,u={width:"".concat(178,"px"),height:"".concat(120,"px")};return s?(0,o.jsx)("div",Object.assign({className:"TemplateTable-module_table__CPv9v",style:{minWidth:178}},{children:(0,o.jsx)("div",Object.assign({className:"TemplateTable-module_tableContent__1e0Xn"},{children:e.map((function(t,e){return(0,o.jsxs)("div",Object.assign({className:t===n?"".concat(jv," ").concat("TemplateTable-module_selected__1BNKz"):jv,title:kv(Cv(t,e)),style:u},{children:[(0,o.jsx)(Rv,{tmpl:t,className:"TemplateTable-module_struct__3H4EB",onClick:function(){return r(t)}},void 0),(0,o.jsxs)("div",Object.assign({className:"TemplateTable-module_btnContainer__1J5Yg"},{children:["User Templates"===t.props.group&&(0,o.jsx)("button",Object.assign({className:"TemplateTable-module_deleteButton__NxTLR",onClick:function(){return i(t)}},{children:"Delete"}),void 0),"Functional Groups"!==t.props.group&&(0,o.jsx)("button",Object.assign({className:"TemplateTable-module_attachButton__FLpk7",onClick:function(){return a(t)}},{children:"Edit"}),void 0)]}),void 0)]}),t.struct.name!==(null==n?void 0:n.struct.name)?"".concat(t.struct.name,"_").concat(e):"".concat(t.struct.name,"_").concat(e,"_selected"))}))}),void 0)}),void 0):(0,o.jsx)(Sv,{textInfo:"No items found"},void 0)},Iv=function(t){return t.functionalGroups.lib},Nv=function(t){return t.functionalGroups.mode};function Bv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bv(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Lv=["formState"];function Dv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dv(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Fv(t){var e=t.match(/^(\d+)?([a-z*]{1,3})(\.|:|\^\^)?(\d+[-+]|[-+])?$/i);if(e){var n="*"===e[2]?"A":(0,V.capitalize)(e[2]),r=0,o=0,i=0;if(e[1]&&(o=parseInt(e[1])),e[3]&&(i={":":1,".":2,"^^":3}[e[3]]),e[4]&&(r=parseInt(e[4]),isNaN(r)&&(r=1),e[4].endsWith("-")&&(r=-r)),"A"===n||"Q"===n||"X"===n||"M"===n||I.eKO.get(n))return{label:n,charge:r,isotope:o,radical:i}}return null}var Gv=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e,n,r,i,a={label:t.letter||(e=t,n=Math.abs(e.charge),r=["",":",".","^^"][e.radical]||"",i="",n&&(i=e.charge<0?"-":"+"),(e.isotope||"")+e.label+r+(n>1?n:"")+i)},s=t.formState,u=(0,B.Z)(t,Lv),c=s.result,l=s.valid;return(0,o.jsx)(xf,{title:"Label Edit",className:"labeledit",valid:function(){return l},result:function(){return Fv(c.label)},params:u,children:(0,o.jsx)(Fd,zv(zv({schema:ho,customValid:{label:function(t){return Fv(t)}},init:a},s),{},{children:(0,o.jsx)(Hd,{name:"label",maxLength:"20",size:"10",autoFocus:!0})}))})}));function Hv(t){var e=t.el,n=t.isInfo,r={color:I.wql[e.label]||"black",fontSize:"1.2em"},i={color:I.wql[e.label]||"black",fontWeight:"bold",fontSize:"2em"};return(0,o.jsxs)("div",{className:F("AtomInfo-module_ket_atom_info__3HqqP",!n&&"AtomInfo-module_none__1Bm_x"),children:[(0,o.jsx)("div",{style:r,children:e.number}),(0,o.jsx)("span",{style:i,children:e.label}),(0,o.jsx)("br",{}),e.title,(0,o.jsx)("br",{}),e.mass]})}function Vv(){return(0,o.jsx)("tbody",{children:(0,o.jsx)("tr",{children:(0,V.range)(0,19).map((function(t){return(0,o.jsx)("th",{children:t||""},t)}))})})}function Uv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Uv(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wv(t){var e=t.row,n=t.caption,r=t.refer,i=t.onSelect,a=t.currentEvents,s=t.atomClassNames,u=t.className;return(0,o.jsx)("tbody",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{children:n}),e.map((function(t,e){return"number"!=typeof t?(0,o.jsx)("td",{children:(0,o.jsx)(Wl,qv({el:t,className:F.apply(void 0,(0,ee.Z)(s(t))),onClick:function(){return i(t.label)}},a(t)))},e):r(t)?(0,o.jsx)("td",{className:u,children:r(t)},e):(0,o.jsx)("td",{colSpan:t},e)}))]})})}function Yv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yv(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kv(t){var e=t.row,n=t.caption,r=t.onSelect,i=t.currentEvents,a=t.atomClassNames,s=t.className;return(0,o.jsx)("tbody",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{colSpan:"3",className:s,children:n}),e.map((function(t){return(0,o.jsx)("td",{children:(0,o.jsx)(Wl,$v({el:t,className:F.apply(void 0,(0,ee.Z)(a(t))),onClick:function(){return r(t.label)}},i(t)))},t.label)})),(0,o.jsx)("td",{})]})})}var Jv={dialog_body:"ElementsTable-module_dialog_body__2BuBn",scrollbar:"ElementsTable-module_scrollbar__h8h59",table:"ElementsTable-module_table__35x0F",main_row:"ElementsTable-module_main_row__21iwj",outiner_row:"ElementsTable-module_outiner_row__2hruz",diatomic:"ElementsTable-module_diatomic__2duFN",noble:"ElementsTable-module_noble__InJ92",alkali:"ElementsTable-module_alkali__qiPZ9","alkaline-earth":"ElementsTable-module_alkaline-earth__3tT5K",metalloid:"ElementsTable-module_metalloid__--9tT",polyatomic:"ElementsTable-module_polyatomic__BDUKD","post-transition":"ElementsTable-module_post-transition__1YWtx",transition:"ElementsTable-module_transition__2mhhb",lanthanide:"ElementsTable-module_lanthanide__mVe3r",actinide:"ElementsTable-module_actinide__3U5Vv","unknown-props":"ElementsTable-module_unknown-props__1jELq","unknown-state":"ElementsTable-module_unknown-state__2DuKP",solid:"ElementsTable-module_solid__1T9ON",metal:"ElementsTable-module_metal__ToB4y",gas:"ElementsTable-module_gas__12rpT",liquid:"ElementsTable-module_liquid__1IlKl",button:"ElementsTable-module_button__dQ1fI",selected:"ElementsTable-module_selected__1LThb"};function Xv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xv(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tm=["alkali","alkaline-earth","transition","post-transition"],em="metal",nm="unknown-props",rm="unknown-state",om="button",im="selected",am={He:16,B:10,Al:10,Hf:1,Rf:1},sm="actinide",um="lanthanide",cm=I.eKO.filter((function(t){return t&&t.type!==sm&&t.type!==um})).reduce((function(t,e){var n=t[e.period-1];return n?(am[e.label]&&n.push(am[e.label]),n.push(e)):t.push([e]),t}),[]),lm=I.eKO.filter((function(t){return t&&t.type===um})),fm=I.eKO.filter((function(t){return t&&t.type===sm})),hm=function(t){(0,Z.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function a(){var t;(0,R.Z)(this,a);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=i.call.apply(i,[this].concat(n)),(0,r.Z)((0,q.Z)(t),"getAtomClassNames",(function(e){var n=t.props.selected,r=tm.includes(e.type)?"".concat(e.type," ").concat(em):e.type||nm;return[].concat((0,ee.Z)(r.split(" ")),[e.state||rm,e.origin,om,n(e.label)&&im]).map((function(t){return Jv[t]}))})),t}return(0,M.Z)(a,[{key:"shouldComponentUpdate",value:function(t){return t.value!==this.props.value}},{key:"render",value:function(){var t=this,e=this.props,n={currentEvents:e.currentEvents,onSelect:e.onSelect};return(0,o.jsxs)("table",{className:Jv.table,summary:"Periodic table of the chemical elements",children:[(0,o.jsx)(Vv,{}),cm.map((function(e,r){return(0,o.jsx)(Wv,Qv({atomClassNames:t.getAtomClassNames,className:Jv.main_row,row:e,caption:r+1,refer:function(t){return 1===t&&(5===r?"*":"**")}},n),r)})),(0,o.jsx)(Kv,Qv({atomClassNames:this.getAtomClassNames,className:Jv.outiner_row,row:lm,caption:"*"},n)),(0,o.jsx)(Kv,Qv({atomClassNames:this.getAtomClassNames,className:Jv.outiner_row,row:fm,caption:"**"},n))]})}}]),a}(N.Component),dm=["labels","caption","selected","onSelect"];function pm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vm(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pm(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pm(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function mm(t){var e=t.labels,n=t.caption,i=void 0===n?"":n,a=t.selected,s=t.onSelect,u=(0,B.Z)(t,dm);return(0,o.jsxs)("fieldset",vm(vm({},u),{},{children:[e.map((function(t,e){return(0,o.jsx)("button",{onClick:function(){return s(t)},className:F((0,r.Z)({},"GenSet-module_selected__3uyG3",a(t)),"GenSet-module_button__JlbxE"),children:t},e)})),i?(0,o.jsx)("legend",{children:i}):null]}))}var gm={carbo:"GenGroup-module_carbo__1JPoA",hetero:"GenGroup-module_hetero__ohczK",cyclic:"GenGroup-module_cyclic__2m79A",acyclic:"GenGroup-module_acyclic__JU60z",atom:"GenGroup-module_atom__1Qp1J",fieldset:"GenGroup-module_fieldset__3b7Ck",subgroup:"GenGroup-module_subgroup__5BV4r",any:"GenGroup-module_any__1t_Rp",metal:"GenGroup-module_metal__3A9LP",halogen:"GenGroup-module_halogen__2fuzc","no-carbon":"GenGroup-module_no-carbon__1TV0O"},ym={atom:{caption:"Atom Generics",order:["any","no-carbon","metal","halogen"]},group:{caption:"Group Generics",order:["acyclic","cyclic"]},special:{caption:"Special Nodes",order:[]},"group/acyclic":{caption:"Acyclic",order:["carbo","hetero"]},"group/cyclic":{caption:"Cyclic",order:["no-carbon","carbo","hetero"]},"group/acyclic/carbo":{caption:"Carbo",order:["alkynyl","alkyl","alkenyl"]},"group/acyclic/hetero":{caption:"Hetero",order:["alkoxy"]},"group/cyclic/carbo":{caption:"Carbo",order:["aryl","cycloalkyl","cycloalkenyl"]},"group/cyclic/hetero":{caption:"Hetero",order:["aryl"]},"atom/any":"any atom","atom/no-carbon":"except C or H","atom/metal":"any metal","atom/halogen":"any halogen","group/cyclic/no-carbon":"no carbon","group/cyclic/hetero/aryl":"hetero aryl"};function bm(t){var e=t.gen,n=t.name,r=t.path,i=t.selected,a=t.onSelect,s=e[n],u=r?"".concat(r,"/").concat(n):n,c=ym[u];return c&&c.caption?(0,o.jsxs)("fieldset",{className:F(gm[n],gm.fieldset),children:[(0,o.jsx)("legend",{children:c.caption}),s.labels?(0,o.jsx)(mm,{labels:s.labels,selected:i,onSelect:a,className:gm.subgroup}):null,c.order.map((function(t,e){return(0,o.jsx)(bm,{gen:s,name:t,path:u,selected:i,onSelect:a},e)}))]}):(0,o.jsx)(mm,{labels:s.labels,caption:c||n,className:gm[n],selected:i,onSelect:a})}var wm={dialog_body:"GenericGroups-module_dialog_body__KyEHX",scrollbar:"GenericGroups-module_scrollbar__X1ZR_","generic-groups":"GenericGroups-module_generic-groups__1EAm3",col:"GenericGroups-module_col__ht0OR"},xm=["selected","onSelect","className"];function Om(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Em(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Om(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Om(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _m(t){var e=t.selected,n=t.onSelect,r=t.className,i=(0,B.Z)(t,xm);return(0,o.jsxs)("div",Em(Em({summary:"Generic Groups",className:wm[r]},i),{},{children:[(0,o.jsxs)("div",{className:wm.col,children:[(0,o.jsx)(bm,{gen:I.X6G,name:"atom",selected:e,onSelect:n}),(0,o.jsx)(bm,{gen:I.X6G,name:"special",selected:e,onSelect:n})]}),(0,o.jsx)("div",{className:wm.col,children:(0,o.jsx)(bm,{gen:I.X6G,name:"group",selected:e,onSelect:n})})]}))}var Sm=["value","onChange"];function jm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Am(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jm(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jm(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Pm=[{title:"Single",value:"atom"},{title:"List",value:"list"},{title:"Not List",value:"not-list"}];function km(t){var e=t.value,n=t.onChange,r=(0,B.Z)(t,Sm);return(0,o.jsx)("fieldset",{className:"TypeChoice-module_fieldset__27dOf",children:Pm.map((function(t){return(0,o.jsxs)("label",{children:[(0,o.jsx)("input",Am({type:"radio",value:t.value,checked:t.value===e,onChange:function(){return n(t.value)}},r)),t.title]},t.title)}))})}function Tm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Cm=function(t){(0,Z.Z)(a,t);var e,n,i=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function a(t){var e;(0,R.Z)(this,a),e=i.call(this,t),(0,r.Z)((0,q.Z)(e),"changeType",(function(t){e.firstType?e.firstType=!1:"list"!==e.state.type&&"not-list"!==e.state.type||"list"!==t&&"not-list"!==t?e.setState({type:t,value:"atom"===t||"gen"===t?null:[]}):e.setState({type:t})})),(0,r.Z)((0,q.Z)(e),"changeTabType",(function(t){var n=0===t?"atom":"gen";e.changeType(n)})),(0,r.Z)((0,q.Z)(e),"selected",(function(t){var n=e.state,r=n.type,o=n.value;return"atom"===r||"gen"===r?o===t:o.includes(t)})),(0,r.Z)((0,q.Z)(e),"onSelect",(function(t){var n=e.state,r=n.type,o=n.value;e.setState({value:"atom"===r||"gen"===r?t:(0,V.xor)([t],o)})})),(0,r.Z)((0,q.Z)(e),"result",(function(){var t=e.state,n=t.type,r=t.value;return r&&r.length?"atom"===n?{label:r,pseudo:null}:"gen"===n?{type:n,label:r,pseudo:r}:{type:n,values:r}:null})),(0,r.Z)((0,q.Z)(e),"currentEvents",(function(t){return{onMouseEnter:function(){return e.setState({current:t,isInfo:!0})},onMouseLeave:function(){return e.setState({isInfo:!1})}}})),(0,r.Z)((0,q.Z)(e),"periodicTable",(function(t){var n=e.state,r=n.type,i=n.current,a=n.isInfo;return(0,o.jsxs)("div",{className:"PeriodTable-module_period_table__8OrtZ",children:[(0,o.jsx)(Hv,{el:i,isInfo:a}),(0,o.jsx)(hm,{value:t,currentEvents:e.currentEvents,selected:e.selected,onSelect:e.onSelect}),(0,o.jsx)(km,{value:r,onChange:e.changeType})]})}));var n=e.props.pseudo?"gen":null;return e.state={type:t.type||n||"atom",value:t.values||t.label||null,current:I.eKO.get(2),isInfo:!1},e.firstType=!0,e}return(0,M.Z)(a,[{key:"render",value:function(){var t=this.state,e=t.type,n=t.value,r=[{caption:"Table",component:this.periodicTable,props:{value:n}},{caption:"Extended",component:_m,props:{className:"generic-groups",selected:this.selected,onSelect:this.onSelect}}];return(0,o.jsx)(xf,{title:"Periodic table",className:"PeriodTable-module_elements_table__2M14i",params:this.props,result:this.result,children:(0,o.jsx)(Ep,{className:"PeriodTable-module_tabs__zC6rx",contentClassName:"PeriodTable-module_tabs_content__1L9kM",captions:r,tabIndex:"gen"!==e?0:1,changeTab:this.changeTabType,tabs:r})})}}]),a}(N.Component);var Rm=Mt((function(t,e){return e.values||e.label?{}:(n=t.editor,(o=n.selection())&&1===Object.keys(o).length&&o.atoms&&1===Object.keys(o.atoms).length?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Tm(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tm(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Oo(n.struct().atoms.get(o.atoms[0]))):{});var n,o}),(function(t,e){return{onOk:function(n){n.type&&"atom"!==n.type||t({type:"ADD_ATOMS",data:n.label}),t(Zo({tool:"atom",opts:Eo(n)})),e.onOk(n)}}}))(Cm);function Mm(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Im(t){var e,n=t.value,r=t.onChange,i=t.schema,a=t.disabledIds,s=t.multiple,u=t.classes.selected||"selected";return(0,o.jsx)("ul",{children:i.items.enum.map((function(t,c){return e=n.includes(t)?u:"",(0,o.jsx)("li",{children:(0,o.jsx)("button",{disabled:a.includes(t),type:"button",className:e,onClick:function(){return r(function(t,e,n){return t?(0,V.xor)(e,[n]):(0,V.xor)(e,e.concat([n]))}(s,n,t))},children:i.items.enumNames[c]})},t)}))})}var Nm={dialog_body:"rgroup-module_dialog_body__2WcOS",scrollbar:"rgroup-module_scrollbar__18Gvw",rgroup:"rgroup-module_rgroup__2t4WD",selected:"rgroup-module_selected__E4jNT"},Bm=["disabledIds","values","formState","type"];function Zm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lm(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zm(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zm(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Dm=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e=t.disabledIds,n=t.values,r=t.formState,i=t.type,a=(0,B.Z)(t,Bm);return(0,o.jsx)(xf,{title:"R-Group",className:Nm.rgroup,params:a,result:function(){return r.result},children:(0,o.jsx)(Fd,Lm(Lm({schema:fo,init:{values:n}},r),{},{children:(0,o.jsx)(Hd,{name:"values",multiple:"atom"===i,labelPos:!1,component:Im,disabledIds:e,classes:Nm})}))})}));var zm=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e;return(0,R.Z)(this,i),(e=r.call(this,t)).state={suggestsHidden:!0},e.click=e.click.bind((0,q.Z)(e)),e.blur=e.blur.bind((0,q.Z)(e)),e.updateInput=e.updateInput.bind((0,q.Z)(e)),e}return(0,M.Z)(i,[{key:"updateInput",value:function(t){var e=t.target.value||t.target.textContent;this.setState({suggestsHidden:!0}),this.props.onChange(e)}},{key:"click",value:function(){this.setState({suggestsHidden:!1})}},{key:"blur",value:function(){this.setState({suggestsHidden:!0})}},{key:"render",value:function(){var t=this,e=this.props,n=e.value,r=e.type,i=void 0===r?"text":r,a=e.schema.enumNames.filter((function(t){return t!==n})).map((function(e){return(0,o.jsx)("li",{onMouseDown:t.updateInput,children:e},e)})),s={display:this.state.suggestsHidden?"none":"block"};return(0,o.jsxs)("div",{children:[(0,o.jsx)("input",{type:i,value:n,onClick:this.click,onBlur:this.blur,onChange:this.updateInput,autoComplete:"off"}),0!==a.length?(0,o.jsx)("ul",{className:"combobox-module_suggestList__lV92o",style:s,children:a}):""]})}}]),i}(N.Component),Fm="sgroup-module_sgroup__1p5K5",Gm="sgroup-module_data__1XWzJ",Hm=["title","name","schema"],Vm=["context","fieldName","fieldValue","type","radiobuttons","formState"];function Um(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qm(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Um(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Um(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wm(t){var e=t.title,n=t.name,r=t.schema,i=(0,B.Z)(t,Hm),a=Object.keys(r).reduce((function(t,e){return t.enum.push(e),t.enumNames.push(r[e].title||e),t}),{title:e,type:"string",default:"",minLength:1,enum:[],enumNames:[]});return(0,o.jsx)(Hd,qm({name:n,schema:a,component:zm},i))}var Ym=function(t,e,n,r){return Object.keys(t.properties).filter((function(t){return"type"!==t&&"context"!==t&&"fieldName"!==t})).map((function(t){return"radiobuttons"===t?(0,o.jsx)(Hd,{name:t,checked:r,type:"radio"},"".concat(e,"-").concat(n,"-").concat(t,"-radio")):(0,o.jsx)(Hd,{name:t,type:"textarea",multiple:!0,size:"10"},"".concat(e,"-").concat(n,"-").concat(t,"-select"))}))},$m=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e=t.context,n=t.fieldName,r=t.fieldValue,i=t.type,a=t.radiobuttons,s=t.formState,u=(0,B.Z)(t,Vm),c=s.result,l=s.valid,f={context:e,fieldName:n||$r(e),type:i,radiobuttons:a};f.fieldValue=r||$r(e,f.fieldName);var h=Wr[c.context][c.fieldName]||qr,d={context:c.context.trim(),fieldName:c.fieldName.trim(),fieldValue:"string"==typeof c.fieldValue?c.fieldValue.trim():c.fieldValue};return(0,o.jsx)(xf,{title:"S-Group Properties",className:Fm,result:function(){return c},valid:function(){return l},params:u,children:(0,o.jsxs)(Fd,qm(qm({serialize:d,schema:h,init:f},s),{},{children:[(0,o.jsx)(Vd,{title:"Context",name:"context",schema:Wr}),(0,o.jsxs)("fieldset",{className:Gm,children:[(0,o.jsx)(Wm,{title:"Field name",name:"fieldName",schema:Wr[c.context]}),Ym(h,c.context,c.fieldName,a)]})]}))})})),Km=["formState"];function Jm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xm(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jm(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jm(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Qm=function(t){return Object.keys(mo[t].properties).filter((function(t){return"type"!==t})).map((function(e){var n={};return"name"===e&&(n.maxLength=15),"fieldName"===e&&(n.maxLength=30),"fieldValue"===e&&(n.type="textarea"),"radiobuttons"===e&&(n.type="radio"),(0,o.jsx)(Hd,Xm({name:e},n),"".concat(t,"-").concat(e))}))},tg=Mt((function(t){return{formState:t.modal.form}}))((function(t){var e=t.formState,n=(0,B.Z)(t,Km),r=e.result,i=e.valid,a=r.type;return(0,o.jsx)(xf,{title:"S-Group Properties",className:Fm,result:function(){return r},valid:function(){return i},params:n,children:(0,o.jsxs)(Fd,Xm(Xm({schema:mo[a],init:n},e),{},{children:[(0,o.jsx)(Vd,{title:"Type",name:"type",schema:mo}),"GEN"!==a&&(0,o.jsx)("fieldset",{className:"DAT"===a?Gm:"base",children:Qm(a)})]}))})})),eg={dialog_body:"template-lib-module_dialog_body__2JFam",scrollbar:"template-lib-module_scrollbar__2Oawx",warning:"template-lib-module_warning__3_tcY",templateLib:"template-lib-module_templateLib__1IX2e",tableGroupWrap:"template-lib-module_tableGroupWrap__1qulm",groups:"template-lib-module_groups__3Zm12",selected:"template-lib-module_selected__1fXcm",split:"template-lib-module_split__2TPWH",singleColLayout:"template-lib-module_singleColLayout__2h3HH",td:"template-lib-module_td__3Z3wH",attach:"template-lib-module_attach__3l_9R",editor:"template-lib-module_editor__2moE5"},ng=["onInit"],rg=["name","onNameEdit","onAttachEdit"];function og(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ig(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?og(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):og(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ag={selectionStyle:{fill:"#47b3ec",stroke:"none"},hoverStyle:{stroke:"#1a7090","stroke-width":1.2},hoverStyleSimpleObject:{"stroke-opacity":.3}},sg=function(t){(0,Z.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,D.Z)(e);if(n){var o=(0,D.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,L.Z)(this,t)});function i(t){var e,n,o,a,s,u,c=t.onInit,l=(0,B.Z)(t,ng);return(0,R.Z)(this,i),(e=r.call(this)).tmpl=(n=l.tmpl,(o={struct:(a=n.struct,s=a.clone(),u=s.getCoordBoundingBox(),s.atoms.forEach((function(t){t.pp=t.pp.sub(u.min)})),s.sgroups.forEach((function(t){t.pp=t.pp?t.pp.sub(u.min):u.min})),s.rxnArrows.forEach((function(t){t.pos=t.pos.map((function(t){return t.sub(u.min)}))})),s.rxnPluses.forEach((function(t){t.pp=t.pp.sub(u.min)})),s.simpleObjects.forEach((function(t){t.pos=t.pos.map((function(t){return t.sub(u.min)}))})),s.texts.forEach((function(t){t.position=t.position.sub(u.min)})),s),props:{atomid:+n.props.atomid||0,bondid:+n.props.bondid||0}}).struct.name=n.struct.name,o),c(e.tmpl.struct.name,e.tmpl.props),e.onResult=e.onResult.bind((0,q.Z)(e)),e}return(0,M.Z)(i,[{key:"onResult",value:function(){var t=this.props,e=t.name,n=t.atomid,r=t.bondid;return e&&(e!==this.tmpl.struct.name||n!==this.tmpl.props.atomid||r!==this.tmpl.props.bondid)&&e.trim().length?{name:e,attach:{atomid:n,bondid:r}}:null}},{key:"checkUniqueName",value:function(t){return!this.props.templateLib.some((function(e){return e.struct.name===t&&"User Templates"===e.props.group}))}},{key:"render",value:function(){var t=this,e=this.props,n=e.name,r=e.onNameEdit,i=e.onAttachEdit,a=(0,B.Z)(e,rg),s=this.tmpl.struct,u=s.atoms.get(this.props.atomid)&&s.bonds.get(this.props.bondid)?this.props:this.tmpl.props,c=u.atomid,l=u.bondid,f=Object.assign(ag,{scale:cg(s)});return(0,o.jsx)(xf,{title:"Template Edit",className:eg.attach,result:this.onResult,valid:function(){return t.props.formState.valid&&n},params:a,children:(0,o.jsxs)(Fd,ig(ig({schema:yo,customValid:{name:function(e){return t.checkUniqueName(e)}}},this.props.formState),{},{children:[(0,o.jsx)(Hd,{name:"name",value:n,onChange:r,placeholder:"template"}),(0,o.jsx)("label",{children:"Choose attachment atom and bond:"}),(0,o.jsx)(dd,{className:eg.editor,struct:s,onAttachEdit:i,tool:"attach",toolOpts:{atomid:c,bondid:l},options:f}),Mr()?null:(0,o.jsx)("div",{className:eg.warning,children:Rr})]}))})}}]),i}(N.Component),ug=Mt((function(t){return ig(ig({},t.templates.attach),{},{templateLib:t.templates.lib,formState:t.modal.form})}),(function(t){return{onInit:function(e,n){return t(function(t,e){return{type:"INIT_ATTACH",data:{name:t,atomid:e.atomid,bondid:e.bondid}}}(e,n))},onAttachEdit:function(e){return t({type:"SET_ATTACH_POINTS",data:{atomid:(n=e).atomid,bondid:n.bondid}});var n},onNameEdit:function(e){return t(function(t){return{type:"SET_TMPL_NAME",data:{name:t}}}(e))}}}))(sg);function cg(t){var e=t.getCoordBoundingBox(),n=220/Math.max(e.max.y-e.min.y,e.max.x-e.min.x);return n<35&&(n=35),n>50&&(n=50),n}var lg=["schema","value","onSelect","splitIndexes","selected","component","classes"];function fg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function hg(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fg(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fg(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function dg(t){var e=t.schema,n=t.value,r=t.onSelect,i=t.splitIndexes;t.selected,t.component;var a=t.classes,s=(0,B.Z)(t,lg);return(0,o.jsx)("ul",hg(hg({},s),{},{children:e.enum.map((function(t,s){return(0,o.jsx)("li",{onClick:function(){return r(t,s)},className:(t===n?"".concat(a.selected," "):"")+(pg(s,i)?" ".concat(a.split):""),children:e.enumNames?e.enumNames[s]:t},t)}))}))}function pg(t,e){return t>0&&e&&e.includes(t)}var vg=["filter","onFilter","onChangeGroup","mode"];function mg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var gg=nr((function(t){return t.lib}),(function(t){return t.filter}),(function(t,e){var n=new RegExp((0,V.escapeRegExp)(kv(e)),"i");return(0,V.flow)((0,V.filter)((function(t){return!e||n.test(kv(t.struct.name))||n.test(kv(t.props.group))})),(0,V.reduce)((function(t,e){return t[e.props.group]?t[e.props.group].push(e):t[e.props.group]=[e],t}),{}))(t)})),yg=Mt((function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mg(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mg(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,V.omit)(["attach"],t.templates))}),(function(t,e){return{onFilter:function(e){return t(function(t){return{type:"TMPL_CHANGE_FILTER",data:{filter:t.trim(),selected:null}}}(e))},onSelect:function(e){return t(function(t){return{type:"TMPL_SELECT",data:{selected:t}}}(e))},onChangeGroup:function(e){return t(function(t){return{type:"TMPL_CHANGE_GROUP",data:{group:t,selected:null}}}(e))},onAttach:function(e){return t(function(t){return function(e,n){Rc(e,"attach",{tmpl:t}).then((function(e){t.struct.name=e?e.name.trim():t.struct.name,t.props=e?Object.assign({},t.props,e.attach):t.props,"User Templates"===t.props.group&&Nc(n().templates.lib)}),(function(){return null})).then((function(){return Rc(e,"templates").catch((function(){return null}))}))}}(e))},onDelete:function(e){return t(function(t){return function(e,n){var r=n().templates.lib.filter((function(e){return e!==t}));e(function(t){return{type:"TMPL_DELETE",data:{tmpl:t}}}(t)),Nc(r)}}(e))},onOk:function(n){t(Zo({tool:"template",opts:n})),e.onOk(n)}}}))((function(t){var e=t.filter,n=t.onFilter,i=t.onChangeGroup,a=t.mode,s=(0,B.Z)(t,vg),u=t.group,c=gg(t);u=c[u]?u:Object.keys(c)[0];var l=Pl(),f=l.ref,h=l.width,d=function(){var e=t.selected;return e?{struct:e.struct,aid:parseInt(String(e.props.atomid))||null,bid:parseInt(String(e.props.bondid))||null,mode:a}:null},p=(new I.Ruh).serialize(t.lib);return(0,o.jsx)(xf,Object.assign({title:"Template Library",className:eg.templateLib,params:(0,V.omit)(["group"],s),result:function(){return d()},buttons:[u&&(0,o.jsx)(fp,Object.assign({data:p,filename:"ketcher-tmpls.sdf"},{children:"Save To SDF…"}),"save-to-SDF"),"Cancel","OK"]},{children:(0,o.jsxs)("div",Object.assign({className:eg.dialog_body},{children:[(0,o.jsxs)("label",{children:["Filter:",(0,o.jsx)(Rd,{type:"search",value:e,onChange:function(t){return n(t)}},void 0)]},void 0),(0,o.jsxs)("div",Object.assign({className:F(eg.tableGroupWrap,(0,r.Z)({},eg.singleColLayout,h&&h<310)),ref:f},{children:[u&&(0,o.jsx)(Rd,{className:eg.groups,classes:eg,component:dg,splitIndexes:[Object.keys(c).indexOf("User Templates")],value:u,onChange:function(t){return i(t)},schema:{enum:Object.keys(c),enumNames:Object.keys(c).map((function(t){return kv(t)}))}},void 0),(0,o.jsx)(Mv,{templates:c[u],onSelect:function(e){e===t.selected?t.onOk(d()):t.onSelect(e)},selected:t.selected,onDelete:t.onDelete,onAttach:t.onAttach},void 0)]}),void 0)]}),void 0)}),void 0)})),bg=function(t){var e=t.editorState,n=t.setEditorState,r=t.styles,i="13px",a=(0,N.useState)(!1),s=(0,U.Z)(a,2),u=s[0],c=s[1],l=(0,N.useState)(i),f=(0,U.Z)(l,2),h=f[0],d=f[1],p=r.fontSize.current(e);(0,N.useEffect)((function(){d(p||i)}),[p]);var v=(0,V.range)(4,145),m=(0,N.useMemo)((function(){return v.map((function(t){return(0,o.jsx)("div",Object.assign({className:"FontControl-module_fontSizeOption__2MB1d",onMouseDown:function(o){return function(t,o){t.preventDefault(),d(o);var i=r.fontSize.remove(e);n(r.fontSize.add(i,o)),c(!1)}(o,"".concat(t,"px"))}},{children:t}),t)}))}),[u]);return(0,o.jsxs)("div",{children:[(0,o.jsx)("button",Object.assign({className:"FontControl-module_fontBtn__DzO2A",onMouseDown:function(t){t.preventDefault(),c(!u)}},{children:h}),void 0),u?(0,o.jsx)("div",Object.assign({className:"FontControl-module_fontSizeMenu__1fJ2V"},{children:m}),void 0):null]},void 0)},wg=function(t){return(0,o.jsx)("button",Object.assign({className:F("TextButton-module_textButton__1kZkT",(0,r.Z)({},"TextButton-module_isActive__DLbeg",t.active)),title:t.button.command.toLowerCase(),onMouseDown:function(e){!function(e,n){e.preventDefault(),t.toggleStyle(n)}(e,t.button.command)}},{children:(0,o.jsx)(fc,{name:t.button.name},void 0)}),void 0)},xg=(0,or.ZP)(["font-size"]),Og=xg.styles,Eg=xg.customStyleFn,_g=[{command:I.Cv7.Bold,name:"text-bold"},{command:I.Cv7.Italic,name:"text-italic"},{command:I.Cv7.Subscript,name:"text-subscript"},{command:I.Cv7.Superscript,name:"text-superscript"}],Sg=Mt((function(t){return{formState:t.modal}}))((function(t){var e=t.formState,n=t.position,r=t.id,i=t.content?JSON.parse(t.content):null,a=(0,N.useState)(rr.EditorState.moveFocusToEnd(rr.EditorState.createWithContent((0,rr.convertFromRaw)(i||{blocks:[],entityMap:{}})))),s=(0,U.Z)(a,2),u=s[0],c=s[1],l=u.getCurrentInlineStyle(),f=(0,N.useCallback)((function(t){var e=u;switch(t){case I.Cv7.Subscript:l.has(I.Cv7.Superscript)&&(e=rr.RichUtils.toggleInlineStyle(e,I.Cv7.Superscript));break;case I.Cv7.Superscript:l.has(I.Cv7.Subscript)&&(e=rr.RichUtils.toggleInlineStyle(e,I.Cv7.Subscript))}e=rr.RichUtils.toggleInlineStyle(e,t),c(e)}),[l,u]);return(0,o.jsxs)(xf,Object.assign({className:"textEditor",title:"Text editor",params:t,result:function(){var t=u.getCurrentContent();return{content:t.hasText()?JSON.stringify((0,rr.convertToRaw)(t)):"",position:n,id:r}},valid:function(){return e.form.valid}},{children:[(0,o.jsxs)("ul",Object.assign({className:"Text-module_controlPanel__2lngv"},{children:[(0,o.jsx)(bg,{editorState:u,setEditorState:c,styles:Og},void 0),_g.map((function(t){return(0,o.jsx)(wg,{button:t,active:l.has(t.command),toggleStyle:f},t.name)}))]}),void 0),(0,o.jsx)("div",Object.assign({className:"Text-module_textEditorInput__32u83"},{children:(0,o.jsx)(rr.Editor,{keyBindingFn:function(t){return 13===t.keyCode&&t.stopPropagation(),(0,rr.getDefaultKeyBinding)(t)},editorState:u,onChange:function(t){c(t)},customStyleMap:{SUBSCRIPT:{verticalAlign:"sub",transform:"scale(0.7)",display:"inline-block",transformOrigin:"left"},SUPERSCRIPT:{verticalAlign:"super",transform:"scale(0.7)",display:"inline-block",transformOrigin:"left"}},customStyleFn:Eg},void 0)}),void 0)]}),void 0)})),jg={open:pv,analyse:Zp,recognize:Yp,"period-table":Rm,rgroup:Dm,attach:ug,templates:yg,about:gd,miew:Qp,atomProps:nv,attachmentPoints:ov,automap:sv,bondProps:cv,check:Pp,enhancedStereo:_v,labelEdit:Gv,rgroupLogic:hv,removeFG:function(t){var e=(0,Tl().getKetcherInstance)().editor,n=t.fgIds,r=function(e,n){t[e](n)};return(0,o.jsxs)("div",Object.assign({onSubmit:function(t){return t.preventDefault()},tabIndex:-1,className:"RemoveFG-module_window__1iNNt"},{children:[(0,o.jsx)("header",Object.assign({className:"RemoveFG-module_header__13O3F"},{children:"Edit Abbreviation"}),void 0),(0,o.jsx)("div",Object.assign({className:"RemoveFG-module_question__35_wx"},{children:"A change was detected for the abbreviation. Do you want to remove the abbreviation information from the structure and continue work with separate atoms and bonds?"}),void 0),(0,o.jsxs)("footer",Object.assign({className:"RemoveFG-module_footer__1n-yr"},{children:[(0,o.jsx)("input",{type:"button",value:"Cancel",className:"RemoveFG-module_buttonCancel__qspzZ",onClick:function(){return r("onOk",!1)}},void 0),(0,o.jsx)("input",{type:"button",value:"Remove Abbreviation",className:"RemoveFG-module_buttonOk__34PiS",onClick:function(){return r("onOk",function(){if(n.length>0){var t,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Mm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mm(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;e.update((0,I.U9$)(e.render.ctab,o))}}catch(t){r.e(t)}finally{r.f()}}return!0}())}},void 0)]}),void 0)]}),void 0)},save:wv,settings:bp,sgroup:tg,sdata:$m,text:Sg,fGroups:function(t){var e=t.onOk,n=t.onCancel,i=t.className,a=Lt(),s=Gt(Iv),u=Gt(Nv),c=(0,N.useState)(null),l=(0,U.Z)(c,2),f=l[0],h=l[1],d=(0,N.useState)(""),p=(0,U.Z)(d,2),v=p[0],m=p[1],g=(0,N.useState)({}),y=(0,U.Z)(g,2),b=y[0],w=y[1],x=(0,N.useMemo)((function(){return s.map((function(t){var e=t.struct.clone();return e.sgroups.forEach((function(t){I.J41.isFunctionalGroup(t)&&(t.data.expanded=!0)})),Zv(Zv({},t),{},{struct:e})}))}),[s]);(0,N.useEffect)((function(){w(function(t,e){var n=new RegExp((0,V.escapeRegExp)(kv(e)),"i");return(0,V.flow)((0,V.filter)((function(t){return!e||n.test(kv(t.struct.name))})),(0,V.reduce)((function(t,e){return t[e.props.group]?t[e.props.group].push(e):t[e.props.group]=[e],t}),{}))(t)}(x,v))}),[x,v]);var O=function(t){t&&t.struct.sgroups.forEach((function(t){I.J41.isFunctionalGroup(t)&&(t.data.expanded=!1)})),a(Zo({tool:"template",opts:t})),e()},E=function(){var t=f;return t?{struct:t.struct,aid:parseInt(String(t.props.atomid))||null,mode:u}:null},_=(new I.Ruh).serialize(s),S=Pl(),j=S.ref,A=S.width,P={onOk:O,onCancel:n,className:i};return(0,o.jsx)(xf,Object.assign({title:"Functional Groups",className:"functionalGroups-module_functionalGroups__29PxF",params:P,result:function(){return E()},buttons:[(0,o.jsx)(fp,Object.assign({data:_,filename:"ketcher-fg-tmpls.sdf"},{children:"Save To SDF…"}),"save-to-SDF"),"Cancel","OK"]},{children:(0,o.jsxs)("div",Object.assign({className:"functionalGroups-module_dialog_body__5BJFo"},{children:[(0,o.jsxs)("label",{children:["Filter:",(0,o.jsx)(Rd,{type:"search",value:v,onChange:function(t){return function(t){return m(t)}(t)}},void 0)]},void 0),(0,o.jsx)("div",Object.assign({className:F("functionalGroups-module_tableGroupWrap__3TEvj",(0,r.Z)({},"functionalGroups-module_singleColLayout__SpXJD",A&&A<310)),ref:j},{children:(0,o.jsx)(Mv,{templates:b["Functional Groups"],onSelect:function(t){t===f?O(E()):function(t){h(t)}(t)},selected:f},void 0)}),void 0)]}),void 0)}),void 0)}},Ag=["modal"];function Pg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kg(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pg(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pg(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Tg=Mt((function(t){return{modal:t.modal}}),(function(t){return{onOk:function(e){t({type:"MODAL_CLOSE"})},onCancel:function(){t({type:"MODAL_CLOSE"})}}}),(function(t,e){var n=t.modal&&t.modal.prop,r=n?(0,V.omit)(["onResult","onCancel"],n):{};return kg(kg({modal:t.modal},r),{},{onOk:function(t){n&&n.onResult&&n.onResult(t),e.onOk(t)},onCancel:function(){n&&n.onCancel&&n.onCancel(),e.onCancel()}})}))((function(t){var e=t.modal,n=(0,B.Z)(t,Ag),i=(0,N.useRef)(null),a=oe()({ref:i}),s=a.height,u=a.width;if(!e)return null;var c=jg[e.name];if(!c)throw new Error("There is no modal window named ".concat(e.name));return(0,o.jsx)("div",Object.assign({className:"Modal-module_modalOverlay__119Xk",ref:i},{children:(0,o.jsx)(c,Object.assign({className:F((0,r.Z)({},"Modal-module_smallScreen__gmFQ5",s&&s<=600||u&&u<=600))},n),void 0)}),void 0)}));function Cg(t,e){var r=(0,V.debounce)(100,(function(){return t({type:"UPDATE"})})),o=function(t){return new Promise((function(e){return setTimeout(e,t)}))};function i(t){var e=n.g.currentState,o=e.actionState.activeTool.tool;if("select"!==o){var i=e.toolbar.visibleTools.select,a=e.options.settings.resetToSelect;!0===a||a===o?t({type:"ACTION",action:vs[i].action}):r()}}return{onInit:function(e){t({type:"INIT",editor:e})},onChange:function(e){void 0===e?o(0).then((function(){return t(i)})):t(i)},onSelectionChange:function(){r()},onElementEdit:function(n){var r="text"===n.type?n:Oo(n),o=null;if("text"===r.type)return Rc(t,"text",r);if(I.eKO.get(r.label))o=Rc(t,"atomProps",r);else if(1===Object.keys(r).length&&"ap"in r)o=Rc(t,"attachmentPoints",r.ap).then((function(t){return{ap:t}}));else if("list"===r.type||"not-list"===r.type)o=Rc(t,"period-table",r);else if("rlabel"===r.type){var i=e().editor.struct().rgroups,a={type:"atom",values:r.values,disabledIds:Array.from(i.entries()).reduce((function(t,e){var n=(0,U.Z)(e,2),o=n[0];return n[1].frags.has(r.fragId)&&t.push(o),t}),[])};o=Rc(t,"rgroup",a).then((function(t){return{values:t.values,type:"rlabel"}}))}else o=Rc(t,"period-table",r);return o.then(Eo)},onEnhancedStereoEdit:function(e){var n=(0,et.Z)({},e);return o(0).then((function(){return n=function(t){if(null===t)return{type:null};var e=t.match(/\D+/g)[0],n=+t.replace(e,"");return e===I.YkY.Abs?{type:t,orNumber:1,andNumber:1}:e===I.YkY.And?{type:e,orNumber:1,andNumber:n}:e===I.YkY.Or?{type:e,orNumber:n,andNumber:1}:void 0}(n.stereoLabel),Rc(t,"enhancedStereo",{init:n}).then((function(t){return function(t){switch(t.type){case I.YkY.And:return"".concat(I.YkY.And).concat(t.andNumber||1);case I.YkY.Or:return"".concat(I.YkY.Or).concat(t.orNumber||1);default:return t.type}}(t)}),(function(){return null}))}))},onQuickEdit:function(e){return Rc(t,"labelEdit",e)},onBondEdit:function(e){return Rc(t,"bondProps",(n=e,{type:Po(n.type,n.stereo),topology:n.topology||0,center:n.reactingCenterStatus||0})).then(jo);var n},onRgroupEdit:function(n){var r=e().editor.struct();if(Object.keys(n).length>2){var o=Array.from(r.rgroups.keys());return n.range||(n.range=">0"),Rc(t,"rgroupLogic",Object.assign({rgroupLabels:o},n))}var i=Array.from(r.atoms.values()).reduce((function(t,e){return e.fragment===n.fragId&&null!==e.rglabel?t.concat(Oo(e).values):t}),[]),a={type:"fragment",values:[n.label],disabledIds:i};return Rc(t,"rgroup",a).then((function(t){return{label:t.values[0]}}))},onSgroupEdit:function(e){return o(0).then((function(){return Rc(t,"sgroup",To(e))})).then(Co)},onRemoveFG:function(e){return o(0).then((function(){return Rc(t,"removeFG",e)}))},onSdataEdit:function(e){return o(0).then((function(){return Rc(t,"DAT"===e.type?"sdata":"sgroup",To(e))})).then(Co)},onMessage:function(t){t.error},onAromatizeStruct:function(t){var n=e(),r=n.options.getServerSettings();return Fo(n.editor,n.server,"aromatize",r,t).catch((function(t){return n.editor.errorHandler(t)}))},onDearomatizeStruct:function(t){var n=e(),r=n.options.getServerSettings();return Fo(n.editor,n.server,"dearomatize",r,t).catch((function(t){return n.editor.errorHandler(t)}))},onMouseDown:function(){r()}}}var Rg=Mt((function(t){return{options:t.options.settings,indigoVerification:t.requestsStatuses.indigoVerification}}),(function(t){return t(Cg)}))(dd),Mg=Mt(null,{checkServer:function(){return function(t,e){var n=e(),r=n.editor;n.server.then((function(e){return t(Dr({indigoVersion:null==e?void 0:e.indigoVersion,imagoVersions:null==e?void 0:e.imagoVersions,server:null==e?void 0:e.isAvailable}))}),(function(t){return r.errorHandler(t)}))}}})((function(t){var e=Lt(),n=t.checkServer,r=Sl().staticResourcesUrl;return(0,N.useEffect)((function(){var t,o;n(),e((t=r,o=(0,k.Z)(C().mark((function e(n){var r,o,i,a,s,u;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="".concat(t,"/templates/").concat("fg.sdf"),o=I.uMq.getInstance(),i=new I.Ruh,e.next=6,Pc(r);case 6:a=e.sent,s=i.deserialize(a),u=s.reduce((function(t,e){var n=e.struct;return[].concat((0,ee.Z)(t),[n])}),[]),o.setFunctionalGroupsList(u),n(nl(s)),n(Dr({functionalGroups:!0}));case 12:case"end":return e.stop()}}),e)}))),function(t){return o.apply(this,arguments)}))}),[]),(0,o.jsxs)("div",Object.assign({className:"App-module_app__3T9Nw"},{children:[(0,o.jsx)(bf,{},void 0),(0,o.jsx)(Rg,{className:"App-module_canvas__3VtDU"},void 0),(0,o.jsx)(af,{className:"App-module_top__1VFT8"},void 0),(0,o.jsx)(Hl,{className:"App-module_left__1yaO0"},void 0),(0,o.jsx)(cl,{className:"App-module_bottom__1pipn"},void 0),(0,o.jsx)(Jl,{className:"App-module_right__2qnj3"},void 0),(0,o.jsx)(yf,{},void 0),(0,o.jsx)(Tg,{},void 0)]}),void 0)}));function Ig(t,e,n,r,i){var a=ul(n,r,i);a.dispatch(function(t){return function(e,n){var r=function(){var t,e={};return Object.keys(vs).forEach((function(n){(t=vs[n]).shortcut&&(Array.isArray(t.shortcut)?t.shortcut.forEach((function(t){pf(t,n,e)})):pf(t.shortcut,n,e))})),df(e)}();t.addEventListener("keydown",(function(t){return function(t,e,n,r){if(!e.modal){var o=e.editor,i=e.actionState,a=i.activeTool,s=df(r),u=o.selection()&&o.selection().atoms,c=null;if(s&&1===s.length&&u&&s.match(/\w/))Rc(t,"labelEdit",{letter:s}).then((function(e){t(Zo({tool:"atom",opts:e}))})).catch((function(){return null})),r.preventDefault();else if(void 0!==(c=df.lookup(n,r))){var l=function(t,e){var n=t.indexOf(e.tool);return t.forEach((function(t,r){(0,V.isEqual)(vs[t].action,e)&&(n=r)})),n}(c,a),f=c[l=(l+1)%c.length];if(i[f]&&!0===i[f].disabled)return void r.preventDefault();if(-1===xr.indexOf(f)){var h=vs[f].action;t(Zo(h)),r.preventDefault()}else window.clipboardData&&Or(r)}}}(e,n(),r,t)}))}}(t)),a.dispatch((function(t,e){var n=(0,V.throttle)(250,(function(){var n=e();n.editor.render.update(),t({type:"CLEAR_VISIBLE",data:n.actionState.activeTool})}));addEventListener("resize",n)})),W.render((0,o.jsx)(tt,Object.assign({store:a},{children:(0,o.jsx)(ur.Provider,Object.assign({value:{staticResourcesUrl:e}},{children:(0,o.jsx)(sr.Provider,Object.assign({value:{errorHandler:n.errorHandler}},{children:(0,o.jsx)(ar.Provider,Object.assign({value:{getKetcherInstance:function(){return window.ketcher}}},{children:(0,o.jsx)(Mg,{},void 0)}),void 0)}),void 0)}),void 0)}),void 0),t)}var Ng=function(){function t(){(0,R.Z)(this,t),(0,r.Z)(this,"structService",void 0),(0,r.Z)(this,"editor",void 0),(0,r.Z)(this,"serviceMode",void 0),(0,r.Z)(this,"formatterFactory",void 0),this.structService=null,this.editor=null,this.serviceMode=null,this.formatterFactory=null}var e,n;return(0,M.Z)(t,[{key:"appendApiAsync",value:(n=(0,k.Z)(C().mark((function t(e){return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.structService=ir(e,{"smart-layout":!0,"ignore-stereochemistry-errors":!0,"mass-skip-error-on-pseudoatoms":!1,"gross-formula-add-rsites":!0,"aromatize-skip-superatoms":!0});case 1:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"appendServiceMode",value:function(t){this.serviceMode=t}},{key:"appendUiAsync",value:(e=(0,k.Z)(C().mark((function t(e,n,r,o){var i,a;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.structService,t.next=3,new Promise((function(t){Ig(e,n,{buttons:o||{},errorHandler:r||null,version:"2.4.2",buildDate:"2022-02-21T15:06:53",buildNumber:""},i,t)}));case 3:a=t.sent,this.editor=a,this.editor.errorHandler=r&&"function"==typeof r?r:function(){},this.formatterFactory=new I.Yyn(i);case 7:case"end":return t.stop()}}),t,this)}))),function(t,n,r,o){return e.apply(this,arguments)})},{key:"build",value:function(){if(!this.serviceMode)throw new Error("You should append ServiceMode before building");if(!this.structService)throw new Error("You should append Api before building");if(!this.formatterFactory)throw new Error("You should append StructureServiceFactory before building");var t=new I.VA(this.editor,this.structService,this.formatterFactory);t[this.serviceMode]=!0;var e=new URLSearchParams(document.location.search).get("moll");return e&&t.setMolecule(e),t}}]),t}();function Bg(){return Bg=(0,k.Z)(C().mark((function t(e){var n,r,o,i,a,s;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.element,r=e.staticResourcesUrl,o=e.structServiceProvider,i=e.buttons,a=e.errorHandler,s=new Ng,t.next=4,s.appendApiAsync(o);case 4:return s.appendServiceMode(o.mode),t.next=7,s.appendUiAsync(n,r,a,i);case 7:return t.abrupt("return",s.build());case 8:case"end":return t.stop()}}),t)}))),Bg.apply(this,arguments)}function Zg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lg(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zg(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zg(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Dg(t){var e=(0,N.useRef)(null),n=t.onInit,i=Pl({ref:e}),a=i.height,s=i.width;return(0,N.useEffect)((function(){(function(t){return Bg.apply(this,arguments)})(Lg(Lg({},t),{},{element:e.current})).then((function(t){"function"==typeof n&&n(t)}))}),[]),(0,o.jsx)("div",{ref:e,className:F("Ketcher-root","Editor-module_editor__2b7ww",(0,r.Z)({},"Editor-module_small__15usy",a&&a<=600||s&&s<=1040))},void 0)}},76884:function(t,e,n){var r,o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a="a-z\\xdf-\\xf6\\xf8-\\xff",s="A-Z\\xc0-\\xd6\\xd8-\\xde",u="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",c="["+u+"]",l="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",f="\\d+",h="["+a+"]",d="[^\\ud800-\\udfff"+u+f+"\\u2700-\\u27bf"+a+s+"]",p="\\ud83c[\\udffb-\\udfff]",v="[^\\ud800-\\udfff]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="["+s+"]",b="(?:"+h+"|"+d+")",w="(?:"+y+"|"+d+")",x="(?:['’](?:d|ll|m|re|s|t|ve))?",O="(?:['’](?:D|LL|M|RE|S|T|VE))?",E="(?:"+l+"|"+p+")?",_="[\\ufe0e\\ufe0f]?",S=_+E+"(?:\\u200d(?:"+[v,m,g].join("|")+")"+_+E+")*",j="(?:"+["[\\u2700-\\u27bf]",m,g].join("|")+")"+S,A="(?:"+[v+l+"?",l,m,g,"[\\ud800-\\udfff]"].join("|")+")",P=RegExp("['’]","g"),k=RegExp(l,"g"),T=RegExp(p+"(?="+p+")|"+A+S,"g"),C=RegExp([y+"?"+h+"+"+x+"(?="+[c,y,"$"].join("|")+")",w+"+"+O+"(?="+[c,y+b,"$"].join("|")+")",y+"?"+b+"+"+x,y+"+"+O,f,j].join("|"),"g"),R=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),M=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,I="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,N="object"==typeof self&&self&&self.Object===Object&&self,B=I||N||Function("return this")(),Z=(r={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(t){return null==r?void 0:r[t]});function L(t){return R.test(t)}var D=Object.prototype.toString,z=B.Symbol,F=z?z.prototype:void 0,G=F?F.toString:void 0;function H(t){return null==t?"":function(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==D.call(t)}(t))return G?G.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}var V,U=(V=function(t,e,n){return e=e.toLowerCase(),t+(n?q(H(e).toLowerCase()):e)},function(t){return function(t,e,n,r){for(var o=-1,i=t?t.length:0;++o<i;)n=e(n,t[o],o,t);return n}(function(t,e,n){return t=H(t),void 0===e?function(t){return M.test(t)}(t)?function(t){return t.match(C)||[]}(t):function(t){return t.match(o)||[]}(t):t.match(e)||[]}(function(t){return(t=H(t))&&t.replace(i,Z).replace(k,"")}(t).replace(P,"")),V,"")}),q=("toUpperCase",function(t){var e,n,r,o,i=L(t=H(t))?function(t){return L(t)?function(t){return t.match(T)||[]}(t):function(t){return t.split("")}(t)}(t):void 0,a=i?i[0]:t.charAt(0),s=i?(e=i,n=1,o=e.length,r=void 0===r?o:r,!n&&r>=o?e:function(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}(e,n,r)).join(""):t.slice(1);return a.toUpperCase()+s});t.exports=U},47044:function(t,e,n){var r,o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a="a-z\\xdf-\\xf6\\xf8-\\xff",s="A-Z\\xc0-\\xd6\\xd8-\\xde",u="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",c="["+u+"]",l="\\d+",f="["+a+"]",h="[^\\ud800-\\udfff"+u+l+"\\u2700-\\u27bf"+a+s+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",v="["+s+"]",m="(?:"+f+"|"+h+")",g="(?:"+v+"|"+h+")",y="(?:['’](?:d|ll|m|re|s|t|ve))?",b="(?:['’](?:D|LL|M|RE|S|T|VE))?",w="(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?",x="[\\ufe0e\\ufe0f]?",O=x+w+"(?:\\u200d(?:"+["[^\\ud800-\\udfff]",d,p].join("|")+")"+x+w+")*",E="(?:"+["[\\u2700-\\u27bf]",d,p].join("|")+")"+O,_=RegExp("['’]","g"),S=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),j=RegExp([v+"?"+f+"+"+y+"(?="+[c,v,"$"].join("|")+")",g+"+"+b+"(?="+[c,v+m,"$"].join("|")+")",v+"?"+m+"+"+y,v+"+"+b,l,E].join("|"),"g"),A=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,P="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,k="object"==typeof self&&self&&self.Object===Object&&self,T=P||k||Function("return this")(),C=(r={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(t){return null==r?void 0:r[t]}),R=Object.prototype.toString,M=T.Symbol,I=M?M.prototype:void 0,N=I?I.toString:void 0;function B(t){return null==t?"":function(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==R.call(t)}(t))return N?N.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}var Z,L=(Z=function(t,e,n){return t+(n?"_":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var o=-1,i=t?t.length:0;++o<i;)n=e(n,t[o],o,t);return n}(function(t,e,n){return t=B(t),void 0===e?function(t){return A.test(t)}(t)?function(t){return t.match(j)||[]}(t):function(t){return t.match(o)||[]}(t):t.match(e)||[]}(function(t){return(t=B(t))&&t.replace(i,C).replace(S,"")}(t).replace(_,"")),Z,"")});t.exports=L},78230:function(t,e,n){var r=n(91387).runInContext();t.exports=n(84599)(r,r)},84599:function(t,e,n){var r=n(68836),o=n(69306),i=Array.prototype.push;function a(t,e){return 2==e?function(e,n){return t(e,n)}:function(e){return t(e)}}function s(t){for(var e=t?t.length:0,n=Array(e);e--;)n[e]=t[e];return n}function u(t,e){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=e.apply(void 0,r);return t.apply(void 0,r),o}}}t.exports=function t(e,n,c,l){var f="function"==typeof n,h=n===Object(n);if(h&&(l=c,c=n,n=void 0),null==c)throw new TypeError;l||(l={});var d=!("cap"in l)||l.cap,p=!("curry"in l)||l.curry,v=!("fixed"in l)||l.fixed,m=!("immutable"in l)||l.immutable,g=!("rearg"in l)||l.rearg,y=f?c:o,b="curry"in l&&l.curry,w="fixed"in l&&l.fixed,x="rearg"in l&&l.rearg,O=f?c.runInContext():void 0,E=f?c:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},_=E.ary,S=E.assign,j=E.clone,A=E.curry,P=E.forEach,k=E.isArray,T=E.isError,C=E.isFunction,R=E.isWeakMap,M=E.keys,I=E.rearg,N=E.toInteger,B=E.toPath,Z=M(r.aryMethod),L={castArray:function(t){return function(){var e=arguments[0];return k(e)?t(s(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],n=arguments[1],r=t(e,n),o=r.length;return d&&"number"==typeof n?(n=n>2?n-2:1,o&&o<=n?r:a(r,n)):r}},mixin:function(t){return function(e){var n=this;if(!C(n))return t(n,Object(e));var r=[];return P(M(e),(function(t){C(e[t])&&r.push([t,n.prototype[t]])})),t(n,Object(e)),P(r,(function(t){var e=t[1];C(e)?n.prototype[t[0]]=e:delete n.prototype[t[0]]})),n}},nthArg:function(t){return function(e){var n=e<0?1:N(e)+1;return A(t(e),n)}},rearg:function(t){return function(e,n){var r=n?n.length:0;return A(t(e,n),r)}},runInContext:function(n){return function(r){return t(e,n(r),l)}}};function D(t,e,n){if(v&&(w||!r.skipFixed[t])){var o=r.methodSpread[t],a=o&&o.start;return void 0===a?_(e,n):function(t,e){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var a=o[e],s=o.slice(0,e);return a&&i.apply(s,a),e!=r&&i.apply(s,o.slice(e+1)),t.apply(this,s)}}(e,a)}return e}function z(t,e,n){return g&&n>1&&(x||!r.skipRearg[t])?I(e,r.methodRearg[t]||r.aryRearg[n]):e}function F(t,e){for(var n=-1,r=(e=B(e)).length,o=r-1,i=j(Object(t)),a=i;null!=a&&++n<r;){var s=e[n],u=a[s];null==u||C(u)||T(u)||R(u)||(a[s]=j(n==o?u:Object(u))),a=a[s]}return i}function G(e,n){var o=r.aliasToReal[e]||e,i=r.remap[o]||o,a=l;return function(e){var r=f?O:E,s=f?O[i]:n,u=S(S({},a),e);return t(r,o,s,u)}}function H(t,e){return function(){var n=arguments.length;if(!n)return t();for(var r=Array(n);n--;)r[n]=arguments[n];var o=g?0:n-1;return r[o]=e(r[o]),t.apply(void 0,r)}}function V(t,e,n){var o,i=r.aliasToReal[t]||t,c=e,l=L[i];return l?c=l(e):m&&(r.mutate.array[i]?c=u(e,s):r.mutate.object[i]?c=u(e,function(t){return function(e){return t({},e)}}(e)):r.mutate.set[i]&&(c=u(e,F))),P(Z,(function(t){return P(r.aryMethod[t],(function(e){if(i==e){var n=r.methodSpread[i],s=n&&n.afterRearg;return o=s?D(i,z(i,c,t),t):z(i,D(i,c,t),t),o=function(t,e,n){return b||p&&n>1?A(e,n):e}(0,o=function(t,e){if(d){var n=r.iterateeRearg[t];if(n)return function(t,e){return H(t,(function(t){var n=e.length;return function(t,e){return 2==e?function(e,n){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}(I(a(t,n),e),n)}))}(e,n);var o=!f&&r.iterateeAry[t];if(o)return function(t,e){return H(t,(function(t){return"function"==typeof t?a(t,e):t}))}(e,o)}return e}(i,o),t),!1}})),!o})),o||(o=c),o==e&&(o=b?A(o,1):function(){return e.apply(this,arguments)}),o.convert=G(i,e),o.placeholder=e.placeholder=n,o}if(!h)return V(n,c,y);var U=c,q=[];return P(Z,(function(t){P(r.aryMethod[t],(function(t){var e=U[r.remap[t]||t];e&&q.push([t,V(t,e,U)])}))})),P(M(U),(function(t){var e=U[t];if("function"==typeof e){for(var n=q.length;n--;)if(q[n][0]==t)return;e.convert=G(t,e),q.push([t,e])}})),P(q,(function(t){U[t[0]]=t[1]})),U.convert=function(t){return U.runInContext.convert(t)(void 0)},U.placeholder=U,P(M(U),(function(t){P(r.realToAlias[t]||[],(function(e){U[e]=U[t]}))})),U}},68836:function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,n=e.aliasToReal,r={};for(var o in n){var i=n[o];t.call(r,i)?r[i].push(o):r[i]=[o]}return r}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},69306:function(t){t.exports={}},96486:function(t,e,n){var r;t=n.nmd(t),function(){var o,i="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,c=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",w="[object Function]",x="[object GeneratorFunction]",O="[object Map]",E="[object Number]",_="[object Object]",S="[object Promise]",j="[object RegExp]",A="[object Set]",P="[object String]",k="[object Symbol]",T="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",M="[object Float32Array]",I="[object Float64Array]",N="[object Int8Array]",B="[object Int16Array]",Z="[object Int32Array]",L="[object Uint8Array]",D="[object Uint8ClampedArray]",z="[object Uint16Array]",F="[object Uint32Array]",G=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,W=RegExp(U.source),Y=RegExp(q.source),$=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,gt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ot="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",_t="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",St="["+_t+"]",jt="["+xt+"]",At="\\d+",Pt="["+Ot+"]",kt="[^\\ud800-\\udfff"+_t+At+"\\u2700-\\u27bf"+Ot+Et+"]",Tt="\\ud83c[\\udffb-\\udfff]",Ct="[^\\ud800-\\udfff]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+Et+"]",Nt="(?:"+Pt+"|"+kt+")",Bt="(?:"+It+"|"+kt+")",Zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Lt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Dt="(?:"+jt+"|"+Tt+")?",zt="[\\ufe0e\\ufe0f]?",Ft=zt+Dt+"(?:\\u200d(?:"+[Ct,Rt,Mt].join("|")+")"+zt+Dt+")*",Gt="(?:"+["[\\u2700-\\u27bf]",Rt,Mt].join("|")+")"+Ft,Ht="(?:"+[Ct+jt+"?",jt,Rt,Mt,"[\\ud800-\\udfff]"].join("|")+")",Vt=RegExp("['’]","g"),Ut=RegExp(jt,"g"),qt=RegExp(Tt+"(?="+Tt+")|"+Ht+Ft,"g"),Wt=RegExp([It+"?"+Pt+"+"+Zt+"(?="+[St,It,"$"].join("|")+")",Bt+"+"+Lt+"(?="+[St,It+Nt,"$"].join("|")+")",It+"?"+Nt+"+"+Zt,It+"+"+Lt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",At,Gt].join("|"),"g"),Yt=RegExp("[\\u200d\\ud800-\\udfff"+xt+"\\ufe0e\\ufe0f]"),$t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Kt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Jt=-1,Xt={};Xt[M]=Xt[I]=Xt[N]=Xt[B]=Xt[Z]=Xt[L]=Xt[D]=Xt[z]=Xt[F]=!0,Xt[v]=Xt[m]=Xt[C]=Xt[g]=Xt[R]=Xt[y]=Xt[b]=Xt[w]=Xt[O]=Xt[E]=Xt[_]=Xt[j]=Xt[A]=Xt[P]=Xt[T]=!1;var Qt={};Qt[v]=Qt[m]=Qt[C]=Qt[R]=Qt[g]=Qt[y]=Qt[M]=Qt[I]=Qt[N]=Qt[B]=Qt[Z]=Qt[O]=Qt[E]=Qt[_]=Qt[j]=Qt[A]=Qt[P]=Qt[k]=Qt[L]=Qt[D]=Qt[z]=Qt[F]=!0,Qt[b]=Qt[w]=Qt[T]=!1;var te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ee=parseFloat,ne=parseInt,re="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,oe="object"==typeof self&&self&&self.Object===Object&&self,ie=re||oe||Function("return this")(),ae=e&&!e.nodeType&&e,se=ae&&t&&!t.nodeType&&t,ue=se&&se.exports===ae,ce=ue&&re.process,le=function(){try{return se&&se.require&&se.require("util").types||ce&&ce.binding&&ce.binding("util")}catch(t){}}(),fe=le&&le.isArrayBuffer,he=le&&le.isDate,de=le&&le.isMap,pe=le&&le.isRegExp,ve=le&&le.isSet,me=le&&le.isTypedArray;function ge(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ye(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var a=t[o];e(r,a,n(a),t)}return r}function be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function we(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Oe(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function Ee(t,e){return!(null==t||!t.length)&&Me(t,e,0)>-1}function _e(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Se(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function je(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Ae(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function Pe(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function ke(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Te=Ze("length");function Ce(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function Re(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Me(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Re(t,Ne,n)}function Ie(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Ne(t){return t!=t}function Be(t,e){var n=null==t?0:t.length;return n?ze(t,e)/n:h}function Ze(t){return function(e){return null==e?o:e[t]}}function Le(t){return function(e){return null==t?o:t[e]}}function De(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function ze(t,e){for(var n,r=-1,i=t.length;++r<i;){var a=e(t[r]);a!==o&&(n=n===o?a:n+a)}return n}function Fe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,sn(t)+1).replace(rt,""):t}function He(t){return function(e){return t(e)}}function Ve(t,e){return Se(e,(function(e){return t[e]}))}function Ue(t,e){return t.has(e)}function qe(t,e){for(var n=-1,r=t.length;++n<r&&Me(e,t[n],0)>-1;);return n}function We(t,e){for(var n=t.length;n--&&Me(e,t[n],0)>-1;);return n}function Ye(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var $e=Le({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ke=Le({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Je(t){return"\\"+te[t]}function Xe(t){return Yt.test(t)}function Qe(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function tn(t,e){return function(n){return t(e(n))}}function en(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==s||(t[n]=s,i[o++]=n)}return i}function nn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function on(t){return Xe(t)?function(t){for(var e=qt.lastIndex=0;qt.test(t);)++e;return e}(t):Te(t)}function an(t){return Xe(t)?function(t){return t.match(qt)||[]}(t):function(t){return t.split("")}(t)}function sn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var un=Le({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),cn=function t(e){var n,r=(e=null==e?ie:cn.defaults(ie.Object(),e,cn.pick(ie,Kt))).Array,ot=e.Date,xt=e.Error,Ot=e.Function,Et=e.Math,_t=e.Object,St=e.RegExp,jt=e.String,At=e.TypeError,Pt=r.prototype,kt=Ot.prototype,Tt=_t.prototype,Ct=e["__core-js_shared__"],Rt=kt.toString,Mt=Tt.hasOwnProperty,It=0,Nt=(n=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Bt=Tt.toString,Zt=Rt.call(_t),Lt=ie._,Dt=St("^"+Rt.call(Mt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=ue?e.Buffer:o,Ft=e.Symbol,Gt=e.Uint8Array,Ht=zt?zt.allocUnsafe:o,qt=tn(_t.getPrototypeOf,_t),Yt=_t.create,te=Tt.propertyIsEnumerable,re=Pt.splice,oe=Ft?Ft.isConcatSpreadable:o,ae=Ft?Ft.iterator:o,se=Ft?Ft.toStringTag:o,ce=function(){try{var t=li(_t,"defineProperty");return t({},"",{}),t}catch(t){}}(),le=e.clearTimeout!==ie.clearTimeout&&e.clearTimeout,Te=ot&&ot.now!==ie.Date.now&&ot.now,Le=e.setTimeout!==ie.setTimeout&&e.setTimeout,ln=Et.ceil,fn=Et.floor,hn=_t.getOwnPropertySymbols,dn=zt?zt.isBuffer:o,pn=e.isFinite,vn=Pt.join,mn=tn(_t.keys,_t),gn=Et.max,yn=Et.min,bn=ot.now,wn=e.parseInt,xn=Et.random,On=Pt.reverse,En=li(e,"DataView"),_n=li(e,"Map"),Sn=li(e,"Promise"),jn=li(e,"Set"),An=li(e,"WeakMap"),Pn=li(_t,"create"),kn=An&&new An,Tn={},Cn=Di(En),Rn=Di(_n),Mn=Di(Sn),In=Di(jn),Nn=Di(An),Bn=Ft?Ft.prototype:o,Zn=Bn?Bn.valueOf:o,Ln=Bn?Bn.toString:o;function Dn(t){if(ns(t)&&!Ua(t)&&!(t instanceof Hn)){if(t instanceof Gn)return t;if(Mt.call(t,"__wrapped__"))return zi(t)}return new Gn(t)}var zn=function(){function t(){}return function(e){if(!es(e))return{};if(Yt)return Yt(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function Fn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function Hn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new qn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Un(t);this.size=e.size}function $n(t,e){var n=Ua(t),r=!n&&Va(t),o=!n&&!r&&$a(t),i=!n&&!r&&!o&&ls(t),a=n||r||o||i,s=a?Fe(t.length,jt):[],u=s.length;for(var c in t)!e&&!Mt.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gi(c,u))||s.push(c);return s}function Kn(t){var e=t.length;return e?t[qr(0,e-1)]:o}function Jn(t,e){return Ii(Po(t),ar(e,0,t.length))}function Xn(t){return Ii(Po(t))}function Qn(t,e,n){(n!==o&&!Fa(t[e],n)||n===o&&!(e in t))&&or(t,e,n)}function tr(t,e,n){var r=t[e];Mt.call(t,e)&&Fa(r,n)&&(n!==o||e in t)||or(t,e,n)}function er(t,e){for(var n=t.length;n--;)if(Fa(t[n][0],e))return n;return-1}function nr(t,e,n,r){return fr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function rr(t,e){return t&&ko(e,Rs(e),t)}function or(t,e,n){"__proto__"==e&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,i=e.length,a=r(i),s=null==t;++n<i;)a[n]=s?o:As(t,e[n]);return a}function ar(t,e,n){return t==t&&(n!==o&&(t=t<=n?t:n),e!==o&&(t=t>=e?t:e)),t}function sr(t,e,n,r,i,a){var s,u=1&e,c=2&e,l=4&e;if(n&&(s=i?n(t,r,i,a):n(t)),s!==o)return s;if(!es(t))return t;var f=Ua(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Mt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Po(t,s)}else{var h=di(t),d=h==w||h==x;if($a(t))return Oo(t,u);if(h==_||h==v||d&&!i){if(s=c||d?{}:vi(t),!u)return c?function(t,e){return ko(t,hi(t),e)}(t,function(t,e){return t&&ko(e,Ms(e),t)}(s,t)):function(t,e){return ko(t,fi(t),e)}(t,rr(s,t))}else{if(!Qt[h])return i?t:{};s=function(t,e,n){var r,o=t.constructor;switch(e){case C:return Eo(t);case g:case y:return new o(+t);case R:return function(t,e){var n=e?Eo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case I:case N:case B:case Z:case L:case D:case z:case F:return _o(t,n);case O:return new o;case E:case P:return new o(t);case j:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case A:return new o;case k:return r=t,Zn?_t(Zn.call(r)):{}}}(t,h,u)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,s),ss(t)?t.forEach((function(r){s.add(sr(r,e,n,r,t,a))})):rs(t)&&t.forEach((function(r,o){s.set(o,sr(r,e,n,o,t,a))}));var m=f?o:(l?c?ri:ni:c?Ms:Rs)(t);return be(m||t,(function(r,o){m&&(r=t[o=r]),tr(s,o,sr(r,e,n,o,t,a))})),s}function ur(t,e,n){var r=n.length;if(null==t)return!r;for(t=_t(t);r--;){var i=n[r],a=e[i],s=t[i];if(s===o&&!(i in t)||!a(s))return!1}return!0}function cr(t,e,n){if("function"!=typeof t)throw new At(i);return Ti((function(){t.apply(o,n)}),e)}function lr(t,e,n,r){var o=-1,i=Ee,a=!0,s=t.length,u=[],c=e.length;if(!s)return u;n&&(e=Se(e,He(n))),r?(i=_e,a=!1):e.length>=200&&(i=Ue,a=!1,e=new Wn(e));t:for(;++o<s;){var l=t[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,a&&f==f){for(var h=c;h--;)if(e[h]===f)continue t;u.push(l)}else i(e,f,r)||u.push(l)}return u}Dn.templateSettings={escape:$,evaluate:K,interpolate:J,variable:"",imports:{_:Dn}},Dn.prototype=Fn.prototype,Dn.prototype.constructor=Dn,Gn.prototype=zn(Fn.prototype),Gn.prototype.constructor=Gn,Hn.prototype=zn(Fn.prototype),Hn.prototype.constructor=Hn,Vn.prototype.clear=function(){this.__data__=Pn?Pn(null):{},this.size=0},Vn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vn.prototype.get=function(t){var e=this.__data__;if(Pn){var n=e[t];return n===a?o:n}return Mt.call(e,t)?e[t]:o},Vn.prototype.has=function(t){var e=this.__data__;return Pn?e[t]!==o:Mt.call(e,t)},Vn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Pn&&e===o?a:e,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(t){var e=this.__data__,n=er(e,t);return!(n<0||(n==e.length-1?e.pop():re.call(e,n,1),--this.size,0))},Un.prototype.get=function(t){var e=this.__data__,n=er(e,t);return n<0?o:e[n][1]},Un.prototype.has=function(t){return er(this.__data__,t)>-1},Un.prototype.set=function(t,e){var n=this.__data__,r=er(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(_n||Un),string:new Vn}},qn.prototype.delete=function(t){var e=ui(this,t).delete(t);return this.size-=e?1:0,e},qn.prototype.get=function(t){return ui(this,t).get(t)},qn.prototype.has=function(t){return ui(this,t).has(t)},qn.prototype.set=function(t,e){var n=ui(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Wn.prototype.add=Wn.prototype.push=function(t){return this.__data__.set(t,a),this},Wn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Un,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!_n||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(t,e),this.size=n.size,this};var fr=Ro(br),hr=Ro(wr,!0);function dr(t,e){var n=!0;return fr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function pr(t,e,n){for(var r=-1,i=t.length;++r<i;){var a=t[r],s=e(a);if(null!=s&&(u===o?s==s&&!cs(s):n(s,u)))var u=s,c=a}return c}function vr(t,e){var n=[];return fr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function mr(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=mi),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?mr(s,e-1,n,r,o):je(o,s):r||(o[o.length]=s)}return o}var gr=Mo(),yr=Mo(!0);function br(t,e){return t&&gr(t,e,Rs)}function wr(t,e){return t&&yr(t,e,Rs)}function xr(t,e){return Oe(e,(function(e){return Xa(t[e])}))}function Or(t,e){for(var n=0,r=(e=yo(e,t)).length;null!=t&&n<r;)t=t[Li(e[n++])];return n&&n==r?t:o}function Er(t,e,n){var r=e(t);return Ua(t)?r:je(r,n(t))}function _r(t){return null==t?t===o?"[object Undefined]":"[object Null]":se&&se in _t(t)?function(t){var e=Mt.call(t,se),n=t[se];try{t[se]=o;var r=!0}catch(t){}var i=Bt.call(t);return r&&(e?t[se]=n:delete t[se]),i}(t):function(t){return Bt.call(t)}(t)}function Sr(t,e){return t>e}function jr(t,e){return null!=t&&Mt.call(t,e)}function Ar(t,e){return null!=t&&e in _t(t)}function Pr(t,e,n){for(var i=n?_e:Ee,a=t[0].length,s=t.length,u=s,c=r(s),l=1/0,f=[];u--;){var h=t[u];u&&e&&(h=Se(h,He(e))),l=yn(h.length,l),c[u]=!n&&(e||a>=120&&h.length>=120)?new Wn(u&&h):o}h=t[0];var d=-1,p=c[0];t:for(;++d<a&&f.length<l;){var v=h[d],m=e?e(v):v;if(v=n||0!==v?v:0,!(p?Ue(p,m):i(f,m,n))){for(u=s;--u;){var g=c[u];if(!(g?Ue(g,m):i(t[u],m,n)))continue t}p&&p.push(m),f.push(v)}}return f}function kr(t,e,n){var r=null==(t=ji(t,e=yo(e,t)))?t:t[Li(Ji(e))];return null==r?o:ge(r,t,n)}function Tr(t){return ns(t)&&_r(t)==v}function Cr(t,e,n,r,i){return t===e||(null==t||null==e||!ns(t)&&!ns(e)?t!=t&&e!=e:function(t,e,n,r,i,a){var s=Ua(t),u=Ua(e),c=s?m:di(t),l=u?m:di(e),f=(c=c==v?_:c)==_,h=(l=l==v?_:l)==_,d=c==l;if(d&&$a(t)){if(!$a(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Yn),s||ls(t)?ti(t,e,n,r,i,a):function(t,e,n,r,o,i,a){switch(n){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!i(new Gt(t),new Gt(e)));case g:case y:case E:return Fa(+t,+e);case b:return t.name==e.name&&t.message==e.message;case j:case P:return t==e+"";case O:var s=Qe;case A:var u=1&r;if(s||(s=nn),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var l=ti(s(t),s(e),r,o,i,a);return a.delete(t),l;case k:if(Zn)return Zn.call(t)==Zn.call(e)}return!1}(t,e,c,n,r,i,a);if(!(1&n)){var p=f&&Mt.call(t,"__wrapped__"),w=h&&Mt.call(e,"__wrapped__");if(p||w){var x=p?t.value():t,S=w?e.value():e;return a||(a=new Yn),i(x,S,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,i,a){var s=1&n,u=ni(t),c=u.length;if(c!=ni(e).length&&!s)return!1;for(var l=c;l--;){var f=u[l];if(!(s?f in e:Mt.call(e,f)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=s;++l<c;){var m=t[f=u[l]],g=e[f];if(r)var y=s?r(g,m,f,e,t,a):r(m,g,f,t,e,a);if(!(y===o?m===g||i(m,g,n,r,a):y)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,i,a))}(t,e,n,r,Cr,i))}function Rr(t,e,n,r){var i=n.length,a=i,s=!r;if(null==t)return!a;for(t=_t(t);i--;){var u=n[i];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++i<a;){var c=(u=n[i])[0],l=t[c],f=u[1];if(s&&u[2]){if(l===o&&!(c in t))return!1}else{var h=new Yn;if(r)var d=r(l,f,c,t,e,h);if(!(d===o?Cr(f,l,3,r,h):d))return!1}}return!0}function Mr(t){return!(!es(t)||(e=t,Nt&&Nt in e))&&(Xa(t)?Dt:vt).test(Di(t));var e}function Ir(t){return"function"==typeof t?t:null==t?ou:"object"==typeof t?Ua(t)?Dr(t[0],t[1]):Lr(t):du(t)}function Nr(t){if(!Oi(t))return mn(t);var e=[];for(var n in _t(t))Mt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Br(t,e){return t<e}function Zr(t,e){var n=-1,o=Wa(t)?r(t.length):[];return fr(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}function Lr(t){var e=ci(t);return 1==e.length&&e[0][2]?_i(e[0][0],e[0][1]):function(n){return n===t||Rr(n,t,e)}}function Dr(t,e){return bi(t)&&Ei(e)?_i(Li(t),e):function(n){var r=As(n,t);return r===o&&r===e?Ps(n,t):Cr(e,r,3)}}function zr(t,e,n,r,i){t!==e&&gr(e,(function(a,s){if(i||(i=new Yn),es(a))!function(t,e,n,r,i,a,s){var u=Pi(t,n),c=Pi(e,n),l=s.get(c);if(l)Qn(t,n,l);else{var f=a?a(u,c,n+"",t,e,s):o,h=f===o;if(h){var d=Ua(c),p=!d&&$a(c),v=!d&&!p&&ls(c);f=c,d||p||v?Ua(u)?f=u:Ya(u)?f=Po(u):p?(h=!1,f=Oo(c,!0)):v?(h=!1,f=_o(c,!0)):f=[]:is(c)||Va(c)?(f=u,Va(u)?f=ys(u):es(u)&&!Xa(u)||(f=vi(c))):h=!1}h&&(s.set(c,f),i(f,c,r,a,s),s.delete(c)),Qn(t,n,f)}}(t,e,s,n,zr,r,i);else{var u=r?r(Pi(t,s),a,s+"",t,e,i):o;u===o&&(u=a),Qn(t,s,u)}}),Ms)}function Fr(t,e){var n=t.length;if(n)return gi(e+=e<0?n:0,n)?t[e]:o}function Gr(t,e,n){e=e.length?Se(e,(function(t){return Ua(t)?function(e){return Or(e,1===t.length?t[0]:t)}:t})):[ou];var r=-1;e=Se(e,He(si()));var o=Zr(t,(function(t,n,o){var i=Se(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var u=So(o[r],i[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(o)}function Hr(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=Or(t,a);n(s,a)&&Jr(i,yo(a,t),s)}return i}function Vr(t,e,n,r){var o=r?Ie:Me,i=-1,a=e.length,s=t;for(t===e&&(e=Po(e)),n&&(s=Se(t,He(n)));++i<a;)for(var u=0,c=e[i],l=n?n(c):c;(u=o(s,l,u,r))>-1;)s!==t&&re.call(s,u,1),re.call(t,u,1);return t}function Ur(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;gi(o)?re.call(t,o,1):co(t,o)}}return t}function qr(t,e){return t+fn(xn()*(e-t+1))}function Wr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=fn(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return Ci(Si(t,e,ou),t+"")}function $r(t){return Kn(Fs(t))}function Kr(t,e){var n=Fs(t);return Ii(n,ar(e,0,n.length))}function Jr(t,e,n,r){if(!es(t))return t;for(var i=-1,a=(e=yo(e,t)).length,s=a-1,u=t;null!=u&&++i<a;){var c=Li(e[i]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(i!=s){var f=u[c];(l=r?r(f,c,u):o)===o&&(l=es(f)?f:gi(e[i+1])?[]:{})}tr(u,c,l),u=u[c]}return t}var Xr=kn?function(t,e){return kn.set(t,e),t}:ou,Qr=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:eu(e),writable:!0})}:ou;function to(t){return Ii(Fs(t))}function eo(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=r(i);++o<i;)a[o]=t[o+e];return a}function no(t,e){var n;return fr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function ro(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=t[i];null!==a&&!cs(a)&&(n?a<=e:a<e)?r=i+1:o=i}return o}return oo(t,e,ou,n)}function oo(t,e,n,r){var i=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,c=cs(e),l=e===o;i<a;){var f=fn((i+a)/2),h=n(t[f]),d=h!==o,p=null===h,v=h==h,m=cs(h);if(s)var g=r||v;else g=l?v&&(r||d):u?v&&d&&(r||!p):c?v&&d&&!p&&(r||!m):!p&&!m&&(r?h<=e:h<e);g?i=f+1:a=f}return yn(a,4294967294)}function io(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Fa(s,u)){var u=s;i[o++]=0===a?0:a}}return i}function ao(t){return"number"==typeof t?t:cs(t)?h:+t}function so(t){if("string"==typeof t)return t;if(Ua(t))return Se(t,so)+"";if(cs(t))return Ln?Ln.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function uo(t,e,n){var r=-1,o=Ee,i=t.length,a=!0,s=[],u=s;if(n)a=!1,o=_e;else if(i>=200){var c=e?null:Yo(t);if(c)return nn(c);a=!1,o=Ue,u=new Wn}else u=e?[]:s;t:for(;++r<i;){var l=t[r],f=e?e(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),s.push(l)}else o(u,f,n)||(u!==s&&u.push(f),s.push(l))}return s}function co(t,e){return null==(t=ji(t,e=yo(e,t)))||delete t[Li(Ji(e))]}function lo(t,e,n,r){return Jr(t,e,n(Or(t,e)),r)}function fo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?eo(t,r?0:i,r?i+1:o):eo(t,r?i+1:0,r?o:i)}function ho(t,e){var n=t;return n instanceof Hn&&(n=n.value()),Ae(e,(function(t,e){return e.func.apply(e.thisArg,je([t],e.args))}),n)}function po(t,e,n){var o=t.length;if(o<2)return o?uo(t[0]):[];for(var i=-1,a=r(o);++i<o;)for(var s=t[i],u=-1;++u<o;)u!=i&&(a[i]=lr(a[i]||s,t[u],e,n));return uo(mr(a,1),e,n)}function vo(t,e,n){for(var r=-1,i=t.length,a=e.length,s={};++r<i;){var u=r<a?e[r]:o;n(s,t[r],u)}return s}function mo(t){return Ya(t)?t:[]}function go(t){return"function"==typeof t?t:ou}function yo(t,e){return Ua(t)?t:bi(t,e)?[t]:Zi(bs(t))}var bo=Yr;function wo(t,e,n){var r=t.length;return n=n===o?r:n,!e&&n>=r?t:eo(t,e,n)}var xo=le||function(t){return ie.clearTimeout(t)};function Oo(t,e){if(e)return t.slice();var n=t.length,r=Ht?Ht(n):new t.constructor(n);return t.copy(r),r}function Eo(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function _o(t,e){var n=e?Eo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function So(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,a=cs(t),s=e!==o,u=null===e,c=e==e,l=cs(e);if(!u&&!l&&!a&&t>e||a&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&t<e||l&&n&&i&&!r&&!a||u&&n&&i||!s&&i||!c)return-1}return 0}function jo(t,e,n,o){for(var i=-1,a=t.length,s=n.length,u=-1,c=e.length,l=gn(a-s,0),f=r(c+l),h=!o;++u<c;)f[u]=e[u];for(;++i<s;)(h||i<a)&&(f[n[i]]=t[i]);for(;l--;)f[u++]=t[i++];return f}function Ao(t,e,n,o){for(var i=-1,a=t.length,s=-1,u=n.length,c=-1,l=e.length,f=gn(a-u,0),h=r(f+l),d=!o;++i<f;)h[i]=t[i];for(var p=i;++c<l;)h[p+c]=e[c];for(;++s<u;)(d||i<a)&&(h[p+n[s]]=t[i++]);return h}function Po(t,e){var n=-1,o=t.length;for(e||(e=r(o));++n<o;)e[n]=t[n];return e}function ko(t,e,n,r){var i=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],c=r?r(n[u],t[u],u,n,t):o;c===o&&(c=t[u]),i?or(n,u,c):tr(n,u,c)}return n}function To(t,e){return function(n,r){var o=Ua(n)?ye:nr,i=e?e():{};return o(n,t,si(r,2),i)}}function Co(t){return Yr((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,s=i>2?n[2]:o;for(a=t.length>3&&"function"==typeof a?(i--,a):o,s&&yi(n[0],n[1],s)&&(a=i<3?o:a,i=1),e=_t(e);++r<i;){var u=n[r];u&&t(e,u,r,a)}return e}))}function Ro(t,e){return function(n,r){if(null==n)return n;if(!Wa(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=_t(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Mo(t){return function(e,n,r){for(var o=-1,i=_t(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}function Io(t){return function(e){var n=Xe(e=bs(e))?an(e):o,r=n?n[0]:e.charAt(0),i=n?wo(n,1).join(""):e.slice(1);return r[t]()+i}}function No(t){return function(e){return Ae(Xs(Vs(e).replace(Vt,"")),t,"")}}function Bo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=zn(t.prototype),r=t.apply(n,e);return es(r)?r:n}}function Zo(t){return function(e,n,r){var i=_t(e);if(!Wa(e)){var a=si(n,3);e=Rs(e),n=function(t){return a(i[t],t,i)}}var s=t(e,n,r);return s>-1?i[a?e[s]:s]:o}}function Lo(t){return ei((function(e){var n=e.length,r=n,a=Gn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new At(i);if(a&&!u&&"wrapper"==ii(s))var u=new Gn([],!0)}for(r=u?r:n;++r<n;){var c=ii(s=e[r]),l="wrapper"==c?oi(s):o;u=l&&wi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[ii(l[0])].apply(u,l[3]):1==s.length&&wi(s)?u[c]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Ua(r))return u.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}function Do(t,e,n,i,a,s,u,l,f,h){var d=e&c,p=1&e,v=2&e,m=24&e,g=512&e,y=v?o:Bo(t);return function o(){for(var c=arguments.length,b=r(c),w=c;w--;)b[w]=arguments[w];if(m)var x=ai(o),O=Ye(b,x);if(i&&(b=jo(b,i,a,m)),s&&(b=Ao(b,s,u,m)),c-=O,m&&c<h){var E=en(b,x);return qo(t,e,Do,o.placeholder,n,b,E,l,f,h-c)}var _=p?n:this,S=v?_[t]:t;return c=b.length,l?b=Ai(b,l):g&&c>1&&b.reverse(),d&&f<c&&(b.length=f),this&&this!==ie&&this instanceof o&&(S=y||Bo(S)),S.apply(_,b)}}function zo(t,e){return function(n,r){return function(t,e,n,r){return br(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function Fo(t,e){return function(n,r){var i;if(n===o&&r===o)return e;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=so(n),r=so(r)):(n=ao(n),r=ao(r)),i=t(n,r)}return i}}function Go(t){return ei((function(e){return e=Se(e,He(si())),Yr((function(n){var r=this;return t(e,(function(t){return ge(t,r,n)}))}))}))}function Ho(t,e){var n=(e=e===o?" ":so(e)).length;if(n<2)return n?Wr(e,t):e;var r=Wr(e,ln(t/on(e)));return Xe(e)?wo(an(r),0,t).join(""):r.slice(0,t)}function Vo(t){return function(e,n,i){return i&&"number"!=typeof i&&yi(e,n,i)&&(n=i=o),e=ps(e),n===o?(n=e,e=0):n=ps(n),function(t,e,n,o){for(var i=-1,a=gn(ln((e-t)/(n||1)),0),s=r(a);a--;)s[o?a:++i]=t,t+=n;return s}(e,n,i=i===o?e<n?1:-1:ps(i),t)}}function Uo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=gs(e),n=gs(n)),t(e,n)}}function qo(t,e,n,r,i,a,s,c,l,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,i,h?a:o,h?s:o,h?o:a,h?o:s,c,l,f],p=n.apply(o,d);return wi(t)&&ki(p,d),p.placeholder=r,Ri(p,t,e)}function Wo(t){var e=Et[t];return function(t,n){if(t=gs(t),(n=null==n?0:yn(vs(n),292))&&pn(t)){var r=(bs(t)+"e").split("e");return+((r=(bs(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Yo=jn&&1/nn(new jn([,-0]))[1]==l?function(t){return new jn(t)}:cu;function $o(t){return function(e){var n=di(e);return n==O?Qe(e):n==A?rn(e):function(t,e){return Se(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ko(t,e,n,a,l,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new At(i);var v=a?a.length:0;if(v||(e&=-97,a=l=o),h=h===o?h:gn(vs(h),0),d=d===o?d:vs(d),v-=l?l.length:0,64&e){var m=a,g=l;a=l=o}var y=p?o:oi(t),b=[t,e,n,a,l,m,g,f,h,d];if(y&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<131,a=r==c&&8==n||r==c&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!i&&!a)return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var u=e[3];if(u){var l=t[3];t[3]=l?jo(l,u,e[4]):u,t[4]=l?en(t[3],s):e[4]}(u=e[5])&&(l=t[5],t[5]=l?Ao(l,u,e[6]):u,t[6]=l?en(t[5],s):e[6]),(u=e[7])&&(t[7]=u),r&c&&(t[8]=null==t[8]?e[8]:yn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(b,y),t=b[0],e=b[1],n=b[2],a=b[3],l=b[4],!(d=b[9]=b[9]===o?p?0:t.length:gn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)w=8==e||16==e?function(t,e,n){var i=Bo(t);return function a(){for(var s=arguments.length,u=r(s),c=s,l=ai(a);c--;)u[c]=arguments[c];var f=s<3&&u[0]!==l&&u[s-1]!==l?[]:en(u,l);return(s-=f.length)<n?qo(t,e,Do,a.placeholder,o,u,f,o,o,n-s):ge(this&&this!==ie&&this instanceof a?i:t,this,u)}}(t,e,d):e!=u&&33!=e||l.length?Do.apply(o,b):function(t,e,n,o){var i=1&e,a=Bo(t);return function e(){for(var s=-1,u=arguments.length,c=-1,l=o.length,f=r(l+u),h=this&&this!==ie&&this instanceof e?a:t;++c<l;)f[c]=o[c];for(;u--;)f[c++]=arguments[++s];return ge(h,i?n:this,f)}}(t,e,n,a);else var w=function(t,e,n){var r=1&e,o=Bo(t);return function e(){return(this&&this!==ie&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return Ri((y?Xr:ki)(w,b),t,e)}function Jo(t,e,n,r){return t===o||Fa(t,Tt[n])&&!Mt.call(r,n)?e:t}function Xo(t,e,n,r,i,a){return es(t)&&es(e)&&(a.set(e,t),zr(t,e,o,Xo,a),a.delete(e)),t}function Qo(t){return is(t)?o:t}function ti(t,e,n,r,i,a){var s=1&n,u=t.length,c=e.length;if(u!=c&&!(s&&c>u))return!1;var l=a.get(t),f=a.get(e);if(l&&f)return l==e&&f==t;var h=-1,d=!0,p=2&n?new Wn:o;for(a.set(t,e),a.set(e,t);++h<u;){var v=t[h],m=e[h];if(r)var g=s?r(m,v,h,e,t,a):r(v,m,h,t,e,a);if(g!==o){if(g)continue;d=!1;break}if(p){if(!ke(e,(function(t,e){if(!Ue(p,e)&&(v===t||i(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==m&&!i(v,m,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function ei(t){return Ci(Si(t,o,qi),t+"")}function ni(t){return Er(t,Rs,fi)}function ri(t){return Er(t,Ms,hi)}var oi=kn?function(t){return kn.get(t)}:cu;function ii(t){for(var e=t.name+"",n=Tn[e],r=Mt.call(Tn,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ai(t){return(Mt.call(Dn,"placeholder")?Dn:t).placeholder}function si(){var t=Dn.iteratee||iu;return t=t===iu?Ir:t,arguments.length?t(arguments[0],arguments[1]):t}function ui(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function ci(t){for(var e=Rs(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Ei(o)]}return e}function li(t,e){var n=function(t,e){return null==t?o:t[e]}(t,e);return Mr(n)?n:o}var fi=hn?function(t){return null==t?[]:(t=_t(t),Oe(hn(t),(function(e){return te.call(t,e)})))}:mu,hi=hn?function(t){for(var e=[];t;)je(e,fi(t)),t=qt(t);return e}:mu,di=_r;function pi(t,e,n){for(var r=-1,o=(e=yo(e,t)).length,i=!1;++r<o;){var a=Li(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ts(o)&&gi(a,o)&&(Ua(t)||Va(t))}function vi(t){return"function"!=typeof t.constructor||Oi(t)?{}:zn(qt(t))}function mi(t){return Ua(t)||Va(t)||!!(oe&&t&&t[oe])}function gi(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&gt.test(t))&&t>-1&&t%1==0&&t<e}function yi(t,e,n){if(!es(n))return!1;var r=typeof e;return!!("number"==r?Wa(n)&&gi(e,n.length):"string"==r&&e in n)&&Fa(n[e],t)}function bi(t,e){if(Ua(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!cs(t))||Q.test(t)||!X.test(t)||null!=e&&t in _t(e)}function wi(t){var e=ii(t),n=Dn[e];if("function"!=typeof n||!(e in Hn.prototype))return!1;if(t===n)return!0;var r=oi(n);return!!r&&t===r[0]}(En&&di(new En(new ArrayBuffer(1)))!=R||_n&&di(new _n)!=O||Sn&&di(Sn.resolve())!=S||jn&&di(new jn)!=A||An&&di(new An)!=T)&&(di=function(t){var e=_r(t),n=e==_?t.constructor:o,r=n?Di(n):"";if(r)switch(r){case Cn:return R;case Rn:return O;case Mn:return S;case In:return A;case Nn:return T}return e});var xi=Ct?Xa:gu;function Oi(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Tt)}function Ei(t){return t==t&&!es(t)}function _i(t,e){return function(n){return null!=n&&n[t]===e&&(e!==o||t in _t(n))}}function Si(t,e,n){return e=gn(e===o?t.length-1:e,0),function(){for(var o=arguments,i=-1,a=gn(o.length-e,0),s=r(a);++i<a;)s[i]=o[e+i];i=-1;for(var u=r(e+1);++i<e;)u[i]=o[i];return u[e]=n(s),ge(t,this,u)}}function ji(t,e){return e.length<2?t:Or(t,eo(e,0,-1))}function Ai(t,e){for(var n=t.length,r=yn(e.length,n),i=Po(t);r--;){var a=e[r];t[r]=gi(a,n)?i[a]:o}return t}function Pi(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var ki=Mi(Xr),Ti=Le||function(t,e){return ie.setTimeout(t,e)},Ci=Mi(Qr);function Ri(t,e,n){var r=e+"";return Ci(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return be(p,(function(n){var r="_."+n[0];e&n[1]&&!Ee(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(st):[]}(r),n)))}function Mi(t){var e=0,n=0;return function(){var r=bn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(o,arguments)}}function Ii(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n<e;){var a=qr(n,i),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Ni,Bi,Zi=(Ni=Na((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,o){e.push(r?o.replace(lt,"$1"):n||t)})),e}),(function(t){return 500===Bi.size&&Bi.clear(),t})),Bi=Ni.cache,Ni);function Li(t){if("string"==typeof t||cs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Di(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function zi(t){if(t instanceof Hn)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=Po(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fi=Yr((function(t,e){return Ya(t)?lr(t,mr(e,1,Ya,!0)):[]})),Gi=Yr((function(t,e){var n=Ji(e);return Ya(n)&&(n=o),Ya(t)?lr(t,mr(e,1,Ya,!0),si(n,2)):[]})),Hi=Yr((function(t,e){var n=Ji(e);return Ya(n)&&(n=o),Ya(t)?lr(t,mr(e,1,Ya,!0),o,n):[]}));function Vi(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=gn(r+o,0)),Re(t,si(e,3),o)}function Ui(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==o&&(i=vs(n),i=n<0?gn(r+i,0):yn(i,r-1)),Re(t,si(e,3),i,!0)}function qi(t){return null!=t&&t.length?mr(t,1):[]}function Wi(t){return t&&t.length?t[0]:o}var Yi=Yr((function(t){var e=Se(t,mo);return e.length&&e[0]===t[0]?Pr(e):[]})),$i=Yr((function(t){var e=Ji(t),n=Se(t,mo);return e===Ji(n)?e=o:n.pop(),n.length&&n[0]===t[0]?Pr(n,si(e,2)):[]})),Ki=Yr((function(t){var e=Ji(t),n=Se(t,mo);return(e="function"==typeof e?e:o)&&n.pop(),n.length&&n[0]===t[0]?Pr(n,o,e):[]}));function Ji(t){var e=null==t?0:t.length;return e?t[e-1]:o}var Xi=Yr(Qi);function Qi(t,e){return t&&t.length&&e&&e.length?Vr(t,e):t}var ta=ei((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Ur(t,Se(e,(function(t){return gi(t,n)?+t:t})).sort(So)),r}));function ea(t){return null==t?t:On.call(t)}var na=Yr((function(t){return uo(mr(t,1,Ya,!0))})),ra=Yr((function(t){var e=Ji(t);return Ya(e)&&(e=o),uo(mr(t,1,Ya,!0),si(e,2))})),oa=Yr((function(t){var e=Ji(t);return e="function"==typeof e?e:o,uo(mr(t,1,Ya,!0),o,e)}));function ia(t){if(!t||!t.length)return[];var e=0;return t=Oe(t,(function(t){if(Ya(t))return e=gn(t.length,e),!0})),Fe(e,(function(e){return Se(t,Ze(e))}))}function aa(t,e){if(!t||!t.length)return[];var n=ia(t);return null==e?n:Se(n,(function(t){return ge(e,o,t)}))}var sa=Yr((function(t,e){return Ya(t)?lr(t,e):[]})),ua=Yr((function(t){return po(Oe(t,Ya))})),ca=Yr((function(t){var e=Ji(t);return Ya(e)&&(e=o),po(Oe(t,Ya),si(e,2))})),la=Yr((function(t){var e=Ji(t);return e="function"==typeof e?e:o,po(Oe(t,Ya),o,e)})),fa=Yr(ia),ha=Yr((function(t){var e=t.length,n=e>1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,aa(t,n)}));function da(t){var e=Dn(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var va=ei((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Hn&&gi(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:pa,args:[i],thisArg:o}),new Gn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)})),ma=To((function(t,e,n){Mt.call(t,n)?++t[n]:or(t,n,1)})),ga=Zo(Vi),ya=Zo(Ui);function ba(t,e){return(Ua(t)?be:fr)(t,si(e,3))}function wa(t,e){return(Ua(t)?we:hr)(t,si(e,3))}var xa=To((function(t,e,n){Mt.call(t,n)?t[n].push(e):or(t,n,[e])})),Oa=Yr((function(t,e,n){var o=-1,i="function"==typeof e,a=Wa(t)?r(t.length):[];return fr(t,(function(t){a[++o]=i?ge(e,t,n):kr(t,e,n)})),a})),Ea=To((function(t,e,n){or(t,n,e)}));function _a(t,e){return(Ua(t)?Se:Zr)(t,si(e,3))}var Sa=To((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),ja=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&yi(t,e[0],e[1])?e=[]:n>2&&yi(e[0],e[1],e[2])&&(e=[e[0]]),Gr(t,mr(e,1),[])})),Aa=Te||function(){return ie.Date.now()};function Pa(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,Ko(t,c,o,o,o,o,e)}function ka(t,e){var n;if("function"!=typeof e)throw new At(i);return t=vs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var Ta=Yr((function(t,e,n){var r=1;if(n.length){var o=en(n,ai(Ta));r|=u}return Ko(t,r,e,n,o)})),Ca=Yr((function(t,e,n){var r=3;if(n.length){var o=en(n,ai(Ca));r|=u}return Ko(e,r,t,n,o)}));function Ra(t,e,n){var r,a,s,u,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new At(i);function v(e){var n=r,i=a;return r=a=o,f=e,u=t.apply(i,n)}function m(t){return f=t,c=Ti(y,e),h?v(t):u}function g(t){var n=t-l;return l===o||n>=e||n<0||d&&t-f>=s}function y(){var t=Aa();if(g(t))return b(t);c=Ti(y,function(t){var n=e-(t-l);return d?yn(n,s-(t-f)):n}(t))}function b(t){return c=o,p&&r?v(t):(r=a=o,u)}function w(){var t=Aa(),n=g(t);if(r=arguments,a=this,l=t,n){if(c===o)return m(l);if(d)return xo(c),c=Ti(y,e),v(l)}return c===o&&(c=Ti(y,e)),u}return e=gs(e)||0,es(n)&&(h=!!n.leading,s=(d="maxWait"in n)?gn(gs(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),w.cancel=function(){c!==o&&xo(c),f=0,r=l=a=c=o},w.flush=function(){return c===o?u:b(Aa())},w}var Ma=Yr((function(t,e){return cr(t,1,e)})),Ia=Yr((function(t,e,n){return cr(t,gs(e)||0,n)}));function Na(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new At(i);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Na.Cache||qn),n}function Ba(t){if("function"!=typeof t)throw new At(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Na.Cache=qn;var Za=bo((function(t,e){var n=(e=1==e.length&&Ua(e[0])?Se(e[0],He(si())):Se(mr(e,1),He(si()))).length;return Yr((function(r){for(var o=-1,i=yn(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return ge(t,this,r)}))})),La=Yr((function(t,e){var n=en(e,ai(La));return Ko(t,u,o,e,n)})),Da=Yr((function(t,e){var n=en(e,ai(Da));return Ko(t,64,o,e,n)})),za=ei((function(t,e){return Ko(t,256,o,o,o,e)}));function Fa(t,e){return t===e||t!=t&&e!=e}var Ga=Uo(Sr),Ha=Uo((function(t,e){return t>=e})),Va=Tr(function(){return arguments}())?Tr:function(t){return ns(t)&&Mt.call(t,"callee")&&!te.call(t,"callee")},Ua=r.isArray,qa=fe?He(fe):function(t){return ns(t)&&_r(t)==C};function Wa(t){return null!=t&&ts(t.length)&&!Xa(t)}function Ya(t){return ns(t)&&Wa(t)}var $a=dn||gu,Ka=he?He(he):function(t){return ns(t)&&_r(t)==y};function Ja(t){if(!ns(t))return!1;var e=_r(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!is(t)}function Xa(t){if(!es(t))return!1;var e=_r(t);return e==w||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qa(t){return"number"==typeof t&&t==vs(t)}function ts(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ns(t){return null!=t&&"object"==typeof t}var rs=de?He(de):function(t){return ns(t)&&di(t)==O};function os(t){return"number"==typeof t||ns(t)&&_r(t)==E}function is(t){if(!ns(t)||_r(t)!=_)return!1;var e=qt(t);if(null===e)return!0;var n=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==Zt}var as=pe?He(pe):function(t){return ns(t)&&_r(t)==j},ss=ve?He(ve):function(t){return ns(t)&&di(t)==A};function us(t){return"string"==typeof t||!Ua(t)&&ns(t)&&_r(t)==P}function cs(t){return"symbol"==typeof t||ns(t)&&_r(t)==k}var ls=me?He(me):function(t){return ns(t)&&ts(t.length)&&!!Xt[_r(t)]},fs=Uo(Br),hs=Uo((function(t,e){return t<=e}));function ds(t){if(!t)return[];if(Wa(t))return us(t)?an(t):Po(t);if(ae&&t[ae])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ae]());var e=di(t);return(e==O?Qe:e==A?nn:Fs)(t)}function ps(t){return t?(t=gs(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function vs(t){var e=ps(t),n=e%1;return e==e?n?e-n:e:0}function ms(t){return t?ar(vs(t),0,d):0}function gs(t){if("number"==typeof t)return t;if(cs(t))return h;if(es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=pt.test(t);return n||mt.test(t)?ne(t.slice(2),n?2:8):dt.test(t)?h:+t}function ys(t){return ko(t,Ms(t))}function bs(t){return null==t?"":so(t)}var ws=Co((function(t,e){if(Oi(e)||Wa(e))ko(e,Rs(e),t);else for(var n in e)Mt.call(e,n)&&tr(t,n,e[n])})),xs=Co((function(t,e){ko(e,Ms(e),t)})),Os=Co((function(t,e,n,r){ko(e,Ms(e),t,r)})),Es=Co((function(t,e,n,r){ko(e,Rs(e),t,r)})),_s=ei(ir),Ss=Yr((function(t,e){t=_t(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&yi(e[0],e[1],i)&&(r=1);++n<r;)for(var a=e[n],s=Ms(a),u=-1,c=s.length;++u<c;){var l=s[u],f=t[l];(f===o||Fa(f,Tt[l])&&!Mt.call(t,l))&&(t[l]=a[l])}return t})),js=Yr((function(t){return t.push(o,Xo),ge(Ns,o,t)}));function As(t,e,n){var r=null==t?o:Or(t,e);return r===o?n:r}function Ps(t,e){return null!=t&&pi(t,e,Ar)}var ks=zo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Bt.call(e)),t[e]=n}),eu(ou)),Ts=zo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Bt.call(e)),Mt.call(t,e)?t[e].push(n):t[e]=[n]}),si),Cs=Yr(kr);function Rs(t){return Wa(t)?$n(t):Nr(t)}function Ms(t){return Wa(t)?$n(t,!0):function(t){if(!es(t))return function(t){var e=[];if(null!=t)for(var n in _t(t))e.push(n);return e}(t);var e=Oi(t),n=[];for(var r in t)("constructor"!=r||!e&&Mt.call(t,r))&&n.push(r);return n}(t)}var Is=Co((function(t,e,n){zr(t,e,n)})),Ns=Co((function(t,e,n,r){zr(t,e,n,r)})),Bs=ei((function(t,e){var n={};if(null==t)return n;var r=!1;e=Se(e,(function(e){return e=yo(e,t),r||(r=e.length>1),e})),ko(t,ri(t),n),r&&(n=sr(n,7,Qo));for(var o=e.length;o--;)co(n,e[o]);return n})),Zs=ei((function(t,e){return null==t?{}:function(t,e){return Hr(t,e,(function(e,n){return Ps(t,n)}))}(t,e)}));function Ls(t,e){if(null==t)return{};var n=Se(ri(t),(function(t){return[t]}));return e=si(e),Hr(t,n,(function(t,n){return e(t,n[0])}))}var Ds=$o(Rs),zs=$o(Ms);function Fs(t){return null==t?[]:Ve(t,Rs(t))}var Gs=No((function(t,e,n){return e=e.toLowerCase(),t+(n?Hs(e):e)}));function Hs(t){return Js(bs(t).toLowerCase())}function Vs(t){return(t=bs(t))&&t.replace(yt,$e).replace(Ut,"")}var Us=No((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),qs=No((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ws=Io("toLowerCase"),Ys=No((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),$s=No((function(t,e,n){return t+(n?" ":"")+Js(e)})),Ks=No((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Js=Io("toUpperCase");function Xs(t,e,n){return t=bs(t),(e=n?o:e)===o?function(t){return $t.test(t)}(t)?function(t){return t.match(Wt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Qs=Yr((function(t,e){try{return ge(t,o,e)}catch(t){return Ja(t)?t:new xt(t)}})),tu=ei((function(t,e){return be(e,(function(e){e=Li(e),or(t,e,Ta(t[e],t))})),t}));function eu(t){return function(){return t}}var nu=Lo(),ru=Lo(!0);function ou(t){return t}function iu(t){return Ir("function"==typeof t?t:sr(t,1))}var au=Yr((function(t,e){return function(n){return kr(n,t,e)}})),su=Yr((function(t,e){return function(n){return kr(t,n,e)}}));function uu(t,e,n){var r=Rs(e),o=xr(e,r);null!=n||es(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=xr(e,Rs(e)));var i=!(es(n)&&"chain"in n&&!n.chain),a=Xa(t);return be(o,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__),o=n.__actions__=Po(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,je([this.value()],arguments))})})),t}function cu(){}var lu=Go(Se),fu=Go(xe),hu=Go(ke);function du(t){return bi(t)?Ze(Li(t)):function(t){return function(e){return Or(e,t)}}(t)}var pu=Vo(),vu=Vo(!0);function mu(){return[]}function gu(){return!1}var yu,bu=Fo((function(t,e){return t+e}),0),wu=Wo("ceil"),xu=Fo((function(t,e){return t/e}),1),Ou=Wo("floor"),Eu=Fo((function(t,e){return t*e}),1),_u=Wo("round"),Su=Fo((function(t,e){return t-e}),0);return Dn.after=function(t,e){if("function"!=typeof e)throw new At(i);return t=vs(t),function(){if(--t<1)return e.apply(this,arguments)}},Dn.ary=Pa,Dn.assign=ws,Dn.assignIn=xs,Dn.assignInWith=Os,Dn.assignWith=Es,Dn.at=_s,Dn.before=ka,Dn.bind=Ta,Dn.bindAll=tu,Dn.bindKey=Ca,Dn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ua(t)?t:[t]},Dn.chain=da,Dn.chunk=function(t,e,n){e=(n?yi(t,e,n):e===o)?1:gn(vs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,s=0,u=r(ln(i/e));a<i;)u[s++]=eo(t,a,a+=e);return u},Dn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},Dn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return je(Ua(n)?Po(n):[n],mr(e,1))},Dn.cond=function(t){var e=null==t?0:t.length,n=si();return t=e?Se(t,(function(t){if("function"!=typeof t[1])throw new At(i);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var o=t[r];if(ge(o[0],this,n))return ge(o[1],this,n)}}))},Dn.conforms=function(t){return function(t){var e=Rs(t);return function(n){return ur(n,t,e)}}(sr(t,1))},Dn.constant=eu,Dn.countBy=ma,Dn.create=function(t,e){var n=zn(t);return null==e?n:rr(n,e)},Dn.curry=function t(e,n,r){var i=Ko(e,8,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Dn.curryRight=function t(e,n,r){var i=Ko(e,16,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Dn.debounce=Ra,Dn.defaults=Ss,Dn.defaultsDeep=js,Dn.defer=Ma,Dn.delay=Ia,Dn.difference=Fi,Dn.differenceBy=Gi,Dn.differenceWith=Hi,Dn.drop=function(t,e,n){var r=null==t?0:t.length;return r?eo(t,(e=n||e===o?1:vs(e))<0?0:e,r):[]},Dn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?eo(t,0,(e=r-(e=n||e===o?1:vs(e)))<0?0:e):[]},Dn.dropRightWhile=function(t,e){return t&&t.length?fo(t,si(e,3),!0,!0):[]},Dn.dropWhile=function(t,e){return t&&t.length?fo(t,si(e,3),!0):[]},Dn.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&yi(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=vs(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:vs(r))<0&&(r+=i),r=n>r?0:ms(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Dn.filter=function(t,e){return(Ua(t)?Oe:vr)(t,si(e,3))},Dn.flatMap=function(t,e){return mr(_a(t,e),1)},Dn.flatMapDeep=function(t,e){return mr(_a(t,e),l)},Dn.flatMapDepth=function(t,e,n){return n=n===o?1:vs(n),mr(_a(t,e),n)},Dn.flatten=qi,Dn.flattenDeep=function(t){return null!=t&&t.length?mr(t,l):[]},Dn.flattenDepth=function(t,e){return null!=t&&t.length?mr(t,e=e===o?1:vs(e)):[]},Dn.flip=function(t){return Ko(t,512)},Dn.flow=nu,Dn.flowRight=ru,Dn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},Dn.functions=function(t){return null==t?[]:xr(t,Rs(t))},Dn.functionsIn=function(t){return null==t?[]:xr(t,Ms(t))},Dn.groupBy=xa,Dn.initial=function(t){return null!=t&&t.length?eo(t,0,-1):[]},Dn.intersection=Yi,Dn.intersectionBy=$i,Dn.intersectionWith=Ki,Dn.invert=ks,Dn.invertBy=Ts,Dn.invokeMap=Oa,Dn.iteratee=iu,Dn.keyBy=Ea,Dn.keys=Rs,Dn.keysIn=Ms,Dn.map=_a,Dn.mapKeys=function(t,e){var n={};return e=si(e,3),br(t,(function(t,r,o){or(n,e(t,r,o),t)})),n},Dn.mapValues=function(t,e){var n={};return e=si(e,3),br(t,(function(t,r,o){or(n,r,e(t,r,o))})),n},Dn.matches=function(t){return Lr(sr(t,1))},Dn.matchesProperty=function(t,e){return Dr(t,sr(e,1))},Dn.memoize=Na,Dn.merge=Is,Dn.mergeWith=Ns,Dn.method=au,Dn.methodOf=su,Dn.mixin=uu,Dn.negate=Ba,Dn.nthArg=function(t){return t=vs(t),Yr((function(e){return Fr(e,t)}))},Dn.omit=Bs,Dn.omitBy=function(t,e){return Ls(t,Ba(si(e)))},Dn.once=function(t){return ka(2,t)},Dn.orderBy=function(t,e,n,r){return null==t?[]:(Ua(e)||(e=null==e?[]:[e]),Ua(n=r?o:n)||(n=null==n?[]:[n]),Gr(t,e,n))},Dn.over=lu,Dn.overArgs=Za,Dn.overEvery=fu,Dn.overSome=hu,Dn.partial=La,Dn.partialRight=Da,Dn.partition=Sa,Dn.pick=Zs,Dn.pickBy=Ls,Dn.property=du,Dn.propertyOf=function(t){return function(e){return null==t?o:Or(t,e)}},Dn.pull=Xi,Dn.pullAll=Qi,Dn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,si(n,2)):t},Dn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,o,n):t},Dn.pullAt=ta,Dn.range=pu,Dn.rangeRight=vu,Dn.rearg=za,Dn.reject=function(t,e){return(Ua(t)?Oe:vr)(t,Ba(si(e,3)))},Dn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=si(e,3);++r<i;){var a=t[r];e(a,r,t)&&(n.push(a),o.push(r))}return Ur(t,o),n},Dn.rest=function(t,e){if("function"!=typeof t)throw new At(i);return Yr(t,e=e===o?e:vs(e))},Dn.reverse=ea,Dn.sampleSize=function(t,e,n){return e=(n?yi(t,e,n):e===o)?1:vs(e),(Ua(t)?Jn:Kr)(t,e)},Dn.set=function(t,e,n){return null==t?t:Jr(t,e,n)},Dn.setWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Jr(t,e,n,r)},Dn.shuffle=function(t){return(Ua(t)?Xn:to)(t)},Dn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&yi(t,e,n)?(e=0,n=r):(e=null==e?0:vs(e),n=n===o?r:vs(n)),eo(t,e,n)):[]},Dn.sortBy=ja,Dn.sortedUniq=function(t){return t&&t.length?io(t):[]},Dn.sortedUniqBy=function(t,e){return t&&t.length?io(t,si(e,2)):[]},Dn.split=function(t,e,n){return n&&"number"!=typeof n&&yi(t,e,n)&&(e=n=o),(n=n===o?d:n>>>0)?(t=bs(t))&&("string"==typeof e||null!=e&&!as(e))&&!(e=so(e))&&Xe(t)?wo(an(t),0,n):t.split(e,n):[]},Dn.spread=function(t,e){if("function"!=typeof t)throw new At(i);return e=null==e?0:gn(vs(e),0),Yr((function(n){var r=n[e],o=wo(n,0,e);return r&&je(o,r),ge(t,this,o)}))},Dn.tail=function(t){var e=null==t?0:t.length;return e?eo(t,1,e):[]},Dn.take=function(t,e,n){return t&&t.length?eo(t,0,(e=n||e===o?1:vs(e))<0?0:e):[]},Dn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?eo(t,(e=r-(e=n||e===o?1:vs(e)))<0?0:e,r):[]},Dn.takeRightWhile=function(t,e){return t&&t.length?fo(t,si(e,3),!1,!0):[]},Dn.takeWhile=function(t,e){return t&&t.length?fo(t,si(e,3)):[]},Dn.tap=function(t,e){return e(t),t},Dn.throttle=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new At(i);return es(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ra(t,e,{leading:r,maxWait:e,trailing:o})},Dn.thru=pa,Dn.toArray=ds,Dn.toPairs=Ds,Dn.toPairsIn=zs,Dn.toPath=function(t){return Ua(t)?Se(t,Li):cs(t)?[t]:Po(Zi(bs(t)))},Dn.toPlainObject=ys,Dn.transform=function(t,e,n){var r=Ua(t),o=r||$a(t)||ls(t);if(e=si(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:es(t)&&Xa(i)?zn(qt(t)):{}}return(o?be:br)(t,(function(t,r,o){return e(n,t,r,o)})),n},Dn.unary=function(t){return Pa(t,1)},Dn.union=na,Dn.unionBy=ra,Dn.unionWith=oa,Dn.uniq=function(t){return t&&t.length?uo(t):[]},Dn.uniqBy=function(t,e){return t&&t.length?uo(t,si(e,2)):[]},Dn.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?uo(t,o,e):[]},Dn.unset=function(t,e){return null==t||co(t,e)},Dn.unzip=ia,Dn.unzipWith=aa,Dn.update=function(t,e,n){return null==t?t:lo(t,e,go(n))},Dn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:lo(t,e,go(n),r)},Dn.values=Fs,Dn.valuesIn=function(t){return null==t?[]:Ve(t,Ms(t))},Dn.without=sa,Dn.words=Xs,Dn.wrap=function(t,e){return La(go(e),t)},Dn.xor=ua,Dn.xorBy=ca,Dn.xorWith=la,Dn.zip=fa,Dn.zipObject=function(t,e){return vo(t||[],e||[],tr)},Dn.zipObjectDeep=function(t,e){return vo(t||[],e||[],Jr)},Dn.zipWith=ha,Dn.entries=Ds,Dn.entriesIn=zs,Dn.extend=xs,Dn.extendWith=Os,uu(Dn,Dn),Dn.add=bu,Dn.attempt=Qs,Dn.camelCase=Gs,Dn.capitalize=Hs,Dn.ceil=wu,Dn.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=gs(n))==n?n:0),e!==o&&(e=(e=gs(e))==e?e:0),ar(gs(t),e,n)},Dn.clone=function(t){return sr(t,4)},Dn.cloneDeep=function(t){return sr(t,5)},Dn.cloneDeepWith=function(t,e){return sr(t,5,e="function"==typeof e?e:o)},Dn.cloneWith=function(t,e){return sr(t,4,e="function"==typeof e?e:o)},Dn.conformsTo=function(t,e){return null==e||ur(t,e,Rs(e))},Dn.deburr=Vs,Dn.defaultTo=function(t,e){return null==t||t!=t?e:t},Dn.divide=xu,Dn.endsWith=function(t,e,n){t=bs(t),e=so(e);var r=t.length,i=n=n===o?r:ar(vs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Dn.eq=Fa,Dn.escape=function(t){return(t=bs(t))&&Y.test(t)?t.replace(q,Ke):t},Dn.escapeRegExp=function(t){return(t=bs(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Dn.every=function(t,e,n){var r=Ua(t)?xe:dr;return n&&yi(t,e,n)&&(e=o),r(t,si(e,3))},Dn.find=ga,Dn.findIndex=Vi,Dn.findKey=function(t,e){return Ce(t,si(e,3),br)},Dn.findLast=ya,Dn.findLastIndex=Ui,Dn.findLastKey=function(t,e){return Ce(t,si(e,3),wr)},Dn.floor=Ou,Dn.forEach=ba,Dn.forEachRight=wa,Dn.forIn=function(t,e){return null==t?t:gr(t,si(e,3),Ms)},Dn.forInRight=function(t,e){return null==t?t:yr(t,si(e,3),Ms)},Dn.forOwn=function(t,e){return t&&br(t,si(e,3))},Dn.forOwnRight=function(t,e){return t&&wr(t,si(e,3))},Dn.get=As,Dn.gt=Ga,Dn.gte=Ha,Dn.has=function(t,e){return null!=t&&pi(t,e,jr)},Dn.hasIn=Ps,Dn.head=Wi,Dn.identity=ou,Dn.includes=function(t,e,n,r){t=Wa(t)?t:Fs(t),n=n&&!r?vs(n):0;var o=t.length;return n<0&&(n=gn(o+n,0)),us(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Me(t,e,n)>-1},Dn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=gn(r+o,0)),Me(t,e,o)},Dn.inRange=function(t,e,n){return e=ps(e),n===o?(n=e,e=0):n=ps(n),function(t,e,n){return t>=yn(e,n)&&t<gn(e,n)}(t=gs(t),e,n)},Dn.invoke=Cs,Dn.isArguments=Va,Dn.isArray=Ua,Dn.isArrayBuffer=qa,Dn.isArrayLike=Wa,Dn.isArrayLikeObject=Ya,Dn.isBoolean=function(t){return!0===t||!1===t||ns(t)&&_r(t)==g},Dn.isBuffer=$a,Dn.isDate=Ka,Dn.isElement=function(t){return ns(t)&&1===t.nodeType&&!is(t)},Dn.isEmpty=function(t){if(null==t)return!0;if(Wa(t)&&(Ua(t)||"string"==typeof t||"function"==typeof t.splice||$a(t)||ls(t)||Va(t)))return!t.length;var e=di(t);if(e==O||e==A)return!t.size;if(Oi(t))return!Nr(t).length;for(var n in t)if(Mt.call(t,n))return!1;return!0},Dn.isEqual=function(t,e){return Cr(t,e)},Dn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:o)?n(t,e):o;return r===o?Cr(t,e,o,n):!!r},Dn.isError=Ja,Dn.isFinite=function(t){return"number"==typeof t&&pn(t)},Dn.isFunction=Xa,Dn.isInteger=Qa,Dn.isLength=ts,Dn.isMap=rs,Dn.isMatch=function(t,e){return t===e||Rr(t,e,ci(e))},Dn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:o,Rr(t,e,ci(e),n)},Dn.isNaN=function(t){return os(t)&&t!=+t},Dn.isNative=function(t){if(xi(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mr(t)},Dn.isNil=function(t){return null==t},Dn.isNull=function(t){return null===t},Dn.isNumber=os,Dn.isObject=es,Dn.isObjectLike=ns,Dn.isPlainObject=is,Dn.isRegExp=as,Dn.isSafeInteger=function(t){return Qa(t)&&t>=-9007199254740991&&t<=f},Dn.isSet=ss,Dn.isString=us,Dn.isSymbol=cs,Dn.isTypedArray=ls,Dn.isUndefined=function(t){return t===o},Dn.isWeakMap=function(t){return ns(t)&&di(t)==T},Dn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==_r(t)},Dn.join=function(t,e){return null==t?"":vn.call(t,e)},Dn.kebabCase=Us,Dn.last=Ji,Dn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=vs(n))<0?gn(r+i,0):yn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Re(t,Ne,i,!0)},Dn.lowerCase=qs,Dn.lowerFirst=Ws,Dn.lt=fs,Dn.lte=hs,Dn.max=function(t){return t&&t.length?pr(t,ou,Sr):o},Dn.maxBy=function(t,e){return t&&t.length?pr(t,si(e,2),Sr):o},Dn.mean=function(t){return Be(t,ou)},Dn.meanBy=function(t,e){return Be(t,si(e,2))},Dn.min=function(t){return t&&t.length?pr(t,ou,Br):o},Dn.minBy=function(t,e){return t&&t.length?pr(t,si(e,2),Br):o},Dn.stubArray=mu,Dn.stubFalse=gu,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=Eu,Dn.nth=function(t,e){return t&&t.length?Fr(t,vs(e)):o},Dn.noConflict=function(){return ie._===this&&(ie._=Lt),this},Dn.noop=cu,Dn.now=Aa,Dn.pad=function(t,e,n){t=bs(t);var r=(e=vs(e))?on(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Ho(fn(o),n)+t+Ho(ln(o),n)},Dn.padEnd=function(t,e,n){t=bs(t);var r=(e=vs(e))?on(t):0;return e&&r<e?t+Ho(e-r,n):t},Dn.padStart=function(t,e,n){t=bs(t);var r=(e=vs(e))?on(t):0;return e&&r<e?Ho(e-r,n)+t:t},Dn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),wn(bs(t).replace(rt,""),e||0)},Dn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&yi(t,e,n)&&(e=n=o),n===o&&("boolean"==typeof e?(n=e,e=o):"boolean"==typeof t&&(n=t,t=o)),t===o&&e===o?(t=0,e=1):(t=ps(t),e===o?(e=t,t=0):e=ps(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=xn();return yn(t+i*(e-t+ee("1e-"+((i+"").length-1))),e)}return qr(t,e)},Dn.reduce=function(t,e,n){var r=Ua(t)?Ae:De,o=arguments.length<3;return r(t,si(e,4),n,o,fr)},Dn.reduceRight=function(t,e,n){var r=Ua(t)?Pe:De,o=arguments.length<3;return r(t,si(e,4),n,o,hr)},Dn.repeat=function(t,e,n){return e=(n?yi(t,e,n):e===o)?1:vs(e),Wr(bs(t),e)},Dn.replace=function(){var t=arguments,e=bs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Dn.result=function(t,e,n){var r=-1,i=(e=yo(e,t)).length;for(i||(i=1,t=o);++r<i;){var a=null==t?o:t[Li(e[r])];a===o&&(r=i,a=n),t=Xa(a)?a.call(t):a}return t},Dn.round=_u,Dn.runInContext=t,Dn.sample=function(t){return(Ua(t)?Kn:$r)(t)},Dn.size=function(t){if(null==t)return 0;if(Wa(t))return us(t)?on(t):t.length;var e=di(t);return e==O||e==A?t.size:Nr(t).length},Dn.snakeCase=Ys,Dn.some=function(t,e,n){var r=Ua(t)?ke:no;return n&&yi(t,e,n)&&(e=o),r(t,si(e,3))},Dn.sortedIndex=function(t,e){return ro(t,e)},Dn.sortedIndexBy=function(t,e,n){return oo(t,e,si(n,2))},Dn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ro(t,e);if(r<n&&Fa(t[r],e))return r}return-1},Dn.sortedLastIndex=function(t,e){return ro(t,e,!0)},Dn.sortedLastIndexBy=function(t,e,n){return oo(t,e,si(n,2),!0)},Dn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ro(t,e,!0)-1;if(Fa(t[n],e))return n}return-1},Dn.startCase=$s,Dn.startsWith=function(t,e,n){return t=bs(t),n=null==n?0:ar(vs(n),0,t.length),e=so(e),t.slice(n,n+e.length)==e},Dn.subtract=Su,Dn.sum=function(t){return t&&t.length?ze(t,ou):0},Dn.sumBy=function(t,e){return t&&t.length?ze(t,si(e,2)):0},Dn.template=function(t,e,n){var r=Dn.templateSettings;n&&yi(t,e,n)&&(e=o),t=bs(t),e=Os({},e,r,Jo);var i,a,s=Os({},e.imports,r.imports,Jo),u=Rs(s),c=Ve(s,u),l=0,f=e.interpolate||bt,h="__p += '",d=St((e.escape||bt).source+"|"+f.source+"|"+(f===J?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Mt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jt+"]")+"\n";t.replace(d,(function(e,n,r,o,s,u){return r||(r=o),h+=t.slice(l,u).replace(wt,Je),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var v=Mt.call(e,"variable")&&e.variable;if(v){if(ct.test(v))throw new xt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(G,""):h).replace(H,"$1").replace(V,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Qs((function(){return Ot(u,p+"return "+h).apply(o,c)}));if(m.source=h,Ja(m))throw m;return m},Dn.times=function(t,e){if((t=vs(t))<1||t>f)return[];var n=d,r=yn(t,d);e=si(e),t-=d;for(var o=Fe(r,e);++n<t;)e(n);return o},Dn.toFinite=ps,Dn.toInteger=vs,Dn.toLength=ms,Dn.toLower=function(t){return bs(t).toLowerCase()},Dn.toNumber=gs,Dn.toSafeInteger=function(t){return t?ar(vs(t),-9007199254740991,f):0===t?t:0},Dn.toString=bs,Dn.toUpper=function(t){return bs(t).toUpperCase()},Dn.trim=function(t,e,n){if((t=bs(t))&&(n||e===o))return Ge(t);if(!t||!(e=so(e)))return t;var r=an(t),i=an(e);return wo(r,qe(r,i),We(r,i)+1).join("")},Dn.trimEnd=function(t,e,n){if((t=bs(t))&&(n||e===o))return t.slice(0,sn(t)+1);if(!t||!(e=so(e)))return t;var r=an(t);return wo(r,0,We(r,an(e))+1).join("")},Dn.trimStart=function(t,e,n){if((t=bs(t))&&(n||e===o))return t.replace(rt,"");if(!t||!(e=so(e)))return t;var r=an(t);return wo(r,qe(r,an(e))).join("")},Dn.truncate=function(t,e){var n=30,r="...";if(es(e)){var i="separator"in e?e.separator:i;n="length"in e?vs(e.length):n,r="omission"in e?so(e.omission):r}var a=(t=bs(t)).length;if(Xe(t)){var s=an(t);a=s.length}if(n>=a)return t;var u=n-on(r);if(u<1)return r;var c=s?wo(s,0,u).join(""):t.slice(0,u);if(i===o)return c+r;if(s&&(u+=c.length-u),as(i)){if(t.slice(u).search(i)){var l,f=c;for(i.global||(i=St(i.source,bs(ht.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var h=l.index;c=c.slice(0,h===o?u:h)}}else if(t.indexOf(so(i),u)!=u){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r},Dn.unescape=function(t){return(t=bs(t))&&W.test(t)?t.replace(U,un):t},Dn.uniqueId=function(t){var e=++It;return bs(t)+e},Dn.upperCase=Ks,Dn.upperFirst=Js,Dn.each=ba,Dn.eachRight=wa,Dn.first=Wi,uu(Dn,(yu={},br(Dn,(function(t,e){Mt.call(Dn.prototype,e)||(yu[e]=t)})),yu),{chain:!1}),Dn.VERSION="4.17.21",be(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Dn[t].placeholder=Dn})),be(["drop","take"],(function(t,e){Hn.prototype[t]=function(n){n=n===o?1:gn(vs(n),0);var r=this.__filtered__&&!e?new Hn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Hn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),be(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Hn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:si(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),be(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Hn.prototype[t]=function(){return this[n](1).value()[0]}})),be(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Hn.prototype[t]=function(){return this.__filtered__?new Hn(this):this[n](1)}})),Hn.prototype.compact=function(){return this.filter(ou)},Hn.prototype.find=function(t){return this.filter(t).head()},Hn.prototype.findLast=function(t){return this.reverse().find(t)},Hn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Hn(this):this.map((function(n){return kr(n,t,e)}))})),Hn.prototype.reject=function(t){return this.filter(Ba(si(t)))},Hn.prototype.slice=function(t,e){t=vs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Hn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=vs(e))<0?n.dropRight(-e):n.take(e-t)),n)},Hn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Hn.prototype.toArray=function(){return this.take(d)},br(Hn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Dn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);i&&(Dn.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof Hn,c=s[0],l=u||Ua(e),f=function(t){var e=i.apply(Dn,je([t],s));return r&&h?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=u&&!d;if(!a&&l){e=v?e:new Hn(this);var m=t.apply(e,s);return m.__actions__.push({func:pa,args:[f],thisArg:o}),new Gn(m,h)}return p&&v?t.apply(this,s):(m=this.thru(f),p?r?m.value()[0]:m.value():m)})})),be(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Pt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Dn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Ua(o)?o:[],t)}return this[n]((function(n){return e.apply(Ua(n)?n:[],t)}))}})),br(Hn.prototype,(function(t,e){var n=Dn[e];if(n){var r=n.name+"";Mt.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:e,func:n})}})),Tn[Do(o,2).name]=[{name:"wrapper",func:o}],Hn.prototype.clone=function(){var t=new Hn(this.__wrapped__);return t.__actions__=Po(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Po(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Po(this.__views__),t},Hn.prototype.reverse=function(){if(this.__filtered__){var t=new Hn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Hn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ua(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=yn(e,t+a);break;case"takeRight":t=gn(t,e-a)}}return{start:t,end:e}}(0,o,this.__views__),a=i.start,s=i.end,u=s-a,c=r?s:a-1,l=this.__iteratees__,f=l.length,h=0,d=yn(u,this.__takeCount__);if(!n||!r&&o==u&&d==u)return ho(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var v=-1,m=t[c+=e];++v<f;){var g=l[v],y=g.iteratee,b=g.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue t;break t}}p[h++]=m}return p},Dn.prototype.at=va,Dn.prototype.chain=function(){return da(this)},Dn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},Dn.prototype.next=function(){this.__values__===o&&(this.__values__=ds(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Dn.prototype.plant=function(t){for(var e,n=this;n instanceof Fn;){var r=zi(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Dn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Hn){var e=t;return this.__actions__.length&&(e=new Hn(this)),(e=e.reverse()).__actions__.push({func:pa,args:[ea],thisArg:o}),new Gn(e,this.__chain__)}return this.thru(ea)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return ho(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,ae&&(Dn.prototype[ae]=function(){return this}),Dn}();ie._=cn,(r=function(){return cn}.call(e,n,e,t))===o||(t.exports=r)}.call(this)},91387:function(t,e,n){var r;t=n.nmd(t),function(){function o(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function i(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var a=t[o];e(r,a,n(a),t)}return r}function a(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function s(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function u(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function c(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function l(t,e){return!(null==t||!t.length)&&b(t,e,0)>-1}function f(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function h(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function d(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function p(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function v(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function m(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function g(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function y(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function b(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):y(t,x,n)}function w(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function x(t){return t!=t}function O(t,e){var n=null==t?0:t.length;return n?j(t,e)/n:tt}function E(t){return function(e){return null==e?q:e[t]}}function _(t){return function(e){return null==t?q:t[e]}}function S(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function j(t,e){for(var n,r=-1,o=t.length;++r<o;){var i=e(t[r]);i!==q&&(n=n===q?i:n+i)}return n}function A(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function P(t){return t?t.slice(0,V(t)+1).replace(Ut,""):t}function k(t){return function(e){return t(e)}}function T(t,e){return h(e,(function(e){return t[e]}))}function C(t,e){return t.has(e)}function R(t,e){for(var n=-1,r=t.length;++n<r&&b(e,t[n],0)>-1;);return n}function M(t,e){for(var n=t.length;n--&&b(e,t[n],0)>-1;);return n}function I(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}function N(t){return"\\"+We[t]}function B(t){return Fe.test(t)}function Z(t){return Ge.test(t)}function L(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function D(t,e){return function(n){return t(e(n))}}function z(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==$||(t[n]=$,i[o++]=n)}return i}function F(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function G(t){return B(t)?function(t){for(var e=De.lastIndex=0;De.test(t);)++e;return e}(t):fn(t)}function H(t){return B(t)?function(t){return t.match(De)||[]}(t):function(t){return t.split("")}(t)}function V(t){for(var e=t.length;e--&&qt.test(t.charAt(e)););return e}function U(t){return t.match(ze)||[]}var q,W="Expected a function",Y="__lodash_hash_undefined__",$="__lodash_placeholder__",K=32,J=128,X=1/0,Q=9007199254740991,tt=NaN,et=4294967295,nt=[["ary",J],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",K],["partialRight",64],["rearg",256]],rt="[object Arguments]",ot="[object Array]",it="[object Boolean]",at="[object Date]",st="[object Error]",ut="[object Function]",ct="[object GeneratorFunction]",lt="[object Map]",ft="[object Number]",ht="[object Object]",dt="[object Promise]",pt="[object RegExp]",vt="[object Set]",mt="[object String]",gt="[object Symbol]",yt="[object WeakMap]",bt="[object ArrayBuffer]",wt="[object DataView]",xt="[object Float32Array]",Ot="[object Float64Array]",Et="[object Int8Array]",_t="[object Int16Array]",St="[object Int32Array]",jt="[object Uint8Array]",At="[object Uint8ClampedArray]",Pt="[object Uint16Array]",kt="[object Uint32Array]",Tt=/\b__p \+= '';/g,Ct=/\b(__p \+=) '' \+/g,Rt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mt=/&(?:amp|lt|gt|quot|#39);/g,It=/[&<>"']/g,Nt=RegExp(Mt.source),Bt=RegExp(It.source),Zt=/<%-([\s\S]+?)%>/g,Lt=/<%([\s\S]+?)%>/g,Dt=/<%=([\s\S]+?)%>/g,zt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ft=/^\w*$/,Gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ht=/[\\^$.*+?()[\]{}|]/g,Vt=RegExp(Ht.source),Ut=/^\s+/,qt=/\s/,Wt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yt=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jt=/[()=,{}\[\]\/\s]/,Xt=/\\(\\)?/g,Qt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ee=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,re=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ie=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,ce="\\ud800-\\udfff",le="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",fe="\\u2700-\\u27bf",he="a-z\\xdf-\\xf6\\xf8-\\xff",de="A-Z\\xc0-\\xd6\\xd8-\\xde",pe="\\ufe0e\\ufe0f",ve="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",me="["+ce+"]",ge="["+ve+"]",ye="["+le+"]",be="\\d+",we="["+fe+"]",xe="["+he+"]",Oe="[^"+ce+ve+be+fe+he+de+"]",Ee="\\ud83c[\\udffb-\\udfff]",_e="[^"+ce+"]",Se="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",Ae="["+de+"]",Pe="(?:"+xe+"|"+Oe+")",ke="(?:"+Ae+"|"+Oe+")",Te="(?:['’](?:d|ll|m|re|s|t|ve))?",Ce="(?:['’](?:D|LL|M|RE|S|T|VE))?",Re="(?:"+ye+"|"+Ee+")?",Me="["+pe+"]?",Ie=Me+Re+"(?:\\u200d(?:"+[_e,Se,je].join("|")+")"+Me+Re+")*",Ne="(?:"+[we,Se,je].join("|")+")"+Ie,Be="(?:"+[_e+ye+"?",ye,Se,je,me].join("|")+")",Ze=RegExp("['’]","g"),Le=RegExp(ye,"g"),De=RegExp(Ee+"(?="+Ee+")|"+Be+Ie,"g"),ze=RegExp([Ae+"?"+xe+"+"+Te+"(?="+[ge,Ae,"$"].join("|")+")",ke+"+"+Ce+"(?="+[ge,Ae+Pe,"$"].join("|")+")",Ae+"?"+Pe+"+"+Te,Ae+"+"+Ce,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",be,Ne].join("|"),"g"),Fe=RegExp("[\\u200d"+ce+le+pe+"]"),Ge=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,He=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ve=-1,Ue={};Ue[xt]=Ue[Ot]=Ue[Et]=Ue[_t]=Ue[St]=Ue[jt]=Ue[At]=Ue[Pt]=Ue[kt]=!0,Ue[rt]=Ue[ot]=Ue[bt]=Ue[it]=Ue[wt]=Ue[at]=Ue[st]=Ue[ut]=Ue[lt]=Ue[ft]=Ue[ht]=Ue[pt]=Ue[vt]=Ue[mt]=Ue[yt]=!1;var qe={};qe[rt]=qe[ot]=qe[bt]=qe[wt]=qe[it]=qe[at]=qe[xt]=qe[Ot]=qe[Et]=qe[_t]=qe[St]=qe[lt]=qe[ft]=qe[ht]=qe[pt]=qe[vt]=qe[mt]=qe[gt]=qe[jt]=qe[At]=qe[Pt]=qe[kt]=!0,qe[st]=qe[ut]=qe[yt]=!1;var We={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ye=parseFloat,$e=parseInt,Ke="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,Je="object"==typeof self&&self&&self.Object===Object&&self,Xe=Ke||Je||Function("return this")(),Qe=e&&!e.nodeType&&e,tn=Qe&&t&&!t.nodeType&&t,en=tn&&tn.exports===Qe,nn=en&&Ke.process,rn=function(){try{return tn&&tn.require&&tn.require("util").types||nn&&nn.binding&&nn.binding("util")}catch(t){}}(),on=rn&&rn.isArrayBuffer,an=rn&&rn.isDate,sn=rn&&rn.isMap,un=rn&&rn.isRegExp,cn=rn&&rn.isSet,ln=rn&&rn.isTypedArray,fn=E("length"),hn=_({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),dn=_({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),pn=_({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),vn=function t(e){function n(t){if(Zo(t)&&!js(t)&&!(t instanceof qt)){if(t instanceof _)return t;if(ji.call(t,"__wrapped__"))return uo(t)}return new _(t)}function r(){}function _(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=q}function qt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=et,this.__views__=[]}function ce(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function le(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function fe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function he(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new fe;++e<n;)this.add(t[e])}function de(t){this.size=(this.__data__=new le(t)).size}function pe(t,e){var n=js(t),r=!n&&Ss(t),o=!n&&!r&&Ps(t),i=!n&&!r&&!o&&Ms(t),a=n||r||o||i,s=a?A(t.length,bi):[],u=s.length;for(var c in t)!e&&!ji.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ur(c,u))||s.push(c);return s}function ve(t){var e=t.length;return e?t[Pn(0,e-1)]:q}function me(t,e){return oo(ir(t),Se(e,0,t.length))}function ge(t){return oo(ir(t))}function ye(t,e,n){(n===q||ko(t[e],n))&&(n!==q||e in t)||Ee(t,e,n)}function be(t,e,n){var r=t[e];ji.call(t,e)&&ko(r,n)&&(n!==q||e in t)||Ee(t,e,n)}function we(t,e){for(var n=t.length;n--;)if(ko(t[n][0],e))return n;return-1}function xe(t,e,n,r){return _a(t,(function(t,o,i){e(r,t,n(t),i)})),r}function Oe(t,e){return t&&ar(e,Jo(e),t)}function Ee(t,e,n){"__proto__"==e&&Vi?Vi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function _e(t,e){for(var n=-1,r=e.length,o=hi(r),i=null==t;++n<r;)o[n]=i?q:$o(t,e[n]);return o}function Se(t,e,n){return t==t&&(n!==q&&(t=t<=n?t:n),e!==q&&(t=t>=e?t:e)),t}function je(t,e,n,r,o,i){var s,u=1&e,c=2&e,l=4&e;if(n&&(s=o?n(t,r,o,i):n(t)),s!==q)return s;if(!Bo(t))return t;var f=js(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ji.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return ir(t,s)}else{var h=Ba(t),d=h==ut||h==ct;if(Ps(t))return Qn(t,u);if(h==ht||h==rt||d&&!o){if(s=c||d?{}:Hr(t),!u)return c?function(t,e){return ar(t,Na(t),e)}(t,function(t,e){return t&&ar(e,Xo(e),t)}(s,t)):function(t,e){return ar(t,Ia(t),e)}(t,Oe(s,t))}else{if(!qe[h])return o?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case bt:return tr(t);case it:case at:return new r(+t);case wt:return function(t,e){return new t.constructor(e?tr(t.buffer):t.buffer,t.byteOffset,t.byteLength)}(t,n);case xt:case Ot:case Et:case _t:case St:case jt:case At:case Pt:case kt:return er(t,n);case lt:return new r;case ft:case mt:return new r(t);case pt:return function(t){var e=new t.constructor(t.source,te.exec(t));return e.lastIndex=t.lastIndex,e}(t);case vt:return new r;case gt:return function(t){return xa?gi(xa.call(t)):{}}(t)}}(t,h,u)}}i||(i=new de);var p=i.get(t);if(p)return p;i.set(t,s),Rs(t)?t.forEach((function(r){s.add(je(r,e,n,r,t,i))})):Ts(t)&&t.forEach((function(r,o){s.set(o,je(r,e,n,o,t,i))}));var v=f?q:(l?c?Nr:Ir:c?Xo:Jo)(t);return a(v||t,(function(r,o){v&&(r=t[o=r]),be(s,o,je(r,e,n,o,t,i))})),s}function Ae(t,e,n){var r=n.length;if(null==t)return!r;for(t=gi(t);r--;){var o=n[r],i=e[o],a=t[o];if(a===q&&!(o in t)||!i(a))return!1}return!0}function Pe(t,e,n){if("function"!=typeof t)throw new wi(W);return Da((function(){t.apply(q,n)}),e)}function ke(t,e,n,r){var o=-1,i=l,a=!0,s=t.length,u=[],c=e.length;if(!s)return u;n&&(e=h(e,k(n))),r?(i=f,a=!1):e.length>=200&&(i=C,a=!1,e=new he(e));t:for(;++o<s;){var d=t[o],p=null==n?d:n(d);if(d=r||0!==d?d:0,a&&p==p){for(var v=c;v--;)if(e[v]===p)continue t;u.push(d)}else i(e,p,r)||u.push(d)}return u}function Te(t,e){var n=!0;return _a(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function Ce(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(s===q?a==a&&!Fo(a):n(a,s)))var s=a,u=i}return u}function Re(t,e){var n=[];return _a(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function Me(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=Vr),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?Me(s,e-1,n,r,o):d(o,s):r||(o[o.length]=s)}return o}function Ie(t,e){return t&&ja(t,e,Jo)}function Ne(t,e){return t&&Aa(t,e,Jo)}function Be(t,e){return c(e,(function(e){return Mo(t[e])}))}function De(t,e){for(var n=0,r=(e=Jn(e,t)).length;null!=t&&n<r;)t=t[io(e[n++])];return n&&n==r?t:q}function ze(t,e,n){var r=e(t);return js(t)?r:d(r,n(t))}function Fe(t){return null==t?t===q?"[object Undefined]":"[object Null]":Hi&&Hi in gi(t)?function(t){var e=ji.call(t,Hi),n=t[Hi];try{t[Hi]=q;var r=!0}catch(t){}var o=ki.call(t);return r&&(e?t[Hi]=n:delete t[Hi]),o}(t):function(t){return ki.call(t)}(t)}function Ge(t,e){return t>e}function We(t,e){return null!=t&&ji.call(t,e)}function Ke(t,e){return null!=t&&e in gi(t)}function Je(t,e,n){for(var r=n?f:l,o=t[0].length,i=t.length,a=i,s=hi(i),u=1/0,c=[];a--;){var d=t[a];a&&e&&(d=h(d,k(e))),u=na(d.length,u),s[a]=!n&&(e||o>=120&&d.length>=120)?new he(a&&d):q}d=t[0];var p=-1,v=s[0];t:for(;++p<o&&c.length<u;){var m=d[p],g=e?e(m):m;if(m=n||0!==m?m:0,!(v?C(v,g):r(c,g,n))){for(a=i;--a;){var y=s[a];if(!(y?C(y,g):r(t[a],g,n)))continue t}v&&v.push(g),c.push(m)}}return c}function Qe(t,e,n){var r=null==(t=Qr(t,e=Jn(e,t)))?t:t[io(po(e))];return null==r?q:o(r,t,n)}function tn(t){return Zo(t)&&Fe(t)==rt}function nn(t,e,n,r,o){return t===e||(null==t||null==e||!Zo(t)&&!Zo(e)?t!=t&&e!=e:function(t,e,n,r,o,i){var a=js(t),s=js(e),u=a?ot:Ba(t),c=s?ot:Ba(e),l=(u=u==rt?ht:u)==ht,f=(c=c==rt?ht:c)==ht,h=u==c;if(h&&Ps(t)){if(!Ps(e))return!1;a=!0,l=!1}if(h&&!l)return i||(i=new de),a||Ms(t)?Rr(t,e,n,r,o,i):function(t,e,n,r,o,i,a){switch(n){case wt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case bt:return!(t.byteLength!=e.byteLength||!i(new Ni(t),new Ni(e)));case it:case at:case ft:return ko(+t,+e);case st:return t.name==e.name&&t.message==e.message;case pt:case mt:return t==e+"";case lt:var s=L;case vt:var u=1&r;if(s||(s=F),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var l=Rr(s(t),s(e),r,o,i,a);return a.delete(t),l;case gt:if(xa)return xa.call(t)==xa.call(e)}return!1}(t,e,u,n,r,o,i);if(!(1&n)){var d=l&&ji.call(t,"__wrapped__"),p=f&&ji.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,m=p?e.value():e;return i||(i=new de),o(v,m,n,r,i)}}return!!h&&(i||(i=new de),function(t,e,n,r,o,i){var a=1&n,s=Ir(t),u=s.length;if(u!=Ir(e).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in e:ji.call(e,l)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++c<u;){var v=t[l=s[c]],m=e[l];if(r)var g=a?r(m,v,l,e,t,i):r(v,m,l,t,e,i);if(!(g===q?v===m||o(v,m,n,r,i):g)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var y=t.constructor,b=e.constructor;y!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d}(t,e,n,r,o,i))}(t,e,n,r,nn,o))}function rn(t,e,n,r){var o=n.length,i=o,a=!r;if(null==t)return!i;for(t=gi(t);o--;){var s=n[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var u=(s=n[o])[0],c=t[u],l=s[1];if(a&&s[2]){if(c===q&&!(u in t))return!1}else{var f=new de;if(r)var h=r(c,l,u,t,e,f);if(!(h===q?nn(l,c,3,r,f):h))return!1}}return!0}function fn(t){return!(!Bo(t)||function(t){return!!Pi&&Pi in t}(t))&&(Mo(t)?Ri:re).test(ao(t))}function mn(t){return"function"==typeof t?t:null==t?ii:"object"==typeof t?js(t)?xn(t[0],t[1]):wn(t):ci(t)}function gn(t){if(!$r(t))return ta(t);var e=[];for(var n in gi(t))ji.call(t,n)&&"constructor"!=n&&e.push(n);return e}function yn(t,e){return t<e}function bn(t,e){var n=-1,r=To(t)?hi(t.length):[];return _a(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function wn(t){var e=zr(t);return 1==e.length&&e[0][2]?Jr(e[0][0],e[0][1]):function(n){return n===t||rn(n,t,e)}}function xn(t,e){return Wr(t)&&Kr(e)?Jr(io(t),e):function(n){var r=$o(n,t);return r===q&&r===e?Ko(n,t):nn(e,r,3)}}function On(t,e,n,r,o){t!==e&&ja(e,(function(i,a){if(o||(o=new de),Bo(i))!function(t,e,n,r,o,i,a){var s=eo(t,n),u=eo(e,n),c=a.get(u);if(c)return ye(t,n,c),q;var l=i?i(s,u,n+"",t,e,a):q,f=l===q;if(f){var h=js(u),d=!h&&Ps(u),p=!h&&!d&&Ms(u);l=u,h||d||p?js(s)?l=s:Co(s)?l=ir(s):d?(f=!1,l=Qn(u,!0)):p?(f=!1,l=er(u,!0)):l=[]:Do(u)||Ss(u)?(l=s,Ss(s)?l=Wo(s):Bo(s)&&!Mo(s)||(l=Hr(u))):f=!1}f&&(a.set(u,l),o(l,u,r,i,a),a.delete(u)),ye(t,n,l)}(t,e,a,n,On,r,o);else{var s=r?r(eo(t,a),i,a+"",t,e,o):q;s===q&&(s=i),ye(t,a,s)}}),Xo)}function En(t,e){var n=t.length;if(n)return Ur(e+=e<0?n:0,n)?t[e]:q}function _n(t,e,n){e=e.length?h(e,(function(t){return js(t)?function(e){return De(e,1===t.length?t[0]:t)}:t})):[ii];var r=-1;return e=h(e,k(Lr())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(bn(t,(function(t,n,o){return{criteria:h(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var u=nr(o[r],i[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Sn(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=De(t,a);n(s,a)&&Mn(i,Jn(a,t),s)}return i}function jn(t,e,n,r){var o=r?w:b,i=-1,a=e.length,s=t;for(t===e&&(e=ir(e)),n&&(s=h(t,k(n)));++i<a;)for(var u=0,c=e[i],l=n?n(c):c;(u=o(s,l,u,r))>-1;)s!==t&&zi.call(s,u,1),zi.call(t,u,1);return t}function An(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;Ur(o)?zi.call(t,o,1):Hn(t,o)}}return t}function Pn(t,e){return t+$i(ia()*(e-t+1))}function kn(t,e){var n="";if(!t||e<1||e>Q)return n;do{e%2&&(n+=t),(e=$i(e/2))&&(t+=t)}while(e);return n}function Tn(t,e){return za(Xr(t,e,ii),t+"")}function Cn(t){return ve(ti(t))}function Rn(t,e){var n=ti(t);return oo(n,Se(e,0,n.length))}function Mn(t,e,n,r){if(!Bo(t))return t;for(var o=-1,i=(e=Jn(e,t)).length,a=i-1,s=t;null!=s&&++o<i;){var u=io(e[o]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var l=s[u];(c=r?r(l,u,s):q)===q&&(c=Bo(l)?l:Ur(e[o+1])?[]:{})}be(s,u,c),s=s[u]}return t}function In(t){return oo(ti(t))}function Nn(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=hi(o);++r<o;)i[r]=t[r+e];return i}function Bn(t,e){var n;return _a(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function Zn(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=t[i];null!==a&&!Fo(a)&&(n?a<=e:a<e)?r=i+1:o=i}return o}return Ln(t,e,ii,n)}function Ln(t,e,n,r){var o=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,u=Fo(e),c=e===q;o<i;){var l=$i((o+i)/2),f=n(t[l]),h=f!==q,d=null===f,p=f==f,v=Fo(f);if(a)var m=r||p;else m=c?p&&(r||h):s?p&&h&&(r||!d):u?p&&h&&!d&&(r||!v):!d&&!v&&(r?f<=e:f<e);m?o=l+1:i=l}return na(i,4294967294)}function Dn(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!ko(s,u)){var u=s;i[o++]=0===a?0:a}}return i}function zn(t){return"number"==typeof t?t:Fo(t)?tt:+t}function Fn(t){if("string"==typeof t)return t;if(js(t))return h(t,Fn)+"";if(Fo(t))return Oa?Oa.call(t):"";var e=t+"";return"0"==e&&1/t==-X?"-0":e}function Gn(t,e,n){var r=-1,o=l,i=t.length,a=!0,s=[],u=s;if(n)a=!1,o=f;else if(i>=200){var c=e?null:Ra(t);if(c)return F(c);a=!1,o=C,u=new he}else u=e?[]:s;t:for(;++r<i;){var h=t[r],d=e?e(h):h;if(h=n||0!==h?h:0,a&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue t;e&&u.push(d),s.push(h)}else o(u,d,n)||(u!==s&&u.push(d),s.push(h))}return s}function Hn(t,e){return null==(t=Qr(t,e=Jn(e,t)))||delete t[io(po(e))]}function Vn(t,e,n,r){return Mn(t,e,n(De(t,e)),r)}function Un(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?Nn(t,r?0:i,r?i+1:o):Nn(t,r?i+1:0,r?o:i)}function qn(t,e){var n=t;return n instanceof qt&&(n=n.value()),p(e,(function(t,e){return e.func.apply(e.thisArg,d([t],e.args))}),n)}function Wn(t,e,n){var r=t.length;if(r<2)return r?Gn(t[0]):[];for(var o=-1,i=hi(r);++o<r;)for(var a=t[o],s=-1;++s<r;)s!=o&&(i[o]=ke(i[o]||a,t[s],e,n));return Gn(Me(i,1),e,n)}function Yn(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;)n(a,t[r],r<i?e[r]:q);return a}function $n(t){return Co(t)?t:[]}function Kn(t){return"function"==typeof t?t:ii}function Jn(t,e){return js(t)?t:Wr(t,e)?[t]:Fa(Yo(t))}function Xn(t,e,n){var r=t.length;return n=n===q?r:n,!e&&n>=r?t:Nn(t,e,n)}function Qn(t,e){if(e)return t.slice();var n=t.length,r=Bi?Bi(n):new t.constructor(n);return t.copy(r),r}function tr(t){var e=new t.constructor(t.byteLength);return new Ni(e).set(new Ni(t)),e}function er(t,e){return new t.constructor(e?tr(t.buffer):t.buffer,t.byteOffset,t.length)}function nr(t,e){if(t!==e){var n=t!==q,r=null===t,o=t==t,i=Fo(t),a=e!==q,s=null===e,u=e==e,c=Fo(e);if(!s&&!c&&!i&&t>e||i&&a&&u&&!s&&!c||r&&a&&u||!n&&u||!o)return 1;if(!r&&!i&&!c&&t<e||c&&n&&o&&!r&&!i||s&&n&&o||!a&&o||!u)return-1}return 0}function rr(t,e,n,r){for(var o=-1,i=t.length,a=n.length,s=-1,u=e.length,c=ea(i-a,0),l=hi(u+c),f=!r;++s<u;)l[s]=e[s];for(;++o<a;)(f||o<i)&&(l[n[o]]=t[o]);for(;c--;)l[s++]=t[o++];return l}function or(t,e,n,r){for(var o=-1,i=t.length,a=-1,s=n.length,u=-1,c=e.length,l=ea(i-s,0),f=hi(l+c),h=!r;++o<l;)f[o]=t[o];for(var d=o;++u<c;)f[d+u]=e[u];for(;++a<s;)(h||o<i)&&(f[d+n[a]]=t[o++]);return f}function ir(t,e){var n=-1,r=t.length;for(e||(e=hi(r));++n<r;)e[n]=t[n];return e}function ar(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],u=r?r(n[s],t[s],s,n,t):q;u===q&&(u=t[s]),o?Ee(n,s,u):be(n,s,u)}return n}function sr(t,e){return function(n,r){var o=js(n)?i:xe,a=e?e():{};return o(n,t,Lr(r,2),a)}}function ur(t){return Tn((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:q,a=o>2?n[2]:q;for(i=t.length>3&&"function"==typeof i?(o--,i):q,a&&qr(n[0],n[1],a)&&(i=o<3?q:i,o=1),e=gi(e);++r<o;){var s=n[r];s&&t(e,s,r,i)}return e}))}function cr(t,e){return function(n,r){if(null==n)return n;if(!To(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=gi(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function lr(t){return function(e,n,r){for(var o=-1,i=gi(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}function fr(t){return function(e){var n=B(e=Yo(e))?H(e):q,r=n?n[0]:e.charAt(0),o=n?Xn(n,1).join(""):e.slice(1);return r[t]()+o}}function hr(t){return function(e){return p(ri(ni(e).replace(Ze,"")),t,"")}}function dr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Ea(t.prototype),r=t.apply(n,e);return Bo(r)?r:n}}function pr(t,e,n){var r=dr(t);return function i(){for(var a=arguments.length,s=hi(a),u=a,c=Zr(i);u--;)s[u]=arguments[u];var l=a<3&&s[0]!==c&&s[a-1]!==c?[]:z(s,c);return(a-=l.length)<n?Sr(t,e,gr,i.placeholder,q,s,l,q,q,n-a):o(this&&this!==Xe&&this instanceof i?r:t,this,s)}}function vr(t){return function(e,n,r){var o=gi(e);if(!To(e)){var i=Lr(n,3);e=Jo(e),n=function(t){return i(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[i?e[a]:a]:q}}function mr(t){return Mr((function(e){var n=e.length,r=n,o=_.prototype.thru;for(t&&e.reverse();r--;){var i=e[r];if("function"!=typeof i)throw new wi(W);if(o&&!a&&"wrapper"==Br(i))var a=new _([],!0)}for(r=a?r:n;++r<n;){var s=Br(i=e[r]),u="wrapper"==s?Ma(i):q;a=u&&Yr(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[Br(u[0])].apply(a,u[3]):1==i.length&&Yr(i)?a[s]():a.thru(i)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&js(r))return a.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}function gr(t,e,n,r,o,i,a,s,u,c){var l=e&J,f=1&e,h=2&e,d=24&e,p=512&e,v=h?q:dr(t);return function m(){for(var g=arguments.length,y=hi(g),b=g;b--;)y[b]=arguments[b];if(d)var w=Zr(m),x=I(y,w);if(r&&(y=rr(y,r,o,d)),i&&(y=or(y,i,a,d)),g-=x,d&&g<c)return Sr(t,e,gr,m.placeholder,n,y,z(y,w),s,u,c-g);var O=f?n:this,E=h?O[t]:t;return g=y.length,s?y=to(y,s):p&&g>1&&y.reverse(),l&&u<g&&(y.length=u),this&&this!==Xe&&this instanceof m&&(E=v||dr(E)),E.apply(O,y)}}function yr(t,e){return function(n,r){return function(t,e,n,r){return Ie(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function br(t,e){return function(n,r){var o;if(n===q&&r===q)return e;if(n!==q&&(o=n),r!==q){if(o===q)return r;"string"==typeof n||"string"==typeof r?(n=Fn(n),r=Fn(r)):(n=zn(n),r=zn(r)),o=t(n,r)}return o}}function wr(t){return Mr((function(e){return e=h(e,k(Lr())),Tn((function(n){var r=this;return t(e,(function(t){return o(t,r,n)}))}))}))}function xr(t,e){var n=(e=e===q?" ":Fn(e)).length;if(n<2)return n?kn(e,t):e;var r=kn(e,Yi(t/G(e)));return B(e)?Xn(H(r),0,t).join(""):r.slice(0,t)}function Or(t,e,n,r){var i=1&e,a=dr(t);return function e(){for(var s=-1,u=arguments.length,c=-1,l=r.length,f=hi(l+u),h=this&&this!==Xe&&this instanceof e?a:t;++c<l;)f[c]=r[c];for(;u--;)f[c++]=arguments[++s];return o(h,i?n:this,f)}}function Er(t){return function(e,n,r){return r&&"number"!=typeof r&&qr(e,n,r)&&(n=r=q),e=Ho(e),n===q?(n=e,e=0):n=Ho(n),function(t,e,n,r){for(var o=-1,i=ea(Yi((e-t)/(n||1)),0),a=hi(i);i--;)a[r?i:++o]=t,t+=n;return a}(e,n,r=r===q?e<n?1:-1:Ho(r),t)}}function _r(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=qo(e),n=qo(n)),t(e,n)}}function Sr(t,e,n,r,o,i,a,s,u,c){var l=8&e;e|=l?K:64,4&(e&=~(l?64:K))||(e&=-4);var f=[t,e,o,l?i:q,l?a:q,l?q:i,l?q:a,s,u,c],h=n.apply(q,f);return Yr(t)&&La(h,f),h.placeholder=r,no(h,t,e)}function jr(t){var e=mi[t];return function(t,n){if(t=qo(t),(n=null==n?0:na(Vo(n),292))&&Xi(t)){var r=(Yo(t)+"e").split("e");return+((r=(Yo(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}function Ar(t){return function(e){var n=Ba(e);return n==lt?L(e):n==vt?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return h(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Pr(t,e,n,r,o,i,a,s){var u=2&e;if(!u&&"function"!=typeof t)throw new wi(W);var c=r?r.length:0;if(c||(e&=-97,r=o=q),a=a===q?a:ea(Vo(a),0),s=s===q?s:Vo(s),c-=o?o.length:0,64&e){var l=r,f=o;r=o=q}var h=u?q:Ma(t),d=[t,e,n,r,o,l,f,i,a,s];if(h&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<131,a=r==J&&8==n||r==J&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!i&&!a)return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var s=e[3];if(s){var u=t[3];t[3]=u?rr(u,s,e[4]):s,t[4]=u?z(t[3],$):e[4]}(s=e[5])&&(u=t[5],t[5]=u?or(u,s,e[6]):s,t[6]=u?z(t[5],$):e[6]),(s=e[7])&&(t[7]=s),r&J&&(t[8]=null==t[8]?e[8]:na(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(d,h),t=d[0],e=d[1],n=d[2],r=d[3],o=d[4],!(s=d[9]=d[9]===q?u?0:t.length:ea(d[9]-c,0))&&24&e&&(e&=-25),e&&1!=e)p=8==e||16==e?pr(t,e,s):e!=K&&33!=e||o.length?gr.apply(q,d):Or(t,e,n,r);else var p=function(t,e,n){var r=1&e,o=dr(t);return function e(){return(this&&this!==Xe&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return no((h?Pa:La)(p,d),t,e)}function kr(t,e,n,r){return t===q||ko(t,Ei[n])&&!ji.call(r,n)?e:t}function Tr(t,e,n,r,o,i){return Bo(t)&&Bo(e)&&(i.set(e,t),On(t,e,q,Tr,i),i.delete(e)),t}function Cr(t){return Do(t)?q:t}function Rr(t,e,n,r,o,i){var a=1&n,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,h=!0,d=2&n?new he:q;for(i.set(t,e),i.set(e,t);++f<s;){var p=t[f],v=e[f];if(r)var g=a?r(v,p,f,e,t,i):r(p,v,f,t,e,i);if(g!==q){if(g)continue;h=!1;break}if(d){if(!m(e,(function(t,e){if(!C(d,e)&&(p===t||o(p,t,n,r,i)))return d.push(e)}))){h=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){h=!1;break}}return i.delete(t),i.delete(e),h}function Mr(t){return za(Xr(t,q,fo),t+"")}function Ir(t){return ze(t,Jo,Ia)}function Nr(t){return ze(t,Xo,Na)}function Br(t){for(var e=t.name+"",n=pa[e],r=ji.call(pa,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function Zr(t){return(ji.call(n,"placeholder")?n:t).placeholder}function Lr(){var t=n.iteratee||ai;return t=t===ai?mn:t,arguments.length?t(arguments[0],arguments[1]):t}function Dr(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function zr(t){for(var e=Jo(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Kr(o)]}return e}function Fr(t,e){var n=function(t,e){return null==t?q:t[e]}(t,e);return fn(n)?n:q}function Gr(t,e,n){for(var r=-1,o=(e=Jn(e,t)).length,i=!1;++r<o;){var a=io(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&No(o)&&Ur(a,o)&&(js(t)||Ss(t))}function Hr(t){return"function"!=typeof t.constructor||$r(t)?{}:Ea(Zi(t))}function Vr(t){return js(t)||Ss(t)||!!(Fi&&t&&t[Fi])}function Ur(t,e){var n=typeof t;return!!(e=null==e?Q:e)&&("number"==n||"symbol"!=n&&ie.test(t))&&t>-1&&t%1==0&&t<e}function qr(t,e,n){if(!Bo(n))return!1;var r=typeof e;return!!("number"==r?To(n)&&Ur(e,n.length):"string"==r&&e in n)&&ko(n[e],t)}function Wr(t,e){if(js(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Fo(t))||Ft.test(t)||!zt.test(t)||null!=e&&t in gi(e)}function Yr(t){var e=Br(t),r=n[e];if("function"!=typeof r||!(e in qt.prototype))return!1;if(t===r)return!0;var o=Ma(r);return!!o&&t===o[0]}function $r(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ei)}function Kr(t){return t==t&&!Bo(t)}function Jr(t,e){return function(n){return null!=n&&n[t]===e&&(e!==q||t in gi(n))}}function Xr(t,e,n){return e=ea(e===q?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=ea(r.length-e,0),s=hi(a);++i<a;)s[i]=r[e+i];i=-1;for(var u=hi(e+1);++i<e;)u[i]=r[i];return u[e]=n(s),o(t,this,u)}}function Qr(t,e){return e.length<2?t:De(t,Nn(e,0,-1))}function to(t,e){for(var n=t.length,r=na(e.length,n),o=ir(t);r--;){var i=e[r];t[r]=Ur(i,n)?o[i]:q}return t}function eo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function no(t,e,n){var r=e+"";return za(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Wt,"{\n/* [wrapped with "+e+"] */\n")}(r,so(function(t){var e=t.match(Yt);return e?e[1].split($t):[]}(r),n)))}function ro(t){var e=0,n=0;return function(){var r=ra(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(q,arguments)}}function oo(t,e){var n=-1,r=t.length,o=r-1;for(e=e===q?r:e;++n<e;){var i=Pn(n,o),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function io(t){if("string"==typeof t||Fo(t))return t;var e=t+"";return"0"==e&&1/t==-X?"-0":e}function ao(t){if(null!=t){try{return Si.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function so(t,e){return a(nt,(function(n){var r="_."+n[0];e&n[1]&&!l(t,r)&&t.push(r)})),t.sort()}function uo(t){if(t instanceof qt)return t.clone();var e=new _(t.__wrapped__,t.__chain__);return e.__actions__=ir(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function co(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Vo(n);return o<0&&(o=ea(r+o,0)),y(t,Lr(e,3),o)}function lo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==q&&(o=Vo(n),o=n<0?ea(r+o,0):na(o,r-1)),y(t,Lr(e,3),o,!0)}function fo(t){return null!=t&&t.length?Me(t,1):[]}function ho(t){return t&&t.length?t[0]:q}function po(t){var e=null==t?0:t.length;return e?t[e-1]:q}function vo(t,e){return t&&t.length&&e&&e.length?jn(t,e):t}function mo(t){return null==t?t:aa.call(t)}function go(t){if(!t||!t.length)return[];var e=0;return t=c(t,(function(t){if(Co(t))return e=ea(t.length,e),!0})),A(e,(function(e){return h(t,E(e))}))}function yo(t,e){if(!t||!t.length)return[];var n=go(t);return null==e?n:h(n,(function(t){return o(e,q,t)}))}function bo(t){var e=n(t);return e.__chain__=!0,e}function wo(t,e){return e(t)}function xo(t,e){return(js(t)?a:_a)(t,Lr(e,3))}function Oo(t,e){return(js(t)?s:Sa)(t,Lr(e,3))}function Eo(t,e){return(js(t)?h:bn)(t,Lr(e,3))}function _o(t,e,n){return e=n?q:e,e=t&&null==e?t.length:e,Pr(t,J,q,q,q,q,e)}function So(t,e){var n;if("function"!=typeof e)throw new wi(W);return t=Vo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=q),n}}function jo(t,e,n){function r(e){var n=c,r=l;return c=l=q,v=e,h=t.apply(r,n)}function o(t){return v=t,d=Da(a,e),m?r(t):h}function i(t){var n=t-p;return p===q||n>=e||n<0||g&&t-v>=f}function a(){var t=ps();return i(t)?s(t):(d=Da(a,function(t){var n=e-(t-p);return g?na(n,f-(t-v)):n}(t)),q)}function s(t){return d=q,y&&c?r(t):(c=l=q,h)}function u(){var t=ps(),n=i(t);if(c=arguments,l=this,p=t,n){if(d===q)return o(p);if(g)return Ca(d),d=Da(a,e),r(p)}return d===q&&(d=Da(a,e)),h}var c,l,f,h,d,p,v=0,m=!1,g=!1,y=!0;if("function"!=typeof t)throw new wi(W);return e=qo(e)||0,Bo(n)&&(m=!!n.leading,f=(g="maxWait"in n)?ea(qo(n.maxWait)||0,e):f,y="trailing"in n?!!n.trailing:y),u.cancel=function(){d!==q&&Ca(d),v=0,c=p=l=d=q},u.flush=function(){return d===q?h:s(ps())},u}function Ao(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new wi(W);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ao.Cache||fe),n}function Po(t){if("function"!=typeof t)throw new wi(W);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function ko(t,e){return t===e||t!=t&&e!=e}function To(t){return null!=t&&No(t.length)&&!Mo(t)}function Co(t){return Zo(t)&&To(t)}function Ro(t){if(!Zo(t))return!1;var e=Fe(t);return e==st||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Do(t)}function Mo(t){if(!Bo(t))return!1;var e=Fe(t);return e==ut||e==ct||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Io(t){return"number"==typeof t&&t==Vo(t)}function No(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Q}function Bo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Zo(t){return null!=t&&"object"==typeof t}function Lo(t){return"number"==typeof t||Zo(t)&&Fe(t)==ft}function Do(t){if(!Zo(t)||Fe(t)!=ht)return!1;var e=Zi(t);if(null===e)return!0;var n=ji.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Si.call(n)==Ti}function zo(t){return"string"==typeof t||!js(t)&&Zo(t)&&Fe(t)==mt}function Fo(t){return"symbol"==typeof t||Zo(t)&&Fe(t)==gt}function Go(t){if(!t)return[];if(To(t))return zo(t)?H(t):ir(t);if(Gi&&t[Gi])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Gi]());var e=Ba(t);return(e==lt?L:e==vt?F:ti)(t)}function Ho(t){return t?(t=qo(t))===X||t===-X?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Vo(t){var e=Ho(t),n=e%1;return e==e?n?e-n:e:0}function Uo(t){return t?Se(Vo(t),0,et):0}function qo(t){if("number"==typeof t)return t;if(Fo(t))return tt;if(Bo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Bo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=P(t);var n=ne.test(t);return n||oe.test(t)?$e(t.slice(2),n?2:8):ee.test(t)?tt:+t}function Wo(t){return ar(t,Xo(t))}function Yo(t){return null==t?"":Fn(t)}function $o(t,e,n){var r=null==t?q:De(t,e);return r===q?n:r}function Ko(t,e){return null!=t&&Gr(t,e,Ke)}function Jo(t){return To(t)?pe(t):gn(t)}function Xo(t){return To(t)?pe(t,!0):function(t){if(!Bo(t))return function(t){var e=[];if(null!=t)for(var n in gi(t))e.push(n);return e}(t);var e=$r(t),n=[];for(var r in t)("constructor"!=r||!e&&ji.call(t,r))&&n.push(r);return n}(t)}function Qo(t,e){if(null==t)return{};var n=h(Nr(t),(function(t){return[t]}));return e=Lr(e),Sn(t,n,(function(t,n){return e(t,n[0])}))}function ti(t){return null==t?[]:T(t,Jo(t))}function ei(t){return iu(Yo(t).toLowerCase())}function ni(t){return(t=Yo(t))&&t.replace(ae,hn).replace(Le,"")}function ri(t,e,n){return t=Yo(t),(e=n?q:e)===q?Z(t)?U(t):function(t){return t.match(Kt)||[]}(t):t.match(e)||[]}function oi(t){return function(){return t}}function ii(t){return t}function ai(t){return mn("function"==typeof t?t:je(t,1))}function si(t,e,n){var r=Jo(e),o=Be(e,r);null!=n||Bo(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=Be(e,Jo(e)));var i=!(Bo(n)&&"chain"in n&&!n.chain),s=Mo(t);return a(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=ir(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,d([this.value()],arguments))})})),t}function ui(){}function ci(t){return Wr(t)?E(io(t)):function(t){return function(e){return De(e,t)}}(t)}function li(){return[]}function fi(){return!1}var hi=(e=null==e?Xe:vn.defaults(Xe.Object(),e,vn.pick(Xe,He))).Array,di=e.Date,pi=e.Error,vi=e.Function,mi=e.Math,gi=e.Object,yi=e.RegExp,bi=e.String,wi=e.TypeError,xi=hi.prototype,Oi=vi.prototype,Ei=gi.prototype,_i=e["__core-js_shared__"],Si=Oi.toString,ji=Ei.hasOwnProperty,Ai=0,Pi=function(){var t=/[^.]+$/.exec(_i&&_i.keys&&_i.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ki=Ei.toString,Ti=Si.call(gi),Ci=Xe._,Ri=yi("^"+Si.call(ji).replace(Ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mi=en?e.Buffer:q,Ii=e.Symbol,Ni=e.Uint8Array,Bi=Mi?Mi.allocUnsafe:q,Zi=D(gi.getPrototypeOf,gi),Li=gi.create,Di=Ei.propertyIsEnumerable,zi=xi.splice,Fi=Ii?Ii.isConcatSpreadable:q,Gi=Ii?Ii.iterator:q,Hi=Ii?Ii.toStringTag:q,Vi=function(){try{var t=Fr(gi,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ui=e.clearTimeout!==Xe.clearTimeout&&e.clearTimeout,qi=di&&di.now!==Xe.Date.now&&di.now,Wi=e.setTimeout!==Xe.setTimeout&&e.setTimeout,Yi=mi.ceil,$i=mi.floor,Ki=gi.getOwnPropertySymbols,Ji=Mi?Mi.isBuffer:q,Xi=e.isFinite,Qi=xi.join,ta=D(gi.keys,gi),ea=mi.max,na=mi.min,ra=di.now,oa=e.parseInt,ia=mi.random,aa=xi.reverse,sa=Fr(e,"DataView"),ua=Fr(e,"Map"),ca=Fr(e,"Promise"),la=Fr(e,"Set"),fa=Fr(e,"WeakMap"),ha=Fr(gi,"create"),da=fa&&new fa,pa={},va=ao(sa),ma=ao(ua),ga=ao(ca),ya=ao(la),ba=ao(fa),wa=Ii?Ii.prototype:q,xa=wa?wa.valueOf:q,Oa=wa?wa.toString:q,Ea=function(){function t(){}return function(e){if(!Bo(e))return{};if(Li)return Li(e);t.prototype=e;var n=new t;return t.prototype=q,n}}();n.templateSettings={escape:Zt,evaluate:Lt,interpolate:Dt,variable:"",imports:{_:n}},n.prototype=r.prototype,n.prototype.constructor=n,_.prototype=Ea(r.prototype),_.prototype.constructor=_,qt.prototype=Ea(r.prototype),qt.prototype.constructor=qt,ce.prototype.clear=function(){this.__data__=ha?ha(null):{},this.size=0},ce.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ce.prototype.get=function(t){var e=this.__data__;if(ha){var n=e[t];return n===Y?q:n}return ji.call(e,t)?e[t]:q},ce.prototype.has=function(t){var e=this.__data__;return ha?e[t]!==q:ji.call(e,t)},ce.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ha&&e===q?Y:e,this},le.prototype.clear=function(){this.__data__=[],this.size=0},le.prototype.delete=function(t){var e=this.__data__,n=we(e,t);return!(n<0||(n==e.length-1?e.pop():zi.call(e,n,1),--this.size,0))},le.prototype.get=function(t){var e=this.__data__,n=we(e,t);return n<0?q:e[n][1]},le.prototype.has=function(t){return we(this.__data__,t)>-1},le.prototype.set=function(t,e){var n=this.__data__,r=we(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},fe.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(ua||le),string:new ce}},fe.prototype.delete=function(t){var e=Dr(this,t).delete(t);return this.size-=e?1:0,e},fe.prototype.get=function(t){return Dr(this,t).get(t)},fe.prototype.has=function(t){return Dr(this,t).has(t)},fe.prototype.set=function(t,e){var n=Dr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},he.prototype.add=he.prototype.push=function(t){return this.__data__.set(t,Y),this},he.prototype.has=function(t){return this.__data__.has(t)},de.prototype.clear=function(){this.__data__=new le,this.size=0},de.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},de.prototype.get=function(t){return this.__data__.get(t)},de.prototype.has=function(t){return this.__data__.has(t)},de.prototype.set=function(t,e){var n=this.__data__;if(n instanceof le){var r=n.__data__;if(!ua||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new fe(r)}return n.set(t,e),this.size=n.size,this};var _a=cr(Ie),Sa=cr(Ne,!0),ja=lr(),Aa=lr(!0),Pa=da?function(t,e){return da.set(t,e),t}:ii,ka=Vi?function(t,e){return Vi(t,"toString",{configurable:!0,enumerable:!1,value:oi(e),writable:!0})}:ii,Ta=Tn,Ca=Ui||function(t){return Xe.clearTimeout(t)},Ra=la&&1/F(new la([,-0]))[1]==X?function(t){return new la(t)}:ui,Ma=da?function(t){return da.get(t)}:ui,Ia=Ki?function(t){return null==t?[]:(t=gi(t),c(Ki(t),(function(e){return Di.call(t,e)})))}:li,Na=Ki?function(t){for(var e=[];t;)d(e,Ia(t)),t=Zi(t);return e}:li,Ba=Fe;(sa&&Ba(new sa(new ArrayBuffer(1)))!=wt||ua&&Ba(new ua)!=lt||ca&&Ba(ca.resolve())!=dt||la&&Ba(new la)!=vt||fa&&Ba(new fa)!=yt)&&(Ba=function(t){var e=Fe(t),n=e==ht?t.constructor:q,r=n?ao(n):"";if(r)switch(r){case va:return wt;case ma:return lt;case ga:return dt;case ya:return vt;case ba:return yt}return e});var Za=_i?Mo:fi,La=ro(Pa),Da=Wi||function(t,e){return Xe.setTimeout(t,e)},za=ro(ka),Fa=function(t){var e=Ao((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Gt,(function(t,n,r,o){e.push(r?o.replace(Xt,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),Ga=Tn((function(t,e){return Co(t)?ke(t,Me(e,1,Co,!0)):[]})),Ha=Tn((function(t,e){var n=po(e);return Co(n)&&(n=q),Co(t)?ke(t,Me(e,1,Co,!0),Lr(n,2)):[]})),Va=Tn((function(t,e){var n=po(e);return Co(n)&&(n=q),Co(t)?ke(t,Me(e,1,Co,!0),q,n):[]})),Ua=Tn((function(t){var e=h(t,$n);return e.length&&e[0]===t[0]?Je(e):[]})),qa=Tn((function(t){var e=po(t),n=h(t,$n);return e===po(n)?e=q:n.pop(),n.length&&n[0]===t[0]?Je(n,Lr(e,2)):[]})),Wa=Tn((function(t){var e=po(t),n=h(t,$n);return(e="function"==typeof e?e:q)&&n.pop(),n.length&&n[0]===t[0]?Je(n,q,e):[]})),Ya=Tn(vo),$a=Mr((function(t,e){var n=null==t?0:t.length,r=_e(t,e);return An(t,h(e,(function(t){return Ur(t,n)?+t:t})).sort(nr)),r})),Ka=Tn((function(t){return Gn(Me(t,1,Co,!0))})),Ja=Tn((function(t){var e=po(t);return Co(e)&&(e=q),Gn(Me(t,1,Co,!0),Lr(e,2))})),Xa=Tn((function(t){var e=po(t);return e="function"==typeof e?e:q,Gn(Me(t,1,Co,!0),q,e)})),Qa=Tn((function(t,e){return Co(t)?ke(t,e):[]})),ts=Tn((function(t){return Wn(c(t,Co))})),es=Tn((function(t){var e=po(t);return Co(e)&&(e=q),Wn(c(t,Co),Lr(e,2))})),ns=Tn((function(t){var e=po(t);return e="function"==typeof e?e:q,Wn(c(t,Co),q,e)})),rs=Tn(go),os=Tn((function(t){var e=t.length,n=e>1?t[e-1]:q;return n="function"==typeof n?(t.pop(),n):q,yo(t,n)})),is=Mr((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return _e(e,t)};return!(e>1||this.__actions__.length)&&r instanceof qt&&Ur(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:wo,args:[o],thisArg:q}),new _(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(q),t}))):this.thru(o)})),as=sr((function(t,e,n){ji.call(t,n)?++t[n]:Ee(t,n,1)})),ss=vr(co),us=vr(lo),cs=sr((function(t,e,n){ji.call(t,n)?t[n].push(e):Ee(t,n,[e])})),ls=Tn((function(t,e,n){var r=-1,i="function"==typeof e,a=To(t)?hi(t.length):[];return _a(t,(function(t){a[++r]=i?o(e,t,n):Qe(t,e,n)})),a})),fs=sr((function(t,e,n){Ee(t,n,e)})),hs=sr((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),ds=Tn((function(t,e){if(null==t)return[];var n=e.length;return n>1&&qr(t,e[0],e[1])?e=[]:n>2&&qr(e[0],e[1],e[2])&&(e=[e[0]]),_n(t,Me(e,1),[])})),ps=qi||function(){return Xe.Date.now()},vs=Tn((function(t,e,n){var r=1;if(n.length){var o=z(n,Zr(vs));r|=K}return Pr(t,r,e,n,o)})),ms=Tn((function(t,e,n){var r=3;if(n.length){var o=z(n,Zr(ms));r|=K}return Pr(e,r,t,n,o)})),gs=Tn((function(t,e){return Pe(t,1,e)})),ys=Tn((function(t,e,n){return Pe(t,qo(e)||0,n)}));Ao.Cache=fe;var bs=Ta((function(t,e){var n=(e=1==e.length&&js(e[0])?h(e[0],k(Lr())):h(Me(e,1),k(Lr()))).length;return Tn((function(r){for(var i=-1,a=na(r.length,n);++i<a;)r[i]=e[i].call(this,r[i]);return o(t,this,r)}))})),ws=Tn((function(t,e){return Pr(t,K,q,e,z(e,Zr(ws)))})),xs=Tn((function(t,e){return Pr(t,64,q,e,z(e,Zr(xs)))})),Os=Mr((function(t,e){return Pr(t,256,q,q,q,e)})),Es=_r(Ge),_s=_r((function(t,e){return t>=e})),Ss=tn(function(){return arguments}())?tn:function(t){return Zo(t)&&ji.call(t,"callee")&&!Di.call(t,"callee")},js=hi.isArray,As=on?k(on):function(t){return Zo(t)&&Fe(t)==bt},Ps=Ji||fi,ks=an?k(an):function(t){return Zo(t)&&Fe(t)==at},Ts=sn?k(sn):function(t){return Zo(t)&&Ba(t)==lt},Cs=un?k(un):function(t){return Zo(t)&&Fe(t)==pt},Rs=cn?k(cn):function(t){return Zo(t)&&Ba(t)==vt},Ms=ln?k(ln):function(t){return Zo(t)&&No(t.length)&&!!Ue[Fe(t)]},Is=_r(yn),Ns=_r((function(t,e){return t<=e})),Bs=ur((function(t,e){if($r(e)||To(e))return ar(e,Jo(e),t),q;for(var n in e)ji.call(e,n)&&be(t,n,e[n])})),Zs=ur((function(t,e){ar(e,Xo(e),t)})),Ls=ur((function(t,e,n,r){ar(e,Xo(e),t,r)})),Ds=ur((function(t,e,n,r){ar(e,Jo(e),t,r)})),zs=Mr(_e),Fs=Tn((function(t,e){t=gi(t);var n=-1,r=e.length,o=r>2?e[2]:q;for(o&&qr(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Xo(i),s=-1,u=a.length;++s<u;){var c=a[s],l=t[c];(l===q||ko(l,Ei[c])&&!ji.call(t,c))&&(t[c]=i[c])}return t})),Gs=Tn((function(t){return t.push(q,Tr),o(Ws,q,t)})),Hs=yr((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=ki.call(e)),t[e]=n}),oi(ii)),Vs=yr((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=ki.call(e)),ji.call(t,e)?t[e].push(n):t[e]=[n]}),Lr),Us=Tn(Qe),qs=ur((function(t,e,n){On(t,e,n)})),Ws=ur((function(t,e,n,r){On(t,e,n,r)})),Ys=Mr((function(t,e){var n={};if(null==t)return n;var r=!1;e=h(e,(function(e){return e=Jn(e,t),r||(r=e.length>1),e})),ar(t,Nr(t),n),r&&(n=je(n,7,Cr));for(var o=e.length;o--;)Hn(n,e[o]);return n})),$s=Mr((function(t,e){return null==t?{}:function(t,e){return Sn(t,e,(function(e,n){return Ko(t,n)}))}(t,e)})),Ks=Ar(Jo),Js=Ar(Xo),Xs=hr((function(t,e,n){return e=e.toLowerCase(),t+(n?ei(e):e)})),Qs=hr((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),tu=hr((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),eu=fr("toLowerCase"),nu=hr((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),ru=hr((function(t,e,n){return t+(n?" ":"")+iu(e)})),ou=hr((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),iu=fr("toUpperCase"),au=Tn((function(t,e){try{return o(t,q,e)}catch(t){return Ro(t)?t:new pi(t)}})),su=Mr((function(t,e){return a(e,(function(e){e=io(e),Ee(t,e,vs(t[e],t))})),t})),uu=mr(),cu=mr(!0),lu=Tn((function(t,e){return function(n){return Qe(n,t,e)}})),fu=Tn((function(t,e){return function(n){return Qe(t,n,e)}})),hu=wr(h),du=wr(u),pu=wr(m),vu=Er(),mu=Er(!0),gu=br((function(t,e){return t+e}),0),yu=jr("ceil"),bu=br((function(t,e){return t/e}),1),wu=jr("floor"),xu=br((function(t,e){return t*e}),1),Ou=jr("round"),Eu=br((function(t,e){return t-e}),0);return n.after=function(t,e){if("function"!=typeof e)throw new wi(W);return t=Vo(t),function(){if(--t<1)return e.apply(this,arguments)}},n.ary=_o,n.assign=Bs,n.assignIn=Zs,n.assignInWith=Ls,n.assignWith=Ds,n.at=zs,n.before=So,n.bind=vs,n.bindAll=su,n.bindKey=ms,n.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return js(t)?t:[t]},n.chain=bo,n.chunk=function(t,e,n){e=(n?qr(t,e,n):e===q)?1:ea(Vo(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var o=0,i=0,a=hi(Yi(r/e));o<r;)a[i++]=Nn(t,o,o+=e);return a},n.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},n.concat=function(){var t=arguments.length;if(!t)return[];for(var e=hi(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return d(js(n)?ir(n):[n],Me(e,1))},n.cond=function(t){var e=null==t?0:t.length,n=Lr();return t=e?h(t,(function(t){if("function"!=typeof t[1])throw new wi(W);return[n(t[0]),t[1]]})):[],Tn((function(n){for(var r=-1;++r<e;){var i=t[r];if(o(i[0],this,n))return o(i[1],this,n)}}))},n.conforms=function(t){return function(t){var e=Jo(t);return function(n){return Ae(n,t,e)}}(je(t,1))},n.constant=oi,n.countBy=as,n.create=function(t,e){var n=Ea(t);return null==e?n:Oe(n,e)},n.curry=function t(e,n,r){var o=Pr(e,8,q,q,q,q,q,n=r?q:n);return o.placeholder=t.placeholder,o},n.curryRight=function t(e,n,r){var o=Pr(e,16,q,q,q,q,q,n=r?q:n);return o.placeholder=t.placeholder,o},n.debounce=jo,n.defaults=Fs,n.defaultsDeep=Gs,n.defer=gs,n.delay=ys,n.difference=Ga,n.differenceBy=Ha,n.differenceWith=Va,n.drop=function(t,e,n){var r=null==t?0:t.length;return r?Nn(t,(e=n||e===q?1:Vo(e))<0?0:e,r):[]},n.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Nn(t,0,(e=r-(e=n||e===q?1:Vo(e)))<0?0:e):[]},n.dropRightWhile=function(t,e){return t&&t.length?Un(t,Lr(e,3),!0,!0):[]},n.dropWhile=function(t,e){return t&&t.length?Un(t,Lr(e,3),!0):[]},n.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&qr(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=Vo(n))<0&&(n=-n>o?0:o+n),(r=r===q||r>o?o:Vo(r))<0&&(r+=o),r=n>r?0:Uo(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},n.filter=function(t,e){return(js(t)?c:Re)(t,Lr(e,3))},n.flatMap=function(t,e){return Me(Eo(t,e),1)},n.flatMapDeep=function(t,e){return Me(Eo(t,e),X)},n.flatMapDepth=function(t,e,n){return n=n===q?1:Vo(n),Me(Eo(t,e),n)},n.flatten=fo,n.flattenDeep=function(t){return null!=t&&t.length?Me(t,X):[]},n.flattenDepth=function(t,e){return null!=t&&t.length?Me(t,e=e===q?1:Vo(e)):[]},n.flip=function(t){return Pr(t,512)},n.flow=uu,n.flowRight=cu,n.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},n.functions=function(t){return null==t?[]:Be(t,Jo(t))},n.functionsIn=function(t){return null==t?[]:Be(t,Xo(t))},n.groupBy=cs,n.initial=function(t){return null!=t&&t.length?Nn(t,0,-1):[]},n.intersection=Ua,n.intersectionBy=qa,n.intersectionWith=Wa,n.invert=Hs,n.invertBy=Vs,n.invokeMap=ls,n.iteratee=ai,n.keyBy=fs,n.keys=Jo,n.keysIn=Xo,n.map=Eo,n.mapKeys=function(t,e){var n={};return e=Lr(e,3),Ie(t,(function(t,r,o){Ee(n,e(t,r,o),t)})),n},n.mapValues=function(t,e){var n={};return e=Lr(e,3),Ie(t,(function(t,r,o){Ee(n,r,e(t,r,o))})),n},n.matches=function(t){return wn(je(t,1))},n.matchesProperty=function(t,e){return xn(t,je(e,1))},n.memoize=Ao,n.merge=qs,n.mergeWith=Ws,n.method=lu,n.methodOf=fu,n.mixin=si,n.negate=Po,n.nthArg=function(t){return t=Vo(t),Tn((function(e){return En(e,t)}))},n.omit=Ys,n.omitBy=function(t,e){return Qo(t,Po(Lr(e)))},n.once=function(t){return So(2,t)},n.orderBy=function(t,e,n,r){return null==t?[]:(js(e)||(e=null==e?[]:[e]),js(n=r?q:n)||(n=null==n?[]:[n]),_n(t,e,n))},n.over=hu,n.overArgs=bs,n.overEvery=du,n.overSome=pu,n.partial=ws,n.partialRight=xs,n.partition=hs,n.pick=$s,n.pickBy=Qo,n.property=ci,n.propertyOf=function(t){return function(e){return null==t?q:De(t,e)}},n.pull=Ya,n.pullAll=vo,n.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?jn(t,e,Lr(n,2)):t},n.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?jn(t,e,q,n):t},n.pullAt=$a,n.range=vu,n.rangeRight=mu,n.rearg=Os,n.reject=function(t,e){return(js(t)?c:Re)(t,Po(Lr(e,3)))},n.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=Lr(e,3);++r<i;){var a=t[r];e(a,r,t)&&(n.push(a),o.push(r))}return An(t,o),n},n.rest=function(t,e){if("function"!=typeof t)throw new wi(W);return Tn(t,e=e===q?e:Vo(e))},n.reverse=mo,n.sampleSize=function(t,e,n){return e=(n?qr(t,e,n):e===q)?1:Vo(e),(js(t)?me:Rn)(t,e)},n.set=function(t,e,n){return null==t?t:Mn(t,e,n)},n.setWith=function(t,e,n,r){return r="function"==typeof r?r:q,null==t?t:Mn(t,e,n,r)},n.shuffle=function(t){return(js(t)?ge:In)(t)},n.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&qr(t,e,n)?(e=0,n=r):(e=null==e?0:Vo(e),n=n===q?r:Vo(n)),Nn(t,e,n)):[]},n.sortBy=ds,n.sortedUniq=function(t){return t&&t.length?Dn(t):[]},n.sortedUniqBy=function(t,e){return t&&t.length?Dn(t,Lr(e,2)):[]},n.split=function(t,e,n){return n&&"number"!=typeof n&&qr(t,e,n)&&(e=n=q),(n=n===q?et:n>>>0)?(t=Yo(t))&&("string"==typeof e||null!=e&&!Cs(e))&&!(e=Fn(e))&&B(t)?Xn(H(t),0,n):t.split(e,n):[]},n.spread=function(t,e){if("function"!=typeof t)throw new wi(W);return e=null==e?0:ea(Vo(e),0),Tn((function(n){var r=n[e],i=Xn(n,0,e);return r&&d(i,r),o(t,this,i)}))},n.tail=function(t){var e=null==t?0:t.length;return e?Nn(t,1,e):[]},n.take=function(t,e,n){return t&&t.length?Nn(t,0,(e=n||e===q?1:Vo(e))<0?0:e):[]},n.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Nn(t,(e=r-(e=n||e===q?1:Vo(e)))<0?0:e,r):[]},n.takeRightWhile=function(t,e){return t&&t.length?Un(t,Lr(e,3),!1,!0):[]},n.takeWhile=function(t,e){return t&&t.length?Un(t,Lr(e,3)):[]},n.tap=function(t,e){return e(t),t},n.throttle=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new wi(W);return Bo(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),jo(t,e,{leading:r,maxWait:e,trailing:o})},n.thru=wo,n.toArray=Go,n.toPairs=Ks,n.toPairsIn=Js,n.toPath=function(t){return js(t)?h(t,io):Fo(t)?[t]:ir(Fa(Yo(t)))},n.toPlainObject=Wo,n.transform=function(t,e,n){var r=js(t),o=r||Ps(t)||Ms(t);if(e=Lr(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Bo(t)&&Mo(i)?Ea(Zi(t)):{}}return(o?a:Ie)(t,(function(t,r,o){return e(n,t,r,o)})),n},n.unary=function(t){return _o(t,1)},n.union=Ka,n.unionBy=Ja,n.unionWith=Xa,n.uniq=function(t){return t&&t.length?Gn(t):[]},n.uniqBy=function(t,e){return t&&t.length?Gn(t,Lr(e,2)):[]},n.uniqWith=function(t,e){return e="function"==typeof e?e:q,t&&t.length?Gn(t,q,e):[]},n.unset=function(t,e){return null==t||Hn(t,e)},n.unzip=go,n.unzipWith=yo,n.update=function(t,e,n){return null==t?t:Vn(t,e,Kn(n))},n.updateWith=function(t,e,n,r){return r="function"==typeof r?r:q,null==t?t:Vn(t,e,Kn(n),r)},n.values=ti,n.valuesIn=function(t){return null==t?[]:T(t,Xo(t))},n.without=Qa,n.words=ri,n.wrap=function(t,e){return ws(Kn(e),t)},n.xor=ts,n.xorBy=es,n.xorWith=ns,n.zip=rs,n.zipObject=function(t,e){return Yn(t||[],e||[],be)},n.zipObjectDeep=function(t,e){return Yn(t||[],e||[],Mn)},n.zipWith=os,n.entries=Ks,n.entriesIn=Js,n.extend=Zs,n.extendWith=Ls,si(n,n),n.add=gu,n.attempt=au,n.camelCase=Xs,n.capitalize=ei,n.ceil=yu,n.clamp=function(t,e,n){return n===q&&(n=e,e=q),n!==q&&(n=(n=qo(n))==n?n:0),e!==q&&(e=(e=qo(e))==e?e:0),Se(qo(t),e,n)},n.clone=function(t){return je(t,4)},n.cloneDeep=function(t){return je(t,5)},n.cloneDeepWith=function(t,e){return je(t,5,e="function"==typeof e?e:q)},n.cloneWith=function(t,e){return je(t,4,e="function"==typeof e?e:q)},n.conformsTo=function(t,e){return null==e||Ae(t,e,Jo(e))},n.deburr=ni,n.defaultTo=function(t,e){return null==t||t!=t?e:t},n.divide=bu,n.endsWith=function(t,e,n){t=Yo(t),e=Fn(e);var r=t.length,o=n=n===q?r:Se(Vo(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},n.eq=ko,n.escape=function(t){return(t=Yo(t))&&Bt.test(t)?t.replace(It,dn):t},n.escapeRegExp=function(t){return(t=Yo(t))&&Vt.test(t)?t.replace(Ht,"\\$&"):t},n.every=function(t,e,n){var r=js(t)?u:Te;return n&&qr(t,e,n)&&(e=q),r(t,Lr(e,3))},n.find=ss,n.findIndex=co,n.findKey=function(t,e){return g(t,Lr(e,3),Ie)},n.findLast=us,n.findLastIndex=lo,n.findLastKey=function(t,e){return g(t,Lr(e,3),Ne)},n.floor=wu,n.forEach=xo,n.forEachRight=Oo,n.forIn=function(t,e){return null==t?t:ja(t,Lr(e,3),Xo)},n.forInRight=function(t,e){return null==t?t:Aa(t,Lr(e,3),Xo)},n.forOwn=function(t,e){return t&&Ie(t,Lr(e,3))},n.forOwnRight=function(t,e){return t&&Ne(t,Lr(e,3))},n.get=$o,n.gt=Es,n.gte=_s,n.has=function(t,e){return null!=t&&Gr(t,e,We)},n.hasIn=Ko,n.head=ho,n.identity=ii,n.includes=function(t,e,n,r){t=To(t)?t:ti(t),n=n&&!r?Vo(n):0;var o=t.length;return n<0&&(n=ea(o+n,0)),zo(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&b(t,e,n)>-1},n.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Vo(n);return o<0&&(o=ea(r+o,0)),b(t,e,o)},n.inRange=function(t,e,n){return e=Ho(e),n===q?(n=e,e=0):n=Ho(n),function(t,e,n){return t>=na(e,n)&&t<ea(e,n)}(t=qo(t),e,n)},n.invoke=Us,n.isArguments=Ss,n.isArray=js,n.isArrayBuffer=As,n.isArrayLike=To,n.isArrayLikeObject=Co,n.isBoolean=function(t){return!0===t||!1===t||Zo(t)&&Fe(t)==it},n.isBuffer=Ps,n.isDate=ks,n.isElement=function(t){return Zo(t)&&1===t.nodeType&&!Do(t)},n.isEmpty=function(t){if(null==t)return!0;if(To(t)&&(js(t)||"string"==typeof t||"function"==typeof t.splice||Ps(t)||Ms(t)||Ss(t)))return!t.length;var e=Ba(t);if(e==lt||e==vt)return!t.size;if($r(t))return!gn(t).length;for(var n in t)if(ji.call(t,n))return!1;return!0},n.isEqual=function(t,e){return nn(t,e)},n.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:q)?n(t,e):q;return r===q?nn(t,e,q,n):!!r},n.isError=Ro,n.isFinite=function(t){return"number"==typeof t&&Xi(t)},n.isFunction=Mo,n.isInteger=Io,n.isLength=No,n.isMap=Ts,n.isMatch=function(t,e){return t===e||rn(t,e,zr(e))},n.isMatchWith=function(t,e,n){return n="function"==typeof n?n:q,rn(t,e,zr(e),n)},n.isNaN=function(t){return Lo(t)&&t!=+t},n.isNative=function(t){if(Za(t))throw new pi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return fn(t)},n.isNil=function(t){return null==t},n.isNull=function(t){return null===t},n.isNumber=Lo,n.isObject=Bo,n.isObjectLike=Zo,n.isPlainObject=Do,n.isRegExp=Cs,n.isSafeInteger=function(t){return Io(t)&&t>=-Q&&t<=Q},n.isSet=Rs,n.isString=zo,n.isSymbol=Fo,n.isTypedArray=Ms,n.isUndefined=function(t){return t===q},n.isWeakMap=function(t){return Zo(t)&&Ba(t)==yt},n.isWeakSet=function(t){return Zo(t)&&"[object WeakSet]"==Fe(t)},n.join=function(t,e){return null==t?"":Qi.call(t,e)},n.kebabCase=Qs,n.last=po,n.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==q&&(o=(o=Vo(n))<0?ea(r+o,0):na(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):y(t,x,o,!0)},n.lowerCase=tu,n.lowerFirst=eu,n.lt=Is,n.lte=Ns,n.max=function(t){return t&&t.length?Ce(t,ii,Ge):q},n.maxBy=function(t,e){return t&&t.length?Ce(t,Lr(e,2),Ge):q},n.mean=function(t){return O(t,ii)},n.meanBy=function(t,e){return O(t,Lr(e,2))},n.min=function(t){return t&&t.length?Ce(t,ii,yn):q},n.minBy=function(t,e){return t&&t.length?Ce(t,Lr(e,2),yn):q},n.stubArray=li,n.stubFalse=fi,n.stubObject=function(){return{}},n.stubString=function(){return""},n.stubTrue=function(){return!0},n.multiply=xu,n.nth=function(t,e){return t&&t.length?En(t,Vo(e)):q},n.noConflict=function(){return Xe._===this&&(Xe._=Ci),this},n.noop=ui,n.now=ps,n.pad=function(t,e,n){t=Yo(t);var r=(e=Vo(e))?G(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return xr($i(o),n)+t+xr(Yi(o),n)},n.padEnd=function(t,e,n){t=Yo(t);var r=(e=Vo(e))?G(t):0;return e&&r<e?t+xr(e-r,n):t},n.padStart=function(t,e,n){t=Yo(t);var r=(e=Vo(e))?G(t):0;return e&&r<e?xr(e-r,n)+t:t},n.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),oa(Yo(t).replace(Ut,""),e||0)},n.random=function(t,e,n){if(n&&"boolean"!=typeof n&&qr(t,e,n)&&(e=n=q),n===q&&("boolean"==typeof e?(n=e,e=q):"boolean"==typeof t&&(n=t,t=q)),t===q&&e===q?(t=0,e=1):(t=Ho(t),e===q?(e=t,t=0):e=Ho(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=ia();return na(t+o*(e-t+Ye("1e-"+((o+"").length-1))),e)}return Pn(t,e)},n.reduce=function(t,e,n){var r=js(t)?p:S,o=arguments.length<3;return r(t,Lr(e,4),n,o,_a)},n.reduceRight=function(t,e,n){var r=js(t)?v:S,o=arguments.length<3;return r(t,Lr(e,4),n,o,Sa)},n.repeat=function(t,e,n){return e=(n?qr(t,e,n):e===q)?1:Vo(e),kn(Yo(t),e)},n.replace=function(){var t=arguments,e=Yo(t[0]);return t.length<3?e:e.replace(t[1],t[2])},n.result=function(t,e,n){var r=-1,o=(e=Jn(e,t)).length;for(o||(o=1,t=q);++r<o;){var i=null==t?q:t[io(e[r])];i===q&&(r=o,i=n),t=Mo(i)?i.call(t):i}return t},n.round=Ou,n.runInContext=t,n.sample=function(t){return(js(t)?ve:Cn)(t)},n.size=function(t){if(null==t)return 0;if(To(t))return zo(t)?G(t):t.length;var e=Ba(t);return e==lt||e==vt?t.size:gn(t).length},n.snakeCase=nu,n.some=function(t,e,n){var r=js(t)?m:Bn;return n&&qr(t,e,n)&&(e=q),r(t,Lr(e,3))},n.sortedIndex=function(t,e){return Zn(t,e)},n.sortedIndexBy=function(t,e,n){return Ln(t,e,Lr(n,2))},n.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Zn(t,e);if(r<n&&ko(t[r],e))return r}return-1},n.sortedLastIndex=function(t,e){return Zn(t,e,!0)},n.sortedLastIndexBy=function(t,e,n){return Ln(t,e,Lr(n,2),!0)},n.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=Zn(t,e,!0)-1;if(ko(t[n],e))return n}return-1},n.startCase=ru,n.startsWith=function(t,e,n){return t=Yo(t),n=null==n?0:Se(Vo(n),0,t.length),e=Fn(e),t.slice(n,n+e.length)==e},n.subtract=Eu,n.sum=function(t){return t&&t.length?j(t,ii):0},n.sumBy=function(t,e){return t&&t.length?j(t,Lr(e,2)):0},n.template=function(t,e,r){var o=n.templateSettings;r&&qr(t,e,r)&&(e=q),t=Yo(t),e=Ls({},e,o,kr);var i,a,s=Ls({},e.imports,o.imports,kr),u=Jo(s),c=T(s,u),l=0,f=e.interpolate||se,h="__p += '",d=yi((e.escape||se).source+"|"+f.source+"|"+(f===Dt?Qt:se).source+"|"+(e.evaluate||se).source+"|$","g"),p="//# sourceURL="+(ji.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ve+"]")+"\n";t.replace(d,(function(e,n,r,o,s,u){return r||(r=o),h+=t.slice(l,u).replace(ue,N),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var v=ji.call(e,"variable")&&e.variable;if(v){if(Jt.test(v))throw new pi("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(Tt,""):h).replace(Ct,"$1").replace(Rt,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=au((function(){return vi(u,p+"return "+h).apply(q,c)}));if(m.source=h,Ro(m))throw m;return m},n.times=function(t,e){if((t=Vo(t))<1||t>Q)return[];var n=et,r=na(t,et);e=Lr(e),t-=et;for(var o=A(r,e);++n<t;)e(n);return o},n.toFinite=Ho,n.toInteger=Vo,n.toLength=Uo,n.toLower=function(t){return Yo(t).toLowerCase()},n.toNumber=qo,n.toSafeInteger=function(t){return t?Se(Vo(t),-Q,Q):0===t?t:0},n.toString=Yo,n.toUpper=function(t){return Yo(t).toUpperCase()},n.trim=function(t,e,n){if((t=Yo(t))&&(n||e===q))return P(t);if(!t||!(e=Fn(e)))return t;var r=H(t),o=H(e);return Xn(r,R(r,o),M(r,o)+1).join("")},n.trimEnd=function(t,e,n){if((t=Yo(t))&&(n||e===q))return t.slice(0,V(t)+1);if(!t||!(e=Fn(e)))return t;var r=H(t);return Xn(r,0,M(r,H(e))+1).join("")},n.trimStart=function(t,e,n){if((t=Yo(t))&&(n||e===q))return t.replace(Ut,"");if(!t||!(e=Fn(e)))return t;var r=H(t);return Xn(r,R(r,H(e))).join("")},n.truncate=function(t,e){var n=30,r="...";if(Bo(e)){var o="separator"in e?e.separator:o;n="length"in e?Vo(e.length):n,r="omission"in e?Fn(e.omission):r}var i=(t=Yo(t)).length;if(B(t)){var a=H(t);i=a.length}if(n>=i)return t;var s=n-G(r);if(s<1)return r;var u=a?Xn(a,0,s).join(""):t.slice(0,s);if(o===q)return u+r;if(a&&(s+=u.length-s),Cs(o)){if(t.slice(s).search(o)){var c,l=u;for(o.global||(o=yi(o.source,Yo(te.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var f=c.index;u=u.slice(0,f===q?s:f)}}else if(t.indexOf(Fn(o),s)!=s){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+r},n.unescape=function(t){return(t=Yo(t))&&Nt.test(t)?t.replace(Mt,pn):t},n.uniqueId=function(t){var e=++Ai;return Yo(t)+e},n.upperCase=ou,n.upperFirst=iu,n.each=xo,n.eachRight=Oo,n.first=ho,si(n,function(){var t={};return Ie(n,(function(e,r){ji.call(n.prototype,r)||(t[r]=e)})),t}(),{chain:!1}),n.VERSION="4.17.21",a(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){n[t].placeholder=n})),a(["drop","take"],(function(t,e){qt.prototype[t]=function(n){n=n===q?1:ea(Vo(n),0);var r=this.__filtered__&&!e?new qt(this):this.clone();return r.__filtered__?r.__takeCount__=na(n,r.__takeCount__):r.__views__.push({size:na(n,et),type:t+(r.__dir__<0?"Right":"")}),r},qt.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),a(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;qt.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Lr(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),a(["head","last"],(function(t,e){var n="take"+(e?"Right":"");qt.prototype[t]=function(){return this[n](1).value()[0]}})),a(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");qt.prototype[t]=function(){return this.__filtered__?new qt(this):this[n](1)}})),qt.prototype.compact=function(){return this.filter(ii)},qt.prototype.find=function(t){return this.filter(t).head()},qt.prototype.findLast=function(t){return this.reverse().find(t)},qt.prototype.invokeMap=Tn((function(t,e){return"function"==typeof t?new qt(this):this.map((function(n){return Qe(n,t,e)}))})),qt.prototype.reject=function(t){return this.filter(Po(Lr(t)))},qt.prototype.slice=function(t,e){t=Vo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new qt(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==q&&(n=(e=Vo(e))<0?n.dropRight(-e):n.take(e-t)),n)},qt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},qt.prototype.toArray=function(){return this.take(et)},Ie(qt.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=n[o?"take"+("last"==e?"Right":""):e],a=o||/^find/.test(e);i&&(n.prototype[e]=function(){var e=this.__wrapped__,s=o?[1]:arguments,u=e instanceof qt,c=s[0],l=u||js(e),f=function(t){var e=i.apply(n,d([t],s));return o&&h?e[0]:e};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=a&&!h,m=u&&!p;if(!a&&l){e=m?e:new qt(this);var g=t.apply(e,s);return g.__actions__.push({func:wo,args:[f],thisArg:q}),new _(g,h)}return v&&m?t.apply(this,s):(g=this.thru(f),v?o?g.value()[0]:g.value():g)})})),a(["pop","push","shift","sort","splice","unshift"],(function(t){var e=xi[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);n.prototype[t]=function(){var t=arguments;if(o&&!this.__chain__){var n=this.value();return e.apply(js(n)?n:[],t)}return this[r]((function(n){return e.apply(js(n)?n:[],t)}))}})),Ie(qt.prototype,(function(t,e){var r=n[e];if(r){var o=r.name+"";ji.call(pa,o)||(pa[o]=[]),pa[o].push({name:e,func:r})}})),pa[gr(q,2).name]=[{name:"wrapper",func:q}],qt.prototype.clone=function(){var t=new qt(this.__wrapped__);return t.__actions__=ir(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ir(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ir(this.__views__),t},qt.prototype.reverse=function(){if(this.__filtered__){var t=new qt(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},qt.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=js(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=na(e,t+a);break;case"takeRight":t=ea(t,e-a)}}return{start:t,end:e}}(0,o,this.__views__),a=i.start,s=i.end,u=s-a,c=r?s:a-1,l=this.__iteratees__,f=l.length,h=0,d=na(u,this.__takeCount__);if(!n||!r&&o==u&&d==u)return qn(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var v=-1,m=t[c+=e];++v<f;){var g=l[v],y=g.iteratee,b=g.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue t;break t}}p[h++]=m}return p},n.prototype.at=is,n.prototype.chain=function(){return bo(this)},n.prototype.commit=function(){return new _(this.value(),this.__chain__)},n.prototype.next=function(){this.__values__===q&&(this.__values__=Go(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?q:this.__values__[this.__index__++]}},n.prototype.plant=function(t){for(var e,n=this;n instanceof r;){var o=uo(n);o.__index__=0,o.__values__=q,e?i.__wrapped__=o:e=o;var i=o;n=n.__wrapped__}return i.__wrapped__=t,e},n.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof qt){var e=t;return this.__actions__.length&&(e=new qt(this)),(e=e.reverse()).__actions__.push({func:wo,args:[mo],thisArg:q}),new _(e,this.__chain__)}return this.thru(mo)},n.prototype.toJSON=n.prototype.valueOf=n.prototype.value=function(){return qn(this.__wrapped__,this.__actions__)},n.prototype.first=n.prototype.head,Gi&&(n.prototype[Gi]=function(){return this}),n}();Xe._=vn,void 0===(r=function(){return vn}.call(e,n,e,t))||(t.exports=r)}.call(this)},24244:function(t){"use strict";var e=function(t){return t!=t};t.exports=function(t,n){return 0===t&&0===n?1/t==1/n:t===n||!(!e(t)||!e(n))}},20609:function(t,e,n){"use strict";var r=n(4289),o=n(55559),i=n(24244),a=n(75624),s=n(52281),u=o(a(),Object);r(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},75624:function(t,e,n){"use strict";var r=n(24244);t.exports=function(){return"function"==typeof Object.is?Object.is:r}},52281:function(t,e,n){"use strict";var r=n(75624),o=n(4289);t.exports=function(){var t=r();return o(Object,{is:t},{is:function(){return Object.is!==t}}),t}},18987:function(t,e,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=n(21414),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===i.call(t),r=a(t),s=e&&"[object String]"===i.call(t),h=[];if(!e&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var p=c&&n;if(s&&t.length>0&&!o.call(t,0))for(var v=0;v<t.length;++v)h.push(String(v));if(r&&t.length>0)for(var m=0;m<t.length;++m)h.push(String(m));else for(var g in t)p&&"prototype"===g||!o.call(t,g)||h.push(String(g));if(u)for(var y=function(t){if("undefined"==typeof window||!d)return f(t);try{return f(t)}catch(t){return!1}}(t),b=0;b<l.length;++b)y&&"constructor"===l[b]||!o.call(t,l[b])||h.push(l[b]);return h}}t.exports=r},82215:function(t,e,n){"use strict";var r=Array.prototype.slice,o=n(21414),i=Object.keys,a=i?function(t){return i(t)}:n(18987),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?s(r.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},21414:function(t){"use strict";var e=Object.prototype.toString;t.exports=function(t){var n=e.call(t),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),r}},67079:function(t){window,t.exports=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}return 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=1)}([function(t,e,n){var r,o;r=[n(2)],void 0===(o=function(t){function e(r){if(e.is(r,"function"))return n?r():t.on("raphael.DOMload",r);if(e.is(r,T))return e._engine.create[d](e,r.splice(0,3+e.is(r[0],k))).add(r);var o=Array.prototype.slice.call(arguments,0);if(e.is(o[o.length-1],"function")){var i=o.pop();return n?i.call(e._engine.create[d](e,o)):t.on("raphael.DOMload",(function(){i.call(e._engine.create[d](e,o))}))}return e._engine.create[d](e,arguments)}e.version="2.3.0",e.eve=t;var n,r,o,i,a=/[, ]+/,s={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},u=/\{(\d+)\}/g,c="hasOwnProperty",l={doc:document,win:window},f={was:Object.prototype[c].call(l.win,"Raphael"),is:l.win.Raphael},h=function(){this.ca=this.customAttributes={}},d="apply",p="concat",v="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,m="",g=" ",y=String,b="split",w="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[b](g),x={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},O=y.prototype.toLowerCase,E=Math,_=E.max,S=E.min,j=E.abs,A=E.pow,P=E.PI,k="number",T="array",C=Object.prototype.toString,R=(e._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),M={NaN:1,Infinity:1,"-Infinity":1},I=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,N=E.round,B=parseFloat,Z=parseInt,L=y.prototype.toUpperCase,D=e._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},z=e._availableAnimAttrs={blur:k,"clip-rect":"csv",cx:k,cy:k,fill:"colour","fill-opacity":k,"font-size":k,height:k,opacity:k,path:"path",r:k,rx:k,ry:k,stroke:"colour","stroke-opacity":k,"stroke-width":k,transform:"transform",width:k,x:k,y:k},F=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,G={hs:1,rg:1},H=/,?([achlmqrstvxz]),?/gi,V=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,U=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,q=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,W=(e._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),Y=function(t,e){return B(t)-B(e)},$=function(t){return t},K=e._rectPath=function(t,e,n,r,o){return o?[["M",t+o,e],["l",n-2*o,0],["a",o,o,0,0,1,o,o],["l",0,r-2*o],["a",o,o,0,0,1,-o,o],["l",2*o-n,0],["a",o,o,0,0,1,-o,-o],["l",0,2*o-r],["a",o,o,0,0,1,o,-o],["z"]]:[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]]},J=function(t,e,n,r){return null==r&&(r=n),[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]]},X=e._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return J(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return J(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return K(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return K(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return K(e.x,e.y,e.width,e.height)},set:function(t){var e=t._getBBox();return K(e.x,e.y,e.width,e.height)}},Q=e.mapPath=function(t,e){if(!e)return t;var n,r,o,i,a,s,u;for(o=0,a=(t=At(t)).length;o<a;o++)for(i=1,s=(u=t[o]).length;i<s;i+=2)n=e.x(u[i],u[i+1]),r=e.y(u[i],u[i+1]),u[i]=n,u[i+1]=r;return t};if(e._g=l,e.type=l.win.SVGAngle||l.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==e.type){var tt,et=l.doc.createElement("div");if(et.innerHTML='<v:shape adj="1"/>',(tt=et.firstChild).style.behavior="url(#default#VML)",!tt||"object"!=typeof tt.adj)return e.type=m;et=null}function nt(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)t[c](n)&&(e[n]=nt(t[n]));return e}e.svg=!(e.vml="VML"==e.type),e._Paper=h,e.fn=r=h.prototype=e.prototype,e._id=0,e.is=function(t,e){return"finite"==(e=O.call(e))?!M[c](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||C.call(t).slice(8,-1).toLowerCase()==e},e.angle=function(t,n,r,o,i,a){if(null==i){var s=t-r,u=n-o;return s||u?(180+180*E.atan2(-u,-s)/P+360)%360:0}return e.angle(t,n,i,a)-e.angle(r,o,i,a)},e.rad=function(t){return t%360*P/180},e.deg=function(t){return Math.round(180*t/P%360*1e3)/1e3},e.snapTo=function(t,n,r){if(r=e.is(r,"finite")?r:10,e.is(t,T)){for(var o=t.length;o--;)if(j(t[o]-n)<=r)return t[o]}else{var i=n%(t=+t);if(i<r)return n-i;if(i>t-r)return n-i+t}return n},e.createUUID=(o=/[xy]/g,i=function(t){var e=16*E.random()|0;return("x"==t?e:3&e|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(o,i).toUpperCase()}),e.setWindow=function(n){t("raphael.setWindow",e,l.win,n),l.win=n,l.doc=l.win.document,e._engine.initWin&&e._engine.initWin(l.win)};var rt=function(t){if(e.vml){var n,r=/^\s+|\s+$/g;try{var o=new ActiveXObject("htmlfile");o.write("<body>"),o.close(),n=o.body}catch(t){n=createPopup().document.body}var i=n.createTextRange();rt=ct((function(t){try{n.style.color=y(t).replace(r,m);var e=i.queryCommandValue("ForeColor");return"#"+("000000"+(e=(255&e)<<16|65280&e|(16711680&e)>>>16).toString(16)).slice(-6)}catch(t){return"none"}}))}else{var a=l.doc.createElement("i");a.title="Raphaël Colour Picker",a.style.display="none",l.doc.body.appendChild(a),rt=ct((function(t){return a.style.color=t,l.doc.defaultView.getComputedStyle(a,m).getPropertyValue("color")}))}return rt(t)},ot=function(){return"hsb("+[this.h,this.s,this.b]+")"},it=function(){return"hsl("+[this.h,this.s,this.l]+")"},at=function(){return this.hex},st=function(t,n,r){if(null==n&&e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(r=t.b,n=t.g,t=t.r),null==n&&e.is(t,"string")){var o=e.getRGB(t);t=o.r,n=o.g,r=o.b}return(t>1||n>1||r>1)&&(t/=255,n/=255,r/=255),[t,n,r]},ut=function(t,n,r,o){var i={r:t*=255,g:n*=255,b:r*=255,hex:e.rgb(t,n,r),toString:at};return e.is(o,"finite")&&(i.opacity=o),i};function ct(t,e,n){return function r(){var o=Array.prototype.slice.call(arguments,0),i=o.join("␀"),a=r.cache=r.cache||{},s=r.count=r.count||[];return a[c](i)?(function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}(s,i),n?n(a[i]):a[i]):(s.length>=1e3&&delete a[s.shift()],s.push(i),a[i]=t[d](e,o),n?n(a[i]):a[i])}}function lt(){return this.hex}function ft(t,e){for(var n=[],r=0,o=t.length;o-2*!e>r;r+=2){var i=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?o-4==r?i[3]={x:+t[0],y:+t[1]}:o-2==r&&(i[2]={x:+t[0],y:+t[1]},i[3]={x:+t[2],y:+t[3]}):i[0]={x:+t[o-2],y:+t[o-1]}:o-4==r?i[3]=i[2]:r||(i[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-i[0].x+6*i[1].x+i[2].x)/6,(-i[0].y+6*i[1].y+i[2].y)/6,(i[1].x+6*i[2].x-i[3].x)/6,(i[1].y+6*i[2].y-i[3].y)/6,i[2].x,i[2].y])}return n}e.color=function(t){var n;return e.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(n=e.hsb2rgb(t),t.r=n.r,t.g=n.g,t.b=n.b,t.hex=n.hex):e.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(n=e.hsl2rgb(t),t.r=n.r,t.g=n.g,t.b=n.b,t.hex=n.hex):(e.is(t,"string")&&(t=e.getRGB(t)),e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(n=e.rgb2hsl(t),t.h=n.h,t.s=n.s,t.l=n.l,n=e.rgb2hsb(t),t.v=n.b):(t={hex:"none"}).r=t.g=t.b=t.h=t.s=t.v=t.l=-1),t.toString=at,t},e.hsb2rgb=function(t,e,n,r){var o,i,a,s,u;return this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(n=t.b,e=t.s,r=t.o,t=t.h),s=(u=n*e)*(1-j((t=(t*=360)%360/60)%2-1)),o=i=a=n-u,ut(o+=[u,s,0,0,s,u][t=~~t],i+=[s,u,u,s,0,0][t],a+=[0,0,s,u,u,s][t],r)},e.hsl2rgb=function(t,e,n,r){var o,i,a,s,u;return this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(n=t.l,e=t.s,t=t.h),(t>1||e>1||n>1)&&(t/=360,e/=100,n/=100),s=(u=2*e*(n<.5?n:1-n))*(1-j((t=(t*=360)%360/60)%2-1)),o=i=a=n-u/2,ut(o+=[u,s,0,0,s,u][t=~~t],i+=[s,u,u,s,0,0][t],a+=[0,0,s,u,u,s][t],r)},e.rgb2hsb=function(t,e,n){var r,o;return t=(n=st(t,e,n))[0],e=n[1],n=n[2],{h:((0==(o=(r=_(t,e,n))-S(t,e,n))?null:r==t?(e-n)/o:r==e?(n-t)/o+2:(t-e)/o+4)+360)%6*60/360,s:0==o?0:o/r,b:r,toString:ot}},e.rgb2hsl=function(t,e,n){var r,o,i,a;return t=(n=st(t,e,n))[0],e=n[1],n=n[2],r=((o=_(t,e,n))+(i=S(t,e,n)))/2,{h:((0==(a=o-i)?null:o==t?(e-n)/a:o==e?(n-t)/a+2:(t-e)/a+4)+360)%6*60/360,s:0==a?0:r<.5?a/(2*r):a/(2-2*r),l:r,toString:it}},e._path2string=function(){return this.join(",").replace(H,"$1")},e._preload=function(t,e){var n=l.doc.createElement("img");n.style.cssText="position:absolute;left:-9999em;top:-9999em",n.onload=function(){e.call(this),this.onload=null,l.doc.body.removeChild(this)},n.onerror=function(){l.doc.body.removeChild(this)},l.doc.body.appendChild(n),n.src=t},e.getRGB=ct((function(t){if(!t||(t=y(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:lt};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:lt};!G[c](t.toLowerCase().substring(0,2))&&"#"!=t.charAt()&&(t=rt(t));var n,r,o,i,a,s,u=t.match(R);return u?(u[2]&&(o=Z(u[2].substring(5),16),r=Z(u[2].substring(3,5),16),n=Z(u[2].substring(1,3),16)),u[3]&&(o=Z((a=u[3].charAt(3))+a,16),r=Z((a=u[3].charAt(2))+a,16),n=Z((a=u[3].charAt(1))+a,16)),u[4]&&(s=u[4][b](F),n=B(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=B(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),o=B(s[2]),"%"==s[2].slice(-1)&&(o*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(i=B(s[3])),s[3]&&"%"==s[3].slice(-1)&&(i/=100)),u[5]?(s=u[5][b](F),n=B(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=B(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),o=B(s[2]),"%"==s[2].slice(-1)&&(o*=2.55),("deg"==s[0].slice(-3)||"°"==s[0].slice(-1))&&(n/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(i=B(s[3])),s[3]&&"%"==s[3].slice(-1)&&(i/=100),e.hsb2rgb(n,r,o,i)):u[6]?(s=u[6][b](F),n=B(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=B(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),o=B(s[2]),"%"==s[2].slice(-1)&&(o*=2.55),("deg"==s[0].slice(-3)||"°"==s[0].slice(-1))&&(n/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(i=B(s[3])),s[3]&&"%"==s[3].slice(-1)&&(i/=100),e.hsl2rgb(n,r,o,i)):((u={r:n,g:r,b:o,toString:lt}).hex="#"+(16777216|o|r<<8|n<<16).toString(16).slice(1),e.is(i,"finite")&&(u.opacity=i),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:lt}}),e),e.hsb=ct((function(t,n,r){return e.hsb2rgb(t,n,r).hex})),e.hsl=ct((function(t,n,r){return e.hsl2rgb(t,n,r).hex})),e.rgb=ct((function(t,e,n){function r(t){return t+.5|0}return"#"+(16777216|r(n)|r(e)<<8|r(t)<<16).toString(16).slice(1)})),e.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},n=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),n.hex},e.getColor.reset=function(){delete this.start},e.parsePathString=function(t){if(!t)return null;var n=ht(t);if(n.arr)return bt(n.arr);var r={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},o=[];return e.is(t,T)&&e.is(t[0],T)&&(o=bt(t)),o.length||y(t).replace(V,(function(t,e,n){var i=[],a=e.toLowerCase();if(n.replace(q,(function(t,e){e&&i.push(+e)})),"m"==a&&i.length>2&&(o.push([e][p](i.splice(0,2))),a="l",e="m"==e?"l":"L"),"r"==a)o.push([e][p](i));else for(;i.length>=r[a]&&(o.push([e][p](i.splice(0,r[a]))),r[a]););})),o.toString=e._path2string,n.arr=bt(o),o},e.parseTransformString=ct((function(t){if(!t)return null;var n=[];return e.is(t,T)&&e.is(t[0],T)&&(n=bt(t)),n.length||y(t).replace(U,(function(t,e,r){var o=[];O.call(e),r.replace(q,(function(t,e){e&&o.push(+e)})),n.push([e][p](o))})),n.toString=e._path2string,n}),this,(function(t){if(!t)return t;for(var e=[],n=0;n<t.length;n++){for(var r=[],o=0;o<t[n].length;o++)r.push(t[n][o]);e.push(r)}return e}));var ht=function(t){var e=ht.ps=ht.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout((function(){for(var n in e)e[c](n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])})),e[t]};function dt(t,e,n,r,o){return t*(t*(-3*e+9*n-9*r+3*o)+6*e-12*n+6*r)-3*e+3*n}function pt(t,e,n,r,o,i,a,s,u){null==u&&(u=1);for(var c=(u=u>1?1:u<0?0:u)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var p=c*l[d]+c,v=dt(p,t,n,o,a),m=dt(p,e,r,i,s),g=v*v+m*m;h+=f[d]*E.sqrt(g)}return c*h}function vt(t,e,n,r,o,i,a,s){if(!(_(t,n)<S(o,a)||S(t,n)>_(o,a)||_(e,r)<S(i,s)||S(e,r)>_(i,s))){var u=(t-n)*(i-s)-(e-r)*(o-a);if(u){var c=((t*r-e*n)*(o-a)-(t-n)*(o*s-i*a))/u,l=((t*r-e*n)*(i-s)-(e-r)*(o*s-i*a))/u,f=+c.toFixed(2),h=+l.toFixed(2);if(!(f<+S(t,n).toFixed(2)||f>+_(t,n).toFixed(2)||f<+S(o,a).toFixed(2)||f>+_(o,a).toFixed(2)||h<+S(e,r).toFixed(2)||h>+_(e,r).toFixed(2)||h<+S(i,s).toFixed(2)||h>+_(i,s).toFixed(2)))return{x:c,y:l}}}}function mt(t,n,r){var o=e.bezierBBox(t),i=e.bezierBBox(n);if(!e.isBBoxIntersect(o,i))return r?0:[];for(var a=pt.apply(0,t),s=pt.apply(0,n),u=_(~~(a/5),1),c=_(~~(s/5),1),l=[],f=[],h={},d=r?0:[],p=0;p<u+1;p++){var v=e.findDotsAtSegment.apply(e,t.concat(p/u));l.push({x:v.x,y:v.y,t:p/u})}for(p=0;p<c+1;p++)v=e.findDotsAtSegment.apply(e,n.concat(p/c)),f.push({x:v.x,y:v.y,t:p/c});for(p=0;p<u;p++)for(var m=0;m<c;m++){var g=l[p],y=l[p+1],b=f[m],w=f[m+1],x=j(y.x-g.x)<.001?"y":"x",O=j(w.x-b.x)<.001?"y":"x",E=vt(g.x,g.y,y.x,y.y,b.x,b.y,w.x,w.y);if(E){if(h[E.x.toFixed(4)]==E.y.toFixed(4))continue;h[E.x.toFixed(4)]=E.y.toFixed(4);var A=g.t+j((E[x]-g[x])/(y[x]-g[x]))*(y.t-g.t),P=b.t+j((E[O]-b[O])/(w[O]-b[O]))*(w.t-b.t);A>=0&&A<=1.001&&P>=0&&P<=1.001&&(r?d++:d.push({x:E.x,y:E.y,t1:S(A,1),t2:S(P,1)}))}}return d}function gt(t,n,r){t=e._path2curve(t),n=e._path2curve(n);for(var o,i,a,s,u,c,l,f,h,d,p=r?0:[],v=0,m=t.length;v<m;v++){var g=t[v];if("M"==g[0])o=u=g[1],i=c=g[2];else{"C"==g[0]?(h=[o,i].concat(g.slice(1)),o=h[6],i=h[7]):(h=[o,i,o,i,u,c,u,c],o=u,i=c);for(var y=0,b=n.length;y<b;y++){var w=n[y];if("M"==w[0])a=l=w[1],s=f=w[2];else{"C"==w[0]?(d=[a,s].concat(w.slice(1)),a=d[6],s=d[7]):(d=[a,s,a,s,l,f,l,f],a=l,s=f);var x=mt(h,d,r);if(r)p+=x;else{for(var O=0,E=x.length;O<E;O++)x[O].segment1=v,x[O].segment2=y,x[O].bez1=h,x[O].bez2=d;p=p.concat(x)}}}}}return p}e.findDotsAtSegment=function(t,e,n,r,o,i,a,s,u){var c=1-u,l=A(c,3),f=A(c,2),h=u*u,d=h*u,p=l*t+3*f*u*n+3*c*u*u*o+d*a,v=l*e+3*f*u*r+3*c*u*u*i+d*s,m=t+2*u*(n-t)+h*(o-2*n+t),g=e+2*u*(r-e)+h*(i-2*r+e),y=n+2*u*(o-n)+h*(a-2*o+n),b=r+2*u*(i-r)+h*(s-2*i+r),w=c*t+u*n,x=c*e+u*r,O=c*o+u*a,_=c*i+u*s,S=90-180*E.atan2(m-y,g-b)/P;return(m>y||g<b)&&(S+=180),{x:p,y:v,m:{x:m,y:g},n:{x:y,y:b},start:{x:w,y:x},end:{x:O,y:_},alpha:S}},e.bezierBBox=function(t,n,r,o,i,a,s,u){e.is(t,"array")||(t=[t,n,r,o,i,a,s,u]);var c=jt.apply(null,t);return{x:c.min.x,y:c.min.y,x2:c.max.x,y2:c.max.y,width:c.max.x-c.min.x,height:c.max.y-c.min.y}},e.isPointInsideBBox=function(t,e,n){return e>=t.x&&e<=t.x2&&n>=t.y&&n<=t.y2},e.isBBoxIntersect=function(t,n){var r=e.isPointInsideBBox;return r(n,t.x,t.y)||r(n,t.x2,t.y)||r(n,t.x,t.y2)||r(n,t.x2,t.y2)||r(t,n.x,n.y)||r(t,n.x2,n.y)||r(t,n.x,n.y2)||r(t,n.x2,n.y2)||(t.x<n.x2&&t.x>n.x||n.x<t.x2&&n.x>t.x)&&(t.y<n.y2&&t.y>n.y||n.y<t.y2&&n.y>t.y)},e.pathIntersection=function(t,e){return gt(t,e)},e.pathIntersectionNumber=function(t,e){return gt(t,e,1)},e.isPointInsidePath=function(t,n,r){var o=e.pathBBox(t);return e.isPointInsideBBox(o,n,r)&&gt(t,[["M",n,r],["H",o.x2+10]],1)%2==1},e._removedFactory=function(e){return function(){t("raphael.log",null,"Raphaël: you are calling to method “"+e+"” of removed object",e)}};var yt=e.pathBBox=function(t){var e=ht(t);if(e.bbox)return nt(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var n,r=0,o=0,i=[],a=[],s=0,u=(t=At(t)).length;s<u;s++)if("M"==(n=t[s])[0])r=n[1],o=n[2],i.push(r),a.push(o);else{var c=jt(r,o,n[1],n[2],n[3],n[4],n[5],n[6]);i=i[p](c.min.x,c.max.x),a=a[p](c.min.y,c.max.y),r=n[5],o=n[6]}var l=S[d](0,i),f=S[d](0,a),h=_[d](0,i),v=_[d](0,a),m=h-l,g=v-f,y={x:l,y:f,x2:h,y2:v,width:m,height:g,cx:l+m/2,cy:f+g/2};return e.bbox=nt(y),y},bt=function(t){var n=nt(t);return n.toString=e._path2string,n},wt=e._pathToRelative=function(t){var n=ht(t);if(n.rel)return bt(n.rel);e.is(t,T)&&e.is(t&&t[0],T)||(t=e.parsePathString(t));var r=[],o=0,i=0,a=0,s=0,u=0;"M"==t[0][0]&&(a=o=t[0][1],s=i=t[0][2],u++,r.push(["M",o,i]));for(var c=u,l=t.length;c<l;c++){var f=r[c]=[],h=t[c];if(h[0]!=O.call(h[0]))switch(f[0]=O.call(h[0]),f[0]){case"a":f[1]=h[1],f[2]=h[2],f[3]=h[3],f[4]=h[4],f[5]=h[5],f[6]=+(h[6]-o).toFixed(3),f[7]=+(h[7]-i).toFixed(3);break;case"v":f[1]=+(h[1]-i).toFixed(3);break;case"m":a=h[1],s=h[2];default:for(var d=1,p=h.length;d<p;d++)f[d]=+(h[d]-(d%2?o:i)).toFixed(3)}else{f=r[c]=[],"m"==h[0]&&(a=h[1]+o,s=h[2]+i);for(var v=0,m=h.length;v<m;v++)r[c][v]=h[v]}var g=r[c].length;switch(r[c][0]){case"z":o=a,i=s;break;case"h":o+=+r[c][g-1];break;case"v":i+=+r[c][g-1];break;default:o+=+r[c][g-2],i+=+r[c][g-1]}}return r.toString=e._path2string,n.rel=bt(r),r},xt=e._pathToAbsolute=function(t){var n=ht(t);if(n.abs)return bt(n.abs);if(e.is(t,T)&&e.is(t&&t[0],T)||(t=e.parsePathString(t)),!t||!t.length)return[["M",0,0]];var r=[],o=0,i=0,a=0,s=0,u=0;"M"==t[0][0]&&(a=o=+t[0][1],s=i=+t[0][2],u++,r[0]=["M",o,i]);for(var c,l,f=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),h=u,d=t.length;h<d;h++){if(r.push(c=[]),(l=t[h])[0]!=L.call(l[0]))switch(c[0]=L.call(l[0]),c[0]){case"A":c[1]=l[1],c[2]=l[2],c[3]=l[3],c[4]=l[4],c[5]=l[5],c[6]=+(l[6]+o),c[7]=+(l[7]+i);break;case"V":c[1]=+l[1]+i;break;case"H":c[1]=+l[1]+o;break;case"R":for(var v=[o,i][p](l.slice(1)),m=2,g=v.length;m<g;m++)v[m]=+v[m]+o,v[++m]=+v[m]+i;r.pop(),r=r[p](ft(v,f));break;case"M":a=+l[1]+o,s=+l[2]+i;default:for(m=1,g=l.length;m<g;m++)c[m]=+l[m]+(m%2?o:i)}else if("R"==l[0])v=[o,i][p](l.slice(1)),r.pop(),r=r[p](ft(v,f)),c=["R"][p](l.slice(-2));else for(var y=0,b=l.length;y<b;y++)c[y]=l[y];switch(c[0]){case"Z":o=a,i=s;break;case"H":o=c[1];break;case"V":i=c[1];break;case"M":a=c[c.length-2],s=c[c.length-1];default:o=c[c.length-2],i=c[c.length-1]}}return r.toString=e._path2string,n.abs=bt(r),r},Ot=function(t,e,n,r){return[t,e,n,r,n,r]},Et=function(t,e,n,r,o,i){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*o+2/3*n,1/3*i+2/3*r,o,i]},_t=function(t,e,n,r,o,i,a,s,u,c){var l,f=120*P/180,h=P/180*(+o||0),d=[],v=ct((function(t,e,n){return{x:t*E.cos(n)-e*E.sin(n),y:t*E.sin(n)+e*E.cos(n)}}));if(c)A=c[0],k=c[1],_=c[2],S=c[3];else{t=(l=v(t,e,-h)).x,e=l.y,s=(l=v(s,u,-h)).x,u=l.y,E.cos(P/180*o),E.sin(P/180*o);var m=(t-s)/2,g=(e-u)/2,y=m*m/(n*n)+g*g/(r*r);y>1&&(n*=y=E.sqrt(y),r*=y);var w=n*n,x=r*r,O=(i==a?-1:1)*E.sqrt(j((w*x-w*g*g-x*m*m)/(w*g*g+x*m*m))),_=O*n*g/r+(t+s)/2,S=O*-r*m/n+(e+u)/2,A=E.asin(((e-S)/r).toFixed(9)),k=E.asin(((u-S)/r).toFixed(9));(A=t<_?P-A:A)<0&&(A=2*P+A),(k=s<_?P-k:k)<0&&(k=2*P+k),a&&A>k&&(A-=2*P),!a&&k>A&&(k-=2*P)}var T=k-A;if(j(T)>f){var C=k,R=s,M=u;k=A+f*(a&&k>A?1:-1),s=_+n*E.cos(k),u=S+r*E.sin(k),d=_t(s,u,n,r,o,0,a,R,M,[k,C,_,S])}T=k-A;var I=E.cos(A),N=E.sin(A),B=E.cos(k),Z=E.sin(k),L=E.tan(T/4),D=4/3*n*L,z=4/3*r*L,F=[t,e],G=[t+D*N,e-z*I],H=[s+D*Z,u-z*B],V=[s,u];if(G[0]=2*F[0]-G[0],G[1]=2*F[1]-G[1],c)return[G,H,V][p](d);for(var U=[],q=0,W=(d=[G,H,V][p](d).join()[b](",")).length;q<W;q++)U[q]=q%2?v(d[q-1],d[q],h).y:v(d[q],d[q+1],h).x;return U},St=function(t,e,n,r,o,i,a,s,u){var c=1-u;return{x:A(c,3)*t+3*A(c,2)*u*n+3*c*u*u*o+A(u,3)*a,y:A(c,3)*e+3*A(c,2)*u*r+3*c*u*u*i+A(u,3)*s}},jt=ct((function(t,e,n,r,o,i,a,s){var u,c=o-2*n+t-(a-2*o+n),l=2*(n-t)-2*(o-n),f=t-n,h=(-l+E.sqrt(l*l-4*c*f))/2/c,p=(-l-E.sqrt(l*l-4*c*f))/2/c,v=[e,s],m=[t,a];return j(h)>"1e12"&&(h=.5),j(p)>"1e12"&&(p=.5),h>0&&h<1&&(u=St(t,e,n,r,o,i,a,s,h),m.push(u.x),v.push(u.y)),p>0&&p<1&&(u=St(t,e,n,r,o,i,a,s,p),m.push(u.x),v.push(u.y)),c=i-2*r+e-(s-2*i+r),f=e-r,h=(-(l=2*(r-e)-2*(i-r))+E.sqrt(l*l-4*c*f))/2/c,p=(-l-E.sqrt(l*l-4*c*f))/2/c,j(h)>"1e12"&&(h=.5),j(p)>"1e12"&&(p=.5),h>0&&h<1&&(u=St(t,e,n,r,o,i,a,s,h),m.push(u.x),v.push(u.y)),p>0&&p<1&&(u=St(t,e,n,r,o,i,a,s,p),m.push(u.x),v.push(u.y)),{min:{x:S[d](0,m),y:S[d](0,v)},max:{x:_[d](0,m),y:_[d](0,v)}}})),At=e._path2curve=ct((function(t,e){var n=!e&&ht(t);if(!e&&n.curve)return bt(n.curve);for(var r=xt(t),o=e&&xt(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=function(t,e,n){var r,o;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][p](_t[d](0,[e.x,e.y][p](t.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*e.x-e.bx,o=2*e.y-e.by):(r=e.x,o=e.y),t=["C",r,o][p](t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][p](Et(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][p](Et(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][p](Ot(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][p](Ot(e.x,e.y,t[1],e.y));break;case"V":t=["C"][p](Ot(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][p](Ot(e.x,e.y,e.X,e.Y))}return t},u=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)l[e]="A",o&&(f[e]="A"),t.splice(e++,0,["C"][p](n.splice(0,6)));t.splice(e,1),g=_(r.length,o&&o.length||0)}},c=function(t,e,n,i,a){t&&e&&"M"==t[a][0]&&"M"!=e[a][0]&&(e.splice(a,0,["M",i.x,i.y]),n.bx=0,n.by=0,n.x=t[a][1],n.y=t[a][2],g=_(r.length,o&&o.length||0))},l=[],f=[],h="",v="",m=0,g=_(r.length,o&&o.length||0);m<g;m++){r[m]&&(h=r[m][0]),"C"!=h&&(l[m]=h,m&&(v=l[m-1])),r[m]=s(r[m],i,v),"A"!=l[m]&&"C"==h&&(l[m]="C"),u(r,m),o&&(o[m]&&(h=o[m][0]),"C"!=h&&(f[m]=h,m&&(v=f[m-1])),o[m]=s(o[m],a,v),"A"!=f[m]&&"C"==h&&(f[m]="C"),u(o,m)),c(r,o,i,a,m),c(o,r,a,i,m);var y=r[m],b=o&&o[m],w=y.length,x=o&&b.length;i.x=y[w-2],i.y=y[w-1],i.bx=B(y[w-4])||i.x,i.by=B(y[w-3])||i.y,a.bx=o&&(B(b[x-4])||a.x),a.by=o&&(B(b[x-3])||a.y),a.x=o&&b[x-2],a.y=o&&b[x-1]}return o||(n.curve=bt(r)),o?[r,o]:r}),null,bt),Pt=(e._parseDots=ct((function(t){for(var n=[],r=0,o=t.length;r<o;r++){var i={},a=t[r].match(/^([^:]*):?([\d\.]*)/);if(i.color=e.getRGB(a[1]),i.color.error)return null;i.opacity=i.color.opacity,i.color=i.color.hex,a[2]&&(i.offset=a[2]+"%"),n.push(i)}for(r=1,o=n.length-1;r<o;r++)if(!n[r].offset){for(var s=B(n[r-1].offset||0),u=0,c=r+1;c<o;c++)if(n[c].offset){u=n[c].offset;break}u||(u=100,c=o);for(var l=((u=B(u))-s)/(c-r+1);r<c;r++)s+=l,n[r].offset=s+"%"}return n})),e._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),kt=(e._tofront=function(t,e){e.top!==t&&(Pt(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},e._toback=function(t,e){e.bottom!==t&&(Pt(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},e._insertafter=function(t,e,n){Pt(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},e._insertbefore=function(t,e,n){Pt(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},e.toMatrix=function(t,e){var n=yt(t),r={_:{transform:m},getBBox:function(){return n}};return Tt(r,e),r.matrix}),Tt=(e.transformPath=function(t,e){return Q(t,kt(t,e))},e._extractTransform=function(t,n){if(null==n)return t._.transform;n=y(n).replace(/\.{3}|\u2026/g,t._.transform||m);var r,o,i=e.parseTransformString(n),a=0,s=1,u=1,c=t._,l=new Mt;if(c.transform=i||[],i)for(var f=0,h=i.length;f<h;f++){var d,p,v,g,b,w=i[f],x=w.length,O=y(w[0]).toLowerCase(),E=w[0]!=O,_=E?l.invert():0;"t"==O&&3==x?E?(d=_.x(0,0),p=_.y(0,0),v=_.x(w[1],w[2]),g=_.y(w[1],w[2]),l.translate(v-d,g-p)):l.translate(w[1],w[2]):"r"==O?2==x?(b=b||t.getBBox(1),l.rotate(w[1],b.x+b.width/2,b.y+b.height/2),a+=w[1]):4==x&&(E?(v=_.x(w[2],w[3]),g=_.y(w[2],w[3]),l.rotate(w[1],v,g)):l.rotate(w[1],w[2],w[3]),a+=w[1]):"s"==O?2==x||3==x?(b=b||t.getBBox(1),l.scale(w[1],w[x-1],b.x+b.width/2,b.y+b.height/2),s*=w[1],u*=w[x-1]):5==x&&(E?(v=_.x(w[3],w[4]),g=_.y(w[3],w[4]),l.scale(w[1],w[2],v,g)):l.scale(w[1],w[2],w[3],w[4]),s*=w[1],u*=w[2]):"m"==O&&7==x&&l.add(w[1],w[2],w[3],w[4],w[5],w[6]),c.dirtyT=1,t.matrix=l}t.matrix=l,c.sx=s,c.sy=u,c.deg=a,c.dx=r=l.e,c.dy=o=l.f,1==s&&1==u&&!a&&c.bbox?(c.bbox.x+=+r,c.bbox.y+=+o):c.dirtyT=1}),Ct=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},Rt=e._equaliseTransform=function(t,n){n=y(n).replace(/\.{3}|\u2026/g,t),t=e.parseTransformString(t)||[],n=e.parseTransformString(n)||[];for(var r,o,i,a,s=_(t.length,n.length),u=[],c=[],l=0;l<s;l++){if(i=t[l]||Ct(n[l]),a=n[l]||Ct(i),i[0]!=a[0]||"r"==i[0].toLowerCase()&&(i[2]!=a[2]||i[3]!=a[3])||"s"==i[0].toLowerCase()&&(i[3]!=a[3]||i[4]!=a[4]))return;for(u[l]=[],c[l]=[],r=0,o=_(i.length,a.length);r<o;r++)r in i&&(u[l][r]=i[r]),r in a&&(c[l][r]=a[r])}return{from:u,to:c}};function Mt(t,e,n,r,o,i){null!=t?(this.a=+t,this.b=+e,this.c=+n,this.d=+r,this.e=+o,this.f=+i):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}e._getContainer=function(t,n,r,o){var i;if(null!=(i=null!=o||e.is(t,"object")?t:l.doc.getElementById(t)))return i.tagName?null==n?{container:i,width:i.style.pixelWidth||i.offsetWidth,height:i.style.pixelHeight||i.offsetHeight}:{container:i,width:n,height:r}:{container:1,x:t,y:n,width:r,height:o}},e.pathToRelative=wt,e._engine={},e.path2curve=At,e.matrix=function(t,e,n,r,o,i){return new Mt(t,e,n,r,o,i)},function(t){function n(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var e=E.sqrt(n(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}t.add=function(t,e,n,r,o,i){var a,s,u,c,l=[[],[],[]],f=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],h=[[t,n,o],[e,r,i],[0,0,1]];for(t&&t instanceof Mt&&(h=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),a=0;a<3;a++)for(s=0;s<3;s++){for(c=0,u=0;u<3;u++)c+=f[a][u]*h[u][s];l[a][s]=c}this.a=l[0][0],this.b=l[1][0],this.c=l[0][1],this.d=l[1][1],this.e=l[0][2],this.f=l[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new Mt(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new Mt(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,r){null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},t.rotate=function(t,n,r){t=e.rad(t),n=n||0,r=r||0;var o=+E.cos(t).toFixed(9),i=+E.sin(t).toFixed(9);this.add(o,i,-i,o,n,r),this.add(1,0,0,1,-n,-r)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[y.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return e.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var o=[[this.a,this.c],[this.b,this.d]];t.scalex=E.sqrt(n(o[0])),r(o[0]),t.shear=o[0][0]*o[1][0]+o[0][1]*o[1][1],o[1]=[o[1][0]-o[0][0]*t.shear,o[1][1]-o[0][1]*t.shear],t.scaley=E.sqrt(n(o[1])),r(o[1]),t.shear/=t.scaley;var i=-o[0][1],a=o[1][1];return a<0?(t.rotate=e.deg(E.acos(a)),i<0&&(t.rotate=360-t.rotate)):t.rotate=e.deg(E.asin(i)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[b]();return e.isSimple?(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[e.dx,e.dy]:m)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:m)+(e.rotate?"r"+[e.rotate,0,0]:m)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(Mt.prototype);for(var It=function(){this.returnValue=!1},Nt=function(){return this.originalEvent.preventDefault()},Bt=function(){this.cancelBubble=!0},Zt=function(){return this.originalEvent.stopPropagation()},Lt=function(t){var e=l.doc.documentElement.scrollTop||l.doc.body.scrollTop,n=l.doc.documentElement.scrollLeft||l.doc.body.scrollLeft;return{x:t.clientX+n,y:t.clientY+e}},Dt=l.doc.addEventListener?function(t,e,n,r){var o=function(t){var e=Lt(t);return n.call(r,t,e.x,e.y)};if(t.addEventListener(e,o,!1),v&&x[e]){var i=function(e){for(var o=Lt(e),i=e,a=0,s=e.targetTouches&&e.targetTouches.length;a<s;a++)if(e.targetTouches[a].target==t){(e=e.targetTouches[a]).originalEvent=i,e.preventDefault=Nt,e.stopPropagation=Zt;break}return n.call(r,e,o.x,o.y)};t.addEventListener(x[e],i,!1)}return function(){return t.removeEventListener(e,o,!1),v&&x[e]&&t.removeEventListener(x[e],i,!1),!0}}:l.doc.attachEvent?function(t,e,n,r){var o=function(t){t=t||l.win.event;var e=l.doc.documentElement.scrollTop||l.doc.body.scrollTop,o=l.doc.documentElement.scrollLeft||l.doc.body.scrollLeft,i=t.clientX+o,a=t.clientY+e;return t.preventDefault=t.preventDefault||It,t.stopPropagation=t.stopPropagation||Bt,n.call(r,t,i,a)};return t.attachEvent("on"+e,o),function(){return t.detachEvent("on"+e,o),!0}}:void 0,zt=[],Ft=function(e){for(var n,r=e.clientX,o=e.clientY,i=l.doc.documentElement.scrollTop||l.doc.body.scrollTop,a=l.doc.documentElement.scrollLeft||l.doc.body.scrollLeft,s=zt.length;s--;){if(n=zt[s],v&&e.touches){for(var u,c=e.touches.length;c--;)if((u=e.touches[c]).identifier==n.el._drag.id){r=u.clientX,o=u.clientY,(e.originalEvent?e.originalEvent:e).preventDefault();break}}else e.preventDefault();var f,h=n.el.node,d=h.nextSibling,p=h.parentNode,m=h.style.display;l.win.opera&&p.removeChild(h),h.style.display="none",f=n.el.paper.getElementByPoint(r,o),h.style.display=m,l.win.opera&&(d?p.insertBefore(h,d):p.appendChild(h)),f&&t("raphael.drag.over."+n.el.id,n.el,f),r+=a,o+=i,t("raphael.drag.move."+n.el.id,n.move_scope||n.el,r-n.el._drag.x,o-n.el._drag.y,r,o,e)}},Gt=function(n){e.unmousemove(Ft).unmouseup(Gt);for(var r,o=zt.length;o--;)(r=zt[o]).el._drag={},t("raphael.drag.end."+r.el.id,r.end_scope||r.start_scope||r.move_scope||r.el,n);zt=[]},Ht=e.el={},Vt=w.length;Vt--;)!function(t){e[t]=Ht[t]=function(n,r){return e.is(n,"function")&&(this.events=this.events||[],this.events.push({name:t,f:n,unbind:Dt(this.shape||this.node||l.doc,t,n,r||this)})),this},e["un"+t]=Ht["un"+t]=function(n){for(var r=this.events||[],o=r.length;o--;)r[o].name!=t||!e.is(n,"undefined")&&r[o].f!=n||(r[o].unbind(),r.splice(o,1),!r.length&&delete this.events);return this}}(w[Vt]);Ht.data=function(n,r){var o=W[this.id]=W[this.id]||{};if(0==arguments.length)return o;if(1==arguments.length){if(e.is(n,"object")){for(var i in n)n[c](i)&&this.data(i,n[i]);return this}return t("raphael.data.get."+this.id,this,o[n],n),o[n]}return o[n]=r,t("raphael.data.set."+this.id,this,r,n),this},Ht.removeData=function(t){return null==t?delete W[this.id]:W[this.id]&&delete W[this.id][t],this},Ht.getData=function(){return nt(W[this.id]||{})},Ht.hover=function(t,e,n,r){return this.mouseover(t,n).mouseout(e,r||n)},Ht.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var Ut=[];function qt(){return this.x+g+this.y+g+this.width+" × "+this.height}Ht.drag=function(n,r,o,i,a,s){function u(u){(u.originalEvent||u).preventDefault();var c=u.clientX,f=u.clientY,h=l.doc.documentElement.scrollTop||l.doc.body.scrollTop,d=l.doc.documentElement.scrollLeft||l.doc.body.scrollLeft;if(this._drag.id=u.identifier,v&&u.touches)for(var p,m=u.touches.length;m--;)if(p=u.touches[m],this._drag.id=p.identifier,p.identifier==this._drag.id){c=p.clientX,f=p.clientY;break}this._drag.x=c+d,this._drag.y=f+h,!zt.length&&e.mousemove(Ft).mouseup(Gt),zt.push({el:this,move_scope:i,start_scope:a,end_scope:s}),r&&t.on("raphael.drag.start."+this.id,r),n&&t.on("raphael.drag.move."+this.id,n),o&&t.on("raphael.drag.end."+this.id,o),t("raphael.drag.start."+this.id,a||i||this,this._drag.x,this._drag.y,u)}return this._drag={},Ut.push({el:this,start:u}),this.mousedown(u),this},Ht.onDragOver=function(e){e?t.on("raphael.drag.over."+this.id,e):t.unbind("raphael.drag.over."+this.id)},Ht.undrag=function(){for(var n=Ut.length;n--;)Ut[n].el==this&&(this.unmousedown(Ut[n].start),Ut.splice(n,1),t.unbind("raphael.drag.*."+this.id));!Ut.length&&e.unmousemove(Ft).unmouseup(Gt),zt=[]},r.circle=function(t,n,r){var o=e._engine.circle(this,t||0,n||0,r||0);return this.__set__&&this.__set__.push(o),o},r.rect=function(t,n,r,o,i){var a=e._engine.rect(this,t||0,n||0,r||0,o||0,i||0);return this.__set__&&this.__set__.push(a),a},r.ellipse=function(t,n,r,o){var i=e._engine.ellipse(this,t||0,n||0,r||0,o||0);return this.__set__&&this.__set__.push(i),i},r.path=function(t){t&&!e.is(t,"string")&&!e.is(t[0],T)&&(t+=m);var n=e._engine.path(e.format[d](e,arguments),this);return this.__set__&&this.__set__.push(n),n},r.image=function(t,n,r,o,i){var a=e._engine.image(this,t||"about:blank",n||0,r||0,o||0,i||0);return this.__set__&&this.__set__.push(a),a},r.text=function(t,n,r){var o=e._engine.text(this,t||0,n||0,y(r));return this.__set__&&this.__set__.push(o),o},r.set=function(t){!e.is(t,"array")&&(t=Array.prototype.splice.call(arguments,0,arguments.length));var n=new fe(t);return this.__set__&&this.__set__.push(n),n.paper=this,n.type="set",n},r.setStart=function(t){this.__set__=t||this.set()},r.setFinish=function(t){var e=this.__set__;return delete this.__set__,e},r.getSize=function(){var t=this.canvas.parentNode;return{width:t.offsetWidth,height:t.offsetHeight}},r.setSize=function(t,n){return e._engine.setSize.call(this,t,n)},r.setViewBox=function(t,n,r,o,i){return e._engine.setViewBox.call(this,t,n,r,o,i)},r.top=r.bottom=null,r.raphael=e,r.getElementByPoint=function(t,e){var n,r,o,i,a,s,u,c=this.canvas,f=l.doc.elementFromPoint(t,e);if(l.win.opera&&"svg"==f.tagName){var h=(r=(n=c).getBoundingClientRect(),i=(o=n.ownerDocument).body,s=(a=o.documentElement).clientTop||i.clientTop||0,u=a.clientLeft||i.clientLeft||0,{y:r.top+(l.win.pageYOffset||a.scrollTop||i.scrollTop)-s,x:r.left+(l.win.pageXOffset||a.scrollLeft||i.scrollLeft)-u}),d=c.createSVGRect();d.x=t-h.x,d.y=e-h.y,d.width=d.height=1;var p=c.getIntersectionList(d,null);p.length&&(f=p[p.length-1])}if(!f)return null;for(;f.parentNode&&f!=c.parentNode&&!f.raphael;)f=f.parentNode;return f==this.canvas.parentNode&&(f=c),f&&f.raphael?this.getById(f.raphaelid):null},r.getElementsByBBox=function(t){var n=this.set();return this.forEach((function(r){e.isBBoxIntersect(r.getBBox(),t)&&n.push(r)})),n},r.getById=function(t){for(var e=this.bottom;e;){if(e.id==t)return e;e=e.next}return null},r.forEach=function(t,e){for(var n=this.bottom;n;){if(!1===t.call(e,n))return this;n=n.next}return this},r.getElementsByPoint=function(t,e){var n=this.set();return this.forEach((function(r){r.isPointInside(t,e)&&n.push(r)})),n},Ht.isPointInside=function(t,n){var r=this.realPath=X[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(r=e.transformPath(r,this.attr("transform"))),e.isPointInsidePath(r,t,n)},Ht.getBBox=function(t){if(this.removed)return{};var e=this._;return t?(!e.dirty&&e.bboxwt||(this.realPath=X[this.type](this),e.bboxwt=yt(this.realPath),e.bboxwt.toString=qt,e.dirty=0),e.bboxwt):((e.dirty||e.dirtyT||!e.bbox)&&(!e.dirty&&this.realPath||(e.bboxwt=0,this.realPath=X[this.type](this)),e.bbox=yt(Q(this.realPath,this.matrix)),e.bbox.toString=qt,e.dirty=e.dirtyT=0),e.bbox)},Ht.clone=function(){if(this.removed)return null;var t=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(t),t},Ht.glow=function(t){if("text"==this.type)return null;var e={width:((t=t||{}).width||10)+(+this.attr("stroke-width")||1),fill:t.fill||!1,opacity:null==t.opacity?.5:t.opacity,offsetx:t.offsetx||0,offsety:t.offsety||0,color:t.color||"#000"},n=e.width/2,r=this.paper,o=r.set(),i=this.realPath||X[this.type](this);i=this.matrix?Q(i,this.matrix):i;for(var a=1;a<n+1;a++)o.push(r.path(i).attr({stroke:e.color,fill:e.fill?e.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/n*a).toFixed(3),opacity:+(e.opacity/n).toFixed(3)}));return o.insertBefore(this).translate(e.offsetx,e.offsety)};var Wt=function(t,n,r,o,i,a,s,u,c){return null==c?pt(t,n,r,o,i,a,s,u):e.findDotsAtSegment(t,n,r,o,i,a,s,u,function(t,e,n,r,o,i,a,s,u){if(!(u<0||pt(t,e,n,r,o,i,a,s)<u)){var c,l=.5,f=1-l;for(c=pt(t,e,n,r,o,i,a,s,f);j(c-u)>.01;)c=pt(t,e,n,r,o,i,a,s,f+=(c<u?1:-1)*(l/=2));return f}}(t,n,r,o,i,a,s,u,c))},Yt=function(t,n){return function(r,o,i){for(var a,s,u,c,l,f="",h={},d=0,p=0,v=(r=At(r)).length;p<v;p++){if("M"==(u=r[p])[0])a=+u[1],s=+u[2];else{if(d+(c=Wt(a,s,u[1],u[2],u[3],u[4],u[5],u[6]))>o){if(n&&!h.start){if(f+=["C"+(l=Wt(a,s,u[1],u[2],u[3],u[4],u[5],u[6],o-d)).start.x,l.start.y,l.m.x,l.m.y,l.x,l.y],i)return f;h.start=f,f=["M"+l.x,l.y+"C"+l.n.x,l.n.y,l.end.x,l.end.y,u[5],u[6]].join(),d+=c,a=+u[5],s=+u[6];continue}if(!t&&!n)return{x:(l=Wt(a,s,u[1],u[2],u[3],u[4],u[5],u[6],o-d)).x,y:l.y,alpha:l.alpha}}d+=c,a=+u[5],s=+u[6]}f+=u.shift()+u}return h.end=f,(l=t?d:n?h:e.findDotsAtSegment(a,s,u[0],u[1],u[2],u[3],u[4],u[5],1)).alpha&&(l={x:l.x,y:l.y,alpha:l.alpha}),l}},$t=Yt(1),Kt=Yt(),Jt=Yt(0,1);e.getTotalLength=$t,e.getPointAtLength=Kt,e.getSubpath=function(t,e,n){if(this.getTotalLength(t)-n<1e-6)return Jt(t,e).end;var r=Jt(t,n,1);return e?Jt(r,e).end:r},Ht.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():$t(t)},Ht.getPointAtLength=function(t){var e=this.getPath();if(e)return Kt(e,t)},Ht.getPath=function(){var t,n=e._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return n&&(t=n(this)),t},Ht.getSubpath=function(t,n){var r=this.getPath();if(r)return e.getSubpath(r,t,n)};var Xt=e.easing_formulas={linear:function(t){return t},"<":function(t){return A(t,1.7)},">":function(t){return A(t,.48)},"<>":function(t){var e=.48-t/1.04,n=E.sqrt(.1734+e*e),r=n-e,o=-n-e,i=A(j(r),1/3)*(r<0?-1:1)+A(j(o),1/3)*(o<0?-1:1)+.5;return 3*(1-i)*i*i+i*i*i},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:A(2,-10*t)*E.sin(2*P*(t-.075)/.3)+1},bounce:function(t){var e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375}};Xt.easeIn=Xt["ease-in"]=Xt["<"],Xt.easeOut=Xt["ease-out"]=Xt[">"],Xt.easeInOut=Xt["ease-in-out"]=Xt["<>"],Xt["back-in"]=Xt.backIn,Xt["back-out"]=Xt.backOut;var Qt=[],te=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},ee=function(){for(var n=+new Date,r=0;r<Qt.length;r++){var o=Qt[r];if(!o.el.removed&&!o.paused){var i,a,s=n-o.start,u=o.ms,l=o.easing,f=o.from,h=o.diff,d=o.to,v=(o.t,o.el),m={},y={};if(o.initstatus?(s=(o.initstatus*o.anim.top-o.prev)/(o.percent-o.prev)*u,o.status=o.initstatus,delete o.initstatus,o.stop&&Qt.splice(r--,1)):o.status=(o.prev+(o.percent-o.prev)*(s/u))/o.anim.top,!(s<0))if(s<u){var b=l(s/u);for(var w in f)if(f[c](w)){switch(z[w]){case k:i=+f[w]+b*u*h[w];break;case"colour":i="rgb("+[ne(N(f[w].r+b*u*h[w].r)),ne(N(f[w].g+b*u*h[w].g)),ne(N(f[w].b+b*u*h[w].b))].join(",")+")";break;case"path":i=[];for(var x=0,O=f[w].length;x<O;x++){i[x]=[f[w][x][0]];for(var E=1,_=f[w][x].length;E<_;E++)i[x][E]=+f[w][x][E]+b*u*h[w][x][E];i[x]=i[x].join(g)}i=i.join(g);break;case"transform":if(h[w].real)for(i=[],x=0,O=f[w].length;x<O;x++)for(i[x]=[f[w][x][0]],E=1,_=f[w][x].length;E<_;E++)i[x][E]=f[w][x][E]+b*u*h[w][x][E];else{var S=function(t){return+f[w][t]+b*u*h[w][t]};i=[["m",S(0),S(1),S(2),S(3),S(4),S(5)]]}break;case"csv":if("clip-rect"==w)for(i=[],x=4;x--;)i[x]=+f[w][x]+b*u*h[w][x];break;default:var j=[][p](f[w]);for(i=[],x=v.paper.customAttributes[w].length;x--;)i[x]=+j[x]+b*u*h[w][x]}m[w]=i}v.attr(m),function(e,n,r){setTimeout((function(){t("raphael.anim.frame."+e,n,r)}))}(v.id,v,o.anim)}else{if(function(n,r,o){setTimeout((function(){t("raphael.anim.frame."+r.id,r,o),t("raphael.anim.finish."+r.id,r,o),e.is(n,"function")&&n.call(r)}))}(o.callback,v,o.anim),v.attr(d),Qt.splice(r--,1),o.repeat>1&&!o.next){for(a in d)d[c](a)&&(y[a]=o.totalOrigin[a]);o.el.attr(y),ie(o.anim,o.el,o.anim.percents[0],null,o.totalOrigin,o.repeat-1)}o.next&&!o.stop&&ie(o.anim,o.el,o.next,null,o.totalOrigin,o.repeat)}}}Qt.length&&te(ee)},ne=function(t){return t>255?255:t<0?0:t};function re(t,e,n,r,o,i){var a=3*e,s=3*(r-e)-a,u=1-a-s,c=3*n,l=3*(o-n)-c,f=1-c-l;function h(t){return((u*t+s)*t+a)*t}return function(t,e){var n=function(t,e){var n,r,o,i,c,l;for(o=t,l=0;l<8;l++){if(i=h(o)-t,j(i)<e)return o;if(j(c=(3*u*o+2*s)*o+a)<1e-6)break;o-=i/c}if((o=t)<(n=0))return n;if(o>(r=1))return r;for(;n<r;){if(i=h(o),j(i-t)<e)return o;t>i?n=o:r=o,o=(r-n)/2+n}return o}(t,e);return((f*n+l)*n+c)*n}(t,1/(200*i))}function oe(t,e){var n=[],r={};if(this.ms=e,this.times=1,t){for(var o in t)t[c](o)&&(r[B(o)]=t[o],n.push(B(o)));n.sort(Y)}this.anim=r,this.top=n[n.length-1],this.percents=n}function ie(n,r,o,i,s,u){o=B(o);var l,f,h,d,v,m,g=n.ms,w={},x={},O={};if(i)for(_=0,S=Qt.length;_<S;_++){var E=Qt[_];if(E.el.id==r.id&&E.anim==n){E.percent!=o?(Qt.splice(_,1),h=1):f=E,r.attr(E.totalOrigin);break}}else i=+x;for(var _=0,S=n.percents.length;_<S;_++){if(n.percents[_]==o||n.percents[_]>i*n.top){o=n.percents[_],v=n.percents[_-1]||0,g=g/n.top*(o-v),d=n.percents[_+1],l=n.anim[o];break}i&&r.attr(n.anim[n.percents[_]])}if(l){if(f)f.initstatus=i,f.start=new Date-f.ms*i;else{for(var j in l)if(l[c](j)&&(z[c](j)||r.paper.customAttributes[c](j)))switch(w[j]=r.attr(j),null==w[j]&&(w[j]=D[j]),x[j]=l[j],z[j]){case k:O[j]=(x[j]-w[j])/g;break;case"colour":w[j]=e.getRGB(w[j]);var A=e.getRGB(x[j]);O[j]={r:(A.r-w[j].r)/g,g:(A.g-w[j].g)/g,b:(A.b-w[j].b)/g};break;case"path":var P=At(w[j],x[j]),T=P[1];for(w[j]=P[0],O[j]=[],_=0,S=w[j].length;_<S;_++){O[j][_]=[0];for(var C=1,R=w[j][_].length;C<R;C++)O[j][_][C]=(T[_][C]-w[j][_][C])/g}break;case"transform":var M=r._,N=Rt(M[j],x[j]);if(N)for(w[j]=N.from,x[j]=N.to,O[j]=[],O[j].real=!0,_=0,S=w[j].length;_<S;_++)for(O[j][_]=[w[j][_][0]],C=1,R=w[j][_].length;C<R;C++)O[j][_][C]=(x[j][_][C]-w[j][_][C])/g;else{var Z=r.matrix||new Mt,L={_:{transform:M.transform},getBBox:function(){return r.getBBox(1)}};w[j]=[Z.a,Z.b,Z.c,Z.d,Z.e,Z.f],Tt(L,x[j]),x[j]=L._.transform,O[j]=[(L.matrix.a-Z.a)/g,(L.matrix.b-Z.b)/g,(L.matrix.c-Z.c)/g,(L.matrix.d-Z.d)/g,(L.matrix.e-Z.e)/g,(L.matrix.f-Z.f)/g]}break;case"csv":var F=y(l[j])[b](a),G=y(w[j])[b](a);if("clip-rect"==j)for(w[j]=G,O[j]=[],_=G.length;_--;)O[j][_]=(F[_]-w[j][_])/g;x[j]=F;break;default:for(F=[][p](l[j]),G=[][p](w[j]),O[j]=[],_=r.paper.customAttributes[j].length;_--;)O[j][_]=((F[_]||0)-(G[_]||0))/g}var H=l.easing,V=e.easing_formulas[H];if(!V)if((V=y(H).match(I))&&5==V.length){var U=V;V=function(t){return re(t,+U[1],+U[2],+U[3],+U[4],g)}}else V=$;if(E={anim:n,percent:o,timestamp:m=l.start||n.start||+new Date,start:m+(n.del||0),status:0,initstatus:i||0,stop:!1,ms:g,easing:V,from:w,diff:O,to:x,el:r,callback:l.callback,prev:v,next:d,repeat:u||n.times,origin:r.attr(),totalOrigin:s},Qt.push(E),i&&!f&&!h&&(E.stop=!0,E.start=new Date-g*i,1==Qt.length))return ee();h&&(E.start=new Date-E.ms*i),1==Qt.length&&te(ee)}t("raphael.anim.start."+r.id,r,n)}}function ae(t){for(var e=0;e<Qt.length;e++)Qt[e].el.paper==t&&Qt.splice(e--,1)}Ht.animateWith=function(t,n,r,o,i,a){if(this.removed)return a&&a.call(this),this;var s=r instanceof oe?r:e.animation(r,o,i,a);ie(s,this,s.percents[0],null,this.attr());for(var u=0,c=Qt.length;u<c;u++)if(Qt[u].anim==n&&Qt[u].el==t){Qt[c-1].start=Qt[u].start;break}return this},Ht.onAnimation=function(e){return e?t.on("raphael.anim.frame."+this.id,e):t.unbind("raphael.anim.frame."+this.id),this},oe.prototype.delay=function(t){var e=new oe(this.anim,this.ms);return e.times=this.times,e.del=+t||0,e},oe.prototype.repeat=function(t){var e=new oe(this.anim,this.ms);return e.del=this.del,e.times=E.floor(_(t,0))||1,e},e.animation=function(t,n,r,o){if(t instanceof oe)return t;!e.is(r,"function")&&r||(o=o||r||null,r=null),t=Object(t),n=+n||0;var i,a,s={};for(a in t)t[c](a)&&B(a)!=a&&B(a)+"%"!=a&&(i=!0,s[a]=t[a]);if(i)return r&&(s.easing=r),o&&(s.callback=o),new oe({100:s},n);if(o){var u=0;for(var l in t){var f=Z(l);t[c](l)&&f>u&&(u=f)}!t[u+="%"].callback&&(t[u].callback=o)}return new oe(t,n)},Ht.animate=function(t,n,r,o){if(this.removed)return o&&o.call(this),this;var i=t instanceof oe?t:e.animation(t,n,r,o);return ie(i,this,i.percents[0],null,this.attr()),this},Ht.setTime=function(t,e){return t&&null!=e&&this.status(t,S(e,t.ms)/t.ms),this},Ht.status=function(t,e){var n,r,o=[],i=0;if(null!=e)return ie(t,this,-1,S(e,1)),this;for(n=Qt.length;i<n;i++)if((r=Qt[i]).el.id==this.id&&(!t||r.anim==t)){if(t)return r.status;o.push({anim:r.anim,status:r.status})}return t?0:o},Ht.pause=function(e){for(var n=0;n<Qt.length;n++)Qt[n].el.id!=this.id||e&&Qt[n].anim!=e||!1!==t("raphael.anim.pause."+this.id,this,Qt[n].anim)&&(Qt[n].paused=!0);return this},Ht.resume=function(e){for(var n=0;n<Qt.length;n++)if(Qt[n].el.id==this.id&&(!e||Qt[n].anim==e)){var r=Qt[n];!1!==t("raphael.anim.resume."+this.id,this,r.anim)&&(delete r.paused,this.status(r.anim,r.status))}return this},Ht.stop=function(e){for(var n=0;n<Qt.length;n++)Qt[n].el.id!=this.id||e&&Qt[n].anim!=e||!1!==t("raphael.anim.stop."+this.id,this,Qt[n].anim)&&Qt.splice(n--,1);return this},t.on("raphael.remove",ae),t.on("raphael.clear",ae),Ht.toString=function(){return"Raphaël’s object"};var se,ue,ce,le,fe=function(t){if(this.items=[],this.length=0,this.type="set",t)for(var e=0,n=t.length;e<n;e++)!t[e]||t[e].constructor!=Ht.constructor&&t[e].constructor!=fe||(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},he=fe.prototype;for(var de in he.push=function(){for(var t,e,n=0,r=arguments.length;n<r;n++)!(t=arguments[n])||t.constructor!=Ht.constructor&&t.constructor!=fe||(this[e=this.items.length]=this.items[e]=t,this.length++);return this},he.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},he.forEach=function(t,e){for(var n=0,r=this.items.length;n<r;n++)if(!1===t.call(e,this.items[n],n))return this;return this},Ht)Ht[c](de)&&(he[de]=function(t){return function(){var e=arguments;return this.forEach((function(n){n[t][d](n,e)}))}}(de));return he.attr=function(t,n){if(t&&e.is(t,T)&&e.is(t[0],"object"))for(var r=0,o=t.length;r<o;r++)this.items[r].attr(t[r]);else for(var i=0,a=this.items.length;i<a;i++)this.items[i].attr(t,n);return this},he.clear=function(){for(;this.length;)this.pop()},he.splice=function(t,e,n){t=t<0?_(this.length+t,0):t,e=_(0,S(this.length-t,e));var r,o=[],i=[],a=[];for(r=2;r<arguments.length;r++)a.push(arguments[r]);for(r=0;r<e;r++)i.push(this[t+r]);for(;r<this.length-t;r++)o.push(this[t+r]);var s=a.length;for(r=0;r<s+o.length;r++)this.items[t+r]=this[t+r]=r<s?a[r]:o[r-s];for(r=this.items.length=this.length-=e-s;this[r];)delete this[r++];return new fe(i)},he.exclude=function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]==t)return this.splice(e,1),!0},he.animate=function(t,n,r,o){(e.is(r,"function")||!r)&&(o=r||null);var i,a,s=this.items.length,u=s,c=this;if(!s)return this;o&&(a=function(){!--s&&o.call(c)}),r=e.is(r,"string")?r:a;var l=e.animation(t,n,r,a);for(i=this.items[--u].animate(l);u--;)this.items[u]&&!this.items[u].removed&&this.items[u].animateWith(i,l,l),this.items[u]&&!this.items[u].removed||s--;return this},he.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},he.getBBox=function(){for(var t=[],e=[],n=[],r=[],o=this.items.length;o--;)if(!this.items[o].removed){var i=this.items[o].getBBox();t.push(i.x),e.push(i.y),n.push(i.x+i.width),r.push(i.y+i.height)}return{x:t=S[d](0,t),y:e=S[d](0,e),x2:n=_[d](0,n),y2:r=_[d](0,r),width:n-t,height:r-e}},he.clone=function(t){t=this.paper.set();for(var e=0,n=this.items.length;e<n;e++)t.push(this.items[e].clone());return t},he.toString=function(){return"Raphaël‘s set"},he.glow=function(t){var e=this.paper.set();return this.forEach((function(n,r){var o=n.glow(t);null!=o&&o.forEach((function(t,n){e.push(t)}))})),e},he.isPointInside=function(t,e){var n=!1;return this.forEach((function(r){if(r.isPointInside(t,e))return n=!0,!1})),n},e.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},n=t.face["font-family"];for(var r in t.face)t.face[c](r)&&(e.face[r]=t.face[r]);if(this.fonts[n]?this.fonts[n].push(e):this.fonts[n]=[e],!t.svg)for(var o in e.face["units-per-em"]=Z(t.face["units-per-em"],10),t.glyphs)if(t.glyphs[c](o)){var i=t.glyphs[o];if(e.glyphs[o]={w:i.w,k:{},d:i.d&&"M"+i.d.replace(/[mlcxtrv]/g,(function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"}))+"z"},i.k)for(var a in i.k)i[c](a)&&(e.glyphs[o].k[a]=i.k[a])}return t},r.getFont=function(t,n,r,o){if(o=o||"normal",r=r||"normal",n=+n||{normal:400,bold:700,lighter:300,bolder:800}[n]||400,e.fonts){var i,a=e.fonts[t];if(!a){var s=new RegExp("(^|\\s)"+t.replace(/[^\w\d\s+!~.:_-]/g,m)+"(\\s|$)","i");for(var u in e.fonts)if(e.fonts[c](u)&&s.test(u)){a=e.fonts[u];break}}if(a)for(var l=0,f=a.length;l<f&&((i=a[l]).face["font-weight"]!=n||i.face["font-style"]!=r&&i.face["font-style"]||i.face["font-stretch"]!=o);l++);return i}},r.print=function(t,n,r,o,i,s,u,c){s=s||"middle",u=_(S(u||0,1),-1),c=_(S(c||1,3),1);var l,f=y(r)[b](m),h=0,d=0,p=m;if(e.is(o,"string")&&(o=this.getFont(o)),o){l=(i||16)/o.face["units-per-em"];for(var v=o.face.bbox[b](a),g=+v[0],w=v[3]-v[1],x=0,O=+v[1]+("baseline"==s?w+ +o.face.descent:w/2),E=0,j=f.length;E<j;E++){if("\n"==f[E])h=0,P=0,d=0,x+=w*c;else{var A=d&&o.glyphs[f[E-1]]||{},P=o.glyphs[f[E]];h+=d?(A.w||o.w)+(A.k&&A.k[f[E]]||0)+o.w*u:0,d=1}P&&P.d&&(p+=e.transformPath(P.d,["t",h*l,x*l,"s",l,l,g,O,"t",(t-g)/l,(n-O)/l]))}}return this.path(p).attr({fill:"#000",stroke:"none"})},r.add=function(t){if(e.is(t,"array"))for(var n,r=this.set(),o=0,i=t.length;o<i;o++)n=t[o]||{},s[c](n.type)&&r.push(this[n.type]().attr(n));return r},e.format=function(t,n){var r=e.is(n,T)?[0][p](n):arguments;return t&&e.is(t,"string")&&r.length-1&&(t=t.replace(u,(function(t,e){return null==r[++e]?m:r[e]}))),t||m},e.fullfill=(se=/\{([^\}]+)\}/g,ue=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(t,e){return String(t).replace(se,(function(t,n){return function(t,e,n){var r=n;return e.replace(ue,(function(t,e,n,o,i){e=e||o,r&&(e in r&&(r=r[e]),"function"==typeof r&&i&&(r=r()))})),r=(null==r||r==n?t:r)+""}(t,n,e)}))}),e.ninja=function(){if(f.was)l.win.Raphael=f.is;else{window.Raphael=void 0;try{delete window.Raphael}catch(t){}}return e},e.st=he,t.on("raphael.DOMload",(function(){n=!0})),null==(ce=document).readyState&&ce.addEventListener&&(ce.addEventListener("DOMContentLoaded",le=function(){ce.removeEventListener("DOMContentLoaded",le,!1),ce.readyState="complete"},!1),ce.readyState="loading"),function t(){/in/.test(ce.readyState)?setTimeout(t,9):e.eve("raphael.DOMload")}(),e}.apply(e,r))||(t.exports=o)},function(t,e,n){var r,o;r=[n(0),n(3),n(4)],void 0===(o=function(t){return t}.apply(e,r))||(t.exports=o)},function(t,e,n){var r,o,i,a,s,u,c,l,f,h,d,p,v,m;a="hasOwnProperty",s=/[\.\/]/,u=/\s*,\s*/,c=function(t,e){return t-e},l={n:{}},f=function(){for(var t=0,e=this.length;t<e;t++)if(void 0!==this[t])return this[t]},h=function(){for(var t=this.length;--t;)if(void 0!==this[t])return this[t]},d=Object.prototype.toString,p=String,v=Array.isArray||function(t){return t instanceof Array||"[object Array]"==d.call(t)},(m=function(t,e){var n,r=i,a=Array.prototype.slice.call(arguments,2),s=m.listeners(t),u=0,l=[],d={},p=[],v=o;p.firstDefined=f,p.lastDefined=h,o=t,i=0;for(var g=0,y=s.length;g<y;g++)"zIndex"in s[g]&&(l.push(s[g].zIndex),s[g].zIndex<0&&(d[s[g].zIndex]=s[g]));for(l.sort(c);l[u]<0;)if(n=d[l[u++]],p.push(n.apply(e,a)),i)return i=r,p;for(g=0;g<y;g++)if("zIndex"in(n=s[g]))if(n.zIndex==l[u]){if(p.push(n.apply(e,a)),i)break;do{if((n=d[l[++u]])&&p.push(n.apply(e,a)),i)break}while(n)}else d[n.zIndex]=n;else if(p.push(n.apply(e,a)),i)break;return i=r,o=v,p})._events=l,m.listeners=function(t){var e,n,r,o,i,a,u,c,f=v(t)?t:t.split(s),h=l,d=[h],p=[];for(o=0,i=f.length;o<i;o++){for(c=[],a=0,u=d.length;a<u;a++)for(n=[(h=d[a].n)[f[o]],h["*"]],r=2;r--;)(e=n[r])&&(c.push(e),p=p.concat(e.f||[]));d=c}return p},m.separator=function(t){t?(t="["+(t=p(t).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",s=new RegExp(t)):s=/[\.\/]/},m.on=function(t,e){if("function"!=typeof e)return function(){};for(var n=v(t)?v(t[0])?t:[t]:p(t).split(u),r=0,o=n.length;r<o;r++)!function(t){for(var n,r=v(t)?t:p(t).split(s),o=l,i=0,a=r.length;i<a;i++)o=(o=o.n).hasOwnProperty(r[i])&&o[r[i]]||(o[r[i]]={n:{}});for(o.f=o.f||[],i=0,a=o.f.length;i<a;i++)if(o.f[i]==e){n=!0;break}!n&&o.f.push(e)}(n[r]);return function(t){+t==+t&&(e.zIndex=+t)}},m.f=function(t){var e=[].slice.call(arguments,1);return function(){m.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},m.stop=function(){i=1},m.nt=function(t){var e=v(o)?o.join("."):o;return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},m.nts=function(){return v(o)?o:o.split(s)},m.off=m.unbind=function(t,e){if(t){var n=v(t)?v(t[0])?t:[t]:p(t).split(u);if(n.length>1)for(var r=0,o=n.length;r<o;r++)m.off(n[r],e);else{n=v(t)?t:p(t).split(s);var i,c,f,h,d,g=[l];for(r=0,o=n.length;r<o;r++)for(h=0;h<g.length;h+=f.length-2){if(f=[h,1],i=g[h].n,"*"!=n[r])i[n[r]]&&f.push(i[n[r]]);else for(c in i)i[a](c)&&f.push(i[c]);g.splice.apply(g,f)}for(r=0,o=g.length;r<o;r++)for(i=g[r];i.n;){if(e){if(i.f){for(h=0,d=i.f.length;h<d;h++)if(i.f[h]==e){i.f.splice(h,1);break}!i.f.length&&delete i.f}for(c in i.n)if(i.n[a](c)&&i.n[c].f){var y=i.n[c].f;for(h=0,d=y.length;h<d;h++)if(y[h]==e){y.splice(h,1);break}!y.length&&delete i.n[c].f}}else for(c in delete i.f,i.n)i.n[a](c)&&i.n[c].f&&delete i.n[c].f;i=i.n}}}else m._events=l={n:{}}},m.once=function(t,e){var n=function(){return m.off(t,n),e.apply(this,arguments)};return m.on(t,n)},m.version="0.5.0",m.toString=function(){return"You are running Eve 0.5.0"},t.exports?t.exports=m:void 0===(r=function(){return m}.apply(e,[]))||(t.exports=r)},function(t,e,n){var r,o;r=[n(0)],void 0===(o=function(t){if(!t||t.svg){var e="hasOwnProperty",n=String,r=parseFloat,o=parseInt,i=Math,a=i.max,s=i.abs,u=i.pow,c=/[, ]+/,l=t.eve,f="",h=" ",d="http://www.w3.org/1999/xlink",p={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},v={};t.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var m=function(r,o){if(o)for(var i in"string"==typeof r&&(r=m(r)),o)o[e](i)&&("xlink:"==i.substring(0,6)?r.setAttributeNS(d,i.substring(6),n(o[i])):r.setAttribute(i,n(o[i])));else(r=t._g.doc.createElementNS("http://www.w3.org/2000/svg",r)).style&&(r.style.webkitTapHighlightColor="rgba(0,0,0,0)");return r},g=function(e,o){var c="linear",l=e.id+o,h=.5,d=.5,p=e.node,v=e.paper,g=p.style,b=t._g.doc.getElementById(l);if(!b){if(o=(o=n(o).replace(t._radial_gradient,(function(t,e,n){if(c="radial",e&&n){h=r(e);var o=2*((d=r(n))>.5)-1;u(h-.5,2)+u(d-.5,2)>.25&&(d=i.sqrt(.25-u(h-.5,2))*o+.5)&&.5!=d&&(d=d.toFixed(5)-1e-5*o)}return f}))).split(/\s*\-\s*/),"linear"==c){var w=o.shift();if(w=-r(w),isNaN(w))return null;var x=[0,0,i.cos(t.rad(w)),i.sin(t.rad(w))],O=1/(a(s(x[2]),s(x[3]))||1);x[2]*=O,x[3]*=O,x[2]<0&&(x[0]=-x[2],x[2]=0),x[3]<0&&(x[1]=-x[3],x[3]=0)}var E=t._parseDots(o);if(!E)return null;if(l=l.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&l!=e.gradient.id&&(v.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){b=m(c+"Gradient",{id:l}),e.gradient=b,m(b,"radial"==c?{fx:h,fy:d}:{x1:x[0],y1:x[1],x2:x[2],y2:x[3],gradientTransform:e.matrix.invert()}),v.defs.appendChild(b);for(var _=0,S=E.length;_<S;_++)b.appendChild(m("stop",{offset:E[_].offset?E[_].offset:_?"100%":"0%","stop-color":E[_].color||"#fff","stop-opacity":isFinite(E[_].opacity)?E[_].opacity:1}))}}return m(p,{fill:y(l),opacity:1,"fill-opacity":1}),g.fill=f,g.opacity=1,g.fillOpacity=1,1},y=function(t){if((e=document.documentMode)&&(9===e||10===e))return"url('#"+t+"')";var e,n=document.location;return"url('"+n.protocol+"//"+n.host+n.pathname+n.search+"#"+t+"')"},b=function(t){var e=t.getBBox(1);m(t.pattern,{patternTransform:t.matrix.invert()+" translate("+e.x+","+e.y+")"})},w=function(r,o,i){if("path"==r.type){for(var a,s,u,c,l,h=n(o).toLowerCase().split("-"),d=r.paper,g=i?"end":"start",y=r.node,b=r.attrs,w=b["stroke-width"],x=h.length,O="classic",E=3,_=3,S=5;x--;)switch(h[x]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":O=h[x];break;case"wide":_=5;break;case"narrow":_=2;break;case"long":E=5;break;case"short":E=2}if("open"==O?(E+=2,_+=2,S+=2,u=1,c=i?4:1,l={fill:"none",stroke:b.stroke}):(c=u=E/2,l={fill:b.stroke,stroke:"none"}),r._.arrows?i?(r._.arrows.endPath&&v[r._.arrows.endPath]--,r._.arrows.endMarker&&v[r._.arrows.endMarker]--):(r._.arrows.startPath&&v[r._.arrows.startPath]--,r._.arrows.startMarker&&v[r._.arrows.startMarker]--):r._.arrows={},"none"!=O){var j="raphael-marker-"+O,A="raphael-marker-"+g+O+E+_+"-obj"+r.id;t._g.doc.getElementById(j)?v[j]++:(d.defs.appendChild(m(m("path"),{"stroke-linecap":"round",d:p[O],id:j})),v[j]=1);var P,k=t._g.doc.getElementById(A);k?(v[A]++,P=k.getElementsByTagName("use")[0]):(k=m(m("marker"),{id:A,markerHeight:_,markerWidth:E,orient:"auto",refX:c,refY:_/2}),P=m(m("use"),{"xlink:href":"#"+j,transform:(i?"rotate(180 "+E/2+" "+_/2+") ":f)+"scale("+E/S+","+_/S+")","stroke-width":(1/((E/S+_/S)/2)).toFixed(4)}),k.appendChild(P),d.defs.appendChild(k),v[A]=1),m(P,l);var T=u*("diamond"!=O&&"oval"!=O);i?(a=r._.arrows.startdx*w||0,s=t.getTotalLength(b.path)-T*w):(a=T*w,s=t.getTotalLength(b.path)-(r._.arrows.enddx*w||0)),(l={})["marker-"+g]="url(#"+A+")",(s||a)&&(l.d=t.getSubpath(b.path,a,s)),m(y,l),r._.arrows[g+"Path"]=j,r._.arrows[g+"Marker"]=A,r._.arrows[g+"dx"]=T,r._.arrows[g+"Type"]=O,r._.arrows[g+"String"]=o}else i?(a=r._.arrows.startdx*w||0,s=t.getTotalLength(b.path)-a):(a=0,s=t.getTotalLength(b.path)-(r._.arrows.enddx*w||0)),r._.arrows[g+"Path"]&&m(y,{d:t.getSubpath(b.path,a,s)}),delete r._.arrows[g+"Path"],delete r._.arrows[g+"Marker"],delete r._.arrows[g+"dx"],delete r._.arrows[g+"Type"],delete r._.arrows[g+"String"];for(l in v)if(v[e](l)&&!v[l]){var C=t._g.doc.getElementById(l);C&&C.parentNode.removeChild(C)}}},x={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},O=function(t,e,r){if(e=x[n(e).toLowerCase()]){for(var o=t.attrs["stroke-width"]||"1",i={round:o,square:o,butt:0}[t.attrs["stroke-linecap"]||r["stroke-linecap"]]||0,a=[],s=e.length;s--;)a[s]=e[s]*o+(s%2?1:-1)*i;m(t.node,{"stroke-dasharray":a.join(",")})}else m(t.node,{"stroke-dasharray":"none"})},E=function(r,i){var u=r.node,l=r.attrs,h=u.style.visibility;for(var p in u.style.visibility="hidden",i)if(i[e](p)){if(!t._availableAttrs[e](p))continue;var v=i[p];switch(l[p]=v,p){case"blur":r.blur(v);break;case"title":var y=u.getElementsByTagName("title");if(y.length&&(y=y[0]))y.firstChild.nodeValue=v;else{y=m("title");var x=t._g.doc.createTextNode(v);y.appendChild(x),u.appendChild(y)}break;case"href":case"target":var E=u.parentNode;if("a"!=E.tagName.toLowerCase()){var S=m("a");E.insertBefore(S,u),S.appendChild(u),E=S}"target"==p?E.setAttributeNS(d,"show","blank"==v?"new":v):E.setAttributeNS(d,p,v);break;case"cursor":u.style.cursor=v;break;case"transform":r.transform(v);break;case"arrow-start":w(r,v);break;case"arrow-end":w(r,v,1);break;case"clip-rect":var j=n(v).split(c);if(4==j.length){r.clip&&r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);var A=m("clipPath"),P=m("rect");A.id=t.createUUID(),m(P,{x:j[0],y:j[1],width:j[2],height:j[3]}),A.appendChild(P),r.paper.defs.appendChild(A),m(u,{"clip-path":"url(#"+A.id+")"}),r.clip=P}if(!v){var k=u.getAttribute("clip-path");if(k){var T=t._g.doc.getElementById(k.replace(/(^url\(#|\)$)/g,f));T&&T.parentNode.removeChild(T),m(u,{"clip-path":f}),delete r.clip}}break;case"path":"path"==r.type&&(m(u,{d:v?l.path=t._pathToAbsolute(v):"M0,0"}),r._.dirty=1,r._.arrows&&("startString"in r._.arrows&&w(r,r._.arrows.startString),"endString"in r._.arrows&&w(r,r._.arrows.endString,1)));break;case"width":if(u.setAttribute(p,v),r._.dirty=1,!l.fx)break;p="x",v=l.x;case"x":l.fx&&(v=-l.x-(l.width||0));case"rx":if("rx"==p&&"rect"==r.type)break;case"cx":u.setAttribute(p,v),r.pattern&&b(r),r._.dirty=1;break;case"height":if(u.setAttribute(p,v),r._.dirty=1,!l.fy)break;p="y",v=l.y;case"y":l.fy&&(v=-l.y-(l.height||0));case"ry":if("ry"==p&&"rect"==r.type)break;case"cy":u.setAttribute(p,v),r.pattern&&b(r),r._.dirty=1;break;case"r":"rect"==r.type?m(u,{rx:v,ry:v}):u.setAttribute(p,v),r._.dirty=1;break;case"src":"image"==r.type&&u.setAttributeNS(d,"href",v);break;case"stroke-width":1==r._.sx&&1==r._.sy||(v/=a(s(r._.sx),s(r._.sy))||1),u.setAttribute(p,v),l["stroke-dasharray"]&&O(r,l["stroke-dasharray"],i),r._.arrows&&("startString"in r._.arrows&&w(r,r._.arrows.startString),"endString"in r._.arrows&&w(r,r._.arrows.endString,1));break;case"stroke-dasharray":O(r,v,i);break;case"fill":var C=n(v).match(t._ISURL);if(C){A=m("pattern");var R=m("image");A.id=t.createUUID(),m(A,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(R,{x:0,y:0,"xlink:href":C[1]}),A.appendChild(R),function(e){t._preload(C[1],(function(){var t=this.offsetWidth,n=this.offsetHeight;m(e,{width:t,height:n}),m(R,{width:t,height:n})}))}(A),r.paper.defs.appendChild(A),m(u,{fill:"url(#"+A.id+")"}),r.pattern=A,r.pattern&&b(r);break}var M=t.getRGB(v);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=n(v).charAt())&&g(r,v)){if("opacity"in l||"fill-opacity"in l){var I=t._g.doc.getElementById(u.getAttribute("fill").replace(/^url\(#|\)$/g,f));if(I){var N=I.getElementsByTagName("stop");m(N[N.length-1],{"stop-opacity":("opacity"in l?l.opacity:1)*("fill-opacity"in l?l["fill-opacity"]:1)})}}l.gradient=v,l.fill="none";break}}else delete i.gradient,delete l.gradient,!t.is(l.opacity,"undefined")&&t.is(i.opacity,"undefined")&&m(u,{opacity:l.opacity}),!t.is(l["fill-opacity"],"undefined")&&t.is(i["fill-opacity"],"undefined")&&m(u,{"fill-opacity":l["fill-opacity"]});M[e]("opacity")&&m(u,{"fill-opacity":M.opacity>1?M.opacity/100:M.opacity});case"stroke":M=t.getRGB(v),u.setAttribute(p,M.hex),"stroke"==p&&M[e]("opacity")&&m(u,{"stroke-opacity":M.opacity>1?M.opacity/100:M.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&w(r,r._.arrows.startString),"endString"in r._.arrows&&w(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=n(v).charAt())&&g(r,v);break;case"opacity":l.gradient&&!l[e]("stroke-opacity")&&m(u,{"stroke-opacity":v>1?v/100:v});case"fill-opacity":if(l.gradient){(I=t._g.doc.getElementById(u.getAttribute("fill").replace(/^url\(#|\)$/g,f)))&&(N=I.getElementsByTagName("stop"),m(N[N.length-1],{"stop-opacity":v}));break}default:"font-size"==p&&(v=o(v,10)+"px");var B=p.replace(/(\-.)/g,(function(t){return t.substring(1).toUpperCase()}));u.style[B]=v,r._.dirty=1,u.setAttribute(p,v)}}_(r,i),u.style.visibility=h},_=function(r,i){if("text"==r.type&&(i[e]("text")||i[e]("font")||i[e]("font-size")||i[e]("x")||i[e]("y"))){var a=r.attrs,s=r.node,u=s.firstChild?o(t._g.doc.defaultView.getComputedStyle(s.firstChild,f).getPropertyValue("font-size"),10):10;if(i[e]("text")){for(a.text=i.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,l=n(i.text).split("\n"),h=[],d=0,p=l.length;d<p;d++)c=m("tspan"),d&&m(c,{dy:1.2*u,x:a.x}),c.appendChild(t._g.doc.createTextNode(l[d])),s.appendChild(c),h[d]=c}else for(d=0,p=(h=s.getElementsByTagName("tspan")).length;d<p;d++)d?m(h[d],{dy:1.2*u,x:a.x}):m(h[0],{dy:0});m(s,{x:a.x,y:a.y}),r._.dirty=1;var v=r._getBBox(),g=a.y-(v.y+v.height/2);g&&t.is(g,"finite")&&m(h[0],{dy:g})}},S=function(t){return t.parentNode&&"a"===t.parentNode.tagName.toLowerCase()?t.parentNode:t},j=function(e,n){this[0]=this.node=e,e.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),e.raphaelid=this.id,this.matrix=t.matrix(),this.realPath=null,this.paper=n,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null},A=t.el;j.prototype=A,A.constructor=j,t._engine.path=function(t,e){var n=m("path");e.canvas&&e.canvas.appendChild(n);var r=new j(n,e);return r.type="path",E(r,{fill:"none",stroke:"#000",path:t}),r},A.rotate=function(t,e,o){if(this.removed)return this;if((t=n(t).split(c)).length-1&&(e=r(t[1]),o=r(t[2])),t=r(t[0]),null==o&&(e=o),null==e||null==o){var i=this.getBBox(1);e=i.x+i.width/2,o=i.y+i.height/2}return this.transform(this._.transform.concat([["r",t,e,o]])),this},A.scale=function(t,e,o,i){if(this.removed)return this;if((t=n(t).split(c)).length-1&&(e=r(t[1]),o=r(t[2]),i=r(t[3])),t=r(t[0]),null==e&&(e=t),null==i&&(o=i),null==o||null==i)var a=this.getBBox(1);return o=null==o?a.x+a.width/2:o,i=null==i?a.y+a.height/2:i,this.transform(this._.transform.concat([["s",t,e,o,i]])),this},A.translate=function(t,e){return this.removed||((t=n(t).split(c)).length-1&&(e=r(t[1])),t=r(t[0])||0,e=+e||0,this.transform(this._.transform.concat([["t",t,e]]))),this},A.transform=function(n){var r=this._;if(null==n)return r.transform;if(t._extractTransform(this,n),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&b(this),this.node&&m(this.node,{transform:this.matrix}),1!=r.sx||1!=r.sy){var o=this.attrs[e]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":o})}return this},A.hide=function(){return this.removed||(this.node.style.display="none"),this},A.show=function(){return this.removed||(this.node.style.display=""),this},A.remove=function(){var e=S(this.node);if(!this.removed&&e.parentNode){var n=this.paper;for(var r in n.__set__&&n.__set__.exclude(this),l.unbind("raphael.*.*."+this.id),this.gradient&&n.defs.removeChild(this.gradient),t._tear(this,n),e.parentNode.removeChild(e),this.removeData(),this)this[r]="function"==typeof this[r]?t._removedFactory(r):null;this.removed=!0}},A._getBBox=function(){if("none"==this.node.style.display){this.show();var t=!0}var e,n=!1;this.paper.canvas.parentElement?e=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(e=this.paper.canvas.parentNode.style),e&&"none"==e.display&&(n=!0,e.display="");var r={};try{r=this.node.getBBox()}catch(t){r={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{r=r||{},n&&(e.display="none")}return t&&this.hide(),r},A.attr=function(n,r){if(this.removed)return this;if(null==n){var o={};for(var i in this.attrs)this.attrs[e](i)&&(o[i]=this.attrs[i]);return o.gradient&&"none"==o.fill&&(o.fill=o.gradient)&&delete o.gradient,o.transform=this._.transform,o}if(null==r&&t.is(n,"string")){if("fill"==n&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==n)return this._.transform;for(var a=n.split(c),s={},u=0,f=a.length;u<f;u++)(n=a[u])in this.attrs?s[n]=this.attrs[n]:t.is(this.paper.customAttributes[n],"function")?s[n]=this.paper.customAttributes[n].def:s[n]=t._availableAttrs[n];return f-1?s:s[a[0]]}if(null==r&&t.is(n,"array")){for(s={},u=0,f=n.length;u<f;u++)s[n[u]]=this.attr(n[u]);return s}if(null!=r){var h={};h[n]=r}else null!=n&&t.is(n,"object")&&(h=n);for(var d in h)l("raphael.attr."+d+"."+this.id,this,h[d]);for(d in this.paper.customAttributes)if(this.paper.customAttributes[e](d)&&h[e](d)&&t.is(this.paper.customAttributes[d],"function")){var p=this.paper.customAttributes[d].apply(this,[].concat(h[d]));for(var v in this.attrs[d]=h[d],p)p[e](v)&&(h[v]=p[v])}return E(this,h),this},A.toFront=function(){if(this.removed)return this;var e=S(this.node);e.parentNode.appendChild(e);var n=this.paper;return n.top!=this&&t._tofront(this,n),this},A.toBack=function(){if(this.removed)return this;var e=S(this.node),n=e.parentNode;return n.insertBefore(e,n.firstChild),t._toback(this,this.paper),this.paper,this},A.insertAfter=function(e){if(this.removed||!e)return this;var n=S(this.node),r=S(e.node||e[e.length-1].node);return r.nextSibling?r.parentNode.insertBefore(n,r.nextSibling):r.parentNode.appendChild(n),t._insertafter(this,e,this.paper),this},A.insertBefore=function(e){if(this.removed||!e)return this;var n=S(this.node),r=S(e.node||e[0].node);return r.parentNode.insertBefore(n,r),t._insertbefore(this,e,this.paper),this},A.blur=function(e){var n=this;if(0!=+e){var r=m("filter"),o=m("feGaussianBlur");n.attrs.blur=e,r.id=t.createUUID(),m(o,{stdDeviation:+e||1.5}),r.appendChild(o),n.paper.defs.appendChild(r),n._blur=r,m(n.node,{filter:"url(#"+r.id+")"})}else n._blur&&(n._blur.parentNode.removeChild(n._blur),delete n._blur,delete n.attrs.blur),n.node.removeAttribute("filter");return n},t._engine.circle=function(t,e,n,r){var o=m("circle");t.canvas&&t.canvas.appendChild(o);var i=new j(o,t);return i.attrs={cx:e,cy:n,r:r,fill:"none",stroke:"#000"},i.type="circle",m(o,i.attrs),i},t._engine.rect=function(t,e,n,r,o,i){var a=m("rect");t.canvas&&t.canvas.appendChild(a);var s=new j(a,t);return s.attrs={x:e,y:n,width:r,height:o,rx:i||0,ry:i||0,fill:"none",stroke:"#000"},s.type="rect",m(a,s.attrs),s},t._engine.ellipse=function(t,e,n,r,o){var i=m("ellipse");t.canvas&&t.canvas.appendChild(i);var a=new j(i,t);return a.attrs={cx:e,cy:n,rx:r,ry:o,fill:"none",stroke:"#000"},a.type="ellipse",m(i,a.attrs),a},t._engine.image=function(t,e,n,r,o,i){var a=m("image");m(a,{x:n,y:r,width:o,height:i,preserveAspectRatio:"none"}),a.setAttributeNS(d,"href",e),t.canvas&&t.canvas.appendChild(a);var s=new j(a,t);return s.attrs={x:n,y:r,width:o,height:i,src:e},s.type="image",s},t._engine.text=function(e,n,r,o){var i=m("text");e.canvas&&e.canvas.appendChild(i);var a=new j(i,e);return a.attrs={x:n,y:r,"text-anchor":"middle",text:o,"font-family":t._availableAttrs["font-family"],"font-size":t._availableAttrs["font-size"],stroke:"none",fill:"#000"},a.type="text",E(a,a.attrs),a},t._engine.setSize=function(t,e){return this.width=t||this.width,this.height=e||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},t._engine.create=function(){var e=t._getContainer.apply(0,arguments),n=e&&e.container;if(!n)throw new Error("SVG container not found.");var r,o=e.x,i=e.y,a=e.width,s=e.height,u=m("svg"),c="overflow:hidden;";return o=o||0,i=i||0,m(u,{height:s=s||342,version:1.1,width:a=a||512,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),1==n?(u.style.cssText=c+"position:absolute;left:"+o+"px;top:"+i+"px",t._g.doc.body.appendChild(u),r=1):(u.style.cssText=c+"position:relative",n.firstChild?n.insertBefore(u,n.firstChild):n.appendChild(u)),(n=new t._Paper).width=a,n.height=s,n.canvas=u,n.clear(),n._left=n._top=0,r&&(n.renderfix=function(){}),n.renderfix(),n},t._engine.setViewBox=function(t,e,n,r,o){l("raphael.setViewBox",this,this._viewBox,[t,e,n,r,o]);var i,s,u=this.getSize(),c=a(n/u.width,r/u.height),f=this.top,d=o?"xMidYMid meet":"xMinYMin";for(null==t?(this._vbSize&&(c=1),delete this._vbSize,i="0 0 "+this.width+h+this.height):(this._vbSize=c,i=t+h+e+h+n+h+r),m(this.canvas,{viewBox:i,preserveAspectRatio:d});c&&f;)s="stroke-width"in f.attrs?f.attrs["stroke-width"]:1,f.attr({"stroke-width":s}),f._.dirty=1,f._.dirtyT=1,f=f.prev;return this._viewBox=[t,e,n,r,!!o],this},t.prototype.renderfix=function(){var t,e=this.canvas,n=e.style;try{t=e.getScreenCTM()||e.createSVGMatrix()}catch(n){t=e.createSVGMatrix()}var r=-t.e%1,o=-t.f%1;(r||o)&&(r&&(this._left=(this._left+r)%1,n.left=this._left+"px"),o&&(this._top=(this._top+o)%1,n.top=this._top+"px"))},t.prototype.clear=function(){t.eve("raphael.clear",this);for(var e=this.canvas;e.firstChild;)e.removeChild(e.firstChild);this.bottom=this.top=null,(this.desc=m("desc")).appendChild(t._g.doc.createTextNode("Created with Raphaël "+t.version)),e.appendChild(this.desc),e.appendChild(this.defs=m("defs"))},t.prototype.remove=function(){for(var e in l("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this)this[e]="function"==typeof this[e]?t._removedFactory(e):null};var P=t.st;for(var k in A)A[e](k)&&!P[e](k)&&(P[k]=function(t){return function(){var e=arguments;return this.forEach((function(n){n[t].apply(n,e)}))}}(k))}}.apply(e,r))||(t.exports=o)},function(t,e,n){var r,o;r=[n(0)],void 0===(o=function(t){if(!t||t.vml){var e="hasOwnProperty",n=String,r=parseFloat,o=Math,i=o.round,a=o.max,s=o.min,u=o.abs,c=/[, ]+/,l=t.eve,f=" ",h="",d={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},p=/([clmz]),?([^clmz]*)/gi,v=/ progid:\S+Blur\([^\)]+\)/g,m=/-?[^,\s-]+/g,g="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",y=21600,b={path:1,rect:1,image:1},w={circle:1,ellipse:1},x=function(e,n,r){var o=t.matrix();return o.rotate(-e,.5,.5),{dx:o.x(n,r),dy:o.y(n,r)}},O=function(t,e,n,r,o,i){var a=t._,s=t.matrix,c=a.fillpos,l=t.node,h=l.style,d=1,p="",v=y/e,m=y/n;if(h.visibility="hidden",e&&n){if(l.coordsize=u(v)+f+u(m),h.rotation=i*(e*n<0?-1:1),i){var g=x(i,r,o);r=g.dx,o=g.dy}if(e<0&&(p+="x"),n<0&&(p+=" y")&&(d=-1),h.flip=p,l.coordorigin=r*-v+f+o*-m,c||a.fillsize){var b=l.getElementsByTagName("fill");b=b&&b[0],l.removeChild(b),c&&(g=x(i,s.x(c[0],c[1]),s.y(c[0],c[1])),b.position=g.dx*d+f+g.dy*d),a.fillsize&&(b.size=a.fillsize[0]*u(e)+f+a.fillsize[1]*u(n)),l.appendChild(b)}h.visibility="visible"}};t.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var E,_=function(t,e,r){for(var o=n(e).toLowerCase().split("-"),i=r?"end":"start",a=o.length,s="classic",u="medium",c="medium";a--;)switch(o[a]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":s=o[a];break;case"wide":case"narrow":c=o[a];break;case"long":case"short":u=o[a]}var l=t.node.getElementsByTagName("stroke")[0];l[i+"arrow"]=s,l[i+"arrowlength"]=u,l[i+"arrowwidth"]=c},S=function(o,u){o.attrs=o.attrs||{};var l=o.node,v=o.attrs,g=l.style,x=b[o.type]&&(u.x!=v.x||u.y!=v.y||u.width!=v.width||u.height!=v.height||u.cx!=v.cx||u.cy!=v.cy||u.rx!=v.rx||u.ry!=v.ry||u.r!=v.r),S=w[o.type]&&(v.cx!=u.cx||v.cy!=u.cy||v.r!=u.r||v.rx!=u.rx||v.ry!=u.ry),A=o;for(var P in u)u[e](P)&&(v[P]=u[P]);if(x&&(v.path=t._getPath[o.type](o),o._.dirty=1),u.href&&(l.href=u.href),u.title&&(l.title=u.title),u.target&&(l.target=u.target),u.cursor&&(g.cursor=u.cursor),"blur"in u&&o.blur(u.blur),(u.path&&"path"==o.type||x)&&(l.path=function(e){var r=/[ahqstv]/gi,o=t._pathToAbsolute;if(n(e).match(r)&&(o=t._path2curve),r=/[clmz]/g,o==t._pathToAbsolute&&!n(e).match(r)){var a=n(e).replace(p,(function(t,e,n){var r=[],o="m"==e.toLowerCase(),a=d[e];return n.replace(m,(function(t){o&&2==r.length&&(a+=r+d["m"==e?"l":"L"],r=[]),r.push(i(t*y))})),a+r}));return a}var s,u,c=o(e);a=[];for(var l=0,v=c.length;l<v;l++){s=c[l],"z"==(u=c[l][0].toLowerCase())&&(u="x");for(var g=1,b=s.length;g<b;g++)u+=i(s[g]*y)+(g!=b-1?",":h);a.push(u)}return a.join(f)}(~n(v.path).toLowerCase().indexOf("r")?t._pathToAbsolute(v.path):v.path),o._.dirty=1,"image"==o.type&&(o._.fillpos=[v.x,v.y],o._.fillsize=[v.width,v.height],O(o,1,1,0,0,0))),"transform"in u&&o.transform(u.transform),S){var k=+v.cx,T=+v.cy,C=+v.rx||+v.r||0,R=+v.ry||+v.r||0;l.path=t.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",i((k-C)*y),i((T-R)*y),i((k+C)*y),i((T+R)*y),i(k*y)),o._.dirty=1}if("clip-rect"in u){var M=n(u["clip-rect"]).split(c);if(4==M.length){M[2]=+M[2]+ +M[0],M[3]=+M[3]+ +M[1];var I=l.clipRect||t._g.doc.createElement("div"),N=I.style;N.clip=t.format("rect({1}px {2}px {3}px {0}px)",M),l.clipRect||(N.position="absolute",N.top=0,N.left=0,N.width=o.paper.width+"px",N.height=o.paper.height+"px",l.parentNode.insertBefore(I,l),I.appendChild(l),l.clipRect=I)}u["clip-rect"]||l.clipRect&&(l.clipRect.style.clip="auto")}if(o.textpath){var B=o.textpath.style;u.font&&(B.font=u.font),u["font-family"]&&(B.fontFamily='"'+u["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,h)+'"'),u["font-size"]&&(B.fontSize=u["font-size"]),u["font-weight"]&&(B.fontWeight=u["font-weight"]),u["font-style"]&&(B.fontStyle=u["font-style"])}if("arrow-start"in u&&_(A,u["arrow-start"]),"arrow-end"in u&&_(A,u["arrow-end"],1),null!=u.opacity||null!=u.fill||null!=u.src||null!=u.stroke||null!=u["stroke-width"]||null!=u["stroke-opacity"]||null!=u["fill-opacity"]||null!=u["stroke-dasharray"]||null!=u["stroke-miterlimit"]||null!=u["stroke-linejoin"]||null!=u["stroke-linecap"]){var Z=l.getElementsByTagName("fill");if(!(Z=Z&&Z[0])&&(Z=E("fill")),"image"==o.type&&u.src&&(Z.src=u.src),u.fill&&(Z.on=!0),null!=Z.on&&"none"!=u.fill&&null!==u.fill||(Z.on=!1),Z.on&&u.fill){var L=n(u.fill).match(t._ISURL);if(L){Z.parentNode==l&&l.removeChild(Z),Z.rotate=!0,Z.src=L[1],Z.type="tile";var D=o.getBBox(1);Z.position=D.x+f+D.y,o._.fillpos=[D.x,D.y],t._preload(L[1],(function(){o._.fillsize=[this.offsetWidth,this.offsetHeight]}))}else Z.color=t.getRGB(u.fill).hex,Z.src=h,Z.type="solid",t.getRGB(u.fill).error&&(A.type in{circle:1,ellipse:1}||"r"!=n(u.fill).charAt())&&j(A,u.fill,Z)&&(v.fill="none",v.gradient=u.fill,Z.rotate=!1)}if("fill-opacity"in u||"opacity"in u){var z=((+v["fill-opacity"]+1||2)-1)*((+v.opacity+1||2)-1)*((+t.getRGB(u.fill).o+1||2)-1);z=s(a(z,0),1),Z.opacity=z,Z.src&&(Z.color="none")}l.appendChild(Z);var F=l.getElementsByTagName("stroke")&&l.getElementsByTagName("stroke")[0],G=!1;!F&&(G=F=E("stroke")),(u.stroke&&"none"!=u.stroke||u["stroke-width"]||null!=u["stroke-opacity"]||u["stroke-dasharray"]||u["stroke-miterlimit"]||u["stroke-linejoin"]||u["stroke-linecap"])&&(F.on=!0),("none"==u.stroke||null===u.stroke||null==F.on||0==u.stroke||0==u["stroke-width"])&&(F.on=!1);var H=t.getRGB(u.stroke);F.on&&u.stroke&&(F.color=H.hex),z=((+v["stroke-opacity"]+1||2)-1)*((+v.opacity+1||2)-1)*((+H.o+1||2)-1);var V=.75*(r(u["stroke-width"])||1);if(z=s(a(z,0),1),null==u["stroke-width"]&&(V=v["stroke-width"]),u["stroke-width"]&&(F.weight=V),V&&V<1&&(z*=V)&&(F.weight=1),F.opacity=z,u["stroke-linejoin"]&&(F.joinstyle=u["stroke-linejoin"]||"miter"),F.miterlimit=u["stroke-miterlimit"]||8,u["stroke-linecap"]&&(F.endcap="butt"==u["stroke-linecap"]?"flat":"square"==u["stroke-linecap"]?"square":"round"),"stroke-dasharray"in u){var U={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};F.dashstyle=U[e](u["stroke-dasharray"])?U[u["stroke-dasharray"]]:h}G&&l.appendChild(F)}if("text"==A.type){A.paper.canvas.style.display=h;var q=A.paper.span,W=v.font&&v.font.match(/\d+(?:\.\d*)?(?=px)/);g=q.style,v.font&&(g.font=v.font),v["font-family"]&&(g.fontFamily=v["font-family"]),v["font-weight"]&&(g.fontWeight=v["font-weight"]),v["font-style"]&&(g.fontStyle=v["font-style"]),W=r(v["font-size"]||W&&W[0])||10,g.fontSize=100*W+"px",A.textpath.string&&(q.innerHTML=n(A.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var Y=q.getBoundingClientRect();A.W=v.w=(Y.right-Y.left)/100,A.H=v.h=(Y.bottom-Y.top)/100,A.X=v.x,A.Y=v.y+A.H/2,("x"in u||"y"in u)&&(A.path.v=t.format("m{0},{1}l{2},{1}",i(v.x*y),i(v.y*y),i(v.x*y)+1));for(var $=["x","y","text","font","font-family","font-weight","font-style","font-size"],K=0,J=$.length;K<J;K++)if($[K]in u){A._.dirty=1;break}switch(v["text-anchor"]){case"start":A.textpath.style["v-text-align"]="left",A.bbx=A.W/2;break;case"end":A.textpath.style["v-text-align"]="right",A.bbx=-A.W/2;break;default:A.textpath.style["v-text-align"]="center",A.bbx=0}A.textpath.style["v-text-kern"]=!0}},j=function(e,i,a){e.attrs=e.attrs||{},e.attrs;var s=Math.pow,u="linear",c=".5 .5";if(e.attrs.gradient=i,i=(i=n(i).replace(t._radial_gradient,(function(t,e,n){return u="radial",e&&n&&(e=r(e),n=r(n),s(e-.5,2)+s(n-.5,2)>.25&&(n=o.sqrt(.25-s(e-.5,2))*(2*(n>.5)-1)+.5),c=e+f+n),h}))).split(/\s*\-\s*/),"linear"==u){var l=i.shift();if(l=-r(l),isNaN(l))return null}var d=t._parseDots(i);if(!d)return null;if(e=e.shape||e.node,d.length){e.removeChild(a),a.on=!0,a.method="none",a.color=d[0].color,a.color2=d[d.length-1].color;for(var p=[],v=0,m=d.length;v<m;v++)d[v].offset&&p.push(d[v].offset+f+d[v].color);a.colors=p.length?p.join():"0% "+a.color,"radial"==u?(a.type="gradientTitle",a.focus="100%",a.focussize="0 0",a.focusposition=c,a.angle=0):(a.type="gradient",a.angle=(270-l)%360),e.appendChild(a)}return 1},A=function(e,n){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=n,this.matrix=t.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null},P=t.el;A.prototype=P,P.constructor=A,P.transform=function(e){if(null==e)return this._.transform;var r,o=this.paper._viewBoxShift,i=o?"s"+[o.scale,o.scale]+"-1-1t"+[o.dx,o.dy]:h;o&&(r=e=n(e).replace(/\.{3}|\u2026/g,this._.transform||h)),t._extractTransform(this,i+e);var a,s=this.matrix.clone(),u=this.skew,c=this.node,l=~n(this.attrs.fill).indexOf("-"),d=!n(this.attrs.fill).indexOf("url(");if(s.translate(1,1),d||l||"image"==this.type)if(u.matrix="1 0 0 1",u.offset="0 0",a=s.split(),l&&a.noRotation||!a.isSimple){c.style.filter=s.toFilter();var p=this.getBBox(),v=this.getBBox(1),m=p.x-v.x,g=p.y-v.y;c.coordorigin=m*-y+f+g*-y,O(this,1,1,m,g,0)}else c.style.filter=h,O(this,a.scalex,a.scaley,a.dx,a.dy,a.rotate);else c.style.filter=h,u.matrix=n(s),u.offset=s.offset();return null!==r&&(this._.transform=r,t._extractTransform(this,r)),this},P.rotate=function(t,e,o){if(this.removed)return this;if(null!=t){if((t=n(t).split(c)).length-1&&(e=r(t[1]),o=r(t[2])),t=r(t[0]),null==o&&(e=o),null==e||null==o){var i=this.getBBox(1);e=i.x+i.width/2,o=i.y+i.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",t,e,o]])),this}},P.translate=function(t,e){return this.removed||((t=n(t).split(c)).length-1&&(e=r(t[1])),t=r(t[0])||0,e=+e||0,this._.bbox&&(this._.bbox.x+=t,this._.bbox.y+=e),this.transform(this._.transform.concat([["t",t,e]]))),this},P.scale=function(t,e,o,i){if(this.removed)return this;if((t=n(t).split(c)).length-1&&(e=r(t[1]),o=r(t[2]),i=r(t[3]),isNaN(o)&&(o=null),isNaN(i)&&(i=null)),t=r(t[0]),null==e&&(e=t),null==i&&(o=i),null==o||null==i)var a=this.getBBox(1);return o=null==o?a.x+a.width/2:o,i=null==i?a.y+a.height/2:i,this.transform(this._.transform.concat([["s",t,e,o,i]])),this._.dirtyT=1,this},P.hide=function(){return!this.removed&&(this.node.style.display="none"),this},P.show=function(){return!this.removed&&(this.node.style.display=h),this},P.auxGetBBox=t.el.getBBox,P.getBBox=function(){var t=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var e={},n=1/this.paper._viewBoxShift.scale;return e.x=t.x-this.paper._viewBoxShift.dx,e.x*=n,e.y=t.y-this.paper._viewBoxShift.dy,e.y*=n,e.width=t.width*n,e.height=t.height*n,e.x2=e.x+e.width,e.y2=e.y+e.height,e}return t},P._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},P.remove=function(){if(!this.removed&&this.node.parentNode){for(var e in this.paper.__set__&&this.paper.__set__.exclude(this),t.eve.unbind("raphael.*.*."+this.id),t._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape),this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;this.removed=!0}},P.attr=function(n,r){if(this.removed)return this;if(null==n){var o={};for(var i in this.attrs)this.attrs[e](i)&&(o[i]=this.attrs[i]);return o.gradient&&"none"==o.fill&&(o.fill=o.gradient)&&delete o.gradient,o.transform=this._.transform,o}if(null==r&&t.is(n,"string")){if("fill"==n&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var a=n.split(c),s={},u=0,f=a.length;u<f;u++)(n=a[u])in this.attrs?s[n]=this.attrs[n]:t.is(this.paper.customAttributes[n],"function")?s[n]=this.paper.customAttributes[n].def:s[n]=t._availableAttrs[n];return f-1?s:s[a[0]]}if(this.attrs&&null==r&&t.is(n,"array")){for(s={},u=0,f=n.length;u<f;u++)s[n[u]]=this.attr(n[u]);return s}var h;for(var d in null!=r&&((h={})[n]=r),null==r&&t.is(n,"object")&&(h=n),h)l("raphael.attr."+d+"."+this.id,this,h[d]);if(h){for(d in this.paper.customAttributes)if(this.paper.customAttributes[e](d)&&h[e](d)&&t.is(this.paper.customAttributes[d],"function")){var p=this.paper.customAttributes[d].apply(this,[].concat(h[d]));for(var v in this.attrs[d]=h[d],p)p[e](v)&&(h[v]=p[v])}h.text&&"text"==this.type&&(this.textpath.string=h.text),S(this,h)}return this},P.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&t._tofront(this,this.paper),this},P.toBack=function(){return this.removed||this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper)),this},P.insertAfter=function(e){return this.removed||(e.constructor==t.st.constructor&&(e=e[e.length-1]),e.node.nextSibling?e.node.parentNode.insertBefore(this.node,e.node.nextSibling):e.node.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper)),this},P.insertBefore=function(e){return this.removed||(e.constructor==t.st.constructor&&(e=e[0]),e.node.parentNode.insertBefore(this.node,e.node),t._insertbefore(this,e,this.paper)),this},P.blur=function(e){var n=this.node.runtimeStyle,r=n.filter;return r=r.replace(v,h),0!=+e?(this.attrs.blur=e,n.filter=r+f+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+e||1.5)+")",n.margin=t.format("-{0}px 0 0 -{0}px",i(+e||1.5))):(n.filter=r,n.margin=0,delete this.attrs.blur),this},t._engine.path=function(t,e){var n=E("shape");n.style.cssText=g,n.coordsize=y+f+y,n.coordorigin=e.coordorigin;var r=new A(n,e),o={fill:"none",stroke:"#000"};t&&(o.path=t),r.type="path",r.path=[],r.Path=h,S(r,o),e.canvas&&e.canvas.appendChild(n);var i=E("skew");return i.on=!0,n.appendChild(i),r.skew=i,r.transform(h),r},t._engine.rect=function(e,n,r,o,i,a){var s=t._rectPath(n,r,o,i,a),u=e.path(s),c=u.attrs;return u.X=c.x=n,u.Y=c.y=r,u.W=c.width=o,u.H=c.height=i,c.r=a,c.path=s,u.type="rect",u},t._engine.ellipse=function(t,e,n,r,o){var i=t.path();return i.attrs,i.X=e-r,i.Y=n-o,i.W=2*r,i.H=2*o,i.type="ellipse",S(i,{cx:e,cy:n,rx:r,ry:o}),i},t._engine.circle=function(t,e,n,r){var o=t.path();return o.attrs,o.X=e-r,o.Y=n-r,o.W=o.H=2*r,o.type="circle",S(o,{cx:e,cy:n,r:r}),o},t._engine.image=function(e,n,r,o,i,a){var s=t._rectPath(r,o,i,a),u=e.path(s).attr({stroke:"none"}),c=u.attrs,l=u.node,f=l.getElementsByTagName("fill")[0];return c.src=n,u.X=c.x=r,u.Y=c.y=o,u.W=c.width=i,u.H=c.height=a,c.path=s,u.type="image",f.parentNode==l&&l.removeChild(f),f.rotate=!0,f.src=n,f.type="tile",u._.fillpos=[r,o],u._.fillsize=[i,a],l.appendChild(f),O(u,1,1,0,0,0),u},t._engine.text=function(e,r,o,a){var s=E("shape"),u=E("path"),c=E("textpath");r=r||0,o=o||0,a=a||"",u.v=t.format("m{0},{1}l{2},{1}",i(r*y),i(o*y),i(r*y)+1),u.textpathok=!0,c.string=n(a),c.on=!0,s.style.cssText=g,s.coordsize=y+f+y,s.coordorigin="0 0";var l=new A(s,e),d={fill:"#000",stroke:"none",font:t._availableAttrs.font,text:a};l.shape=s,l.path=u,l.textpath=c,l.type="text",l.attrs.text=n(a),l.attrs.x=r,l.attrs.y=o,l.attrs.w=1,l.attrs.h=1,S(l,d),s.appendChild(c),s.appendChild(u),e.canvas.appendChild(s);var p=E("skew");return p.on=!0,s.appendChild(p),l.skew=p,l.transform(h),l},t._engine.setSize=function(e,n){var r=this.canvas.style;return this.width=e,this.height=n,e==+e&&(e+="px"),n==+n&&(n+="px"),r.width=e,r.height=n,r.clip="rect(0 "+e+" "+n+" 0)",this._viewBox&&t._engine.setViewBox.apply(this,this._viewBox),this},t._engine.setViewBox=function(e,n,r,o,i){t.eve("raphael.setViewBox",this,this._viewBox,[e,n,r,o,i]);var a,s,u=this.getSize(),c=u.width,l=u.height;return i&&(r*(a=l/o)<c&&(e-=(c-r*a)/2/a),o*(s=c/r)<l&&(n-=(l-o*s)/2/s)),this._viewBox=[e,n,r,o,!!i],this._viewBoxShift={dx:-e,dy:-n,scale:u},this.forEach((function(t){t.transform("...")})),this},t._engine.initWin=function(t){var e=t.document;e.styleSheets.length<31?e.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):e.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!e.namespaces.rvml&&e.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),E=function(t){return e.createElement("<rvml:"+t+' class="rvml">')}}catch(t){E=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),n=e.container,r=e.height,o=e.width,i=e.x,a=e.y;if(!n)throw new Error("VML container not found.");var s=new t._Paper,u=s.canvas=t._g.doc.createElement("div"),c=u.style;return i=i||0,a=a||0,o=o||512,r=r||342,s.width=o,s.height=r,o==+o&&(o+="px"),r==+r&&(r+="px"),s.coordsize="21600000 21600000",s.coordorigin="0 0",s.span=t._g.doc.createElement("span"),s.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",u.appendChild(s.span),c.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",o,r),1==n?(t._g.doc.body.appendChild(u),c.left=i+"px",c.top=a+"px",c.position="absolute"):n.firstChild?n.insertBefore(u,n.firstChild):n.appendChild(u),s.renderfix=function(){},s},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=h,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){for(var e in t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var k=t.st;for(var T in P)P[e](T)&&!k[e](T)&&(k[T]=function(t){return function(){var e=arguments;return this.forEach((function(n){n[t].apply(n,e)}))}}(T))}}.apply(e,r))||(t.exports=o)}])},88359:function(t,e){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,s=60109,u=60110,c=60112,l=60113,f=60120,h=60115,d=60116;if("function"==typeof Symbol&&Symbol.for){var p=Symbol.for;n=p("react.element"),r=p("react.portal"),o=p("react.fragment"),i=p("react.strict_mode"),a=p("react.profiler"),s=p("react.provider"),u=p("react.context"),c=p("react.forward_ref"),l=p("react.suspense"),f=p("react.suspense_list"),h=p("react.memo"),d=p("react.lazy"),p("react.block"),p("react.server.block"),p("react.fundamental"),p("react.debug_trace_mode"),p("react.legacy_hidden")}e.isContextConsumer=function(t){return function(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case o:case a:case i:case l:case f:return t;default:switch(t=t&&t.$$typeof){case u:case c:case d:case h:case s:return t;default:return e}}case r:return e}}}(t)===u}},72973:function(t,e,n){"use strict";t.exports=n(88359)},75251:function(t,e,n){"use strict";n(27418);var r=n(67294),o=60103;if(e.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),e.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var r,i={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(l=e.ref),e)s.call(e,r)&&!u.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===i[r]&&(i[r]=e[r]);return{$$typeof:o,type:t,key:c,ref:l,props:i,_owner:a.current}}e.jsx=c,e.jsxs=c},48521:function(t,e,n){"use strict";t.exports=n(75251)},94500:function(t,e,n){!function(t){"use strict";function e(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function r(t,e){Object.defineProperty(this,"kind",{value:t,enumerable:!0}),e&&e.length&&Object.defineProperty(this,"path",{value:e,enumerable:!0})}function o(t,e,n){o.super_.call(this,"E",t),Object.defineProperty(this,"lhs",{value:e,enumerable:!0}),Object.defineProperty(this,"rhs",{value:n,enumerable:!0})}function i(t,e){i.super_.call(this,"N",t),Object.defineProperty(this,"rhs",{value:e,enumerable:!0})}function a(t,e){a.super_.call(this,"D",t),Object.defineProperty(this,"lhs",{value:e,enumerable:!0})}function s(t,e,n){s.super_.call(this,"A",t),Object.defineProperty(this,"index",{value:e,enumerable:!0}),Object.defineProperty(this,"item",{value:n,enumerable:!0})}function u(t,e,n){var r=t.slice((n||e)+1||t.length);return t.length=e<0?t.length+e:e,t.push.apply(t,r),t}function c(t){var e=void 0===t?"undefined":S(t);return"object"!==e?e:t===Math?"math":null===t?"null":Array.isArray(t)?"array":"[object Date]"===Object.prototype.toString.call(t)?"date":"function"==typeof t.toString&&/^\/.*\//.test(t.toString())?"regexp":"object"}function l(t,e,n,r,f,h,d){d=d||[];var p=(f=f||[]).slice(0);if(void 0!==h){if(r){if("function"==typeof r&&r(p,h))return;if("object"===(void 0===r?"undefined":S(r))){if(r.prefilter&&r.prefilter(p,h))return;if(r.normalize){var v=r.normalize(p,h,t,e);v&&(t=v[0],e=v[1])}}}p.push(h)}"regexp"===c(t)&&"regexp"===c(e)&&(t=t.toString(),e=e.toString());var m=void 0===t?"undefined":S(t),g=void 0===e?"undefined":S(e),y="undefined"!==m||d&&d[d.length-1].lhs&&d[d.length-1].lhs.hasOwnProperty(h),b="undefined"!==g||d&&d[d.length-1].rhs&&d[d.length-1].rhs.hasOwnProperty(h);if(!y&&b)n(new i(p,e));else if(!b&&y)n(new a(p,t));else if(c(t)!==c(e))n(new o(p,t,e));else if("date"===c(t)&&t-e!=0)n(new o(p,t,e));else if("object"===m&&null!==t&&null!==e)if(d.filter((function(e){return e.lhs===t})).length)t!==e&&n(new o(p,t,e));else{if(d.push({lhs:t,rhs:e}),Array.isArray(t)){var w;for(t.length,w=0;w<t.length;w++)w>=e.length?n(new s(p,w,new a(void 0,t[w]))):l(t[w],e[w],n,r,p,w,d);for(;w<e.length;)n(new s(p,w,new i(void 0,e[w++])))}else{var x=Object.keys(t),O=Object.keys(e);x.forEach((function(o,i){var a=O.indexOf(o);a>=0?(l(t[o],e[o],n,r,p,o,d),O=u(O,a)):l(t[o],void 0,n,r,p,o,d)})),O.forEach((function(t){l(void 0,e[t],n,r,p,t,d)}))}d.length=d.length-1}else t!==e&&("number"===m&&isNaN(t)&&isNaN(e)||n(new o(p,t,e)))}function f(t,e,n,r){return r=r||[],l(t,e,(function(t){t&&r.push(t)}),n),r.length?r:void 0}function h(t,e,n){if(n.path&&n.path.length){var r,o=t[e],i=n.path.length-1;for(r=0;r<i;r++)o=o[n.path[r]];switch(n.kind){case"A":h(o[n.path[r]],n.index,n.item);break;case"D":delete o[n.path[r]];break;case"E":case"N":o[n.path[r]]=n.rhs}}else switch(n.kind){case"A":h(t[e],n.index,n.item);break;case"D":t=u(t,e);break;case"E":case"N":t[e]=n.rhs}return t}function d(t,e,n){if(t&&e&&n&&n.kind){for(var r=t,o=-1,i=n.path?n.path.length-1:0;++o<i;)void 0===r[n.path[o]]&&(r[n.path[o]]="number"==typeof n.path[o]?[]:{}),r=r[n.path[o]];switch(n.kind){case"A":h(n.path?r[n.path[o]]:r,n.index,n.item);break;case"D":delete r[n.path[o]];break;case"E":case"N":r[n.path[o]]=n.rhs}}}function p(t,e,n){if(n.path&&n.path.length){var r,o=t[e],i=n.path.length-1;for(r=0;r<i;r++)o=o[n.path[r]];switch(n.kind){case"A":p(o[n.path[r]],n.index,n.item);break;case"D":case"E":o[n.path[r]]=n.lhs;break;case"N":delete o[n.path[r]]}}else switch(n.kind){case"A":p(t[e],n.index,n.item);break;case"D":case"E":t[e]=n.lhs;break;case"N":t=u(t,e)}return t}function v(t){return"color: "+P[t].color+"; font-weight: bold"}function m(t,e,n,r){var o=f(t,e);try{r?n.groupCollapsed("diff"):n.group("diff")}catch(t){n.log("diff")}o?o.forEach((function(t){var e=t.kind,r=function(t){var e=t.kind,n=t.path,r=t.lhs,o=t.rhs,i=t.index,a=t.item;switch(e){case"E":return[n.join("."),r,"→",o];case"N":return[n.join("."),o];case"D":return[n.join(".")];case"A":return[n.join(".")+"["+i+"]",a];default:return[]}}(t);n.log.apply(n,["%c "+P[e].text,v(e)].concat(j(r)))})):n.log("—— no diff ——");try{n.groupEnd()}catch(t){n.log("—— diff end —— ")}}function g(t,e,n,r){switch(void 0===t?"undefined":S(t)){case"object":return"function"==typeof t[r]?t[r].apply(t,j(n)):t[r];case"function":return t(e);default:return t}}function y(t,e){var n=e.logger,r=e.actionTransformer,o=e.titleFormatter,i=void 0===o?function(t){var e=t.timestamp,n=t.duration;return function(t,r,o){var i=["action"];return i.push("%c"+String(t.type)),e&&i.push("%c@ "+r),n&&i.push("%c(in "+o.toFixed(2)+" ms)"),i.join(" ")}}(e):o,a=e.collapsed,s=e.colors,u=e.level,c=e.diff,l=void 0===e.titleFormatter;t.forEach((function(o,f){var h=o.started,d=o.startedTime,p=o.action,v=o.prevState,y=o.error,b=o.took,w=o.nextState,x=t[f+1];x&&(w=x.prevState,b=x.started-h);var O=r(p),_="function"==typeof a?a((function(){return w}),p,o):a,S=E(d),j=s.title?"color: "+s.title(O)+";":"",A=["color: gray; font-weight: lighter;"];A.push(j),e.timestamp&&A.push("color: gray; font-weight: lighter;"),e.duration&&A.push("color: gray; font-weight: lighter;");var P=i(O,S,b);try{_?s.title&&l?n.groupCollapsed.apply(n,["%c "+P].concat(A)):n.groupCollapsed(P):s.title&&l?n.group.apply(n,["%c "+P].concat(A)):n.group(P)}catch(t){n.log(P)}var k=g(u,O,[v],"prevState"),T=g(u,O,[O],"action"),C=g(u,O,[y,v],"error"),R=g(u,O,[w],"nextState");if(k)if(s.prevState){var M="color: "+s.prevState(v)+"; font-weight: bold";n[k]("%c prev state",M,v)}else n[k]("prev state",v);if(T)if(s.action){var I="color: "+s.action(O)+"; font-weight: bold";n[T]("%c action ",I,O)}else n[T]("action ",O);if(y&&C)if(s.error){var N="color: "+s.error(y,v)+"; font-weight: bold;";n[C]("%c error ",N,y)}else n[C]("error ",y);if(R)if(s.nextState){var B="color: "+s.nextState(w)+"; font-weight: bold";n[R]("%c next state",B,w)}else n[R]("next state",w);c&&m(v,w,n,_);try{n.groupEnd()}catch(t){n.log("—— log end ——")}}))}function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},k,t),n=e.logger,r=e.stateTransformer,o=e.errorTransformer,i=e.predicate,a=e.logErrors,s=e.diffPredicate;if(void 0===n)return function(){return function(t){return function(e){return t(e)}}};if(t.getState&&t.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(t){return function(e){return t(e)}}};var u=[];return function(t){var n=t.getState;return function(t){return function(c){if("function"==typeof i&&!i(n,c))return t(c);var l={};u.push(l),l.started=_.now(),l.startedTime=new Date,l.prevState=r(n()),l.action=c;var f=void 0;if(a)try{f=t(c)}catch(t){l.error=o(t)}else f=t(c);l.took=_.now()-l.started,l.nextState=r(n());var h=e.diff&&"function"==typeof s?s(n,c):e.diff;if(y(u,Object.assign({},e,{diff:h})),u.length=0,l.error)throw l.error;return f}}}}var w,x,O=function(t,e){return function(t,e){return new Array(e+1).join(t)}("0",e-t.toString().length)+t},E=function(t){return O(t.getHours(),2)+":"+O(t.getMinutes(),2)+":"+O(t.getSeconds(),2)+"."+O(t.getMilliseconds(),3)},_="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,S="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},j=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},A=[];w="object"===(void 0===n.g?"undefined":S(n.g))&&n.g?n.g:"undefined"!=typeof window?window:{},(x=w.DeepDiff)&&A.push((function(){void 0!==x&&w.DeepDiff===f&&(w.DeepDiff=x,x=void 0)})),e(o,r),e(i,r),e(a,r),e(s,r),Object.defineProperties(f,{diff:{value:f,enumerable:!0},observableDiff:{value:l,enumerable:!0},applyDiff:{value:function(t,e,n){t&&e&&l(t,e,(function(r){n&&!n(t,e,r)||d(t,e,r)}))},enumerable:!0},applyChange:{value:d,enumerable:!0},revertChange:{value:function(t,e,n){if(t&&e&&n&&n.kind){var r,o,i=t;for(o=n.path.length-1,r=0;r<o;r++)void 0===i[n.path[r]]&&(i[n.path[r]]={}),i=i[n.path[r]];switch(n.kind){case"A":p(i[n.path[r]],n.index,n.item);break;case"D":case"E":i[n.path[r]]=n.lhs;break;case"N":delete i[n.path[r]]}}},enumerable:!0},isConflict:{value:function(){return void 0!==x},enumerable:!0},noConflict:{value:function(){return A&&(A.forEach((function(t){t()})),A=null),f},enumerable:!0}});var P={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},k={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(t){return t},actionTransformer:function(t){return t},errorTransformer:function(t){return t},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},T=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dispatch,n=t.getState;return"function"==typeof e||"function"==typeof n?b()({dispatch:e,getState:n}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};t.defaults=k,t.createLogger=b,t.logger=T,t.default=T,Object.defineProperty(t,"__esModule",{value:!0})}(e)},99622:function(t,e){function n(t,e,n){this.f=t,this.once=e,this.priority=n}function r(){this.handlers=[]}function o(t,e){for(var n=0;n<t.handlers.length&&!(t.handlers[n].priority<e.priority);n++);t.handlers=t.handlers.slice(0,n).concat(e).concat(t.handlers.slice(n))}function i(){r.call(this)}function a(){r.call(this)}function s(){r.call(this)}e.w0=r,r.prototype.handlersForDispatch=function(){for(var t=this.handlers,e=null,n=t.length-1;n>=0;n--)t[n].once&&(e||(e=t.slice()),e.splice(n,1));return e&&(this.handlers=e),t},r.prototype.add=function(t,e){o(this,new n(t,!1,e||0))},r.prototype.addOnce=function(t,e){o(this,new n(t,!0,e||0))},r.prototype.remove=function(t){for(var e=0;e<this.handlers.length;e++)if(this.handlers[e].f==t)return void(this.handlers=this.handlers.slice(0,e).concat(this.handlers.slice(e+1)))},r.prototype.hasHandler=function(){return this.handlers.length>0},r.prototype.dispatch=function(){for(var t=this.handlersForDispatch(),e=0;e<t.length;e++)t[e].f.apply(null,arguments)},e.he=i,i.prototype=new r,i.prototype.dispatch=function(t){for(var e=this.handlersForDispatch(),n=0;n<e.length;n++)t=e[n].f(t);return t},a.prototype=new r,a.prototype.dispatch=function(){for(var t=this.handlersForDispatch(),e=0;e<t.length;e++){var n=t[e].f.apply(null,arguments);if(n)return n}},e.ZN=s,s.prototype=new r,s.prototype.dispatch=function(t){for(var e=this.handlersForDispatch(),n=0;n<e.length;n++)if(e[n].f(t)||t.defaultPrevented)return!0;return!1}},66721:function(t,e,n){"use strict";t.exports=n(92192)},72921:function(t){"use strict";var e=2*Math.PI;function n(t,e,n,r){var o=t*n+e*r;return o>1&&(o=1),o<-1&&(o=-1),(t*r-e*n<0?-1:1)*Math.acos(o)}function r(t,e){var n=4/3*Math.tan(e/4),r=Math.cos(t),o=Math.sin(t),i=Math.cos(t+e),a=Math.sin(t+e);return[r,o,r-o*n,o+r*n,i+a*n,a-i*n,i,a]}t.exports=function(t,o,i,a,s,u,c,l,f){var h=Math.sin(f*e/360),d=Math.cos(f*e/360),p=d*(t-i)/2+h*(o-a)/2,v=-h*(t-i)/2+d*(o-a)/2;if(0===p&&0===v)return[];if(0===c||0===l)return[];c=Math.abs(c),l=Math.abs(l);var m=p*p/(c*c)+v*v/(l*l);m>1&&(c*=Math.sqrt(m),l*=Math.sqrt(m));var g=function(t,r,o,i,a,s,u,c,l,f){var h=f*(t-o)/2+l*(r-i)/2,d=-l*(t-o)/2+f*(r-i)/2,p=u*u,v=c*c,m=h*h,g=d*d,y=p*v-p*g-v*m;y<0&&(y=0),y/=p*g+v*m;var b=(y=Math.sqrt(y)*(a===s?-1:1))*u/c*d,w=y*-c/u*h,x=f*b-l*w+(t+o)/2,O=l*b+f*w+(r+i)/2,E=(h-b)/u,_=(d-w)/c,S=(-h-b)/u,j=(-d-w)/c,A=n(1,0,E,_),P=n(E,_,S,j);return 0===s&&P>0&&(P-=e),1===s&&P<0&&(P+=e),[x,O,A,P]}(t,o,i,a,s,u,c,l,h,d),y=[],b=g[2],w=g[3],x=Math.max(Math.ceil(Math.abs(w)/(e/4)),1);w/=x;for(var O=0;O<x;O++)y.push(r(b,w)),b+=w;return y.map((function(t){for(var e=0;e<t.length;e+=2){var n=t[e+0],r=t[e+1],o=d*(n*=c)-h*(r*=l),i=h*n+d*r;t[e+0]=o+g[0],t[e+1]=i+g[1]}return t}))}},56954:function(t){"use strict";var e=1e-10,n=Math.PI/180;function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);this.rx=t,this.ry=e,this.ax=n}r.prototype.transform=function(t){var r=Math.cos(this.ax*n),o=Math.sin(this.ax*n),i=[this.rx*(t[0]*r+t[2]*o),this.rx*(t[1]*r+t[3]*o),this.ry*(-t[0]*o+t[2]*r),this.ry*(-t[1]*o+t[3]*r)],a=i[0]*i[0]+i[2]*i[2],s=i[1]*i[1]+i[3]*i[3],u=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1])),c=(a+s)/2;if(u<e*c)return this.rx=this.ry=Math.sqrt(c),this.ax=0,this;var l=i[0]*i[1]+i[2]*i[3],f=c+(u=Math.sqrt(u))/2,h=c-u/2;return this.ax=Math.abs(l)<e&&Math.abs(f-s)<e?90:180*Math.atan(Math.abs(l)>Math.abs(f-s)?(f-a)/l:l/(f-s))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(f),this.ry=Math.sqrt(h)):(this.ax+=90,this.rx=Math.sqrt(h),this.ry=Math.sqrt(f)),this},r.prototype.isDegenerate=function(){return this.rx<e*this.ry||this.ry<e*this.rx},t.exports=r},59480:function(t){"use strict";function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,n){var r,o,i;return 0!==t&&(this.translate(e,n),r=t*Math.PI/180,o=Math.cos(r),i=Math.sin(r),this.queue.push([o,i,-i,o,0,0]),this.cache=null,this.translate(-e,-n)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=(e=this.cache,n=this.queue[t],[e[0]*n[0]+e[2]*n[1],e[1]*n[0]+e[3]*n[1],e[0]*n[2]+e[2]*n[3],e[1]*n[2]+e[3]*n[3],e[0]*n[4]+e[2]*n[5]+e[4],e[1]*n[4]+e[3]*n[5]+e[5]]);var e,n;return this.cache},e.prototype.calc=function(t,e,n){var r;return this.queue.length?(this.cache||(this.cache=this.toArray()),[t*(r=this.cache)[0]+e*r[2]+(n?0:r[4]),t*r[1]+e*r[3]+(n?0:r[5])]):[t,e]},t.exports=e},63665:function(t){"use strict";var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},n=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function r(t){return t>=48&&t<=57}function o(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function i(t){for(;t.index<t.max&&(10===(e=t.path.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&n.indexOf(e)>=0);)t.index++;var e}function a(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")")}function s(t){var e,n=t.index,o=n,i=t.max,a=!1,s=!1,u=!1,c=!1;if(o>=i)t.err="SvgPath: missed param (at pos "+o+")";else if(43!==(e=t.path.charCodeAt(o))&&45!==e||(e=++o<i?t.path.charCodeAt(o):0),r(e)||46===e){if(46!==e){if(a=48===e,e=++o<i?t.path.charCodeAt(o):0,a&&o<i&&e&&r(e))return void(t.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+n+")");for(;o<i&&r(t.path.charCodeAt(o));)o++,s=!0;e=o<i?t.path.charCodeAt(o):0}if(46===e){for(c=!0,o++;r(t.path.charCodeAt(o));)o++,u=!0;e=o<i?t.path.charCodeAt(o):0}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="SvgPath: invalid float exponent (at pos "+o+")");if(43!==(e=++o<i?t.path.charCodeAt(o):0)&&45!==e||o++,!(o<i&&r(t.path.charCodeAt(o))))return void(t.err="SvgPath: invalid float exponent (at pos "+o+")");for(;o<i&&r(t.path.charCodeAt(o));)o++}t.index=o,t.param=parseFloat(t.path.slice(n,o))+0}else t.err="SvgPath: param should start with 0..9 or `.` (at pos "+o+")"}function u(t){var n,r;r=(n=t.path[t.segmentStart]).toLowerCase();var o=t.data;if("m"===r&&o.length>2&&(t.result.push([n,o[0],o[1]]),o=o.slice(2),r="l",n="m"===n?"l":"L"),"r"===r)t.result.push([n].concat(o));else for(;o.length>=e[r]&&(t.result.push([n].concat(o.splice(0,e[r]))),e[r]););}function c(t){var n,r,o,c,l,f,h=t.max;if(t.segmentStart=t.index,r=97==(32|(n=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(n))if(c=e[t.path[t.index].toLowerCase()],t.index++,i(t),t.data=[],c){for(o=!1;;){for(l=c;l>0;l--){if(!r||3!==l&&4!==l?s(t):a(t),t.err.length)return;t.data.push(t.param),i(t),o=!1,t.index<h&&44===t.path.charCodeAt(t.index)&&(t.index++,i(t),o=!0)}if(!o){if(t.index>=t.max)break;if(!((f=t.path.charCodeAt(t.index))>=48&&f<=57||43===f||45===f||46===f))break}}u(t)}else u(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}t.exports=function(t){var e=new o(t),n=e.max;for(i(e);e.index<n&&!e.err.length;)c(e);return e.err.length?e.result=[]:e.result.length&&("mM".indexOf(e.result[0][0])<0?(e.err="SvgPath: string should start with `M` or `m`",e.result=[]):e.result[0][0]="M"),{err:e.err,segments:e.result}}},92192:function(t,e,n){"use strict";var r=n(63665),o=n(22094),i=n(59480),a=n(72921),s=n(56954);function u(t){if(!(this instanceof u))return new u(t);var e=r(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}u.from=function(t){if("string"==typeof t)return new u(t);if(t instanceof u){var e=new u("");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return i().matrix(t.toArray())})),e}throw new Error("SvgPath.from: invalid param type "+t)},u.prototype.__matrix=function(t){var e,n=this;t.queue.length&&this.iterate((function(r,o,i,a){var u,c,l,f;switch(r[0]){case"v":c=0===(u=t.calc(0,r[1],!0))[0]?["v",u[1]]:["l",u[0],u[1]];break;case"V":c=(u=t.calc(i,r[1],!1))[0]===t.calc(i,a,!1)[0]?["V",u[1]]:["L",u[0],u[1]];break;case"h":c=0===(u=t.calc(r[1],0,!0))[1]?["h",u[0]]:["l",u[0],u[1]];break;case"H":c=(u=t.calc(r[1],a,!1))[1]===t.calc(i,a,!1)[1]?["H",u[0]]:["L",u[0],u[1]];break;case"a":case"A":var h=t.toArray(),d=s(r[1],r[2],r[3]).transform(h);if(h[0]*h[3]-h[1]*h[2]<0&&(r[5]=r[5]?"0":"1"),u=t.calc(r[6],r[7],"a"===r[0]),"A"===r[0]&&r[6]===i&&r[7]===a||"a"===r[0]&&0===r[6]&&0===r[7]){c=["a"===r[0]?"l":"L",u[0],u[1]];break}c=d.isDegenerate()?["a"===r[0]?"l":"L",u[0],u[1]]:[r[0],d.rx,d.ry,d.ax,r[4],r[5],u[0],u[1]];break;case"m":f=o>0,c=["m",(u=t.calc(r[1],r[2],f))[0],u[1]];break;default:for(c=[l=r[0]],f=l.toLowerCase()===l,e=1;e<r.length;e+=2)u=t.calc(r[e],r[e+1],f),c.push(u[0],u[1])}n.segments[o]=c}),!0)},u.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(1===this.__stack.length)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=i(),e=this.__stack.length;--e>=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},u.prototype.toString=function(){var t="",e="",n=!1;this.__evaluateStack();for(var r=0,o=this.segments.length;r<o;r++){var i=this.segments[r],a=i[0];a!==e||"m"===a||"M"===a?("m"===a&&"z"===e&&(t+=" "),t+=a,n=!1):n=!0;for(var s=1;s<i.length;s++){var u=i[s];1===s?n&&u>=0&&(t+=" "):u>=0&&(t+=" "),t+=u}e=a}return t},u.prototype.translate=function(t,e){return this.__stack.push(i().translate(t,e||0)),this},u.prototype.scale=function(t,e){return this.__stack.push(i().scale(t,e||0===e?e:t)),this},u.prototype.rotate=function(t,e,n){return this.__stack.push(i().rotate(t,e||0,n||0)),this},u.prototype.skewX=function(t){return this.__stack.push(i().skewX(t)),this},u.prototype.skewY=function(t){return this.__stack.push(i().skewY(t)),this},u.prototype.matrix=function(t){return this.__stack.push(i().matrix(t)),this},u.prototype.transform=function(t){return t.trim()?(this.__stack.push(o(t)),this):this},u.prototype.round=function(t){var e,n=0,r=0,o=0,i=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(a){var s=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":return s&&(a[1]+=o),o=a[1]-a[1].toFixed(t),void(a[1]=+a[1].toFixed(t));case"V":case"v":return s&&(a[1]+=i),i=a[1]-a[1].toFixed(t),void(a[1]=+a[1].toFixed(t));case"Z":case"z":return o=n,void(i=r);case"M":case"m":return s&&(a[1]+=o,a[2]+=i),o=a[1]-a[1].toFixed(t),i=a[2]-a[2].toFixed(t),n=o,r=i,a[1]=+a[1].toFixed(t),void(a[2]=+a[2].toFixed(t));case"A":case"a":return s&&(a[6]+=o,a[7]+=i),o=a[6]-a[6].toFixed(t),i=a[7]-a[7].toFixed(t),a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t),a[3]=+a[3].toFixed(t+2),a[6]=+a[6].toFixed(t),void(a[7]=+a[7].toFixed(t));default:return e=a.length,s&&(a[e-2]+=o,a[e-1]+=i),o=a[e-2]-a[e-2].toFixed(t),i=a[e-1]-a[e-1].toFixed(t),void a.forEach((function(e,n){n&&(a[n]=+a[n].toFixed(t))}))}})),this},u.prototype.iterate=function(t,e){var n,r,o,i=this.segments,a={},s=!1,u=0,c=0,l=0,f=0;if(e||this.__evaluateStack(),i.forEach((function(e,n){var r=t(e,n,u,c);Array.isArray(r)&&(a[n]=r,s=!0);var o=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return u=e[1]+(o?u:0),c=e[2]+(o?c:0),l=u,void(f=c);case"h":case"H":return void(u=e[1]+(o?u:0));case"v":case"V":return void(c=e[1]+(o?c:0));case"z":case"Z":return u=l,void(c=f);default:u=e[e.length-2]+(o?u:0),c=e[e.length-1]+(o?c:0)}})),!s)return this;for(o=[],n=0;n<i.length;n++)if(void 0!==a[n])for(r=0;r<a[n].length;r++)o.push(a[n][r]);else o.push(i[n]);return this.segments=o,this},u.prototype.abs=function(){return this.iterate((function(t,e,n,r){var o,i=t[0],a=i.toUpperCase();if(i!==a)switch(t[0]=a,i){case"v":return void(t[1]+=r);case"a":return t[6]+=n,void(t[7]+=r);default:for(o=1;o<t.length;o++)t[o]+=o%2?n:r}}),!0),this},u.prototype.rel=function(){return this.iterate((function(t,e,n,r){var o,i=t[0],a=i.toLowerCase();if(i!==a&&(0!==e||"M"!==i))switch(t[0]=a,i){case"V":return void(t[1]-=r);case"A":return t[6]-=n,void(t[7]-=r);default:for(o=1;o<t.length;o++)t[o]-=o%2?n:r}}),!0),this},u.prototype.unarc=function(){return this.iterate((function(t,e,n,r){var o,i,s,u=[],c=t[0];return"A"!==c&&"a"!==c?null:("a"===c?(i=n+t[6],s=r+t[7]):(i=t[6],s=t[7]),0===(o=a(n,r,i,s,t[4],t[5],t[1],t[2],t[3])).length?[["a"===t[0]?"l":"L",t[6],t[7]]]:(o.forEach((function(t){u.push(["C",t[2],t[3],t[4],t[5],t[6],t[7]])})),u))})),this},u.prototype.unshort=function(){var t,e,n,r,o,i=this.segments;return this.iterate((function(a,s,u,c){var l,f=a[0],h=f.toUpperCase();s&&("T"===h?(l="t"===f,"Q"===(n=i[s-1])[0]?(t=n[1]-u,e=n[2]-c):"q"===n[0]?(t=n[1]-n[3],e=n[2]-n[4]):(t=0,e=0),r=-t,o=-e,l||(r+=u,o+=c),i[s]=[l?"q":"Q",r,o,a[1],a[2]]):"S"===h&&(l="s"===f,"C"===(n=i[s-1])[0]?(t=n[3]-u,e=n[4]-c):"c"===n[0]?(t=n[3]-n[5],e=n[4]-n[6]):(t=0,e=0),r=-t,o=-e,l||(r+=u,o+=c),i[s]=[l?"c":"C",r,o,a[1],a[2],a[3],a[4]]))})),this},t.exports=u},22094:function(t,e,n){"use strict";var r=n(59480),o={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},i=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,a=/[\s,]+/;t.exports=function(t){var e,n,s=new r;return t.split(i).forEach((function(t){if(t.length)if(void 0===o[t])switch(n=t.split(a).map((function(t){return+t||0})),e){case"matrix":return void(6===n.length&&s.matrix(n));case"scale":return void(1===n.length?s.scale(n[0],n[0]):2===n.length&&s.scale(n[0],n[1]));case"rotate":return void(1===n.length?s.rotate(n[0],0,0):3===n.length&&s.rotate(n[0],n[1],n[2]));case"translate":return void(1===n.length?s.translate(n[0],0):2===n.length&&s.translate(n[0],n[1]));case"skewX":return void(1===n.length&&s.skewX(n[0]));case"skewY":return void(1===n.length&&s.skewY(n[0]))}else e=t})),s}},35449:function(t,e,n){!function(t){"use strict";var e,n=function(){try{if(t.URLSearchParams&&"bar"===new t.URLSearchParams("foo=bar").get("foo"))return t.URLSearchParams}catch(t){}return null}(),r=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),i=!n||((e=new n).append("s"," &"),"s=+%26"===e.toString()),a=l.prototype,s=!(!t.Symbol||!t.Symbol.iterator);if(!(n&&r&&o&&i)){var u;a.append=function(t,e){v(this.__URLSearchParams__,t,e)},a.delete=function(t){delete this.__URLSearchParams__[t]},a.get=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t][0]:null},a.getAll=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t].slice(0):[]},a.has=function(t){return g(this.__URLSearchParams__,t)},a.set=function(t,e){this.__URLSearchParams__[t]=[""+e]},a.toString=function(){var t,e,n,r,o=this.__URLSearchParams__,i=[];for(e in o)for(n=f(e),t=0,r=o[e];t<r.length;t++)i.push(n+"="+f(r[t]));return i.join("&")},o&&n&&!r&&t.Proxy?(u=new Proxy(n,{construct:function(t,e){return new t(new l(e[0]).toString())}})).toString=Function.prototype.toString.bind(l):u=l,Object.defineProperty(t,"URLSearchParams",{value:u});var c=t.URLSearchParams.prototype;c.polyfill=!0,c.forEach=c.forEach||function(t,e){var n=p(this.toString());Object.getOwnPropertyNames(n).forEach((function(r){n[r].forEach((function(n){t.call(e,n,r,this)}),this)}),this)},c.sort=c.sort||function(){var t,e,n,r=p(this.toString()),o=[];for(t in r)o.push(t);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var i=o[e],a=r[i];for(n=0;n<a.length;n++)this.append(i,a[n])}},c.keys=c.keys||function(){var t=[];return this.forEach((function(e,n){t.push(n)})),d(t)},c.values=c.values||function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},c.entries=c.entries||function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),d(t)},s&&(c[t.Symbol.iterator]=c[t.Symbol.iterator]||c.entries)}function l(t){((t=t||"")instanceof URLSearchParams||t instanceof l)&&(t=t.toString()),this.__URLSearchParams__=p(t)}function f(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,(function(t){return e[t]}))}function h(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,(function(t){return decodeURIComponent(t)}))}function d(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(n[t.Symbol.iterator]=function(){return n}),n}function p(t){var e={};if("object"==typeof t)if(m(t))for(var n=0;n<t.length;n++){var r=t[n];if(!m(r)||2!==r.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");v(e,r[0],r[1])}else for(var o in t)t.hasOwnProperty(o)&&v(e,o,t[o]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var i=t.split("&"),a=0;a<i.length;a++){var s=i[a],u=s.indexOf("=");-1<u?v(e,h(s.slice(0,u)),h(s.slice(u+1))):s&&v(e,h(s),"")}}return e}function v(t,e,n){var r="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);g(t,e)?t[e].push(r):t[e]=[r]}function m(t){return!!t&&"[object Array]"===Object.prototype.toString.call(t)}function g(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(void 0!==n.g?n.g:"undefined"!=typeof window?window:this)},52511:function(t,e,n){var r;t=n.nmd(t),function(o){e&&e.nodeType,t&&t.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var a,s=2147483647,u=36,c=/^xn--/,l=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function v(t){throw RangeError(h[t])}function m(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function g(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+m((t=t.replace(f,".")).split("."),e).join(".")}function y(t){for(var e,n,r=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(n=t.charCodeAt(o++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--):r.push(e);return r}function b(t){return m(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,n){var r=0;for(t=n?d(t/700):t>>1,t+=d(t/e);t>455;r+=u)t=d(t/35);return d(r+36*t/(t+38))}function O(t){var e,n,r,o,i,a,c,l,f,h,p,m=[],g=t.length,y=0,w=128,O=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&v("not-basic"),m.push(t.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=y,a=1,c=u;o>=g&&v("invalid-input"),((l=(p=t.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:u)>=u||l>d((s-y)/a))&&v("overflow"),y+=l*a,!(l<(f=c<=O?1:c>=O+26?26:c-O));c+=u)a>d(s/(h=u-f))&&v("overflow"),a*=h;O=x(y-i,e=m.length+1,0==i),d(y/e)>s-w&&v("overflow"),w+=d(y/e),y%=e,m.splice(y++,0,w)}return b(m)}function E(t){var e,n,r,o,i,a,c,l,f,h,m,g,b,O,E,_=[];for(g=(t=y(t)).length,e=128,n=0,i=72,a=0;a<g;++a)(m=t[a])<128&&_.push(p(m));for(r=o=_.length,o&&_.push("-");r<g;){for(c=s,a=0;a<g;++a)(m=t[a])>=e&&m<c&&(c=m);for(c-e>d((s-n)/(b=r+1))&&v("overflow"),n+=(c-e)*b,e=c,a=0;a<g;++a)if((m=t[a])<e&&++n>s&&v("overflow"),m==e){for(l=n,f=u;!(l<(h=f<=i?1:f>=i+26?26:f-i));f+=u)E=l-h,O=u-h,_.push(p(w(h+E%O,0))),l=d(E/O);_.push(p(w(l,0))),i=x(n,b,r==o),n=0,++r}++n,++e}return _.join("")}a={version:"1.3.2",ucs2:{decode:y,encode:b},decode:O,encode:E,toASCII:function(t){return g(t,(function(t){return l.test(t)?"xn--"+E(t):t}))},toUnicode:function(t){return g(t,(function(t){return c.test(t)?O(t.slice(4).toLowerCase()):t}))}},void 0===(r=function(){return a}.call(e,n,e,t))||(t.exports=r)}()},8575:function(t,e,n){"use strict";var r=n(52511),o=n(62502);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){return o.isString(t)&&(t=b(t)),t instanceof i?t.format():i.prototype.format.call(t)},e.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(52624);function b(t,e,n){if(t&&o.isObject(t)&&t instanceof i)return t;var r=new i;return r.parse(t,e,n),r}i.prototype.parse=function(t,e,n){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),s=-1!==i&&i<t.indexOf("#")?"?":"#",c=t.split(s);c[0]=c[0].replace(/\\/g,"/");var b=t=c.join(s);if(b=b.trim(),!n&&1===t.split("#").length){var w=u.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?y.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var x=a.exec(b);if(x){var O=(x=x[0]).toLowerCase();this.protocol=O,b=b.substr(x.length)}if(n||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||x&&m[x]||(b=b.substr(2),this.slashes=!0)}if(!m[x]&&(E||x&&!g[x])){for(var _,S,j=-1,A=0;A<h.length;A++)-1!==(P=b.indexOf(h[A]))&&(-1===j||P<j)&&(j=P);for(-1!==(S=-1===j?b.lastIndexOf("@"):b.lastIndexOf("@",j))&&(_=b.slice(0,S),b=b.slice(S+1),this.auth=decodeURIComponent(_)),j=-1,A=0;A<f.length;A++){var P;-1!==(P=b.indexOf(f[A]))&&(-1===j||P<j)&&(j=P)}-1===j&&(j=b.length),this.host=b.slice(0,j),b=b.slice(j),this.parseHost(),this.hostname=this.hostname||"";var k="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!k)for(var T=this.hostname.split(/\./),C=(A=0,T.length);A<C;A++){var R=T[A];if(R&&!R.match(d)){for(var M="",I=0,N=R.length;I<N;I++)R.charCodeAt(I)>127?M+="x":M+=R[I];if(!M.match(d)){var B=T.slice(0,A),Z=T.slice(A+1),L=R.match(p);L&&(B.push(L[1]),Z.unshift(L[2])),Z.length&&(b="/"+Z.join(".")+b),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=r.toASCII(this.hostname));var D=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+D,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[O])for(A=0,C=l.length;A<C;A++){var F=l[A];if(-1!==b.indexOf(F)){var G=encodeURIComponent(F);G===F&&(G=escape(F)),b=b.split(F).join(G)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var V=b.indexOf("?");if(-1!==V?(this.search=b.substr(V),this.query=b.substr(V+1),e&&(this.query=y.parse(this.query)),b=b.slice(0,V)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[O]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){D=this.pathname||"";var U=this.search||"";this.path=D+U}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,a="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),e+i+(n=n.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+r},i.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if(o.isString(t)){var e=new i;e.parse(t,!1,!0),t=e}for(var n=new i,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(n[l]=t[l])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!g[t.protocol]){for(var f=Object.keys(t),h=0;h<f.length;h++){var d=f[h];n[d]=t[d]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||m[t.protocol])n.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var v=n.pathname||"",y=n.search||"";n.path=v+y}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=w||b||n.host&&t.pathname,O=x,E=n.pathname&&n.pathname.split("/")||[],_=(p=t.pathname&&t.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(_&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),x=x&&(""===p[0]||""===E[0])),w)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),n.search=t.search,n.query=t.query;else if(!o.isNullOrUndefined(t.search))return _&&(n.hostname=n.host=E.shift(),(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.shift())),n.search=t.search,n.query=t.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=E.slice(-1)[0],j=(n.host||t.host||E.length>1)&&("."===S||".."===S)||""===S,A=0,P=E.length;P>=0;P--)"."===(S=E[P])?E.splice(P,1):".."===S?(E.splice(P,1),A++):A&&(E.splice(P,1),A--);if(!x&&!O)for(;A--;A)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),j&&"/"!==E.join("/").substr(-1)&&E.push("");var k,T=""===E[0]||E[0]&&"/"===E[0].charAt(0);return _&&(n.hostname=n.host=T?"":E.length?E.shift():"",(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.shift())),(x=x||n.host&&E.length)&&!T&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},62502:function(t){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},8107:function(t,e,n){"use strict";var r=n(86254),o=n(67294),i=function(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:"contentBoxSize"===e?t.contentRect["inlineSize"===n?"width":"height"]:void 0};t.exports=function(t){void 0===t&&(t={});var e=t.onResize,n=o.useRef(void 0);n.current=e;var a=t.round||Math.round,s=o.useRef(),u=o.useState({width:void 0,height:void 0}),c=u[0],l=u[1],f=o.useRef(!1);o.useEffect((function(){return function(){f.current=!0}}),[]);var h,d,p,v,m,g,y=o.useRef({width:void 0,height:void 0}),b=(h=o.useCallback((function(e){return s.current&&s.current.box===t.box&&s.current.round===a||(s.current={box:t.box,round:a,instance:new r.ResizeObserver((function(e){var r=e[0],o="border-box"===t.box?"borderBoxSize":"device-pixel-content-box"===t.box?"devicePixelContentBoxSize":"contentBoxSize",s=i(r,o,"inlineSize"),u=i(r,o,"blockSize"),c=s?a(s):void 0,h=u?a(u):void 0;if(y.current.width!==c||y.current.height!==h){var d={width:c,height:h};y.current.width=c,y.current.height=h,n.current?n.current(d):f.current||l(d)}}))}),s.current.instance.observe(e,{box:t.box}),function(){s.current&&s.current.instance.unobserve(e)}}),[t.box,a]),d=t.ref,p=o.useRef(null),v=o.useRef(null),m=o.useRef(),g=o.useCallback((function(){var t=null;p.current?t=p.current:d&&(t=d instanceof HTMLElement?d:d.current),v.current&&v.current.element===t&&v.current.reporter===g||(m.current&&(m.current(),m.current=null),v.current={reporter:g,element:t},t&&(m.current=h(t)))}),[d,h]),o.useEffect((function(){g()}),[g]),o.useCallback((function(t){p.current=t,g()}),[g]));return o.useMemo((function(){return{ref:b,width:c.width,height:c.height}}),[b,c?c.width:null,c?c.height:null])}},20384:function(t){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},55955:function(t,e,n){"use strict";var r=n(82584),o=n(48662),i=n(86430),a=n(85692);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(c)var v=s(Symbol.prototype.valueOf);function m(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function g(t){return"[object Map]"===l(t)}function y(t){return"[object Set]"===l(t)}function b(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function x(t){return"[object ArrayBuffer]"===l(t)}function O(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function E(t){return"[object DataView]"===l(t)}function _(t){return"undefined"!=typeof DataView&&(E.working?E(t):t instanceof DataView)}e.isArgumentsObject=r,e.isGeneratorFunction=o,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||_(t)},e.isUint8Array=function(t){return"Uint8Array"===i(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===i(t)},e.isUint16Array=function(t){return"Uint16Array"===i(t)},e.isUint32Array=function(t){return"Uint32Array"===i(t)},e.isInt8Array=function(t){return"Int8Array"===i(t)},e.isInt16Array=function(t){return"Int16Array"===i(t)},e.isInt32Array=function(t){return"Int32Array"===i(t)},e.isFloat32Array=function(t){return"Float32Array"===i(t)},e.isFloat64Array=function(t){return"Float64Array"===i(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===i(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===i(t)},g.working="undefined"!=typeof Map&&g(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(g.working?g(t):t instanceof Map)},y.working="undefined"!=typeof Set&&y(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(y.working?y(t):t instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(b.working?b(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=O,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=_;var S="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function j(t){return"[object SharedArrayBuffer]"===l(t)}function A(t){return void 0!==S&&(void 0===j.working&&(j.working=j(new S)),j.working?j(t):t instanceof S)}function P(t){return m(t,f)}function k(t){return m(t,h)}function T(t){return m(t,d)}function C(t){return u&&m(t,p)}function R(t){return c&&m(t,v)}e.isSharedArrayBuffer=A,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=P,e.isStringObject=k,e.isBooleanObject=T,e.isBigIntObject=C,e.isSymbolObject=R,e.isBoxedPrimitive=function(t){return P(t)||k(t)||T(t)||C(t)||R(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(O(t)||A(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},89539:function(t,e,n){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},o=/%[sdj%]/g;e.format=function(t){if(!y(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(u(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),s=r[n];n<i;s=r[++n])m(s)||!x(s)?a+=" "+s:a+=" "+u(s);return a},e.deprecate=function(t,e){if(!0==={env:{}}.noDeprecation)return t;var n=!1;return function(){if(!n){if({env:{}}.throwDeprecation)throw new Error(e);!{env:{}}.traceDeprecation?console.error(e):console.trace(e),n=!0}return t.apply(this,arguments)}};var i={},a=/^$/;if({}.NODE_DEBUG){var s={}.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+s+"$","i")}function u(t,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(n)?r.showHidden=n:n&&e._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),f(r,t,r.depth)}function c(t,e){var n=u.styles[e];return n?"["+u.colors[n][0]+"m"+t+"["+u.colors[n][1]+"m":t}function l(t,e){return t}function f(t,n,r){if(t.customInspect&&n&&_(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,t);return y(o)||(o=f(t,o,r)),o}var i=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(y(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return g(e)?t.stylize(""+e,"number"):v(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,n);if(i)return i;var a=Object.keys(n),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(n);if(0===a.length){if(_(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(O(n))return t.stylize(Date.prototype.toString.call(n),"date");if(E(n))return h(n)}var c,l="",x=!1,S=["{","}"];return p(n)&&(x=!0,S=["[","]"]),_(n)&&(l=" [Function"+(n.name?": "+n.name:"")+"]"),w(n)&&(l=" "+RegExp.prototype.toString.call(n)),O(n)&&(l=" "+Date.prototype.toUTCString.call(n)),E(n)&&(l=" "+h(n)),0!==a.length||x&&0!=n.length?r<0?w(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=x?function(t,e,n,r,o){for(var i=[],a=0,s=e.length;a<s;++a)k(e,String(a))?i.push(d(t,e,n,r,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(d(t,e,n,r,o,!0))})),i}(t,n,r,s,a):a.map((function(e){return d(t,n,r,s,e,x)})),t.seen.pop(),function(t,e,n){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(c,l,S)):S[0]+l+S[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,n,r,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),k(r,o)||(a="["+o+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(n)?f(t,u.value,null):f(t,u.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),b(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function v(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function b(t){return void 0===t}function w(t){return x(t)&&"[object RegExp]"===S(t)}function x(t){return"object"==typeof t&&null!==t}function O(t){return x(t)&&"[object Date]"===S(t)}function E(t){return x(t)&&("[object Error]"===S(t)||t instanceof Error)}function _(t){return"function"==typeof t}function S(t){return Object.prototype.toString.call(t)}function j(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var n={env:{}}.pid;i[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else i[t]=function(){};return i[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=n(55955),e.isArray=p,e.isBoolean=v,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=w,e.types.isRegExp=w,e.isObject=x,e.isDate=O,e.types.isDate=O,e.isError=E,e.types.isNativeError=E,e.isFunction=_,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(20384);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[j(t.getHours()),j(t.getMinutes()),j(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=n(35717),e._extend=function(t,e){if(!e||!x(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e;if("function"!=typeof(e=t[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise((function(t,r){e=t,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,r){t?n(t):e(r)}));try{t.apply(this,o)}catch(t){n(t)}return r}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),T&&Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,r(t))},e.promisify.custom=T,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],n=0;n<arguments.length;n++)e.push(arguments[n]);var r=e.pop();if("function"!=typeof r)throw new TypeError("The last argument must be of type Function");var o=this,i=function(){return r.apply(o,arguments)};t.apply(this,e).then((function(t){({env:{}}).nextTick(i.bind(null,null,t))}),(function(t){({env:{}}).nextTick(C.bind(null,t,i))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,r(t)),e}},86430:function(t,e,n){"use strict";var r=n(49804),o=n(63083),i=n(21924),a=i("Object.prototype.toString"),s=n(96410)(),u="undefined"==typeof globalThis?n.g:globalThis,c=o(),l=i("String.prototype.slice"),f={},h=n(20882),d=Object.getPrototypeOf;s&&h&&d&&r(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var n=d(e),r=h(n,Symbol.toStringTag);if(!r){var o=d(n);r=h(o,Symbol.toStringTag)}f[t]=r.get}}}));var p=n(85692);t.exports=function(t){return!!p(t)&&(s&&Symbol.toStringTag in t?function(t){var e=!1;return r(f,(function(n,r){if(!e)try{var o=n.call(t);o===r&&(e=o)}catch(t){}})),e}(t):l(a(t),8,-1))}},63083:function(t,e,n){"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?n.g:globalThis;t.exports=function(){for(var t=[],e=0;e<r.length;e++)"function"==typeof o[r[e]]&&(t[t.length]=r[e]);return t}},20882:function(t,e,n){"use strict";var r=n(40210)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(t){r=null}t.exports=r},1519:function(t,e,n){"use strict";function r(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}n.d(e,{Z:function(){return r}})},86033:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(1519);function o(t,e){return function(t,e){return e.get?e.get.call(t):e.value}(t,(0,r.Z)(t,e,"get"))}},13092:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(1519);function o(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,(0,r.Z)(t,e,"set"),n),n}}}]);