{"version":3,"file":"Whatsapp.DaEPrcp2.mjs","names":["React.useMemo","p"],"sources":["https:/framerusercontent.com/modules/g9RvOiqc6PKukU9aKhUA/j5y8uBloVIlYgMPZTgtb/Whatsapp.js"],"sourcesContent":["// Whatsapp.tsx — Full width/height, centré, Bricolage Grotesque, Ref + labelSuffix\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Whatsapp(props){const{// UX\nlabel=\"WhatsApp\",labelSuffix=\"\",includeRefInLabel=false,bg=\"#25D366\",textColor=\"#0B1B13\",hoverBg=\"#22c05b\",radius=12,paddingX=16,paddingY=10,fontSize=16,showIcon=true,// Lien / message\nphone=\"+34 613 810 074\",message=\"Bonjour, je suis int\\xe9ress\\xe9\\xb7e par ce bien : \",propertyRef=\"\",useCurrentUrl=true,baseUrl=\"https://domaine-patrimoine.es/proprietes/\",slugOverride=\"\",openNewTab=true,// Optionnel\nutm=\"\"}=props;// Nettoie le numéro\nconst phoneClean=React.useMemo(()=>String(phone).replace(/[^0-9]/g,\"\"),[phone]);// Slug courant\nconst getSlugFromPath=()=>{if(typeof window===\"undefined\")return\"\";const parts=window.location.pathname.split(\"/\").filter(Boolean);return parts[parts.length-1]||\"\";};// URL du bien\nconst propertyUrl=React.useMemo(()=>{let url=\"\";if(typeof window!==\"undefined\"&&useCurrentUrl){url=window.location.href.split(\"#\")[0];}else{const slug=String(slugOverride||getSlugFromPath()).replace(/^\\/|\\/$/g,\"\");url=baseUrl?baseUrl.endsWith(\"/\")?baseUrl+slug:baseUrl+\"/\"+slug:slug;}if(utm)url+=(url.includes(\"?\")?\"&\":\"?\")+utm;return url;},[useCurrentUrl,baseUrl,slugOverride,utm]);// Lien WhatsApp (message + Ref + URL)\nconst waHref=React.useMemo(()=>{const refPart=propertyRef?` (Ref: ${propertyRef})`:\"\";const txt=`${message}${refPart}${propertyUrl?\" \"+propertyUrl:\"\"}`.trim();return`https://wa.me/${phoneClean}?text=${encodeURIComponent(txt)}`;},[message,propertyRef,propertyUrl,phoneClean]);const target=openNewTab?\"_blank\":\"_self\";const rel=openNewTab?\"noopener noreferrer\":undefined;// Texte affiché dans le bouton\nconst labelDisplay=React.useMemo(()=>{const bits=[label];if(labelSuffix)bits.push(labelSuffix);if(includeRefInLabel&&propertyRef)bits.push(`Ref ${propertyRef}`);return bits.join(\" \\xb7 \");},[label,labelSuffix,includeRefInLabel,propertyRef]);return /*#__PURE__*/_jsx(\"a\",{href:waHref,target:target,rel:rel,style:{display:\"block\",width:\"100%\",height:\"100%\",textDecoration:\"none\"},children:/*#__PURE__*/_jsxs(motion.button,{whileTap:{scale:.98},style:{// Full parent\nwidth:\"100%\",height:\"100%\",// Centrage parfait\ndisplay:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:10,// Style\nbackgroundColor:bg,color:textColor,border:\"none\",borderRadius:radius,padding:`${paddingY}px ${paddingX}px`,cursor:\"pointer\",boxShadow:\"0 8px 24px rgba(0,0,0,0.12)\",transition:\"background 0.2s ease\",// Typo demandée\nfontFamily:'\"Bricolage Grotesque\", system-ui, -apple-system, Segoe UI, Roboto, \"Helvetica Neue\", Arial, sans-serif',fontWeight:600,fontSize:`${fontSize}px`,letterSpacing:\"-0.1px\",lineHeight:\"16px\",textAlign:\"center\"},onMouseOver:e=>{e.currentTarget.style.backgroundColor=hoverBg;},onMouseOut:e=>{e.currentTarget.style.backgroundColor=bg;},\"aria-label\":\"Contacter via WhatsApp\",children:[showIcon&&/*#__PURE__*/_jsxs(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M20.52 3.48A11.5 11.5 0 0 0 12 0C5.37 0 0 5.37 0 12c0 2.1.54 4.07 1.48 5.8L0 24l6.34-1.66A11.93 11.93 0 0 0 12 24c6.63 0 12-5.37 12-12 0-3.2-1.24-6.2-3.48-8.52Z\",fill:\"currentColor\",opacity:\"0.1\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 2.37c-5.31 0-9.63 4.32-9.63 9.63 0 1.9.56 3.67 1.52 5.16L3 22l4.98-1.31a9.6 9.6 0 0 0 4.02.89c5.31 0 9.63-4.32 9.63-9.63S17.31 2.37 12 2.37Zm5.56 13.52c-.23.64-1.33 1.22-1.84 1.26-.49.05-1.12.07-1.8-.11-.41-.11-.93-.3-1.61-.59-2.83-1.22-4.67-4.05-4.81-4.24-.14-.19-1.15-1.53-1.15-2.92 0-1.39.73-2.08.99-2.36.26-.28.57-.35.76-.35.19 0 .38 0 .55.01.18.01.41-.07.65.49.23.56.79 1.94.86 2.08.07.14.12.3.02.49-.09.19-.14.31-.28.48-.14.17-.3.38-.43.51-.14.14-.28.29-.12.57.16.28.72 1.18 1.55 1.91 1.07.95 1.97 1.25 2.25 1.39.28.14.45.12.62-.07.17-.19.71-.83.9-1.12.19-.28.38-.24.64-.14.26.09 1.64.77 1.92.91.28.14.47.21.54.33.07.12.07.69-.16 1.33Z\",fill:\"currentColor\"})]}),/*#__PURE__*/_jsx(\"span\",{children:labelDisplay})]})});}addPropertyControls(Whatsapp,{// UX\nlabel:{title:\"Label\",type:ControlType.String,defaultValue:\"WhatsApp\"},labelSuffix:{title:\"Label +\",type:ControlType.String,defaultValue:\"\"},includeRefInLabel:{title:\"Afficher Ref dans label\",type:ControlType.Boolean,defaultValue:false},bg:{title:\"Fond\",type:ControlType.Color,defaultValue:\"#25D366\"},hoverBg:{title:\"Hover\",type:ControlType.Color,defaultValue:\"#22c05b\"},textColor:{title:\"Texte\",type:ControlType.Color,defaultValue:\"#0B1B13\"},radius:{title:\"Radius\",type:ControlType.Number,defaultValue:12,min:0,max:40,unit:\"px\"},paddingX:{title:\"Padding X\",type:ControlType.Number,defaultValue:16,min:0,max:48,unit:\"px\"},paddingY:{title:\"Padding Y\",type:ControlType.Number,defaultValue:10,min:0,max:32,unit:\"px\"},fontSize:{title:\"Font size\",type:ControlType.Number,defaultValue:16,min:8,max:36,unit:\"px\"},showIcon:{title:\"Ic\\xf4ne\",type:ControlType.Boolean,defaultValue:true},// Lien / message\nphone:{title:\"T\\xe9l\\xe9phone\",type:ControlType.String,defaultValue:\"+34 613 810 074\"},message:{title:\"Message\",type:ControlType.String,defaultValue:\"Bonjour, je suis int\\xe9ress\\xe9\\xb7e par ce bien : \"},propertyRef:{title:\"Ref du bien\",type:ControlType.String,defaultValue:\"\"},useCurrentUrl:{title:\"URL actuelle\",type:ControlType.Boolean,defaultValue:true},baseUrl:{title:\"Base URL\",type:ControlType.String,defaultValue:\"https://domaine-patrimoine.es/proprietes/\",hidden:p=>p.useCurrentUrl===true},slugOverride:{title:\"Slug (optionnel)\",type:ControlType.String,defaultValue:\"\",hidden:p=>p.useCurrentUrl===true},utm:{title:\"UTM (optionnel)\",type:ControlType.String,defaultValue:\"\"},openNewTab:{title:\"Nouvel onglet\",type:ControlType.Boolean,defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Whatsapp\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Whatsapp.map"],"mappings":"gPAIG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAChD,QAAM,WAAW,cAAY,GAAG,oBAAkB,GAAM,KAAG,UAAU,YAAU,UAAU,UAAQ,UAAU,SAAO,GAAG,WAAS,GAAG,WAAS,GAAG,WAAS,GAAG,WAAS,GAClK,QAAM,kBAAkB,UAAQ,8CAAuD,cAAY,GAAG,gBAAc,GAAK,UAAQ,4CAA4C,eAAa,GAAG,aAAW,GACxM,MAAI,IAAI,EACF,EAAWA,MAAkB,OAAO,EAAM,CAAC,QAAQ,UAA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