{"version":3,"file":"Price_Text.CDA0kuXx.mjs","names":["React.useState","__esmMin","init_npm_react_18_3_1","init_jsx_runtime","c","p","ce","_e","RenderTarget","init_framer_BisrWwwE","addPropertyControls","ControlType","regionFor","country","EURO","getCountry","countryPromise","r","d","money","cents","value","region","BlackFridayPriceText","props","setCountry","alive","key","forceRegion","REGIONS","full","raw","discount","exact","exactRegions","promo","roundPromo","layout","align","prefix","prefixFont","prefixColor","showFullPrice","fullPriceFont","fullPriceColor","priceFont","priceColor","suffix","suffixFont","suffixColor","init_Price_Text"],"sources":["https:/framerusercontent.com/modules/TtmYWp4Mmv2D8bvvY4Pt/cJxqpbA7HWI0Fjk1IBk3/Price_Text.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// Preço mensal cheio por região. Mantenha igual ao PlanSelector.\nconst REGIONS={WORLD:{currency:\"USD\",locale:\"en-US\",monthly:20},CA:{currency:\"CAD\",locale:\"en-CA\",monthly:20},AU:{currency:\"AUD\",locale:\"en-AU\",monthly:24},GB:{currency:\"GBP\",locale:\"en-GB\",monthly:11},EU:{currency:\"EUR\",locale:\"en-IE\",monthly:13},BR:{currency:\"BRL\",locale:\"en-US\",monthly:45}};const EURO=[\"AT\",\"BE\",\"BG\",\"CY\",\"DE\",\"EE\",\"ES\",\"FI\",\"FR\",\"GR\",\"IE\",\"IT\",\"LT\",\"LU\",\"LV\",\"MT\",\"NL\",\"PT\",\"SI\",\"SK\"];function regionFor(country){if([\"CA\",\"AU\",\"GB\",\"BR\"].includes(country))return country;if(EURO.includes(country))return\"EU\";return\"WORLD\";}let countryPromise=null;function getCountry(){if(!countryPromise){countryPromise=fetch(\"https://loc.loot-studios.com\").then(r=>r.json()).then(d=>d.country).catch(()=>\"US\");}return countryPromise;}function money(value,region){const cents=Math.abs(value-Math.round(value))>.004;return new Intl.NumberFormat(region.locale,{style:\"currency\",currency:region.currency,minimumFractionDigits:cents?2:0,maximumFractionDigits:cents?2:0}).format(value);}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function BlackFridayPriceText(props){const{prefix,suffix,discount,roundPromo,exactRegions,showFullPrice,forceRegion,align,gap,prefixFont,priceFont,fullPriceFont,suffixFont,prefixColor,priceColor,fullPriceColor,suffixColor,layout}=props;const[country,setCountry]=React.useState(null);React.useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;let alive=true;getCountry().then(c=>alive&&setCountry(c));return()=>{alive=false;};},[]);const key=forceRegion&&forceRegion!==\"AUTO\"?forceRegion:country?regionFor(country):\"WORLD\";const region=REGIONS[key]||REGIONS.WORLD;const full=region.monthly;const raw=full*(1-discount/100);const exact=String(exactRegions||\"\").toUpperCase().split(/[\\s,;]+/).includes(key);const promo=roundPromo&&!exact?Math.round(raw+1e-9):raw;const alignItems=align===\"center\"?\"center\":align===\"right\"?\"flex-end\":\"flex-start\";return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:layout===\"row\"?\"row\":\"column\",alignItems:layout===\"row\"?\"baseline\":alignItems,flexWrap:\"wrap\",gap,textAlign:align,whiteSpace:\"nowrap\"},children:[prefix?/*#__PURE__*/_jsx(\"span\",{style:{...prefixFont,color:prefixColor},children:prefix}):null,/*#__PURE__*/_jsxs(\"span\",{style:{display:\"inline-flex\",alignItems:\"baseline\",gap:8},children:[showFullPrice?/*#__PURE__*/_jsx(\"span\",{style:{...fullPriceFont,color:fullPriceColor,textDecoration:\"line-through\"},children:money(full,region)}):null,/*#__PURE__*/_jsx(\"span\",{style:{...priceFont,color:priceColor},children:money(promo,region)}),suffix?/*#__PURE__*/_jsx(\"span\",{style:{...suffixFont,color:suffixColor},children:suffix}):null]})]});}addPropertyControls(BlackFridayPriceText,{prefix:{type:ControlType.String,title:\"Texto antes\",defaultValue:\"Plans starting at\"},suffix:{type:ControlType.String,title:\"Texto depois\",defaultValue:\"/month\"},discount:{type:ControlType.Number,title:\"Desconto %\",defaultValue:30,min:0,max:90,step:1},exactRegions:{type:ControlType.String,title:\"Sem arredondar (regi\\xf5es)\",defaultValue:\"\",placeholder:\"AU, CA\",hidden:props=>!props.roundPromo},roundPromo:{type:ControlType.Boolean,title:\"Arredondar\",defaultValue:true,enabledTitle:\"Sem centavos\",disabledTitle:\"Exato\"},showFullPrice:{type:ControlType.Boolean,title:\"Pre\\xe7o riscado\",defaultValue:true,enabledTitle:\"Mostrar\",disabledTitle:\"Ocultar\"},forceRegion:{type:ControlType.Enum,title:\"Regi\\xe3o (teste)\",options:[\"AUTO\",\"WORLD\",\"CA\",\"AU\",\"GB\",\"EU\",\"BR\"],optionTitles:[\"Autom\\xe1tica\",\"EUA / Mundo\",\"Canad\\xe1\",\"Austr\\xe1lia\",\"Reino Unido\",\"Europa\",\"Brasil\"],defaultValue:\"AUTO\"},layout:{type:ControlType.Enum,title:\"Disposi\\xe7\\xe3o\",options:[\"column\",\"row\"],optionTitles:[\"Texto em cima\",\"Mesma linha\"],defaultValue:\"column\",displaySegmentedControl:true},align:{type:ControlType.Enum,title:\"Alinhamento\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Esquerda\",\"Centro\",\"Direita\"],defaultValue:\"left\",displaySegmentedControl:true},gap:{type:ControlType.Number,title:\"Espa\\xe7o\",defaultValue:4,min:0,max:40},prefixFont:{type:ControlType.Font,title:\"Fonte texto\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14}},priceFont:{type:ControlType.Font,title:\"Fonte pre\\xe7o\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:22}},fullPriceFont:{type:ControlType.Font,title:\"Fonte riscado\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14}},suffixFont:{type:ControlType.Font,title:\"Fonte depois\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14}},prefixColor:{type:ControlType.Color,title:\"Cor texto\",defaultValue:\"#F4F2EA\"},priceColor:{type:ControlType.Color,title:\"Cor pre\\xe7o\",defaultValue:\"#FFFFFF\"},fullPriceColor:{type:ControlType.Color,title:\"Cor riscado\",defaultValue:\"#B8B2AC\"},suffixColor:{type:ControlType.Color,title:\"Cor depois\",defaultValue:\"#F4F2EA\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlackFridayPriceText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Price_Text.map"],"mappings":"A,gMACwZ,SAASY,EAAU,EAAQ,CAAgG,MAA5F,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,CAAC,SAASC,CAAO,EAASA,EAAWC,EAAK,SAASD,CAAO,EAAQ,KAAW,OAAQ,CAAyB,SAASE,GAAY,CAAgI,MAA/H,CAAoBC,IAAe,MAAM,8BAA8B,CAAC,CAAC,KAAK,GAAGC,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAGC,EAAE,OAAO,CAAC,CAAC,UAAU,IAAI,EAAUF,CAAe,CAAC,SAASG,EAAM,EAAM,EAAO,CAAC,IAAMC,EAAM,KAAK,IAAIC,EAAM,KAAK,MAAMA,CAAK,CAAC,EAAE,KAAK,OAAO,IAAI,KAAK,aAAaC,EAAO,OAAO,CAAC,MAAM,WAAW,SAASA,EAAO,SAAS,sBAAsBF,EAAM,EAAE,EAAE,sBAAsBA,EAAM,EAAE,CAAC,CAAC,CAAC,CAAC,OAAOC,CAAK,CAAE,CAGz9B,SAAwBE,EAAqB,EAAM,CAAC,GAAK,CAAC,SAAO,SAAO,WAAS,aAAW,eAAa,gBAAc,cAAY,QAAM,MAAI,aAAW,YAAU,gBAAc,aAAW,cAAY,aAAW,iBAAe,cAAY,UAAQC,EAAW,CAACX,EAAQY,GAAYzB,EAAe,IAAI,EAAEM,MA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