UNPKG

pataka-cli

Version:

command line tool for running a pataka instance

118 lines (116 loc) 45.6 kB
(()=>{var t={7510:(t,e,a)=>{"use strict";var s=a(144),i=a(7283),o=a(4667),r=a(1096),n=a(3551),l=function(){var t=this,e=t._self._c;return e(r.Z,[t.displayAppBar?e("AppBar"):t._e(),e(n.Z,[e("router-view")],1),e("div",{staticClass:"version"},[e("span",[t._v("version")]),t._v(" "+t._s(t.version)+" ")])],1)},c=[],u=a(629),p=a(3250),d=function(){var t=this,e=t._self._c;return e("div",[e(p.Z,{attrs:{color:"#303030",flat:""}},[e("router-link",{staticClass:"logo-link",attrs:{to:"/"}},[e("img",{staticClass:"logo",attrs:{src:a(9432)}})])],1)],1)},h=[];const g={name:"AppBar"},m=g;var f=a(1001),v=(0,f.Z)(m,d,h,!1,null,"4be6b7a9",null);const y=v.exports,{version:b}=a(9876),{mapActions:w}=(0,u._p)("analytics"),k=6e4;let _;const Z={name:"App",data(){return{version:b}},methods:{...w(["patakaPing"])},created(){_||(this.patakaPing(),_=setInterval(this.patakaPing,10*k))},computed:{displayAppBar(){return"login"!==this.$route.name}},watch:{"$route.name":{handler(t,e){void 0!==e&&document.body.classList.remove("page--"+e.toLowerCase()),document.body.classList.add("page--"+t.toLowerCase())},immediate:!0}},components:{AppBar:y}},C=Z;var x=(0,f.Z)(C,l,c,!1,null,null,null);const P=x.exports;var I=a(8345),S=a(7179),D=a(4437),A=a(6035),E=a(3296),L=a(5057),B=a(6275),$=a(1302),N=a(5294),T=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wrapper"},[e(A.Z,{staticClass:"px-12",attrs:{fluid:""}},[e(N.Z,{attrs:{justify:"center"}},[e(D.Z,{staticClass:"pt-0",attrs:{cols:"4"}},[t.loading?e(B.Z,{staticClass:"d-flex ma-auto",attrs:{width:3,color:"#0484c4",indeterminate:"",absolute:""}}):e("div",[e(E.Z,{attrs:{value:!0}},[e("Avatar",{staticClass:"pb-4",attrs:{size:"180px",type:"pataka",alt:t.profile.preferredName,image:t.profile.avatarImage,showEdit:""},on:{edit:t.toggleEditDialog}})],1),e("h1",{staticClass:"text-uppercase text-center"},[t._v(t._s(t.profile.preferredName))]),e("p",{staticClass:"grey--text text-center caption overflow-wrap"},[t._v(t._s(t.profile.description))])],1),e(D.Z,{staticClass:"mx-auto mt-8",attrs:{cols:"7"}},[e(N.Z,{staticClass:"py-2",attrs:{justify:"start",align:"center"}},[e("div",{staticClass:"dot mr-4 internet-dot",class:t.network.internetLatency?-1===t.network.internetLatency?"red":"green":"grey"}),e("p",{staticClass:"caption text-uppercase text-center ma-0"},[t._v(" "+t._s(t.network.internetLatency?-1===t.network.internetLatency?"Offline":"Online":"Checking")+" ")]),e("span",{staticClass:"network-latency"},[t._v(t._s(t.latency))])]),e(N.Z,{staticClass:"py-2 network-local",attrs:{justify:"start",align:"center"}},[e("div",{staticClass:"dot mr-4",class:t.network.ipv4?"green":"grey"}),e("p",{staticClass:"caption text-uppercase ma-0"},[t._v(" "+t._s(t.network.ipv4?" Local Network":"Checking")+" ")])]),e(N.Z,{staticClass:"py-2",attrs:{justify:"start",align:"center"}},[e("div",{staticClass:"dot mr-4",class:t.network.portForwarding?"green":null===t.network.internetLatency?"grey":"orange"}),e("p",{staticClass:"caption text-uppercase text-center ma-0"},[t._v(" "+t._s(t.network.portForwarding?"Port-Forwarding":null===t.network.portForwarding?"Checking":"Port-Forwarding Off")+" ")])]),e(N.Z,{staticClass:"mt-8",attrs:{justify:"center"}},[e("h2",{staticStyle:{"text-align":"center"}},[t._v("Disk Usage")]),t._l(t.diskUsage,(function(a){return e($.Z,{key:a.fs,staticClass:"mt-4",attrs:{value:a.use,height:"25",color:"blue-grey"}},[e("strong",{staticClass:"pr-2"},[t._v(t._s(Math.ceil(a.use))+"%")]),e("span",{staticClass:"caption"},[t._v(t._s(a.fs))])])}))],2),t.cloudHost?e(N.Z,{attrs:{align:"center"}},[e(S.Z,{staticClass:"mt-6",attrs:{width:"100%",color:"red",outlined:""},on:{click:t.logout}},[t._v(" logout ")])],1):t._e()],1)],1),e(D.Z,{attrs:{cols:"8"}},[e(N.Z,[e(D.Z,{attrs:{cols:"12"}},[t.generatingCode?e(B.Z,{attrs:{indeterminate:"",color:"#0484c4",width:"2"}}):e(S.Z,{attrs:{color:"#53cb62",outlined:"",disabled:null===t.network.portForwarding},on:{click:function(e){return t.toggleDialog()}}},[t._v(" "+t._s(t.network.ipv4?"Generate join code":"Loading network data")+" ")])],1),t.generateError?e(D.Z,[e("p",{staticClass:"red--text caption mb-0"},[t._v(t._s(t.generateError))])]):t.generatedInvite?e(D.Z,{staticClass:"generated-code pl-6",attrs:{cols:"12"}},[e(N.Z,[e("p",{staticClass:"overline pt-2"},[t._v("Pātaka code:")])]),e(N.Z,[e("p",{staticClass:"pa-2",attrs:{id:"invite-code"}},[t._v(t._s(t.generatedInvite))])]),e(N.Z,[t.cloudHost?t._e():e(S.Z,{staticClass:"text-uppercase",attrs:{color:"#0484c4",outlined:"",justify:"end"},on:{click:t.copyCode}},["Copy"===t.copyText?e(L.Z,{attrs:{small:"",left:""}},[t._v("mdi-content-copy")]):e(L.Z,{attrs:{small:"",left:""}},[t._v("mdi-check")]),t._v(" "+t._s(t.copyText)+" ")],1),e(S.Z,{staticClass:"ml-6",attrs:{color:"#cb53a5",outlined:""},on:{click:function(e){return t.toggleInviteDialog()}}},[t._v(" send invite ")])],1)],1):t._e()],1),e(N.Z,{staticClass:"stat-column"},[e(D.Z,{attrs:{cols:"6"}},[e("Meter",{attrs:{title:"CPU",values:t.cpuLoad}})],1),e(D.Z,{attrs:{cols:"6"}},[e("Meter",{attrs:{title:"RAM",values:t.memoryLoad}})],1)],1),e(N.Z,{staticClass:"pt-6"},[e(D.Z,{staticClass:"stat-column",attrs:{cols:"6"}},[e("h2",{staticClass:"h2 text-uppercase pb-8"},[t._v("People")]),t.connectedPeople&&0!==t.connectedPeople.length?e(N.Z,{staticClass:"pb-2"},[e("div",[e("AvatarGroup",{attrs:{profiles:t.connectedPeople,size:"60px",showLabel:""}})],1)]):e("p",{staticClass:"caption"},[t._v("There is no one connected to your network")])],1),e(D.Z,{staticClass:"stat-column pl-6",attrs:{cols:"6"}},[e("h2",{staticClass:"h2 text-uppercase pb-8"},[t._v("Tribes")]),0===t.tribes.length?e("p",{staticClass:"caption"},[t._v("There are no tribes on your network")]):t._e(),e(N.Z,{staticClass:"pb-2"},[t.tribes&&t.tribes.length>0?e("div",[e("AvatarGroup",{attrs:{profiles:t.tribes,size:"60px",showLabel:""}})],1):t._e()])],1)],1)],1)],1)],1),t.dialog?e("GenerateInviteDialog",{attrs:{show:t.dialog,publicIpv4:t.network.publicIpv4,portForwarding:t.network.portForwarding,checkPortForwarding:t.checkPortForwarding,checkingPort:t.checkingPort,title:"Generate Invite Code",errorMsg:t.errorMsg,cloudHost:t.cloudHost},on:{close:t.toggleDialog,generate:function(e){return t.generateInviteCode(e)}}}):t._e(),t.editNodeDialog?e("NewNodeDialog",{attrs:{show:t.editNodeDialog,title:"Āhau Pātaka",profile:t.profile},on:{close:t.toggleEditDialog,save:function(e){return t.save(e)}}}):t._e(),t.inviteDialog?e("SendInviteDialog",{attrs:{show:t.inviteDialog,title:"Send Pātaka Invite Code",errorMsg:t.errorMsg,uses:t.uses,code:t.generatedInvite,name:t.profile.preferredName},on:{close:t.toggleInviteDialog,codeSent:function(e){return t.showSnackbar("Code successfully sent")}}}):t._e(),t.snackbar?e("Snackbar",{attrs:{show:t.snackbar,message:t.snackbarMsg},on:{clearSnackbar:t.clearSnackbar}}):t._e()],1)},F=[],O=(a(560),a(8819)),M=a(2469),j=a(8236),q=function(){var t=this,e=t._self._c;return e("div",[e(D.Z,[e(N.Z,{attrs:{justify:"center"}},[e(E.Z,{scopedSlots:t._u([{key:"default",fn:function({hover:a}){return[e(O.Z,{staticClass:"avatar-container",class:{isEditing:t.isEditing,online:!t.offline},attrs:{size:t.size,tile:t.tile,dark:t.dark}},[t.image&&t.image.uri?e(M.Z,{attrs:{src:t.hackURL(t.image.uri),alt:t.alt}}):e(M.Z,{staticClass:"no-pic",style:t.customStyle,attrs:{src:t.getImage}}),e(j.Z,{attrs:{absolute:"",opacity:"0.5",value:a}},[t.showLabel?e("p",{staticClass:"text-center pt-2",staticStyle:{"font-size":"12px"}},[t._v(t._s(t.alt))]):t.showEdit?e(L.Z,{on:{click:function(e){return t.$emit("edit")}}},[t._v(" mdi-pencil ")]):t._e()],1)],1)]}}])})],1)],1)],1)},U=[];const z=a.p+"img/tane.b97713f0.svg",H=a.p+"img/wahine.6307c174.svg",V=a.p+"img/diverse.b5a2eb18.svg",R=a.p+"img/whakapapa.27a898a4.svg",G={defaultImage:X};function X(t,e){switch(t){case"person":switch(e){case"male":return z;case"female":return H;case"other":case"unknown":default:return V}case"pataka":case"whakapapa":default:return R}}const W={name:"Avatar",props:{showOnHover:Boolean,image:Object,alt:String,gender:String,type:{type:String,default:"person"},size:{type:String,default:"25vh"},showLabel:{type:Boolean,default:!1},showEdit:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},isEditing:{type:Boolean,default:!1},offline:{type:Boolean,default:!0},dark:Boolean,tile:Boolean},data:function(){return{hovered:!1}},computed:{getImage(){return G.defaultImage(this.type,this.gender||null)},customStyle(){return{opacity:this.offline?.5:1}}},components:{},methods:{hackURL(t){const e=new URL(t);return e.hostname=window.location.hostname||"localhost",e.href},updateAvatar(t){this.$emit("updateAvatar",t)}}},K=W;var J=(0,f.Z)(K,q,U,!1,null,"0b01464e",null);const Q=J.exports;var Y=function(){var t=this,e=t._self._c;return e(D.Z,{staticClass:"pt-0 pb-0"},[t.groupTitle?e(N.Z,[e(D.Z,{staticClass:"pt-1 pb-0"},[e("small",{staticClass:"label overline"},[t._v(" "+t._s(t.groupTitle)+" ")])])],1):t._e(),e(N.Z,{class:t.customClass},[t._l(t.profiles,(function(a,s){return e("div",{key:`${t.groupTitle}-${s}`,class:t.spacing,attrs:{width:"100%"}},[e("div",{staticClass:"pt-2",attrs:{justify:"center"}},[e("Avatar",{attrs:{size:t.size,isEditing:!1,type:a.type,image:a.avatarImage,alt:a.preferredName,gender:a.gender,showLabel:t.showLabels,clickable:t.clickable,deletable:t.deletable,dark:t.dark,row:t.row,tile:t.tile,offline:void 0===a.isOnline||!a.isOnline},on:{click:function(e){return t.profileClick(a)},delete:function(e){return t.$emit("delete",s)}}})],1)])})),t._t("action")],2)],1)},tt=[];const et={name:"AvatarGroup",components:{Avatar:Q},props:{profiles:{type:Array,default:null},groupTitle:{type:String,default:null},showLabels:{type:Boolean,default:!0},size:{type:String,default:"80px"},customClass:{type:String,default:"d-flex justify-start align-center pa-2 pl-4"},spacing:{type:String,default:"pr-5"},deletable:Boolean,tile:Boolean,clickable:{type:Boolean,default:!0},dark:Boolean,row:Boolean},computed:{columns(){return this.profiles.length}},methods:{profileClick(t){this.$emit("profile-click",t)}}},at=et;var st=(0,f.Z)(at,Y,tt,!1,null,"87d9808e",null);const it=st.exports;var ot=a(7738),rt=a(5251),nt=function(){var t=this,e=t._self._c;return e("Dialog",{attrs:{show:t.show,title:t.title,width:"720px",goBack:t.close,enableMenu:""},on:{close:t.close},scopedSlots:t._u([{key:"content",fn:function(){return[e(D.Z,{staticStyle:{color:"black"}},[e(N.Z,[e(D.Z,{attrs:{cols:"6"}},[e(rt.Z,{attrs:{"error-messages":t.errorMsg,label:"This machines public IP",outlined:""},model:{value:t.ip,callback:function(e){t.ip=e},expression:"ip"}})],1),e(D.Z,{staticClass:"mt-4"},[e(N.Z,{staticClass:"py-2",attrs:{justify:"start",align:"center"}},[e("div",{staticClass:"dot mr-4",class:t.portForwarding?"green":"orange"}),e("p",{staticClass:"caption text-uppercase text-center ma-0"},[t._v(" "+t._s(t.portForwarding?"Port-Forwarding":null===t.portForwarding?"Checking":"Port-Forwarding Off")+" ")])])],1)],1),t.portForwarding?t._e():e("div",[e("p",[t._v("Our portfordward checks indicate that you have not setup portforwarding.")]),e("p",[t._v(" In order for others to connect to this Pātaka over the Internet you'll need to enable "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/Port_forwarding",target:"_blank"}},[t._v("Port-Forwarding")]),t._v(" on your router. ")]),e("p",[t._v("Depending on your router, our portfordwarding checks maybe by inaccurate. If you believe you have correctly setup port forwarding then we recommend that you test generating a code using your internet connection")]),e("p",[t._v("Alternatively you can also connect locally without the internet via wifi. If you want to do this then please select use local network")])]),e(N.Z,[e(D.Z,[e("p",{staticClass:"overline"},[t._v("Select number of uses")]),e(ot.Z,{staticStyle:{"max-width":"300px"},attrs:{items:["single use","100 uses","1,000 uses","100,000 uses"],outlined:"",placeholder:"single use","persistent-placeholder":"",autofocus:""},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1),e(D.Z,[e("p",{staticClass:"overline"},[t._v("Select connection")]),e(ot.Z,{staticStyle:{"max-width":"300px"},attrs:{items:t.portForwarding?["Connect globally over internet"]:["Connect globally over internet","Connect locally over wifi"],outlined:"",placeholder:t.portForwarding?"connect globally over internet":"connect locally over wifi","persistent-placeholder":"",autofocus:""},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}})],1)],1)],1)]},proxy:!0},{key:"actions",fn:function(){return[e("div",[e(S.Z,{staticClass:"primary--text my-2",attrs:{text:"",large:""},on:{click:function(e){return t.submit()}}},[t._v("Generate code")])],1)]},proxy:!0}])})},lt=[],ct=a(9781),ut=a(5223),pt=a(2570),dt=a(4192),ht=a(5234),gt=function(){var t=this,e=t._self._c;return e(pt.Z,{attrs:{"max-width":t.width,light:!t.dark,fullscreen:t.mobile,transition:t.mobile?"dialog-bottom-transition":"scale-transition"},on:{input:t.close},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(ct.Z,[e(p.Z,{attrs:{color:"#292929",dark:!t.dark,src:t.banner,flat:"",dense:"",height:"60px","max-height":"60px"},scopedSlots:t._u([{key:"img",fn:function({props:a}){return[e(M.Z,t._b({staticStyle:{opacity:"40%",left:"100px"}},"v-img",a,!1))]}}])},[t.mobile?e(S.Z,{attrs:{icon:""},on:{click:t.closeDialog}},[e(L.Z,[t._v("mdi-arrow-left")])],1):t._e(),t.mobile?e(ht.Z,{staticStyle:{"min-width":"10%"}}):t._e(),e("div",{staticClass:"dialog-title text-uppercase",style:t.mobile?"text-align:end":""},[e("span",{staticStyle:{color:"#BA041B"}},[t._v(t._s(t.splitTitle.maori))]),e("span",[t._v(t._s(t.splitTitle.english))])]),t.mobile?t._e():e(ht.Z),t.mobile?t._e():e(S.Z,{attrs:{icon:""},on:{click:t.closeDialog}},[e(L.Z,[t._v("mdi-close")])],1)],1),e(ut.ZB,{staticClass:"pa-3",style:t.mobile?"overflow-x: hidden;":"max-height: 650px; overflow-x: hidden;"},[t._t("content")],2),e(dt.Z),t.hideActions?t._e():e(ut.h7,{staticClass:"pa-0"},[e(A.Z,{staticClass:"py-0"},[e(N.Z,{staticClass:"ma-0",attrs:{align:"end"}},[t.$slots["before-actions"]?e(D.Z,{staticClass:"py-0",attrs:{cols:"12",md:"auto",align:t.mobile?"center":"start"}},[t._t("before-actions")],2):t._e(),t.mobile?t._e():e(ht.Z),t._t("actions",(function(){return[e(D.Z,{attrs:{cols:"6",md:"auto",align:"center"}},[e(S.Z,{staticClass:"secondary--text",attrs:{text:"",large:!t.mobile},on:{click:t.close}},[t._v(" Cancel ")])],1),e(D.Z,{attrs:{cols:"6",md:"auto",align:"center"}},[e(S.Z,{attrs:{large:!t.mobile,text:"",color:"blue"},on:{click:t.submit}},[t._v(" Save ")])],1)]}))],2)],1)],1)],1)],1)},mt=[];const ft=a.p+"img/bg-tohu.8ab98236.png",vt={name:"Dialog",props:{show:{type:Boolean,required:!1},isEditing:{type:Boolean,required:!1},width:{type:String,required:!1,default:"1000px"},height:{type:String,default:"calc(100vh)"},background:{type:String,default:""},goBack:Function,enableMenu:Boolean,enableBar:{type:Boolean,default:!0},title:String,dark:Boolean,hideActions:Boolean},data(){return{showDialog:this.show,listener:null,banner:ft,isSubmitting:!1}},computed:{mobile(){return this.$vuetify.breakpoint.xs||this.$vuetify.breakpoint.sm},style(){return{position:"fixed",backgroundColor:"#292929",maxWidth:this.width}},splitTitle(){let t={};const e=this.title,a="----";if(-1!==e.indexOf(a)){const a="-",s=2,i=e.split(a).slice(0,s+1).join(a),o=e.split(a).slice(s).join(a);return t={maori:i,english:o},t}return t={maori:"",english:e},t}},methods:{submit(){this.isSubmitting||(this.isSubmitting=!0,this.$emit("submit"))},closeDialog(){this.isSubmitting=!1,this.showDialog=!1,this.close()},close(){this.isSubmitting=!1,this.$emit("close")}},mounted(){this.listener=document.addEventListener("keydown",(t=>{27===t.keyCode&&this.close()})),document.body.style.top=`-${window.scrollY}px`,document.body.style.minWidth="100%",document.body.style.position="fixed"},destroyed(){document.removeEventListener("keydown",this.listener);const t=document.body.style.top;document.body.style.position="",document.body.style.top="",window.scrollTo(0,-1*parseInt(t||"0"))}},yt=vt;var bt=(0,f.Z)(yt,gt,mt,!1,null,null,null);const wt=bt.exports,kt={name:"GenerateInviteDialog",components:{Dialog:wt},props:{show:{type:Boolean,required:!0},title:{type:String},publicIpv4:{type:String,default:"xxx.xxx.xx.xx"},portForwarding:{type:Boolean,default:!0},checkPortForwarding:{type:Function},checkingPort:{type:Boolean,default:!1},errorMsg:{type:String},cloudHost:{type:Boolean}},data(){return{type:"",value:"",externalIp:null}},computed:{ip:{get:function(){return this.externalIp||this.publicIpv4},set:function(t){this.externalIp=t}},uses(){switch(this.value){case"single use":return 1;case"100 uses":return 100;case"1,000 uses":return 1e3;case"100,000 uses":return 1e5;default:return 1}}},methods:{submit(){let t;t=this.cloudHost?window.location.hostname:"Connect locally over wifi"===this.type?null:this.externalIp||this.publicIpv4,this.$emit("generate",{ip:t,uses:this.uses}),this.close()},close(){this.$emit("close")}}},_t=kt;var Zt=(0,f.Z)(_t,nt,lt,!1,null,"e567785e",null);const Ct=Zt.exports;var xt=a(4944),Pt=function(){var t=this,e=t._self._c;return e("Dialog",{attrs:{show:t.show,title:t.title,width:"45vw",goBack:t.close,enableMenu:"",hideActions:""},on:{close:t.close},scopedSlots:t._u([{key:"content",fn:function(){return[e(N.Z,{staticClass:"mx-2"},[e(D.Z,{attrs:{cols:"12"}},[e(N.Z,[e(D.Z,{staticClass:"mt-4",attrs:{cols:"12"}},[t.uses>1?e("p",[t._v("Enter email addresses")]):e("p",[t._v("Enter email address")]),e(rt.Z,{ref:"input",attrs:{messages:t.messages},on:{keyup:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:t.add.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.removeLast.apply(null,arguments)}],focus:function(e){t.inputActive=!0},blur:function(e){t.inputActive=!1}},scopedSlots:t._u([{key:"prepend-inner",fn:function(){return t._l(t.invitees,(function(a,s){return e("div",{key:s},[e(xt.Z,{staticClass:"ma-1",attrs:{close:""},on:{"click:close":function(e){return t.remove(a)}}},[t._v(" "+t._s(a)+" ")])],1)}))},proxy:!0}]),model:{value:t.input,callback:function(e){t.input=e},expression:"input"}})],1)],1)],1)],1),e(N.Z,{staticClass:"mx-2"},[e(D.Z,{staticClass:"py-0",staticStyle:{"margin-bottom":"20px"},attrs:{align:"left"}},[t.sending?e(B.Z,{attrs:{width:"2",indeterminate:"",color:"#0484c4"}}):e(S.Z,{staticClass:"white--text",attrs:{color:"black"},on:{click:function(e){return t.send()}}},[e(L.Z,{attrs:{small:""}},[t._v("mdi-send")]),t._v(" "),e("span",{staticClass:"pl-2"},[t._v(" send")])],1),t.errorMsg?e("p",{staticClass:"red--text"},[t._v(t._s(t.errorMsg))]):t._e()],1)],1)]},proxy:!0}])})},It=[];const St={name:"SendInviteDialog",components:{Dialog:wt},props:{show:{type:Boolean,required:!0},title:String,code:String,uses:Number,name:String},data(){return{invitees:[],input:"",inputActive:!1,canPop:!1,count:0,errorMsg:null,sending:!1}},computed:{messages(){return 1===this.uses?"Code limited to a single use":""}},methods:{add(){this.input.length&&((this.uses>1||!this.invitees.length)&&this.invitees.push(this.input),this.input="",this.count=0),setTimeout((()=>this.$refs.input.focus()),100)},send(){this.sending=!0;const t={emails:this.invitees.length?this.invitees:this.input,code:this.code,name:this.name},e=new FormData;e.append("json",JSON.stringify(t)),fetch("https://ahau.io/sendInvite",{method:"post",body:e}).then((t=>{200===t.status?(this.sending=!1,this.$emit("codeSent"),this.close()):(this.sending=!1,this.errorMsg="Error sending code. Please send manually")})),this.$emit("codeSent"),this.close()},close(){this.errorMsg=null,this.$emit("close")},remove(t){this.invitees.splice(this.invitees.indexOf(t),1)},removeLast(){this.$refs.input.focus&&!this.input.length&&this.invitees.length&&(this.count++,this.count>1&&this.invitees.pop(),setTimeout((()=>this.$refs.input.focus()),100))}}},Dt=St;var At=(0,f.Z)(Dt,Pt,It,!1,null,"70038857",null);const Et=At.exports;var Lt=a(1692),Bt=function(){var t=this,e=t._self._c;return e(Lt.Z,{attrs:{timeout:"2000",outlined:"",color:"success"},scopedSlots:t._u([{key:"action",fn:function({attrs:a}){return[e(S.Z,t._b({attrs:{color:"success",text:""},on:{click:function(e){t.snackbar=!1}}},"v-btn",a,!1),[e("b",[t._v("Close")])])]}}]),model:{value:t.showSnackbar,callback:function(e){t.showSnackbar=e},expression:"showSnackbar"}},[t._v(" "+t._s(t.message)+" ")])},$t=[];const Nt={name:"snackbar",props:{show:Boolean,message:String},computed:{showSnackbar:{get(){return this.show},set(t){!1===t&&this.$emit("clearSnackbar")}}}},Tt=Nt;var Ft=(0,f.Z)(Tt,Bt,$t,!1,null,null,null);const Ot=Ft.exports;var Mt=a(9868),jt=a(3625),qt=function(){var t=this,e=t._self._c;return e(ct.Z,{staticClass:"mt-4",attrs:{"max-width":"400"}},[e(Mt.Z,{staticClass:"v-sheet--offset mx-auto",attrs:{color:"primary",tile:""}},[e(ut.ZB,[e(N.Z,{staticClass:"mt-0 ml-0",attrs:{align:"end"}},[e("h2",[t._v(t._s(t.title))]),t._v(" "),e("span",{staticClass:"pl-4 caption"},[t._v("usage in last hour")])])],1),e(jt.Z,{attrs:{labels:t.labels,value:t.values,gradient:["red","#0484c4","#53cb62"],"line-width":"1",padding:"16"}})],1)],1)},Ut=[];const zt={name:"Meter",props:{title:String,labels:Array,values:Array}},Ht=zt;var Vt=(0,f.Z)(Ht,qt,Ut,!1,null,"60b500b3",null);const Rt=Vt.exports;var Gt=function(){var t=this,e=t._self._c;return e("Dialog",{attrs:{show:t.show,title:t.title,width:"720px",goBack:t.close,enableMenu:""},on:{close:t.close},scopedSlots:t._u([{key:"content",fn:function(){return[e(D.Z,{staticClass:"py-0"},[e("ProfileForm",{attrs:{profile:t.formData,mobile:t.mobile},on:{"update:profile":function(e){t.formData=e}}})],1)]},proxy:!0},{key:"actions",fn:function(){return[e(S.Z,{staticClass:"secondary--text",attrs:{text:"",large:"",fab:""},on:{click:t.close}},[e("span",{attrs:{color:"secondary"}},[t._v("cancel")])]),e(S.Z,{staticClass:"blue--text ml-5",attrs:{text:"",large:"",fab:""},on:{click:t.submit}},[e("span",[t._v("save")])])]},proxy:!0}])})},Xt=[],Wt=a(6904),Kt=a(5617),Jt=function(){var t=this,e=t._self._c;return e(Wt.Z,{ref:"form",staticClass:"px-4 pt-4",attrs:{light:""}},[e(N.Z,[e(D.Z,{staticClass:"pt-6",attrs:{order:t.mobile?"":"2"}},[e(N.Z,{staticClass:"justify-center pt-3"},[e("Avatar",{staticClass:"big-avatar",attrs:{size:"200px",type:"pataka",image:t.formData.avatarImage,alt:t.formData.preferredName,isView:!1},on:{updateAvatar:function(e){t.formData.avatarImage=e}}})],1),e(N.Z,[e(D.Z,{staticClass:"pa-0",attrs:{cols:"12",justify:"center",align:"center"}},[e("ImagePicker",{attrs:{avatarLoaded:t.formData.avatarImage},on:{updateAvatar:function(e){t.formData.avatarImage=e}}})],1)],1)],1),e(D.Z,{staticClass:"pt-2",attrs:{cols:"12",sm:t.mobile?"12":"6"}},[e(N.Z,[e(D.Z,{staticClass:"pa-1",attrs:{cols:"12"}},[e(rt.Z,{attrs:{label:"Pātaka name",outlined:"",rules:t.nameRules,required:""},model:{value:t.formData.preferredName,callback:function(e){t.$set(t.formData,"preferredName",e)},expression:"formData.preferredName"}})],1)],1),e(N.Z,[e(D.Z,{staticClass:"pa-1",attrs:{cols:"12"}},[e(Kt.Z,{attrs:{label:"Description","no-resize":"",rows:"5","auto-grow":"",outlined:""},model:{value:t.formData.description,callback:function(e){t.$set(t.formData,"description",e)},expression:"formData.description"}})],1)],1)],1)],1)],1)},Qt=[],Yt=function(){var t=this,e=t._self._c;return e("div",[e("clipper-upload",{attrs:{accept:"image/*"},on:{input:t.toggleAvatar}},[e(N.Z,{staticClass:"upload-pic-row"},[e(L.Z,{staticClass:"grey--text pr-2 pt-1"},[t._v("mdi-camera")]),e("p",{staticClass:"toggle"},[t._v(" "+t._s(t.label||"Upload Photo")+" ")])],1)],1),t.avatar.showEditor?e("AvatarEditDialog",{attrs:{show:t.avatar.showEditor,avatarImage:t.avatar.new,isView:t.isView,type:t.type},on:{submit:function(e){return t.updateAvatar(e)},close:function(e){return t.toggleAvatar(null)}}}):t._e()],1)},te=[],ee=function(){var t=this,e=t._self._c;return e("Dialog",{attrs:{title:"Crop Photo",show:t.show,width:"750px",goBack:t.close,enableMenu:"",dark:""},on:{submit:t.submit,close:t.close},scopedSlots:t._u([{key:"content",fn:function(){return[e(N.Z,{attrs:{justify:"center"}},[e(D.Z,{staticStyle:{"max-width":"300px"}},[e("clipper-fixed",{ref:"avatar",attrs:{grid:!1,src:t.avatarImage,area:100,round:!t.tile,"bg-color":"rgba(0, 0, 0, 0)",shadow:"rgba(0,0,0,0.5)",rotate:t.rotation}})],1)],1),e("div",{staticClass:"px-8 py-4"},[e("h6",{staticClass:"caption pt-8 white--text"},[e(L.Z,{attrs:{dark:""}},[t._v("mdi-gesture-tap")]),t._v(" Adjust the image by zooming, scaling and moving it around before saving. ")],1),e("h5",{staticClass:"pt-8 white--text"},[t._v("rotate")]),e("clipper-range",{staticStyle:{"max-width":"300px"},attrs:{min:0,max:360},model:{value:t.rotation,callback:function(e){t.rotation=e},expression:"rotation"}})],1)]},proxy:!0}])})},ae=[];function se(t){return new window.File([t],"avatar",{type:t.type})}const ie=i.ZP` mutation uploadFile($file: Upload!, $size: Int!, $encrypt: Boolean) { uploadFile(file: $file, size: $size, encrypt: $encrypt) { type blobId mimeType uri size ...on BlobScuttlebutt { unbox } ...on BlobHyper { driveAddress readKey } } } `;function oe(t){return{mutation:ie,variables:{file:t.file,size:t.file.size,encrypt:t.encrypt}}}const re="$2a$10$EHZEoQfUA3XmnhwVfhdcSuV3BZvQwMo4/YUuMdXeX3lbiIbP5BHMy",ne=1048576,le=5*ne,ce={name:"AvatarEditDialog",components:{Dialog:wt},props:{show:{type:Boolean,default:!1},avatarImage:String,tile:Boolean},data(){return{rotation:0}},methods:{close(){this.$emit("close")},async submit(){try{const t=this.$refs.avatar.clip({maxWPixel:"header"===this.type?1920:800});t.toBlob((async t=>{const e=se(t);if(e.size>=5242880)throw console.error("this avatar image is bigger than 5MB, we cannot allow this through, otherwise it will end up a hyperblob, which AvatarImage does not currently support"),new Error("avatar image must me < 5MB");const a=await this.uploadFile({file:e,encrypt:!0});null===a.mimeType&&(a.mimeType=e.type),"Hello World"===a.mimeType&&(a.mimeType=e.type),a.blobId&&(a.blob=a.blobId),delete a.blobId;const s={};Object.entries(a).forEach((([t,e])=>{"__typename"!==t&&"type"!==t&&(s[t]=e)})),this.$emit("submit",s)}))}catch(t){console.error("Error editing avatar",t)}},async uploadFile(t){try{if(t.file&&t.file.size>le)throw new Error("Please check the file size is less than 5MB");const e=await this.$apollo.mutate(oe(t));if(e.errors)throw e.errors;return e.data.uploadFile}catch(e){return console.error("Something went wrong while trying to upload a file",e),null}}}},ue=ce;var pe=(0,f.Z)(ue,ee,ae,!1,null,null,null);const de=pe.exports,he={name:"ImagePicker",components:{AvatarEditDialog:de},props:{label:{type:String},isView:{type:Boolean,default:!1},type:String},data(){return{avatar:{new:null,showEditor:!1}}},methods:{toggleAvatar(t){this.avatar.new=this.avatar.new?null:t,this.avatar.showEditor=!this.avatar.showEditor},updateAvatar(t){this.$emit("updateAvatar",t),this.toggleAvatar(null)}}},ge=he;var me=(0,f.Z)(ge,Yt,te,!1,null,"416cf575",null);const fe=me.exports,ve={name:"ProfileForm",components:{Avatar:Q,ImagePicker:fe},props:{profile:{type:Object,required:!0},mobile:{type:Boolean,default:!1}},data(){return{formData:{},form:{valid:!0,showDescription:!1},nameRules:[t=>!!t||"Pataka name required"]}},watch:{profile:{deep:!0,immediate:!0,handler(t){this.formData=t}}}},ye=ve;var be=(0,f.Z)(ye,Jt,Qt,!1,null,"1ad8a51e",null);const we=be.exports;var ke=a(9245),_e=a.n(ke),Ze=a(2307),Ce=a.n(Ze),xe=a(841),Pe=a.n(xe);const Ie={name:"NewNodeDialog",components:{Dialog:wt,ProfileForm:we},props:{show:{type:Boolean,required:!0},title:{type:String,default:"Create a new Pātaka"},profile:{type:Object,default:()=>({})}},data(){return{formData:{}}},watch:{profile:{deep:!0,immediate:!0,handler(t){this.formData=Pe()(t)}}},computed:{mobile(){return this.$vuetify.breakpoint.xs},submission(){const t={};return Object.entries(this.formData).forEach((([e,a])=>{_e()(this.formData[e])||(t[e]=a)})),t}},methods:{getProfileChanges(){const t={};return Object.entries(this.submission).forEach((([e,a])=>{Ce()(this.submission[e],this.profile[e])||(t[e]=a)})),t},submit(){if(this.submission&&!this.submission.preferredName)return;const t=this.getProfileChanges(this.submission);this.$emit("save",t),this.close()},close(){this.resetFormData(),this.$emit("close")},resetFormData(){this.formData={}}}},Se=Ie;var De=(0,f.Z)(Se,Gt,Xt,!1,null,"5450636a",null);const Ae=De.exports;var Ee=a(5030),Le=a.n(Ee);const Be=1e3,$e={name:"Dashboard",data:()=>({dialog:!1,ipSet:!1,copyText:"Copy",generatedInvite:null,generateError:!1,errorMsg:null,checkingPort:null,invitedPeople:[],tribes:[],profile:{feedId:"",preferredName:"",description:"",avatarImage:null},portForwarding:null,network:{internetLatency:null,ipv4:null,ipv6:null,publicIpv4:null},diskUsage:[],cpuLoad:[0,0],memoryLoad:[0,0],loading:!1,editNodeDialog:!1,inviteDialog:null,uses:null,generatingCode:!1,snackbar:!1,snackbarMsg:""}),mounted(){this.loading=!0,this.getCurrentIdentity()},computed:{latency(){return this.network.internetLatency&&-1!==this.network.internetLatency?`${this.network.internetLatency} ms`:"Unknown"},cloudHost(){return"file://"!==window.location.origin&&"localhost"!==window.location.hostname},connectedPeople(){return this.invitedPeople.filter((t=>"pataka"!==t.type))}},apollo:{network:{query:i.ZP`query { network { ipv4 internetLatency publicIpv4 portForwarding } }`,pollInterval:10*Be},portForwarding:{query:i.ZP`query { network { portForwarding } }`,update(t){return t.network.portForwarding}},cpuLoad:{query:i.ZP`query { cpuLoad }`,pollInterval:10*Be,update(t){return this.cpuLoad.length>=360||0===this.cpuLoad[this.cpuLoad.length-1]?this.cpuLoad.pop():0===this.cpuLoad[0]&&this.cpuLoad.shift(),[...this.cpuLoad,t.cpuLoad]}},memoryLoad:{query:i.ZP`query { memoryLoad }`,pollInterval:10*Be,update(t){return this.memoryLoad.length>=360?this.memoryLoad.pop():0===this.memoryLoad[0]&&this.memoryLoad.shift(),[...this.memoryLoad,t.memoryLoad]}},diskUsage:{query:i.ZP`query { diskUsage { use fs } }`,pollInterval:10*Be},invitedPeople:{query:i.ZP`query { invitedPeople { type id preferredName avatarImage { uri } ...on Person { gender } } connectedPeers { person { id } } }`,pollInterval:5*Be,update(t){return t.invitedPeople.map((e=>({...e,isOnline:t.connectedPeers.person.some((t=>t.id===e.id))})))}},tribes:{query:i.ZP`query { tribes { public { preferredName avatarImage { uri } } } }`,update(t){return t.tribes.filter((t=>t.public&&t.public[0])).map((t=>t.public[0]))},pollInterval:10*Be}},methods:{async getCurrentIdentity(){const t=await this.$apollo.query({query:i.ZP` { whoami { public { profile { id preferredName description avatarImage { uri } } } } } `,fetchPolicy:"no-cache"});if(t.errors)throw this.loading=!1,t.errors;if(this.loading=!1,!t.data.whoami.public.profile||!t.data.whoami.public.profile.preferredName)return this.$router.push({name:"login"});this.profile={...t.data.whoami.public.profile,feedId:t.data.whoami.public.feedId}},showSnackbar(t){this.snackbarMsg=t,this.snackbar=!0},clearSnackbar(){this.snackbarMsg="",this.snackbar=!1},logout(){this.$router.push("/")},toggleDialog(){this.generatedInvite&&(this.generatedInvite=null),this.dialog=!this.dialog},toggleEditDialog(){this.editNodeDialog=!this.editNodeDialog},toggleInviteDialog(){this.inviteDialog=!this.inviteDialog},async generateInviteCode({ip:t,uses:e}){this.generatingCode=!0,this.uses=e;const a={uses:e};t&&(a.external=t);try{const t=await this.$apollo.mutate({mutation:i.ZP` mutation ($input: createInviteInput) { createInvite(input: $input) } `,variables:{input:{...a}}});this.generateError=!1,this.dialog=!1,this.generatedInvite=t.data.createInvite,this.copyText="Copy",this.generatingCode=!1}catch(s){throw console.error(s),this.generatingCode=!1,this.generateError="something went wrong while trying to generate an invite code",s}},async tryInvite(){this.portForwarding&&await this.generateInviteCode(this.network.publicIpv4)},async checkPortForwarding(){this.checkingPort=!0,this.errorMsg=null;const t=await this.$apollo.query({query:i.ZP`query { network { portForwarding } }`}),e=t.data.network.portForwarding;this.portForwarding=e,e?(await this.tryInvite(),this.errorMsg=null):this.errorMsg="Port not open",this.checkingPort=!1},async copyCode(){navigator.clipboard.writeText(this.generatedInvite).then((()=>{this.copyText="Copied"})).catch((t=>{console.error("Could not copy text: ",t)}))},async save(t){this.loading=!0;const e=Le()(t,"preferredName","description","avatarImage");e.avatarImage&&delete e.avatarImage.uri;const a=await this.$apollo.mutate({mutation:i.ZP` mutation($input: PatakaProfileInput!) { savePataka(input: $input) } `,variables:{input:{id:this.profile.id,...e}}});a.errors?console.error("failed to update profile",a):this.getCurrentIdentity()}},components:{Avatar:Q,AvatarGroup:it,Meter:Rt,GenerateInviteDialog:Ct,NewNodeDialog:Ae,SendInviteDialog:Et,Snackbar:Ot}},Ne=$e;var Te=(0,f.Z)(Ne,T,F,!1,null,null,null);const Fe=Te.exports;var Oe=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container"},[t.isLoading?e("div",{staticClass:"splash"},[e("img",{attrs:{src:a(9432)}}),e("h1",[t._v("Āhau Pātaka")])]):t._e(),t.isLoading||t.isSetup?!t.isLoading&&t.isSetup&&t.cloudHost?e("div",{staticClass:"welcome-text",staticStyle:{"justify-items":"center",display:"grid"}},[e(N.Z,{staticClass:"pb-12"},[e("p",{staticClass:"mb-0 headliner2",staticStyle:{color:"darkgrey"}},[t._v("enter password")])]),e(N.Z,{staticClass:"mt-10"},[e(D.Z,{attrs:{cols:"12"}},[e(rt.Z,{staticStyle:{"background-color":"#303030",width:"300px"},attrs:{label:"Password",outlined:"",width:"150px",type:"password","error-messages":t.passwordRules},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.checkPassword.apply(null,arguments)}},model:{value:t.passwordInput,callback:function(e){t.passwordInput=e},expression:"passwordInput"}})],1)],1),e(N.Z,[e(S.Z,{staticStyle:{"border-color":"#b12526","background-color":"#303030"},attrs:{text:"",color:"#b12526",outlined:""},on:{click:function(e){return e.preventDefault(),t.checkPassword.apply(null,arguments)}}},[e("p",{staticClass:"login-text mb-0"},[t._v("submit")])])],1)],1):t._e():e("div",{staticClass:"welcome-text",staticStyle:{"justify-items":"center",display:"grid"}},[e(N.Z,[e("p",{staticClass:"mb-0 headliner"},[t._v("Nau mai")])]),e(N.Z,[e("p",{staticClass:"mb-0 headliner"},[t._v("Whakatau mai")])]),e(N.Z,{staticClass:"pb-12"},[e("p",{staticClass:"mb-0 headliner2",staticStyle:{color:"darkgrey"}},[t._v("welcome")])]),e(N.Z,{staticClass:"mt-10"},[e(S.Z,{staticStyle:{"border-color":"#b12526","background-color":"#303030"},attrs:{text:"","x-large":"",color:"#b12526",outlined:""},on:{click:function(e){return e.preventDefault(),t.toggleNew.apply(null,arguments)}}},[e("p",{staticClass:"login-text mb-0"},[t._v("create pataka")])])],1)],1),t.dialog?e("NewNodeDialog",{attrs:{show:t.dialog,title:"Āhau Pātaka"},on:{close:t.toggleNew,save:function(e){return t.save(e)}}}):t._e()],1)},Me=[],je=a(2418),qe=a.n(je);const Ue="\n---------------------------------\nE te tangata\nWhāia te māutauranga kai mārama\nKia whai take ngā mahi katoa\nTū māia, tū kaha\nAroha atu, aroha mai\nTātou i a tātou katoa\n\nFor this person\nSeek knowledge for understanding\nHave purpose in all that you do\nStand tall, be strong\nLets us all show respect\nFor each other\n---------------------------------\n",ze={data(){return{isLoading:!0,isSetup:!1,profile:{id:null,preferredName:null,avatarImage:null},dialog:!1,passwordInput:"",passwordError:!1,passwordRules:[]}},computed:{cloudHost(){return"file://"!==window.location.origin&&"localhost"!==window.location.hostname}},mounted(){this.getCurrentIdentity()},methods:{async createPassword(){await qe().hash(this.passwordInput,10,(function(t,e){t?console.log("error encrypting password: ",t):console.log("hash: ",e)}))},checkPassword(){qe().compare(this.passwordInput,re).then((t=>{t?(this.karakiaTūwhera(),this.$router.push({name:"dashboard"})):this.passwordRules.push("Password incorrect. Try again")}))},async getCurrentIdentity(){const t=await this.$apollo.query({query:i.ZP` { whoami { public { profile { id preferredName avatarImage { uri } } } } } `,fetchPolicy:"no-cache"});if(t.errors)throw t.errors;t.data.whoami.public.profile&&(this.profile=t.data.whoami.public.profile),this.proceed()},karakiaTūwhera(){console.log(Ue)},proceed(){if(this.$apollo.loading||!this.profile.id)return console.log("waiting for apollo"),void setTimeout(this.proceed,300);this.isSetup=Boolean(this.profile.preferredName),this.isSetup&&!this.cloudHost&&(this.karakiaTūwhera(),this.$router.push({name:"dashboard"})),this.isLoading=!1},toggleNew(){this.dialog=!this.dialog},async save(t){const e=Le()(t,"preferredName","description","avatarImage");e.avatarImage&&delete e.avatarImage.uri;const a=await this.$apollo.mutate({mutation:i.ZP` mutation($input: PatakaProfileInput!) { savePataka(input: $input) } `,variables:{input:{id:this.profile.id,...e}}});a.errors?console.error("failed to update profile",a):this.getCurrentIdentity()}},components:{NewNodeDialog:Ae}},He=ze;var Ve=(0,f.Z)(He,Oe,Me,!1,null,"7f7d691c",null);const Re=Ve.exports;s.ZP.use(I.ZP);const Ge=new I.ZP({mode:"history",routes:[{path:"/",redirect:"/login"},{path:"/login",name:"login",component:Re},{path:"/logout",redirect:"/login"},{path:"/dashboard",name:"dashboard",component:Fe},{path:"*",redirect:"/"}]});var Xe=a(6486),We=a(8891),Ke=a.n(We);const{VUE_APP_MIXPANEL_TOKEN:Je,VUE_APP_MIXPANEL_API_HOST:Qe="https://api-eu.mixpanel.com"}={VUE_APP_MIXPANEL_TOKEN:"undefined",VUE_APP_MIXPANEL_API_HOST:"undefined"},Ye=1e3,ta=60*Ye,ea=60*ta,aa=1*ea,sa={track(...t){}};sa.throttledTrack=(0,Xe.throttle)(sa.track,aa);const ia={};function oa(){return window.ahoy?(Ke().init(Je,{api_host:Qe}),window.ahoy.getConfig().then((t=>{const e=t.mixpanelId;Ke().identify(e),Ke().people.set({application:"ahau",isPataka:!0,isMobile:!1,userId:e}),Ke().throttledTrack=(t,...e)=>(ia[t]||(ia[t]=(0,Xe.throttle)(Ke().track,aa,{trailing:!1}).bind(Ke(),t)),ia[t](...e))})),Ke()):(console.log("(analytics) window.ahoy not found - this is only accessible in electron"),sa)}const ra=oa(),na=a(9876).version,la={},ca={},ua={},pa={patakaPing({state:t,commit:e}){ra.throttledTrack("pataka-ping",{version:na})}},da={namespaced:!0,state:la,getters:ca,mutations:ua,actions:pa};s.ZP.use(u.ZP);const ha={state:{},getters:{},mutations:{},actions:{}},ga=new u.ZP.Store({...ha,modules:{analytics:da}});var ma=a(2489),fa=a(692);const va=JSON.parse('{"__schema":{"types":[{"name":"Blob","kind":"INTERFACE","possibleTypes":[{"name":"BlobScuttlebutt","description":"Blobs of the ssb-blobs variety"},{"name":"BlobHyper","description":"Blobs of the ssb-hyper-blobs variety"}]},{"name":"_Entity","kind":"UNION","possibleTypes":[{"name":"CurrentIdentity","description":"Secure Scuttlebutt current identity"},{"name":"PublicIdentity","description":null},{"name":"PersonalIdentity","description":null},{"name":"Peer","description":"Secure Scuttlebutt replication peer"}]},{"name":"Profile","kind":"INTERFACE","possibleTypes":[{"name":"Person","description":"Person fields used by ssb-profile plugin"},{"name":"Pataka","description":null},{"name":"Community","description":"Community profile (fields from ssb-profile plugin)"}]}]}}'),ya=a(5926)();function ba(t={}){const e={NODE_ENV:"production",VUE_APP_MIXPANEL_TOKEN:"undefined",VUE_APP_MIXPANEL_API_HOST:"undefined",VUE_APP_PLATFORM:"web",BASE_URL:""}.VUE_APP_GRAPHQL_HTTP||`http://localhost:${ya.pataka.graphql.port}/graphql`,a=new fa.Z(e,{possibleTypes:va,...t}),s=new ma.ZP({defaultClient:a,defaultOptions:{$query:{}},errorHandler(t){console.log("%cError","background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;",t.message)}});return s}s.ZP.use(ma.ZP);ba();var wa=a(2250);const ka="#bfbfbf",_a="#427979",Za={theme:{dark:!0,themes:{dark:{primary:"#383838",secondary:"#A80000",accent:"#A70000",error:"#ff0000",alive:_a,deceased:ka}},options:{customProperties:!0}},icons:{iconfont:"mdi"}};s.ZP.use(wa.Z);const Ca=new wa.Z(Za);async function xa(){s.ZP.use(o.ZP),s.ZP.config.productionTip=!1;const t=ba();async function e(a){try{await t.defaultClient.query({query:i.ZP`{ whoami { public { feedId } } }`})}catch(s){return console.log("Waiting for Graphql"),setTimeout((()=>e(a)),500)}a()}e((()=>{new s.ZP({router:Ge,store:ga,apolloProvider:t,vuetify:Ca,render:t=>t(P)}).$mount("#app")}))}xa()},9432:(t,e,a)=>{"use strict";t.exports=a.p+"img/logo_red.d388862f.svg"},5995:()=>{},9876:t=>{"use strict";t.exports=JSON.parse('{"name":"Pataka","version":"4.5.0","description":"A pub application for the Ahau ecosystem. Built using scuttlebutt","homepage":"https://gitlab.com/ahau/pataka","main":"main.bundle.js","scripts":{"postinstall":"patch-package && electron-builder install-app-deps && cd ui && npm i","start":"electron main.bundle.js -- --title Pātaka","dev":"cross-env NODE_ENV=development DEV_SERVER_PORT=8081 electron main.js -- --title Pātaka","serve":"cd ui && npm run dev","build:ui":"cd ui && npm run build","build:backend":"node bundle.mjs","build:icons":"node build/build-icons.js","pack":"electron-builder --config build/electron-builder.config.js --dir","dist":"npm run build:backaned && electron-builder --config build/electron-builder.config.js","publish":"electron-builder --config build/electron-builder.config.js --publish always","move-release":"rimraf releases && mvy dist/installers releases","release":"npm run build:backend && npm run build:ui && npm run publish && npm run move-release","lint":"cd ui && npm run lint"},"dependencies":{"ahau-env":"^3.0.0","boxen":"^5.1.2","chalk":"^4.1.2","electron-updater":"^4.6.5","env-paths":"^2.2.1","lodash.merge":"^4.6.2","secret-stack":"^6.4.2","ssb-ahoy":"^6.1.1","ssb-artefact":"^3.2.2","ssb-backlinks":"^2.1.1","ssb-blobs":"^2.0.1","ssb-config":"^3.4.6","ssb-conn":"^1.0.0","ssb-db":"^20.4.1","ssb-friends":"^4.4.10","ssb-hyper-blobs":"^3.1.0","ssb-invite":"^3.0.3","ssb-lan":"^1.2.3","ssb-pataka":"^6.0.1","ssb-profile":"^6.0.1","ssb-query":"^2.4.5","ssb-recps-guard":"^2.3.0","ssb-replicate":"^1.3.5","ssb-serve-blobs":"^3.3.0","ssb-settings":"^1.1.5","ssb-story":"^2.5.1","ssb-submissions":"^1.5.1","ssb-whakapapa":"^3.6.1"},"devDependencies":{"cross-env":"^7.0.3","electron":"26.4.1","electron-builder":"^24.6.4","esbuild":"^0.19.8","esbuild-plugin-fileloc":"^0.0.6","esm":"^3.2.25","mvy":"^0.2.1","patch-package":"^8.0.0","rimraf":"^2.7.1","typescript":"^3.9.10"},"optionalDependencies":{"@electron/notarize":"^1.2.4","dmg-license":"^1.0.11"},"engines":{"node":">=18"},"author":"Āhau Ltd.","repository":{"type":"git","url":"git+https://gitlab.com/ahau/pataka.git"},"license":"AGPL-3.0"}')}},e={};function a(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={id:s,loaded:!1,exports:{}};return t[s].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=t,(()=>{var t=[];a.O=(e,s,i,o)=>{if(!s){var r=1/0;for(u=0;u<t.length;u++){for(var[s,i,o]=t[u],n=!0,l=0;l<s.length;l++)(!1&o||r>=o)&&Object.keys(a.O).every((t=>a.O[t](s[l])))?s.splice(l--,1):(n=!1,o<r&&(r=o));if(n){t.splice(u--,1);var c=i();void 0!==c&&(e=c)}}return e}o=o||0;for(var u=t.length;u>0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[s,i,o]}})(),(()=>{a.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;return a.d(e,{a:e}),e}})(),(()=>{a.d=(t,e)=>{for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})}})(),(()=>{a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()})(),(()=>{a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})(),(()=>{a.r=t=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}})(),(()=>{a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t)})(),(()=>{a.p=""})(),(()=>{var t={143:0};a.O.j=e=>0===t[e];var e=(e,s)=>{var i,o,[r,n,l]=s,c=0;if(r.some((e=>0!==t[e]))){for(i in n)a.o(n,i)&&(a.m[i]=n[i]);if(l)var u=l(a)}for(e&&e(s);c<r.length;c++)o=r[c],a.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return a.O(u)},s=globalThis["webpackChunkpataka_ui"]=globalThis["webpackChunkpataka_ui"]||[];s.forEach(e.bind(null,0)),s.push=e.bind(null,s.push.bind(s))})();var s=a.O(void 0,[998],(()=>a(7510)));s=a.O(s)})(); //# sourceMappingURL=app.98fbcd13.js.map