{"version":3,"file":"DataInput.DMzdl9XF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Kuwa4LRQnmmppaTnEydr/t3D5F7RKQIiLc0GJ57Tn/DataInput.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useState}from\"react\";import{HiddenComponentLabel}from\"https://framerusercontent.com/modules/DwWOdDzQZGCuvkNlbUjZ/y3zt4fv5F2ZtnBW8nZvn/FramerFormsShared.js\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function DataInput(props){const{type}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const isOptimizing=typeof window===\"undefined\";const[value,setValue]=useState(\"\");let text=\"\";switch(type){case\"url\":text=\"Current URL\";break;case\"utmTags\":text=\"UTM Tags\";break;case\"urlParameter\":text=`${props.urlParameter} URL Parameter`;break;case\"referrerUrl\":text=\"Referrer URL\";break;}useEffect(()=>{switch(type){case\"url\":setValue(window.location.href);break;case\"utmTags\":const utms={};const queryParams=new URLSearchParams(window.location.search);queryParams.forEach((value,key)=>{// Check if the key starts with 'utm_' (indicating it's a UTM parameter)\nif(key.startsWith(\"utm_\")){utms[key]=value;}});setValue(utms);break;case\"urlParameter\":var _get;setValue((_get=new URLSearchParams(window.location.search).get(props.urlParameter))!==null&&_get!==void 0?_get:\"\");break;case\"referrerUrl\":setValue(document.referrer);break;}},[type,props.urlParameter]);return /*#__PURE__*/_jsx(HiddenComponentLabel,{text:text,subtext:\"Hidden Field\",children:!isCanvas&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"hidden\"},children:type==\"utmTags\"?value?Object.keys(value).map(key=>/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:key,value:value[key],\"data-framerforms-no-prefill\":true})):null:/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:props.name,value:value,\"data-framerforms-no-prefill\":true})})});}DataInput.displayName=\"URL Data Collector\";addPropertyControls(DataInput,{type:{type:ControlType.Enum,options:[\"url\",\"utmTags\",\"referrerUrl\",\"urlParameter\"],optionTitles:[\"Current URL\",\"UTM Tags\",\"Referrer URL\",\"URL Parameter\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},name:{type:ControlType.String,defaultValue:\"Data\",preventLocalization:true,hidden:props=>props.type==\"utmTags\"},urlParameter:{type:ControlType.String,defaultValue:\"\",placeholder:\"Parameter Name\",title:\"URL Param\",preventLocalization:true,hidden:props=>props.type!==\"urlParameter\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DataInput\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DataInput.map"],"mappings":"sPAIG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,EAAY,EAAS,EAAa,QAAQ,IAAI,EAAa,OAA2D,CAAC,EAAM,GAAUA,EAAS,EAAE,EAAM,EAAK,GAAG,OAAO,EAAP,CAAa,IAAI,MAAM,EAAK,cAAc,MAAM,IAAI,UAAU,EAAK,WAAW,MAAM,IAAI,eAAe,EAAK,GAAG,EAAM,aAAa,gBAAgB,MAAM,IAAI,cAAc,EAAK,eAAe,KAAM,CACjH,OADkH,MAAc,CAAC,OAAO,EAAP,CAAa,IAAI,MAAM,EAAS,EAAO,SAAS,IAAI,EAAE,MAAM,IAAI,UAAU,IAAM,EAAK,CAAC,EAAgE,IAAxC,gBAAgB,EAAO,SAAS,MAAkB,CAAC,CAAC,SAAS,EAAM,IAAM,CAChmB,EAAI,WAAW,MAAM,IAAG,EAAK,GAAK,EAAO,CAAC,EAAE,EAAS,CAAI,EAAE,MAAM,IAAI,eAAwB,EAAe,IAAI,gBAAgB,EAAO,SAAS,MAAM,CAAC,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