{"version":3,"file":"format.cjs","sources":["../../../../src/components/lib/format.ts"],"sourcesContent":["/**\n * Formats seconds into a time string (MM:SS or HH:MM)\n * @param time - Time in seconds\n * @returns Formatted time string\n */\nexport const formatTime = (time: number): string => {\n  // Formatting duration of video\n  if (isNaN(time)) {\n    return \"00:00\";\n  }\n\n  const date = new Date(time * 1000);\n  const hours = date.getUTCHours();\n  const minutes = date.getUTCMinutes();\n  const seconds = date.getUTCSeconds().toString().padStart(2, \"0\");\n  \n  if (hours) {\n    // If video has hours\n    return `${hours}:${minutes.toString().padStart(2, \"0\")}`;\n  } else {\n    return `${minutes}:${seconds}`;\n  }\n};"],"names":["time","isNaN","date","Date","hours","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","toString","padStart","concat"],"mappings":"uFAK0B,SAACA,GAEzB,GAAIC,MAAMD,GACR,MAAO,QAGT,IAAME,EAAO,IAAIC,KAAY,IAAPH,GAChBI,EAAQF,EAAKG,cACbC,EAAUJ,EAAKK,gBACfC,EAAUN,EAAKO,gBAAgBC,WAAWC,SAAS,EAAG,KAE5D,OAAIP,EAEF,GAAAQ,OAAUR,EAAKQ,KAAAA,OAAIN,EAAQI,WAAWC,SAAS,EAAG,MAElD,GAAAC,OAAUN,EAAOM,KAAAA,OAAIJ,EAEzB"}