From e2160b072a513e5704c55ccc3df94a8b500d3359 Mon Sep 17 00:00:00 2001 From: Zarlex Date: Wed, 3 Jun 2020 11:44:22 +0200 Subject: [PATCH] release version 1.24.4 --- bin/release.sh | 2 +- dist/mw-uikit.js | 2 +- dist/mw-uikit.min.js | 5 +++++ dist/mw-uikit.relution.min.js | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 dist/mw-uikit.min.js create mode 100644 dist/mw-uikit.relution.min.js diff --git a/bin/release.sh b/bin/release.sh index fdab04a4..4f2049d2 100755 --- a/bin/release.sh +++ b/bin/release.sh @@ -119,7 +119,7 @@ mv .ignore_tmp .gitignore # Create tag and push it git tag -a v${VERSION_NUMBER} -m "Version ${VERSION_NUMBER}" -m "${CHANGELOG}" -git push origin_gh --tags --no-verify > /dev/null 2>&1 || exit_with_error "Could not publish tag v${VERSION_NUMBER}" +git push origin --tags --no-verify > /dev/null 2>&1 || exit_with_error "Could not publish tag v${VERSION_NUMBER}" echo "##########################################" echo "# #" diff --git a/dist/mw-uikit.js b/dist/mw-uikit.js index 09d4fbe1..5407577c 100644 --- a/dist/mw-uikit.js +++ b/dist/mw-uikit.js @@ -41,7 +41,7 @@ //Will be replaced with the actual version number duringh the build process; //DO NOT TOUCH - root.mwUI.VERSION = 'UIKITVERSIONNUMBER'; + root.mwUI.VERSION = '1.24.4'; angular.module("mwUI").run(["$templateCache", function($templateCache) { 'use strict'; diff --git a/dist/mw-uikit.min.js b/dist/mw-uikit.min.js new file mode 100644 index 00000000..bdacc044 --- /dev/null +++ b/dist/mw-uikit.min.js @@ -0,0 +1,5 @@ +!function(a,b){"use strict";b.module("mwUI",["mwUI.Backbone","mwUI.ExceptionHandler","mwUI.Form","mwUI.Inputs","mwUI.i18n","mwUI.Layout","mwUI.List","mwUI.Menu","mwUI.Modal","mwUI.ResponseHandler","mwUI.Toast","mwUI.ResponseToastHandler","mwUI.Utils","mwUI.UiComponents"]).config(["i18nProvider","mwIconProvider",function(a,b){a.addLocale("de_DE","Deutsch","de_DE.json"),a.addLocale("en_US","English (US)","en_US.json"),b.addIconSet({id:"mwUI",classPrefix:"fa",iconsUrl:"uikit/mw_ui_icons.json"},!0)}]).run(["i18n",function(a){a.setLocale("en_US")}]),window.mCAP=window.mCAP||{},a.mwUI={},a.mwUI.VERSION="1.24.4",b.module("mwUI").run(["$templateCache",function(a){a.put("uikit/mw-exception-handler/modals/templates/mw_exception_modal.html",'

{{\'ExceptionHandler.mwExceptionModal.unknownError\' | i18n}}

{{exception}}

{{\'ExceptionHandler.mwExceptionModal.userMessage\' | i18n}}

{{\'ExceptionHandler.mwExceptionModal.thanks\' | i18n}}
'),a.put("uikit/mw-form/directives/templates/mw_checkbox_wrapper.html",'
'),a.put("uikit/mw-form/directives/templates/mw_error_messages.html",'
'),a.put("uikit/mw-form/directives/templates/mw_form_actions.html",'
'),a.put("uikit/mw-form/directives/templates/mw_input_wrapper.html","
'),a.put("uikit/mw-inputs/directives/templates/mw_checkbox_group.html",'
'),a.put("uikit/mw-inputs/directives/templates/mw_radio_group.html",'
'),a.put("uikit/mw-inputs/directives/templates/mw_select_box.html",''),a.put("uikit/mw-inputs/directives/templates/mw_toggle.html",'
'),a.put("uikit/mw-layout/directives/templates/mw_footer.html",''),a.put("uikit/mw-layout/directives/templates/mw_header.html",'

{{title}}

{{description}}
'),a.put("uikit/mw-layout/directives/templates/mw_sidebar.html",'
'),a.put("uikit/mw-layout/directives/templates/mw_sub_nav.html",'
'),a.put("uikit/mw-layout/directives/templates/mw_sub_nav_pill.html",'
  • '),a.put("uikit/mw-layout/directives/templates/mw_ui.html",'
    '),a.put("uikit/mw-list/directives/templates/mw_list_action_button.html",'
    '),a.put("uikit/mw-list/directives/templates/mw_list_body_row_checkbox.html",' '),a.put("uikit/mw-list/directives/templates/mw_list_column_configurator.html",'
    '),a.put("uikit/mw-list/directives/templates/mw_list_footer.html",'

    {{ \'List.mwListFooter.noneFound\' | i18n }}

    '),a.put("uikit/mw-list/directives/templates/mw_list_head.html",'
    {{\'List.mwListHead.notAvailable\' | i18n}} {{getModelAttribute(item)}}
    '),a.put("uikit/mw-list/directives/templates/mw_list_header.html",' '),a.put("uikit/mw-list/directives/templates/mw_list_url_action_button.html",'
    '),a.put("uikit/mw-menu/directives/templates/mw_menu_divider.html",'
    '),a.put("uikit/mw-menu/directives/templates/mw_menu_entry.html",'
    '),a.put("uikit/mw-menu/directives/templates/mw_menu_top_bar.html",''),a.put("uikit/mw-menu/directives/templates/mw_menu_top_drop_down_item.html",''),a.put("uikit/mw-menu/directives/templates/mw_menu_top_entries.html",''),a.put("uikit/mw-menu/directives/templates/mw_menu_top_item.html",'
    {{entry.get(\'label\')}}
    '),a.put("uikit/mw-menu/directives/templates/mw_sidebar_menu.html",'
    '),a.put("uikit/mw-modal/directives/templates/mw_modal.html",''),a.put("uikit/mw-modal/directives/templates/mw_modal_body.html",''),a.put("uikit/mw-modal/directives/templates/mw_modal_confirm.html",'
    '),a.put("uikit/mw-modal/directives/templates/mw_modal_footer.html",''),a.put("uikit/mw-toast/directives/templates/mw_toasts.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_alert.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_arrow_button.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_arrow_link.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_badge.html",''),a.put("uikit/mw-ui-components/directives/templates/mw_bread_crumb.html",'
    {{title}}
    '),a.put("uikit/mw-ui-components/directives/templates/mw_bread_crumbs_holder.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_collapsible.html",'
    {{title}}
    '),a.put("uikit/mw-ui-components/directives/templates/mw_hide_on_request.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_icon.html",' '),a.put("uikit/mw-ui-components/directives/templates/mw_indefinite_loading.html",'
    {{\'UiComponents.mwIndefiniteLoading.loading\' | i18n | uppercase}}
    '),a.put("uikit/mw-ui-components/directives/templates/mw_option_group.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_panel.html",'

    {{title}}

    '),a.put("uikit/mw-ui-components/directives/templates/mw_spinner.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_star_rating.html",''),a.put("uikit/mw-ui-components/directives/templates/mw_tab_bar.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_tab_pane.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_text_collapsible.html",'
    {{ text() }} {{ showLessOrMore() | i18n }}
    '),a.put("uikit/mw-ui-components/directives/templates/mw_timeline.html",'

    '),a.put("uikit/mw-ui-components/directives/templates/mw_timeline_entry.html",'
  • '),a.put("uikit/mw-ui-components/directives/templates/mw_timeline_fieldset.html",'
    {{mwTitle}}
    {{ hiddenEntriesText() | i18n:{count:entries.length} }}
    '),a.put("uikit/mw-ui-components/directives/templates/mw_view_change_loader.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_wizard.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_wizard_navigation.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_wizard_progress.html",'
    '),a.put("uikit/mw-ui-components/directives/templates/mw_wizard_step.html",'
    '),a.put("uikit/mw-utils/modals/templates/mw_leave_confirmation_modal.html",'

    {{ text }}

    '),a.put("uikit/templates/mwSidebarBb/mwSidebarInput.html",'
    '),a.put("uikit/mw-exception-handler/i18n/de_DE.json",'{ "ExceptionHandler": { "mwExceptionModal": { "title": "Es ist etwas schiefgelaufen", "unknownError": "Leider ist ein unvorhergesehener Fehler aufgetreten. Sie können uns einen Fehlerbericht senden, sodass wir diesen schnellst möglich beseitigen können. Vielen Dank.", "userMessage": "Sie können uns zusätzlich ihre letzten Schritte beschreiben, sodass wir den Fehler schneller nachstellen können.", "userMessagePlaceholder": "(Optional)", "report": "Fehler melden", "thanks": "Vielen Dank für Ihre Rückmeldung. Wir werden uns umgehend um diesen Fehler kümmern." } } }'),a.put("uikit/mw-exception-handler/i18n/en_US.json",'{ "ExceptionHandler": { "mwExceptionModal": { "title": "Something went wrong", "unknownError": "Unfortunatly something went wrong. You can report this error so we can fix it. Thank you.", "userMessage": "You can leave some additional information to make it easier for us to reproduce the error", "userMessagePlaceholder": "(Optional)", "report": "Report error", "thanks": "Thanks for your feedback. We will have a look at this error as soon as possible." } } }'),a.put("uikit/mw-form/i18n/de_DE.json",'{ "mwForm": { "leaveConfirmation": "Ihre Änderungen wurden noch nicht gespeichert. Wenn Sie diese Seite verlassen gehen diese verloren!", "formActions": { "save": "Speichern", "cancel": "Abbrechen" } }, "mwErrorMessages": { "required": "ist ein Pflichtfeld", "hasToBeValidEmail": "muss eine valide E-Mail Adresse sein", "hasToMatchPattern": "muss dem Muster entsprechen", "hasToBeValidUrl": "muss eine valide URL sein", "hasToBeValidPhoneNumber": "muss die Ländervorwahl beinhalten zum Beispiel: +49 1577 / 8344", "hasToBeMin": "muss mindestens {{min}} sein", "hasToBeMinLength": "muss mindestens {{ngMinlength}} Zeichen haben", "hasToBeSmaller": "darf maximal {{max}} sein", "hasToBeSmallerLength": "darf maximal {{ngMaxlength}} Zeichen haben", "invalidInput": "Eingabe is ungültig" } }'),a.put("uikit/mw-form/i18n/en_US.json",'{ "mwForm": { "leaveConfirmation": "Your changes haven\'t been saved yet. If you leave this page all changes will be discarded!", "formActions": { "save": "Save", "cancel": "Cancel" } }, "mwErrorMessages": { "required": "is required", "hasToBeValidEmail": "has to be a valid e-mail", "hasToMatchPattern": "has to match the pattern", "hasToBeValidUrl": "has to be a valid URL", "hasToBeValidPhoneNumber": "must include the country code e.g. +49 1577 834-443", "hasToBeMin": "has to be at least {{min}}", "hasToBeMinLength": "has to have a least {{ngMinlength}} chars", "hasToBeSmaller": "must not be greater than {{max}}", "hasToBeSmallerLength": "must not have more chars than {{ngMaxlength}}", "invalidInput": "input is invalid" } }'),a.put("uikit/mw-inputs/i18n/de_DE.json",'{ "mwSelectBox": { "pleaseSelect": "Option auswählen" } }'),a.put("uikit/mw-inputs/i18n/en_US.json",'{ "mwSelectBox": { "pleaseSelect": "Select an option" } }'),a.put("uikit/mw-list/i18n/de_DE.json",'{ "List": { "mwListHead": { "items": "Einträge", "selectAll": "Alle selektieren", "clearSelection": "Selektion aufheben", "itemSelected": "{{name}} ist selektiert", "itemsSelected": "{{count}} von {{total}} {{name}} sind selektiert", "itemAmount": "{{total}} {{name}}", "searchFor": "{{name}} suchen", "notAvailable": "N/V", "notAvailableTooltip": "Der Eintrag ist nicht verfügbar. Eventuell wurde dieser gelöscht." }, "mwListFooter": { "noneFound": "Es wurden keine Einträge gefunden" } } }'), +a.put("uikit/mw-list/i18n/en_US.json",'{ "List": { "mwListHead": { "items": "Items", "selectAll": "Select all", "clearSelection": "Clear selection", "itemSelected": "{{name}} is selected", "itemsSelected": "{{count}} out of {{total}} {{name}} are selected", "itemAmount": "{{total}} {{name}}", "searchFor": "Search for {{name}}", "notAvailable": "N/V", "notAvailableTooltip": "The entry is not available anymore. Maybe is has been deleted." }, "mwListFooter": { "noneFound": "No entries have been found." } } }'),a.put("uikit/mw-modal/i18n/de_DE.json",'{ "Modal": { "mwModalConfirm": { "areYouSure": "Sind Sie sich sicher?" } } }'),a.put("uikit/mw-modal/i18n/en_US.json",'{ "Modal": { "mwModalConfirm": { "areYouSure": "Are you sure?" } } }'),a.put("uikit/mw-ui-components/i18n/de_DE.json",'{ "UiComponents": { "mwToggle": { "on": "An", "off": "Aus" }, "mwTimelineFieldset": { "entriesHiddenSingular": "1 Eintrag ist ausgeblendet", "entriesHiddenPlural": "{{count}} Einträge sind ausgeblendet" }, "mwTextCollapsible": { "showMore": "mehr anzeigen", "showLess": "weniger anzeigen" }, "mwButtonHelp": { "isDisabledBecause": "Dieser Button ist deaktiviert weil:" }, "mwIndefiniteLoading": { "loading": "Lade Daten..." } } }'),a.put("uikit/mw-ui-components/i18n/en_US.json",'{ "UiComponents": { "mwToggle": { "on": "On", "off": "Off" }, "mwTimelineFieldset": { "entriesHiddenSingular": "One entry is hidden", "entriesHiddenPlural": "{{count}} entries are hidden" }, "mwTextCollapsable": { "showMore": "show more", "showLess": "show less" }, "mwButtonHelp": { "isDisabledBecause": "This button is currently disabled because:" }, "mwIndefiniteLoading": { "loading": "Loading data..." } } }'),a.put("uikit/mw-utils/i18n/de_DE.json",'{ "Utils": { "ok": "Ok", "cancel": "Abbrechen", "mwLeaveConfirmationModal": { "title": "Möchten Sie wirklich die aktuelle Seite verlassen?", "continue": "Fortfahren", "stay": "Auf Seite bleiben" } } }'),a.put("uikit/mw-utils/i18n/en_US.json",'{ "Utils": { "ok": "Ok", "cancel": "Cancel", "mwLeaveConfirmationModal": { "title": "Do you really want to leave the current page?", "continue": "Continue", "stay": "Stay on this page" } } }'),a.put("uikit/mw_ui_icons.json",'{ "check": "fa-check", "angleLeft": "fa-angle-left", "angleRight": "fa-angle-right", "angleUp": "fa-angle-up", "angleDown": "fa-angle-down", "caretRight": "fa-caret-right", "sort": "fa-sort", "sortAsc": "fa-sort-asc", "sortDesc": "fa-sort-desc", "warning": "fa-warning", "cross": "fa-times", "chevronUpCircle": "fa-chevron-circle-up", "chevronDownCircle": "fa-chevron-circle-down", "question": "fa-question", "questionCircle": "fa-question-circle-o", "refresh": "fa-refresh", "gears": "fa-cog", "undo": "fa-undo", "info": "fa-info" }')}]),window.mwUI.Backbone={hostName:"",basePath:"",Selectable:{},Utils:{},use$http:!0},b.module("mwUI.Backbone",[]),mwUI.Backbone.Utils.concatUrlParts=function(){var a=_.toArray(arguments),b=[];return a=_.compact(a),_.each(a,function(a,c){a=0===c?a.replace(/\/$/g,""):a.replace(/^\/|\/$/g,""),b.push(a)}),b.join("/")},mwUI.Backbone.Utils.getUrl=function(a){var b,c,d;if(!(a instanceof mwUI.Backbone.Model||a instanceof mwUI.Backbone.Collection))throw new Error("An instance of a collection or a model has to be passed as argument to the function");if(b=_.result(a,"hostName")||"",c=_.result(a,"basePath")||"",d=_.result(a,"endpoint"),!d||0===d.length)throw new Error("An endpoint has to be specified");return window.mwUI.Backbone.Utils.concatUrlParts(b,c,d)},mwUI.Backbone.Utils.request=function(a,b,c,d){c=c||{};var e,f={url:a,type:b};return d&&(f.instance=d),a&&!a.match(/\/\//)&&(e=d instanceof mwUI.Backbone.Model||d instanceof mwUI.Backbone.Collection?_.result(d,"hostName"):mwUI.Backbone.hostName||"",f.url=mwUI.Backbone.Utils.concatUrlParts(e,a)),Backbone.ajax(_.extend(f,c))},mwUI.Backbone.NestedModel=Backbone.NestedModel=Backbone.Model.extend({nested:function(){return{}},_prepare:function(){var a=this.nested(),b={};for(var c in a){if("function"!=typeof a[c])throw new Error("Nested attribute "+c+" is not a valid constructor. Do not set an instance as nested attribute.");var d=new a[c];d.parent=this,b[c]=d}return b},_setNestedModel:function(a,b){if(_.isObject(b))this.get(a).set(b);else{var c=this.get(a).idAttribute;this.get(a).set(c,b)}},_setNestedCollection:function(a,b){if(_.isObject(b)&&!_.isArray(b))this.get(a).add(b);else if(_.isArray(b))b.forEach(function(b){this._setNestedCollection(a,b)}.bind(this));else{var c=this.get(a).model.prototype.idAttribute,d={};d[c]=b,this.get(a).add(d)}},_setNestedAttributes:function(a){for(var b in a){var c=this.nested(),d=a[b],e=c[b];!e||d instanceof e||!this.get(b)||(this.get(b)instanceof Backbone.Model?this._setNestedModel(b,d):this.get(b)instanceof Backbone.Collection&&this._setNestedCollection(b,d),delete a[b])}return a},_nestedModelToJson:function(a){var b;return b=a instanceof Backbone.NestedModel?a._prepareDataForServer():a.toJSON()},_prepareDataForServer:function(){var a=_.extend({},this.attributes),b=this.nested();for(var c in b){var d=this.get(c);if(d instanceof Backbone.Model)a[c]=this._nestedModelToJson(d);else if(d instanceof Backbone.Collection){var e=[];d.each(function(a){e.push(this._nestedModelToJson(a))}.bind(this)),a[c]=e}}return this.compose(a)},constructor:function(a,b){return b=b||{},b.parse&&(a=this.parse(a),b.parse=!1),this.attributes=this._prepare(),this.set(a),a=this.attributes,Backbone.Model.prototype.constructor.call(this,a,b)},set:function(a,b){var c={};return _.isString(a)?c[a]=b:_.isObject(a)&&(c=a),_.isObject(b)||(b=null),c=this._setNestedAttributes(c),Backbone.Model.prototype.set.call(this,c,b)},compose:function(a){return a},toJSON:function(a){return a?this._prepareDataForServer():Backbone.Model.prototype.toJSON.apply(this,arguments)},clear:function(a){var b={};for(var c in this.attributes)this.get(c)instanceof Backbone.Model?this.get(c).clear():this.get(c)instanceof Backbone.Collection?this.get(c).reset():b[c]=void 0;return this.set(b,_.extend({},a,{unset:!0}))}}),mwUI.Backbone.Selectable.Model=function(a,b){var c=a,d=b.selected||!1;this.isInCollection=!1,this.hasDisabledFn="function"==typeof b.isDisabled||!1,this.isDisabled=function(){return this.hasDisabledFn?b.isDisabled.apply(a,arguments):!1},this.isSelected=function(){return d},this.select=function(b){b=b||{},this.isDisabled()&&!b.force||this.isSelected()||(d=!0,b.silent||this.trigger("change change:select",a,this))},this.unSelect=function(b){b=b||{},this.isSelected()&&(d=!1,b.silent||this.trigger("change change:unselect",a,this))},this.toggleSelect=function(){this.isSelected()?this.unSelect():this.select()};var e=function(){if(!(c instanceof Backbone.Model))throw new Error("First parameter has to be the instance of a model")};e.call(this)},_.extend(mwUI.Backbone.Selectable.Model.prototype,Backbone.Events),mwUI.Backbone.SelectableModel=Backbone.SelectableModel=Backbone.Model.extend({selectable:!0,selectableOptions:function(){return{selected:!1,isDisabled:null}},selectableModelConstructor:function(a){this.selectable&&(this.selectable=new mwUI.Backbone.Selectable.Model(this,this.selectableOptions.call(this,a))),this.on("destroy",function(){this.collection&&this.collection.filterable&&this.collection.filterable.getTotalAmount()>0&&this.collection.filterable.setTotalAmount(this.collection.filterable.getTotalAmount()-1)})},constructor:function(a,b){var c=Backbone.Model.prototype.constructor.call(this,a,b);return this.selectableModelConstructor(b),c}}),mwUI.Backbone.Model=mwUI.Backbone.NestedModel.extend({selectable:!0,hostName:function(){return mwUI.Backbone.hostName},basePath:function(){return mwUI.Backbone.basePath},endpoint:null,selectableOptions:mwUI.Backbone.SelectableModel.prototype.selectableOptions,urlRoot:function(){return mwUI.Backbone.Utils.getUrl(this)},constructor:function(){var a=mwUI.Backbone.NestedModel.prototype.constructor.apply(this,arguments);return mwUI.Backbone.SelectableModel.prototype.selectableModelConstructor.apply(this,arguments),a},getEndpoint:function(){return this.urlRoot()},setEndpoint:function(a){this.endpoint=a},sync:function(a,b,c){return c.instance=this,mwUI.Backbone.NestedModel.prototype.sync.call(this,a,b,c)},request:function(a,b,c){return mwUI.Backbone.Utils.request(a,b,c,this)}}),mwUI.Backbone.Filter=function(){var a=function(a,b){return _.isUndefined(a)||null===a||""===a||0===a.length||_.isArray(a)&&0===_.compact(a).length?null:b},b=function(b,c){var d=!1;if(!_.isObject(b))throw console.log(b),new Error("The argument values has to be an object");for(var e in b)a(b[e],!0)?d=!0:delete c[e];return d?c:null};return{containsString:function(b,c){return a(c,{type:"containsString",fieldName:b,contains:c})},string:function(b,c){return a(c,{type:"string",fieldName:b,value:c})},and:function(a){return this.logOp(a,"AND")},nand:function(a){return this.logOp(a,"NAND")},or:function(a){return this.logOp(a,"OR")},logOp:function(a,b){return a=_.without(a,null),0===a.length?null:{type:"logOp",operation:b,filters:a}},"boolean":function(b,c){return a(c,{type:"boolean",fieldName:b,value:c})},stringMap:function(b,c,d){return"%%"===d&&(d=""),a(d,{type:"stringMap",fieldName:b,value:d,key:c})},stringEnum:function(b,c){return a(c,{type:"stringEnum",fieldName:b,values:_.flatten(c)})},"long":function(b,c){return a(c,{type:"long",fieldName:b,value:c})},like:function(b,c){return a(c,{type:"like",fieldName:b,like:c})},notNull:function(b){return a(!0,{type:"null",fieldName:b})},dateRange:function(a,c,d){return c=c?+new Date(c):null,d=d?+new Date(d):null,b({min:c,max:d},{type:"dateRange",fieldName:a,min:c,max:d})},longRange:function(a,c,d){return b({min:c,max:d},{type:"longRange",fieldName:a,min:c,max:d})}}},mwUI.Backbone.Filterable=function(a,b){b=b||{};var c,d,e=a,f=b.limit,g=f?b.offset:!1,h=b.page||1,i=b.perPage||30,j=b.customUrlParams||{},k=b.filterValues||{},l=b.filterDefinition,m=b.sortOrder,n=function(a){return JSON.parse(JSON.stringify(a))};this.filterValues={},this.customUrlParams={},this.fields=b.fields,this.filterIsSet=!1,this.hasFilterChanged=function(a){return JSON.stringify(a)!==JSON.stringify(d)},this.getRequestParams=function(a){a=a||{},a.params=a.params||{};var b=this.getFilters();return b&&(a.params.filter=b),i&&h&&(f||_.isUndefined(f))&&(a.params.limit=i,a.params.offset=h>1?i*(h-1):0),m&&m.length>0&&(a.params.sortOrder=m),(f||g)&&(a.params.limit=f,a.params.offset=g),f===!1&&delete a.params.limit,this.fields&&this.fields.length>0&&(a.params.field=this.fields),this.customUrlParams&&_.extend(a.params,_.result(this,"customUrlParams")),a.params.getNonpagedCount=!0,d=b,a.params},this.getInitialFilterValues=function(){return k},this.setInitialFilterValues=function(a){for(var b in a)this.filterValues[b]===k[b]&&(this.filterValues[b]=a[b]);_.extend(k,a),this.filterValues=_.extend({},k,this.filterValues)},this.setLimit=function(a){f=a,g=g||0},this.setTotalAmount=function(a){c=a},this.getTotalAmount=function(){return c},this.loadPreviousPage=function(){return h-=1,e.fetch({remove:!1})},this.hasPreviousPage=function(){return h>=1},this.loadNextPage=function(){return h+=1,e.fetch({remove:!1})},this.hasNextPage=function(){return c&&c>e.length},this.getPage=function(){return h},this.setPage=function(a){h=a},this.getTotalPages=function(){return Math.floor(c/i)},this.setSortOrder=function(b){h=1,m=b,a.trigger("change:sortOrder",b)},this.getSortOrder=function(){return m},this.getInvalidFilterKeys=function(a){var b=[];return _.forEach(a,function(a,c){_.has(this.filterValues,c)||b.push(c)}.bind(this)),b},this.setFilters=function(b,c){c=c||{};var d=this.getInvalidFilterKeys(b);if(d.length>0)throw new Error("[mwFilterable] The filter keys '"+d.join(",")+"' do not exist, did you add them to filterValues of the model?");_.forEach(b,function(b,d){this.filterValues[d]=b;var e={};e[d]=b,(_.isUndefined(c.silent)||!c.silent)&&a.trigger("change:filterValue",e)},this),this.resetPagination(),this.filterIsSet=!0},this.getFilters=function(){return _.isFunction(l)?l.apply(this):void 0},this.resetFilters=function(){this.filterValues=n(k),this.customUrlParams=j,this.resetPagination(),this.filterIsSet=!1},this.resetPagination=function(){this.setPage(b.page||1)},function(){if(!(e instanceof Backbone.Collection))throw new Error("First parameter has to be the instance of a collection");b.filterValues&&(k=n(b.filterValues)),this.resetFilters()}.bind(this)()},mwUI.Backbone.FilterableCollection=Backbone.FilterableCollection=Backbone.Collection.extend({selectable:!0,filterableOptions:function(){return{limit:void 0,offset:!1,page:1,perPage:30,filterValues:{},customUrlParams:{},filterDefinition:function(){},fields:[],sortOrder:""}},filterableCollectionConstructor:function(a){this.filterable&&(this.filterable=new mwUI.Backbone.Filterable(this,this.filterableOptions.call(this,a)))},constructor:function(a,b){var c=Backbone.Collection.prototype.constructor.call(this,a,b);return this.filterableCollectionConstructor(b),c},fetch:function(a){if(a=a||{},this.filterable){var b=this.filterable.getRequestParams(a);window.mwUI.Backbone.use$http?(a.params=a.params||{},_.extend(a.params,b)):(a.data=a.data||{},_.extend(a.data,b))}return Backbone.Collection.prototype.fetch.call(this,a)}}),mwUI.Backbone.Selectable.Collection=function(a,b){var c=a,d=b||{},e=!0,f=d.isSingleSelection||!1,g=d.addPreSelectedToCollection||!1,h=d.unSelectOnRemove,i=b.preSelected,j=!!b.preSelected,k=new(mwUI.Backbone.Collection.extend({selectable:!1,filterable:!1})),l=function(){if(i instanceof Backbone.Model)this.preSelectModel(i);else{if(!(i instanceof Backbone.Collection))throw new Error("The option preSelected has to be either a Backbone Model or Collection");this.preSelectCollection(i)}},m=function(a){k.get(a)||this.select(a)},n=function(a){k.get(a)&&this.unSelect(a)},o=function(a,b){b=b||{},(b.unset||!a.id||a.id.length<1)&&this.unSelect(a)},p=function(a){a.selectable.off("change:select",m,this),a.selectable.on("change:select",m,this)},q=function(a){a.selectable.off("change:unselect",n,this),a.selectable.on("change:unselect",n,this)},r=function(a,b){if(a&&a.selectable){var d=k.get(a);d?(c.get(a)?(a.selectable.isInCollection=!0,d.selectable.isInCollection=!0):(a.selectable.isInCollection=!1,d.selectable.isInCollection=!1),a.selectable.select(b),d.selectable.select(b)):a.selectable.unSelect(b),p.call(this,a),q.call(this,a)}},s=function(a,b){j&&(this.isSingleSelection()?i=b:(i.remove(a,{silent:!0}),i.add(b,{silent:!0})))},t=function(a){var b=this.getSelected().get(a);b&&(this.unSelect(b,{silent:!0}),this.select(a,{silent:!0}),s.call(this,b,a),r.call(this,b,{silent:!0}))};this.getSelected=function(){return k},this.getDisabled=function(){var a=new Backbone.Collection;return e&&c.each(function(b){b.selectable&&b.selectable.isDisabled()&&a.add(b)}),a},this.select=function(a,b){if(b=b||{},!(a instanceof Backbone.Model))throw new Error("The first argument has to be a Backbone Model");a instanceof c.model||(a=new c.model(a.toJSON())),!a.selectable||a.selectable.isDisabled()&&!b.force||(f&&this.unSelectAll(),c.get(a)&&(a=c.get(a)),a.on("change",o,this),k.add(a,b),r.call(this,a,b),b.silent||this.trigger("change change:add",a,this))},this.selectAll=function(){c.each(function(a){this.select(a)},this)},this.unSelect=function(a,b){b=b||{},a.off("change",o,this),k.remove(a,b),r.call(this,a,b),b.silent||this.trigger("change change:remove",a,this)},this.unSelectAll=function(){this.getSelected().secureEach(function(a){this.unSelect(a)},this)},this.toggleSelectAll=function(){this.allSelected()?this.unSelectAll():this.selectAll()},this.allSelected=function(){var a=this.getDisabled().length;return this.getSelected().length===c.length-a},this.allDisabled=function(){return this.getDisabled().length===c.length},this.isSingleSelection=function(){return f},this.setSingleSelection=function(a){if(i instanceof Backbone.Model){if(!a)throw new Error("isSingleSelection can not be set to false when preselected is a model!");f=!0}else f=a},this.reset=function(){this.unSelectAll(),l.call(this)},this.preSelectModel=function(a){a.id&&(j=!0,!c.get(a)&&g?c.add(a):c.get(a)&&(a=c.get(a)),this.select(a,{force:!0,silent:!0}))},this.preSelectCollection=function(a){a.each(function(a){this.preSelectModel(a)},this),a.on("add",function(a){this.preSelectModel(a)},this),a.on("remove",function(a){this.unSelect(a)},this)},this.setCollectionFromSelection=function(a){var b=this.getSelected();if(!(a instanceof mwUI.Backbone.Collection))throw new Error("[Selectable] The passed collection is not an instance of mwUI.Backbone.Collection");return a.replace(b.toJSON()),a},this.setModelFromSelection=function(a){var b=this.getSelected();if(!(a instanceof Backbone.Model))throw new Error("[Selectable] The passed model is not an instance of Backbone.Model");return 0===b.length?a.clear():a.set(b.first().toJSON()),a},this.useSelectionFor=function(a){return a instanceof Backbone.Model?this.setModelFromSelection(a):a instanceof Backbone.Collection?this.setCollectionFromSelection(a):void 0};var u=function(){if(!(c instanceof Backbone.Collection))throw new Error("The first parameter has to be from type Backbone.Collection");c.on("add",function(a){e=a.selectable.hasDisabledFn,r.call(this,a),t.call(this,a)},this),c.on("remove",function(a){h?this.unSelect(a):r.call(this,a)},this),c.on("reset",function(){h?this.unSelectAll():this.getSelected().each(function(a){r.call(this,a)},this)},this),i instanceof Backbone.Model?this.setSingleSelection(!0):this.setSingleSelection(d.isSingleSelection||!1),j&&l.call(this)}.bind(this);u.call(this)},_.extend(mwUI.Backbone.Selectable.Collection.prototype,Backbone.Events),mwUI.Backbone.SelectableCollection=Backbone.SelectableCollection=Backbone.Collection.extend({selectable:!0,selectableOptions:function(){return{isSingleSelection:!1,addPreSelectedToCollection:!1,unSelectOnRemove:!1,preSelected:new Backbone.Collection}},selectableCollectionConstructor:function(a){this.selectable&&(this.selectable=new mwUI.Backbone.Selectable.Collection(this,this.selectableOptions.call(this,a)))},constructor:function(a,b){var c=Backbone.Collection.prototype.constructor.call(this,a,b);return this.selectableCollectionConstructor(b),c}}),mwUI.Backbone.Collection=Backbone.Collection.extend({selectable:!0,filterable:!0,hostName:function(){return mwUI.Backbone.hostName},basePath:function(){return mwUI.Backbone.basePath},endpoint:null,selectableOptions:mwUI.Backbone.SelectableCollection.prototype.selectableOptions,filterableOptions:mwUI.Backbone.FilterableCollection.prototype.filterableOptions,model:mwUI.Backbone.Model,secureEach:function(a,b){_.pluck(this.models,"cid").forEach(function(c,d){var e=this.get(c,d);a.call(b,e,d,this.models)}.bind(this))},url:function(){return window.mwUI.Backbone.Utils.getUrl(this)},getEndpoint:function(){return this.url()},setEndpoint:function(a){this.endpoint=a},replace:function(a){this.reset(a),this.trigger("replace",this)},constructor:function(){var a=Backbone.Collection.prototype.constructor.apply(this,arguments);return mwUI.Backbone.SelectableCollection.prototype.selectableCollectionConstructor.apply(this,arguments),mwUI.Backbone.FilterableCollection.prototype.filterableCollectionConstructor.apply(this,arguments),a},fetch:function(){return mwUI.Backbone.FilterableCollection.prototype.fetch.apply(this,arguments)},request:function(a,b,c){return window.mwUI.Backbone.Utils.request(a,b,c,this)}}),b.module("mwUI.Backbone").directive("mwCollection",function(){return{require:["?ngModel","?^form"],link:function(a,b,c,d){var e,f,g;d.length>0&&(f=d[0]),d.length>1&&(g=d[1]);var h=function(){e.length>0?(f.$setViewValue(e),f.$render()):(f.$setViewValue(null),f.$render())},i=function(){e=a.$eval(c.mwCollection),e&&(h(),e.on("add remove reset",h),f.$setPristine(),g&&g.$setPristine(f))};if(f)if(a.mwModel)i();else var j=a.$watch("mwCollection",function(){j(),i()})}}}),b.module("mwUI.Backbone").directive("mwModel",function(){return{require:["?ngModel","?^form"],link:function(a,c,d,e){var f,g,h,i;e.length>0&&(h=e[0]),e.length>1&&(i=e[1]);var j=function(){var a=f.get(g);h.$formatters.forEach(function(b){a=b(a)}),h.$setViewValue(a),h.$render()},k=function(){var a={};a[g]=h.$modelValue,f.set(a,{fromNgModel:!0})},l=function(){var a=d.mwModelAttr,c=d.ngModel;return a&&a.length>0?a:b.isUndefined(a)&&c?c.split(".").pop():void 0},m=function(a,b,c){c.fromNgModel||j()},n=function(){if(f=a.$eval(d.mwModel),g=l(),h&&f&&g){if(f.on("change:"+g,m),h.$viewChangeListeners.push(k),h.$parsers.push(function(a){return k(),a}),f.get(g)&&h.$modelValue&&f.get(g)!==h.$modelValue)throw new Error("The ng-model and the backbone model can not have different values during initialization!");f.get(g)?(j(),h.$setPristine(),i&&i.$setPristine(h)):h.$modelValue&&k()}};if(a.mwModel&&l())n();else var o=a.$watch("mwModel",function(){o(),n()}),p=a.$watch("mwModelAttr",function(){p(),n()});a.$on("$destroy",function(){f&&g&&f.off("change:"+g,m)})}}});var c,d,e=Backbone.ajax,f=Backbone.sync;b.module("mwUI.Backbone").run(["$http","$q",function(a,b){c=a,d=b}]),Backbone.ajax=function(a){return mwUI.Backbone.use$http&&c?(a.method=a.type,a.success||a.error||!a.instance||(a.instance.isSynchronising=!0,a.instance.trigger("request")),c.apply(b,arguments).then(function(b){return a.success&&"function"==typeof a.success?a.success(b):a.instance&&(a.instance.isSynchronising=!1,a.instance.trigger("sync")),b},function(b){return a.error&&"function"==typeof a.error?a.error(b):a.instance&&(a.instance.isSynchronising=!1,a.instance.trigger("error")),d.reject(b)})):e.apply(this,arguments)},Backbone.sync=function(a,b,c){return c=c||{},_.isUndefined(c.wait)&&(c.wait=!0),b.isSynchronising=!0,f.call(Backbone,a,b,c).then(function(){return b.isSynchronising=!1,b},function(a){return b.isSynchronising=!1,d.reject(a)})},window.mwUI.Utils={ViewportBreakPoints:{XS:"xs",SM:"sm",MD:"md",LG:"lg"},shims:{}},b.module("mwUI.Utils",["mwUI.i18n","mwUI.Modal"]),b.module("mwUI.Utils").directive("mwAppendRouteClass",function(){return{link:function(a,b){var c=b.attr("class"),d=function(){b.attr("class",c)};a.$on("$routeChangeSuccess",function(a,c){d(),c&&c.cssClasses&&b.addClass(c.cssClasses)})}}}),b.module("mwUI.Utils").directive("mwDraggable",["$timeout",function(a){return{restrict:"A",scope:{mwDragData:"=",mwDragstart:"&",mwDragend:"&",mwDropEffect:"@"},link:function(b,c){c.attr("draggable",!0),c.addClass("draggable",!0),b.mwDragstart&&c.on("dragstart",function(c){c.originalEvent.dataTransfer.setData("text",JSON.stringify(b.mwDragData)),c.originalEvent.dataTransfer.effectAllowed=b.mwDropEffect,a(function(){b.mwDragstart({event:c,dragData:b.mwDragData})})}),c.on("dragend",function(c){b.mwDragend&&a(function(){b.mwDragend({event:c})})})}}}]),b.module("mwUI.Utils").directive("mwDroppable",["$timeout",function(a){return{restrict:"A",scope:{mwDropData:"=",mwDragenter:"&",mwDragleave:"&",mwDragover:"&",mwDrop:"&",disableDrop:"="},link:function(b,c){c.addClass("droppable");var d=function(a){var b=a.originalEvent.dataTransfer.getData("text");return b?JSON.parse(b):void 0};b.mwDragenter&&c.on("dragenter",function(d){b.disableDrop!==!0&&c.addClass("drag-over"),a(function(){b.mwDragenter({event:d})})}),b.mwDragleave&&c.on("dragleave",function(d){c.removeClass("drag-over"),a(function(){b.mwDragleave({event:d})})}),b.mwDrop&&c.on("drop",function(e){c.removeClass("drag-over"),e.stopPropagation&&e.stopPropagation();var f=d(e);return a(function(){b.mwDrop({event:e,dragData:f,dropData:b.mwDropData})}),!1});var e=function(a){return b.disableDrop!==!0?(a.preventDefault&&a.preventDefault(),!1):void 0};c.on("dragover",e),b.mwDragover&&c.on("dragover",function(c){a(function(){b.mwDragover({event:c})})}),b.$on("$destroy",function(){c.off()})}}}]),b.module("mwUI.Utils").directive("mwInfiniteScroll",["$window",function(a){return{restrict:"A",link:function(c,d,e){var f,g,h,i,j=!1,k=0;if(e.mwListCollection?f=c.$eval(e.mwListCollection).getCollection():e.collection?f=c.$eval(e.collection):console.warn("No collection was found for the infinite scroll pleas pass it as scope attribute"),f&&(!f||f.filterable)){var l=function(){return!j&&f.filterable.hasNextPage()?(j=!0,k++,f.filterable.loadNextPage().then(function(){j=!1})):void 0},m=function(){var a=4,b=9;return Math.min(a+k,b)/10},n=function(){var a=i[0].clientHeight||i.height(),b=a-h.height(),c=m();h.scrollTop()/b>c&&l()};if(e.scrollContainerSelector||e.scrollContentSelector){if(e.scrollContainerSelector&&d.parents(e.scrollContainerSelector).length>0)h=d.parents(e.scrollContainerSelector).first();else{if(e.scrollContainerSelector&&0===d.parents(e.scrollContainerSelector).length)throw new Error("No parent of the infinite scroll element with the selector "+e.scrollContainerSelector+" could be found!");h=d}if(e.scrollContentSelector&&d.find(e.scrollContentSelector).length>0)i=d.find(e.scrollContentSelector).first();else{if(e.scrollContentSelector&&0===d.find(e.scrollContentSelector).length)throw new Error("No child of the infinite scroll element with the selector "+e.scrollContentSelector+" could be found!");i=d}}else d.parents(".modal").length?(h=d.parents("*[mw-modal-body]"),i=d.parents(".modal-body")):(h=b.element(a),i=b.element(document));if(h===i)throw new Error("The scrollContainerElement can not be the same as the actual scrollContentElement");g=_.throttle(n,500),h.on("scroll",g),c.$on("$destroy",function(){h.off("scroll",g)})}}}}]),b.module("mwUI.Utils").directive("mwLeaveConfirmation",["$window","$rootScope","LeaveConfirmationModal",function(a,c,d){return{scope:{alertBeforeLeave:"=mwLeaveConfirmation",text:"@"},link:function(e){var f=new d,g=function(a){f.setScopeAttributes({nextUrl:a,text:e.text,leaveCallback:function(){e.changeLocationOff()},stayCallback:function(){}}),f.show()};if(e.changeLocationOff=c.$on("$locationChangeStart",function(a,b,c){e.alertBeforeLeave&&c&&b!==c&&(a.preventDefault(),g(b))}),a.onbeforeunload=function(){return e.alertBeforeLeave?e.text:void 0},!b.isDefined(e.text))throw new Error("Please specify a text in the text attribute");e.$on("$destroy",e.changeLocationOff)}}}]),b.module("mwUI.Utils").directive("mwPreventDefault",function(){return{restrict:"A",link:function(a,b,c){if(!c.mwPreventDefault)throw new Error('Directive mwPreventDefault: This directive must have an event name as attribute e.g. mw-prevent-default="click"');b.on(c.mwPreventDefault,function(a){a.preventDefault()})}}}),b.module("mwUI.Utils").directive("mwStopPropagation",function(){return{restrict:"A",link:function(a,b,c){if(!c.mwStopPropagation)throw new Error('Directive mwStopPropagation: This directive must have an event name as attribute e.g. mw-stop-propagation="keyup"');b.on(c.mwStopPropagation,function(a){a.stopPropagation()})}}}),b.module("mwUI.Utils").filter("mwReadableFileSize",function(){return function(a,c,d){if(!a||!b.isNumber(a)||0===a)return"0.0 kB";var e,f=-1,g=["kB","MB","GB","TB","PB","EB","ZB","YB"];void 0!==c&&(f=g.indexOf(c));do a/=1024,f++;while(a>1024);return e=Math.max(a,.1),d?e.toFixed(0)+" "+g[f]:e.toFixed(1)+" "+g[f]}}),b.module("mwUI.Utils").filter("reduceStringTo",function(){return function(a,b){return b&&a&&a.length>b?a.substr(0,b)+"...":a}}),b.module("mwUI.Utils").factory("LeaveConfirmationModal",["Modal",function(a){return a.prepare({templateUrl:"uikit/mw-utils/modals/templates/mw_leave_confirmation_modal.html",controller:"LeaveConfirmationModalController"})}]).controller("LeaveConfirmationModalController",["$scope",function(a){a.stay=function(){a.stayCallback(),a.hideModal()},a["continue"]=function(){if(!a.nextUrl)throw new Error("NextUrl has to be set!");a.leaveCallback(),a.hideModal().then(function(){document.location.href=a.nextUrl})}}]),b.module("mwUI.Utils").service("mwBootstrapBreakpoint",["$rootScope",function(a){var c=[],d=null,e=function(){for(var a in mwUI.Utils.ViewportBreakPoints){var d=b.element('
    ');b.element("body").append(d),c.push(d)}},f=function(){var b=d;c.forEach(function(a){a.is(":visible")&&(d=mwUI.Utils.ViewportBreakPoints[a.attr("data-type")])}),b!==d&&a.$broadcast("mwBootstrapBreakpoint:changed",d)},g=_.debounce(f,200);return e(),f(),b.element(window).on("resize",g),{getActiveBreakpoint:function(){return d}}}]),b.module("mwUI.Utils").provider("BrowserTitleHandler",function(){var a=!0,c="",d=null,e=function(){var a=b.element("head title");a&&!d&&(d=a.text())};this.setNewTitle=function(a){var c=b.element("head title");c&&c.text(a),d||(d=a)},this.setKeepOriginalTitle=function(b){a=b};var f=this;this.$get=function(){return{getOriginalTitle:function(){return d||e(),d},setTitle:function(a){c=a,f.setNewTitle(this.getTitle())},getTitle:function(){return c?a?this.getOriginalTitle()+"—"+c:c:this.getOriginalTitle()}}}}),b.module("mwUI.Utils").service("callbackHandler",["$injector",function(a){return{execFn:function(a,c,d){return c&&b.isArray(c)?a.apply(d,c):a.call(d,c)},getFn:function(c){if(b.isString(c))return a.get(c);if(b.isFunction(c))return c;throw new Error("First argument has to be either a valid service or function")},exec:function(a,b,c){return this.execFn(this.getFn(a),b,c)}}}]),window.mwUI.Utils.Scheduler={},window.mwUI.Utils.Scheduler.Task=window.mwUI.Backbone.Model.extend({defaults:function(){return{callback:function(){},executeInMs:0,_time:0}},getRemainingSleepTime:function(){return this.get("executeInMs")-this.get("_time")},decrementTime:function(a){a=a||1;var b=this.get("_time");this.set("_time",b+a)},canBeExecuted:function(){return this.getRemainingSleepTime()<=0},execute:function(){this.get("callback").apply(this.get("scope")),this.collection&&this.collection.remove(this)},resetTime:function(){this.set("_time",0)},kill:function(){return this.collection?this.collection.remove(this):!1}}),window.mwUI.Utils.Scheduler.TaskRunner=window.mwUI.Backbone.Collection.extend({_timer:!1,_stopped:!1,_startTime:null,_prevValue:null,model:window.mwUI.Utils.Scheduler.Task,_step:function(a){var b,c;this.isStopped()||(this._startTime&&(this._startTime=a),b=a-this._startTime,c=this._prevValue?b-this._prevValue:0,this.length>0&&(this.secureEach(function(a){a.canBeExecuted()?a.execute():a.decrementTime(c)}),this._prevValue=b,window.requestAnimationFrame(this._step.bind(this))))},start:function(){this._stopped=!1,this._startTime=null,this._prevValue=null,this.length>0&&window.requestAnimationFrame(this._step.bind(this))},isRunning:function(){return this.length>0&&!this._stopped},isStopped:function(){return this._stopped},stop:function(){this._stopped=!0},add:function(a,b,c,d){if("function"==typeof a&&(a=new window.mwUI.Utils.Scheduler.Task({id:c||_.uniqueId("task"),callback:a,executeInMs:b,scope:d||window})),mwUI.Backbone.Collection.prototype.add.call(this,a),a&&!_.isFunction(a.get("callback")))throw new Error("[mwScheduler] Task has to be a function");return this.isStopped()||this.start(),a},remove:function(a){var b=this.findWhere({callback:a});return mwUI.Backbone.Collection.prototype.remove.call(this,b||a)},get:function(a){return"function"==typeof a?this.findWhere({callback:a}):mwUI.Backbone.Collection.prototype.get.apply(this,arguments)}}),b.module("mwUI.Utils").service("mwScheduler",function(){var a=new window.mwUI.Utils.Scheduler.TaskRunner;return b.element(document).on("visibilitychange",function(){document.hidden?a.stop():a.start()}.bind(this)),b.element(window).on("blur",a.stop.bind(a)),b.element(window).on("focus",a.start.bind(a)),a}),b.module("mwUI.Utils").service("mwUrlStorage",["$rootScope","$location","$route",function(a,b,c){var d={},e=[],f=null,g=null,h=null,i=function(){c.current&&c.current.$$route&&(f&&f(),g&&g(),null===h&&(h=c.current.$$route.reloadOnSearch),f=a.$on("$routeUpdate",function(){f(),f=null;var d=b.absUrl();g=a.$on("$locationChangeStart",function(a,b){g(),b===d&&a.preventDefault()}),c.current.$$route.reloadOnSearch=h,h=null}),c.current.$$route.reloadOnSearch=!1)},j=function(){var a=_.clone(e);a.forEach(function(a,b){d[a]=null,e.splice(b,1)})},k=function(){var a,c=b.search();a=_.extend(c,d),i(),b.search(a),b.replace()};return a.$on("$routeChangeStart",function(a,b,c){ +b&&c&&b.originalPath!==c.originalPath&&(e.length>0&&j(b.params),k())}),{getItem:function(a){return b.search()[a]},setObject:function(a,b){b=b||{};var c=!1;if(!_.isObject(a))throw new Error("[mwUrlStorage] parameter has to be an object otherwise setItem(key, val) should be called ");for(var f in a)a.hasOwnProperty(f)&&d[f]!==a[f]&&(b.removeOnUrlChange&&-1===e.indexOf(f)&&e.push(f),d[f]=a[f],c=!0);c&&k()},setItem:function(a,b,c){c=c||{},d[a]!==b&&(c.removeOnUrlChange&&-1===e.indexOf(a)&&e.push(a),d[a]=b,k())},removeObject:function(a){var b=!1;if(!_.isObject(a))throw new Error("[mwUrlStorage] parameter has to be an object otherwise deleteItem(key, val) should be called ");for(var c in a)if(a.hasOwnProperty(c)){(d[c]||this.getItem(c))&&(d[c]=null,b=!0);var f=e.indexOf(c);-1!==f&&e.slice(f,1)}b&&k()},removeItem:function(a){var b=e.indexOf(a);return-1!==b&&e.slice(b,1),d[a]?(d[a]=null,k(),!0):!1},clear:function(){d={},e=[],k()}}}]),b.module("mwUI.Utils").service("mwRuntimeStorage",function(){var a={};return{getItem:function(b){return a[b]},setObject:function(b){if(!_.isObject(b))throw new Error("[mwRuntimeStorage] parameter has to be an object otherwise setItem(key, val) should be called");for(var c in b)b.hasOwnProperty(c)&&a[c]!==b[c]&&(a[c]=b[c])},setItem:function(b,c){a[b]!==c&&(a[b]=c)},removeObject:function(b){if(!_.isObject(b))throw new Error("[mwRuntimeStorage] parameter has to be an object otherwise deleteItem(key, val) should be called");for(var c in b)b.hasOwnProperty(c)&&a[c]&&(a[c]=null)},removeItem:function(b){return a[b]?(a[b]=null,!0):!1},clear:function(){a={}}}});var g=function(a,b){for(var c in b)if(c in a&&_.isObject(a[c])&&_.isObject(b[c]))g(a[c],b[c]);else{if(_.isObject(a[c])&&!_.isObject(b[c]))throw new Error("Target["+c+"] is an object but source["+c+"] is from type "+typeof b[c]+"! You can not overwrite an object with type "+typeof b[c]);a[c]=b[c]}return a};window.mwUI.Utils.shims.deepExtendObject=g,window.mwUI.Utils.shims.domObserver=function(a,c,d){var e=new MutationObserver(function(a){c.call(this,a)}),f=a instanceof b.element?a[0]:a;return d=d||{attributes:!0,childList:!0,characterData:!0},e.observe(f,d),e},window.mwUI.Utils.shims.routeToRegExp=function(a){var b=/\((.*?)\)/g,c=/(\(\?)?:\w+/g,d=/\*\w?/g,e=/[\-{}\[\]+?.,\\\^$|#\s]/g;if(!_.isString(a))throw new Error("The route "+JSON.stringify(a)+"has to be a URL");return a=a.replace(e,"\\$&").replace(b,"(?:$1)?").replace(c,function(a,b){return b?a:"([^/?]+)"}).replace(d,"([^?]*?)"),new RegExp("^"+a+"(?:\\?([\\s\\S]*))?$")};var h=[],i=function(a){-1===h.indexOf(a)&&(console.warn(a),h.push(a))};window.mwUI.Utils.shims.deprecationWarning=i,b.module("mwUI.Utils").config(["i18nProvider",function(a){a.addResource("mw-utils/i18n","uikit")}]),b.module("mwUI.ExceptionHandler",["mwUI.Modal","mwUI.i18n","mwUI.UiComponents","mwUI.Utils"]),b.module("mwUI.ExceptionHandler").factory("ExceptionModal",["Modal",function(a){return a.prepare({templateUrl:"uikit/mw-exception-handler/modals/templates/mw_exception_modal.html",controller:"ExceptionModalController"})}]).controller("ExceptionModalController",["$scope","$q","Wizard",function(a,b,c){a.exception=null,a.wizard=c.createWizard("exception"),a.report=function(){b.when(a.successCallback()).then(function(){a.wizard.next()})},a.cancel=function(){a.errorCallback?b.when(a.errorCallback()).then(function(){a.hideModal()}):a.hideModal()},a.close=function(){a.hideModal()}}]),b.module("mwUI.ExceptionHandler").provider("$exceptionHandler",function(){var a=[];return{registerHandler:function(b){a.push(b)},$get:["callbackHandler","$log",function(b,c){return function(d,e){if(d=d||"",e=e||"",_.isString(d)&&d.match(/unhandled rejection/))return console.warn(d),!1;try{a.forEach(function(a){b.exec(a,[d.toString(),e.toString()])})}catch(f){c.error(f)}c.error(d)}}]}}),b.module("mwUI.ExceptionHandler").provider("exceptionHandlerModal",function(){var a=!0,c={displayException:!1,userCanEnterMessage:!1,successCallback:null,errorCallback:null};return{disableExceptionModal:function(){a=!1},setModalOptions:function(a){_.extend(c,a)},$get:["callbackHandler","ExceptionModal",function(d,e){var f=new e,g=function(){var a=b.element.find("div[ng-view]");a&&b.element(a).hide()};return function(b,e){if(a){if(c.successCallback){var h=c.successCallback;c.successCallback=function(){return d.exec(h,[b.toString(),e.toString()])}}if(c.errorCallback){var i=c.errorCallback;c.errorCallback=function(){d.exec(i,[b.toString(),e.toString()])}}f.setScopeAttributes(_.extend({},c,{exception:b.toString(),cause:e})),g(),f.show()}}}]}}),b.module("mwUI.ExceptionHandler").config(["$exceptionHandlerProvider","i18nProvider",function(a,b){a.registerHandler("exceptionHandlerModal"),b.addResource("mw-exception-handler/i18n","uikit")}]),b.module("mwUI.Form",["mwUI.i18n","mwUI.Modal","mwUI.Utils"]),b.module("mwUI.Form").directive("mwFormActions",["$route",function(a){return{scope:{save:"&",cancel:"&",showSave:"=",showCancel:"="},templateUrl:"uikit/mw-form/directives/templates/mw_form_actions.html",link:function(c,d,e){c.form=d.inheritedData("$formController"),c.viewModel={isLoading:!1,hasSave:b.isDefined(e.save),hasCancel:b.isDefined(e.cancel),showSave:!0,showCancel:!0},c.$watch("showSave",function(a){b.isDefined(a)&&(c.viewModel.showSave=a)}),c.$watch("showCancel",function(a){b.isDefined(a)&&(c.viewModel.showCancel=a)});var f=function(){c.viewModel.isLoading=!0},g=function(){c.viewModel.isLoading=!1},h=function(a){c.form&&c.form.$setPristine();var b=c.$eval(a);b&&b.then&&(f(),b.then(g,g))};c.saveFacade=function(){h(c.save)},c.cancelFacade=function(){h(b.isDefined(e.cancel)?c.cancel:function(){return a.reload()})}}}}]),b.module("mwUI.Form").directive("mwErrorMessages",["mwValidationMessages",function(a){return{require:"^ngModelErrors",templateUrl:"uikit/mw-form/directives/templates/mw_error_messages.html",link:function(b,c,d,e){b.errors=e.getErrors,b.getMessageForError=function(b){return a.getMessageFor(b.get("error"),b.get("attrs"))}}}}]);var j=function(){return{restrict:"E",link:function(a,b){b.addClass("form-horizontal"),b.attr("novalidate","true")}}};b.module("mwUI.Form").directive("form",j),b.module("mwUI.Form").directive("mwFormLeaveConfirmation",["$compile",function(a){return{require:"^form",link:function(b,c,d,e){var f=a('
    ')(b),g=!0;b.showConfirmation=function(){return e.$dirty&&g},c.on("submit",function(){g=!1}),c.on("input",function(){g=!0}),c.append(f),b.$on("$destroy",function(){g=!1})}}}]),b.module("mwUI.Form").directive("mwCheckboxWrapper",function(){return{transclude:!0,scope:{label:"@",tooltip:"@"},templateUrl:"uikit/mw-form/directives/templates/mw_checkbox_wrapper.html"}}),b.module("mwUI.Form").directive("mwInputWrapper",function(){return{transclude:!0,scope:{label:"@",tooltip:"@",hideErrors:"="},templateUrl:"uikit/mw-form/directives/templates/mw_input_wrapper.html",controller:function(){var a={dirty:!0,valid:!0,touched:!1},c={required:!1,focused:!1},d="text",e=function(a,c){if(!b.isObject(c))throw new Error("State has to be an object");_.extend(a,c)};this.setModelState=function(b){e(a,b)},this.getModelState=function(){return a},this.setInputState=function(a){e(c,a)},this.getInputState=function(){return c},this.setType=function(a){d=a},this.getType=function(){return d}},link:function(a,b,c,d){a.isValid=function(){return d.getModelState().valid},a.isDirty=function(){return d.getModelState().dirty},a.isTouched=function(){return d.getModelState().touched},a.isRequired=function(){return d.getInputState().required},a.isFocused=function(){return d.getInputState().focused},a.hasError=function(){return!a.hideErrors&&!a.isValid()&&a.isDirty()},a.hasRequiredError=function(){return a.isRequired()&&!a.isValid()},a.getType=d.getType}}}),b.module("mwUI.Form").directive("ngModel",function(){return{require:["ngModel","?^ngModelErrors","?^mwInputWrapper"],link:function(a,c,d,e){var f=e[0],g=e[1],h=e[2],i=_.uniqueId("input_el"),j=function(a,b){var c=_.keys(a),e=_.keys(b),f=_.difference(e,c);g.addErrorsForInput(c,i,_.clone(d)),g.removeErrorsForInput(f,i,_.clone(d))},k=function(){h.setModelState({dirty:f.$dirty,valid:f.$valid,touched:f.$touched})},l=function(){a.$watch(function(){return f.$error},function(a,b){j(a,b)},!0)},m=function(){a.$watch(function(){return f.$error},k,!0),a.$watch(function(){return f.$touched},k),d.$observe("required",function(){h.setInputState({required:b.isDefined(c.attr("required"))})}),c.on("focus blur",function(a){h.setInputState({focused:"focus"===a.type})}),a.$on("$destroy",c.off.bind(c))};g&&l(),h&&m()}}}),b.module("mwUI.Form").directive("ngModelErrors",function(){return{scope:!0,controller:function(){var a=mwUI.Backbone.Model.extend({idAttribute:"error",nested:function(){return{inputIds:Backbone.Collection}}}),b=Backbone.Collection.extend({model:a}),c=new b,d=function(a,b,d){var e=c.get(a);if(e){var f=e.get("inputIds");_.extend(e.get("attrs"),d),f.add({id:b})}else c.add({error:a,inputIds:[b],attrs:d})},e=function(a,b){var d=c.get(a);if(d){var e=d.get("inputIds"),f=e.get(b);f&&(e.remove(f),0===e.length&&c.remove(d))}};this.addErrorsForInput=function(a,b,c){a.forEach(function(a){d(a,b,c)})},this.removeErrorsForInput=function(a,b){a.forEach(function(a){e(a,b)})},this.getErrors=function(){return c}}}}),b.module("mwUI.Form").directive("mwSetDirtyOnModelChange",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.valueWatcher=function(a){return void 0!==a&&null!==a?(d.$setDirty(),d.$setTouched()):d.$setPristine(),!0}}}}),b.module("mwUI.Form").config(["mwValidationMessagesProvider",function(a){a.registerValidator("customValidation","mwErrorMessages.invalidInput")}]).directive("mwCustomErrorValidator",["mwValidationMessages","i18n",function(a,c){return{require:"ngModel",scope:{isValid:"=mwIsValid",errorMsg:"@mwCustomErrorValidator"},link:function(d,e,f,g){g.$validators.customValidation=function(){var a=!1;return a=_.isUndefined(d.isValid)?!0:d.isValid},d.$watch("isValid",function(){a.updateMessage("customValidation",function(){return d.errorMsg&&b.isString(d.errorMsg)&&"false"!==d.errorMsg?d.errorMsg:b.isUndefined(d.errorMsg)?c.get("mwErrorMessages.invalidInput"):""}),g.$validate()})}}}]),b.module("mwUI.Form").provider("mwValidationMessages",function(){var a={},b={},c={},d=function(c,d){if("function"==typeof d)b[c]=d;else if("string"==typeof d)a[c]=d;else if(d)throw new Error("The validation has to be either a string or a function. String can be also a reference to i18n")};this.registerValidator=function(c,e){if(a[c]||b[c])throw new Error("The key "+c+" has already been registered");d(c,e)},this.$get=["$rootScope","i18n",function(e,f){var g=function(b,c){var d=a[b];return f.translationIsAvailable(d)?f.get(d,c):d},h=function(a,c){return b[a](f,c)};return{getRegisteredValidators:function(){return _.extend(a,c)},getMessageFor:function(c,d){return b[c]?h(c,d):a[c]?g(c,d):void 0},updateMessage:function(c,e){if(!a[c]&&!b[c])throw new Error("The key "+c+" is not available. You have to register it first via the provider");d(c,e)}}}]}),b.module("mwUI.Form").config(["i18nProvider","mwValidationMessagesProvider",function(a,b){a.addResource("mw-form/i18n","uikit"),b.registerValidator("required","mwErrorMessages.required"),b.registerValidator("email","mwErrorMessages.hasToBeValidEmail"),b.registerValidator("pattern","mwErrorMessages.hasToMatchPattern"),b.registerValidator("url","mwErrorMessages.hasToBeValidUrl"),b.registerValidator("phone","mwErrorMessages.hasToBeValidPhoneNumber"),b.registerValidator("min","mwErrorMessages.hasToBeMin"),b.registerValidator("minlength","mwErrorMessages.hasToBeMinLength"),b.registerValidator("max","mwErrorMessages.hasToBeSmaller"),b.registerValidator("maxlength","mwErrorMessages.hasToBeSmallerLength")}]),b.module("mwUI.i18n",["mwUI.Backbone"]),b.module("mwUI.i18n").provider("i18n",function(){var a=[],c=[],d={},e=!1,f=null,g=null,h=function(){return _.findWhere(c,{active:!0})},i=function(a){var b=h(),d=_.findWhere(c,{id:a});if(!d)throw new Error("You can not set a locale that has not been registered. Please register the locale first by calling addLocale()");b&&(b.active=!1),d.active=!0},j=function(a){var c=f||h();if(c&&d&&d[c.id]){var e=d[c.id];return b.forEach(a.split("."),function(a){e=e?e[a]:null}),e}return!1},k=function(a){var b;return _.each(c,function(c){!b&&a[c.id]&&(b=a[c.id])}),b||(b=_.values(a)[0]),b},l=function(a){for(var b,c=/{{\s*([a-zA-Z0-9$_]+)\s*}}/g,d=[];null!==(b=c.exec(a));)b.index===c.lastIndex&&c.lastIndex++,d.push(b[1]);return d},m=function(a,b){if(b){var c=l(a);c.forEach(function(c){var d=c.replace(/[$_]/g,"\\$&"),e=new RegExp("{{\\s*"+d+"\\s*}}");a=a.replace(e,b[c])})}return a};this.addLocale=function(a,b,e,f){e=e||a+".json";var h=_.findWhere(c,{id:a});h?(h.name=b,h.fileExtension=e,h.basePath=f):(c.push({id:a,name:b,active:a===g,basePath:f||"",fileExtension:e}),d[a]={})},this.addResource=function(b,c){c=c||"";var d=_.findWhere(a,{path:b});d?d.basePath=c:a.push({path:b,basePath:c})},this.setDefaultLocale=function(a){g=a,_.findWhere(c,{id:a})&&i(a)},this.$get=["$templateRequest","$q","$rootScope",function(l,n,o){return{_loadResource:function(b){var c=_.findWhere(a,{path:b}),e=this.getActiveLocale(),f="";return c&&e?(f=mwUI.Backbone.Utils.concatUrlParts(e.basePath,c.basePath,c.path,e.fileExtension),l(f).then(function(a){return _.extend(d[e.id],JSON.parse(a)),a})):n.reject("Resource not available or no locale has been set")},getLocales:function(){return c},getActiveLocale:function(){return h()},get:function(a,b){var c=j(a);return c?m(c,b):e?"...":"MISSING TRANSLATION "+this.getActiveLocale().id+": "+a},setLocale:function(b){var c=[];return o.$broadcast("i18n:loadResourcesStart"),e=!0,f=this.getActiveLocale(),i(b),_.each(a,function(a){c.push(this._loadResource(a.path))},this),n.all(c).then(function(){return e=!1,o.$broadcast("i18n:loadResourcesSuccess"),f=null,o.$broadcast("i18n:localeChanged",b),b})},translationIsAvailable:function(a){return!!j(a)},localize:function(a){var c=this.getActiveLocale(),d=a[c.id];return b.isDefined(d)&&""!==d?d:a[g]||k(a)},extendForLocale:function(a,b){if(!a)throw new Error("Locale is a required argument!");if(!_.isObject(b))throw new Error("The translations argument is of type "+typeof b+" but it has to be an object!");if(!_.findWhere(c,{id:a}))throw new Error("The locale "+a+" does not exist! Make sure you have registered it.");e||mwUI.Utils.shims.deepExtendObject(d[a],b),o.$on("i18n:loadResourcesSuccess",function(){mwUI.Utils.shims.deepExtendObject(d[a],b)})},extend:function(a){if(!_.isObject(a))throw new Error("The localesWithTranslations argument is from type "+typeof a+" but it has to be an object!");for(var b in a)this.extendForLocale(b,a[b])}}}]}),b.module("mwUI.i18n").filter("i18n",["i18n",function(a){function b(b,c){return _.isString(b)?a.get(b,c):_.isObject(b)?a.localize(b):void 0}return b.$stateful=!0,b}]),b.module("mwUI.Inputs",["mwUI.i18n","mwUI.Backbone"]),b.module("mwUI.Inputs").directive("input",function(){return{restrict:"E",link:function(a,c,d){var e=function(){var a=b.element(''),d=b.element(''),e=b.element('');c.wrap(a),d.insertAfter(c),e.insertAfter(d)},f=function(){a.$on("$destroy",function(){c.off(),c.parent(".mw-checkbox").remove()}),e()};"checkbox"===d.type&&f()}}}),b.module("mwUI.Inputs").directive("mwCheckboxGroup",["i18n",function(a){return{restrict:"A",scope:{mwCollection:"=",mwOptionsCollection:"=",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwRequired:"=",mwDisabled:"="},templateUrl:"uikit/mw-inputs/directives/templates/mw_checkbox_group.html",link:function(b){var c=function(){return b.mwCollection.model.prototype.idAttribute};if(b.getLabel=function(c){var d=c.get(b.mwOptionsLabelKey);return d?b.mwOptionsLabelI18nPrefix?a.get(b.mwOptionsLabelI18nPrefix+"."+d):d:void 0},b.isOptionDisabled=function(a){return a.selectable.isDisabled()},b.isSelected=function(a){return!!b.mwCollection.get(a.get(c()))},b.toggleModel=function(a){var c=b.mwCollection.findWhere(a.toJSON());c?b.mwCollection.remove(c):b.mwCollection.add(a.toJSON())},!(b.mwCollection instanceof Backbone.Collection))throw new Error("[mwCheckboxGroup] The attribute mwCollection is required and has to be an instanceof Backbone Collection");if(!(b.mwOptionsCollection instanceof Backbone.Collection))throw new Error("[mwCheckboxGroup] The attribute mwOptionsCollection is required and has to be an instanceof Backbone Collection")}}}]);var k=function(){return{restrict:"E",require:"?^mwInputWrapper",link:function(a,b,c,d){var e=["radio","checkbox"];-1===e.indexOf(c.type)&&b.addClass("form-control"),d&&(c.type?d.setType(c.type):b[0].tagName&&d.setType(b[0].tagName.toLowerCase()))}}};b.module("mwUI.Inputs").directive("select",k).directive("input",k).directive("textarea",k),b.module("mwUI.Inputs").directive("input",function(){return{restrict:"E",link:function(a,c,d){var e=function(){var a=b.element(''),d=b.element(''),e=b.element('');c.wrap(a),d.insertAfter(c),e.insertAfter(d)},f=function(){a.$on("$destroy",function(){c.off(),c.parent(".mw-radio").remove()}),e()};"radio"===d.type&&f()}}}),b.module("mwUI.Inputs").directive("mwRadioGroup",["i18n",function(a){return{restrict:"A",scope:{mwModel:"=",mwModelAttr:"@",mwOptionsCollection:"=",mwOptionsKey:"@",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwRequired:"=",mwDisabled:"="},templateUrl:"uikit/mw-inputs/directives/templates/mw_radio_group.html",link:function(b){b.radioGroupId=_.uniqueId("radio_");var c=function(a){b.mwModelAttr?b.mwModel.set(b.mwModelAttr,a.get(b.mwOptionsKey)):b.mwModel.set(a.toJSON())},d=function(){b.mwModelAttr?b.mwModel.unset(b.mwModelAttr):b.mwModel.clear()};if(b.getLabel=function(c){var d=c.get(b.mwOptionsLabelKey);return d?b.mwOptionsLabelI18nPrefix?a.get(b.mwOptionsLabelI18nPrefix+"."+d):d:void 0},b.isOptionDisabled=function(a){return a.selectable.isDisabled()},b.getModelAttribute=function(){return b.mwModelAttr||b.mwModel.idAttribute},b.isChecked=function(a){return b.mwModelAttr?a.get(b.mwOptionsKey)===b.mwModel.get(b.mwModelAttr):a.id===b.mwModel.id},b.selectOption=function(a){b.isChecked(a)?d():c(a)},b.mwModelAttr&&!b.mwOptionsKey)throw new Error("[mwRadioGroup] When using mwModelAttr the attribute mwOptionsKey is required!")}}}]),b.module("mwUI.Inputs").directive("select",function(){return{link:function(a,c){var d=b.element(''),e=function(){c.wrap(d),c.addClass("custom")};e()}}}),b.module("mwUI.Inputs").directive("mwSelectBox",["i18n",function(a){return{restrict:"A",scope:{mwModel:"=",mwModelAttr:"@",mwOptionsCollection:"=",mwOptionsKey:"@",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwPlaceholder:"@",mwRequired:"=",mwDisabled:"="},templateUrl:"uikit/mw-inputs/directives/templates/mw_select_box.html",link:function(b){b.viewModel={};var c=function(a){b.mwModelAttr?b.mwModel.set(b.mwModelAttr,a.get(b.mwOptionsKey)):b.mwModel.set(a.toJSON())},d=function(){b.mwModelAttr?b.mwModel.unset(b.mwModelAttr):b.mwModel.clear()},e=function(){b.mwModelAttr?b.viewModel.selected=b.mwModel.get(b.mwModelAttr):b.mwModel.id&&(b.viewModel.selected=b.mwModel.id.toString())},f=function(){b.mwOptionsCollection.each(function(a){if(!a.id)throw new Error("[mwSelectBox] Each model of the options collection must have an id. Make sure you set the correct model and modelId attribute!")})},g=function(){d(),b.viewModel.selected=null};if(b.getLabel=function(c){var d=c.get(b.mwOptionsLabelKey);return d?b.mwOptionsLabelI18nPrefix?a.get(b.mwOptionsLabelI18nPrefix+"."+d):d:void 0},b.hasPlaceholder=function(){return b.mwPlaceholder||b.mwRequired},b.getPlaceholder=function(){return b.mwPlaceholder?b.mwPlaceholder:b.mwRequired?a.get("mwSelectBox.pleaseSelect"):void 0},b.isOptionDisabled=function(a){return a.selectable.isDisabled()},b.getModelAttribute=function(){return b.mwModelAttr||b.mwModel.idAttribute},b.isChecked=function(a){return b.mwModelAttr&&b.mwModel instanceof Backbone.Model?a.get(b.mwOptionsKey)===b.mwModel.get(b.mwModelAttr):a.id===b.mwModel.id},b.select=function(a){a?b.selectOption(b.mwOptionsCollection.get(a)):g()},b.selectOption=function(a){b.isChecked(a)||c(a)},b.mwModel){if(!(b.mwModel instanceof Backbone.Model))throw new Error("[mwSelectBox] The attribute mw-model is from type "+typeof b.mwModel+" but has to be a Backbone Model!");b.mwModel.on("change:"+b.mwModel.idAttribute,e),e(),b.mwModel.on("change",function(a){(b.mwModelAttr&&!a.get(b.mwModelAttr)||!b.mwModelAttr&&!a.id)&&g()})}if(b.mwModelAttr&&!b.mwOptionsKey)throw new Error("[mwSelectBox] When using mwModelAttr the attribute mwOptionsKey is required!");if(!(b.mwOptionsCollection&&b.mwOptionsCollection instanceof Backbone.Collection))throw new Error("[mwSelectBox] An options collection is required. Make sure you set the attribute mw-options-collection and that it is a backbone collection!");f(),b.mwOptionsCollection.on("add",f)}}}]),b.module("mwUI.Inputs").directive("mwToggle",["$timeout",function(a){return{scope:{mwModel:"=",mwDisabled:"=",mwIconOn:"@",mwIconOff:"@",mwChange:"&"},replace:!0,templateUrl:"uikit/mw-inputs/directives/templates/mw_toggle.html",link:function(b){b.toggle=function(c){b.mwModel!==c&&(b.mwModel=!b.mwModel,a(function(){b.mwChange({value:b.mwModel})}))}}}}]),b.module("mwUI.Inputs").config(["i18nProvider",function(a){a.addResource("mw-inputs/i18n","uikit")}]),b.module("mwUI.Layout",["mwUI.Utils"]),b.module("mwUI.Layout").directive("mwUi",["Modal",function(a){return{transclude:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_ui.html",controller:["$scope",function(a){this.addClass=function(b){a.addClass(b)},this.removeClass=function(b){a.removeClass(b)}}],link:function(b,c){b.displayToasts=function(){return 0===a.getOpenedModals().length},b.addClass=function(a){c.addClass(a)},b.removeClass=function(a){c.removeClass(a)}}}}]),b.module("mwUI.Layout").directive("mwHeader",["$rootScope","$route","$location","BrowserTitleHandler",function(a,c,d,e){return{transclude:!0,scope:{title:"@",url:"@?",mwTitleIcon:"@?",showBackButton:"=?",mwBreadCrumbs:"=?",description:"@?",disableReload:"=?"},require:"^?mwUi",templateUrl:"uikit/mw-layout/directives/templates/mw_header.html",link:function(f,g,h,i,j){if(a.siteTitleDetails=f.title,e.setTitle(f.title),f.showRefreshButton=!0,f.mwTitleIcon&&g.find(".description").addClass("has-title-icon"),j(function(a){a&&0!==a.length||f.showBackButton||g.find(".mw-header").addClass("no-buttons"),g.find("[mw-form-actions]")&&g.find("[mw-form-actions]").length>0&&(f.showRefreshButton=!1)}),f.refresh=function(){c.reload()},f.toggleDescription=function(){f.showDescription=!f.showDescription},f.back=function(){var a=f.url.replace("#","");d.path(a)},f.canShowDescriptionButton=function(){return b.isDefined(f.description)},f.canShowBackButton=function(){return(b.isUndefined(f.showBackButton)||f.showBackButton)&&b.isDefined(f.url)},!f.url&&f.mwBreadCrumbs&&f.mwBreadCrumbs.length>0)f.url=f.mwBreadCrumbs[f.mwBreadCrumbs.length-1].url;else if(!f.url&&f.showBackButton)throw new Error("[mwHeader] Can not show back button when the attribute url is not defined");i&&(i.addClass("has-mw-header"),f.$on("$destroy",function(){i.removeClass("has-mw-header")})),f.disableReload&&(f.showRefreshButton=!1)}}}]),b.module("mwUI.Layout").directive("mwSidebar",function(){return{transclude:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_sidebar.html",link:function(a,c){var d=c.find(".mw-sidebar"),e=b.element(".mw-footer"),f=b.element(".mw-header"),g=b.element(".mw-menu-top-bar"),h=function(){var a=b.element(window).innerHeight(),c=a;f.length&&(c-=f.height()),g.length&&(c-=g.height()),e.length&&(c-=e.height()),d.css("maxHeight",c)},i=_.throttle(h,100);h(),b.element(window).on("resize",i)}}}),b.module("mwUI.Layout").directive("mwFooter",function(){return{transclude:!0,scope:{type:"@mwFooter"},templateUrl:"uikit/mw-layout/directives/templates/mw_footer.html"}}),b.module("mwUI.Layout").directive("mwSubNav",function(){return{restrict:"A",scope:{justified:"="},transclude:!0,replace:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_sub_nav.html"}}),b.module("mwUI.Layout").directive("mwSubNavPill",["$location",function(a){return{restrict:"A",scope:{url:"@mwSubNavPill",mwDisabled:"="},transclude:!0,replace:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_sub_nav_pill.html",link:function(b,c){var d=function(a){b.url&&a===b.url.slice(1)?c.addClass("active"):c.removeClass("active")};b.$watch("url",function(b){b&&d(a.$$path)}),b.navigate=function(c){b.mwDisabled||(c=c.replace(/#\//,""),a.path(c),a.replace())},d(a.$$path)}}}]),b.module("mwUI.List",["mwUI.i18n","mwUI.Backbone","mwUI.UiComponents"]),window.mwUI.List={localStoragePrefix:"tbl_confg_v1"};var l=window.mwUI.Backbone.Model.extend({});window.mwUI.List.MwTableColumn=l;var m=window.mwUI.Backbone.Model.extend({fetched:!1,nested:function(){return{columns:window.mwUI.List.MwTableColumns}},sync:function(){var a=Backbone.$.Deferred();return a.resolve(this),a.promise()},fetch:function(){if(!this.fetched){var a=localStorage.getItem(window.mwUI.List.localStoragePrefix+"_"+this.id);a&&this.set(JSON.parse(a)),this.fetched=!0}return this.sync()},save:function(){return localStorage.setItem(window.mwUI.List.localStoragePrefix+"_"+this.id,JSON.stringify(this.toJSON(!0))),this.sync()},destroy:function(){return this.clear(),localStorage.removeItem(window.mwUI.List.localStoragePrefix+"_"+this.id),this.sync()},clear:function(){var a=this.get("id");mwUI.Backbone.Model.prototype.clear.apply(this,arguments),this.set("id",a)}});window.mwUI.List.MwTableConfigurator=m;var n=window.mwUI.Backbone.Collection.extend({model:window.mwUI.List.MwTableColumn});window.mwUI.List.MwTableColumns=n;var o=window.mwUI.Backbone.Collection.extend({model:window.mwUI.List.MwTableConfigurator});window.mwUI.List.MwTableConfigurators=o,b.module("mwUI.List").directive("mwListableBb",function(){return{scope:{collection:"=",mwListCollection:"=",enableConfigurator:"=?",id:"@"},compile:function(a){return a.append(""),function(a,b){b.addClass("hide-all-cols"),b.addClass("table table-striped mw-list")}},controller:["$scope","TableConfigurator",function(a,b){var c,d=a.columns=[],e=null,f=null;this.enableConfigurator=a.enableConfigurator,this.actionColumns=[],this.maxActionColumnsAmount=0;var g=function(b,c){a.$emit(b,c),d.forEach(function(a){a.scope.$broadcast(b,c)})};this.registerColumn=function(a){d.push(a),g("mwList:registerColumn")},this.updateColumn=function(a){if(a&&a.id){var b=_.findWhere(d,{id:a.id}),c=_.indexOf(d,b);if(c>-1){var e=d[c];_.extend(e,a),g("mwList:updateColumn",e)}}},this.unRegisterColumn=function(a){if(a&&a.id){var b=_.findWhere(d,{id:a.id}),c=_.indexOf(d,b);c>-1&&(d.splice(c,1),g("mwList:unRegisterColumn",d[c]))}},this.getColumns=function(){return d},this.getId=function(){return a.id},this.getCollection=function(){return e},this.getTableConfigurator=function(){if(!c){if(!a.id)return!1;c=b.getInstanceForTableId(a.id)}return c.fetch(),c},this.isSingleSelection=function(){return e&&e.selectable?e.selectable.isSingleSelection():!1},a.$on("$destroy",function(){this.actionColumns=[]}.bind(this)),a.mwListCollection?(e=a.mwListCollection.getCollection(),f=a.mwListCollection.getMwListCollectionFilter()):a.collection&&(e=a.collection)}]}}).directive("mwListableBb",function(){return{require:"mwListableBb",link:function(a,b,c,d){var e=function(){b.removeClass("hide-all-cols")},f=_.debounce(e,200),g=function(){b.removeClass(function(a,b){return(b.match(/(^|\s)(hidden-col-|visible-col-)\S+/g)||[]).join(" ")})},h=function(){g(),d.getColumns().forEach(function(a){a.scope.isVisible()?b.addClass("visible-col-"+a.pos):b.addClass("hidden-col-"+a.pos)}),f()},i=_.debounce(h,200);a.$on("mwList:registerColumn",i),a.$on("mwList:unRegisterColumn",i),a.$on("mwList:updateColumn",i)}}}),b.module("mwUI.List").directive("mwListableAction",["$timeout",function(a){return{require:["^mwListableBb","^?mwListableBodyRowBb"],transclude:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_action_button.html",scope:{action:"&mwListableAction"},link:function(b,c,d,e){var f,g=e[0],h=e[1],i=function(){if(_.isNumber(f)){var a=b.action,c=_.findWhere(g.actionColumns,{id:f});if(c)c.actions.push(a);else{var d={id:f,actions:[a]};g.actionColumns.push(d),c=d}c.actions.length>g.maxActionColumnsAmount&&(g.maxActionColumnsAmount=c.actions.length)}},j=function(){if(_.isNumber(f)){var a=_.findWhere(g.actionColumns,{id:f});if(a){var c=_.indexOf(a.actions,b.action);if(a.actions.splice(c,1),0===a.actions.length){var d=_.indexOf(g.actionColumns,a);g.actionColumns.splice(d,1)}}}};b.execute=function(){a(b.action)},h&&(f=h.getId()),i(d.action),b.$on("$destroy",j)}}}]),b.module("mwUI.List").directive("mwListableBodyRowBb",["$timeout",function(a){return{require:"^mwListableBb",controller:["$scope",function(a){this.getId=function(){return a.$id}}],compile:function(b){return b.prepend(''),b.append(''),function(b,c,d,e){var f="selected";if(b.collection=e.getCollection(),b.actionColumns=e.actionColumns,!b.item)throw new Error('No item available in the list! Please make sure to use ng-repeat="item in collection"');b.item&&b.item.selectable&&!b.item.selectable.isDisabled()?c.addClass("selectable clickable"):e.actionColumns&&e.actionColumns.length>0&&c.addClass("clickable"),c.on("click",function(){b.item&&b.item.selectable&&!b.item.selectable.isDisabled()&&a(function(){b.item.selectable.toggleSelect()})}),c.on("dblclick",function(){var c=b.$id;if(e.actionColumns){var d=_.findWhere(e.actionColumns,{id:c}),f=d.actions[0];f&&a(f)}}),b.$watch("item.selectable.isSelected()",function(a){a?c.addClass(f):c.removeClass(f)})}}}}]),b.module("mwUI.List").directive("mwListBodyRowCheckbox",function(){return{restrict:"A",require:"^mwListableBb",scope:{item:"="},templateUrl:"uikit/mw-list/directives/templates/mw_list_body_row_checkbox.html",link:function(a,b,c,d){a.isSingleSelection=d.isSingleSelection(),a.click=function(a,b){b.stopPropagation(),a.selectable&&a.selectable.toggleSelect()},a.$watch("item.selectable.isDisabled()",function(b){b&&a.item.selectable.unSelect()})}}}),b.module("mwUI.List").directive("mwListColumnConfigurator",["$timeout",function(a){return{require:"^mwListableBb",scope:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_column_configurator.html",link:function(c,d,e,f){var g=d.find(".dropdown-menu"),h=d.find(".btn-group"),i="scroll touchmove mousewheel resize";c.colums=f.getColumns();var j=f.getTableConfigurator(),k=function(){h.hasClass("open")&&g.dropdown("toggle")},l=function(a){j?(j.get("columns").add({id:a.persistId,visible:a.scope.isVisible()},{merge:!0}),j.save()):console.warn("In order to persist the visibility of the column the table needs an id!")};c.getColTitle=function(a){if(a&&a.scope){var b=a.scope.getTitle()||"";return b.length>0?b:!1}},c.reset=function(){c.colums.forEach(function(a){a.scope.resetColumnVisibility()}),j&&j.destroy()},c.toggleColumn=function(a){a.scope.toggleColumn(),l(a)},h.on("show.bs.dropdown",function(){var c=d[0].getBoundingClientRect();g.css({position:"fixed",top:c.top+d.innerHeight(),left:"inherit",marginLeft:-1*g.innerWidth()+d.innerWidth()}),a(function(){b.element(window).on(i,k)})}),h.on("hide.bs.dropdown",function(){b.element(window).off(i,k)})}}}]),b.module("mwUI.List").directive("mwListableFooterBb",function(){return{require:"^mwListableBb",templateUrl:"uikit/mw-list/directives/templates/mw_list_footer.html",link:function(a,b,c,d){a.collection=d.getCollection(),a.columns=d.getColumns(),a.collection.on("request",function(){ +a.isSynchronising=!0}),a.collection.on("sync error",function(){a.isSynchronising=!1}),a.showSpinner=function(){return a.isSynchronising&&a.collection.filterable.hasNextPage()}}}}),b.module("mwUI.List").directive("mwListableHead2",["$window","$document","i18n",function(a,c,d){return{scope:{collection:"=",mwListCollection:"=",affix:"=",affixOffset:"=",collectionName:"@",nameFn:"&",nameAttribute:"@",localizeName:"@",nameI18nPrefix:"@",nameI18nSuffix:"@",searchAttribute:"@"},transclude:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_head.html",link:function(c,e,f,g,h){var i,j,k=b.element("body"),l=b.element("*[mw-menu-top-bar]"),m=e.parents("*[mw-modal-body]"),n=b.element("*[mw-header]"),o=!1,p=b.isDefined(c.affix)?c.affix:!0,q=b.element(a);c.selectable=!1,c.selectedAmount=0,c.collectionName=c.collectionName||d.get("List.mwListHead.items"),c.isModal=m.length>0,c.isLoadingModelsNotInCollection=!1,c.hasFetchedModelsNotInCollection=!1,c.isLoadingModelsNotInCollection=!1,c.hasFetchedModelsNotInCollection=!1;var r,s=_.throttle(function(){if(e.is(":visible")){if(!r){var a,b,d=0,f=0,g=0;if(c.isModal){var h=e.parents(".modal-content").find(".modal-header");h.length?(d=h.offset().top,f=h.innerHeight(),g=0):g=e.innerHeight(),g-=4}else n.length?(d=n.last().offset().top,f=n.last().innerHeight(),g=5):l.length&&(d=l.innerHeight());a=d+f,b=e.offset().top,r=b-a-g}var j=i.scrollTop();j>r&&p?(e.find(".mw-listable-header").css("top",j-r),e.addClass("affixed")):p?(e.find(".mw-listable-header").css("top","initial"),e.removeClass("affixed")):i.off("scroll",s)}},10),t=_.throttle(function(){e.find(".mw-listable-header").css("top","initial"),r=null}),u=function(){if(!c.hasFetchedModelsNotInCollection){var a=[];if(c.selectable.getSelected().each(function(b){b.selectable.isInCollection||c.getModelAttribute(b)||a.push(b)}),0!==a.length){var b=j.constructor.extend({filterableOptions:function(){return{filterDefinition:function(){var b=new window.mCAP.Filter,c=[];return a.forEach(function(a){a.id&&c.push(b.string(a.idAttribute,a.id))}),b.or(c)}}}}),d=new b;d.url=j.url(),c.isLoadingModelsNotInCollection=!0,d.fetch().then(function(b){c.hasFetchedModelsNotInCollection=!0;var d=c.selectable.getSelected();b.each(function(a){d.get(a.id).set(a.toJSON())});var e=_.difference(_.pluck(a,"id"),b.pluck("uuid"));e.forEach(function(a){d.get(a).selectable.isDeletedItem=!0}),c.isLoadingModelsNotInCollection=!1})}}};c.getCollection=function(){return j},c.showSelected=function(){o=!0,u(),setTimeout(function(){var d;c.isModal?(d=m.height()+(m.offset().top-e.find(".selected-items").offset().top)+25,m.css("overflow","hidden")):(d=b.element(a).height()-e.find(".selected-items").offset().top+i.scrollTop()-25,k.css("overflow","hidden")),e.find(".selected-items").css("height",d),e.find(".selected-items").css("bottom",-1*d)})},c.hideSelected=function(){c.isModal?m.css("overflow","auto"):k.css("overflow","inherit"),o=!1},c.canShowSelected=function(){return c.selectable&&o&&c.selectedAmount>0},c.unSelect=function(a){a.selectable.unSelect()},c.toggleSelectAll=function(){c.selectable.toggleSelectAll()},c.getTotalAmount=function(){return j.filterable&&j.filterable.getTotalAmount()?j.filterable.getTotalAmount():j.length},c.toggleShowSelected=function(){o?c.hideSelected():c.showSelected()},c.getModelAttribute=function(a){if(c.nameAttribute){var e=a.get(c.nameAttribute);if(c.nameI18nPrefix||c.nameI18nSuffix){var f=c.nameI18nPrefix||"",g=c.nameI18nSuffix||"";return d.get(f+"."+e+"."+g)}return b.isDefined(c.localizeName)?d.localize(e):e}return c.nameFn({item:a})};var v=function(){c.selectable=j.selectable,i=c.isModal?m:q,i.on("scroll",s),i.on("resize",t),c.$on("$destroy",function(){i.off("scroll",s)}),c.$on("$destroy",function(){i.off("resize",t)}),e.on("focus","input[type=text]",function(){e.find(".search-bar").addClass("focused")}),e.on("blur","input[type=text]",function(){e.find(".search-bar").removeClass("focused")})};if(h(function(a){a&&a.length>0&&e.addClass("has-extra-content")}),c.$watch(function(){return c.selectable?c.selectable.getSelected().length:0},function(a){c.selectedAmount=a,1>a&&c.hideSelected()}),c.mwListCollection)j=c.mwListCollection.getCollection();else{if(!c.collection)throw new Error("[mwListableHead2] Either a collection or a mwListCollection has to be passed as attribute");j=c.collection}v()}}}]),b.module("mwUI.List").directive("mwListableHeaderBb",["$rootScope","$timeout","mwBootstrapBreakpoint",function(a,c,d){return{require:"^mwListableBb",scope:{property:"@?sort",title:"@?",hidden:"=?",mandatory:"=?"},transclude:!0,replace:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_header.html",link:function(e,f,g,h){var i,j="+",k="-",l=h.getCollection(),m=f.text()||"",n=h.getTableConfigurator(),o=e.property||g.title||m.trim(),p=!0,q=function(){return l&&l.filterable?l.filterable.getSortOrder():!1},r=function(a,b){var c=b+a;return l.filterable.setSortOrder(c),l.fetch()},s=function(){return{scope:e,pos:f.index(),id:e.$id,persistId:o}},t=function(){g.title||(e.title=f.text().trim())},u=function(){c(function(){e.pos=f.index(),t(),h.updateColumn(s())})},v=_.debounce(u,100),w=function(){var a=f.attr("class").match(/hidden-[a-z]{2}/g),b=f.attr("class").match(/visible-[a-z]{2}/g),c=d.getActiveBreakpoint(),e=!1;return a&&a.forEach(function(a){e||a.split("-")[1]!==c.toLowerCase()||(e=!0)}),b&&(e=!0,b.forEach(function(a){e&&a.split("-")[1]===c.toLowerCase()&&(e=!1)})),e},x=function(){var a=d.getActiveBreakpoint(),c=!1;return b.isArray(e.hidden)?c=-1!==e.hidden.indexOf(a):_.isBoolean(e.hidden)?c=e.hidden:b.isDefined(g.hidden)&&(c=!0),c},y=function(){p=x()||w()},z=_.debounce(y,100);if(e.hideColumn=function(){i=!0,h.updateColumn(s())},e.showColumn=function(){i=!1,h.updateColumn(s())},e.toggleColumn=function(){!e.isVisible()||e.isMandatory()?e.showColumn():e.hideColumn()},e.resetColumnVisibility=function(){i=void 0,h.updateColumn(s())},e.getTitle=function(){return e.title||""},e.isVisible=function(){return b.isUndefined(i)?!p:!i},e.canBeSorted=function(){return b.isString(e.property)&&e.property.length>0&&!!l.filterable},e.toggleSortOrder=function(){if(e.canBeSorted()){var a=j;q()===j+e.property&&(a=k),r(e.property,a)}},e.isSelected=function(a){var b=q();return b&&a?b===a+e.property:b&&!a?b==="+"+e.property||b==="-"+e.property:void 0},e.isMandatory=function(){return e.mandatory},e.$on("$destroy",function(){h.unRegisterColumn(s())}),e.$on("mwList:registerColumn",v),e.$on("mwList:registerColumn",v),e.$on("mwList:unRegisterColumn",v),e.$watch("hidden",z),g.$observe("title",v),a.$on("i18n:localeChanged",v),a.$on("mwBootstrapBreakpoint:changed",v),a.$on("mwBootstrapBreakpoint:changed",z),a.$on("$modalOpenSuccess",z),n){var A=n.get("columns").get(o);A&&(i=!A.get("visible"))}c(function(){u(),y(),h.registerColumn(s())})}}}]),b.module("mwUI.List").directive("mwListableHeaderRowBb",function(){return{require:"^mwListableBb",scope:!0,compile:function(a){return a.prepend(''),a.append('
    '),a.append('
    '),function(a,c,d,e){a.hasCollection=!1;var f=e.getCollection();f&&(a.hasCollection=b.isDefined(f.length)&&f.selectable),a.actionColumns=e.actionColumns,a.enableConfigurator=e.enableConfigurator,a.getActionColumnsAmount=function(){return e.maxActionColumnsAmount}}}}}),b.module("mwUI.List").directive("mwListableLinkShowBb",["$window",function(a){return{restrict:"A",require:"^mwListableBb",templateUrl:"uikit/mw-list/directives/templates/mw_list_url_action_button.html",scope:{link:"@mwListableLinkShowBb",target:"@linkTarget"},link:function(b){b.execute=function(){var c=b.link,d=b.target;c&&!d?a.location.href=c:c&&d&&"self"!==d&&window.open(c)}}}}]),b.module("mwUI.List").service("TableConfigurator",function(){var a=new window.mwUI.List.MwTableConfigurators;return{getInstanceForTableId:function(b){if(a.get(b))return a.get(b);var c=new window.mwUI.List.MwTableConfigurator({id:b});return a.add(c),c}}}),b.module("mwUI.List").config(["i18nProvider",function(a){a.addResource("mw-list/i18n","uikit")}]),b.module("mwUI.Menu",[]),window.mwUI.Menu={};var p=mwUI.Utils.shims.routeToRegExp,q=window.mwUI.Backbone.NestedModel.extend({idAttribute:"id",defaults:function(){return{url:null,label:null,icon:null,activeUrls:[],order:null,action:null,isActive:null,target:null,isVisible:null}},nested:function(){return{subEntries:window.mwUI.Menu.MwMenuSubEntries}},_throwMissingIdError:function(a){throw new Error("No id is specified for the entry",a)},_throwNoTypeCouldBeDeterminedError:function(a){throw new Error("No type could be determinded for the given entry: ",a)},_throwNotValidEntryError:function(a){throw new Error("Is not a valid entry",a)},_determineType:function(a){return a.type||(a.url||a.subEntries&&0!==a.subEntries.length||a.label||a.icon?a.url||a.subEntries&&a.subEntries.length>0&&(a.label||a.icon)?a.type="ENTRY":this._throwNoTypeCouldBeDeterminedError():a.type="DIVIDER"),a},_missingLabel:function(a){return"ENTRY"===a.type&&!a.label&&!a.icon},_urlsAreMatching:function(a,b){return b.match("#")&&(b=b.split("#")[1]),a.match(p(b))},validate:function(a){a&&_.isObject(a)&&(a=this._determineType(a),a.id||this._throwMissingIdError(),this.isValidEntry(a)||this._throwNotValidEntryError(a))},set:function(a,b){return b=b||{},_.isUndefined(b.validate)&&this.validate(a),window.mwUI.Backbone.NestedModel.prototype.set.call(this,a,b)},isValidEntry:function(a){return a.type?!this._missingLabel(a):!1},ownUrlIsActiveForUrl:function(a){return this.get("url")?this._urlsAreMatching(a,this.get("url")):!1},activeUrlIsActiveForUrl:function(a){var b=!1;return this.get("activeUrls").forEach(function(c){b||(b=this._urlsAreMatching(a,c))}.bind(this)),b},isSubEntry:function(){return this.collection&&this.collection.parent?!0:!1},hasSubEntries:function(){return this.get("subEntries").length>0},hasManualActiveFunction:function(){return this.get("isActive")&&"function"==typeof this.get("isActive")},isActiveForUrl:function(a){return this.hasManualActiveFunction()?this.get("isActive")():this.ownUrlIsActiveForUrl(a)||this.activeUrlIsActiveForUrl(a)},getActiveSubEntryForUrl:function(a){return this.get("subEntries").getActiveEntryForUrl(a)},hasActiveSubEntryOrIsActiveForUrl:function(a){return"ENTRY"===this.get("type")?this.hasManualActiveFunction()?this.get("isActive")():!!this.getActiveSubEntryForUrl(a)||this.isActiveForUrl(a):void 0},constructor:function(a,b){return b=b||{},b.validate=a?!0:!1,window.mwUI.Backbone.NestedModel.prototype.constructor.call(this,a,b)}});window.mwUI.Menu.MwMenuEntry=q;var r=Backbone.Collection.extend({model:window.mwUI.Menu.MwMenuEntry,comparator:"order",_isAlreadyRegistered:function(a){return this.get(a.id)||a.url&&this.findWhere({url:a.url})},_throwIsAlreadyRegisteredError:function(a){throw a.url?new Error("The entry with the id "+a.id+" and the url "+a.url+" has already been registered"):new Error("The entry with the id "+a.id+" has already been registered")},add:function(a){return _.isArray(a)?a.forEach(function(a){this._isAlreadyRegistered(a)&&this._throwIsAlreadyRegisteredError(a)}.bind(this)):this._isAlreadyRegistered(a)&&this._throwIsAlreadyRegisteredError(a),Backbone.Collection.prototype.add.apply(this,arguments)},addEntry:function(a,b,c,d){d=d||{};var e={id:a,url:b,label:c,icon:d.icon,activeUrls:d.activeUrls||[],order:d.order,subEntries:d.subEntries||[],type:"ENTRY"};return this.add(e)},addDivider:function(a,b){b=b||{};var c={id:a,label:b.label,order:b.order,type:"DIVIDER"};return this.add(c)},getActiveEntryForUrl:function(a){var b=!1,c=null;return this.each(function(d){!b&&d.hasActiveSubEntryOrIsActiveForUrl(a)&&(b=!0,c=d)}),c}});window.mwUI.Menu.MwMenuEntries=r;var s=window.mwUI.Menu.MwMenuEntries.extend({});window.mwUI.Menu.MwMenuSubEntries=s;var t=window.mwUI.Menu.MwMenuEntries.extend({});window.mwUI.Menu.MwMenu=t,b.module("mwUI.Menu").directive("mwMenuTopBar",["$rootScope",function(a){return{transclude:{brand:"?img",entries:"?div"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_bar.html",require:"^?mwUi",link:function(c,d,e,f){f&&f.addClass("has-mw-menu-top-bar"),c.closeMenu=function(){var a=d.find(".navbar-collapse");a.hasClass("in")&&a.collapse("hide")};var g=_.throttle(c.closeMenu,200),h=a.$on("$locationChangeStart",g);b.element(window).on("resize",g),c.$on("$destroy",function(){h(),b.element(window).off("resize",g),f&&f.removeClass("has-mw-menu-top-bar")})}}}]),b.module("mwUI.Menu").directive("mwMenuTopEntries",["$rootScope","$timeout",function(a,b){return{scope:{menu:"=mwMenuTopEntries",right:"="},transclude:!0,templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_entries.html",controller:["$scope",function(a){var b=a.menu||new mwUI.Menu.MwMenu;this.getMenu=function(){return b}}],link:function(a,c,d,e){var f=[],g=!1;a.entries=e.getMenu();var h=function(){g||f.push(b(function(){a.entries.sort(),a.$broadcast("mw-menu:resort")}))},i=_.throttle(h,1),j=function(){g||f.push(b(function(){a.$broadcast("mw-menu:reorder")}))},k=_.throttle(j,1);a.$on("mw-menu:triggerReorder",k),a.$on("mw-menu:triggerResort",i),a.entries.on("add remove reset",k),a.$on("$destroy",function(){g=!0,f.forEach(function(a){b.cancel(a)}),a.entries.off("add remove reset",k)})}}}]),b.module("mwUI.Menu").directive("mwMenuTopDropDownItem",function(){return{scope:{entry:"=mwMenuTopDropDownItem"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_drop_down_item.html"}}),b.module("mwUI.Menu").directive("mwMenuTopItem",["$timeout",function(a){return{scope:{entry:"=mwMenuTopItem"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_item.html",link:function(b){b.executeAction=function(){a(function(){var a=b.entry.get("action");a&&"function"==typeof a&&a()})}}}}]),b.module("mwUI.Menu").directive("mwMenuEntry",["$timeout",function(a){return{scope:{id:"@",url:"@",icon:"@",label:"@",type:"@",target:"@","class":"@styleClass",order:"=",activeUrls:"=",isVisible:"=",action:"&",isActive:"&"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_entry.html",require:["mwMenuEntry","?^^mwMenuEntry","?^mwMenuTopEntries"],transclude:!0,controller:function(){var a;this.setMenuEntry=function(b){a=b},this.getMenuEntry=function(){return a}},link:function(b,c,d,e){var f,g,h=e[0],i=e[1],j=e[2],k=new mwUI.Menu.MwMenuEntry,l=[],m=function(){for(var a=c;;){if(0!==a.parent(".mw-menu-entry").length||0!==a.parent(".mw-menu-entries").length)break;a=a.parent()}return a.index()+1},n=function(){if(i){if(!i.getMenuEntry())throw new Error("Menu entry is not available, so registration failed!");f=i.getMenuEntry().get("subEntries")}else j&&(f=j.getMenu(),g=!0);f&&!f.get(k)&&f.add(k)},o=function(){k.set({id:b.id||b.url||b.label||b.$id,label:b.label,url:b.url,icon:b.icon,type:b.type||"ENTRY",target:b.target,order:b.order||m(),activeUrls:b.activeUrls||[],"class":b["class"],action:d.action?function(){b.action()}:null,isActive:d.isActive?function(){return b.isActive()}:null,isVisible:_.isUndefined(b.isVisible)?!0:b.isVisible})};o(),b.menuEntry=k,l.push(a(n)),h.setMenuEntry(k),k.get("subEntries").on("add remove reset change:order",function(){b.$emit("mw-menu:triggerReorder")}),k.on("change:order",function(){b.$emit("mw-menu:triggerResort")}),b.$on("mw-menu:reorder",function(){b.order||k.set("order",m())}),b.$on("mw-menu:resort",function(){k.get("subEntries").sort()}),b.$on("$destroy",function(){l.forEach(function(b){a.cancel(b)}),f&&f.remove(k),k=null,h.setMenuEntry(k)}),b.$watchGroup(["id","label","url","icon","class","order","target","isVisible"],o)}}}]),b.module("mwUI.Menu").directive("mwMenuDivider",function(){return{scope:{id:"@",label:"@",icon:"@",order:"="},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_divider.html"}}),b.module("mwUI.Menu").directive("mwMenuToggleActiveClass",["$rootScope","$location","$timeout",function(a,b,c){return{scope:{entry:"=mwMenuToggleActiveClass",isActive:"&"},link:function(d,e){var f=function(){c(function(){var a=b.url(),c=e.hasClass("active");d.entry.hasActiveSubEntryOrIsActiveForUrl(a)?e.addClass("active"):e.removeClass("active"),c!==e.hasClass("active")&&d.$emit("menu-toggle-active-class-changed",e.hasClass("active"))})};d.entry&&d.entry.get("isActive")&&d.$watch(function(){return d.entry.get("isActive")()},f),f(),a.$on("menu-toggle-active-class-changed",f),a.$on("$locationChangeSuccess",f),a.$on("$routeChangeError",f)}}}]),window.mwUI.Modal={Sizes:{DEFAULT:"DEFAULT",BIGGER:"BIGGER",LARGE:"LARGE",FULLSCREEN:"FULLSCREEN"}},b.module("mwUI.Modal",["mwUI.i18n","mwUI.Toast"]),b.module("mwUI.Modal").directive("mwModal",["mwModalTmpl",function(a){return{restrict:"A",scope:{title:"@"},transclude:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal.html",controller:["$scope",function(a){this.addClass=function(b){a.addClass(b)}}],link:function(b,c){b.$emit("COMPILE:FINISHED"),b.mwModalTmpl=a,b.addClass=function(a){c.addClass(a)},b.title&&b.addClass("has-header")}}}]),b.module("mwUI.Modal").directive("mwModalBody",function(){return{transclude:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal_body.html"}}),b.module("mwUI.Modal").directive("mwModalConfirm",function(){return{restrict:"A",transclude:!0,scope:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal_confirm.html",link:function(a,c,d){b.forEach(["ok","cancel"],function(b){a[b]=function(){a.$eval(d[b])}})}}}),b.module("mwUI.Modal").directive("mwModalFooter",function(){return{transclude:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal_footer.html",require:"^mwModal",link:function(a,b,c,d){d.addClass("has-footer")}}}),b.module("mwUI.Modal").service("Modal",["$rootScope","$location","$templateCache","$document","$compile","$controller","$injector","$q","$templateRequest","$timeout","mwModalOptions","Toast",function(a,c,d,e,f,g,h,i,j,k,l,m){var n=[],o=function(d,e){var o,p,q,r,s=d.templateUrl,t=d.scope||a,u=d.scopeAttributes||{},v=d.resolve||{},w=d.controller,x=_.extend(l.getOptions(),d),y=_.extend(x.bootStrapModalOptions,e),z=[],A=!1,B=this,C=t.$new(),D=function(a,b){if(_.isObject(b)&&_.isObject(a))for(var c in b)a[c]=b[c]},E=function(a){if(D(C,u),w){a.$scope=C,a.modalId=s;var b=g(w,a,!0,x.controllerAs);D(b.instance,u),p=b()}},F=function(){if(!s)throw new Error("Modal service: templateUrl options is required.");return j(s)},G=function(){q.on("hidden.bs.modal",function(){B.destroy()})},H=function(){var b=a.$on("$routeChangeStart",function(a){if(q&&A){var d=c.path();a.preventDefault(),console.warn("Modal is closed because of a route change!"),B.hide().then(function(){c.path(d),b()})}else b()})},I=function(){z.forEach(function(a){C.$watch(a.expression,a.callback)})},J=function(){var a=b.extend({},v);return b.forEach(a,function(c,d){a[d]=b.isString(c)?h.get(c):h.invoke(c,null,null,d)}),a.$template=F(),i.all(a)},K=function(a){return E(a),f(a.$template)(C)},L=function(){var a=i.defer();return J().then(function(c){I(),u.hideModal=function(){return B.hide()},o=K(c),C.$on("COMPILE:FINISHED",function(){if(o.addClass("mw-modal"),o.addClass(x.size),o.addClass(x.styleClass),q=o.find(".modal"),y.show=!1,x.dismissible||(y.backdrop="static",y.keyboard=!1),q.modal(y),q.data()){var c=q.data()["bs.modal"],d=c.backdrop;c.backdrop=function(a){d.call(c,a,b.element(x.holderEl).find(".modal"))}}G(),H(),a.resolve()})}.bind(this),function(b){a.reject(b)}),a.promise};this.id=s,this.getScope=function(){return C},this.watchScope=function(a,b){z.push({expression:a,callback:b})},this.show=function(){var c=i.defer(),d=b.element(x.holderEl);if(!d||0===d.length)throw new Error("[Modal] no element could be found for the selector string "+x.holderEl+". Make sure that the element exists");return m.clear(),r=b.element(document.activeElement),a.$broadcast("$modalOpenStart"),a.$broadcast("$modalResolveDependenciesStart"),L.call(this).then(function(){a.$broadcast("$modalResolveDependenciesSuccess"),b.element(x.holderEl).append(o),A=!0,n.push(this),q.on("shown.bs.modal",function(){b.element(this).find("input:text:visible:first").focus(),a.$broadcast("$modalOpenSuccess"),c.resolve()}),r&&q.on("hidden.bs.modal",function(){r.focus()}),q.modal("show")}.bind(this),function(b){a.$broadcast("$modalOpenError",b),c.reject(b)}),c.promise},this.setScopeAttributes=function(a){D(u,a),k(function(){C&&D(C,a),p&&D(p,a)})},this.hide=function(){var b=i.defer();return a.$broadcast("$modalCloseStart"),q&&A?(q.one("hidden.bs.modal",function(){q.off(),B.destroy(),A=!1,a.$broadcast("$modalCloseSuccess"),b.resolve()}),q.modal("hide")):b.resolve(),b.promise},this.toggle=function(){q.modal("toggle")},this.destroy=function(){n=_.without(n,this);var a=m.getToasts();a.forEach(function(a){+new Date-a.initDate>500&&m.removeToast(a.id)}),k(function(){o&&(o.remove(),A=!1),C&&(C.$destroy(),C=t.$new()),u=d.scopeAttributes||{}}.bind(this))},function(){F();var a=_.values(mwUI.Modal.Sizes);if(-1===a.indexOf(x.size))throw new Error("Modal size "+x.size+" is invalid. It can be only "+a.join(",")+". mwUI.Modal.Sizes provides all available sizes");t.$on("$destroy",function(){B.hide()})}()};this.create=function(a,b){return a&&a.el&&(a.holderEl=a.el,window.mwUI.Utils.shims.deprecationWarning("[Modal] The modal options property el was renamed to holderEl")),a&&a["class"]&&(a.styleClass=a["class"],window.mwUI.Utils.shims.deprecationWarning("[Modal] The modal options property class was renamed to styleClass")),new o(a,b)},this.prepare=function(a,b){return this.create.bind(this,a,b)},this.getOpenedModals=function(){return n}}]),b.module("mwUI.Modal").provider("mwModalOptions",function(){var a={controllerAs:"$ctrl",styleClass:"",holderEl:"body",dismissible:!0,bootStrapModalOptions:{},size:mwUI.Modal.Sizes.DEFAULT};this.config=function(b){_.isObject(b)&&_.extend(a,b)},this.$get=function(){return{getOptions:function(){return _.clone(a)}}}}),b.module("mwUI.Modal").provider("mwModalTmpl",function(){var a;this.setLogoPath=function(b){a=b},this.$get=function(){return{getLogoPath:function(){return a}}}}),$.fn.modal.Constructor.prototype.backdrop=function(a,b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=$.support.transition&&c;if(this.$backdrop=$('