YUI.add("moodle-message_airnotifier-toolboxes",function(c,e){var t,i='div[data-processor-name="airnotifier"]',o="a.hidedevice",n="li.airnotifierdevice",a="dimmed_text",s="deviceid-",r=function(){r.superclass.constructor.apply(this,arguments)};c.extend(r,c.Base,{replace_button:function(e,t,i,o){o=o||"pointer";e=c.one(e).all(t).setStyle("cursor",o);return e.on("click",i,this),e},toggle_hide_device_ui:function(e){var t=e.ancestor(n),i=e.one("img"),o=a,s="",s=t.hasClass(o)?"hide":"show";t.toggleClass(o),o=M.util.get_string(s,"moodle"),i.setAttrs({alt:o,title:o,src:M.util.image_url("t/"+s)}),e.set("title",o),e.set("className","editing_"+s)},send_request:function(e,o,s){var t,i,n,a;for(i in e=e||{},t=this.get("config").pageparams)e[i]=t[i];return o&&o.show(),e.sesskey=M.cfg.sesskey,n=M.cfg.wwwroot+this.get("ajaxurl"),a=[],c.io(n,{method:"POST",data:e,on:{success:function(e,t){try{(a=c.JSON.parse(t.responseText)).error?c.use("moodle-core-notification-ajaxexception",function(){return new M.core.ajaxException(a).show()}):a.success&&s()}catch(i){}o&&o.hide()},failure:function(e,t){o&&o.hide(),c.use("moodle-core-notification-ajaxexception",function(){return new M.core.ajaxException(t).show()})}},context:this,sync:!1}),a},get_element_id:function(e){return e.get("id").replace(s,"")}},{NAME:"device-toolbox",ATTRS:{ajaxurl:{value:0},config:{value:0}}}),c.extend(t=function(){t.superclass.constructor.apply(this,arguments)},r,{initializer:function(){this.setup_for_device()},setup_for_device:function(e){e=e||i,c.all(e).each(this._setup_for_device,this)},_setup_for_device:function(e){this.replace_button(e,o,this.toggle_hide_device)},toggle_hide_device:function(e){var t,i,o;e.preventDefault(),i=e.target.ancestor(n),t=e.target.ancestor("a",!0),e={field:"enable",enable:i.hasClass(a)?1:0,id:this.get_element_id(i)},i=M.util.add_spinner(c,i),(o=this).send_request(e,i,function(){o.toggle_hide_device_ui(t)})}},{NAME:"message-device-toolbox",ATTRS:{}}),M.message=M.message||{},M.message.init_device_toolbox=function(e){return new t(e)}},"@VERSION@",{requires:["base","node","io"]});