Application.define("core.view_model",function(a){a=jQuery.extend(!0,{_required:{},scope:!1,model:{},view:!1,container:!1,args:{l10n:{remove_confirmation:"Are you sure you want to remove it?"}},actions:{update:function(){return null},pre_apply:function(a,b){b(null,!0)},init:function(a,b){b(null,!0)},add_data:function(){return null},remove_data:function(){return null},callback:!1},callback:function(a,b){var c=this;return"object"==typeof c.actions&&"function"==typeof c.actions.callback?c.actions.callback(a,b):(a&&a instanceof Error&&console.error(a.message,b),b)}},"object"==typeof a?a:{});var b=a.container&&"object"!=typeof a.container?jQuery(a.container):a.container;if(!b||"undefined"==typeof b.length||!b.length>0)return a.callback(new Error("ko.view_model. Container is missing, or incorrect."),!1);a.view&&(/^((https?|ftp):)?\/\/([\-A-Z0-9.]+)(\/[\-A-Z0-9+&@#\/%=~_|!:,.;]*)?(\?[A-Z0-9+&@#\/%=~_|!:,.;]*)?/i.test(a.view)&&jQuery.ajax({url:a.view,async:!1,dataType:"html",complete:function(b){a.view=b.responseText}}),b.html(a.view));var c=b.html();b.html("").addClass("ud_view_model ud_ui_loading").append('
').append('').find(".ud_ui_prepared_interface").html(c);var d=function(a,b){var c=this;c._applied=!1,c._args=a,c.scope=a.scope,c.core=a.scope.core,c.socket="object"==typeof a.scope.socket?a.scope.socket:!1,c.container=b,c.add_data=function(a,b,d,e){"function"==typeof b?a.push(new b):"function"==typeof d[b]&&a.push(new d[b]);try{c._args.actions.add_data(c,e,a,b)}catch(f){c._args.callback(f,d)}},c.alert=function(a,b){var d="alert-success";if("undefined"!=typeof b)switch(b){case"error":d="alert-error";break;case"warning":d=""}var e='