{"version":3,"file":"ChargeableWeightCalculator.BrInClsN.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/oBPfeP9Bre2lJZogwoMB/qnGlJZfvbMa9MJRDK32m/ChargeableWeightCalculator.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const numberInput={width:\"100%\",minWidth:0,height:46,border:\"1px solid #dbe5ea\",borderRadius:10,padding:\"0 13px\",boxSizing:\"border-box\",fontFamily:\"Inter, sans-serif\",fontSize:15,color:\"#0A3D62\",background:\"#ffffff\",outline:\"none\"};const labelStyle={display:\"block\",marginBottom:7,fontFamily:\"Inter, sans-serif\",fontSize:11,fontWeight:700,letterSpacing:\"0.06em\",textTransform:\"uppercase\",color:\"#607482\"};/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ChargeableWeightCalculator(props){const{mode=\"maritime\",accentColor=\"#00BCD4\",navyColor=\"#0A3D62\",style}=props;const[kg,setKg]=React.useState(0);const[length,setLength]=React.useState(0);const[width,setWidth]=React.useState(0);const[height,setHeight]=React.useState(0);const[pieces,setPieces]=React.useState(1);const safePieces=Math.max(1,pieces||1);const cubicMeters=Math.max(0,length)*Math.max(0,width)*Math.max(0,height)*safePieces/1e6;const tons=Math.max(0,kg)/1e3;const volumetricKg=cubicMeters*166.67;const result=mode===\"maritime\"?Math.max(cubicMeters,tons):Math.max(Math.max(0,kg),volumetricKg);const update=setter=>event=>{const value=Number(event.target.value);setter(Number.isFinite(value)?Math.max(0,value):0);};const maritime=mode===\"maritime\";const title=maritime?\"Calculadora LCL\":\"Calculadora a\\xe9rea\";const resultLabel=maritime?\"Valor cobrable\":\"Peso facturable\";const resultUnit=maritime?\"m\\xb3 / toneladas\":\"kg cobrables\";return /*#__PURE__*/_jsxs(\"section\",{\"aria-label\":title,style:{position:\"relative\",width:\"100%\",boxSizing:\"border-box\",border:\"1px solid #dbe5ea\",borderRadius:22,background:\"#ffffff\",boxShadow:\"0 24px 60px rgba(10,61,98,0.12)\",overflow:\"hidden\",...style},children:[/*#__PURE__*/_jsxs(\"div\",{style:{padding:\"27px 28px 10px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:11,fontWeight:800,letterSpacing:\"0.08em\",color:accentColor,marginBottom:8},children:\"HERRAMIENTA DE CUBICACI\\xd3N\"}),/*#__PURE__*/_jsx(\"h2\",{style:{margin:0,fontFamily:\"Manrope, sans-serif\",fontSize:25,lineHeight:1.2,color:navyColor},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"9px 0 0\",fontFamily:\"Inter, sans-serif\",fontSize:13,lineHeight:1.55,color:\"#687b88\"},children:\"Ingresa las medidas de cada bulto y el peso bruto total.\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{padding:\"18px 28px 28px\",display:\"grid\",gap:18},children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"label\",{htmlFor:\"weight-\"+mode,style:labelStyle,children:\"Peso bruto total (kg)\"}),/*#__PURE__*/_jsx(\"input\",{id:\"weight-\"+mode,type:\"number\",min:\"0\",inputMode:\"decimal\",value:kg||\"\",placeholder:\"Ej: 1200\",onChange:update(setKg),style:numberInput})]}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"span\",{style:labelStyle,children:\"Dimensiones por bulto (cm)\"}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"grid\",gridTemplateColumns:\"repeat(3, minmax(0, 1fr))\",gap:9},children:[/*#__PURE__*/_jsx(\"input\",{\"aria-label\":\"Largo en cent\\xedmetros\",type:\"number\",min:\"0\",inputMode:\"decimal\",value:length||\"\",placeholder:\"Largo\",onChange:update(setLength),style:numberInput}),/*#__PURE__*/_jsx(\"input\",{\"aria-label\":\"Ancho en cent\\xedmetros\",type:\"number\",min:\"0\",inputMode:\"decimal\",value:width||\"\",placeholder:\"Ancho\",onChange:update(setWidth),style:numberInput}),/*#__PURE__*/_jsx(\"input\",{\"aria-label\":\"Alto en cent\\xedmetros\",type:\"number\",min:\"0\",inputMode:\"decimal\",value:height||\"\",placeholder:\"Alto\",onChange:update(setHeight),style:numberInput})]})]}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"label\",{htmlFor:\"pieces-\"+mode,style:labelStyle,children:\"Cantidad de bultos\"}),/*#__PURE__*/_jsx(\"input\",{id:\"pieces-\"+mode,type:\"number\",min:\"1\",step:\"1\",inputMode:\"numeric\",value:pieces||\"\",onChange:update(setPieces),style:numberInput})]}),/*#__PURE__*/_jsxs(\"div\",{\"aria-live\":\"polite\",style:{background:navyColor,borderRadius:17,padding:\"24px 20px\",textAlign:\"center\",color:\"white\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:10,fontWeight:800,letterSpacing:\"0.09em\",textTransform:\"uppercase\",color:accentColor,marginBottom:8},children:resultLabel}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Manrope, sans-serif\",fontSize:40,lineHeight:1,fontWeight:800},children:result.toFixed(2)}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:12,opacity:.76,marginTop:8},children:resultUnit})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"grid\",gridTemplateColumns:\"1fr 1fr\",gap:10},children:[/*#__PURE__*/_jsxs(\"div\",{style:{background:\"#f4f8fa\",borderRadius:12,padding:13},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:10,fontWeight:700,color:\"#718391\",textTransform:\"uppercase\"},children:\"Volumen\"}),/*#__PURE__*/_jsxs(\"div\",{style:{fontFamily:\"Manrope, sans-serif\",fontSize:17,fontWeight:800,color:navyColor,marginTop:4},children:[cubicMeters.toFixed(2),\" m\\xb3\"]})]}),/*#__PURE__*/_jsxs(\"div\",{style:{background:\"#f4f8fa\",borderRadius:12,padding:13},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:10,fontWeight:700,color:\"#718391\",textTransform:\"uppercase\"},children:maritime?\"Peso\":\"Peso volum\\xe9trico\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Manrope, sans-serif\",fontSize:17,fontWeight:800,color:navyColor,marginTop:4},children:maritime?tons.toFixed(2)+\" ton\":volumetricKg.toFixed(2)+\" kg\"})]})]}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontFamily:\"Inter, sans-serif\",fontSize:11,lineHeight:1.5,color:\"#7c8c97\"},children:\"Resultado referencial para cubicaci\\xf3n. No corresponde al precio del flete ni reemplaza una cotizaci\\xf3n comercial.\"})]})]});}addPropertyControls(ChargeableWeightCalculator,{mode:{type:ControlType.Enum,title:\"Modalidad\",defaultValue:\"maritime\",options:[\"maritime\",\"air\"],optionTitles:[\"Mar\\xedtimo LCL\",\"A\\xe9reo\"],displaySegmentedControl:true},accentColor:{type:ControlType.Color,title:\"Calipso\",defaultValue:\"#00BCD4\"},navyColor:{type:ControlType.Color,title:\"Azul\",defaultValue:\"#0A3D62\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ChargeableWeightCalculator\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ChargeableWeightCalculator.map"],"mappings":"iLAGG,SAAwB,EAA2B,EAAM,CAAC,GAAK,CAAC,OAAK,WAAW,cAAY,UAAU,YAAU,UAAU,SAAO,EAAW,CAAC,EAAG,GAAOA,EAAe,CAAC,EAAO,CAAC,EAAO,GAAWA,EAAe,CAAC,EAAO,CAAC,EAAM,GAAUA,EAAe,CAAC,EAAO,CAAC,EAAO,GAAWA,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