PageSourceSearch

https://hikerapi.com/assets/js/Settings-Dy2w36RE.js

js hikerapi.com collected 2026-09-25 21:45:22 UTC 30,845 bytes, 4 lines download raw bytes

1import"./vue-core-BJYLVuRU.js";import{_ as x,t as E,f as I,S as D}from"./index-BV6QtbyE.js";import{q as r,t as n,y as s,v as F,C as u,G as b,H as p,E as m,D as v,L as f,S as y,x as h,F as C,K,o as _,J as k,z as A,T,B as V}from"./vendor-C61o6woY.js";import{N}from"./mixins-Dm-LeQDs.js";import{d as g}from"./string-C_kPiLtH.js";import{Q as R}from"./qrcode-CRMKui6W.js";import{b as q}from"./date-V67yhMnj.js";import{t as B}from"./tablePagination-BYx0ftkr.js";import"./toastr-ZJ-XgUIA.js";import"./tables-Zwqw6ld6.js";import"./bootstrap-82v6EwEu.js";import"./jarallax-DStYVGbw.js";import"./highlight-CohLJnU_.js";import"./typed-D7S6yrmg.js";import"./mitt-DJ65BbbF.js";import"./axios-42ANG6Sg.js";const Y={props:{name:{required:!0,type:String},currentTab:{required:!0,type:String}},data(){return{}}},M={class:"nav-item"},L=["href","help"];function z(o,e,c,w,t,l){return r(),n("li",M,[s("a",{class:u(["nav-link",{active:c.currentTab==c.name}]),onClick:e[0]||(e[0]=d=>c.currentTab=c.name),href:`#${c.name}`,help:c.currentTab},[F(o.$slots,"default")],10,L)])}const O=x(Y,[["render",z],["__file","/app/src/components/Tab.vue"]]),H={data(){return{show:!1,reason:"",errors:{},disabled:!1}},methods:{open(){this.show=!0,this.errors={},document.body.style.overflow="hidden",this.$nextTick(()=>this.$refs.reason.focus())},close(){this.disabled||(this.show=!1,this.reason="",document.body.style.overflow="",this.$nextTick(()=>this.$refs.opener.focus()))},trapFocus(o){const e=[...this.$refs.modal.querySelectorAll("button, textarea")].filter(t=>!t.disabled);if(!e.length)return;const c=e[0],w=e[e.length-1];o.shiftKey&&document.activeElement===c?(o.preventDefault(),w.focus()):!o.shiftKey&&document.activeElement===w&&(o.preventDefault(),c.focus())},deactivate(){this.errors={},this.disabled=!0,this.$services.Deactivate().save({reason:this.reason.trim()}).then(o=>{o.body.state?(E("account_deactivate"),I(),location.href="/"):(this.disabled=!1,g(o,this))}).catch(o=>{this.disabled=!1,g(o,this)})}},unmounted(){document.body.style.overflow=""}},Q={class:"mt-8"},G={key:0},W={class:"modal-dialog modal-dialog-centered",role:"document"},j={class:"modal-content"},J={class:"modal-header"},Z={class:"modal-body"},$={class:"form-group"},X={class:"modal-footer"},ee=["disabled"],se={key:0,class:"spinner-border spinner-border-sm me-2"};function te(o,e,c,w,t,l){return r(),n("div",Q,[e[13]||(e[13]=s("hr",{class:"mb-6"},null,-1)),e[14]||(e[14]=s("h3",{class:"text-danger fw-bold"},"Danger Zone",-1)),e[15]||(e[15]=s("p",{class:"text-muted mb-4"}," Deactivating your account disables API access and dashboard login. Your balance and plan are kept. To reactivate later, contact support. ",-1)),s("button",{type:"button",class:"btn btn-outline-danger",ref:"opener",onClick:e[0]||(e[0]=(...d)=>l.open&&l.open(...d))}," Deactivate account ",512),t.show?(r(),n("div",G,[s("div",{class:"modal fade show d-block",tabindex:"-1",role:"dialog","aria-modal":"true","aria-labelledby":"deactivate-title",ref:"modal",onKeydown:[e[5]||(e[5]=K((...d)=>l.close&&l.close(...d),["esc"])),e[6]||(e[6]=K((...d)=>l.trapFocus&&l.trapFocus(...d),["tab"]))],onMousedown:e[7]||(e[7]=C((...d)=>l.close&&l.close(...d),["self"]))},[s("div",W,[s("div",j,[s("div",J,[e[8]||(e[8]=s("h5",{class:"modal-title",id:"deactivate-title"},"Deactivate account",-1)),s("button",{type:"button",class:"btn-close","aria-label":"Close",onClick:e[1]||(e[1]=(...d)=>l.close&&l.close(...d))})]),s("div",Z,[(r(!0),n(b,null,p(t.errors.__all__,d=>(r(),n("p",{class:"mb-4 text-danger",key:d},m(d),1))),128)),e[10]||(e[10]=s("p",null," Your API tokens will stop working within a few minutes and you will no longer be able to log in. This can only be undone by contacting support. ",-1)),s("div",$,[e[9]||(e[9]=s("label",{class:"form-label",for:"deactivate-reason"},[v(" Why are you leaving? "),s("span",{class:"text-danger"},"*")],-1)),f(s("textarea",{id:"deactivate-reason",ref:"reason",rows:"4",maxlength:"2000",class:u(["form-control",{"is-invalid":t.errors.reason}]),placeholder:"Please tell us the reason (at least 10 characters)","onUpdate:modelValue":e[2]||(e[2]=d=>t.reason=d)},null,2),[[y,t.reason]]),(r(!0),n(b,null,p(t.errors.reason,d=>(r(),n("small",{class:"form-text text-danger",key:d},m(d),1))),128))])]),s("div",X,[s("button",{type:"button",class:"btn btn-secondary",onClick:e[3]||(e[3]=(...d)=>l.close&&l.close(...d))},"Cancel"),s("button",{type:"button",class:"btn btn-danger",disabled:t.reason.trim().length<10||t.disabled,onClick:e[4]||(e[4]=(...d)=>l.deactivate&&l.deactivate(...d))},[t.disabled?(r(),n("span",se)):h("v-if",!0),e[11]||(e[11]=v(" Deactivate ",-1))],8,ee)])])])],544),e[12]||(e[12]=s("div",{class:"modal-backdrop fade show"},null,-1))])):h("v-if",!0)])}const oe=x(H,[["render",te],["__file","/app/src/components/inner/DeactivateAccount.vue"]]),re={mixins:[N],components:{Spinner:D,DeactivateAccount:oe},data(){return{errors:{},form:{},loaded:!1,disabled:!1}},methods:{fetch(){let o=["id","email","first_name","last_name","billed_to","address"];this.$services.Context().get().then(e=>{for(let c of o)this.form[c]=e.body[c]})},save(){this.errors={},this.disabled=!0,this.$services.Context().save(this.form).then(o=>{this.errors=o.body.errors||{},o.body.state?this.successNotify({message:"Successful"}):g(o,this)}).catch(o=>{g(o,this)}).finally(()=>{this.disabled=!1})}},created(){this.fetch(),this.loaded=!0}},ne={class:"pt-8 pt-md-5 pb-8 pb-md-14"},le={class:"container"},ie={class:"row"},ae={class:"col-12"},de={class:"mb-6 text-danger"},me={class:"form-group"},ue={class:"form-text text-danger"},ce={class:"form-group"},fe={class:"form-text text-danger"},be={class:"form-group"},pe={class:"form-text text-danger"},he={class:"form-group"},ye={class:"form-text text-danger"},ve={class:"form-group"},ge={class:"form-text text-danger"},we=["disabled"];function _e(o,e,c,w,t,l){const d=_("Spinner"),i=_("DeactivateAccount");return r(),n("section",ne,[s("div",le,[s("div",ie,[s("div",ae,[(r(!0),n(b,null,p(t.errors.__all__,a=>(r(),n("p",de,m(a),1))),256)),t.loaded?(r(),n("form",{key:1,class:"mb-6",onSubmit:e[5]||(e[5]=C((...a)=>l.save&&l.save(...a),["prevent"]))},[s("div",me,[e[6]||(e[6]=s("label",{class:"form-label",for:"email"},"Email address",-1)),f(s("input",{type:"email",class:u(["form-control",{"is-invalid":t.errors.email}]),id:"email",placeholder:"Enter your Email","onUpdate:modelValue":e[0]||(e[0]=a=>t.form.email=a)},null,2),[[y,t.form.email]]),(r(!0),n(b,null,p(t.errors.email,a=>(r(),n("small",ue,m(a),1))),256))]),s("div",ce,[e[7]||(e[7]=s("label",{class:"form-label",for:"first_name"},"First name",-1)),f(s("input",{type:"text",class:u(["form-control",{"is-invalid":t.errors.first_name}]),id:"first_name",placeholder:"Enter your first name","onUpdate:modelValue":e[1]||(e[1]=a=>t.form.first_name=a)},null,2),[[y,t.form.first_name]]),(r(!0),n(b,null,p(t.errors.first_name,a=>(r(),n("small",fe,m(a),1))),256))]),s("div",be,[e[8]||(e[8]=s("label",{class:"form-label",for:"last_name"},"Last name",-1)),f(s("input",{type:"text",class:u(["form-control",{"is-invalid":t.errors.last_name}]),id:"last_name",placeholder:"Enter your last name","onUpdate:modelValue":e[2]||(e[2]=a=>t.form.last_name=a)},null,2),[[y,t.form.last_name]]),(r(!0),n(b,null,p(t.errors.last_name,a=>(r(),n("small",pe,m(a),1))),256))]),s("div",he,[e[9]||(e[9]=s("label",{class:"form-label",for:"email"},"Billed to",-1)),f(s("input",{type:"billed_to",class:u(["form-control",{"is-invalid":t.errors.billed_to}]),id:"billed_to",placeholder:"Enter your company name","onUpdate:modelValue":e[3]||(e[3]=a=>t.form.billed_to=a)},null,2),[[y,t.form.billed_to]]),(r(!0),n(b,null,p(t.errors.billed_to,a=>(r(),n("small",ye,m(a),1))),256))]),s("div",ve,[e[10]||(e[10]=s("label",{class:"form-label",for:"email"},"Address",-1)),f(s("input",{type:"address",class:u(["form-control",{"is-invalid":t.errors.address}]),id:"address",placeholder:"Enter your address","onUpdate:modelValue":e[4]||(e[4]=a=>t.form.address=a)},null,2),[[y,t.form.address]]),(r(!0),n(b,null,p(t.errors.address,a=>(r(),n("small",ge,m(a),1))),256))]),s("button",{class:"btn w-100 btn-primary",type:"submit",disabled:t.disabled}," Save ",8,we)],32)):(r(),k(d,{key:0})),A(i)])])])])}const ke=x(re,[["render",_e],["__file","/app/src/components/inner/Profile.vue"]]),xe={mixins:[N],data(){return{errors:{},form:{},disabled:!1}},methods:{change(){this.errors={},this.disabled=!0,this.$services.Password().update(this.form).then(o=>{this.errors=o.body.errors||{},o.body.state?this.successNotify({message:"Successful"}):g(o,this)}).catch(o=>{g(o,this)}).finally(()=>{this.disabled=!1})}}},Ce={class:"pt-8 pt-md-5 pb-8 pb-md-14"},Te={class:"container"},Pe={class:"row"},Se={class:"col-12"},Ae={class:"mb-6 text-danger"},De={class:"form-group mb-5"},Ee={class:"form-text text-danger"},Ve={class:"form-group mb-5"},Ne={class:"form-text text-danger"},Ke={class:"form-group mb-5"},Ue={class:"form-text text-danger"},Ie=["disabled"];function Fe(o,e,c,w,t,l){return r(),n("section",Ce,[s("div",Te,[s("div",Pe,[s("div",Se,[(r(!0),n(b,null,p(t.errors.__all__,d=>(r(),n("p",Ae,m(d),1))),256)),s("form",{class:"mb-6",onSubmit:e[3]||(e[3]=C((...d)=>l.change&&l.change(...d),["prevent"]))},[s("div",De,[e[4]||(e[4]=s("label",{class:"form-label",for:"old_password"},"Old password",-1)),f(s("input",{type:"password",class:u(["form-control",{"is-invalid":t.errors.old_password}]),id:"old_password",placeholder:"Enter your password","onUpdate:modelValue":e[0]||(e[0]=d=>t.form.old_password=d)},null,2),[[y,t.form.old_password]]),(r(!0),n(b,null,p(t.errors.old_password,d=>
1(r(),n("small",Ee,m(d),1))),256))]),s("div",Ve,[e[5]||(e[5]=s("label",{class:"form-label",for:"password"},"New password",-1)),f(s("input",{type:"password",class:u(["form-control",{"is-invalid":t.errors.password1}]),id:"password",placeholder:"Enter new password","onUpdate:modelValue":e[1]||(e[1]=d=>t.form.password1=d)},null,2),[[y,t.form.password1]]),(r(!0),n(b,null,p(t.errors.password1,d=>(r(),n("small",Ne,m(d),1))),256))]),s("div",Ke,[e[6]||(e[6]=s("label",{class:"form-label",for:"password2"},"Repeat password",-1)),f(s("input",{type:"password",class:u(["form-control",{"is-invalid":t.errors.password2}]),id:"password2",placeholder:"Enter new password again","onUpdate:modelValue":e[2]||(e[2]=d=>t.form.password2=d)},null,2),[[y,t.form.password2]]),(r(!0),n(b,null,p(t.errors.password2,d=>(r(),n("small",Ue,m(d),1))),256))]),s("button",{class:"btn w-100 btn-primary",type:"submit",disabled:t.disabled}," Change password ",8,Ie)],32)])])])])}const Re=x(xe,[["render",Fe],["__file","/app/src/components/inner/Password.vue"]]),qe={mixins:[N],components:{Spinner:D},data(){return{step:"loading",status:{},secret:"",qr:"",code:"",password:"",recoveryCodes:[],acknowledged:!1,errors:{},disabled:!1}},created(){this.load()},methods:{reset(){this.errors={},this.code="",this.password="",this.recoveryCodes=[],this.acknowledged=!1,this.secret="",this.qr=""},load(){this.reset(),this.step="loading",this.$services.Tfa().get().then(o=>{this.status=o.body,this.step=o.body.enabled?"enabled":"disabled"}).catch(o=>{g(o,this),this.step="error"})},goto(o){this.reset(),this.step=o,this.focusFirstField()},focusFirstField(){this.$nextTick(()=>{this.$refs.firstField&&this.$refs.firstField.focus()})},startSetup(){this.password&&(this.errors={},this.disabled=!0,this.$services.TfaSetup().save({password:this.password}).then(o=>o.body.state?(this.secret=o.body.secret,this.qr="",this.password="",this.code="",this.step="qr",this.focusFirstField(),R.toDataURL(o.body.otpauth_uri).then(e=>{this.qr=e}).catch(()=>{this.errors={__all__:["Could not draw the QR code — enter the key below manually"]}})):g(o,this)).catch(o=>{g(o,this)}).finally(()=>{this.disabled=!1}))},showCodeError(o){g(o,this),o?.status===403&&this.errors.__all__&&(this.errors={code:this.errors.__all__})},enable(){this.code.trim()&&(this.errors={},this.disabled=!0,this.$services.TfaEnable().save({code:this.code.trim()}).then(o=>{if(!o.body.state)return g(o,this);this.recoveryCodes=o.body.recovery_codes,this.acknowledged=!1,this.code="",this.step="recovery",E("tfa_enable")}).catch(o=>{this.showCodeError(o)}).finally(()=>{this.disabled=!1}))},disable(){!this.password||!this.code.trim()||(this.errors={},this.disabled=!0,this.$services.TfaDisable().save({password:this.password,code:this.code.trim()}).then(o=>{if(!o.body.state)return g(o,this);this.successNotify({message:"Two-factor authentication turned off"}),E("tfa_disable"),this.load()}).catch(o=>{this.showCodeError(o)}).finally(()=>{this.disabled=!1}))},regenerate(){!this.password||!this.code.trim()||(this.errors={},this.disabled=!0,this.$services.TfaRecoveryCodes().save({password:this.password,code:this.code.trim()}).then(o=>{if(!o.body.state)return g(o,this);this.recoveryCodes=o.body.recovery_codes,this.acknowledged=!1,this.code="",this.password="",this.step="recovery"}).catch(o=>{this.showCodeError(o)}).finally(()=>{this.disabled=!1}))},copy(o){this.$methods.copyToClipboard(o),this.successNotify({message:"Copied"})}}},Be={class:"pt-8 pt-md-5 pb-8 pb-md-14"},Ye={class:"container"},Me={class:"row"},Le={class:"col-12"},ze={key:1},Oe={key:2},He={class:"form-group mb-5"},Qe=["disabled"],Ge={key:3},We=["src"],je={class:"mb-4"},Je={class:"fs-5"},Ze={class:"form-group mb-5"},$e=["disabled"],Xe={key:4},es={class:"mb-4 fs-5"},ss={class:"form-check my-4"},ts=["disabled"],os={key:5},rs={class:"form-group mb-5"},ns={class:"form-group mb-5"},ls=["disabled"],is={key:6},as={class:"form-group mb-5"},ds={class:"form-group mb-5"},ms=["disabled"],us={key:7},cs={key:0,class:"text-muted mb-2"},fs={class:"text-muted mb-5"};function bs(o,e,c,w,t,l){const d=_("Spinner");return r(),n("section",Be,[s("div",Ye,[s("div",Me,[s("div",Le,[(r(!0),n(b,null,p(t.errors.__all__,i=>(r(),n("p",{class:"mb-6 text-danger",key:i},m(i),1))),128)),t.step==="loading"?(r(),k(d,{key:0})):t.step==="error"?(r(),n("div",ze,[e[20]||(e[20]=s("h4",{class:"mb-2"},"Couldn't load two-factor status",-1)),e[21]||(e[21]=s("p",{class:"text-muted mb-5"}," The status request did not go through, so nothing is shown or changed here until it does. ",-1)),s("button",{class:"btn btn-primary",type:"button",onClick:e[0]||(e[0]=(...i)=>l.load&&l.load(...i))},"Retry")])):t.step==="disabled"?(r(),n("div",Oe,[e[23]||(e[23]=s("h4",{class:"mb-2"},"Two-factor authentication is off",-1)),e[24]||(e[24]=s("p",{class:"text-muted mb-5"}," Add a second step to every login: a 6-digit code from an app like Google Authenticator or 1Password. ",-1)),s("form",{class:"mb-6",onSubmit:e[2]||(e[2]=C((...i)=>l.startSetup&&l.startSetup(...i),["prevent"]))},[s("div",He,[e[22]||(e[22]=s("label",{class:"form-label",for:"tfa-password"},"Your password",-1)),f(s("input",{type:"password",class:u(["form-control",{"is-invalid":t.errors.password}]),id:"tfa-password",autocomplete:"current-password","onUpdate:modelValue":e[1]||(e[1]=i=>t.password=i)},null,2),[[y,t.password]]),(r(!0),n(b,null,p(t.errors.password,i=>(r(),n("small",{class:"form-text text-danger",key:i},m(i),1))),128))]),s("button",{class:"btn btn-primary",type:"submit",disabled:t.disabled||!t.password}
1," Enable two-factor ",8,Qe)],32)])):t.step==="qr"?(r(),n("div",Ge,[e[28]||(e[28]=s("h4",{class:"mb-2"},"Scan this code",-1)),e[29]||(e[29]=s("p",{class:"text-muted mb-4"},"Open your authenticator app and scan the image, then enter the code it shows.",-1)),t.qr?(r(),n("img",{key:0,src:t.qr,alt:"TOTP QR code",class:"mb-4",width:"200",height:"200"},null,8,We)):h("v-if",!0),s("p",je,[e[25]||(e[25]=v(" Can't scan? Enter this key manually:",-1)),e[26]||(e[26]=s("br",null,null,-1)),s("code",Je,m(t.secret),1),s("button",{class:"btn btn-sm btn-outline-secondary ms-2",type:"button",onClick:e[3]||(e[3]=i=>l.copy(t.secret))},"Copy")]),s("form",{class:"mb-6",onSubmit:e[6]||(e[6]=C((...i)=>l.enable&&l.enable(...i),["prevent"]))},[s("div",Ze,[e[27]||(e[27]=s("label",{class:"form-label",for:"tfa-code"},"Code from the app",-1)),f(s("input",{type:"text",class:u(["form-control",{"is-invalid":t.errors.code}]),id:"tfa-code",inputmode:"numeric",autocomplete:"one-time-code",placeholder:"123456",maxlength:"32",ref:"firstField","onUpdate:modelValue":e[4]||(e[4]=i=>t.code=i)},null,2),[[y,t.code]]),(r(!0),n(b,null,p(t.errors.code,i=>(r(),n("small",{class:"form-text text-danger",key:i},m(i),1))),128))]),s("button",{class:"btn btn-primary",type:"submit",disabled:t.disabled||!t.code.trim()},"Confirm",8,$e),s("button",{class:"btn btn-link",type:"button",onClick:e[5]||(e[5]=(...i)=>l.load&&l.load(...i))},"Cancel")],32)])):t.step==="recovery"?(r(),n("div",Xe,[e[31]||(e[31]=s("h4",{class:"mb-2"},"Save your recovery codes",-1)),e[32]||(e[32]=s("p",{class:"text-danger mb-4"}," Shown once. Each code logs you in exactly once if you lose your phone. ",-1)),s("pre",es,m(t.recoveryCodes.join(`
2`)),1),s("button",{class:"btn btn-outline-secondary me-2",type:"button",onClick:e[7]||(e[7]=i=>l.copy(t.recoveryCodes.join(`
3`)))},"Copy all"),s("div",ss,[f(s("input",{class:"form-check-input",type:"checkbox",id:"tfa-saved","onUpdate:modelValue":e[8]||(e[8]=i=>t.acknowledged=i)},null,512),[[T,t.acknowledged]]),e[30]||(e[30]=s("label",{class:"form-check-label",for:"tfa-saved"}," I saved them somewhere safe ",-1))]),s("button",{class:"btn btn-primary",type:"button",disabled:!t.acknowledged,onClick:e[9]||(e[9]=(...i)=>l.load&&l.load(...i))},"Done",8,ts)])):t.step==="regenerate"?(r(),n("div",os,[e[35]||(e[35]=s("h4",{class:"mb-2"},"Regenerate recovery codes",-1)),e[36]||(e[36]=s("p",{class:"text-muted mb-5"}," The 8 codes you have now stop working. Confirm with your password and a code from your authenticator app. ",-1)),s("form",{class:"mb-6",onSubmit:e[13]||(e[13]=C((...i)=>l.regenerate&&l.regenerate(...i),["prevent"]))},[s("div",rs,[e[33]||(e[33]=s("label",{class:"form-label",for:"tfa-regenerate-password"},"Your password",-1)),f(s("input",{type:"password",class:u(["form-control",{"is-invalid":t.errors.password}]),id:"tfa-regenerate-password",autocomplete:"current-password",ref:"firstField","onUpdate:modelValue":e[10]||(e[10]=i=>t.password=i)},null,2),[[y,t.password]]),(r(!0),n(b,null,p(t.errors.password,i=>(r(),n("small",{class:"form-text text-danger",key:i},m(i),1))),128))]),s("div",ns,[e[34]||(e[34]=s("label",{class:"form-label",for:"tfa-regenerate-code"},"Current code",-1)),f(s("input",{type:"text",class:u(["form-control",{"is-invalid":t.errors.code}]),id:"tfa-regenerate-code",inputmode:"numeric",autocomplete:"one-time-code",placeholder:"123456 or a recovery code",maxlength:"32","onUpdate:modelValue":e[11]||(e[11]=i=>t.code=i)},null,2),[[y,t.code]]),(r(!0),n(b,null,p(t.errors.code,i=>(r(),n("small",{class:"form-text text-danger",key:i},m(i),1))),128))]),s("button",{class:"btn btn-primary me-2",type:"submit",disabled:t.disabled||!t.password||!t.code.trim()}," Regenerate ",8,ls),s("button",{class:"btn btn-link",type:"button",onClick:e[12]||(e[12]=(...i)=>l.load&&l.load(...i))},"Cancel")],32)])):t.step==="disable"?(r(),n("div",is,[e[39]||(e[39]=s("h4",{class:"mb-2 text-danger"},"Turn off two-factor",-1)),e[40]||(e[40]=s("p",{class:"text-muted mb-5"}," Your account goes back to a single password step. Confirm with your password and a code from your authenticator app. ",-1)),s("form",{class:"mb-6",onSubmit:e[17]||(e[17]=C((...i)=>l.disable&&l.disable(...i),["prevent"]))},[s("div",as,[e[37]||(e[37]=s("label",{class:"form-label",for:"tfa-password-off"},"Your password",-1)),f(s("input",{type:"password",class:u(["form-control",{"is-invalid":t.errors.password}]),id:"tfa-password-off",autocomplete:"current-password",ref:"firstField","onUpdate:modelValue":e[14]||(e[14]=i=>t.password=i)},null,2),[[y,t.password]]),(r(!0),n(b,null,p(t.errors.password,i=>(r(),n("small",{class:"form-text text-danger",key:i},m(i),1))),128))]),s("div",ds,[e[38]||(e[38]=s("label",{class:"form-label",for:"tfa-disable-code"},"Current code",-1)),f(s("input",{type:"text",class:u(["form-control",{"is-invalid":t.errors.code}]),id:"tfa-disable-code",inputmode:"numeric",autocomplete:"one-time-code",placeholder:"123456 or a recovery code",maxlength:"32","onUpdate:modelValue":e[15]||(e[15]=i=>t.code=i)},null,2),[[y,t.code]]),(r(!0),n(b,null,p(t.errors.code,i=>(r(),n("small",{class:"form-text text-danger",key:i},m(i),1))),128))]),s("button",{class:"btn btn-danger me-2",type:"submit",disabled:t.disabled||!t.password||!t.code.trim()}," Turn off two-factor ",8,ms),s("button",{class:"btn btn-link",type:"button",onClick:e[16]||(e[16]=(...i)=>l.load&&l.load(...i))},"Cancel")],32)])):(r(),n("div",us,[e[41]||(e[41]=s("h4",{class:"mb-2"},"Two-factor authentication is on",-1)),t.status.confirmed_at?(r(),n("p",cs,"Enabled on "+m(t.status.confirmed_at.slice(0,10)),1)):h("v-if",!0),s("p",fs,m(t.status.recovery_codes_left)+" recovery codes left",1),s("button",{class:"btn btn-outline-primary me-2",type:"button",onClick:e[18]||(e[18]=i=>l.goto("regenerate"))}," Regenerate recovery codes "),s("button",{class:"btn btn-outline-danger",type:"button",onClick:e[19]||(e[19]=i=>l.goto("disable"))}," Turn off two-factor ")]))])])])])}const ps=x(qe,[["render",bs],["__file","/app/src/components/inner/Security.vue"]]),hs={components:{Spinner:D},data(){return{loading:!0,settings:{balance:!0,digest_email:!0,digest_tg:!0,rewards:!0}}},computed:{hasTelegram(){return this.settings.has_telegram}},created(){this.$services.Notification().get().then(o=>{this.settings=o.body,this.loading=!1}
3).catch(()=>{this.loading=!1})},methods:{save(){const{balance:o,digest_email:e,digest_tg:c,rewards:w}=this.settings;this.$services.Notification().save({balance:o,digest_email:e,digest_tg:c,rewards:w}).catch(()=>{this.$services.Notification().get().then(t=>{this.settings=t.body})})}}},ys={class:"pt-8 pt-md-5 pb-8 pb-md-14"},vs={class:"container"},gs={class:"row"},ws={class:"col-12 col-md-8"},_s={key:0,class:"mb-2"},ks={key:1,class:"mb-2"},xs=["href"],Cs={key:2},Ts={class:"mb-4"},Ps={class:"form-check form-switch mb-3"},Ss={class:"form-check-label",for:"digest_email"},As={class:"text-muted"},Ds={class:"form-check form-switch mb-3"},Es={class:"form-check form-switch mb-3"},Vs={class:"mb-4"},Ns={class:"form-check form-switch mb-3"},Ks=["disabled"],Us={class:"text-muted"},Is={key:0},Fs={key:1,class:"text-danger"};function Rs(o,e,c,w,t,l){const d=_("Spinner"),i=_("router-link");return r(),n("section",ys,[s("div",vs,[s("div",gs,[s("div",ws,[h(" Telegram Connection "),o.$state.context.token?(r(),n("div",{key:0,class:u(["alert mb-6",l.hasTelegram?"alert-success":"alert-warning"]),role:"alert"},[l.hasTelegram?(r(),n("p",_s," Your Telegram account is connected. ")):(r(),n("p",ks," Link your Telegram account to start a trial, access balance details and receive notifications. ")),s("a",{href:`${o.$state.siteTgBase}/${o.$state.context.tg_bot}?start=${o.$state.context.token}`,target:"_blank"},m(l.hasTelegram?"Open Bot":"Connect Telegram"),9,xs)],2)):h("v-if",!0),t.loading?(r(),k(d,{key:1})):h("v-if",!0),t.loading?h("v-if",!0):(r(),n("div",Cs,[h(" Email Notifications "),e[19]||(e[19]=s("h5",{class:"mb-3"},"Email Notifications",-1)),s("div",Ts,[s("div",Ps,[f(s("input",{class:"form-check-input",type:"checkbox",id:"digest_email","onUpdate:modelValue":e[0]||(e[0]=a=>t.settings.digest_email=a),onChange:e[1]||(e[1]=(...a)=>l.save&&l.save(...a))},null,544),[[T,t.settings.digest_email]]),s("label",Ss,[e[10]||(e[10]=s("strong",null,"Weekly Digest",-1)),e[11]||(e[11]=s("br",null,null,-1)),s("small",As,[e[9]||(e[9]=v("Receive weekly industry news ",-1)),A(i,{to:"/blog"},{default:V(()=>[...e[8]||(e[8]=[v("digest",-1)])]),_:1})])])]),s("div",Ds,[f(s("input",{class:"form-check-input",type:"checkbox",id:"balance","onUpdate:modelValue":e[2]||(e[2]=a=>t.settings.balance=a),onChange:e[3]||(e[3]=(...a)=>l.save&&l.save(...a))},null,544),[[T,t.settings.balance]]),e[12]||(e[12]=s("label",{class:"form-check-label",for:"balance"},[s("strong",null,"Low Balance Alerts"),s("br"),s("small",{class:"text-muted"},"Get notified when balance is low")],-1))]),s("div",Es,[f(s("input",{class:"form-check-input",type:"checkbox",id:"rewards","onUpdate:modelValue":e[4]||(e[4]=a=>t.settings.rewards=a),onChange:e[5]||(e[5]=(...a)=>l.save&&l.save(...a))},null,544),[[T,t.settings.rewards]]),e[13]||(e[13]=s("label",{class:"form-check-label",for:"rewards"},[s("strong",null,"Rewards & Promotions"),s("br"),s("small",{class:"text-muted"},"Earn API credits for writing about HikerAPI")],-1))])]),h(" Telegram Notifications "),e[20]||(e[20]=s("h5",{class:"mb-3"},"Telegram Notifications",-1)),s("div",Vs,[s("div",Ns,[f(s("input",{class:"form-check-input",type:"checkbox",id:"digest_tg","onUpdate:modelValue":e[6]||(e[6]=a=>t.settings.digest_tg=a),onChange:e[7]||(e[7]=(...a)=>l.save&&l.save(...a)),disabled:!l.hasTelegram},null,40,Ks),[[T,t.settings.digest_tg]]),s("label",{class:u(["form-check-label",{"text-muted":!l.hasTelegram}]),for:"digest_tg"},[e[17]||(e[17]=s("strong",null,"Weekly Digest",-1)),e[18]||(e[18]=s("br",null,null,-1)),s("small",Us,[e[15]||(e[15]=v("Receive ",-1)),A(i,{to:"/blog"},{default:V(()=>[...e[14]||(e[14]=[v("digest",-1)])]),_:1}),e[16]||(e[16]=v(" via Telegram bot",-1))]),l.hasTelegram?h("v-if",!0):(r(),n("br",Is)),l.hasTelegram?h("v-if",!0):(r(),n("small",Fs,"Connect Telegram to enable"))],2)])])]))])])])])}const qs=x(hs,[["render",Rs],["__file","/app/src/components/inner/Notifications.vue"]]),Bs={components:{Spinner:D},mixins:[B],data(){return{disabled:!1,loaded:!1,columns:[{label:"Name",field:"name",sortable:!1},{label:"API key",field:"api_key",sortable:!1},{label:"Date of creation",field:"created_at",formatFn:q,sortable:!1},{label:"Actions",field:"actions",sortable:!1}],rows:[]}},methods:{fetch(o){o=o||{},this.$services.APIKey().get(o).then(e=>{this.rows=e.body.data||[]}).finally(()=>{this.loaded=!0})},create(){this.disabled=!0,this.$services.APIKey().save().then(o=>{this.fetch()}).finally(()=>{this.disabled=!1})},edit(o){let e=prompt("Change name",o.name);e&&this.$services.APIKey().update({id:o.id,name:e}).then(c=>{this.fetch()})},remove(o){confirm("Are you sure?")&&this.$services.APIKey().delete({id:o.id}).then(e=>{this.fetch()})},onPageChange(o){this.fetch({page:o.currentPage})},copyKey(o){this.$methods.copyToClipboard(o),this.$notify.success({title:"Copied",message:"API key copied"})}},created(){this.fetch()}},Ys={class:"pt-8 pt-md-5 pb-8 pb-md-14"},Ms={class:"container"},Ls={key:1,class:"row"},zs={key:0,class:"mb-6 text-muted"},Os=["href"],Hs=["href"],Qs={class:"col-12"},Gs={class:"table-responsive"},Ws={key:0},js=["onClick"],Js={key:1},Zs=["onClick"],$s=["onClick"],Xs={key:2},et=["disabled"];function st(o,e,c,w,t,l){const d=_("Spinner"),i=_("vue-good-table");return r(),n("section",Ys,[s("div",Ms,[t.loaded?(r(),n("div",Ls,[o.$state.context.
3id?(r(),n("p",zs,[e[1]||(e[1]=v(" Create tokens and affiliate promo codes using your APIKey.",-1)),e[2]||(e[2]=s("br",null,null,-1)),s("a",{href:`${o.$state.siteProto}://${o.$state.siteDomain}/dapi/docs`},m(o.$state.siteProto)+"://"+m(o.$state.siteDomain)+"/dapi/docs ",9,Os),e[3]||(e[3]=v(" (Cloudflare, Swagger)",-1)),e[4]||(e[4]=s("br",null,null,-1)),s("a",{href:`${o.$state.siteProto}://${o.$state.siteDomain}/dapi/redoc`},m(o.$state.siteProto)+"://"+m(o.$state.siteDomain)+"/dapi/redoc ",9,Hs),e[5]||(e[5]=v(" (Cloudflare, Redoc) ",-1))])):h("v-if",!0),e[7]||(e[7]=s("p",{class:"mb-4 text-danger"}," Keep APIKey private — anyone with it can manage your tokens. ",-1)),s("div",Qs,[s("div",Gs,[A(i,{columns:t.columns,rows:t.rows,"pagination-options":o.paginationOptions,onPageChange:l.onPageChange},{"table-row":V(a=>[a.column.field==="api_key"?(r(),n("span",Ws,[v(m(a.row.api_key)+" ",1),s("button",{class:"btn-copy-inline",onClick:P=>l.copyKey(a.row.api_key),title:"Copy"},[...e[6]||(e[6]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"currentColor",viewBox:"0 0 16 16"},[s("path",{d:"M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"}),s("path",{d:"M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"})],-1)])],8,js)])):a.column.field==="actions"?(r(),n("span",Js,[s("button",{class:"btn btn-primary mb-1 me-1 btn-xs",onClick:P=>l.edit(a.row)},"Edit",8,Zs),s("button",{class:"btn btn-danger mb-1 btn-xs",onClick:P=>l.remove(a.row)},"Delete",8,$s)])):(r(),n("span",Xs,m(a.formattedRow[a.column.field]),1))]),_:1},8,["columns","rows","pagination-options","onPageChange"])]),s("button",{class:"btn btn-primary mb-1 btn-xs mt-3",onClick:e[0]||(e[0]=(...a)=>l.create&&l.create(...a)),disabled:t.disabled},"Create an APIKey",8,et)])])):(r(),k(d,{key:0}))])])}const tt=x(Bs,[["render",st],["__file","/app/src/components/inner/APIKey.vue"]]),ot={components:{Tab:O,Profile:ke,Password:Re,Security:ps,Notifications:qs,APIKey:tt},data(){return{tab:location.hash.slice(1)||"profile"}}},rt={class:"pt-8 pt-md-5 pb-8 pb-md-14"},nt={class:"container"},lt={class:"row"},it={class:"col-12"},at={key:0,class:"mb-6 text-muted"},dt={key:1,class:"mb-6 text-muted"},mt={class:"nav nav-tabs"},ut={class:"nav-item"},ct={class:"nav-item"},ft={class:"nav-item"},bt={class:"nav-item"},pt={class:"nav-item"};function ht(o,e,c,w,t,l){const d=_("Profile"),i=_("Password"),a=_("Security"),P=_("Notifications"),U=_("APIKey");return r(),n("section",rt,[s("div",nt,[s("div",lt,[s("div",it,[e[7]||(e[7]=s("h1",{class:"mb-0 fw-bold"},"Settings",-1)),o.$state.context.id?(r(),n("p",at,[e[5]||(e[5]=v(" Please provide your Customer ID ",-1)),s("code",null,'"'+m(o.$state.context.id)+'"',1),e[6]||(e[6]=v(" when requesting support ",-1))])):(r(),n("p",dt," You can change the settings for your account here ")),s("ul",mt,[s("li",ut,[s("a",{class:u(["nav-link",{active:t.tab=="profile"}]),onClick:e[0]||(e[0]=S=>t.tab="profile"),href:"#profile"}," Profile ",2)]),s("li",ct,[s("a",{class:u(["nav-link",{active:t.tab=="password"}]),onClick:e[1]||(e[1]=S=>t.tab="password"),href:"#password"}," Password ",2)]),s("li",ft,[s("a",{class:u(["nav-link",{active:t.tab=="security"}]),onClick:e[2]||(e[2]=S=>t.tab="security"),href:"#security"}," Security ",2)]),s("li",bt,[s("a",{class:u(["nav-link",{active:t.tab=="notifications"}]),onClick:e[3]||(e[3]=S=>t.tab="notifications"),href:"#notifications"}," Notifications ",2)]),s("li",pt,[s("a",{class:u(["nav-link",{active:t.tab=="apikey"}]),onClick:e[4]||(e[4]=S=>t.tab="apikey"),href:"#apikey"}," API Key ",2)])]),t.tab=="profile"?(r(),k(d,{key:2})):h("v-if",!0),t.tab=="password"?(r(),k(i,{key:3})):h("v-if",!0),t.tab=="security"?(r(),k(a,{key:4})):h("v-if",!0),t.tab=="notifications"?(r(),k(P,{key:5})):h("v-if",!0),t.tab=="apikey"?(r(),k(U,{key:6})):h("v-if",!0)])])])])}const Kt=x(ot,[["render",ht],["__file","/app/src/components/inner/Settings.vue"]]);export{Kt as default};
4//# sourceMappingURL=Settings-Dy2w36RE.js.map

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.