-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
2 lines (2 loc) · 28.1 KB
/
index.js
1
2
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}("undefined"!=typeof self?self:this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="pwNi")}({BtxX:function(e){!function(t){function n(){}function o(e,t){return function(){e.apply(t,arguments)}}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],u(e,this)}function i(e,t){for(;3===e._state;)e=e._value;if(0===e._state)return void e._deferreds.push(t);e._handled=!0,r._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?a:c)(t.promise,e._value);var o;try{o=n(e._value)}catch(e){return void c(t.promise,e)}a(t.promise,o)})}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof r)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void u(o(n,t),e)}e._state=1,e._value=t,s(e)}catch(t){c(e,t)}}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function u(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}var f=setTimeout;r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var o=new this.constructor(n);return i(this,new l(e,t,o)),o},r.all=function(e){return new r(function(t,n){function o(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(t){o(e,t)},n)}r[e]=a,0==--i&&t(r)}catch(e){n(e)}}if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);for(var i=r.length,a=0;a<r.length;a++)o(a,r[a])})},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,n){n(e)})},r.race=function(e){return new r(function(t,n){for(var o=0,r=e.length;o<r;o++)e[o].then(t,n)})},r._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){f(e,0)},r._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},r._setImmediateFn=function(e){r._immediateFn=e},r._setUnhandledRejectionFn=function(e){r._unhandledRejectionFn=e},void 0!==e&&e.exports?e.exports=r:t.Promise||(t.Promise=r)}(this)},GOAy:function(e){e.exports={"risk-level-selection__container":"risk-level-selection__container__3TPmi","risk-level-selection__option":"risk-level-selection__option__3gaTE","risk-level-selection__option--selected":"risk-level-selection__option--selected__2bkRh"}},JkW7:function(e,t,n){"use strict";function o(e){if(null==e)throw new TypeError("Cannot destructure undefined")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return e>=0?V.a.positiveNumber:V.a.negativeNumber}function c(e){var t=function(e){return e.toFixed(0).padStart(2,"0")};return t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=B({includeSign:!1,precision:2},t),(t.includeSign&&e>=0?"+":"")+e.toFixed(t.precision).replace(".",",").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")}function l(e){if(null==e)throw new TypeError("Cannot destructure undefined")}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function C(e,t,n){e.dataset.propUser=t,e.dataset.propPortfolio=n,se({selector:"#"+e.id})}Object.defineProperty(t,"__esModule",{value:!0});var x=n("KM04"),S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},N=function(e){return e.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()})},P=function(){return document.currentScript||function(){var e=document.getElementsByTagName("script");return e[e.length-1]}()},E=function(e,t){void 0===t&&(t={});var n=e.attributes,o=S({},t);return Object.keys(n).forEach(function(e){if(n.hasOwnProperty(e)){var t=n[e].name;if(!t||"string"!=typeof t)return!1;var r=t.split(/(data-props?-)/).pop()||"";if(r=N(r),t!==r){o[r]=n[e].nodeValue}}}),[].forEach.call(e.getElementsByTagName("script"),function(e){var t={};if(e.hasAttribute("type")){if("text/props"!==e.getAttribute("type")&&"application/json"!==e.getAttribute("type"))return;try{t=JSON.parse(e.innerHTML)}catch(e){throw new Error(e)}S(o,t)}}),o},T=function(e){var t=e.attributes,n=null;return Object.keys(t).forEach(function(e){if(t.hasOwnProperty(e)){"data-mount-in"===t[e].name&&(n=t[e].nodeValue)}}),n},L=function(e){var t=e.selector,n=e.inline,o=e.clientSpecified,r=[],i=P();if(!0===n){r.push(i.parentNode)}return!0!==o||t||(t=T(i)),t&&[].forEach.call(document.querySelectorAll(t),function(e){r.push(e)}),r},U=function(e,t,n,o,r){t.forEach(function(t){var i=t;if(!i._habitat){i._habitat=!0;var a=E(t,r)||r;return o&&(i.innerHTML=""),Object(x.render)(Object(x.h)(e,a),i,n)}})},R=function(e){var t=e;return{render:function(e){void 0===e&&(e={});var n=e.selector;void 0===n&&(n=null);var o=e.inline;void 0===o&&(o=!1);var r=e.clean;void 0===r&&(r=!1);var i=e.clientSpecified;void 0===i&&(i=!1);var a=e.defaultProps;void 0===a&&(a={});var c=L({selector:n,inline:o,clientSpecified:i}),s=function(){if(c.length>0){var e=L({selector:n,inline:o,clientSpecified:i});return U(t,e,null,r,a)}};s(),document.addEventListener("DOMContentLoaded",s),document.addEventListener("load",s)}}},M=R,A=n("vsHu"),W=n.n(A),H=n("W/Rx"),D=n.n(H),F=n("cXSW"),V=n.n(F),B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},I=function(e){function t(){return r(this,e.apply(this,arguments))}return i(t,e),t.prototype.render=function(e,t){var n=e.stock,r=e.onClick,i=e.onHover;return o(t),n?Object(x.h)("tr",{onClick:function(e){r(e,"row")},onMouseOver:i,class:V.a["stock-table-row"]},Object(x.h)("td",{class:V.a.name},Object(x.h)("a",{onClick:function(e){e.preventDefault(),e.stopPropagation(),r(e,"link")},href:n.url},n.name)),Object(x.h)("td",{class:V.a.category},Object(x.h)("a",{href:n.category.url},n.category.name)),Object(x.h)("td",{class:V.a.value},s(n.value)," ",n.currency),Object(x.h)("td",{class:[V.a.absolute,a(n.absolute)].join(" ")},s(n.absolute,{includeSign:!0})," ",n.currency),Object(x.h)("td",{class:[V.a.relative,a(n.relative)].join(" ")},s(n.relative,{includeSign:!0})," %"),Object(x.h)("td",{class:[V.a.timestamp,V.a.small].join(" ")},c(new Date(n.updated_at))),Object(x.h)("td",{class:[V.a.exchange,V.a.small].join(" ")},n.exchange),Object(x.h)("td",{class:[V.a.revenue,V.a.small].join(" ")},s(n.volume,{precision:0})," ",n.currency)):Object(x.h)("tr",null,Object(x.h)("td",{className:V.a.name},"Error: Could not load stock"),Object(x.h)("td",{className:V.a.category},"-"),Object(x.h)("td",{className:V.a.value},"-"),Object(x.h)("td",{className:V.a.absolute},"-"),Object(x.h)("td",{className:V.a.relative},"-"),Object(x.h)("td",{className:[V.a.timestamp,V.a.small].join(" ")},"-"),Object(x.h)("td",{className:[V.a.exchange,V.a.small].join(" ")},"-"),Object(x.h)("td",{className:[V.a.revenue,V.a.small].join(" ")},"-"))},t}(x.Component),q=Object(x.h)("tr",null,Object(x.h)("th",null,"Wertpapier"),Object(x.h)("th",null,"Branche"),Object(x.h)("th",null,"(Letzter) Kurs"),Object(x.h)("th",null,"Abs."),Object(x.h)("th",null,"Perf. %"),Object(x.h)("th",null,"Letztes Update"),Object(x.h)("th",null,"Börse"),Object(x.h)("th",null,"Umsatz")),J=Object(x.h)("tr",null,"No stocks found."),G=function(e){function t(){return u(this,t),f(this,e.apply(this,arguments))}return p(t,e),t.prototype.render=function(e,t){var n=e.stocks,o=e.onStockClicked,r=void 0===o?function(){}:o,i=e.onStockHovered;l(t);var a=Object(x.h)("thead",{className:D.a["stock-table-head"]},q);return n&&0!==n.length?Object(x.h)("table",{className:D.a["stock-table"]},a,Object(x.h)("tbody",{className:D.a["stock-table-body"]},(n||[]).map(function(e){return Object(x.h)(I,{stock:e,onClick:r?r.bind(null,e):function(){},onHover:i?i.bind(null,e):function(){},key:e.id})}))):Object(x.h)("table",{className:D.a["stock-table"]},a,Object(x.h)("tbody",{className:D.a["stock-table-body"]},J))},t}(x.Component),K=n("QACa"),Q=n.n(K),z=n("VqBh"),X=n.n(z),$=function(e){function t(){return d(this,t),h(this,e.apply(this,arguments))}return _(t,e),t.prototype.render=function(e){return Object(x.h)("div",{className:X.a["dialog-pane-background"]},Object(x.h)("div",{className:X.a["dialog-pane-dialog"],style:e.dialogStyle},e.children))},t}(x.Component),Y=Object(x.h)("br",null),Z=function(e){function t(){return v(this,t),b(this,e.apply(this,arguments))}return m(t,e),t.prototype.render=function(e){var t=e.error,n=e.refreshCallback;return Object(x.h)($,{dialogStyle:"background-color: darkred;"},t||"Unknown error",Y,function(){return n?Object(x.h)("div",{className:Q.a["error-pane-dialog__button"],onClick:n},"Retry"):null}())},t}(x.Component),ee=n("GOAy"),te=n.n(ee),ne=[{label:"3%",value:.03},{label:"6%",value:.06},{label:"8%",value:.08},{label:"10%",value:.1},{label:"12%",value:.12},{label:"16%",value:.16}],oe=function(e){function t(n){var o=n.riskLevel;y(this,t);var r=g(this,e.call(this,o));return r.state={selectedValue:null},r}return j(t,e),t.prototype.updateSelection=function(e){this.props.onUpdate&&this.props.onUpdate(e.value)},t.prototype.render=function(e){var t=this,n=e.riskLevel,o=null!==n&&void 0!==n&&ne.map(function(e){return e.value}).includes(n)?n:ne[0].value;return Object(x.h)("form",{className:te.a["risk-level-selection__container"]},ne.map(function(e){var n="risk-level-selection__option",r=[te.a[n]];return te.a[n+"--"+e.value]&&r.push(te.a[n+"--"+e.value]),o===e.value&&r.push(te.a[n+"--selected"]),Object(x.h)("span",{class:r.join(" "),key:e.value,onClick:function(){o!==e.value&&t.updateSelection(e)}},e.label)}))},t}(x.Component),re=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ie=Object(x.h)($,{dialogStyle:"background-color: transparent;"},"Loading..."),ae=function(e){function t(n){w(this,t);var o=O(this,e.call(this,n));return o.state={recommendation:null,error:null,selected:null,hovered:null,loading:!1,user:null,showSettings:!1},o.pending=!1,o.refreshCachedData(n.user,n.portfolio),o}return k(t,e),t.prototype.refreshCachedData=function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.state.loading&&!this.pending){this.pending=!0,this.setState(function(){return{loading:!0,error:null}});(!this.state.user||o?this.requestUserData(e):Promise.resolve()).then(function(){return n.requestRecommendation(e,t)}).catch(function(r){n.setState(function(){return{error:{error:r,callback:function(){n.refreshCachedData(e,t,o)}}}})}).finally(function(){n.setState(function(){return{loading:!1}}),n.pending=!1})}},t.prototype.requestUserData=function(e){var t=this;return fetch("http://localhost:8080/api/user/"+e).then(function(e){return 200!==e.status?Promise.reject("Error: "+e.status):e.json()}).then(function(e){t.setState(function(){return{user:e}})})},t.prototype.requestRecommendation=function(e,t){var n=this;return fetch("http://localhost:8080/api/recommend/"+e+"?portfolio="+t).then(function(e){return 200!==e.status?Promise.reject("Error: "+e.status):e.json()}).then(function(e){n.setState(function(){return{recommendation:e}})})},t.prototype.stockClicked=function(e,t,n){var o=this;if(!this.state.loading&&!this.pending){this.pending=!0,this.setState(function(t){return{selected:t.selected&&e.id===t.selected.id?null:e}});var r="link"===n;fetch("http://localhost:8080/api/recommend/"+this.props.user+"?portfolio="+this.props.portfolio,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({choice:e,offered:this.state.recommendation.map(function(e){return e.isin}),switchedPage:r})}).finally(function(){o.pending=!1,r&&(window.location=e.url)})}},t.prototype.stockHovered=function(e){this.setState(function(){return{hovered:e}})},t.prototype.riskLevelUpdated=function(e){var t=this;this.state.loading||this.pending||(this.pending=!0,fetch("http://localhost:8080/api/user/"+this.props.user+"?portfolio="+this.props.portfolio,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({"risk-level":e})}).then(function(e){if(404===e.status)return Promise.reject("Could not update risk level!")}).then(function(){t.setState(function(){return{user:re({},t.state.user,{riskLevel:e})}}),t.pending=!1,t.refreshCachedData(t.props.user,t.props.portfolio)}).catch(function(n){t.pending=!1,t.setState(function(){return{error:{error:n,callback:function(){t.riskLevelUpdated(e)}}}})}))},t.prototype.render=function(e,t){var n=this,o=t.recommendation,r=t.error,i=t.loading;return r&&!i?Object(x.h)(Z,{error:r.error,refreshCallback:r.callback}):i?ie:Object(x.h)("div",{class:W.a["recommendation-container"]},Object(x.h)("div",{class:W.a["recommendation-container__table"]},Object(x.h)(G,{stocks:o,onStockClicked:this.stockClicked.bind(this),onStockHovered:this.stockHovered.bind(this)})),Object(x.h)(oe,{riskLevel:this.state.user?this.state.user.riskLevel:.03,onUpdate:function(e){return n.riskLevelUpdated(e)},class:W.a["recommendation-container"]}))},t}(x.Component),ce=(n("m+Gh"),M(ae)),se=ce.render;registerWOPlugin("SecuritiesRecommendationEngine",function(e){return C(document.getElementById(e),WOPluginInfoProvider.currentUserId(),WOPluginInfoProvider.currentPortfolioId())})},KM04:function(e){!function(){"use strict";function t(e,t){var n,o,r,i,a=U;for(i=arguments.length;i-- >2;)L.push(arguments[i]);for(t&&null!=t.children&&(L.length||L.push(t.children),delete t.children);L.length;)if((o=L.pop())&&void 0!==o.pop)for(i=o.length;i--;)L.push(o[i]);else"boolean"==typeof o&&(o=null),(r="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o+="":"string"!=typeof o&&(r=!1)),r&&n?a[a.length-1]+=o:a===U?a=[o]:a.push(o),n=r;var c=new E;return c.nodeName=e,c.children=a,c.attributes=null==t?void 0:t,c.key=null==t?void 0:t.key,void 0!==T.vnode&&T.vnode(c),c}function n(e,t){for(var n in t)e[n]=t[n];return e}function o(e,t){e&&("function"==typeof e?e(t):e.current=t)}function r(e,o){return t(e.nodeName,n(n({},e.attributes),o),arguments.length>2?[].slice.call(arguments,2):e.children)}function i(e){!e.__d&&(e.__d=!0)&&1==A.push(e)&&(T.debounceRendering||R)(a)}function a(){for(var e;e=A.pop();)e.__d&&k(e)}function c(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&s(e,t.nodeName):n||e._componentConstructor===t.nodeName}function s(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=n({},e.attributes);t.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var r in o)void 0===t[r]&&(t[r]=o[r]);return t}function u(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,n,r,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)o(n,null),o(r,e);else if("class"!==t||i)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var a in n)a in r||(e.style[a]="");for(var a in r)e.style[a]="number"==typeof r[a]&&!1===M.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var c=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,d,c):e.removeEventListener(t,d,c),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!i&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var s=i&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function d(e){return this.__l[e.type](T.event&&T.event(e)||e)}function h(){for(var e;e=W.shift();)T.afterMount&&T.afterMount(e),e.componentDidMount&&e.componentDidMount()}function _(e,t,n,o,r,i){H++||(D=null!=r&&void 0!==r.ownerSVGElement,F=null!=e&&!("__preactattr_"in e));var a=v(e,t,n,o,i);return r&&a.parentNode!==r&&r.appendChild(a),--H||(F=!1,i||h()),a}function v(e,t,n,o,r){var i=e,a=D;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0))),i.__preactattr_=!0,i;var c=t.nodeName;if("function"==typeof c)return C(e,t,n,o);if(D="svg"===c||"foreignObject"!==c&&D,c+="",(!e||!s(e,c))&&(i=u(c,D),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0)}var l=i.firstChild,f=i.__preactattr_,p=t.children;if(null==f){f=i.__preactattr_={};for(var d=i.attributes,h=d.length;h--;)f[d[h].name]=d[h].value}return!F&&p&&1===p.length&&"string"==typeof p[0]&&null!=l&&void 0!==l.splitText&&null==l.nextSibling?l.nodeValue!=p[0]&&(l.nodeValue=p[0]):(p&&p.length||null!=l)&&b(i,p,n,o,F||null!=f.dangerouslySetInnerHTML),g(i,t.attributes,f),D=a,i}function b(e,t,n,o,r){var i,a,s,l,u,p=e.childNodes,d=[],h={},_=0,b=0,y=p.length,g=0,j=t?t.length:0;if(0!==y)for(var w=0;w<y;w++){var O=p[w],k=O.__preactattr_,C=j&&k?O._component?O._component.__k:k.key:null;null!=C?(_++,h[C]=O):(k||(void 0!==O.splitText?!r||O.nodeValue.trim():r))&&(d[g++]=O)}if(0!==j)for(var w=0;w<j;w++){l=t[w],u=null;var C=l.key;if(null!=C)_&&void 0!==h[C]&&(u=h[C],h[C]=void 0,_--);else if(b<g)for(i=b;i<g;i++)if(void 0!==d[i]&&c(a=d[i],l,r)){u=a,d[i]=void 0,i===g-1&&g--,i===b&&b++;break}u=v(u,l,n,o),s=p[w],u&&u!==e&&u!==s&&(null==s?e.appendChild(u):u===s.nextSibling?f(s):e.insertBefore(u,s))}if(_)for(var w in h)void 0!==h[w]&&m(h[w],!1);for(;b<=g;)void 0!==(u=d[g--])&&m(u,!1)}function m(e,t){var n=e._component;n?x(n):(null!=e.__preactattr_&&o(e.__preactattr_.ref,null),!1!==t&&null!=e.__preactattr_||f(e),y(e))}function y(e){for(e=e.lastChild;e;){var t=e.previousSibling;m(e,!0),e=t}}function g(e,t,n){var o;for(o in n)t&&null!=t[o]||null==n[o]||p(e,o,n[o],n[o]=void 0,D);for(o in t)"children"===o||"innerHTML"===o||o in n&&t[o]===("value"===o||"checked"===o?e[o]:n[o])||p(e,o,n[o],n[o]=t[o],D)}function j(e,t,n){var o,r=V.length;for(e.prototype&&e.prototype.render?(o=new e(t,n),S.call(o,t,n)):(o=new S(t,n),o.constructor=e,o.render=w);r--;)if(V[r].constructor===e)return o.__b=V[r].__b,V.splice(r,1),o;return o}function w(e,t,n){return this.constructor(e,n)}function O(e,t,n,r,a){e.__x||(e.__x=!0,e.__r=t.ref,e.__k=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||a?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.__c||(e.__c=e.context),e.context=r),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===T.syncComponentUpdates&&e.base?i(e):k(e,1,a)),o(e.__r,e))}function k(e,t,o,r){if(!e.__x){var i,a,c,s=e.props,u=e.state,f=e.context,p=e.__p||s,d=e.__s||u,v=e.__c||f,b=e.base,y=e.__b,g=b||y,w=e._component,C=!1,S=v;if(e.constructor.getDerivedStateFromProps&&(u=n(n({},u),e.constructor.getDerivedStateFromProps(s,u)),e.state=u),b&&(e.props=p,e.state=d,e.context=v,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(s,u,f)?C=!0:e.componentWillUpdate&&e.componentWillUpdate(s,u,f),e.props=s,e.state=u,e.context=f),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!C){i=e.render(s,u,f),e.getChildContext&&(f=n(n({},f),e.getChildContext())),b&&e.getSnapshotBeforeUpdate&&(S=e.getSnapshotBeforeUpdate(p,d));var N,P,E=i&&i.nodeName;if("function"==typeof E){var L=l(i);a=w,a&&a.constructor===E&&L.key==a.__k?O(a,L,1,f,!1):(N=a,e._component=a=j(E,L,f),a.__b=a.__b||y,a.__u=e,O(a,L,0,f,!1),k(a,1,o,!0)),P=a.base}else c=g,N=w,N&&(c=e._component=null),(g||1===t)&&(c&&(c._component=null),P=_(c,i,f,o||!b,g&&g.parentNode,!0));if(g&&P!==g&&a!==w){var U=g.parentNode;U&&P!==U&&(U.replaceChild(P,g),N||(g._component=null,m(g,!1)))}if(N&&x(N),e.base=P,P&&!r){for(var R=e,M=e;M=M.__u;)(R=M).base=P;P._component=R,P._componentConstructor=R.constructor}}for(!b||o?W.push(e):C||(e.componentDidUpdate&&e.componentDidUpdate(p,d,S),T.afterUpdate&&T.afterUpdate(e));e.__h.length;)e.__h.pop().call(e);H||r||h()}}function C(e,t,n,o){for(var r=e&&e._component,i=r,a=e,c=r&&e._componentConstructor===t.nodeName,s=c,u=l(t);r&&!s&&(r=r.__u);)s=r.constructor===t.nodeName;return r&&s&&(!o||r._component)?(O(r,u,3,n,o),e=r.base):(i&&!c&&(x(i),e=a=null),r=j(t.nodeName,u,n),e&&!r.__b&&(r.__b=e,a=null),O(r,u,1,n,o),e=r.base,a&&e!==a&&(a._component=null,m(a,!1))),e}function x(e){T.beforeUnmount&&T.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?x(n):t&&(null!=t.__preactattr_&&o(t.__preactattr_.ref,null),e.__b=t,f(t),V.push(e),y(t)),o(e.__r,null)}function S(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{},this.__h=[]}function N(e,t,n){return _(n,e,{},!1,t,!1)}function P(){return{}}var E=function(){},T={},L=[],U=[],R="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,M=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,A=[],W=[],H=0,D=!1,F=!1,V=[];n(S.prototype,{setState:function(e,t){this.__s||(this.__s=this.state),this.state=n(n({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this.__h.push(t),i(this)},forceUpdate:function(e){e&&this.__h.push(e),k(this,2)},render:function(){}});var B={h:t,createElement:t,cloneElement:r,createRef:P,Component:S,render:N,rerender:a,options:T};e.exports=B}()},QACa:function(e){e.exports={"error-pane-background":"error-pane-background__37mwa","error-pane-dialog":"error-pane-dialog__2SORC","error-pane-dialog__button":"error-pane-dialog__button__2JGoq"}},QAmr:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise(function(n,o){function r(){var e,t=[],n=[],o={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(r,i,a){t.push(i=i.toLowerCase()),n.push([i,a]),e=o[i],o[i]=e?e+","+a:a}),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:r,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},headers:{keys:function(){return t},entries:function(){return n},get:function(e){return o[e.toLowerCase()]},has:function(e){return e.toLowerCase()in o}}}}var i=new XMLHttpRequest;i.open(t.method||"get",e,!0);for(var a in t.headers)i.setRequestHeader(a,t.headers[a]);i.withCredentials="include"==t.credentials,i.onload=function(){n(r())},i.onerror=o,i.send(t.body||null)})}},VS7n:function(e,t,n){e.exports=window.fetch||(window.fetch=n("QAmr").default||n("QAmr"))},VqBh:function(e){e.exports={"dialog-pane-background":"dialog-pane-background__21iQw","dialog-pane-dialog":"dialog-pane-dialog__2sOe0"}},"W/Rx":function(e){e.exports={"stock-table":"stock-table__3CwM0","stock-table-head":"stock-table-head__2c8SR","stock-table-body":"stock-table-body__2VWKg",selected:"selected__28K1j"}},cXSW:function(e){e.exports={positiveNumber:"positiveNumber__2R-IV",negativeNumber:"negativeNumber__s_ysA",highlighted:"highlighted__Ybwmp",small:"small__27Phi"}},h6ac:function(e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},"m+Gh":function(e,t,n){"use strict";(function(e){e.Promise||(e.Promise=n("BtxX")),e.fetch||(e.fetch=n("VS7n"))}).call(t,n("h6ac"))},pwNi:function(e,t,n){"use strict";var o=n("KM04"),r=function(e){return e&&e.default?e.default:e};if("function"==typeof r(n("JkW7"))){var i=document.body.firstElementChild,a=function(){var e=r(n("JkW7"));i=(0,o.render)((0,o.h)(e),document.body,i)};a()}},vsHu:function(e){e.exports={"recommendation-container":"recommendation-container__2xEJh","recommendation-container__table":"recommendation-container__table__Lb0RD"}}})});
//# sourceMappingURL=index.js.map