1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BrowserExtensionSection-BXQcKoiZ.js","assets/vendor-react-QBdHTLhB.js","assets/vendor-i18n-D25i1uPq.js","assets/vendor-query-DvxQDmy6.js","assets/RepoHistoryChart-CXrKYW0O.js","assets/marketing-BhSCZukC.js","assets/compare-DdhxnVz7.js","assets/embed-CSImRHTC.js"])))=>i.map(i=>d[i]); 2var Ot=Object.defineProperty;var At=(e,s,n)=>s in e?Ot(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n;var Ce=(e,s,n)=>At(e,typeof s!="symbol"?s+"":s,n);import{r as d,j as t,R as O,c as Tt}from"./vendor-react-QBdHTLhB.js";import{u as Pe,Q as Pt,a as Ut}from"./vendor-query-DvxQDmy6.js";import{i as f,B as It,a as Dt,u as C,T as be}from"./vendor-i18n-D25i1uPq.js";const Mt=(function(){const s=typeof document<"u"&&document.createElement("link").relList;return s&&s.supports&&s.supports("modulepreload")?"modulepreload":"preload"})(),Bt=function(e){return"/"+e},He={},I=function(s,n,a){let r=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=l(n.map(u=>{if(u=Bt(u),u in He)return;He[u]=!0;const p=u.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":Mt,p||(g.as="script"),g.crossOrigin="",g.href=u,c&&g.setAttribute("nonce",c),document.head.appendChild(g),p)return new Promise((x,b)=>{g.addEventListener("load",x),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return r.then(l=>{for(const o of l||[])o.status==="rejected"&&i(o.reason);return s().catch(i)})};/** 3 * @license lucide-react v0.503.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const zt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ft=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,n,a)=>a?a.toUpperCase():n.toLowerCase()),Ge=e=>{const s=Ft(e);return s.charAt(0).toUpperCase()+s.slice(1)},it=(...e)=>e.filter((s,n,a)=>!!s&&s.trim()!==""&&a.indexOf(s)===n).join(" ").trim(),qt=e=>{for(const s in e)if(s.startsWith("aria-")||s==="role"||s==="title")return!0};/** 8 * @license lucide-react v0.503.0 - ISC 9 * 10 * This source code is licensed under the ISC license. 11 * See the LICENSE file in the root directory of this source tree. 12 */var Ht={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 13 * @license lucide-react v0.503.0 - ISC 14 * 15 * This source code is licensed under the ISC license. 16 * See the LICENSE file in the root directory of this source tree. 17 */const Gt=d.forwardRef(({color:e="currentColor",size:s=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:i,iconNode:l,...o},c)=>d.createElement("svg",{ref:c,...Ht,width:s,height:s,stroke:e,strokeWidth:a?Number(n)*24/Number(s):n,className:it("lucide",r),...!i&&!qt(o)&&{"aria-hidden":"true"},...o},[...l.map(([u,p])=>d.createElement(u,p)),...Array.isArray(i)?i:[i]]));/** 18 * @license lucide-react v0.503.0 - ISC 19 * 20 * This source code is licensed under the ISC license. 21 * See the LICENSE file in the root directory of this source tree. 22 */const M=(e,s)=>{const n=d.forwardRef(({className:a,...r},i)=>d.createElement(Gt,{ref:i,iconNode:s,className:it(`lucide-${zt(Ge(e))}`,`lucide-${e}`,a),...r}));return n.displayName=Ge(e),n};/** 23 * @license lucide-react v0.503.0 - ISC 24 * 25 * This source code is licensed under the ISC license. 26 * See the LICENSE file in the root directory of this source tree. 27 */const Wt=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Vt=M("arrow-up",Wt);/** 28 * @license lucide-react v0.503.0 - ISC 29 * 30 * This source code is licensed under the ISC license. 31 * See the LICENSE file in the root directory of this source tree. 32 */const Kt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Jt=M("chevron-down",Kt);/** 33 * @license lucide-react v0.503.0 - ISC 34 * 35 * This source code is licensed under the ISC license. 36 * See the LICENSE file in the root directory of this source tree. 37 */const Qt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zt=M("chevron-right",Qt);
37/** 38 * @license lucide-react v0.503.0 - ISC 39 * 40 * This source code is licensed under the ISC license. 41 * See the LICENSE file in the root directory of this source tree. 42 */const Xt=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],re=M("clipboard",Xt);/** 43 * @license lucide-react v0.503.0 - ISC 44 * 45 * This source code is licensed under the ISC license. 46 * See the LICENSE file in the root directory of this source tree. 47 */const Yt=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],es=M("download",Yt);/** 48 * @license lucide-react v0.503.0 - ISC 49 * 50 * This source code is licensed under the ISC license. 51 * See the LICENSE file in the root directory of this source tree. 52 */const ts=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ss=M("external-link",ts);/** 53 * @license lucide-react v0.503.0 - ISC 54 * 55 * This source code is licensed under the ISC license. 56 * See the LICENSE file in the root directory of this source tree. 57 */const ns=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],as=M("file-json",ns);/** 58 * @license lucide-react v0.503.0 - ISC 59 * 60 * This source code is licensed under the ISC license. 61 * See the LICENSE file in the root directory of this source tree. 62 */const rs=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],os=M("history",rs);/** 63 * @license lucide-react v0.503.0 - ISC 64 * 65 * This source code is licensed under the ISC license. 66 * See the LICENSE file in the root directory of this source tree. 67 */const is=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ls=M("loader-circle",is);/** 68 * @license lucide-react v0.503.0 - ISC 69 * 70 * This source code is licensed under the ISC license. 71 * See the LICENSE file in the root directory of this source tree. 72 */const cs=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],ds=M("moon",cs);/** 73 * @license lucide-react v0.503.0 - ISC 74 * 75 * This source code is licensed under the ISC license. 76 * See the LICENSE file in the root directory of this source tree. 77 */const us=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],hs=M("play",us);/** 78 * @license lucide-react v0.503.0 - ISC 79 * 80 * This source code is licensed under the ISC license. 81 * See the LICENSE file in the root directory of this source tree. 82 */const ps=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ms=M("rotate-ccw",ps);/** 83 * @license lucide-react v0.503.0 - ISC 84 * 85 * This source code is licensed under the ISC license. 86 * See the LICENSE file in the root directory of this source tree. 87 */const gs=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],lt=M("share-2",gs);/** 88 * @license lucide-react v0.503.0 - ISC 89 * 90 * This source code is licensed under the ISC license. 91 * See the LICENSE file in the root directory of this source tree. 92 */const fs=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],bs=M("sun",fs),xs={title:"OctoCounts â GitHub SLOC Counter",description:"OctoCounts shows actual source line counts for public GitHub repositories: files, code lines, comments, blanks, and per-language totals. No clone required."},ys={brandName:"OctoCounts",chrome:"Chrome",edge:"Edge",firefox:"Firefox",githubAria:"View OctoCounts on GitHub",navigation:"Primary navigation",analyze:"Analyze",explore:"Explore",tools:"Tools",install:"Install",installExtension:"Install extension",compare:"Compare repositories",diff:"Diff refs",badges:"Badges & embeds"},js={title:"GitHub <1>code statistics</1>, at a glance.",subtitle:"Install the browser extension to see SLOC directly in GitHub's repo sidebar, or paste a public GitHub repo URL here for the full web report. Powered by <1>tokei</1>, no clone required.",definition:"OctoCounts is a free SLOC counter for public GitHub repositories. It shows files, total lines, code, comments, blanks, and per-language totals without cloning.",freshnessLabel:"Last updated",maintainedBy:"Maintained by",badgeOpenSource:"Open source on GitHub",badgeFree:"Free · no sign-up",badgeLanguages:"200+ languages",placeholderUrl:"https://github.com/owner/repo",refLabel:"ref",refPlaceholder:"default",ariaUrl:"Repository URL",ariaRef:"Optional ref",ariaSamples:"Example repositories",ariaTrust:"Trust badges",analyze:"Analyze",installChrome:"Chrome Web Store",installEdge:"Microsoft Edge Add-ons",installFirefox:"Firefox (GitHub download)",addToChrome:"Add to Chrome",sidebarHint:"See SLOC directly in GitHub's repo sidebar.",otherBrowsers:"Other browsers",ambiguousRef:"This URL may contain a branch and a path. Enter the ref explicitly before analyzing."},ws={label:"sample"},vs={label:"recent",ariaLabel:"Recently analyzed repositories",clear:"Clear history"},Cs={ariaLabel:"Report summary",lines:"{{lines}} lines",top:"top",share:"share"},ks={title:"Runner",cancel:"Cancel",status:{idle:"Paste a repository URL and run the analyzer.",queued:"Job accepted. Waiting for an analysis slot.",running:"Downloading archive, extracting files, and counting language statistics.",completed:"Analysis completed.",cached:"Served from commit-level cache.",failed:"Analysis failed.",timedOut:"The analysis is taking too long. You can retry or return to the input."},statusShort:{idle:"idle",queued:"queued",running:"running",completed:"completed",cached:"cached",failed:"failed"},log:{idle:"idle: command runner ready",queuedWaiting:"queued: waiting for an analysis worker ({{elapsed}}s)",stillQueued:"still queued after {{elapsed}}s; jobs run one at a time",stillCounting:"still running after {{elapsed}}s; large repositories can take longer",resolvedRef:"resolved {{ref}} -> {{sha}}",cacheHit:"cache hit returned",freshReport:"fresh report saved to cache",languageRows_one
92:"{{count}} language row rendered",languageRows_other:"{{count}} language rows rendered",counted:"counted {{lines}} lines in {{duration}}ms",runningWaiting:"running: the analysis worker is processing this repository ({{elapsed}}s)"},command:"octocount analyze {{repo}}{{ref}}{{force}}",cacheHit:"cache hit",freshRun:"fresh run",demoNote:"Demo: analyzing OctoCounts itself. Paste any public repo URL above to analyze yours.",generated:"generated {{date}} / {{duration}}ms / {{version}}",exportText:"text",exportJson:"json",copyReportUrl:"url",exportPng:"png",exportGitHub:"github",reRun:"re-run",clear:"clear",runDetails:"Run details",commandLabel:"Command",moreActions:"More actions",exportPngFailed:"PNG export failed. Retry the export."},Ns={title:"OctoCounts // SLOC",totalLoc:"// Total LOC",labelCode:"Code",labelComments:"Comments",labelBlanks:"Blanks",topLanguages:"top languages loc",percentCode:"{{percent}} code",generatedBy:"generated by OctoCounts"},Ss={ariaLabel:"Share report actions",kicker:"next",title:"Make this report travel",subt
92itle:"Drop the badge into a README, share the report URL, or export a card.",copyBadge:"README badge",copyUrl:"report URL",copyEmbed:"embed iframe",exportPng:"PNG card",copied:"copied",preview:"Preview",copyFailed:"Copy failed. Select the link and copy it manually.",copyFailedShort:"Copy failed",manualCopyAria:"Report URL for manual copy",manualContentAria:"Content for manual copy"},Rs={ariaLabel:"Similar repositories",title:"Similar repositories",subtitle:"reports with the same top language and a similar code size",codeLines:"code",mixed:"mixed"},Ls={files:"Files",lines:"Lines",code:"Code",comments:"Comments",blanks:"Blanks"},Es={kicker:"insight",title:"Codebase readout",scale:"Scale",cacheState:"Result",speed:"Speed",speedDetail:"{{lines}} lines via {{version}}",scaleValues:{tiny:"Tiny",small:"Small",medium:"Medium",large:"Large",huge:"Huge"},scaleDetails:{tiny:"Under 1k code lines",small:"1k-10k code lines",medium:"10k-100k code lines",large:"100k-500k code lines",huge:"500k+ code lines"}},$s={title:"Report trust details",commit:"Commit",ref:"Ref",counter:"Counter",cache:"Cache",stars:"Stars",profile:"Profile",ignored:"Ignored dirs",languages:"Ignored languages",none:"none"},_s={summary:"Advanced analysis options",profile:"Profile",defaultProfile:"Default",sourceOnlyProfile:"Source only",ignoredDirs:"Ignore dirs",ignoredLanguages:"Ignore languages",includeDocs:"Include docs",includeTests:"Include tests",includeGenerated:"Include generated",profiles:{default:"default","source-only":"source only"}},Os={languageShare:"Language share",report:"Report",lines:"lines",other:"Other",noData:"No data",totalLinesTooltip:"{{count}} total lines",fullStats:"Full statistics",compactStats:"Compact statistics",totalCodeTooltip:"{{count}} total code lines"},As={title:"Lines of Code History",chartAriaLabel:"Lines of code growth chart, {{count}} lines currently",locAbbrev:"lines",gatheringSloc:"Gathering historical code data⦠this can take a minute the first time",exportGif:"Export GIF",gifExportFailed:"GIF export failed. Try again.",unavailable:"History could not load.",empty:"No history is available yet.",retry:"Retry",dataTable:"History data",date:"Date",lines:"Code lines"},Ts={caption:"Source line counts by language for {{repo}}",language:"Language",files:"files",lines:"lines",code:"code",comments:"comments",blanks:"blanks",total:"Total",expandLanguage:"Expand {{language}} file details",collapseLanguage:"Collapse {{language}} file details"},Ps={title:"Browser Extension",subtitle:"GitHub SLOC & code statistics in the repo sidebar.",terminalLabel:"browser-extension@octocounts",name:"OctoCounts â GitHub SLOC & Code Statistics",description:"Open a GitHub repository and OctoCounts adds a compact SLOC card to the repo sidebar. Click the card for the full panel with totals, language breakdown, and cached stats.",features:["Repo sidebar card","Language table","Local cache","Auto-analyze setting","Placement setting"],installChrome:"Install from Chrome Web Store",installEdge:"Install from Microsoft Edge Add-ons",installFirefox:"Download for Firefox (GitHub release)",viewSource:"View source",previewAlt:"OctoCounts browser extension showing SLOC results on a GitHub repository",learnMore:"Learn more about the extension"},Us={title:"Use Cases",subtitle:"common reasons developers count lines",cases:[{title:"Evaluate a dependency",text:"Before adopting a new open source library, check its actual size, not just file count. A 50-file repo might be 20k lines of dense C++ or 500 lines of glue code. SLOC gives you the real picture before you commit to a dependency."},{title:"Estimate project scope",text:"Clients and stakeholders ask how big a codebase is. SLOC gives you a solid number before a review or audit: 12k lines across 8 languages, 89% code, 4% comments."},{title:"Compare forks or alternatives",text:"Paste two repos and compare language breakdowns side by side. See how much a fork diverged, or how different two implementations of the same spec really are."}]},Is={title:"How It Works",subtitle:"archive in, tokei report out",pipeline:{url:"github url",tarball:"tarball",tokei:"tokei",report:"cached report"},steps:[{num:"01",title:"Resolve",text:"OctoCounts validates the public GitHub URL and resolves the requested branch, tag, or commit SHA to a pinned commit hash via the GitHub API. Pinning to a commit means the analysis is deterministic: the same URL and ref always produce the same count, and the cache key is stable regardless of branch movement.",code:"GET <1>/repos/:owner/:repo</1>"},{num:"02",title:"Count",text:"The Rust backend downloads a compressed archive, not a full git clone. It skips generated folders like node_modules, vendor, and .git, then tokei counts every source file in a background worker queue.",code:"tokei <1>--output json</1>"},{num:"03",title:"Cache",text:"Reports are stored by owner, repo, commit SHA, and tokei version. When you re-analyze the same commit, the cache is hit immediately, with no re-download and no re-count. Re-run forces a fresh analysis and updates the cache. The browser extension also caches results locally for instant offline viewing.",code:"cache <1>commit + version</1>"}]},Ds={tagline:"OctoCounts // actual SLOC for public GitHub repos",about:"About",privacy:"Privacy",contact:"Contact",apiDocs:"API docs",slocGuide:"SLOC guide",faq:"FAQ",badges:"Badges",builtBy:"Built by <1>huanglizhuo</1>, indie developer",copyright:"(c) 2026",extension:"Extension"},Ms={switchToDay:"Switch to day mode",switchToNight:"Switch to night mode",toggle:"Toggle dark or light theme"},Bs={privateRepo:"Private repositories are not supported.",invalidUrl:"Enter a public github.com repository URL.",refNotFound:"The requested branch, tag, or commit was not found.",ref
92NotFoundWithDefault:`The requested branch, tag, or commit was not found. This repository's default branch is "{{branch}}" â clear the ref field to use it.`,rateLimited:"GitHub API rate limit was reached.",githubUnavailable:"The repository host is currently unavailable â the problem is on GitHub's side, not this service. Check the GitHub status page and try again in a few minutes.",tooLarge:"This repository is too large to analyze right now.",notFound:"Repository was not found or is not public.",emptyRepository:"This repository has no commits to count.",githubRequestFailed:"GitHub request failed.",analysisFailed:"Analysis failed while counting the repository.",requestFailed:"Request failed",failedCode:"failed",retry:"retry"},zs={private_repo:"OctoCounts analyzes public repositories only. It does not request GitHub account access, does not support private repositories, and does not accept source-code uploads.",invalid_url:"Use a URL like https://github.com/owner/repo.",ref_not_found:"Check the ref field for typos, or leave it empty to use the repository default branch.",empty_repository:"The repository has no commits, so there is nothing to count. Retrying will not change that.",rate_limited:"Wait a few minutes and retry. Cached reports continue to load instantly when available.",too_large:"The analyzer has size and timeout limits. Try a smaller ref or retry later.",not_found:"Confirm that the repository exists and is public. Private repositories are intentionally out of scope.",github_request_failed:"GitHub did not return a usable archive or repository response. Retry after a short wait.",analysis_failed:"The archive downloaded, but the counting step failed. Retry once; if it repeats, the repository may hit an analyzer edge case.",default:"Retry the analysis, or check the repository URL and ref."},Fs={degradedHint:"analyses may fail until it recovers.",official:"GitHub's official status:",officialOperational:"GitHub's status page currently reports normal operation; the failure may be transient.",link:"View GitHub status"},qs={label:"Language"},Hs={title:"Badge Builder",subtitle:"copy live README badges",openPage:"full badge page",type:"Badge type",language:"Language",copyMarkdown:"copy markdown",previewAlt:"OctoCounts badge preview",noRepo:"Enter a valid public GitHub repository URL above.",types:{summary:"Summary",code:"Code lines",lines:"Total lines",files:"Files",comments:"Comments",languages:"Language count","top-language":"Top language",ratio:"Code share",language:"Single language"},markdownAria:"Badge Markdown output",defaultConfigNote:"Badges use the requested ref with default analysis options; they do not reproduce custom report options."},Gs={kicker:"badges, live",hint:"rendered by the badge API right now · embed yours from the builder above",alt:"OctoCounts badge for {{repo}}"},Ws={kicker:"readme badges, live",title:"SLOC badges for your README",subtitle:"Pick a badge type, copy the markdown, and your README shows live line counts that link back to a permanent OctoCounts report.",faqTitle:"Badge FAQ",faqSubtitle:"common questions about README badges",faq:[{question:"What is an OctoCounts badge?",answer:"A small live image you embed in a README that shows repository SLOC stats and links to the permanent OctoCounts report page."},{question:"How do I add a badge to my README?",answer:"Pick a badge type above, copy the Markdown snippet, and paste it into your README.md where you want the badge to appear."},{question:"Will the badge slow down my README?",answer:"No. Badges are lightweight SVG images served by the OctoCounts badge API and are cached by CDN."},{question:"Can I show a single language instead of the whole repo?",answer:"Yes. Select 'Single language' in the badge builder and enter the language name, for example Rust or TypeScript."},{question:"Does the badge update automatically?",answer:"The badge reflects the latest cached report for the requested ref. Re-analyze the repository or visit its OctoCounts report to refresh the cache."}],repoLabel:"Repository URL",repoAria:"Repository URL",refLabel:"Ref (optional)",refAria:"Repository ref",refPlaceholder:"default branch"},Vs={title:"Embed a SLOC card",subtitle:"iframe widget for blogs and docs",description:"Paste this iframe snippet into a blog post or docs page to show the repository's live line counts and language mix, linking back to the full report:",previewAlt:"OctoCounts embed card preview",copy:"copy iframe",snippetAria:"Embed iframe output",defaultConfigNote:"Embeds show the latest cached default-branch report and do not carry custom analysis options.",languageNote:"The embedded card's language follows each visitor's browser. Append ?lng=en or ?lng=zh to the embed URL to pin a language."},Ks={ariaLabel:"{{repo}} SLOC summary card",lines:"lines",code:"code",poweredBy:"Powered by OctoCounts",loading:"Loading reportâ¦",unavailable:"No cached report yet â open the full report to run an analysis.",viewReport:"View full report"},Js={ariaLabel:"Share this page",label:"share:",x:"X",reddit:"Reddit",hackernews:"HN",native:"share",reportText:"{{repo}}
92 has {{code}} lines of code â SLOC report by OctoCounts",compareText:"{{left}} vs {{right}} â source lines of code compared by OctoCounts"},Qs={draftChanged:"Inputs changed. Run again to update this result.",title:"Compare Repos",subtitle:"forks, alternatives, or branches",help:"Compare total SLOC, code lines, language mix, and deltas between two public repositories or refs.",leftRepo:"Left repository",rightRepo:"Right repository",repoUrl:"Repository URL",ref:"Ref",refPlaceholder:"optional ref",run:"Compare",languages:"Languages",metric:"Metric",left:"Left",right:"Right",delta:"Delta",copyUrl:"copy URL",running:"running: analyzing both reports, this can take a minute",resultPending:"Run a comparison to create a result link.",defaultRef:"default",analysisFailed:"Analysis failed. Wait a few minutes and try again.",analysisTimedOut:"The comparison is taking too long. Wait a few minutes and try again.",swap:"Swap left and right repositories",noSharedLanguages:"The two reports share no languages, so there is no per-language delta to show."},Zs={unavailable:"This comparison is temporarily unavailable. Please try again in a moment, or run a fresh comparison with the tool below.",missing:"A cached OctoCounts report is not available for both repositories yet. Run the analyses with the tool below, then revisit this page.",resultsAria:"Comparison results",aboutAria:"About this comparison",aboutTitle:"About this comparison",sourcesLabel:"Sources:",verified:"Statements verified {{date}}.",nextSteps:"Evidence and next steps:",slocReport:"{{repo}} SLOC report",interactive:"Compare {{left}} and {{right}} interactively",faqTitle:"Compare FAQ",relatedAria:"Related OctoCounts pages"},Xs={title:"Ref Diff",subtitle:"branch, tag, or commit deltas",help:"Compare one repository across two refs to estimate growth between releases, branches, or pull request endpoints.",repo:"Repository",refs:"Refs",base:"base ref",head:"head ref",run:"Diff",resultPending:"Run a diff to create a result link."},Ys={reportsLabel:"Reports",navAria:"Public report pages",footerTagline:"OctoCounts growth loops are built from aggregate public report activity.",loading:"Loading public report stats...",error:"Stats are temporarily unavailable.",empty:"No reports yet.",nav:{stats:{label:"Stats",detail:"aggregate usage"},recent:{label:"Recent",detail:"fresh reports"},popular:{label:"Popular",detail:"most viewed"},trending:{label:"Trending",detail:"GitHub daily"},hall:{label:"Hall",detail:"largest repos"}},index:{ariaLabel:"Public OctoCounts report index",navAria:"Explore public reports",label:"public index",fallback:"public report activity, aggregate only",stats:"{{reports}} reports / {{repos}} repos / {{lines}} code lines"},actions:{analyze:"Analyze repo",stats:"Stats dashboard",recent:"Recent reports",popular:"Popular reports",largest:"Largest repos",chrome:"Chrome extension"},stats:{ariaLabel:"OctoCounts stats",kicker:"public stats",title:"OctoCounts growth dashboard",subtitle:"Aggregate activity from public repository reports. No extension user IDs, no DAU tracking, no browser history collection."},metrics:{totalsAria:"Totals",windowsAria:"Recent windows",reportsGenerated:"reports generated",repositoriesAnalyzed:"repositories analyzed",linesCounted:"lines counted",languagesDetected:"languages detected",reportsToday:"reports today",reports7d:"reports 7d",reports30d:"reports 30d",newRepos30d:"new repos 30d"},panels:{sources:{title:"Source breakdown",subtitle:"analysis requests that generated reports"},languages:{title:"Language SLOC",subtitle:"top languages across generated reports"}},sections:{largest:{title:"Largest public repositories",subtitle:"ranked by latest counted lines"},recent:{title:"Recent public reports",subtitle:"fresh report inventory for search and sharing"}},pages:{recent:{kicker:"recent",title:"Recent codebase reports",subtitle:"Fresh public repository SLOC reports generated by OctoCounts."},popular:{kicker:"popular",title:"Popular codebase reports",subtitle:"Frequently opened public repository reports, ready to cite and share."},trending:{kicker:"GitHub daily",title:"Trending GitHub repositories today",subtitle:"Daily GitHub Trending projects with stable OctoCounts source line count report links.",updated:"Snapshot updated {{date}}"},hall:{kicker:"leaderboard",title:"Hall of Monoliths",subtitle:"The largest public repositories OctoCounts has measured, ranked by counted lines."}},pagination:{ariaLabel:"Report pages",previous:"Previous",page:"Page {{page}}",next:"Next"},repoCard:{mixed:"mixed",code:"code",trendingFallback:"GitHub Trending repository",starsToday_one:"+{{count}} star today · {{total}} total",starsToday_other:"+{{count}} stars today · {{total}} total"}},en={language:"Language",files:"Files",lines:"Lines",code:"Code",comments:"Comments",blanks:"Blanks",total:"Total"},tn={skipToContent:"Skip to content"},sn={ariaLabel:"Report tools",title:"Continue with this repository",subtitle:"Open a focused tool with this repository and ref already selected.",compare:"Compare this ref",diff:"Diff this ref",badges:"Create badges",copyCitation:"Copy citation"},nn={title:"Developer tools",subtitle:"Make SLOC reports show up where developers already work.",items:{stats:{title:"Public stats",text:"Aggregate report totals, language coverage, largest repositories, and source breakdown without user-level tracking."},action:{title:"GitHub Action",text:"Comment SLOC changes on pull requests so reports travel through review workflows."},cli:{title:"CLI",text:"Run OctoCounts from a terminal or CI script and print text or JSON summaries."},mcp:{title:"MCP server",text:"Expose SLOC reports to agent workflows and developer assistants through MCP tools."},badge:{title:"README badge",text:"Add a live SLOC badge that links back to a permanent report page."},api:{title:"API",text:"Use analyze, jobs, reports, badge, SEO, and stats endpoints directly."}}},an={heroTitle:"See GitHub code statistics in your browser",heroIntro:"OctoCounts is a free browser extension that adds a SLOC (source lines of code) card to public GitHub repository pages. The card shows the repository's total line count at a glance; clicking it opens a full panel with files, code lines, comment lines, blank lines, and a per-language breakdown â the same counts the OctoCounts web app produces with tokei, pinned to an exact commit.",installTitle:"Install OctoCounts",installSubtitle:"Free, no account, no API token",stepsTitle:"Install in three steps",step1:"Install OctoCounts from the Chrome Web Store, Microsoft Edge Add-ons, or Firefox Add-ons â one click, no account.",step2:"Open any public GitHub repository page in y
92our browser.",step3:"The SLOC card appears in the repository sidebar automatically. Click it to open the full panel with the per-language line breakdown.",permissionsTitle:"Permissions and data handling",permissions:"The extension reads the public GitHub repository page you are viewing to detect the owner and repository name, and runs the count against public data through the OctoCounts API. It does not request GitHub account access, needs no API token, works on public repositories only, and collects no personal data. Results are cached locally and by repository and ref so repeat visits load instantly.",scopeTitle:"Supported repositories",scope:"Public GitHub repositories. Private repositories and source-code uploads are not supported; to count private code, run tokei locally."},rn={app:xs,topbar:ys,hero:js,samples:ws,recent:vs,stickyBar:Cs,runner:ks,shareCard:Ns,reportCta:Ss,similarRepos:Rs,summary:Ls,insights:Es,trust:$s,analysisOptions:_s,charts:Os,codeHistory:As,table:Ts,extensionSection:Ps,useCases:Us,howItWorks:Is,footer:Ds,theme:Ms,error:Bs,errorHelp:zs,githubStatus:Fs,languageSwitcher:qs,badgeBuilder:Hs,badgeWall:Gs,badgesPage:Ws,embedBuilder:Vs,embedCard:Ks,share:Js,compare:Qs,curatedCompare:Zs,diff:Xs,growth:Ys,textReport:en,common:tn,reportTools:sn,developerTools:nn,extensionLanding:an};let Oe=()=>{};const on=new Promise(e=>{Oe=e});async function ln(e){if(e==="zh"&&!f.hasResourceBundle("zh","translation")){const s=await I(()=>import("./zh-3wz-SsQQ.js"),[]);f.addResourceBundle("zh","translation",s.default,!0,!0)}}f.on("languageChanged",e=>{ln(e).then(Oe).catch(Oe)});f.use(It).use(Dt).init({resources:{en:{translation:rn}},fallbackLng:"en",supportedLngs:["en","zh"],interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator"],caches:["localStorage"]},react:{bindI18nStore:"added"}});const U={analyzeSubmitted:"analyze_submitted",analyzeCompleted:"analyze_completed",badgeMarkdownCopied:"badge_markdown_copied",embedSnippetCopied:"embed_snippet_copied",pngExported:"png_exported",gifExported:"gif_exported",extensionStoreClick:"extension_store_click",reportUrlCopied:"report_url_copied",shareClicked:"share_clicked",aiVisit:"ai_visit"},cn=[{host:/(^|\.)chatgpt\.com$/,source:"chatgpt"},{host:/(^|\.)openai\.com$/,source:"chatgpt"},{host:/(^|\.)perplexity\.ai$/,source:"perplexity"},{host:/(^|\.)pplx\.ai$/,source:"perplexity"},{host:/(^|\.)gemini\.google\.com$/,source:"gemini"},{host:/(^|\.)copilot\.microsoft\.com$/,source:"copilot"},{host:/(^|\.)claude\.ai$/,source:"claude"},{host:/(^|\.)kimi\.com$/,source:"kimi"}];function dn(e){var s;if(e)try{const n=new URL(e).hostname.toLowerCase();return(s=cn.find(a=>a.host.test(n)))==null?void 0:s.source}catch{return}}function un(){if(typeof document>"u")return;let e=null;try{e=sessionStorage.getItem("octocounts.ai_visit")}catch{return}const s=dn(document.referrer);if(!(!s||e===s)){try{sessionStorage.setItem("octocounts.ai_visit",s)}catch{}S(U.aiVisit,{source:s,path:window.location.pathname})}}function S(e,s){var n,a;(n=window.plausible)==null||n.call(window,e,s?{props:s}:void 0),(a=window.umami)==null||a.track(e,s)}function we(e){try{const s=e.trim().startsWith("[email protected]:")?e.trim().replace("[email protected]:","https://github.com/"):e.trim();if(new URL(s).hostname==="github.com")return"github"}catch{return"unknown"}return"unknown"}const We="2026-09-17",ve="https://github.com/huanglizhuo/OctoCounts",ct="e92153946164",he={chromeWebStoreUrl:"https://chromewebstore.google.com/detail/octocounts-%E2%80%94-github-sloc/gkgjpjdnaklagijmekoolhcpebmoldbj",edgeAddOnsUrl:"https://microsoftedge.microsoft.com/addons/detail/octocounts-%E2%80%93-github-sloc-/ehifednhpbpekkadndaipnngopbhpoim",firefoxAddOnsUrl:"https://addons.mozilla.org/en-US/firefox/addon/octocounts-github-sloc/"};function dt({size:e}){return t.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 0C8.21 0 4.831 1.757 2.632 4.501l3.953 6.848A5.454 5.454 0 0 1 12 6.545h10.691A12 12 0 0 0 12 0zM1.931 5.47A11.943 11.943 0 0 0 0 12c0 6.012 4.42 10.991 10.189 11.864l3.953-6.847a5.45 5.45 0 0 1-6.865-2.29zm13.342 2.166a5.446 5.446 0 0 1 1.45 7.09l.002.001h-.002l-5.344 9.257c.206.01.413.016.621.016 6.627 0 12-5.373 12-12 0-1.54-.29-3.011-.818-4.364zM12 16.364a4.364 4.364 0 1 1 0-8.728 4.364 4.364 0 0 1 0 8.728Z"})})}function ut({size:e}){return t.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"
92currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M21.86 13.34c0-5.2-4.16-9.42-9.3-9.42-4.63 0-8.48 3.43-9.18 7.91.96-1.72 2.91-3.3 5.87-3.3 3.54 0 5.85 2.05 5.85 4.8H7.56c.24 2.65 2.43 4.42 5.47 4.42 2.12 0 4.05-.73 5.54-2.13-.89 2.88-3.57 4.46-6.85 4.46C5.64 20.08 1 16.12 1 10.45 1 4.68 5.77 0 11.65 0 18.38 0 23 4.77 23 11.35c0 .69-.06 1.35-.18 1.99h-.96Z"})})}function ht({size:e}){return t.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M20.452 3.445a11.002 11.002 0 00-2.482-1.908C16.944.997 15.098.093 12.477.032c-.734-.017-1.457.03-2.174.144-.72.114-1.398.292-2.118.56-1.017.377-1.996.975-2.574 1.554.583-.349 1.476-.733 2.55-.992a10.083 10.083 0 013.729-.167c2.341.34 4.178 1.381 5.48 2.625a8.066 8.066 0 011.298 1.587c1.468 2.382 1.33 5.376.184 7.142-.85 1.312-2.67 2.544-4.37 2.53-.583-.023-1.438-.152-2.25-.566-2.629-1.343-3.021-4.688-1.118-6.306-.632-.136-1.82.13-2.646 1.363-.742 1.107-.7 2.816-.242 4.028a6.473 6.473 0 01-.59-1.895 7.695 7.695 0 01.416-3.845A8.212 8.212 0 019.45 5.399c.896-1.069 1.908-1.72 2.75-2.005-.54-.471-1.411-.738-2.421-.767C8.31 2.583 6.327 3.061 4.7 4.41a8.148 8.148 0 00-1.976 2.414c-.455.836-.691 1.659-.697 1.678.122-1.445.704-2.994 1.248-4.055-.79.413-1.827 1.668-2.41 3.042C.095 9.37-.2 11.608.14 13.989c.966 5.668 5.9 9.982 11.843 9.982C18.62 23.971 24 18.591 24 11.956a11.93 11.93 0 00-3.548-8.511z"})})}function ke({store:e,placement:s,size:n=15,className:a,children:r}){const i=e==="chrome"?he.chromeWebStoreUrl:e==="edge"?he.edgeAddOnsUrl:he.firefoxAddOnsUrl,l=e==="chrome"?dt:e==="edge"?ut:ht;return t.jsxs("a",{className:a,href:i,target:"_blank",rel:"noreferrer",onClick:()=>S(U.extensionStoreClick,{store:e,placement:s}),children:[t.jsx(l,{size:n,"aria-hidden":"true"}),r]})}const hn="https://api.octocounts.com";class pt extends Error{constructor(n,a,r){super(n);Ce(this,"code");Ce(this,"status");this.name="ApiRequestError",this.status=a,this.code=r}}async function pn(e){return oe("/api/analyze",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({repoUrl:e.repoUrl,refName:e.refName||void 0,forceRefresh:e.forceRefresh,options:e.options,source:e.source??"web"}),signal:e.signal})}function mn(){return oe("/api/stats")}function hr(e,s,n){const a=new URLSearchParams({provider:e,owner:s,repo:n});return oe(`/api/seo/repo-history?${a.toString()}`)}async function oe(e,s){const n=await fetch(`${hn}${e}`,s),a=await n.json().catch(()=>null);if(!n.ok){const r=gn(a);throw new pt(fn(a,n.statusText),n.status,r)}return a}function gn(e){if(!(!e||typeof e!="object"))return"code"in e&&typeof e.code=="string"?e.code:void 0}function fn(e,s){if(!e||typeof e!="object")return s||f.t("error.requestFailed");const n="code"in e&&typeof e.code=="string"?e.code:"",a="message"in e&&typeof e.message=="string"?e.message:"",r="defaultBranch"in e&&typeof e.defaultBranch=="string"?e.defaultBranch:void 0;return mt(n,a||s,"error.requestFailed",r)}function mt(e,s,n,a){return e==="private_repo"?f.t("error.privateRepo"):e==="invalid_url"?f.t("error.invalidUrl"):e==="ref_not_found"?a?f.t("error.refNotFoundWithDefault",{branch:a}):f.t("error.refNotFound"):e==="empty_repository"?f.t("error.emptyRepository"):e==="rate_limited"?f.t("error.rateLimited"):e==="github_unavailable"?f.t("error.githubUnavailable"):e==="too_large"?f.t("error.tooLarge"):e==="not_found"?f.t("error.notFound"):e==="github_request_failed"?f.t("error.githubRequestFailed"):e==="analysis_failed"?f.t("error.analysisFailed"):s||f.t(n)}const bn="https://www.githubstatus.com/api/v2/status.json",xn=300*1e3;let ae=null,me=null;function yn(){return ae&&Date.now()-ae.at<xn?Promise.resolve(ae.value):me||(me=fetch(bn).then(e=>e.ok?e.json():null).then(e=>{const s=e&&typeof e=="object"&&"status"in e?e.status:void 0,n=typeof(s==null?void 0:s.indicator)=="string"&&typeof(s==null?void 0:s.description)=="string"?{indicator:s.indicator,description:s.description}:null;return ae={at:Date.now(),value:n},n}).catch(()=>null).finally(()=>{me=null}),me)}const jn=new Set(["minor","major","critical","maintenance"]);function gt(e){return e!==null&&jn.has(e.indicator)}
92function ft(){const[e,s]=d.useState(()=>(ae==null?void 0:ae.value)??null);return d.useEffect(()=>{let n=!1;return yn().then(a=>{n||s(a)}),()=>{n=!0}},[]),e}const bt="octocounts.theme";function wn(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"matrix":"paper"}function vn(){try{const e=localStorage.getItem(bt);return e==="matrix"||e==="paper"?e:null}catch{return null}}function Cn(){return vn()??wn()}function kn(e){try{localStorage.setItem(bt,e)}catch{}}const Ue=d.createContext({scheme:"matrix",setScheme:()=>{}});function Nn({children:e}){const{i18n:s}=C(),[n,a]=d.useState(()=>Cn());return d.useEffect(()=>{document.documentElement.dataset.scheme=n,kn(n)},[n]),d.useEffect(()=>{document.documentElement.lang=s.language},[s.language]),t.jsx(Ue.Provider,{value:{scheme:n,setScheme:a},children:e})}function Sn(){return d.useContext(Ue)}function xt(){return d.useContext(Ue).scheme}function Rn(){const{t:e}=C(),{scheme:s,setScheme:n}=Sn(),a=s==="matrix",r=e("theme.toggle"),i=e(a?"theme.switchToDay":"theme.switchToNight");return t.jsxs("button",{className:"theme-toggle",type:"button",onClick:()=>n(a?"paper":"matrix"),"aria-label":r,"aria-pressed":a,title:`${r} â ${i}`,children:[a?t.jsx(bs,{size:18,"aria-hidden":"true"}):t.jsx(ds,{size:18,"aria-hidden":"true"}),t.jsx("span",{className:"visually-hidden",children:r})]})}const yt=[{href:"/stats",key:"stats",command:"stats"},{href:"/recent",key:"recent",command:"tail -f"},{href:"/popular",key:"popular",command:"sort --hits"},{href:"/trending",key:"trending",command:"watch --daily"},{href:"/hall-of-monoliths",key:"hall",command:"top --lines"}];function Ln(){const{t:e,i18n:s}=C(),n=window.location.pathname,[a,r]=d.useState(null),i=d.useRef({explore:null,tools:null,install:null}),l=u=>n===u;d.useEffect(()=>{const u=p=>{Object.values(i.current).some(m=>m==null?void 0:m.contains(p.target))||r(null)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[]);const o=u=>{if(u.key!=="Escape")return;u.preventDefault();const p=u.currentTarget.querySelector("summary");r(null),requestAnimationFrame(()=>p==null?void 0:p.focus())},c=(u,p,m)=>t.jsxs("details",{ref:g=>{i.current[u]=g},className:`topbar-menu ${u==="install"?"topbar-install":""}`,open:a===u,onKeyDown:o,children:[t.jsxs("summary",{onClick:g=>{g.preventDefault(),r(x=>x===u?null:u)},children:[t.jsx("span",{className:"topbar-menu-label",children:p}),u==="install"?t.jsx("span",{className:"topbar-menu-short",children:e("topbar.install")}):null]}),t.jsx("div",{className:"topbar-popover",children:m})]});return t.jsxs("header",{className:"topbar",children:[t.jsxs("a",{className:"brand",href:"/","aria-label":e("topbar.brandName"),children:[t.jsx("div",{className:"logo",children:t.jsx("img",{src:"/octocounts-logo-96.webp",alt:"",width:"96",height:"96"})}),t.jsx("span",{className:"brand-name",children:e("topbar.brandName")})]}),t.jsxs("nav",{className:"topbar-nav","aria-label":e("topbar.navigation"),children:[t.jsx("a",{href:"/","aria-current":n==="/"?"page":void 0,children:e("topbar.analyze")}),c("explore",e("topbar.explore"),yt.map(u=>t.jsx("a",{href:u.href,"aria-current":l(u.href)?"page":void 0,children:e(`growth.nav.${u.key}.label`)},u.href))),c("tools",e("topbar.tools"),t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/compare","aria-current":l("/compare")?"page":void 0,children:e("topbar.compare")}),t.jsx("a",{href:"/diff","aria-current":l("/diff")?"page":void 0,children:e("topbar.diff")}),t.jsx("a",{href:"/badges","aria-current":l("/badges")?"page":void 0,children:e("topbar.badges")})]})),c("install",e("topbar.installExtension"),t.jsxs(t.Fragment,{children:[t.jsx(Ne,{store:"chrome",label:e("topbar.chrome")}),t.jsx(Ne,{store:"edge",label:e("topbar.edge")}),t.jsx(Ne,{store:"firefox",label:e("topbar.firefox")})]}))]}),t.jsxs("div",{className:"topbar-controls",role:"group","aria-label":e("languageSwitcher.label"),children:[t.jsx("button",{type:"button",className:"lang-btn","aria-current":s.language==="en"?"true":void 0,onClick:()=>s.changeLanguage("en"),children:"EN"}),t.jsx("button",{type:"button",className:"lang-btn","aria-current":s.language==="zh"?"true":void 0,onClick:()=>s.changeLanguage("zh"),children:"䏿"}),t.jsx(Rn,{}),t.jsx("a",{className:"github-link icon-link",href:ve,target:"_blank",rel:"noreferrer","aria-label":e("topbar.githubAria"),children:"GitHub"})]})]})}function Ne({store:e,label:s}){const n=e==="chrome"?he.chromeWebStoreUrl:e==="edge"?he.edgeAddOnsUrl:he.firefoxAddOnsUrl,a=e==="chrome"?dt:e==="edge"?ut:ht;return t.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",onClick:()=>S(U.extensionStoreClick,{store:e,placement:"topbar"}),children:[t.jsx(a,{size:15,"aria-hidden":"true"})," ",s]})}const Ve=[20,27,23],Ke=3.2;function Ie(e,s){if(s!=="matrix")return e;const n=En(e);if(!n||Je(n,Ve)>=Ke)return e;const[a,r,i]=$n(n);let l=i,o=1;for(let c=0;c<18;c+=1){const u=(l+o)/2;Je(Qe(a,r,u),Ve)>=Ke?o=u:l=u}return _n(Qe(a,r,o))}function Je(e,s){const n=Math.max(xe(e),xe(s)),a=Math.min(xe(e),xe(s));
92return(n+.05)/(a+.05)}function En(e){const s=/^#([0-9a-f]{6})$/i.exec(e.trim());if(!s)return null;const n=parseInt(s[1],16);return[n>>16&255,n>>8&255,n&255]}function xe([e,s,n]){const a=r=>{const i=r/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*a(e)+.7152*a(s)+.0722*a(n)}function $n([e,s,n]){const a=e/255,r=s/255,i=n/255,l=Math.max(a,r,i),o=Math.min(a,r,i),c=(l+o)/2;if(l===o)return[0,0,c];const u=l-o,p=c>.5?u/(2-l-o):u/(l+o);let m;return l===a?m=((r-i)/u+(r<i?6:0))*60:l===r?m=((i-a)/u+2)*60:m=((a-r)/u+4)*60,[m,p,c]}function Qe(e,s,n){const a=(1-Math.abs(2*n-1))*s,r=e/60,i=a*(1-Math.abs(r%2-1)),[l,o,c]=r<1?[a,i,0]:r<2?[i,a,0]:r<3?[0,a,i]:r<4?[0,i,a]:r<5?[i,0,a]:[a,0,i],u=n-a/2;return[l,o,c].map(p=>Math.round((p+u)*255))}function _n(e){const s=n=>n.toString(16).padStart(2,"0");return`#${e.map(s).join("")}`}function On(e){const s=e.languages.filter(a=>a.stats.code>0).slice(0,6),n=Math.max(...s.map(a=>a.stats.code),1);return s.map(a=>({label:a.name,value:a.stats.code,color:De(a.name),percent:Math.max(4,Math.round(a.stats.code/n*100))}))}function An(e,s,n,a=0){if(e==="failed")return[{ts:"00:00",kind:"err",text:n??f.t("runner.status.failed")}];if(e==="idle")return[{ts:"00:00",kind:"",text:f.t("runner.log.idle")}];if(e==="queued"){const r=[{ts:ye(a),kind:"warn",text:f.t("runner.log.queuedWaiting",{elapsed:a})}];return a>=8&&r.push({ts:ye(a),kind:"warn",text:f.t("runner.log.stillQueued",{elapsed:a})}),r}if(e==="running"){const r=[{ts:ye(a),kind:"",text:f.t("runner.log.runningWaiting",{elapsed:a})}];return a>=20&&r.push({ts:ye(a),kind:"warn",text:f.t("runner.log.stillCounting",{elapsed:a})}),r}return s?[{ts:"00:01",kind:"ok",text:f.t("runner.log.resolvedRef",{ref:s.refName,sha:s.commitSha.slice(0,12)})},{ts:"00:02",kind:"ok",text:s.cached?f.t("runner.log.cacheHit"):f.t("runner.log.freshReport")},{ts:"00:03",kind:"ok",text:f.t("runner.log.languageRows",{count:s.languages.length})},{ts:"00:04",kind:"ok",text:f.t("runner.log.counted",{lines:_(s.total.lines),duration:s.durationMs})}]:[]}function ye(e){const s=Math.floor(e/60),n=e%60;return`${String(s).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function Tn(e){return e==="idle"?0:e==="queued"?30:e==="running"?64:100}function W(e){return"github"}function Pn(e,s,n){return[...e].sort((a,r)=>{const i=s==="name"?a.name:a.stats[s],l=s==="name"?r.name:r.stats[s],o=typeof i=="string"&&typeof l=="string"?i.localeCompare(l):Number(i)-Number(l);return n==="asc"?o:-o})}const Un={rust:"#CE422B",python:"#3572A5",javascript:"#F1E05A",typescript:"#3178C6",go:"#00ADD8",ruby:"#701516",java:"#B07219",c:"#555555","c++":"#F34B7D","c#":"#239120",swift:"#F05138",kotlin:"#7F52FF",scala:"#DC322F",php:"#4F5D95",html:"#E34C26",css:"#563D7C",shell:"#89E051",r:"#198CE7",dart:"#00B4AB",lua:"#000080",haskell:"#5E5086",elixir:"#6E4A7E",clojure:"#DB5855",perl:"#0298C3",vue:"#41B883",svelte:"#FF3E00",zig:"#EC915C",nix:"#7E7EFF",ocaml:"#3BE133",groovy:"#4298B8",powershell:"#012456",makefile:"#427819",dockerfile:"#384D54",json:"#292929",yaml:"#CB171E",toml:"#9C4221",markdown:"#083FA1",tex:"#3D6117"},Ze=["#3fb950","#58a6ff","#d29922","#79c0ff","#d2a8ff","#f85149"];function De(e){const s=Un[e.toLowerCase()];if(s)return s;const n=[...e].reduce((a,r)=>a+r.charCodeAt(0),0);return Ze[n%Ze.length]}function jt(e){const s=[`${e.repository.owner}/${e.repository.name} ${e.commitSha.slice(0,12)}`,`${f.t("textReport.language").padEnd(14)} ${f.t("textReport.files").padStart(6)} ${f.t("textReport.lines").padStart(10)} ${f.t("textReport.code").padStart(10)} ${f.t("textReport.comments").padStart(10)} ${f.t("textReport.blanks").padStart(10)}`];for(const a of e.languages)s.push(`${a.name.padEnd(14)} ${String(a.stats.files).padStart(6)} ${String(a.stats.lines).padStart(10)} ${String(a.stats.code).padStart(10)} ${String(a.stats.comments).padStart(10)} ${String(a.stats.blanks).padStart(10)}`);const n=f.t("textReport.total");return s.push(`${n.padEnd(14)} ${String(e.total.files).padStart(6)} ${String(e.total.lines).padStart(10)} ${String(e.total.code).padStart(10)} ${String(e.total.comments).padStart(10)} ${String(e.total.blanks).padStart(10)}`),s.join(` 93`)}function Ae(e,s,n){return f.t("runner.command",{repo:e.trim()||"<repo>",ref:s.trim()?` --ref ${s.trim()}`:"",force:n?" --force":""})}async function X(e){var s;try{if((s=navigator.clipboard)!=null&&s.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return In(e)}function In(e){const s=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",n.style.top="0",document.body.appendChild(n),n.select();try{return document.execCommand("copy")}catch{return!1}finally{n.remove(),s!=null&&s.isConnected&&s.focus({preventScroll:!0})}}function Dn(e,s){const n=document.createElement("a");n.download=s,n.href=e,n.click()}function _(e){return new Intl.NumberFormat(f.language).format(e)}function ee(e){return e<=99999?_(e):new Intl.NumberFormat(f.language,{notation:"compact",maximumFractionDigits:1}).format(e)}function Y(e,s){if(e===0||s===0)return"0%";const n=e/s*100;if(n<.1)return"<0.1%";const a=n.toFixed(1);return a.endsWith(".0")?`${Math.round(n)}%`:`${a}%`}const Mn=["summary","code","lines","files","comments","languages","top-language","ratio","language"],Bn="https://api.octocounts.com";
93function zn({repoUrl:e,refName:s,report:n}){const{t:a}=C(),[r,i]=d.useState("summary"),[l,o]=d.useState("rust"),[c,u]=d.useState("idle"),p=n&&W()==="github"?{owner:n.repository.owner,repo:n.repository.name}:wt(e),m=(n==null?void 0:n.refName)||s.trim(),g=p?Be(p.owner,p.repo,m,r,l):"",x=p?pe(p.owner,p.repo,m):window.location.origin,b=g?`[](${x})`:"";return t.jsx("div",{className:"badge-builder",children:t.jsxs("div",{className:"badge-builder-layout",children:[t.jsx("div",{className:"badge-builder-settings",children:t.jsxs("div",{className:"badge-builder-controls",children:[t.jsxs("label",{children:[t.jsx("span",{children:a("badgeBuilder.type")}),t.jsx("select",{value:r,onChange:w=>i(w.target.value),children:Mn.map(w=>t.jsx("option",{value:w,children:a(`badgeBuilder.types.${w}`)},w))})]}),r==="language"?t.jsxs("label",{children:[t.jsx("span",{children:a("badgeBuilder.language")}),t.jsx("input",{value:l,onChange:w=>o(w.target.value),placeholder:"rust"})]}):null]})}),t.jsxs("div",{className:"badge-builder-result",children:[t.jsx("div",{className:"badge-builder-preview",children:g?t.jsx("img",{src:g,alt:a("badgeBuilder.previewAlt"),width:"180",height:"20"}):t.jsx("span",{children:a("badgeBuilder.noRepo")})}),t.jsx("p",{className:"badge-semantics",children:a("badgeBuilder.defaultConfigNote")}),t.jsxs("div",{className:"badge-builder-output",children:[t.jsx("code",{tabIndex:0,"aria-label":a("badgeBuilder.markdownAria"),children:b||a("badgeBuilder.noRepo")}),t.jsxs("button",{className:"copybtn",type:"button",disabled:!b,onClick:()=>{X(b).then(w=>{u(w?"copied":"failed"),w&&S(U.badgeMarkdownCopied,{provider:"github",placement:"builder"})})},children:[t.jsx(re,{size:14}),a(c==="copied"?"reportCta.copied":c==="failed"?"reportCta.copyFailedShort":"badgeBuilder.copyMarkdown")]})]})]})]})})}function pr({repoUrl:e,report:s}){const{t:n}=C(),[a,r]=d.useState("idle"),i=s&&W()==="github"?{owner:s.repository.owner,repo:s.repository.name}:wt(e),l=i?kt("github",i.owner,i.repo):"",o=l?Nt(l):"";return t.jsxs("div",{className:"badge-builder embed-builder",children:[t.jsx("p",{className:"badge-embed-desc",children:n("embedBuilder.description")}),t.jsx("p",{className:"badge-semantics",children:n("embedBuilder.defaultConfigNote")}),t.jsx("p",{className:"badge-semantics",children:n("embedBuilder.languageNote")}),t.jsx("div",{className:"badge-builder-preview embed-builder-preview",children:l?t.jsx("iframe",{src:l,width:"400",height:"160",frameBorder:"0",loading:"lazy",title:n("embedBuilder.previewAlt")}):t.jsx("span",{children:n("badgeBuilder.noRepo")})}),t.jsxs("div",{className:"badge-builder-output",children:[t.jsx("code",{tabIndex:0,"aria-label":n("embedBuilder.snippetAria"),children:o||n("badgeBuilder.noRepo")}),t.jsxs("button",{className:"copybtn",type:"button",disabled:!o,onClick:()=>{X(o).then(c=>{r(c?"copied":"failed"),c&&S(U.embedSnippetCopied,{provider:"github",placement:"badges_page"})})},children:[t.jsx(re,{size:14}),n(a==="copied"?"reportCta.copied":a==="failed"?"reportCta.copyFailedShort":"embedBuilder.copy")]})]})]})}const Fn=[{owner:"huanglizhuo",repo:"OctoCounts",type:"summary"},{owner:"tokio-rs",repo:"axum",type:"code"},{owner:"vitejs",repo:"vite",type:"top-language"}];function qn(){const{t:e}=C();return t.jsxs("div",{className:"badge-wall",children:[t.jsxs("div",{className:"badge-wall-head",children:[t.jsx("span",{className:"chart-tag",children:e("badgeWall.kicker")}),t.jsx("span",{children:e("badgeWall.hint")})]}),t.jsx("div",{className:"badge-wall-row",children:Fn.map(s=>t.jsxs("a",{href:pe(s.owner,s.repo,""),target:"_blank",rel:"noreferrer",children:[t.jsx("img",{src:Be(s.owner,s.repo,"",s.type,""),alt:e("badgeWall.alt",{repo:`${s.owner}/${s.repo}`}),loading:"lazy",width:"180",height:"20"}),t.jsxs("code",{children:[s.owner,"/",s.repo]})]},`${s.owner}/${s.repo}`))})]})}function wt(e){const s=Me(e);return!s||s.host!=="github.com"?null:{owner:s.owner,repo:s.repo}}function Me(e){try{const s=e.trim(),n=s.startsWith("[email protected]:")?s.replace("[email protected]:","https://github.com/"):s,a=new URL(n);if(a.hostname!=="github.com")return null;
93const r=a.pathname.split("/").filter(Boolean);return r.length<2?null:{host:a.hostname,owner:r.slice(0,-1).join("/"),repo:r[r.length-1].replace(/\.git$/,"")}}catch{return null}}function pe(e,s,n){const a=encodeURIComponent(e),r=`${window.location.origin}/github/${a}/${encodeURIComponent(s)}`;if(!n.trim())return r;const i=Ct(n)?"commit":"tree";return`${r}/${i}/${vt(n)}`}function vt(e){return e.trim().split("/").map(encodeURIComponent).join("/")}function Ct(e){return/^[a-f0-9]{7,40}$/i.test(e.trim())}function kt(e,s,n){const a=s.split("/").map(encodeURIComponent).join("/");return`${window.location.origin}/embed/${e}/${a}/${encodeURIComponent(n)}`}function Nt(e,s=400,n=160){return`<iframe src="${e}" width="${s}" height="${n}" frameborder="0" loading="lazy"></iframe>`}function Be(e,s,n,a,r){const i=encodeURIComponent(e),l=encodeURIComponent(s),o=Ct(n)?"commit":"branch",c=n.trim()?`/${o}/${vt(n)}`:"",u=new URLSearchParams;a==="language"?u.set("lang",r.trim()||"rust"):a!=="summary"&&u.set("type",a);const p=u.toString();return`${Bn}/badge/${i}/${l}${c}${p?`?${p}`:""}`}function Hn({url:e,text:s,placement:n}){const{t:a}=C(),r=[{key:"x",href:`https://twitter.com/intent/tweet?text=${encodeURIComponent(s)}&url=${encodeURIComponent(e)}`},{key:"reddit",href:`https://www.reddit.com/submit?url=${encodeURIComponent(e)}&title=${encodeURIComponent(s)}`},{key:"hackernews",href:`https://news.ycombinator.com/submitlink?u=${encodeURIComponent(e)}&t=${encodeURIComponent(s)}`}],i=typeof navigator<"u"&&typeof navigator.share=="function";return t.jsxs("div",{className:"share-buttons",role:"group","aria-label":a("share.ariaLabel"),children:[t.jsx("span",{className:"share-buttons-label",children:a("share.label")}),r.map(l=>t.jsx("a",{className:"copybtn",href:l.href,target:"_blank",rel:"noopener",onClick:()=>S(U.shareClicked,{share_type:l.key,placement:n}),children:a(`share.${l.key}`)},l.key)),i?t.jsxs("button",{className:"copybtn",type:"button",onClick:()=>{S(U.shareClicked,{share_type:"native",placement:n}),navigator.share({title:s,url:e}).catch(()=>{})},children:[t.jsx(lt,{size:14}),a("share.native")]}):null]})}const Gn="bb05b86aaabb82d08585569bce1284a0b01ec9e5a1c6d1b38e55aea67bf4761e",Wn={owner:"huanglizhuo",name:"OctoCounts",htmlUrl:"https://github.com/huanglizhuo/OctoCounts"},Vn="main",Kn="e921539461646579db979b7eaf40aa7c8f634f93",Jn="2026-05-03T14:54:51.484242888Z",Qn=194,Zn=!0,Xn="tokei-12.1",Yn=[{name:"JSON",stats:{files:3,lines:1829,code:1829,comments:0,blanks:0},children:[]},{name:"Rust",stats:{files:6,lines:1247,code:1107,comments:0,blanks:140},children:[]},{name:"CSS",stats:{files:1,lines:1272,code:1086,comments:0,blanks:186},children:[]},{name:"TSX",stats:{files:1,lines:762,code:702,comments:0,blanks:60},children:[]},{name:"HTML",stats:{files:2,lines:66,code:62,comments:0,blanks:4},children:[{name:"JavaScript",stats:{files:1,lines:137,code:104,comments:19,blanks:14},children:[]},{name:"CSS",stats:{files:1,lines:7,code:7,comments:0,blanks:0},children:[]}]},{name:"YAML",stats:{files:2,lines:67,code:62,comments:0,blanks:5},children:[]},{name:"Shell",stats:{files:1,lines:59,code:46,comments:1,blanks:12},children:[]},{name:"TOML",stats:{files:1,lines:31,code:29,comments:0,blanks:2},children:[]},{name:"Dockerfile",stats:{files:2,lines:30,code:28,comments:0,blanks:2},children:[]},{name:"Markdown",stats:{files:1,lines:141,code:0,comments:89,blanks:52},children:[{name:"BASH",stats:{files:1,lines:18,code:18,comments:0,blanks:0},children:[]}]},{name:"TypeScript",stats:{files:1,lines:1,code:0,comments:1,blanks:0},children:[]}],ea={files:21,lines:5505,code:4951,comments:91,blanks:463},ta={id:Gn,repository:Wn,refName:Vn,commitSha:Kn,generatedAt:Jn,durationMs:Qn,cached:Zn,tokeiVersion:Xn,languages:Yn,total:ea};function sa(e,s,n){const a=[...e].filter(l=>l.stats.code>0).sort((l,o)=>o.stats.code-l.stats.code),r=a.slice(0,5).map(l=>({label:l.name,value:l.stats.code,color:De(l.name)})),i=a.slice(5).reduce((l,o)=>l+o.stats.code,0);return i>0&&r.push({label:s,value:i,color:"var(--fg-mute)"}),r.length>0?r:[{label:n,value:0,color:"var(--fg-mute)"}]}function na(e){const s=e.reduce((a,r)=>a+r.value,0);let n=0;return e.map(a=>{const r=s>0?a.value/s:0,i=n+r,l=aa(n,i);return n=i,{...a,path:l}})}function aa(e,s){if(s-e>=.9999)return"M 1 0 A 1 1 0 1 1 -1 0 A 1 1 0 1 1 1 0";const n=Xe(e),a=Xe(s),r=s-e>.5?1:0;return`M 0 0 L ${n.x} ${n.y} A 1 1 0 ${r} 1 ${a.x} ${a.y} Z`}function Xe(e){const s=e*Math.PI*2-Math.PI/2;return{x:Math.cos(s),y:Math.sin(s)}}
93function ra({repoUrl:e,refName:s,defaultRepoUrl:n,defaultRefName:a,seedReport:r,analysisOptions:i}){var j,E,D,K,Z,de,ue;const[l,o]=d.useState(null),[c,u]=d.useState(null),[p,m]=d.useState(r),[g,x]=d.useState(null),[b,w]=d.useState(!1),[k,y]=d.useState(Ae(n,a,!1)),v=d.useRef(0),R=d.useRef(null),P=d.useRef(null),[A,te]=d.useState(0),L=Pe({queryKey:["job",l],enabled:!!(l&&!p),refetchInterval:N=>{const $=N.state.data;return($==null?void 0:$.status)==="completed"||($==null?void 0:$.status)==="failed"?!1:oa(Date.now()-(c??Date.now()))},queryFn:()=>oe(`/api/jobs/${l}?wait=20`)});d.useEffect(()=>{var J,se;const N=(J=L.data)==null?void 0:J.reportId;if(((se=L.data)==null?void 0:se.status)!=="completed"||!N||p)return;const $=A;let F=!1;return oe(`/api/reports/${N}`).then(q=>{F||$!==v.current||(Q(P),m(q),S(U.analyzeCompleted,{provider:Ye(q.repository.provider,q.repository.htmlUrl),cached:q.cached,code:q.total.code,languages:q.languages.length}),o(null),u(null))}).catch(q=>{F||$!==v.current||(Q(P),x(Se(q)),o(null),u(null))}),()=>{F=!0}},[(j=L.data)==null?void 0:j.status,(E=L.data)==null?void 0:E.reportId,p,A]),d.useEffect(()=>{var N;((N=L.data)==null?void 0:N.status)==="failed"&&A===v.current&&(x(ia(L.data.error)),Q(P),o(null),u(null))},[L.data,A]),d.useEffect(()=>{!L.isError||A!==v.current||(x(Se(L.error)),Q(P),o(null),u(null))},[L.isError,L.error,A]),d.useEffect(()=>()=>{var N;(N=R.current)==null||N.abort(),Q(P)},[]);const ie=async(N,$)=>{var H;const F=v.current+1;v.current=F,(H=R.current)==null||H.abort(),Q(P);const J=new AbortController;R.current=J,P.current=window.setTimeout(()=>{F===v.current&&(v.current+=1,J.abort(),x({message:f.t("runner.status.timedOut")}),o(null),u(null),w(!1))},12e4);const se=($==null?void 0:$.repoUrl)??e,q=($==null?void 0:$.refName)??s,h=se.trim()||n,T=q.trim()||(se.trim()?"":a);x(null),m(null),o(null),u(null),w(!0);const B=Ae(h,T,N);y(B),S(U.analyzeSubmitted,{provider:we(h),forceRefresh:N});try{const z=await pn({repoUrl:h,refName:T,forceRefresh:N,options:i,signal:J.signal});if(F!==v.current)return;z.kind==="cached"?(Q(P),m(z.report),S(U.analyzeCompleted,{provider:Ye(z.report.repository.provider,h),cached:!0,code:z.report.total.code,languages:z.report.languages.length})):(u(Date.now()),te(F),o(z.jobId))}catch(z){if(F!==v.current||z instanceof DOMException&&z.name==="AbortError")return;Q(P),x(Se(z))}finally{F===v.current&&w(!1)}},le=()=>{var N;v.current+=1,(N=R.current)==null||N.abort(),Q(P),m(null),x(null),o(null),u(null),w(!1)},ce=g?"failed":p?p.cached?"cached":"completed":((D=L.data)==null?void 0:D.status)??(l||b?"queued":"idle");return{report:p,error:(g==null?void 0:g.message)??((Z=(K=L.data)==null?void 0:K.error)==null?void 0:Z.message)??null,errorCode:(g==null?void 0:g.code)??((ue=(de=L.data)==null?void 0:de.error)==null?void 0:ue.code),isSubmitting:b,lastCommand:k,status:ce,setLastCommand:y,runAnalysis:ie,reset:le}}function Q(e){e.current!==null&&window.clearTimeout(e.current),e.current=null}function oa(e){return e<5e3?1200:e<3e4?2500:5e3}function Ye(e,s){return e==="github"||e==="gitHub"?"github":we(s)}function ia(e){return e?{code:e.code,message:la(e.code,e.message)}:{message:f.t("runner.status.failed")}}function Se(e){return e instanceof pt?{code:e.code,message:e.message}:{message:e instanceof Error?e.message:f.t("error.requestFailed")}}function la(e,s){return mt(e,s,"runner.status.failed")}const ca=O.lazy(()=>I(()=>import("./BrowserExtensionSection-BXQcKoiZ.js"),__vite__mapDeps([0,1,2,3]))),da=O.lazy(()=>I(()=>import("./RepoHistoryChart-CXrKYW0O.js"),__vite__mapDeps([4,1,3,2])).then(e=>({default:e.RepoHistoryChart}))),ua=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.StatsPage}))),Re=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.ReportListPage}))),ha=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.TrendingPage}))),pa=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.ComparePage}))),ma=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.CuratedComparePage}))),ga=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.DiffPage}))),fa=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.BadgesPage}
93))),ba=O.lazy(()=>I(()=>import("./marketing-BhSCZukC.js"),__vite__mapDeps([5,1,3,6,2])).then(e=>({default:e.ExtensionPage}))),xa=O.lazy(()=>I(()=>import("./embed-CSImRHTC.js"),__vite__mapDeps([7,1,3,2])).then(e=>({default:e.EmbedPage}))),ya=O.lazy(()=>I(()=>import("./compare-DdhxnVz7.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.CompareRepos}))),ja=O.lazy(()=>I(()=>import("./compare-DdhxnVz7.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.DiffRefs})));function wa(){const{t:e}=C();return t.jsx("div",{className:"growth-state",role:"status",children:e("growth.loading")})}function G({children:e}){return t.jsx(d.Suspense,{fallback:t.jsx(wa,{}),children:e})}const va=new Pt({defaultOptions:{queries:{staleTime:6e4,retry:1,refetchOnWindowFocus:!1}}}),Ca=[{label:"octocount",repoUrl:ve,refName:ct},{label:"axum",repoUrl:"https://github.com/tokio-rs/axum",refName:""},{label:"vite",repoUrl:"https://github.com/vitejs/vite",refName:""},{label:"vscode",repoUrl:"https://github.com/microsoft/vscode",refName:""}],St="octocounts.recentRepos",ze=5;function ka(){try{const e=JSON.parse(localStorage.getItem(St)??"[]");return Array.isArray(e)?e.filter(s=>typeof(s==null?void 0:s.repoUrl)=="string"&&typeof(s==null?void 0:s.label)=="string").map(s=>({repoUrl:s.repoUrl,refName:typeof s.refName=="string"?s.refName:"",label:s.label})).slice(0,ze):[]}catch{return[]}}function et(e){try{localStorage.setItem(St,JSON.stringify(e.slice(0,ze)))}catch{}}function Rt(e="600px"){const s=d.useRef(null),[n,a]=d.useState(!1);return d.useEffect(()=>{const r=s.current;if(!r||typeof IntersectionObserver>"u"){a(!0);return}const i=new IntersectionObserver(([l])=>{l.isIntersecting&&(a(!0),i.disconnect())},{rootMargin:e});return i.observe(r),()=>i.disconnect()},[e]),{ref:s,isNear:n}}function Na(e){const s=d.useRef(null);return d.useEffect(()=>{const n=s.current;if(!n||typeof ResizeObserver>"u")return;const a=new ResizeObserver(r=>{var l;const i=(l=r[0])==null?void 0:l.contentRect.width;i&&n.style.setProperty("--card-scale",String(i/e))});return a.observe(n),()=>a.disconnect()},[e]),s}function ne({children:e,rootMargin:s="300px"}){const{ref:n,isNear:a}=Rt(s);return t.jsx("div",{className:"deferred-slot",ref:n,children:a?e:null})}const Sa=[".cache",".git",".next","build","dist","node_modules","target","vendor"],Fe={ignoredDirs:[],ignoredLanguages:[],profile:"default",includeDocs:!0,includeTests:!0,includeGenerated:!0};function Ra(){var s,n;const e=document.getElementById("octocounts-report-summary");if(!e)return null;try{const a=JSON.parse(e.textContent??""),r=_t(window.location.pathname),i=r?Me(r.repoUrl):null;if(!i)return null;const l=String(((s=a.repository)==null?void 0:s.owner)??"").toLowerCase(),o=String(((n=a.repository)==null?void 0:n.repo)??"").toLowerCase();return l!==i.owner.toLowerCase()||o!==i.repo.toLowerCase()?null:{id:"",repository:{owner:a.repository.owner,name:a.repository.repo,htmlUrl:a.repository.htmlUrl,provider:a.repository.provider},refName:a.refName,commitSha:a.commitSha,generatedAt:a.generatedAt,durationMs:a.durationMs??0,cached:!0,tokeiVersion:a.tokeiVersion??"",analysisKey:a.analysisKey??"",analysisOptions:a.analysisOptions??Fe,snapshotUrl:a.snapshotUrl,languages:(a.languages??[]).map(c=>({name:c.name,stats:c.stats,children:[]})),total:a.totals}}catch{return null}}const Te=Ra(),Le=Te?nt(Te):window.location.pathname.startsWith("/github/")?null:nt(ta);function La(){const{t:e,i18n:s}=C(),n=window.location.pathname,a=n.startsWith("/github/");if(d.useEffect(()=>{let h=0,T=0;const B=()=>{cancelAnimationFrame(h);const H=window.location.hash.slice(1);if(H!=="extension"&&H!=="badges")return;const z=()=>{const qe=document.getElementById(H);if(qe){qe.scrollIntoView({block:"start"});return}T++<12&&(h=requestAnimationFrame(z))};h=requestAnimationFrame(z)};return B(),window.addEventListener("hashchange",B),()=>{cancelAnimationFrame(h),window.removeEventListener("hashchange",B)}},[]),n==="/stats")return t.jsx(G,{children:t.jsx(ua,{})});if(n==="/recent")return t.jsx(G,{children:t.jsx(Re,{kind:"recent"})});if(n==="/popular")return t.jsx(G,{children:t.jsx(Re,{kind:"popular"})});if(n==="/trending")return t.jsx(G,{children:t.jsx(ha,{})});if(n==="/hall-of-monoliths")return t.jsx(G,{children:t.jsx(Re,{kind:"monoliths"})});if(n==="/compare")return t.jsx(G,{children:t.jsx(pa,{})});if(n.startsWith("/compare/"))return t.jsx(G,{children:t.jsx(ma,{})});if(n==="/diff")return t.jsx(G,{children:t.jsx(ga,{})});if(n==="/badges")return t.jsx(G,{children:t.jsx(fa,{})});if(n==="/extension")return t.jsx(G,{children:t.jsx(ba,{})});if(n.startsWith("/embed/"))return t.jsx(G,{children:t.jsx(xa,{})});const r=d.useMemo(()=>Ga(),[]),[i,l]=d.useState(()=>
93r.repoUrl),[o,c]=d.useState(()=>r.refName),[u,p]=d.useState(()=>$e(r.repoUrl)),m=d.useRef(!r.usesSuggestedMain),[g,x]=d.useState(()=>r.analysisOptions??Fe),{report:b,error:w,errorCode:k,isSubmitting:y,lastCommand:v,status:R,setLastCommand:P,runAnalysis:A,reset:te}=ra({repoUrl:i,refName:o,defaultRepoUrl:ve,defaultRefName:ct,seedReport:r.analysisOptions?null:Le,analysisOptions:g}),L=d.useRef(!1),ie=y||R==="queued"||R==="running",le=ft(),[ce,j]=d.useState(()=>ka());d.useEffect(()=>{if(!b||b===Le||b.repository.htmlUrl===ve)return;const h={repoUrl:b.repository.htmlUrl,refName:b.refName,label:`${b.repository.owner}/${b.repository.name}${b.refName?` @ ${b.refName}`:""}`};j(T=>{const B=[h,...T.filter(H=>H.repoUrl!==h.repoUrl||H.refName!==h.refName)].slice(0,ze);return et(B),B})},[b]),d.useEffect(()=>{if(!b||b===Le)return;const h=window.location.pathname;if(h==="/compare"||h==="/diff")return;const T=new URL(pe(b.repository.owner,b.repository.name,b.refName)),B=new URLSearchParams(window.location.search);B.delete("q"),B.delete("url"),B.delete("ref");const H=B.toString();window.history.replaceState(null,"",T.pathname+(H?`?${H}`:""))},[b]);const E=h=>{S("recent_chip_clicked",{provider:we(h.repoUrl)}),N(),l(h.repoUrl),m.current=!0,c(h.refName),A(!1,{repoUrl:h.repoUrl,refName:h.refName})};d.useEffect(()=>{if(!L.current&&i){if(L.current=!0,Te&&!r.analysisOptions)return;A(!1)}},[]);const[D,K]=d.useState(null),Z=d.useRef(null),[de,ue]=d.useState(null),N=d.useCallback(()=>{Z.current&&ue(null),Z.current=null,K(null)},[]),$=d.useCallback(()=>{const h=Z.current;Z.current=null,K(null),h==null||h()},[]),F=h=>{S("sample_chip_clicked",{sample:h.label,provider:we(h.repoUrl)}),N(),ue(h.repoUrl),m.current=!1,c(h.refName),P(Ae(h.repoUrl,h.refName,!1));const T=()=>{A(!1,{repoUrl:h.repoUrl,refName:h.refName}).finally(()=>ue(null))};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){l(h.repoUrl),T();return}l(""),Z.current=()=>{l(h.repoUrl),T()},K(h.repoUrl)},[J,se]=d.useState(i);d.useEffect(()=>{const h=window.setTimeout(()=>se(i),300);return()=>window.clearTimeout(h)},[i]),d.useEffect(()=>{Va({report:b,repoUrl:J,refName:o,defaultTitle:e("app.title"),defaultDescription:e("app.description")})},[b,J,o,e,s.language]);const q=h=>{h.preventDefault(),A(!1)};return t.jsxs(t.Fragment,{children:[t.jsx("a",{className:"skip-link",href:"#main",children:e("common.skipToContent")}),t.jsx("div",{className:"crt"}),t.jsxs("main",{id:"main",className:"page",children:[t.jsx(Ln,{}),t.jsx("section",{className:`hero ${a?"hero-compact":""}`,"aria-labelledby":"hero-title",children:t.jsxs("div",{className:"hero-left",children:[t.jsx(Pa,{status:R}),a?t.jsx("h1",{id:"hero-title",className:"title title-compact",children:"OctoCounts"}):t.jsxs(t.Fragment,{children:[t.jsx("h1",{id:"hero-title",className:"title",children:t.jsx(be,{i18nKey:"hero.title",components:{1:t.jsx("span",{className:"glow"})}})}),t.jsx("p",{className:"subtitle",children:t.jsx(be,{i18nKey:"hero.subtitle",components:{1:t.jsx("a",{href:"https://github.com/XAMPPRocky/tokei",target:"_blank",rel:"noreferrer"})}})}),t.jsx("p",{className:"hero-definition",children:e("hero.definition")}),t.jsxs("p",{className:"hero-freshness",children:[e("hero.freshnessLabel"),": ",t.jsx("time",{dateTime:We,children:We})," · ",e("hero.maintainedBy")," ",t.jsx("a",{href:"https://github.com/huanglizhuo",target:"_blank",rel:"noreferrer",children:"huanglizhuo"})]})]}),gt(le)?t.jsxs("p",{className:"host-status-hint",role:"status",children:[le.description," â ",e("githubStatus.degradedHint")," ",t.jsx("a",{href:"https://www.githubstatus.com",target:"_blank",rel:"noreferrer",children:e("githubStatus.link")})]}):null,t.jsxs("form",{className:"input-row",onSubmit:q,children:[t.jsx("span",{className:"prompt",children:"$"}),t.jsx(Ea,{value:i,typingTarget:D,onTypingDone:$,onCancelTyping:N,onChange:h=>{if(l(h),p($e(h)),!m.current){const T=qa(h);T?(m.current=!0,c(T)):$e(h)?(m.current=!0,c("")):c("main")}},placeholder:e("hero.placeholderUrl"),ariaLabel:e("hero.ariaUrl")}),t.jsxs("label",{className:"ref",children:[e("hero.refLabel"),t.jsx("input",{id:"repo-ref",name:"refName",value:o,onChange:h=>
93{m.current=!0,c(h.target.value)},placeholder:e("hero.refPlaceholder"),"aria-label":e("hero.ariaRef")})]}),t.jsxs("button",{className:"btn",disabled:ie,children:[y?t.jsx(ls,{className:"spin",size:15}):t.jsx(hs,{size:15}),e("hero.analyze")]}),ie?t.jsx("button",{type:"button",className:"copybtn",onClick:()=>te(),children:e("runner.cancel")}):null]}),t.jsx(Fa,{options:g,setOptions:x}),u?t.jsx("p",{className:"input-hint",role:"status",children:e("hero.ambiguousRef")}):null,!a&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hero-paths",role:"group","aria-label":e("hero.sidebarHint"),children:[t.jsx("span",{children:e("hero.sidebarHint")}),t.jsx(ke,{store:"chrome",placement:"hero",className:"btn install-btn hero-install-primary",size:15,children:e("hero.addToChrome")}),t.jsxs("details",{className:"hero-other-browsers",children:[t.jsx("summary",{children:e("hero.otherBrowsers")}),t.jsxs("div",{children:[t.jsx(ke,{store:"edge",placement:"hero",className:"copybtn install-btn secondary-install",size:14,children:e("hero.installEdge")}),t.jsx(ke,{store:"firefox",placement:"hero",className:"copybtn install-btn secondary-install",size:14,children:e("hero.installFirefox")})]})]})]}),t.jsx("div",{className:"quick-rows",role:"group","aria-label":e("hero.ariaSamples"),children:Ca.map(h=>t.jsxs("button",{className:`chip ${de===h.repoUrl?"busy":""}`,type:"button",disabled:de!==null,"aria-pressed":de===h.repoUrl,onClick:()=>F(h),children:[t.jsx("span",{className:"k",children:e("samples.label")}),h.label]},h.repoUrl))}),ce.length>0?t.jsxs("div",{className:"quick-rows recent-rows",role:"group","aria-label":e("recent.ariaLabel"),children:[ce.map(h=>t.jsxs("button",{className:"chip recent-chip",type:"button",title:h.repoUrl,onClick:()=>E(h),children:[t.jsx(os,{size:12,"aria-hidden":"true"}),t.jsx("span",{className:"k",children:e("recent.label")}),h.label]},`${h.repoUrl}@${h.refName}`)),t.jsx("button",{className:"chip recent-clear",type:"button",onClick:()=>{j([]),et([])},children:e("recent.clear")})]}):null]})]})}),!a&&t.jsx("section",{className:"trust-strip","aria-label":e("hero.ariaTrust"),children:t.jsxs("div",{className:"social-proof",children:[t.jsx("a",{href:"https://github.com/huanglizhuo/OctoCounts",target:"_blank",rel:"noreferrer",className:"proof-badge",children:e("hero.badgeOpenSource")}),t.jsx("span",{className:"proof-badge",children:e("hero.badgeFree")}),t.jsx("span",{className:"proof-badge",children:e("hero.badgeLanguages")})]})}),t.jsxs("section",{children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("runner.title")}),t.jsx("span",{className:"sub",children:e("runner.status."+R)})]}),!i&&t.jsx("p",{className:"demo-note",children:e("runner.demoNote")}),t.jsx(Ua,{command:v,status:R,report:b,error:w,errorCode:k,onReset:te,onRerun:()=>void A(!0)})]}),a?null:t.jsxs("section",{id:"extension",className:"extension-promo",children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("extensionSection.title")}),t.jsx("span",{className:"sub",children:e("extensionSection.subtitle")})]}),t.jsx(d.Suspense,{fallback:null,children:t.jsx(ca,{compact:!0})})]}),a?t.jsx(Oa,{report:b,repoUrl:i,refName:o}):t.jsxs(t.Fragment,{children:[t.jsx(ne,{children:t.jsx($a,{})}),t.jsxs("section",{id:"badges",children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("badgeBuilder.title")}),t.jsxs("span",{className:"sub",children:[e("badgeBuilder.subtitle")," · ",t.jsx("a",{href:"/badges",children:e("badgeBuilder.openPage")})]})]}),t.jsxs(ne,{children:[t.jsx(zn,{repoUrl:i,refName:o,report:b}),t.jsx(qn,{})]})]}),t.jsxs("section",{children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("developerTools.title")}),t.jsx("span",{className:"sub",children:e("developerTools.subtitle")})]}),t.jsx(ne,{children:t.jsx(Aa,{})})]}),t.jsxs("section",{children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("compare.title")}),t.jsx("span",{className:"sub",children:e("compare.subtitle")})]}),t.jsx(ne,{children:t.jsx(d.Suspense,{fallback:null,children:t.jsx(ya,{})})})]}),t.jsxs("section",{children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("diff.title")}),t.jsx("span",{className:"sub",children:e("diff.subtitle")})]}),t.jsx(ne,{children:t.jsx(d.Suspense,{fallback:null,children:t.jsx(ja,{})})})]}),t.jsxs("section",{children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("useCases.title")}),t.jsx("span",{className:"sub",children:e("useCases.subtitle")})]}),t.jsx(ne,{children:t.jsx("div",{className:"how",children:e("useCases.cases",{returnObjects:!0}).map((h,T)=>t.jsxs("div",{className:"step",children:[t.jsx("h3",{children:h.title}),t.jsx("p",{children:h.text})]},T))})})]}),t.jsxs("section",{children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:e("howItWorks.title")}),t.jsx("span",{className:"sub",children:e("howItWorks.subtitle")})]}),t.jsxs(ne,{children:[t.jsx(Xa,{}),t.jsx("div",{className:"how",children:e("howItWorks.steps",{returnObjects:!0}).map(h=>t.jsxs("div",{className:"step",children:[t.jsx("span",{className:"n",children:h.num}),t.jsx("h3",{children:h.title}),t.jsx("p",{children:h.text}),t.jsx("div",{className:"codeline",children:t.jsx(be,{i18nKey:`howItWorks.steps.${Number(h.num)-1}.code`,components:{1:t.jsx("span",{className:"c"})}})})]},h.num))})]})]})]}),t.jsxs("footer",{children:[t.jsx("span",{children:e("footer.tagline")}),t.jsxs("span",{children:[t.jsx("a",{href:"/about",children:e("footer.about")})," ·",t.jsx("a",{href:"/privacy",children:e("footer.privacy")})," · ",t.jsx("a",{href:"/contact",children:e("footer.contact")})," ·",t.jsx("a",{href:"/docs/api",children:e("footer.apiDocs")})," ·",t.jsx("a",{href:"/docs/github-sloc-counter",children:e("footer.slocGuide")})," ·",t.jsx("a",{href:"/docs/faq",children:e("footer.faq")})," ·",t.jsx("a",{href:"/badges",children:e("footer.badges")})," ·",t.jsx("a",{href:"/stats",children:e("growth.nav.stats.label")})," ·",t.jsx("a",{href:"/popular",children:e("growth.nav.popular.label")})," · ",t.jsx("a",{href:"/trending",children:e("growth.nav.trending.label")})," ·",t.jsx(be,{i18nKey:"footer.builtBy",components:{1:t.jsx("a",{href:"https://github.com/huanglizhuo",target:"_blank",rel:"noreferrer"})}})," ",e("footer.copyright")]}),t.jsx(Ta,{})]})]})]})}function Ea({value:e,typingTarget:s,onTypingDone:n,onCancelTyping:a,onChange:r,placeholder:i,ariaLabel:l}
93){const[o,c]=d.useState(null),u=d.useRef(n);return u.current=n,d.useEffect(()=>{if(s===null){c(null);return}let p=0;c("");const m=window.setInterval(()=>{p+=1,c(s.slice(0,p)),p>=s.length&&(window.clearInterval(m),u.current())},18);return()=>window.clearInterval(m)},[s]),t.jsx("input",{id:"repo-url",name:"repoUrl",className:o!==null?"typing":void 0,value:o??e,onChange:p=>{a(),c(null),r(p.target.value)},placeholder:i,"aria-label":l})}function $a(){var l;const{t:e}=C(),{ref:s,isNear:n}=Rt(),r=(l=Pe({queryKey:["growth-stats"],queryFn:mn,staleTime:300*1e3,enabled:n}).data)==null?void 0:l.totals,i=r?e("growth.index.stats",{reports:ee(r.reportsGenerated),repos:ee(r.repositoriesAnalyzed),lines:ee(r.codeLinesCounted)}):e("growth.index.fallback");return t.jsxs("section",{className:"report-index","aria-label":e("growth.index.ariaLabel"),ref:s,children:[t.jsxs("div",{className:"report-index-head",children:[t.jsx("span",{className:"terminal-label",children:e("growth.index.label")}),t.jsx("p",{children:i})]}),t.jsx("nav",{className:"report-index-grid","aria-label":e("growth.index.navAria"),children:yt.map(o=>t.jsxs("a",{href:o.href,className:o.href==="/stats"?"report-index-link primary":"report-index-link",children:[t.jsx("span",{children:o.command}),t.jsx("strong",{children:e(`growth.nav.${o.key}.label`)}),t.jsx("em",{children:e(`growth.nav.${o.key}.detail`)})]},o.href))})]})}function _a({report:e}){var i;const{t:s}=C(),n=W(),r=(((i=Pe({queryKey:["related-reports",n,e.repository.owner,e.repository.name],queryFn:()=>oe(`/api/seo/related?provider=${encodeURIComponent(n)}&owner=${encodeURIComponent(e.repository.owner)}&repo=${encodeURIComponent(e.repository.name)}`),staleTime:3600*1e3,retry:0}).data)==null?void 0:i.reports)??[]).slice(0,6);return r.length===0?null:t.jsxs("section",{className:"similar-repos","aria-label":s("similarRepos.ariaLabel"),children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:s("similarRepos.title")}),t.jsx("span",{className:"sub",children:s("similarRepos.subtitle")})]}),t.jsx("div",{className:"growth-repo-grid",children:r.map(l=>t.jsxs("a",{className:"growth-repo-card",href:l.publicPath,onClick:()=>S("similar_repo_clicked",{provider:n,placement:"report_similar",target:`${l.owner}/${l.repo}`}),children:[t.jsx("span",{className:"chart-tag",children:l.provider}),t.jsx("strong",{children:l.repoFullName}),t.jsxs("span",{children:[l.topLanguage??s("similarRepos.mixed")," · ",_(l.totalCode)," ",s("similarRepos.codeLines")]}),t.jsx("em",{children:l.publicPath})]},l.publicPath))})]})}function tt(e){const s=e.analysisOptions,n=[...s.ignoredDirs,...s.ignoredLanguages],a=[];s.includeTests||a.push("tests excluded"),s.includeDocs||a.push("docs excluded"),s.includeGenerated||a.push("generated excluded"),s.profile&&s.profile!=="default"&&a.push(`profile: ${s.profile}`);const r=n.length||a.length?`custom configuration (${[...a,...n.map(l=>`ignoring ${l}`)].join(", ")})`:"default configuration",i=e.generatedAt.slice(0,10);return`${e.repository.owner}/${e.repository.name} has ${_(e.total.code)} lines of code (SLOC counted ${i} at commit ${e.commitSha.slice(0,12)}, ${r}, via OctoCounts/tokei): ${fe(e)}`}function Oa({report:e,repoUrl:s,refName:n}){const{t:a}=C(),r=Et(),i=(e==null?void 0:e.repository.htmlUrl)||s,l=(e==null?void 0:e.commitSha)||(e==null?void 0:e.refName)||n,o=new URLSearchParams({repo:i});l&&o.set("ref",l);const c=new URLSearchParams({left:i,right:i});l&&(c.set("leftRef",l),c.set("rightRef",l));const u=new URLSearchParams({repo:i,base:l,head:l});return t.jsxs("section",{className:"report-context-tools","aria-label":a("reportTools.ariaLabel"),children:[t.jsxs("div",{className:"section-h",children:[t.jsx("h2",{children:a("reportTools.title")}),t.jsx("span",{className:"sub",children:a("reportTools.subtitle")})]}),t.jsxs("div",{className:"report-tool-links",children:[t.jsxs("button",{type:"button",className:"copybtn",disabled:!e,onClick:()=>{e&&X(tt(e)).then(p=>{r.showCopied("citation"),S("report_citation_copied",{provider:"github"}),p||window.prompt(a("reportCta.copyFailed"),tt(e))})},children:[t.jsx(re,{size:14}),r.copiedKey==="citation"?a("reportCta.copied"):a("reportTools.copyCitation")]}),t.jsx("a",{className:"copybtn",href:`/compare?${c.toString()}`,children:a("reportTools.compare")}),t.jsx("a",{className:"copybtn",href:`/diff?${u.toString()}`,children:a("reportTools.diff")}),t.jsx("a",{className:"copybtn",href:`/badges?${o.toString()}`,children:a("reportTools.badges")})]})]})}function Aa(){const{t:e}=C(),s=[{key:"stats",command:"open https://octocounts.com/stats",href:"/stats"},{key:"action",command:"uses: huanglizhuo/OctoCounts/action@main",href:"https://github.com/huanglizhuo/OctoCounts/tree/main/action"},{key:"cli",command:"npx octocounts https://github.com/owner/repo --json",href:"https://github.com/huanglizhuo/OctoCounts/tree/main/cli"},{key:"mcp",command:"npx octocounts-mcp",href:"https://github.com/huanglizhuo/OctoCounts/tree/main/mcp"},{key:"badge",command:"[](...)",href:"/badges"},{key:"api",command:"GET https://api.octocounts.com/api/stats",href:"/docs/api"}];return t.jsx("div",{className:"developer-tools",children:s.map(n=>t.jsxs("a",{className:"developer-tool",href:n.href,children:[t.jsx("span",{className:"chart-tag",children:e(`developerTools.items.${n.key}.title`)}),t.jsx("p",{children:e(`developerTools.items.${n.key}.text`)}),t.jsx("code",{children:n.command})]},n.key))})}function Ta(){const{i18n:e,t:s}=C(),n=[{code:"en",label:"EN"},{code:"zh",label:"䏿"}];return t.jsx("div",{className:"language-switcher",role:"group","aria-label":s("languageSwitcher.label"),style:{marginTop:8},children:n.map(a=>t.jsx("button",{type:"button",className:"lang-btn","aria-current":e.language===a.code?"true":void 0,onClick:()=>e.changeLanguage(a.code),children:a.label},a.code))})}function Lt({stars:e,size:s=11,className:n}){return t.jsxs("span",{className:n,"aria-label":`${ee(e)} stars`,children:[t.jsx("svg",{viewBox:"0 0 16 16",width:s,height:s,"aria-hidden":"true",focusable:"false",children:t.jsx("path",{fill:"currentColor",d:"M8 .25a.75.75 0 0 1 .67.42l1.88 3.8 4.2.61a.75.75 0 0 1 .42 1.28l-3.04 2.96.72 4.17a.75.75 0 0 1-1.09.79L8 12.35l-3.76 1.97a.75.75 0 0 1-1.09-.79l.72-4.17L.83 6.36a.75.75 0 0 1 .42-1.28l4.2-.6L6.66.66A.75.75 0 0 1 8 .25Z"})}),ee(e)]})}
93function Et(e=1800){const[s,n]=d.useState(null),a=d.useRef(null);return d.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]),{copiedKey:s,showCopied:i=>{n(i),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>n(null),e)}}}function Pa({status:e}){const{t:s}=C();return t.jsx("div",{className:"top-actions",children:t.jsxs("span",{className:"pill",children:[t.jsx("span",{className:`dot ${e==="idle"?"idle":""}`}),s("runner.statusShort."+e)]})})}function Ua({command:e,status:s,report:n,error:a,errorCode:r,onReset:i,onRerun:l}){const{t:o,i18n:c}=C(),u=d.useRef(null),[p,m]=d.useState(!1),[g,x]=d.useState(null),[b,w]=d.useState(null),{copiedKey:k,showCopied:y}=Et(),v=s==="queued"||s==="running",[R,P]=d.useState(null);d.useEffect(()=>{if(P(null),!n)return;const j=new AbortController,E=window.setTimeout(()=>j.abort(),2500),D=`owner=${encodeURIComponent(n.repository.owner)}&repo=${encodeURIComponent(n.repository.name)}`;return oe(`/api/repo-info?${D}`,{signal:j.signal}).then(K=>{typeof K.stars=="number"&&P(K.stars)}).catch(()=>{}),()=>{window.clearTimeout(E),j.abort()}},[n]);const[A,te]=d.useState(0);d.useEffect(()=>{if(!v){te(0);return}const j=Date.now(),E=window.setInterval(()=>te(Math.floor((Date.now()-j)/1e3)),1e3);return()=>window.clearInterval(E)},[v]);const L=d.useRef(null),[ie,le]=d.useState(!1);d.useEffect(()=>{const j=L.current;if(!j||typeof IntersectionObserver>"u")return;const E=()=>le(j.getBoundingClientRect().bottom<0),D=new IntersectionObserver(E);return D.observe(j),document.addEventListener("scrollend",E),()=>{D.disconnect(),document.removeEventListener("scrollend",E)}},[]);const ce=async()=>{if(!(!n||!u.current)){m(!0),x(null);try{const{toPng:j}=await I(async()=>{const{toPng:D}=await import("./index-CgJtiJsK.js");return{toPng:D}},[]),E=await j(u.current,{cacheBust:!0,pixelRatio:2,width:1200,height:630,backgroundColor:"#050a06",style:{transform:"none",transformOrigin:"top left"}});Dn(E,`octocount-${n.repository.owner}-${n.repository.name}-${n.commitSha.slice(0,12)}.png`),S(U.pngExported,{provider:W(n)})}catch{x(o("runner.exportPngFailed"))}finally{m(!1)}}};return t.jsxs("div",{className:"runner",children:[n&&ie?t.jsxs("div",{className:"sticky-bar",role:"region","aria-label":o("stickyBar.ariaLabel"),children:[t.jsxs("span",{className:"sticky-repo",children:[n.repository.owner,"/",n.repository.name,typeof(R??n.repository.stars??null)=="number"?t.jsx(Lt,{className:"repo-stars",size:11,stars:R??n.repository.stars}):null]}),t.jsxs("span",{className:"sticky-stats",children:[o("stickyBar.lines",{count:n.total.lines,lines:_(n.total.lines)})," · ",t.jsx("span",{className:n.cached?"ok":"",children:n.cached?o("runner.cacheHit"):o("runner.freshRun")})]}),t.jsxs("div",{className:"sticky-actions",children:[t.jsxs("button",{className:"copybtn share-cta",onClick:()=>{var j;S(U.shareClicked,{share_type:"sticky_jump",placement:"sticky"}),(j=document.getElementById("share-showcase"))==null||j.scrollIntoView({behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth",block:"start"})},children:[t.jsx(lt,{size:13})," ",o("stickyBar.share")]}),t.jsxs("button",{className:"copybtn",onClick:()=>window.scrollTo({top:0,behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),"aria-label":o("stickyBar.top"),children:[t.jsx(Vt,{size:13})," ",o("stickyBar.top")]})]})]}):null,t.jsxs("div",{className:"runner-head",ref:L,children:[t.jsxs("div",{className:"left",children:[n?t.jsxs("strong",{className:"runner-repo",children:[n.repository.owner,"/",n.repository.name]}):null,t.jsxs("span",{className:"pill",children:[t.jsx("span",{className:`dot ${s==="idle"?"idle":""}`}),o("runner.statusShort."+s)]}),n?t.jsxs("details",{className:"runner-command",children:[t.jsx("summary",{children:o("runner.commandLabel")}),t.jsxs("code",{children:["$ ",e]})]}):t.jsxs("code",{children:["$ ",e]})]}),t.jsx("div",{className:"row-flex",children:n?t.jsxs("span",{children:[n.refName," / ",n.commitSha.slice(0,12)," / ",new Date(n.generatedAt).toLocaleString(c.language)," /"," ",n.cached?t.jsxs("b",{className:"cache-flex",children:[o("runner.cac
93heHit")," · ",n.durationMs,"ms"]}):t.jsxs(t.Fragment,{children:[o("runner.freshRun")," / ",t.jsxs("b",{className:"speed-val",children:[n.durationMs,"ms"]})]})]}):t.jsxs("span",{children:[o("runner.status."+s),v&&A>0?t.jsxs("b",{className:"speed-val",children:[" · ",A,"s"]}):null]})})]}),t.jsx("div",{className:`progress ${s==="queued"||s==="running"?"indet":""}`,children:t.jsx("i",{style:{transform:`scaleX(${Tn(s)/100})`}})}),t.jsx("span",{className:"visually-hidden","aria-live":"polite",children:o("runner.status."+s)}),n?null:t.jsx(st,{status:s,report:n,error:a,elapsedSec:A}),s==="failed"?t.jsx(Ba,{code:r,message:a,onRetry:l}):null,n?t.jsxs(t.Fragment,{children:[t.jsx(Ya,{stats:n.total}),t.jsx(sr,{report:n}),t.jsx(er,{report:n}),t.jsx(Ia,{report:n,stars:R??n.repository.stars??null,cardRef:u,copiedCta:k,isExporting:p,exportError:g,copyError:b,onCopyUrl:()=>{X(fe(n)).then(j=>{if(!j){w(o("reportCta.copyFailed"));return}w(null),y("url")}),S(U.reportUrlCopied,{provider:W(),placement:"share_showcase"})},onExportPng:()=>void ce()}),t.jsx(Da,{report:n,copiedCta:k,onCopyBadge:async()=>{const j=fe(n),E=Be(n.repository.owner,n.repository.name,n.refName,"summary","");if(!E)return!1;const D=await X(`[](${j})`);return D&&(y("badge"),S(U.badgeMarkdownCopied,{provider:"github",placement:"report_utility"})),D},onCopyEmbed:async()=>{const j=W(),E=await X(Nt(kt(j,n.repository.owner,n.repository.name)));return E&&(y("embed"),S(U.embedSnippetCopied,{provider:j,placement:"report_utility"})),E},onExportText:async()=>{const j=await X(jt(n));return j&&S("report_text_copied",{provider:W()}),j},onExportJson:async()=>{const j=await X(JSON.stringify(n,null,2));return j&&S("report_json_copied",{provider:W()}),j},onRerun:l,onReset:i}),t.jsxs("details",{className:"report-details",children:[t.jsx("summary",{children:o("trust.title")}),t.jsx(Ma,{report:n,stars:R??n.repository.stars??null})]}),t.jsx(d.Suspense,{fallback:null,children:t.jsx(da,{provider:W(),owner:n.repository.owner,repo:n.repository.name})}),t.jsx(_a,{report:n}),t.jsxs("details",{className:"run-details",children:[t.jsx("summary",{children:o("runner.runDetails")}),t.jsx(st,{status:s,report:n,error:a})]})]}):null]})}function Ia({report:e,stars:s,cardRef:n,copiedCta:a,isExporting:r,exportError:i,copyError:l,onCopyUrl:o,onExportPng:c}){const{t:u}=C(),p=Na(1200),[m,g]=d.useState(()=>!window.matchMedia("(max-width: 720px)").matches);return t.jsxs("section",{id:"share-showcase",className:"share-showcase","aria-label":u("reportCta.ariaLabel"),children:[t.jsxs("div",{className:"share-showcase-head",children:[t.jsx("span",{className:"chart-tag",children:u("reportCta.kicker")}),t.jsx("strong",{children:u("reportCta.title")}),t.jsx("span",{children:u("reportCta.subtitle")})]}),t.jsxs("div",{className:"share-showcase-body",children:[t.jsxs("details",{className:"share-preview",open:m,onToggle:x=>g(x.currentTarget.open),children:[t.jsx("summary",{children:u("reportCta.preview")}),t.jsx("div",{className:"share-showcase-card",ref:p,children:t.jsx(za,{ref:n,report:e,stars:s})})]}),t.jsxs("div",{className:"share-showcase-actions",children:[t.jsxs("div",{className:"row-flex",children:[t.jsxs("button",{className:"btn install-btn",type:"button",onClick:o,children:[t.jsx(re,{size:14}),u(a==="url"?"reportCta.copied":"reportCta.copyUrl")]}),t.jsxs("button",{className:"copybtn",type:"button",disabled:r,onClick:c,children:[t.jsx(es,{size:14}),u("reportCta.exportPng")]})]}),t.jsx(Hn,{url:fe(e),text:u("share.reportText",{repo:`${e.repository.owner}/${e.repository.name}`,code:_(e.total.code)}),placement:"report"}),i||l?t.jsxs("div",{className:"export-error",role:"alert",children:[t.jsx("p",{children:i??l}),l?t.jsx("textarea",{className:"manual-copy",readOnly:!0,value:fe(e),"aria-label":u("reportCta.manualCopyAria"),onFocus:x=>x.currentTarget.select()}):null]}):null]})]})]})}function Da({report:e,copiedCta:s,onCopyBadge:n,onCopyEmbed:a,onExportText:r,onExportJson:i,onRerun:l,onReset:o}){const{t:c}=C(),[u,p]=d.useState(null),[m,g]=d.useState(null),x=async(b,w)=>{const k=await b();p(k?"copied":"failed"),g(k?null:w??null)};return t.jsxs("div",{className:"runner-foot",children:[t.jsx("span",{children:c("runner.generated",{date:new Date(e.generatedAt).toLocaleStr
93ing(f.language),duration:e.durationMs,version:e.tokeiVersion})}),t.jsxs("div",{className:"actions",children:[t.jsxs("button",{className:"copybtn",type:"button",onClick:()=>void x(n),children:[t.jsx(re,{size:14}),c(s==="badge"?"reportCta.copied":"reportCta.copyBadge")]}),t.jsxs("button",{className:"copybtn",type:"button",onClick:()=>void x(a),children:[t.jsx(re,{size:14}),c(s==="embed"?"reportCta.copied":"reportCta.copyEmbed")]}),t.jsxs("details",{className:"utility-more",children:[t.jsx("summary",{children:c("runner.moreActions")}),t.jsxs("div",{children:[t.jsxs("button",{className:"copybtn",onClick:()=>void x(r,jt(e)),children:[t.jsx(re,{size:14})," ",c("runner.exportText")]}),t.jsxs("button",{className:"copybtn",onClick:()=>void x(i,JSON.stringify(e,null,2)),children:[t.jsx(as,{size:14})," ",c("runner.exportJson")]}),t.jsxs("a",{className:"copybtn",href:e.repository.htmlUrl,target:"_blank",rel:"noreferrer",children:[t.jsx(ss,{size:14})," ",c("runner.exportGitHub")]}),t.jsxs("button",{className:"copybtn",onClick:l,children:[t.jsx(ms,{size:14})," ",c("runner.reRun")]}),t.jsx("button",{className:"copybtn",onClick:o,children:c("runner.clear")})]})]}),u?t.jsx("span",{className:"copy-feedback",role:"status",children:c(u==="copied"?"reportCta.copied":"reportCta.copyFailedShort")}):null,m?t.jsx("textarea",{className:"manual-copy utility-manual-copy",readOnly:!0,value:m,"aria-label":c("reportCta.manualContentAria"),onFocus:b=>b.currentTarget.select()}):null]})]})}function Ma({report:e,stars:s}){const{t:n}=C(),a=[{label:n("trust.commit"),value:e.commitSha},{label:n("trust.ref"),value:e.refName},{label:n("trust.counter"),value:e.tokeiVersion},{label:n("trust.cache"),value:e.cached?n("runner.cacheHit"):n("runner.freshRun")},...typeof s=="number"?[{label:n("trust.stars"),value:ee(s)}]:[],{label:n("trust.profile"),value:n(`analysisOptions.profiles.${e.analysisOptions.profile}`)},{label:n("trust.ignored"),value:[...Sa,...e.analysisOptions.ignoredDirs].join(", ")},{label:n("trust.languages"),value:e.analysisOptions.ignoredLanguages.join(", ")||n("trust.none")}];return t.jsx("div",{className:"trust-details",role:"group","aria-label":n("trust.title"),children:a.map(r=>t.jsxs("div",{children:[t.jsx("span",{children:r.label}),t.jsx("code",{children:r.value})]},r.label))})}function Ba({code:e,message:s,onRetry:n}){const{t:a}=C(),r=ft(),i=e&&f.exists(`errorHelp.${e}`)?`errorHelp.${e}`:"errorHelp.default";return t.jsx("div",{className:"error-state",role:"alert",children:t.jsxs("div",{children:[t.jsx("span",{className:"chart-tag",children:e??a("error.failedCode")}),t.jsx("h3",{children:s??a("runner.status.failed")}),t.jsx("p",{children:a(i)}),e==="github_unavailable"?t.jsxs("p",{className:"host-status-line",children:[gt(r)?`${a("githubStatus.official")} ${r.description} `:`${a("githubStatus.officialOperational")} `,t.jsx("a",{href:"https://www.githubstatus.com",target:"_blank",rel:"noreferrer",children:a("githubStatus.link")})]}):null,n?t.jsx("button",{type:"button",className:"copybtn retry-btn",onClick:n,children:a("error.retry")}):null]})})}function st({status:e,report:s,error:n,elapsedSec:a=0}){return t.jsx("div",{className:"log",children:An(e,s,n,a).map(r=>t.jsxs("div",{children:[t.jsx("span",{className:"ts",children:r.ts}),t.jsx("span",{className:r.kind,children:r.text})]},r.text))})}const za=O.forwardRef(function({report:s,stars:n},a){const{t:r}=C(),i=On(s).slice(0,6),l=s.languages.length>i.length,o=s.total.code+s.total.comments+s.total.blanks;return t.jsx("div",{className:"share-card",ref:a,children:t.jsxs("div",{className:"share-window",children:[t.jsxs("div",{className:"share-head",children:[t.jsxs("div",{className:"lights",children:[t.jsx("span",{className:"r"}),t.jsx("span",{className:"y"}),t.jsx("span",{className:"g"})]}),t.jsx("span",{children:r("shareCard.title")})]}),t.jsxs("div",{className:"share-body",children:[t.jsxs("div",{className:"share-kicker-row",children:[t.jsxs("div",{className:"share-kicker",children:[s.repository.owner,"/",s.repository.name]}),typeof n=="number"?t.jsx(Lt,{className:"share-stars",size:15,stars:n}):null]}),t.jsxs("div",{className:"share-ref",children:[s.refName," / ",s.commitSha.slice(0,12)]}),t.jsxs("div",{className:"share-total",children:[t.jsx("span",{children:r("shareCard.totalLoc")}),t.jsx("strong",{children:_(s.total.lines)})]}),t.jsxs("div",{className:"share-breakdown",children:[t.jsx(Ee,{c
93olor:"var(--accent)",label:r("shareCard.labelCode"),value:s.total.code}),t.jsx(Ee,{color:"var(--accent-2)",label:r("shareCard.labelComments"),value:s.total.comments}),t.jsx(Ee,{color:"var(--violet)",label:r("shareCard.labelBlanks"),value:s.total.blanks})]}),t.jsxs("div",{className:"share-ticker",children:[t.jsx("div",{className:"share-ticker-list",children:i.map(c=>t.jsxs("div",{className:"share-ticker-row",children:[t.jsx("span",{children:c.label}),t.jsx("i",{children:t.jsx("b",{style:{width:`${c.percent}%`,background:Ie(c.color,"matrix")}})}),t.jsx("em",{children:_(c.value)})]},c.label))}),l?t.jsx("div",{className:"share-ticker-note",children:r("shareCard.topLanguages")}):null]}),t.jsxs("div",{className:"share-foot",children:[t.jsx("span",{children:r("shareCard.percentCode",{percent:Y(s.total.code,o)})}),t.jsx("span",{children:r("shareCard.generatedBy")})]})]})]})})});function Ee({color:e,label:s,value:n}){return t.jsxs("div",{className:"share-stat",children:[t.jsx("span",{style:{background:e}}),t.jsx("p",{children:s}),t.jsx("strong",{children:_(n)})]})}function Fa({options:e,setOptions:s}){const{t:n}=C(),[a,r]=d.useState(()=>e.ignoredDirs.join(", ")),[i,l]=d.useState(()=>e.ignoredLanguages.join(", ")),o=c=>s({...e,...c});return t.jsxs("details",{className:"analysis-options",children:[t.jsx("summary",{children:n("analysisOptions.summary")}),t.jsxs("div",{className:"analysis-options-grid",children:[t.jsxs("label",{children:[t.jsx("span",{children:n("analysisOptions.profile")}),t.jsxs("select",{name:"analysisProfile",value:e.profile,onChange:c=>o({profile:c.target.value}),children:[t.jsx("option",{value:"default",children:n("analysisOptions.defaultProfile")}),t.jsx("option",{value:"source-only",children:n("analysisOptions.sourceOnlyProfile")})]})]}),t.jsxs("label",{children:[t.jsx("span",{children:n("analysisOptions.ignoredDirs")}),t.jsx("input",{name:"ignoredDirs",value:a,onChange:c=>{r(c.target.value),o({ignoredDirs:je(c.target.value)})},onBlur:()=>o({ignoredDirs:je(a)}),placeholder:"examples, fixtures"})]}),t.jsxs("label",{children:[t.jsx("span",{children:n("analysisOptions.ignoredLanguages")}),t.jsx("input",{name:"ignoredLanguages",value:i,onChange:c=>{l(c.target.value),o({ignoredLanguages:je(c.target.value)})},onBlur:()=>o({ignoredLanguages:je(i)}),placeholder:"Markdown, JSON"})]}),t.jsxs("div",{className:"analysis-toggles",children:[t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",name:"includeDocs",checked:e.includeDocs,onChange:c=>o({includeDocs:c.target.checked})}),n("analysisOptions.includeDocs")]}),t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",name:"includeTests",checked:e.includeTests,onChange:c=>o({includeTests:c.target.checked})}),n("analysisOptions.includeTests")]}),t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",name:"includeGenerated",checked:e.includeGenerated,onChange:c=>o({includeGenerated:c.target.checked})}),n("analysisOptions.includeGenerated")]})]})]})]})}function je(e){return e.split(",").map(s=>s.trim()).filter(Boolean)}const $t=new Set(["tree","blob","commit","commits"]);function qa(e){try{const s=new URL(e.trim());if(s.hostname!=="github.com")return"";const n=s.pathname.split("/").filter(Boolean);return n.length!==4||!$t.has(n[2])?"":Ha(n[3])}catch{return""}}function $e(e){try{const s=new URL(e.trim()),n=s.pathname.split("/").filter(Boolean);return s.hostname==="github.com"&&n.length>4&&$t.has(n[2])}catch{return!1}}function Ha(e){try{return decodeURIComponent(e)}catch{return e}}function Ga(){const e=new URLSearchParams(window.location.search),s=e.get("q")??e.get("url"),n=e.get("ref")??"",a=Wa(e.get("analysis"));if(s)return{repoUrl:s,refName:n,analysisOptions:a};const r=_t(window.location.pathname);return r?{...r,analysisOptions:a}:{repoUrl:"",refName:"main",analysisOptions:a,usesSuggestedMain:!0}}function Wa(e){if(!e)return null;try{const s=JSON.parse(e);return s.profile!=="default"&&s.profile!=="source-only"||!Array.isArray(s.ignoredDirs)||!Array.isArray(s.ignoredLanguages)?null:{profile:s.profile,ignoredDirs:s.ignoredDirs.filter(n=>typeof n=="string"),ignoredLanguages:s.ignoredLanguages.filter(n=>typeof n=="string"),includeDocs:typeof s.includeDocs=="boolean"?s.includeDocs:!0,includeTests:typeof s.includeTests=="boolean"?s.includeTests:!0,includeGenerated:typeof s.includeGenerated=="boolean"?s.includeGenerated:!0}}catch{return null}}function nt(e){return{...e,repository:{...e.repository,provider:W()},analysisKey:e.analysisKey||e.tokeiVersion,analysisOptions:{...Fe,...e.analysisOptions??{}}}}
93function _t(e){const s=e.split("/").filter(Boolean).map(decodeURIComponent);if(s[0]==="github"&&s[1]&&s[2]){const n=s[1],a=s[2],r=s[3],i=r==="tree"||r==="commit"?s.slice(4).join("/"):"";return{repoUrl:`https://github.com/${n}/${a}`,refName:i}}return null}function Va({report:e,repoUrl:s,refName:n,defaultTitle:a,defaultDescription:r}){const i=window.location.pathname;if(i==="/compare"||i==="/diff"){_e({title:i==="/compare"?"Compare repository SLOC | OctoCounts":"Compare branch SLOC diff | OctoCounts",description:i==="/compare"?"Compare files, code lines, comments, blanks, and language mix between two public repositories or refs.":"Compare source line count changes between two branches, tags, or commits in a public repository.",canonical:`${window.location.origin}${i}`});return}if(!i.startsWith("/github/")){_e({title:a,description:r,canonical:`${window.location.origin}/`,extraRobots:",max-video-preview:-1"});return}const o=e?{owner:e.repository.owner,repo:e.repository.name}:Me(s),c=(e==null?void 0:e.refName)||n.trim(),u=o?`${o.owner}/${o.repo} SLOC report | OctoCounts`:a,p=e?`${o==null?void 0:o.owner}/${o==null?void 0:o.repo} has ${_(e.total.code)} code lines across ${_(e.total.files)} files and ${_(e.languages.length)} languages.`:o?`Source line count report for ${o.owner}/${o.repo}: files, code lines, comments, blanks, and language totals.`:r,m=e?Ka(e,c):o?Ja(o,s,c):window.location.origin+"/";_e({title:u,description:p,canonical:m,extraRobots:",max-video-preview:-1"})}function Ka(e,s){return pe(e.repository.owner,e.repository.name,s)}function fe(e){const s=e.commitSha||e.refName,n=pe(e.repository.owner,e.repository.name,s),a=new URLSearchParams;return a.set("analysis",JSON.stringify(e.analysisOptions)),`${n}?${a.toString()}`}function Ja(e,s,n){return pe(e.owner,e.repo,n)}let at="";function _e({title:e,description:s,canonical:n,extraRobots:a}){const r=JSON.stringify([e,s,n,a??""]);if(r===at)return;at=r,document.title=e;const i=`index,follow,max-image-preview:large,max-snippet:-1${a??""}`,l=`${window.location.origin}/og-image.jpg`,o=[["name","description",s],["name","robots",i],["property","og:title",e],["property","og:description",s],["property","og:url",n],["property","og:image",l],["name","twitter:title",e],["name","twitter:description",s],["name","twitter:image",l]];for(const[c,u,p]of o)Qa(c,u,p);Za(n)}function Qa(e,s,n){let a=document.head.querySelector(`meta[${e}="${s}"]`);a||(a=document.createElement("meta"),a.setAttribute(e,s),document.head.appendChild(a)),a.content=n}function Za(e){let s=document.head.querySelector('link[rel="canonical"]');s||(s=document.createElement("link"),s.rel="canonical",document.head.appendChild(s)),s.href=e}function Xa(){const{t:e}=C(),s=["url","tarball","tokei","report"];return t.jsx("div",{className:"pipeline","aria-hidden":"true",children:s.map((n,a)=>t.jsxs(O.Fragment,{children:[a>0?t.jsx("span",{className:"pipe-link",children:t.jsx("i",{})}):null,t.jsx("span",{className:`pipe-node ${n==="report"?"accent":""}`,children:e("howItWorks.pipeline."+n)})]},n))})}function Ya({stats:e}){const{t:s}=C();return t.jsxs("div",{className:"summary",children:[t.jsx(ge,{label:s("summary.code"),value:e.code,accent:!0}),t.jsx(ge,{label:s("summary.files"),value:e.files}),t.jsx(ge,{label:s("summary.lines"),value:e.lines}),t.jsx(ge,{label:s("summary.comments"),value:e.comments}),t.jsx(ge,{label:s("summary.blanks"),value:e.blanks})]})}function er({report:e}){const{t:s}=C(),n=e.total.lines,a=e.total.code,r=tr(a),i=e.cached?s("runner.cacheHit"):s("runner.freshRun"),l=`${e.refName} / ${e.commitSha.slice(0,12)}`,o=[{label:s("insights.scale"),value:s(`insights.scaleValues.${r}`),detail:s(`insights.scaleDetails.${r}`),tone:"accent"},{label:s("insights.speed"),value:`${e.durationMs}ms`,detail:s("insights.speedDetail",{lines:_(n),version:e.tokeiVersion}),tone:"warn"},{label:s("insights.cacheState"),value:i,detail:l,tone:"muted"}];return t.jsxs("div",{className:"insights",role:"group","aria-label":s("insights.title"),children:[t.jsxs("div",{className:"insights-head",children:[t.jsx("span",{className:"chart-tag",children:s("insights.kicker")}),t.jsx("h3",{children:s("insights.title")})]}),t.jsx("div",{className:"insight-grid",children:o.map(c=>t.jsxs("div",{className:`insight-card ${c.tone}`,children:[t.jsx("span",{children:c.label}),t.jsx("strong",{children:c.value}),t.jsx("p",{children:c.detail})]},c.label))})]})}function tr(e){return e<1e3?"tiny":e<1e4?"small":e<1e5?"medium":e<5e5?"large":"huge"}function ge({label:e,value:s,accent:n}){const a=_(s);return t.jsxs("div",{className:`cell ${n?"accent":""}`,children:[t.jsx("div",{className:"lbl",children:e}),t.jsx("div",{className:"val",title:a,children:ee(s)})]})}function sr({report:e}){const{t:s,i18n:n}=C(),a=xt(),r=d.useMemo(()=>sa(e.languages,s("charts.other"),s("charts.noData")),[e.languages,n.language,s]),i=d.useMemo(()=>r.map(k=>({...k,color:Ie(k.color,a)}
93)),[r,a]),l=e.total.code,[o,c]=d.useState(null),[u,p]=d.useState(!1),m=s("charts.other"),g=d.useMemo(()=>new Set(i.map(k=>k.label)),[i]),x=d.useCallback(k=>g.has(k)?k:g.has(m)?m:null,[g,m]),b=d.useCallback(k=>c(k===null?null:x(k)),[x]),w=[...e.languages].sort((k,y)=>y.stats.code-k.stats.code)[0];return t.jsxs(t.Fragment,{children:[w?t.jsxs("div",{className:"mobile-code-summary",children:[t.jsx("span",{children:w.name}),t.jsxs("strong",{children:[_(w.stats.code)," ",s("table.code")]}),t.jsx("em",{children:Y(w.stats.code,e.total.code)})]}):null,t.jsx("button",{type:"button",className:"full-stats-toggle copybtn",onClick:()=>p(k=>!k),"aria-expanded":u,children:s(u?"charts.compactStats":"charts.fullStats")}),t.jsxs("div",{className:"charts-grid",children:[t.jsxs("div",{className:"chart-card donut-card",children:[t.jsxs("div",{className:"chart-h",children:[t.jsx("span",{className:"chart-tag",children:"chart"}),s("charts.languageShare")]}),t.jsx(nr,{items:i,total:l,hovered:o,onHover:c})]}),t.jsxs("div",{className:"chart-card table-card",children:[t.jsxs("div",{className:"chart-h",children:[t.jsx("span",{className:"chart-tag",children:"table"}),s("charts.report")]}),t.jsx(ir,{report:e,compact:!u,fullStats:u,hoveredSlice:o,sliceForLanguage:x,onHoverLanguage:b})]})]})]})}function nr({items:e,total:s,hovered:n,onHover:a}){const{t:r}=C(),i=_(s),l=d.useMemo(()=>na(e),[e]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"donut-wrap",role:"img","aria-label":r("charts.languageShare"),children:[t.jsxs("svg",{viewBox:"-1 -1 2 2",onMouseLeave:()=>a(null),children:[l.map(o=>t.jsx("path",{d:o.path,fill:o.color,className:n&&n!==o.label?"dim":void 0,onMouseEnter:()=>a(o.label)},o.label)),t.jsx("circle",{r:"0.58",fill:"var(--bg-2)"})]}),t.jsxs("div",{className:"donut-center",title:r("charts.totalCodeTooltip",{count:i}),children:[t.jsx("span",{className:"mute",children:r("table.code")}),t.jsx("strong",{children:ee(s)})]})]}),t.jsx("ul",{className:"visually-hidden",children:e.map(o=>t.jsxs("li",{children:[o.label,": ",Y(o.value,s)]},o.label))}),t.jsx("div",{className:"legend",onMouseLeave:()=>a(null),children:e.map(o=>t.jsxs("span",{className:`legend-row ${n===o.label?"hl":""}`,onMouseEnter:()=>a(o.label),children:[t.jsx("span",{className:"key-sw",style:{background:o.color}}),t.jsx("span",{className:"lname",children:o.label}),t.jsx("span",{children:Y(o.value,s)})]},o.label))})]})}const ar=["name","files","lines","code","comments","blanks"];function rr(){const e=new URLSearchParams(window.location.search),s=e.get("sort"),n=e.get("dir");return{key:s&&ar.includes(s)?s:"code",dir:n==="asc"||n==="desc"?n:"desc"}}function or(e,s){const n=new URLSearchParams(window.location.search);e==="code"&&s==="desc"?(n.delete("sort"),n.delete("dir")):(n.set("sort",e),n.set("dir",s));const a=n.toString();window.history.replaceState(null,"",window.location.pathname+(a?`?${a}`:""))}function ir({report:e,compact:s,fullStats:n,hoveredSlice:a,sliceForLanguage:r,onHoverLanguage:i}){const{t:l}=C(),o=d.useMemo(()=>rr(),[]),[c,u]=d.useState(o.key),[p,m]=d.useState(o.dir),[g,x]=d.useState(new Set),b=d.useMemo(()=>Pn(e.languages,c,p),[e.languages,c,p]),w=y=>{let v;c===y?(v=p==="asc"?"desc":"asc",m(v)):(v=y==="name"?"asc":"desc",u(y),m(v)),or(y,v)},k=d.useCallback(y=>{x(v=>{const R=new Set(v);return R.has(y)?R.delete(y):R.add(y),R})},[]);return t.jsx("div",{className:`table-wrap ${s?"compact":""} ${n?"is-full-stats":""}`,children:t.jsxs("table",{className:"report",children:[t.jsx("caption",{className:"visually-hidden",children:l("table.caption",{repo:`${e.repository.owner}/${e.repository.name}`})}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(rt,{label:l("table.language"),active:c==="name",dir:p,onClick:()=>w("name"),className:"lang",scope:"col"}),["files","lines","code","comments","blanks"].map(y=>t.jsx(rt,{label:l("table."+y),active:c===y,dir:p,onClick:()=>w(y),scope:"col"},y))]})}),t.jsxs("tbody",{onMouseLeave:()=>i==null?void 0:i(null),children:[b.map(y=>t.jsxs(O.Fragment,{children:[t.jsx(ot,{row:y,totalCode:e.total.code,expanded:g.has(y.name),onToggle:k,highlighted:!!(a&&(r==null?void 0:r(y.name))===a),onHover:i}),g.has(y.name)&&y.children.map(v=>t.jsx(ot,{row:v,child:!0,totalCode:e.total.code},`${y.name}:${v.name}`))]},y.name)),t.jsxs("tr",{className:"totals",children:[t.jsx("td",{className:"lang",children:l("table.total")}),t.jsx(V,{value:e.total.files}),t.jsx(V,{value:e.total.lines}),t.jsx(V,{value:e.total.code}),t.jsx(V,{value:e.total.comments}),t.jsx(V,{value:e.total.blanks})]})]})]})})}function rt({label:e,active:s,dir:n,onClick:a,className:r,scope:i}){return t.jsx("th",{className:r,scope:i,"aria-sort":s?n==="asc"?"ascending":"descending":void 0,children:t.jsxs("button",{type:"button",className:"sort-btn",onClick:a,children:[e," ",t.jsx("span",{className:"arr","aria-hidden":"true",children:s?n==="asc"?"^":"v":""})]})})}const ot=O.memo(function({row:s,totalCode:n,expanded:a,child:r,onToggle:i,highlighted:l,onHover:o}){const{t:c}=C(),u=xt(),p=s.children.length>0,m=p&&!r,g=s.stats.code+s.stats.comments+s.stats.blanks,x=`${Y(s.stats.code,g)} ${c("table.code")} · ${Y(s.stats.comments,g)} ${c("table.comments")} · ${Y(s.stats.blanks,g)} ${c("table.blanks")}`;return t.jsxs("tr",{className:`${r?"file-row":"lang-row"} ${m?"expandable":""} ${a?"expanded":""} ${l?"hl-row":""}`,onMouseEnter:r?void 0:()=>o==null?void 0:o(s.name),onClick:m?()=>i==null?void 0:i(s.name):void 0,children:[t.jsxs("td",{className:"lang",children:[p?t.jsx("button",{className:"expand",type:"button","aria-label":c(a?"table.collapseLanguage":"table.expandLanguage",{language:s.name}),"aria-expanded":!!a,onClick:b=>{b.stopPropagation(),i==null||i(s.name)},children:a?t.jsx(Jt,{size:14,"aria-hidden":"true"}):t.jsx(Zt,{size:14,"aria-hidden":"true"})}):t.jsx("span",{className:"expand-spacer"}),t.jsx("span",{className:"swatch",style:{color:Ie(De(s.name),u)}}),s.name,!r&&g>0?t.jsxs("span",{className:"row-ratio",title:x,"aria-hidden":"true",children:[t.jsx("i",{style:{width:`${s.stats.code/g*100}%`}}),t.jsx("i",{className:"cm",style:{width:`${s.stats.comments/g*100}%`}}),t.jsx("i",{className:"bl",style:{width:`${s.stats.blanks/g*100}%`}})]}):null]}),t.jsx(V,{value:s.stats.files}),t.jsx(V,{value:s.stats.lines}),t.jsx(V,{value:s.stats.code,share:Y(s.stats.code,n)}),t.jsx(V,{value:s.stats.comments}),t.jsx(V,{value:s.stats.blanks})]})});function V({value:e,share:s}){return t.jsxs("td",{children:[t.jsx("span",{children:_(e)}),s?t.jsx("small",{className:"mobile-code-share",children:s}):null]})}on.then(()=>{un(),Tt.createRoot(document.getElementById("root")).render(t.jsx(Nn,{children:t.jsx(Ut,{client:va,children:t.jsx(La,{})})}))});export{U as A,zn as B,dt as C,es as D,ss as E,ht as F,ls as L,hs as P,ke as S,Ln as T,I as _,ut as a,Dn as b,hr as c,ve as d,he as e,_ as f,pr as g,qn as h,ee as i,mn as j,oe as k,pe as l,De as m,Y as n,M as o,re as p,X as q,we as r,Hn as s,S as t,xt as u,Ie as v,ct as w,pn as x};
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.