text: (()=>{"use strict";var e,t,n,a,i={315:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(645),i=n.n(a)()((function(e){return e[1]}));i.push([e.id,"input:checked~.dot{transform:translateX(100%);background-color:#00ff6a}",""]);const r=i},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,a){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(a)for(var r=0;r<this.length;r++){var o=this[r][0];null!=o&&(i[o]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);a&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},379:(e,t,n)=>{var a,i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),r=[];function o(e){for(var t=-1,n=0;n<r.length;n++)if(r[n].identifier===e){t=n;break}return t}function s(e,t){for(var n={},a=[],i=0;i<e.length;i++){var s=e[i],l=t.base?s[0]+t.base:s[0],d=n[l]||0,c="".concat(l," ").concat(d);n[l]=d+1;var u=o(c),f={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(r[u].references++,r[u].updater(f)):r.push({identifier:c,updater:h(f,t),references:1}),a.push(c)}return a}function l(e){var t=document.createElement("style"),a=e.attributes||{};if(void 0===a.nonce){var r=n.nc;r&&(a.nonce=r)}if(Object.keys(a).forEach((function(e){t.setAttribute(e,a[e])})),"function"==typeof e.insert)e.insert(t);else{var o=i(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var d,c=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function u(e,t,n,a){var i=n?"":a.media?"@media ".concat(a.media," {").concat(a.css,"}"):a.css;if(e.styleSheet)e.styleSheet.cssText=c(t,i);else{var r=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(r,o[t]):e.appendChild(r)}}function f(e,t,n){var a=n.css,i=n.media,r=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=a;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(a))}}var p=null,m=0;function h(e,t){var n,a,i;if(t.singleton){var r=m++;n=p||(p=l(t)),a=u.bind(null,n,r,!1),i=u.bind(null,n,r,!0)}else n=l(t),a=f.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return a(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;a(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===a&&(a=Boolean(window&&document&&document.all&&!window.atob)),a));var n=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var a=0;a<n.length;a++){var i=o(n[a]);r[i].references--}for(var l=s(e,t),d=0;d<n.length;d++){var c=o(n[d]);0===r[c].references&&(r[c].updater(),r.splice(c,1))}n=l}}}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={id:e,exports:{}};return i[e](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e=(e,t,n,a)=>{const i=document.createElement(e);return i.innerText=n,Object.keys(t).forEach((e=>i.setAttribute(e,t[e]))),i&&document.getElementById(a).appendChild(i),i},t=()=>{const t=document.getElementById("status");!t||t.remove(),window.weather&&(e("div",{class:"my-4 flex w-full",id:"status"},"","body-content"),e("div",{class:"fp-2 w-full",id:"status-div"},"","status"),e("div",{class:"h-full flex flex-col p-4 rounded-lg bg-blue-50",id:"weather-details"},"","status-div"),e("div",{class:"flex my-2",id:"weather-icon"},"","weather-details"),e("img",{alt:"icon",class:"w-16 h-16 bg-blue-200 object-cover object-center flex-shrink-0 rounded-full mr-4",src:window.icon},"","weather-icon"),e("h1",{class:"my-3 text-gray-900 title-font text-3xl font-bold"},window.weather.description,"weather-icon"),e("div",{class:"grid grid-flow-col p-2 justify-baseline justify-items-stretch",id:"country-details"},"","weather-details"),e("span",{class:"text-gray-500"},`Country: ${window.weather.country}`,"country-details"),e("span",{class:"text-gray-500"},`Feels like: ${window.weather.feels_like}`,"country-details"),e("div",{class:"grid grid-flow-col p-2 justify-baseline justify-items-stretch",id:"temp-details"},"","weather-details"),e("span",{class:"text-gray-500"},`Temp: ${window.weather.temp}`,"temp-details"),e("span",{class:"text-gray-500"},`Min: ${window.weather.temp_min}`,"temp-details"),e("span",{class:"text-gray-500"},`Max: ${window.weather.temp_max}`,"temp-details"),e("div",{class:"grid grid-flow-col p-2 justify-baseline justify-items-stretch",id:"stat-details"},"","weather-details"),e("span",{class:"text-gray-500"},`Clouds: ${window.weather.clouds}`,"stat-details"),e("span",{class:"text-gray-500"},`Humidity: ${window.weather.humidity}`,"stat-details"),e("span",{class:"text-gray-500"},`Pressure: ${window.weather.pressure}`,"stat-details"),e("div",{class:"grid grid-flow-col p-2 justify-baseline justify-items-stretch",id:"wind-details"},"","weather-details"),e("span",{class:"text-gray-500"},"Winds ","wind-details"),e("span",{class:"text-gray-500"},`Deg: ${window.weather.deg}`,"wind-details"),e("span",{class:"text-gray-500"},`Speed: ${window.weather.speed}`,"wind-details"))},n=n=>{try{n.preventDefault();const a=(e,t,n,a,i,r,o,s,l,d,c,u,f)=>({icon:e,country:t,main:n,description:a,feels_like:i,humidity:r,pressure:o,temp:s,temp_max:l,temp_min:d,clouds:c,deg:u,speed:f}),i=(e,t,n="16b763577392ee505e23d81e111408f0")=>({city:e,units:t,apikey:n}),r=document.getElementById("toggle-status").checked?"imperial":"metric",o=i(document.getElementById("location-name").value,r),s=`https://api.openweathermap.org/data/2.5/weather?q=${o.city}&units=${o.units}&appid=${o.apikey}`;return fetch(s).then((e=>e.json())).then((n=>{if(n.message){const t=document.getElementById("error");!t||t.remove(),e("span",{class:"text-red-700 transition-colors duration-200 ease-in-out",id:"error"},`${n.message}`,"loaction-form")}else{const e=document.getElementById("error");!e||e.remove(),window.weather=a(n.weather[0].icon,n.sys.country,n.weather[0].main,n.weather[0].description,n.main.feels_like,n.main.humidity,n.main.pressure,n.main.temp,n.main.temp_max,n.main.temp_min,n.clouds.all,n.wind.deg,n.wind.speed),window.icon=`http://openweathermap.org/img/wn/${window.weather.icon}@2x.png`,t()}})),{units:r}}catch(n){}};e("header",{class:"text-gray-600 body-font my-3",id:"header"},"","content"),e("div",{class:"container mx-auto flex flex-wrap p-5 flex-col md:flex-row justify-center",id:"headercontainer"},"","header"),e("a",{class:"title-font cursor-pointer font-medium items-center text-gray-900 text-3xl",href:"#"},"Weather App","headercontainer"),e("section",{class:"text-gray-600 body-font overflow-hidden",id:"body-section"},"","content"),e("div",{class:"container px-5 py-24 mx-auto",id:"body-container"},"","body-section"),e("div",{class:"flex flex-wrap -m-4 justify-center ",id:"body-flex-container"},"","body-container"),e("div",{class:"p-4 xl:w-1/2 md:w-1/2 w-full",id:"body-flex-sub-container"},"","body-flex-container"),e("div",{class:"h-full p-6 px-11 rounded-lg border-2 border-gray-300 flex flex-col relative overflow-hidden items-center",id:"body-content"},"","body-flex-sub-container"),e("label",{class:"flex items-center cursor-pointer my-4",for:"toggle-status",id:"toggle-button-label"},"","body-content"),e("span",{class:""},"Celsius","toggle-button-label"),e("div",{class:"relative mx-3",id:"toggle-button-container"},"","toggle-button-label"),e("input",{class:"sr-only",type:"checkbox",id:"toggle-status"},"","toggle-button-container").addEventListener("change",n),e("div",{class:"w-10 h-4 bg-gray-400 rounded-full shadow-inner"},"","toggle-button-container"),e("div",{class:"dot absolute w-6 h-6 bg-white rounded-full shadow -left-1 -top-1 transition"},"","toggle-button-container"),e("span",{class:""},"Fahrenheit","toggle-button-label"),e("form",{class:"relative w-full mb-4",id:"loaction-form"},"","body-content").addEventListener("submit",n),e("input",{class:"w-full bg-gray-100 rounded border bg-opacity-50 border-gray-300 focus:ring-2 focus:ring-indigo-200 focus:bg-transparent focus:border-indigo-500 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out",type:"text",id:"location-name",name:"name",placeholder:"Name",required:""},"","loaction-form"),n(),t()})(),e=o(379),t=o.n(e),n=o(315),a={insert:"head",singleton:!1},t()(n.Z,a),n.Z.locals})();