-
Notifications
You must be signed in to change notification settings - Fork 2
/
account.6bb334ece17d5cc31aea.js
2 lines (2 loc) · 351 KB
/
account.6bb334ece17d5cc31aea.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{1753:function(e,t,a){"use strict";a.d(t,"b",function(){return y}),a.d(t,"a",function(){return v});var n=a(0),s=a.n(n),r=a(1),o=a.n(r),i=a(5),l=a.n(i),c=a(35),u=a(23),p=a(22),m=a(14),d=a.n(m),h=a(2073),f=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function b(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 _(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)}var v=function(e){function t(){return b(this,t),g(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _(t,s.a.Component),f(t,[{key:"render",value:function(){var e=this.props,t=e.isActive,a=e.index,n=e.changeTab,r=e.title,o=e.className,i=e.updatedTab,c=e.disabled,u=e.subText,p=l()({"is-active":t},o);return"string"==typeof r&&r.indexOf(".")>0&&(r=d.a.translate(r)),this.props.collapsed?("string"==typeof u&&(u=u.trim()),s.a.createElement("option",{value:a,"data-is-link-to":this.props.isLinkTo},s.a.createElement("span",{className:"tab-title"},r,i?"*":"",u&&" (",u&&u,u&&")"))):s.a.createElement("li",{className:p,onClick:c?null:n.bind(this,a,this.props.isLinkTo)},s.a.createElement("a",null,s.a.createElement("span",{className:"tab-title"},r,i?"*":""),u&&s.a.createElement("div",{className:"tab-subtext"},u)))}}]),t}();v.propTypes={changeTab:o.a.func,isActive:o.a.bool.isRequired,index:o.a.number.isRequired,className:o.a.string,isLinkTo:o.a.string,subText:o.a.oneOfType([o.a.object,o.a.string])},v.defaultProps={isActive:!1,index:0,className:"",isLinkTo:"",subText:null};var y=function(e){function t(e){b(this,t);var a=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.state={activeTab:e.setting?e.viewSettings.get(e.setting,e.defaultActiveTab):e.defaultActiveTab,width:window.innerWidth},a._setDimensions=a._setDimensions.bind(a),a}return _(t,s.a.Component),f(t,[{key:"componentDidMount",value:function(){this._setDimensions(),window.addEventListener("resize",this._setDimensions,{capture:!1,passive:!0})}},{key:"componentWillReceiveProps",value:function(e){var t=e.viewSettings.get(e.setting);t!==this.props.viewSettings.get(this.props.setting)&&this.setState({activeTab:t})}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this._setDimensions)}},{key:"_setDimensions",value:function(){var e=window.innerWidth;e!==this.state.width&&this.setState({width:e})}},{key:"_changeTab",value:function(e,t){e!==this.state.activeTab&&(""!==t&&this.props.history.push(t),this.props.setting&&u.a.changeViewSetting(function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}({},this.props.setting,e)),this.setState({activeTab:e}),this.props.onChangeTab&&this.props.onChangeTab(e))}},{key:"render",value:function(){var e=this,t=this.props,a=t.children,n=t.contentClass,r=t.tabsClass,o=t.style,i=t.segmented,c=this.state.width<900&&s.a.Children.count(a)>2,u=null,p=s.a.Children.map(a,function(t,a){if(!t)return null;if(c&&t.props.disabled)return null;var n=a===e.state.activeTab;return n&&(u=t.props.children),s.a.cloneElement(t,{collapsed:c,isActive:n,changeTab:e._changeTab.bind(e),index:a})}).filter(function(e){return null!==e});return u||(u=p[0].props.children),s.a.createElement("div",{className:l()(this.props.actionButtons?"with-buttons":"",this.props.className)},s.a.createElement("div",{className:"service-selector"},s.a.createElement("ul",{style:o,className:l()("button-group no-margin",r,{segmented:i})},c?s.a.createElement("li",{style:{paddingLeft:10,paddingRight:10,minWidth:"15rem"}},s.a.createElement("select",{value:this.state.activeTab,style:{marginTop:10,marginBottom:10},className:"bts-select",onChange:function(t){var a=parseInt(t.target.value,10);e._changeTab(a,t.target[a].attributes["data-is-link-to"].value)}},p)):p,this.props.actionButtons?s.a.createElement("li",{className:"tabs-action-buttons"},this.props.actionButtons):null)),s.a.createElement("div",{className:l()("tab-content",n)},u))}}]),t}();y.propTypes={setting:o.a.string,defaultActiveTab:o.a.number,segmented:o.a.bool},y.defaultProps={active:0,defaultActiveTab:0,segmented:!0,contentClass:"",style:{}},y=Object(c.a)(y,{listenTo:function(){return[p.a]},getProps:function(){return{viewSettings:p.a.getState().viewSettings}}}),y=Object(h.a)(y)},1757:function(e,t,a){"use strict";var n=a(0),s=a.n(n),r=a(119),o=a(1),i=a.n(o),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},c=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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)}var d=function(e){function t(e){u(this,t);var a=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={imgError:!1},a}return m(t,s.a.Component),c(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.asset!==e.asset||this.props.maxWidth!==e.maxWidth||this.props.whiteList!==e.whiteList||this.state.imgError!==t.imgError}},{key:"_onError",value:function(e){this.state.imgError||(this.props.replaceNoneToBts?this.refs[e.toLowerCase()].src="asset-symbols/bts.png":this.refs[e.toLowerCase()].remove(),this.setState({imgError:!0}))}},{key:"render",value:function(){var e=function(e){return e.get("symbol")}(this.props.asset);return s.a.createElement("img",{ref:e.toLowerCase(),className:"column-hide-small",onError:this._onError.bind(this,e),style:{maxWidth:this.props.maxWidth,marginRight:5},src:"asset-symbols/"+e.toLowerCase()+".png"})}}]),t}();d.propTypes={replaceNoneToBts:i.a.bool,maxWidth:i.a.number},d.defaultProps={replaceNoneToBts:!0,maxWidth:20},d=Object(r.a)(d);var h=function(e){function t(){return u(this,t),p(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return m(t,s.a.Component),c(t,[{key:"render",value:function(){return s.a.createElement(d,l({},this.props,{asset:this.props.name}))}}]),t}();t.a=h},1770:function(e,t,a){"use strict";a.d(t,"b",function(){return x}),a.d(t,"a",function(){return S});var n=a(0),s=a.n(n),r=a(32),o=a(39),i=a(48),l=a(119),c=a(16),u=a(35),p=a(251),m=a(3),d=a.n(m),h=a(14),f=a.n(h),b=a(105),g=a.n(b),_=a(536),v=a(59),y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},E=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function w(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(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 C(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)}var O=function(e){function t(e){return k(this,t),A(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return C(t,_["a"]),E(t,[{key:"componentDidMount",value:function(){g.a.rebuild()}},{key:"shouldComponentUpdate",value:function(e){return function e(t,a,n){null===t&&(t=Function.prototype);var s=Object.getOwnPropertyDescriptor(t,a);if(void 0===s){var r=Object.getPrototypeOf(t);return null===r?void 0:e(r,a,n)}if("value"in s)return s.value;var o=s.get;return void 0!==o?o.call(n):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldComponentUpdate",this).call(this,e)||!c.a.are_equal_shallow(e.pulsate,this.props.pulsate)||e.toAsset!==this.props.toAsset||e.fromAsset!==this.props.fromAsset||e.amount!==this.props.amount}},{key:"getValue",value:function(){var e=this.props,t=e.amount,a=e.toAsset,n=e.fromAsset,s=e.fullPrecision,r=e.allMarketStats,o=e.coreAsset;return v.a.convertValue(t,a,n,r,o,s)}},{key:"render",value:function(){var e=this.props,t=e.amount,a=e.toAsset,n=e.fromAsset,o=e.fullPrecision,i=w(e,["amount","toAsset","fromAsset","fullPrecision"]),l=a.get("id"),u=a.get("symbol");o||(t=c.a.get_asset_amount(t,n));var p=this.getValue();return p||0===p?s.a.createElement(r.a,y({noPrefix:!0,amount:p,asset:l,decimalOffset:-1!==u.indexOf("BTC")?4:this.props.fullDecimals?0:this.props.noDecimals?a.get("precision"):a.get("precision")-2},i)):s.a.createElement("div",{className:"tooltip inline-block","data-place":"bottom","data-tip":f.a.translate("tooltip.no_price"),style:{fontSize:"0.9rem"}},s.a.createElement(d.a,{content:"account.no_price"}))}}]),t}();O.defaultProps={fullPrecision:!0,noDecimals:!1,fullDecimals:!1,hide_asset:!1},O=Object(l.a)(O,{propNames:["toAsset","fromAsset","coreAsset"],defaultProps:{toAsset:"1.3.0",coreAsset:"1.3.0"}});var x=function(e){function t(){return k(this,t),A(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return C(t,s.a.Component),E(t,[{key:"render",value:function(){var e=this.props,t=e.refCallback,a=w(e,["refCallback"]);return s.a.createElement(O,y({},a,{ref:t}))}}]),t}();x=Object(u.a)(x,{listenTo:function(){return[p.a]},getProps:function(){return{allMarketStats:p.a.getState().allMarketStats}}});var S=function(e){function t(){return k(this,t),A(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return C(t,s.a.Component),E(t,[{key:"render",value:function(){var e=this.props,t=e.balance,a=w(e,["balance"]),n=!!t.getIn(["balance","amount"]),r=Number(n?t.getIn(["balance","amount"]):t.get("balance")),o=n?t.getIn(["balance","asset_id"]):t.get("asset_type");return isNaN(r)?s.a.createElement("span",null,"--"):s.a.createElement(x,y({amount:r,fromAsset:o,noDecimals:!0},a))}}]),t}();S.propTypes={balance:o.a.ChainObject.isRequired},S=Object(i.a)(S,{keep_updating:!0})},1777:function(e,t,a){"use strict";var n=a(0),s=a.n(n),r=a(16),o=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return 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)}(t,s.a.Component),o(t,[{key:"render",value:function(){var e=this.props,t=e.price,a=e.preFormattedPrice,n=e.quote,o=e.base;if(!t&&!a)return null;var i=a||r.a.price_to_text(t,n,o);return i.full>=1?s.a.createElement("span",null,s.a.createElement("span",{className:"price-integer"},i.int,"."),i.dec?s.a.createElement("span",{className:"price-integer"},i.dec):null,i.trailing?s.a.createElement("span",{className:"price-decimal"},i.trailing):null):i.full>=.1?s.a.createElement("span",null,s.a.createElement("span",{className:"price-decimal"},i.int,"."),i.dec?s.a.createElement("span",{className:"price-integer"},i.dec):null,i.trailing?s.a.createElement("span",{className:"price-decimal"},i.trailing):null):s.a.createElement("span",null,s.a.createElement("span",{className:"price-decimal"},i.int,"."),i.dec?s.a.createElement("span",{className:"price-decimal"},i.dec):null,i.trailing?s.a.createElement("span",{className:"price-integer"},i.trailing):null)}}]),t}();t.a=i},1778:function(e,t,a){"use strict";var n=a(0),s=a.n(n),r=a(3),o=a.n(r),i=a(10),l=a(39),c=a(48),u=a(14),p=a.n(u),m=a(335),d=a(32),h=a(11),f=a.n(h),b=a(5),g=a.n(b),_=a(119),v=a(1),y=a.n(v),E=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(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 A(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)}var C=function(e){function t(){return w(this,t),k(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return A(t,s.a.Component),E(t,[{key:"render",value:function(){return 0!==this.props.assets.length&&this.props.value?s.a.createElement(m.a,{entries:this.props.assets.map(function(e){return e&&e.get("symbol")}).filter(function(e){return!!e}),values:this.props.assets.reduce(function(e,t){return t&&t.get("symbol")&&(e[t.get("symbol")]=t),e},{}),singleEntry:this.props.assets[0]?s.a.createElement(d.a,{asset:this.props.assets[0].get("id"),amount:0,hide_amount:!0}):null,value:"",onChange:this.props.onChange}):null}}]),t}();C.propTypes={value:y.a.string,onChange:y.a.func},C=Object(_.a)(C,{asList:!0});var O=function(e){function t(){return w(this,t),k(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return A(t,s.a.Component),E(t,[{key:"getAsset",value:function(){return this.props.asset}},{key:"getError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.assetInput,t=this.props.error;return t||!e||this.getNameType(e)||(t=p.a.translate("explorer.asset.invalid",{name:e})),t}},{key:"getNameType",value:function(e){return e?i.ChainValidation.is_valid_symbol_error(e,!0)?null:"symbol":null}},{key:"onInputChanged",value:function(e){var t=e.target.value.trim().substr(0,16).toUpperCase();this.props.onChange&&t!==this.props.assetInput&&this.props.onChange(t)}},{key:"onKeyDown",value:function(e){13===e.keyCode&&(this.onFound(e),this.onAction(e))}},{key:"componentDidMount",value:function(){this.props.onFound&&this.props.asset&&this.props.onFound(this.props.asset)}},{key:"componentWillReceiveProps",value:function(e){this.props.onFound&&e.asset!==this.props.asset&&this.props.onFound(e.asset)}},{key:"onFound",value:function(e){e.preventDefault(),!this.props.onFound||this.getError()||this.props.disableActionButton||this.props.asset&&this.props.onFound(this.props.asset)}},{key:"onAssetSelect",value:function(e){e&&(this.props.onFound(e),this.props.onChange(e.get("symbol")))}},{key:"onAction",value:function(e){e.preventDefault(),!this.props.onAction||this.getError()||this.props.disableActionButton||this.props.asset&&this.props.onAction(this.props.asset)}},{key:"render",value:function(){var e=this.props,t=e.disabled,a=e.noLabel,n=this.getError(),r=void 0;t||(this.props.asset?r=this.props.asset.get("symbol"):!n&&this.props.assetInput&&(n=p.a.translate("explorer.asset.not_found",{name:this.props.assetInput})));var i=g()("button",{disabled:!this.props.asset||n||this.props.disableActionButton});return s.a.createElement("div",{className:"asset-selector",style:this.props.style},s.a.createElement("div",null,s.a.createElement("div",{className:"header-area"},n||a?null:s.a.createElement("label",{className:"right-label"}," ",s.a.createElement("span",null,r)),s.a.createElement(o.a,{component:"label",content:this.props.label})),s.a.createElement("div",{className:"input-area"},s.a.createElement("div",{className:"inline-label input-wrapper"},s.a.createElement("input",{style:this.props.inputStyle,disabled:this.props.disabled,type:"text",value:this.props.assetInput||"",placeholder:this.props.placeholder||p.a.translate("explorer.assets.symbol"),ref:"user_input",onChange:this.onInputChanged.bind(this),onKeyDown:this.onKeyDown.bind(this),tabIndex:this.props.tabIndex}),s.a.createElement("div",{className:"form-label select floating-dropdown"},this.props.asset?s.a.createElement(C,{ref:this.props.refCallback,value:this.props.asset.get("symbol"),assets:f.a.List(this.props.assets),onChange:this.onAssetSelect.bind(this)}):null),this.props.children,this.props.onAction?s.a.createElement("button",{className:i,onClick:this.onAction.bind(this)},s.a.createElement(o.a,{content:this.props.action_label})):null)),s.a.createElement("div",{className:"error-area",style:{paddingBottom:"10px"}},s.a.createElement("span",{style:{wordBreak:"break-all"}},n))))}}]),t}();O.propTypes={label:y.a.string,error:y.a.string,placeholder:y.a.string,onChange:y.a.func,onFound:y.a.func,assetInput:y.a.string,asset:l.a.ChainAsset,tabIndex:y.a.number,disableActionButton:y.a.bool},O.defaultProps={disabled:!1},t.a=Object(c.a)(O)},1789:function(e,t,a){"use strict";a.d(t,"a",function(){return v}),a.d(t,"b",function(){return g});var n=a(0),s=a.n(n),r=a(119),o=a(5),i=a.n(o),l=a(251),c=a(35),u=a(16),p=a(143),m=a(59),d=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function h(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 b(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)}var g=function(e){function t(e){h(this,t);var a=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));a.statsInterval=null;var n=m.a.getMarketName(e.base,e.quote).marketName;return a.state={marketName:n},a}return b(t,s.a.Component),d(t,[{key:"_checkStats",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{close:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{close:{}};return e.volumeBase!==t.volumeBase||!u.a.are_equal_shallow(e.close&&e.close.base,t.close&&t.close.base)||!u.a.are_equal_shallow(e.close&&e.close.quote,t.close&&t.close.quote)}},{key:"shouldComponentUpdate",value:function(e){return this._checkStats(e.allMarketStats.get(this.state.marketName),this.props.allMarketStats.get(this.state.marketName))||e.base.get("id")!==this.props.base.get("id")||e.quote.get("id")!==this.props.quote.get("id")}},{key:"componentWillUnmount",value:function(){this.statsInterval&&this.statsInterval()}}]),t}(),_=function(e){function t(e){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return b(t,g),d(t,[{key:"shouldComponentUpdate",value:function(e){return function e(t,a,n){null===t&&(t=Function.prototype);var s=Object.getOwnPropertyDescriptor(t,a);if(void 0===s){var r=Object.getPrototypeOf(t);return null===r?void 0:e(r,a,n)}if("value"in s)return s.value;var o=s.get;return void 0!==o?o.call(n):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldComponentUpdate",this).call(this,e)}},{key:"render",value:function(){var e=this.props.allMarketStats,t=this.state.marketName,a=e.get(t),n=a&&a.price?a.price:null;return s.a.createElement("span",{className:i()("",this.props.className)},n?s.a.createElement(p.a,{base_amount:n.base.amount,base_asset:n.base.asset_id,quote_amount:n.quote.amount,quote_asset:n.quote.asset_id,force_direction:this.props.force_direction,hide_symbols:this.props.hide_symbols}):"n/a")}}]),t}();_=Object(r.a)(_,{propNames:["quote","base"]});var v=function(e){function t(){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return b(t,s.a.Component),d(t,[{key:"render",value:function(){return s.a.createElement(_,this.props)}}]),t}();v=Object(c.a)(v,{listenTo:function(){return[l.a]},getProps:function(){return{allMarketStats:l.a.getState().allMarketStats}}})},1791:function(e,t,a){"use strict";var n=a(1803),s=a(0),r=a.n(s),o=a(1),i=a.n(o),l=a(42),c=a.n(l),u=a(104),p=a(252),m=a.n(p),d=a(3),h=a.n(d),f=a(39),b=a(105),g=a.n(b),_=a(48),v=a(32),y=a(16),E=a(5),w=a.n(E),k=a(304),A=a(332),C=a(100),O=a(19),x=a(143),S=a(14),N=a.n(S),j=a(526),P=a(11),T=a.n(P),I=a(10),R=a(21),q=a(69),M=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(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 F(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)}var L=function(e){function t(e){B(this,t);var a=D(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.state=a._initialState(e),a}return F(t,r.a.Component),M(t,[{key:"_initialState",value:function(e){var t=e?this._getCurrentPosition(e):{};if(t.collateral){var a=y.a.get_asset_amount(t.debt,e.quote_asset),n=y.a.get_asset_amount(t.collateral,e.backing_asset),s=isNaN(t.target_collateral_ratio)?0:t.target_collateral_ratio/1e3;return{short_amount:a?a.toString():null,collateral:n?n.toString():null,collateral_ratio:this._getCollateralRatio(a,n),target_collateral_ratio:s,errors:this._getInitialErrors(),isValid:!1,useTargetCollateral:s>0,original_position:{debt:a,collateral:n,target_collateral_ratio:s}}}return{short_amount:0,collateral:0,collateral_ratio:this._getInitialCollateralRatio(e),target_collateral_ratio:0,errors:this._getInitialErrors(),isValid:!1,useTargetCollateral:!1,original_position:{debt:0,collateral:0}}}},{key:"componentDidUpdate",value:function(){g.a.rebuild()}},{key:"componentDidMount",value:function(){var e=this._initialState(this.props);this.setState(e),this._setUpdatedPosition(e)}},{key:"shouldComponentUpdate",value:function(e,t){return!(y.a.are_equal_shallow(t,this.state)&&T.a.is(e.quote_asset,this.props.quote_asset)&&!e.backing_asset.get("symbol")!==this.props.backing_asset.get("symbol")&&T.a.is(e.account,this.props.account)&&T.a.is(e.call_orders,this.props.call_orders))}},{key:"componentWillReceiveProps",value:function(e){var t=this.state,a=t.short_amount,n=t.collateral,s=t.collateral_ratio;if(e.account!==this.props.account||e.hasCallOrders!==this.props.hasCallOrders||e.quote_asset.get("id")!==this.props.quote_asset.get("id")){var r=this._initialState(e),o=!1;(a||n||s)&&(r.short_amount=a,r.collateral=n,r.collateral_ratio=s,o=!0),this.setState(r),o&&this._validateFields(r)}}},{key:"_getInitialErrors",value:function(){return{collateral_balance:null,ratio_too_high:null}}},{key:"_getMaintenanceRatio",value:function(){return this.props.quote_asset.getIn(["bitasset","current_feed","maintenance_collateral_ratio"])/1e3}},{key:"confirmClicked",value:function(e){e.preventDefault(),c.a.publish(this.props.modalId,"close")}},{key:"toggleLockedCR",value:function(e){e.preventDefault(),this.setState({lockedCR:!this.state.lockedCR})}},{key:"_onBorrowChange",value:function(e){var t=this._getFeedPrice(),a=e.amount.replace(/,/g,""),n={short_amount:a,collateral:(this.state.collateral_ratio*(a/t)).toFixed(this.props.backing_asset.get("precision")),collateral_ratio:this.state.collateral_ratio};this.setState(n),this._validateFields(n),this._setUpdatedPosition(n)}},{key:"_onCollateralChange",value:function(e){var t=e.amount.replace(/,/g,""),a=this._getFeedPrice(),s=t/(this.state.short_amount/a),r=this._isPredictionMarket(this.props)?{short_amount:t,collateral:t,collateral_ratio:1}:{short_amount:this.state.short_amount,collateral:t,collateral_ratio:Object(n.a)(s)?s:this._getInitialCollateralRatio(this.props)};this.setState(r),this._validateFields(r),this._setUpdatedPosition(r)}},{key:"_onTargetRatioChange",value:function(e){var t=e.target;new RegExp(/[[:digit:]]/).test(t.value)||(t.value=t.value.replace(/[^0-9.]/g,""));var a=t.value;this.setState({target_collateral_ratio:a})}},{key:"_onRatioChange",value:function(e){var t=this._getFeedPrice(),a=e.target;new RegExp(/[[:digit:]]/).test(a.value)||(a.value=a.value.replace(/[^0-9.]/g,""));var n=a.value,s=void 0,r=void 0;this.state.lockedCR?(s=(this.state.collateral*t/n).toFixed(this.props.backing_asset.get("precision")),r=this.state.collateral):(s=this.state.short_amount,r=(this.state.short_amount/t*n).toFixed(this.props.backing_asset.get("precision")));var o={short_amount:s,collateral:r,collateral_ratio:n};this.setState(o),this._validateFields(o),this._setUpdatedPosition(o)}},{key:"_maximizeCollateral",value:function(){var e=this.props?this._getCurrentPosition(this.props):{},t=0;e.collateral&&(t=y.a.get_asset_amount(e.collateral,this.props.backing_asset));var a=Math.floor(Math.min(this.props.backing_balance.get("balance")/y.a.get_asset_precision(this.props.backing_asset)+t-10,this.state.short_amount/this._getFeedPrice()*1e3));this._onCollateralChange(new Object({amount:a.toString()}))}},{key:"_maximizeDebt",value:function(){var e=this.props?this._getCurrentPosition(this.props):{},t=0;e.collateral&&(t=y.a.get_asset_amount(e.collateral,this.props.backing_asset));var a=this.props.backing_balance.get("balance")/y.a.get_asset_precision(this.props.backing_asset)+t-10,n={short_amount:a/this.state.collateral_ratio*this._getFeedPrice(),collateral:a,collateral_ratio:this.state.collateral_ratio};this.setState(n),this._validateFields(n),this._setUpdatedPosition(n)}},{key:"_payDebt",value:function(){var e=this.props?this._getCurrentPosition(this.props):{debt:0};if(!(e.debt<=0)){var t=y.a.get_asset_amount(Math.max(e.debt-this.props.bitasset_balance.get("balance"),0),this.props.quote_asset);this._onBorrowChange({amount:t.toString()})}}},{key:"_setUpdatedPosition",value:function(e){this.setState({newPosition:parseFloat(e.short_amount)/parseFloat(e.collateral)})}},{key:"_validateFields",value:function(e){var t=this._getInitialErrors(),a=this.state.original_position,n=this.props.backing_balance?this.props.backing_balance.toJS():{balance:0},s=this._getMaintenanceRatio(),r=this._getCollateralRatio(a.debt,a.collateral),o=a.collateral>0&&r<s;parseFloat(e.collateral)-a.collateral>y.a.get_asset_amount(n.balance,this.props.backing_asset.toJS())&&(t.collateral_balance=N.a.translate("borrow.errors.collateral")),o&&e.short_amount>a.debt?t.below_maintenance=N.a.translate("borrow.errors.increased_debt_on_margin_call"):o&&parseFloat(e.collateral_ratio)<=parseFloat(r)?t.below_maintenance=N.a.translate("borrow.errors.below_ratio_mcr_update",{ocr:r.toFixed(4)}):!o&&parseFloat(e.collateral_ratio)<(this._isPredictionMarket(this.props)?1:s)?t.below_maintenance=N.a.translate("borrow.errors.below",{mr:s}):parseFloat(e.collateral_ratio)<(this._isPredictionMarket(this.props)?1:s+.5)&&(t.close_maintenance=N.a.translate("borrow.errors.close",{mr:s})),this.setState({errors:t})}},{key:"_onSubmit",value:function(e){e.preventDefault();var t=y.a.get_asset_precision(this.props.quote_asset.get("precision")),a=y.a.get_asset_precision(this.props.backing_asset.get("precision")),n=this._getCurrentPosition(this.props),s=!1;!!(void 0!==this.state.target_collateral_ratio&&this.state.target_collateral_ratio>0&&this.state.useTargetCollateral)&&(s={target_collateral_ratio:parseInt(1e3*this.state.target_collateral_ratio,10)});var r=C.a.new_transaction();s?r.add_type_operation("call_order_update",{fee:{amount:0,asset_id:0},funding_account:this.props.account.get("id"),delta_collateral:{amount:parseInt(this.state.collateral*a-n.collateral,10),asset_id:this.props.backing_asset.get("id")},delta_debt:{amount:parseInt(this.state.short_amount*t-n.debt,10),asset_id:this.props.quote_asset.get("id")},extensions:s}):r.add_type_operation("call_order_update",{fee:{amount:0,asset_id:0},funding_account:this.props.account.get("id"),delta_collateral:{amount:parseInt(this.state.collateral*a-n.collateral,10),asset_id:this.props.backing_asset.get("id")},delta_debt:{amount:parseInt(this.state.short_amount*t-n.debt,10),asset_id:this.props.quote_asset.get("id")}}),O.a.process_transaction(r,null,!0).catch(function(e){}),c.a.publish(this.props.modalId,"close")}},{key:"_getCurrentPosition",value:function(e){var t={collateral:null,debt:null};return e&&e.hasCallOrders&&e.call_orders&&(t=(t=e.call_orders.filter(function(e){return!!e}).find(function(t){return t.getIn(["call_price","quote","asset_id"])===e.quote_asset.get("id")}))?t.toJS():{collateral:null,debt:null}),t}},{key:"_getFeedPrice",value:function(){return this.props?this._isPredictionMarket(this.props)?1:1/y.a.get_asset_price(this.props.quote_asset.getIn(["bitasset","current_feed","settlement_price","quote","amount"]),this.props.backing_asset,this.props.quote_asset.getIn(["bitasset","current_feed","settlement_price","base","amount"]),this.props.quote_asset):1}},{key:"_getInitialCollateralRatio",value:function(e){return this._isPredictionMarket(e)?1:0}},{key:"_getCollateralRatio",value:function(e,t){return t/(e/this._getFeedPrice())}},{key:"_isPredictionMarket",value:function(e){return e.quote_asset.getIn(["bitasset","is_prediction_market"])}},{key:"_setUseTargetCollateral",value:function(){this.setState({useTargetCollateral:!this.state.useTargetCollateral})}},{key:"render",value:function(){var e=this,t=this.props,a=t.quote_asset,n=t.bitasset_balance,s=t.backing_asset,o=t.backing_balance,i=this.state,l=i.short_amount,c=i.collateral,u=i.collateral_ratio,p=i.target_collateral_ratio,d=i.errors,f=i.original_position,b=i.useTargetCollateral,g=y.a.get_asset_precision(this.props.quote_asset.get("precision")),_=y.a.get_asset_precision(this.props.backing_asset.get("precision"));u&&!isNaN(u)&&u>0&&u<1e3||(u=0),n=n?n.toJS():{balance:0,id:null},o=o?o.toJS():{balance:0,id:null};var E=w()("form-group",{"has-error":d.collateral_balance}),C=w()("form-group",{"has-error":d.below_maintenance},{"has-warning":d.close_maintenance}),O=this._getCurrentPosition(this.props),S=o.id?I.ChainStore.getObject(o.id):null,P=(S?S.get("balance"):0)-parseInt(this.state.collateral*_-O.collateral,10),T=r.a.createElement("span",null,r.a.createElement("span",null,r.a.createElement(h.a,{component:"span",content:"transfer.available"}),":"," ",n.id?r.a.createElement(A.a,{balance:n.id}):r.a.createElement(v.a,{amount:0,asset:a.get("id")})),r.a.createElement("a",{onClick:this._payDebt.bind(this)},r.a.createElement(h.a,{content:"borrow.pay_max_debt"})),"|",0!=u?r.a.createElement("a",{onClick:this._maximizeDebt.bind(this)},r.a.createElement(h.a,{content:"borrow.use_max"})):r.a.createElement("span",{className:"disabled-link","data-place":"left","data-tip":N.a.translate("borrow.maximize_debt_set_ratio_slider")},r.a.createElement(h.a,{content:"borrow.use_max"}))),M=r.a.createElement("span",null,r.a.createElement("span",null,r.a.createElement(h.a,{component:"span",content:"transfer.available"}),":"," ",o.id?r.a.createElement(v.a,{amount:P,asset:s.get("id")}):r.a.createElement(v.a,{amount:0,asset:s.get("id")})),r.a.createElement("a",{onClick:this._maximizeCollateral.bind(this)},r.a.createElement(h.a,{content:"borrow.use_max"}))),B=this._getFeedPrice(),D=this._getMaintenanceRatio(),F=(this.props.quote_asset.getIn(["bitasset","current_feed","maximum_short_squeeze_ratio"]),this._isPredictionMarket(this.props)),L=f.collateral>0&&this._getCollateralRatio(f.debt,f.collateral)<D;return!F&&isNaN(B)?r.a.createElement("div",null,r.a.createElement("form",{className:"grid-container text-center no-overflow",noValidate:!0},r.a.createElement(h.a,{component:"h3",content:"borrow.no_valid",asset_symbol:a.get("symbol")})),r.a.createElement("div",{className:"grid-content button-group text-center no-overflow"},r.a.createElement(m.a,{close:this.props.modalId},r.a.createElement("div",{className:" button warning"},r.a.createElement(h.a,{content:"account.perm.cancel"}))))):r.a.createElement("div",null,r.a.createElement("form",{className:"grid-container small-10 small-offset-1 no-overflow",noValidate:!0},r.a.createElement(h.a,{component:"h3",content:"borrow.title",asset_symbol:a.get("symbol")}),r.a.createElement("div",{style:{textAlign:"left"}},this.props.hide_help?null:r.a.createElement(j.a,{path:"components/"+(F?"BorrowModalPrediction":"BorrowModal"),debt:a.get("symbol"),collateral:s.get("symbol"),borrower:this.props.account.get("name"),mr:D}),L?r.a.createElement(h.a,{component:"h6",className:"has-warning",content:"borrow.errors.below_info"}):null,F?null:r.a.createElement("div",{style:{paddingTop:"1rem",paddingBottom:"1rem"}},r.a.createElement("div",{className:"borrow-price-feeds"},r.a.createElement("span",{className:"borrow-price-label"},r.a.createElement(h.a,{content:"transaction.feed_price"}),": "),r.a.createElement(x.a,{noPopOver:!0,quote_amount:a.getIn(["bitasset","current_feed","settlement_price","base","amount"]),quote_asset:a.getIn(["bitasset","current_feed","settlement_price","base","asset_id"]),base_asset:a.getIn(["bitasset","current_feed","settlement_price","quote","asset_id"]),base_amount:a.getIn(["bitasset","current_feed","settlement_price","quote","amount"])})),r.a.createElement("b",null),r.a.createElement("div",{className:"borrow-price-final "+(d.below_maintenance?"has-error":d.close_maintenance?"has-warning":"")},r.a.createElement("span",{className:"borrow-price-label"},r.a.createElement(h.a,{content:"exchange.your_price"}),": "),this.state.newPosition?r.a.createElement(x.a,{noPopOver:!0,quote_amount:D*this.state.short_amount*g,quote_asset:a.get("id"),base_asset:s.get("id"),base_amount:this.state.collateral*_}):null)),r.a.createElement("div",{className:"form-group"},r.a.createElement("span",{style:{position:"absolute",left:20}},r.a.createElement(R.a,{onClick:this.toggleLockedCR.bind(this),name:this.state.lockedCR?"unlocked":"locked",size:"1_5x",style:{position:"relative",top:-10}})),r.a.createElement(k.a,{label:"transaction.borrow_amount",amount:l.toString(),onChange:this._onBorrowChange.bind(this),asset:a.get("id"),assets:[a.get("id")],display_balance:T,placeholder:"0.0",tabIndex:1})),r.a.createElement("div",{className:E},r.a.createElement("span",{style:{position:"absolute",left:20}},r.a.createElement(R.a,{onClick:this.toggleLockedCR.bind(this),name:this.state.lockedCR?"locked":"unlocked",size:"1_5x",style:{position:"relative",top:-10}})),r.a.createElement(k.a,{label:"transaction.collateral",amount:c.toString(),onChange:this._onCollateralChange.bind(this),asset:s.get("id"),assets:[s.get("id")],display_balance:M,placeholder:"0.0",tabIndex:1}),d.collateral_balance?r.a.createElement("div",{className:"float-left",style:{paddingTop:5}},d.collateral_balance):null),F?null:r.a.createElement("div",null,r.a.createElement("div",{className:C,style:{marginBottom:"3.5rem"}},r.a.createElement(h.a,{component:"label",content:"borrow.coll_ratio"}),r.a.createElement("span",null,r.a.createElement("input",{value:0==u?"":u,onChange:this._onRatioChange.bind(this),type:"text",style:{width:"12%",float:"right",marginTop:-10}}),r.a.createElement("input",{style:{width:"85%"},min:"0",max:"6",step:"0.01",onChange:this._onRatioChange.bind(this),value:u,type:"range"})),d.below_maintenance||d.close_maintenance?r.a.createElement("div",{style:{height:"1em",maxWidth:"85%"},className:"float-left"},d.below_maintenance,d.close_maintenance):null),r.a.createElement("div",{className:"form-group",style:{marginBottom:"3.5rem"}},r.a.createElement("span",null,r.a.createElement("label",null,r.a.createElement(h.a,{content:"borrow.target_collateral_ratio"})," ",r.a.createElement("span",{"data-place":"top","data-html":!0,"data-tip":N.a.translate("tooltip.target_collateral_ratio")},r.a.createElement(R.a,{name:"question-circle",title:"icons.question_circle"}))),b?r.a.createElement("span",null,r.a.createElement("div",{style:{marginBottom:"1em"}},r.a.createElement(q.Checkbox,{onClick:this._setUseTargetCollateral.bind(this),checked:!0},r.a.createElement(h.a,{content:"borrow.enable_target_collateral_ratio"}))),r.a.createElement("span",null,r.a.createElement("input",{value:isNaN(p)?"0":p,onChange:this._onTargetRatioChange.bind(this),type:"text",style:{float:"right",marginTop:-10,width:"12%"}}),r.a.createElement("input",{style:{width:"85%"},min:"0",max:"6",step:"0.01",onChange:this._onTargetRatioChange.bind(this),value:isNaN(p)?"0":p,type:"range"}))):r.a.createElement("div",{style:{marginBottom:"1em"}},r.a.createElement(q.Checkbox,{onClick:this._setUseTargetCollateral.bind(this)},r.a.createElement(h.a,{content:"borrow.enable_target_collateral_ratio"})))))),r.a.createElement("div",{className:"no-padding grid-content button-group no-overflow"},r.a.createElement("div",{onClick:this._onSubmit.bind(this),className:w()("button")},r.a.createElement(h.a,{content:"borrow.adjust"})),r.a.createElement("div",{onClick:function(t){t.preventDefault(),e.setState(e._initialState(e.props))},className:"button hollow primary"},r.a.createElement(h.a,{content:"wallet.reset"}))))))}}]),t}();L.propTypes={quote_asset:f.a.ChainAsset.isRequired,bitasset_balance:f.a.ChainObject,backing_asset:f.a.ChainAsset.isRequired,backing_balance:f.a.ChainObject,call_orders:f.a.ChainObjectsList,hasCallOrders:i.a.bool},L=Object(_.a)(L);var V=function(e){function t(){B(this,t);var e=D(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={smallScreen:!1,open:!1},e}return F(t,r.a.Component),M(t,[{key:"show",value:function(){var e=this;this.setState({open:!0},function(){c.a.publish(e.props.modalId,"open")})}},{key:"onClose",value:function(){this.setState({open:!1})}},{key:"componentWillMount",value:function(){this.setState({smallScreen:window.innerHeight<=800})}},{key:"render",value:function(){var e=this.props,t=e.quote_asset,a=e.backing_asset,n=e.account,s=n.get("balances").toJS(),o=void 0,i=void 0;if(s)for(var l in s)l===a&&(o=s[l]),l===t&&(i=s[l]);return this.state.open?r.a.createElement(u.a,{id:this.props.modalId,overlay:!0,onClose:this.onClose.bind(this),ref:this.props.modalId},r.a.createElement("div",{className:"grid-block vertical"},r.a.createElement(L,{quote_asset:t,call_orders:n.get("call_orders",Object(P.List)()).toList(),hasCallOrders:n.get("call_orders")&&n.get("call_orders").size>0,modalId:this.props.modalId,bitasset_balance:i,backing_balance:o,backing_asset:a,hide_help:this.state.smallScreen,account:n}))):null}}]),t}();t.a=V},1799:function(e,t,a){"use strict";(function(e){var n=a(305),s=a(0),r=a.n(s),o=a(42),i=a.n(o),l=a(104),c=a(3),u=a.n(c),p=a(28),m=a(16),d=a(48),h=a(39),f=a(47),b=a(105),g=a.n(b),_=a(14),v=a.n(_),y=a(78),E=a(308),w=a(21),k=a(41),A=a(142),C=a(140),O=a(10),x=a(337),S=a(43),N=a(37),j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},P=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(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 R(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)}var q=function(t){function a(e){T(this,a);var t=I(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return t.state={toAddress:y.a.getLast(e.walletType),withdrawValue:"",amountError:null,symbol:e.asset.get("symbol"),to_withdraw:new p.a({asset_id:e.asset.get("id"),precision:e.asset.get("precision")}),fee_asset_id:"1.3.0",feeStatus:{},loading:!1,emptyAddressDeposit:!1},t._validateAddress(t.state.toAddress,e),t.addDepositAddress=t.addDepositAddress.bind(t),t._checkFeeStatus=t._checkFeeStatus.bind(t),t._checkBalance=t._checkBalance.bind(t),t._getCurrentBalance=t._getCurrentBalance.bind(t),t._getFee=t._getFee.bind(t),t._updateFee=Object(n.a)(t._updateFee.bind(t),250),t}return R(a,x["a"]),P(a,[{key:"componentWillMount",value:function(){this._getDepositAddress(),this._updateFee(),this._checkFeeStatus()}},{key:"componentWillReceiveProps",value:function(e){e.asset&&this.props.asset&&e.asset.get("id")!==this.props.asset.get("id")&&this.setState({to_withdraw:new p.a({asset_id:e.asset.get("id"),precision:e.asset.get("precision")}),gateFee:e.asset.get("gateFee"),intermediateAccount:e.asset.get("intermediateAccount"),symbol:e.asset.get("symbol"),memo:"",withdrawValue:"",receive_address:null,toAddress:y.a.getLast(e.walletType)},this._getDepositAddress)}},{key:"_getDepositAddress",value:function(){if(this.props.backingCoinType){var e=Object(y.j)({coin:"open."+this.props.backingCoinType.toLowerCase(),account:this.props.account,stateCallback:this.addDepositAddress});e?this.setState({receive_address:e}):Object(y.l)(this._getDepositObject())}}},{key:"_getDepositObject",value:function(){return{inputCoinType:this.props.backingCoinType.toLowerCase(),outputCoinType:this.props.symbol.toLowerCase(),outputAddress:this.props.sender.get("name"),stateCallback:this.addDepositAddress}}},{key:"requestDepositAddressLoad",value:function(){this.setState({loading:!0,emptyAddressDeposit:!1}),Object(y.l)(this._getDepositObject())}},{key:"addDepositAddress",value:function(e){e.error&&("no_address"===e.error.message?this.setState({emptyAddressDeposit:!0}):this.setState({emptyAddressDeposit:!1})),this.setState({receive_address:e,loading:!1})}},{key:"componentDidUpdate",value:function(){g.a.rebuild()}},{key:"onSubmit",value:function(t){if(t.preventDefault(),0===this.state.to_withdraw.getAmount())return this.setState({amountError:"transfer.errors.pos"});if(this.props.intermediateAccount){var a=this._getFee(),n=this._getGateFee(),s=this.state.to_withdraw.clone(),r=s.clone(this._getCurrentBalance().get("balance"));s.plus(n),r.lt(s)&&(s=this.state.to_withdraw.clone()),f.a.transfer(this.props.sender.get("id"),this.props.intermediateAccount,this.state.to_withdraw.getAmount(),this.state.to_withdraw.asset_id,this.props.backingCoinType.toLowerCase()+":"+this.state.toAddress+(this.state.memo?":"+new e(this.state.memo,"utf-8"):""),null,a.asset_id)}}},{key:"_updateAmount",value:function(){var e=this._getFee(),t=this._getCurrentBalance(),a=new p.a({amount:t?t.get("balance"):0,asset_id:this.props.asset.get("id"),precision:this.props.asset.get("precision")});a.asset_id===e.asset_id&&a.minus(e),this.state.to_withdraw.setAmount({sats:a.getAmount()}),this.setState({withdrawValue:a.getAmount({real:!0}),amountError:null},this._checkBalance)}},{key:"_checkFeeStatus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.sender;if(t){var a=["1.3.0",this.state.to_withdraw.asset_id],n={},s=[];a.forEach(function(a){s.push(Object(A.b)({accountID:t.get("id"),feeID:a,options:["price_per_kbyte"],data:{type:"memo",content:e.props.backingCoinType.toLowerCase()+":"+e.state.toAddress+(e.state.memo?":"+e.state.memo:"")}}))}),Promise.all(s).then(function(t){a.forEach(function(e,a){n[e]=t[a]}),m.a.are_equal_shallow(e.state.feeStatus,n)||e.setState({feeStatus:n}),e._checkBalance()}).catch(function(e){console.error(e)})}}},{key:"_updateFee",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.fee_asset_id;if(!this.props.sender)return null;Object(A.b)({accountID:this.props.sender.get("id"),feeID:t,options:["price_per_kbyte"],data:{type:"memo",content:this.props.backingCoinType.toLowerCase()+":"+this.state.toAddress+(this.state.memo?":"+this.state.memo:"")}}).then(function(t){var a=t.fee,n=t.hasBalance,s=t.hasPoolBalance;e.setState({feeAmount:a,hasBalance:n,hasPoolBalance:s,error:!n||!s},e._checkFeeStatus)})}},{key:"_getCurrentBalance",value:function(){var e=this;return this.props.balances.find(function(t){return t&&t.get("asset_type")===e.props.asset.get("id")})}},{key:"_checkBalance",value:function(){var e=this.state,t=e.feeAmount,a=e.to_withdraw,n=this.props.asset,s=this._getCurrentBalance();if(s&&t){var r=Object(A.a)(a.getAmount({real:!0}),n,this._getFee(),s,this._getGateFee());if(null!==r)return this.state.balanceError!==!r&&this.setState({balanceError:!r}),r}}},{key:"_getFee",value:function(){var e={getAmount:function(){return 0},asset_id:this.state.fee_asset_id};if(!this.state.feeStatus||!this.state.feeAmount)return e;var t=this.state.feeStatus["1.3.0"],a=this.state.feeStatus[this.state.to_withdraw.asset_id];return t&&t.hasBalance?t.fee:t&&!t.hasBalance&&a&&a.hasBalance?a.fee:t?t.fee:e}},{key:"_onInputAmount",value:function(e){try{this.state.to_withdraw.setAmount({real:parseFloat(e.target.value||0)}),this.setState({withdrawValue:e.target.value,amountError:null},this._checkBalance)}catch(e){console.error("err:",e)}}},{key:"_onInputTo",value:function(e){var t=e.target.value.trim();this.setState({withdraw_address_check_in_progress:!0,withdraw_address_selected:t,validAddress:null,toAddress:t}),this._validateAddress(t)}},{key:"_onMemoChanged",value:function(e){this.setState({memo:e.target.value},this._updateFee)}},{key:"_validateAddress",value:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;Object(y.m)({url:S.f.BASE,walletType:a.walletType,newAddress:e}).then(function(a){t.state.toAddress===e&&t.setState({withdraw_address_check_in_progress:!1,validAddress:!!a})}).catch(function(e){console.error("Error when validating address:",e)})}},{key:"_openRegistrarSite",value:function(e){e.preventDefault(),window.open(SettingsStore.site_registr,"_blank").opener=null}},{key:"_getGateFee",value:function(){var e=this.props,t=e.gateFee,a=e.asset;return new p.a({real:parseFloat(t?t.replace(",",""):0),asset_id:a.get("id"),precision:a.get("precision")})}},{key:"_renderWithdraw",value:function(){var e=this.state.amountError,t=m.a.replaceName(this.props.asset).name,a=1,n=this.props.supportsMemos,s=this._getFee(),o=this._getGateFee(),i=this.state.feeStatus[s.asset_id],l=O.ChainStore.getAsset(s.asset_id),c=i&&!i.hasBalance||this.state.balanceError||!this.state.toAddress||!this.state.withdrawValue;return r.a.createElement("div",null,r.a.createElement("p",null,r.a.createElement(u.a,{content:"gateway.withdraw_funds",asset:t,wallet_name:Object(N.m)()})),this._renderCurrentBalance(),r.a.createElement("div",{className:"SimpleTrade__withdraw-row"},r.a.createElement("label",{className:"left-label"},v.a.translate("modal.withdraw.amount")),r.a.createElement("div",{className:"inline-label input-wrapper"},r.a.createElement("input",{tabIndex:a++,type:"number",min:"0",onKeyPress:this.onKeyPress.bind(this),value:this.state.withdrawValue,onChange:this._onInputAmount.bind(this)}),r.a.createElement("div",{className:"form-label select floating-dropdown"},r.a.createElement("div",{className:"dropdown-wrapper inactive"},r.a.createElement("div",null,t)))),e?r.a.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},r.a.createElement(u.a,{content:e})):null,this.state.balanceError?r.a.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},r.a.createElement(u.a,{content:"transfer.errors.insufficient"})):null),r.a.createElement("div",{className:"SimpleTrade__withdraw-row"},r.a.createElement("label",{className:"left-label"},v.a.translate("transfer.fee")),r.a.createElement("div",{className:"inline-label input-wrapper"},r.a.createElement("input",{type:"text",disabled:!0,value:s.getAmount({real:!0})}),r.a.createElement("div",{className:"form-label select floating-dropdown"},r.a.createElement("div",{className:"dropdown-wrapper inactive"},r.a.createElement("div",null,l?r.a.createElement(C.a,{name:l.get("symbol")}):null)))),i&&!i.hasBalance?r.a.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},r.a.createElement(u.a,{content:"transfer.errors.insufficient"})):null),r.a.createElement("div",{className:"SimpleTrade__withdraw-row"},r.a.createElement("label",{className:"left-label"},v.a.translate("gateway.fee")),r.a.createElement("div",{className:"inline-label input-wrapper"},r.a.createElement("input",{type:"text",disabled:!0,value:o.getAmount({real:!0})}),r.a.createElement("div",{className:"form-label select floating-dropdown"},r.a.createElement("div",{className:"dropdown-wrapper inactive"},r.a.createElement("div",null,r.a.createElement(C.a,{name:this.props.asset.get("symbol")}))))),i&&!i.hasBalance?r.a.createElement("p",{className:"has-error no-margin",style:{paddingTop:10}},r.a.createElement(u.a,{content:"transfer.errors.insufficient"})):null),r.a.createElement("div",{className:"SimpleTrade__withdraw-row"},r.a.createElement("label",{className:"left-label"},v.a.translate("modal.withdraw.address")),r.a.createElement("div",{className:"inline-label input-wrapper"},r.a.createElement("input",{placeholder:v.a.translate("gateway.withdraw_placeholder",{asset:t}),tabIndex:a++,type:"text",value:this.state.toAddress,onChange:this._onInputTo.bind(this)}),r.a.createElement("div",{className:"form-label select floating-dropdown"},r.a.createElement("div",{className:"dropdown-wrapper inactive"},r.a.createElement("div",{"data-place":"right","data-tip":v.a.translate("tooltip.withdraw_address",{asset:t})},"?")))),!this.state.validAddress&&this.state.toAddress?r.a.createElement("div",{className:"has-error",style:{paddingTop:10}},r.a.createElement(u.a,{content:"gateway.valid_address",coin_type:t})):null),n?r.a.createElement("div",{className:"SimpleTrade__withdraw-row"},r.a.createElement("label",{className:"left-label"},v.a.translate("transfer.memo")),r.a.createElement("div",{className:"inline-label input-wrapper"},r.a.createElement("textarea",{rows:"3",value:this.state.memo,tabIndex:a++,onChange:this._onMemoChanged.bind(this)})),!this.state.validAddress&&this.state.toAddress?r.a.createElement("div",{className:"has-error",style:{paddingTop:10}},r.a.createElement(u.a,{content:"gateway.valid_address",coin_type:t})):null):null,r.a.createElement("div",{className:"button-group SimpleTrade__withdraw-row"},r.a.createElement("button",{tabIndex:a++,className:"button"+(c?" disabled":""),onClick:this.onSubmit.bind(this),type:"submit"},r.a.createElement(u.a,{content:"gateway.withdraw_now"}))))}},{key:"_renderDeposit",value:function(){var e=this.state,t=e.receive_address,a=e.loading,n=e.emptyAddressDeposit,s=m.a.replaceName(this.props.asset).name,o=t&&"memo"in t&&t.memo,i=t&&t.address||"",l=1;return r.a.createElement("div",{className:i?"":"no-overflow"},r.a.createElement("p",null,r.a.createElement(u.a,{unsafe:!0,content:"gateway.add_funds",account:this.props.sender.get("name"),wallet_name:Object(N.m)()})),this._renderCurrentBalance(),r.a.createElement("div",{className:"SimpleTrade__withdraw-row"},r.a.createElement("p",{style:{marginBottom:10},"data-place":"right","data-tip":v.a.translate("tooltip.deposit_tip",{asset:s})},r.a.createElement(u.a,{className:"help-tooltip",content:"gateway.deposit_to",asset:s}),":",r.a.createElement("label",{className:"fz_12 left-label"},r.a.createElement(u.a,{content:"gateway.deposit_notice_delay"}))),i?r.a.createElement("label",null,n?r.a.createElement(u.a,{content:"gateway.please_generate_address"}):r.a.createElement("span",{className:"inline-label"},r.a.createElement("input",{readOnly:!0,type:"text",value:i}),r.a.createElement(E.a,{text:i})," ")):r.a.createElement(k.a,{type:"three-bounce"}),o?r.a.createElement("label",null,r.a.createElement("span",{className:"inline-label"},r.a.createElement("input",{readOnly:!0,type:"text",value:v.a.translate("transfer.memo")+": "+t.memo}),r.a.createElement(E.a,{text:t.memo}))):null,t&&t.error?r.a.createElement("div",{className:"has-error",style:{paddingTop:10}},t.error.message):null),r.a.createElement("div",{className:"button-group SimpleTrade__withdraw-row"},r.a.createElement("button",{tabIndex:l++,className:"button spinner-button-circle",onClick:this.requestDepositAddressLoad.bind(this),type:"submit"},a?r.a.createElement(k.a,{type:"circle"}):null,r.a.createElement(u.a,{content:"gateway.generate_new"}))))}},{key:"_renderCurrentBalance",value:function(){var e=m.a.replaceName(this.props.asset).name,t="deposit"===this.props.action,a=this._getCurrentBalance(),n=a?new p.a({asset_id:a.get("asset_type"),precision:this.props.asset.get("precision"),amount:a.get("balance")}):null,s=t?r.a.createElement("span",{style:{border:"2px solid black",borderLeft:"none"},className:"form-label"},e):r.a.createElement("button",{"data-place":"right","data-tip":v.a.translate("tooltip.withdraw_full"),className:"button",style:{border:"2px solid black",borderLeft:"none"},onClick:this._updateAmount.bind(this,a?parseInt(a.get("balance"),10):0)},r.a.createElement(w.a,{name:"clippy",title:"icons.clippy.withdraw_full"}));return r.a.createElement("div",{className:"SimpleTrade__withdraw-row",style:{fontSize:"1rem"}},r.a.createElement("label",{style:{fontSize:"1rem"}},v.a.translate("gateway.balance_asset",{asset:e}),":",r.a.createElement("span",{className:"inline-label"},r.a.createElement("input",{disabled:!0,style:{color:"black",border:"2px solid black",padding:10,width:"100%"},value:n?n.getAmount({real:!0}):0}),s)))}},{key:"render",value:function(){var e=this.props,t=e.asset,a="deposit"===e.action;if(!t)return null;var n=m.a.replaceName(t).name,s=this.props.isDown?r.a.createElement("div",null,r.a.createElement(u.a,{className:"txtlabel cancel",content:"gateway.unavailable_OPEN",component:"p"})):this.props.isAvailable?a?this._renderDeposit():this._renderWithdraw():r.a.createElement("div",null,r.a.createElement(u.a,{className:"txtlabel cancel",content:"gateway.unavailable",component:"p"}));return r.a.createElement("div",{className:"SimpleTrade__modal"},r.a.createElement("div",{className:"Modal__header"},r.a.createElement("h3",null,r.a.createElement(u.a,{content:a?"gateway.deposit":"modal.withdraw.submit"})," ",n)),r.a.createElement("div",{className:"Modal__divider"}),r.a.createElement("div",{className:"grid-block vertical no-overflow",style:{zIndex:1002,paddingLeft:"2rem",paddingRight:"2rem",paddingTop:"1rem"}},s))}}]),a}();q.propTypes={sender:h.a.ChainAccount.isRequired,asset:h.a.ChainAsset.isRequired,coreAsset:h.a.ChainAsset.isRequired,globalObject:h.a.ChainAsset.isRequired},q.defaultProps={coreAsset:"1.3.0",globalObject:"2.0.0"},q=Object(d.a)(q);var M=function(e){function t(){T(this,t);var e=I(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={open:!1},e}return R(t,r.a.Component),P(t,[{key:"show",value:function(){var e=this;this.setState({open:!0},function(){i.a.publish(e.props.modalId,"open")})}},{key:"onClose",value:function(){this.setState({open:!1})}},{key:"render",value:function(){return this.state.open?r.a.createElement(l.a,{className:"test",onClose:this.onClose.bind(this),overlay:!0,id:this.props.modalId},this.state.open?r.a.createElement(q,j({},this.props,{open:this.state.open})):null):null}}]),t}();t.a=M}).call(this,a(118).Buffer)},1800:function(e,t,a){"use strict";var n=a(0),s=a.n(n),r=a(42),o=a.n(r),i=a(104),l=a(3),c=a.n(l),u=a(28),p=a(16),m=a(48),d=a(39),h=a(105),f=a.n(h),b=a(14),g=a.n(b),_=a(78),v=a(530),y=a(308),E=a(21),w=a(41),k=a(43),A=a(335),C=a(35),O=a(22),x=a(23),S=a(528),N=a.n(S),j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},P=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(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 R(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)}var q=function(e){function t(e){T(this,t);var a=I(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.state={toAddress:_.a.getLast(e.walletType),withdrawValue:"",amountError:null,inputAmount:0,receiveLoading:!1,limitLoading:!0,apiError:!1},a._validateAddress(a.state.toAddress,e),a.deposit_address_cache=new v.a,a}return R(t,s.a.Component),P(t,[{key:"onClose",value:function(){o.a.publish(this.props.modalId,"close")}},{key:"componentWillMount",value:function(){this._getDepositAddress()}},{key:"componentDidMount",value:function(){this._getDepositLimit(),this._estimateOutput()}},{key:"componentWillReceiveProps",value:function(e){e.inputCoinType===this.props.inputCoinType&&e.outputCoinType===this.props.outputCoinType||(this._getDepositLimit(e),this._estimateOutput(e),this._getDepositAddress(e))}},{key:"shouldComponentUpdate",value:function(e,t){return e.inputCoinType!==this.props.inputCoinType||e.outputCoinType!==this.props.outputCoinType||e.sender!==this.props.sender||e.asset!==this.props.asset||e.isAvailable!==this.props.isAvailable||e.isDown!==this.props.isDown||!p.a.are_equal_shallow(t,this.state)}},{key:"_getDepositLimit",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;this.setState({limitLoading:!0}),Object(_.k)(t.inputCoinType,t.outputCoinType).then(function(t){e.setState({depositLimit:t.depositLimit,limitLoading:!1})}).catch(function(t){console.log("deposit limit error:",t),e.setState({depositLimit:null,limitLoading:!1})})}},{key:"_onAmountChange",value:function(e,t){var a=new RegExp(/[[:digit:]]/),n=t.target;switch(a.test(n.value)||(n.value=n.value.replace(/[^0-9.]/g,"")),"."==n.value.charAt(0)&&(n.value="0."),n.value.charAt(n.value.length)!=n.value.search(".")&&n.value.substr(1),n.value=p.a.limitByPrecision(n.value,8),e){case"input":this.setState({inputAmount:n.value},this._estimateOutput.bind(this));break;case"output":this.setState({outputAmount:n.value},this._estimateInput.bind(this))}}},{key:"_estimateOutput",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;this.setState({receiveAmount:0,sendAmount:this.state.inputAmount}),this.state.inputAmount&&(this.setState({receiveLoading:!0}),Object(_.c)(this.state.inputAmount,t.inputCoinType,t.outputCoinType).then(function(t){e.setState({inputAmount:t.inputAmount,receiveAmount:t.outputAmount,receiveLoading:!1})}).catch(function(t){console.log("receive amount err:",t),e.setState({receiveLoading:!1,apiError:!0})}))}},{key:"_estimateInput",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;this.setState({receiveAmount:this.state.outputAmount,sendAmount:0}),this.state.outputAmount&&(this.setState({receiveLoading:!0}),Object(_.b)(this.state.outputAmount,t.inputCoinType,t.outputCoinType).then(function(t){e.setState({inputAmount:t.inputAmount,sendAmount:p.a.limitByPrecision(t.inputAmount,8),receiveLoading:!1})}).catch(function(t){console.log("send amount err:",t),e.setState({receiveLoading:!1,apiError:!0})}))}},{key:"_getDepositAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;if(e.inputCoinType){this.setState({receive_address:null}),Object(_.l)(this._getDepositObject(e))}}},{key:"_getDepositObject",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return{inputCoinType:t.inputCoinType.toLowerCase(),outputCoinType:t.outputCoinType.toLowerCase(),outputAddress:t.sender.get("name"),url:k.a.BASE,stateCallback:function(a){e.addDepositAddress(t.inputCoinType.toLowerCase(),t.outputCoinType.toLowerCase(),t.sender.get("name"),a)}}}},{key:"addDepositAddress",value:function(e,t,a,n){this.deposit_address_cache.cacheInputAddress("blocktrades",a,e,t,n.address,n.memo),this.setState({receive_address:n})}},{key:"componentDidUpdate",value:function(){f.a.rebuild()}},{key:"_validateAddress",value:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;Object(_.m)({walletType:a.walletType,newAddress:e}).then(function(a){t.state.toAddress===e&&t.setState({withdraw_address_check_in_progress:!1,validAddress:a})}).catch(function(e){console.error("Error when validating address:",e)})}},{key:"_openRegistrarSite",value:function(e){e.preventDefault(),window.open(O.a.site_registr,"_blank").opener=null}},{key:"_onDropDownSelect",value:function(e){x.a.changeViewSetting({preferredBridge:e})}},{key:"onBlockTradesContact",value:function(){console.log("Open New Tab"),window.open("https://www.blocktrades.us/contact","_blank").focus()}},{key:"_renderDeposit",value:function(){var e=p.a.replaceName(this.props.asset),t=e.name,a=e.prefix,n=this.state,r=n.receive_address,o=n.apiError,i=r&&"memo"in r&&r.memo,l=r&&r.address||"",u=s.a.createElement("div",{className:"QR",style:{textAlign:"center"}},s.a.createElement(N.a,{size:140,value:l})),m=Object.keys(this.props.bridges.toJS()),d=this.props.inputCoinType.toUpperCase(),h=(a||"")+t,f=(this.state.receiveAmount/this.state.inputAmount).toFixed(4),b=h+"/"+d,_=this.state.inputAmount>parseFloat(this.state.depositLimit)||this.state.sendAmount>parseFloat(this.state.depositLimit),v=_?{border:"1px solid #a94442"}:null;return s.a.createElement("div",{className:"modal__body"},s.a.createElement("div",{className:"container-row"},s.a.createElement("label",{className:"left-label"},s.a.createElement(c.a,{content:"modal.buy.asset"})),s.a.createElement("div",{className:"inline-label input-wrapper"},s.a.createElement("input",{disabled:!0,type:"text",defaultValue:h}))),s.a.createElement("div",{className:"container-row"},s.a.createElement("div",{className:"grid-block"},s.a.createElement("label",{className:"left-label"},s.a.createElement(c.a,{content:"modal.buy.bridge"})),s.a.createElement("span",{"data-tip":g.a.translate("tooltip.bridge_TRADE"),className:"inline-block tooltip",onClick:this.onBlockTradesContact.bind(this)}," ",s.a.createElement(E.a,{style:{position:"relative",top:0},name:"question-circle",title:"icons.question_circle"}))),s.a.createElement("div",{className:"inline-label input-wrapper"},s.a.createElement("input",{disabled:!0,type:"text",defaultValue:"BLOCKTRADES"})," ")),s.a.createElement("span",{style:o?{display:"none"}:{display:""}},s.a.createElement("div",{className:"container-row double-row"},s.a.createElement("div",{className:"no-margin no-padding"},s.a.createElement("div",{className:"small-6",style:{paddingRight:10}},s.a.createElement("div",{className:"grid-block"},s.a.createElement("label",{className:"left-label"},s.a.createElement(c.a,{content:"transfer.send"})),_?s.a.createElement("div",{className:"error-msg inline-block tooltip","data-tip":g.a.translate("tooltip.over_limit")},s.a.createElement(c.a,{content:"gateway.over_limit"})," ",s.a.createElement(E.a,{name:"question-circle",title:"icons.question_circle"})):null),s.a.createElement("div",{className:"inline-label input-wrapper"},s.a.createElement("input",{style:v,type:"text",value:this.state.sendAmount,onInput:this._onAmountChange.bind(this,"input")}),s.a.createElement("div",{className:"form-label select floating-dropdown"},s.a.createElement(A.a,{entries:m,values:m.reduce(function(e,t){return t&&(e[t]=t),e},{}),singleEntry:m[0],value:this.props.preferredBridge||m[0],onChange:this._onDropDownSelect,upperCase:!0})))),s.a.createElement("div",{className:"small-6",style:{paddingLeft:10}},s.a.createElement("label",{className:"left-label"},s.a.createElement(c.a,{content:"gateway.deposit_limit"})),s.a.createElement("div",{className:"inline-label input-wrapper"},s.a.createElement("input",{disabled:!0,type:"number",value:this.state.depositLimit&&parseFloat(this.state.depositLimit).toFixed(4)||0}),s.a.createElement("div",{className:"input-right-symbol"},d))))),s.a.createElement("div",{className:"container-row double-row"},s.a.createElement("div",{className:"no-margin no-padding"},s.a.createElement("div",{className:"small-6",style:{paddingRight:10}},s.a.createElement("label",{className:"left-label"},s.a.createElement(c.a,{content:"exchange.receive"})),s.a.createElement("div",{className:"inline-label input-wrapper"},s.a.createElement("input",{style:v,type:"text",value:this.state.receiveAmount,onInput:this._onAmountChange.bind(this,"output")}),s.a.createElement("div",{className:"input-right-symbol"},h))),s.a.createElement("div",{className:"small-6",style:{paddingLeft:10}},s.a.createElement("div",{className:"grid-block"},s.a.createElement("label",{className:"left-label"},s.a.createElement(c.a,{content:"exchange.price"})," ",this.state.receiveLoading?s.a.createElement(c.a,{content:"footer.loading"}):"")),s.a.createElement("div",{className:"inline-label input-wrapper"},s.a.createElement("input",{disabled:!0,type:"number",value:_?0:f}),s.a.createElement("div",{className:"input-right-symbol"},b))))),l?s.a.createElement("div",{className:"container-row"},i?null:u,s.a.createElement("div",{className:"grid-block"},s.a.createElement("div",{className:"copyIcon"},s.a.createElement(y.a,{text:l,className:"copyIcon"})),s.a.createElement("div",null,s.a.createElement(c.a,{component:"div",style:{fontSize:"0.8rem",fontWeight:"bold",paddingBottom:"0.3rem"},content:"gateway.purchase_notice",inputAsset:d,outputAsset:h}),s.a.createElement("div",{className:"modal__highlight"},l))),i?s.a.createElement("div",{className:"grid-block",style:{marginTop:"10px"}},s.a.createElement("div",{className:"copyIcon"},s.a.createElement(y.a,{text:r.memo,className:"copyIcon"})),s.a.createElement("div",null,s.a.createElement(c.a,{unsafe:!0,content:"gateway.purchase_notice_memo",component:"div",style:{fontSize:"0.8rem",fontWeight:"bold",paddingBottom:"0.3rem"}}),s.a.createElement("div",{className:"modal__highlight"},r.memo))):null):s.a.createElement("div",{style:{textAlign:"center"}},s.a.createElement(w.a,{type:"three-bounce"})),s.a.createElement("div",null,s.a.createElement("div",{className:"no-margin no-padding"},s.a.createElement("button",{className:"button primary hollow",onClick:this.onClose.bind(this)},s.a.createElement(c.a,{content:"transfer.close"}))))),s.a.createElement("span",{style:o?{display:""}:{display:"none"}},s.a.createElement("div",{className:"container-row double-row"},s.a.createElement(c.a,{className:"txtlabel cancel",content:"gateway.unavailable_TRADE",component:"h3"}),s.a.createElement("button",{className:"button primary hollow",onClick:this.onClose.bind(this)},s.a.createElement(c.a,{content:"transfer.close"})))))}},{key:"_renderCurrentBalance",value:function(){var e=this,t=p.a.replaceName(this.props.asset).name,a="deposit"===this.props.action,n=this.props.balances.find(function(t){return t&&t.get("asset_type")===e.props.asset.get("id")}),r=n?new u.a({asset_id:n.get("asset_type"),precision:this.props.asset.get("precision"),amount:n.get("balance")}):null,o=a?s.a.createElement("span",{style:{border:"2px solid black",borderLeft:"none"},className:"form-label"},t):s.a.createElement("button",{"data-place":"right","data-tip":g.a.translate("tooltip.withdraw_full"),className:"button",style:{border:"2px solid black",borderLeft:"none"},onClick:this._updateAmount.bind(this,n?parseInt(n.get("balance"),10):0)},s.a.createElement(E.a,{name:"clippy",title:"icons.clippy.withdraw_full"}));return s.a.createElement("div",{className:"SimpleTrade__withdraw-row",style:{fontSize:"1rem"}},s.a.createElement("label",{style:{fontSize:"1rem"}},g.a.translate("gateway.balance_asset",{asset:t}),":",s.a.createElement("span",{className:"inline-label"},s.a.createElement("input",{disabled:!0,style:{color:"black",border:"2px solid black",padding:10,width:"100%"},value:r?r.getAmount({real:!0}):0}),o)))}},{key:"render",value:function(){return this.props.asset?s.a.createElement("div",{className:"grid-block vertical no-overflow"},s.a.createElement("div",{className:"modal__header"},s.a.createElement(c.a,{component:"p",content:"modal.buy.title"})),this.props.isDown?s.a.createElement("div",{style:{textAlign:"center"}},s.a.createElement(c.a,{className:"txtlabel cancel",content:"gateway.unavailable_TRADE",component:"p"})):this.props.isAvailable?this._renderDeposit():s.a.createElement("div",{style:{textAlign:"center"}},s.a.createElement(c.a,{className:"txtlabel cancel",content:"gateway.unavailable",component:"p"}))):null}}]),t}();q.propTypes={sender:d.a.ChainAccount.isRequired,asset:d.a.ChainAsset.isRequired},q=Object(m.a)(q);var M=function(e){function t(){return T(this,t),I(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return R(t,s.a.Component),P(t,[{key:"render",value:function(){var e=this.props,t=e.preferredBridge,a=function(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(e,["preferredBridge"]),n=this.props.bridges.get(this.props.preferredBridge);return n||(t=(n=this.props.bridges.first()).inputCoinType),s.a.createElement(q,j({},a,{preferredBridge:t},n.toJS()))}}]),t}();M=Object(C.a)(M,{listenTo:function(){return[O.a]},getProps:function(){return{preferredBridge:O.a.getState().viewSettings.get("preferredBridge","btc")}}});var B=function(e){function t(){T(this,t);var e=I(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={open:!1},e}return R(t,s.a.Component),P(t,[{key:"show",value:function(){var e=this;this.setState({open:!0},function(){o.a.publish(e.props.modalId,"open")})}},{key:"onClose",value:function(){this.setState({open:!1})}},{key:"render",value:function(){return this.props.bridges&&this.state.open?s.a.createElement(i.a,{id:this.props.modalId,onClose:this.onClose.bind(this),noCloseBtn:!0,overlay:!0},this.state.open?s.a.createElement(M,j({},this.props,{open:this.state.open})):null):null}}]),t}();t.a=B},1815:function(e,t,a){"use strict";var n=a(0),s=a.n(n),r=a(1),o=a.n(r),i=a(2056),l=a(14),c=a.n(l),u=a(1760),p=a.n(u),m=a(16),d=a(3),h=a.n(d),f=a(140),b=a(1781),g=a.n(b),_=a(1756),v=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(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 w(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(e){function t(){return y(this,t),E(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return w(t,s.a.Component),v(t,[{key:"render",value:function(){var e=this.props,t=e.baseSymbol,a=e.quoteSymbol;return s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(h.a,{content:"exchange.price"}),s.a.createElement("br",null),t?s.a.createElement("span",{className:"header-sub-title"},"(",s.a.createElement(f.a,{name:t}),"/",s.a.createElement(f.a,{name:a}),")"):null),s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(h.a,{content:"transfer.amount"}),s.a.createElement("br",null),a?s.a.createElement("span",{className:"header-sub-title"},"(",s.a.createElement(f.a,{name:a}),")"):null),s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(h.a,{content:"transaction.settlement_date"}),s.a.createElement("br",null),s.a.createElement("span",{style:{visibility:"hidden"},className:"header-sub-title"},"d"))))}}]),t})()).defaultProps={quoteSymbol:null,baseSymbol:null};var k=function(e){function t(){return y(this,t),E(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return w(t,s.a.Component),v(t,[{key:"render",value:function(){var e=this.props,t=e.base,a=e.quote,n=e.order,r=e.showSymbols,o="1.3.0"==t.get("id")?n.getPrice()/(1+n.offset_percent/1e4):n.getPrice()*(1+n.offset_percent/1e4),i=r?" "+a.get("symbol"):null;return s.a.createElement("tr",{style:{paddingRight:5}},s.a.createElement("td",{style:{textAlign:"right",width:"25%"}},m.a.format_number(o,a.get("precision"))," ",i),s.a.createElement("td",{style:{textAlign:"right",width:"25%"}},m.a.format_number(n[n.isBid()?"amountToReceive":"amountForSale"]().getAmount({real:!0}),a.get("precision"))),s.a.createElement("td",{style:{textAlign:"right",width:"25%"}},m.a.format_number(n[n.isBid()?"amountForSale":"amountToReceive"]().getAmount({real:!0}),t.get("precision"))),s.a.createElement("td",{style:{textAlign:"right",width:"25%"},className:"tooltip","data-tip":new Date(n.settlement_date)},c.a.localize(new Date(n.settlement_date),{type:"date",format:-1!==g()().toLowerCase().indexOf("en-us")?"market_history_us":"market_history"})))}}]),t}();k.defaultProps={showSymbols:!1,invert:!1};var A=function(e){function t(){return y(this,t),E(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return w(t,s.a.Component),v(t,[{key:"shouldComponentUpdate",value:function(e){return e.currentAccount!==this.props.currentAccount||e.orders!==this.props.orders}},{key:"render",value:function(){var e=this.props,t=e.orders,a=e.base,n=e.quote,r=null;if(!(t.size>0&&a&&n))return null;var o=0;return r=t.sort(function(e,t){return e.isBefore(t)?-1:1}).map(function(e){return Date.now()<e.settlement_date?s.a.createElement(k,{key:o++,order:e,base:a,quote:n}):null}).toArray(),s.a.createElement(_.a,{component:"tbody",transitionName:"newrow"},r)}}]),t}();A.defaultProps={base:{},quote:{},orders:{},quoteSymbol:"",baseSymbol:""},A.propTypes={base:o.a.object.isRequired,quote:o.a.object.isRequired,orders:o.a.object.isRequired,quoteSymbol:o.a.string.isRequired,baseSymbol:o.a.string.isRequired};var C=A,O=a(1777),x=a(23),S=a(5),N=a.n(S),j=a(21),P=a(10),T=a(28),I=a(1770),R=a(1789),q=a(143),M=a(105),B=a.n(M);a.d(t,"b",function(){return J}),a.d(t,"c",function(){return W}),a.d(t,"a",function(){return K});var D=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function F(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(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 U(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)}var z={textAlign:"left"},W=function(e){function t(){return L(this,t),V(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return U(t,s.a.Component),D(t,[{key:"render",value:function(){var e=this.props,t=e.baseSymbol,a=e.quoteSymbol,n=e.dashboard,r=e.isMyAccount;return n?s.a.createElement("tr",null,r?s.a.createElement("th",{id:"cancelAllOrders",style:{cursor:"pointer"}},s.a.createElement(h.a,{content:"wallet.cancel"})):null,s.a.createElement("th",null,s.a.createElement(h.a,{content:"account.trade"})),s.a.createElement("th",{style:z},s.a.createElement(h.a,{content:"transaction.order_id"})),s.a.createElement("th",{style:z,colSpan:"4"},s.a.createElement(h.a,{content:"exchange.description"})),s.a.createElement("th",{style:z},s.a.createElement(h.a,{content:"exchange.price"})),s.a.createElement("th",{style:z},s.a.createElement(h.a,{content:"exchange.price_market"})),s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(h.a,{content:"exchange.value"}))):s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",{style:{textAlign:this.props.leftAlign?"left":""}},s.a.createElement(h.a,{className:"header-sub-title",content:"exchange.price"})),s.a.createElement("th",{style:this.props.leftAlign?{textAlign:"left"}:null},t?s.a.createElement("span",{className:"header-sub-title"},s.a.createElement(f.a,{dataPlace:"top",name:a})):null),s.a.createElement("th",{style:this.props.leftAlign?{textAlign:"left"}:null},t?s.a.createElement("span",{className:"header-sub-title"},s.a.createElement(f.a,{dataPlace:"top",name:t})):null),s.a.createElement("th",{style:{textAlign:this.props.leftAlign?"left":""}},s.a.createElement(h.a,{className:"header-sub-title",content:"transaction.expiration"})),s.a.createElement("th",{style:{width:"6%"}})))}}]),t}();W.defaultProps={quoteSymbol:null,baseSymbol:null};var J=function(e){function t(){return L(this,t),V(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return U(t,s.a.Component),D(t,[{key:"shouldComponentUpdate",value:function(e){return e.order.for_sale!==this.props.order.for_sale||e.order.id!==this.props.order.id||e.quote!==this.props.quote||e.base!==this.props.base||e.order.market_base!==this.props.order.market_base}},{key:"render",value:function(){var e=this.props,t=e.base,a=e.quote,n=e.order,r=e.showSymbols,o=e.dashboard,l=e.isMyAccount,u=e.settings,p=n.isBid(),d=n.isCall(),b=d?"orderHistoryCall":p?"orderHistoryBid":"orderHistoryAsk",g=r?s.a.createElement("span",null," "+t.get("symbol")+"/"+a.get("symbol")):null,_=r?" "+t.get("symbol"):null,v=r?" "+a.get("symbol"):null,y=u?u.get("unit"):"1.3.0",E=p?"value positive":"value negative",w=p?"value negative":"value positive";return o?s.a.createElement("tr",{key:n.id,className:"clickable"},l?s.a.createElement("td",{className:"text-center"},d?null:s.a.createElement("span",{style:{marginRight:0},className:"order-cancel"},s.a.createElement("input",{type:"checkbox",className:"orderCancel",onChange:this.props.onCheckCancel}))):null,s.a.createElement("td",null,s.a.createElement(i.a,{to:"/market/"+a.get("symbol")+"_"+t.get("symbol")},s.a.createElement(j.a,{name:"trade",title:"icons.trade.trade",className:"icon-14px"}))),s.a.createElement("td",{style:z},"#",n.id.substring(4)),s.a.createElement("td",{colSpan:"4",style:z,onClick:this.props.onFlip},p?s.a.createElement(h.a,{content:"exchange.buy_description",baseAsset:m.a.format_number(n[p?"amountToReceive":"amountForSale"]().getAmount({real:!0}),t.get("precision"),!1),quoteAsset:m.a.format_number(n[p?"amountForSale":"amountToReceive"]().getAmount({real:!0}),a.get("precision"),!1),baseName:s.a.createElement(f.a,{noTip:!0,customClass:E,name:a.get("symbol")}),quoteName:s.a.createElement(f.a,{noTip:!0,customClass:w,name:t.get("symbol")})}):s.a.createElement(h.a,{content:"exchange.sell_description",baseAsset:m.a.format_number(n[p?"amountToReceive":"amountForSale"]().getAmount({real:!0}),t.get("precision"),!1),quoteAsset:m.a.format_number(n[p?"amountForSale":"amountToReceive"]().getAmount({real:!0}),a.get("precision"),!1),baseName:s.a.createElement(f.a,{noTip:!0,customClass:E,name:a.get("symbol")}),quoteName:s.a.createElement(f.a,{noTip:!0,customClass:w,name:t.get("symbol")})})),s.a.createElement("td",{style:z,onClick:this.props.onFlip},s.a.createElement(q.a,{base_amount:n.sellPrice().base.amount,base_asset:n.sellPrice().base.asset_id,quote_amount:n.sellPrice().quote.amount,quote_asset:n.sellPrice().quote.asset_id,force_direction:t.get("symbol"),hide_symbols:!0})),s.a.createElement("td",{style:z,onClick:this.props.onFlip},s.a.createElement(R.a,{base:t.get("id"),quote:a.get("id"),force_direction:t.get("symbol"),hide_symbols:!0,hide_asset:!0})),s.a.createElement("td",{style:{textAlign:"right"},onClick:this.props.onFlip},s.a.createElement(I.b,{hide_asset:!0,amount:n.amountForSale().getAmount(),fromAsset:n.amountForSale().asset_id,noDecimals:!0,toAsset:y})," ",s.a.createElement(f.a,{name:y}))):s.a.createElement("tr",{key:n.id},s.a.createElement("td",{className:b,style:{paddingLeft:10}},s.a.createElement(O.a,{price:n.getPrice(),base:t,quote:a}),g),s.a.createElement("td",null,m.a.format_number(n[p?"amountToReceive":"amountForSale"]().getAmount({real:!0}),a.get("precision"))," ",v),s.a.createElement("td",null,m.a.format_number(n[p?"amountForSale":"amountToReceive"]().getAmount({real:!0}),t.get("precision"))," ",_),s.a.createElement("td",{style:{width:"25%",textAlign:"right"},className:"tooltip","data-tip":n.expiration.toLocaleString()},d?null:c.a.localize(new Date(n.expiration),{type:"date",format:"short_custom"})),s.a.createElement("td",{className:"text-center",style:{width:"6%"}},d?null:s.a.createElement("a",{style:{marginRight:0},className:"order-cancel",onClick:this.props.onCancel},s.a.createElement(j.a,{name:"cross-circle",title:"icons.cross_circle.cancel_order",className:"icon-14px"}))))}}]),t}();J.defaultProps={showSymbols:!1};var K=function(e){function t(e){L(this,t);var a=V(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.state={activeTab:e.activeTab},a._getOrders=a._getOrders.bind(a),a}return U(t,s.a.Component),D(t,[{key:"componentDidMount",value:function(){var e=this.refs.container;e&&p.a.initialize(e)}},{key:"componentDidUpdate",value:function(){var e=this.refs.container;e&&p.a.update(e)}},{key:"_getOrders",value:function(){var e,t=this.props,a=t.currentAccount,n=t.base,s=t.quote,r=t.feedPrice,o=a.get("orders"),i=a.get("call_orders"),l=n.get("id"),c=s.get("id"),u=(F(e={},n.get("id"),{precision:n.get("precision")}),F(e,s.get("id"),{precision:s.get("precision")}),e),p=o.toArray().map(function(e){var t=P.ChainStore.getObject(e);if(!t)return null;var a=t.getIn(["sell_price","base","asset_id"]),n=t.getIn(["sell_price","quote","asset_id"]);return a===l&&n===c||a===c&&n===l?new T.f(t.toJS(),u,s.get("id")):void 0}).filter(function(e){return!!e}),m=i.toArray().map(function(e){try{var t=P.ChainStore.getObject(e);if(!t)return null;var a=t.getIn(["call_price","base","asset_id"]),n=t.getIn(["call_price","quote","asset_id"]);if(a===l&&n===c||a===c&&n===l)return r?new T.b(t.toJS(),u,s.get("id"),r):null}catch(e){return null}}).filter(function(e){return!!e}).filter(function(e){try{return e.isMarginCalled()}catch(e){return!1}});return p.concat(m)}},{key:"_changeTab",value:function(e){x.a.changeViewSetting({ordersTab:e}),this.setState({activeTab:e});var t=this.refs.container;t.scrollTop=0,p.a.update(t),setTimeout(B.a.rebuild,1e3)}},{key:"render",value:function(){var e=this,t=this.props,a=t.base,n=t.quote,r=t.quoteSymbol,o=t.baseSymbol,i=t.settleOrders,l=this.state.activeTab;if(!a||!n)return null;var c=void 0,u=!!(a.get("bitasset_data_id")&&i.size>0),p=!!(n.get("bitasset_data_id")&&i.size>0);if(l&&(u||p)||(l="my_orders"),"my_orders"==l){var m=this._getOrders(),d=s.a.createElement("tr",null,s.a.createElement("td",{style:{textAlign:"center"},colSpan:"5"},s.a.createElement(h.a,{content:"account.no_orders"}))),b=m.filter(function(e){return e.isBid()}).sort(function(e,t){return t.getPrice()-e.getPrice()}).map(function(t){var r=t.getPrice();return s.a.createElement(J,{price:r,key:t.id,order:t,base:a,quote:n,onCancel:e.props.onCancel.bind(e,t.id)})}),g=m.filter(function(e){return!e.isBid()}).sort(function(e,t){return e.getPrice()-t.getPrice()}).map(function(t){var r=t.getPrice();return s.a.createElement(J,{price:r,key:t.id,order:t,base:a,quote:n,onCancel:e.props.onCancel.bind(e,t.id)})}),v=[];g.length&&(v=v.concat(g)),b.length&&(v=v.concat(b)),v.sort(function(e,t){return e.props.price-t.props.price}),c=s.a.createElement(_.a,{component:"tbody",transitionName:"newrow"},v.length?v:d)}l&&"open_settlement"==l&&(c=s.a.createElement(C,{key:"settle_orders",orders:i,base:a,quote:n,baseSymbol:o,quoteSymbol:r}));var y="mymarkets-header clickable",E=N()(y,{inactive:"my_orders"!==l}),w=N()(y,{inactive:"open_settlement"!==l}),k=u||p?"50%":"100%",A=u||p?"inherit":"none";return s.a.createElement("div",{style:{marginBottom:"15px"},key:"open_orders",className:this.props.className},s.a.createElement("div",{className:"exchange-bordered small-12",style:{height:"auto",minHeight:266}},s.a.createElement("div",{className:"grid-block shrink left-orderbook-header"},s.a.createElement("div",{style:{width:k},className:E,onClick:this._changeTab.bind(this,"my_orders")},s.a.createElement(h.a,{content:"exchange.my_orders"})),s.a.createElement("div",{style:{display:A},className:w,onClick:this._changeTab.bind(this,"open_settlement")},s.a.createElement(h.a,{content:"exchange.settle_orders"}))),s.a.createElement("div",{className:"grid-block shrink left-orderbook-header market-right-padding-only"},s.a.createElement("table",{className:"table order-table text-right fixed-table market-right-padding"},"my_orders"==l?s.a.createElement(W,{rightAlign:!0,type:"sell",baseSymbol:o,quoteSymbol:r}):s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null,s.a.createElement(h.a,{className:"header-sub-title",content:"exchange.price"})),s.a.createElement("th",null,s.a.createElement("span",{className:"header-sub-title"},s.a.createElement(f.a,{dataPlace:"top",name:r}))),s.a.createElement("th",null,s.a.createElement("span",{className:"header-sub-title"},s.a.createElement(f.a,{dataPlace:"top",name:o}))),s.a.createElement("th",null,s.a.createElement(h.a,{className:"header-sub-title",content:"explorer.block.date"})))))),s.a.createElement("div",{className:"table-container grid-block market-right-padding-only no-overflow",ref:"container",style:{overflow:"hidden",maxHeight:200}},s.a.createElement("table",{className:"table order-table text-right fixed-table market-right-padding"},c))))}}]),t}();K.defaultProps={base:{},quote:{},orders:{},quoteSymbol:"",baseSymbol:""},K.propTypes={base:o.a.object.isRequired,quote:o.a.object.isRequired,orders:o.a.object.isRequired,quoteSymbol:o.a.string.isRequired,baseSymbol:o.a.string.isRequired}},1931:function(e,t,a){"use strict";(function(e){var n=a(0),s=a.n(n),r=a(3),o=a.n(r),i=a(39),l=a(48),c=a(16),u=a(14),p=a.n(u),m=a(229),d=a(253),h=a(304),f=a(67),b=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var g=function(t){function a(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var t=function(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}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e));return t.state={amount:e.amount,to:e.to,to_id:null,memo:""},t}return 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)}(a,s.a.Component),b(a,[{key:"onAmountChanged",value:function(e){var t=e.amount;this.setState({amount:t})}},{key:"onToAccountChanged",value:function(e){var t=e?{to:e.get("name"),to_id:e.get("id")}:{to_id:null};this.setState(t)}},{key:"onToChanged",value:function(e){this.setState({to:e,to_id:null})}},{key:"onSubmit",value:function(){var t=this.props.asset_to_issue,a=c.a.get_asset_precision(t.get("precision")),n=this.state.amount.toString().replace(/,/g,"");n*=a,m.a.issue_asset(this.state.to_id,t.get("issuer"),t.get("id"),n,this.state.memo?new e(this.state.memo,"utf-8"):this.state.memo).catch(function(e){console.log("issue error caught here:",e),f.a.addNotification({message:"Failed to issue the asset, probably due to an invalid amount being issued",level:"error",autoDismiss:10})}),this.setState({amount:0,to:"",to_id:null,memo:""})}},{key:"onMemoChanged",value:function(e){this.setState({memo:e.target.value})}},{key:"render",value:function(){var e=this.props.asset_to_issue.get("id"),t=1;return s.a.createElement("form",{className:"grid-block vertical full-width-content"},s.a.createElement("div",{className:"grid-container ",style:{paddingTop:"2rem"}},s.a.createElement("div",{className:"content-block"},s.a.createElement(d.a,{label:"modal.issue.to",accountName:this.state.to,onAccountChanged:this.onToAccountChanged.bind(this),onChange:this.onToChanged.bind(this),account:this.state.to,tabIndex:t++})),s.a.createElement("div",{className:"content-block"},s.a.createElement(h.a,{label:"modal.issue.amount",amount:this.state.amount,onChange:this.onAmountChanged.bind(this),asset:e,assets:[e],tabIndex:t++})),s.a.createElement("div",{className:"content-block"},s.a.createElement("label",null,s.a.createElement(o.a,{component:"span",content:"transfer.memo"})," ","(",s.a.createElement(o.a,{content:"transfer.optional"}),")"),s.a.createElement("textarea",{rows:"3",value:this.state.memo,tabIndex:t++,onChange:this.onMemoChanged.bind(this)})),s.a.createElement("div",{className:"content-block button-group"},s.a.createElement("button",{type:"submit",className:"button primary",onClick:this.onSubmit.bind(this,this.state.to,this.state.amount),disabled:!this.state.to_id||!this.state.amount,tabIndex:t++},p.a.translate("modal.issue.submit")),s.a.createElement("button",{className:"button primary hollow",onClick:this.props.onClose,tabIndex:t++},p.a.translate("cancel")))))}}]),a}();g.propTypes={asset_to_issue:i.a.ChainAsset.isRequired},t.a=Object(l.a)(g)}).call(this,a(118).Buffer)},1932:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QoLBzEKr7oFDgAAIABJREFUeNq9fXmYXVWV71p773PuvVUVSAL2o40KmjCEgiSEVFUSAiRR6U9Bwan9tPG1OPLk2bQTaQd89rOfooJD80RBUfTz4RPnVpx9bZuEzIHMAaICraIiZKjpnrP3Xuv9se5dtetU1U1SiveP+m5uztln77XXtH9rOPjWt751y5YtzrkQQpZlIQRjjDGGiOB4PsxsjIkxjoyMbNmyhZkBABHlf4nIGNPX19fT0+O9995v2rQpvRcR5Rr5rrfLP/VKItq7d+/VV19tjAGAPM9DCMyc5/ncuXM//elPy4179ux54xvfWK/XiUjWJU/pPH9rbQgBAJQC8mhmjjEODAy4bdu2rV+/Xn6NMSKizDud4rF8ZHSZ9+joaKPRkAGNMTJUWZbbt2+31nrv0ykKlWUE/V1ukQ2T+cgFiHjo0KFt27Z57+VHWaG1ttlsxhittcw8ODh4zz336MR0qDzP06dPJJbuUIxRZyKTQUSnU0nvkWUfF7F09BBCvV6X7/J4mXGe50RUYVjdGyGZ8pE8XcmnXxDRGNNsNnVVwgsxRiGZ/g4AzjkdWTfsWJZQobLOygh10l2Vx0/jY4yR+SFiCCHGGGMU6lRIL49LJ2etFUKkgsnM3nsdR4aSnRDKKhWMMYcOHdIHOefku0wmxigD6uZN/MjTZUD5yO7qjiKikbHkV6GiPIOP8yO3K6Gdc9Zaa22WZTKPPM9VlFSCAMB7X6vVdELOOUTMsuzss88GgCzLZBxZSQhBuIOIGo1GX1+fEDHGuG/fvnSzRT7yPO/v75cZeu/Lspxq/rorIQQZcGhoSMbUa5xMSNSkiqtz7njFUJlfNbGKmLU2xijKoiKGwtf6Vy8wxsyYMUNuF8WvnJvnuQw4OjqqkiKqUDZG9kDYVigrukz5cdL5V5hOGPbIkSOqsIwxTqiYXic8fLwKPtWFKkcVXSCLnHhL5Ue5RamWqggiKopCZVnkS9aZZZkaKL1ApqG0Vqp1sIk6iOyfEFekzaRaUK47qpXt8CRlHNFBkyopXbyqM/lF1bPcqOJQUXYiLHLlyMiIXiwjqJirdVYpUbJ2mLxogImMYoyx1o55E8LM6YZ3/lRYWr/rbug/RdlX3BGdligXdVxE8RHR5z73uSzLRIUtWLBAx1yxYoWMFkK47777ZObOOSWrem3yFO+9PnfTpk1TLUc0IyL29fWJUkpdxTGd9WR/KhZduS/lLN18nZ+QTHZVLIA6bsqbqon0u4wwUa6Pa7YVsRhTUE82pYSh1PmUL7KZ+stE56uyYDFBYmGFHMIv6iLIIMKGcv00dIgq8qn0tXmyiSXP1s1XaRKFolqywho6b71S6SJKXSRUr1RJ9N6L1P/pM6/ok78EsVQp1Go18R7UysinKAphhJRwHZhU2WdkZOSee+7Rwc8991xx65xzqQE9Xsue0qhy41+Is1Kekm0XfklVe2V++r8VudBxurq61MtBxO7ubvmvoiimYc0nEjT1Qv5yOit1GlSRy+anB2YlxMSjiRybU59DbbeMmVrbPM//FJ3VaeP/AtZQ6aKnqFSFjx1Tk4Oh+Maqs9QRVYMoBqurq0tdBIWV5OxSYcNjF8aUtSscOh3OEke8glV1dvZSRKEyJ/HgJ4rh4sWLVWDVeiLixo0bL7zwQgWFjooaHaOyT7EzdWv/DJyVrqGCQx0LZx0jJ2ZZpkBNyon1el3tpvpcuiXq7oqva4xRZK0zSKfjpMeMytLctGUq3fOjmjD5e1SyKjuo5lY8T72qoihkPQpsioJT5i3LUqFBEWE5Y3c+xumYuhzxQo6JWFORQDlf/JqjqlL1sPTGzqdZuSyEMDw8rFCvc857L6c84ZQU85LP8PCwzFncfbUSWZbJJIWCHbZW2HNwcFDuTV25oxBrKlGfqKo6L16vd86NjIyIgBzVKgHAvn37lIsXLFhw3333idz19vYqgdJTt2xeyshyLBUaiR+7bNmyzuuStYQQJp4ipslZFZC+8+J1wQpadRZbPdwdOXJE/ICyLOv1uopJrVar6GAhop6H1O+VQ1Ke54pVTHXoUz4VwU/PBn8GnSVzOkadVbn3qFYpna5Em1J0xXsvroOqcEVBlNbiOsjBSHScTniqOYjjVoHX/wwefIoWHIvzUkEpjxpkkxkL1i7+p/hZcrsKsnq2qd8r85Fly152dXUp4NFhtxRfVdFzzvX09Iy7aNWqVRUf51j2v4PY1mo1USiKdqrzIu7iRGcvBf51AuJnyTg7duww7U05d+ECHwMzx+jvWb9WWXvhwoXq9G7atCm1/ROduOP9OOdWrlxpFEVVn2UaQcP0uFAURQhBxEcRD3WanHNydlMWSO1UigurBy+IqJDXWtvV1WWNsKrLs7oAEhKMkaiSkr5er6e70gGAPyoTyLBG5D/d2GnDygrIOucErdYQVqpKxLTL3og2ybJMNHSK0lRg28xlFcsrke0KDi6EE93UbDbTcOT0FpXiqO7gwYOpEtGNnUZ0R2ght3vv5QGyAPHuxN9RJkoJquqvBeA6J0sV859lWRliltWIwuGDh2IIzrksy2yWi2ir/hZTIGMKb+oJtHJKOy4FTUQHDx5EsRdijysw5vESS7ZdpViEQiiVenf6T+9jltlEhNl7v2XLNg2JHzlyRDDlPM8HBpYZA0VR1GrCYgxgjhw58sAD+/M8HxkZmT179rx583Q/hFjNZlMMgrLk9EJ83vs8z1E34c8FLaaHNRWZtWvXilopy/Lss8+eMWMGMWaZQ4RI0RobyYsmwraBVn4RP4sBKEZrkSmgMQCGGQGRYgwh1Gq19GAEAAww2hxt1BsMDAAISEyIaACnvTpMcV6Vwc5AwhRjRZFE2duhoaG77rrrK1/5yo9//FOhYJ7nzWZTNtkYc/6S/he84AVXXXXVnDl/TUwx+sxlPvjcTVi2RGuADTBD/MC//Mt3v/tdtBbBRobcZUVRCP+q64uIz7v0+b29vZdffrkGe2KMeZbj8ftJY6Sg9kfPENOI3UsAfLQ5yOx//ZuHXvqyK4wFQDAWJoYPWs9Gi8YBmKXLl+27fz9xHC1GiKOi7OlMZH7eF8z+da/9rwiABowBMGMpLhoebqk/BOMsILzs5X978PAhYg4UI09vaa0pQX9/fyUW3dnVcpD1zj+HmQP5yJL9wUwcikPM5fXvfg8AIIKoUYO5WpM0+IqIFiCzDsCYrAts7Y3//R+bkT1zJCbmZrPJHJkjM4fQoplnH0bpmte8yBpwCHUE42am3tP4g5cxxunfO7/81cDsmYk9M0dPzEzMgWMZCiYW1mPmtWvX6vIlXjmW69DV1aVjKyLRwcmOEJ/ylKeIQjFowAAAMZHN6osXLLpv195arVEUo8ZZFo8HuK+v77nPfa44FkT005/+dOvWrcEXIQZrbfRNNO7WT/7vdT9fu337VrRQFr5eqwFA2Szyes1aJAKG4ME3cnFKoF53ZTNQCJVjnSIctSwrysIAGgNE8MpXvGJ4tPmqv7/SGEYAY0WviQ/sUjdAbhe6a+5U67N69eo07iQOZGcxXr58ufctWaHofTnCsTnv1DkZQmZzAAcGAeHZz7nke9//sdj+iSy9e/ful7/8ZQjQlVsEQLSu1nPK0+cG5sBclG3fMqjoRM+eA1991eUtcUP42C13qrRKBEywmo0bN77rnWsa9byWOxk8r3Wjaxx4+NEg1xPHGCNTYBYeUydGUxKNMcuXLx+XKXTxxRdXDpCdw/fG4cBA39hK2DM3L1x+ngWo2xqCA3A9M078fz/79xDZB05dapmNOCtl8MzxoV/sP23OUxyAFRG3XQMrVgbmIjIJlYmZAlPwvvBccuDXXvl8RMzrNQDz/o/ekaq2siyTjYkc/Esuv6yROVEJYGqrLrnMMweKvmzG6Ik5EkdiVWUhhB07dqjTd84551SJlToUqZqf9AMIS5f2hxA4cvSByb/33W/PDCBA7moA2V8/9dQ/PPZ4SVGmImvQAfWfgTlGT36E/fAFSxZ059aiQ5ODyT904ycCs2+rqhhK0V+jNMKB33L1y1sQALr/8dEvCKumzCsIJ1Ng9hzL8xeeU3c2z3MAB7b26BMj8mhmT8whMkVm4jVr1ogMLlq0SBIpJqp5I7iPeqFCXXUjJkmgMJYIrLFgCDk++utff+ADNwYCBihDnDV79oO/+MXsk2cDBQAyCIq3qFLIsoyIENgYgy6LxOvu2XjKKacAB6ASmNasecfhI8MRUDSnsVZcOIcOAgyPDAmDi24ty1JObEVRiKoVVCsSMQEgfu72z8YQfVkCEMS4cdN2knMikdgFNABI9XpdDkZyxkyTvMZBNJXjzsSI7ngElWtZ3mwOAxNmeO2116I1AIBZDgg/X7eOgYjJWRNjCUBi/iSpTASwZd0BY2QAZ/MGZNnP/uM/LEJN3NJI1113nbMABoghBAJs62PD9Sw3yBQiAGdWWKaFdggs04I6rItEALBg8aIsw66aQyAAuu++vRSF+Gn0hCrhyDQ3cYxYgsaKQVFCdggfGbBEUK/XAPmJxx77+rf+LQRicBzDG6+55oyz5jXqGSISk7Nj2QmyJImzt3wWZmMtAxBgCPTUpz/tmmvewBGAIyDeftttPjAxMIJ1jhlBrAZiCMG0Y9tEAZIkWM2xISIGtM6R9wBw3sJziyI4BAQYGhpBCwRs2qgpM8vpQ1hECDIpu4zL9tYg+5g3NG5EAADKOQwPA3oosls+doOzmQMACGC6P3zTTQbZcHSMljPgVjJuZX9agwNCJARCJrTO2Ox97/ufooktRIT4ma98N+NmACAA5BIRS4hgAZwNDE5svzUa5kmZAhENAHNhsgawa8e7awYoy2xgYITIDAwWAGgMfUfEtWvXimwpviSfgYEBk+Z5p7lbim2l6fNEBD64Wj1yBAvf+Ma3yuAZwLr88he/pOasBQQAppbgdDozoT7RGjQA0N3dGOg7p21q8Gt3fQXQUtsXijE6cHJUtBaNzYCNgr+CzAjPtpL/mAw0KBwBsHv27rSmzraIkC1c0OuEzuLKIqABAGw0GgJMpjCWhiattY1Gw3TOGUwLH9LsfotZeeSJfff/J4DJrI2RX//611oDDGPIkSxzyjMXMBhmljkBANh6dvnllwG0VMnPf/pDQOsQkAkArLEGAAgQDUUoyxLQMKPiPCoHLbgVgSIb2/PQLzY0R2qem4EMYL6s/zxhv/ZSQU7Waapqmgc85gZIHnyadZfmRlWSbzT3sCQGgK2bN4h3xIyA+UUrlqfPOJYjavpQ0ZLPee5qC0RM1uUwOvy7Px7G1iYjAEQKLdgaENEaY9OET0gqMmQTEBGweNd17wcogDOwpndJ/zPmzERg4DaR2uqoLEtNPtdjX5oHD62TaJIKkSauVMJzLeeewToHjLt3b/XRABIRnXzas7rqxjAARTkTHhUIkSsMCpIFzAjMZ83vtQAGTYzBONjzwC8BwLQ4lJxxgC2eyPOcoo+hFEnUmpukIMIgFnd+8Utf/9b32QABQ6x9+MMfRAAD7GxOkcVgyapvuOGGI0eOiL2W+C4R7dmzp+o6TBqkmYqznEUwBhB//9uHIxhAQOBnnXGmITCYhnCOGh0Yz30GmV02Y5YFcJkBRi5H//N3f7TQZl4iHtttKotRAGqM54U0wEMB3v+B66989Zvy7oYnAAyve8ObL1k5EKMHMAAGUBSsEMsIz8oZQ1hMY5fqUTupLKhAo2kIU3V8i6xEzTIA46O/fUigOiSeefJJDICgUU8wRm7sAIABMyGKr2AZLYABcCd2ZwebEYyzBIOj5RiohMjAwGAzY42NFOs1e+D+PRs2bBDtLvF9Y8wDDzywfv36Oz7/mZGRwEhDw7Wsy/3N6hd/4uPvdQwkW8ggVqUSixa4TbPn06CJMcZphcZUWSVCKVV1BiCr5QAwNHwYwIADDnDCzBPboSpqsQwfBUFEAAALEAGIARAtAEbPM2ee8NhvHofMGoJmIcQitA6BI4QMIcYYKRoAX8Q7brv1i5++MVXGCvk7BMQcnOE4/L73fmrNmqstBPCMmSGGGME5YAaDQj3UkK2WmSGiFOGNBQk3bdpUyTHTUGiadaaAHKIJcRTIFUgAkEOtsIBNZGgVaJVlCQiMR1HzRIJ7QaCIgMxABNYZ9l5QHwvQ3d0NzEyi4AwCC4GFKXIECM0xuQMGBEAbAgGYgFnXjJPf8Y63HRp8Ys2aq1sbaBHBGITMtUZsiWSbP2KMa9eubTQaAi4sWLAg9Q1dyodpKYB+EaRYAf/ABMQQY6PelWeuLIYB4fDBx8VyhxD1/IHGMMcpFZcBQAg+uiwPxMaARYLgDw0NGWsgxgDQ090FKA4mMIPFdpCRyVosI4PJiYpWhIVaxX/W2RDC7JNOueVTn3zpS64QkSnKop7XiL2BrAN8rABMxUMQp9epA0VEgmSlxX1iUNWsil9Syyw4+9Snneb9RgCT1+HXDz1EDIjWOIHiRMF3ygFBBCJyWQZgrAEfPLN3GR8ZIXYZoPEMp845JfEzEIABwGUZgwkRnIUVq56zesUCIBZ1s3nzxu/823djCM7CE4899qq/e8mtn/6bH/7ge2iplteCB5dR55wBEUD5m6Y0id/r9u3b9/jjj0sYbuHChYr8CSsJjbZv3y5kbsX+iQHo6afNM0CAObP/5YP7GYEiW4vel3luseWg89ReFgmGaQzECIjsHD70wO4SgMXuYXb6M0+NAA4MACFihOioVaDCjMZlqy953vve8XpisihcjAD0T29/x003fdyY6Ev695/85LLnv+TuH36dCGwGDNzBQpdlaa096aSTFi5cWKvVarWaJj5ba8844wwYGBiQpBxNXVU8q1JqpIGGpQN9HMPPfvLtOkLN1MEAQPejfzwyOFpGJgHORQ16X0wVAgjkiYJAXEVJzDE0H//eN28Xmwim5mb8VWAuSIA5z8yeS/Z8zWuvQLQADkz2z5/4QmQKFFtoH8fm6CCTv/3WWxCh0egGcADuIx/5lA9MXPpYHjU2IV5bBeAVspju7m6tkqnIoFaXpmIMBh0wIPf1r2AGZAQEC/R/7/pavZ5xy3UBHB+Cn0wMbTvVC2wmpSnuhz/4KYJFZGvw/P5llluBDwhtFARbyfFoDDCHEBDQokgQee9r9a4Y6TVveP11b/9vzdHCGAIM7/yndz36+8eK6NFkHUJeGlFPk7xUwROREUqpX5omM8pfyYfSMltgOShxV8/ss8+cE5kBwUC87bO3h7YuTAORU7ukaE1G0QMSAEQmzBqf/9ydLZc9lle++iqITZZjEfIYjYENMHAEpkZeK4tCwZksqwEYBgPgPvi/bjj9WXMyZwAxxKFLL73U2a4OyU7GGFXZac556naZFNZQVJOINm/evGHDhu3bt+/fv3/+/PlLliy54IILLrjgAjDGMABiUfrXv/Yq1zqN8L4dO3bu3BMpapFN56wVjiCQFmLL+H79K18tPAASMhHTi150udBRWFRdWSICJrmrKJridreML4APZJ0LkdE1vvntL3sfgCyg371n1+dvv4v46GkNlRyp9HAOK1eurKTJT5U/1U57dsuXXcTEVI6ODj0uoAxCDpift2TZaGDPXDI3y1Fmz1SkiH4K8HtmHyWUVzI3mctTTp5lAWytDuguu+IlxOwDE7OPgUjUhw+R3/yaKyS2g2Cu//jnp9Q9xMzxTa9+KQJ0AQD0mKzn9yPEHCn6EIKEKUIIzJFjmQY+UsU9DoPvnLFXqaQxxlhniEPwEV1W757xxte92jlAiIh479atH7vpY+JC5Vk9RgY06tBWKgYsgDMIAL4sgfEt//APTzxxkBFiGcCYG264QfgJAZyxiPa4UxMQIDRv/tyXZtVhBFzdlBT4NVe+MpIhcNbaGALqQaV97hcdouJVHbQzZ4kuS2kMCEv6+9pb533zsEMwCNZmYnq+ffcPPHNJHChOzAQQW0NEzLE5Oszkmcsv3XE7ihZDB1h71WveEJgLX5IYuJHRFmMdD2cFZt8cJC6/8KmbAEzNALguQPez9ZuGi0DMRDQyPMgchec1yzCFWyqfKZNnent7TzjhBAAYHh7etWvX4OAgEfX09Cw679zzzjuvLCjLDRDYrHb33d+89NIXxeidyVyeXX7pZV+88/+88hV/K9HqNP1M82iZGZhqeQYAN97w4Xe/+3rB9YBh5sl/ddttt8o2C4xTq4SFj5W1CGs9GIdedfU//uvNt2zb+6scRjy6573gikOP/zYCOMRGVxcwhwiI8PvfPfrII49o0a0IxIwZM/TE04mzlJtE649Fh7iITMQcvMh2ydxc8/Y316zJTSvDwbr6ylXP/ePjh6mt6dJcD2Gu0Bx+cN/uhb1n1Z1FgFqtkde6AbI9+x8OzJ4pchniaKQilL4dBD0OziKOgZmpJOZf7d3mnHFyejeNa697z6gfm5oor+uuu64SrM/zvK+v71h1lmSjaQ5Eq6gFDBBTAOPAOUfMAPaGj3z0yitfGYmNAWOAol+/fu3JJ8164QuvuOOOO/bu3avyX5bltm3bbr755sV9S86Yf87+Bw+UgVxWKwpflsWO3bvnn/mMUAYjRDcO2NjMwXQyHI0FKinDWD79rEVv+PuXm8zmBkxmPvGRDz388MMhsgDbEkA84YQTpGuLwqST9GLpwFlqAdPshxhKJiZiYiaOkUNbyMuP3/ghZzF3rYvzei3FSzUzU8+G2mnGufzU0+bdf+Bhzxxa8WcmotHRUXXNp8FZTMJcftQHLg/Va5mcb11WO7N3gSTtUMv2xfe+970aoNX46bJly46Js9atW7dx48atW7fu2rUrRaZ++eAvt2zeKuSNFBHQOgcMwHzt296ye/fOufOe6YwFgFAWEsJJGyuNtY6QI6Zk70R++OGHvvHNr/sA1kKkVpSlXq8TME2Lr4ACgbEERXR1W3LW/dlb/pXRNDITfHH/vn233voZAAgMzhmg2EZNgkKhk9SwXXTRRWnFiLBJ6tNPzM1dvHhxNdMs+e598cMffv/Zz17lsrGYQBo91EolQepdO+wAprZwyfKDR0Ylkab0LW5q+WLEZTHKXL7uqldiCzzM3vfBj3Vws6g1pUAUIhXM/vzFCwABrRHn8A9/fCxITgbT9ddfr417dMlLly4dZw0llATjuzBV+kRVMt3T+ra0ME6QL+fcRRdddMkllwDAj370o02btuzdu/dXv/qVbECWZX19ffPmzbvkkuc8bc6cvr7z9+y5HwEYyFnYsXXLSSed9PVvfO2Flz7POQmAsLU2xBIYszxnCmvWvPMNV18TyQSwzzj1tCkZi4mIMtuqPkdwAHT33Xf/6pHfGGPKshwDFRA0mT5FDSY5fqxevVrjiJwYL72n0g3GGDMwMDA6OjppcmVZtjJevC/ky/g0oNZR3ntfFEWMPobm2992bWunEa3NrKsDuDddc20rH4hJNl98Lopehm3BFfHoaY9ERBTaU/I+tn13ij4GsezE/J73vKdSjiGZaOM46/TTTy/LsizLQ4cOaaMFa+3555+f6uO0r1xfX1+atq6+Rft03gq3yAPUOAjaoxPK8xyAKPJHbrxx1apVV7zgCmKG6CNEALjlkzd/5zvfXrfhnlNOOcUaEwEsQKDoTAYERIwWECgz1LlWq51G3soMLssyz+ut2ESSuCy/CAKqNZ+T5HxMzMxTVyh1jlImkhiHlJ2k7pj6vul3oZE+Qsdsd7OKMTRjaP7u1w8/8+lPdQAAJs/r7WiVu+NLX24GDsyRA3FszYJa/OLDaAeeknnKE4W52kmqraVpXQIzizWs1D1VdJZJs9W1wEP7e02sDxJmEQw6TWLS4J0mH4zlaCTYhvZTkZBtWQZjMzTuv8x56i8ffvhlL3sxAJVlExGNtYjw6iv/7tkrV40MNSlEBCPujXKEs3nn8pgELLIxcrNZwvgmZzp/TQZJeapaIy0+p1bITkz+rhT0TKzLa38n76Mo+HaHMFspINDKV+ccUEtIGZAgxDJkzt1511fvbKeMSa2A4M4hkHNS6KNWxYUg+MmUcUmKMTLJ1nrvXZbV2qUWmpmkG6k1bFoRqsDWGLH27t176NAh6X2SBlNTcCflrBjjzJkzzzrrrEr9u8Y7tNpEVpi2+xrnkSAyE7bIx1leR5A8Wi91T1LThczAxlkDDKJjrMUQAxA45yjClHgEs7HWoB13OIVxRZ5CR1msODRZlp1wwglz586Vy6SV3thnxYoVlRLKzmH3tO/ZpEV8abOLFJnRDJyJI0xsulkRJfmrmJx+0lsWLVokmiiEsH79eu13IEm0or/Wrl2rK01T8yu52JyAEKkRb0XKFLpKY6udC75Vso5a+at5pGkNvmq09MexfBXTSj4QXFz+aiwvxZG0DHliHwi5sdFoqFEWPZvGBCskU99dvcj0MqOPl3KhSnX1pA3ZpJxQmeio9f/GGNGmaVHOuCBIkjymRiDPc8mZ0h5uabqdaBblYqnVShvhaRfX9GCr9bWpAtWOcJC0VEnT/nRrnWbL5Hm+cOHCPM8nPxYlOksD1/rXGLNu3bpJr1+wYIH0H5LOKJroUunPptO48MILpZPf8PDw3r17hR0ajcb8+fMhaYIiBvcPf/jDAw88UOmgV5bljBkzlixZIlpv3rx5WgIp/qBo7jzPL7zwQlHkRVFIbFRbwAkTSPdNGX/WrFlw8cUXKwnFJ2o7JpN/JtZKaBvaSXVWmlMum59WCFWYJc0L27Fjh2h6AEhP/22glUMIO3fuVEkcGBiooOZSd98+sXpm3rBhg4r5qlWrNEFfa6oBYMmSJfqgLVu2QLuP3sDAgEvL1CZqzUlDIAp4KlMctbMsjG/5WommaN2xyLgQd2hoqFUhNN7mpJMcHBxMu1bD+P47mnKQ9mtRB2h4eFi742nerPpPojFED4gf09XVZVJ9UelEMOlHSVOWpZ5yOseXlLHTnnyqNer1ujKL+ofSE6WS0pkGPmTDFKSW85NSTTZGRpPEhVRWVNgSAAAGi0lEQVS1yZakiQpSWSzcJDXxyg0y51aJHkzR9Xnz5s2TOg3qEBCRSEfnGuGNGzcK73R3d/f29tbrdc2U0y8iHTLU3r17Dx48mOf5gQMHFi1aJC1v58yZs23bNslFkLvEYtx3333aXvXgwYP33nuvKCaxntKjW4UmhLBnzx7t9TM0NLR9+3ahzoEDBxYsWCAe9Zw5c/bv3z8yMkJEBw4cSBMwjyluOJV8pQqis5+lajVt+aDaJC201z07//zzVQdt27atcvKYWJwFEzrJVqrd0hbiFdu6ZMkSndvmzZtTjaR/V65c+aR3ZktFQ/suaIRNjFpqYVVsU+9EEKEErgDtuZyufFyoPTlpac/o1JdMp6fz0RYOk4rLk04sFRwFDlPnKFWRaSWU5mJUWqqkFaQV9VrJG06746V5oROLBaW6P6W4NDefWBvypDdIlP0UG7d79+7BwUEhRH9/vxhBY4xgZ7KSjRs3lmWZZdnhw4d37tzZbDadcw8++OCiRYvErT106ND999+vO5G+EkA3YNasWWeccUZ6NhJH9IknntBO6GkV3GOPPbZz586yLEdGRn7729+ec845YgdGRkZ27dp1rBHpP11nTVQTlWcp6qR8pFVReq+g/vLZs2dPxTvT1Cj5kue5WB61sCJZMcatW7dW/I+Kk2GM6e/vV8fw3nvv/YvqrNSGqkylCLfYbFUx9Xq9LMvKqz4UBdGMfrXo6TlJdFZZllo1m7qBFcgl9QEkRCjgkiLsIQSJJP7ldFbaLjhtJ5civymckEY6lRCNRkOP1uJApOiuSLoM7pyTwkP1wjTRTKDdiWcGOepqtCLtjT6h88CTr7PUIe7r64N208IdO3boOxCWLl1aMfnMPGPGjHPPPVfuFQUkpJk5c+a5557b3d2drk3eYbF//37xRYeHh7dv3y4EmjVr1llnnSUSeuKJJy5evFiUetq7SFOQnXNnn3228mDV5V61alXlKCN71QHYUt83zWaahi5Ta6UnuLTwbPny5fK7nhYrXyr/u23btkoqmvxzYGBgqsSYdD4TowREpGdJa+3FF19slC6VFxp0AB4qR7zOPf86q7NKiV5abyt4gPayVQBW0xP1bKSYn0JMqX+nAYEOQGYlg3Ri6+AWF2uHz/TSChqXeuG686p0p9eaSsOUqcKKMcqCBbQTH0KWKm6X9tiC9ksr5AAg/6Xd7tJWd5U1T7T4+r3SAFqvh3ZHfTdp93RjzJIlS9SOVPpcyv2HDx/WDmHH+64sADjzzDNnzpwpHVd37twpYddZs2bJgrMsO3LkyO7du8W0dXd3L1y4UN9YsmvXrjzPRSbkJOi9P3DggAaZ6vX6GWec0dXVVRTF/PnzhXnT0odJ+asiWIg4e/Zs8QGzLDv99NNh1apVAjNpJ2JFi1KRTk9zFQ1yLH7WpDiXfqnA+SmviaD19/crLrZu3brJOwElH4n3pXwkkXoh/URgLlXWqQKVu8Yw+PSFHCkgN/H1JtWmne3I4DTelZWCpemrwFIUVFEzsffp4UPP3np4qlgefbGUOCLSKgzajfZSEVGhmQhwV5xVKZ7J0hCpJn9PVdOlb4CqFPpMz6uotHytsJvIuD5C27Zqs0AxNbVaTb6oNdBGi5LMJ+GSSY97KXUq3Z+FyzSwhIhOnFcR6fvvv//gwYOaV5MqyIluhEYiBCOfBhqhYTsdSpWr6J1FixYVRYGIc+fO3b59u0z1kUcekdoaY8zQ0NCePXtEzc2ePXvu3LnyEr/TTjtN8C9jTE9PT29vr1BheHh49+7dijHos5xzixYtSskkNB0dHd2+fbsQoaenB1avXj2pppg2xqDsnQKbaRbJRAgfxveOlL9Lly5VGRckMs0Ok3u3bt2qYpXmJQgmJQOed955qnTknRcw4S0olYwzVVvy3j+5bOnSpW7iy7umfaypvJFv0hdPTBVPrUTCK+9tCO0+WaqY5H9Tf3iqF+mJ3ql0R0yNTxpDqQAS6VSzLHOpIKgfMO2mrjLjZrMp8HGqCwTxkP44aRxfGgGmTo22OSmKQpD1sX4S1koSWnp4lKH0eo1Oaj9Z8dfSh6YaXU3ZxFWri9cC4yR7WWHfNCB4XMTSd44NDg6KWpUR+vv7G40GEY2MjKRd4NRLFt0k75xTQF2aTmqudXd394oVK4QEvb296ql3dXUtX75cFLz+Lnj/8uXLRX/19vZqw4aenp5ly5al4ShZsrSrm9g2uVarLVu2TDasv7///wMCmdZm6AM8jAAAAABJRU5ErkJggg=="},2063:function(e,t,a){"use strict";a.r(t);var n=a(0),s=a.n(n),r=a(47),o=a(26),i=a(22),l=a(111),c=a(39),u=a(48),p=a(35),m=a(126),d=a(11),h=a.n(d),f=a(537),b=a(2072),g=a(2057),_=a(2055),v=a(305),y=a(1),E=a.n(y),w=a(2056),k=a(3),A=a.n(k),C=a(423),O=a(529),x=a(104),S=a(32),N=a(42),j=a.n(N),P=a(41),T=a(1931),I=a(333),R=a(119),q=a(1753),M=a(21),B=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var D=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={create:{symbol:"",name:"",description:"",max_supply:1e15,precision:4},issue:{amount:0,to:"",to_id:"",asset_id:"",symbol:""},errors:{symbol:null},isValid:!1,searchTerm:""},a._searchAccounts=Object(v.a)(a._searchAccounts,150),a}return 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)}(t,s.a.Component),B(t,[{key:"_checkAssets",value:function(e,t){if(!this.props.account.get("assets").size){var a=e.sort(function(e,t){return e.symbol>t.symbol?1:e.symbol<t.symbol?-1:0}).last();0===e.size||t?(C.a.getAssetList.defer("A",100),this.setState({assetsFetched:100})):e.size>=this.state.assetsFetched&&(C.a.getAssetList.defer(a.symbol,100),this.setState({assetsFetched:this.state.assetsFetched+99}))}}},{key:"componentWillReceiveProps",value:function(e){this._checkAssets(e.assets)}},{key:"componentWillMount",value:function(){this._checkAssets(this.props.assets,!0)}},{key:"_onIssueInput",value:function(e,t){var a=t.target.id,n=this.state.issue;if("to"===a){this._searchAccounts(t.target.value),n.to=t.target.value;var s=this.props.searchAccounts.findEntry(function(e){return e===t.target.value});n.to_id=s?s[0]:null}else n[e]=t.target.value;this.setState({issue:n})}},{key:"_searchAccounts",value:function(e){r.a.accountSearch(e)}},{key:"_issueButtonClick",value:function(e,t,a){a.preventDefault();var n=this.state.issue;n.asset_id=e,n.symbol=t,this.setState({issue:n}),j.a.publish("issue_asset","open")}},{key:"_editButtonClick",value:function(e,t,a){a.preventDefault(),this.props.history.push("/account/"+t+"/update-asset/"+e)}},{key:"_createButtonClick",value:function(e){this.props.history.push("/account/"+e+"/create-asset")}},{key:"render",value:function(){var e=this,t=this.props,a=t.account,n=t.account_name,r=t.assets,o=t.assetsList,i=!0;if(!a)return s.a.createElement(P.a,{type:"circle"});if(a.notFound&&(i=!1),!i)return s.a.createElement("div",{className:"grid-block"},s.a.createElement("h5",null,s.a.createElement(A.a,{component:"h5",content:"account.errors.not_found",name:n})));o.length&&(r=r.clear(),o.forEach(function(e){e&&(r=r.set(e.get("id"),e.toJS()))}));var l=r.filter(function(e){return e.issuer===a.get("id")}).sort(function(e,t){return parseInt(e.id.substring(4,e.id.length),10)-parseInt(t.id.substring(4,t.id.length),10)}).map(function(t){var a=I.a.parseDescription(t.options.description),r=a.short_name?a.short_name:a.main;r.length>100&&(r=r.substr(0,100)+"...");var o=e.props.getDynamicObject(t.dynamic_asset_data_id);return s.a.createElement("tr",{key:t.symbol},s.a.createElement("td",{style:{textAlign:"left"}},s.a.createElement(w.a,{to:"/asset/"+t.symbol},t.symbol)),s.a.createElement("td",{style:{textAlign:"left"}},"bitasset"in t?t.bitasset.is_prediction_market?s.a.createElement(A.a,{content:"account.user_issued_assets.pm"}):s.a.createElement(A.a,{content:"account.user_issued_assets.mpa"}):"User Issued Asset"),s.a.createElement("td",{style:{textAlign:"right"}},o?s.a.createElement(S.a,{hide_asset:!0,amount:parseInt(o.get("current_supply"),10),asset:t.id}):null),s.a.createElement("td",{style:{textAlign:"right"}},s.a.createElement(S.a,{hide_asset:!0,amount:parseInt(t.options.max_supply,10),asset:t.id})),s.a.createElement("td",null,t.bitasset_data_id?null:s.a.createElement("a",{onClick:e._issueButtonClick.bind(e,t.id,t.symbol)},s.a.createElement(M.a,{name:"cross-circle",className:"rotate45"}))),s.a.createElement("td",null,s.a.createElement("a",{onClick:e._editButtonClick.bind(e,t.symbol,n)},s.a.createElement(M.a,{name:"dashboard"}))))}).toArray();return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{segmented:!1,setting:"issuedAssetsTab",className:"account-tabs",tabsClass:"account-overview bordered-header content-block",contentClass:"padding"},s.a.createElement(q.a,{title:"account.user_issued_assets.issued_assets"},s.a.createElement("div",{className:"content-block"},s.a.createElement("table",{className:"table dashboard-table"},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",{style:{textAlign:"left"}},s.a.createElement(A.a,{content:"account.user_issued_assets.symbol"})),s.a.createElement("th",{style:{textAlign:"left"}},s.a.createElement(A.a,{content:"explorer.asset.summary.asset_type"})),s.a.createElement(A.a,{component:"th",content:"markets.supply",style:{textAlign:"right"}}),s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(A.a,{content:"account.user_issued_assets.max_supply"})),s.a.createElement("th",{style:{textAlign:"center"}},s.a.createElement(A.a,{content:"transaction.trxTypes.asset_issue"})),s.a.createElement("th",{style:{textAlign:"center"}},s.a.createElement(A.a,{content:"transaction.trxTypes.asset_update"})))),s.a.createElement("tbody",null,l))),s.a.createElement("div",{className:"content-block"},s.a.createElement("button",{className:"button",onClick:this._createButtonClick.bind(this,n)},s.a.createElement(A.a,{content:"transaction.trxTypes.asset_create"})))))),s.a.createElement(x.a,{id:"issue_asset",overlay:!0},s.a.createElement("br",null),s.a.createElement("div",{className:"grid-block vertical"},s.a.createElement(T.a,{asset_to_issue:this.state.issue.asset_id,onClose:function(){j.a.publish("issue_asset","close")}})))))}}]),t}();D.defaultProps={symbol:"",name:"",description:"",max_supply:0,precision:0},D.propTypes={symbol:E.a.string.isRequired},D=Object(R.a)(D,{propNames:["assetsList"],asList:!0,withDynamic:!0});var F=Object(p.a)(D,{listenTo:function(){return[O.a]},getProps:function(e){var t=Object(d.Map)(),a=Object(d.List)();return e.account.get("assets",[]).size?e.account.get("assets",[]).forEach(function(e){a=a.push(e)}):t=O.a.getState().assets,{assets:t,assetsList:a}}}),L=a(5),V=a.n(L),U=a(526),z=a(16),W=a(10),J=a(14),K=a.n(J),G=a(1778),Z=a(178),Q=a(304),H=a(169),Y=a.n(H),X=a(142),$=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(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 ae(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)}var ne=new Z.a(Y.a.GRAPHENE_MAX_SHARE_SUPPLY),se=function(e){function t(e){ee(this,t);var a=te(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={backingAsset:e.backingAsset.get("symbol"),error:null},a}return ae(t,s.a.Component),$(t,[{key:"_onInputBackingAsset",value:function(e){this.setState({backingAsset:e.toUpperCase(),error:null})}},{key:"_onFoundBackingAsset",value:function(e){if(e){var t=e.get("bitasset")&&W.ChainStore.getAsset(e.getIn(["bitasset","options","short_backing_asset"])),a=t&&t.get("bitasset")&&W.ChainStore.getAsset(t.getIn(["bitasset","options","short_backing_asset"]));a&&"1.3.0"!==a?(this.setState({error:K.a.translate("account.user_issued_assets.error_too_deep")}),this.props.onUpdate("invalid",!0)):e.getIn(["bitasset","is_prediction_market"])?(this.setState({error:K.a.translate("account.user_issued_assets.error_invalid")}),this.props.onUpdate("invalid",!0)):this.props.isPredictionMarket&&e.get("precision")!==parseInt(this.props.assetPrecision,10)?(this.setState({error:K.a.translate("account.user_issued_assets.error_precision",{asset:this.props.assetSymbol})}),this.props.onUpdate("invalid",!0)):(this.props.onUpdate("short_backing_asset",e.get("id")),this.props.onUpdate("invalid",!1))}else this.props.onUpdate("invalid",!0)}},{key:"render",value:function(){var e=this.props.bitasset_opts,t=this.state.error;return s.a.createElement("div",{className:"small-12 grid-content"},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.feed_lifetime_sec"}),s.a.createElement("input",{type:"number",value:e.feed_lifetime_sec/60,onChange:this.props.onUpdate.bind(this,"feed_lifetime_sec")})),s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.minimum_feeds"}),s.a.createElement("input",{type:"number",value:e.minimum_feeds,onChange:this.props.onUpdate.bind(this,"minimum_feeds")})),s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.force_settlement_delay_sec"}),s.a.createElement("input",{type:"number",value:e.force_settlement_delay_sec/60,onChange:this.props.onUpdate.bind(this,"force_settlement_delay_sec")})),s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.force_settlement_offset_percent"}),s.a.createElement("input",{type:"number",value:e.force_settlement_offset_percent/Y.a.GRAPHENE_1_PERCENT,onChange:this.props.onUpdate.bind(this,"force_settlement_offset_percent")})),s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.maximum_force_settlement_volume"}),s.a.createElement("input",{type:"number",value:e.maximum_force_settlement_volume/Y.a.GRAPHENE_1_PERCENT,onChange:this.props.onUpdate.bind(this,"maximum_force_settlement_volume")})),s.a.createElement("div",{className:"grid-block no-margin small-12"},s.a.createElement(G.a,{label:"account.user_issued_assets.backing",onChange:this._onInputBackingAsset.bind(this),asset:this.state.backingAsset,assetInput:this.state.backingAsset,tabIndex:1,style:{width:"100%",paddingRight:"10px"},onFound:this._onFoundBackingAsset.bind(this)}),t?s.a.createElement("div",{className:"content-block has-error"},t):null))}}]),t}();se.propTypes={backingAsset:c.a.ChainAsset.isRequired,isUpdate:E.a.bool},se.defaultProps={isUpdate:!1},se=Object(u.a)(se);var re=function(e){function t(e){ee(this,t);var a=te(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state=a.resetState(e),a}return ae(t,s.a.Component),$(t,[{key:"resetState",value:function(e){z.a.get_asset_precision(4),z.a.get_asset_precision(e.core.get("precision"));var t=this._getPermissions({isBitAsset:!1}),a=t.flagBooleans,n=t.permissionBooleans;W.ChainStore.getAsset("1.3.0").get("symbol");return{update:{symbol:"",precision:4,max_supply:1e5,max_market_fee:0,market_fee_percent:0,description:{main:""}},errors:{max_supply:null},isValid:!0,flagBooleans:a,permissionBooleans:n,isBitAsset:!1,is_prediction_market:!1,core_exchange_rate:{quote:{asset_id:null,amount:1},base:{asset_id:"1.3.0",amount:1}},bitasset_opts:{feed_lifetime_sec:86400,minimum_feeds:7,force_settlement_delay_sec:86400,force_settlement_offset_percent:1*Y.a.GRAPHENE_1_PERCENT,maximum_force_settlement_volume:20*Y.a.GRAPHENE_1_PERCENT,short_backing_asset:"1.3.0"},marketInput:""}}},{key:"_getPermissions",value:function(e){return{flagBooleans:I.a.getFlagBooleans(0,e.isBitAsset),permissionBooleans:I.a.getFlagBooleans("all",e.isBitAsset)}}},{key:"_createAsset",value:function(e){e.preventDefault();var t=this.state,a=t.update,n=t.flagBooleans,s=t.permissionBooleans,r=t.core_exchange_rate,o=t.isBitAsset,i=t.is_prediction_market,l=t.bitasset_opts,c=this.props.account,u=I.a.getFlags(n,o),p=I.a.getPermissions(s,o);this.state.marketInput!==a.description.market&&(a.description.market="");var m=JSON.stringify(a.description);C.a.createAsset(c.get("id"),a,u,p,r,o,i,l,m).then(function(e){console.log("... AssetActions.createAsset(account_id, update)",c.get("id"),a,u,p)})}},{key:"_hasChanged",value:function(){return!z.a.are_equal_shallow(this.state,this.resetState(this.props))}},{key:"_reset",value:function(e){e.preventDefault(),this.setState(this.resetState(this.props))}},{key:"_forcePositive",value:function(e){return parseFloat(e)<0?"0":e}},{key:"_onUpdateDescription",value:function(e,t){var a=this.state.update,n=!0;switch(e){case"condition":if(t.target.value.length>60)return void(n=!1);a.description[e]=t.target.value;break;case"short_name":if(t.target.value.length>32)return void(n=!1);a.description[e]=t.target.value;break;case"market":a.description[e]=t;break;case"visible":a.description[e]=!a.description[e];break;default:a.description[e]=t.target.value}n&&(this.forceUpdate(),this._validateEditFields(a))}},{key:"onChangeBitAssetOpts",value:function(e,t){var a=this.state,n=a.bitasset_opts,s=a.errors;switch(e){case"force_settlement_offset_percent":case"maximum_force_settlement_volume":n[e]=parseFloat(t.target.value)*Y.a.GRAPHENE_1_PERCENT;break;case"minimum_feeds":n[e]=parseInt(t.target.value,10);break;case"feed_lifetime_sec":case"force_settlement_delay_sec":console.log(t.target.value,parseInt(60*parseFloat(t.target.value),10)),n[e]=parseInt(60*parseFloat(t.target.value),10);break;case"short_backing_asset":n[e]=t;break;case"invalid":s.invalid_bitasset=t;break;default:n[e]=t.target.value}var r=!s.symbol&&!s.max_supply&&!s.invalid_bitasset;this.setState({isValid:r,errors:s})}},{key:"_onUpdateInput",value:function(e,t){var a=this.state,n=a.update,s=a.errors,r=!1,o=z.a.get_asset_precision(this.state.update.precision),i=t.target,l=i.selectionStart,c=i.value;switch(e){case"market_fee_percent":n[e]=this._forcePositive(i.value);break;case"max_market_fee":if(new Z.a(c).times(o).gt(ne))return s.max_market_fee="The number you tried to enter is too large",this.setState({errors:s});i.value=z.a.limitByPrecision(i.value,this.state.update.precision),n[e]=i.value;break;case"precision":n[e]=this._forcePositive(i.value);break;case"max_supply":r=!0,new RegExp(/[[:digit:]]/).test(i.value)||(i.value=i.value.replace(/[^0-9.]/g,"")),"."==i.value.charAt(0)&&(i.value="0."),i.value.charAt(i.value.length)!=i.value.search(".")&&i.value.substr(1),i.value=z.a.limitByPrecision(i.value,this.state.update.precision),n[e]=i.value;break;case"symbol":r=!0;var u=i.value.toUpperCase(),p=new RegExp("^[.A-Z0-9]+$");if(""!==u&&!p.test(u))break;W.ChainStore.getAsset(u),n[e]=this._forcePositive(u);break;default:n[e]=i.value}this.setState({update:n},function(){if(r){var t=l-(c.length-n[e].length);i.setSelectionRange(t,t)}}),this._validateEditFields(n)}},{key:"_validateEditFields",value:function(e){var t=this.state.errors;t.max_supply=null,t.symbol=W.ChainValidation.is_valid_symbol_error(e.symbol),W.ChainStore.getAsset(e.symbol)&&(t.symbol=K.a.translate("account.user_issued_assets.exists"));try{t.max_supply=e.max_supply<=0?K.a.translate("account.user_issued_assets.max_positive"):new Z.a(e.max_supply).times(Math.pow(10,e.precision)).gt(ne)?K.a.translate("account.user_issued_assets.too_large"):null}catch(e){console.log("err:",e),t.max_supply=K.a.translate("account.user_issued_assets.too_large")}var a=!t.symbol&&!t.max_supply&&!t.invalid_bitasset;this.setState({isValid:a,errors:t})}},{key:"_onFlagChange",value:function(e){var t=this.state.flagBooleans;t[e]=!t[e],this.setState({flagBooleans:t})}},{key:"_onPermissionChange",value:function(e){var t=this.state.permissionBooleans;t[e]=!t[e],this.setState({permissionBooleans:t})}},{key:"_onInputCoreAsset",value:function(e,t){"quote"===e?this.setState({quoteAssetInput:t}):"base"===e&&this.setState({baseAssetInput:t})}},{key:"_onFoundCoreAsset",value:function(e,t){if(t){var a=this.state.core_exchange_rate;a[e].asset_id=t.get("id"),this.setState({core_exchange_rate:a}),this._validateEditFields({max_supply:this.state.max_supply,core_exchange_rate:a})}}},{key:"_onInputMarket",value:function(e){this.setState({marketInput:e})}},{key:"_onFoundMarketAsset",value:function(e){e&&this._onUpdateDescription("market",e.get("symbol"))}},{key:"_onCoreRateChange",value:function(e,t){var a=void 0,n=void 0;if("quote"===e)a=z.a.limitByPrecision(t.target.value,this.state.update.precision),n=null;else{if(!(t&&"amount"in t))return;a=""==t.amount?"0":z.a.limitByPrecision(t.amount.toString().replace(/,/g,""),this.props.core.get("precision")),n=t.asset.get("id")}this.state.core_exchange_rate[e]={amount:a,asset_id:n},this.forceUpdate()}},{key:"_onToggleBitAsset",value:function(){this.state.update;this.state.isBitAsset=!this.state.isBitAsset,this.state.isBitAsset||(this.state.is_prediction_market=!1);var e=this._getPermissions(this.state),t=e.flagBooleans,a=e.permissionBooleans;this.state.flagBooleans=t,this.state.permissionBooleans=a,this.forceUpdate()}},{key:"_onTogglePM",value:function(){this.state.is_prediction_market=!this.state.is_prediction_market,this.state.update.precision=this.props.core.get("precision"),this.state.core_exchange_rate.base.asset_id=this.props.core.get("id"),this.forceUpdate()}},{key:"render",value:function(){var e=this.props,t=e.globalObject,a=e.core,n=this.state,r=n.errors,o=n.isValid,i=n.update,l=n.flagBooleans,c=n.permissionBooleans,u=n.core_exchange_rate,p=n.is_prediction_market,m=n.isBitAsset,d=n.bitasset_opts,h=i.symbol.length,f="N/A";3===h?f=s.a.createElement(S.a,{amount:Object(X.c)("asset_create",["symbol3"],t),asset:"1.3.0"}):4===h?f=s.a.createElement(S.a,{amount:Object(X.c)("asset_create",["symbol4"],t),asset:"1.3.0"}):h>4&&(f=s.a.createElement(S.a,{amount:Object(X.c)("asset_create",["long_symbol"],t),asset:"1.3.0"}));var b=[],g=function(e,t,a){return s.a.createElement("table",{key:"table_"+e,className:"table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none",width:"80%"}},s.a.createElement(A.a,{content:"account.user_issued_assets."+e}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:t},s.a.createElement("input",{type:"checkbox",checked:a}),s.a.createElement("label",null))))))};for(var _ in c)c[_]&&"charge_market_fee"!==_&&b.push(g(_,this._onFlagChange.bind(this,_),l[_]));b.push(g("visible",this._onUpdateDescription.bind(this,"visible"),!i.description.visible&&!1===i.description.visible));var v=[];for(var y in c)v.push(s.a.createElement("table",{key:"table_"+y,className:"table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none",width:"80%"}},s.a.createElement(A.a,{content:"account.user_issued_assets."+y}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:this._onPermissionChange.bind(this,y)},s.a.createElement("input",{type:"checkbox",checked:c[y],onChange:function(){}}),s.a.createElement("label",null)))))));var E=s.a.createElement("div",null,s.a.createElement("button",{className:"button",onClick:this._reset.bind(this),value:K.a.translate("account.perm.reset")},s.a.createElement(A.a,{content:"account.perm.reset"})),s.a.createElement("button",{className:V()("button",{disabled:!o}),onClick:this._createAsset.bind(this)},s.a.createElement(A.a,{content:"header.create_asset"})));return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement("div",{className:"tabs-header"},s.a.createElement("h3",null,s.a.createElement(A.a,{content:"header.create_asset"}))),s.a.createElement(q.b,{setting:"createAssetTab",className:"account-tabs",tabsClass:"account-overview no-padding bordered-header content-block",contentClass:"grid-block shrink small-vertical medium-horizontal padding",segmented:!1,actionButtons:E},s.a.createElement(q.a,{title:"account.user_issued_assets.primary"},s.a.createElement("div",{className:"small-12 grid-content"},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.symbol"}),s.a.createElement("input",{type:"text",value:i.symbol,onChange:this._onUpdateInput.bind(this,"symbol")})),r.symbol?s.a.createElement("p",{className:"grid-content has-error"},r.symbol):null,s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.max_supply"})," ",i.symbol?s.a.createElement("span",null,"(",i.symbol,")"):null,s.a.createElement("input",{type:"text",value:i.max_supply,onChange:this._onUpdateInput.bind(this,"max_supply")})),r.max_supply?s.a.createElement("p",{className:"grid-content has-error"},r.max_supply):null,s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.decimals"}),s.a.createElement("input",{min:"0",max:"8",step:"1",type:"range",value:i.precision,onChange:this._onUpdateInput.bind(this,"precision")})),s.a.createElement("p",null,i.precision),s.a.createElement("div",{style:{marginBottom:10},className:"txtlabel cancel"},s.a.createElement(A.a,{content:"account.user_issued_assets.precision_warning"})),s.a.createElement("table",{className:"table",style:{width:"inherit"}},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none"}},s.a.createElement(A.a,{content:"account.user_issued_assets.mpa"}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:this._onToggleBitAsset.bind(this)},s.a.createElement("input",{type:"checkbox",checked:m}),s.a.createElement("label",null)))))),m?s.a.createElement("table",{className:"table",style:{width:"inherit"}},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none"}},s.a.createElement(A.a,{content:"account.user_issued_assets.pm"}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:this._onTogglePM.bind(this)},s.a.createElement("input",{type:"checkbox",checked:p}),s.a.createElement("label",null)))))):null,s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.core_exchange_rate"}),s.a.createElement("label",null,s.a.createElement("div",{className:"grid-block no-margin"},r.quote_asset?s.a.createElement("p",{className:"grid-content has-error"},r.quote_asset):null,r.base_asset?s.a.createElement("p",{className:"grid-content has-error"},r.base_asset):null,s.a.createElement("div",{className:"grid-block no-margin small-12 medium-6"},s.a.createElement("div",{className:"amount-selector",style:{width:"100%",paddingRight:"10px"}},s.a.createElement(A.a,{component:"label",content:"account.user_issued_assets.quote"}),s.a.createElement("div",{className:"inline-label"},s.a.createElement("input",{type:"text",placeholder:"0.0",onChange:this._onCoreRateChange.bind(this,"quote"),value:u.quote.amount})))),s.a.createElement("div",{className:"grid-block no-margin small-12 medium-6"},s.a.createElement(Q.a,{label:"account.user_issued_assets.base",amount:u.base.amount,onChange:this._onCoreRateChange.bind(this,"base"),asset:u.base.asset_id,assets:[u.base.asset_id],placeholder:"0.0",tabIndex:1,style:{width:"100%",paddingLeft:"10px"}}))),s.a.createElement("div",null,s.a.createElement("h5",null,s.a.createElement(A.a,{content:"exchange.price"}),s.a.createElement("span",null,":"," ",z.a.format_number(z.a.get_asset_price(u.quote.amount*z.a.get_asset_precision(i.precision),{precision:i.precision},u.base.amount*z.a.get_asset_precision(a),a),2+(parseInt(i.precision,10)||8))),s.a.createElement("span",null," ",i.symbol,"/",a.get("symbol"))))),s.a.createElement("div",null,s.a.createElement(A.a,{content:"account.user_issued_assets.cer_warning_1",component:"label",className:"has-error"}),s.a.createElement(A.a,{content:"account.user_issued_assets.cer_warning_2",component:"p"})),s.a.createElement("p",null,s.a.createElement(A.a,{content:"account.user_issued_assets.approx_fee"}),": ",f))),s.a.createElement(q.a,{title:"account.user_issued_assets.description"},s.a.createElement("div",{className:"small-12 grid-content"},s.a.createElement(A.a,{component:"label",content:"account.user_issued_assets.description"}),s.a.createElement("label",null,s.a.createElement("textarea",{style:{height:"7rem"},rows:"1",value:i.description.main,onChange:this._onUpdateDescription.bind(this,"main")})),s.a.createElement(A.a,{component:"label",content:"account.user_issued_assets.short"}),s.a.createElement("label",null,s.a.createElement("input",{type:"text",rows:"1",value:i.description.short_name,onChange:this._onUpdateDescription.bind(this,"short_name")})),s.a.createElement(A.a,{component:"label",content:"account.user_issued_assets.market"}),s.a.createElement(G.a,{label:"account.user_issued_assets.name",onChange:this._onInputMarket.bind(this),asset:this.state.marketInput,assetInput:this.state.marketInput,style:{width:"100%",paddingRight:"10px"},onFound:this._onFoundMarketAsset.bind(this)}),p?s.a.createElement("div",null,s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.condition"}),s.a.createElement("label",null,s.a.createElement("input",{type:"text",rows:"1",value:i.description.condition,onChange:this._onUpdateDescription.bind(this,"condition")})),s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.expiry"}),s.a.createElement("label",null,s.a.createElement("input",{type:"date",value:i.description.expiry,onChange:this._onUpdateDescription.bind(this,"expiry")}))):null)),m?s.a.createElement(q.a,{title:"account.user_issued_assets.bitasset_opts"},s.a.createElement(se,{bitasset_opts:d,onUpdate:this.onChangeBitAssetOpts.bind(this),backingAsset:d.short_backing_asset,assetPrecision:i.precision,assetSymbol:i.symbol,isPredictionMarket:p})):null,s.a.createElement(q.a,{title:"account.permissions"},s.a.createElement("div",{className:"small-12 grid-content"},s.a.createElement("div",{style:{maxWidth:800}},s.a.createElement(U.a,{path:"components/AccountAssetCreate",section:"permissions"})),v)),s.a.createElement(q.a,{title:"account.user_issued_assets.flags"},s.a.createElement("div",{className:"small-12 grid-content"},s.a.createElement("div",{style:{maxWidth:800}},s.a.createElement(U.a,{path:"components/AccountAssetCreate",section:"flags"})),c.charge_market_fee?s.a.createElement("div",null,s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.market_fee"}),s.a.createElement("table",{className:"table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none",width:"80%"}},s.a.createElement(A.a,{content:"account.user_issued_assets.charge_market_fee"}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:this._onFlagChange.bind(this,"charge_market_fee")},s.a.createElement("input",{type:"checkbox",checked:l.charge_market_fee}),s.a.createElement("label",null)))))),s.a.createElement("div",{className:V()({disabled:!l.charge_market_fee})},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.market_fee"})," ","(%)",s.a.createElement("input",{type:"number",value:i.market_fee_percent,onChange:this._onUpdateInput.bind(this,"market_fee_percent")})),s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.max_market_fee"})," ","(",i.symbol,")",s.a.createElement("input",{type:"number",value:i.max_market_fee,onChange:this._onUpdateInput.bind(this,"max_market_fee")})),r.max_market_fee?s.a.createElement("p",{className:"grid-content has-error"},r.max_market_fee):null)):null,s.a.createElement("h3",null,s.a.createElement(A.a,{content:"account.user_issued_assets.flags"})),b))))))}}]),t}();re.propTypes={core:c.a.ChainAsset.isRequired,globalObject:c.a.ChainObject.isRequired},re.defaultProps={globalObject:"2.0.0",core:"1.3.0"},re=Object(u.a)(re);var oe=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var ie=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return 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)}(t,s.a.Component),oe(t,[{key:"getFee",value:function(){return Object(X.c)(this.props.opType,this.props.options,this.props.globalObject)}},{key:"render",value:function(){var e=this.props,t=e.opType,a=e.options,n=e.globalObject;if(!t||!a||!n)return null;var r=Object(X.c)(t,a,n);return s.a.createElement(S.a,{amount:r,asset:"1.3.0"})}}]),t}();ie.propTypes={globalObject:c.a.ChainObject.isRequired,opType:E.a.string,options:E.a.array},ie.defaultProps={globalObject:"2.0.0",options:[]};var le=Object(u.a)(ie),ce=a(143),ue=a(141),pe=a(166),me=a(253),de=a(23),he=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var fe=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.state={listType:e.assetWhiteListType,accountTable:-1===e.assetWhiteListType.indexOf("market"),listTypes:["whitelist_authorities","blacklist_authorities","whitelist_markets","blacklist_markets"],assetInput:null,asset_id:null},a}return 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)}(t,s.a.Component),he(t,[{key:"renderAccountTables",value:function(){var e=this,t=this.state.listType;return this.props.whiteListEnabled?s.a.createElement("div",null,s.a.createElement("table",{className:"table dashboard-table table-hover"},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null,s.a.createElement(A.a,{content:"explorer.account.title"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.perm.remove_text"})))),s.a.createElement("tbody",null,this.props[t].map(function(a){return s.a.createElement("tr",{key:a},s.a.createElement("td",null,s.a.createElement(ue.a,{account:a})),s.a.createElement("td",{className:"clickable",onClick:e.props.onChangeList.bind(e,t,"remove",a)},s.a.createElement(M.a,{name:"cross-circle",title:"icons.cross_circle.remove",className:"icon-14px"})))}))),s.a.createElement("div",{style:{paddingTop:"2rem"}},s.a.createElement(me.a,{label:"account.whitelist."+t,accountName:this.props.authority_name,account:this.props.authority_name,onChange:this.props.onAccountNameChanged.bind(this,"authority_name"),onAccountChanged:this.props.onAccountChanged.bind(this,"new_authority_id"),error:null,tabIndex:1,action_label:"account.perm.confirm_add",onAction:this.props.onChangeList.bind(this,t,"add",this.props.new_authority_id)}))):s.a.createElement("div",null,s.a.createElement(A.a,{className:"txtlabel cancel",component:"p",content:"explorer.asset.whitelist.enable_flag"}))}},{key:"_onAssetChange",value:function(e){this.setState({assetInput:e})}},{key:"_onAssetFound",value:function(e){this.setState({asset_id:e?e.get("id"):null})}},{key:"renderMarketTable",value:function(){var e=this,t=this.state.listType;return s.a.createElement("div",null,s.a.createElement("table",{className:"table dashboard-table table-hover"},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null,s.a.createElement(A.a,{content:"explorer.asset.title"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.perm.remove_text"})))),s.a.createElement("tbody",null,this.props[t].map(function(a){return s.a.createElement("tr",{key:a},s.a.createElement("td",null,s.a.createElement(pe.a,{asset:a})),s.a.createElement("td",{className:"clickable",onClick:e.props.onChangeList.bind(e,t,"remove",a)},s.a.createElement(M.a,{name:"cross-circle",title:"icons.cross_circle.remove",className:"icon-14px"})))}))),s.a.createElement("div",{style:{paddingTop:"2rem"}},s.a.createElement(G.a,{label:"explorer.asset.whitelist."+t,onChange:this._onAssetChange.bind(this),asset:this.state.assetInput,assetInput:this.state.assetInput,tabIndex:1,style:{width:"100%"},onFound:this._onAssetFound.bind(this),action_label:"account.perm.confirm_add",onAction:this.props.onChangeList.bind(this,t,"add",this.state.asset_id)})))}},{key:"_onSwitchType",value:function(e){this.setState({listType:e,accountTable:-1===e.indexOf("market")}),de.a.changeViewSetting({assetWhiteListType:e})}},{key:"render",value:function(){var e=this,t=this.state.accountTable,a=this.state.listTypes.indexOf(this.state.listType);return s.a.createElement("div",{className:"small-12 large-8 large-offset-2 grid-content"},s.a.createElement("div",null,s.a.createElement("div",{className:"header-selector",style:{paddingBottom:"2rem"}},s.a.createElement("div",{className:"selector"},this.state.listTypes.map(function(t,n){return s.a.createElement("div",{key:t,className:V()("inline-block",{inactive:a!==n}),onClick:e._onSwitchType.bind(e,t)},s.a.createElement(A.a,{content:"explorer.asset.whitelist."+t}))}))),t?this.renderAccountTables():this.renderMarketTable(),this.props.children))}}]),t}(),be=Object(p.a)(fe,{listenTo:function(){return[i.a]},getProps:function(){return{assetWhiteListType:i.a.getState().viewSettings.get("assetWhiteListType","whitelist_authorities")}}}),ge=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var _e=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={producer_name:null},a}return 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)}(t,s.a.Component),ge(t,[{key:"onAccountChanged",value:function(e){this.setState({new_producer_id:e?e.get("id"):null})}},{key:"onAccountNameChanged",value:function(e){this.setState({producer_name:e})}},{key:"render",value:function(){var e=this,t=this.props,a=t.witnessFed,n=t.committeeFed;return a||n?s.a.createElement("div",{className:"grid-content small-12 large-8 large-offset-2"},s.a.createElement(A.a,{component:"p",content:"account.user_issued_assets.feed_not_allowed_1",className:"has-error"}),s.a.createElement(A.a,{component:"p",content:"account.user_issued_assets.feed_not_allowed_2"})):s.a.createElement("div",{className:"grid-content small-12 large-8 large-offset-2"},s.a.createElement("table",{className:"table dashboard-table table-hover"},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null),s.a.createElement("th",{style:{textAlign:"left"}},s.a.createElement(A.a,{content:"explorer.account.title"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.perm.remove_text"})))),s.a.createElement("tbody",null,this.props.producers.map(function(t,a){return s.a.createElement("tr",{key:t},s.a.createElement("td",{style:{textAlign:"left"}},"#",a+1),s.a.createElement("td",{style:{textAlign:"left"}},s.a.createElement(ue.a,{account:t})),s.a.createElement("td",{className:"clickable",onClick:e.props.onChangeList.bind(e,"remove",t)},s.a.createElement(M.a,{name:"cross-circle",title:"icons.cross_circle.remove",className:"icon-14px"})))}))),s.a.createElement("div",{style:{paddingTop:"2rem"}},s.a.createElement(me.a,{label:"account.user_issued_assets.add_feed",accountName:this.state.producer_name,account:this.state.producer_name,onChange:this.onAccountNameChanged.bind(this),onAccountChanged:this.onAccountChanged.bind(this),error:null,tabIndex:1,action_label:"account.perm.confirm_add",onAction:this.props.onChangeList.bind(this,"add",this.state.new_producer_id)})))}}]),t}(),ve=a(2073),ye=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Ee=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function we(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ae(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 Ce(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)}var Oe=new Z.a(Y.a.GRAPHENE_MAX_SHARE_SUPPLY),xe=function(e){function t(e){ke(this,t);var a=Ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state=a.resetState(e),a}return Ce(t,s.a.Component),Ee(t,[{key:"_openConfirm",value:function(){this.refs.confirm_modal.show()}},{key:"_cancelConfirm",value:function(){this.refs.confirm_modal.onClose()}},{key:"resetState",value:function(e){var t=e.asset.toJS(),a=void 0!==t.bitasset_data_id,n=z.a.get_asset_precision(t.precision),s=z.a.get_asset_precision(e.core.get("precision")),r=new Z.a(t.options.max_market_fee).div(n).toString(),o=new Z.a(t.options.max_supply).div(n).toString(),i=t.options.core_exchange_rate;i.quote.amount=i.quote.asset_id===t.id?new Z.a(i.quote.amount).div(n).toString():new Z.a(i.quote.amount).div(s).toString(),i.base.amount=i.base.asset_id===t.id?new Z.a(i.base.amount).div(n).toString():new Z.a(i.base.amount).div(s).toString();var l=I.a.getFlagBooleans(t.options.flags,a),c=I.a.getFlagBooleans(t.options.issuer_permissions,a);t.options.market_fee_percent/=100;var u=W.ChainStore.getAsset(i.quote.asset_id).get("symbol"),p=W.ChainStore.getAsset(i.base.asset_id).get("symbol");return{update:{max_supply:o,max_market_fee:r,market_fee_percent:t.options.market_fee_percent,description:I.a.parseDescription(t.options.description)},core_exchange_rate:i,issuer:t.issuer,new_issuer_account_id:null,new_funder_account:e.account.get("id"),asset_to_update:t.id,errors:{max_supply:null},new_authority_id:null,authority_name:null,isValid:!0,flagBooleans:l,permissionBooleans:c,isBitAsset:a,coreRateQuoteAssetName:u,quoteAssetInput:u,coreRateBaseAssetName:p,baseAssetInput:p,claimFeesAmount:0,bitasset_opts:a?t.bitasset.options:null,original_bitasset_opts:a?e.asset.getIn(["bitasset","options"]).toJS():null,marketInput:"",whitelist_authorities:e.asset.getIn(["options","whitelist_authorities"]),blacklist_authorities:e.asset.getIn(["options","blacklist_authorities"]),whitelist_markets:e.asset.getIn(["options","whitelist_markets"]),blacklist_markets:e.asset.getIn(["options","blacklist_markets"]),maxFeedProducers:e.globalObject.getIn(["parameters","maximum_asset_feed_publishers"]),feedProducers:a?e.asset.getIn(["bitasset","feeds"],[]).map(function(e){return e.first()}):null,originalFeedProducers:a?e.asset.getIn(["bitasset","feeds"],[]).map(function(e){return e.first()}):null}}},{key:"assetChanged",value:function(){var e=this.state,t=this.resetState(this.props);return JSON.stringify(e.update)!==JSON.stringify(t.update)||JSON.stringify(e.core_exchange_rate)!==JSON.stringify(t.core_exchange_rate)||null!==e.new_issuer_account_id&&e.new_issuer_account_id!==e.issuer||JSON.stringify(e.flagBooleans)!==JSON.stringify(t.flagBooleans)||JSON.stringify(e.permissionBooleans)!==JSON.stringify(t.permissionBooleans)||JSON.stringify(e.whitelist_authorities)!==JSON.stringify(t.whitelist_authorities)||JSON.stringify(e.blacklist_authorities)!==JSON.stringify(t.blacklist_authorities)||JSON.stringify(e.whitelist_markets)!==JSON.stringify(t.whitelist_markets)||JSON.stringify(e.blacklist_markets)!==JSON.stringify(t.blacklist_markets)}},{key:"tabChanged",value:function(e){var t=this.tabsChanged();return!!t[e]&&t[e]}},{key:"tabsChanged",value:function(){var e=this.state,t=this.resetState(this.props),a=[];return e.update.max_supply===t.update.max_supply&&e.core_exchange_rate.base.amount===t.core_exchange_rate.base.amount&&e.core_exchange_rate.quote.amount===t.core_exchange_rate.quote.amount||(a[0]=!0),JSON.stringify(e.whitelist_authorities)===JSON.stringify(t.whitelist_authorities)&&JSON.stringify(e.blacklist_authorities)===JSON.stringify(t.blacklist_authorities)&&JSON.stringify(e.whitelist_markets)===JSON.stringify(t.whitelist_markets)&&JSON.stringify(e.blacklist_markets)===JSON.stringify(t.blacklist_markets)||(a[1]=!0),e.update.description.main===t.update.description.main&&e.update.description.short_name===t.update.description.short_name&&e.update.description.market===t.update.description.market||(a[2]=!0),JSON.stringify(e.bitasset_opts)!==JSON.stringify(t.original_bitasset_opts)&&(a[3]=!0),JSON.stringify(e.permissionBooleans)!==JSON.stringify(t.permissionBooleans)&&(a[4]=!0),JSON.stringify(e.flagBooleans)===JSON.stringify(t.flagBooleans)&&e.update.market_fee_percent===t.update.market_fee_percent&&e.update.max_market_fee===t.update.max_market_fee||(a[5]=!0),JSON.stringify(e.feedProducers)!==JSON.stringify(t.originalFeedProducers)&&(a[6]=!0),a}},{key:"pageChanged",value:function(){var e=this.state,t=e.isBitAsset,a=e.bitasset_opts,n=e.original_bitasset_opts,s=e.feedProducers,r=e.originalFeedProducers;return this.assetChanged()||t&&(JSON.stringify(a)!==JSON.stringify(n)||!z.a.are_equal_shallow(s.toJS(),r.toJS()))}},{key:"_updateAsset",value:function(e){var t=this;e.preventDefault(),this.refs.confirm_modal.onClose();var a=this.state,n=a.update,s=a.issuer,r=a.new_issuer_account_id,o=a.core_exchange_rate,i=a.flagBooleans,l=a.permissionBooleans,c=a.isBitAsset,u=a.bitasset_opts,p=a.original_bitasset_opts,m=a.feedProducers,d=a.originalFeedProducers,h=I.a.getFlags(i);128&this.props.asset.getIn(["options","flags"])&&!(128&this.props.asset.getIn(["options","issuer_permissions"]))&&(h+=128);var f=I.a.getPermissions(l,c);this.state.marketInput!==n.description.market&&(n.description.market="");var b=JSON.stringify(n.description),g={whitelist_authorities:this.state.whitelist_authorities,blacklist_authorities:this.state.blacklist_authorities,whitelist_markets:this.state.whitelist_markets,blacklist_markets:this.state.blacklist_markets},_=c?m.toJS():null,v=c?d.toJS():null;C.a.updateAsset(s,r,n,o,this.props.asset,h,f,c,u,p,b,g,_,v,this.assetChanged()).then(function(){console.log("... AssetActions.updateAsset(account_id, update)",s,r,t.props.asset.get("id"),n),setTimeout(function(){W.ChainStore.getAsset(t.props.asset.get("id")),t.setState(t.resetState(t.props))},3e3)})}},{key:"_reset",value:function(e){e.preventDefault(),this.setState(this.resetState(this.props))}},{key:"_forcePositive",value:function(e){return parseFloat(e)<0?"0":e}},{key:"_onUpdateDescription",value:function(e,t){var a=this.state.update,n=!0;switch(e){case"condition":if(t.target.value.length>60)return void(n=!1);a.description[e]=t.target.value;break;case"short_name":if(t.target.value.length>32)return void(n=!1);a.description[e]=t.target.value;break;case"market":a.description[e]=t;break;case"visible":a.description[e]=!a.description[e];break;default:a.description[e]=t.target.value}n&&(this.forceUpdate(),this._validateEditFields(a))}},{key:"onChangeBitAssetOpts",value:function(e,t){var a=this.state.bitasset_opts;switch(e){case"force_settlement_offset_percent":case"maximum_force_settlement_volume":a[e]=parseFloat(t.target.value)*Y.a.GRAPHENE_1_PERCENT;break;case"feed_lifetime_sec":case"force_settlement_delay_sec":console.log(t.target.value,parseInt(60*parseFloat(t.target.value),10)),a[e]=parseInt(60*parseFloat(t.target.value),10);break;case"short_backing_asset":a[e]=t}this.forceUpdate()}},{key:"_onUpdateInput",value:function(e,t){var a=this.state.update,n=!0,s=z.a.get_asset_precision(this.props.asset.get("precision"));switch(e){case"market_fee_percent":a[e]=this._forcePositive(t.target.value);break;case"max_market_fee":var r=t.amount.replace(/,/g,"");if(new Z.a(r).times(s).gt(Oe))return n=!1,this.setState({errors:{max_market_fee:"The number you tried to enter is too large"}});a[e]=z.a.limitByPrecision(r,this.props.asset.get("precision"));break;case"max_supply":var o=t.amount.replace(/,/g,"");a[e]=z.a.limitByPrecision(o,this.props.asset.get("precision"));break;default:a[e]=t.target.value}n&&(this.setState({update:a}),this._validateEditFields(a))}},{key:"_validateEditFields",value:function(e){var t=e.core_exchange_rate,a=e.feedProducers?e.feedProducers:this.state.feedProducers,n=this.state.flagBooleans,s=this.props,r=s.asset,o=s.core,i={max_supply:null,quote_asset:null,base_asset:null,max_feed_producer:null,conflict_producer:null,invalid_market_pair:null},l=this.props.asset.get("precision");try{i.max_supply=e.max_supply<=0?K.a.translate("account.user_issued_assets.max_positive"):new Z.a(parseInt(e.max_supply,10)).times(Math.pow(10,l)).gt(Oe)?K.a.translate("account.user_issued_assets.too_large"):null}catch(e){console.log("err:",e),i.max_supply=K.a.translate("account.user_issued_assets.too_large")}t&&(t.quote.asset_id!==r.get("id")&&t.base.asset_id!==r.get("id")&&(i.quote_asset=K.a.translate("account.user_issued_assets.need_asset",{name:r.get("symbol")})),t.quote.asset_id!==o.get("id")&&t.base.asset_id!==o.get("id")&&(i.base_asset=K.a.translate("account.user_issued_assets.need_asset",{name:o.get("symbol")}))),a&&a.size>this.state.maxFeedProducers&&(i.max_feed_producer=K.a.translate("account.user_issued_assets.too_many_feed",{max:this.state.maxFeedProducers})),n.committee_fed_asset&&n.witness_fed_asset&&(i.conflict_producer=K.a.translate("account.user_issued_assets.conflict_feed")),this.state.marketInput==this.props.asset.get("symbol")&&(i.invalid_market_pair=K.a.translate("account.user_issued_assets.invalid_market_pair"));var c=!(i.invalid_market_pair||i.max_supply||i.base_asset||i.quote_asset||i.max_feed_producer||i.conflict_producer);this.setState({isValid:c,errors:i})}},{key:"_onCoreRateChange",value:function(e,t){t.amount=""==t.amount?"0":t.amount.replace(/,/g,""),t.amount=z.a.limitByPrecision(t.amount,t.asset.get("precision")),this.state.core_exchange_rate[e]={amount:t.amount,asset_id:t.asset.get("id")},this.forceUpdate()}},{key:"onAccountChanged",value:function(e,t){this.setState(we({},e,t?t.get("id"):null))}},{key:"onAccountNameChanged",value:function(e,t){this.setState(we({},e,t))}},{key:"_onInputCoreAsset",value:function(e,t){"quote"===e?this.setState({quoteAssetInput:t}):"base"===e&&this.setState({baseAssetInput:t})}},{key:"_onFoundCoreAsset",value:function(e,t){if(t){var a=this.state.core_exchange_rate;a[e].asset_id=t.get("id"),this.setState({core_exchange_rate:a}),this._validateEditFields({max_supply:this.state.max_supply,core_exchange_rate:a})}}},{key:"_onInputMarket",value:function(e){this.setState({marketInput:e})}},{key:"_onFoundMarketAsset",value:function(e){e&&this._onUpdateDescription("market",e.get("symbol"))}},{key:"_onFlagChange",value:function(e){var t=this.state.flagBooleans;t[e]=!t[e],this.setState({flagBooleans:t}),this._validateEditFields({})}},{key:"_onPermissionChange",value:function(e){var t=this.state.permissionBooleans;t[e]=!t[e],this.setState({permissionBooleans:t})}},{key:"_onClaimInput",value:function(e){this.setState({claimFeesAmount:e.amount})}},{key:"onChangeList",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"add",a=arguments[2],n=this.state[e];"add"!==t||n.includes(a)?"remove"===t&&n.includes(a)&&(n=n.remove(n.indexOf(a))):n=n.push(a),this.setState(we({},e,n))}},{key:"onChangeFeedProducerList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"add",t=arguments[1],a=this.state.feedProducers;"add"!==e||a.includes(t)?"remove"===e&&a.includes(t)&&(a=a.remove(a.indexOf(t))):a=a.push(t),this.setState({feedProducers:a}),this._validateEditFields({feedProducers:a})}},{key:"render",value:function(){var e,t=this,a=this.props.asset,n=this.state,r=n.errors,o=n.isValid,i=n.update,l=n.core_exchange_rate,c=n.flagBooleans,u=n.permissionBooleans,p=(n.claimFeesAmount,n.isBitAsset),m=n.bitasset_opts,d=a.get("symbol");e=s.a.createElement(le,{opType:"asset_update"});var h=W.ChainStore.getAsset(l.quote.asset_id),f=z.a.get_asset_precision(h.get("precision")),b=W.ChainStore.getAsset(l.base.asset_id),g=z.a.get_asset_precision(b.get("precision")),_=parseFloat(l.quote.amount)*f,v=parseFloat(l.base.amount)*g,y=I.a.getFlagBooleans(a.getIn(["options","issuer_permissions"]),void 0!==a.get("bitasset")),E=[],w=function(e,t,a){return s.a.createElement("table",{key:"table_"+e,className:"table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none",width:"80%"}},s.a.createElement(A.a,{content:"account.user_issued_assets."+e}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:t},s.a.createElement("input",{type:"checkbox",checked:a}),s.a.createElement("label",null))))))};for(var k in y)y[k]&&"charge_market_fee"!==k&&E.push(w(k,this._onFlagChange.bind(this,k),c[k]));E.push(w("visible",this._onUpdateDescription.bind(this,"visible"),!i.description.visible&&!1===i.description.visible));var C=[];for(var O in y)C.push(s.a.createElement("table",{key:"table_"+O,className:"table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none",width:"80%"}},s.a.createElement(A.a,{content:"account.user_issued_assets."+O}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:this._onPermissionChange.bind(this,O)},s.a.createElement("input",{type:"checkbox",checked:u[O],onChange:function(){}}),s.a.createElement("label",null)))))));var x=0;this.tabsChanged().forEach(function(){x++});var S=s.a.createElement("div",null,s.a.createElement("button",{className:V()("button",{disabled:!o||!this.pageChanged()}),style:{width:"9rem"},onClick:x>1?this._openConfirm.bind(this):this._updateAsset.bind(this)},x>1?s.a.createElement(A.a,{content:"account.perm.save_all"}):s.a.createElement(A.a,{content:"account.perm.save"})),s.a.createElement("button",{className:V()("button primary hollow",{disabled:!this.pageChanged()}),onClick:this._reset.bind(this)},s.a.createElement(A.a,{content:"account.perm.reset"}))),N=!1;"1.3.0"!==h.get("id")&&"1.3.0"!==b.get("id")||h.get("id")!==a.get("id")&&b.get("id")!==a.get("id")||(N=!0);var j=a.getIn(["bitasset","is_prediction_market"]),P=I.a.parseDescription(this.props.asset.toJS().options.description);return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement("div",{className:"tabs-header"},s.a.createElement("h3",null,s.a.createElement(A.a,{content:"header.update_asset"}),":"," ",d)),s.a.createElement(q.b,{setting:"updateAssetTab",className:"account-tabs",tabsClass:"account-overview bordered-header content-block",contentClass:"grid-block padding-top shrink small-vertical medium-horizontal",segmented:!1,actionButtons:S,onChangeTab:function(e){t.setState({activeTab:e})}},s.a.createElement(q.a,{title:"account.user_issued_assets.primary",updatedTab:this.tabChanged(0)},s.a.createElement("div",{className:"small-12 large-8 large-offset-2 grid-content"},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.precision"}),s.a.createElement("span",null,": ",a.get("precision"))),s.a.createElement("br",null),s.a.createElement("label",null,s.a.createElement(Q.a,{label:"account.user_issued_assets.max_supply",amount:i.max_supply,onChange:this._onUpdateInput.bind(this,"max_supply"),asset:a.get("id"),assets:[a.get("id")],placeholder:"0.0",tabIndex:1})),r.max_supply?s.a.createElement("p",{className:"grid-content has-error"},r.max_supply):null,s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.core_exchange_rate"}),s.a.createElement("label",null,s.a.createElement("div",{className:"grid-block no-margin"},N?null:s.a.createElement("div",{className:"grid-block no-margin small-12 medium-6"},s.a.createElement(G.a,{label:"account.user_issued_assets.quote_name",onChange:this._onInputCoreAsset.bind(this,"quote"),asset:this.state.quoteAssetInput,assetInput:this.state.quoteAssetInput,tabIndex:1,style:{width:"100%",paddingRight:"10px"},onFound:this._onFoundCoreAsset.bind(this,"quote")})),N?null:s.a.createElement("div",{className:"grid-block no-margin small-12 medium-6"},s.a.createElement(G.a,{label:"account.user_issued_assets.base_name",onChange:this._onInputCoreAsset.bind(this,"base"),asset:this.state.baseAssetInput,assetInput:this.state.baseAssetInput,tabIndex:1,style:{width:"100%",paddingLeft:"10px"},onFound:this._onFoundCoreAsset.bind(this,"base")})),r.quote_asset?s.a.createElement("p",{className:"grid-content has-error"},r.quote_asset):null,r.base_asset?s.a.createElement("p",{className:"grid-content has-error"},r.base_asset):null,s.a.createElement("div",{className:"grid-block no-margin small-12 medium-6"},s.a.createElement(Q.a,{label:"account.user_issued_assets.quote",amount:l.quote.amount,onChange:this._onCoreRateChange.bind(this,"quote"),asset:l.quote.asset_id,assets:[l.quote.asset_id],placeholder:"0.0",tabIndex:1,style:{width:"100%",paddingRight:"10px"}})),s.a.createElement("div",{className:"grid-block no-margin small-12 medium-6"},s.a.createElement(Q.a,{label:"account.user_issued_assets.base",amount:l.base.amount,onChange:this._onCoreRateChange.bind(this,"base"),asset:l.base.asset_id,assets:[l.base.asset_id],placeholder:"0.0",tabIndex:1,style:{width:"100%",paddingLeft:"10px"}}))),s.a.createElement("div",null,s.a.createElement("h5",null,s.a.createElement(A.a,{content:"exchange.price"}),":"," ",s.a.createElement(ce.a,{style:{fontWeight:"bold"},quote_amount:_,quote_asset:l.quote.asset_id,base_asset:l.base.asset_id,base_amount:v})))),s.a.createElement("div",null,s.a.createElement(A.a,{content:"account.user_issued_assets.cer_warning_1",component:"label",className:"has-error"}),s.a.createElement(A.a,{content:"account.user_issued_assets.cer_warning_2",component:"p"})),s.a.createElement("p",null,s.a.createElement(A.a,{content:"account.user_issued_assets.approx_fee"}),": ",e))),s.a.createElement(q.a,{title:"account.whitelist.title",updatedTab:this.tabChanged(1)},s.a.createElement(be,{whiteListEnabled:c.white_list,whitelist_authorities:this.state.whitelist_authorities,blacklist_authorities:this.state.blacklist_authorities,whitelist_markets:this.state.whitelist_markets,blacklist_markets:this.state.blacklist_markets,new_authority_id:this.state.new_authority_id,authority_name:this.state.authority_name,onAccountNameChanged:this.onAccountNameChanged.bind(this),onAccountChanged:this.onAccountChanged.bind(this),onChangeList:this.onChangeList.bind(this)},s.a.createElement("p",null,s.a.createElement(A.a,{content:"account.user_issued_assets.approx_fee"}),": ",e))),s.a.createElement(q.a,{title:"account.user_issued_assets.description",updatedTab:this.tabChanged(2)},s.a.createElement("div",{className:"small-12 large-8 large-offset-2 grid-content"},s.a.createElement("label",null,s.a.createElement("textarea",{style:{height:"7rem"},rows:"1",value:i.description.main||"",onChange:this._onUpdateDescription.bind(this,"main")})),s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.short"}),s.a.createElement("label",null,s.a.createElement("input",{type:"text",rows:"1",value:i.description.short_name||"",onChange:this._onUpdateDescription.bind(this,"short_name")})),s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.market"}),s.a.createElement(G.a,{label:"account.user_issued_assets.name",onChange:this._onInputMarket.bind(this),placeholder:P.market,asset:this.state.marketInput,assetInput:this.state.marketInput,style:{width:"100%",paddingRight:"10px",paddingBottom:"20px"},onFound:this._onFoundMarketAsset.bind(this)}),r.invalid_market_pair?s.a.createElement("p",{className:"grid-content has-error"},r.invalid_market_pair):null,j?s.a.createElement("div",null,s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.condition"}),s.a.createElement("label",null,s.a.createElement("input",{type:"text",rows:"1",value:i.description.condition,onChange:this._onUpdateDescription.bind(this,"condition")})),s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.expiry"}),s.a.createElement("label",null,s.a.createElement("input",{type:"date",value:i.description.expiry,onChange:this._onUpdateDescription.bind(this,"expiry")}))):null,s.a.createElement("p",null,s.a.createElement(A.a,{content:"account.user_issued_assets.approx_fee"}),": ",e))),p?s.a.createElement(q.a,{title:"account.user_issued_assets.bitasset_opts",updatedTab:this.tabChanged(3)},s.a.createElement("div",{className:"small-12 large-8 large-offset-2 grid-content"},s.a.createElement(se,{bitasset_opts:m,onUpdate:this.onChangeBitAssetOpts.bind(this),backingAsset:m.short_backing_asset,assetPrecision:a.get("precision"),assetSymbol:a.get("symbol")}),s.a.createElement("p",null,s.a.createElement(A.a,{content:"account.user_issued_assets.approx_fee"}),": ",e))):null,s.a.createElement(q.a,{title:"account.permissions",updatedTab:this.tabChanged(4)},s.a.createElement("div",{className:"small-12 large-8 large-offset-2 grid-content"},s.a.createElement(U.a,{path:"components/AccountAssetCreate",section:"permissions"}),s.a.createElement("p",{className:"grid-content has-error"},s.a.createElement(A.a,{content:"account.user_issued_assets.perm_warning"})),C,s.a.createElement("p",null,s.a.createElement(A.a,{content:"account.user_issued_assets.approx_fee"}),": ",e))),s.a.createElement(q.a,{title:"account.user_issued_assets.flags",updatedTab:this.tabChanged(5)},s.a.createElement("div",{className:"small-12 large-8 large-offset-2 grid-content"},s.a.createElement(U.a,{path:"components/AccountAssetCreate",section:"flags"}),y.charge_market_fee?s.a.createElement("div",null,s.a.createElement(A.a,{component:"h3",content:"account.user_issued_assets.market_fee"}),s.a.createElement("table",{className:"table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{style:{border:"none",width:"80%"}},s.a.createElement(A.a,{content:"account.user_issued_assets.charge_market_fee"}),":"),s.a.createElement("td",{style:{border:"none"}},s.a.createElement("div",{className:"switch",style:{marginBottom:"10px"},onClick:this._onFlagChange.bind(this,"charge_market_fee")},s.a.createElement("input",{type:"checkbox",onChange:function(){},checked:c.charge_market_fee}),s.a.createElement("label",null)))))),s.a.createElement("div",{className:V()({disabled:!c.charge_market_fee})},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.user_issued_assets.market_fee"})," ","(%)",s.a.createElement("input",{type:"number",value:i.market_fee_percent,onChange:this._onUpdateInput.bind(this,"market_fee_percent")})),s.a.createElement("label",null,s.a.createElement(Q.a,{label:"account.user_issued_assets.max_market_fee",amount:i.max_market_fee,onChange:this._onUpdateInput.bind(this,"max_market_fee"),asset:a.get("id"),assets:[a.get("id")],placeholder:"0.0",tabIndex:1})),r.max_market_fee?s.a.createElement("p",{className:"grid-content has-error"},r.max_market_fee):null)):null,s.a.createElement("h3",null,s.a.createElement(A.a,{content:"account.user_issued_assets.flags"})),E,s.a.createElement("p",null,s.a.createElement(A.a,{content:"account.user_issued_assets.approx_fee"}),": ",e),r.conflict_producer?s.a.createElement("p",{className:"grid-content has-error"},r.conflict_producer):null)),p?s.a.createElement(q.a,{title:"account.user_issued_assets.feed_producers",updatedTab:this.tabChanged(6)},s.a.createElement(_e,{asset:this.props.asset,account:this.props.account,witnessFed:c.witness_fed_asset,committeeFed:c.committee_fed_asset,producers:this.state.feedProducers,onChangeList:this.onChangeFeedProducerList.bind(this)}),r.max_feed_producer?s.a.createElement("p",{className:"grid-content has-error large-8 large-offset-2",style:{marginTop:"20px"}},r.max_feed_producer):null):null))),s.a.createElement(Se,ye({modalId:"asset_update_modal",ref:"confirm_modal",tabsChanged:this.tabsChanged(),_cancelConfirm:this._cancelConfirm.bind(this),_updateAsset:this._updateAsset.bind(this)},this.props)))}}]),t}();xe.propTypes={globalObject:c.a.ChainObject.isRequired},xe.defaultProps={globalObject:"2.0.0"},xe=Object(u.a)(xe),xe=Object(R.a)(xe,{propNames:["asset","core"],defaultProps:{core:"1.3.0"},withDynamic:!0});var Se=function(e){function t(){ke(this,t);var e=Ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={open:!1},e}return Ce(t,s.a.Component),Ee(t,[{key:"show",value:function(){var e=this;this.setState({open:!0},function(){j.a.publish(e.props.modalId,"open")})}},{key:"onClose",value:function(){this.setState({open:!1})}},{key:"render",value:function(){var e=this.props.tabsChanged;return this.state.open?s.a.createElement(x.a,{id:this.props.modalId,overlay:!0,modalHeader:"account.confirm_asset_modal.header",noLogo:!0},s.a.createElement(A.a,{content:"account.confirm_asset_modal.are_you_sure",component:"div",style:{paddingBottom:"1rem"}}),s.a.createElement("div",null,s.a.createElement("ul",null,e[0]?s.a.createElement("li",null,s.a.createElement(A.a,{content:"account.user_issued_assets.primary"})):null,e[1]?s.a.createElement("li",null,s.a.createElement(A.a,{content:"account.whitelist.title"})):null,e[2]?s.a.createElement("li",null,s.a.createElement(A.a,{content:"account.user_issued_assets.description"})):null,e[3]?s.a.createElement("li",null,s.a.createElement(A.a,{content:"account.user_issued_assets.bitasset_opts"})):null,e[4]?s.a.createElement("li",null,s.a.createElement(A.a,{content:"account.permissions"})):null,e[5]?s.a.createElement("li",null,s.a.createElement(A.a,{content:"account.user_issued_assets.flags"})):null,e[6]?s.a.createElement("li",null,s.a.createElement(A.a,{content:"account.user_issued_assets.feed_producers"})):null)),s.a.createElement("div",null,s.a.createElement("button",{className:"button primary",onClick:this.props._updateAsset.bind(this)},s.a.createElement(A.a,{content:"global.confirm"})),s.a.createElement("button",{className:"button primary hollow",onClick:this.props._cancelConfirm.bind(this)},s.a.createElement(A.a,{content:"global.cancel"})))):null}}]),t}(),Ne=function(e){function t(){return ke(this,t),Ae(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Ce(t,s.a.Component),Ee(t,[{key:"render",value:function(){var e=this.props.match.params.asset;return s.a.createElement(xe,ye({asset:e},this.props))}}]),t}(),je=Object(ve.a)(Ne),Pe=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Te=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return 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)}(t,s.a.Component),Pe(t,[{key:"render",value:function(){var e=this.props.stat_object.toJS();return s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.fees_paid"})," "),s.a.createElement("td",null,s.a.createElement(S.a,{amount:parseFloat(e.lifetime_fees_paid),asset:"1.3.0"}))))}}]),t}();Te.propTypes={stat_object:c.a.ChainObject.isRequired};var Ie=Object(u.a)(Te),Re=a(531),qe=a(37),Me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Be=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function De(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(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 Le(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)}var Ve=function(e){function t(){return De(this,t),Fe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Le(t,s.a.Component),Be(t,[{key:"render",value:function(){var e=this.props.dprops;return s.a.createElement(U.a,Me({},this.props,{path:"components/AccountMembership",section:"fee-division",nextMaintenanceTime:{time:e.get("next_maintenance_time")}}))}}]),t}();Ve.propTypes={dprops:c.a.ChainObject.isRequired},Ve.defaultProps={dprops:"2.1.0"},Ve=Object(u.a)(Ve);var Ue=function(e){function t(){return De(this,t),Fe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Le(t,s.a.Component),Be(t,[{key:"upgradeAccount",value:function(e,t,a){a.preventDefault(),r.a.upgradeAccount(e,t)}},{key:"componentWillMount",value:function(){m.a.getFinalFeeAsset(this.props.account,"account_upgrade")}},{key:"render",value:function(){var e=this.props,t=e.gprops,a=e.core_asset,n=this.props.account.toJS(),r=W.ChainStore.getAccount(n.lifetime_referrer,!1);r&&(n.lifetime_referrer_name=r.get("name"));var o=W.ChainStore.getAccount(n.referrer,!1);o&&(n.referrer_name=o.get("name"));var i=W.ChainStore.getAccount(n.registrar,!1);i&&(n.registrar_name=i.get("name"));var l=n.name,c=n.network_fee_percentage/100,u=n.lifetime_referrer_fee_percentage/100,p=100-c-u,m=p*n.referrer_rewards_percentage/1e4,d=100-m-u-c,h=t.getIn(["parameters","current_fees","parameters",8,1,"membership_lifetime_fee"])*t.getIn(["parameters","current_fees","scale"])/1e4,f=W.ChainStore.getAccountMemberStatus(this.props.account),b="account.member."+f,g=null;"annual"===f&&(g=s.a.createElement("span",null,"(",s.a.createElement(A.a,{content:"account.member.expires"})," ",s.a.createElement(Re.a,{time:n.membership_expiration_date}),")"));var _=n.membership_expiration_date;return"1969-12-31T23:59:59"===_?_="Never":"1970-01-01T00:00:00"===_&&(_="N/A"),s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{segmented:!1,setting:"membershipTab",className:"account-tabs",tabsClass:"account-overview bordered-header content-block",contentClass:"padding"},s.a.createElement(q.a,{title:"account.member.membership"},s.a.createElement("h3",null,s.a.createElement(A.a,{content:b})," ",g),"lifetime"===f?null:s.a.createElement("div",null,s.a.createElement("div",{className:"large-6 medium-8"},s.a.createElement(U.a,{path:"components/AccountMembership",section:"lifetime",feesCashback:100-c,price:{amount:h,asset:a}}),s.a.createElement("div",{className:"button no-margin",onClick:this.upgradeAccount.bind(this,n.id,!0)},s.a.createElement(A.a,{content:"account.member.upgrade_lifetime"}))," "," ",null),s.a.createElement("br",null),s.a.createElement("hr",null)),s.a.createElement("div",{className:"content-block no-margin"},s.a.createElement("div",{className:"no-margin grid-block vertical large-horizontal"},s.a.createElement("div",{className:"no-margin grid-block large-5"},s.a.createElement("div",{className:"grid-content"},"lifetime"===f?s.a.createElement("div",null,s.a.createElement("h4",null,s.a.createElement(A.a,{content:"account.member.referral_link"})),s.a.createElement(A.a,{content:"account.member.referral_text",wallet_name:Object(qe.m)()}),":",s.a.createElement("h5",null,Object(qe.n)()+"/?r="+n.name)):null,s.a.createElement("h4",null,s.a.createElement(A.a,{content:"account.member.fee_allocation"})),s.a.createElement("table",{className:"table key-value-table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.network_percentage"})),s.a.createElement("td",null,c,"%")),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.lifetime_referrer"})," "," (",s.a.createElement(w.a,{to:"account/"+n.lifetime_referrer_name},n.lifetime_referrer_name),")"),s.a.createElement("td",null,u,"%")),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.registrar"})," "," (",s.a.createElement(w.a,{to:"account/"+n.registrar_name},n.registrar_name),")"),s.a.createElement("td",null,d,"%")),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.referrer"})," "," (",s.a.createElement(w.a,{to:"account/"+n.referrer_name},n.referrer_name),")"),s.a.createElement("td",null,m,"%")),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.membership_expiration"})," "),s.a.createElement("td",null,_)))),s.a.createElement("h4",{style:{paddingTop:"1rem"}},s.a.createElement(A.a,{content:"account.member.fees_cashback"})),s.a.createElement("table",{className:"table key-value-table"},s.a.createElement(Ie,{stat_object:n.statistics})))),s.a.createElement("div",{className:"grid-block large-7"},s.a.createElement("div",{className:"grid-content"},s.a.createElement(Ve,{account:l,networkFee:c,referrerFee:m,registrarFee:d,lifetimeFee:u,referrerTotalFee:p,maintenanceInterval:t.getIn(["parameters","maintenance_interval"]),vestingThreshold:{amount:t.getIn(["parameters","cashback_vesting_threshold"]),asset:a},vestingPeriod:t.getIn(["parameters","cashback_vesting_period_seconds"])/60/60/24}))))))))))}}]),t}();Ue.propTypes={account:c.a.ChainAccount.isRequired,gprops:c.a.ChainObject.isRequired,core_asset:c.a.ChainAsset.isRequired},Ue.defaultProps={gprops:"2.0.0",core_asset:"1.3.0"};var ze=Ue=Object(u.a)(Ue),We=a(71),Je=a(13),Ke=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function Ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ze(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 Qe(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)}var He=function(e){function t(){return Ge(this,t),Ze(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Qe(t,s.a.Component),Ke(t,[{key:"_onClaim",value:function(e,t){var a=this;t.preventDefault(),We.a.claimVestingBalance(this.props.account.id,this.props.vb,e).then(function(){"function"==typeof a.props.handleChanged&&a.props.handleChanged()})}},{key:"render",value:function(){var e=this.props.vb;if(!this.props.vb)return null;var t=void 0,a=void 0,n=void 0,r=void 0,o=void 0;return e&&(o=e.balance.amount,t=W.ChainStore.getAsset(e.balance.asset_id),n=e.policy[1].coin_seconds_earned,r=0===(a=e.policy[1].vesting_seconds)?1:n/(a*o)),t&&o?s.a.createElement("div",null,s.a.createElement(A.a,{component:"h5",content:"account.vesting.balance_number",id:e.id}),s.a.createElement("table",{className:"table key-value-table"},s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.cashback"})),s.a.createElement("td",null,s.a.createElement(S.a,{amount:e.balance.amount,asset:e.balance.asset_id}))),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.earned"})),s.a.createElement("td",null,z.a.format_number(z.a.get_asset_amount(n/86400,t),0)," ",s.a.createElement(A.a,{content:"account.member.coindays"}))),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.required"})),s.a.createElement("td",null,z.a.format_number(z.a.get_asset_amount(e.balance.amount*a/86400,t),0)," ",s.a.createElement(A.a,{content:"account.member.coindays"}))),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.remaining"})),s.a.createElement("td",null,z.a.format_number(a*(1-r)/86400||0,2)," days")),s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.member.available"})),s.a.createElement("td",null,z.a.format_number(100*r,2),"% /"," ",s.a.createElement(S.a,{amount:r*e.balance.amount,asset:t.get("id")}))),s.a.createElement("tr",null,s.a.createElement("td",{colSpan:"2",style:{textAlign:"right"}},s.a.createElement("button",{onClick:this._onClaim.bind(this,!1),className:"button"},s.a.createElement(A.a,{content:"account.member.claim"}))))))):null}}]),t}(),Ye=function(e){function t(){Ge(this,t);var e=Ze(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={vbs:null},e}return Qe(t,s.a.Component),Ke(t,[{key:"componentWillMount",value:function(){this.retrieveVestingBalances.call(this,this.props.account.get("id"))}},{key:"componentWillUpdate",value:function(e){var t=e.account.get("id");t!==this.props.account.get("id")&&this.retrieveVestingBalances.call(this,t)}},{key:"retrieveVestingBalances",value:function(e){var t=this;e=e||this.props.account.get("id"),Je.Apis.instance().db_api().exec("get_vesting_balances",[e]).then(function(e){t.setState({vbs:e})}).catch(function(e){console.log("error:",e)})}},{key:"render",value:function(){var e=this,t=this.state.vbs;if(!t||!this.props.account||!this.props.account.get("vesting_balances"))return null;var a=this.props.account.toJS(),n=t.map(function(t){if(t.balance.amount)return s.a.createElement(He,{key:t.id,vb:t,account:a,handleChanged:e.retrieveVestingBalances.bind(e)})}).filter(function(e){return!!e});return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{segmented:!1,setting:"vestingTab",className:"account-tabs",tabsClass:"account-overview bordered-header content-block",contentClass:"padding"},s.a.createElement(q.a,{title:"account.vesting.title"},s.a.createElement(A.a,{content:"account.vesting.explain",component:"p"}),n.length?n:s.a.createElement("h4",{style:{paddingTop:"1rem"}},s.a.createElement(A.a,{content:"account.vesting.no_balances"})))))))}}]),t}();Ye.VestingBalance=He;var Xe=Ye,$e=a(229),et=a(336),tt=a(60),at=a(19),nt=a(99),st=a(528),rt=a.n(st),ot=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var it=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state=a._getInitialState(),a.onPasswordEnter=a.onPasswordEnter.bind(a),a.onKeyDown=a.onKeyDown.bind(a),a.onCancel=a.onCancel.bind(a),a.onClose=a.onClose.bind(a),a}return 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)}(t,s.a.Component),ot(t,[{key:"_getInitialState",value:function(){return{isShowQrcode:!1,keyString:null}}},{key:"show",value:function(){j.a.publish(this.props.modalId,"open")}},{key:"onCancel",value:function(){j.a.publish(this.props.modalId,"close"),this.onClose()}},{key:"onClose",value:function(){this.refs.password_input&&(this.refs.password_input.value=""),this.setState(this._getInitialState())}},{key:"onPasswordEnter",value:function(e){e.preventDefault();var t=this.refs.password_input.value,a=this.props.keyValue;if(null!=t&&""!=t){if(void 0!==a&&null!=a&&""!=a){var n=W.Aes.fromSeed(t).encryptToHex(a);this.setState({isShowQrcode:!0,keyString:n})}}else this.setState({isShowQrcode:!0,keyString:a})}},{key:"onKeyDown",value:function(e){13===e.keyCode&&this.onPasswordEnter(e)}},{key:"render",value:function(){var e=this,t=null;return this.state.isShowQrcode&&(t={textAlign:"center"}),s.a.createElement(x.a,{onClose:this.onClose,id:this.props.modalId,ref:"modal",overlay:!0,overlayClose:!1},s.a.createElement("div",{className:"text-center"},s.a.createElement("div",{style:{margin:"1.5rem 0"}},s.a.createElement(A.a,{component:"h4",content:"modal.qrcode.title"})),s.a.createElement("form",{className:"full-width",style:{margin:"0 3.5rem"},onSubmit:this.onPasswordEnter,noValidate:!0},s.a.createElement("div",{className:"form-group"},this.state.isShowQrcode?s.a.createElement("section",{style:t},s.a.createElement("span",{style:{background:"#fff",padding:".75rem",display:"inline-block"}},s.a.createElement(rt.a,{size:256,value:this.state.keyString}))):s.a.createElement("section",null,s.a.createElement("label",{className:"left-label"},s.a.createElement(A.a,{unsafe:!0,content:"modal.qrcode.input_message"})),s.a.createElement("input",{name:"password",type:"text",onFocus:function(){e.refs.password_input.setAttribute("type","password")},ref:"password_input",autoComplete:"off",onKeyDown:this.onKeyDown}))),s.a.createElement("div",{style:t},s.a.createElement("div",{className:"button-group"},0==this.state.isShowQrcode?s.a.createElement("button",{className:"button",onClick:this.onPasswordEnter},s.a.createElement(A.a,{content:"modal.ok"})):null,s.a.createElement("button",{className:"button primary hollow",onClick:this.onCancel},s.a.createElement(A.a,{content:"cancel"})))))))}}]),t}();it.propTypes={modalId:E.a.string.isRequired,keyValue:E.a.string},it.defaultProps={modalId:"qr_code_password_modal"};var lt=it,ct=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var ut=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state=e._getInitialState(),e}return 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)}(t,n["Component"]),ct(t,[{key:"_getInitialState",value:function(){return{wif:null}}},{key:"reset",value:function(){this.setState(this._getInitialState())}},{key:"componentDidMount",value:function(){var e=this,t="key_view_modal"+this.props.pubkey;j.a.subscribe(t,function(a,n){a===t&&"close"===n&&e.reset()})}},{key:"render",value:function(){var e="key_view_modal"+this.props.pubkey,t=nt.a.getState().keys;if(!t.has(this.props.pubkey))return s.a.createElement("span",null,this.props.children);var n=t.get(this.props.pubkey);return s.a.createElement("span",null,s.a.createElement("a",{onClick:this.onOpen.bind(this)},this.props.children),s.a.createElement(x.a,{ref:e,id:e,overlay:!0,overlayClose:!1},s.a.createElement("h3",null,s.a.createElement(A.a,{content:"account.perm.key_viewer"})),s.a.createElement("div",{className:"grid-block vertical"},s.a.createElement("div",{className:"content-block"},s.a.createElement("div",{className:"grid-content"},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.perm.public"})),this.props.pubkey),s.a.createElement("br",null),s.a.createElement("div",{className:"grid-block grid-content"},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.perm.private"})),s.a.createElement("div",null,this.state.wif?s.a.createElement("span",null,s.a.createElement("p",{style:{fontWeight:600}},this.state.wif),s.a.createElement("div",{className:"button-group"},s.a.createElement("div",{className:"button",onClick:this.onHide.bind(this)},"hide"),s.a.createElement("div",{className:"clickable",onClick:this.showQrCode.bind(this)},s.a.createElement("img",{style:{height:50},src:a(1932)})))):s.a.createElement("span",null,s.a.createElement("div",{className:"button",onClick:this.onShow.bind(this)},s.a.createElement(A.a,{content:"account.perm.show"}))))),s.a.createElement("br",null),s.a.createElement("div",{className:"grid-block grid-content"},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.perm.brain"})),null==n.brainkey_sequence?"Non-deterministic":n.brainkey_sequence),s.a.createElement("br",null),n.import_account_names&&n.import_account_names.length?s.a.createElement("div",{className:"grid-block grid-content"},s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.perm.from"})),n.import_account_names.join(", "),s.a.createElement("br",null)):null)),s.a.createElement("div",{className:"button-group"},s.a.createElement("div",{onClick:this.onClose.bind(this),className:" button"},s.a.createElement(A.a,{content:"transfer.close"})))),s.a.createElement(lt,{ref:"qrmodal",keyValue:this.state.wif}))}},{key:"onOpen",value:function(){var e="key_view_modal"+this.props.pubkey;j.a.publish(e,"open")}},{key:"onClose",value:function(){this.reset();var e="key_view_modal"+this.props.pubkey;j.a.publish(e,"close")}},{key:"onShow",value:function(){var e=this;tt.a.unlock().then(function(){var t=at.a.getPrivateKey(e.props.pubkey);e.setState({wif:t.toWif()})}).catch(function(){})}},{key:"onHide",value:function(){this.setState({wif:null})}},{key:"showQrCode",value:function(){this.refs.qrmodal.show()}}]),t}();ut.propTypes={pubkey:E.a.string.isRequired};var pt=ut,mt=a(200),dt=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ft(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 bt(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)}var gt=function(e){function t(){return ht(this,t),ft(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return bt(t,s.a.Component),dt(t,[{key:"shouldComponentUpdate",value:function(e){return!z.a.are_equal_shallow(e,this.props)}},{key:"_lookUpPubKeyForAddress",value:function(e){return mt.a.getState().addresses.get(e)}},{key:"render",value:function(){var e=void 0,t=void 0,a=void 0,n="_accounts",r=this.props.pubkey,o=nt.a.getState().keys,i=!1;return this.props.account?(e=this.props.account.get("name"),t=this.props.account.get("id"),a=s.a.createElement(w.a,{to:"/account/"+e+"/permissions"},e)):r?(e=t=r,a=s.a.createElement(pt,{pubkey:r},r),n="_keys",i=o.has(r)):this.props.address&&(r=this._lookUpPubKeyForAddress(this.props.address),t=this.props.address,a=r?s.a.createElement(pt,{pubkey:r},r):this.props.address,n="_addresses",i=o.has(r)),s.a.createElement("tr",{key:e},s.a.createElement("td",null,this.props.account?s.a.createElement(et.a,{size:{height:30,width:30},account:e}):r?s.a.createElement("div",{className:"account-image"},s.a.createElement(pt,{pubkey:r},s.a.createElement(M.a,{name:"key",title:"icons.key",size:"4x"}))):null),s.a.createElement("td",{className:(i?"my-key":"")+" pub-key"},a),s.a.createElement("td",null,this.props.weights[t]),s.a.createElement("td",null,s.a.createElement("button",{className:"button",onClick:this.props.onRemoveItem.bind(this,t,n)},s.a.createElement(A.a,{content:"account.votes.remove_witness"}))))}}]),t}();gt.propTypes={account:E.a.object,pubkey:E.a.string,address:E.a.string,onRemoveItem:E.a.func.isRequired,weights:E.a.object};var _t=function(e){function t(e){ht(this,t);var a=ft(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={selected_item:null,item_name_input:"",weight_input:"",error:null},a.onItemChange=a.onItemChange.bind(a),a.onItemAccountChange=a.onItemAccountChange.bind(a),a.onAddItem=a.onAddItem.bind(a),a}return bt(t,s.a.Component),dt(t,[{key:"onItemChange",value:function(e){this.setState({item_name_input:e})}},{key:"onItemAccountChange",value:function(e){var t=this;if(this.setState({selected_item:e,error:null}),e&&this.props.validateAccount){var a=this.props.validateAccount(e);if(null===a)return;"string"==typeof a?this.setState({error:a}):a.then(function(e){return t.setState({error:e})})}}},{key:"onWeightChanged",value:function(e){var t=e.target.value.trim();this.setState({weight_input:parseInt(t)})}},{key:"onAddItem",value:function(e){if(e){this.setState({selected_item:null,item_name_input:"",weight_input:"",error:null});var t="string"==typeof e?e:e.get("id");this.props.onAddItem(t,this.state.weight_input)}}},{key:"onWeightKeyDown",value:function(e){13===e.keyCode&&this.state.weight_input&&this.state.selected_item&&this.onAddItem(this.state.selected_item)}},{key:"render",value:function(){var e=this,t=0,a=this.props.accounts.filter(function(e){return!!e}).sort(function(e,t){return e.get("name")>t.get("name")?1:e.get("name")<t.get("name")?-1:0}).map(function(a){return s.a.createElement(gt,{key:t++,account:a,weights:e.props.weights,onRemoveItem:e.props.onRemoveItem})}),n=this.props.keys.map(function(a){return s.a.createElement(gt,{key:t++,pubkey:a,weights:e.props.weights,onRemoveItem:e.props.onRemoveItem})}),r=this.props.addresses.map(function(a){return s.a.createElement(gt,{key:t++,address:a,weights:e.props.weights,onRemoveItem:e.props.onRemoveItem})}),o=this.state.error;!o&&this.state.selected_item&&-1!==this.props.accounts.indexOf(this.state.selected_item)&&(o=K.a.translate("account.perm.warning3")),!o&&this.state.item_name_input&&-1!==this.props.keys.indexOf(this.state.item_name_input)&&(o=K.a.translate("account.perm.warning4"));var i=["10%","70%","30%","10%"];return s.a.createElement("div",null,s.a.createElement(me.a,{label:this.props.label,error:o,placeholder:this.props.placeholder,account:this.state.item_name_input,accountName:this.state.item_name_input,onChange:this.onItemChange,onAccountChanged:this.onItemAccountChange,onAction:this.onAddItem,action_label:"account.votes.add_witness",tabIndex:this.props.tabIndex,allowPubKey:!0,disableActionButton:!this.state.weight_input,allowUppercase:!0},s.a.createElement("input",{value:this.state.weight_input,onChange:this.onWeightChanged.bind(this),className:"weight-input",type:"number",autoComplete:"off",placeholder:K.a.translate("account.perm.weight"),onKeyDown:this.onWeightKeyDown.bind(this),tabIndex:this.props.tabIndex+1})),s.a.createElement("div",{style:{paddingTop:"2rem"}},s.a.createElement("table",{className:"table"},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",{style:{width:i[0]}}),s.a.createElement("th",{style:{width:i[1]}},s.a.createElement(A.a,{content:"account.perm.acct_or_key"})),s.a.createElement("th",{style:{width:i[2]}},s.a.createElement(A.a,{content:"account.perm.weight"})),s.a.createElement("th",{style:{width:i[3]}},s.a.createElement(A.a,{content:"account.perm.action"})))),s.a.createElement("tbody",null,a,n,r))))}}]),t}();_t.propTypes={accounts:c.a.ChainObjectsList,onAddItem:E.a.func.isRequired,onRemoveItem:E.a.func.isRequired,validateAccount:E.a.func,label:E.a.string.isRequired,placeholder:E.a.string,tabIndex:E.a.number,weights:E.a.object};var vt=Object(u.a)(_t,{autosubscribe:!1}),yt=a(384),Et=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var wt=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={validPassword:!1,pass:null,generatedPassword:"P"+W.key.get_random_key().toWif().toString()},e}return 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)}(t,s.a.Component),Et(t,[{key:"onSubmit",value:function(){}},{key:"onPasswordChange",value:function(e){var t=e.valid,a=this.props.account.get("name"),n=t?at.a.generateKeyFromPassword(a,"active",e.value).pubKey:null,s=t?at.a.generateKeyFromPassword(a,"owner",e.value).pubKey:null,r=t?at.a.generateKeyFromPassword(a,"memo",e.value).pubKey:null;this.setState({validPassword:e.valid,pass:e.value}),this.props.onSetPasswordKeys({active:n,owner:s,memo:r})}},{key:"checkKeyUse",value:function(e,t){return!!e&&("memo"===t?e===this.props.memoKey:this.props[t+"Keys"].reduce(function(t,a){return a===e||t},!1))}},{key:"_onUseKey",value:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])this.props["active"===e?"onRemoveActive":"onRemoveOwner"](this.props[e],"_keys");else if(this.props[e]){var t={active:this.props.account.getIn(["active","weight_threshold"]),owner:this.props.account.getIn(["owner","weight_threshold"])};console.log("key",this.props[e],"weights",t,"weight of role:",t[e]),this.props["active"===e?"onAddActive":"owner"===e?"onAddOwner":"onSetMemo"](this.props[e],t[e])}}},{key:"render",value:function(){var e=this.checkKeyUse(this.props.active&&this.props.active,"active"),t=this.checkKeyUse(this.props.owner&&this.props.owner,"owner"),a=this.checkKeyUse(this.props.memo&&this.props.memo,"memo"),n=K.a.translate("account.perm.use_text"),r=K.a.translate("account.perm.remove_text");return s.a.createElement("div",null,s.a.createElement("p",{style:{maxWidth:"800px"}},s.a.createElement(A.a,{content:"account.perm.password_model_1"})),s.a.createElement("p",{style:{maxWidth:"800px"}},s.a.createElement(A.a,{content:"wallet.password_model_1"})),s.a.createElement("p",{style:{maxWidth:"800px"}},s.a.createElement(A.a,{unsafe:!0,content:"wallet.password_model_2"})),s.a.createElement("div",{className:"divider"}),s.a.createElement("form",{style:{maxWidth:"40rem"},onSubmit:this.onSubmit.bind(this),noValidate:!0},s.a.createElement("label",{className:"left-label"},s.a.createElement(A.a,{content:"wallet.generated"})),s.a.createElement("p",null,this.state.generatedPassword),s.a.createElement("p",{style:{fontWeight:"bold"}},s.a.createElement(A.a,{content:"account.perm.password_model_2"})),s.a.createElement(yt.a,{ref:"password",confirmation:!0,onChange:this.onPasswordChange.bind(this),noLabel:!0,passwordLength:12,checkStrength:!0})),s.a.createElement("table",{className:"table"},s.a.createElement("tbody",null,s.a.createElement("tr",{className:e?"in-use":""},s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.perm.new_active"}),":"),s.a.createElement("td",null,this.props.active),s.a.createElement("td",{className:"text-right"},s.a.createElement("div",{className:"button",onClick:this._onUseKey.bind(this,"active",e)},e?r:n))),s.a.createElement("tr",{className:t?"in-use":""},s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.perm.new_owner"}),":"),s.a.createElement("td",null,this.props.owner),s.a.createElement("td",{className:"text-right"},s.a.createElement("div",{className:"button",onClick:this._onUseKey.bind(this,"owner",t)},t?r:n))),s.a.createElement("tr",{className:a?"in-use":""},s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.perm.new_memo"}),":"),s.a.createElement("td",null,this.props.memo),s.a.createElement("td",{className:"text-right"},s.a.createElement("div",{className:"button",style:{visibility:a?"hidden":""},onClick:this._onUseKey.bind(this,"memo",a)},n))))),a?s.a.createElement("p",{style:{maxWidth:"800px",paddingTop:10},className:"has-error"},s.a.createElement(A.a,{content:"account.perm.memo_warning"})):null)}}]),t}(),kt=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var At=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return 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)}(t,s.a.Component),kt(t,[{key:"isValidPubKey",value:function(e){return!!W.PublicKey.fromPublicKeyString(e)}},{key:"onInputChanged",value:function(e){var t=e.target.value.trim();this.props.onChange(t)}},{key:"onKeyDown",value:function(e){13===e.keyCode&&this.onAction(e)}},{key:"onAction",value:function(e){e.preventDefault(),this.props.onAction&&this.state.valid&&!this.props.disableActionButton&&this.props.onAction(e)}},{key:"render",value:function(){var e=this.props.error;e||!this.props.value||this.isValidPubKey(this.props.value)||(e="Not a valid public key");var t=V()("button",{disabled:e||this.props.disableActionButton}),a=nt.a.getState().keys,n=this.isValidPubKey(this.props.value)&&a.has(this.props.value);return s.a.createElement("div",{className:"pubkey-input no-overflow"},s.a.createElement("div",{className:"content-area"},s.a.createElement("div",{className:"header-area"},!e&&this.props.value&&this.isValidPubKey(this.props.value)?s.a.createElement("label",{className:"right-label"},s.a.createElement(A.a,{content:"account.perm.valid_pub"})):null,s.a.createElement(A.a,{className:"left-label",component:"label",content:this.props.label})),s.a.createElement("div",{className:"input-area"},s.a.createElement("span",{className:"inline-label"},s.a.createElement("div",{className:"account-image"},s.a.createElement(pt,{pubkey:this.props.value},s.a.createElement(M.a,{name:"key",title:"icons.key",size:"4x"}))),s.a.createElement("input",{type:"text",className:n?"my-key":"",value:this.props.value,placeholder:this.props.placeholder||counterpart.translate("account.public_key"),ref:"user_input",onChange:this.onInputChanged.bind(this),onKeyDown:this.onKeyDown.bind(this),tabIndex:this.props.tabIndex}),this.props.onAction?s.a.createElement("button",{className:t,onClick:this.onAction.bind(this)},s.a.createElement(A.a,{content:this.props.action_label})):null)),s.a.createElement("div",{className:"error-area has-error"},s.a.createElement("span",null,e))))}}]),t}();At.propTypes={label:E.a.string.isRequired,value:E.a.string,error:E.a.string,placeholder:E.a.string,onChange:E.a.func,onAction:E.a.func,tabIndex:E.a.number,disableActionButton:E.a.bool};var Ct=At,Ot=a(1766),xt=a(67),St=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Nt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={},a.onPublish=a.onPublish.bind(a),a.onReset=a.onReset.bind(a),a}return 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)}(t,s.a.Component),St(t,[{key:"componentWillMount",value:function(){this.updateAccountData(this.props.account),m.a.getFinalFeeAsset(this.props.account,"account_update")}},{key:"componentWillReceiveProps",value:function(e){e.account!==this.props.account&&this.updateAccountData(e.account)}},{key:"permissionsFromImmutableObj",value:function(e){var t=e.get("weight_threshold"),a=e.get("account_auths"),n=e.get("key_auths"),s=e.get("address_auths"),r=a.map(function(e){return e.get(0)}),o=n.map(function(e){return e.get(0)}),i=s.map(function(e){return e.get(0)}),l=a.reduce(function(e,t){return e[t.get(0)]=t.get(1),e},{});return l=n.reduce(function(e,t){return e[t.get(0)]=t.get(1),e},l),{threshold:t,accounts:r,keys:o,addresses:i,weights:l=s.reduce(function(e,t){return e[t.get(0)]=t.get(1),e},l)}}},{key:"permissionsToJson",value:function(e,t,a,n,s){var r={weight_threshold:e};return r.account_auths=t.sort(z.a.sortID).map(function(e){return[e,s[e]]}).toJS(),r.key_auths=a.sort(z.a.sortID).map(function(e){return[e,s[e]]}).toJS(),r.address_auths=n.sort(z.a.sortID).map(function(e){return[e,s[e]]}).toJS(),r}},{key:"updateAccountData",value:function(e){var t=this.permissionsFromImmutableObj(e.get("active")),a=this.permissionsFromImmutableObj(e.get("owner")),n=e.get("options").get("memo_key"),s={active_accounts:t.accounts,active_keys:t.keys,active_addresses:t.addresses,owner_accounts:a.accounts,owner_keys:a.keys,owner_addresses:a.addresses,active_weights:t.weights,owner_weights:a.weights,active_threshold:t.threshold,owner_threshold:a.threshold,memo_key:n,prev_active_accounts:t.accounts,prev_active_keys:t.keys,prev_active_addresses:t.addresses,prev_owner_accounts:a.accounts,prev_owner_keys:a.keys,prev_owner_addresses:a.addresses,prev_active_weights:t.weights,prev_owner_weights:a.weights,prev_active_threshold:t.threshold,prev_owner_threshold:a.threshold,prev_memo_key:n};this.setState(s)}},{key:"isChanged",value:function(){var e=this.state;return e.active_accounts!==e.prev_active_accounts||e.active_keys!==e.prev_active_keys||e.active_addresses!==e.prev_active_addresses||e.owner_accounts!==e.prev_owner_accounts||e.owner_keys!==e.prev_owner_keys||e.owner_addresses!==e.prev_owner_addresses||e.active_threshold!==e.prev_active_threshold||e.owner_threshold!==e.prev_owner_threshold||e.memo_key!==e.prev_memo_key}},{key:"didChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;if("memo"===e)return t.memo_key!==t.prev_memo_key;var a=!1;return["_keys","_active_addresses","_accounts","_threshold"].forEach(function(n){var s=e+n;t[s]!==t["prev_"+s]&&(a=!0)}),a}},{key:"onPublish",value:function(){var e=this.state,t=this.props.account.toJS();t.fee={amount:0,asset_id:m.a.getFinalFeeAsset(t.id,"account_update")};var a={account:t.id};if(this.didChange("active")&&(a.active=this.permissionsToJson(e.active_threshold,e.active_accounts,e.active_keys,e.active_addresses,e.active_weights)),this.didChange("owner")&&(a.owner=this.permissionsToJson(e.owner_threshold,e.owner_accounts,e.owner_keys,e.owner_addresses,e.owner_weights)),this.didChange("owner")&&0===e.owner_keys.size&&0===e.owner_addresses.size&&1===e.owner_accounts.size&&e.owner_accounts.first()===t.id)return xt.a.addNotification({message:"Setting your owner permissions like this will render your account permanently unusable. Please make sure you know what you're doing before modifying account authorities!",level:"error",autoDismiss:10});e.memo_key&&this.didChange("memo")&&this.isValidPubKey(e.memo_key)&&(a.new_options=this.props.account.get("options").toJS(),a.new_options.memo_key=e.memo_key),$e.a.updateAccount(a)}},{key:"isValidPubKey",value:function(e){return!!W.PublicKey.fromPublicKeyString(e)}},{key:"onReset",value:function(){var e=this.state;this.setState({active_accounts:e.prev_active_accounts,active_keys:e.prev_active_keys,active_addresses:e.prev_active_addresses,owner_accounts:e.prev_owner_accounts,owner_keys:e.prev_owner_keys,owner_addresses:e.prev_owner_addresses,active_weights:e.prev_active_weights,owner_weights:e.prev_owner_weights,active_threshold:e.prev_active_threshold,owner_threshold:e.prev_owner_threshold,memo_key:e.prev_memo_key})}},{key:"onAddItem",value:function(e,t,a){var n={},s=e+(z.a.is_object_id(t)?"_accounts":"_keys");n[s]=this.state[s].push(t),this.state[e+"_weights"][t]=a,this.setState(n)}},{key:"onRemoveItem",value:function(e,t,a){console.log("onRemoveItem",e,t,a);var n={},s=e+a;n[s]=this.state[s].filter(function(e){return e!==t}),this.setState(n)}},{key:"onThresholdChanged",value:function(e,t){var a=parseInt(t.target.value.trim()),n={};n[e]=a,this.setState(n)}},{key:"validateAccount",value:function(e,t){return null}},{key:"sumUpWeights",value:function(e,t,a,n){var s=e.reduce(function(e,t){return e+n[t]},0);return s=t.reduce(function(e,t){return e+n[t]},s),a.reduce(function(e,t){return e+n[t]},s)}},{key:"onMemoKeyChanged",value:function(e){this.setState({memo_key:e})}},{key:"onSetPasswordKeys",value:function(e){var t={};(arguments.length>1&&void 0!==arguments[1]?arguments[1]:["active","owner","memo"]).forEach(function(a){t["password_"+a]=e[a]}),this.setState(t)}},{key:"render",value:function(){var e=void 0,t=void 0,a=this.state,n=a.active_accounts,r=a.active_keys,o=a.active_addresses,i=a.active_weights,l=this.state,c=l.owner_accounts,u=l.owner_keys,p=l.owner_addresses,m=l.owner_weights,d=this.state.active_threshold>0?this.state.active_threshold:0,f=this.sumUpWeights(n,r,o,i);this.didChange("active")&&f<d&&(e=K.a.translate("account.perm.warning1",{weights_total:f,threshold:d})),d=this.state.owner_threshold>0?this.state.owner_threshold:0,f=this.sumUpWeights(c,u,p,m),this.didChange("owner")&&f<d&&(t=K.a.translate("account.perm.warning2",{weights_total:f,threshold:d}));var b="button"+(!e&&!t&&this.isChanged()&&this.isValidPubKey(this.state.memo_key)?"":" disabled"),g="button"+(this.isChanged()?"":" disabled"),_=h.a.Set();return _=_.add(this.props.account.get("id")),s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{defaultActiveTab:1,segmented:!1,setting:"permissionsTab",className:"account-tabs",tabsClass:"account-overview bordered-header content-block",contentClass:"padding",actionButtons:s.a.createElement("div",{className:"action-buttons"},s.a.createElement("button",{className:g,onClick:this.onReset,tabIndex:8},s.a.createElement(A.a,{content:"account.perm.reset"})),s.a.createElement("button",{className:b,onClick:this.onPublish,tabIndex:9},s.a.createElement(A.a,{content:"account.perm.publish"})))},s.a.createElement(q.a,{title:"account.perm.active"},s.a.createElement(U.a,{path:"components/AccountPermActive"}),s.a.createElement("form",{className:"threshold"},s.a.createElement("label",{className:"horizontal"},s.a.createElement(A.a,{content:"account.perm.threshold"})," "," ",s.a.createElement("input",{type:"number",placeholder:"0",size:"5",value:this.state.active_threshold,onChange:this.onThresholdChanged.bind(this,"active_threshold"),autoComplete:"off",tabIndex:1}))),s.a.createElement(vt,{label:"account.perm.add_permission_label",accounts:n,keys:r,weights:i,addresses:o,validateAccount:this.validateAccount.bind(this,"active"),onAddItem:this.onAddItem.bind(this,"active"),onRemoveItem:this.onRemoveItem.bind(this,"active"),placeholder:K.a.translate("account.perm.account_name_or_key"),tabIndex:2}),s.a.createElement("br",null),e?s.a.createElement("div",{className:"content-block has-error"},e):null),s.a.createElement(q.a,{title:"account.perm.owner"},s.a.createElement(U.a,{path:"components/AccountPermOwner"}),s.a.createElement("form",{className:"threshold"},s.a.createElement("label",{className:"horizontal"},s.a.createElement(A.a,{content:"account.perm.threshold"})," "," ",s.a.createElement("input",{type:"number",placeholder:"0",size:"5",value:this.state.owner_threshold,onChange:this.onThresholdChanged.bind(this,"owner_threshold"),autoComplete:"off",tabIndex:4}))),s.a.createElement(vt,{label:"account.perm.add_permission_label",accounts:c,keys:u,weights:m,addresses:p,validateAccount:this.validateAccount.bind(this,"owner"),onAddItem:this.onAddItem.bind(this,"owner"),onRemoveItem:this.onRemoveItem.bind(this,"owner"),placeholder:K.a.translate("account.perm.account_name_or_key"),tabIndex:5}),s.a.createElement("br",null),t?s.a.createElement("div",{className:"content-block has-error"},t):null),s.a.createElement(q.a,{title:"account.perm.memo_key"},s.a.createElement(U.a,{style:{maxWidth:"800px"},path:"components/AccountPermMemo"}),s.a.createElement(Ct,{ref:"memo_key",value:this.state.memo_key,label:"account.perm.memo_public_key",placeholder:"Public Key",onChange:this.onMemoKeyChanged.bind(this),tabIndex:7})),s.a.createElement(q.a,{title:"account.perm.password_model"},s.a.createElement(wt,{active:this.state.password_active,owner:this.state.password_owner,memo:this.state.password_memo,onSetPasswordKeys:this.onSetPasswordKeys.bind(this),account:this.props.account,activeKeys:this.state.active_keys,ownerKeys:this.state.owner_keys,memoKey:this.state.memo_key,onAddActive:this.onAddItem.bind(this,"active"),onRemoveActive:this.onRemoveItem.bind(this,"active"),onAddOwner:this.onAddItem.bind(this,"owner"),onRemoveOwner:this.onRemoveItem.bind(this,"owner"),onSetMemo:this.onMemoKeyChanged.bind(this)}))),s.a.createElement("div",{className:"tab-content",style:{padding:10}},s.a.createElement("div",{className:"divider"}),s.a.createElement(Ot.a,{accountsList:_,limit:25,compactView:!1,filter:"account_update",style:{paddingBottom:"2rem"}})))))}}]),t}(),jt=a(24),Pt=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Tt="-----BEGIN BITSHARES SIGNED MESSAGE-----",It="-----END BITSHARES SIGNED MESSAGE-----",Rt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return Pt(e,[{key:"parseMessage",value:function(e){var t=void 0,a=void 0,n=void 0,s=void 0;try{t=(a=(t=e.split(Tt)[1]).split("-----BEGIN META-----"))[0].replace(/^\n|\n$/g,""),a=(n=a[1].split("-----BEGIN SIGNATURE-----"))[0].trim(),n=n[1].split(It)[0].trim(),s=t+"\n"+a}catch(e){throw new Error(K.a.translate("account.signedmessages.invalidformat"))}var r=void 0,o=void 0,i=void 0,l=void 0;if(a)try{r=(r=a.split("account="))[1].split("\n")[0].trim(),o=(o=a.split("memokey="))[1].split("\n")[0].trim(),i=(i=a.split("block="))[1].split("\n")[0].trim(),l=(l=a.split("timestamp="))[1].split("\n")[0].trim()}catch(e){throw new Error(K.a.translate("account.signedmessages.invalidformat"))}return{content:t,meta:{account:r,key:o,block:i,timestamp:l},signed:s,signature:n}}},{key:"verifyMemo",value:function(e){var t=void 0;if(t="string"==typeof e||e instanceof String?this.parseMessage(e):e,null==W.ChainStore.getAccount(t.meta.account))throw new Error(K.a.translate("account.signedmessages.invaliduser"));var a=!1;try{a=W.Signature.fromHex(t.signature).verifyBuffer(t.signed,W.PublicKey.fromPublicKeyString(t.meta.key))}catch(e){throw new Error(K.a.translate("account.signedmessages.errorverifying"))}if(!a)throw new Error(K.a.translate("account.signedmessages.invalidsignature"));return t}},{key:"signMessage",value:function(e,t){return new Promise(function(a,n){tt.a.unlock().then(function(){try{var s=e.get("options").get("memo_key");/111111111111111111111/.test(s)&&(s=null);var r=void 0;if(t&&s&&!(r=at.a.getPrivateKey(s)))throw new Error(K.a.translate("account.signedmessages.invalidkey"));var o=W.ChainStore.getObject("2.1.0").get("last_irreversible_block_num"),i=new Date,l="account="+e.get("name")+"\nmemokey="+s+"\nblock="+o+"\ntimestamp="+i.toUTCString(),c=t+"\n"+l;setTimeout(function(){try{var e=W.Signature.signBuffer(c,r,s),o=Tt+"\n"+t+"\n-----BEGIN META-----\n"+l+"\n-----BEGIN SIGNATURE-----\n"+e.toHex()+"\n"+It;a(o)}catch(e){n(e)}},0)}catch(e){n(e)}}).catch(function(e){n(e)})})}}]),e}(),qt=jt.a.createActions(Rt),Mt=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Bt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={message:a.props.message,messageParsed:null,showRawMessage:!1,noVerification:a.props.noVerification,verified:null,notification:null},a}return 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)}(t,s.a.Component),Mt(t,[{key:"_verifyMessage",value:function(e){var t=this;this.setState({message:e,messageParsed:null,verified:null});var a=null;try{a=qt.parseMessage(e),this.setState({verified:null,messageParsed:a}),this.state.noVerification||(this.setState({verified:null,notification:K.a.translate("account.signedmessages.verifying")}),setTimeout(function(){try{qt.verifyMemo(a),t.setState({verified:!0,notification:""})}catch(e){t._warning(e.message),t.setState({verified:!1})}},0))}catch(e){this._warning(e.message)}}},{key:"componentWillMount",value:function(){this._verifyMessage(this.state.message)}},{key:"componentWillReceiveProps",value:function(e){var t=e.message;void 0!=t&&null!=t&&t==this.state.message||this._verifyMessage(t)}},{key:"_warning",value:function(e){this.setState({notification:e})}},{key:"_toggleRawMessage",value:function(){this.setState({showRawMessage:!this.state.showRawMessage})}},{key:"render",value:function(){var e=void 0,t=void 0;null!=this.state.messageParsed&&(null==this.state.verified?(t="#FFF",e="Unverified message from "+this.state.messageParsed.meta.account):this.state.verified?(t="#FFF",e="Verified message from "+this.state.messageParsed.meta.account):(t="#F00",e="Refuted message, indicated sender "+this.state.messageParsed.meta.account));var a=null!=this.props.message&&""!=this.props.message,n=this.state.notification&&""!=this.state.notification;return s.a.createElement("div",{style:{color:"gray",margin:"10px 10px"}},null!=this.state.messageParsed&&s.a.createElement("fieldset",{style:{borderColor:t}},s.a.createElement("legend",{style:{color:"white",weight:"bold"}},e),s.a.createElement("pre",{style:{position:"relative",width:"100%",display:"table"}},this.state.messageParsed.content,n&&s.a.createElement("div",{style:{textAlign:"center",display:"table-cell",verticalAlign:"middle",position:"absolute",width:"calc(100% - 30px)",height:"calc(100% + 15px)",top:"0px",right:"30px",backgroundColor:"rgba(50,50,50,0.5)"},id:"overlay"},this.state.notification)),s.a.createElement("span",{style:{fontSize:"small",float:"right"}},"Signed on ",this.state.messageParsed.meta.timestamp," "," ",s.a.createElement("button",{className:"button",type:"button",style:{fontSize:"small",float:"right",padding:"0px 0px",background:"#777"},onClick:this._toggleRawMessage.bind(this)},"🔍")),this.state.showRawMessage&&s.a.createElement("br",null),this.state.showRawMessage&&s.a.createElement("br",null),this.state.showRawMessage&&s.a.createElement("div",{style:{overflow:"auto",width:"calc(100%)",maxWidth:"1000px"}},s.a.createElement("pre",null,this.state.message))),a&&null==this.state.messageParsed&&s.a.createElement("fieldset",{style:{borderColor:"#F00"}},s.a.createElement("legend",{style:{color:"red",weight:"bold"},className:"error"},"Error while parsing message, please check syntax from message below"),s.a.createElement("pre",null,this.props.message)))}}]),t}();Bt.defaultProps={noVerification:!1};var Dt=Bt,Ft=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Lt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={tabsm_memo_key:a.props.account.get("options").get("memo_key"),tabsm_popup:"",tabsm_message_text:"",tabsm_message_signed:"",tabvm_popup:"",tabvm_message_signed:"",tabvm_verified:null,tabvm_message_signed_and_verified:null,tabvm_flag_verifyonchange:!1},a}return 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)}(t,s.a.Component),Ft(t,[{key:"_tabSMSignAction",value:function(e){var t=this;e.preventDefault();try{var a=this.props.account.get("options").get("memo_key");if(this.state.tabsm_memo_key!==a)throw Error(K.a.translate("account.signedmessages.keymismatch"));this.state.tabsm_message_text&&(this._tabSMPopMessage(K.a.translate("account.signedmessages.signing"),0),qt.signMessage(this.props.account,this.state.tabsm_message_text).then(function(e){t.setState({tabsm_message_signed:e,tabsm_popup:""})}).catch(function(e){t._tabSMPopMessage(e.message),t.setState({tabsm_message_signed:null})}))}catch(e){this._tabSMPopMessage(e.message),this.setState({tabsm_message_signed:null})}}},{key:"_tabSMHandleChange",value:function(e){this.setState({tabsm_message_text:e.target.value})}},{key:"_tabSMHandleChangeKey",value:function(e){this.setState({tabsm_memo_key:e})}},{key:"_tabSMCopyToClipBoard",value:function(e){if(""!==e.target.value){e.target.focus(),e.target.select();try{var t=document.execCommand("copy");this._tabSMPopMessage(t?K.a.translate("account.signedmessages.copysuccessful"):K.a.translate("account.signedmessages.copyunsuccessful"))}catch(e){this._tabSMPopMessage(K.a.translate("account.signedmessages.copyunsuccessful"))}}}},{key:"_tabSMPopMessage",value:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;this.setState({tabsm_popup:e}),""!==e&&a>0&&setTimeout(function(){t.setState({tabsm_popup:""})},a)}},{key:"_tabVMAction",value:function(e){var t=this;e.preventDefault(),this.setState({tabvm_message_signed_and_verified:null,tabvm_verified:!1}),this.state.tabvm_message_signed&&(this._tabVMPopMessage(K.a.translate("account.signedmessages.verifying"),0),setTimeout(function(){try{var e=qt.verifyMemo(t.state.tabvm_message_signed);t.setState({tabvm_message_signed_and_verified:e,tabvm_verified:!0,tabvm_popup:""})}catch(e){t._tabVMPopMessage(e.message),t.setState({tabvm_message_signed_and_verified:null,tabvm_verified:!1})}},0))}},{key:"_tabVMHandleChange",value:function(e){this.setState({tabvm_message_signed:e.target.value,tabvm_verified:!1,tabvm_message_signed_and_verified:null}),this.state.tabvm_flag_verifyonchange&&this._tabVMAction(e)}},{key:"_tabVMPopMessage",value:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;this.setState({tabvm_popup:e}),""!==e&&a>0&&setTimeout(function(){t.setState({tabvm_popup:""})},a)}},{key:"_tabVMToggleVerifyOnChange",value:function(){this.setState({tabvm_flag_verifyonchange:!this.state.tabvm_flag_verifyonchange})}},{key:"render",value:function(){return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{className:"account-tabs",tabsClass:"account-overview no-padding bordered-header content-block",setting:"accountSignedMessagesTab",contentClass:"grid-content shrink small-vertical medium-horizontal padding",segmented:!1},s.a.createElement(q.a,{title:"account.signedmessages.signmessage"},s.a.createElement("div",{className:"grid-content",style:{overflowX:"hidden"}},s.a.createElement("div",{className:"content-block no-margin"},s.a.createElement("h3",null,s.a.createElement(A.a,{content:"account.signedmessages.signmessage"}))),s.a.createElement(Ct,{ref:"memo_key",value:this.state.tabsm_memo_key,label:"account.perm.memo_public_key",placeholder:"Public Key",tabIndex:7,onChange:this._tabSMHandleChangeKey.bind(this),disableActionButton:!0}),s.a.createElement("br",null),s.a.createElement("textarea",{rows:"10",value:this.state.tabsm_message_text,onChange:this._tabSMHandleChange.bind(this),placeholder:K.a.translate("account.signedmessages.entermessage")}),s.a.createElement("span",null,s.a.createElement("button",{className:"button",onClick:this._tabSMSignAction.bind(this)},s.a.createElement(A.a,{content:"account.signedmessages.sign"})),s.a.createElement("div",{style:{color:"gray"}},this.state.tabsm_popup)),s.a.createElement("br",null),s.a.createElement("br",null),s.a.createElement("textarea",{rows:"14",value:this.state.tabsm_message_signed,style:{editable:!1},placeholder:K.a.translate("account.signedmessages.automaticcreation"),onClick:this._tabSMCopyToClipBoard.bind(this)}))),s.a.createElement(q.a,{title:"account.signedmessages.verifymessage"},s.a.createElement("div",{className:"grid-content",style:{overflowX:"hidden"}},s.a.createElement("div",{className:"content-block no-margin"},s.a.createElement("h3",null,s.a.createElement(A.a,{content:"account.signedmessages.verifymessage"})),s.a.createElement("div",{style:{float:"right",marginTop:"0.1em",marginBottom:"0.5em"}},s.a.createElement("table",null,s.a.createElement("tr",null,s.a.createElement("td",null,s.a.createElement("label",null,s.a.createElement(A.a,{content:"account.signedmessages.verifyonchange"}))),s.a.createElement("td",null,s.a.createElement("div",{className:"switch",onClick:this._tabVMToggleVerifyOnChange.bind(this)},s.a.createElement("input",{type:"checkbox",checked:this.state.tabvm_flag_verifyonchange,value:K.a.translate("account.signedmessages.verifyonchange")}),s.a.createElement("label",null))))))),s.a.createElement("textarea",{rows:"10",value:this.state.tabvm_message_signed,onChange:this._tabVMHandleChange.bind(this),placeholder:K.a.translate("account.signedmessages.entermessage")}),s.a.createElement("span",null,s.a.createElement("button",{className:"button",onClick:this._tabVMAction.bind(this)},s.a.createElement(A.a,{content:"account.signedmessages.verify"})),s.a.createElement("text",{style:{color:"gray"}},this.state.tabvm_popup),null!==this.state.tabvm_verified&&s.a.createElement("div",{style:{float:"right"}},"Message is:",s.a.createElement("div",{style:{backgroundColor:this.state.tabvm_verified?"green":"red"}},s.a.createElement("label",null,this.state.tabvm_verified?"verified":"not verified"))),(this.state.tabvm_verified&&null!==this.state.tabvm_message_signed_and_verified||this.state.tabvm_flag_verifyonchange)&&s.a.createElement("div",null,s.a.createElement("br",null),s.a.createElement(Dt,{message:this.state.tabvm_message_signed})))))))))}}]),t}();Lt.propTypes={account:c.a.ChainAccount.isRequired};var Vt=Lt=Object(u.a)(Lt),Ut=a(240),zt=a.n(Ut),Wt=a(100),Jt=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function Kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gt(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 Zt(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)}var Qt=function(e){function t(){return Kt(this,t),Gt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Zt(t,s.a.Component),Jt(t,[{key:"render",value:function(){var e=this.props,t=e.account,a=e.onRemove;return s.a.createElement("tr",null,s.a.createElement("td",null,this.props.index),s.a.createElement("td",null,t.get("id")),s.a.createElement("td",null,s.a.createElement(ue.a,{account:t.get("id")})),a?s.a.createElement("td",null,s.a.createElement("button",{onClick:a.bind(this,t.get("id")),className:"button outline"},"Remove")):null)}}]),t}();Qt.propTypes={account:c.a.ChainAccount.isRequired},Qt.defaultProps={tempComponent:"tr"},Qt=Object(u.a)(Qt);var Ht=function(e){function t(){return Kt(this,t),Gt(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Zt(t,s.a.Component),Jt(t,[{key:"_onRemove",value:function(e,t,a){if(t){var n=this.props.getCurrentState(t),s=Wt.a.new_transaction();s.add_type_operation("account_whitelist",{fee:{amount:0,asset_id:"1.3.0"},authorizing_account:this.props.account.get("id"),account_to_list:t,new_listing:n-zt.a.account_listing[e]}),at.a.process_transaction(s,null,!0)}}},{key:"render",value:function(){var e=this,t=this.props,a=t.removeButton,n=t.white,r=t.list.map(function(t,r){return s.a.createElement(Qt,{key:t,onRemove:a?e._onRemove.bind(e,n?"white_listed":"black_listed"):null,account:t,index:r+1})}).toArray(),o=!0;return r.length||(o=!1,r.push(s.a.createElement("tr",{key:"empty"},s.a.createElement("td",{style:{padding:"1rem 0"},colSpan:a?4:3},s.a.createElement(A.a,{content:this.props.emptyText,account:this.props.account.get("name")}))))),s.a.createElement("table",{className:"table compact dashboard-table"},o?s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null,"#"),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.id"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.name"})),a?s.a.createElement("th",null):null)):null,s.a.createElement("tbody",null,r))}}]),t}(),Yt=function(e){function t(){Kt(this,t);var e=Gt(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={accountName:"",accountToList:null},e}return Zt(t,s.a.Component),Jt(t,[{key:"_getCurrentState",value:function(e){var t=this.props.account,a=t.get("whitelisted_accounts")||h.a.List(),n=t.get("blacklisted_accounts")||h.a.List(),s=zt.a.account_listing.no_listing;return a.includes(e)&&(s+=zt.a.account_listing.white_listed),n.includes(e)&&(s+=zt.a.account_listing.black_listed),s}},{key:"_onAdd",value:function(e,t){var a=this.state.accountToList,n=this.props.account,s=this._getCurrentState(a);if(a){var r=Wt.a.new_transaction();r.add_type_operation("account_whitelist",{fee:{amount:0,asset_id:"1.3.0"},authorizing_account:n.get("id"),account_to_list:a,new_listing:s+zt.a.account_listing[e]}),at.a.process_transaction(r,null,!0)}}},{key:"_onAccountFound",value:function(e){console.log("accountFound:",e),this.setState({accountName:e?e.get("name"):null,accountToList:e?e.get("id"):null})}},{key:"_onAccountChanged",value:function(e){console.log("account changed:",e),this.setState({accountName:e,accountToList:null})}},{key:"render",value:function(){var e=this.props.account,t=this.state.accountName;return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{className:"account-tabs",tabsClass:"account-overview no-padding bordered-header content-block",setting:"whitelistTab",contentClass:"grid-content shrink small-vertical medium-horizontal no-padding",segmented:!1},s.a.createElement(q.a,{title:"account.whitelist.title"},s.a.createElement("div",{style:{paddingBottom:"1rem"},className:"small-12"},s.a.createElement("div",null,s.a.createElement(Ht,{emptyText:"account.whitelist.empty",account:e,getCurrentState:this._getCurrentState.bind(this),list:e.get("whitelisted_accounts")||h.a.List(),removeButton:!0,white:!0})),e.get("whitelisted_accounts")?null:s.a.createElement("p",{className:"has-error"},"Please note, whitelisting is not working yet due to unresolved backend issue."),s.a.createElement("div",{style:{padding:"2rem 0"}},s.a.createElement(me.a,{label:"account.whitelist.add",accountName:t,onAccountChanged:this._onAccountFound.bind(this),onChange:this._onAccountChanged.bind(this),account:t,tabIndex:2,onAction:this._onAdd.bind(this,"white_listed"),action_label:"account.perm.confirm_add",white:!1,typeahead:!0})))),s.a.createElement(q.a,{title:"account.whitelist.black"},s.a.createElement("div",{style:{paddingBottom:"1rem"},className:"small-12"},s.a.createElement("div",null,s.a.createElement(Ht,{emptyText:"account.whitelist.empty_black",account:e,getCurrentState:this._getCurrentState.bind(this),list:e.get("blacklisted_accounts"),removeButton:!0})),s.a.createElement("div",{style:{padding:"2rem 1rem"}},s.a.createElement(me.a,{label:"account.whitelist.add_black",accountName:t,onAccountChanged:this._onAccountFound.bind(this),onChange:this._onAccountChanged.bind(this),account:t,tabIndex:2,onAction:this._onAdd.bind(this,"black_listed"),action_label:"account.perm.confirm_add",typeahead:!0})))),s.a.createElement(q.a,{title:"account.whitelist.white_by"},s.a.createElement("div",{style:{paddingBottom:"1rem"},className:"small-12"},s.a.createElement("div",null,s.a.createElement(Ht,{emptyText:"account.whitelist.empty_white_by",account:e,list:e.get("whitelisting_accounts")})))),s.a.createElement(q.a,{title:"account.whitelist.black_by"},s.a.createElement("div",{style:{paddingBottom:"1rem"},className:"small-12"},s.a.createElement("div",null,s.a.createElement(Ht,{emptyText:"account.whitelist.empty_black_by",account:e,list:e.get("blacklisting_accounts")}))))))))}}]),t}(),Xt=a(1770),$t=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var ea=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return 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)}(t,s.a.Component),$t(t,[{key:"onApprove",value:function(){var e=[],t=[];this.props.vote_ids.has(this.props.worker.get("vote_against"))&&t.push(this.props.worker.get("vote_against")),this.props.vote_ids.has(this.props.worker.get("vote_for"))||e.push(this.props.worker.get("vote_for")),this.props.onChangeVotes(e,t)}},{key:"onReject",value:function(){var e=[];this.props.vote_ids.has(this.props.worker.get("vote_against"))&&e.push(this.props.worker.get("vote_against")),this.props.vote_ids.has(this.props.worker.get("vote_for"))&&e.push(this.props.worker.get("vote_for")),this.props.onChangeVotes([],e)}},{key:"render",value:function(){var e=this.props.rank,t=this.props.worker.toJS(),a=t.total_votes_for-t.total_votes_against,n=!!this.props.vote_ids.has(t.vote_for)||!this.props.vote_ids.has(t.vote_against)&&null,r=0;t.daily_pay<this.props.rest?r=100:this.props.rest>0&&(r=this.props.rest/t.daily_pay*100);var o=K.a.localize(new Date(t.work_begin_date+"Z"),{type:"date",format:"short_custom"}),i=K.a.localize(new Date(t.work_end_date+"Z"),{type:"date",format:"short_custom"}),l=new Date,c=new Date(t.work_end_date+"Z")<=l,u=new Date(t.work_begin_date+"Z")<=l,p=!c&&a<this.props.voteThreshold||!u;return s.a.createElement("tr",{className:n?"":"unsupported"},c?null:s.a.createElement("td",{style:{textAlign:"right",paddingRight:10,paddingLeft:0}},e),s.a.createElement("td",{className:"worker-id",style:{textAlign:"left"}},t.id),s.a.createElement("td",{className:"worker-name",style:{textAlign:"left"}},s.a.createElement("div",{className:"inline-block",style:{paddingRight:5,position:"relative",top:-1}},s.a.createElement("a",{style:{visibility:t.url&&-1!==t.url.indexOf(".")?"visible":"hidden"},href:t.url,target:"_blank",rel:"noopener noreferrer"},s.a.createElement(M.a,{name:"share",title:"icons.share"}))),s.a.createElement("div",{className:"inline-block"},t.name,s.a.createElement("br",null),s.a.createElement(ue.a,{account:t.worker_account}))),s.a.createElement("td",{style:{textAlign:"right"},className:"hide-column-small"},s.a.createElement(S.a,{amount:a,asset:"1.3.0",decimalOffset:5,hide_asset:!0})),p?s.a.createElement("td",{style:{textAlign:"right"}},s.a.createElement(S.a,{amount:Math.max(0,this.props.voteThreshold-a),asset:"1.3.0",hide_asset:!0,decimalOffset:5})):null,s.a.createElement("td",null,o," - ",i),c||p?null:s.a.createElement("td",{style:{textAlign:"right"},className:"hide-column-small"},z.a.format_number(r,2),"%"),s.a.createElement("td",{style:{textAlign:"right"},className:"hide-column-small"},s.a.createElement(Xt.b,{hide_asset:!0,fromAsset:"1.3.0",toAsset:this.props.preferredUnit,amount:t.daily_pay})),c||p?null:s.a.createElement("td",{style:{textAlign:"right"}},this.props.rest<=0?"0.00":s.a.createElement(Xt.b,{hide_asset:!0,fromAsset:"1.3.0",toAsset:this.props.preferredUnit,amount:this.props.rest})),s.a.createElement("td",{className:"clickable",onClick:this.props.proxy?function(){}:this[n?"onReject":"onApprove"].bind(this)},this.props.proxy?s.a.createElement(M.a,{name:"locked",title:"icons.locked.action"}):s.a.createElement(M.a,{name:n?"checkmark-circle":"minus-circle",title:n?"icons.checkmark_circle.approved":"icons.minus_circle.disapproved"})))}}]),t}();ea.propTypes={worker:c.a.ChainObject.isRequired,onAddVote:E.a.func,onRemoveVote:E.a.func,vote_ids:E.a.object},ea.defaultProps={tempComponent:"tr"};var ta=Object(u.a)(ea),aa=a(322),na=a.n(aa),sa=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oa(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 ia(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 la(e,t){var a="",n=0,s=void 0;return"witness"===e?s=W.ChainStore.getWitnessById(t.get("id")):"committee"===e&&(s=W.ChainStore.getCommitteeMemberById(t.get("id"))),a=s?s.get("url"):a,{url:a=na()(a,{whiteList:[],stripIgnoreTag:!0}),votes:n=s?s.get("total_votes"):n,id:s.get("id")}}var ca=function(e){function t(){return ra(this,t),oa(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return ia(t,s.a.Component),sa(t,[{key:"shouldComponentUpdate",value:function(e){return e.account!==this.props.account||e.action!==this.props.action||e.isActive!==this.props.isActive||e.idx!==this.props.idx||e.proxy!==this.props.proxy}},{key:"onAction",value:function(e){this.props.onAction(e)}},{key:"render",value:function(){var e=this.props,t=e.account,a=e.type,n=e.action,r=e.isActive,o=t.get("id"),i=la(a,t),l=i.url,c=i.votes,u=l&&l.length>0&&-1===l.indexOf("http")?"http://"+l:l,p="remove"===n;return s.a.createElement("tr",{className:p?"":"unsupported"},s.a.createElement("td",{style:{textAlign:"right"}},this.props.idx+1),s.a.createElement("td",{style:{textAlign:"left"}},s.a.createElement(ue.a,{account:t.get("id")})),s.a.createElement("td",null,u&&-1!==u.indexOf(".")?s.a.createElement("a",{href:u,target:"_blank",rel:"noopener noreferrer"},s.a.createElement(M.a,{name:"share",title:"icons.share"})):null),s.a.createElement("td",null,s.a.createElement(S.a,{amount:c,asset:"1.3.0",decimalOffset:5,hide_asset:!0})),s.a.createElement("td",null,s.a.createElement(A.a,{content:"account.votes."+(r?"active_short":"inactive")})),s.a.createElement("td",{style:{textAlign:"center"}},s.a.createElement(A.a,{content:"settings."+(p?"yes":"no")})),s.a.createElement("td",{className:this.props.proxy?"":"clickable",onClick:this.props.proxy?function(){}:this.onAction.bind(this,o)},this.props.proxy?s.a.createElement(M.a,{name:"locked",title:"icons.locked.action"}):s.a.createElement(M.a,{name:p?"checkmark-circle":"minus-circle",title:p?"icons.checkmark_circle.yes":"icons.minus_circle.no"})))}}]),t}();ca.propTypes={account:E.a.object.isRequired,onAction:E.a.func.isRequired};var ua=function(e){function t(e){ra(this,t);var a=oa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={selected_item:null,item_name_input:"",error:null},a.onItemChange=a.onItemChange.bind(a),a.onItemAccountChange=a.onItemAccountChange.bind(a),a.onAddItem=a.onAddItem.bind(a),a}return ia(t,s.a.Component),sa(t,[{key:"onItemChange",value:function(e){this.setState({item_name_input:e})}},{key:"onItemAccountChange",value:function(e){var t=this;if(this.setState({selected_item:e,error:null}),e&&this.props.validateAccount){var a=this.props.validateAccount(e);if(null===a)return;"string"==typeof a?this.setState({error:a}):a.then(function(e){return t.setState({error:e})})}}},{key:"onAddItem",value:function(e){if(e){this.setState({selected_item:null,item_name_input:"",error:null}),this.props.onAddItem(e.get("id"))}}},{key:"render",value:function(){var e=this;if(!this.props.items)return null;var t=this.props.items.filter(function(e){return!!e}).sort(function(t,a){var n=la(e.props.type,t).votes,s=la(e.props.type,a).votes;return n!==s?parseInt(s,10)-parseInt(n,10):t.get("name")>a.get("name")?1:t.get("name")<a.get("name")?-1:0}).map(function(t,a){var n=e.props.supported&&e.props.supported.includes(t.get("id"))?"remove":"add",r=e.props.active.includes(la(e.props.type,t).id);return s.a.createElement(ca,{idx:a,key:t.get("name"),account:t,type:e.props.type,onAction:"add"===n?e.props.onAddItem:e.props.onRemoveItem,isSelected:-1!==e.props.items.indexOf(t),action:n,isActive:r,proxy:e.props.proxy})}),a=this.state.error;!a&&this.state.selected_item&&-1!==this.props.items.indexOf(this.state.selected_item)&&(a=K.a.translate("account.votes.already"));var n=["10%","20%","40%","20%","10%"];return s.a.createElement("div",null,this.props.withSelector?s.a.createElement(me.a,{style:{maxWidth:"600px"},label:this.props.label,error:a,placeholder:this.props.placeholder,account:this.state.item_name_input,accountName:this.state.item_name_input,onChange:this.onItemChange,onAccountChanged:this.onItemAccountChange,onAction:this.onAddItem,action_label:"account.votes.add_witness",tabIndex:this.props.tabIndex}):null,this.props.title&&t.length?s.a.createElement("h4",null,this.props.title):null,t.length?s.a.createElement("table",{className:"table dashboard-table table-hover"},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",{style:{textAlign:"right"}},"#"),s.a.createElement("th",{style:{textAlign:"left",maxWidth:n[1]}},s.a.createElement(A.a,{content:"account.votes.name"})),s.a.createElement("th",{style:{maxWidth:n[2]}},s.a.createElement(A.a,{content:"account.votes.about"})),s.a.createElement("th",{style:{maxWidth:n[3]}},s.a.createElement(A.a,{content:"account.votes.votes"})),s.a.createElement("th",{style:{maxWidth:n[4]}},s.a.createElement(A.a,{content:"account.votes.status.title"})),s.a.createElement("th",{style:{maxWidth:n[0]}},s.a.createElement(A.a,{content:"account.votes.supported"})),s.a.createElement("th",{style:{maxWidth:n[5]}},s.a.createElement(A.a,{content:"account.votes.toggle"})))),s.a.createElement("tbody",null,t)):null)}}]),t}();ua.propTypes={items:c.a.ChainObjectsList,onAddItem:E.a.func.isRequired,onRemoveItem:E.a.func.isRequired,validateAccount:E.a.func,label:E.a.string.isRequired,placeholder:E.a.string,tabIndex:E.a.number,action:E.a.string,withSelector:E.a.bool},ua.defaultProps={action:"remove",withSelector:!0,autosubscribe:!1};var pa=Object(u.a)(ua),ma=a(140),da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ha=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,s=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done)&&(a.push(o.value),!t||a.length!==t);n=!0);}catch(e){s=!0,r=e}finally{try{!n&&i.return&&i.return()}finally{if(s)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),fa=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var ba=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));a.onRemoveProxy=function(){a.publish(null)};var n=e.proxy.get("id"),s=e.proxy.get("name");return a.state={proxy_account_id:"1.2.5"===n?"":n,prev_proxy_account_id:"1.2.5"===n?"":n,current_proxy_input:"1.2.5"===n?"":s,witnesses:null,committee:null,vote_ids:h.a.Set(),proxy_vote_ids:h.a.Set(),lastBudgetObject:e.initialBudget.get("id"),workerTableIndex:e.viewSettings.get("workerTableIndex",1),all_witnesses:h.a.List(),all_committee:h.a.List()},a.onProxyAccountFound=a.onProxyAccountFound.bind(a),a.onPublish=a.onPublish.bind(a),a.onReset=a.onReset.bind(a),a._getVoteObjects=a._getVoteObjects.bind(a),a}return 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)}(t,s.a.Component),fa(t,[{key:"componentWillMount",value:function(){m.a.getFinalFeeAsset(this.props.account,"account_update"),W.ChainStore.fetchAllWorkers(),this.getBudgetObject()}},{key:"componentDidMount",value:function(){this.updateAccountData(this.props),this._getVoteObjects(),this._getVoteObjects("committee")}},{key:"componentWillReceiveProps",value:function(e){if(e.account!==this.props.account){var t=e.proxy.get("id"),a={proxy_account_id:"1.2.5"===t?"":t};this.setState({prev_proxy_account_id:a.proxy_account_id}),this.updateAccountData(e,a)}this.getBudgetObject()}},{key:"updateAccountData",value:function(e){var t=this,a=e.account,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state).proxy_account_id,s=W.ChainStore.getAccount(n),r=a.get("options"),o=s?s.get("options"):null,i=s?s.get("name"):"";"1.2.5"===n&&(n="",i="");var l=r.get("votes").toArray(),c=h.a.Set(l);W.ChainStore.getObjectsByVoteIds(l);var u=null,p=h.a.Set([]);if("1.2.5"!==n&&o){var m=o.get("votes").toArray();p=h.a.Set(m),W.ChainStore.getObjectsByVoteIds(m),u=Object(W.FetchChainObjects)(W.ChainStore.getObjectByVoteID,m,1e4)}Promise.all([Object(W.FetchChainObjects)(W.ChainStore.getObjectByVoteID,l,1e4),u]).then(function(e){var a=ha(e,2),s=a[0],r=a[1];function o(e){var t=new h.a.List,a=new h.a.List,n=new h.a.Set;return e.forEach(function(e){var n=e.get("committee_member_account");n?a=a.push(n):(n=e.get("worker_account"))||(n=e.get("witness_account"))&&(t=t.push(n))}),{witnesses:t,committee:a,workers:n}}var l=o(s),u=l.witnesses,m=l.committee,d=l.workers,f=o(r||[]),b=f.witnesses,g=f.committee,_=f.workers,v={proxy_account_id:n,current_proxy_input:i,witnesses:u,committee:m,workers:d,proxy_witnesses:b,proxy_committee:g,proxy_workers:_,vote_ids:c,proxy_vote_ids:p,prev_witnesses:u,prev_committee:m,prev_workers:d,prev_vote_ids:c};t.setState(v)})}},{key:"isChanged",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return e.proxy_account_id!==e.prev_proxy_account_id||e.witnesses!==e.prev_witnesses||e.committee!==e.prev_committee||!h.a.is(e.vote_ids,e.prev_vote_ids)}},{key:"_getVoteObjects",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"witnesses",a=arguments[1],n=this.state["all_"+t],s="witnesses"===t,r=void 0;if(a)r=parseInt(a[a.length-1].split(".")[2],10);else{a=[];var o=this.props.globalObject.get(s?"active_witnesses":"active_committee_members").sort(function(e,t){return parseInt(e.split(".")[2],10)-parseInt(t.split(".")[2],10)}).last()||"1."+(s?"6":"5")+".1";r=parseInt(o.split(".")[2],10);for(var i=1;i<=r+10;i++)a.push("1."+(s?"6":"5")+"."+i)}Object(W.FetchChainObjects)(W.ChainStore.getObject,a,5e3,{}).then(function(o){if(e.state["all_"+t]=n.concat(h.a.List(o.filter(function(e){return!!e}).map(function(e){return e.get(s?"witness_account":"committee_member_account")}))),o[o.length-1]){a=[];for(var i=r+11;i<=r+20;i++)a.push("1."+(s?"6":"5")+"."+i);return e._getVoteObjects(t,a)}e.forceUpdate()})}},{key:"onPublish",value:function(){this.publish(this.state.proxy_account_id)}},{key:"publish",value:function(e){var t=this,a=this.props.account.toJS(),n={account:a.id},s={memo_key:a.options.memo_key};s.voting_account=e||"1.2.5",s.num_witness=this.state.witnesses.size,s.num_committee=this.state.committee.size,n.new_options=s,n.fee={amount:0,asset_id:m.a.getFinalFeeAsset(a.id,"account_update")};var r=this.state.vote_ids,o=this._getWorkerArray(),i=new Date;function l(e,t){return e.includes(t)&&(e=e.delete(t)),e}o.forEach(function(e){e&&(new Date(e.get("work_end_date"))<=i&&(r=l(r,e.get("vote_for"))),r=l(r,e.get("vote_against")))}),Object(W.FetchChainObjects)(W.ChainStore.getWitnessById,this.state.witnesses.toArray(),4e3).then(function(e){var a=e.map(function(e){return e.get("vote_id")});return Promise.all([Promise.resolve(a),Object(W.FetchChainObjects)(W.ChainStore.getCommitteeMemberById,t.state.committee.toArray(),4e3)])}).then(function(e){n.new_options.votes=e[0].concat(e[1].map(function(e){return e.get("vote_id")})).concat(r.filter(function(e){return"2"===e.split(":")[0]}).toArray()).sort(function(e,t){var a=e.split(":"),n=t.split(":");return parseInt(a[1],10)-parseInt(n[1],10)}),$e.a.updateAccount(n)})}},{key:"onReset",value:function(){var e=this,t=this.state;this.refs.voting_proxy&&this.refs.voting_proxy.refs.bound_component&&this.refs.voting_proxy.refs.bound_component.onResetProxy(),this.setState({proxy_account_id:t.prev_proxy_account_id,current_proxy_input:t.prev_proxy_input,witnesses:t.prev_witnesses,committee:t.prev_committee,workers:t.prev_workers,vote_ids:t.prev_vote_ids},function(){e.updateAccountData(e.props)})}},{key:"onAddItem",value:function(e,t){var a={};a[e]=this.state[e].push(t),this.setState(a)}},{key:"onRemoveItem",value:function(e,t){var a={};a[e]=this.state[e].filter(function(e){return e!==t}),this.setState(a)}},{key:"onChangeVotes",value:function(e,t){var a={};a.vote_ids=this.state.vote_ids,e.length&&e.forEach(function(e){a.vote_ids=a.vote_ids.add(e)}),t&&t.forEach(function(e){a.vote_ids=a.vote_ids.delete(e)}),this.setState(a)}},{key:"validateAccount",value:function(e,t){return t?"witnesses"===e?Object(W.FetchChainObjects)(W.ChainStore.getWitnessById,[t.get("id")],3e3).then(function(e){return e[0]?null:"Not a witness"}):"committee"===e?Object(W.FetchChainObjects)(W.ChainStore.getCommitteeMemberById,[t.get("id")],3e3).then(function(e){return e[0]?null:"Not a committee member"}):null:null}},{key:"onProxyChange",value:function(e){var t=W.ChainStore.getAccount(e);(!t||t&&t.get("id")!==this.state.proxy_account_id)&&this.setState({proxy_account_id:"",proxy_witnesses:h.a.Set(),proxy_committee:h.a.Set(),proxy_workers:h.a.Set()}),this.setState({current_proxy_input:e})}},{key:"onProxyAccountFound",value:function(e){var t=this,a=e?e.get("id"):"";this.state.proxy_account_id!==a&&this.setState({proxy_account_id:a},function(){t.updateAccountData(t.props)})}},{key:"onClearProxy",value:function(){this.setState({proxy_account_id:""})}},{key:"_getTotalVotes",value:function(e){return parseInt(e.get("total_votes_for"),10)-parseInt(e.get("total_votes_against"),10)}},{key:"getBudgetObject",value:function(){var e=this,t=this.state.lastBudgetObject,a=void 0;a=W.ChainStore.getObject(t);var n=parseInt(t.split(".")[2],10);if(a){var s=a.get("time");/Z$/.test(s)||(s+="Z");var r=new Date,o=n+Math.floor((r-new Date(s).getTime())/1e3/60/60)-1;if(n>=o)return;var l="2.13."+Math.max(n,o),c=parseInt(l.split(".")[2],10);Object(W.FetchChainObjects)(W.ChainStore.getObject,[l],void 0,{}).then(function(t){null===ha(t,1)[0]?e.setState({lastBudgetObject:"2.13."+(c-1)},e.getBudgetObject):(i.a.setLastBudgetObject(l),e.setState({lastBudgetObject:l}))})}else{var u="2.13."+(n-1);Object(W.FetchChainObjects)(W.ChainStore.getObject,[u],void 0,{}).then(function(t){null===ha(t,1)[0]?e.setState({lastBudgetObject:"2.13."+(n-2)},e.getBudgetObject):(i.a.setLastBudgetObject(u),e.setState({lastBudgetObject:u}))})}}},{key:"_getWorkerArray",value:function(){var e=[];return W.ChainStore.workers.forEach(function(t){var a=W.ChainStore.getObject(t,!1,!1);a&&e.push(a)}),e}},{key:"_setWorkerTableIndex",value:function(e){this.setState({workerTableIndex:e})}},{key:"render",value:function(){var e=this,t=this.state,a=t.workerTableIndex,n=!!t.prev_proxy_account_id,r=this.props.settings.get("unit")||"1.3.0",o=!!this.state.proxy_account_id,i=V()("button",{disabled:!this.isChanged()}),l=this.props.globalObject,c=void 0;this.state.lastBudgetObject&&(c=W.ChainStore.getObject(this.state.lastBudgetObject));var u=0,p=l?parseInt(l.getIn(["parameters","worker_budget_per_day"]),10):0;c&&(p=Math.min(24*c.getIn(["record","worker_budget"]),p),u=Math.min(24*c.getIn(["record","worker_budget"]),p));var m=new Date,d=this._getWorkerArray(),h=0,f=d.filter(function(e){return!!e&&(new Date(e.get("work_end_date")+"Z")>m&&new Date(e.get("work_begin_date")+"Z")<=m)}).sort(function(t,a){return e._getTotalVotes(a)-e._getTotalVotes(t)}).map(function(t,a){var n=parseInt(t.get("daily_pay"),10);p-=n;var i=t.get("total_votes_for")-t.get("total_votes_against");return p<=0&&!h&&(h=i),h&&i<h?null:s.a.createElement(ta,{preferredUnit:r,rest:p+n,rank:a+1,key:t.get("id"),worker:t.get("id"),vote_ids:e.state[o?"proxy_vote_ids":"vote_ids"],onChangeVotes:e.onChangeVotes.bind(e),proxy:o,voteThreshold:h})}).filter(function(e){return!!e}),b=d.filter(function(e){if(!e)return!1;var t=e.get("total_votes_for")-e.get("total_votes_against");return new Date(e.get("work_end_date")+"Z")>m&&t<h||new Date(e.get("work_begin_date")+"Z")>m}).sort(function(t,a){return e._getTotalVotes(a)-e._getTotalVotes(t)}).map(function(t,a){return s.a.createElement(ta,{preferredUnit:r,rest:0,rank:a+1,key:t.get("id"),worker:t.get("id"),vote_ids:e.state[o?"proxy_vote_ids":"vote_ids"],onChangeVotes:e.onChangeVotes.bind(e),proxy:o,voteThreshold:h})}),g=d.filter(function(e){return!!e&&new Date(e.get("work_end_date"))<=m}).sort(function(t,a){return e._getTotalVotes(a)-e._getTotalVotes(t)}).map(function(t,a){return s.a.createElement(ta,{preferredUnit:r,rest:0,rank:a+1,key:t.get("id"),worker:t.get("id"),vote_ids:e.state[o?"proxy_vote_ids":"vote_ids"],onChangeVotes:e.onChangeVotes.bind(e),proxy:o,voteThreshold:h})}),_=s.a.createElement("span",null,s.a.createElement("button",{className:V()(i,{success:this.isChanged()}),onClick:this.onPublish,tabIndex:4},s.a.createElement(A.a,{content:"account.votes.publish"})),s.a.createElement("button",{className:"button "+i,onClick:this.onReset,tabIndex:8},s.a.createElement(A.a,{content:"account.perm.reset"})),n&&s.a.createElement("button",{className:"button",onClick:this.onRemoveProxy,tabIndex:9},s.a.createElement(A.a,{content:"account.perm.remove_proxy"}))),v=s.a.createElement(me.a,{style:{width:"50%",maxWidth:250,marginBottom:10},account:this.state.current_proxy_input,accountName:this.state.current_proxy_input,onChange:this.onProxyChange.bind(this),onAccountChanged:this.onProxyAccountFound,tabIndex:1,placeholder:K.a.translate("account.votes.set_proxy"),tooltip:K.a.translate(this.state.proxy_account_id?"tooltip.proxy_remove":"tooltip.proxy_search"),hideImage:!0},s.a.createElement("span",{style:{paddingLeft:5,position:"relative",top:9,display:o?"":"none"}},s.a.createElement(M.a,{name:"locked",size:"1x"})),s.a.createElement("span",{style:{paddingLeft:5,position:"relative",top:9,display:o?"none":""}},s.a.createElement(w.a,{to:"/help/voting"},s.a.createElement(M.a,{name:"question-circle",title:"icons.question_circle",size:"1x"})))),y=2===a,E=s.a.createElement("div",{className:"inline-block",style:{float:"right",visibility:this.isChanged()?"visible":"hidden",color:"red",padding:"0.85rem",fontSize:"0.9rem"}},s.a.createElement(A.a,{content:"account.votes.save_finish"}));return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{setting:"votingTab",className:"account-tabs",defaultActiveTab:1,segmented:!1,actionButtons:E,tabsClass:"account-overview no-padding bordered-header content-block"},s.a.createElement(q.a,{title:"explorer.witnesses.title"},s.a.createElement("div",{className:V()("content-block")},s.a.createElement("div",{className:"header-selector"},v,s.a.createElement("div",{style:{float:"right",marginTop:"-2.5rem"}},_)),s.a.createElement(pa,{type:"witness",label:"account.votes.add_witness_label",items:this.state.all_witnesses,validateAccount:this.validateAccount.bind(this,"witnesses"),onAddItem:this.onAddItem.bind(this,"witnesses"),onRemoveItem:this.onRemoveItem.bind(this,"witnesses"),tabIndex:o?-1:2,supported:this.state[o?"proxy_witnesses":"witnesses"],withSelector:!1,active:l.get("active_witnesses"),proxy:this.state.proxy_account_id}))),s.a.createElement(q.a,{title:"explorer.committee_members.title"},s.a.createElement("div",{className:V()("content-block")},s.a.createElement("div",{className:"header-selector"},v,s.a.createElement("div",{style:{float:"right",marginTop:"-2.5rem"}},_)),s.a.createElement(pa,{type:"committee",label:"account.votes.add_committee_label",items:this.state.all_committee,validateAccount:this.validateAccount.bind(this,"committee"),onAddItem:this.onAddItem.bind(this,"committee"),onRemoveItem:this.onRemoveItem.bind(this,"committee"),tabIndex:o?-1:3,supported:this.state[o?"proxy_committee":"committee"],withSelector:!1,active:l.get("active_committee_members"),proxy:this.state.proxy_account_id}))),s.a.createElement(q.a,{title:"account.votes.workers_short"},s.a.createElement("div",{className:"header-selector"},s.a.createElement("div",{style:{float:"right"}},s.a.createElement(w.a,{to:"/create-worker"},s.a.createElement("div",{className:"button"},s.a.createElement(A.a,{content:"account.votes.create_worker"})))),s.a.createElement("div",{className:"selector"},s.a.createElement("div",{style:{paddingLeft:10},className:V()("inline-block",{inactive:0!==a}),onClick:this._setWorkerTableIndex.bind(this,0)},K.a.translate("account.votes.new",{count:b.length})),s.a.createElement("div",{className:V()("inline-block",{inactive:1!==a}),onClick:this._setWorkerTableIndex.bind(this,1)},K.a.translate("account.votes.active",{count:f.length})),g.length?s.a.createElement("div",{className:V()("inline-block",{inactive:!y}),onClick:y?function(){}:this._setWorkerTableIndex.bind(this,2)},s.a.createElement(A.a,{content:"account.votes.expired"})):null),s.a.createElement("div",{style:{marginTop:"2rem"}},v,s.a.createElement("div",{style:{float:"right",marginTop:"-2.5rem"}},_))),s.a.createElement("table",{className:"table dashboard-table table-hover"},2===a?null:0===a?s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null),s.a.createElement("th",{colSpan:"3",style:{textAlign:"left"}},s.a.createElement(A.a,{content:"account.votes.threshold"})),s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(S.a,{decimalOffset:5,hide_asset:!0,amount:h,asset:"1.3.0"})),s.a.createElement("th",{colSpan:"3"})),s.a.createElement("tr",null,s.a.createElement("th",{style:{border:"none",backgroundColor:"transparent"}}))):s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null),s.a.createElement("th",{colSpan:"4",style:{textAlign:"left"}},s.a.createElement(A.a,{content:"account.votes.total_budget"})," ","(",s.a.createElement(ma.a,{name:r}),")"),s.a.createElement("th",{colSpan:"2",className:"hide-column-small"}),s.a.createElement("th",{style:{textAlign:"right"}},l?s.a.createElement(Xt.b,{hide_asset:!0,fromAsset:"1.3.0",toAsset:r,amount:u}):null),s.a.createElement("th",{className:"hide-column-small"})),s.a.createElement("tr",null,s.a.createElement("th",{style:{border:"none",backgroundColor:"transparent"}}))),s.a.createElement("thead",null,s.a.createElement("tr",null,2===a?null:s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(A.a,{content:"account.votes.line"})),s.a.createElement("th",{style:{textAlign:"center"}},s.a.createElement(A.a,{content:"account.user_issued_assets.id"})),s.a.createElement("th",{style:{textAlign:"left"}},s.a.createElement(A.a,{content:"account.user_issued_assets.description"})),s.a.createElement("th",{style:{textAlign:"right"},className:"hide-column-small"},s.a.createElement(A.a,{content:"account.votes.total_votes"})),0===a?s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(A.a,{content:"account.votes.missing"})):null,s.a.createElement("th",null,s.a.createElement(A.a,{content:"explorer.workers.period"})),2===a||0===a?null:s.a.createElement("th",{style:{textAlign:"right"},className:"hide-column-small"},s.a.createElement(A.a,{content:"account.votes.funding"})),s.a.createElement("th",{style:{textAlign:"right"},className:"hide-column-small"},s.a.createElement(A.a,{content:"account.votes.daily_pay"}),s.a.createElement("div",{style:{paddingTop:5,fontSize:"0.8rem"}},"(",s.a.createElement(ma.a,{name:r}),")")),2===a||0===a?null:s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(A.a,{content:"explorer.witnesses.budget"}),s.a.createElement("div",{style:{paddingTop:5,fontSize:"0.8rem"}},"(",s.a.createElement(ma.a,{name:r}),")")),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.votes.toggle"})))),s.a.createElement("tbody",null,0===a?b:1===a?f:g)))))))}}]),t}();ba.propTypes={initialBudget:c.a.ChainObject.isRequired,globalObject:c.a.ChainObject.isRequired,proxy:c.a.ChainAccount.isRequired},ba.defaultProps={globalObject:"2.0.0"},ba=Object(u.a)(ba);var ga=function(e){return s.a.createElement(ba,da({},e,{initialBudget:i.a.getLastBudgetObject()}))},_a=a(535),va=a(1757),ya=a(1791),Ea=a(36),wa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ka=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function Aa(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Ca(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oa(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 xa(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)}var Sa={textAlign:"right"},Na={textAlign:"left"},ja=function(e){function t(){return Ca(this,t),Oa(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return xa(t,s.a.Component),ka(t,[{key:"_onUpdatePosition",value:function(e){e.preventDefault();var t="cp_modal_"+this.props.object.getIn(["call_price","quote","asset_id"]);this.refs[t].show()}},{key:"_onClosePosition",value:function(e){e.preventDefault();var t=Wt.a.new_transaction();t.add_type_operation("call_order_update",{fee:{amount:0,asset_id:0},funding_account:this.props.object.get("borrower"),delta_collateral:{amount:-this.props.object.get("collateral"),asset_id:this.props.object.getIn(["call_price","base","asset_id"])},delta_debt:{amount:-this.props.object.get("debt"),asset_id:this.props.object.getIn(["call_price","quote","asset_id"])}}),at.a.process_transaction(t,null,!0)}},{key:"_getBalance",value:function(){var e=this.props.account,t=this.props.object.getIn(["call_price","quote","asset_id"]),a=e.get("balances"),n=0;return a&&a.forEach(function(e,a){if(a==t){var s=W.ChainStore.getObject(e);n=s.get("balance")}}),n}},{key:"_getFeedPrice",value:function(){return this.props?1/z.a.get_asset_price(this.props.debtAsset.getIn(["bitasset","current_feed","settlement_price","quote","amount"]),this.props.collateralAsset,this.props.debtAsset.getIn(["bitasset","current_feed","settlement_price","base","amount"]),this.props.debtAsset):1}},{key:"_getCollateralRatio",value:function(){var e=this.props.object.toJS();return z.a.get_asset_amount(e.collateral,this.props.collateralAsset)/(z.a.get_asset_amount(e.debt,this.props.debtAsset)/this._getFeedPrice())}},{key:"_getMR",value:function(){return this.props.debtAsset.getIn(["bitasset","current_feed","maintenance_collateral_ratio"])/1e3}},{key:"_getStatusClass",value:function(){var e=this._getCollateralRatio(),t=this._getMR();return isNaN(e)?null:e<t?"danger":e<t+.5?"warning":""}},{key:"_getCRTip",value:function(){var e=this._getStatusClass(),t=this._getMR();return e&&""!==e?"danger"===e?K.a.translate("tooltip.cr_danger",{mr:t}):"warning"===e?K.a.translate("tooltip.cr_warning",{mr:t}):null:null}},{key:"render",value:function(){var e=this.props,t=e.debtAsset,a=e.collateralAsset,n=e.object.toJS(),r=this._getCollateralRatio(),o=z.a.get_asset_amount(n.debt,this.props.debtAsset),i=this._getBalance(),l=this._getStatusClass();return s.a.createElement("tr",{className:"margin-row"},s.a.createElement("td",{style:Na},s.a.createElement(va.a,{replaceNoneToBts:!1,maxWidth:30,name:t.get("symbol")}),s.a.createElement(w.a,{to:"/asset/"+t.get("symbol")},s.a.createElement(ma.a,{noTip:!0,name:t.get("symbol")}))),s.a.createElement("td",{style:Sa},s.a.createElement(S.a,{amount:i,asset:n.call_price.quote.asset_id,hide_asset:!0})),s.a.createElement("td",{style:Sa},s.a.createElement(S.a,{amount:n.debt,asset:n.call_price.quote.asset_id,hide_asset:!0})),s.a.createElement("td",{style:Sa,className:"column-hide-medium"},s.a.createElement(S.a,{decimalOffset:5,amount:n.collateral,asset:n.call_price.base.asset_id})),s.a.createElement("td",{"data-place":"bottom","data-tip":this._getCRTip(),className:"center-content "+l},z.a.format_number(r,2)),s.a.createElement("td",{style:Sa},s.a.createElement(_a.a,{noTip:!0,balances:Object(d.List)(),debt:Aa({},t.get("id"),n.debt),collateral:Aa({},a.get("id"),parseInt(n.collateral,10)),hide_asset:!0})),s.a.createElement("td",{style:Sa,className:"column-hide-small"},s.a.createElement(ce.a,{base_amount:n.call_price.base.amount,base_asset:n.call_price.base.asset_id,quote_amount:n.call_price.quote.amount,quote_asset:n.call_price.quote.asset_id,hide_symbols:!0})),s.a.createElement("td",{style:Sa,className:"column-hide-small"},s.a.createElement(ce.a,{base_amount:t.getIn(["bitasset","current_feed","settlement_price","base","amount"]),base_asset:n.call_price.quote.asset_id,quote_amount:t.getIn(["bitasset","current_feed","settlement_price","quote","amount"]),quote_asset:n.call_price.base.asset_id,hide_symbols:!0})),s.a.createElement("td",{className:"center-content column-hide-small",style:Na},s.a.createElement(ce.a,{base_amount:n.call_price.base.amount,base_asset:n.call_price.base.asset_id,quote_amount:n.call_price.quote.amount,quote_asset:n.call_price.quote.asset_id,hide_value:!0})),s.a.createElement("td",{style:{textAlign:"center"}},s.a.createElement(w.a,{to:"/market/"+t.get("symbol")+"_"+a.get("symbol")},s.a.createElement(M.a,{name:"trade",title:"icons.trade.trade",className:"icon-14px",style:{marginRight:5}}))),s.a.createElement("td",null,s.a.createElement("div",{"data-place":"left","data-tip":K.a.translate("tooltip.update_position"),style:{paddingBottom:5}},s.a.createElement("a",{onClick:this._onUpdatePosition.bind(this)},s.a.createElement(M.a,{name:"adjust",title:"icons.adjust",className:"icon-14px rotate90"})))),s.a.createElement("td",null,s.a.createElement("div",{"data-place":"left","data-tip":K.a.translate("tooltip.close_position",{amount:o,asset:t.get("symbol")}),style:{paddingBottom:5}},s.a.createElement("a",{onClick:this._onClosePosition.bind(this)},s.a.createElement(M.a,{name:"cross-circle",title:"icons.cross_circle.close_position",className:"icon-14px"}))),t?s.a.createElement(ya.a,{ref:"cp_modal_"+n.call_price.quote.asset_id,modalId:"cp_modal_"+n.call_price.quote.asset_id,quote_asset:n.call_price.quote.asset_id,backing_asset:t.getIn(["bitasset","options","short_backing_asset"]),account:this.props.account}):null))}}]),t}();ja.propTypes={debtAsset:c.a.ChainAsset.isRequired,collateralAsset:c.a.ChainAsset.isRequired},ja.defaultProps={tempComponent:"tr"},ja=Object(u.a)(ja);var Pa=function(e){function t(){return Ca(this,t),Oa(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return xa(t,s.a.Component),ka(t,[{key:"render",value:function(){var e=this.props,t=e.object,a=e.account,n=t.getIn(["call_price","quote","asset_id"]),r=t.getIn(["call_price","base","asset_id"]);return s.a.createElement(ja,wa({debtAsset:n,collateralAsset:r,account:a},this.props))}}]),t}();Pa.propTypes={object:c.a.ChainObject.isRequired},Pa=Object(u.a)(Pa);var Ta=function(e){function t(){return Ca(this,t),Oa(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return xa(t,s.a.Component),ka(t,[{key:"_onUpdatePosition",value:function(e){e.preventDefault();var t="cp_modal_"+this.props.debtAsset.get("id");this.refs[t].show()}},{key:"_getFeedPrice",value:function(){return this.props?1/z.a.get_asset_price(this.props.debtAsset.getIn(["bitasset","current_feed","settlement_price","quote","amount"]),this.props.collateralAsset,this.props.debtAsset.getIn(["bitasset","current_feed","settlement_price","base","amount"]),this.props.debtAsset):1}},{key:"render",value:function(){var e=this.props,t=e.debtAsset,a=e.collateralAsset,n=e.account,r=t.get("id"),o=n.get("balances"),i=0;return o&&o.forEach(function(e,t){if(t==r){var a=W.ChainStore.getObject(e);i=a.get("balance")}}),s.a.createElement("tr",{className:"margin-row"},s.a.createElement("td",{style:Na},s.a.createElement(va.a,{replaceNoneToBts:!1,maxWidth:30,name:t.get("symbol")}),s.a.createElement(w.a,{to:"/asset/"+t.get("symbol")},s.a.createElement(ma.a,{noTip:!0,name:t.get("symbol")}))),s.a.createElement("td",{style:Sa},s.a.createElement(S.a,{amount:i,asset:t.get("id"),hide_asset:!0})),s.a.createElement("td",{style:Sa},s.a.createElement(S.a,{amount:0,asset:t.get("id"),hide_asset:!0})),s.a.createElement("td",{style:Sa,className:"column-hide-medium"},s.a.createElement(S.a,{decimalOffset:5,amount:0,asset:a.get("id")})),s.a.createElement("td",null),s.a.createElement("td",{style:Sa}),s.a.createElement("td",{style:Sa,className:"column-hide-small"}),s.a.createElement("td",{style:Sa,className:"column-hide-small"}),s.a.createElement("td",{className:"center-content column-hide-small",style:Na}),s.a.createElement("td",{style:{textAlign:"center"}},s.a.createElement(w.a,{to:"/market/"+t.get("symbol")+"_"+a.get("symbol")},s.a.createElement(M.a,{name:"trade",title:"icons.trade.trade",className:"icon-14px",style:{marginRight:5}}))),s.a.createElement("td",null,s.a.createElement("div",{"data-place":"left","data-tip":K.a.translate("tooltip.update_position"),style:{paddingBottom:5}},s.a.createElement("a",{onClick:this._onUpdatePosition.bind(this)},s.a.createElement(M.a,{name:"adjust",title:"icons.adjust",className:"icon-14px rotate90"})))),s.a.createElement("td",null,t?s.a.createElement(ya.a,{ref:"cp_modal_"+t.get("id"),modalId:"cp_modal_"+t.get("id"),quote_asset:t.get("id"),backing_asset:t.getIn(["bitasset","options","short_backing_asset"]),account:this.props.account}):null))}}]),t}();Ta.propTypes={debtAsset:c.a.ChainAsset.isRequired,collateralAsset:c.a.ChainAsset.isRequired},Ta.defaultProps={tempComponent:"tr"},Ta=Object(u.a)(Ta);var Ia=function(e){function t(){return Ca(this,t),Oa(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return xa(t,s.a.Component),ka(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.account,n=t.callOrders,r=t.bitAssets;if(n=n.filter(function(e){return!!e}),!(r=r.filter(function(e){return!!e})).length)return null;if(n.forEach(function(e){if(e){var t=r.findIndex(function(t){return t&&t.get("id")===e.getIn(["call_price","quote","asset_id"])});-1!==t&&r.splice(t,1)}}),!r.length)return null;var o=r.map(function(t){return s.a.createElement(Ta,wa({key:t.get("id"),debtAsset:t.get("id"),collateralAsset:t.getIn(["bitasset","options","short_backing_asset"]),account:a},e.props))});return s.a.createElement("tbody",null,o)}}]),t}();Ia.propTypes={callOrders:c.a.ChainObjectsList},Ia=Object(u.a)(Ia),Ia=Object(R.a)(Ia,{propNames:["bitAssets"],defaultProps:{bitAssets:["1.3.103","1.3.113","1.3.120","1.3.121","1.3.958","1.3.1325","1.3.1362","1.3.105","1.3.106"]},asList:!0});var Ra=function(e){var t=e.callOrders,a=e.account,n=e.className,r=e.children,o=e.preferredUnit;return s.a.createElement("table",{className:"table table-hover "+n},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",{style:Na},s.a.createElement(A.a,{content:"explorer.asset.title"})),s.a.createElement("th",{style:Sa},s.a.createElement(A.a,{content:"exchange.balance"})),s.a.createElement("th",{style:Sa},s.a.createElement(A.a,{content:"transaction.borrow_amount"})),s.a.createElement("th",{style:Sa,className:"column-hide-medium"},s.a.createElement(A.a,{content:"transaction.collateral"})),s.a.createElement("th",null,s.a.createElement("div",{className:"tooltip inline-block","data-place":"top","data-tip":K.a.translate("tooltip.coll_ratio")},s.a.createElement(A.a,{content:"borrow.coll_ratio"}))),s.a.createElement("th",null,s.a.createElement(Ea.a,{noLink:!0,string:"account.total",keys:[{type:"asset",value:o,arg:"asset"}]})),s.a.createElement("th",{style:Sa,className:"column-hide-small"},s.a.createElement("div",{className:"tooltip inline-block","data-place":"top","data-tip":K.a.translate("tooltip.call_price")},s.a.createElement(A.a,{content:"exchange.call"}))),s.a.createElement("th",{style:Sa,className:"column-hide-small"},s.a.createElement(A.a,{content:"exchange.price"})),s.a.createElement("th",{className:"column-hide-small",style:Na},s.a.createElement(A.a,{content:"explorer.assets.units"})),s.a.createElement("th",{style:{textAlign:"center"}},s.a.createElement(A.a,{content:"exchange.market"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"borrow.adjust_short"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"transfer.close"})))),s.a.createElement("tbody",null,t.sort(function(e,t){return e.split(".")[2]-t.split(".")[2]}).map(function(e){return s.a.createElement(Pa,{key:e,object:e,account:a})})),s.a.createElement(Ia,{account:a,callOrders:h.a.List(t)}),s.a.createElement("tbody",null,r))},qa=a(383),Ma=a(198),Ba=a(544),Da={AccountPermission:function(e,t,a){var n=this;this.id=e.get("id"),this.weight=t,this.threshold=e.getIn([a,"weight_threshold"]),this.accounts=[],this.keys=e.getIn([a,"key_auths"]).map(function(e){return new function(e){var t=this;this.id=e.toJS?e.get(0):e[0],this.weight=e.toJS?e.get(1):e[1],this.isAvailable=function(e){return e.includes?e.includes(t.id):-1!==e.indexOf(t)}}(e)}).toArray(),this.isAvailable=function(e){return e.includes?e.includes(n.id):-1!==e.indexOf(n)},this._sumWeights=function(e){if(n.isNested()||n.isMultiSig()){var t=n.accounts.reduce(function(t,a){return t+(a._sumWeights(e)?a.weight:0)},0);return Math.floor(t/n.threshold)}return n.isAvailable(e)?n.weight:0},this.getStatus=function(e,t){if(n.isNested()){var a=n.accounts.reduce(function(t,a){return t+a._sumWeights(e)},0);return n.keys.length&&(a+=n.sumKeys(t)),a}var s=n._sumWeights(e);return n.isMultiSig()&&(s+=n.sumKeys(t)),s},this.sumKeys=function(e){return n.keys.reduce(function(t,a){return t+(a.isAvailable(e)?a.weight:0)},0)},this.isNested=function(){return n.accounts.length>0},this.isMultiSig=function(){return n.keys.reduce(function(e,t){return e||t.weight<n.threshold},!1)},this.getMissingSigs=function(e){var t=[],a=[];return n.isNested()?a=n.accounts.reduce(function(t,a){return t.concat(a.getMissingSigs(e))},[]):n.isAvailable(e)||t.push(n.id),t.concat(a)},this.getMissingKeys=function(e){var t=[],a=[];return n.keys.length&&(n.isNested()||n.isMultiSig())&&n.keys.forEach(function(a){a.isAvailable(e)||t.push(a.id)}),n.isNested()&&(a=n.accounts.reduce(function(t,a){return t.concat(a.getMissingKeys(e))},[])),t.concat(a)}},listToIDs:function(e){var t=[];return e.forEach(function(e){e&&t.push(e.get?e.get("id"):e)}),t},unravel:function(e,t){var a=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(n<3){var s=W.ChainStore.getAccount(e.id);s&&s.getIn([t,"account_auths"]).size&&s.getIn([t,"account_auths"]).forEach(function(s){var r=W.ChainStore.getAccount(s.get(0));r&&e.accounts.push(a.unravel(new a.AccountPermission(r,s.get(1),t),t,n+1))})}return e},unnest:function(e,t){var a=this,n=[];return e.forEach(function(e){var s=W.ChainStore.getAccount(e),r=a.unravel(new a.AccountPermission(s,null,t),t);n.push(r)}),n},flatten_auths:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.a.List();return e.size?(e.forEach(function(e){t.includes(e.get(0))||(t=t.push(e.get(0)))}),t):t}},Fa=a(105),La=a.n(Fa),Va=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Ua=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return 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)}(t,s.a.Component),Va(t,[{key:"componentDidMount",value:function(){La.a.rebuild()}},{key:"render",value:function(){var e=this.props,t=e.className,a=e.children,n=e.dataTip,r=e.content;return s.a.createElement("span",{className:"tooltip "+t,"data-html":!0,"data-tip":n||K.a.translate(r)},a)}}]),t}(),za=function(){return s.a.createElement(Ua,{className:"error appended",content:"explorer.proposals.authority_depth_warning"},"/!\\")},Wa=function(){return s.a.createElement(Ua,{className:"error appended",content:"explorer.proposals.children_authority_depth_warning"},"/!\\")},Ja=function(){return s.a.createElement(Ua,{className:"warning",content:"explorer.proposals.pending_approval"},s.a.createElement(A.a,{content:"explorer.proposals.pending"}))},Ka=function(){return s.a.createElement(Ua,{className:"warning",content:"explorer.proposals.pending_review"},s.a.createElement(A.a,{content:"explorer.proposals.review"}))},Ga=function(){return s.a.createElement(Ua,{className:"error",content:"explorer.proposals.failed_execute"},s.a.createElement(A.a,{content:"explorer.proposals.failed"}))},Za=function(e){var t=e.onToggle,a=e.expanded;return s.a.createElement("a",{className:"expand-button",onClick:t},"[",a?"-":"+","]")},Qa=function(e){return e.approved?s.a.createElement(M.a,{name:"checkmark-circle",size:"1x",className:"success",title:"icons.checkmark_circle.operation_succeed"}):s.a.createElement(M.a,{name:"cross-circle",size:"1x",className:"error",title:"icons.cross_circle.operation_failed"})},Ha=function(e){var t=e.available,a=e.permission,n=e.weight,r=e.level;return s.a.createElement("tbody",null,s.a.createElement("tr",null,s.a.createElement("td",{colSpan:"2"},s.a.createElement(Qa,{approved:a.isAvailable(t)}),a.id.substr(0,20-4*r),"..."),s.a.createElement("td",null,n)))},Ya=function e(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n>t||!(!a.isNested()&&!a.isMultiSig())&&a.accounts.some(function(a){return e(t,a,n+1)})},Xa=function(e,t,a){return e.accounts.reduce(function(e,n){return e+($a(n,t,a)?n.weight:0)},0)+e.keys.reduce(function(e,t){return e+(t.isAvailable(a)?t.weight:0)},0)},$a=function(e,t,a){return e.isNested()||e.isMultiSig()?Xa(e,t,a)>=e.threshold:e.isAvailable(t)},en=function(e,t,a){return e&&e.threshold>10?z.a.get_percentage(e.getStatus(t,a),e.threshold)+" / 100%":e.getStatus(t,a)+" / "+e.threshold},tn=function(e,t){return t&&t>10?z.a.get_percentage(e,t):e},an=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},nn=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rn(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 on(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)}var ln=function(e){function t(e){sn(this,t);var a=rn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.handleExpandToggle=function(){a.setState({expanded:!a.state.expanded})},a.state={expanded:!!e.expanded},a}return on(t,s.a.Component),nn(t,[{key:"render",value:function(){var e=this.props,t=e.account,a=e.available,n=e.availableKeys,r=e.permission,o=e.threshold,i=e.level,l=e.maxAuthorityDepth,c=e.hideRoot,u=this.state.expanded,p=$a(r,a,n),m=r.isNested(),d=r.isMultiSig(),h=tn(r.weight,o)||1,f=en(r,a,n),b=i>=l,g=m||d?s.a.createElement("tr",null,s.a.createElement("td",{colSpan:"2"},s.a.createElement(Qa,{approved:p}),s.a.createElement(ue.a,{subpage:"permissions",account:t.get("id")})),s.a.createElement("td",null,u?s.a.createElement("span",{className:p?"success-text":""},h):h&&(h&&2===h.length?" ":"")+h+" ",s.a.createElement(Za,{onToggle:this.handleExpandToggle,expanded:u}),u&&s.a.createElement("span",{className:"appended"},"(",f,")"),b?s.a.createElement(za,null):Ya(l,r,i)&&!u&&s.a.createElement(Wa,null))):s.a.createElement("tr",null,s.a.createElement("td",{colSpan:"2"},s.a.createElement(Qa,{approved:p}),s.a.createElement(ue.a,{subpage:"permissions",account:t.get("id")})),s.a.createElement("td",null,!m&&h?(h&&2===h.length?" ":"")+h+" ":null)),_=[];return(m||d)&&u&&(r.accounts.forEach(function(e){_.push(s.a.createElement(cn,{key:e.id,account:e.id,accounts:e.accounts,permission:e,available:a,availableKeys:n,threshold:r.threshold,level:i+1,maxAuthorityDepth:l}))}),r.keys.length&&r.keys.forEach(function(e){return _.push(s.a.createElement(Ha,{key:e.id,permission:e,available:n,level:i+(c?0:1),weight:tn(e.weight,o)}))})),_.length>0?s.a.createElement("tbody",null,c||g,s.a.createElement("tr",null,s.a.createElement("td",{colSpan:"3",className:"heading-perm"},s.a.createElement("div",{className:c?"":"table-container"},s.a.createElement("table",null,_)),u&&0===i&&s.a.createElement("div",{className:"spacer"})))):s.a.createElement("tbody",null,g)}}]),t}();ln.propTypes={account:c.a.ChainAccount.isRequired,accounts:c.a.ChainAccountsList,level:E.a.number.isRequired},ln.defaultProps={level:0};var cn=Object(u.a)(ln),un=function(e){function t(e){sn(this,t);var a=rn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.handleExpandToggle=function(){return a.setState({expanded:!a.state.expanded})},a.state={requiredPermissions:[],expanded:e.expanded},a._updateState=a._updateState.bind(a),a}return on(t,s.a.Component),nn(t,[{key:"componentWillMount",value:function(){this._updateState(),W.ChainStore.subscribe(this._updateState)}},{key:"componentWillUnmount",value:function(){W.ChainStore.unsubscribe(this._updateState)}},{key:"_updateState",value:function(){var e=Da.listToIDs(this.props.required),t=Da.listToIDs(this.props.available);this.setState({requiredPermissions:Da.unnest(e,this.props.type),required:e,available:t})}},{key:"render",value:function(){var e=this,t=this.props,a=(t.type,t.added),n=t.removed,r=t.availableKeys,o=t.globalObject,i=t.reviewPeriodTime,l=t.noFail,c=this.state,u=c.requiredPermissions,p=(c.required,c.available),m=c.expanded;p=Object(Ba.a)(p),r=r.toJS(),a&&(p.push(a),r.push(a)),n&&(-1!==p.indexOf(n)&&p.splice(p.indexOf(n),1),-1!==r.indexOf(n)&&r.splice(r.indexOf(n),1));var d=u.reduce(function(e,t){return e+($a(t,p,r)?1:0)},0),h=u.length,f=d===h,b=f&&!i&&!l,g=f&&i,_=o.get("parameters").get("max_authority_depth"),v=1===u.length,y=v?u[0]:null,E=!v&&d+" / "+h,w=u.map(function(t){return s.a.createElement(cn,{key:t.id,account:t.id,accounts:t.accounts,permission:t,available:p,availableKeys:r,expanded:e.props.expanded||v,level:0,maxAuthorityDepth:_,hideRoot:v})});return s.a.createElement("div",{className:"nested-approval-state"},s.a.createElement("div",{className:"root-status"},b?s.a.createElement(Ga,null):g?s.a.createElement(Ka,null):s.a.createElement(Ja,null)," ",y?y.threshold>1&&en(y,p,r):s.a.createElement("span",null,"(",E,")"),(!y||y.isMultiSig()||y.isNested())&&s.a.createElement(Za,{onToggle:this.handleExpandToggle,expanded:m}),!m&&u.some(function(e){return Ya(_,e,0)})&&s.a.createElement(Wa,null)),m&&s.a.createElement("table",null,w))}}]),t}();un.propTypes={required:c.a.ChainAccountsList,available:c.a.ChainAccountsList},un.defaultProps={type:"active",added:null,removed:null},un=Object(u.a)(un);var pn=function(e){function t(){return sn(this,t),rn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return on(t,s.a.Component),nn(t,[{key:"render",value:function(){var e=this.props,t=e.proposal,a=e.type,n=t.get("available_"+a+"_approvals"),r=t.get("available_key_approvals"),o=t.get("required_"+a+"_approvals");return s.a.createElement(un,an({},this.props,{required:o,available:n,availableKeys:r,reviewPeriodTime:t.get("review_period_time")}))}}]),t}();pn.propTypes={proposal:c.a.ChainObject.isRequired,type:E.a.string.isRequired,globalObject:c.a.ChainObject.isRequired},pn.defaultProps={type:"active",added:null,globalObject:"2.0.0"};var mn=Object(u.a)(pn),dn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},hn=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,s=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done)&&(a.push(o.value),!t||a.length!==t);n=!0);}catch(e){s=!0,r=e}finally{try{!n&&i.return&&i.return()}finally{if(s)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),fn=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gn(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 _n(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)}var vn=function(e,t,a){var n=[];e.forEach(function(e){n=n.concat(e.getMissingSigs(t))});var s=[];return e.forEach(function(e){s=s.concat(e.getMissingKeys(a))}),[n,s]},yn=function(e){function t(e){bn(this,t);var a=gn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.state={active:null,key:null,owner:null,payee:null},a}return _n(t,s.a.Component),fn(t,[{key:"onActiveAccount",value:function(e,t,a,n){var s={};t[n]?(s.key=n,s[a]=null):n?(s[a]=e[n],s.key=null):(s[a]=null,s.key=null),this.setState(s)}},{key:"_onProposalAction",value:function(e){var t=this,a=e.toJS(),n=this.state,s=n.active,r=(n.key,n.owner,{fee_paying_account:n.payee||s,proposal:a.id,active_approvals_to_add:[],active_approvals_to_remove:[],owner_approvals_to_add:[],owner_approvals_to_remove:[],key_approvals_to_add:[],key_approvals_to_remove:[]}),o="approve"===this.props.action,i=[];["active","owner","key"].forEach(function(e){var n=t.state[e];if(n){var s=-1!==a["available_"+e+"_approvals"].indexOf(n);(o&&!s||!o&&s)&&("approve"===t.props.action?(r[e+"_approvals_to_add"]=[n],"key"===e&&i.push(n)):"reject"===t.props.action&&(r[e+"_approvals_to_remove"]=[n],"key"===e&&i.push(n)))}});var l=Wt.a.new_transaction();l.add_type_operation("proposal_update",r),at.a.process_transaction(l,null,!0,i),j.a.publish(this.props.modalId,"close")}},{key:"onChangePayee",value:function(e){var t=W.ChainStore.getAccount(e);t&&this.setState({payee:t.get("id")})}},{key:"onCancel",value:function(){j.a.publish(this.props.modalId,"close")}},{key:"render",value:function(){var e=this.props,t=e.proposal,a=e.type,n=[],r={},i="approve"===this.props.action;this.props.accounts.length&&this.props.accounts.forEach(function(e){(i?e&&!t.get("available_"+a+"_approvals").includes(e.get("id")):e&&t.get("available_"+a+"_approvals").includes(e.get("id")))&&(r[e.get("name")]=e.get("id"),n.push(e.get("name")))});var l=[],c={};this.props.keys.length&&this.props.keys.forEach(function(e){var a=o.a.isMyKey(e),n=t.get("available_key_approvals").includes(e);(a&&i&&!n||a&&!i&&n)&&(c[e]=!0,l.push(e))});var u=o.a.getMyAccounts();return s.a.createElement("form",{className:"grid-block vertical full-width-content"},s.a.createElement("div",{className:"grid-container"},s.a.createElement("div",{className:"content-block"},s.a.createElement("h4",null,i?"Add approval":"Remove approval")),s.a.createElement("div",{className:"content-block",style:{paddingRight:"20%"}},s.a.createElement(mn,{expanded:!0,proposal:t.get("id"),type:a,added:i?this.state.key?this.state.key:this.state[a]||null:null,removed:i?null:this.state.key?this.state.key:this.state[a]||null,noFail:!0})),s.a.createElement("div",{className:"content-block full-width-content"},s.a.createElement("div",{className:"full-width-content form-group"},s.a.createElement(A.a,{content:"modal.proposals.pay_with",component:"label"}),s.a.createElement(Ma.a,{account_names:u,onChange:this.onChangePayee.bind(this)})),n.length||l.length?s.a.createElement("div",{className:"full-width-content form-group"},s.a.createElement(A.a,{content:"modal.proposals.approval_"+(i?"add":"remove"),component:"label"}),s.a.createElement(Ma.a,{account_names:n.concat(l),onChange:this.onActiveAccount.bind(this,r,c,a)})):null,null),s.a.createElement("div",{className:"content-block"},s.a.createElement("input",{type:"submit",className:"button",onClick:this._onProposalAction.bind(this,t),value:i?"Approve":"Remove"}),s.a.createElement("div",{onClick:this.onCancel.bind(this),className:" button"},s.a.createElement(A.a,{content:"account.perm.cancel"})))))}}]),t}();yn.propTypes={accounts:c.a.ChainAccountsList},yn=Object(u.a)(yn);var En=function(e){function t(){bn(this,t);var e=gn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._updateState=e._updateState.bind(e),e}return _n(t,s.a.Component),fn(t,[{key:"componentWillMount",value:function(){this._updateState(),W.ChainStore.subscribe(this._updateState)}},{key:"componentWillUnmount",value:function(){W.ChainStore.unsubscribe(this._updateState)}},{key:"_updateState",value:function(){var e=this.props,t=e.proposal,a=(e.account,t.get("required_active_approvals").size?"active":"owner"),n=Da.listToIDs(t.get("required_"+a+"_approvals")),s=Da.listToIDs(t.get("available_"+a+"_approvals")),r=Da.listToIDs(t.get("available_key_approvals"));this.setState({requiredPermissions:Da.unnest(n,a),available:s,availableKeys:r,type:a})}},{key:"render",value:function(){var e=this.props.action,t=this.state,a=t.requiredPermissions,n=t.available,r=t.availableKeys,o=t.type,i=vn(a,n,r),l=hn(i,2),c=l[0],u=l[1];return s.a.createElement(yn,dn({},this.props,{type:o,accounts:"approve"===e?c:n,keys:"approve"===e?u:r}))}}]),t}();En.propTypes={account:c.a.ChainAccount.isRequired,proposal:c.a.ChainObject.isRequired},En=Object(u.a)(En);var wn=function(e){function t(){bn(this,t);var e=gn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={open:!1},e}return _n(t,s.a.Component),fn(t,[{key:"componentDidMount",value:function(){var e=this;j.a.subscribe(this.props.modalId,function(t,a){e.setState({open:"open"===a})})}},{key:"show",value:function(){j.a.publish(this.props.modalId,"open")}},{key:"render",value:function(){var e=this.props,t=e.modalId;e.proposal;return s.a.createElement(x.a,{id:t,overlay:!0,ref:t},this.state.open?s.a.createElement("div",{className:"grid-block vertical"},s.a.createElement(En,this.props)):null)}}]),t}(),kn=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,s=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done)&&(a.push(o.value),!t||a.length!==t);n=!0);}catch(e){s=!0,r=e}finally{try{!n&&i.return&&i.return()}finally{if(s)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),An=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Cn=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.forceUpdate=e.forceUpdate.bind(e),e}return 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)}(t,n["Component"]),An(t,[{key:"componentDidMount",value:function(){W.ChainStore.subscribe(this.forceUpdate)}},{key:"componentWillUnmount",value:function(){W.ChainStore.unsubscribe(this.forceUpdate)}},{key:"_onApproveModal",value:function(e,t){this.refs[e+"_"+t]&&this.refs[e+"_"+t].show()}},{key:"_canReject",value:function(e){return e.available_active_approvals.length||e.available_owner_approvals.length||e.available_key_approvals.length}},{key:"render",value:function(){var e=this,t=this.props.account;if(!t)return null;var a=[];t.get("proposals").size&&t.get("proposals").forEach(function(e){var n=W.ChainStore.getObject(e);if(n){var s=n.get("proposed_transaction").get("operations");a.push({operations:s,account:t,proposal:n})}});var n=a.sort(function(e,t){return z.a.sortID(e.proposal.get("id"),t.proposal.get("id"),!0)}).reduce(function(t,a,n){var r=!1,i=a.proposal.get("id"),l=a.proposal.get("proposer"),c=a.proposal.get("expiration_time"),u=a.operations.map(function(e,t){return"1.2.153124"===e.getIn([1,"to"])&&(r=!0),s.a.createElement(qa.b,{key:a.proposal.get("id")+"_operation_"+t,expiration:c,index:t,op:e.toJS(),inverted:!1,hideFee:!0,hideOpLabel:!0,hideExpiration:!0,hideDate:!0,proposal:!0,id:i,proposer:l})}).toArray(),p=e._canReject(a.proposal.toJS()),m=a.proposal.get("id"),d=a.proposal.get("required_active_approvals").size?"active":"owner";t.push(s.a.createElement("tr",{key:m+"_id"},s.a.createElement("td",{colSpan:"4",className:"proposal"+(0===n?" first":"")},s.a.createElement(qa.a,{id:i,expiration:c}))));var h=Da.listToIDs(a.proposal.get("available_"+d+"_approvals")),f=Da.listToIDs(a.proposal.get("available_key_approvals")),b=Da.listToIDs(a.proposal.get("required_"+d+"_approvals")),g=Da.unnest(b,d),_=vn(g,h,f),v=kn(_,2),y=v[0],E=v[1],w=[];y.length&&y.forEach(function(e){e&&!a.proposal.get("available_"+d+"_approvals").includes(e)&&w.push(e)});var k=[];E.length&&E.forEach(function(e){o.a.isMyKey(e)&&!a.proposal.get("available_key_approvals").includes(e)&&k.push(e)});var C=w.length+k.length>0;return t.push(s.a.createElement("tr",{className:"top-left-align",key:m+"_content"},s.a.createElement("td",null,u),s.a.createElement("td",null,g.map(function(e,t){return s.a.createElement("div",{className:"list-item",key:m+"_approver_"+t},s.a.createElement(ue.a,{subpage:"permissions",account:e.id}))})),s.a.createElement("td",null,s.a.createElement(mn,{proposal:a.proposal.get("id"),type:d})),s.a.createElement("td",{className:"approval-buttons"},r?s.a.createElement("div",{"data-tip":K.a.translate("tooltip.propose_scam"),className:"tooltip has-error scam-error"},"SCAM"):s.a.createElement("button",{onClick:C?e._onApproveModal.bind(e,m,"approve"):function(){},className:"button primary hollow"+(C?"":" hidden")},s.a.createElement("span",null,s.a.createElement(A.a,{content:"proposal.approve"}))),s.a.createElement(wn,{ref:m+"_approve",modalId:m+"_approve",account:a.account.get("id"),proposal:m,action:"approve"}),p?s.a.createElement("button",{onClick:e._onApproveModal.bind(e,m,"reject"),className:"button primary hollow"},s.a.createElement(A.a,{content:"proposal.reject"})):null,s.a.createElement(wn,{ref:m+"_reject",modalId:m+"_reject",account:a.account.get("id"),proposal:m,action:"reject"})))),t.push(s.a.createElement("tr",{key:m+"_separator"},s.a.createElement("td",{colSpan:"4"},s.a.createElement("hr",null)))),t},[]);return s.a.createElement("table",{className:"table proposals compact "+this.props.className},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null,s.a.createElement(A.a,{content:"proposal.proposals"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"proposal.approvers"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"proposal.status"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"proposal.action"})))),s.a.createElement("tbody",null,n))}}]),t}();Cn.propTypes={account:c.a.ChainAccount.isRequired};var On=Object(u.a)(Cn),xn=a(1815),Sn=a(85),Nn=a(28),jn=a(59),Pn=a(1768),Tn=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function In(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var Rn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={selectedOrders:[],filterValue:""},a}return 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)}(t,s.a.Component),Tn(t,[{key:"componentDidMount",value:function(){var e=document.getElementById("cancelAllOrders");e&&e.addEventListener("click",function(){var e=this._getFilteredOrders.call(this);e=e.toJS?e.toJS():e,this.setState({selectedOrders:e}),document.querySelectorAll(".orderCancel").forEach(function(e){e.checked||(e.checked=!0)})}.bind(this))}},{key:"_getFilteredOrders",value:function(){var e=this.state.filterValue;return(this.props.account.get("orders")||[]).filter(function(t){var a=W.ChainStore.getObject(t).toJS(),n=W.ChainStore.getAsset(a.sell_price.base.asset_id),s=W.ChainStore.getAsset(a.sell_price.quote.asset_id),r=n.get("symbol").toLowerCase(),o=s.get("symbol").toLowerCase();return r.indexOf(e)>-1||o.indexOf(e)>-1})}},{key:"_cancelLimitOrder",value:function(e,t){t.preventDefault(),Sn.a.cancelLimitOrder(this.props.account.get("id"),e,!1).catch(function(e){console.log("cancel order error:",e)})}},{key:"_cancelLimitOrders",value:function(e){var t=this;Sn.a.cancelLimitOrders(this.props.account.get("id"),this.state.selectedOrders).then(function(){t.resetSelected()}).catch(function(e){console.log("cancel orders error:",e)})}},{key:"onFlip",value:function(e){var t={};t[e]=!this.props.marketDirections.get(e),de.a.changeMarketDirection(t)}},{key:"onCheckCancel",value:function(e,t){var a=this.state.selectedOrders;if(t.target.checked)this.setState({selectedOrders:a.concat([e])});else{var n=a.indexOf(e);n>-1&&this.setState({selectedOrders:a.slice(0,n).concat(a.slice(n+1))})}}},{key:"setFilterValue",value:function(e){this.setState({filterValue:e.target.value.toLowerCase()})}},{key:"resetSelected",value:function(){this.setState({selectedOrders:[]}),document.querySelectorAll(".orderCancel").forEach(function(e){e.checked&&(e.checked=!1)})}},{key:"cancelSelected",value:function(){this._cancelLimitOrders.call(this)}},{key:"render",value:function(){var e=this,t=this.props,a=t.account,n=t.marketDirections,r=this.state,o=r.filterValue,i=r.selectedOrders,l=K.a.translate("account.perm.cancel"),c={},u={};if(!a.get("orders"))return null;var p=a.get("orders"),m=p.size;o&&(p=this._getFilteredOrders.call(this)),p.forEach(function(t){var a=W.ChainStore.getObject(t).toJS(),r=W.ChainStore.getAsset(a.sell_price.base.asset_id),o=W.ChainStore.getAsset(a.sell_price.quote.asset_id);if(r&&o){var i,p=(In(i={},r.get("id"),{precision:r.get("precision")}),In(i,o.get("id"),{precision:o.get("precision")}),i),m=jn.a.getMarketName(r,o).marketName,d=n.get(m);c[m]||(c[m]=d?{base:{id:r.get("id"),symbol:r.get("symbol"),precision:r.get("precision")},quote:{id:o.get("id"),symbol:o.get("symbol"),precision:o.get("precision")}}:{base:{id:o.get("id"),symbol:o.get("symbol"),precision:o.get("precision")},quote:{id:r.get("id"),symbol:r.get("symbol"),precision:r.get("precision")}});var h=new Nn.f(a,p,c[m].quote.id),f=W.ChainStore.getAsset(c[m].base.id),b=W.ChainStore.getAsset(c[m].quote.id);u[m]||(u[m]=[]),u[m].push(s.a.createElement(xn.b,{ref:c[m].base.symbol,key:a.id,order:h,base:f,quote:b,cancel_text:l,showSymbols:!1,invert:!0,onCancel:e._cancelLimitOrder.bind(e,a.id),price:h.getPrice(),dashboard:!0,isMyAccount:e.props.isMyAccount,settings:e.props.settings,onFlip:e.onFlip.bind(e,m),onCheckCancel:e.onCheckCancel.bind(e,a.id)}))}});var d=[];for(var h in u)u[h].length&&(d=d.concat(u[h].sort(function(e,t){return e.props.price-t.props.price})));return s.a.createElement("div",{className:"grid-content no-overflow no-padding",style:{paddingBottom:15}},s.a.createElement("div",{className:"header-selector"},p&&m?s.a.createElement("input",{type:"text",placeholder:K.a.translate("account.filter_orders"),style:{display:"inline-block",maxWidth:"50%",marginRight:"1em",marginBottom:"0"},onChange:this.setFilterValue.bind(this)}):null,i.length?s.a.createElement("button",{className:"button",onClick:this.resetSelected.bind(this)},s.a.createElement(A.a,{content:"account.reset_orders"})):null,i.length?s.a.createElement("button",{className:"button",onClick:this.cancelSelected.bind(this)},s.a.createElement(A.a,{content:"account.submit_orders"})):null),s.a.createElement(Pn.a,{pageSize:20,className:"table table-striped dashboard-table table-hover",header:s.a.createElement(xn.c,{settings:this.props.settings,dashboard:!0,isMyAccount:this.props.isMyAccount}),rows:d,extraRow:this.props.children}))}}]),t}(),qn=Rn=Object(p.a)(Rn,{listenTo:function(){return[i.a]},getProps:function(){return{marketDirections:i.a.getState().marketDirections}}}),Mn={},Bn=6e4;var Dn=a(703),Fn=a(1790),Ln=a.n(Fn),Vn=a(1933),Un=a.n(Vn),zn=a(1934),Wn=a.n(zn),Jn=a(129),Kn=a(251),Gn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Zn=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hn(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 Yn(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)}Un()(Ln.a.Highcharts),Wn()(Ln.a.Highcharts);var Xn=function(e){function t(){return Qn(this,t),Hn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Yn(t,s.a.Component),Zn(t,[{key:"render",value:function(){var e=this.props,t=e.balanceObjects,a=e.core_asset,n=e.marketStats,r=e.preferredAsset,o=null;if(t&&t.length>0){var i=0;o=t.forEach(function(e){if(e){var t="string"==typeof e?W.ChainStore.getObject(e):e,s=t.get("asset_type"),o=W.ChainStore.getAsset(s);if(o&&r){var l=Number(t.get("balance")),c=jn.a.convertValue(l,r,o,n,a);if(c){var u=z.a.get_asset_precision(r.get("precision"));i+=c/u}}}}),o=t.map(function(e,t){if(!e)return null;var s="string"==typeof e?W.ChainStore.getObject(e):e,o=s.get("asset_type"),l=W.ChainStore.getAsset(o);if(!l)return null;var c=Number(s.get("balance")),u=jn.a.convertValue(c,r,l,n,a);if(!u)return null;var p=u/z.a.get_asset_precision(r.get("precision")),m=p/i*100;return m<.5?null:p>=1?{name:l.get("symbol")+" ("+(0===i?0:m.toFixed(2))+"%)",value:p,color:Ln.a.Highcharts.getOptions().colors[t]}:null}).filter(function(e){return!!e})}o&&1===o.length&&0===o[0].value&&(o=null);var l={chart:{backgroundColor:"rgba(255, 0, 0, 0)",height:250,spacingLeft:0,spacingRight:0,spacingBottom:0},credits:{enabled:!1},legend:{enabled:!1},plotOptions:{treemap:{animation:!1,tooltip:{pointFormatter:function(){return"<b>"+this.name+"</b>: "+Ln.a.Highcharts.numberFormat(this.value,0)+" "+r.get("symbol")}}}},series:[{type:"treemap",levels:[{level:1,layoutAlgorithm:"sliceAndDice",dataLabels:{enabled:!0,align:"center",verticalAlign:"middle"}}],data:o}],title:{text:null}};return s.a.createElement("div",{className:"account-treemap"},s.a.createElement(Ln.a,{config:l}))}}]),t}();Xn.propTypes={assets:c.a.ChainAssetsList,preferredAsset:c.a.ChainAsset.isRequired},Xn.defaultProps={assets:[],preferredAsset:"1.3.0"},Xn=Object(u.a)(Xn);var $n=function(e){function t(){return Qn(this,t),Hn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Yn(t,s.a.Component),Zn(t,[{key:"render",value:function(){var e=this.props.balanceObjects.filter(function(e){return!!e}).map(function(e){return e.get("asset_type")});return s.a.createElement(Xn,Gn({preferredAsset:this.props.settings.get("unit","1.3.0"),assets:e},this.props))}}]),t}();$n.propTypes={balanceObjects:c.a.ChainObjectsList,core_asset:c.a.ChainAsset.isRequired},$n.defaultProps={balanceObjects:[],core_asset:"1.3.0"},$n=Object(u.a)($n);var es=function(e){function t(){return Qn(this,t),Hn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Yn(t,s.a.Component),Zn(t,[{key:"render",value:function(){return s.a.createElement(Jn.a,{stores:[i.a,Kn.a],inject:{marketStats:function(){return Kn.a.getState().allMarketStats},settings:function(){return i.a.getState().settings}}},s.a.createElement($n,Gn({},this.props,{ref:this.props.refCallback})))}}]),t}(),ts=a(1818),as=a.n(ts),ns=a(332),ss=a(90),rs=a(1789),os=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},is=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function ls(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cs(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 us(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)}var ps=function(e){function t(e){return ls(this,t),cs(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return us(t,rs["b"]),is(t,[{key:"componentDidMount",value:function(){La.a.rebuild()}},{key:"shouldComponentUpdate",value:function(e){return function e(t,a,n){null===t&&(t=Function.prototype);var s=Object.getOwnPropertyDescriptor(t,a);if(void 0===s){var r=Object.getPrototypeOf(t);return null===r?void 0:e(r,a,n)}if("value"in s)return s.value;var o=s.get;return void 0!==o?o.call(n):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldComponentUpdate",this).call(this,e)||e.base!==this.props.base}},{key:"getValue",value:function(){var e=this.props.marketStats;return e&&e.change?e.change:0}},{key:"render",value:function(){var e=this.getValue(),t=0===parseFloat(e)?"":parseFloat(e)<0?"change-down":"change-up",a=s.a.createElement(ss.b,{style:"decimal",value:e,minimumFractionDigits:2,maximumFractionDigits:2});return s.a.createElement("span",{className:"value "+t},a,"%")}}]),t}();ps.defaultProps={fullPrecision:!1,noDecimals:!1,hide_asset:!1},ps=Object(R.a)(ps,{propNames:["quote","base"],defaultProps:{quote:"1.3.0"}});var ms=function(e){function t(){return ls(this,t),cs(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return us(t,s.a.Component),is(t,[{key:"render",value:function(){var e=this.props,t=e.refCallback,a=function(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(e,["refCallback"]);return s.a.createElement(ps,os({},a,{ref:t}))}}]),t}();ms=Object(p.a)(ms,{listenTo:function(){return[Kn.a]},getProps:function(e){return{marketStats:Kn.a.getState().allMarketStats.get(e.marketId),allMarketStats:Kn.a.getState().allMarketStats}}});var ds=a(536),hs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},fs=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function bs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gs(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 _s(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)}var vs=function(e){function t(){return bs(this,t),gs(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _s(t,ds["a"]),fs(t,[{key:"shouldComponentUpdate",value:function(e,a){return function e(t,a,n){null===t&&(t=Function.prototype);var s=Object.getOwnPropertyDescriptor(t,a);if(void 0===s){var r=Object.getPrototypeOf(t);return null===r?void 0:e(r,a,n)}if("value"in s)return s.value;var o=s.get;return void 0!==o?o.call(n):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldComponentUpdate",this).call(this,e)||e.base_amount!==this.props.base_amount||e.quote_amount!==this.props.quote_amount||e.decimals!==this.props.decimals||!z.a.are_equal_shallow(e.pulsate,this.props.pulsate)||!z.a.are_equal_shallow(a,this.state)}},{key:"getFinalPrice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.props,a=t.coreAsset,n=t.fromAsset,s=t.toAsset,r=t.allMarketStats;return jn.a.getFinalPrice(a,n,s,r,e)}},{key:"render",value:function(){var e=this.props,t=e.toAsset,a=e.forceDirection,n=function(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(e,["toAsset","forceDirection"]),r=this.getFinalPrice();return 1===r?s.a.createElement("span",null,"1.00"):r?s.a.createElement(ce.a,hs({force_direction:!!a&&t.get("symbol"),base_amount:r.base.amount,base_asset:r.base.asset_id,quote_amount:r.quote.amount,quote_asset:r.quote.asset_id},n)):s.a.createElement("span",null,"--")}}]),t}();vs.defaultProps={forceDirection:!0},vs=Object(R.a)(vs,{propNames:["toAsset","fromAsset","coreAsset"],defaultProps:{toAsset:"1.3.0",coreAsset:"1.3.0"}});var ys=function(e){function t(){return bs(this,t),gs(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _s(t,s.a.Component),fs(t,[{key:"render",value:function(){var e=this;return s.a.createElement(Jn.a,{stores:[i.a,Kn.a],inject:{toAsset:function(){return e.props.toAsset||i.a.getState().settings.get("unit","1.3.0")},allMarketStats:function(){return Kn.a.getState().allMarketStats}}},s.a.createElement(vs,hs({},this.props,{ref:this.props.refCallback})))}}]),t}(),Es=a(124),ws=a(177),ks=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},As=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function Cs(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}var Os=function(e){function t(){var e,a,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var s=arguments.length,r=Array(s),o=0;o<s;o++)r[o]=arguments[o];return a=n=Cs(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r))),n.tick=function(){var e=n.props,t=e.onIcon,a=e.offIcon,s=(n.state||{}).name,r=void 0===s?t:s;n.setState({name:r===t?a:t})},Cs(n,a)}return 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)}(t,n["Component"]),As(t,[{key:"componentDidMount",value:function(){var e=this.props.duration;this.interval=setInterval(this.tick,e)}},{key:"componentWillUnmount",value:function(){this.interval&&clearInterval(this.interval)}},{key:"render",value:function(){var e=this.props,t=e.onIcon,a=e.rest,n=(this.state||{}).name,r=void 0===n?t:n,o=this.props.title;return s.a.createElement(M.a,ks({name:r,title:o},a))}}]),t}();Os.propTypes={duration:E.a.number.isRequired,offIcon:E.a.string.isRequired,onIcon:E.a.string.isRequired,title:E.a.string.isRequired};var xs=Os,Ss=a(692),Ns=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function js(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ps(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 Ts(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)}var Is=function(e){function t(){js(this,t);var e=Ps(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={amount:0},e}return Ts(t,s.a.Component),Ns(t,[{key:"onAmountChanged",value:function(e){var t=e.amount;e.asset;this.setState({amount:t})}},{key:"onSubmit",value:function(e){e.preventDefault(),j.a.publish("settlement_modal","close");var t=z.a.get_asset_precision(this.props.asset.get("precision")),a=this.state.amount.replace(/,/g,"");a*=t;var n=Wt.a.new_transaction();return n.add_type_operation("asset_settle",{fee:{amount:0,asset_id:0},account:this.props.account.get("id"),amount:{amount:a,asset_id:this.props.asset.get("id")}}),at.a.process_transaction(n,null,!0).then(function(e){return!0}).catch(function(e){return console.error("asset settle error: ",e),!1})}},{key:"render",value:function(){var e=this.props,t=e.asset,a=e.account,n=this.state.amount;if(!t)return null;var r=t.get("id"),o=a.get("balances"),i=null,l=0;o&&o.forEach(function(e){var t=W.ChainStore.getObject(e);if(!t.get("balance"))return null;t.get("asset_type")===r&&(i=e,l=t.get("balance"))});var c=z.a.get_asset_precision(t.get("precision")),u=n?n.replace(/,/g,""):0,p=parseFloat(u)>0&&parseFloat(u)*c<=parseFloat(l)?"button success":"button disabled",m=s.a.createElement("span",null,s.a.createElement(A.a,{content:"exchange.balance"}),": ",i?s.a.createElement(ns.a,{balance:i}):"0 "+t.get("symbol"));return s.a.createElement("form",{className:"grid-block vertical full-width-content"},s.a.createElement(A.a,{component:"h3",style:{textAlign:"center"},content:"modal.settle.title",asset:t.get("symbol")}),s.a.createElement("div",{className:"grid-container ",style:{paddingTop:"2rem"}},s.a.createElement("div",{className:"content-block"},s.a.createElement(Q.a,{label:"modal.settle.amount",amount:n,onChange:this.onAmountChanged.bind(this),display_balance:m,asset:r,assets:[r],tabIndex:1})),s.a.createElement("div",{className:"content-block"},s.a.createElement("input",{type:"submit",className:p,onClick:this.onSubmit.bind(this),value:K.a.translate("modal.settle.submit")}))))}}]),t}();Is.propTypes={asset:c.a.ChainAsset.isRequired,account:c.a.ChainAccount.isRequired},Is=Object(u.a)(Is);var Rs=function(e){function t(){js(this,t);var e=Ps(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={open:!1},e}return Ts(t,s.a.Component),Ns(t,[{key:"show",value:function(){var e=this;this.setState({open:!0},function(){j.a.publish(e.props.modalId,"open")})}},{key:"onClose",value:function(){this.setState({open:!1})}},{key:"render",value:function(){return this.state.open?s.a.createElement(x.a,{id:this.props.modalId,onClose:this.onClose.bind(this),overlay:!0,ref:"settlement_modal"},s.a.createElement("div",{className:"grid-block vertical"},s.a.createElement(Is,this.props))):null}}]),t}(),qs=a(727),Ms=a(1799),Bs=a(1800),Ds=a(702),Fs=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();var Ls=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state=a.getInitialState(e),a}return 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)}(t,s.a.Component),Fs(t,[{key:"componentWillReceiveProps",value:function(e){e.asset&&this.props.asset&&e.asset.get("id")!==this.props.asset.get("id")&&this.setState(this.getInitialState(e))}},{key:"getInitialState",value:function(e){return{amount:0,amountAsset:new Nn.a({amount:0,asset_id:e.asset.get("id"),precision:e.asset.get("precision")})}}},{key:"onAmountChanged",value:function(e){var t=e.amount,a=e.asset;this.state.amountAsset.setAmount({real:t}),this.setState({amount:t,asset:a})}},{key:"onSubmit",value:function(){var e=this;C.a.reserveAsset(this.state.amountAsset.getAmount(),this.props.asset.get("id"),this.props.account.get("id")).then(function(){e.state.amountAsset.setAmount({sats:0}),e.setState({amount:0})}),this.props.onClose()}},{key:"render",value:function(){var e=this,t=this.props.asset.get("id"),a=this.props.account&&this.props.account.get("balances",[]).size&&this.props.account.getIn(["balances",t])?W.ChainStore.getObject(this.props.account.getIn(["balances",t])):null;return a?s.a.createElement("form",{className:"grid-block vertical full-width-content"},s.a.createElement(A.a,{component:"h3",content:"modal.reserve.title"}),s.a.createElement("div",{className:"grid-container ",style:{paddingTop:"2rem"}},s.a.createElement("div",{className:"content-block"},s.a.createElement(Q.a,{label:"modal.reserve.amount",amount:this.state.amount,onChange:this.onAmountChanged.bind(this),asset:t,assets:[t],display_balance:s.a.createElement("div",{onClick:function(){e.state.amountAsset.setAmount({sats:a.get("balance")}),e.setState({amount:e.state.amountAsset.getAmount({real:!0})})}},s.a.createElement(ns.a,{balance:this.props.account.getIn(["balances",t])})),tabIndex:1})),s.a.createElement("div",{className:"content-block button-group"},s.a.createElement("input",{type:"submit",className:"button success",onClick:this.onSubmit.bind(this),value:K.a.translate("modal.reserve.submit"),tabIndex:2}),s.a.createElement("div",{className:"button",onClick:this.props.onClose,tabIndex:3},K.a.translate("cancel"))))):null}}]),t}(),Vs=Ls=Object(R.a)(Ls,{propNames:["asset"]}),Us=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},zs=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function Ws(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var Js=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));for(var a in e.sortFunctions={qty:function(e,t,a){return Number(this.qtyRefs[e.key])<Number(this.qtyRefs[t.key])?this.props.sortDirection||a?-1:1:Number(this.qtyRefs[e.key])>Number(this.qtyRefs[t.key])?this.props.sortDirection||a?1:-1:void 0},alphabetic:function(e,t,a){return e.key>t.key?this.props.sortDirection||a?1:-1:e.key<t.key?this.props.sortDirection||a?-1:1:0},priceValue:function(e,t){var a=this.priceRefs[e.key],n=this.priceRefs[t.key];return a&&n?this.props.sortDirection?a-n:n-a:null===a&&null!==n?1:null!==a&&null===n?-1:this.sortFunctions.alphabetic(e,t,!0)},totalValue:function(e,t){var a=this.valueRefs[e.key],n=this.valueRefs[t.key];return a&&n?this.props.sortDirection?a-n:n-a:!a&&n?1:a&&!n?-1:this.sortFunctions.alphabetic(e,t,!0)},changeValue:function(e,t){var a=this.changeRefs[e.key],n=this.changeRefs[t.key];if(a&&n){var s="NaN"!=parseFloat(a)?parseFloat(a):a,r="NaN"!=parseFloat(n)?parseFloat(n):n;return void 0===this.props.sortDirection||this.props.sortDirection?s-r:r-s}}},e._renderBuy=function(t,a,n,r,o){return"BTS"===t&&o<=1e5?s.a.createElement("span",null,s.a.createElement("a",{onClick:e._showDepositWithdraw.bind(e,"bridge_modal",n,!1)},s.a.createElement(xs,{onIcon:"dollar",offIcon:"dollar-green",title:"icons.dollar.buy",duration:1e3,className:"icon-14px"}))):a&&e.props.isMyAccount?s.a.createElement("span",null,s.a.createElement("a",{onClick:e._showDepositWithdraw.bind(e,"bridge_modal",n,!1)},s.a.createElement(M.a,{name:"dollar",title:"icons.dollar.buy",className:"icon-14px"}))):r},e.state={settleAsset:"1.3.0",depositAsset:null,withdrawAsset:null,bridgeAsset:null,allRefsAssigned:!1},e.qtyRefs={},e.priceRefs={},e.valueRefs={},e.changeRefs={},e.sortFunctions)e.sortFunctions[a]=e.sortFunctions[a].bind(e);return e._checkRefAssignments=e._checkRefAssignments.bind(e),e}return 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)}(t,s.a.Component),zs(t,[{key:"componentWillMount",value:function(){this.refCheckInterval=setInterval(this._checkRefAssignments)}},{key:"componentWillUnmount",value:function(){clearInterval(this.refCheckInterval)}},{key:"_checkRefAssignments",value:function(){var e=this;if(!this.state.allRefsAssigned){var t=["qtyRefs","priceRefs","valueRefs","changeRefs"].reduce(function(t,a){return void 0===t?!!Object.keys(e[a]).length:!!Object.keys(e[a]).length&&t},void 0);t&&(clearInterval(this.refCheckInterval),this.setState({allRefsAssigned:t}))}}},{key:"shouldComponentUpdate",value:function(e,t){var a=this;return!z.a.are_equal_shallow(t,this.state)||!z.a.are_equal_shallow(e.backedCoins,this.props.backedCoins)||!z.a.are_equal_shallow(e.balances,this.props.balances)||!z.a.are_equal_shallow(e.balanceList,this.props.balanceList)||!z.a.are_equal_shallow(e.optionalAssets,this.props.optionalAssets)||e.account!==this.props.account||e.visible!==this.props.visible||e.settings!==this.props.settings||e.hiddenAssets!==this.props.hiddenAssets||e.sortDirection!==this.props.sortDirection||e.sortKey!==this.props.sortKey||e.allMarketStats.reduce(function(e,t,n){return z.a.check_market_stats(t,a.props.allMarketStats.get(n))||e},!1)}},{key:"triggerSend",value:function(e){var t=this;this.setState({send_asset:e},function(){t.send_modal&&t.send_modal.show()})}},{key:"_onSettleAsset",value:function(e,t){t.preventDefault(),this.setState({settleAsset:e}),this.refs.settlement_modal.show()}},{key:"_hideAsset",value:function(e,t){de.a.hideAsset(e,t)}},{key:"_burnAsset",value:function(e,t){t.preventDefault(),this.setState({reserve:e}),j.a.publish("reserve_asset","open")}},{key:"_showDepositModal",value:function(e,t){var a=this;t.preventDefault(),this.setState({depositAsset:e},function(){a.refs.deposit_modal_new.show()})}},{key:"_showDepositWithdraw",value:function(e,t,a,n){var s,r=this;n.preventDefault(),this.setState((Ws(s={},"bridge_modal"===e?"bridgeAsset":"deposit_modal"===e?"depositAsset":"withdrawAsset",t),Ws(s,"fiatModal",a),s),function(){r.refs[e].show()})}},{key:"_getSeparator",value:function(e){return e?s.a.createElement("span",null," | "):null}},{key:"_renderBalances",value:function(e,t,a){var n=this,r=this.props,o=r.coreSymbol,i=r.preferredUnit,l=r.settings,c=r.hiddenAssets,u=r.orders,p=l.get("showAssetPercent",!1),m=function(e,t){var a=e&&e.has("bitasset_data_id"),r="cp_modal_"+e.get("id");return{isBitAsset:a,borrowModal:a?s.a.createElement(ya.a,{ref:r,modalId:"borrow_modal_"+e.get("id"),quote_asset:e.get("id"),backing_asset:e.getIn(["bitasset","options","short_backing_asset"]),account:t}):null,borrowLink:a?s.a.createElement("a",{onClick:function(){La.a.hide(),n.refs[r].show()}},s.a.createElement(M.a,{name:"dollar",title:"icons.dollar.borrow",className:"icon-14px"})):null}},d=[];return e.forEach(function(e){var t=W.ChainStore.getObject(e);if(t){var a=t.get("asset_type"),r=W.ChainStore.getObject(a);if(r){var l,h,f,b="",g=r.get("symbol"),_="1.3.0"!==r.get("id"),v=i!==o,y=I.a.parseDescription(r.getIn(["options","description"])).market;-1===(b=r.get("symbol")).indexOf("OPEN.")||y||(y="USD"),-1!==["RUDEX.GOLOS","RUDEX.GBG"].indexOf(b)&&(y="RUBLE");var E=y||o;l=_?s.a.createElement(w.a,{to:"/market/"+r.get("symbol")+"_"+E},s.a.createElement(M.a,{name:"trade",title:"icons.trade.trade",className:"icon-14px"})):v?s.a.createElement(w.a,{to:"/market/"+r.get("symbol")+"_"+i},s.a.createElement(M.a,{name:"trade",title:"icons.trade.trade",className:"icon-14px"})):"-",f=s.a.createElement(w.a,{to:"/transfer?asset="+r.get("id")},s.a.createElement(M.a,{name:"transfer",title:"icons.transfer",className:"icon-14px"}));var k=m(r,n.props.account),A=k.isBitAsset,C=k.borrowModal,O=k.borrowLink;h=s.a.createElement("a",{onClick:n._onSettleAsset.bind(n,r.get("id"))},s.a.createElement(M.a,{name:"settle",title:"icons.settle",className:"icon-14px"}));var x=!c.includes(a),S=!!t.get("balance"),N=!!u[a],j=(Object(Es.b)(r.get("symbol"),n.props.backedCoins),!!n.props.bridgeCoins.get(b)),P=t.get("balance");n.qtyRefs[r.get("symbol")]=z.a.get_asset_amount(P,r);var T=r&&r.getIn(["bitasset","options"])?r.getIn(["bitasset","options"]).toJS():null,R=T&&T.short_backing_asset?W.ChainStore.getAsset(T.short_backing_asset):null,q=z.a.replaceName(r).isBitAsset,B=z.a.replaceName(R).isBitAsset,D=W.ChainStore.getAsset(i);n.valueRefs[r.get("symbol")]=S&&D?jn.a.convertValue(P,D,r,n.props.allMarketStats,n.props.coreAsset,!0):null,n.priceRefs[r.get("symbol")]=D?jn.a.getFinalPrice(n.props.coreAsset,r,D,n.props.allMarketStats,!0):null;var F=r.get("symbol")+"_"+i,L=n.props.allMarketStats.get(F);n.changeRefs[r.get("symbol")]=L&&L.change?L.change:0,d.push(s.a.createElement("tr",{key:r.get("symbol"),style:{maxWidth:"100rem"}},s.a.createElement("td",{style:{textAlign:"left"}},s.a.createElement(va.a,{replaceNoneToBts:!1,maxWidth:30,name:r.get("symbol")}),s.a.createElement(pe.a,{asset:r.get("id")})),s.a.createElement("td",{style:{textAlign:"right"}},S||N?s.a.createElement(ns.a,{balance:e,hide_asset:!0}):null),s.a.createElement("td",{style:{textAlign:"right"},className:"column-hide-small"},s.a.createElement(ys,{fromAsset:r.get("id"),pulsate:{reverse:!0,fill:"forwards"},hide_symbols:!0})),s.a.createElement("td",{style:{textAlign:"right"},className:"column-hide-small"},s.a.createElement(ms,{base:r.get("id"),quote:i,marketId:F,hide_symbols:!0})),s.a.createElement("td",{style:{textAlign:"right"},className:"column-hide-small"},S||N?s.a.createElement(Xt.a,{balance:e,toAsset:i,hide_asset:!0}):null),p?s.a.createElement("td",{style:{textAlign:"right"}},S?s.a.createElement(ns.a,{balance:e,asPercentage:!0}):null):null,s.a.createElement("td",null,f),s.a.createElement("td",null,n._renderBuy(r.get("symbol"),j,g,"-",t.get("balance"))),s.a.createElement("td",null,"-"),s.a.createElement("td",null,"-"),s.a.createElement("td",null,l),s.a.createElement("td",null,A?s.a.createElement("div",{className:"inline-block","data-place":"bottom","data-tip":K.a.translate("tooltip.borrow",{asset:b})},O,C):"-"),s.a.createElement("td",null,A&&R?s.a.createElement("div",{className:"inline-block","data-place":"bottom","data-tip":K.a.translate("tooltip.settle",{asset:q?"bit"+b:b,backingAsset:B?"bit"+R.get("symbol"):R.get("symbol"),settleDelay:T.force_settlement_delay_sec/3600})},h):"-"),s.a.createElement("td",{style:{textAlign:"center"},className:"column-hide-small"},A?null:s.a.createElement("a",{style:{marginRight:0},onClick:n._burnAsset.bind(n,r.get("id"))},s.a.createElement(M.a,{name:"fire",className:"icon-14px"}))),s.a.createElement("td",{style:{textAlign:"center"},className:"column-hide-small","data-place":"bottom","data-tip":K.a.translate("tooltip."+(x?"hide_asset":"show_asset"))},s.a.createElement("a",{style:{marginRight:0},className:x?"order-cancel":"action-plus",onClick:n._hideAsset.bind(n,a,x)},s.a.createElement(M.a,{name:x?"cross-circle":"plus-circle",title:x?"icons.cross_circle.hide_asset":"icons.plus_circle.show_asset",className:"icon-14px"})))))}}}),t&&t.filter(function(e){var t=!1;n.props.backedCoins.get("OPEN",[]).forEach(function(a){a&&a.symbol===e&&(t=!0)}),n.props.bridgeCoins.get(e)&&(t=!0);var a=!0;return d.forEach(function(t){t.key===e&&(a=!1)}),a&&t}).forEach(function(e){var t=W.ChainStore.getAsset(e);if(t&&n.props.isMyAccount){var r=!c.includes(t.get("id")),i=t.get("symbol").split("."),l=!!n.props.backedCoins.get("OPEN",[]).find(function(e){return e.backingCoinType===i[1]})||!!n.props.backedCoins.get("RUDEX",[]).find(function(e){return e.backingCoin===i[1]})||"BTS"==t.get("symbol"),u=!!n.props.bridgeCoins.get(t.get("symbol")),p="1.3.0"!==t.get("id"),h=I.a.parseDescription(t.getIn(["options","description"])).market;-1===t.get("symbol").indexOf("OPEN.")||h||(h="USD");var f=h||o,b=p?s.a.createElement(w.a,{to:"/market/"+t.get("symbol")+"_"+f},s.a.createElement(M.a,{name:"trade",title:"icons.trade.trade",className:"icon-14px"})):"-",g=m(t,n.props.account),_=g.isBitAsset,v=g.borrowModal,y=g.borrowLink;(r&&a||!r&&!a)&&d.push(s.a.createElement("tr",{key:t.get("symbol"),style:{maxWidth:"100rem"}},s.a.createElement("td",{style:{textAlign:"left"}},s.a.createElement(va.a,{replaceNoneToBts:!1,maxWidth:30,name:t.get("symbol")}),s.a.createElement(pe.a,{asset:t.get("id")})),s.a.createElement("td",null,"-"),s.a.createElement("td",{className:"column-hide-small"},"-"),s.a.createElement("td",{className:"column-hide-small"},"-"),s.a.createElement("td",{className:"column-hide-small"},"-"),s.a.createElement("td",null,"-"),s.a.createElement("td",{style:{textAlign:"center"}},u&&n.props.isMyAccount?s.a.createElement("span",null,s.a.createElement("a",{onClick:n._showDepositWithdraw.bind(n,"bridge_modal",e,!1)},s.a.createElement(M.a,{name:"dollar",title:"icons.dollar.buy",className:"icon-14px"}))):"-"),s.a.createElement("td",null,l&&n.props.isMyAccount?s.a.createElement("span",null,s.a.createElement(M.a,{style:{cursor:"pointer"},name:"deposit",title:"icons.deposit.deposit",className:"icon-14x",onClick:n._showDepositModal.bind(n,t.get("symbol"))})):"-"),s.a.createElement("td",null,"-"),s.a.createElement("td",{style:{textAlign:"center"}},b),s.a.createElement("td",null,_?s.a.createElement("div",{className:"inline-block","data-place":"bottom","data-tip":K.a.translate("tooltip.borrow",{asset:t.get("symbol")})},y,v):"-"),s.a.createElement("td",null,"-"),s.a.createElement("td",{style:{textAlign:"center"},className:"column-hide-small","data-place":"bottom","data-tip":K.a.translate("tooltip."+(r?"hide_asset":"show_asset"))},s.a.createElement("a",{style:{marginRight:0},className:r?"order-cancel":"action-plus",onClick:n._hideAsset.bind(n,t.get("id"),r)},s.a.createElement(M.a,{name:r?"cross-circle":"plus-circle",title:r?"icons.cross_circle.hide_asset":"icons.plus_circle.show_asset",className:"icon-14px"})))))}}),d.sort(this.sortFunctions[this.props.sortKey]),d}},{key:"_renderSendModal",value:function(){var e=this;return s.a.createElement(Ss.a,{id:"send_modal_portfolio",refCallback:function(t){t&&(e.send_modal=t)},from_name:this.props.account.get("name"),asset_id:this.state.send_asset||"1.3.0"})}},{key:"_renderSettleModal",value:function(){return s.a.createElement(Rs,{ref:"settlement_modal",modalId:"settlement_modal",asset:this.state.settleAsset,account:this.props.account.get("name")})}},{key:"render",value:function(){var e=this,t=this.props.backedCoins.get("OPEN",[]).find(function(t){return t.symbol===e.state.withdrawAsset})||{},a=this.props.bridgeCoins.get(this.state.bridgeAsset)||null;return s.a.createElement("div",null,s.a.createElement(Pn.a,{style:{padding:0},className:"table dashboard-table table-hover",rows:this._renderBalances(this.props.balanceList,this.props.optionalAssets,this.props.visible),header:this.props.header,pageSize:20,label:"utility.total_x_assets",extraRow:this.props.extraRow,leftPadding:"1.5rem"},this._renderSendModal(),this._renderSettleModal(),s.a.createElement(Ms.a,Us({ref:"withdraw_modal",action:"withdraw",fiatModal:this.state.fiatModal,account:this.props.account.get("name"),sender:this.props.account.get("id"),asset:this.state.withdrawAsset,modalId:"simple_withdraw_modal",balances:this.props.balances},t,{isDown:this.props.gatewayDown.get("OPEN")})),s.a.createElement(Ds.a,{ref:"withdraw_modal_new",modalId:"withdraw_modal_new",backedCoins:this.props.backedCoins,initialSymbol:this.state.withdrawAsset}),s.a.createElement(qs.a,{ref:"deposit_modal_new",modalId:"deposit_modal_new",asset:this.state.depositAsset,account:this.props.account.get("name"),backedCoins:this.props.backedCoins}),s.a.createElement(Bs.a,{ref:"bridge_modal",action:"deposit",account:this.props.account.get("name"),sender:this.props.account.get("id"),asset:this.state.bridgeAsset,modalId:"simple_bridge_modal",balances:this.props.balances,bridges:a,isDown:this.props.gatewayDown.get("TRADE")}),s.a.createElement(x.a,{id:"reserve_asset",overlay:!0},s.a.createElement("br",null),s.a.createElement("div",{className:"grid-block vertical"},s.a.createElement(Vs,{asset:this.state.reserve,account:this.props.account,onClose:function(){j.a.publish("reserve_asset","close")}})))))}}]),t}();Js=Object(p.a)(Js,{listenTo:function(){return[i.a,ws.a,Kn.a]},getProps:function(){return{settings:i.a.getState().settings,viewSettings:i.a.getState().viewSettings,backedCoins:ws.a.getState().backedCoins,bridgeCoins:ws.a.getState().bridgeCoins,gatewayDown:ws.a.getState().down,allMarketStats:Kn.a.getState().allMarketStats}}});var Ks=Js=as()(Js,50,{leading:!1}),Gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Zs=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function Qs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hs(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 Ys(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)}var Xs=function(e){function t(e){Qs(this,t);var a=Hs(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.state={sortKey:e.viewSettings.get("portfolioSort","totalValue"),sortDirection:e.viewSettings.get("portfolioSortDirection",!0),shownAssets:e.viewSettings.get("shownAssets","active"),alwaysShowAssets:["BTS"]},a._handleFilterInput=a._handleFilterInput.bind(a),a}return Ys(t,s.a.Component),Zs(t,[{key:"_handleFilterInput",value:function(e){e.preventDefault(),this.setState({filterValue:e.target.value})}},{key:"componentWillMount",value:function(){this._checkMarginStatus()}},{key:"_checkMarginStatus",value:function(){var e=this;(function(e){if(!e||e&&!e.get("call_orders",[]).size)return Promise.resolve(null);var t=e.get("name")+JSON.stringify(e.get("call_orders"));return Mn[t]?Mn[t].result?Promise.resolve(Mn[t].result):new Promise(function(e,a){Mn[t].queue.push({res:e,rej:a})}):new Promise(function(a,n){Mn[t]={queue:[{res:a,rej:n}],result:null},Object(W.FetchChain)("getObject",e.get("call_orders").toArray()).then(function(e){var a=[];e.forEach(function(e){var t=e.getIn(["call_price","base","asset_id"]),n=e.getIn(["call_price","quote","asset_id"]);-1===a.indexOf(t)&&a.push(t),-1===a.indexOf(n)&&a.push(n)}),Object(W.FetchChain)("getAsset",a,6e3).then(function(a){var n={};a.forEach(function(e){n[e.get("id")]=e.toJS()});var s={};e.forEach(function(e){var t=n[e.getIn(["call_price","quote","asset_id"])],a=n[e.getIn(["call_price","base","asset_id"])],r=t.bitasset.current_feed.settlement_price;if(r.base.asset_id===r.quote.asset_id)s[t.id]={ratio:null};else{var o=new Nn.a({amount:e.get("collateral"),asset_id:a.id,precision:a.precision}),i=new Nn.a({amount:e.get("debt"),asset_id:t.id,precision:t.precision}),l=t.bitasset.current_feed.maintenance_collateral_ratio/1e3,c=new Nn.c({priceObject:t.bitasset.current_feed.settlement_price,market_base:t.bitasset.current_feed.settlement_price.quote.asset_id,sqr:t.bitasset.current_feed.maximum_short_squeeze_ratio,assets:n}),u={ratio:o.getAmount({real:!0})/(i.getAmount({real:!0})/c.toReal())};if(isNaN(u.ratio))return null;u.ratio<l?u.statusClass="danger":u.ratio<l+.5?u.statusClass="warning":u.statusClass=null,s[t.id]=u}}),Mn[t].queue.forEach(function(e){e.res(s)}),Mn[t]={result:s},setTimeout(function(){delete Mn[t]},Bn)})}).catch(function(){Mn[t].queue.forEach(function(e){e.rej()})})})})((arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props).account).then(function(t){var a=null;for(var n in t)a=t[n].statusClass||a;e.setState({globalMarginStatus:a})})}},{key:"componentWillReceiveProps",value:function(e){e.account!==this.props.account&&this._checkMarginStatus(e)}},{key:"shouldComponentUpdate",value:function(e,t){return!z.a.are_equal_shallow(e.balances,this.props.balances)||e.account!==this.props.account||e.settings!==this.props.settings||e.hiddenAssets!==this.props.hiddenAssets||!z.a.are_equal_shallow(t,this.state)||this.state.filterValue!==t.filterValue}},{key:"_changeShownAssets",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"active";this.setState({shownAssets:e}),de.a.changeViewSetting({shownAssets:e})}},{key:"_toggleSortOrder",value:function(e){this.state.sortKey===e?(de.a.changeViewSetting({portfolioSortDirection:!this.state.sortDirection}),this.setState({sortDirection:!this.state.sortDirection})):(de.a.changeViewSetting({portfolioSort:e}),this.setState({sortDirection:!1,sortKey:e}))}},{key:"getHeader",value:function(){var e=this.props.settings,t=this.state.shownAssets,a=e.get("unit")||this.props.core_asset.get("symbol"),n=e.get("showAssetPercent",!1);return s.a.createElement("tr",null,s.a.createElement("th",{style:{textAlign:"left"},className:V()("clickable is-sortable",{"is-active":"alphabetic"===this.state.sortKey}),onClick:this._toggleSortOrder.bind(this,"alphabetic")},s.a.createElement(A.a,{component:"span",content:"account.asset"})),s.a.createElement("th",{onClick:this._toggleSortOrder.bind(this,"qty"),className:V()("clickable is-sortable",{"is-active":"qty"===this.state.sortKey}),style:{textAlign:"right"}},s.a.createElement(A.a,{content:"account.qty"})),s.a.createElement("th",{onClick:this._toggleSortOrder.bind(this,"priceValue"),className:V()("column-hide-small clickable is-sortable",{"is-active":"priceValue"===this.state.sortKey}),style:{textAlign:"right"}},s.a.createElement(A.a,{content:"exchange.price"})," (",s.a.createElement(ma.a,{name:a,noTip:!0}),")"),s.a.createElement("th",{onClick:this._toggleSortOrder.bind(this,"changeValue"),className:V()("column-hide-small clickable is-sortable",{"is-active":"changeValue"===this.state.sortKey}),style:{textAlign:"right"}},s.a.createElement(A.a,{content:"account.hour_24_short"})),s.a.createElement("th",{onClick:this._toggleSortOrder.bind(this,"totalValue"),style:{textAlign:"right"},className:V()("column-hide-small clickable is-sortable",{"is-active":"totalValue"===this.state.sortKey})},s.a.createElement(Ea.a,{noLink:!0,string:"account.eq_value_header",keys:[{type:"asset",value:a,arg:"asset"}],noTip:!0})),n?s.a.createElement("th",{style:{textAlign:"right"}},s.a.createElement(A.a,{component:"span",content:"account.percent"})):null,s.a.createElement("th",null,s.a.createElement(A.a,{content:"header.payments"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"exchange.buy"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"modal.deposit.submit"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"modal.withdraw.submit"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.trade"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"exchange.borrow_short"})),s.a.createElement("th",null,s.a.createElement(A.a,{content:"account.settle"})),s.a.createElement("th",{className:"column-hide-small"},s.a.createElement(A.a,{content:"modal.reserve.submit"})),s.a.createElement("th",{className:"column-hide-small"},s.a.createElement(A.a,{content:"active"==t?"exchange.hide":"account.perm.show"})))}},{key:"render",value:function(){var e=this,t=this.props,a=t.account,n=t.hiddenAssets,r=t.settings,o=t.orders,i=this.state.shownAssets;if(!a)return null;var l=r.get("unit")||this.props.core_asset.get("symbol"),c=[],u={},p={};a.toJS&&a.has("call_orders")&&(c=a.get("call_orders").toJS());var m,d,f=a.get("balances"),b=h.a.List(),g=h.a.List();c.forEach(function(e){var t=W.ChainStore.getObject(e);if(t){var a=t.getIn(["call_price","base","asset_id"]);u[a]?u[a]+=parseInt(t.get("collateral"),10):u[a]=parseInt(t.get("collateral"),10);var n=t.getIn(["call_price","quote","asset_id"]);p[n]?p[n]+=parseInt(t.get("debt"),10):p[n]=parseInt(t.get("debt"),10)}}),f&&(f=f.filter(function(e,t){var a=W.ChainStore.getObject(e);return!(a&&!a.get("balance")&&!o[t])})).forEach(function(t,a){var s=W.ChainStore.getAsset(a),r="",o="";e.state.filterValue&&(o=e.state.filterValue?String(e.state.filterValue).toLowerCase():"",r=s.get("symbol").toLowerCase(),z.a.replaceName(s).isBitAsset&&(r="bit"+r));n.includes(a)&&r.includes(o)?g=g.push(t):r.includes(o)&&(b=b.push(t))});var _=s.a.createElement(_a.a,{noTip:!0,balances:g,hide_asset:!0}),v=s.a.createElement(_a.a,{noTip:!0,balances:b,hide_asset:!0}),y=s.a.createElement(_a.a,{noTip:!0,balances:h.a.List(),openOrders:o,hide_asset:!0}),E=s.a.createElement(_a.a,{noTip:!0,balances:h.a.List(),debt:p,collateral:u,hide_asset:!0}),w=s.a.createElement(_a.a,{noTip:!0,balances:h.a.List(),debt:p,hide_asset:!0}),k=s.a.createElement(_a.a,{noTip:!0,balances:h.a.List(),collateral:u,hide_asset:!0}),C=s.a.createElement(Ea.a,{noLink:!0,string:"account.total",keys:[{type:"asset",value:l,arg:"asset"}]}),O=s.a.createElement("tr",{key:"portfolio",className:"total-value"},s.a.createElement("td",{colSpan:"2",style:{textAlign:"left"}},C),s.a.createElement("td",{className:"column-hide-small"}),s.a.createElement("td",{className:"column-hide-small"}),s.a.createElement("td",{style:{textAlign:"right"}},v),s.a.createElement("td",{colSpan:"9"})),x=s.a.createElement("tr",{key:"portfolio",className:"total-value"},s.a.createElement("td",{colSpan:"2",style:{textAlign:"left"}},C),s.a.createElement("td",{className:"column-hide-small"}),s.a.createElement("td",{className:"column-hide-small"}),s.a.createElement("td",{style:{textAlign:"right"}},_),s.a.createElement("td",{colSpan:"9"}));m=s.a.createElement(Ks,{balanceList:b,optionalAssets:this.state.filterValue?null:this.state.alwaysShowAssets,visible:!0,preferredUnit:l,coreAsset:this.props.core_asset,coreSymbol:this.props.core_asset.get("symbol"),hiddenAssets:n,orders:o,account:this.props.account,sortKey:this.state.sortKey,sortDirection:this.state.sortDirection,isMyAccount:this.props.isMyAccount,balances:this.props.balances,header:this.getHeader(),extraRow:O}),d=s.a.createElement(Ks,{balanceList:g,optionalAssets:this.state.filterValue?null:this.state.alwaysShowAsset,visible:!1,preferredUnit:l,coreSymbol:this.props.core_asset.get("symbol"),settings:r,hiddenAssets:n,orders:o,account:this.props.account,sortKey:this.state.sortKey,sortDirection:this.state.sortDirection,isMyAccount:this.props.isMyAccount,balances:this.props.balances,header:this.getHeader(),extraRow:x});return s.a.createElement("div",{className:"grid-content app-tables no-padding",ref:"appTables"},s.a.createElement("div",{className:"content-block small-12"},s.a.createElement("div",{className:"tabs-container generic-bordered-box"},s.a.createElement(q.b,{defaultActiveTab:0,segmented:!1,setting:"overviewTab",className:"account-tabs",tabsClass:"account-overview no-padding bordered-header content-block"},s.a.createElement(q.a,{title:"account.portfolio",subText:v},s.a.createElement("div",{className:"header-selector"},s.a.createElement("div",{className:"filter inline-block"},s.a.createElement("input",{type:"text",placeholder:"Filter",onChange:this._handleFilterInput})),s.a.createElement("div",{className:"selector inline-block"},s.a.createElement("div",{className:V()("inline-block",{inactive:"active"!=i}),onClick:"active"!=i?this._changeShownAssets.bind(this,"active"):function(){}},s.a.createElement(A.a,{content:"account.hide_hidden"})),g.size?s.a.createElement("div",{className:V()("inline-block",{inactive:"hidden"!=i}),onClick:"hidden"!=i?this._changeShownAssets.bind(this,"hidden"):function(){}},s.a.createElement(A.a,{content:"account.show_hidden"})):null,s.a.createElement("div",{className:V()("inline-block",{inactive:"visual"!=i}),onClick:"visual"!=i?this._changeShownAssets.bind(this,"visual"):function(){}},s.a.createElement(A.a,{content:"account.show_visual"})))),"visual"!=i?"hidden"===i&&g.size?d:m:s.a.createElement(es,{balanceObjects:b})),s.a.createElement(q.a,{title:"account.open_orders",subText:y},s.a.createElement(qn,this.props,s.a.createElement("tr",{className:"total-value"},s.a.createElement("td",{colSpan:"8",style:{textAlign:"right"}},C),s.a.createElement("td",{colSpan:"1",style:{textAlign:"right"}},y),this.props.isMyAccount?s.a.createElement("td",null):null))),s.a.createElement(q.a,{title:"account.collaterals",subText:s.a.createElement("span",{className:this.state.globalMarginStatus},E)},s.a.createElement("div",{className:"content-block"},s.a.createElement("div",{className:"generic-bordered-box"},s.a.createElement(Ra,{preferredUnit:l,className:"dashboard-table",callOrders:c,account:a},s.a.createElement("tr",{className:"total-value"},s.a.createElement("td",null,C),s.a.createElement("td",null),s.a.createElement("td",null,w),s.a.createElement("td",{className:"column-hide-medium"},k),s.a.createElement("td",null),s.a.createElement("td",null,E),s.a.createElement("td",{className:"column-hide-small"}),s.a.createElement("td",{className:"column-hide-small"}),s.a.createElement("td",{colSpan:"3"})))))),s.a.createElement(q.a,{title:"account.activity",subText:" "},s.a.createElement(Ot.a,{accountsList:h.a.fromJS([a.get("id")]),compactView:!1,showMore:!0,fullHeight:!0,limit:100,showFilters:!0,dashboard:!0})),a.get("proposals")&&a.get("proposals").size?s.a.createElement(q.a,{title:"explorer.proposals.title",subText:String(a.get("proposals")?a.get("proposals").size:0)},s.a.createElement(On,{className:"dashboard-table",account:a.get("id")})):null))))}}]),t}();Xs=Object(R.a)(Xs,{propNames:["core_asset"]});var $s=function(e){function t(){return Qs(this,t),Hs(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Ys(t,s.a.Component),Zs(t,[{key:"render",value:function(){return s.a.createElement(Dn.a,Gs({},this.props,{wrap:Xs}))}}]),t}(),er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},tr=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();function ar(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nr(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 sr(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)}var rr=function(e){function t(){return ar(this,t),nr(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return sr(t,s.a.Component),tr(t,[{key:"componentDidMount",value:function(){this.props.account&&(r.a.setCurrentAccount.defer(this.props.account.get("name")),m.a.getPossibleFees(this.props.account,"transfer"))}},{key:"componentWillReceiveProps",value:function(e){if(e.account){var t=e.account.get("name"),a=this.props.account&&this.props.account.get("name");this.props.account&&t===a||(r.a.setCurrentAccount.defer(t),m.a.getPossibleFees(e.account,"transfer"))}}},{key:"render",value:function(){var e=this.props,t=e.myActiveAccounts,a=e.searchAccounts,n=e.settings,r=e.wallet_locked,i=e.account,l=e.hiddenAssets;if(!i)return s.a.createElement(f.a,null);var c=this.props.account.get("name"),u={account_name:c,myActiveAccounts:t,searchAccounts:a,settings:n,wallet_locked:r,account:i,isMyAccount:o.a.isMyAccount(i),hiddenAssets:l,contained:!0,balances:i.get("balances",Object(d.List)()).toList(),orders:i.get("orders",Object(d.List)()).toList(),viewSettings:this.props.viewSettings,proxy:i.getIn(["options","voting_account"]),history:this.props.history};return s.a.createElement("div",{className:"grid-block page-layout"},s.a.createElement("div",{className:"grid-block no-padding"},s.a.createElement(b.a,null,s.a.createElement(g.a,{path:"/account/"+c,exact:!0,render:function(){return s.a.createElement($s,u)}}),s.a.createElement(_.a,{from:"/account/"+c+"/overview",to:"/account/"+c}),s.a.createElement(g.a,{path:"/account/"+c+"/assets",exact:!0,render:function(){return s.a.createElement(F,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/create-asset",exact:!0,render:function(){return s.a.createElement(re,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/update-asset/:asset",exact:!0,render:function(){return s.a.createElement(je,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/member-stats",exact:!0,render:function(){return s.a.createElement(ze,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/vesting",exact:!0,render:function(){return s.a.createElement(Xe,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/permissions",exact:!0,render:function(){return s.a.createElement(Nt,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/voting",exact:!0,render:function(){return s.a.createElement(ga,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/whitelist",exact:!0,render:function(){return s.a.createElement(Yt,u)}}),s.a.createElement(g.a,{path:"/account/"+c+"/signedmessages",exact:!0,render:function(){return s.a.createElement(Vt,u)}}))))}}]),t}();rr.propTypes={account:c.a.ChainAccount.isRequired},rr=Object(u.a)(rr,{show_loader:!0});var or=function(e){function t(){return ar(this,t),nr(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return sr(t,s.a.Component),tr(t,[{key:"render",value:function(){var e=this.props.match.params.account_name;return s.a.createElement(rr,er({},this.props,{account:e}))}}]),t}();t.default=Object(p.a)(or,{listenTo:function(){return[o.a,i.a,l.a]},getProps:function(){return{myActiveAccounts:o.a.getState().myActiveAccounts,searchAccounts:o.a.getState().searchAccounts,settings:i.a.getState().settings,hiddenAssets:i.a.getState().hiddenAssets,wallet_locked:l.a.getState().locked,viewSettings:i.a.getState().viewSettings}}})}}]);
//# sourceMappingURL=account.js.map