${Math.round(i.daily[0].temp.min)+"°"}
\n Max. Temp:
${Math.round(i.daily[0].temp.max)+"°"}
\n Precip Chance:
${100*i.daily[0].pop+"%"}
\n `,a.innerHTML=l,n=`\n \n ${function(){let e="";return d.forEach((a=>{e+=`
${a.day}
`})),e}()}
\n ${function(){let e="";return d.forEach((a=>{e+=`

`})),e}()}
\n ${function(){let e="";return d.forEach((a=>{e+=`
${a.desc}
`})),e}()}
\n ${function(){let e="";return d.forEach((a=>{e+=`
Low: ${a.minTemp+"°"} Hi: ${a.maxTemp+"°"}
`})),e}()}
\n `,t.innerHTML=n}))},yelpPanels(e,a){e.append("term",a),fetch("https://vtbeertrail.com/server/yelp.php",{method:"POST",body:e}).then((e=>e.text())).then((e=>{let t=JSON.parse(e).businesses;if("restaurants"===a)var l=document.querySelector('[data-target="dining-tab"]');else l=document.querySelector('[data-target="shopping-tab"]');let n="";t.forEach((e=>{let a="";switch(e.rating){case 5:a="five";break;case 4.5:a="four-half";break;case 4:a="four";break;case 3.5:a="three-half";break;case 3:a="three";break;case 2.5:a="two-half";break;case 2:a="two";break;case 1.5:a="one-half";break;case 1:a="one";break;case 0:a="zero"}n=`\n \n

\n
\n
\n
\n `,l.innerHTML+=n}))}))}},a={init(){let e=document.querySelector(".detail-action-item-bigtext"),a=document.querySelector(".detail-action-item-check"),t=null,l=JSON.parse(document.querySelector("#detailData").textContent);localforage.getItem("beerDB").then((function(n){n&&(t=n.find((e=>e.selector===l.selector))),t&&(a.classList.add("detail-action-item-check-selected"),e.textContent="Already In Your Trail")}))}},t={init(){let e=JSON.parse(document.querySelector("#detailData").textContent),a=document.querySelector(".detail-modal"),l=document.querySelector(".detail-modaltwo"),n=document.querySelector("[data-add]"),i=document.querySelector(".detail-action-item-check"),r=document.querySelector(".detail-action-item-bigtext");t.clickingOnSaveToTrail(e,a,l,n,i,r)},clickingOnSaveToTrail(e,a,l,n,i,r){n.addEventListener("click",(n=>{let c=null;localforage.getItem("beerDB").then((function(n){n&&(c=n.find((a=>a.selector===e.selector))),c?(l.classList.add("detail-modaltwo-open"),i.classList.add("detail-action-item-check-selected")):(t.addToTrail(e),a.classList.add("detail-modal-open"),i.classList.add("detail-action-item-check-selected"),r.textContent="Added To Your Trail"),t.modalsBoth(a,l)}))}))},addToTrail(e){localforage.getItem("beerDB").then((function(a){a?a.push(e):(a=[]).push(e),localforage.setItem("beerDB",a)}))},modalsBoth(e,a){e.addEventListener("click",(e=>{e.target.closest(".detail-modal").classList.remove("detail-modal-open")})),a.addEventListener("click",(e=>{e.target.closest(".detail-modaltwo").classList.remove("detail-modaltwo-open")}))}};e.init(),a.init(),t.init()})();