PageSourceSearch

https://www.builder.io/assets/code-copy-ONzPIkHK.js

js builder.io collected 2026-09-24 07:06:01 UTC 1,398 bytes, 1 lines download raw bytes

1import{r as a,a as l}from"./components-tbqp4LHE.js";function u(t){const[o,e]=a.useState(0),n=[t.text,"copied!"];a.useEffect(()=>{const s=setTimeout(()=>e(0),1500);return()=>{clearTimeout(s)}},[o]),t.fun&&n.push("double copied!","triple copied!","super copied!","hyper copied!!!","definitively copied","seriously?","trust me, it's copied","you can paste it already","WTF","PLEASE STOP","ok, i am out");const c=()=>{r(t.copyOverride??t.text),e(Math.min(n.length-1,o+1))},i=o>0;return l("code",{className:t.attributes?.className,css:{display:"inline-block",fontSize:"16px",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"24px",paddingRight:"24px",userSelect:"none",borderRadius:"8px",backgroundColor:i?"#5cba47":"#161525",color:i?"#fff":"#E0E0F1",cursor:"copy",overflowX:"auto",transition:"background-color 0.2s, color 0.2s"},onClick:c,children:n[o]})}function r(t,{target:o=document.body}={}){const e=document.createElement("textarea"),n=document.activeElement;e.value=t,e.setAttribute("readonly",""),e.style.contain="strict",e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt";const c=document.getSelection();let i;c.rangeCount>0&&(i=c.getRangeAt(0)),o.append(e),e.select(),e.selectionStart=0,e.selectionEnd=t.length;let s=!1;try{s=document.execCommand("copy")}catch{}return e.remove(),i&&(c.removeAllRanges(),c.addRange(i)),n&&n.focus(),s}export{u as CodeCopyComponent};

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.