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