/*! knockstrap 1.4.1 http://faulknercs.github.io/Knockstrap/ | (c) 2013-2020 Artem Stepanyuk |  http://www.opensource.org/licenses/mit-license */
!function(a){"use strict";if("undefined"!=typeof ko&&"undefined"!=typeof jQuery)a(ko,jQuery);else if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module)a(require("knockout"),require("jquery"));else{if("function"!=typeof define||!define.amd)throw new Error("Could not locate current context reference to knockout and jQuery in order to load Knockstrap");define(["knockout","jquery"],a)}}(function(a,b){"use strict";function c(b){var c=this;c.isAligned=b.isAligned,c.currentPage=b.currentPage,c.totalCount=b.totalCount,c.pageSize=b.pageSize,c.text=b.text,c.pagesCount=a.computed(function(){var b=a.unwrap(c.totalCount),d=a.unwrap(c.pageSize);return Math.max(Math.ceil(b/d),1)}),c.isBackDisabled=a.computed(function(){return 1===c.currentPage()}),c.isForwardDisabled=a.computed(function(){return c.currentPage()===c.pagesCount()}),c.goBack=function(){if(!c.isBackDisabled()){var a=c.currentPage();c.currentPage(a-1)}},c.goForward=function(){if(!c.isForwardDisabled()){var a=c.currentPage();c.currentPage(a+1)}}}function d(b){var d=this;c.call(d,b);var f=function(){var b=+a.unwrap(d.maxPages);return(Math.ceil(d.currentPage()/b)-1)*b+1},g=function(b){var c=+a.unwrap(d.maxPages);return Math.min(b+c-1,d.pagesCount())};d.maxPages=b.maxPages,d.boundary=b.boundary,d.directions=b.directions,d.text=b.text,d.pages=a.computed(function(){for(var a=[],b=f(),c=g(b),h=b;c>=h;h++)a.push(new e(h,h,h===d.currentPage()));return b>1&&a.unshift(new e(b-1,"...")),c<d.pagesCount()&&a.push(new e(c+1,"...")),a}),d.selectPage=function(a){d.currentPage(a.number)},d.goFirst=function(){d.isBackDisabled()||d.currentPage(1)},d.goLast=function(){d.isForwardDisabled()||d.currentPage(d.pagesCount())}}function e(a,b,c){this.number=a,this.text=b||a,this.isActive=!!c}function f(b){var c=a.unwrap(b);if("number"==typeof c)return new g({value:b});if("number"==typeof a.unwrap(c.value))return new g(c);throw new Error('progress binding can accept only numbers or objects with "value" number property')}function g(c){var d=this;b.extend(d,a.bindingHandlers.progress.defaults,c),d.barWidth=a.computed(function(){return a.unwrap(d.value)+"%"}),d.barType=a.computed(function(){var b=a.unwrap(d.type);return b?"progress-bar-"+b:""})}a.utils.uniqueId=function(){var a={"ks-unique-":0};return function(b){return b=b||"ks-unique-",a[b]||(a[b]=0),b+a[b]++}}(),a.utils.unwrapProperties=a.toJS,function(){var b={};b.alert='<div class="alert fade in" data-bind="css: type, template: innerTemplate">\n</div>',b.alertInner='<button class="close" data-dismiss="alert" aria-hidden="true">&times;</button>\n<p data-bind="text: message"></p>',b.carousel='<!-- ko template: indicatorsTemplate -->\n<!-- /ko -->\n<div class="carousel-inner">\n    <!-- ko foreach: items -->\n    <div class="item" data-bind="with: $parent.converter($data), css: { active: $index() == 0 }">\n        <img data-bind="attr: { src: src, alt: alt }">\n        <div class="container">\n            <div class="carousel-caption">\n                <!-- ko template: { name: $parents[1].itemTemplateName, data: $data, templateEngine: $parents[1].templateEngine,\n                    afterRender: $parents[1].afterRender, afterAdd: $parents[1].afterAdd, beforeRemove: $parents[1].beforeRemove } -->\n                <!-- /ko -->\n            </div>\n        </div>\n    </div>\n    <!-- /ko -->\n</div>\n<!-- ko template: controlsTemplate -->\n<!-- /ko -->\n',b.carouselContent='<div data-bind="text: content"></div>',b.carouselControls='<a class="left carousel-control" data-bind="attr: { href: id }" data-slide="prev">\n    <span class="icon-prev"></span>\n</a>\n<a class="right carousel-control" data-bind="attr: { href: id }" data-slide="next">\n    <span class="icon-next"></span>\n</a>',b.carouselIndicators='<ol class="carousel-indicators" data-bind="foreach: items">\n    <li data-bind="attr: { \'data-target\': $parent.id, \'data-slide-to\': $index }, css: { active: $index() == 0 }"></li>\n</ol>\n',b.modal='<div class="modal-dialog" data-bind="css: dialogCss">\n    <div class="modal-content">\n        <div class="modal-header" data-bind="template: headerTemplate">\n        </div>\n\n        <div class="modal-body" data-bind="template: bodyTemplate">\n        </div>\n        <!-- ko if: footerTemplate -->\n        <div class="modal-footer" data-bind="template: footerTemplate">\n        </div>\n        <!-- /ko -->\n    </div>\n</div>',b.modalBody='<div data-bind="html: content">\n</div>',b.modalFooter='<!-- ko if: $data.action -->\n<a href="#" class="btn btn-primary" data-bind="click: action, html: primaryLabel"></a>\n<!-- /ko -->\n<a href="#" class="btn btn-default" data-bind="html: closeLabel" data-dismiss="modal"></a>',b.modalHeader='<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\n<h3 data-bind="text: label"></h3>\n',b.pager='<ul class="pager">\n    <li data-bind="css: { previous: isAligned, disabled: isBackDisabled }">\n        <a href="#" data-bind="with: text, click: goBack">\n            <span data-bind="html: back"></span>\n        </a>\n    </li>\n    <li data-bind="css: { next: isAligned, disabled: isForwardDisabled }">\n        <a href="#" data-bind="with: text, click: goForward">\n            <span data-bind="html: forward"></span>\n        </a>\n    </li>\n</ul>\n',b.pagination='<ul class="pagination">\n    <!-- ko if: boundary -->\n    <li class="ks-boundary-first" data-bind="css: { disabled: isBackDisabled }">\n        <a href="#" data-bind="with: text, click: goFirst">\n            <span data-bind="html: first"></span>\n        </a>\n    </li>\n    <!-- /ko -->\n    \n    <!-- ko if: directions -->\n    <li class="ks-direction-back" data-bind="css: { disabled: isBackDisabled }">\n        <a href="#" data-bind="with: text, click: goBack">\n            <span data-bind="html: back"></span>\n        </a>\n    </li>\n    <!-- /ko -->\n\n    <!-- ko foreach: pages -->\n    <li data-bind="css: { active: isActive }">\n        <a href="#" data-bind="text: text, click: $parent.selectPage"></a>\n    </li>\n    <!-- /ko -->\n    \n    <!-- ko if: directions -->\n    <li class="ks-direction-forward" data-bind="css: { disabled: isForwardDisabled }">\n        <a href="#" data-bind="with: text, click: goForward">\n            <span data-bind="html: forward"></span>\n        </a>\n    </li>\n    <!-- /ko -->\n\n    <!-- ko if: boundary -->\n    <li class="ks-boundary-last" data-bind="css: { disabled: isForwardDisabled }">\n        <a href="#" data-bind="with: text, click: goLast">\n            <span data-bind="html: last"></span>\n        </a>\n    </li>\n    <!-- /ko -->\n</ul>',b.progress='<!-- ko foreach: $data -->\n<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"\n    data-bind="style: { width: barWidth }, attr: { \'aria-valuenow\': value }, css: { active: animated, \'progress-bar-striped\': striped }, \'class\': barType">\n    <span data-bind="css: { \'sr-only\': textHidden }">\n        <span data-bind="text: value"></span>% <span data-bind="text: text"></span>\n    </span>\n</div>\n<!-- /ko -->',a.templateSources.stringTemplate=function(a){this.templateName=a,this.data=function(a,c){return b.data=b.data||{},b.data[this.templateName]=b.data[this.templateName]||{},1===arguments.length?b.data[this.templateName][a]:void(b.data[this.templateName][a]=c)},this.text=function(a){return 0===arguments.length?b[this.templateName]:void(b[this.templateName]=a)}},a.stringTemplateEngine=function(){this.allowTemplateRewriting=!1},a.stringTemplateEngine.prototype=new a.nativeTemplateEngine,a.stringTemplateEngine.prototype.constructor=a.stringTemplateEngine,a.stringTemplateEngine.prototype.makeTemplateSource=function(b){return new a.templateSources.stringTemplate(b)},a.stringTemplateEngine.prototype.getTemplate=function(a){return b[a]},a.stringTemplateEngine.prototype.addTemplate=function(a,c){if(arguments.length<2)throw new Error("template is not provided");b[a]=c},a.stringTemplateEngine.prototype.removeTemplate=function(a){if(!a)throw new Error("template name is not provided");delete b[a]},a.stringTemplateEngine.prototype.isTemplateExist=function(a){return!!b[a]},a.stringTemplateEngine.instance=new a.stringTemplateEngine}(),a.bindingHandlers.alert={init:function(){return{controlsDescendantBindings:!0}},update:function(c,d,e,f,g){var h,i,j=b(c),k=d(),l=k.template?null:a.stringTemplateEngine.instance,m=a.unwrap(k.template)||"alertInner";if(c.nodeType===("undefined"!=typeof Node&&Node.ELEMENT_NODE||1))h=m,i=k.data||{message:k.message},j.removeClass("alert-info alert-danger alert-success "),j.addClass("alert fade in").addClass("alert-"+(a.unwrap(k.type)||"info"));else{if(c.nodeType!==("undefined"!=typeof Node&&Node.COMMENT_NODE||8))throw new Error("alert binding should be used with dom elements or ko virtual elements");h="alert",i={innerTemplate:{name:m,data:k.data||{message:k.message},templateEngine:l},type:"alert-"+(a.unwrap(k.type)||"info")}}a.renderTemplate(h,g.createChildContext(i),a.utils.extend({templateEngine:l},k.templateOptions),c)}},a.virtualElements.allowedBindings.alert=!0,a.bindingHandlers.carousel={defaults:{css:"carousel slide",controlsTemplate:{name:"carouselControls",templateEngine:a.stringTemplateEngine.instance,dataConverter:function(b){return{id:a.computed(function(){return"#"+a.unwrap(b.id)})}}},indicatorsTemplate:{name:"carouselIndicators",templateEngine:a.stringTemplateEngine.instance,dataConverter:function(b){return{id:a.computed(function(){return"#"+a.unwrap(b.id)}),items:b.content.data}}},itemTemplate:{name:"carouselContent",templateEngine:a.stringTemplateEngine.instance,converter:function(a){return a}}},init:function(c,d,e,f,g){var h=b(c),i=d(),j=a.bindingHandlers.carousel.defaults,k=function(a,c){var d={name:a.name,data:i[c]&&(i[c].data||i[c].dataConverter&&i[c].dataConverter(i))||a.dataConverter(i)};return d=b.extend(!0,{},d,i[c]),i[c]&&i[c].name||(d.templateEngine=a.templateEngine),d};if(!i.content)throw new Error("content option is required for carousel binding");c.id?i.id=c.id:i.id?c.id=a.unwrap(i.id):c.id=i.id=a.utils.uniqueId("ks-carousel-");var l={id:i.id,controlsTemplate:k(j.controlsTemplate,"controls"),indicatorsTemplate:k(j.indicatorsTemplate,"indicators"),items:i.content.data,converter:i.content.converter||j.itemTemplate.converter,itemTemplateName:i.content.name||j.itemTemplate.name,templateEngine:i.content.name?null:j.itemTemplate.templateEngine,afterRender:i.content.afterRender,afterAdd:i.content.afterAdd,beforeRemove:i.content.beforeRemove};return a.renderTemplate("carousel",g.createChildContext(l),{templateEngine:a.stringTemplateEngine.instance},c),h.addClass(j.css),{controlsDescendantBindings:!0}},update:function(c,d){var e=d(),f=a.unwrap(e.options);b(c).carousel(f)}},a.bindingHandlers.checkbox={init:function(c,d){var e=b(c),f=function(c){setTimeout(function(){var e=b(c.target),f=d(),g=e.val(),h=e.parent().hasClass("active");if(!e.prop("disabled"))if(a.unwrap(f)instanceof Array){var i=a.utils.arrayIndexOf(a.unwrap(f),g);h&&-1===i?f.push(g):h||-1===i||f.splice(i,1)}else f(h)},0)};if("buttons"===e.attr("data-toggle")&&e.find("input:checkbox").length){if(!(a.unwrap(d())instanceof Array))throw new Error("checkbox binding should be used only with array or observableArray values in this case");e.on("change","input:checkbox",f)}else{if("checkbox"!==e.attr("type"))throw new Error("checkbox binding should be used only with bootstrap checkboxes");if(!a.isObservable(d()))throw new Error("checkbox binding should be used only with observable values in this case");e.on("change",f)}},update:function(c,d){var e,f=b(c),g=a.unwrap(d());g instanceof Array?"buttons"===f.attr("data-toggle")?f.find("input:checkbox").each(function(c,d){e=-1!==a.utils.arrayIndexOf(g,d.value),b(d).parent().toggleClass("active",e),d.checked=e}):(e=-1!==a.utils.arrayIndexOf(g,f.val()),f.toggleClass("active",e),f.find("input").prop("checked",e)):(e=!!g,f.prop("checked",e),f.parent().toggleClass("active",e))}};var h="__ko__previousClassValue__";a.bindingHandlers["class"]={update:function(b,c){b[h]&&a.utils.toggleDomNodeCssClass(b,b[h],!1);var d=a.unwrap(c());a.utils.toggleDomNodeCssClass(b,d,!0),b[h]=d}},a.bindingHandlers.modal={defaults:{css:"modal fade",dialogCss:"",attributes:{role:"dialog"},events:{shown:"shown.bs.modal",hidden:"hidden.bs.modal"},headerTemplate:{name:"modalHeader",templateEngine:a.stringTemplateEngine.instance},bodyTemplate:{name:"modalBody",templateEngine:a.stringTemplateEngine.instance},footerTemplate:{name:"modalFooter",templateEngine:a.stringTemplateEngine.instance,data:{closeLabel:"Close",primaryLabel:"Ok"}}},init:function(c,d,e,f,g){var h=b(c),i=d(),j=a.bindingHandlers.modal.defaults,k=b.extend({},j.events,a.toJS(i.events)),l=a.utils.extend({show:h.data().show||!1},a.toJS(i.options)),m=function(a,c){var d={name:a.name,data:a.data};return d=b.extend(!0,{},d,c),c&&c.name||(d.templateEngine=a.templateEngine),d};if(!i.header||!i.body)throw new Error("header and body options are required for modal binding.");(l.keyboard||"undefined"==typeof l.keyboard)&&h.attr("tabindex",-1);var n={dialogCss:i.dialogCss||j.dialogCss,headerTemplate:m(j.headerTemplate,a.unwrap(i.header)),bodyTemplate:m(j.bodyTemplate,a.unwrap(i.body)),footerTemplate:i.footer?m(j.footerTemplate,a.unwrap(i.footer)):null};return a.renderTemplate("modal",g.createChildContext(n),{templateEngine:a.stringTemplateEngine.instance},c),h.addClass(j.css).attr(j.attributes),h.modal(l),h.on(k.shown,function(){"undefined"==typeof i.visible||"function"!=typeof i.visible||a.isComputed(i.visible)||i.visible(!0),b(this).find("[autofocus]:first").focus()}),"undefined"==typeof i.visible||"function"!=typeof i.visible||a.isComputed(i.visible)||(h.on(k.hidden,function(){i.visible(!1)}),l.show&&i.visible(!0)),{controlsDescendantBindings:!0}},update:function(c,d){var e=d();"undefined"!=typeof e.visible&&b(c).modal(a.unwrap(e.visible)?"show":"hide")}},a.bindingHandlers.pagination={defaults:{maxPages:5,pageSize:10,directions:!0,boundary:!0,text:{first:"First",last:"Last",back:"&laquo;",forward:"&raquo;"}},init:function(c,e,f,g,h){var i=b.extend(!0,{},a.bindingHandlers.pagination.defaults,e());if(!a.isObservable(i.currentPage))throw new TypeError("currentPage should be observable");b.isNumeric(i.currentPage())||i.currentPage(1);var j=new d(i);return a.renderTemplate("pagination",h.createChildContext(j),{templateEngine:a.stringTemplateEngine.instance},c),{controlsDescendantBindings:!0}}},a.bindingHandlers.pager={defaults:{pageSize:10,text:{back:"&larr;",forward:"&rarr;"}},init:function(d,e,f,g,h){var i=b.extend(!0,{},a.bindingHandlers.pager.defaults,e());if(!a.isObservable(i.currentPage))throw new TypeError("currentPage should be observable");b.isNumeric(i.currentPage())||i.currentPage(1);var j=new c(i);return a.renderTemplate("pager",h.createChildContext(j),{templateEngine:a.stringTemplateEngine.instance},d),{controlsDescendantBindings:!0}}};var i="__popoverTemplateKey__";a.bindingHandlers.popover={init:function(c){var d=b(c);a.utils.domNodeDisposal.addDisposeCallback(c,function(){d.data("bs.popover")&&d.popover("destroy")})},update:function(c,d,e,f,g){var h=b(c),j=a.unwrap(d()),k=(j.options||j.template?a.utils.unwrapProperties(j.options):a.utils.unwrapProperties(j))||{};if(j.template){a.unwrap(j.template);var l=a.utils.domData.get(c,i),m=function(c){c&&"inserted"===c.type&&h.off("shown.bs.popover");var d,e=a.unwrap(j.template);d="string"==typeof e?{$$popoverTemplate:b.extend({name:j.template,data:j.data},j.templateOptions)}:{$$popoverTemplate:j.template};var f=g.createChildContext(g.$rawData,null,function(b){a.utils.extend(b,d)});a.applyBindingsToDescendants(f,document.getElementById(l));var i=b("#"+l).parents(".popover"),k=h.data("bs.popover"),m=k.options&&k.options.placement||"right",n=k.getCalculatedOffset(m,k.getPosition(),i.outerWidth(),i.outerHeight());k.applyPlacement(n,m)};l||(l=a.utils.uniqueId("ks-popover-"),a.utils.domData.set(c,i,l),h.on("shown.bs.popover inserted.bs.popover",m)),k.content='<div id="'+l+'" ><div data-bind="template: $$popoverTemplate"></div></div>',k.html=!0}var n=h.data("bs.popover");n?(a.utils.extend(n.options,k),n.tip().is(":visible")&&n.options.content&&h.popover("show")):(h.popover(k),h.on("shown.bs.popover inserted.bs.popover",function(){(k.container?b(k.container):h.parent()).one("click",'[data-dismiss="popover"]',function(){h.popover("hide")})}))}},a.bindingHandlers.progress={defaults:{css:"progress",text:"",textHidden:!0,striped:!1,type:"",animated:!1},init:function(c,d){var e,g=b(c),h=d(),i=a.unwrap(h),j=a.bindingHandlers.progress.defaults;return e=i instanceof Array?i.map(function(a){return f(a)}):[f(h)],a.renderTemplate("progress",e,{templateEngine:a.stringTemplateEngine.instance},c),g.addClass(j.css),{controlsDescendantBindings:!0}}},a.bindingHandlers.radio={init:function(c,d){if(!a.isObservable(d()))throw new Error("radio binding should be used only with observable values");b(c).on("change","input:radio",function(a){setTimeout(function(){var c=b(a.target),e=d(),f=c.val();c.prop("disabled")||e(f)},0)})},update:function(c,d){var e,f=a.unwrap(d()),g=null!==f&&void 0!==f?f:"",h=b(c).find('input[value="'+g.toString().replace(/"/g,'\\"')+'"]');h.length?(e=h.parent(),e.siblings().removeClass("active"),e.addClass("active"),h.prop("checked",!0)):(e=b(c).find(".active"),e.removeClass("active"),e.find("input").prop("checked",!1))}},a.bindingHandlers.toggle={init:function(c,d){var e=d();if(!a.isObservable(e))throw new Error("toggle binding should be used only with observable values");b(c).on("click",function(b){b.preventDefault();var c=a.unwrap(e);e(!c)})},update:function(b,c){a.utils.toggleDomNodeCssClass(b,"active",a.unwrap(c()))}},a.bindingHandlers.tooltip={init:function(c){var d=b(c);a.utils.domNodeDisposal.addDisposeCallback(c,function(){d.data("bs.tooltip")&&d.tooltip("destroy")})},update:function(c,d){var e=b(c),f=a.unwrap(d()),g=a.utils.unwrapProperties(f),h=e.data("bs.tooltip");h?a.utils.extend(h.options,g):e.tooltip(g)}}});