",a?c(s).append(o):c("#commands-list").append(o)}})),c(".sclk").off("click").on("click",(function(){runCommand(this,!1)})),c(".cclk").off("click").on("click",(function(){runCommand(this,!0)})),t.commands.forEach((function(e){c("[cmdname="+e.name+"]:input").val(""),c("[cmdname="+e.name+"]:checkbox").prop("checked",!1),e.argtable&&e.argtable.forEach((function(n){var a="#"+e.name+"-"+n.longopts,s=St(t,e.name,n.longopts);n.checkbox?c(a)[0].checked=s:(void 0!==s&&c(a).val(s).trigger("change"),0===c(a)[0].value.length&&(n.datatype||"").includes("|")&&(c(a)[0].value="--"))}))})),0!=c("#cfg-hw-preset-model_config").length&&(R||(R=!0,c("#cfg-hw-preset-model_config").html(""),c.getJSON("https://gist.githubusercontent.com/sle118/dae585e157b733a639c12dc70f0910c5/raw/",{_:(new Date).getTime()},(function(t){c.each(t,(function(t,e){c("#cfg-hw-preset-model_config").append("")),""!==$&&$==e.name&&c("#cfg-hw-preset-model_config").val($)})),""!==$&&"#prev_preset".show().val($)})).fail((function(t,e,n){var a=e+", "+n;console.log("Request Failed: "+a)}))))})).fail((function(t,e,n){404==t.status?c(".orec").hide():j(t,0,n),c("#commands-list").empty()}))}function _t(){c.ajaxSetup({timeout:7e3}),c.getJSON("/config.json",(function(t){c("#nvsTable tr").remove();var e=t.config?t.config:t;B=e,Object.keys(e).sort().forEach((function(t){var n=e[t].value;if("autoexec"===t)"0"===e.autoexec.value?c("#disable-squeezelite")[0].checked=!0:c("#disable-squeezelite")[0].checked=!1;else if("autoexec1"===t){var a=/-o\s?(["][^"]*["]|[^-]+)/g.exec(n);a[1].toUpperCase().startsWith("I2S")?P("i2s"):a[1].toUpperCase().startsWith("SPDIF")?P("spdif"):a[1].toUpperCase().startsWith('"BT')&&P("bt")}else"host_name"===t?(n=n.replaceAll('"',""),c("input#dhcp-name1").val(n),c("input#dhcp-name2").val(n),c("#player").val(n),document.title=n,z=n):"rel_api"===t?D=n:"enable_airplay"===t?c("#s_airplay").css({display:f(n)?"inline":"none"}):"enable_cspot"===t?c("#s_cspot").css({display:f(n)?"inline":"none"}):"preset_name"==t?$=n:"board_model"==t&&(Q=n);c("tbody#nvsTable").append(""+t+" | |
"),c("input#"+t).val(e[t].value)})),c("tbody#nvsTable").append(" | |
"),t.gpio?(c("#pins").show(),c("tbody#gpiotable tr").remove(),t.gpio.forEach((function(t){c("tbody#gpiotable").append("'+t.group+" | "+t.name+" | "+t.gpio+" | "+(t.fixed?"Fixed":"Configuration")+" |
")}))):c("#pins").hide()})).fail((function(t,e,n){j(t,0,n)}))}function wt(t,e){Tt({message:t,type:e},new Date)}function Tt(t,e){var n="table-success";"MESSAGING_WARNING"===t.type?(n="table-warning","MESSAGING_INFO"===H&&(H="MESSAGING_WARNING")):"MESSAGING_ERROR"===t.type&&("MESSAGING_INFO"!==H&&"MESSAGING_WARNING"!==H||(H="MESSAGING_ERROR"),n="table-danger"),++W>0&&(c("#msgcnt").removeClass("badge-success"),c("#msgcnt").removeClass("badge-warning"),c("#msgcnt").removeClass("badge-danger"),c("#msgcnt").addClass(O[H]),c("#msgcnt").text(W)),c("#syslogTable").append(""+e.toLocalShort()+" | "+t.message.encodeHTML()+" |
")}function Et(t){return new h((function(e){return setTimeout(e,t)}))}h.prototype.delay=function(t){return this.then((function(e){return new h((function(n){setTimeout((function(){n(e)}),t)}))}),(function(e){return new h((function(n,a){setTimeout((function(){a(e)}),t)}))}))},window.saveAutoexec1=function(t){U("cfg-audio-tmpl","MESSAGING_INFO","Saving.\n",!1);var e='squeezelite -b 500:2000 -d all=info -C 30 -W -n "'+c("#player").val()+'"';"bt"===Y?(e+=' -o "BT" -R -Z 192000',U("cfg-audio-tmpl","MESSAGING_INFO","Remember to configure the Bluetooth audio device name.\n",!0)):e+="spdif"===Y?" -o SPDIF -Z 192000":" -o I2S",""!==c("#optional").val()&&(e+=" "+c("#optional").val());var n={timestamp:Date.now()};n.config={autoexec1:{value:e,type:33},autoexec:{value:c("#disable-squeezelite").prop("checked")?"0":"1",type:33}},c.ajax({url:"/config.json",dataType:"text",method:"POST",cache:!1,contentType:"application/json; charset=utf-8",data:JSON.stringify(n),error:j,complete:function(e){e.responseText&&"OK"===JSON.parse(e.responseText).result?(U("cfg-audio-tmpl","MESSAGING_INFO","Done.\n",!0),t&&it(1500,"cfg-audio-tmpl")):JSON.parse(e.responseText).result?U("cfg-audio-tmpl","MESSAGING_WARNING",JSON.parse(e.responseText).Result+"\n",!0):U("cfg-audio-tmpl","MESSAGING_ERROR",e.statusText+"\n"),console.log(e.responseText)}}),console.log("sent data:",JSON.stringify(n))},window.handleDisconnect=function(){c.ajax({url:"/connect.json",dataType:"text",method:"DELETE",cache:!1,contentType:"application/json; charset=utf-8",data:JSON.stringify({timestamp:Date.now()})})},window.handleConnect=function(){nt.ssid=c("#manual_ssid").val(),nt.pwd=c("#manual_pwd").val(),nt.dhcpname=c("#dhcp-name2").val(),c("*[class*='connecting']").hide(),c("#ssid-wait").text(nt.ssid),c(".connecting").show(),c.ajax({url:"/connect.json",dataType:"text",method:"POST",cache:!1,contentType:"application/json; charset=utf-8",data:JSON.stringify({timestamp:Date.now(),ssid:nt.ssid,pwd:nt.pwd}),error:j})},c(document).ready((function(){c(".material-icons").each((function(t,e){e.attributes.icon=e.textContent})),bt(!0),p(),x.init(),c("#fw-url-input").on("input",(function(){c(this).val().length>8&&(c(this).val().startsWith("http://")||c(this).val().startsWith("https://"))?c("#start-flash").show():c("#start-flash").hide()})),c(".upSrch").on("input",(function(){var t=this.value;c("#rTable tr").removeClass(this.id+"_hide"),t.length>0&&c("#rTable td:nth-child(".concat(c(this).parent().index()+1,")")).filter((function(){return!c(this).text().toUpperCase().includes(t.toUpperCase())})).parent().addClass(this.id+"_hide"),c('[class*="_hide"]').hide(),c("#rTable tr").not('[class*="_hide"]').show()})),setTimeout(lt,1500),c("#WifiConnectDialog")[0].addEventListener("shown.bs.modal",(function(t){c("*[class*='connecting']").hide(),null!=t&&t.relatedTarget&&(nt.Action=st.CONN,c(t.relatedTarget).children("td:eq(1)").text()==et.ssid?nt.Action=st.STS:c(t.relatedTarget).is(":last-child")?(nt.Action=st.MAN,nt.ssid="",c("#manual_ssid").val(nt.ssid)):(nt.ssid=c(t.relatedTarget).children("td:eq(1)").text(),c("#manual_ssid").val(nt.ssid))),nt.Action!==st.STS?(c(".connecting-init").show(),c("#manual_ssid").trigger("focus")):mt()})),c("#WifiConnectDialog")[0].addEventListener("hidden.bs.modal",(function(){c("#WifiConnectDialog input").val("")})),c("#uCnfrm")[0].addEventListener("shown.bs.modal",(function(){c("#selectedFWURL").text(c("#fw-url-input").val())})),c("input#show-commands")[0].checked=1===q,c('a[href^="#tab-commands"]').hide(),c("#load-nvs").on("click",(function(){c("#nvsfilename").trigger("click")})),c("#nvsfilename").on("change",(function(){if("function"!=typeof window.FileReader)throw"The file API isn't supported on this browser.";if(!this.files)throw"This browser does not support the `files` property of the file input.";if(this.files[0]){var t=this.files[0],e=new FileReader;e.onload=function(t){var e={};try{e=JSON.parse(t.target.result)}catch(t){alert("Parsing failed!\r\n "+t)}c("input.nvs").each((function(t,n){c(this).parent().removeClass("bg-warning").removeClass("bg-success"),e[n.id]&&(e[n.id]!==n.value?(console.log("Changed "+n.id+" "+n.value+"==>"+e[n.id]),c(this).parent().addClass("bg-warning"),c(this).val(e[n.id])):c(this).parent().addClass("bg-success"))})),c("input.nvs").children(".bg-warning")&&alert("Highlighted values were changed. Press Commit to change on the device")},e.readAsText(t),this.value=null}})),c("#clear-syslog").on("click",(function(){W=0,H="MESSAGING_INFO",c("#msgcnt").text(""),c("#syslogTable").html("")})),c("#ok-credits").on("click",(function(){c("#credits").slideUp("fast",(function(){})),c("#app").slideDown("fast",(function(){}))})),c("#acredits").on("click",(function(t){t.preventDefault(),c("#app").slideUp("fast",(function(){})),c("#credits").slideDown("fast",(function(){}))})),c("input#show-commands").on("click",(function(){this.checked=this.checked?1:0,this.checked?(c('a[href^="#tab-commands"]').show(),q=1):(q=0,c('a[href^="#tab-commands"]').hide())})),c("input#show-nvs").on("click",(function(){this.checked=this.checked?1:0,r.Z.set("show-nvs",this.checked?"Y":"N"),p()})),c("#btn_reboot_recovery").on("click",(function(){handleReboot("recovery")})),c("#btn_reboot").on("click",(function(){handleReboot("reboot")})),c("#btn_flash").on("click",(function(){hFlash()})),c("#save-autoexec1").on("click",(function(){saveAutoexec1(!1)})),c("#commit-autoexec1").on("click",(function(){saveAutoexec1(!0)})),c("#btn_disconnect").on("click",(function(){et={},dt(),c.ajax({url:"/connect.json",dataType:"text",method:"DELETE",cache:!1,contentType:"application/json; charset=utf-8",data:JSON.stringify({timestamp:Date.now()})})})),c("#btnJoin").on("click",(function(){handleConnect()})),c("#reboot_nav").on("click",(function(){handleReboot("reboot")})),c("#reboot_ota_nav").on("click",(function(){handleReboot("reboot_ota")})),c("#save-as-nvs").on("click",(function(){var t=ot(!0),e=document.createElement("a");e.href=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:"text/plain"})),e.setAttribute("download","nvs_config_"+z+"_"+Date.now()+"json"),document.body.appendChild(e),e.click(),document.body.removeChild(e)})),c("#save-nvs").on("click",(function(){I(ot(!1))})),c("#fwUpload").on("click",(function(){0===document.getElementById("flashfilename").files.length?alert("No file selected!"):(c("#fw-url-input").value=null,x.StartOTA())})),c("[name=output-tmpl]").on("click",(function(){P(this.id)})),c("#chkUpdates").on("click",(function(){c("#rTable").html(""),c.getJSON(D,(function(t){var e=[];t.forEach((function(t){var n=t.name.split("#")[3];e.includes(n)||e.push(n)}));var n="";e.forEach((function(t){n+='"})),c("#fwbranch").append(n),t.forEach((function(t){var e="";t.assets.forEach((function(t){t.name.match(/\.bin$/)&&(e=t.browser_download_url)}));var n=t.name.split("#"),a=n[0],s=n[2],o=n[3],i=a.substr(a.lastIndexOf("-")+1);i="32"==i||"16"==i?i:"";var r=t.body;r=(r=(r=r.replace(/'/gi,'"')).replace(/[\s\S]+(### Revision Log[\s\S]+)### ESP-IDF Version Used[\s\S]+/,"$1")).replace(/- \(.+?\) /g,"- ").encodeHTML(),c("#rTable").append("\n ").concat(a," | ").concat(new Date(t.created_at).toLocalShort(),"\n | ").concat(s," | ").concat(o," | ").concat(i," |
"))})),c("#searchfw").css("display","inline"),rt(X)||rt(K),c("#rTable tr.release").on("click",(function(){var t=this.attributes.fwurl.value;L&&(t=t.replace(/.*\/download\//,L+"/plugins/SqueezeESP32/firmware/")),c("#fw-url-input").val(t),c("#start-flash").show(),c("#rTable tr.release").removeClass("table-success table-warning"),c(this).addClass("table-success table-warning")}))})).fail((function(){alert("failed to fetch release history!")}))})),c("#fwcheck").on("click",(function(){c("#releaseTable").html(""),c("#fwbranch").empty(),c.getJSON(D,(function(t){var e,n=0,a=[];t.forEach((function(t){var e=t.name.split("#")[3];a.includes(e)||a.push(e)})),a.forEach((function(t){e+='"})),c("#fwbranch").append(e),t.forEach((function(t){var e="";t.assets.forEach((function(t){t.name.match(/\.bin$/)&&(e=t.browser_download_url)}));var a=t.name.split("#"),s=a[0],o=a[1],i=a[2],r=a[3],l=t.body;l=(l=(l=l.replace(/'/gi,'"')).replace(/[\s\S]+(### Revision Log[\s\S]+)### ESP-IDF Version Used[\s\S]+/,"$1")).replace(/- \(.+?\) /g,"- ");var u=n++>6?" hide":"";c("#releaseTable").append(""+s+" | "+new Date(t.created_at).toLocalShort()+" | "+i+" | "+o+" | "+r+" | |
")})),n>7&&(c("#releaseTable").append(" |
"),c("#showallbutton").on("click",(function(){c("tr.hide").removeClass("hide"),c("tr#showall").addClass("hide")}))),c("#searchfw").css("display","inline")})).fail((function(){alert("failed to fetch release history!")}))})),c("#updateAP").on("click",(function(){lt(),console.log("refresh AP")})),_t(),yt(),ft(),vt()})),window.setURL=function(t){var e=t.dataset.url;c('[data-bs-url^="http"]').addClass("btn-success").removeClass("btn-danger"),c('[data-bs-url="'+e+'"]').addClass("btn-danger").removeClass("btn-success"),L&&(e=e.replace(/.*\/download\//,L+"/plugins/SqueezeESP32/firmware/")),c("#fwurl").val(e)},window.runCommand=function(t,e){var n=t.attributes.cmdname.value;U(t.attributes.cmdname.value,"MESSAGING_INFO","Executing.",!1);var a=document.getElementById("flds-"+n),o=null==a?void 0:a.querySelectorAll("select,input");if("cfg-hw-preset"===n)return function(t,e){var n=JSON.parse(t[0].value),a=t[0].attributes.cmdname.value;console.log("selected model: ".concat(n.name));for(var o={timestamp:Date.now(),config:{model_config:{value:n.name,type:33}}},i=0,r=Object.entries(n.config);i{n.r(e)},607:(t,e,n)=>{n(138),n(393),n(861),n(322)},861:t=>{t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAb1BMVEXIycuswsKMjI4rqqZyc3RQlpQ6jIEmJifW2dq5ursppJ8Om4zC0NAFdGYmmpb///8Hg3O4x8cHkoEggX0jko5Ks6/P0dM5r6ocoZb3+PgiiYVevrp/y8bg4uOS09FtxMDs7+7M6um529qoysik2tiNn72gAAAAF3RSTlP94Fr/Wf39BP26/////////////////kibhL0AAAGjSURBVDjLbZMJkoMgEEWtmETEJWpkiSC45P5nnF4wk7HmW2jLfzYIdFYUxbXUYp5nIbTOUFoLAR2ivIKZFQXYuu6TahSHmdAlAqWub0/QNI1jSxrHacKeWw9EdtH1xHbbyiRgCJn67JqVAr9nO2fJnBDMoUuYEvsfmxnJBM66Zj8/iYmaAPKlOvRNJAC/fz8OefINEAngAbYPEMiHTJCCAZrACciVMpCCgDEBKwsAowymMO3IAP3Btqa5vYJx0ZlcOSUZaE/AWznvnTHOyfZ/wMUQvAIg/wb27QNEH94BgGj+APsZiF8AXAhQQEMwkIYYLW7xvsENoyUoF0I0ysf0F2O743kDQNXzXM8+j8Eb6byzDEz7gtpsO1PgrXG5Nd6btNTP+YXarKTny1uQ9JiAN6vbqT9au+BzMQjAWtlq6BiYttdjiVVVqfXxWFWFkk6Cz0DTdYOFPmpHAAK/YQCJoTppQJ8A3TAxVAAhR439Bg5tKe7NgSDEje3mDsf+ovuGCUbYZb/BwoHS6ykHMYfo/U6lx8Xb/+qo3U/x/lf+VP9c/j9c3zy20WEMxgAAAABJRU5ErkJggg=="}},n={};function a(t){var s=n[t];if(void 0!==s)return s.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=e,t=[],a.O=(e,n,s,o)=>{if(!n){var i=1/0;for(u=0;u=o)&&Object.keys(a.O).every((t=>a.O[t](n[c])))?n.splice(c--,1):(r=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[n,s,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 n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},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),(()=>{var t={826:0};a.O.j=e=>0===t[e];var e=(e,n)=>{var s,o,[i,r,c]=n,l=0;if(i.some((e=>0!==t[e]))){for(s in r)a.o(r,s)&&(a.m[s]=r[s]);if(c)var u=c(a)}for(e&&e(n);la(607)));s=a.O(s)})();
//# sourceMappingURL=index.392dfa.bundle.js.map