/*! phoscon-app 2025-05-20 */

const SEARCH_SENSORS_DISABLED=0,SEARCH_SENSORS_ENABLED=1,FAST_POLL_DELAY=500,SLOW_POLL_DELAY=5e3;var pollState=SEARCH_SENSORS_DISABLED,pollDelay=SLOW_POLL_DELAY;function setGui(){app.currentSite=HELP,loadLanguage(),initSidenavBackButton(),screenMin(SCREEN_MIN_WIDTH_TABLET_PORTRAIT)&&openNav(),initAmaPopover(),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&($("body").addClass("is-mobile"),$("#link_to_old_webapp").addClass("hidden"))}function initAmaPopover(){var popShow=!1;app.amaBtn||(app.amaBtn=$("#ama-btn")),app.amaBtn.popover({html:!0,content:function(){var cid=$(this).attr("data-popover-content");return $(cid).html()},placement:"top"}),app.amaBtn.popover().on("show.bs.popover",function(){popShow=!0}),$(document).on("click",".ama-link",function(e){popShow=!1,app.amaBtn[0].click(),window.open($(this).attr("data-href"))}),$("body").on("click",function(e){popShow&&app.amaBtn.each(function(){$(this).is(e.target)||0!==$(this).has(e.target).length||0!==$(".popover").has(e.target).length||(popShow=!1,app.amaBtn[0].click())})})}function wizLoadSvg(dest,dev,page){var swel=Snap.select(dest);if(!swel)return!1;var data=Snap("#src-sw-svg");swel.clear();var s=data.select(dev);if(!s)return!1;(wiz=(s=s.clone()).select(".sw-wizzard"))&&wiz.attr("display","none"),s.parent().attr("display","inline"),swel.append(s),s.attr("display","inline");var bb=s.getBBox(),viewBox=swel.attr("viewBox"),wMargin=swel.attr("data-wmargin");wMargin=wMargin?parseInt(wMargin):310;var bottomMargin=swel.attr("data-bmargin");bottomMargin=bottomMargin?parseInt(bottomMargin):200;var wiz,width=Math.floor(bb.width+2*wMargin),height=Math.floor(bb.height+20+bottomMargin);return viewBox.x=Math.floor(bb.x-wMargin),viewBox.y=Math.floor(bb.y-20),viewBox.width=width,viewBox.height=height,swel.attr("viewBox",viewBox),swel.attr("width",width),swel.attr("height",height),(wiz=s.select(".sw-wizzard"))&&(wiz.attr("display","inline"),wiz.selectAll("[data-wizzard-page]").forEach(function(el){var p=el.attr("data-wizzard-page");page!=p?el.attr("display","none"):el.attr("display","inline"),el.selectAll("text").forEach(function(txt){txt.attr("display","none")})})),$(".sw-target, .sw-corner").each(function(){"none"===page?($(this).attr("style","opacity: 0.001"),$(this).parent().css("display","inline"),$(this).removeClass("sw-target-show")):($(this).attr("style","inline"),$(this).parent().css("display","none"),$(this).addClass("sw-target-show"))}),!0}function pollDone(){pollState===SEARCH_SENSORS_DISABLED?(pollDelay=SLOW_POLL_DELAY,(app.sensorScan.isActive()||app.config.get("permitjoin")>0)&&app.config.save({permitjoin:0},{patch:!0})):pollState===SEARCH_SENSORS_ENABLED&&(pollDelay=FAST_POLL_DELAY,app.sensorScan.isActive()||app.sensorScan.start()),app.sensorScan.fetch(),setTimeout(pollDone,pollDelay)}function showAmaLinks(){$("#amazon-link-list").addClass("show-Ama-links")}function hideAmaLinks(){$("#amazon-link-list").removeClass("show-Ama-links")}$(document).ready(function(){initApp(),setGui();let url="https://phoscon.de/de/app/doc",urlP="https://phoscon.de/de/conbee2",urlDe="https://www.dresden-elektronik.de";"de"!==app.lang&&(url="https://phoscon.de/en/app/doc",urlP="https://phoscon.de/en/conbee2",urlDe="https://www.dresden-elektronik.com"),$("#linkOnlineHelp").addClass("disabled"),fetch(url,{method:"HEAD",mode:"no-cors"}).then(()=>{$("#linkOnlineHelp").attr("href",url),$("#linkPhoscon").attr("href",urlP),$("#linkDe").attr("href",urlDe),$("#linkOnlineHelp").removeClass("disabled")}).catch(()=>{console.log("offline")})});