(window.webpackJsonp=window.webpackJsonp||[]).push([["load-chart-dialog"],{"0HKD":function(t,e,i){t.exports={"css-value-list-dialog-item-height":"30px"}},Ald9:function(t,e){t.exports=''},E5yG:function(t,e,i){"use strict";function o(t){return t.replace(a,c)}function n(t,e,i){return null===i?t:t.filter(function(t){return function(t,e,i){return Object.values(i(t)).some(function(t){return e.test(t)})}(t,i,e)})}function s(t){return{title:t.title,symbol:t.symbol}}function r(t){switch(t){case"title":return function(t,e){return t.title.localeCompare(e.title)};case"symbol":return function(t,e){return t.symbol.localeCompare(e.symbol)};case"modified":return function(t,e){return e.modified-t.modified};default:return function(t,e){return t.title.localeCompare(e.title)}}}var l,a,c,d,u,_,h,p,g,f,v,m,w,y,b,j,S,O,C,L,D,I,x,T,A,F,N,R,E,M,B,H,k,q,z;i.r(e),l=i("mrSG"),i("YFKU"),i("HbRj"),a=/[<"'&>]/g,c=function(t){return""+t.charCodeAt(0)+";"},d=i("BxxN"),u=i("pPtI"),_=i("ldgD"),h=i.n(_),p=i("Eyy1"),g=i("Vdly"),f=i("YDhE"),v=i("dTSQ"),m=i("oNDq"),w=i("UIZs"),y=i("TzTt"),b=i("0HKD"),j=parseInt(b["css-value-list-dialog-item-height"]),S=i("uo4K"),O=i("HHbT"),C=i("GWvR"),L=i("rMPu"),D=i("YTOR"),I=window.t("Add to favorites"),x=window.t("Remove from favorites"),T=window.t("Search"),A=function(){function t(t,e){var i=this;this._itemsData=[],this._itemsToRender=[],this._sortMap=null,this._currentSortObj=null,this._itemsCount=0,this._searchRegexp=null,this._dialog=null,this._fieldsExtractorFunc=null,this._isConfirmDialogOpen=!1,this._tvSettingsName=t,this._content=Object(y.b)('
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
'),this._contentSearch=Object(p.ensureNotNull)(this._content.querySelector(".js-content-search")),this._contentSort=Object(p.ensureNotNull)(this._content.querySelector(".js-content-sort")),this._contentBody=Object(p.ensureNotNull)(this._content.querySelector(".js-content-body")),this._contentBody.addEventListener("scroll",function(t){return i._scrollHandler(t)},!1)}return t.prototype._setItemsData=function(t){this._itemsData=t},t.prototype._getItemsData=function(){return this._itemsData},t.prototype._setSortMap=function(t){this._sortMap=t},t.prototype._makeItemTemplate=function(t,e,i,n){
var s,r,l,a,c,d,u,_,h,p,g=this,f=t.isActive,v=t.isFavorite,w=t.columns,b=t.url,j=t.id,D=v?L["list-dialog__favorite-icon--starred"]:"",T=f?L["list-dialog__row--item-active"]:"",A="";for(s=0,r=Object.values(w);s\n\t\t\t\t'+l+"\n\t\t\t";return b?A=function(t,e){return''+e+""}(b,A):(c=A,A=''+c+"
"),(a=Object(y.b)('\n\t\t\t'+(h=(_=v)?O:C,p=_?x:I,'
\n\t\t'+h+"\n\t
")+"\n\t\t\t"+A+"\n\t\t\t"+(u=(d=n)?'title="'+d+'"':"",'
\n\t\t"+S+"\n\t
")+"\n\t\t
")).addEventListener("click",function(t){t.defaultPrevented||(e.open(),t.preventDefault())}),a.querySelector(".js-remove-button").addEventListener("click",function(t){g._isConfirmDialogOpen=!0;!function(t,e,i){Object(m.createConfirmDialog)({content:o(t)}).then(function(t){t.on("action:yes",function(){e(),t.close()}),t.on("afterClose",function(){return i()}),t.open()})}(i,function(){e.delete().then(function(){return g._removeItem(j)})},function(){g._isConfirmDialogOpen=!1}),t.preventDefault()}),a.querySelector(".js-favs").addEventListener("click",function(t){e.favorite(),g._render(),t.preventDefault()}),a},t.prototype._prepareHighlight=function(t,e){var i,o,n,s,r;if(null!==this._searchRegexp){for(i in t)if(t[i]){if(o=t[i],null===(n=this._searchRegexp.exec(o)))continue;for(s="",r=1;r$'+r+"":"$"+r;t[i]=o.replace(this._searchRegexp,s)}e.columns=Object.assign(e.columns,t)}},t.prototype._showDialog=function(t,e,i,o){var n=this;0===e.length?this._emptyList(t.dialogEmpty):(this._setItemsToRender(e),this._initSearch(e,o),this._prepareSort(),this._initHeader(i),this._render()),this._dialog=Object(f.createDialog)({title:t.dialogTitle,width:600,height:550,content:this._content,contentWrapTemplate:"",destroyOnClose:!0,withScroll:!1,isClickOutFn:function(){return!n._isConfirmDialogOpen&&void 0}}),this._dialog.open()},t.prototype._render=function(){this._contentBody.innerHTML="",this._sortList(this._isFavorite.bind(this)),this._renderWithOffset(this._getItemsToRender(),0,this._getMinShownItems())},t.prototype._makeActive=function(t){var e,i=this._contentBody.querySelector(".js-item."+L["list-dialog__row--item-active"]);null!==i&&i.classList.remove(L["list-dialog__row--item-active"]),null!==(e=this._contentBody.querySelector(".js-item[data-id='"+t+"']"))&&e.classList.add(L["list-dialog__row--item-active"])},t.prototype._removeItem=function(t){var e,i;this._filterItems(t),e=this._getItemsData(),this._setItemsToRender(e),null!==(i=this._contentBody.querySelector(".js-item[data-id='"+t+"']"))&&this._contentBody.removeChild(i)},t.prototype._setItemsToRender=function(t){
this._itemsToRender=t},t.prototype._getItemsToRender=function(){return this._itemsToRender},t.prototype._getCurrentSortObj=function(){return this._currentSortObj},t.prototype._emptyList=function(t){this._contentBody.innerHTML='
'+t+"
"},t.prototype._sortList=function(t){var e,i,o,n,s,r=[],l=[];for(e=0,i=this._getItemsToRender();e
\n\t\t\t\t'+s+'\n\t\t\t\t\n\t\t\t ';for(l=Object(y.b)('\n\t\t\t'+p+"\n\t\t
"),this._contentSort.appendChild(l),a=0,
c=Array.from(l.querySelectorAll(".js-column"));a=e.scrollHeight-j/2&&this._renderWithOffset(this._getItemsToRender(),this._itemsCount,this._getMinShownItems())},t.prototype._disableContextMenu=function(){this._content.addEventListener("contextmenu",function(t){var e,i=t.target.parentElement;null!==i&&((e=i)&&e.classList.contains("js-item-link"))||t.preventDefault()})},t.prototype._resetScroll=function(){this._itemsCount=0,this._contentBody.scrollTop=0},t}(),F=function(){function t(t){this._isAscending=!1,this._sortingFunc=t}return t.prototype.getPredicate=function(){var t=this;return function(e,i){var o=t._sortingFunc(e,i);return t._isAscending&&(o*=-1),o}},t.prototype.inverse=function(){this._isAscending=!this._isAscending},t.prototype.setIsAscending=function(t){this._isAscending=t},t.prototype.isAscending=function(){return this._isAscending},t}(),i.d(e,"LoadChartDialog",function(){return z}),N=window.t("Load Chart Layout"),R=window.t("Delete chart layout"),E=window.t("Multiple charts"),M=window.t("Last Modified"),B=window.t("Active Symbol"),H=window.t("Chart Layout Name"),k=window.t("There are no saved charts"),q=window.t("Do you really want to delete Chart Layout '{0}' ?"),z=function(t){function e(e,i){var o,n,l,a=t.call(this,"loadChartDialog","load-chart-dialog")||this;return a._defaultSort={sortField:"modified",isAscending:!1},a._favorites=[],(o=new Map).set("title",new F(r("title"))),o.set("modified",new F(r("modified"))),o.set("symbol",new F(r("symbol"))),a._setSortMap(o),e.forEach(function(t){var e;t.symbol=0!==(e=t).symbol.length?e.symbol+", "+Object(u.getTranslatedResolution)(e.interval):E}),n={title:H,modified:M,symbol:B},l={dialogTitle:N,dialogEmpty:k},a._setFavorites(i),a._setItemsData(e),a._showDialog(l,e,n,s),a}return l.__extends(e,t),e.prototype._isFavorite=function(t){return this._favorites.hasOwnProperty(t.id)},e.prototype._renderItem=function(t){var e,i,n=this,r=t.id,l=t.active,a=t.url,c=t.title,u=t.modified,_=t.symbol,p={id:r,isActive:l(),isFavorite:this._isFavorite(t),url:Object(d.a)({chartId:a}),columns:{title:o(c),modified:(i=u,h.a.unix(i).format("l LT")),symbol:o(_)}},g={open:function(){t.openAction(),n._makeActive(r)},delete:function(){return t.deleteAction()},favorite:function(){n._setItemFavorite(t.id,!n._isFavorite(t)),n._filterFavorites(),t.favoriteAction(n._getFavorites())}};return this._prepareHighlight(s(t),p),e=q.format(c),this._makeItemTemplate(p,g,e,R)},e.prototype._setFavorites=function(t){this._favorites=t},e.prototype._getFavorites=function(){return this._favorites},e.prototype._setItemFavorite=function(t,e){e?this._favorites[t]=e:delete this._favorites[t]},e.prototype._filterFavorites=function(){
var t=this,e=this._getItemsData(),i={};e.forEach(function(e){t._isFavorite(e)&&(i[e.id]=!0)}),this._setFavorites(i)},e}(A)},EulZ:function(t,e,i){},"G0+C":function(t,e){t.exports=''},GWvR:function(t,e){t.exports=''},HHbT:function(t,e){t.exports=''},UIZs:function(t,e,i){"use strict";function o(t,e,i){e.toggleClass("i-hidden",""===t.val()),i.fire(t.val())}function n(t){var e,i,n,s=$(d);return t.addClass&&s.addClass(t.addClass),t.withoutControls&&s.addClass("tv-search-row--without-controls"),e=s.find(".js-input-control"),i=s.find(".js-reset-button"),t.placeholder&&e.attr("placeholder",t.placeholder),i[0].addEventListener("click",function(){e.val("").trigger("input").focus()}),n=new r.a,e.on("input propertychange",o.bind(null,e,i,n)),o(e,i,n),{$control:s,$input:e,inputChangedDelegate:n}}var s,r,l,a,c,d;i.r(e),i.d(e,"createSearchControl",function(){return n}),s=i("aIyQ"),r=i.n(s),l=i("Ald9"),a=i("G0+C"),c=i("EulZ"),d=''+l+''+a+"
"},YTOR:function(t,e,i){t.exports={"i-match":"i-match-2pyl0dCc-"}},
qoI1:function(t,e,i){function o(t){var e=n(t);return i(e)}function n(t){var e,i=s[t];if(!(i+1))throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e;return i}var s={"./en-gb":"Oaa7","./en-gb.js":"Oaa7","./es":"iYuL","./es.js":"iYuL","./it":"bpih","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./ko":"Ivi+","./ko.js":"Ivi+","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ru":"lXzo","./ru.js":"lXzo","./tr":"DoHr","./tr.js":"DoHr"};o.keys=function(){return Object.keys(s)},o.resolve=n,t.exports=o,o.id="qoI1"},rMPu:function(t,e,i){t.exports={"css-value-list-dialog-item-height":"30px","list-dialog":"list-dialog-1sgWMCbw-","list-dialog__items-list-container":"list-dialog__items-list-container-3udN82S7-","list-dialog__columns-row":"list-dialog__columns-row-3aXi_jqm-","list-dialog__empty-list":"list-dialog__empty-list-3-j_iMIA-","list-dialog__sort-wrap":"list-dialog__sort-wrap-1I15ultt-","list-dialog__sort-box":"list-dialog__sort-box-YtT0TZlJ-","list-dialog__row":"list-dialog__row-2uvnOH0w-","list-dialog__row--header":"list-dialog__row--header-3X78INHz-","list-dialog__row--item":"list-dialog__row--item-JC8p2W7Z-","list-dialog__row--item-active":"list-dialog__row--item-active-1KBCgO8t-","list-dialog__column":"list-dialog__column-19ZOQoKP-","list-dialog__column--header":"list-dialog__column--header-3SOUE3EQ-","list-dialog__column--header-active":"list-dialog__column--header-active-g3V-G5Px-","list-dialog__column--caret":"list-dialog__column--caret-UwNizK99-","list-dialog__favorite-icon":"list-dialog__favorite-icon-D64HiVDN-","list-dialog__remove-icon":"list-dialog__remove-icon-2jI_v983-","list-dialog__favorite-icon--starred":"list-dialog__favorite-icon--starred-3YY_YpZL-"}}}]);