PageSourceSearch

https://assets.lichess.dev/assets/compiled/lib.QSN4SHRN.js

js lichess.dev collected 2026-10-08 10:50:10 UTC 5,885 bytes, 1 lines download raw bytes

1import{b as r,i as u}from"./lib.BVGQPJTT.js";var a=e=>e!==void 0,G=e=>e!=null,E=e=>!e||e.length===0,J=e=>!E(e),Q=(e,t)=>e[t],X=e=>{let t=e;return n=>(a(n)&&(t=n),t)},N=(e,t)=>{let n=e;return o=>(a(o)&&(n=o,t(o)),n)},Y=(e,t)=>n=>{let o;return a(n)?(o=e(n),t(n)):o=e(),o},O=(e,t=()=>{})=>{let n=N(e,t);return n.toggle=()=>n(!n()),n},z=e=>{let t;return()=>(t===void 0&&(t=e()),t)},ee=(e,t,n=!1,o="instant")=>V(e,e.querySelector(t),n,o),V=(e,t,n=!1,o="instant")=>{t&&e.scrollTo(n?{behavior:o,left:t.offsetLeft-e.offsetWidth/2+t.offsetWidth/2}:{behavior:o,top:t.offsetTop-e.offsetHeight/2+t.offsetHeight/2})},te=e=>t=>{let n=()=>$(document).one("click",o=>{document.contains(t)&&(t.contains(o.target)?n():e())});setTimeout(n,300)},ne=e=>e.replace(/-([a-z])/g,t=>t[1].toUpperCase()),oe=(e,t)=>{window.requestIdleCallback?window.requestIdleCallback(e,t?{timeout:t}:void 0):requestAnimationFrame(e)};function l(e){return/[&<>"']/.test(e)?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):e}function re(e){let t=document.createRange().createContextualFragment(e);return t.childElementCount===1?t.firstElementChild:t}function se(e){return t=>e.querySelector(t)}var ie=()=>document.body.dataset.user,ae=()=>document.body.dataset.username;function le(e,t){let n,o=(function*(){yield 500;for(let i=350;;)yield Math.max(100,i*=.9333333333333333)})(),s=()=>{e(),n=setTimeout(s,o.next().value),t!=null&&t()&&clearTimeout(n)};s(),document.addEventListener("pointerup",()=>clearTimeout(n),{once:!0})}function ce(e){if(!(e instanceof MouseEvent))return;let t=document.activeElement;t instanceof HTMLElement&&e.button===0&&(e.clientX||e.clientY)&&requestAnimationFrame(()=>t.blur())}function h(e){e.target instanceof HTMLElement&&e.key==="Escape"&&(e.stopPropagation(),e.target.blur())}function de(e){e.addEventListener("keydown",h)}function A(e){return{insert:t=>e(t.elm)}}function c(e,t,n,o=!0){return A(s=>s.addEventListener(e,i=>{let p=t(i);return p===!1&&!o&&i.preventDefault(),n==null||n(),p},{passive:o}))}function ge(e){return{insert:t=>{var n,o;(o=(n=c("click",e)).insert)==null||o.call(n,t),t.elm.focus()}}}var xe=(e,t,n)=>c(e,t,n,!1);function me(e,t){return c("submit",n=>{n.preventDefault(),e(n)},t,!1)}var Te=e=>({"data-icon":e}),be=e=>site.debug?{"data-testid":e}:{},g=e=>e&&e!==!0||e===""||e===0,f=e=>{let t=[];return x(e,t),t.filter(g)};function ye(e,t,n){return n?r(e,t,f(n)):g(t)?Array.isArray(t)||typeof t=="object"&&"sel"in t?r(e,f(t)):r(e,t):r(e)}var x=(e,t)=>{if(Array.isArray(e))for(let n of e)x(n,t);else t.push(e)},Ee=e=>r("span",{attrs:{lang:"en"}},e),Ne=(e,t,n)=>window.i18n[e]?n(window.i18n[e]):(site.asset.loadI18n(e).then(t),r("span","..."));function Ve(e){return e.target}function he(e){return e.target.value}function Ae(e,t,...n){return u(e,t&&Object.entries(t).reduce((o,[s,i])=>(s==="attrs"?o.attrs={...o.attrs,...i}:["hook","key","on","props","style"].includes(s)?o[s]=i:s==="class"?o.attrs={...o.attrs,class:Array.isArray(i)?i.filter(Boolean).join(" "):i}:o.attrs={...o.attrs,[s]:i},o),{}),...n)}var He=e=>r("a",v(e),[L(e),...M(e),e.rating&&` ${C(e)} `]),d=e=>`/@/${e}`,v=e=>({class:{"user-link":!0,ulpt:e.name!=="ghost",online:!!e.online},attrs:{href:d(e.name),...e.attrs}}),k=e=>e.flair?r("img.uflair",{attrs:{src:site.asset.flairSrc(e.flair)}}):void 0,L=e=>e.line!==!1?r("icon.line",{class:{patron:!!e.patronColor,moderator:!!e.moderator,...e.patronColor?{[`paco${e.patronColor}`]:!0}
1:{}},attrs:e.patronColor?{title:"Lichess Patron"}:{}}):void 0,H=({title:e})=>e?r("span.utitle",e==="BOT"?{attrs:{"data-bot":!0}}:{},[e,"\xA0"]):void 0,M=e=>[H(e),e.name,k(e)],C=e=>{if(e.rating){let t=`${e.rating}${e.provisional?"?":""}`;return e.brackets!==!1?`(${t})`:t}},Me=({ratingDiff:e})=>e===0?r("span","\xB10"):e&&e>0?r("good","+"+e):e&&e<0?r("bad","\u2212"+-e):void 0;var P=/(^|[\s\n\(]|<[A-Za-z]*\/?>)((?:(?:https?|ftp):\/\/|lichess\.org)[\-A-Z0-9+\u0026\u2019@#\/%?=()~_|!:,.;*$']*[\-A-Z0-9+\u0026@#\/%=~()_|][\-A-Z0-9+\u0026@#\/%=~(_|])/gi,w=/\n/g,m=/(^|[^\w@#/])@([a-z0-9_-]{2,30})/gi,R=/\b(\d+)\s*(\.+)\s*(?:[o0-]+[o0]|[NBRQK\u2654\u2655\u2656\u2657\u2658]?[a-h]?[1-8]?[x@]?[a-h][1-8](?:=[NBRQK\u2654\u2655\u2656\u2657\u2658\u2659])?)\+?#?[!\?=]{0,5}/gi,Re=e=>/(\n|(@|#|\.)\w{2,}|(board|game) \d)/i.test(e),T=(e,t,n=!0)=>`<a${n?"":' class="text"'} target="_blank" rel="nofollow noreferrer" href="${e}">${t}</a>`;function I(e){return/^[A-Za-z]+:\/\//.test(e)||(e="https://"+e),T(e,e.replace(/https?:\/\//,""))}var U=(e,t)=>e.replace(P,(n,o,s)=>o+t(s)),D=(e,t)=>({insert(n){n.elm.innerHTML=t(e),n.data.cachedA=e},postpatch(n,o){n.data.cachedA!==e&&(o.elm.innerHTML=t(e)),o.data.cachedA=e}});function b(e,t,n=!0){return e.includes("&quot;")?e:T(e.startsWith("/")||e.includes("://")?e:"//"+e,t||e,n)}var y=(e,t,n)=>t+b(d(n),"@"+n),Ie=e=>e.replace(m,y);function q(e,t=!0){let n=U(l(e),I);return t&&(n=n.replace(w,"<br>")),n}function Ue(e,t=!0){return D(e,n=>q(n,t))}var W=/\b\b(?:https?:\/\/)?(lichess\.org\/[-–—\w+&'@#\/%?=()~|!:,.;*$]+[\w+&@#\/%=~|])/gi,j=/^[a-h][2-7]$/,B=/\b(?:board|game)\s(\d+)/gi;function F(e,t,n){return t<1||t>200?e:'<a class="jump" data-ply="'+(t*2-(n.length>1?0:1))+'">'+e+"</a>"}function _(e,t){return t<1||t>100?e:'<a data-board="'+t+'">'+e+"</a>"}var K=e=>e.replace(R,F),S=e=>e.replace(B,_),Z=(e,t,n)=>j.test(n)?e:y(e,t,n);function $e(e,t){let n=l(e),o=n.replace(m,Z).replace(W,b),s=t!=null&&t.plies&&o===n?K(o):o;return t!=null&&t.boards&&o===n?S(s):o}export{a,G as b,E as c,J as d,Q as e,X as f,N as g,Y as h,O as i,z as j,ee as k,V as l,te as m,ne as n,oe as o,l as p,re as q,se as r,ie as s,ae as t,le as u,ce as v,h as w,de as x,A as y,c as z,ge as A,xe as B,me as C,Te as D,be as E,ye as F,Ee as G,Ne as H,Ve as I,he as J,Ae as K,He as L,d as M,v as N,k as O,L as P,H as Q,M as R,C as S,Me as T,P as U,w as V,m as W,Re as X,D as Y,b as Z,Ie as _,q as $,Ue as aa,$e as ba};

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.