PageSourceSearch

https://www.sharkscope.com/v7/assets/PreferencesView-D3QvC6fH.js

js sharkscope.com collected 2026-10-03 21:06:53 UTC 11,975 bytes, 1 lines download raw bytes

1import{x as m,w as e,aD as N,aC as A,h1 as T,a6 as R,ad as M,I as F,d as I,bC as $,t as s,U as D,R as G,cy as U,h2 as B,ea as H,ef as Y,h3 as _,h4 as z,h5 as W,h6 as K,f0 as V,bz as q,bY as J}from"./core-hEbRg-IQ.js";import{l as P,c as Q,C as X,m as Z,T as ee,k as se}from"./App-BRf_5Iq-.js";import{u as ae,b as te,w as re,C as ne}from"./preference-BoidA645.js";/* empty css                */function ie({value:t,onChange:d,labelledBy:i,describedBy:r}){const[n,h]=m.useState(!1),u=m.useRef(null);return m.useEffect(()=>{if(!n)return;const l=o=>{var x;(x=u.current)!=null&&x.contains(o.target)||h(!1)},g=o=>{o.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",g)}},[n]),e.jsxs("div",{className:"lang-dd lang-dd-down",ref:u,children:[e.jsxs("button",{type:"button",className:"lang-dd-btn field","aria-haspopup":"listbox","aria-expanded":n,"aria-labelledby":i,"aria-describedby":r,onClick:()=>h(l=>!l),children:[e.jsx(P,{code:A[t],name:N[t]}),e.jsx("span",{className:"lang-dd-label",children:N[t]}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",children:e.jsx("path",{d:"M2 3.5 5 6.5l3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),n&&e.jsx("ul",{className:"lang-dd-list",role:"listbox","aria-labelledby":i,children:T.map(l=>e.jsx("li",{role:"option","aria-selected":l===t,children:e.jsxs("button",{type:"button",className:`lang-dd-item${l===t?" active":""}`,lang:l,onClick:()=>{h(!1),l!==t&&d(l)},children:[e.jsx(P,{code:A[l],name:N[l]}),N[l]]})},l))})]})}function O(t){return{hideEmail:t.hideEmail,notifier:t.notifier,newsletter:t.emailOption,emailLanguage:B(t.emailLanguage),expandMultiEntries:t.expandMultiEntries===!0,showPersonalNameChips:t.showPersonalNameChips!==!1,groupsExcludeOptedOut:t.groupsExcludeOptedOut===!0,groupsExcludeNotOptedIn:t.groupsExcludeNotOptedIn===!0,showAds:t.showAds===!0,showTips:t.showTips!==!1,blogUrl:t.blogUrl??""}}function pe(){const{user:t,openLogin:d,setHideEmail:i,setShowAds:r,setShowNameChips:n,isSubscriber:h,tier:u}=R(),l=M(h,u);Q();const g=F()==="demo"?!I().unlocksStats:!h,[o,x]=m.useState(null),[E,v]=m.useState("loading"),[b,w]=m.useState("idle"),c=m.useRef(null),L=(t==null?void 0:t.username)??null;m.useEffect(()=>{if(!L)return;let a=!1;return v("loading"),w("idle"),$().then(y=>{a||(c.current=y,x(O(y)),v("ready"))},()=>{a||v("failed")}),()=>{a=!0}},[L]);async function f(a,y){if(c.current){x(S=>S&&{...S,...y}),w("saving");try{await U(a),c.current={...c.current,...a},a.hideEmail!==void 0&&i(a.hideEmail),a.showAds!==void 0&&r(a.showAds===!0),a.showPersonalNameChips!==void 0&&n(a.showPersonalNameChips!==!1),w("saved")}catch{x(O(c.current)),w("error")}}}return e.jsxs("section",{id:"view-preferences",className:"view","aria-labelledby":"pref-h1",children:[e.jsx("h1",{className:"page-title",id:"pref-h1",children:s("Preferences")}),e.jsx("p",{className:"page-sub",children:s("Configure your SharkScope preferences.")}),e.jsxs("div",{className:"pref-stack",children:[e.jsx(le,{}),e.jsxs(k,{id:"pref-g-results",title:s("Results & data"),badge:"account",children:[e.jsx(oe,{}),o&&e.jsxs(e.Fragment,{children:[e.jsx(p,{id:"pref-multientry",title:s("Multi-Entries"),hint:s("When viewing a tournament:"),children:e.jsxs("select",{className:"field pref-select","aria-labelledby":"pref-multientry-t",value:o.expandMultiEntries?"true":"false",onChange:a=>{const y=a.target.value==="true";f({expandMultiEntries:y},{expandMultiEntries:y})},children:[e.jsx("option",{value:"false",children:s("Combine all player’s entries (Default)")}),e.jsx("option",{value:"true",children:s("Keep each entry separate")})]})}),e.jsx(p,{id:"pref-chips",title:s("Personal player names"),hint:e.jsxs(e.Fragment,{children:[s("Show my")," ",e.jsx(D,{to:G.personalNames,children:s("personal player names")})," ",s("as one-click search chips on the home page and Player Statistics")]}),children:e.jsx(j,{id:"pref-chips",checked:o.showPersonalNameChips,onChange:a=>f({showPersonalNameChips:a},{showPersonalNameChips:a})})}),e.jsx(p,{id:"pref-groups",title:s("Player Groups"),hint:s("When searching a player group:"),children:e.jsxs("div",{className:"pref-checks",children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:o.groupsExcludeOptedOut,onChange:a=>f({groupsExcludeOptedOut:a.target.checked},{groupsExcludeOptedOut:a.target.checked})}),e.jsx("span",{children:s("Exclude Opted-Out Members")})]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:o.groupsExcludeNotOptedIn,onChange:a=>f({groupsExcludeNotOptedIn:a.target.checked},{groupsExcludeNotOptedIn:a.target.checked})}),e.jsx("span",{children:s("Exclude Not Opted-In Members")})]})]})})]})]}),t?E==="failed"?e.jsx("div",{className:"panel panel-pad",role:"status",children:e.jsx("p",{children:s("Your preferences could not be loaded right now — please refresh to try again.")})}):E==="loading"||!o?e.jsx("div",{className:"panel panel-pad","aria-busy":"true",children:e.jsx("p",{role:"status",children:s("Loading your preferences…")})}):e.jsxs(e.Fragment,{children:[e.jsxs(k,{id:"pref-g-email",title:s("Emails & alerts"),badge:"account",children:[e.jsx(p,{id:"pref-email-language",title:s("Email language"),hint:s("Purchase confirmations, renewal and cancellation notices, alerts, scheduled reports and the newsletter are sent in this language."),children:e.jsx(ie,{value:o.emailLanguage,labelledBy:"pref-email-language-t",describedBy:"pref-email-language-h",onChange:a=>f({emailLanguage:a},{emailLanguage:a})})}),e.jsx(p,{id:"pref-newsletter",title:s("Newsletter"),hint:s("Email me poker tips, new features and offers from SharkScope. Unsubscribe anytime."),children:e.jsx(j,{id:"pref-newsletter",checked:o.newsletter,onChange:a=>f({emailOption:a},{newsletter:a})})}),e.jsx(p,{id:"pref-notifier",title:e.jsxs(e.Fragment,{children:[s("Notify me when a player’s statistics are out of date"),g&&e.jsx(X,{})]}),gated:g,titleAttr:g?s("Out-of-date alerts need a subscription — SharkScope only tracks new results for subscribers."):void 0,children:e.jsx(j,{id:"pref-notifier",checked:o.notifier,disabled:g,onChange:a=>f({notifier:a},{notifier:a})})}),e.jsx(p,{id:"pref-tips",title:s("Tips"),hint:s("Show me tips about features included in my plan"),children:e.jsx(j,{id:"pref-tips",checked:o.showTips,onChange:a=>f({showTips:a},{showTips:a})})})]}),e.jsxs(k,{id:"pref-g-privacy",title:s("Privacy & adverts"),badge:"account",children:[e.jsx(p,{id:"pref-hide-email",title:s("Hide Email Address"),className:"pref-hide-email",children:e.jsx(j,{id:"pref-hide-email",checked:o.hideEmail,onChange:a=>f({hideEmail:a},{hideEmail:a})})}),l&&e.jsx(p,{id:"pref-ads",title:s("Adverts"),hint:s("Show adverts — your subscription is ad-free, but you can opt in to see them."),children:e.jsx(j,{id:"pref-ads",checked:o.showAds,onChange:a=>f({showAds:a},{showAds:a})})})]})]}):e.jsxs("div",{className:"panel panel-pad pref-login",role:"note",children:[e.jsx("p",{children:s("Log in to manage your preferences.")}),e.jsx("button",{type:"button",className:"btn btn-cta",onClick:d,children:s("Log in")})]})]}),e.jsx("p",{className:"pref-status",role:"status","aria-live":"polite","data-state":b,children:b==="saving"?s("Saving…"):b==="error"?e.jsx("span",{className:"neg",children:s("Your change couldn’t be saved — please try again.")}):b==="saved"?s("Saved"):null})]})}function k({id:t,title:d,badge:i,note:r,children:n}){return e.jsxs("section",{className:"panel panel-pad pref-card","aria-labelledby":`${t}-h`,children:[e.jsxs("h2",{className:"pref-card-h",id:`${t}
1-h`,children:[d,e.jsx("span",{className:`pref-badge pref-badge-${i}`,children:i==="device"?s("This device"):s("Your account")}),r&&e.jsx("span",{className:"pref-card-note",children:r})]}),n]})}function p({id:t,title:d,hint:i,gated:r,titleAttr:n,className:h,children:u}){return e.jsxs("div",{className:`pref-row${r?" pref-row-gated":""}${h?` ${h}`:""}`,title:n,children:[e.jsxs("div",{className:"pref-row-l",children:[e.jsx("div",{className:"pref-row-t",id:`${t}-t`,children:d}),i&&e.jsx("div",{className:"pref-row-h",id:`${t}-h`,children:i})]}),e.jsx("div",{className:"pref-row-r",children:u})]})}function j({id:t,checked:d,disabled:i,onChange:r}){return e.jsx("input",{type:"checkbox",role:"switch",className:"pref-switch",checked:d,disabled:i,"aria-labelledby":`${t}-t`,onChange:n=>r(n.target.checked)})}function C({name:t,labelledBy:d,value:i,options:r,onChange:n,testId:h}){return e.jsx("div",{className:"pref-seg",role:"radiogroup","aria-labelledby":d,"data-testid":h,children:r.map(u=>e.jsxs("label",{className:i===u.value?"on":void 0,children:[e.jsx("input",{type:"radio",name:t,value:u.value,checked:i===u.value,onChange:()=>n(u.value)}),e.jsx("span",{children:u.label})]},u.value))})}function le(){const{preference:t,setPreference:d,theme:i}=Z(),r=H(),n=Y(),h=ae(),u=te(),l={system:s("Match my device"),classic:s("Classic"),dark:s("Dark")},g={system:s("Follows your phone or computer’s light/dark setting — right now that is {0}.",i==="dark"?s("Dark"):s("Classic")),classic:s("The default light theme."),dark:s("A low-light theme for night sessions.")},o={auto:s("Automatic"),cards:s("Always cards")},x={auto:s("A table on larger screens, one card per player on a phone."),cards:s("One card per player at every screen size. Graphs & Details opens each player in its own view instead of expanding the row.")},E={modern:s("Modern"),classic:s("Classic")},v={modern:s("Shaded beneath the line, red below zero, with the final total labelled in green or red."),classic:s("No shading, one colour throughout, and dotted gridlines — as on the original SharkScope chart.")},b={auto:s("Match my device"),always:s("Always"),never:s("Never")},w={auto:u?s("Plays a short animation when a search finds a player rated 98, 99 or 100 — but not on this device right now, because it is set to reduce motion."):s("Plays a short animation when a search finds a player rated 98, 99 or 100, unless your device is set to reduce motion."),always:s("Plays them even when your device is set to reduce motion."),never:s("Top ratings keep their silver, gold or cosmic look, without the animation.")};return e.jsxs(k,{id:"pref-g-look",title:s("Look & feel"),badge:"device",note:s("Saved in this browser. It does not follow you to another browser or phone yet."),children:[e.jsx(p,{id:"pref-theme",title:s("Appearance"),hint:g[t],children:e.jsx(C,{name:"ss-theme",labelledBy:"pref-theme-t",value:t,options:ee.map(c=>({value:c,label:l[c]})),onChange:d})}),e.jsx(p,{id:"pref-chart",title:s("Profit chart style"),hint:v[n],children:e.jsx(C,{name:"ss-chart-style",labelledBy:"pref-chart-t",testId:"pref-chart-style",value:n,options:z.map(c=>({value:c,label:E[c]})),onChange:_})}),e.jsx(p,{id:"pref-layout",title:s("Player statistics layout"),hint:x[r],children:e.jsx(C,{name:"ss-results-layout",labelledBy:"pref-layout-t",testId:"pref-results-layout",value:r,options:K.map(c=>({value:c,label:o[c]})),onChange:W})}),e.jsx(p,{id:"pref-celebrations",title:s("Ability 98–100 animations"),hint:w[h],children:e.jsx(C,{name:"ss-celebrations",labelledBy:"pref-celebrations-t",testId:"pref-celebrations",value:h,options:ne.map(c=>({value:c,label:b[c]})),onChange:re})})]})}function oe(){const[t,d]=m.useState([{iso:V,symbol:"$"}]),i=se(null);return m.useEffect(()=>{let r=!0;return q().then(n=>{r&&n.length>0&&d(n)}).catch(()=>{}),()=>{r=!1}},[]),e.jsx(p,{id:"pref-currency",title:s("Display currency"),hint:s("Applies to search results, and is saved to your account when you are signed in. A shared link that specifies a currency opens in that currency instead."),children:e.jsx("select",{className:"field","aria-labelledby":"pref-currency-t",value:i,onChange:r=>J(r.target.value),children:t.map(r=>
1e.jsxs("option",{value:r.iso,children:[r.iso," ",r.symbol]},r.iso))})})}export{pe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.