function Airplay(e){function a(){l(),n=["&#xE101;","bose","PLAY"],r=["&#xE103;","bose","PAUSE"],i=["&#xE10D;","bose","NEXT_TRACK"],s=["&#xE107;","bose","PREV_TRACK"],o=[]}function f(e,t){var u=$(t).find("streamType").text();u==="RADIO_TRACKS"?o=[null,n,i]:o=[s,n,i];if(e=="PLAY_STATE"||e=="BUFFERING_STATE")u==="RADIO_TRACKS"?o[1]=r:o[1]=r;return o}function l(){t=e}function c(e){return t[e]}function h(){var e=_.template(airplay_message_template),t=e({title:"##TRANS_Airplay2_Prompt_Title##",description:"##TRANS_Airplay2_Prompt_Description##",additional_description:p()?"##TRANS_Airplay2_Prompt_AdditionalDescription##":"",hiwtitle:"##TRANS_Airplay2_Prompt_Howitworks_Title##",airplay:{hiw:["##TRANS_Airplay2_Prompt_Howitworks_Description_hiw1##","##TRANS_Airplay2_Prompt_Howitworks_Description_hiw2##","##TRANS_Airplay2_Prompt_Howitworks_Description_hiw3##"]},learnmore:"##TRANS_Airplay2_Prompt_Howitworks_Description_hiw4##"}),n=[{title:"##TRANS_Buttons_OK##",callback:"close"}];funcObj.message.createMessage({headertitle:"",title:"",icon:"",classes:"airplay",copy:t,buttons:n,close:!0,ref:"airplay"}),setTimeout(function(){$("#advanced_setup").off().on(vdown,function(e){e.preventDefault(),funcObj.UIMain.setCurBut(this)}).on(vup,function(e){this==funcObj["UIMain"].getCurBut()&&!outside&&!moved&&(funcObj.devCon.goToSettings(funcObj.UIMain.getUID()),funcObj.message.closeMessage("airplay"))})},0)}function p(){var e=!1,t=funcObj.devCon.getDevice(funcObj.UIMain.getUID());if(t&&t.type){var n=t.type.toLowerCase();e=n==="binky"||n==="soundtouch wireless link adapter"}return e}function d(e,t){var n=$(".homekitname"),r=funcObj.content.getSettingsSrc()!=undefined&&funcObj.content.getSettingsSrc()[0]!=="";if(srcObj.settings.getCurDevice()===e&&r&&n.length){var i=$(t).attr("HomeKitName");i&&i!==""&&(n.find(".value").text(i),n.removeClass("disp_off"),setTimeout(function(){if(touchDevice){var e=funcObj.settingsBrowse.getLastList();if(e){var t=e.getListScrollObj();t&&t.refresh()}}},0))}}function v(e){if(!e){var t=funcObj.devCon.getDevices();e=t.some(function(e){return e.hasAirplay2})}e&&funcObj.appcomm.appSend({method:"getData",params:{name:"airplayPromo"},id:null},function(e){e!=="true"&&funcObj.message.createMessage({icon:"",title:"##TRANS_InternalMessages_Dialogs_Airplay2Promo_Title##",copy:"##TRANS_InternalMessages_Dialogs_Airplay2Promo_Copy##",buttons:[{title:"##TRANS_Buttons_GotIt##",callback:function(){funcObj.message.closeMessage("airplaypromo"),funcObj.appcomm.appSend({method:"setData",params:{name:"airplayPromo",value:"true"}})}}],classes:"airplay_promo",close:!1,ref:"airplaypromo"})})}var t,n,r,i,s,o,u=!1;this.getControls=f,this.getFeature=c,this.promptUser=h,this.updateHomeKitName=d,this.showAirplayPromo=v,a()};