{"version":3,"file":"EconomicIndicators.DuHRTKtv.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/IW8ncSiwQ59ky1FbBMji/c64hwpOvzjqEQTdDw4of/EconomicIndicators.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const fallback={dolar:{valor:929.18,fecha:\"2026-08-31T04:00:00.000Z\"},euro:{valor:1076.06,fecha:\"2026-08-31T04:00:00.000Z\"},uf:{valor:40873.77,fecha:\"2026-08-31T04:00:00.000Z\"},utm:{valor:71649,fecha:\"2026-08-01T04:00:00.000Z\"},tpm:{valor:4.5,fecha:\"2026-08-31T04:00:00.000Z\"}};function money(value){return new Intl.NumberFormat(\"es-CL\",{style:\"currency\",currency:\"CLP\",minimumFractionDigits:2,maximumFractionDigits:2}).format(value);}function dateLabel(value){return new Intl.DateTimeFormat(\"es-CL\",{day:\"2-digit\",month:\"short\",year:\"numeric\"}).format(new Date(value));}// The customs rate is maintained monthly, independently of mindicador.cl.\n// Never present a rate for another month as current (including cached HTML).\nfunction isCurrentCustomsPeriod(period,now){const months=[\"enero\",\"febrero\",\"marzo\",\"abril\",\"mayo\",\"junio\",\"julio\",\"agosto\",\"septiembre\",\"octubre\",\"noviembre\",\"diciembre\"];const match=period.trim().toLowerCase().match(/^([a-z]+)\\s+(\\d{4})$/);if(!match)return false;const parts=new Intl.DateTimeFormat(\"en-US\",{timeZone:\"America/Santiago\",month:\"numeric\",year:\"numeric\"}).formatToParts(now);return months.indexOf(match[1])+1===Number(parts.find(p=>p.type===\"month\")?.value)&&Number(match[2])===Number(parts.find(p=>p.type===\"year\")?.value);}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function EconomicIndicators(props){const{mode=\"full\",customsValue=969.7,customsPeriod=\"Octubre 2026\",style}=props;const[data,setData]=React.useState(fallback);const[live,setLive]=React.useState(false);const[customsCurrent,setCustomsCurrent]=React.useState(null);React.useEffect(()=>{const checkPeriod=()=>setCustomsCurrent(isCurrentCustomsPeriod(customsPeriod,new Date)&&Number.isFinite(customsValue)&&customsValue>0);checkPeriod();const timer=window.setInterval(checkPeriod,6e4);document.addEventListener(\"visibilitychange\",checkPeriod);return()=>{window.clearInterval(timer);document.removeEventListener(\"visibilitychange\",checkPeriod);};},[customsPeriod,customsValue]);React.useEffect(()=>{let active=true;fetch(\"https://mindicador.cl/api\").then(response=>{if(!response.ok)throw new Error(\"Indicadores no disponibles\");return response.json();}).then(payload=>{if(!active)return;setData({dolar:payload.dolar||fallback.dolar,euro:payload.euro||fallback.euro,uf:payload.uf||fallback.uf,utm:payload.utm||fallback.utm,tpm:payload.tpm||fallback.tpm});setLive(true);}).catch(()=>setLive(false));return()=>{active=false;};},[]);const allItems=[{label:\"D\\xf3lar observado\",value:money(data.dolar.valor),detail:`Vigente al ${dateLabel(data.dolar.fecha)}`,accent:true},{label:\"D\\xf3lar aduanero\",value:customsCurrent?money(customsValue):\"—\",detail:customsCurrent===null?\"Comprobando vigencia mensual…\":customsCurrent?`${customsPeriod} \\xb7 referencia mensual`:\"Pendiente de actualizaci\\xf3n mensual\",accent:true},{label:\"Unidad de Fomento\",value:money(data.uf.valor),detail:`Vigente al ${dateLabel(data.uf.fecha)}`},{label:\"UTM\",value:money(data.utm.valor),detail:`Vigente al ${dateLabel(data.utm.fecha)}`},{label:\"EUR observado\",value:money(data.euro.valor),detail:`Vigente al ${dateLabel(data.euro.fecha)}`},{label:\"TPM\",value:`${data.tpm.valor.toLocaleString(\"es-CL\",{maximumFractionDigits:2})}%`,detail:`Vigente al ${dateLabel(data.tpm.fecha)}`}];const items=mode===\"compact\"?[allItems[0],allItems[1],allItems[2],allItems[4]]:allItems;return /*#__PURE__*/_jsxs(\"section\",{className:\"economic-indicators\",\"aria-label\":\"Indicadores econ\\xf3micos para comercio exterior\",style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",boxSizing:\"border-box\",overflow:\"hidden\",borderRadius:mode===\"compact\"?16:20,padding:mode===\"compact\"?24:32,background:mode===\"compact\"?\"#FFFFFF\":\"#F4F8FA\",border:\"1px solid rgba(10,61,98,.12)\",fontFamily:\"Inter, Arial, sans-serif\",color:\"#0A3D62\"},children:[/*#__PURE__*/_jsxs(\"div\",{className:\"economic-indicators__header\",style:{display:\"flex\",alignItems:\"flex-start\",justifyContent:\"space-between\",gap:20,marginBottom:22,width:\"100%\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{style:{color:\"#00BCD4\",fontSize:12,fontWeight:800,letterSpacing:\".11em\",textTransform:\"uppercase\",marginBottom:8},children:\"Referencia econ\\xf3mica\"}),/*#__PURE__*/_jsx(\"h2\",{style:{margin:0,fontFamily:\"Manrope, Inter, sans-serif\",fontSize:mode===\"compact\"?25:34,lineHeight:1.12,letterSpacing:\"-.03em\"},children:\"Indicadores para comercio exterior\"})]}),/*#__PURE__*/_jsx(\"span\",{style:{flex:\"none\",padding:\"7px 10px\",borderRadius:999,background:live?\"#E8F8F5\":\"#EEF2F4\",color:live?\"#08796F\":\"#526675\",fontSize:11,fontWeight:700},children:live?\"Datos diarios autom\\xe1ticos\":\"\\xdaltimo dato disponible\"})]}),/*#__PURE__*/_jsx(\"div\",{className:\"economic-indicators__grid\",style:{display:\"grid\",gridTemplateColumns:mode===\"compact\"?\"repeat(4, minmax(0, 1fr))\":\"repeat(3, minmax(0, 1fr))\",gridAutoRows:\"1fr\",gap:12,width:\"100%\",boxSizing:\"border-box\",alignItems:\"stretch\"},children:items.map(item=>/*#__PURE__*/_jsxs(\"article\",{style:{minWidth:0,width:\"100%\",height:\"100%\",boxSizing:\"border-box\",display:\"flex\",flexDirection:\"column\",justifyContent:\"flex-start\",padding:mode===\"compact\"?16:20,borderRadius:12,background:item.accent?\"linear-gradient(145deg, rgba(6,43,70,.94) 0%, rgba(10,61,98,.84) 62%, rgba(0,105,116,.70) 100%)\":\"rgba(255,255,255,.84)\",backdropFilter:item.accent?\"blur(24px) saturate(1.15)\":\"blur(16px)\",WebkitBackdropFilter:item.accent?\"blur(24px) saturate(1.15)\":\"blur(16px)\",border:item.accent?\"1px solid rgba(155,245,236,.40)\":\"1px solid rgba(0,188,212,.24)\",boxShadow:item.accent?\"0 12px 32px rgba(2,30,48,.16)\":\"0 8px 24px rgba(10,61,98,.06)\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{color:item.accent?\"#00BCD4\":\"#526675\",fontSize:12,fontWeight:700,marginBottom:9},children:item.label}),/*#__PURE__*/_jsx(\"div\",{style:{color:item.accent?\"#FFFFFF\":\"#0A3D62\",fontFamily:\"Manrope, Inter, sans-serif\",fontSize:mode===\"compact\"?21:27,fontWeight:800,lineHeight:1.08,whiteSpace:\"nowrap\"},children:item.value}),/*#__PURE__*/_jsx(\"div\",{style:{color:item.accent?\"rgba(255,255,255,.72)\":\"#71808C\",fontSize:11,lineHeight:1.4,marginTop:9},children:item.detail})]},item.label))}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexWrap:\"wrap\",alignItems:\"center\",justifyContent:\"space-between\",gap:12,marginTop:18,color:\"#627482\",fontSize:11,lineHeight:1.5},children:[/*#__PURE__*/_jsx(\"span\",{children:\"Valores referenciales. Verifica siempre la fuente oficial antes de calcular o declarar una operaci\\xf3n.\"}),/*#__PURE__*/_jsxs(\"span\",{children:[\"Datos diarios: \",/*#__PURE__*/_jsx(\"a\",{href:\"https://mindicador.cl/\",target:\"_blank\",rel:\"noreferrer\",style:{color:\"#087F77\",fontWeight:700},children:\"mindicador.cl\"}),\" \\xb7 Aduanero: \",/*#__PURE__*/_jsx(\"a\",{href:\"https://caduanera.cl/\",target:\"_blank\",rel:\"noreferrer\",style:{color:\"#087F77\",fontWeight:700},children:\"C\\xe1mara Aduanera\"}),\" \\xb7 carga mensual\"]})]}),mode===\"compact\"&&/*#__PURE__*/_jsx(\"a\",{href:\"/indicadores-comercio-exterior\",style:{display:\"inline-flex\",marginTop:17,color:\"#087F77\",fontSize:13,fontWeight:800,textDecoration:\"none\"},children:\"Ver todos los indicadores →\"}),/*#__PURE__*/_jsx(\"style\",{children:`\n                @media (max-width: 840px) {\n                    .economic-indicators__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }\n                }\n                @media (max-width: 520px) {\n                    .economic-indicators { padding: 20px !important; }\n                    .economic-indicators__header { flex-direction: column; align-items: flex-start !important; }\n                    .economic-indicators__grid { grid-template-columns: minmax(0, 1fr) !important; grid-auto-rows: minmax(126px, auto) !important; }\n                    .economic-indicators__grid article { width: 100% !important; min-width: 0 !important; }\n                }\n            `})]});}addPropertyControls(EconomicIndicators,{mode:{type:ControlType.Enum,title:\"Formato\",options:[\"compact\",\"full\"],optionTitles:[\"Resumen Home\",\"P\\xe1gina completa\"],defaultValue:\"full\"},customsValue:{type:ControlType.Number,title:\"USD aduanero\",defaultValue:969.7,min:0,step:.01,displayStepper:true},customsPeriod:{type:ControlType.String,title:\"Mes aduanero\",defaultValue:\"Octubre 2026\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EconomicIndicators\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EconomicIndicators.map"],"mappings":"sMAA+Z,SAAS,EAAM,EAAM,CAAC,OAAO,IAAI,KAAK,aAAa,QAAQ,CAAC,MAAM,WAAW,SAAS,MAAM,sBAAsB,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAK,CAAE,CAAC,SAAS,EAAU,EAAM,CAAC,OAAO,IAAI,KAAK,eAAe,QAAQ,CAAC,IAAI,UAAU,MAAM,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,CAAK,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