(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9656],{62705:function(e,t,n){var o=n(55639).Symbol;e.exports=o},29932:function(e){e.exports=function(e,t){for(var n=-1,o=null==e?0:e.length,r=Array(o);++n<o;)r[n]=t(e[n],n,e);return r}},44239:function(e,t,n){var o=n(62705),r=n(89607),i=n(2333),l=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?r(e):i(e)}},80531:function(e,t,n){var o=n(62705),r=n(29932),i=n(1469),l=n(33448),s=1/0,a=o?o.prototype:void 0,u=a?a.toString:void 0;e.exports=function baseToString(e){if("string"==typeof e)return e;if(i(e))return r(e,baseToString)+"";if(l(e))return u?u.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}},31957:function(e,t,n){var o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=o},89607:function(e,t,n){var o=n(62705),r=Object.prototype,i=r.hasOwnProperty,l=r.toString,s=o?o.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var o=!0}catch(e){}var r=l.call(e);return o&&(t?e[s]=n:delete e[s]),r}},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:function(e,t,n){var o=n(31957),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();e.exports=i},1469:function(e){var t=Array.isArray;e.exports=t},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var o=n(44239),r=n(37005);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==o(e)}},79833:function(e,t,n){var o=n(80531);e.exports=function(e){return null==e?"":o(e)}},17553:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/demo",function(){return n(23134)}])},23134:function(e,t,n){"use strict";n.r(t);var o=n(85893),r=n(9008),i=n.n(r),l=n(79797),s=n(91271),a=n(80249),u=n(3305),c=n(67294),d=n(38623),v=n(72445),f=n(62679),b=n(51072),p=n(37117),h=n(19590),j=n(29355),g=n(53319),m=n(98779),w=n(69518),x=n(82716);t.default=()=>{var e,t,n,r;let{width:y}=(0,j.n)(),[S,E]=(0,c.useState)(!1),[I,k]=(0,c.useState)({width:y,isMobile:y<850}),[O,B]=(0,c.useState)({slipId:"",slipEventId:""});(0,c.useEffect)(()=>{y<850?(k({width:y,isMobile:!0}),E(!0)):(k({width:y,isMobile:!1}),E(!1))},[y]);let M=l.h.sharpSports.getBettorAccountById.useQuery({id:"",sharpSportsId:"",isDemo:!0},{cacheTime:36e5,refetchOnWindowFocus:!0,onError:e=>(0,b.d)({title:"Error",id:"".concat(Date.now(),"-error}"),type:"error",message:e.message})}),_=null==M?void 0:null===(e=M.data)||void 0===e?void 0:e.filter(e=>!0===e.verified),P=(null==_?void 0:_.reduce((e,t)=>e+t.balance,0))||0,T=null==_?void 0:_.map(e=>{let t=0==e.balance?0:Number((e.balance/P*100).toFixed(2));return{value:t,color:(0,a.v)(e.book.name),label:e.book.name,abbreviation:e.book.abbr,bankroll:(0,s.x)(e.balance,!0),tooltip:"".concat(e.book.name," represents ").concat(t,"% of your bankroll or ").concat((0,s.x)(e.balance,!0))}}),[D,N]=(0,c.useState)([]),{data:A,isLoading:C}=l.h.sharpSports.getBetSlipById.useQuery({id:"",sharpSportsId:"",isDemo:!0},{onError:e=>(0,b.d)({title:"Error",id:"".concat(Date.now(),"-error}"),type:"error",message:e.message}),onSuccess:e=>{var t,n,o;if((null==e?void 0:null===(t=e.objects)||void 0===t?void 0:t.length)>0){let t=null==e?void 0:null===(n=e.objects)||void 0===n?void 0:n[0];t&&!O.slipId&&B({slipEventId:null==t?void 0:null===(o=t.bets[0])||void 0===o?void 0:o.id,slipId:null==t?void 0:t.id})}},enabled:!0});return(0,c.useEffect)(()=>{if(O.slipId){var e;let t=null==A?void 0:null===(e=A.objects)||void 0===e?void 0:e.filter(e=>e.id===O.slipId);N(t||[])}},[O.slipId]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(i(),{children:[(0,o.jsx)("title",{children:"BtrBet diary"}),(0,o.jsx)("meta",{name:"description",content:"BtrBet Diary - view bet history"}),(0,o.jsx)("link",{rel:"icon",href:"/btrbet.svg"})]}),(0,o.jsx)(h.s,{onboardingComplete:!0,onboardingStep:4,isDemo:!0,children:(0,o.jsx)(v.W,{size:"xl",mb:"xl",children:(null==M?void 0:null===(t=M.data)||void 0===t?void 0:t.length)===0?(0,o.jsx)(p.Z,{viewText:"Bet Diary"}):(0,o.jsxs)(o.Fragment,{children:[Number(null==A?void 0:null===(n=A.objects)||void 0===n?void 0:n.length)>0&&(0,o.jsx)(x.Z,{slips:null==A?void 0:A.objects,accountDetails:null==M?void 0:M.data,width:y}),(0,o.jsx)("div",{children:M.isLoading?(0,o.jsx)(d.O,{height:200,mb:10}):!T||T.length<1?null:(0,o.jsx)(u.$,{totalBankroll:P,sections:T,sortValues:!0})}),!C&&(null==A?void 0:null===(r=A.objects)||void 0===r?void 0:r.length)===0&&(0,o.jsx)(g.Z,{}),(0,o.jsxs)(f.r,{columns:12,children:[(0,o.jsx)(f.r.Col,{span:I.isMobile?12:4,children:S?null:(0,o.jsx)(m.Z,{events:null==A?void 0:A.objects,isLoading:C,isSearchEvent:!0,userId:"",setMobileSearchIntent:E,mobileScreen:I,queryParam:O,setQueryParam:B})}),(0,o.jsx)(f.r.Col,{span:I.isMobile?12:8,children:!I.isMobile||I.isMobile&&S?(0,o.jsx)(w.Z,{userId:"",width:y,event:D,isLoading:C,queryParam:O,setQueryParam:B,mobileSearchIntent:S,setMobileSearchIntent:E,mobileScreen:I}):null})]})]})})})]})}},9008:function(e,t,n){e.exports=n(79201)},94573:function(e,t,n){"use strict";function isBrowser(){return"undefined"!=typeof window}function getMode(){let e=isBrowser()?window.vam:"production";return e||"production"}function isProduction(){return"production"===getMode()}function track(e,t){var n,o;if(!isBrowser()){let e="[Vercel Web Analytics] Please import `track` from `@vercel/analytics/server` when using this function in a server environment";if(isProduction())console.warn(e);else throw Error(e);return}if(!t){null==(n=window.va)||n.call(window,"event",{name:e});return}try{let n=function(e,t){if(!e)return;let n=e,o=[];for(let[r,i]of Object.entries(e))"object"==typeof i&&null!==i&&(t.strip?n=function(e,{[e]:t,...n}){return n}(r,n):o.push(r));if(o.length>0&&!t.strip)throw Error(`The following properties are not valid: ${o.join(", ")}. Only strings, numbers, booleans, and null are allowed.`);return n}(t,{strip:isProduction()});null==(o=window.va)||o.call(window,"event",{name:e,data:n})}catch(e){e instanceof Error&&"development"===getMode()&&console.error(e)}}n.d(t,{j:function(){return track}})}},function(e){e.O(0,[5084,2537,1228,9012,7474,2083,3317,5757,5426,524,1194,166,4262,3126,4627,1035,9774,2888,179],function(){return e(e.s=17553)}),_N_E=e.O()}]);