{"version":3,"file":"CodeSample.DY6RZ1qV.mjs","names":["React.useState","__esmMin","init_npm_react_18_3_1","navigator","init_ssg_sandbox_shims","init_jsx_runtime","c","p","_e","addPropertyControls","ControlType","init_framer_BisrWwwE","CodeSample","props","items","tabs","t","active","setActive","copied","setCopied","current","mono","copy","style","border","i","accent","text","muted","maxHeight","init_CodeSample"],"sources":["https:/framerusercontent.com/modules/nI3G4pEjj3oSXmm4m7C4/H1RR32kZBIhHkEMo49Yk/CodeSample.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Code sample block for API pages. Renders code verbatim in <pre><code>\n// (server-rendered, so it is in the page HTML), with optional tabs and a\n// copy button. Use the Tabs control: one item per tab (label + code).\n/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function CodeSample(props){const{tabs=[],background=\"#101010\",border=\"rgba(255, 255, 255, 0.1)\",text=\"#FFFFFF\",muted=\"#AAAAAA\",accent=\"#8681F7\",maxHeight=0,style}=props;const items=(tabs||[]).filter(t=>t&&(t.code||\"\").length>0);const[active,setActive]=React.useState(0);const[copied,setCopied]=React.useState(false);const current=items[Math.min(active,Math.max(items.length-1,0))];const mono='\"DM Mono\", \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace';const copy=()=>{if(!current)return;try{navigator.clipboard.writeText(current.code);setCopied(true);setTimeout(()=>setCopied(false),1500);}catch(e){}};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",boxSizing:\"border-box\",background,border:`1px solid ${border}`,borderRadius:14,overflow:\"hidden\",fontFamily:mono},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:8,padding:\"10px 14px\",borderBottom:`1px solid ${border}`},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:6,flexWrap:\"wrap\"},children:items.map((t,i)=>/*#__PURE__*/_jsx(\"button\",{onClick:()=>setActive(i),style:{fontFamily:mono,fontSize:12,lineHeight:\"16px\",padding:\"4px 10px\",borderRadius:6,cursor:\"pointer\",border:`1px solid ${i===active?accent:\"transparent\"}`,background:i===active?\"rgba(134, 129, 247, 0.12)\":\"transparent\",color:i===active?text:muted},children:t.label||\"Code\"},i))}),/*#__PURE__*/_jsx(\"button\",{onClick:copy,\"aria-label\":\"Copy code\",style:{fontFamily:mono,fontSize:12,padding:\"4px 10px\",borderRadius:6,cursor:\"pointer\",border:`1px solid ${border}`,background:\"transparent\",color:muted},children:copied?\"Copied\":\"Copy\"})]}),items.map((t,i)=>/*#__PURE__*/_jsx(\"pre\",{style:{display:i===active?\"block\":\"none\",margin:0,padding:\"16px 18px\",overflowX:\"auto\",maxHeight:maxHeight>0?maxHeight:undefined,overflowY:maxHeight>0?\"auto\":undefined,color:text,fontSize:13,lineHeight:\"20px\",whiteSpace:\"pre\"},children:/*#__PURE__*/_jsx(\"code\",{style:{fontFamily:mono},children:t.code})},i))]});}addPropertyControls(CodeSample,{tabs:{type:ControlType.Array,title:\"Tabs\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\",defaultValue:\"cURL\"},code:{type:ControlType.String,title:\"Code\",displayTextArea:true,defaultValue:\"\"}}},defaultValue:[{label:\"cURL\",code:\"curl https://api.crustdata.com\"}]},background:{type:ControlType.Color,defaultValue:\"#101010\"},border:{type:ControlType.Color,defaultValue:\"rgba(255, 255, 255, 0.1)\"},text:{type:ControlType.Color,defaultValue:\"#FFFFFF\"},muted:{type:ControlType.Color,defaultValue:\"#AAAAAA\"},accent:{type:ControlType.Color,defaultValue:\"#8681F7\"},maxHeight:{type:ControlType.Number,title:\"Max height (0 = none)\",defaultValue:0,min:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CodeSample\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"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