1import{u as W,k as n,c as a,a as t,b as A,d as o,p as X,e as g,w,n as p,f as L,t as d,g as u,F as C,h as T,q as j,m as Y,i as ee,j as te,o as s}from"./index-Ci6TV6FY.js";import{u as re}from"./useFitFileTool-BvlnBhsx.js";import{B as oe}from"./BuyMeACoffee-DziwkXNX.js";import{_ as se}from"./PipelinePanel-2jusmymN.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const ae={class:"animate-fade-in-up bg-white dark:bg-gray-800 rounded-3xl shadow-sm hover:shadow-md transition-shadow duration-300 border border-gray-100 dark:border-gray-700 p-8 md:p-10 max-w-5xl mx-auto"},le={class:"flex items-center space-x-5 mb-10 pb-6 border-b border-gray-100"},de={class:"p-4 bg-teal-50 dark:bg-teal-900/30 text-teal-600 dark:text-teal-400 rounded-2xl"},ne={class:"grid grid-cols-1 md:grid-cols-3 gap-10 md:gap-8 lg:gap-12"},ie={class:"flex flex-col"},ge={key:0},ue={key:1,class:"w-full flex flex-col items-center"},xe={class:"w-full text-sm font-semibold text-gray-800 dark:text-gray-100 bg-white dark:bg-gray-700 p-3 rounded-xl shadow-sm border border-gray-100 dark:border-gray-600 mb-4 truncate text-center"},be={class:"block text-xs text-gray-400 dark:text-gray-500 font-medium mt-1"},fe={key:1,class:"flex-grow bg-blue-50 dark:bg-blue-900/20 border-2 border-blue-200 dark:border-blue-700 rounded-2xl flex flex-col items-center justify-center p-8 text-center"},me={key:2,class:"text-red-500 dark:text-red-400 text-sm mt-3 font-semibold text-center bg-red-50 dark:bg-red-900/20 py-2 rounded-lg"},ye={class:"flex flex-col"},ce={class:"flex gap-1 mb-4 bg-gray-100 dark:bg-gray-700 rounded-xl p-1"},ve={class:"flex-grow bg-gray-50 dark:bg-gray-700/50 rounded-2xl p-6 border border-gray-100 dark:border-gray-600 shadow-inner flex flex-col space-y-6"},pe={class:"space-y-2"},ke={class:"space-y-2"},he={class:"space-y-3"},we={class:"grid grid-cols-3 gap-2"},Ce=["onClick"],Te={class:"space-y-2"},je={class:"flex items-center gap-2"},De={class:"flex items-center gap-1 flex-1"},Fe={class:"flex items-center gap-1 flex-1"},Se={class:"text-xs text-gray-400 dark:text-gray-500"},Me={class:"flex flex-col"},$e={class:"flex-grow flex flex-col items-center justify-center p-6 border border-gray-100 dark:border-gray-600 rounded-2xl bg-gray-50 dark:bg-gray-700/50 shadow-inner"},ze=["disabled"],Be={key:1,class:"w-full text-center p-4 bg-white dark:bg-gray-700 rounded-xl shadow-sm border border-gray-100 dark:border-gray-600"},Ie={class:"w-full bg-gray-100 dark:bg-gray-600 rounded-full h-4 mb-3 overflow-hidden shadow-inner"},Pe={class:"text-lg text-gray-700 dark:text-gray-300 font-bold"},Ve={key:2,class:"w-full text-center space-y-5 animate-fade-in-up"},Ue={key:0,class:"p-6 bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 rounded-xl border border-red-200 dark:border-red-800 font-medium flex flex-col items-center shadow-sm"},Ae={key:1,class:"flex flex-col space-y-4"},Le={class:"p-6 bg-green-50 dark:bg-green-900/20 rounded-xl border border-green-200 dark:border-green-800 flex flex-col items-center shadow-sm relative overflow-hidden"},Ne=["download","href"],Oe=["href"],Ke={__name:"AdjusterView",setup(qe){W({title:"Time Adjuster â FIT File Tools",meta:[{name:"description",content:"Change the date or time of any Garmin FIT file. Fix timestamps, backdate rides, or correct timezone errors. Free, no account required."}]});const{files:m,isDragging:k,isUploading:z,uploadProgress:B,resultMessage:N,resultStatus:h,resultUrl:I,resultId:O,stravaUrl:q,errorMessage:y,isPipelined:D,onFileDrop:F,reset:E,uploadFile:P,getFileFormData:R}=re(1),S=n("Click here to download your file!"),M=n(!1),$=new Date,c=n(new Date($.getTime()-$.getTimezoneOffset()*6e4).toISOString().split("T")[0]),v=n($.toTimeString().slice(0,5)),x=n("absolute"),i=n("+"),b=n(0),f=n(0),G=Intl.DateTimeFormat().resolvedOptions().timeZone,H=[{label:"â2h",hours:2,minutes:0,dir:"-"},{label:"â1h",hours:1,minutes:0,dir:"-"},{label:"â30m",hours:0,minutes:30,dir:"-"},{label:"+30m",hours:0,minutes:30,dir:"+"},{label:"+1h",hours:1,minutes:0,dir:"+"},{label:"+2h",hours:2,minutes:0,dir:"+"}];function _(l){i.value=l.dir,b.value=l.hours,f.value=l.minutes}function K(){const l=R();
1if(!l){y.value="Please select a file.";return}if(x.value==="offset"){const e=(b.value*60+f.value)*6e4;if(e===0){y.value="Please enter an offset greater than zero.";return}const r=i.value==="-"?-e:e;P(`tools/timeadjuster?offsetMs=${r}`,l)}else{if(!c.value||!v.value){y.value="Please select both a date and a time.";return}const[e,r,U]=c.value.split("-"),[Q,Z]=v.value.split(":"),J=new Date(e,r-1,U,Q,Z);P(`tools/timeadjuster?starttime=${J.getTime()}`,l)}}function V(){E(),S.value="Click here to download your file!";const l=new Date;c.value=new Date(l.getTime()-l.getTimezoneOffset()*6e4).toISOString().split("T")[0],v.value=l.toTimeString().slice(0,5),b.value=0,f.value=0,i.value="+"}return(l,e)=>(s(),a(C,null,[t("div",ae,[t("div",le,[t("div",de,[A(o(X),{class:"h-8 w-8"})]),e[15]||(e[15]=t("div",null,[t("h1",{class:"text-3xl font-bold text-gray-800 dark:text-gray-100 tracking-tight"},"Time Adjuster"),t("p",{class:"text-gray-500 dark:text-gray-400 mt-1 text-lg"},"Change the date or time that you created the file.")],-1))]),t("div",ne,[t("div",ie,[e[19]||(e[19]=t("h3",{class:"text-xl font-bold mb-2 text-gray-800 dark:text-gray-100 flex items-center"},[t("span",{class:"bg-gray-800 text-white rounded-full w-7 h-7 flex items-center justify-center text-sm mr-3"},"1"),g(" Select File ")],-1)),e[20]||(e[20]=t("p",{class:"text-sm text-gray-500 dark:text-gray-400 mb-6 font-medium"},"Choose your FIT file.",-1)),o(D)?(s(),a("div",fe,[...e[18]||(e[18]=[L('<div class="w-16 h-16 mb-4 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center"><svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></div><p class="text-blue-800 font-bold mb-1">Pipeline mode</p><p class="text-blue-600 text-sm">Using output from previous step</p>',3)])])):(s(),a("div",{key:0,class:p(["flex-grow border-2 border-dashed rounded-2xl flex flex-col items-center justify-center p-8 text-center transition-all duration-200 cursor-pointer",[o(k)?"border-teal-500 bg-teal-50 scale-105":"border-gray-300 hover:border-teal-400 hover:bg-teal-50/50"]]),onDragover:e[1]||(e[1]=w(r=>k.value=!0,["prevent"])),onDragleave:e[2]||(e[2]=w(r=>k.value=!1,["prevent"])),onDrop:e[3]||(e[3]=w(r=>{k.value=!1,o(F)(r)},["prevent"])),onClick:e[4]||(e[4]=r=>l.$refs.fileInput.click())},[t("input",{type:"file",ref:"fileInput",class:"hidden",accept:".fit,.FIT",onChange:e[0]||(e[0]=(...r)=>o(F)&&o(F)(...r))},null,544),o(m).length?(s(),a("div",ue,[e[17]||(e[17]=t("div",{class:"w-16 h-16 mb-4 bg-green-100 dark:bg-green-900/40 text-green-600 dark:text-green-400 rounded-full flex items-center justify-center"},[t("svg",{class:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1)),t("div",xe,[g(d(o(m)[0].name)+" ",1),t("span",be,d(Math.round(o(m)[0].size/1024))+" KB",1)]),t("button",{onClick:w(V,["stop"]),class:"text-sm px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg font-semibold transition-colors"},"Choose a different file")])):(s(),a("div",ge,[...e[16]||(e[16]=[L('<div class="w-16 h-16 mb-4 mx-auto bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center text-gray-400 dark:text-gray-500"><svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path></svg></div><p class="text-gray-700 dark:text-gray-300 font-semibold mb-1">Drag your file <span class="text-teal-600">here</span></p><p class="text-gray-400 dark:text-gray-500 text-sm">... or click to browse</p>',3)])]))],34)),o(y)?(s(),a("p",me,d(o(y)),1)):u("",!0)]),t("div",ye,[e[27]||(e[27]=t("h3",{class:"text-xl font-bold mb-2 text-gray-800 dark:text-gray-100 flex items-center"},[t("span",{class:"bg-gray-800 text-white rounded-full w-7 h-7 flex items-center justify-center text-sm mr-3"},"2"),g(" New Time ")],-1)),e[28]||(e[28]=t("p",{class:"text-sm text-gray-500 dark:text-gray-400 mb-6 font-medium"},"Set a new time or shift by an offset.",-1)),t("div",ce,[t("button",{onClick:e[5]||(e[5]=r=>x.value="absolute"),class:p(["flex-1 py-1.5 text-sm font-bold rounded-lg transition-colors",x.value==="absolute"?"bg-white dark:bg-gray-600 text-gray-800 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"])}," Set time ",2),t("button",{onClick:e[6]||(e[6]=r=>x.value="offset"),class:p(["flex-1 py-1.5 text-sm font-bold rounded-lg transition-colors",x.value==="offset"?"bg-white dark:bg-gray-600 text-gray-800 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"])}," Shift by offset ",2)]),t("div",ve,[x.value==="absolute"?(s(),a(C,{key:0},[t("div",pe,[e[21]||(e[21]=t("label",{class:"block text-sm font-bold text-gray-700 dark:text-gray-300"},"Start Date",-1)),T(t("input",{type:"date","onUpdate:modelValue":e[7]||
1(e[7]=r=>c.value=r),class:"w-full px-4 py-3 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-teal-500 focus:border-teal-500 text-gray-800 dark:text-gray-100 font-medium shadow-sm",required:""},null,512),[[j,c.value]])]),t("div",ke,[e[22]||(e[22]=t("label",{class:"block text-sm font-bold text-gray-700 dark:text-gray-300"},"Start Time",-1)),T(t("input",{type:"time","onUpdate:modelValue":e[8]||(e[8]=r=>v.value=r),class:"w-full px-4 py-3 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-teal-500 focus:border-teal-500 text-gray-800 dark:text-gray-100 font-medium shadow-sm",required:""},null,512),[[j,v.value]])])],64)):(s(),a(C,{key:1},[t("div",he,[e[23]||(e[23]=t("label",{class:"block text-sm font-bold text-gray-700 dark:text-gray-300"},"Quick presets",-1)),t("div",we,[(s(),a(C,null,Y(H,r=>t("button",{key:r.label,onClick:U=>_(r),class:p(["py-2 text-sm font-bold rounded-lg border transition-colors",i.value===r.dir&&b.value===r.hours&&f.value===r.minutes?"bg-teal-500 text-white border-teal-500":"bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-200 border-gray-200 dark:border-gray-600 hover:border-teal-400 dark:hover:border-teal-500"])},d(r.label),11,Ce)),64))])]),t("div",Te,[e[26]||(e[26]=t("label",{class:"block text-sm font-bold text-gray-700 dark:text-gray-300"},"Custom offset",-1)),t("div",je,[t("button",{onClick:e[9]||(e[9]=r=>i.value=i.value==="+"?"-":"+"),class:"w-10 h-10 flex-shrink-0 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-lg font-bold text-gray-700 dark:text-gray-200 hover:border-teal-400 transition-colors"},d(i.value),1),t("div",De,[T(t("input",{type:"number","onUpdate:modelValue":e[10]||(e[10]=r=>b.value=r),min:"0",max:"23",placeholder:"0",class:"w-full px-3 py-2.5 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-teal-500 text-gray-800 dark:text-gray-100 font-medium shadow-sm text-center"},null,512),[[j,b.value,void 0,{number:!0}]]),e[24]||(e[24]=t("span",{class:"text-sm text-gray-500 dark:text-gray-400 font-medium"},"h",-1))]),t("div",Fe,[T(t("input",{type:"number","onUpdate:modelValue":e[11]||(e[11]=r=>f.value=r),min:"0",max:"59",placeholder:"0",class:"w-full px-3 py-2.5 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-teal-500 text-gray-800 dark:text-gray-100 font-medium shadow-sm text-center"},null,512),[[j,f.value,void 0,{number:!0}]]),e[25]||(e[25]=t("span",{class:"text-sm text-gray-500 dark:text-gray-400 font-medium"},"m",-1))])])])],64)),t("p",Se,"Times are in your local timezone ("+d(o(G))+")",1)])]),t("div",Me,[e[38]||(e[38]=t("h3",{class:"text-xl font-bold mb-2 text-gray-800 dark:text-gray-100 flex items-center"},[t("span",{class:"bg-gray-800 text-white rounded-full w-7 h-7 flex items-center justify-center text-sm mr-3"},"3"),g(" Process ")],-1)),e[39]||(e[39]=t("p",{class:"text-sm text-gray-500 dark:text-gray-400 mb-6 font-medium"},"Run the selected tool.",-1)),t("div",$e,[!o(z)&&!o(h)?(s(),a("button",{key:0,onClick:K,disabled:!o(m).length&&!o(D),class:p(["w-full py-4 text-lg font-bold rounded-xl transition-all shadow-md focus:ring-4 focus:ring-teal-200 transform hover:-translate-y-1 active:translate-y-0",[o(m).length||o(D)?"bg-gradient-to-r from-teal-500 to-teal-600 hover:from-teal-600 hover:to-teal-700 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-400 dark:text-gray-500 cursor-not-allowed shadow-none hover:translate-y-0"]])}," Go! ",10,ze)):u("",!0),o(z)?(s(),a("div",Be,[e[29]||(e[29]=t("p",{class:"text-teal-600 mb-4 font-bold animate-pulse"},"Processing File...",-1)),t("div",Ie,[t("div",{class:"bg-gradient-to-r from-teal-400 to-teal-600 h-4 rounded-full transition-all duration-300 ease-out flex items-center justify-center pt-0.5 shadow",style:ee({width:`${o(B)}%`})},null,4)]),t("p",Pe,d(o(B))+"%",1)])):u("",!0),o(h)?(s(),a("div",Ve,[o(h)!=="success"?(s(),a("div",Ue,[e[30]||(e[30]=t("svg",{class:"w-10 h-10 mb-2 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),g(" Error: "+d(o(N)),1)])):u("",!0),o(h)==="success"?(s(),a("div",Ae,[t("div",Le,[e[31]||(e[31]=t("div",{class:"absolute top-0 right-0 -mr-4 -mt-4 w-16 h-16 bg-green-200 rounded-full opacity-50 blur-xl"},null,-1)),e[32]||(e[32]=t("div",{class:"absolute bottom-0 left-0 -ml-4 -mb-4 w-16 h-16 bg-green-200 rounded-full opacity-50 blur-xl"},null,-1)),e[33]||(e[33]=t("p",{class:"text-green-800 dark:text-green-300 font-bold mb-4 text-lg"},"Time Adjusted!",-1)),t("a",{download:o(I).split("/").pop()||"fitfiletools.fit",href:o(I),onClick:e[12]||(e[12]=r=>S.value="File has been saved to your downloads"),class:"inline-block relative z-10 w-full py-4 text-lg bg-green-600 hover:bg-green-700 text-white font-bold rounded-xl transition-all shadow hover:shadow-lg transform hover:-translate-y-0.5"},d(S.value),9,Ne)]),e[36]||(e[36]=t("div",{class:"relative flex py-2 items-center"},[t("div",{class:"flex-grow border-t border-gray-300 dark:border-gray-600"}),t("span",{class:"flex-shrink-0 mx-4 text-gray-400 dark:text-gray-500 text-sm font-bold uppercase tracking-widest"},"or"),t("div",{class:"flex-grow border-t border-gray-300 dark:border-gray-600"})],-1)),t("a",{href:o(q),class:"inline-flex justify-center items-center w-full py-4 text-lg bg-[#fc4c02] hover:bg-[#e34402] text-white font-bold rounded-xl transition-all shadow hover:shadow-lg transform hover:-translate-y-0.5"},[...e[34]||(e[34]=[t("svg",{class:"w-6 h-6 mr-2",viewBox:"0 0 24 24",fill:"
1currentColor"},[t("path",{d:"M15.387 17.944l-2.089-4.116h-3.065L15.387 24l5.15-10.172h-3.066m-7.008-5.599l2.836 5.598h4.172L10.463 0l-7 13.828h4.169"})],-1),g(" Upload to Strava ",-1)])],8,Oe),e[37]||(e[37]=t("div",{class:"relative flex py-2 items-center"},[t("div",{class:"flex-grow border-t border-gray-300 dark:border-gray-600"}),t("span",{class:"flex-shrink-0 mx-4 text-gray-400 dark:text-gray-500 text-sm font-bold uppercase tracking-widest"},"or"),t("div",{class:"flex-grow border-t border-gray-300 dark:border-gray-600"})],-1)),t("button",{onClick:e[13]||(e[13]=r=>M.value=!0),class:"inline-flex justify-center items-center w-full py-3 text-base bg-blue-600 hover:bg-blue-700 text-white font-bold rounded-xl transition-all shadow hover:shadow-lg transform hover:-translate-y-0.5"},[...e[35]||(e[35]=[t("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),g(" Chain to another tool ",-1)])])])):u("",!0),A(oe),t("button",{onClick:V,class:"mt-4 px-6 py-2 bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-600 font-bold rounded-lg transition-colors shadow-sm w-full"}," Process another file ")])):u("",!0)])])])]),M.value?(s(),te(se,{key:0,sourceId:o(O),onClose:e[14]||(e[14]=r=>M.value=!1)},null,8,["sourceId"])):u("",!0)],64))}};export{Ke as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.