"use client"
import{a as s}from"./chunk-NWME2ANF.mjs";import{b as g}from"./chunk-NFT4CZEK.mjs";import{a as f}from"./chunk-4KAIJ2PN.mjs";import{a as u}from"./chunk-U4QIRPVU.mjs";import{a as p}from"./chunk-RKUUDTHF.mjs";import{a as c}from"./chunk-GHXIGUPQ.mjs";import{a as m}from"./chunk-GLJR2QX5.mjs";import{a as d}from"./chunk-3IVWKAUU.mjs";import{j as r}from"./chunk-5PZS4TTS.mjs";import{useEffect as S,useId as k,useRef as P,useState as A}from"react";import{jsx as o,jsxs as n}from"react/jsx-runtime";var C=[{key:"utm_source",icon:d,label:"Source",placeholder:"google",description:"Where the traffic is coming from"},{key:"utm_medium",icon:f,label:"Medium",placeholder:"cpc",description:"How the traffic is coming"},{key:"utm_campaign",icon:c,label:"Campaign",placeholder:"summer_sale",description:"The name of the campaign"},{key:"utm_term",icon:p,label:"Term",placeholder:"running shoes",description:"The term of the campaign"},{key:"utm_content",icon:u,label:"Content",placeholder:"logolink",description:"The content of the campaign"},{key:"ref",icon:m,label:"Referral",placeholder:"yoursite.com",description:"The referral of the campaign"}];function z({values:h,onChange:b,disabled:y,autoFocus:v,className:T}){let{isMobile:x}=s(),i=k(),[l,N]=A(!1),t=P(null);return S(()=>{t.current&&!x&&v&&setTimeout(()=>{var e;return(e=t.current)==null?void 0:e.focus()},10)},[]),o("div",{className:r("grid gap-y-3",T),children:C.map(({key:e,icon:M,label:R,placeholder:_,description:w},E)=>o("div",{className:"group relative",children:n("div",{className:"relative z-10 flex",children:[o(g,{content:n("div",{className:"p-3 text-center text-xs",children:[o("p",{className:"text-gray-600",children:w}),o("span",{className:"font-mono text-gray-400",children:e})]}),sideOffset:4,disableHoverableContent:!0,children:n("div",{className:r("flex items-center gap-1.5 rounded-l-md border-y border-l border-gray-300 bg-gray-50 px-3 py-1.5 text-gray-700",l?"sm:min-w-36":"sm:min-w-28"),onClick:()=>N(a=>!a),children:[o(M,{className:"size-4 shrink-0"}),o("label",{htmlFor:`${i}-${e}`,className:"select-none text-sm",children:l?o("span",{className:"font-mono text-xs",children:e}):R})]})}),o("input",{type:"text",id:`${i}-${e}`,ref:E===0?t:void 0,placeholder:_,disabled:y,className:"h-full min-w-0 grow rounded-r-md border border-gray-300 placeholder-gray-400 focus:border-gray-500 focus:ring-gray-500 disabled:cursor-not-allowed sm:text-sm",value:h[e]||"",onChange:a=>b(e,a.target.value)})]})},e))})}export{C as a,z as b};
