-
Notifications
You must be signed in to change notification settings - Fork 1
/
2.async.js
1 lines (1 loc) · 98 KB
/
2.async.js
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[2,3],{"+Lt0":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=r("q1tI"),o=r("yP6+"),i=n.__importDefault(r("q1tI")),l=r("2dk7"),u=r("SLhE");class s extends a.Component{constructor(){super(...arguments),this.xy={x:"date",y:"fundGrowthRate"}}getTooltipFormat(t){return"totalProfitRate*accumulatedProfit"===t?[t,(t,e)=>({name:"\u7d2f\u8ba1\u6536\u76ca\u7387",value:u.roundToFix(100*t,2)+"%"+"(".concat(e,"\u5143)")})]:"profitRate*profit"===t?[t,(t,e)=>({name:"\u6301\u6709\u6536\u76ca",value:u.roundToFix(100*t,2)+"%"+"(".concat(e,"\u5143)")})]:[t,(t,e,r)=>{var n=e?"(".concat(this.props.textMap["dateBuyAmount"]," ").concat(e,")"):"",a=r?"(".concat(this.props.textMap["dateSellAmount"]," ").concat(r,")"):"";return{name:this.props.textMap["fundGrowthRate"],value:u.roundToFix(100*t,2)+"%"+n+a}}]}get scale(){var t=this.props.data.reduce((t,e)=>{return t.push(e.profitRate,e.fundGrowthRate,e.totalProfitRate),t},[]),e={min:Math.min(...t),max:Math.max(...t)};return{profitRate:e,fundGrowthRate:e,totalProfitRate:e}}render(){var t=this.props,e=t.data,r=t.textMap,n=t.commonProp,a=n.chart,s=this.xy,c=s.x,d=s.y,f=this.scale,h=e.length,m=h>0?e[0].origin.fundStrategy.annualizedRate:{fundGrowth:0,totalProfit:0},p={fixedBuy:l.COLOR_NAME.red,buy:l.COLOR_NAME.purple,sell:l.COLOR_NAME.green};return i.default.createElement("div",null,i.default.createElement("h1",{className:"main-title"},"\u57fa\u91d1\u4e1a\u7ee9\u8d70\u52bf"),i.default.createElement("h2",{className:"sub-title"},i.default.createElement("span",null,"\u57fa\u91d1\u6536\u76ca\u7387\uff1a",u.roundToFix(100*e[h-1].fundGrowthRate,2),"%\uff0c\u5e74\u5316\u6536\u76ca\u7387\uff1a",u.roundToFix(100*m.fundGrowth,2),"%")," ",i.default.createElement("br",null),i.default.createElement("span",null,"\u5b9a\u6295\u7d2f\u8ba1\u6536\u76ca\u7387\uff1a",u.roundToFix(100*e[h-1].totalProfitRate,2),"%\uff0c\u5e74\u5316\u6536\u76ca\u7387\uff1a",u.roundToFix(100*m.totalProfit,2),"%")),i.default.createElement(o.Chart,Object.assign({data:e,scale:f},a),i.default.createElement(o.Legend,{name:"txnType",itemFormatter:t=>{return r[t]}}),i.default.createElement(o.Axis,{name:c}),i.default.createElement(o.Axis,{name:"fundGrowthRate"}),i.default.createElement(o.Axis,{name:"profitRate",visible:!1}),i.default.createElement(o.Axis,{name:"totalProfitRate",visible:!1}),i.default.createElement(o.Tooltip,{crosshairs:{type:"y"}}),i.default.createElement(o.Geom,{type:"line",position:"".concat(c,"*").concat(d),size:2,color:l.COLOR_PLATE_16[0],tooltip:this.getTooltipFormat("fundGrowthRate*dateBuyAmount*dateSellAmount")}),i.default.createElement(o.Geom,{type:"line",position:"date*profitRate",size:2,color:l.COLOR_PLATE_16[2],tooltip:this.getTooltipFormat("profitRate*profit")}),i.default.createElement(o.Geom,{type:"line",position:"date*totalProfitRate",size:2,color:l.COLOR_PLATE_16[3],tooltip:this.getTooltipFormat("totalProfitRate*accumulatedProfit")}),i.default.createElement(o.Geom,{type:"point",position:"".concat(c,"*").concat(d),size:4,shape:"circle",color:["txnType",t=>{return p[t]}],opacity:["dateBuyAmount*dateSellAmount",function(){var t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1];return 0===t&&0===e?0:1}],tooltip:this.getTooltipFormat(d+"*dateBuyAmount"),style:{lineWidth:2,stroke:"#fff"}})))}}e.FundValChart=s},"2dk7":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_COLOR="#1890FF",e.COLOR_PLATE_8=["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],e.COLOR_NAME={red:e.COLOR_PLATE_8[7],yellow:e.COLOR_PLATE_8[2],green:e.COLOR_PLATE_8[1],blue:e.COLOR_PLATE_8[0],purple:"#985ae1"},e.COLOR_PLATE_16=["#1890FF","#41D9C7","#2FC25B","#FACC14","#E6965C","#223273","#7564CC","#8543E0","#5C8EE6","#13C2C2","#5CA3E6","#3436C7","#B381E6","#F04864","#D598D9"],e.COLOR_PLATE_24=["#1890FF","#66B5FF","#41D9C7","#2FC25B","#6EDB8F","#9AE65C","#FACC14","#E6965C","#57AD71","#223273","#738AE6","#7564CC","#8543E0","#A877ED","#5C8EE6","#13C2C2","#70E0E0","#5CA3E6","#3436C7","#8082FF","#DD81E6","#F04864","#FA7D92","#D598D9"],e.COLOR_PIE=["#1890FF","#13C2C2","#2FC25B","#FACC14","#F04864","#8543E0","#3436C7","#223273"],e.COLOR_PIE_16=["#1890FF","#73C9E6","#13C2C2","#6CD9B3","#2FC25B","#9DD96C","#FACC14","#E6965C","#F04864","#D66BCA","#8543E0","#8E77ED","#3436C7","#737EE6","#223273","#7EA2E6"]},"6N5B":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=r("q1tI"),o=r("yP6+"),i=n.__importDefault(r("q1tI"));class l extends a.Component{getTooltipFormat(t){var e=this.props.formatVal,r=this.props.textMap[this.props.y];return[t,(t,n)=>({name:(n||"")+"(".concat(r,")"),value:e?e(t):t})]}render(){var t=this.props,e=t.title,r=t.subTitle,n=t.y,a=t.data,l=t.textMap,u=t.commonProp,s=t.legendProp,c=u.chart;return i.default.createElement("div",null,i.default.createElement("h1",{className:"main-title"},e||l[n]),r?i.default.createElement("h2",{className:"sub-title"},r):"",i.default.createElement(o.Chart,Object.assign({data:a},c,{scale:{date:{type:"timeCat"}}}),i.default.createElement(o.Legend,Object.assign({},s||{})),i.default.createElement(o.Axis,{name:"date"}),i.default.createElement(o.Tooltip,{crosshairs:{type:"y"}}),i.default.createElement(o.Geom,{type:"line",position:"date*"+n,size:2,color:"name",tooltip:this.getTooltipFormat("".concat(n,"*name"))})))}}e.CommonFundLine=l},"7CHm":function(t,e,r){"use strict";var n=r("p0pE"),a=r("qIgq"),o=r("1l/V");function i(){i=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),l=new L(n||[]);return a(i,"_invoke",{value:S(t,r,l)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",m="suspendedYield",p="executing",y="completed",v={};function g(){}function w(){}function x(){}var E={};c(E,l,function(){return this});var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==r&&n.call(_,l)&&(E=_);var j=x.prototype=g.prototype=Object.create(E);function F(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(a,o,i,l){var u=f(t[a],t,o);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,i,l)},function(t){r("throw",t,i,l)}):e.resolve(c).then(function(t){s.value=t,i(s)},function(t){return r("throw",t,i,l)})}l(u.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e(function(e,a){r(t,n,e,a)})}return o=o?o.then(a,a):a()}})}function S(e,r,n){var a=h;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=O(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var s=f(e,r,n);if("normal"===s.type){if(a=n.done?y:m,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=y,n.method="throw",n.arg=s.arg)}}}function O(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=x,a(j,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},F(P.prototype),c(P.prototype,u,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new P(d(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},F(j),c(j,s,"Generator"),c(j,l,function(){return this}),c(j,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return l.type="throw",l.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}Object.defineProperty(e,"__esModule",{value:!0});var l=r("SLhE"),u=window["getJSONP"];e.getFundData=function(){var t=o(i().mark(function t(e,r){var n,a;return i().wrap(function(t){while(1)switch(t.prev=t.next){case 0:return 1,"","",Array.isArray(r)?(n=(new Date(r[1]).getTime()-new Date(r[0]).getTime())/1e3/60/60/24,l.dateFormat(new Date(r[0])),l.dateFormat(new Date(r[1]))):n=r,a="https://fund.eastmoney.com/pingzhongdata/".concat(e,".js?v=").concat(l.dateFormat(new Date,"yyyyMMddHHmmss")),t.abrupt("return",new Promise(t=>{u(a,t=>{},{onload:()=>{var e=window["Data_netWorthTrend"]||[];if(0===e.length)throw console.error("\u67e5\u8be2\u57fa\u91d1\u51c0\u503c\u5931\u8d25",e),new Error("\u67e5\u8be2\u57fa\u91d1\u51c0\u503c\u5931\u8d25");console.log("hislen",e.length),e=e.slice(-n),console.log("historyVal ",e);var r=e.reverse().reduce((t,e)=>{var r={date:l.dateFormat(e.x,"yyyy-MM-dd"),val:e.y,bonus:e.unitMoney};if(t.all[r.date]=r,r.bonus){var n=r.bonus.toString().match(/\d+.?\d+/);r.bonus=n?Number(n[0]):0,t.bonus[r.date]=r,e.unitMoney.startsWith("\u62c6\u5206")&&(r.isBonusPortion=!0)}return r,t},{bonus:{},all:{}});console.log("formatResult",r),t(r)}})}));case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}(),function(t){t["ShangZheng"]="1.000001"}(e.IndexFund||(e.IndexFund={}));var s=(t,e,r)=>{var n=r.previousDate,a=r.curDate;if(!n)return r.data[a].val;var o=9===e?"dea":"ema".concat(e),i=Number(r.data[n][o]);return(2*t+(e-1)*i)/(e+1)},c=t=>{var e=[];t.reduce((t,r)=>{var n=t.macd*r.macd;return 0===t.macd?(e.push([r]),r):(n<0?e.push([r]):e[e.length-1].push(r),r)}),t[0].macdPosition=0,e.forEach(t=>{var e=Math.max(...t.map(t=>Math.abs(t.macd)));t.forEach(t=>{var r=Math.abs(t.macd)/e;t.macdPosition=l.roundToFix(r)})})};e.calcMACD=(t=>{var e=Object.values(t);return e.forEach((r,n)=>{var a=r;if(!a.ema12&&0!==a.ema12){var o=e[n-1]?e[n-1].date:void 0;a.ema12=s(a.val,12,{previousDate:o,curDate:a.date,data:t}),a.ema26=s(a.val,26,{previousDate:o,curDate:a.date,data:t}),a.diff=a.ema12-a.ema26,a.dea=o?s(a.diff,9,{previousDate:o,curDate:a.date,data:t}):0,a.macd=2*(a.diff-a.dea)}}),c(e),t}),e.txnByMacd=((t,e,r)=>{t[0].index=0;var n=[[t[0]]];t.reduce((t,e,r)=>{e.index=r;var a=t.macd*e.macd;return a<0?n.push([e]):n[n.length-1].push(e),e}),n.forEach(n=>{var a=n[0].macd>0;if((!a||e)&&(a||r)){var o=n.reduce((t,n)=>{var o=t[t.length-1],i=Math.abs(n.macd);return i>=o.maxVal&&(-1!==o.threshold?t.push({maxVal:i,threshold:-1}):o.maxVal=i),a&&i<=o.maxVal*e&&-1===o.threshold&&(o.threshold=n.index),!a&&i<=o.maxVal*r&&-1===o.threshold&&(o.threshold=n.index),t},[{maxVal:0,threshold:-1}]),i=o[o.length-1];-1===i.threshold&&(i.threshold=n[n.length-1].index+1),console.log("\u4e34\u754c\u70b9",o),o.forEach(e=>{var r=e.threshold;t[r]&&(t[r].txnType=a?"sell":"buy")})}})}),e.getIndexFundData=function(){var t=o(i().mark(function t(r){var o,s,c,d,f,h,m,p,y;return i().wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(o=r.range.map(t=>l.dateFormat(t)),s=a(o,2),c=s[0],d=s[1],f=JSON.parse(localStorage.getItem(r.code)||"{}"),h=Object.keys(f),m=[h[0],h[h.length-1]],p=m[0],y=m[1],0!==h.length){t.next=9;break}c="19900101",d=l.dateFormat(Date.now()),t.next=15;break;case 9:if(!(new Date(r.range[0])>=new Date(p)&&new Date(r.range[1])<=new Date(y))){t.next=13;break}return t.abrupt("return",f);case 13:new Date(r.range[0])>=new Date(p)&&(c=y),new Date(r.range[1])<=new Date(y)&&(d=p);case 15:return t.abrupt("return",new Promise(t=>{u("//60.push2his.eastmoney.com/api/qt/stock/kline/get?secid=".concat(r.code,"&fields1=f1,f2,f3,f4,f5&fields2=f51,f52,f53,f54,f55,f56,f57&klt=101&fqt=0&beg=").concat(c.replace(/-/g,""),"&end=").concat(d.replace(/-/g,""),"&ut=fa5fd1943c7b386f172d6893dbfba10b"),o=>{console.log("\u6307\u6570\u57fa\u91d1 \u54cd\u5e94",o.data.klines);var i=o.data.klines,u=i.reduce((t,e)=>{var r=e.split(","),n=a(r,3),o=n[0],i=n[2];return t[o]={date:o,val:i},t},{}),s=n({},f,u),c=Object.keys(s).sort((t,e)=>new Date(t).getTime()-new Date(e).getTime());s=c.reduce((t,e)=>{return t[e]=s[e],t},{}),console.log("sorted date",s),e.calcMACD(s),localStorage.setItem(r.code,JSON.stringify(s));var d={},h=new Date(r.range[0]).getTime()-864e6;for(var m in s)m>=l.dateFormat(h)&&m<=l.dateFormat(r.range[1])&&(d[m]=s[m]);t(d)})}));case 16:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.searchIndex=function(){var t=o(i().mark(function t(e){return i().wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(t=>{var r="//searchapi.eastmoney.com/api/suggest/get?input=".concat(e,"&type=14&token=D43BF722C8E33BDC906FB84D85E326E8&markettype=&mktnum=&jys=&classify=&securitytype=&count=5&_=").concat(Date.now());u(r,e=>{var r=e.QuotationCodeTable.Data||[];r=r.filter(t=>"Index"===t.Classify);var n=r.map(t=>{return{code:t.Code,name:t.Name,id:t.QuoteID}});t(n)})}));case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),e.getFundInfo=function(){var t=o(i().mark(function t(e){return i().wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(t=>{var r="https://fundsuggest.eastmoney.com/FundSearch/api/FundSearchAPI.ashx?m=10&t=700&IsNeedBaseInfo=0&IsNeedZTInfo=0&key=".concat(e,"&_=").concat(Date.now());u(r,e=>{var r=e.Datas.map(t=>{return{code:t.CODE,name:t.NAME}});t(r)})}));case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()},"7R38":function(t,e,r){"use strict";var n=r("1l/V");function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:S(t,r,l)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",m="suspendedYield",p="executing",y="completed",v={};function g(){}function w(){}function x(){}var E={};c(E,l,function(){return this});var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==r&&n.call(_,l)&&(E=_);var j=x.prototype=g.prototype=Object.create(E);function F(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(a,o,i,l){var u=f(t[a],t,o);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,i,l)},function(t){r("throw",t,i,l)}):e.resolve(c).then(function(t){s.value=t,i(s)},function(t){return r("throw",t,i,l)})}l(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,a){r(t,n,e,a)})}return a=a?a.then(o,o):o()}})}function S(e,r,n){var a=h;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=O(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var s=f(e,r,n);if("normal"===s.type){if(a=n.done?y:m,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=y,n.method="throw",n.arg=s.arg)}}}function O(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=x,o(j,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},F(P.prototype),c(P.prototype,u,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new P(d(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},F(j),c(j,s,"Generator"),c(j,l,function(){return this}),c(j,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return l.type="throw",l.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}Object.defineProperty(e,"__esModule",{value:!0});var o=r("mrSG"),i=o.__importStar(r("q1tI")),l=o.__importDefault(r("qu0K")),u=o.__importDefault(r("PArb")),s=o.__importDefault(r("fyUT")),c=o.__importDefault(r("Sdc0")),d=o.__importDefault(r("2fM7")),f=o.__importDefault(r("BMrR")),h=o.__importDefault(r("kPKH")),m=r("7CHm"),p=o.__importDefault(r("DzJC")),y=d.default.Option;class v extends i.Component{constructor(){var t;super(...arguments),t=this,this.state={searchIndexData:[]},this.handleSearchIndex=p.default(function(){var e=n(a().mark(function e(r){var n;return a().wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!r){e.next=7;break}return e.next=3,m.searchIndex(r);case 3:n=e.sent,t.setState({searchIndexData:n}),e.next=8;break;case 7:t.setState({searchIndexData:[]});case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),1e3)}render(){var t=this.state.searchIndexData,e={style:{width:500},labelCol:{xs:{span:24},sm:{span:8}},wrapperCol:{xs:{span:24},sm:{span:16}}},r=this.props.form,n=r.getFieldDecorator,a=r.getFieldsValue,o=a(),m="fundPercent"===o.sellUnit?100:void 0;return i.default.createElement("section",null,i.default.createElement(u.default,{orientation:"left"},"\u6b62\u76c8\u7b56\u7565 "),i.default.createElement(l.default.Item,Object.assign({},e,{label:"\u4e0a\u8bc1\u6307\u6570\u5927\u4e8e"}),n("shCompositeIndex",{initialValue:3e3})(i.default.createElement(s.default,{style:{width:"100%"},min:0,placeholder:"\u5927\u4e8e\u4e0a\u8bc1\u6307\u6570\u7684\u70b9\uff0c\u5219\u5f00\u59cb\u8fdb\u884c\u6b62\u76c8"}))),i.default.createElement(l.default.Item,Object.assign({},e,{label:"\u6301\u6709\u4ed3\u4f4d\u5927\u4e8e"}),n("fundPosition",{initialValue:70})(i.default.createElement(s.default,{style:{width:"100%"},formatter:t=>"".concat(t,"%"),parser:t=>t?t.replace("%",""):"",min:0,max:100,placeholder:"\u6301\u4ed3\u5927\u4e8e\u591a\u5c11\u65f6\u5f00\u59cb\u6b62\u76c8"}))),i.default.createElement(l.default.Item,Object.assign({},e,{label:"\u6301\u6709\u6536\u76ca\u7387\u5927\u4e8e"}),n("profitRate",{initialValue:5})(i.default.createElement(s.default,{style:{width:"100%"},formatter:t=>"".concat(t,"%"),parser:t=>t?t.replace("%",""):"",min:0,placeholder:"\u5f00\u59cb\u6b62\u76c8\u7684\u6301\u6709\u6536\u76ca\u7387\u6700\u5c0f\u503c"}))),i.default.createElement(l.default.Item,Object.assign({},e,{label:"\u662f\u5426\u6536\u76ca\u65b0\u9ad8"}),n("sellAtTop",{initialValue:!0,valuePropName:"checked"})(i.default.createElement(c.default,{checkedChildren:"\u662f",unCheckedChildren:"\u5426"}))),i.default.createElement(l.default.Item,Object.assign({},e,{label:"\u5356\u51fa\u91d1\u989d"}),i.default.createElement(f.default,null,i.default.createElement(h.default,{span:12},n("sellNum",{initialValue:10})(i.default.createElement(s.default,{style:{width:"100%"},min:0,max:m,placeholder:"\u6b62\u76c8\u65f6\u5356\u51fa\u591a\u5c11"}))),i.default.createElement(h.default,{span:12},i.default.createElement(l.default.Item,{style:{marginBottom:"unset"}},n("sellUnit",{initialValue:"fundPercent"})(i.default.createElement(d.default,null,i.default.createElement(y,{value:"amount"},"\u5143"),i.default.createElement(y,{value:"fundPercent"},"% \u6301\u6709\u4efd\u989d"))))))),i.default.createElement(l.default.Item,Object.assign({},e,{label:"\u6307\u6570\u7f16\u53f7/\u540d\u79f0"}),n("referIndex",{initialValue:"1.000001"})(i.default.createElement(d.default,{showSearch:!0,placeholder:"\u8f93\u5165\u6307\u6570\u540d\u79f0\u6216\u7f16\u53f7",defaultActiveFirstOption:!1,showArrow:!1,filterOption:!1,onSearch:this.handleSearchIndex,notFoundContent:null},t.map((t,e)=>i.default.createElement(y,{key:t.id},t.name,"[",t.code,"]"))))),i.default.createElement(l.default.Item,Object.assign({},e,{label:"\u5356\u51fa MACD \u4e34\u754c\u70b9"}),n("sellMacdPoint",{})(i.default.createElement(s.default,{style:{width:"100%"},formatter:t=>"".concat(t,"%"),parser:t=>(t||"").replace("%",""),min:0,max:100,placeholder:"macd \u6b62\u76c8\u70b9"}))))}}e.StopProfitForm=v},"9dBp":function(t,e,r){"use strict";var n=r("p0pE");Object.defineProperty(e,"__esModule",{value:!0});var a=r("mrSG"),o=a.__importStar(r("q1tI")),i=r("yP6+"),l=r("2dk7"),u=r("SLhE"),s=a.__importDefault(r("1Gbu")),c=a.__importDefault(r("cQSq")),d=31536e6;class f extends o.Component{constructor(){super(...arguments),this.ds=new c.default({state:{start:u.dateFormat(Date.now()-31536e6),end:u.dateFormat(Date.now())}}),this.sliderTimeChange=(t=>{var e=t.startText,r=t.endText;this.ds.setState("start",e),this.ds.setState("end",r)})}getDataList(){var t=this.props.data,e=0,r=0;return t.forEach(t=>{t.val=Number(t.val),t.macd=u.roundToFix(t.macd,2),t.diff=u.roundToFix(t.diff,2),t.dea=u.roundToFix(t.dea,2);var n=[Math.min(t.macd,t.diff,t.dea),Math.max(t.macd,t.diff,t.dea)],a=n[0],o=n[1];e=e<a?e:a,r=r>o?r:o}),{result:t,min:e,max:r}}render(){var t=this.props,e=t.textMap,r=t.commonProp;t.title;e=n({},e,{val:"\u6307\u6570"});var a=n({},r.chart,{height:500}),c=this.getDataList(),f=c.result,h=c.min,m=c.max;console.log("macd line",f);var p={min:h,max:m},y={date:{type:"timeCat"},macd:p,diff:p,dea:p,val:{alias:"\u6307\u6570\u503c"}},v=this.ds,g=u.dateFormat(new Date(f[f.length-1].date).getTime()-d);this.sliderTimeChange({startText:f[0].date>g?f[0].date:g,endText:f[f.length-1].date});var w=v.createView();return w.source(f).transform({type:"filter",callback:t=>{var e=t.date;return e<=v.state.end&&e>=v.state.start}}),o.default.createElement("div",null,o.default.createElement("h1",{className:"main-title"},"\u53c2\u8003\u6307\u6570\u66f2\u7ebf\u4e0e MACD \u8d8b\u52bf\u56fe"),o.default.createElement(i.Chart,Object.assign({data:w,scale:y},a),o.default.createElement(i.Axis,{name:"date"}),o.default.createElement(i.Axis,{name:"macd"}),o.default.createElement(i.Axis,{name:"diff",visible:!1}),o.default.createElement(i.Axis,{name:"dea",visible:!1}),o.default.createElement(i.Tooltip,null),o.default.createElement(i.Geom,{type:"line",position:"date*val",color:l.COLOR_NAME.purple,size:2}),o.default.createElement(i.Geom,{type:"interval",color:["macd",t=>{return t>0?l.COLOR_NAME.red:l.COLOR_NAME.green}],position:"date*macd"})),o.default.createElement("div",null,o.default.createElement(s.default,{padding:[20,40,20,40],width:"auto",height:26,start:v.state.start,end:v.state.end,xAxis:"date",yAxis:"macd",scales:{time:{type:"timeCat",nice:!1}},data:f,onChange:this.sliderTimeChange})))}}e.default=f},Cvqf:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=r("q1tI"),o=r("yP6+"),i=n.__importDefault(r("q1tI")),l=r("2dk7");class u extends a.Component{getTooltipFormat(t){return[t,e=>({name:this.props.textMap[t],value:e})]}render(){var t=this.props,e=t.data,r=t.textMap,n=t.commonProp,a=n.chart;return i.default.createElement("div",null,i.default.createElement("h1",{className:"main-title"},"\u7d2f\u8ba1\u6536\u76ca\u8d8b\u52bf\u56fe"),i.default.createElement(o.Chart,Object.assign({data:e},a),i.default.createElement(o.Legend,{itemFormatter:t=>{return r[t]}}),i.default.createElement(o.Axis,{name:"date"}),i.default.createElement(o.Axis,{name:"profitRate"}),i.default.createElement(o.Axis,{name:"profit"}),i.default.createElement(o.Tooltip,{crosshairs:{type:"y"}}),i.default.createElement(o.Geom,{type:"line",position:"date*accumulatedProfit",size:2,color:l.COLOR_PLATE_16[5],tooltip:this.getTooltipFormat("accumulatedProfit")})))}}e.RateChart=u},EDuE:function(t,e,r){t.exports={normal:"normal___HWRKS",welcome:"welcome___Hx9vE",list:"list___1QtXr",inline:"inline___3QxFT","inline-select":"inline-select___1bEMK",hint:"hint___jhb3q"}},EtUQ:function(t,e,r){"use strict";var n=r("qIgq");Object.defineProperty(e,"__esModule",{value:!0});var a=r("mrSG"),o=a.__importStar(r("q1tI")),i=a.__importDefault(r("Vl3Y")),l=a.__importDefault(r("bx4M")),u=a.__importDefault(r("kaz8")),s=a.__importDefault(r("+eQT")),c=a.__importDefault(r("2/Rp")),d=r("YTim"),f=a.__importDefault(r("wd/R")),h=r("SLhE"),m=r("sn++"),p=s.default.RangePicker,y=h.dateFormat(new Date).split("-").map(Number),v=n(y,3),g=v[0],w=v[1],x=v[2];w=Number(w)-1;var E=["totalAmount","leftAmount","profitRate","profit","fundAmount","fundGrowthRate","maxPrincipal","accumulatedProfit","totalProfitRate","position"],b={labelCol:{xs:{span:24},sm:{span:4}},wrapperCol:{xs:{span:24},sm:{span:20}}};class _ extends o.Component{constructor(){super(...arguments),this.handleSubmit=(t=>{t.preventDefault(),this.props.form.validateFields((t,e)=>{t||(console.log("compare\u8868\u5355",e),this.props.onSearch(e))})})}render(){var t=this.props.form.getFieldDecorator,e={rules:[{type:"array",required:!0,message:"\u8bf7\u9009\u62e9\u65f6\u95f4\u8303\u56f4"}],initialValue:[f.default([Number(g)-1,w,x]),f.default([g,w,x])]};return o.default.createElement(l.default,{title:"\u57fa\u91d1\u7b56\u7565\u6bd4\u8f83",style:{textAlign:"initial",margin:"20px 0"}},o.default.createElement(i.default,{onSubmit:this.handleSubmit},o.default.createElement(i.default.Item,Object.assign({},b,{label:"\u5df2\u6709\u57fa\u91d1\u7b56\u7565"}),t("stragegyChecked",{rules:[{required:!0,message:"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u57fa\u91d1\u7b56\u7565"}]})(o.default.createElement(u.default.Group,{style:{width:"100%"}},Object.keys(d.allSavedCondition).map((t,e)=>o.default.createElement(u.default,{key:e,value:t},t))))),o.default.createElement(i.default.Item,Object.assign({},b,{label:"\u5bf9\u6bd4\u7684\u6570\u636e"}),t("chartChecked",{initialValue:["totalAmount","accumulatedProfit","totalProfitRate","position"],rules:[{required:!0,message:"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u6570\u636e"}]})(o.default.createElement(u.default.Group,{style:{width:"100%"}},E.map((t,e)=>o.default.createElement(u.default,{key:e,value:t},m.keyTextMap[t]))))),o.default.createElement(i.default.Item,Object.assign({},b,{label:"\u65f6\u95f4\u8303\u56f4"}),t("dateRange",e)(o.default.createElement(p,{placeholder:["\u5f00\u59cb\u65f6\u95f4","\u7ed3\u675f\u65f6\u95f4"],ranges:{"\u6700\u8fd1\u4e00\u5e74":[f.default([Number(g)-1,w,x]),f.default([g,w,x])],"\u6700\u8fd1\u4e24\u5e74":[f.default([Number(g)-2,w,x]),f.default([g,w,x])],"\u6700\u8fd1\u4e09\u5e74":[f.default([Number(g)-3,w,x]),f.default([g,w,x])],"\u6700\u8fd1\u4e94\u5e74":[f.default([Number(g)-5,w,x]),f.default([g,w,x])]},disabledDate:h.disabledFuture}))),o.default.createElement(i.default.Item,{wrapperCol:{offset:4}},o.default.createElement(c.default,{type:"primary",htmlType:"submit"},"\u6bd4\u8f83\u7b56\u7565"))))}}e.CompareForm=_,e.CompareSearchForm=i.default.create({name:"compare-search"})(_)},I4l8:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("SLhE"),a=864e5;class o{constructor(t){this.buyFeeRate=.0015,this.sellFeeRate=.005,this.data=[],this.dataMap={},Object.assign(this,t)}get annualizedRate(){var t=this.data.length;if(t>0){var e=this.data[0],r=this.data[t-1],o=new Date(r.date).getTime()-new Date(e.date).getTime(),i=o/a/365;return{fundGrowth:n.roundToFix(Math.pow(1+r.fundGrowthRate,1/i)-1,4),totalProfit:n.roundToFix(Math.pow(1+r.totalProfitRate,1/i)-1,4)}}return{fundGrowth:0,totalProfit:0}}shouldFixedInvest(t,e){var r=new Date(e);return"monthly"===t.period?r.getDate()===t.dateOrWeek:"weekly"===t.period&&r.getDay()===t.dateOrWeek}fixedInvest(t){var e=t.range,r=t.fixedInvestment;this.fixedConfig=t;var n=new Date(e[0]).getTime(),a=new Date(e[1]).getTime();if(n>a)throw new Error("range[1] should not less than range[0]");var o=n;while(o<=a)this.shouldFixedInvest(r,o)?this.buy(r.amount,o):this.buy(0,o),this.onEachDay(o),o+=864e5;return this}getSnapshotInstance(t){return this.dataMap[t]?this.dataMap[t]:new i({fundStrategy:this,date:t})}pushData(t){this.data.push(t),this.dataMap[t.date]||(this.dataMap[t.date]=t)}buy(t,e){var r=n.dateFormat(e),o=new Date(e).getTime();if(this.latestInvestment){var i=new Date(this.latestInvestment.date).getTime();i+=a;while(o>i){var l=this.getSnapshotInstance(i).buy(0);this.pushData(l),i+=a}}var u=this.getSnapshotInstance(r).buy(t);return this.pushData(u),this}sell(t,e){var r=n.dateFormat(e),o=new Date(e).getTime();if(this.latestInvestment){var i=new Date(this.latestInvestment.date).getTime();i+=a;while(o>i){var l=this.getSnapshotInstance(i).sell({amount:0});this.pushData(l),i+=a}}var u=this.getSnapshotInstance(r);return"all"===t?u.sell("all"):u.sell({amount:t}),this.pushData(u),this}getFundByDate(t,e){var r=this.fundJson.all;e&&e.origin&&(r=e.origin);var a=r[t];if(a)return a;var o=n.dateFormat(new Date(t).getTime()-864e5);return this.getFundByDate(o,e)}}e.InvestmentStrategy=o;class i{constructor(t){this.curBonus=[],this.dateBuyAmount=0,this.dateSellAmount=0,this.date=t.date?n.dateFormat(t.date):n.dateFormat(Date.now()),this.fundStrategy=t.fundStrategy;try{this.curFund=this.fundStrategy.getFundByDate(this.date)}catch(t){throw new RangeError("\u6240\u9009\u65f6\u95f4\u8d85\u51fa\u57fa\u91d1\u8fd0\u8425\u8303\u56f4")}if(this.fundStrategy.latestInvestment){var e=this.fundStrategy.latestInvestment;this.portion=e.portion,this.cost=e.cost,this.leftAmount=e.leftAmount,this.totalBuyAmount=e.totalBuyAmount,this.totalSellAmount=e.totalSellAmount,this.maxPrincipal=e.maxPrincipal,this.curBonus=this.getBonusBetween(this.fundStrategy.data[0].date,this.date)}else this.portion=0,this.cost=0,this.totalBuyAmount=0,this.totalSellAmount=0,this.leftAmount=this.fundStrategy.totalAmount,this.maxPrincipal=0;this.operate(),this.calcMaxAccumulatedProfit()}get costAmount(){return n.roundToFix(this.cost*this.portion,2)}get fundAmount(){return n.roundToFix(this.curFund.val*this.portion,2)}get profit(){return n.roundToFix((this.curFund.val-this.cost)*this.portion,2)}get profitRate(){return 0===this.costAmount?0:n.roundToFix(this.curFund.val/this.cost-1,4)}get totalProfitRate(){return 0===this.maxPrincipal?0:n.roundToFix(this.accumulatedProfit/this.maxPrincipal,4)}get totalAmount(){return n.roundToFix(this.leftAmount+this.fundAmount,2)}get accumulatedProfit(){return n.roundToFix(this.fundAmount-this.totalBuyAmount+this.totalSellAmount,2)}getBonusBetween(t,e){var r=new Date(t).getTime(),n=new Date(e).getTime(),a=this.fundStrategy.fundJson.bonus,o=Object.values(a).reduce((t,e)=>{var a=new Date(e.date).getTime();return a>=r&&a<=n&&t.push(e),t},[]);return o}get isBonus(){return Boolean(this.fundStrategy.fundJson.bonus[this.date])}get fundGrowthRate(){if(this.fundStrategy.data[0]){var t=this.curBonus,e=this.fundStrategy.data[0].curFund.val;if(0===t.length)return n.roundToFix((this.curFund.val-e)/e,4);var r=t.reduce((t,e)=>{return e.isBonusPortion?t*e.bonus:t*(Number(e.val)+Number(e.bonus))/e.val},this.curFund.val/e)-1;return n.roundToFix(r,4)}return 0}calcMaxAccumulatedProfit(){var t={date:this.date,amount:this.accumulatedProfit},e=this.fundStrategy.data[this.fundStrategy.data.length-1];e&&e.maxAccumulatedProfit?this.maxAccumulatedProfit=e.maxAccumulatedProfit.amount>t.amount?e.maxAccumulatedProfit:t:this.maxAccumulatedProfit=t}operate(){this.income(),this.isBonus&&(this.curFund.isBonusPortion?(this.cost=this.cost/this.curFund.bonus,this.portion=this.portion*this.curFund.bonus):(this.cost=this.cost*this.curFund.val/(Number(this.curFund.val)+Number(this.curFund.bonus)),this.portion=this.portion*(Number(this.curFund.val)+Number(this.curFund.bonus))/this.curFund.val)),this.fundStrategy.latestInvestment=this}calcMaxPrincipal(){this.maxPrincipal<this.costAmount&&(this.maxPrincipal=this.costAmount)}income(){var t=1;new Date(this.date).getDate()===t&&(this.leftAmount+=this.fundStrategy.salary)}fulfillBuyTxn(t){return t.val=t.val||this.curFund.val,isNaN(t.amount)||t.portion||(t.amount=n.roundToFix(t.amount/(1+this.fundStrategy.buyFeeRate),2),t.portion=n.roundToFix(t.amount/t.val,2)),t}fulfillSellTxn(t){var e;if(t.val=t.val||this.curFund.val,!t.amount&&0!==t.amount||t.portion){if(!isNaN(t.amount)||!t.portion)throw new Error("txn.portion \u548c txn.amount \u5fc5\u987b\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u503c");e=t.portion}else e=n.roundToFix(t.amount/t.val,2);return t.portion=e,t.amount=t.val*e*(1-this.fundStrategy.sellFeeRate),t}buy(t){if(this.isBonus)return this;if(t<=0)return this;this.totalBuyAmount+=t,this.dateBuyAmount+=t;var e=this.fulfillBuyTxn({amount:t}),r=this.costAmount;return this.portion=this.portion+e.portion,this.cost=n.roundToFix((r+t)/this.portion,4),this.leftAmount=n.roundToFix(this.leftAmount-t,2),this.calcMaxPrincipal(),this}sell(t){if(this.isBonus)return this;if("all"===t&&(t={portion:this.portion}),t&&(t.amount<=0||t.portion<=0))return this;var e=this.fulfillSellTxn(t);return this.portion-e.portion<0&&console.error("\u5356\u51fa\u4efd\u989d\u4e0d\u80fd\u6bd4\u6301\u6709\u4efd\u989d\u9ad8, \u8df3\u8fc7\u672c\u6b21\u5356\u51fa"),this.portion=this.portion-e.portion,this.leftAmount=n.roundToFix(this.leftAmount+e.amount,2),this.totalSellAmount=n.roundToFix(this.totalSellAmount+e.amount,2),this.dateSellAmount=n.roundToFix(this.dateSellAmount+e.amount,2),this}}e.InvestDateSnapshot=i},Pdyw:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=n.__importStar(r("q1tI")),o=r("6N5B"),i=r("sn++"),l=r("SLhE"),u=r("QxXQ"),s={chart:{forceFit:!0,height:450,padding:[20,80,100,80]}},c=["fundGrowthRate","profitRate","totalProfitRate","position"];class d extends a.Component{render(){var t=this.props.data;if(!t||0===t.length)return null;var e=t.map(t=>{var e=0,r=t.data.reduce((t,r)=>{var n=r.position;return e=n>e?n:e,t+n},0)/t.data.length,n=t.data[t.data.length-1].totalProfitRate/r,a=t.data[t.data.length-1].accumulatedProfit/e;return{name:t.name,avgPos:l.roundToFix(100*r),maxPos:l.roundToFix(100*e),profitPerInvest:l.roundToFix(n),profitAmountPerPos:l.roundToFix(a)}}),r=t.reduce((t,e)=>{return[...t,...e.data]},[]),n=this.props.chartList;return console.log("allData",r),a.default.createElement("div",null,n.map((t,e)=>{var n={y:t,data:r,textMap:i.keyTextMap,commonProp:s,formatVal:c.includes(t)?l.formatPercentVal:void 0};return a.default.createElement(o.CommonFundLine,Object.assign({key:e},n))}),a.default.createElement(u.ComparePosition,{commonProp:s,textMap:i.keyTextMap,data:e}))}}e.CompareChart=d},PmdP:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=r("q1tI"),o=r("yP6+"),i=n.__importDefault(r("q1tI")),l=r("2dk7");class u extends a.Component{getTooltipFormat(t){return[t,e=>({name:this.props.textMap[t],value:e})]}get scale(){var t=this.props.data.reduce((t,e)=>{return t.push(e.totalAmount,e.leftAmount,e.fundAmount),t},[]),e={min:Math.min(...t),max:Math.max(...t)};return{totalAmount:e,leftAmount:e,fundAmount:e}}render(){var t=this.props,e=t.data,r=t.textMap,n=t.commonProp,a=n.chart,u=this.scale;return i.default.createElement("div",null,i.default.createElement("h1",{className:"main-title"},"\u8d44\u4ea7\u589e\u957f\u8d8b\u52bf\u56fe"),i.default.createElement(o.Chart,Object.assign({data:e,scale:u},a),i.default.createElement(o.Legend,{itemFormatter:t=>{return r[t]}}),i.default.createElement(o.Axis,{name:"date"}),i.default.createElement(o.Axis,{name:"totalAmount"}),i.default.createElement(o.Axis,{name:"leftAmount",visible:!1}),i.default.createElement(o.Axis,{name:"fundAmount",visible:!1}),i.default.createElement(o.Tooltip,{crosshairs:{type:"y"}}),i.default.createElement(o.Geom,{type:"line",position:"date*totalAmount",size:2,color:l.COLOR_PLATE_8[0],tooltip:this.getTooltipFormat("totalAmount")}),i.default.createElement(o.Geom,{type:"line",position:"date*leftAmount",size:2,color:l.COLOR_PLATE_8[1],tooltip:this.getTooltipFormat("leftAmount")}),i.default.createElement(o.Geom,{type:"line",position:"date*fundAmount",size:2,color:l.COLOR_PLATE_8[7],tooltip:this.getTooltipFormat("fundAmount")})))}}e.TotalAmountChart=u},QeBL:function(t,e,r){"use strict";var n=r("qIgq"),a=r("1l/V");function o(){o=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),l=new L(n||[]);return a(i,"_invoke",{value:S(t,r,l)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",m="suspendedYield",p="executing",y="completed",v={};function g(){}function w(){}function x(){}var E={};c(E,l,function(){return this});var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==r&&n.call(_,l)&&(E=_);var j=x.prototype=g.prototype=Object.create(E);function F(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(a,o,i,l){var u=f(t[a],t,o);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,i,l)},function(t){r("throw",t,i,l)}):e.resolve(c).then(function(t){s.value=t,i(s)},function(t){return r("throw",t,i,l)})}l(u.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e(function(e,a){r(t,n,e,a)})}return o=o?o.then(a,a):a()}})}function S(e,r,n){var a=h;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=O(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var s=f(e,r,n);if("normal"===s.type){if(a=n.done?y:m,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=y,n.method="throw",n.arg=s.arg)}}}function O(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=x,a(j,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},F(P.prototype),c(P.prototype,u,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new P(d(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},F(j),c(j,s,"Generator"),c(j,l,function(){return this}),c(j,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return l.type="throw",l.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}Object.defineProperty(e,"__esModule",{value:!0});var i=r("mrSG"),l=i.__importStar(r("q1tI")),u=i.__importDefault(r("EDuE")),s=r("sn++"),c=r("hQqI");r("TpwP");var d=r("7CHm"),f=r("I4l8"),h=i.__importDefault(r("TeRw")),m=i.__importDefault(r("wd/R")),p=r("SLhE");class y extends l.Component{constructor(){var t;super(...arguments),t=this,this.state={fundData:[]},this.getFundData=function(){var e=a(o().mark(function e(r){var a,i,l,u,s,c;return o().wrap(function(e){while(1)switch(e.prev=e.next){case 0:return console.log("\u57fa\u91d1\u8868\u5355\u53c2\u6570",r),r.referIndex=r.referIndex||d.IndexFund.ShangZheng,e.next=4,Promise.all([d.getFundData(r.fundId,r.dateRange),d.getIndexFundData({code:d.IndexFund.ShangZheng,range:r.dateRange}),r.referIndex?d.getIndexFundData({code:r.referIndex,range:r.dateRange}):Promise.resolve(null)]);case 4:return a=e.sent,i=n(a,3),l=i[0],u=i[1],s=i[2],d.txnByMacd(Object.values(s),r.sellMacdPoint/100,r.buyMacdPoint/100),c=new Date(Object.keys(l.all).pop()),c.getTime()>new Date(r.dateRange[0]).getTime()&&(r.dateRange[0]=m.default(c)),e.prev=12,e.abrupt("return",t.createInvestStragegy(l,r,{szData:u,indexData:s}));case 16:throw e.prev=16,e.t0=e["catch"](12),h.default.error({message:"\u57fa\u91d1\u521b\u5efa\u9519\u8bef",description:e.t0.message}),new Error(e.t0);case 20:case"end":return e.stop()}},e,null,[[12,16]])}));return function(t){return e.apply(this,arguments)}}()}createInvestStragegy(t,e,r){var n=new f.InvestmentStrategy({totalAmount:e.totalAmount+e.purchasedFundAmount,salary:e.salary,shangZhengData:r.szData,indexData:r.indexData,stop:{rate:.05,minAmount:5e4},tInvest:{rate:.05,amount:1e3},fundJson:t,onEachDay(t){var n=p.dateFormat(t),a=this.latestInvestment,o=this.getFundByDate(n,{origin:r.szData}),i=p.roundToFix(a.fundAmount/a.totalAmount,2),l=r.indexData[n]||{};if(i>e.fundPosition/100&&o.val>e.shCompositeIndex&&(!e.sellAtTop||a.maxAccumulatedProfit.date===a.date)&&(!e.sellMacdPoint||"sell"===l.txnType)&&a.profitRate>(e.profitRate/100||-100)){var u="amount"===e.sellUnit?e.sellNum:(e.sellNum/100*a.fundAmount).toFixed(2);this.sell(Number(u),n)}if(e.buyMacdPoint&&"buy"===l.txnType){var s=e.buyAmountPercent<=100?Math.round(a.leftAmount*e.buyAmountPercent/100):e.buyAmountPercent;this.buy(s,n)}}});return n.buy(e.purchasedFundAmount,e.dateRange[0]).fixedInvest({fixedInvestment:{period:e.period[0],amount:e.fixedAmount,dateOrWeek:e.period[1]},range:[p.dateFormat(e.dateRange[0]),p.dateFormat(e.dateRange[1])]}),console.log("investment",n),this.setState({fundData:n.data}),n}render(){return l.default.createElement("div",{className:u.default.normal},l.default.createElement(c.SearchForm,{onSearch:this.getFundData}),0===this.state.fundData.length?"":l.default.createElement(s.FundChart,{data:this.state.fundData}))}}e.default=y},QxXQ:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=n.__importStar(r("q1tI")),o=r("yP6+"),i=n.__importDefault(r("cQSq"));class l extends a.Component{render(){var t=this.props,e=(t.title,t.subTitle,t.data),r=t.textMap,n=t.commonProp,l=(t.legendProp,n.chart),u=new i.default;console.log("\u4ed3\u4f4d\u5bf9\u6bd4\u6570\u636e",e);var s=u.createView().source(e);s.transform({type:"fold",fields:["avgPos","maxPos"],key:"type",value:"value"});var c={avgPos:{alias:"\u5e73\u5747\u4ed3\u4f4d"},maxPos:{alias:"\u6700\u5927\u4ed3\u4f4d"}};return a.default.createElement("div",null,a.default.createElement("h1",{className:"main-title"},"\u6295\u8d44\u7b56\u7565 \u5e73\u5747\u4ed3\u4f4d\u4e0e\u6700\u5927\u4ed3\u4f4d"),a.default.createElement(o.Chart,Object.assign({data:s},l,{forceFit:!0,scale:c}),a.default.createElement(o.Legend,{itemFormatter:t=>{return r[t]}}),a.default.createElement(o.Axis,{name:"name"}),a.default.createElement(o.Axis,{name:"value"}),a.default.createElement(o.Tooltip,null),a.default.createElement(o.Geom,{type:"interval",color:"type",position:"name*value",adjust:[{type:"dodge",marginRatio:1/32}]})),a.default.createElement("h1",{className:"main-title"},"\u6536\u76ca/\u5e73\u5747\u4ed3\u4f4d\u6bd4"),a.default.createElement(o.Chart,Object.assign({data:e},l,{forceFit:!0,scale:c}),a.default.createElement(o.Axis,{name:"name"}),a.default.createElement(o.Axis,{name:"profitPerInvest"}),a.default.createElement(o.Tooltip,null),a.default.createElement(o.Geom,{type:"interval",position:"name*profitPerInvest"})),a.default.createElement("h1",{className:"main-title"},"\u7d2f\u8ba1\u6536\u76ca/\u6700\u9ad8\u4ed3\u4f4d"),a.default.createElement(o.Chart,Object.assign({data:e},l,{forceFit:!0,scale:c}),a.default.createElement(o.Axis,{name:"name"}),a.default.createElement(o.Axis,{name:"profitAmountPerPos"}),a.default.createElement(o.Tooltip,null),a.default.createElement(o.Geom,{type:"interval",position:"name*profitAmountPerPos"})))}}e.ComparePosition=l},RnhZ:function(t,e,r){var n={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-ps":"TJgH","./ar-ps.js":"TJgH","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn-bd":"loYQ","./bn-bd.js":"loYQ","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-in":"7C5Q","./en-in.js":"7C5Q","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./en-sg":"t+mt","./en-sg.js":"t+mt","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-mx":"tbfe","./es-mx.js":"tbfe","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fil":"1ppg","./fil.js":"1ppg","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-deva":"qvJo","./gom-deva.js":"qvJo","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku-kmr":"dVgr","./ku-kmr.js":"dVgr","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./oc-lnc":"Fnuy","./oc-lnc.js":"Fnuy","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tk":"Wv91","./tk.js":"Wv91","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-mo":"OmwH","./zh-mo.js":"OmwH","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function a(t){var e=o(t);return r(e)}function o(t){if(!r.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}a.keys=function(){return Object.keys(n)},a.resolve=o,t.exports=a,a.id="RnhZ"},SLhE:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dateFormat=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd",r=new Date(t);if(!r.getFullYear())return console.log(t,r),t;var n=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],a=[r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds()],o=a[0],i=a[1],l=a[2],u=a[3],s=a[4],c=a[5],d={yyyy:o,eM:n[i],MM:(i+1+"").padStart(2,"0"),M:i+1,dd:(l+"").padStart(2,"0"),d:l,HH:(u+"").padStart(2,"0"),H:u,hh:(u%12+"").padStart(2,"0"),h:u%12,mer:u>12?"pm":"am",mm:(s+"").padStart(2,"0"),m:s,ss:(c+"").padStart(2,"0"),s:c},f=/eM|mer|yyyy|MM|M|dd|d|HH|H|hh|h|mm|m|ss|s/g;return e.replace(f,t=>d[t])},e.roundToFix=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=Math.pow(10,e);return Number((Math.round(Number(t)*r)/r).toFixed(e))},e.disabledFuture=(t=>{var e=new Date(t).getTime(),r=Date.now();return e>r}),e.formatPercentVal=(t=>{return e.roundToFix(100*t)+"%"}),window["getJSONP"]=((t,e,r)=>{var n="cb"+window["getJSONP"].counter++,a="getJSONP."+n;-1==t.indexOf("?")?(t+="?callback="+a,t+="?cb="+a):(t+="&callback="+a,t+="&cb="+a);var o=document.createElement("script");o.referrerPolicy="no-referrer",window["getJSONP"][n]=function(t){try{e(t)}finally{delete window["getJSONP"][n],o.parentNode.removeChild(o)}},o.src=t,r&&r.onload&&(o.onload=(()=>{r.onload()})),document.body.appendChild(o)}),window["getJSONP"].counter=0},WzYl:function(t,e,r){"use strict";var n=r("p0pE"),a=r("1l/V");function o(){o=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),l=new L(n||[]);return a(i,"_invoke",{value:S(t,r,l)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",m="suspendedYield",p="executing",y="completed",v={};function g(){}function w(){}function x(){}var E={};c(E,l,function(){return this});var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==r&&n.call(_,l)&&(E=_);var j=x.prototype=g.prototype=Object.create(E);function F(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(a,o,i,l){var u=f(t[a],t,o);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,i,l)},function(t){r("throw",t,i,l)}):e.resolve(c).then(function(t){s.value=t,i(s)},function(t){return r("throw",t,i,l)})}l(u.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e(function(e,a){r(t,n,e,a)})}return o=o?o.then(a,a):a()}})}function S(e,r,n){var a=h;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=O(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var s=f(e,r,n);if("normal"===s.type){if(a=n.done?y:m,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=y,n.method="throw",n.arg=s.arg)}}}function O(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=x,a(j,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},F(P.prototype),c(P.prototype,u,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new P(d(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},F(j),c(j,s,"Generator"),c(j,l,function(){return this}),c(j,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return l.type="throw",l.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}Object.defineProperty(e,"__esModule",{value:!0});var i=r("mrSG"),l=i.__importStar(r("q1tI")),u=i.__importDefault(r("EDuE")),s=r("EtUQ"),c=r("Pdyw"),d=i.__importDefault(r("QeBL")),f=r("YTim"),h=r("SLhE");class m extends l.Component{constructor(){var t;super(...arguments),t=this,this.state={stragegyData:[],chartList:[]},this.handleSearch=function(){var e=a(o().mark(function e(r){var i,l,u;return o().wrap(function(e){while(1)switch(e.prev=e.next){case 0:return i=new d.default({}),l=r.stragegyChecked.map(function(){var t=a(o().mark(function t(e){var a,l,u;return o().wrap(function(t){while(1)switch(t.prev=t.next){case 0:return a=n({},f.allSavedCondition[e],{dateRange:r.dateRange}),t.next=3,i.getFundData(a);case 3:return l=t.sent,u=l.data.map(t=>{return{name:e,origin:t,totalAmount:t.totalAmount,leftAmount:t.leftAmount,date:t.date,profit:t.profit,profitRate:t.profitRate,fundAmount:t.fundAmount,fundVal:Number(t.curFund.val),fundGrowthRate:t.fundGrowthRate,dateBuyAmount:t.dateBuyAmount,dateSellAmount:t.dateSellAmount,accumulatedProfit:t.accumulatedProfit,maxPrincipal:t.maxPrincipal,totalProfitRate:t.totalProfitRate,position:h.roundToFix(t.fundAmount/t.totalAmount,4)}}),t.abrupt("return",{name:e,data:u});case 6:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()),e.next=4,Promise.all(l);case 4:u=e.sent,t.setState({stragegyData:u,chartList:r.chartChecked});case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()}render(){var t=this.state,e=t.stragegyData,r=t.chartList;return l.default.createElement("div",{className:u.default.normal},l.default.createElement(s.CompareSearchForm,{onSearch:this.handleSearch}),l.default.createElement(c.CompareChart,{data:e,chartList:r}))}}e.default=m},YTim:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=n.__importStar(r("q1tI")),o=n.__importDefault(r("5rEg")),i=n.__importDefault(r("kLXV")),l=n.__importDefault(r("mr32")),u=n.__importDefault(r("diRs")),s=n.__importDefault(r("2/Rp")),c=r("SLhE"),d=["magenta","red","volcano","orange","gold","lime","green","cyan","blue","geekblue","purple"],f="saved-fund-form",h=localStorage.getItem(f)||"{}";if("{}"===h){var m=c.dateFormat(Date.now(),"yyyy-MM-dd"),p=c.dateFormat(Date.now()-94608e6,"yyyy-MM-dd");h=JSON.stringify({"\u5b9a\u6295\u767d\u9152\u4e0d\u6b62\u76c8":{fundId:"161725",dateRange:["".concat(p,"T00:00:00.000Z"),"".concat(m,"T16:00:00.000Z")],totalAmount:1e4,salary:1e4,purchasedFundAmount:0,fixedAmount:2e3,period:["weekly",4],shCompositeIndex:3e3,fundPosition:100,profitRate:5,sellAtTop:!1,sellNum:10,sellUnit:"fundPercent",referIndex:"1.000001",buyAmountPercent:20},"\u5b9a\u6295\u767d\u9152\u6b62\u76c8":{fundId:"161725",dateRange:["".concat(p,"T00:00:00.000Z"),"".concat(m,"T16:00:00.000Z")],totalAmount:1e4,salary:1e4,purchasedFundAmount:0,fixedAmount:2e3,period:["weekly",4],shCompositeIndex:3e3,fundPosition:70,profitRate:10,sellAtTop:!0,sellNum:10,sellUnit:"fundPercent",referIndex:"1.000001",buyAmountPercent:20}})}e.allSavedCondition=JSON.parse(h);class y extends a.Component{constructor(){super(...arguments),this.state={allSavedCondition:e.allSavedCondition,selectedName:""},this.saveSearchForm=(()=>{var t=this.state.selectedName;this.props.form.validateFields((e,r)=>{if(!e){var n=t;i.default.confirm({title:"\u8bf7\u7ed9\u5f53\u524d\u641c\u7d22\u6761\u4ef6\u547d\u540d",content:a.default.createElement(o.default,{defaultValue:t,placeholder:"\u5982\u540d\u79f0\u91cd\u590d\uff0c\u5c06\u4f1a\u8986\u76d6\u539f\u6709\u641c\u7d22\u6761\u4ef6",onChange:t=>{n=t.target.value}}),onOk:()=>{this.setState({selectedName:n}),this.state.allSavedCondition[n]=r,this.saveStorage(),this.props.onSave&&this.props.onSave(r)}})}})})}deleteCondition(t,e){t.preventDefault(),t.stopPropagation(),console.log("tag name",e),delete this.state.allSavedCondition[e],this.saveStorage()}saveStorage(){localStorage.setItem(f,JSON.stringify(this.state.allSavedCondition)),this.setState({allSavedCondition:this.state.allSavedCondition})}handleSelectedTag(t,e){this.setState({selectedName:t}),this.props.onSelected(t,e)}content(){var t=this.state.allSavedCondition;return a.default.createElement("div",{style:{width:500}},Object.keys(t).map((e,r)=>{return a.default.createElement(l.default,{closable:!0,key:r,style:{marginBottom:10,cursor:"pointer"},color:d[r%d.length],onClose:t=>this.deleteCondition(t,e),onClick:()=>this.handleSelectedTag(e,t[e])},e)}))}render(){return a.default.createElement(a.Fragment,null,a.default.createElement(s.default,{type:"default",onClick:this.saveSearchForm,style:{marginRight:10}},"\u4fdd\u5b58"),a.default.createElement(u.default,{trigger:"click",placement:"bottomRight",content:this.content(),title:"\u5df2\u4fdd\u5b58\u7684\u57fa\u91d1\u7b56\u7565"},a.default.createElement(s.default,{type:"primary"},"\u6211\u7684\u4fdd\u5b58\u9879")))}}e.SavedSearchCondition=y},hQqI:function(t,e,r){"use strict";var n=r("qIgq"),a=r("p0pE"),o=r("1l/V");function i(){i=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),l=new L(n||[]);return a(i,"_invoke",{value:S(t,r,l)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",m="suspendedYield",p="executing",y="completed",v={};function g(){}function w(){}function x(){}var E={};c(E,l,function(){return this});var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==r&&n.call(_,l)&&(E=_);var j=x.prototype=g.prototype=Object.create(E);function F(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(a,o,i,l){var u=f(t[a],t,o);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,i,l)},function(t){r("throw",t,i,l)}):e.resolve(c).then(function(t){s.value=t,i(s)},function(t){return r("throw",t,i,l)})}l(u.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e(function(e,a){r(t,n,e,a)})}return o=o?o.then(a,a):a()}})}function S(e,r,n){var a=h;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=O(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var s=f(e,r,n);if("normal"===s.type){if(a=n.done?y:m,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=y,n.method="throw",n.arg=s.arg)}}}function O(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=x,a(j,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},F(P.prototype),c(P.prototype,u,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new P(d(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},F(j),c(j,s,"Generator"),c(j,l,function(){return this}),c(j,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return l.type="throw",l.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}Object.defineProperty(e,"__esModule",{value:!0});var l=r("mrSG"),u=l.__importStar(r("q1tI")),s=l.__importDefault(r("Vl3Y")),c=l.__importDefault(r("+eQT")),d=l.__importDefault(r("2/Rp")),f=l.__importDefault(r("bx4M")),h=l.__importDefault(r("2fM7")),m=l.__importDefault(r("fyUT")),p=l.__importDefault(r("DFOY")),y=l.__importDefault(r("PArb")),v=l.__importDefault(r("BMrR")),g=l.__importDefault(r("kPKH")),w=l.__importDefault(r("wd/R")),x=r("SLhE"),E=r("7CHm"),b=l.__importDefault(r("EDuE")),_=r("7R38"),j=r("wgSR"),F=r("YTim"),P=l.__importDefault(r("DzJC")),S=c.default,O=(S.MonthPicker,S.RangePicker),D=h.default.Option;class A extends u.Component{constructor(){var t;super(...arguments),t=this,this.state={searchFundData:[]},this.weekOpt=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94"].map((t,e)=>{return{value:e+1,label:"\u5468"+t}}),this.monthOpt=Array(28).fill("").map((t,e)=>{return{value:e+1,label:"".concat(e+1,"\u53f7")}}),this.handleSearch=P.default(function(){var e=o(i().mark(function e(r){var n;return i().wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!r){e.next=7;break}return e.next=3,E.getFundInfo(r);case 3:n=e.sent,t.setState({searchFundData:n}),e.next=8;break;case 7:t.setState({searchFundData:[]});case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),1e3),this.handleSubmit=(t=>{t.preventDefault(),this.props.form.validateFields((t,e)=>{t||this.props.onSearch(e)})}),this.reset=(()=>{this.props.form.resetFields()}),this.disabledDate=(t=>{var e=new Date(t).getTime(),r=Date.now();return e>r}),this.updateSearchForm=((t,e)=>{this.handleSearch(e.fundId),this.props.form.setFieldsValue(a({},e,{dateRange:e.dateRange.map(t=>w.default(t))})),this.props.onSearch(e)})}get periodOpts(){return[{value:"weekly",label:"\u6bcf\u5468",children:this.weekOpt},{value:"monthly",label:"\u6bcf\u6708",children:this.monthOpt}]}render(){var t=this.props.form.getFieldDecorator,e=this.state.searchFundData,r=x.dateFormat(new Date).split("-").map(Number),a=n(r,3),o=a[0],i=a[1],l=a[2];i=Number(i)-1;var c={style:{width:500},labelCol:{xs:{span:24},sm:{span:8}},wrapperCol:{xs:{span:24},sm:{span:16}}},E={rules:[{type:"array",required:!0,message:"\u8bf7\u9009\u62e9\u65f6\u95f4\u8303\u56f4"}],initialValue:[w.default([Number(o)-1,i,l]),w.default([o,i,l])]},P={span:24,xl:12,xxl:8},S=this.props.form.getFieldsValue();return console.log("formVa",S),u.default.createElement(f.default,{title:"\u57fa\u91d1\u9009\u9879",extra:u.default.createElement(F.SavedSearchCondition,{form:this.props.form,onSelected:this.updateSearchForm}),style:{textAlign:"initial",margin:"20px 0"}},u.default.createElement(s.default,{onSubmit:this.handleSubmit},u.default.createElement(s.default.Item,Object.assign({},c,{label:"\u57fa\u91d1\u7f16\u53f7"}),t("fundId",{rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u57fa\u91d1\u7f16\u53f7"}]})(u.default.createElement(h.default,{showSearch:!0,placeholder:"\u8f93\u5165\u57fa\u91d1\u540d\u79f0\u6216\u57fa\u91d1\u7f16\u53f7",defaultActiveFirstOption:!1,showArrow:!1,filterOption:!1,onSearch:this.handleSearch,notFoundContent:null},e.map(t=>u.default.createElement(D,{key:t.code},t.name,"[",t.code,"]"))))),u.default.createElement(s.default.Item,Object.assign({},c,{label:"\u65f6\u95f4\u8303\u56f4"}),t("dateRange",E)(u.default.createElement(O,{placeholder:["\u5f00\u59cb\u65f6\u95f4","\u7ed3\u675f\u65f6\u95f4"],ranges:{"\u6700\u8fd1\u4e00\u5e74":[w.default([Number(o)-1,i,l]),w.default([o,i,l])],"\u6700\u8fd1\u4e24\u5e74":[w.default([Number(o)-2,i,l]),w.default([o,i,l])],"\u6700\u8fd1\u4e09\u5e74":[w.default([Number(o)-3,i,l]),w.default([o,i,l])],"\u6700\u8fd1\u4e94\u5e74":[w.default([Number(o)-5,i,l]),w.default([o,i,l])]},disabledDate:this.disabledDate}))),u.default.createElement(v.default,null,u.default.createElement(g.default,Object.assign({},P),u.default.createElement(y.default,{orientation:"left"},"\u6295\u8d44\u7b56\u7565 ",u.default.createElement("span",{className:b.default.hint},"\u9ed8\u8ba4[\u5206\u7ea2\u65b9\u5f0f\uff1a\u7ea2\u5229\u590d\u6295][\u4e70\u5165\u8d39\u7387:0.15%][\u5356\u51fa\u8d39\u73870.5%]")),u.default.createElement(s.default.Item,Object.assign({},c,{label:"\u521d\u59cb\u672c\u91d1"}),t("totalAmount",{initialValue:1e4,rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u672c\u91d1"}]})(u.default.createElement(m.default,{style:{width:"100%"},min:0}))),u.default.createElement(s.default.Item,Object.assign({},c,{label:"\u6708\u5de5\u8d44[\u6bcf\u6708\u589e\u91cf\u8d44\u91d1]"}),t("salary",{initialValue:1e4,rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u6708\u5de5\u8d44"}]})(u.default.createElement(m.default,{style:{width:"100%"},min:0}))),u.default.createElement(s.default.Item,Object.assign({},c,{label:"\u521d\u59cb\u6301\u6709\u57fa\u91d1\u91d1\u989d"}),t("purchasedFundAmount",{initialValue:0,rules:[{required:!0,message:"\u8f93\u5165\u6301\u6709\u57fa\u91d1\u91d1\u989d, \u4ece0\u5f00\u59cb\u5b9a\u6295\u5219\u586b0"}]})(u.default.createElement(m.default,{style:{width:"100%"},min:0,placeholder:"\u6295\u8d44\u5f00\u59cb\u65f6\u6301\u6709\u7684\u57fa\u91d1\u91d1\u989d"}))),u.default.createElement(s.default.Item,Object.assign({},c,{label:"\u5b9a\u6295\u91d1\u989d"}),t("fixedAmount",{rules:[{required:!0,message:"\u8f93\u5165\u5b9a\u6295\u91d1\u989d"}],initialValue:1e3})(u.default.createElement(m.default,{style:{width:"100%"},min:0}))),u.default.createElement(s.default.Item,Object.assign({},c,{label:"\u5b9a\u6295\u5468\u671f"}),t("period",{initialValue:["monthly",1],rules:[{required:!0}]})(u.default.createElement(p.default,{options:this.periodOpts,placeholder:"\u9009\u62e9\u5b9a\u6295\u5468\u671f"}))),u.default.createElement(s.default.Item,{wrapperCol:{sm:{span:16,offset:8}}},u.default.createElement(d.default,{type:"primary",htmlType:"submit"},"\u67e5\u8be2"),u.default.createElement(d.default,{style:{marginLeft:20},onClick:this.reset},"\u91cd\u7f6e"))),u.default.createElement(g.default,Object.assign({},P),u.default.createElement(_.StopProfitForm,{form:this.props.form})),u.default.createElement(g.default,Object.assign({},P),u.default.createElement(j.BuyStragegyForm,{form:this.props.form})))),S.dateRange?u.default.createElement("div",null,u.default.createElement("p",null," \u5b9a\u6295\u63cf\u8ff0\uff1a\u4ece ",S.dateRange[0].format("YYYY-MM-DD")," ~ ",S.dateRange[1].format("YYYY-MM-DD")," \u65f6\u95f4\u5185 \u6295\u8d44\u57fa\u91d1[",S.fundId,"]\uff0c\u521d\u59cb\u6301\u6709\u57fa\u91d1 ",S.purchasedFundAmount," \u5143\uff0c\u6301\u6709\u53ef\u7528\u6295\u8d44\u8d44\u91d1 ",S.totalAmount," \u5143\uff0c\u6bcf\u6708\u589e\u52a0\u6295\u8d44\u8d44\u91d1 ",S.salary,"\u5143\u3010\u5de5\u8d44\u6536\u5165\u3011\uff1b\u6bcf ","weekly"===S.period[0]?"\u5468":"\u6708"," ",S.period[1]," ","weekly"===S.period[0]?"":"\u53f7"," \u5b9a\u6295 ",S.fixedAmount," \u5143\u3002"),u.default.createElement("p",null,"\u6b62\u76c8\u63cf\u8ff0\uff1a\u5f53\u4e0a\u8bc1\u6307\u6570\u5927\u4e8e ",S.shCompositeIndex," \u70b9\uff0c\u4e14\u6301\u6709\u4ed3\u4f4d\u5927\u4e8e ",S.fundPosition,"%\uff0c\u4e14\u5f53\u524d\u6301\u6709\u6536\u76ca\u7387\u5927\u4e8e ",S.profitRate,"%\uff0c",S.sellAtTop?"\u4e14\u7d2f\u8ba1\u76c8\u5229\u65b0\u9ad8\uff0c":"",null!==S.sellMacdPoint&&S.sellMacdPoint>=0?"\u4e14\u53c2\u8003\u6307\u6570".concat(S.referIndex,"\u7684MACD\u7ea2\u67f1\u63a5\u8fd1 ").concat(S.sellMacdPoint,"% \u4e34\u754c\u4f4d\u7f6e\uff0c"):"","\u5219\u5356\u51fa ",S.sellNum," ","amount"===S.sellUnit?"\u5143":"% \u7684\u6301\u6709\u4efd\u989d"," "),u.default.createElement("p",null,"\u8865\u4ed3\u63cf\u8ff0\uff1a",null!==S.buyMacdPoint&&S.buyMacdPoint>=0?"\u53c2\u8003\u6307\u6570".concat(S.referIndex,"\u7684MACD\u7eff\u67f1\u63a5\u8fd1 ").concat(S.buyMacdPoint,"% \u4e34\u754c\u4f4d\u7f6e\uff0c\u4e70\u5165\u5269\u4f59\u6d41\u52a8\u8d44\u91d1\u7684 ").concat(S.buyAmountPercent,"%"):"")):null)}}e.InnerSearchForm=A,e.SearchForm=s.default.create({name:"fund-search"})(A)},ka5M:function(t,e,r){"use strict";var n=r("p0pE"),a=r("Y/ft");Object.defineProperty(e,"__esModule",{value:!0});var o=r("mrSG"),i=o.__importStar(r("q1tI")),l=o.__importDefault(r("1Gbu")),u=o.__importDefault(r("cQSq")),s=r("SLhE");class c extends i.Component{constructor(){super(...arguments),this.ds=new u.default({state:{start:s.dateFormat(Date.now()-31536e6),end:s.dateFormat(Date.now())}}),this.sliderTimeChange=(t=>{var e=t.startText,r=t.endText;this.ds.setState("start",e),this.ds.setState("end",r)})}render(){var t=this.props,e=(t.children,a(t,["children"])),r=e.data,o=e.y;if(!r||!r[0])return null;var u=this.ds;this.sliderTimeChange({startText:r[0].date,endText:r[r.length-1].date});var s=u.createView();s.source(r).transform({type:"filter",callback:t=>{var e=t.date;return e<=u.state.end&&e>=u.state.start}}),r=s;var c=i.default.Children.map(this.props.children,t=>i.default.cloneElement(t,n({},e,{data:r})));return i.default.createElement("div",null,c,i.default.createElement("div",null,i.default.createElement(l.default,{padding:[20,40,20,40],width:"auto",height:26,start:u.state.start,end:u.state.end,xAxis:"date",yAxis:o,scales:{time:{type:"timeCat"}},data:r,onChange:this.sliderTimeChange})))}}e.SliderChart=c},"sn++":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("mrSG"),a=n.__importStar(r("q1tI")),o=r("PmdP"),i=r("+Lt0"),l=r("Cvqf"),u=r("6N5B"),s=r("SLhE"),c=n.__importDefault(r("9dBp")),d=r("ka5M");e.keyTextMap={totalAmount:"\u603b\u8d44\u4ea7",leftAmount:"\u5269\u4f59\u53ef\u7528\u8d44\u91d1",profitRate:"\u6301\u6709\u6536\u76ca\u7387",profit:"\u6301\u6709\u6536\u76ca",fundAmount:"\u57fa\u91d1\u6301\u6709\u91d1\u989d",fundVal:"\u57fa\u91d1\u51c0\u503c",fundGrowthRate:"\u57fa\u91d1\u6da8\u5e45",dateBuyAmount:"\u4e70\u5165\u91d1\u989d",dateSellAmount:"\u5356\u51fa\u91d1\u989d",accumulatedProfit:"\u7d2f\u8ba1\u76c8\u4e8f",maxPrincipal:"\u7d2f\u8ba1\u672c\u91d1",totalProfitRate:"\u7d2f\u8ba1\u6536\u76ca\u7387",position:"\u6301\u6709\u4ed3\u4f4d",buy:"\u4e70\u5165",fixedBuy:"\u5b9a\u6295",sell:"\u5356\u51fa",avgPos:"\u5e73\u5747\u4ed3\u4f4d",maxPos:"\u6700\u5927\u4ed3\u4f4d",profitPerInvest:"\u6536\u76ca\u4ed3\u4f4d\u6bd4"};class f extends a.Component{constructor(){super(...arguments),this.commonProp={chart:{forceFit:!0,height:450,padding:[20,80,100,80]}}}render(){var t=this.props.data[0].fundStrategy.fixedConfig.fixedInvestment.amount,r=this.props.data.map(e=>{var r;return e.dateBuyAmount>0&&(r=e.dateBuyAmount===t?"fixedBuy":"buy"),e.dateSellAmount>0&&(r="sell"),{origin:e,totalAmount:e.totalAmount,leftAmount:e.leftAmount,date:e.date,profit:e.profit,profitRate:e.profitRate,fundAmount:e.fundAmount,fundVal:Number(e.curFund.val),fundGrowthRate:e.fundGrowthRate,dateBuyAmount:e.dateBuyAmount,dateSellAmount:e.dateSellAmount,txnType:r,accumulatedProfit:e.accumulatedProfit,maxPrincipal:e.maxPrincipal,totalProfitRate:e.totalProfitRate,position:s.roundToFix(e.fundAmount/e.totalAmount,4)}}),n=r;if(!n||!n[0])return null;console.log("\u6e90\u6570\u636e",n);var f=[n[0].origin.date,n[n.length-1].origin.date],h=f[0],m=f[1],p=Object.values(n[0].origin.fundStrategy.indexData).filter(t=>{var e=new Date(t.date).getTime();return e>=new Date(h).getTime()&&e<=new Date(m).getTime()}),y=0,v=s.roundToFix(n.reduce((t,e)=>{var r=e.position;return y=r>y?r:y,t+r},0)/n.length*100,2);return a.default.createElement("div",null,a.default.createElement(i.FundValChart,{data:n,textMap:e.keyTextMap,commonProp:this.commonProp}),a.default.createElement(c.default,{data:p,textMap:e.keyTextMap,commonProp:this.commonProp}),a.default.createElement(l.RateChart,{data:n,textMap:e.keyTextMap,commonProp:this.commonProp}),a.default.createElement(o.TotalAmountChart,{data:n,textMap:e.keyTextMap,commonProp:this.commonProp}),a.default.createElement(u.CommonFundLine,{y:"totalAmount",data:n,textMap:e.keyTextMap,commonProp:this.commonProp}),a.default.createElement(d.SliderChart,{y:"position",data:n.map(t=>{return{position:t.position,date:t.date}})},a.default.createElement(u.CommonFundLine,{y:"position",subTitle:"\u5e73\u5747\u4ed3\u4f4d\uff1a".concat(v,"%; \u6700\u5927\u4ed3\u4f4d\uff1a").concat(100*y,"%"),data:n,textMap:e.keyTextMap,commonProp:this.commonProp})))}}e.FundChart=f},wgSR:function(t,e,r){"use strict";var n=r("1l/V");function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:S(t,r,l)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",m="suspendedYield",p="executing",y="completed",v={};function g(){}function w(){}function x(){}var E={};c(E,l,function(){return this});var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==r&&n.call(_,l)&&(E=_);var j=x.prototype=g.prototype=Object.create(E);function F(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(a,o,i,l){var u=f(t[a],t,o);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,i,l)},function(t){r("throw",t,i,l)}):e.resolve(c).then(function(t){s.value=t,i(s)},function(t){return r("throw",t,i,l)})}l(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,a){r(t,n,e,a)})}return a=a?a.then(o,o):o()}})}function S(e,r,n){var a=h;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=O(l,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var s=f(e,r,n);if("normal"===s.type){if(a=n.done?y:m,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=y,n.method="throw",n.arg=s.arg)}}}function O(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=x,o(j,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},F(P.prototype),c(P.prototype,u,function(){return this}),e.AsyncIterator=P,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new P(d(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},F(j),c(j,s,"Generator"),c(j,l,function(){return this}),c(j,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return l.type="throw",l.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}Object.defineProperty(e,"__esModule",{value:!0});var o=r("mrSG"),i=o.__importStar(r("q1tI")),l=o.__importDefault(r("qu0K")),u=o.__importDefault(r("2fM7")),s=o.__importDefault(r("fyUT")),c=o.__importDefault(r("PArb")),d=r("7CHm"),f=o.__importDefault(r("DzJC")),h=u.default.Option,m={style:{width:500},labelCol:{xs:{span:24},sm:{span:8}},wrapperCol:{xs:{span:24},sm:{span:16}}};class p extends i.Component{constructor(){var t;super(...arguments),t=this,this.state={searchIndexData:[]},this.handleSearchIndex=f.default(function(){var e=n(a().mark(function e(r){var n;return a().wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!r){e.next=7;break}return e.next=3,d.searchIndex(r);case 3:n=e.sent,t.setState({searchIndexData:n}),e.next=8;break;case 7:t.setState({searchIndexData:[]});case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),1e3)}render(){var t=this.state.searchIndexData,e=this.props.form,r=e.getFieldDecorator;e.getFieldsValue;return i.default.createElement("section",null,i.default.createElement(c.default,{orientation:"left"},"\u8865\u4ed3\u7b56\u7565 "),i.default.createElement(l.default.Item,Object.assign({},m,{label:"\u53c2\u8003\u6307\u6570"}),r("referIndex")(i.default.createElement(u.default,{showSearch:!0,placeholder:"\u8f93\u5165\u6307\u6570\u540d\u79f0\u6216\u7f16\u53f7",defaultActiveFirstOption:!1,showArrow:!1,filterOption:!1,onSearch:this.handleSearchIndex,notFoundContent:null},t.map((t,e)=>i.default.createElement(h,{key:t.id},t.name,"[",t.code,"]"))))),i.default.createElement(l.default.Item,Object.assign({},m,{label:"\u4e70\u5165 MACD \u4e34\u754c\u70b9"}),r("buyMacdPoint",{})(i.default.createElement(s.default,{style:{width:"100%"},formatter:t=>"".concat(t,"%"),parser:t=>(t||"").replace("%",""),min:0,max:100,placeholder:"macd \u8865\u4ed3\u70b9"}))),i.default.createElement(l.default.Item,Object.assign({},m,{label:"\u8865\u4ed3\u91d1\u989d"}),i.default.createElement("div",null,i.default.createElement("span",null," \u5269\u4f59\u6d41\u52a8\u8d44\u91d1\u7684 "),r("buyAmountPercent",{initialValue:20})(i.default.createElement(s.default,{size:"small",min:0,formatter:t=>Number(t)>100?"".concat(t,"\u5143"):"".concat(t,"%"),parser:t=>(t||"").replace(/%|\u5143/,""),placeholder:"\u8865\u4ed3\u4e70\u5165\u767e\u5206\u6bd4"}))," ")))}}e.BuyStragegyForm=p}}]);