(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{255:function(e,t,n){"use strict";var r=n(5),o=n(30),l=n(31),c=n(150),d=n(78),m=n(11),f=n(59).f,v=n(60).f,x=n(14).f,h=n(256).trim,w="Number",y=r.Number,_=y,C=y.prototype,k=l(n(102)(C))==w,N="trim"in String.prototype,I=function(e){var t=d(e,!1);if("string"==typeof t&&t.length>2){var n,r,o,l=(t=N?t.trim():h(t,3)).charCodeAt(0);if(43===l||45===l){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===l){switch(t.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+t}for(var code,c=t.slice(2),i=0,m=c.length;io)return NaN;return parseInt(c,r)}}return+t};if(!y(" 0o1")||!y("0b1")||y("+0x1")){y=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof y&&(k?m((function(){C.valueOf.call(n)})):l(n)!=w)?c(new _(I(t)),n,y):I(t)};for(var E,T=n(9)?f(_):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),A=0;T.length>A;A++)o(_,E=T[A])&&!o(y,E)&&x(y,E,v(_,E));y.prototype=C,C.constructor=y,n(16)(r,w,y)}},256:function(e,t,n){var r=n(4),o=n(43),l=n(11),c=n(257),d="["+c+"]",m=RegExp("^"+d+d+"*"),f=RegExp(d+d+"*$"),v=function(e,t,n){var o={},d=l((function(){return!!c[e]()||"​…"!="​…"[e]()})),m=o[e]=d?t(x):c[e];n&&(o[n]=m),r(r.P+r.F*d,"String",o)},x=v.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(m,"")),2&t&&(e=e.replace(f,"")),e};e.exports=v},257:function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},268:function(e,t,n){"use strict";n.r(t);var r=n(2),o=n(19),l=(n(24),n(255),n(101)),c={head:function(){return{title:"FTTx.gr - Add a cabinet in the map",meta:[{hid:"description",name:"description",content:"Add a FTTx cabinet in the map and contribute to the database"},{hid:"twitter:description",name:"twitter:description",content:"Add a FTTx cabinet in the map and contribute to the database"},{hid:"og:description",property:"og:description",content:"Add a FTTx cabinet in the map and contribute to the database"}]}},data:function(){var e;return e={id:null,isp:null,lat:null,lng:null,type:null,img:null,name:null,email:null,success:!1,failed:!1,error:null},Object(o.a)(e,"email",null),Object(o.a)(e,"checkEmail",!1),Object(o.a)(e,"sending",!1),Object(o.a)(e,"noEmail",null),e},methods:{submit:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var data,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return data={id:Number(e.id),isp:e.isp,position:{lat:Number(e.lat),lng:Number(e.lng)},type:e.type,img:e.img},t.prev=1,"RURALCONNECT"===e.type&&(data.type="RURCON"),t.next=5,e.$axios({method:"post",url:"/api/auth/cabinet",headers:{"content-type":"application/json"},data:data});case 5:n=t.sent,e.$toast.success("Submitted! Thanks for submitting a new cabinet! It's pending approval now..."),e.error=n.data,t.next=14;break;case 10:t.prev=10,t.t0=t.catch(1),e.failed=!0,e.$toast.error("Uh-oh! Something went wrong while trying to submit a new Cabinet. Make sure you have actual coordinates.");case 14:case"end":return t.stop()}}),t,null,[[1,10]])})))()},signIn:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.sending=!0,e.email){t.next=5;break}e.noEmail=!0,t.next=12;break;case 5:return t.next=7,l.a.auth.signIn({email:e.email},{redirectTo:"".concat(e.$config.url,"add")});case 7:n=t.sent,n.user,n.session,n.error||(e.checkEmail=!0);case 12:e.sending=!1;case 13:case"end":return t.stop()}}),t)})))()},signOut:function(){return Object(r.a)(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.a.auth.signOut();case 2:t=e.sent,t.error;case 4:case"end":return e.stop()}}),e)})))()}},computed:{loggedIn:function(){return this.$store.state.loggedIn},user:function(){return this.$store.state.user}},mounted:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var n,r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.$route.query,r=n.lat,o=n.lng,r&&o&&(e.lat=r,e.lng=o);case 2:case"end":return t.stop()}}),t)})))()}},d=n(6),component=Object(d.a)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.loggedIn?n("div",[n("h1",{staticClass:"text-center font-semibold text-lg mt-8"},[e._v("\n Welcome back, "+e._s(e.user.email)+"!\n ")]),e._v(" "),n("form",{staticClass:"max-w-lg mt-8 mx-auto px-8",on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[n("div",{staticClass:"flex flex-wrap mb-6 -mx-3"},[n("div",{staticClass:"w-full px-3 mb-6 md:w-1/2 md:mb-0"},[n("label",{staticClass:"block mb-2 text-xs font-bold tracking-wide text-gray-700 uppercase",attrs:{for:"grid-id"}},[e._v("Cabinet ID")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.id,expression:"id"}],staticClass:"block w-full px-4 py-3 mb-3 leading-tight text-gray-700 bg-gray-200 border-gray-400 border rounded appearance-none focus:outline-none focus:bg-white",attrs:{id:"grid-id",type:"number",required:""},domProps:{value:e.id},on:{input:function(t){t.target.composing||(e.id=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"w-full px-3 mb-6 md:w-1/2 md:mb-0"},[n("label",{staticClass:"block mb-2 text-xs font-bold tracking-wide text-gray-700 uppercase",attrs:{for:"grid-isp"}},[e._v("ISP")]),e._v(" "),n("div",{staticClass:"relative"},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.isp,expression:"isp"}],staticClass:"block w-full px-4 py-3 pr-8 leading-tight text-gray-700 bg-gray-200 border-gray-400 border rounded appearance-none focus:outline-none focus:bg-white focus:border-gray-500",attrs:{id:"grid-isp",required:""},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.isp=t.target.multiple?n:n[0]}}},[n("option",[e._v("OTE")]),e._v(" "),n("option",[e._v("Vodafone")]),e._v(" "),n("option",[e._v("WIND")]),e._v(" "),n("option",[e._v("RURALCONNECT")])]),e._v(" "),n("div",{staticClass:"absolute inset-y-0 right-0 flex items-center px-2 text-gray-700 pointer-events-none"},[n("svg",{staticClass:"w-4 h-4 fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"}})])])])])]),e._v(" "),n("div",{staticClass:"flex flex-wrap mb-6 -mx-3"},[n("div",{staticClass:"w-full px-3 mb-6 md:w-1/2 md:mb-0"},[n("label",{staticClass:"block mb-2 text-xs font-bold tracking-wide text-gray-700 uppercase",attrs:{for:"grid-lat"}},[e._v("Latitude")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.lat,expression:"lat"}],staticClass:"block w-full px-4 py-3 mb-3 leading-tight text-gray-700 bg-gray-200 border-gray-400 border rounded appearance-none focus:outline-none focus:bg-white",attrs:{id:"grid-lat",type:"number",step:"any"},domProps:{value:e.lat},on:{input:function(t){t.target.composing||(e.lat=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"w-full px-3 mb-6 md:w-1/2 md:mb-0"},[n("label",{staticClass:"block mb-2 text-xs font-bold tracking-wide text-gray-700 uppercase",attrs:{for:"grid-lng"}},[e._v("Longtitude")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.lng,expression:"lng"}],staticClass:"block w-full px-4 py-3 mb-3 leading-tight text-gray-700 bg-gray-200 border-gray-400 border rounded appearance-none focus:outline-none focus:bg-white",attrs:{id:"grid-lng",type:"number",step:"any"},domProps:{value:e.lng},on:{input:function(t){t.target.composing||(e.lng=t.target.value)}}})])]),e._v(" "),n("div",{staticClass:"flex flex-wrap mb-6 -mx-3"},[n("div",{staticClass:"w-full px-3 mb-6 md:w-1/2 md:mb-0"},[n("label",{staticClass:"block mb-2 text-xs font-bold tracking-wide text-gray-700 uppercase",attrs:{for:"grid-img"}},[e._v("Image URL")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.img,expression:"img"}],staticClass:"block w-full px-4 py-3 mb-3 leading-tight text-gray-700 bg-gray-200 border-gray-400 border rounded appearance-none focus:outline-none focus:bg-white",attrs:{id:"grid-img",type:"text",placeholder:"Ex. https://imgur.com/"},domProps:{value:e.img},on:{input:function(t){t.target.composing||(e.img=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"w-full px-3 mb-6 md:w-1/2 md:mb-0"},[n("label",{staticClass:"block mb-2 text-xs font-bold tracking-wide text-gray-700 uppercase",attrs:{for:"grid-type"}},[e._v("Type")]),e._v(" "),n("div",{staticClass:"relative"},[n("select",{directives:[{name:"model",rawName:"v-model",value:e.type,expression:"type"}],staticClass:"block w-full px-4 py-3 pr-8 leading-tight text-gray-700 bg-gray-200 border-gray-400 border rounded appearance-none focus:outline-none focus:bg-white focus:border-gray-500",attrs:{id:"grid-type",required:""},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.type=t.target.multiple?n:n[0]}}},[n("option",[e._v("ADSL")]),e._v(" "),n("option",[e._v("VDSL")]),e._v(" "),n("option",[e._v("FTTH")]),e._v(" "),n("option",[e._v("RURALCONNECT")])]),e._v(" "),n("div",{staticClass:"absolute inset-y-0 right-0 flex items-center px-2 text-gray-700 pointer-events-none"},[n("svg",{staticClass:"w-4 h-4 fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"}})])])])])]),e._v(" "),n("div",{staticClass:"flex justify-between"},[n("button",{staticClass:"px-4 py-2 font-bold bg-blue-500/40 text-blue-500 rounded hover:bg-blue-500/50 ease-in-out duration-150 border border-blue-500",attrs:{type:"submit"}},[e._v("\n Submit\n ")]),e._v(" "),n("button",{staticClass:"px-4 py-2 font-bold bg-red-500/40 text-red-500 rounded hover:bg-red-500/50 ease-in-out duration-150 border border-red-500",attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.signOut()}}},[e._v("\n Sign out\n ")])])])]):!1===e.loggedIn?n("div",{staticClass:"flex flex-col justify-between max-w-lg p-3 m-auto w-80 mt-16"},[n("div",{staticClass:"flex flex-col space-y-4"},[e._m(0),e._v(" "),n("form",{staticClass:"flex flex-col space-y-4"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],staticClass:"bg-gray-200 border border-gray-400 rounded-md py-2 w-full px-2",attrs:{required:"",type:"email",placeholder:"Email"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value)}}}),n("button",{staticClass:"bg-blue-500/25 text-blue-500 font-semibold border border-blue-500 py-2 px-2 rounded-md hover:bg-blue-500/40 ease-in-out duration-150 flex justify-center items-center",attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.signIn()}}},[e._v("\n Sign in with magic link\n "),e.sending?n("Icon",{attrs:{i:"text-white animate-spin fas fa-spinner fa-lg ml-2"}}):e._e()],1)]),e._v(" "),e.noEmail?n("div",{staticClass:"text-center font-semibold text-red-500 uppercase"},[e._v("\n Email is required\n ")]):e._e(),e._v(" "),e.checkEmail?n("h2",{staticClass:"text-center font-semibold text-green-500 uppercase"},[e._v("\n ✨ Check your email\n ")]):e._e()])]):e._e()])}),[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"text-2xl font-semibold text-center"},[e._v("\n You are not logged in\n ")]),e._v(" "),n("p",{staticClass:"text-center py-2"},[e._v("\n Login now and start adding FTTx cabinets\n ")])])}],!1,null,null,null);t.default=component.exports;installComponents(component,{Icon:function(){return n.e(4).then(n.bind(null,274)).then((function(e){return e.default||e}))}})}}]);