!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a8523b76-022f-41fa-bf43-1617be9e5d01",t._sentryDebugIdIdentifier="sentry-dbid-a8523b76-022f-41fa-bf43-1617be9e5d01")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[702],{13209:function(t,o,e){Promise.resolve().then(e.t.bind(e,19167,23)),Promise.resolve().then(e.bind(e,99413)),Promise.resolve().then(e.t.bind(e,95424,23)),Promise.resolve().then(e.bind(e,88047)),Promise.resolve().then(e.bind(e,17006)),Promise.resolve().then(e.bind(e,26420)),Promise.resolve().then(e.bind(e,62682))},99413:function(t,o,e){"use strict";e.r(o),e.d(o,{default:function(){return GridLayout}});var n,i=e(60230),r=e(57437),l=e(6438),c=e(5805),a=e(2265),s=e(90341);function _templateObject(){let t=(0,i._)(["\n height: 100%;\n padding: 40px 40px 0 40px;\n display: flex;\n flex-direction: column;\n align-items: center;\n\n @media screen and (min-width: ","){\n padding: 32px 32px 0 32px;\n }\n"]);return _templateObject=function(){return t},t}let d=c.ZP.div.withConfig({componentId:"sc-372328cd-0"})(_templateObject(),s.rS.breakpoints.desktop.min);var p=e(18837);async function getPortfolios(){try{let t=await (0,p.Z)({url:"/api/v3/portfolios",method:"GET"});return t.data}catch(t){console.log(t)}}async function getPortfolio(t){try{let o=await (0,p.Z)({url:"/api/v3/portfolios/".concat(t),method:"GET"});return o.data}catch(t){console.log(t)}}async function getPortfolioHistory(t,o){try{let e=o.range?"range=".concat(o.range):"",n=await (0,p.Z)({url:"/api/v3/portfolios/".concat(t,"/history?").concat(e),method:"GET"});return n.data}catch(t){console.log(t)}}var u=e(75789);let roundAmountToInteger=t=>!t||Number.isInteger(t)?t:Math.round(t);var g=e(88047),f=e(83776),h=e(17884),icons_QuestionIcon=function(t){return(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,r.jsx)("rect",{width:"16",height:"16",rx:"8",fill:"#C6D5EA"}),(0,r.jsx)("path",{d:"M8.00065 9.15991V8.9491C8.00065 8.26633 8.42237 7.90485 8.84407 7.61367C9.25572 7.33253 9.66732 6.97108 9.66732 6.30839C9.66732 5.38465 8.92436 4.6416 8.00065 4.6416C7.07694 4.6416 6.33398 5.38465 6.33398 6.30839",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,r.jsx)("path",{d:"M7.99609 11.5596H8.00454",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})};function PortfolioProfitWidgetLg_style_templateObject(){let t=(0,i._)(["\n font-size: 16px;\n font-weight: 700;\n line-height: 160%;\n color: ",";\n"]);return PortfolioProfitWidgetLg_style_templateObject=function(){return t},t}function _templateObject1(){let t=(0,i._)(["\n @layer largeWidgetTitle {\n font-size: 24px;\n font-style: normal;\n font-weight: 400;\n line-height: 120%;\n color: ",";\n }\n"]);return _templateObject1=function(){return t},t}function _templateObject2(){let t=(0,i._)(["\n width: 100%;\n margin: 0 auto;\n padding: 4px;\n max-height: 32px;\n display: flex;\n flex-direction: 'row';\n align-items: center;\n justify-content: center;\n gap: 4px;\n border-radius: 8px;\n background-color: ",";\n\n & button {\n width: 100%;\n }\n"]);return _templateObject2=function(){return t},t}function _templateObject3(){let t=(0,i._)(["\n height: auto;\n padding: 4px 12px;\n background-color: ",";\n color: ",";\n font-size: 12px;\n line-height: 130%;\n border: 0;\n border-radius: 4px;\n"]);return _templateObject3=function(){return t},t}function _templateObject4(){let t=(0,i._)(["\n display: flex;\n padding: 4px 11px;\n justify-content: center;\n align-items: flex-start;\n border-radius: 16px;\n font-size: 14px;\n line-height: 140%;\n background-color: ",";\n color: ",";\n"]);return _templateObject4=function(){return t},t}function _templateObject5(){let t=(0,i._)(["\n width: 340px;\n max-height: 32px;\n margin-top: auto;\n border-radius: 8px 8px 0 0;\n background-color: ",";\n cursor: default;\n"]);return _templateObject5=function(){return t},t}function _templateObject6(){let t=(0,i._)(["\n background-color: #ecf1f7;\n"]);return _templateObject6=function(){return t},t}function _templateObject7(){let t=(0,i._)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n color: #c6d5ea;\n background-color: #ecf1f7;\n border-radius: 4px;\n border: 0;\n cursor: pointer;\n\n"]);return _templateObject7=function(){return t},t}function _templateObject8(){let t=(0,i._)(["\n ","\n"]);return _templateObject8=function(){return t},t}function _templateObject9(){let t=(0,i._)(["\n ","\n"]);return _templateObject9=function(){return t},t}function _templateObject10(){let t=(0,i._)(["\n margin-bottom: 24px;\n cursor: default;\n"]);return _templateObject10=function(){return t},t}function _templateObject11(){let t=(0,i._)(["\n cursor: default;\n"]);return _templateObject11=function(){return t},t}function _templateObject12(){let t=(0,i._)(["\n &:focus {\n outline: none;\n border: none;\n }\n\n &:focus-visible {\n outline: 2px solid #0f75fc;\n }\n"]);return _templateObject12=function(){return t},t}let m=c.ZP.p.withConfig({componentId:"sc-9c4c43c-0"})(PortfolioProfitWidgetLg_style_templateObject(),s.rS.colors.text.darkBlue),x=(0,c.ZP)(g.Title3).withConfig({componentId:"sc-9c4c43c-1"})(_templateObject1(),s.rS.colors.text.title),b=c.ZP.div.withConfig({componentId:"sc-9c4c43c-2"})(_templateObject2(),s.rS.colors.input.color),P=(0,c.ZP)(f.zx).withConfig({componentId:"sc-9c4c43c-3"})(_templateObject3(),t=>{let{isActive:o}=t;return o?s.rS.colors.white:s.rS.colors.input.color},s.rS.colors.text.darkBlue),y=c.ZP.div.withConfig({componentId:"sc-9c4c43c-4"})(_templateObject4(),t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.successLigth):"".concat(s.rS.colors.notification.errorLight)},t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.success):"".concat(s.rS.colors.notification.error)}),S=c.ZP.div.withConfig({componentId:"sc-9c4c43c-5"})(_templateObject5(),s.rS.colors.input.color);(0,c.ZP)(f.zx).withConfig({componentId:"sc-9c4c43c-6"})(_templateObject6());let j=(0,c.iv)(_templateObject7()),w=(0,c.ZP)("button").withConfig({componentId:"sc-9c4c43c-7"})(_templateObject8(),j),_=(0,c.ZP)("button").withConfig({componentId:"sc-9c4c43c-8"})(_templateObject9(),j),C=(0,c.ZP)(h.Stack).withConfig({componentId:"sc-9c4c43c-9"})(_templateObject10()),v=(0,c.ZP)(h.Stack).withConfig({componentId:"sc-9c4c43c-10"})(_templateObject11()),k=(0,c.ZP)(icons_QuestionIcon).withConfig({componentId:"sc-9c4c43c-11"})(_templateObject12());var I=e(26420),A=e(16691),O=e.n(A),M=e(85739);let CoinsListWidget=t=>{let{coins:o,listPage:e}=t,n=o.length%4,i=Math.ceil(o.length/4),l=n<1?4*i-n:o.length,c=4*e,a=o.slice(c,c+4>=l?l:c+4);return(0,r.jsx)("ul",{style:{width:"100%",marginBottom:"20px",height:"144px"},children:a.sort((t,o)=>parseFloat(o.percentage)-parseFloat(t.percentage)).map((t,o,e)=>{var n;return(0,r.jsxs)("li",{style:{display:"flex",flexDirection:"row",marginBottom:o!==e.length-1?"16px":"0px"},children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:10,children:[(0,r.jsx)(O(),{style:{width:"24px",height:"24px"},width:24,height:24,src:(null==t?void 0:null===(n=t.currencyEntity)||void 0===n?void 0:n.cmcTicker)!==""?"https://static.simpleswap.io/images/currencies-logo/"+"".concat(t.currencyEntity.cmcTicker,".svg"):"",alt:"coin in list"}),(t.currencyEntity.cmcTicker.length>6||t.currencyEntity.name.length>12)&&(0,r.jsx)(M.u,{anchorSelect:".coinList-ticker-".concat(o),content:t.currencyEntity.cmcTicker.toUpperCase(),place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(I.Text14,{className:"coinList-ticker-".concat(o),style:{color:"".concat(s.rS.colors.text.darkBlue),maxWidth:"42px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},children:t.currencyEntity.cmcTicker.toUpperCase()}),t.currencyEntity.name.length>12&&(0,r.jsx)(M.u,{anchorSelect:".coinList-fullName-".concat(o),content:t.currencyEntity.name,place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(I.Text14,{className:"coinList-fullName-".concat(o),style:{color:"".concat(s.rS.colors.text.nullLabel),maxWidth:"72px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},children:t.currencyEntity.name})]}),(0,r.jsxs)(I.Text14,{style:{marginLeft:"auto",color:"".concat(s.rS.colors.text.darkBlue)},children:[t.percentage,"%"]})]},t.id)})})};var L=e(30116),W=e(55090),N=e(91371),Z=e(96704),T=e(55281),z=e(20105),D=e(27470);Z.kL.register(Z.uw,Z.f$,Z.od,Z.jn,Z.Dx,Z.u,Z.Gu,D.ZP);let roundPriceAmount=t=>Number.isNaN(t)||0===t||Number.isInteger(t)?t:t.toFixed(2),transformHistoryAmountData=t=>{if(Array.isArray(t))return t.map(t=>roundPriceAmount(Number(t.price)))},B=[{id:"hoverXLine",defaults:{width:1,color:"#7CB2F9",dash:[3,4]},afterInit:t=>{t.hoverXLine={x:0}},afterEvent:(t,o)=>{let{inChartArea:e}=o,{x:n}=o.event;t.hoverXLine={x:n,draw:e},t.draw()},afterDatasetDraw:(t,o,e)=>{let{ctx:n}=t,{top:i,bottom:r}=t.chartArea,{x:l,draw:c}=t.hoverXLine;c&&null!==l&&(n.save(),n.setLineDash(e.dash),n.beginPath(),n.lineWidth=e.width,n.strokeStyle=e.color,n.moveTo(l,r),n.lineTo(l,i),n.stroke(),n.restore())}}];var Charts_ProfitLineChart=t=>{var o,e;let{historyData:n,range:i,gradientWeightY1:l=0}=t,c=(0,a.useRef)(),d=null!==(o=(t=>{if(Array.isArray(t))return t.map(t=>(0,T.Z)(new Date(t.createdAt),"LLL dd"))})(null==n?void 0:n.history))&&void 0!==o?o:[],p={labels:d,datasets:[{fill:!0,label:"Profit",data:null!==(e=transformHistoryAmountData(null==n?void 0:n.history))&&void 0!==e?e:[],borderColor:"".concat(s.rS.colors.text.base),borderWidth:1.5,backgroundColor:()=>{var t;let o=null===(t=document.getElementById("profit-line-chart"))||void 0===t?void 0:t.getContext("2d");if(null===o)return;let e=o.createLinearGradient(0,0,0,l);return e.addColorStop(0,"rgba(15, 117, 252, 0.50)"),e.addColorStop(.7,"rgba(15, 117, 252, 0.00)"),e.addColorStop(.8,"rgba(252, 252, 252, 0.00)"),o.fillStyle=e,e},tension:.2,pointBackgroundColor:"#fff",pointRadius:0,pointHoverBackgroundColor:"#0F75FC",pointHoverRadius:10}]},u={responsive:!0,interaction:{intersect:!1,mode:"nearest",axis:"x",includeInvisible:!1},scales:{x:{display:!0,grid:{display:!1,drawTicks:!0},offset:!0,border:{width:0,dash:[],dashOffset:0,display:!0},ticks:{font:{family:"Inter",size:10,weight:"200",lineHeight:1.3},color:"".concat(s.rS.colors.text.nullLabel)}},y:{display:!1,offset:!0,grid:{display:!1}}},plugins:{tooltip:{corenerRadius:4,displayColors:!1,bodyFontSize:10,backgroundColor:s.rS.colors.white,borderColor:s.rS.colors.primaryWhite,borderWidth:.7,callbacks:{title:()=>"",label:t=>{var o;let e=null===(o=n.history[t.dataIndex])||void 0===o?void 0:o.createdAt;return"Date: ".concat((0,T.Z)(new Date(e),"LLL")," ").concat((0,T.Z)(new Date(e),"dd"),", ").concat((0,T.Z)(new Date(e),"yyyy"))},footer:t=>{var o;return"Value: ".concat(null===(o=t[0])||void 0===o?void 0:o.formattedValue,"$")},labelTextColor:()=>"".concat(s.rS.colors.text.darkBlue)},footerColor:s.rS.colors.text.darkBlue,footerFont:{weight:"normal"}},hoverXLine:{width:1,color:"#7CB2F9",dash:[3,4]},zoom:{zoom:{mode:"x",wheel:{enabled:!0,speed:1e-4},pinch:{enabled:!0}},limits:{x:{minRange:4},y:{minRange:4}},pan:{},animation:{duration:1e3,easing:"easeOutCubic"}}}};return(0,r.jsx)(z.x1,{style:{cursor:"pointer",width:"100%"},ref:c,datasetIdKey:"profit",data:p,id:"profit-line-chart",options:u,plugins:B})},R=e(4202),E=e(1807);e(36250);var H=e(62545),F=e(88356);Z.kL.register(Z.qi),Z.kL.register(Z.tt),Z.kL.register(Z.u),Z.kL.register(Z.wL);let U={data:[],backgroundColor:[],hoverOffset:0,spacing:1,borderRadius:8,borderAlign:"center",borderJoinStyle:"round",offset:4},G={labels:[],label:"Portfolio",datasets:[],realAmount:[],coinName:[],coinStoreIds:[],logos:[]},PieChart=t=>{let{portfolioData:o,setLegendData:e,fiatValue:n,pieKey:i}=t,l=(0,R.T)(),c=(0,a.useRef)(),d=(0,a.useRef)(null),[p,u]=(0,a.useState)(""),g=(0,R.C)(E.KB),f=(0,R.C)(E.J2),h=(0,R.C)(E.xq),[m,x]=(0,a.useState)(G),b={plugins:{tooltip:{backgroundColor:s.rS.colors.text.title,bodyFontSize:14,corenerRadius:4,displayColors:!1,callbacks:{title:()=>"",label:t=>{let o=t.dataIndex,e=G.coinName[o],n=G.labels[o],i="".concat(n," ").concat(e);return i}},enabled:!1,external:t=>{var o,e,n,i;let[r,l,c,a]=[t.tooltip.dataPoints[0].label,t.tooltip.dataPoints[0].formattedValue,t.tooltip.dataPoints[0].dataIndex,t.tooltip.dataPoints[0].dataset],s=document.getElementById("piechart-profit-tooltip-".concat(c)),p='\n
\n
\n coin in pie chart\n
\n
\n

').concat(null!==(n=null==r?void 0:null===(o=r.ticker)||void 0===o?void 0:o.toUpperCase())&&void 0!==n?n:"unknown",'

\n
\n
\n ').concat(l,"%\n
\n
\n ");null==s&&((s=document.createElement("div")).id="piechart-profit-tooltip-".concat(c),s.dataset.tooltipId="piechart-portfolio-tooltip-".concat(c),s.dataset.tooltipHtml=p,document.body.appendChild(s));let g=t.tooltip;if(0===g.opacity){s.dataset.tooltipHtml="",null===(i=d.current)||void 0===i||i.close();return}let f=t.chart.canvas.getBoundingClientRect();s.dataset.tooltipHtml=p,s.style.position="absolute",s.style.left=f.left+window.scrollX+g.caretX+"px",s.style.top=f.top+window.scrollY+g.caretY+"px",null===(e=d.current)||void 0===e||e.open(),u(c)}}}},clearDatasetItem=()=>{U.data=[],U.backgroundColor=[]},clearChartData=()=>{G.labels=[],G.datasets=[],G.realAmount=[],G.coinName=[],G.coinStoreIds=[],G.logos=[]},P=(0,a.useCallback)(t=>{g&&(clearChartData(),clearDatasetItem(),t.forEach(t=>{G.labels.push({ticker:t.currencyEntity.cmcTicker,fullName:t.currencyEntity.name}),G.coinName.push(t.currencyEntity.name),G.realAmount.push(Number(n)*t.percentage/100),G.coinStoreIds.push(t.id),U.data.push(t.percentage),U.backgroundColor.push(h[t.currencyEntity.cmcTicker.toLowerCase()])}),G.datasets.push(U),x(G),l(F.K.revalidatePortfolio(!1)))},[h,l,n,g]);return(0,a.useEffect)(()=>{P(o)},[o,P]),m.datasets.length>0&&!f?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.u,{id:"piechart-portfolio-tooltip-".concat(p),opacity:1,ref:d,border:"1px solid "+"".concat(s.rS.colors.primaryWhite),style:{backgroundColor:"".concat(s.rS.colors.white),padding:"8px 12px",borderRadius:"8px",boxShadow:"0px 8px 16px -6px #18274B14"}},"piechart-portfolio-tooltip-".concat(p)),(0,r.jsx)(z.by,{style:{cursor:"pointer"},ref:c,datasetIdKey:null!=i?i:"pie1",data:m,options:b,onClick:t=>{t.stopPropagation();let[o]=(0,z.cX)(c.current,t),n=o.index;e(t=>({...t,isOpen:!0,coinId:G.coinStoreIds[n],ticker:G.labels[n],name:G.coinName[n],percentage:U.data[n],realAmount:G.realAmount[n]}))}},"portfolio-pie-".concat(null!=i?i:"default"))]}):(0,r.jsx)(H.yk,{height:"100",width:"100",color:"#0f75fc",visible:!0})};function isPositive(t){return 1===Math.sign(t)}PieChart.displayName="PieChart";let Y=[{value:"",label:"All time"},{value:"7",label:"Weekly"},{value:"30",label:"30 days"}];function PortfolioSelectOption_style_templateObject(){let t=(0,i._)(["\n padding: 6px 12px;\n font-size: 12px;\n background-color :",";\n\n &:hover {\n ","\n }\n\n @media screen and (min-width: ","){\n font-size: 10px;\n}\n\n"]);return PortfolioSelectOption_style_templateObject=function(){return t},t}function PortfolioSelectOption_style_templateObject1(){let t=(0,i._)(["\n display: flex;\n padding: 4px 11px;\n justify-content: center;\n align-items: flex-start;\n border-radius: 16px;\n font-size: 12px;\n line-height: 140%;\n background-color: ",";\n color: ",";\n\n@media screen and (min-width: ","){\n font-size: 10px;\n}\n"]);return PortfolioSelectOption_style_templateObject1=function(){return t},t}let V=c.ZP.div.withConfig({componentId:"sc-5fc6ee4f-0"})(PortfolioSelectOption_style_templateObject(),t=>{let{isActive:o}=t;return o?"#d7e2f0":"#ffffff"},t=>{let{isActive:o}=t;return!o&&"cursor: pointer; background-color: #f2f7fe;"},s.rS.breakpoints.desktop.min),K=c.ZP.div.withConfig({componentId:"sc-5fc6ee4f-1"})(PortfolioSelectOption_style_templateObject1(),t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.successLigth):"".concat(s.rS.colors.notification.errorLight)},t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.success):"".concat(s.rS.colors.notification.error)},s.rS.breakpoints.desktop.min);function PinButton_styles_templateObject(){let t=(0,i._)(["\n cursor: pointer;\n\n &:hover {\n color: ",";\n }\n"]);return PinButton_styles_templateObject=function(){return t},t}let J=(0,c.ZP)(h.Stack).withConfig({componentId:"sc-e4efd7de-0"})(PinButton_styles_templateObject(),s.rS.colors.text.darkBlue);var icons_PinIcon=function(t){return(0,r.jsxs)("svg",{...t,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M14.3283 6.34321L11.8971 8.77438C11.8704 8.80116 11.8312 8.81061 11.7952 8.79887C10.7594 8.46122 9.11255 8.13695 7.43791 9.70279C7.35723 9.77823 7.35695 9.9053 7.43506 9.9834C8.86694 11.4153 12.3222 14.8706 13.5178 16.0662C13.5959 16.1443 13.7217 16.1427 13.7972 16.062C15.363 14.3874 15.0387 12.7406 14.7011 11.7048C14.6893 11.6688 14.6988 11.6296 14.7256 11.6028L17.1567 9.17163",stroke:"#0F75FC","stroke-width":"1.5","stroke-linecap":"round"}),(0,r.jsx)("path",{d:"M10.4766 13.0239L7.25801 16.2425",stroke:"#0F75FC","stroke-width":"1.5","stroke-linecap":"round"}),(0,r.jsx)("path",{d:"M13.2676 5.28247L18.2173 10.2322",stroke:"#0F75FC","stroke-width":"1.5","stroke-linecap":"round"})]})},icons_PushPinnedIcon=function(t){return(0,r.jsxs)("svg",{...t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M6.43034 6.50737L6.43034 4.23584L9.09701 4.23584L9.09701 6.50737C9.09701 6.54525 9.11832 6.57974 9.15202 6.59703C9.78892 6.92368 10.6836 7.53609 10.7586 9.00083C10.7643 9.11115 10.6751 9.20136 10.5647 9.20136L4.96211 9.20136C4.85165 9.20136 4.76307 9.11115 4.76872 9.00083C4.84376 7.53609 5.73843 6.92368 6.37532 6.59703C6.40903 6.57974 6.43034 6.54525 6.43034 6.50737Z",fill:"#0F75FC",stroke:"#0F75FC","stroke-width":"1.5","stroke-linecap":"round"}),(0,r.jsx)("path",{d:"M7.76367 9.20117L7.76367 12.2357",stroke:"#0F75FC","stroke-width":"1.5","stroke-linecap":"round"}),(0,r.jsx)("path",{d:"M5.43164 4.23584L10.0983 4.23584",stroke:"#0F75FC","stroke-width":"1.5","stroke-linecap":"round"})]})};let useSaveItemInLocalStorage=t=>{let[o,e]=(0,a.useState)(void 0),getItemFromLS=t=>{var o;e(null!==(o=localStorage.getItem(t))&&void 0!==o?o:null)},removeFromLS=t=>{localStorage.removeItem(t)};return(0,a.useEffect)(function(){void 0!==window&&getItemFromLS(t)},[t]),[o,o=>{if(void 0!==window){if(localStorage.getItem(t)===o){removeFromLS(t);return}localStorage.setItem(t,o)}}]},useSaveArrayInLocalStorage=t=>{let[o,e]=(0,a.useState)(void 0),n=(0,a.useCallback)(t=>{let o=[],n=localStorage.getItem(t);null!==n?e(JSON.parse(n)):(e(o),localStorage.setItem(t,JSON.stringify(o)))},[]),i=(0,a.useCallback)(o=>{let n=localStorage.getItem(t);if(null!==n){let i=JSON.parse(n),r=i.filter(t=>t!==o);localStorage.setItem(t,JSON.stringify(r)),e(r)}},[t]),r=(0,a.useCallback)(o=>{if(void 0!==window){let n=localStorage.getItem(t);if(null!==n){let i=JSON.parse(n);if(i.includes(o))return;let r=[...i,o],l=JSON.stringify(r);localStorage.setItem(t,l),e(r)}else{let n=JSON.stringify([o]);localStorage.setItem(t,n),e([o])}}},[t]);return(0,a.useEffect)(function(){void 0!==window&&n(t)},[n,t]),[o,r,i,()=>{localStorage.removeItem(t)}]},Q=(0,a.createContext)(),PinContextProvider=t=>{let{children:o,defaultBtn:e}=t,[n,i]=(0,a.useState)(e);return(0,r.jsx)(Q.Provider,{value:{getPinnedBtn:t=>n===t?n:null,addPinnedBtn:t=>{i(t)},removePinnedBtn:t=>{n===t&&i(null)}},children:o})};var components_PinButton=t=>{let{id:o,isPin:e,togglePinPortfolio:n,widgetId:i,selectedPortfolioId:l}=t,{getPinnedBtn:c,addPinnedBtn:d,removePinnedBtn:p}=(0,a.useContext)(Q),[u,g,f]=useSaveArrayInLocalStorage("pinnedWidgets");return(0,r.jsxs)(a.Fragment,{children:[!c(o)&&(0,r.jsxs)(J,{direction:"row",style:{marginLeft:"auto"},className:"pin-unpin-widget-".concat(o),onTouchEnd:t=>{t.stopPropagation(),t.preventDefault(),n(t,!0,g,f),d(o)},onMouseUp:t=>{t.stopPropagation(),t.defaultPrevented||(n(t,!0,g,f),d(o))},children:[(0,r.jsx)("p",{style:{color:"".concat(s.rS.colors.text.base)},children:"Pin"}),(0,r.jsx)(icons_PinIcon,{})]},o),c(o)&&(0,r.jsxs)(J,{direction:"row",style:{marginLeft:"auto"},className:"pin-unpin-widget-".concat(o),onTouchEnd:t=>{t.stopPropagation(),t.preventDefault(),n(t,!1,g,f),p(o)},onMouseUp:t=>{t.stopPropagation(),t.defaultPrevented||(n(t,!1,g,f),p(o))},children:[(0,r.jsx)("p",{style:{color:"".concat(s.rS.colors.text.base)},children:"Unpin"}),(0,r.jsx)(icons_PushPinnedIcon,{})]},o),(0,r.jsx)(M.u,{anchorSelect:".pin-unpin-widget-".concat(o),content:"".concat(c(o)?"Unpin":"Pin"," this portfolio"),place:"bottom",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}})]},o)},components_PortfolioSelectOption=t=>{let{cx:o,children:e,getStyles:n,innerRef:i,value:l,selectProps:{selectedPortfolio:a,setSelectedPortfolio:s,togglePinPortfolio:d,pinnedPortfolioId:p,widgetId:u,isPinnedWidget:g,setListPage:f},data:m,...x}=t,b=isPositive(null==m?void 0:m.percentageDif),P=isPositive(null==m?void 0:m.amountDif),y=l===a;return(0,r.jsx)(V,{ref:i,isActive:y,className:o((0,c.iv)(n("option",x)),{option:!0}),onClick:()=>{s(l),f(0)},children:(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,alignItems:"center",style:{width:"100%"},children:[e,(0,r.jsxs)(K,{isPositive:b,style:{marginLeft:"auto",marginRight:"4px"},children:[b?"+":"",null==m?void 0:m.percentageDif,"%"]}),(0,r.jsxs)(K,{isPositive:P,style:{marginRight:"8px"},children:[P?"+":"",null==m?void 0:m.amountDif,"$"]}),(0,r.jsx)(h.Stack,{direction:"row",style:{cursor:y?"default":"pointer",width:"52px"},children:(0,r.jsx)(components_PinButton,{id:"".concat(u,"-").concat(l),isPin:l===p,togglePinPortfolio:(t,o,e,n)=>{t.stopPropagation(),d(l),l!==a&&(s(l),f(0)),l===p?n(u):g||e(u)},widgetId:u,selectedPortfolioId:a})})]})})},lg_PortfolioProfitWidgetLg=t=>{var o;let{portfolio:e,coinsView:n,toggleCoinsView:i,setLegendValue:l,listPage:c,setListPage:a,legend:d,setChartTimeRange:p,setSelectedPortfolio:u,roundedAmount:g,roundedPercent:f,createdValues:j,widgetId:A,portfolioHistory:O,chartTimeRange:Z,selectedPortfolioId:T,pinnedPortfolioId:z,isLoadingPortfolios:D,isPinnedWidget:B,isPinnedPortfolio:R,gradientWeightY1:E,togglePinPortfolio:H}=t;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(PinContextProvider,{defaultBtn:R?"".concat(A,"-").concat(null!=T?T:""):null,children:[(0,r.jsxs)(C,{direction:"row",alignItems:"flex-start",spacing:98,style:{width:"100%"},onClick:t=>{t.stopPropagation()},onMouseDown:t=>{t.stopPropagation()},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(x,{children:e.name}),(0,r.jsx)(I.Text14,{style:{color:"".concat(s.rS.colors.text.darkBlue)},children:e.description})]}),(0,r.jsx)(components_PinButton,{id:"".concat(A,"-").concat(null!=T?T:""),isPin:R,togglePinPortfolio:(t,o,e,n)=>{t.stopPropagation(),o?(e(A),H(T),a(0)):(n(A),H(T))},widgetId:A,selectedPortfolioId:T})]}),(0,r.jsxs)(v,{spacing:32,direction:"row",onMouseDown:t=>{t.stopPropagation()},children:[(0,r.jsxs)(h.Stack,{direction:"column",style:{maxHeight:"240px",width:"200px"},children:["chart"===n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,style:{width:"100%",marginBottom:"20px"},onClick:t=>{t.stopPropagation()},children:[(0,r.jsx)(m,{children:"Piechart"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-piechart",content:"The share of coins in your portfolio",place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(k,{role:"button",tabIndex:0,className:"info-about-piechart"})]}),(0,r.jsx)(h.Stack,{justifyContent:"center",style:{width:"165px",height:"150px",marginBottom:"20px"},children:(0,r.jsx)(PieChart,{portfolioData:e.portfolioCurrencyEntityList,pieKey:e.id.toString(),setLegendData:l,fiatValue:1e3})})]}),"list"===n&&void 0!==e.portfolioCurrencyEntityList&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,style:{width:"100%",marginBottom:"20px"},children:[(0,r.jsx)(m,{children:"Coin list"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-coinlist",content:"The share of coins in your portfolio",place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(k,{role:"button",tabIndex:0,className:"info-about-coinlist"}),(0,r.jsxs)(h.Stack,{style:{marginLeft:"auto"},children:[(0,r.jsx)(w,{style:{marginRight:"8px",...0!==c?{color:"#859ab5",backgroundColor:"#e4ebf3"}:{}},onClick:t=>{t.stopPropagation(),a(t=>t-1>=0?t-1:t)},children:(0,r.jsx)(L.Z,{width:20,height:20})}),(0,r.jsx)(_,{style:{...c+1{t.stopPropagation(),a(t=>{var o;return t+1{t.stopPropagation(),i("chart")},children:"Piechart"}),(0,r.jsx)(P,{isActive:"list"===n,onClick:t=>{t.stopPropagation(),i("list")},children:"Coin list"})]})]}),(0,r.jsxs)(h.Stack,{direction:"column",style:{width:"426px",height:"240px"},children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,alignItems:"flex-start",style:{width:"100%"},children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,children:[(0,r.jsx)(m,{children:"Profit graph"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-linechart",content:"Changes in the total portfolio price over the selected period",place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(k,{role:"button",tabIndex:0,className:"info-about-linechart"})]}),(0,r.jsx)(M.u,{anchorSelect:".return-on-investment",content:"Return on investment",place:"bottom",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsxs)(y,{className:"return-on-investment",isPositive:isPositive(null==O?void 0:O.percentage),style:{marginLeft:"auto",marginRight:"4px"},children:[isPositive(null==O?void 0:O.percentage)?"+":"",f,"%"]}),(0,r.jsxs)(y,{isPositive:isPositive(null==O?void 0:O.difference),style:{marginRight:"8px"},children:[isPositive(null==O?void 0:O.difference)?"+":"",g,"$"]}),(0,r.jsx)(N.ZP,{className:"profit-time-range",classNamePrefix:"select",name:"time range",options:Y,defaultValue:Y[0],onChange:t=>{let{value:o,label:e}=t;p(o.toString())},isSearchable:!1,hideSelectedOptions:!1,backspaceRemovesValue:!1,isClearable:!1,styles:{container:t=>({...t,borderRadius:"8px",maxHeight:"28px"}),indicatorSeparator:()=>({display:"none"}),valueContainer:t=>({...t,backgroundColor:"".concat(s.rS.colors.input.color),alignItems:"center"}),control:t=>({...t,border:0,boxShadow:"none",backgroundColor:"".concat(s.rS.colors.input.color),height:"28px",minHeight:"unset"}),singleValue:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel),fontSize:"10px"}),dropdownIndicator:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel),padding:0,height:"20px",width:"20px"}),indicatorsContainer:t=>({...t,height:"100%"}),option:t=>({...t,fontSize:"10px"}),menu:t=>({...t,borderRadius:"8px"})}})]}),(0,r.jsx)(Charts_ProfitLineChart,{historyData:O,gradientWeightY1:E,range:"7"===Z?"week":"30"===Z?"month":"all"})]})]}),(0,r.jsx)(S,{onClick:t=>{t.stopPropagation()},onMouseDown:t=>{t.stopPropagation()},children:(0,r.jsx)(N.ZP,{className:"portfolios-dropdown",name:"all portfolios",options:null!=j?j:[],backspaceRemovesValue:!1,pinnedPortfolioId:z,placeholder:"Show other portfolios",controlShouldRenderValue:!1,hideSelectedOptions:!1,onChange:()=>!1,isLoading:D,isPinnedWidget:B,isClearable:!1,isSearchable:!1,togglePinPortfolio:H,setSelectedPortfolio:u,selectedPortfolio:T,setListPage:a,widgetId:A,styles:{container:t=>({...t,borderRadius:"8px 8px 0 0",maxHeight:"32px"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:()=>({display:"none"}),valueContainer:t=>({...t,backgroundColor:"".concat(s.rS.colors.input.color),fontSize:"10px",display:"flex",justifyContent:"center",":before":{content:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgb3BhY2l0eT0iMC44Ij4KPHBhdGggZD0iTTQuNjY2MDIgNi42NjY3NUw3Ljk5OTM1IDEwLjAwMDFMMTEuMzMyNyA2LjY2Njc1IiBzdHJva2U9IiM4NTlBQjUiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8L3N2Zz4K)",marginRight:"auto",width:"16px",height:"16px"},":after":{content:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgb3BhY2l0eT0iMC44Ij4KPHBhdGggZD0iTTQuNjY2MDIgNi42NjY3NUw3Ljk5OTM1IDEwLjAwMDFMMTEuMzMyNyA2LjY2Njc1IiBzdHJva2U9IiM4NTlBQjUiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8L3N2Zz4K)",marginLeft:"auto",width:"16px",height:"16px"}}),control:t=>({...t,padding:"8px 12px 8px 16px",height:"32px",minHeight:0,border:0,boxShadow:"none",backgroundColor:"".concat(s.rS.colors.input.color)}),placeholder:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel)}),menuPortal:t=>({...t,zIndex:9999,border:0,backgroundColor:"transparent"}),menuList:t=>({...t,padding:"0",border:"1px solid ".concat(s.rS.colors.input.color),backgroundColor:"".concat(s.rS.colors.white),borderRadius:"8px"}),menu:t=>({...t,padding:0,border:0,boxShadow:"unset",backgroundColor:"unset"}),option:t=>({...t,color:"".concat(s.rS.colors.text.title)})},menuPortalTarget:document.body,components:{Option:components_PortfolioSelectOption}})})]})})};function PortfolioProfitWidgetMd_style_templateObject(){let t=(0,i._)(["\n font-size: 24px;\n font-weight: 700;\n line-height: 160%;\n color: ",";\n"]);return PortfolioProfitWidgetMd_style_templateObject=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject1(){let t=(0,i._)(["\n /* font-family: 'Popins, sans-serif'; */\n @layer widgetTitle {\n font-size: 32px;\n font-style: normal;\n font-weight: 400;\n line-height: 120%;\n color: ",";\n }\n"]);return PortfolioProfitWidgetMd_style_templateObject1=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject2(){let t=(0,i._)(["\n width: 100%;\n margin: 0 auto;\n padding: 4px;\n max-height: 32px;\n display: flex;\n flex-direction: 'row';\n align-items: center;\n justify-content: center;\n gap: 4px;\n border-radius: 8px;\n background-color: ",";\n\n & button {\n width: 100%;\n }\n"]);return PortfolioProfitWidgetMd_style_templateObject2=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject3(){let t=(0,i._)(["\n height: auto;\n padding: 4px 12px;\n background-color: ",";\n color: ",";\n font-size: 12px;\n line-height: 130%;\n border: 0;\n border-radius: 4px;\n"]);return PortfolioProfitWidgetMd_style_templateObject3=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject4(){let t=(0,i._)(["\n display: flex;\n height: 40px;\n padding: 4px 16px;\n justify-content: center;\n align-items: center;\n border-radius: 16px;\n font-size: 16px;\n line-height: 140%;\n background-color: ",";\n color: ",";\n"]);return PortfolioProfitWidgetMd_style_templateObject4=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject5(){let t=(0,i._)(["\n width: 340px;\n max-height: 32px;\n margin-top: auto;\n border-radius: 8px 8px 0 0;\n background-color: ",";\n cursor: default;\n"]);return PortfolioProfitWidgetMd_style_templateObject5=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject6(){let t=(0,i._)(["\n background-color: #ecf1f7;\n"]);return PortfolioProfitWidgetMd_style_templateObject6=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject7(){let t=(0,i._)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n color: #c6d5ea;\n background-color: #ecf1f7;\n border-radius: 4px;\n border: 0;\n cursor: pointer;\n\n"]);return PortfolioProfitWidgetMd_style_templateObject7=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject8(){let t=(0,i._)(["\n ","\n"]);return PortfolioProfitWidgetMd_style_templateObject8=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject9(){let t=(0,i._)(["\n ","\n"]);return PortfolioProfitWidgetMd_style_templateObject9=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject10(){let t=(0,i._)(["\n margin-bottom: 24px;\n cursor: default;\n"]);return PortfolioProfitWidgetMd_style_templateObject10=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject11(){let t=(0,i._)(["\n min-width: 514px;\n width: 100%;\n height: 286px;\n cursor: default;\n\n"]);return PortfolioProfitWidgetMd_style_templateObject11=function(){return t},t}function PortfolioProfitWidgetMd_style_templateObject12(){let t=(0,i._)(["\n cursor: pointer;\n\n &:hover {\n color: ",";\n }\n"]);return PortfolioProfitWidgetMd_style_templateObject12=function(){return t},t}function _templateObject13(){let t=(0,i._)(["\n &:focus {\n outline: none;\n border: none;\n }\n\n &:focus-visible {\n outline: 2px solid #0f75fc;\n }\n"]);return _templateObject13=function(){return t},t}let X=c.ZP.p.withConfig({componentId:"sc-5423baa5-0"})(PortfolioProfitWidgetMd_style_templateObject(),s.rS.colors.text.darkBlue),$=(0,c.ZP)(g.Title3).withConfig({componentId:"sc-5423baa5-1"})(PortfolioProfitWidgetMd_style_templateObject1(),s.rS.colors.text.title);c.ZP.div.withConfig({componentId:"sc-5423baa5-2"})(PortfolioProfitWidgetMd_style_templateObject2(),s.rS.colors.input.color),(0,c.ZP)(f.zx).withConfig({componentId:"sc-5423baa5-3"})(PortfolioProfitWidgetMd_style_templateObject3(),t=>{let{isActive:o}=t;return o?s.rS.colors.white:s.rS.colors.input.color},s.rS.colors.text.darkBlue);let q=c.ZP.div.withConfig({componentId:"sc-5423baa5-4"})(PortfolioProfitWidgetMd_style_templateObject4(),t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.successLigth):"".concat(s.rS.colors.notification.errorLight)},t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.success):"".concat(s.rS.colors.notification.error)}),tt=c.ZP.div.withConfig({componentId:"sc-5423baa5-5"})(PortfolioProfitWidgetMd_style_templateObject5(),s.rS.colors.input.color);(0,c.ZP)(f.zx).withConfig({componentId:"sc-5423baa5-6"})(PortfolioProfitWidgetMd_style_templateObject6());let to=(0,c.iv)(PortfolioProfitWidgetMd_style_templateObject7()),te=(0,c.ZP)("button").withConfig({componentId:"sc-5423baa5-7"})(PortfolioProfitWidgetMd_style_templateObject8(),to),tn=(0,c.ZP)("button").withConfig({componentId:"sc-5423baa5-8"})(PortfolioProfitWidgetMd_style_templateObject9(),to),ti=(0,c.ZP)(h.Stack).withConfig({componentId:"sc-5423baa5-9"})(PortfolioProfitWidgetMd_style_templateObject10()),tr=c.ZP.div.withConfig({componentId:"sc-5423baa5-10"})(PortfolioProfitWidgetMd_style_templateObject11());(0,c.ZP)(h.Stack).withConfig({componentId:"sc-5423baa5-11"})(PortfolioProfitWidgetMd_style_templateObject12(),s.rS.colors.text.darkBlue);let tl=(0,c.ZP)(icons_QuestionIcon).withConfig({componentId:"sc-5423baa5-12"})(_templateObject13());var md_PortfolioProfitWidgetMd=t=>{var o;let{portfolio:e,isPinnedWidget:n,setLegendValue:i,listPage:l,setListPage:c,legend:a,setChartTimeRange:d,setSelectedPortfolio:p,togglePinPortfolio:u,selectedPortfolioId:g,roundedAmount:f,roundedPercent:m,createdValues:x,widgetId:b,portfolioHistory:P,chartTimeRange:y,isLoadingPortfolios:S,pinnedPortfolioId:j,isPinnedPortfolio:w,gradientWeightY1:_}=t;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(PinContextProvider,{defaultBtn:w?"".concat(b,"-").concat(null!=g?g:""):null,children:[(0,r.jsxs)(ti,{direction:"row",alignItems:"flex-start",spacing:98,style:{width:"100%"},onClick:t=>{t.stopPropagation()},onMouseDown:t=>{t.stopPropagation()},onTouchStart:t=>{t.stopPropagation()},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)($,{children:e.name}),(0,r.jsx)(I.Text16,{style:{color:"".concat(s.rS.colors.text.darkBlue)},children:e.description})]}),(0,r.jsx)(components_PinButton,{id:"".concat(b,"-").concat(null!=g?g:""),isPin:w,togglePinPortfolio:(t,o,e,n)=>{t.stopPropagation(),o?(e(b),u(g),c(0)):(n(b),u(g))},widgetId:b,selectedPortfolioId:g}),(0,r.jsx)(M.u,{anchorSelect:".pin-unpin-widget",content:"".concat(n?"Unpin":"Pin"," this widget"),place:"bottom",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}})]}),(0,r.jsxs)(h.Stack,{direction:"row",style:{maxHeight:"268px",width:"592px",marginBottom:"24px",justifyContent:"space-between"},children:[(0,r.jsxs)(h.Stack,{direction:"column",children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,style:{width:"100%",marginBottom:"20px"},onClick:t=>{t.stopPropagation()},onTouchStart:t=>{t.stopPropagation()},children:[(0,r.jsx)(X,{children:"Piechart"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-piechart_md",content:"The share of coins in your portfolio",openEvents:{click:!0},closeEvents:{click:!0},globalCloseEvents:{clickOutsideAnchor:!0},place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(tl,{role:"button",tabIndex:0,className:"info-about-piechart_md",width:20,height:20})]}),(0,r.jsx)(h.Stack,{justifyContent:"center",style:{width:"294px",height:"215px",marginBottom:"20px"},children:(0,r.jsx)(PieChart,{portfolioData:e.portfolioCurrencyEntityList,pieKey:e.id,setLegendData:i,fiatValue:1e3})})]}),(0,r.jsxs)(h.Stack,{direction:"column",style:{width:"215px",height:"280px"},children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,style:{width:"100%",marginBottom:"20px"},children:[(0,r.jsx)(X,{children:"Coin list"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-coinlist_md",content:"The share of coins in your portfolio",place:"top",openEvents:{click:!0},closeEvents:{click:!0},globalCloseEvents:{clickOutsideAnchor:!0},openOnClick:!0,style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(tl,{role:"button",tabIndex:0,className:"info-about-coinlist_md",width:20,height:20}),(0,r.jsxs)(h.Stack,{style:{marginLeft:"auto"},children:[(0,r.jsx)(te,{style:{marginRight:"8px",...0!==l?{color:"#859ab5",backgroundColor:"#e4ebf3"}:{}},onClick:t=>{t.stopPropagation(),c(t=>t-1>=0?t-1:t)},onTouchStart:t=>{t.stopPropagation(),c(t=>t-1>=0?t-1:t)},children:(0,r.jsx)(L.Z,{width:20,height:20})}),(0,r.jsx)(tn,{style:{...l+1{t.stopPropagation(),c(t=>{var o;return t+1{t.stopPropagation(),c(t=>{var o;return t+1{t.stopPropagation()},onTouchStart:t=>{t.stopPropagation()},onTouchMove:t=>{t.stopPropagation()},children:(0,r.jsxs)(h.Stack,{direction:"column",children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,alignItems:"flex-start",style:{width:"100%"},children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,children:[(0,r.jsx)(X,{children:"Profit graph"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-linechart_md",content:"Changes in the total portfolio price over the selected period",place:"top",openOnClick:!0,openEvents:{click:!0},closeEvents:{click:!0},globalCloseEvents:{clickOutsideAnchor:!0},style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(tl,{role:"button",tabIndex:0,className:"info-about-linechart_md",width:20,height:20})]}),(0,r.jsx)(M.u,{anchorSelect:".return-on-investment_md",content:"Return on investment",place:"bottom",openOnClick:!0,style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsxs)(q,{className:"return-on-investment_md",isPositive:isPositive(null==P?void 0:P.percentage),style:{marginLeft:"auto",marginRight:"4px"},children:[isPositive(null==P?void 0:P.percentage)?"+":"",m,"%"]}),(0,r.jsxs)(q,{isPositive:isPositive(null==P?void 0:P.difference),style:{marginRight:"8px"},children:[isPositive(null==P?void 0:P.difference)?"+":"",f,"$"]}),(0,r.jsx)(N.ZP,{className:"profit-time-range",classNamePrefix:"select",name:"time range",options:Y,defaultValue:Y[0],onChange:t=>{let{value:o,label:e}=t;d(o.toString())},isSearchable:!1,hideSelectedOptions:!1,backspaceRemovesValue:!1,isClearable:!1,styles:{container:t=>({...t,width:"134px",borderRadius:"8px",maxHeight:"40px"}),indicatorSeparator:()=>({display:"none"}),valueContainer:t=>({...t,backgroundColor:"".concat(s.rS.colors.input.color),alignItems:"center"}),control:t=>({...t,border:0,borderRadius:8,boxShadow:"none",backgroundColor:"".concat(s.rS.colors.input.color),height:"40px",minHeight:"unset"}),singleValue:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel),fontSize:"14px"}),dropdownIndicator:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel),padding:0,height:"20px",width:"20px"}),indicatorsContainer:t=>({...t,height:"100%",paddingRight:"8px"}),option:t=>({...t,fontSize:"12px"}),menu:t=>({...t,borderRadius:"8px"})}})]}),(0,r.jsx)(Charts_ProfitLineChart,{historyData:P,gradientWeightY1:_,range:"7"===y?"week":"30"===y?"month":"all"})]})}),(0,r.jsx)(tt,{onClick:t=>{t.stopPropagation()},onMouseDown:t=>{t.stopPropagation()},onTouchStart:t=>{t.stopPropagation()},children:(0,r.jsx)(N.ZP,{className:"portfolios-dropdown",name:"all portfolios",backspaceRemovesValue:!1,options:null!=x?x:[],pinnedPortfolioId:j,placeholder:"Show other portfolios",onChange:()=>!1,isPinnedWidget:n,isLoading:S,isClearable:!1,isSearchable:!1,controlShouldRenderValue:!1,hideSelectedOptions:!1,widgetId:b,togglePinPortfolio:u,setListPage:c,setSelectedPortfolio:p,selectedPortfolio:g,styles:{container:t=>({...t,borderRadius:"8px 8px 0 0",maxHeight:"40px"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:()=>({display:"none"}),valueContainer:t=>({...t,backgroundColor:"".concat(s.rS.colors.input.color),fontSize:"14px",display:"flex",justifyContent:"center",":before":{content:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgb3BhY2l0eT0iMC44Ij4KPHBhdGggZD0iTTQuNjY2MDIgNi42NjY3NUw3Ljk5OTM1IDEwLjAwMDFMMTEuMzMyNyA2LjY2Njc1IiBzdHJva2U9IiM4NTlBQjUiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8L3N2Zz4K)",marginRight:"auto",width:"16px",height:"16px"},":after":{content:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgb3BhY2l0eT0iMC44Ij4KPHBhdGggZD0iTTQuNjY2MDIgNi42NjY3NUw3Ljk5OTM1IDEwLjAwMDFMMTEuMzMyNyA2LjY2Njc1IiBzdHJva2U9IiM4NTlBQjUiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8L3N2Zz4K)",marginLeft:"auto",width:"16px",height:"16px"}}),control:t=>({...t,padding:"8px 12px 8px 16px",height:"32px",minHeight:0,border:0,boxShadow:"none",backgroundColor:"".concat(s.rS.colors.input.color)}),placeholder:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel)}),menuPortal:t=>({...t,zIndex:9999,border:0,backgroundColor:"transparent"}),menuList:t=>({...t,padding:"6px 12px 0 12px",border:"1px solid ".concat(s.rS.colors.input.color),backgroundColor:"".concat(s.rS.colors.white),borderRadius:"8px",fontSize:"12px"}),menu:t=>({...t,border:0,boxShadow:"unset",backgroundColor:"unset",fontSize:"12px"}),option:t=>({...t,fontSize:"12px",color:"".concat(s.rS.colors.text.title)})},menuPortalTarget:document.body,components:{Option:components_PortfolioSelectOption}})})]})})};function PortfolioProfitWidgetSm_style_templateObject(){let t=(0,i._)(["\n font-size: 14px;\n font-weight: 500;\n line-height: 140%;\n color: ",";\n"]);return PortfolioProfitWidgetSm_style_templateObject=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject1(){let t=(0,i._)(["\n /* font-family: 'Popins, sans-serif'; */\n @layer widgetTitleSm {\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 120%;\n color: ",";\n }\n"]);return PortfolioProfitWidgetSm_style_templateObject1=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject2(){let t=(0,i._)(["\n width: 100%;\n margin: 0 auto;\n padding: 4px;\n max-height: 32px;\n display: flex;\n flex-direction: 'row';\n align-items: center;\n justify-content: center;\n gap: 4px;\n border-radius: 8px;\n background-color: ",";\n\n & button {\n width: 100%;\n }\n"]);return PortfolioProfitWidgetSm_style_templateObject2=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject3(){let t=(0,i._)(["\n height: auto;\n padding: 4px 12px;\n background-color: ",";\n color: ",";\n font-size: 12px;\n line-height: 130%;\n border: 0;\n border-radius: 4px;\n"]);return PortfolioProfitWidgetSm_style_templateObject3=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject4(){let t=(0,i._)(["\n display: flex;\n height: 28px;\n padding: 4px 16px;\n justify-content: center;\n align-items: center;\n border-radius: 16px;\n font-size: 14px;\n line-height: 140%;\n background-color: ",";\n color: ",";\n"]);return PortfolioProfitWidgetSm_style_templateObject4=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject5(){let t=(0,i._)(["\n min-width: 340px;\n max-height: 32px;\n margin-top: auto;\n border-radius: 8px 8px 0 0;\n background-color: ",";\n cursor: default;\n"]);return PortfolioProfitWidgetSm_style_templateObject5=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject6(){let t=(0,i._)(["\n background-color: #ecf1f7;\n"]);return PortfolioProfitWidgetSm_style_templateObject6=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject7(){let t=(0,i._)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n color: #c6d5ea;\n background-color: #ecf1f7;\n border-radius: 4px;\n border: 0;\n cursor: pointer;\n"]);return PortfolioProfitWidgetSm_style_templateObject7=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject8(){let t=(0,i._)(["\n ","\n"]);return PortfolioProfitWidgetSm_style_templateObject8=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject9(){let t=(0,i._)(["\n ","\n"]);return PortfolioProfitWidgetSm_style_templateObject9=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject10(){let t=(0,i._)(["\n margin-bottom: 24px;\n cursor: default;\n"]);return PortfolioProfitWidgetSm_style_templateObject10=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject11(){let t=(0,i._)(["\n min-width: 256px;\n width: 100%;\n margin-bottom: 20px;\n cursor: default;\n\n"]);return PortfolioProfitWidgetSm_style_templateObject11=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject12(){let t=(0,i._)(["\n cursor: pointer;\n\n &:hover {\n color: ",";\n }\n"]);return PortfolioProfitWidgetSm_style_templateObject12=function(){return t},t}function PortfolioProfitWidgetSm_style_templateObject13(){let t=(0,i._)(["\n &:focus {\n outline: none;\n border: none;\n }\n\n &:focus-visible {\n outline: 2px solid #0f75fc;\n }\n"]);return PortfolioProfitWidgetSm_style_templateObject13=function(){return t},t}let tc=c.ZP.p.withConfig({componentId:"sc-63a4d9a-0"})(PortfolioProfitWidgetSm_style_templateObject(),s.rS.colors.text.darkBlue),ta=(0,c.ZP)(g.Title3).withConfig({componentId:"sc-63a4d9a-1"})(PortfolioProfitWidgetSm_style_templateObject1(),s.rS.colors.text.title),ts=c.ZP.div.withConfig({componentId:"sc-63a4d9a-2"})(PortfolioProfitWidgetSm_style_templateObject2(),s.rS.colors.input.color),td=(0,c.ZP)(f.zx).withConfig({componentId:"sc-63a4d9a-3"})(PortfolioProfitWidgetSm_style_templateObject3(),t=>{let{isActive:o}=t;return o?s.rS.colors.white:s.rS.colors.input.color},s.rS.colors.text.darkBlue),tp=c.ZP.div.withConfig({componentId:"sc-63a4d9a-4"})(PortfolioProfitWidgetSm_style_templateObject4(),t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.successLigth):"".concat(s.rS.colors.notification.errorLight)},t=>{let{isPositive:o}=t;return o?"".concat(s.rS.colors.notification.success):"".concat(s.rS.colors.notification.error)}),tu=c.ZP.div.withConfig({componentId:"sc-63a4d9a-5"})(PortfolioProfitWidgetSm_style_templateObject5(),s.rS.colors.input.color);(0,c.ZP)(f.zx).withConfig({componentId:"sc-63a4d9a-6"})(PortfolioProfitWidgetSm_style_templateObject6());let tg=(0,c.iv)(PortfolioProfitWidgetSm_style_templateObject7()),tf=(0,c.ZP)("button").withConfig({componentId:"sc-63a4d9a-7"})(PortfolioProfitWidgetSm_style_templateObject8(),tg),th=(0,c.ZP)("button").withConfig({componentId:"sc-63a4d9a-8"})(PortfolioProfitWidgetSm_style_templateObject9(),tg),tm=(0,c.ZP)(h.Stack).withConfig({componentId:"sc-63a4d9a-9"})(PortfolioProfitWidgetSm_style_templateObject10()),tx=c.ZP.div.withConfig({componentId:"sc-63a4d9a-10"})(PortfolioProfitWidgetSm_style_templateObject11());(0,c.ZP)(h.Stack).withConfig({componentId:"sc-63a4d9a-11"})(PortfolioProfitWidgetSm_style_templateObject12(),s.rS.colors.text.darkBlue);let tb=(0,c.ZP)(icons_QuestionIcon).withConfig({componentId:"sc-63a4d9a-12"})(PortfolioProfitWidgetSm_style_templateObject13());var sm_PortfolioProfitWidgetSm=t=>{var o;let{portfolio:e,isPinnedWidget:n,coinsView:i,toggleCoinsView:l,setLegendValue:c,listPage:a,setListPage:d,legend:p,setChartTimeRange:u,setSelectedPortfolio:g,togglePinPortfolio:f,roundedAmount:m,roundedPercent:x,createdValues:b,widgetId:P,isPinnedPortfolio:y,portfolioHistory:S,chartTimeRange:j,selectedPortfolioId:w,isLoadingPortfolios:_,pinnedPortfolioId:C,gradientWeightY1:v}=t;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(PinContextProvider,{defaultBtn:y?"".concat(P,"-").concat(null!=w?w:""):null,children:[(0,r.jsxs)(tm,{direction:"row",alignItems:"flex-start",spacing:98,style:{width:"100%"},onClick:t=>{t.stopPropagation()},onTouchStart:t=>{t.stopPropagation()},onMouseDown:t=>{t.stopPropagation()},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(ta,{children:e.name}),(0,r.jsx)(I.Text14,{style:{color:"".concat(s.rS.colors.text.darkBlue)},children:e.description})]}),(0,r.jsx)(components_PinButton,{id:"".concat(P,"-").concat(null!=w?w:""),isPin:y,togglePinPortfolio:(t,o,e,n)=>{t.stopPropagation(),o?(e(P),f(w),d(0)):(n(P),f(w))},widgetId:P,selectedPortfolioId:w}),(0,r.jsx)(M.u,{anchorSelect:".pin-unpin-widget",content:"".concat(n?"Unpin":"Pin"," this widget"),place:"bottom",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}})]}),(0,r.jsxs)(tx,{style:{minWidth:"256px",height:"262px"},children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,alignItems:"flex-start",style:{width:"100%"},children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,children:[(0,r.jsx)(tc,{children:"Profit graph"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-linechart_sm",content:"Changes in the total portfolio price over the selected period",place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(tb,{role:"button",tabIndex:0,className:"info-about-linechart_sm"})]}),(0,r.jsx)(M.u,{anchorSelect:".return-on-investment",content:"Return on investment",place:"bottom",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsxs)(tp,{className:"return-on-investment",isPositive:isPositive(null==S?void 0:S.percentage),style:{marginLeft:"auto",marginRight:"4px"},children:[isPositive(null==S?void 0:S.percentage)?"+":"",x,"%"]}),(0,r.jsxs)(tp,{isPositive:isPositive(null==S?void 0:S.difference),style:{marginRight:"8px"},children:[isPositive(null==S?void 0:S.difference)?"+":"",m,"$"]}),(0,r.jsx)(N.ZP,{className:"profit-time-range",classNamePrefix:"select",name:"time range",options:Y,defaultValue:Y[0],onChange:t=>{let{value:o,label:e}=t;u(o.toString())},isSearchable:!1,hideSelectedOptions:!1,backspaceRemovesValue:!1,isClearable:!1,styles:{container:t=>({...t,borderRadius:"8px",maxHeight:"28px"}),indicatorSeparator:()=>({display:"none"}),valueContainer:t=>({...t,backgroundColor:"".concat(s.rS.colors.input.color),alignItems:"center"}),control:t=>({...t,border:0,boxShadow:"none",backgroundColor:"".concat(s.rS.colors.input.color),height:"28px",minHeight:"unset"}),singleValue:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel),fontSize:"10px"}),dropdownIndicator:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel),padding:0,height:"20px",width:"20px"}),indicatorsContainer:t=>({...t,height:"100%"}),option:t=>({...t,fontSize:"10px"}),menu:t=>({...t,borderRadius:"8px"})}})]}),(0,r.jsx)(Charts_ProfitLineChart,{historyData:S,gradientWeightY1:v,range:"7"===j?"week":"30"===j?"month":"all"})]}),(0,r.jsxs)(h.Stack,{onMouseDown:t=>{t.stopPropagation()},direction:"column",style:{maxHeight:"324px",width:"100%"},children:["chart"===i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,style:{width:"100%",marginBottom:"20px"},onClick:t=>{t.stopPropagation()},onTouchStart:t=>{t.stopPropagation()},children:[(0,r.jsx)(tc,{children:"Piechart"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-piechart_sm",content:"The share of coins in your portfolio",place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(tb,{role:"button",tabIndex:0,className:"info-about-piechart_sm"})]}),(0,r.jsx)(h.Stack,{justifyContent:"center",style:{width:"232px",height:"232px",marginBottom:"20px"},children:(0,r.jsx)(PieChart,{portfolioData:e.portfolioCurrencyEntityList,setLegendData:c,pieKey:e.id.toString(),fiatValue:1e3})})]}),"list"===i&&void 0!==e.portfolioCurrencyEntityList&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Stack,{direction:"row",spacing:4,style:{width:"100%",marginBottom:"20px"},children:[(0,r.jsx)(tc,{children:"Coin list"}),(0,r.jsx)(M.u,{anchorSelect:".info-about-coinlist_sm",content:"The share of coins in your portfolio",place:"top",style:{backgroundColor:"".concat(s.rS.colors.text.title),padding:"8px 12px",borderRadius:"8px",fontSize:"12px",color:"".concat(s.rS.colors.white)}}),(0,r.jsx)(tb,{role:"button",tabIndex:0,className:"info-about-coinlist_sm"}),(0,r.jsxs)(h.Stack,{style:{marginLeft:"auto"},children:[(0,r.jsx)(tf,{style:{marginRight:"8px",...0!==a?{color:"#859ab5",backgroundColor:"#e4ebf3"}:{}},onClick:t=>{t.stopPropagation(),d(t=>t-1>=0?t-1:t)},onTouchStart:t=>{t.stopPropagation(),d(t=>t-1>=0?t-1:t)},children:(0,r.jsx)(L.Z,{width:20,height:20})}),(0,r.jsx)(th,{style:{...a+1{t.stopPropagation(),d(t=>{var o;return t+1{t.stopPropagation(),d(t=>{var o;return t+1{t.stopPropagation(),l("chart")},onTouchStart:t=>{t.stopPropagation(),l("chart")},children:"Piechart"}),(0,r.jsx)(td,{isActive:"list"===i,onClick:t=>{t.stopPropagation(),l("list")},onTouchStart:t=>{t.stopPropagation(),l("list")},children:"Coin list"})]})]}),(0,r.jsx)(tu,{onClick:t=>{t.stopPropagation()},onMouseDown:t=>{t.stopPropagation()},onTouchStart:t=>{t.stopPropagation()},children:(0,r.jsx)(N.ZP,{className:"portfolios-dropdown",name:"all portfolios",backspaceRemovesValue:!1,controlShouldRenderValue:!1,options:null!=b?b:[],onChange:()=>!1,pinnedPortfolioId:C,placeholder:"Show other portfolios",hideSelectedOptions:!1,isLoading:_,isPinnedWidget:n,isClearable:!1,isSearchable:!1,togglePinPortfolio:f,setSelectedPortfolio:g,selectedPortfolio:w,setListPage:d,widgetId:P,styles:{container:t=>({...t,borderRadius:"8px 8px 0 0",maxHeight:"32px"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:()=>({display:"none"}),valueContainer:t=>({...t,backgroundColor:"".concat(s.rS.colors.input.color),fontSize:"10px",display:"flex",justifyContent:"center",":before":{content:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgb3BhY2l0eT0iMC44Ij4KPHBhdGggZD0iTTQuNjY2MDIgNi42NjY3NUw3Ljk5OTM1IDEwLjAwMDFMMTEuMzMyNyA2LjY2Njc1IiBzdHJva2U9IiM4NTlBQjUiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8L3N2Zz4K)",marginRight:"auto",width:"16px",height:"16px"},":after":{content:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgb3BhY2l0eT0iMC44Ij4KPHBhdGggZD0iTTQuNjY2MDIgNi42NjY3NUw3Ljk5OTM1IDEwLjAwMDFMMTEuMzMyNyA2LjY2Njc1IiBzdHJva2U9IiM4NTlBQjUiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8L3N2Zz4K)",marginLeft:"auto",width:"16px",height:"16px"}}),control:t=>({...t,padding:"8px 12px 8px 16px",height:"32px",minHeight:0,border:0,boxShadow:"none",backgroundColor:"".concat(s.rS.colors.input.color)}),placeholder:t=>({...t,color:"".concat(s.rS.colors.text.nullLabel)}),menuPortal:t=>({...t,zIndex:9999,border:0,backgroundColor:"transparent"}),menuList:t=>({...t,padding:"6px 12px 0 12px",border:"1px solid ".concat(s.rS.colors.input.color),backgroundColor:"".concat(s.rS.colors.white),borderRadius:"8px"}),menu:t=>({...t,border:0,boxShadow:"unset",backgroundColor:"unset"}),option:t=>({...t,color:"".concat(s.rS.colors.text.title)})},menuPortalTarget:document.body,components:{Option:components_PortfolioSelectOption}})})]})})};let fetchPortfolioCoinsColors=async t=>{fetch("https://static.simpleswap.io/coins/ticker_color.json").then(async t=>await t.json()).then(o=>{t(F.K.setCoinsColors({coinsColors:o}))})};var PortfolioProfitWidget=t=>{var o,e;let{...n}=t,[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(),p=(0,R.T)(),g=(0,R.C)(E.KB),f=(0,u.a)(s.Uh.desktop),h=(0,u.a)(s.Uh.tablet),m=(0,u.a)(s.Uh.mobile),[x,b]=(0,a.useState)(null),[P,y]=(0,a.useState)(!1),[S,j]=(0,a.useState)(!1),[w,_]=(0,a.useState)(null),[C,v]=(0,a.useState)([]),[k,I]=(0,a.useState)("chart"),[A,O]=(0,a.useState)(0),[M,L]=(0,a.useState)(""),W=roundAmountToInteger(Number(null!==(o=null==w?void 0:w.percentage)&&void 0!==o?o:0)),N=roundAmountToInteger(Number(null!==(e=null==w?void 0:w.difference)&&void 0!==e?e:0)),[Z,T]=useSaveItemInLocalStorage("pinnedPortfolio"),z=(0,a.useMemo)(()=>null==C?void 0:C.map(t=>{var o,e;return{value:t.id.toString(),label:t.name,percentageDif:roundAmountToInteger(Number(null!==(o=null==t?void 0:t.percentage)&&void 0!==o?o:0)),amountDif:roundAmountToInteger(Number(null!==(e=null==t?void 0:t.difference)&&void 0!==e?e:0))}}),[C]);return((0,a.useLayoutEffect)(function(){void 0!==Z&&l(null!=Z?Z:"2")},[Z]),(0,a.useEffect)(function(){g||fetchPortfolioCoinsColors(p)},[p,g]),(0,a.useEffect)(function(){P||null===i||(y(!0),p(F.K.revalidatePortfolio(!0)),Promise.all([getPortfolioHistory(i,{range:M}),getPortfolio(i)]).then(t=>{_(t[0]),b(t[1])}).catch(t=>{console.log("err",t)}).finally(()=>{y(!1)}))},[i]),(0,a.useEffect)(function(){P||null===i||(y(!0),getPortfolioHistory(i,{range:M}).then(t=>{_(t)}).catch(t=>{console.log("err",t)}).finally(()=>{y(!1)}))},[M]),(0,a.useEffect)(function(){S||C.length>0||(j(!0),getPortfolios().then(t=>{v(t)}).catch(t=>{console.log("err",t)}).finally(()=>{j(!1)}))},[]),null==x)?(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:(0,r.jsx)(H.Fe,{color:"#0f75fc",visible:!0,height:"100",width:"100"})}):f?(0,r.jsx)(lg_PortfolioProfitWidgetLg,{createdValues:z,coinsView:k,chartTimeRange:M,isPinnedPortfolio:Z===i,isLoadingPortfolios:S,legend:c,listPage:A,gradientWeightY1:250,portfolio:x,pinnedPortfolioId:Z,portfolioHistory:w,roundedAmount:N,roundedPercent:W,setChartTimeRange:L,setLegendValue:d,setListPage:O,setSelectedPortfolio:l,selectedPortfolioId:i,togglePinPortfolio:T,toggleCoinsView:I,...n}):h?(0,r.jsx)(md_PortfolioProfitWidgetMd,{createdValues:z,coinsView:k,chartTimeRange:M,isLoadingPortfolios:S,isPinnedPortfolio:Z===i,legend:c,listPage:A,gradientWeightY1:350,portfolio:x,pinnedPortfolioId:Z,portfolioHistory:w,roundedAmount:N,roundedPercent:W,setChartTimeRange:L,setLegendValue:d,setSelectedPortfolio:l,setListPage:O,selectedPortfolioId:i,togglePinPortfolio:T,toggleCoinsView:I,...n}):m?(0,r.jsx)(sm_PortfolioProfitWidgetSm,{createdValues:z,coinsView:k,chartTimeRange:M,isLoadingPortfolios:S,isPinnedPortfolio:Z===i,legend:c,listPage:A,gradientWeightY1:300,portfolio:x,pinnedPortfolioId:Z,portfolioHistory:w,roundedAmount:N,roundedPercent:W,setChartTimeRange:L,setLegendValue:d,setSelectedPortfolio:l,setListPage:O,selectedPortfolioId:i,togglePinPortfolio:T,toggleCoinsView:I,...n}):null};(n||(n={})).portfolioProfitWidget="portfolioProfitWidget";let tP={[n.portfolioProfitWidget]:{sm:()=>null,md:t=>(0,r.jsx)(PortfolioProfitWidget,{...t}),lg:()=>null}};var dashboard_DashboardWidget=t=>{let{item:o,...e}=t;if(void 0===o.widget)return null;let n=tP[o.widget][o.iconSize]({...e});return(0,r.jsx)(d,{onTouchStart:t=>{t.stopPropagation()},onTouchMove:t=>{t.stopPropagation()},children:n})};function GridLayout_templateObject(){let t=(0,i._)(["\n border-radius: 32px;\n background-color: #ffffff;\n /* height: 830px; */\n cursor: grab;\n\n img {\n width: 100%;\n height: 100%;\n }\n\n @media screen and (min-width: ",") {\n min-height: 438px;\n }\n"]);return GridLayout_templateObject=function(){return t},t}let ty={sm:{src:"/learn/_next/static/media/small-skeleton-bg.a48264b8.png",height:437,width:346,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAMAAADtGH4KAAAAHlBMVEX9/fzt8vr////n8Pzy7uj09/vS2OD5+vz+///l6e3IOUdAAAAAB3RSTlP+/vH+/v7+MjCGPgAAAAlwSFlzAAALEwAACxMBAJqcGAAAACxJREFUeJw1yDECACAIA7EriC3//7CTGUPFd4vM7AaOA1gaGXerjX8aoAKpBxmzAM3oQ31MAAAAAElFTkSuQmCC",blurWidth:6,blurHeight:8},md:{src:"/learn/_next/static/media/mid-skeleton-bg.54967f15.png",height:437,width:737,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAAD1BMVEX///76/P3m8P7y8/X09/vjUxnFAAAABHRSTlP+/f7+uAz0pQAAAAlwSFlzAAALEwAACxMBAJqcGAAAACRJREFUeJwlycENACAAg0Bauv/MRuV1CegICeqEMNa2wTzc/zsHEgBFtsefGQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:5},lg:{src:"/learn/_next/static/media/big-skeleton-bg.0b57af56.png",height:376,width:1098,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAMAAACZFr56AAAADFBMVEX+/v7y9Pfp8v33+fyZ0Am8AAAAA3RSTlP+/v6VFoksAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAG0lEQVR4nAXBAQEAAACCIM3/nwMsIHFbKVQJBwInACg2cXYUAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:3}},tS=[{i:"md-1",x:0,y:0,w:2,h:1,maxW:2,iconSize:"md",type:"widgetContainer",widget:n.portfolioProfitWidget},{i:"sm-1",x:2,y:0,w:1,h:1,iconSize:"sm",type:"placeholder"},{i:"sm-2",x:0,y:1,w:1,h:1,iconSize:"sm",type:"placeholder"},{i:"md-2",x:2,y:1,w:2,h:1,maxW:2,iconSize:"md",type:"placeholder"}],tj=(0,l.WidthProvider)(l.Responsive);var GridLayout=()=>{let[t]=useSaveArrayInLocalStorage("pinnedWidgets"),o=(0,u.a)(s.Uh.tablet),e=(0,u.a)(s.Uh.mobile);return null==t?(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(f.aN,{size:"l"})}):(0,r.jsx)(tj,{className:"layout",style:{marginBottom:"120px"},containerPadding:[0,0],rowHeight:e?875:o?830:438,margin:{lg:[16,16],sm:[8,8]},breakpoints:{lg:1080,sm:768},cols:{lg:3,sm:1},isResizable:!1,isDraggable:!(o||e),isBounded:!0,onLayoutChange:t=>{},children:tS.map(e=>"widgetContainer"===e.type?(0,r.jsx)(tw,{"data-grid":{...e,static:t.includes(e.i)},children:(0,r.jsx)(dashboard_DashboardWidget,{widgetId:e.i,item:e,isPinnedWidget:t.includes(e.i)})},e.i+"-".concat(t.includes(e.i).toString())):(0,r.jsx)(tw,{"data-grid":{...e,static:!1},children:(0,r.jsx)(O(),{style:{objectFit:"contain"},src:o?ty.lg:ty[e.iconSize],alt:"This widget in development"})},e.i))})};let tw=c.ZP.figure.withConfig({componentId:"sc-9af81dc9-0"})(GridLayout_templateObject(),s.rS.breakpoints.desktop.min)},30116:function(t,o,e){"use strict";var n=e(57437);e(2265),o.Z=function(t){return(0,n.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,n.jsx)("path",{d:"M17.68 20.707 12.986 16l4.694-4.707",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}},55090:function(t,o,e){"use strict";var n=e(57437);e(2265),o.Z=function(t){return(0,n.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,n.jsx)("path",{d:"M14.32 20.707 19.014 16l-4.694-4.707",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}},75789:function(t,o,e){"use strict";e.d(o,{a:function(){return n.Z}});var n=e(14074)},95424:function(t){t.exports={hero:"page_hero__l2i3s",back:"page_back__7EuTG","white-back":"page_white-back__oN096"}}},function(t){t.O(0,[866,674,754,571,162,691,687,266,6,991,971,364,744],function(){return t(t.s=13209)}),_N_E=t.O()}]);ERROR: learn / _next / static / chunks / app / dashboard / page-7ec6e08f98a64994.js