/** 
 * WebDataRocks Reporting v1.3.3 (http://www.webdatarocks.com/)
 * Copyright 2020 WebDataRocks. All rights reserved.
 */
(function(a,b){"function"===typeof define&&define.amd&&define("webdatarocks",[],b);a.WebDataRocks=b()})(window,function(){return function(a){var __extends=this&&this.__extends||function(){var d=function(e,h){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var a in b)b.hasOwnProperty(a)&&(d[a]=b[a])};return d(e,h)};return function(e,h){function f(){this.constructor=e}d(e,h);e.prototype=null===h?Object.create(h):(f.prototype=h.prototype,new f)}}(),events;
(function(d){var e=function(){function d(f,b,a){void 0===b&&(b=null);void 0===a&&(a=null);this.type=f;this.target=b;this.data=a}d.isNativeType=function(d){return-1<"fullscreenchange mozfullscreenchange webkitfullscreenchange MSFullscreenChange focusin focusout touchstart touchmove touchend touchenter touchleave touchcancel".split(" ").indexOf(d)};d.COMPLETE="event_complete";d.CONNECTED="event_connected";d.PROGRESS="event_progress";d.SELECT="event_select";d.CHANGE="event_change";d.ERROR="event_error";
d.OPENED="event_opened";d.CLOSED="event_closed";d.CANCEL="event_cancel";d.OPEN="event_open";d.CLOSE="event_close";d.RESIZE="event_resize";return d}();d._Event=e;e=function(){function e(){this.dispatchActive=!1;this._listeners=[];this._addedListeners=[];this._deletedListeners=[]}e.prototype.areListenersEqual=function(d,b){return d.type==b.type&&d.handler==b.handler};e.prototype.hasEventListener=function(d,b){if(utils.nullOrUndefined(this._listeners[d]))return!1;for(var a=0;a<this._listeners[d].length;a++)if(this.areListenersEqual(this._listeners[d][a],
b))return!0;return!1};e.prototype.addEventListener=function(d,b,a){void 0===a&&(a=0);b={type:d,handler:b,priority:a};if(!this.hasEventListener(d,b))if(this.dispatchActive)utils.nullOrUndefined(this._addedListeners[d])&&(this._addedListeners[d]=[]),this._addedListeners[d].push(b);else if(utils.nullOrUndefined(this._listeners[d])&&(this._listeners[d]=[]),0==this._listeners[d].length)this._listeners[d].push(b);else{this._listeners[d][this._listeners[d].length-1].priority>=a&&this._listeners[d].push(b);
for(var c=0;c<this._listeners[d].length;c++)if(this._listeners[d][c].priority<a){this._listeners[d].splice(c,0,b);break}}};e.prototype.removeEventListener=function(d,b){if(!utils.nullOrUndefined(this._listeners[d])){for(var a={type:d,handler:b},c=this._listeners[d].slice(0),g=[],m=0;m<c.length;m++)this.areListenersEqual(c[m],a)?this.dispatchActive&&(utils.nullOrUndefined(this._deletedListeners[d])&&(this._deletedListeners[d]=[]),this._deletedListeners[d].push(c[m])):g.push(c[m]);this._listeners[d]=
g}};e.prototype.removeAllEventListeners=function(d){void 0===d?(this._listeners=[],this._addedListeners=[],this._deletedListeners=[]):(utils.nullOrUndefined(this._listeners)||(this._listeners[d]=[]),utils.nullOrUndefined(this._addedListeners)||(this._addedListeners[d]=[]),utils.nullOrUndefined(this._deletedListeners)||(this._deletedListeners[d]=[]))};e.prototype.dispatch=function(d){if(!utils.nullOrUndefined(this._listeners[d.type])){this.dispatchActive=!0;for(var b=this._listeners[d.type].slice(0),
a=0;a<b.length;a++){if(!utils.nullOrUndefined(this._deletedListeners[d.type])){var c=!1,g;for(g in this._deletedListeners[d.type])this.areListenersEqual(b[a],this._deletedListeners[d.type][g])&&(c=!0);if(c)continue}d instanceof pivot.model.APIEvent?b[a].handler.call(this,d.data):b[a].handler.call(this,d)}delete this._deletedListeners[d.type];for(var m in this._addedListeners){if(utils.nullOrUndefined(this._listeners[m]))b=[];else if(this._listeners[m]instanceof Array)b=this._listeners[m].slice(0);
else continue;if(!utils.nullOrUndefined(this._addedListeners[m]))for(a=0;a<this._addedListeners[m].length;a++)if(0==b.length)b.push(this._addedListeners[m][a]);else for(b[b.length-1].priority==this._addedListeners[m][a].priority&&b.push(this._addedListeners[m][a]),d=0;d<b.length;d++)if(b[d].priority<this._addedListeners[m][a].priority){b.splice(d,0,this._addedListeners[m][a]);break}this._listeners[m]=b;this._addedListeners[m]=[]}this.dispatchActive=!1}};e.prototype.dispatchWith=function(e,b,a){e=
new d._Event(e,null==b?this:b,a);this.dispatch(e)};return e}();d.EventDispatcher=e})(events||(events={}));var uicontrols;
(function(d){(function(e){var h=function(){function e(){var b=this;this.distance=5;this._lastDraggable=null;utils.fmdocument.addEventListener("mousemove",function(a){return b.onMouseMove(a)});utils.fmdocument.addEventListener("touchmove",function(a){return b.onTouchMove(a)},!1);utils.fmdocument.addEventListener("mouseup",function(a){return b.onMouseUp(a)});utils.fmdocument.addEventListener("touchend",function(a){return b.onTouchEnd(a)});utils.fmdocument.addEventListener("touchcancel",function(a){return b.onTouchEnd(a)})}
e.getInstance=function(){e.instance||(e.instance=new e);return e.instance};e.dispose=function(){e.instance=null};e.prototype.makeDraggable=function(b,a){var c=this;b.addClass("wdr-draggable");var g=function(g){a.handle&&!g.target.matches(a.handle)||c.dragElement==b||(null!=c.dragElement&&c.stopDrag(a,g),c.dragElement=b,c.dragOptions=a,c.startX=c.getX(g),c.startY=c.getY(g))};b.addEventListener("mousedown",g);b.addEventListener("touchstart",g)};e.prototype.getX=function(b){return b instanceof MouseEvent?
b.clientX:b.changedTouches[0].clientX};e.prototype.getY=function(b){return b instanceof MouseEvent?b.clientY:b.changedTouches[0].clientY};e.prototype.onMouseMove=function(b){if(1==b.which&&this.dragElement)if(this.dragHelper&&this.dragElement.hasClass("wdr-dragging")){this.setHelperPosition(b.clientX,b.clientY);if(this.dragOptions.onDrag)this.dragOptions.onDrag(this.dragElement,b);b.preventDefault()}else utils.nullOrUndefined(this.dragOptions.onDragStart)||this.dragOptions.onDragStart(this.dragElement,
b)?(this.dragHelper=this.dragOptions.createHelper(this.dragElement),this.dragHelper.css("opacity",0),pivot._view.PivotView.stage.container.addChild(this.dragHelper),this.setHelperPosition(b.clientX,b.clientY,!0),this.dragElement.addClass("wdr-dragging")):(this.dragElement=null,this.dragHelper.removeFromParent(!0),this.dragHelper=null)};e.prototype.isDistanceOK=function(b,a){return Math.abs(this.startX-b)>this.distance||Math.abs(this.startY-a)>this.distance?!0:!1};e.prototype.setHelperPosition=function(b,
a,c){void 0===c&&(c=!1);if(null!=this.dragHelper){var g=pivot._view.PivotView.stage.container.getOffset();this.dragHelper.position({top:a-g.top,left:b-g.left});this.isDistanceOK(b,a)&&(this.dragHelper.css("opacity",1),this.dragElement.addClass("wdr-dragging-move"));c&&null!=this.dragElement&&(g=this.dragElement.getOffset(),a=Math.max(0,Math.min(this.dragElement.height,a-g.top)),b=Math.max(0,Math.min(this.dragElement.width,this.dragHelper.width,b-g.left)),this.dragHelper.css("margin-top",-a+"px"),
this.dragHelper.css("margin-left",-b+"px"))}};e.prototype.onTouchMove=function(b){if(this.dragElement){var a=b.touches[0];if(this.dragHelper&&this.dragElement.hasClass("wdr-dragging")){this.setHelperPosition(a.clientX,a.clientY);if(this.dragOptions.onDrag)this.dragOptions.onDrag(this.dragElement,b);b.preventDefault();a=b.changedTouches[0];if(a=d.UIElement.convert(document.elementFromPoint(a.clientX,a.clientY))){var c=a.closest(".wdr-droppable");c&&c.droppableOptions&&c.droppableOptions.onDragOver&&
(c.droppableOptions.onDragOver(this.dragElement,this.dragHelper,c,b),this._lastDraggable=c)}if((null==a||null==c)&&null!=this._lastDraggable&&this._lastDraggable.droppableOptions&&this._lastDraggable.droppableOptions.onDragLeave)this._lastDraggable.droppableOptions.onDragLeave(this.dragElement,this.dragHelper,this._lastDraggable,b)}else utils.nullOrUndefined(this.dragOptions.onDragStart)||this.dragOptions.onDragStart(this.dragElement,b)?(this.dragHelper=this.dragOptions.createHelper(this.dragElement),
this.dragHelper.css("opacity",0),pivot._view.PivotView.stage.container.addChild(this.dragHelper),this.setHelperPosition(a.clientX,a.clientY,!0),this.dragElement.addClass("wdr-dragging")):(this.dragElement=null,this.dragHelper.removeFromParent(!0),this.dragHelper=null)}};e.prototype.onMouseUp=function(b){this.stopDrag(this.dragOptions,b)};e.prototype.onTouchEnd=function(b){for(var a=b.changedTouches[0],c=a=d.UIElement.convert(document.elementFromPoint(a.clientX,a.clientY));a;){if(a.hasClass("wdr-droppable")){utils.nullOrEmpty(a.droppableOptions.itemSelector)||
(c=c.closest(a.droppableOptions.itemSelector));a.droppableOptions.onDrop(this.dragElement,a,c,b);break}a=a.parent}this.stopDrag(this.dragOptions,b)};e.prototype.stopDrag=function(b,a){null!=this.dragHelper&&(this.dragHelper.removeFromParent(!0),this.dragHelper=null);if(null!=this.dragElement){this.dragElement.removeClass("wdr-dragging");this.dragElement.removeClass("wdr-dragging-move");if(b.onDragEnd&&this.isDistanceOK(this.getX(a),this.getY(a)))b.onDragEnd(this.dragElement,a);this.dragElement=null}this._lastDraggable=
null;this.startY=this.startX=NaN};e.prototype.makeDroppable=function(b,a,c){var g=this;b.hasClass("wdr-droppable")||(b.addClass("wdr-droppable"),b.addEventListener("mouseenter",function(b){if(null!=g.dragElement&&1==b.which&&c.onDragEnter)c.onDragEnter(g.dragElement,g.dragHelper,a,b)}),b.addEventListener("mouseleave",function(b){if(null!=g.dragElement&&1==b.which&&c.onDragLeave)c.onDragLeave(g.dragElement,g.dragHelper,a,b)}),b.addEventListener("mouseover",function(b){if(null!=g.dragElement&&1==b.which&&
c.onDragOver)c.onDragOver(g.dragElement,g.dragHelper,a,b)}),b.addEventListener("mouseup",function(a){if(null!=g.dragElement&&1==a.which){var k=d.UIElement.convert(a.target);utils.nullOrEmpty(c.itemSelector)||(k=k.closest(c.itemSelector));c.onDrop(g.dragElement,b,k,a)}}))};return e}();e.DragManager=h})(d.dragndrop||(d.dragndrop={}))})(uicontrols||(uicontrols={}));
(function(d){var e=function(e){function f(b,a){void 0===b&&(b="div");void 0===a&&(a="");var c=e.call(this)||this;c.container=new d.UIElement(b);c.container.addClass("wdr-ui "+a);utils.browserVersion().isMobile&&c.container.addClass("wdr-ui-mobile");c.validate();return c}__extends(f,e);f.prototype.validate=function(){this.invalidHash={}};f.prototype.invalidate=function(b){void 0===b&&(b="all");this.invalidHash[b]=!0;this.draw()};f.prototype.isInvalid=function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=
arguments[a];if(this.invalidHash.all)return!0;for(a=0;a<b.length;a++)if(this.invalidHash[b[a]])return!0;return!1};f.prototype.draw=function(){this.validate()};f.prototype.validateNow=function(){this.invalidate()};f.prototype.show=function(){this.container.show()};f.prototype.hide=function(){this.container.hide()};f.prototype.getId=function(){return this.container.attr("id")};f.prototype.setId=function(b){this.container.attr("id",b)};f.prototype.getName=function(){return this.name};f.prototype.setName=
function(b){this.name=b};f.prototype.html=function(b){if(void 0===b)return this.container.html();this.container.html(b);return this};f.prototype.setEnabled=function(b){this.container.toggleClass("wdr-ui-disabled",!b)};f.prototype.getEnabled=function(){return!this.container.hasClass("wdr-ui-disabled")};f.prototype.addClass=function(b){void 0===b&&(b="");this.container.addClass(b)};f.prototype.removeClass=function(b){this.container.removeClass(b)};Object.defineProperty(f.prototype,"padding",{get:function(){return this.container.padding},
set:function(b){},enumerable:!0,configurable:!0});f.prototype.getWidth=function(b){return this.container.getWidth(b)};f.prototype.setWidth=function(b){this.getWidth()!==b&&(this.container.setWidth(b),this.invalidate("size"))};f.prototype.getHeight=function(b){void 0===b&&(b=!1);return this.container.getHeight(b)};f.prototype.setHeight=function(b){this.getHeight()!==b&&(this.container.setHeight(b),this.invalidate("size"))};f.prototype.isVisible=function(b){void 0===b&&(b=void 0);void 0!==b&&(b?this.show():
this.hide());return this.container.visible};f.prototype.position=function(){return this.container.position()};f.prototype.addChild=function(b,a){void 0===a&&(a=!1);a?this.container.prepend(b.container):this.container.append(b.container)};f.prototype.removeFromParent=function(b){void 0===b&&(b=!1);b?this.container.remove():this.container.detach()};f.prototype.getX=function(){return this.container.left};f.prototype.getY=function(){return this.container.top};f.prototype.hitTestPoint=function(b,a){return b>=
this.getX()&&b<=this.getX()+this.getWidth()&&a>=this.getY()&&a<=this.getY()+this.getHeight()};f.prototype.addEventListener=function(b,a){this.container.addEventListener(b,a)};f.prototype.removeEventListener=function(b,a){this.container.removeEventListener(b,a)};f.prototype.dispatch=function(b){this.container.dispatch(b)};f.prototype.dispatchWith=function(b,a,c){this.container.dispatchWith(b,a,c)};f.prototype.addLayoutClasses=function(b){void 0===b&&(b=!1);b=b?this.getWidth(!0):pivot._view.PivotView.stageWidth;
this.container.toggleClass("wdr-layout-tablet",768>b);this.container.toggleClass("wdr-layout-mobile",580>b);this.container.toggleClass("wdr-layout-mobile-small",460>b)};return f}(events.EventDispatcher);d.UIComponentBase=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(e){function f(b,a){void 0===b&&(b="div");void 0===a&&(a="");var c=e.call(this)||this;c.display="block";c.frames=[];c.__handlers=[];c.element="string"==typeof b?document.createElement(b):b;c.addClass("wdr-ui-element");c.addClass(a);return c}__extends(f,e);Object.defineProperty(f.prototype,"element",{get:function(){return this._element},set:function(b){(this._element=b)&&(this._element.uielement=this)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"id",
{get:function(){return this.element.id},set:function(b){this.element.id=b},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"parent",{get:function(){return f.convert(this.element.parentElement)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"nodeName",{get:function(){return this._element.nodeName.toLowerCase()},enumerable:!0,configurable:!0});f.prototype.addChild=function(b){this.element.appendChild(b.element)};f.prototype.children=function(){for(var b=this.element.firstElementChild,
a=[];b;)a.push(f.convert(b)),b=b.nextElementSibling;return a};f.prototype.contains=function(b){return this.element.contains(b.element)};f.prototype.append=function(b){b&&this.addChild(b);return this};f.prototype.prepend=function(b){this.element.insertBefore(b.element,this.element.firstChild);return this};f.prototype.before=function(b){this.element.parentNode&&this.element.parentNode.insertBefore(b.element,this.element);return this};f.prototype.after=function(b){this.element.parentNode&&this.element.nextElementSibling?
this.element.parentNode.insertBefore(b.element,this.element.nextElementSibling):this.append(b);return this};f.prototype.addComponent=function(b){this.element.appendChild(b.container.element)};f.prototype.removeFromParent=function(b){void 0===b&&(b=!0);b?this.remove():this.detach()};f.prototype.remove=function(){null!=this.element&&(this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispose())};f.prototype.detach=function(){if(null!=this.element&&this.element.parentNode){var b=
this.element.cloneNode(!0);this.element.parentNode.removeChild(this.element);this.element=b}};f.prototype.removeAllChildren=function(){for(;this.element&&this.element.firstChild;){var b=f.convert(this.element.firstChild);b&&b.dispose&&b.dispose();this.element.removeChild(this.element.firstChild)}};f.prototype.clone=function(){return f.convert(this.element.cloneNode(!0))};f.convert=function(b){return b&&b.nodeType==Node.ELEMENT_NODE?utils.nullOrUndefined(b.uielement)?new f(b):b.uielement:null};f.prototype.get=
function(b){var a=this.children();return 0<a.length?a[b]:null};f.prototype.find=function(b,a){if(void 0===a||!1==a)return f.convert(this.element.querySelector(b));for(var c=this.element.querySelectorAll(b),g=[],m=0;m<c.length;m++)g.push(f.convert(c[m]));return g};f.prototype.closest=function(b){if(!this.element)return null;for(var a=this.element;null!=a;){if(a.matches){if(a.matches(b))return a==this.element?this:f.convert(a)}else if(a.msMatchesSelector(b))return a==this.element?this:f.convert(a);
a=a.parentElement}return null};f.prototype.addClass=function(b){if(!this.element)return this;b=b.trim();for(var a=b.split(" "),c=0;c<a.length;c++)0<a[c].length&&(utils.detectBrowser().isMsie?(b=this.element.getAttribute("class"),utils.nullOrUndefined(b)?this.element.setAttribute("class",a[c]):-1==b.split(" ").indexOf(a[c])&&this.element.setAttribute("class",b+" "+a[c])):!1==this.element.classList.contains(a[c])&&this.element.classList.add(a[c]));return this};f.prototype.removeClass=function(b){if(!this.element)return this;
b=b.trim();if(0<b.length)if(utils.detectBrowser().isMsie){var a=this.element.getAttribute("class");utils.nullOrUndefined(a)||(a=a.split(" "),b=a.indexOf(b),-1<b&&(a.splice(b,1),this.element.setAttribute("class",a.join(" "))))}else this.element.classList.contains(b)&&this.element.classList.remove(b);return this};f.prototype.toggleClass=function(b,a){a?this.addClass(b):this.removeClass(b)};f.prototype.hasClass=function(b){return this.element.classList.contains(b)};f.prototype.disableSelection=function(){this.addClass("wdr-noselect");
return this};f.prototype.enableSelection=function(){this.addClass("wdr-selectable");return this};f.prototype.getWidth=function(b){void 0===b&&(b=!1);if(!this.element)return 0;var a=window.getComputedStyle(this.element);b=b?0:(parseFloat(a.paddingLeft)||0)+(parseFloat(a.paddingRight)||0);return this.element.clientWidth-b};f.prototype.setWidth=function(b){"number"===typeof b?this.element.style.width=b+"px":"string"===typeof b&&(this.element.style.width=b);return this};Object.defineProperty(f.prototype,
"width",{get:function(){return this.getWidth()},set:function(b){this.setWidth(b)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"padding",{get:function(){var b=window.getComputedStyle(this.element);return{left:parseFloat(b.paddingLeft)||0,right:parseFloat(b.paddingRight)||0,top:parseFloat(b.paddingTop)||0,bottom:parseFloat(b.paddingBottom)||0}},set:function(b){},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"borderWidth",{get:function(){var b=window.getComputedStyle(this.element);
return{left:parseFloat(b.borderLeftWidth||b.borderWidth)||0,right:parseFloat(b.borderRightWidth||b.borderWidth)||0,top:parseFloat(b.borderTopWidth||b.borderWidth)||0,bottom:parseFloat(b.borderBottomWidth||b.borderWidth)||0}},enumerable:!0,configurable:!0});f.prototype.getHeight=function(b){void 0===b&&(b=!1);var a=window.getComputedStyle(this.element);b=b?0:(parseFloat(a.paddingTop)||0)+(parseFloat(a.paddingBottom)||0);return 0>this.element.clientHeight-b?0:this.element.clientHeight-b};f.prototype.setHeight=
function(b){"number"===typeof b?this.element.style.height=b+"px":"string"===typeof b&&(this.element.style.height=b);return this};Object.defineProperty(f.prototype,"height",{get:function(){return this.getHeight()},set:function(b){this.setHeight(b)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"left",{get:function(){return this.element.getBoundingClientRect().left},set:function(b){this.element.style.left=b+"px"},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,
"top",{get:function(){return this.element.getBoundingClientRect().top},set:function(b){this.element.style.top=b+"px"},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"right",{get:function(){return this.element.getBoundingClientRect().right},set:function(b){this.element.style.right=b+"px"},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"bottom",{get:function(){return this.element.getBoundingClientRect().bottom},set:function(b){this.element.style.bottom=b+"px"},
enumerable:!0,configurable:!0});f.prototype.outerHtml=function(){return this.element.outerHTML};f.prototype.html=function(b){if(void 0===b)return this.element.innerHTML;this.element.innerHTML=b;return this};f.prototype.empty=function(){this.html("")};f.prototype.clear=function(){this.empty()};f.prototype.text=function(b){if(void 0===b)return this.element.textContent;"input"==this.element.tagName.toLowerCase()?this.element.value=b:this.element.textContent=b;return this};f.prototype.focus=function(){this.element.focus();
return this};f.prototype.blur=function(){this.element.blur();return this};f.prototype.show=function(){this.element.style.display=this.display};f.prototype.hide=function(){this.element.style.display="none"};Object.defineProperty(f.prototype,"x",{get:function(){return this.element.offsetLeft},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"y",{get:function(){return this.element.offsetTop},enumerable:!0,configurable:!0});f.prototype.offset=function(b){if(void 0===b)return this.getOffset();
this.css("left",b.left+"px");this.css("top",b.top+"px")};f.prototype.getBoundingClientRect=function(){return this.element.getBoundingClientRect()};f.prototype.position=function(b){if(void 0===b)return{top:this.y,left:this.x};this.offset(b)};f.prototype.attr=function(b,a){if(void 0===a)return this.element.getAttribute(b);try{this.element.setAttribute(b,a)}catch(c){this.element.attributes[b]=a}return this};f.prototype.removeAttr=function(b){this.element.removeAttribute(b);return this};f.prototype.css=
function(b,a){if(void 0===a)return window.getComputedStyle(this.element)[f.toCamelCase(b)];this.element.style[f.toCamelCase(b)]=a;return this};f.toCamelCase=function(b){var a=b.split("-");if(1<a.length){for(b=1;b<a.length;b++)a[b]=a[b].charAt(0).toUpperCase()+a[b].substr(1);return a.join("")}return b};f.prototype.val=function(){return"input"==this.element.tagName.toLowerCase()||"textarea"==this.element.tagName.toLowerCase()?this.element.value:this.element.textContent};f.prototype.requestAnimationFrame=
function(b){var a=0;window.requestAnimationFrame?a=window.requestAnimationFrame(b):window.msRequestAnimationFrame?a=window.msRequestAnimationFrame(b):window.mozRequestAnimationFrame?a=window.mozRequestAnimationFrame(b):window.webkitRequestAnimationFrame?a=window.webkitRequestAnimationFrame(b):b.call(null);this.frames.push(a);return a};f.prototype.cancelAnimationFrame=function(b){this.frames.splice(this.frames.indexOf(b),1);0!=b&&(null!=window.cancelAnimationFrame?window.cancelAnimationFrame(b):null!=
window.msCancelRequestAnimationFrame?window.msCancelRequestAnimationFrame(b):null!=window.mozCancelAnimationFrame?window.mozCancelAnimationFrame(b):null!=window.webkitCancelAnimationFrame&&window.webkitCancelAnimationFrame(b))};Object.defineProperty(f.prototype,"visible",{get:function(){return this.element&&"none"!=this.css("display")},set:function(b){b?this.show():this.hide()},enumerable:!0,configurable:!0});f.prototype.getOffset=function(b){void 0===b&&(b=null);if(null==b)return this.element.getBoundingClientRect();
for(var a=0,c=0,g=this.element;g&&g!=b&&!isNaN(g.offsetLeft)&&!isNaN(g.offsetTop);)a+=g.offsetLeft-g.scrollLeft,c+=g.offsetTop-g.scrollTop,g=g.offsetParent;return{top:c,left:a}};f.prototype.getScrollTop=function(){return this.element.scrollTop};f.prototype.setScrollTop=function(b){this.element.scrollTop=b;return this};f.prototype.setScrollLeft=function(b){this.element.scrollLeft=b;return this};f.prototype.addEventListener=function(b,a,c){"undefined"!==typeof this.element["on"+b]||events._Event.isNativeType(b)?
(utils.nullOrUndefined(this.__handlers[b])&&(this.__handlers[b]=[]),this.__handlers[b][a.toString()]=function(c){a(c)},this.element.addEventListener(b,this.__handlers[b][a.toString()],c)):e.prototype.addEventListener.call(this,b,a,c)};f.prototype.removeEventListener=function(b,a,c){"undefined"!==typeof this.element["on"+b]||events._Event.isNativeType(b)?this.__handlers[b]&&this.element.removeEventListener(b,this.__handlers[b][a.toString()],c):e.prototype.removeEventListener.call(this,b,a)};f.prototype.dispatch=
function(b){e.prototype.dispatch.call(this,b)};f.prototype.removeAllEventListeners=function(b){for(var a in this.__handlers)if(void 0===b||b==a)for(var c in this.__handlers[a])try{this.element.removeEventListener(a,this.__handlers[a][c],!0),this.element.removeEventListener(a,this.__handlers[a][c],!1)}catch(g){console.error(g)}this.__handlers=[];e.prototype.removeAllEventListeners.call(this,a)};f.prototype.dispose=function(){this.removeAllEventListeners();this.removeAllChildren();this._element=this._element.uielement=
null;for(var b=0;b<this.frames.length;b++)this.cancelAnimationFrame(this.frames[b]);this.frames=[];this._resizableHelper&&this._resizableHelper.dispose()};f.prototype.refresh=function(){this.html(this.html())};f.prototype.draggable=function(b){d.dragndrop.DragManager.getInstance().makeDraggable(this,b)};f.prototype.droppable=function(b,a){this._droppableOptions=b;d.dragndrop.DragManager.getInstance().makeDroppable(this,a?a:this,b)};Object.defineProperty(f.prototype,"droppableOptions",{get:function(){return this._droppableOptions},
enumerable:!0,configurable:!0});f.prototype.index=function(){for(var b=0,a=this.element;a=a.previousElementSibling;)b++;return b};f.prototype.resizable=function(b){this._resizableHelper=new d.resizable.ResizableHelper(this,b)};return f}(events.EventDispatcher);d.UIElement=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(d){function e(b){void 0===b&&(b="");var a=d.call(this,"a","wdr-ui-btn")||this;a.mouseDownTimeout=0;a.repeatDelay=50;a.addClass(b);a.container.addEventListener("click",function(c){return a.onClick(c)});a.container.addEventListener("mousedown",function(c){return a.onMouseDown()});a.container.addEventListener("mouseup",function(c){return a.onMouseUp()});a.container.addEventListener("mouseout",function(c){return a.onMouseOut()});a.container.display="inline-block";return a}
__extends(e,d);e.prototype.onClick=function(b){this.getEnabled()&&this.dispatchWith(e.CLICK_EVENT,this);b.stopImmediatePropagation()};e.prototype.onMouseDown=function(){var b=this;this.container.toggleClass("wdr-ui-pressed",!0);this.mouseDownTimeout=utils.fmSetInterval(function(){return b.dispatchMouseDown()},this.getRepeatDelay())};e.prototype.dispatchMouseDown=function(){this.dispatch(new events._Event(e.MOUSE_DOWN_EVENT,this))};e.prototype.onMouseUp=function(){this.container.toggleClass("wdr-ui-pressed",
!1);utils.fmClearInterval(this.mouseDownTimeout)};e.prototype.onMouseOut=function(){this.container.toggleClass("wdr-ui-pressed",!1);utils.fmClearInterval(this.mouseDownTimeout)};e.prototype.getLabel=function(){return this.label};e.prototype.setRepeatDelay=function(b){this.repeatDelay=b};e.prototype.getRepeatDelay=function(){return this.repeatDelay};e.prototype.setLabel=function(b){this.label!=b&&(this.label=b,this.container.text(this.label))};e.MOUSE_DOWN_EVENT="buttonmousedown";e.CLICK_EVENT="buttonclick";
return e}(d.UIComponentBase);d.UIButton=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(d){function e(b){void 0===b&&(b="");var a=d.call(this,"span","wdr-ui wdr-ui-label")||this;a.container.display="inline-block";a.setLabel(b);return a}__extends(e,d);e.prototype.getLabel=function(){return this.label};e.prototype.setLabel=function(b,a){void 0===a&&(a=!1);this.label!=b&&(this.label=b,a?this.container.html(this.label):this.container.text(this.label))};e.prototype.setSelectable=function(b){b?this.container.enableSelection():this.container.disableSelection()};
return e}(d.UIComponentBase);d.UILabel=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(e){function f(){var b=e.call(this,"textarea","wdr-ui-text-area")||this;b.container.addEventListener("keypress",function(a){return b.onKeyPressed(a)});b.container.addEventListener("keyup",function(a){return b.onKeyUp(a)});b.container.addEventListener("paste",function(a){return b.onInputPaste(a)});return b}__extends(f,e);f.prototype.onKeyUp=function(b){this.dispatchChange()};f.prototype.onInputPaste=function(b){this.dispatchChange()};f.prototype.dispatchChange=function(){this.dispatch(new events._Event(d.UITextInput.CHANGE_EVENT,
this))};f.prototype.getText=function(){return this.container.val()};f.prototype.setText=function(b){this.getText()!=b&&(this.container.element.value=b,this.dispatchChange())};f.prototype.clear=function(){this.setText("")};f.prototype.insertText=function(b){var a=this.getSelectionBeginIndex(),c=this.getSelectionEndIndex(),g=this.getText(),g=g.substr(0,a)+b+g.substr(a);this.setText(g);this.setSelection(a+b.length,c+b.length)};f.prototype.setSelection=function(b,a){void 0===a&&(a=-1);this.container.element.focus();
this.container.element.setSelectionRange(b,0>a?b:a)};f.prototype.getSelectionBeginIndex=function(){return this.container.element.selectionStart};f.prototype.getSelectionEndIndex=function(){return this.container.element.selectionEnd};f.prototype.selectAll=function(){this.setSelection(0,this.getText().length)};f.prototype.onKeyPressed=function(b){b.ctrlKey?(this.dispatchWith(f.EVENT_CTRL_ENTER),b.preventDefault()):13==b.keyCode&&(this.dispatchWith(f.EVENT_ENTER),b.preventDefault())};f.EVENT_ENTER="ntr";
f.EVENT_CTRL_ENTER="ntl";return f}(d.UIComponentBase);d.UITextArea=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(d){function e(){var b=d.call(this,"input","wdr-ui-text-input")||this;b.text="";b.prompt="";b.changeDelay=0;b.changeDispatched=!0;b.container.display="inline-block";b.container.attr("type","text");b.container.attr("data-placeholder","");b.container.addEventListener("focusin",function(a){return b.onFocusIn()});b.container.addEventListener("focusout",function(a){return b.onFocusOut()});b.container.addEventListener("keyup",function(a){return b.onKeyUp(a)});b.container.addEventListener("keypress",
function(a){return b.onKeyPressed(a)});b.container.addEventListener("paste",function(a){return b.onInputPaste(a)});return b}__extends(e,d);e.getChar=function(b){return null==b.which?32>b.keyCode?null:String.fromCharCode(b.keyCode):0!=b.which&&0!=b.charCode?32>b.which?null:String.fromCharCode(b.which):null};e.prototype.onKeyPressed=function(b){13==b.keyCode&&this.dispatchWith(e.EVENT_ENTER);if(!(utils.nullOrUndefined(this.restrictRule)||b.ctrlKey||b.altKey||b.metaKey)){var a=e.getChar(b);null!=a&&
!1===this.restrictRule.test(a)&&b.preventDefault()}};e.prototype.onKeyUp=function(b){this.container.val()!==this.text&&(this.text=this.container.val(),this.dispatchChange())};e.prototype.onInputPaste=function(b){this.container.val()!==this.text&&(this.text=this.container.val(),this.dispatchChange())};e.prototype.dispatchChange=function(){var b=this;0<this.changeDelay?this.changeDispatched&&(this.changeDispatched=!1,utils.fmSetTimeout(function(){return b._dispatchChange()},this.changeDelay)):this._dispatchChange()};
e.prototype._dispatchChange=function(){this.changeDispatched=!0;this.dispatch(new events._Event(e.CHANGE_EVENT,this,this.text))};e.prototype.onFocusIn=function(){0==this.text.length&&(this.container.text(""),this.enablePrompt(!1))};e.prototype.onFocusOut=function(){this.enablePrompt(0==this.text.length)};e.prototype.getText=function(){return this.text=this.container.val()==this.prompt?this.text:this.container.val()};e.prototype.setText=function(b){this.text!=b&&(this.text=b,this.container.text(this.text),
this.enablePrompt(0==this.text.length))};e.prototype.clear=function(b){void 0===b&&(b=!0);this.setText("");b&&this._dispatchChange()};e.prototype.setPrompt=function(b){b!=this.prompt&&(this.prompt=b,this.container.attr("data-placeholder",this.prompt),this.enablePrompt(0==this.text.length))};e.prototype.enablePrompt=function(b){this.container.text(b?this.prompt:this.text);this.container.toggleClass("wdr-ui-prompt",b)};e.prototype.getPrompt=function(){return this.prompt};e.prototype.setRestriction=
function(b){this.restrictRule=b};e.prototype.getRestriction=function(){return this.restrictRule};e.prototype.setChangeDelay=function(b){this.changeDelay=b};e.prototype.getChangeDelay=function(){return this.changeDelay};e.prototype.getType=function(){return this.container.attr("type")};e.prototype.setType=function(b){this.container.attr("type",b)};e.CHANGE_EVENT="_";e.EVENT_ENTER="ntr";return e}(d.UIComponentBase);d.UITextInput=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(e){function f(){var b=e.call(this)||this;b.container.display="inline-block";b.container.hasClass("wdr-ui-btn")&&b.container.removeClass("wdr-ui-btn");b.container.addClass("wdr-ui-toggle-btn");b.selected=0;b.addEventListener(d.UIButton.CLICK_EVENT,function(){return b.onClick()});return b}__extends(f,e);f.prototype.onClick=function(){this.getEnabled()&&(this.toggle(),this.dispatchWith(events._Event.CHANGE,this))};f.prototype.toggle=function(){this.selected=1==this.selected?
0:1;this.container.toggleClass("wdr-selected",1==this.selected)};f.prototype.setSelection=function(b){this.selected==b||1<b||-1>b||(this.selected=b,this.container.toggleClass("wdr-selected",1==this.selected))};f.prototype.getSelection=function(){return this.selected};return f}(d.UIButton);d.UIToggleButton=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(e){function f(){var b=e.call(this)||this;b.container.display="inline-block";b.container.hasClass("wdr-ui-toggle-btn")&&b.container.removeClass("wdr-ui-toggle-btn");b.container.addClass("wdr-ui-checkbox");b.labelHolder=new d.UILabel("Label");b.container.append(b.labelHolder.container);return b}__extends(f,e);f.prototype.toggle=function(){e.prototype.toggle.call(this);this.container.toggleClass("wdr-ui-semi-selected",-1==this.getSelection())};f.prototype.setLabel=function(b,
a){void 0===a&&(a=!1);null!=this.labelHolder&&this.labelHolder.setLabel(b,a)};f.prototype.getLabel=function(){return null!=this.labelHolder?this.labelHolder.getLabel():""};f.prototype.setSelection=function(b){this.getSelection()==b||1<b||-1>b||(e.prototype.setSelection.call(this,b),this.container.toggleClass("wdr-ui-semi-selected",-1==this.getSelection()))};Object.defineProperty(f.prototype,"checked",{get:function(){return 1==this.getSelection()},set:function(b){this.setSelection(b?1:0)},enumerable:!0,
configurable:!0});f.SELECTED=1;f.UNSELECTED=0;f.SEMI_SELECTED=-1;return f}(d.UIToggleButton);d.UICheckBox=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(d){function e(){var b=d.call(this,"div","wdr-ui-divider")||this;b.mouseMoveHandler=function(a){return b.onMouseMove(a)};b.mouseDownHandler=function(a){return b.onMouseDown(a)};b.mouseUpHandler=function(a){return b.onMouseUp(a)};b.direction=e.HORIZONTAL;b.addEventListener("mousedown",b.mouseDownHandler);utils.fmdocument.addEventListener("mouseup",b.mouseUpHandler);b.container.disableSelection();return b}__extends(e,d);e.prototype.onMouseDown=function(b){this._height=this.direction==
e.HORIZONTAL?this.getHeight():this.getWidth();this._baseOffset=this.container.parent.getOffset();utils.fmdocument.addEventListener("mousemove",this.mouseMoveHandler);b.preventDefault();b.stopImmediatePropagation()};e.prototype.onMouseMove=function(b){if(this.direction==e.HORIZONTAL){var a=b.clientY-this._baseOffset.top;if(this._containment&&(a<this._containment[1]||a>this._containment[3]))return;this.container.css("top",a-this._height/2+"px");this.dispatchWith(e.EVENT_MOVED,this,{top:a})}this.direction==
e.VERTICAL&&(b=b.clientX-this._baseOffset.left,this._containment&&(b<this._containment[0]||b>this._containment[2])||(this.container.css("left",b-this._height/2+"px"),this.dispatchWith(e.EVENT_MOVED,this,{left:b})))};e.prototype.onMouseUp=function(b){utils.fmdocument.removeEventListener("mousemove",this.mouseMoveHandler)};Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(b){this._direction=b;this.container.toggleClass("wdr-ui-horizontal",this._direction==
e.HORIZONTAL);this.container.toggleClass("wdr-ui-vertical",this._direction==e.VERTICAL);this.container.css("position","absolute")},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"containment",{set:function(b){this._containment=b},enumerable:!0,configurable:!0});e.HORIZONTAL=0;e.VERTICAL=1;e.EVENT_MOVED="divider_moved_event";return e}(d.UIComponentBase);d.UIDivider=e})(uicontrols||(uicontrols={}));
(function(d){var e=function(d){function e(){return d.call(this,"div","wdr-ui-modal-overlay")||this}__extends(e,d);e.prototype.setTransparent=function(b){this.container.toggleClass("wdr-ui-opaque",!1);this.container.toggleClass("wdr-ui-transparent",b)};e.prototype.setOpaque=function(b){this.container.toggleClass("wdr-ui-transparent",!1);this.container.toggleClass("wdr-ui-opaque",b)};return e}(d.UIComponentBase);d.UIModalOverlay=e})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(d){function b(a){void 0===a&&(a="wdr-ui-container");return d.call(this,"div",a)||this}__extends(b,d);b.prototype.removeChild=function(a){this.contains(a)&&a.container.detach()};b.prototype.contains=function(a){return utils.nullOrUndefined(a)?!1:this.container.contains(a.container)};b.prototype.getWidth=function(){return this.container.width};b.prototype.getHeight=function(){return this.container.height};b.prototype.removeAllChildren=function(){for(var a=this.container.children(),
c=a.length-1;0<=c;c--)a[c].removeFromParent()};return b}(d.UIComponentBase);e.UIContainer=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-border-container")||this}__extends(b,d);return b}(d.UIContainer);d.UIBorderContainer=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(d){var h=function(d){function b(){var a=d.call(this)||this;a.container.addClass("wdr-ui-window");a.hide();return a}__extends(b,d);b.prototype.setPosition=function(a,c){this.container.offset({left:Math.floor(a),top:Math.floor(c)});this.container.css("position","absolute")};b.prototype.getPosition=function(){return this.container.offset()};return b}(d.UIContainer);d.UIWindow=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-hgroup")||this}__extends(b,d);return b}(d.UIContainer);d.UIHGroup=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-vgroup")||this}__extends(b,d);return b}(d.UIContainer);d.UIVGroup=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-panel")||this}__extends(b,d);return b}(d.UIContainer);d.UIPanel=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(e){function b(a){var c=e.call(this)||this;c._overlayClickHandler=function(){return c.onOverlayClick()};c.resizeHandler=function(a){return c.onWindowResize(a)};c.isOpaque=!1;c._modalParent=a;c.container.addClass("wdr-ui-popup");c.hide();c._overlay=new d.UIModalOverlay;c._overlay.addEventListener("click",c._overlayClickHandler);c._overlay.hide();c._modalParent&&c._modalParent.addChild(c._overlay.container);return c}__extends(b,e);b.prototype.onWindowResize=function(a){var c=
this;a.target===window&&(this.container.requestAnimationFrame(function(){return c.centerPosition()}),this.addLayoutClasses())};b.prototype.onOverlayClick=function(){this.close()};b.prototype.open=function(){utils.fmwindow.addEventListener("resize",this.resizeHandler);this._overlay.show();this._overlay.container.toggleClass("wdr-ui-opaque",this.isOpaque);this.show();this.centerPosition();this.dispatchWith(events._Event.OPENED);this.addLayoutClasses()};b.prototype.close=function(){utils.fmwindow.removeEventListener("resize",
this.resizeHandler);this._overlay.hide();this.hide();this.dispatchWith(events._Event.CLOSED)};b.prototype.centerPosition=function(){var a=this._modalParent;if(a){var c=Math.max(0,(a.getWidth(!0)-this.container.getWidth(!0)-2)/2),a=Math.max(0,(a.getHeight(!0)-this.container.getHeight(!0)-2)/2);this.setPosition(c,a)}};Object.defineProperty(b.prototype,"overlay",{get:function(){return this._overlay},enumerable:!0,configurable:!0});return b}(e.UIWindow);e.UIPopup=h})(d.containers||(d.containers={}))})(uicontrols||
(uicontrols={}));(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-toolbar")||this}__extends(b,d);return b}(d.UIContainer);d.UIToolbar=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(e){function b(){var a=e.call(this,"wdr-ui-toolbar-mobile")||this;a.headerDisplay=new d.UILabel;a.headerDisplay.addClass("wdr-ui-header-display");a.addChild(a.headerDisplay);return a}__extends(b,e);b.prototype.setHeader=function(a){this.header!=a&&(this.header=a,this.headerDisplay.setLabel(a))};b.prototype.getHeader=function(){return this.header};b.prototype.setLeftItem=function(a){this.leftItem!=a&&(null!=this.leftItem&&this.leftItem.removeFromParent(),this.leftItem=
a,null!=this.leftItem&&(this.leftItem.addClass("wdr-ui-left"),this.addChild(this.leftItem)))};b.prototype.setRightItem=function(a){this.rightItem!=a&&(null!=this.rightItem&&this.rightItem.removeFromParent(),this.rightItem=a,null!=this.rightItem&&(this.rightItem.addClass("wdr-ui-right"),this.addChild(this.rightItem)))};return b}(e.UIContainer);e.UIToolbarMobile=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(d){var h=function(){function d(){this.items=[];this.allItems=[]}d.prototype.setItems=function(b){this.allItems=b};d.prototype.getItems=function(b,a){if(0>b||a>this.allItems.length+1)return[];this.items.length=0;for(var c=b;c<a;c++)this.items.push(this.allItems[c]);return this.items};d.prototype.getLength=function(){return this.allItems.length};return d}();d.SmartDataProvider=h})(d.dataProviders||(d.dataProviders={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(e){function b(){var a=e.call(this,"ul","wdr-ui-list")||this;a.rowHeight=utils.browserVersion().isMobile?b.DEFAULT_ROW_HEIGHT_MOBILE:b.DEFAULT_ROW_HEIGHT;a.selectedItems=[];a.selectedIndices=[];a.markSelected=!1;a.useCache=!0;a._allowMultipleSelection=!1;a.dataProvider=[];a.itemsCache=[];a.visibleItems=[];a.labelField="label";a.itemRendererFactory=a.defaultItemRendererFactory;a.selectedItem=null;a.selectedIndex=-1;a.container.addEventListener("click",function(c){return a.onItemClick(c)});
return a}__extends(b,e);b.prototype.getRowHeight=function(){return 0<this.visibleItems.length?this.visibleItems[0].getHeight():this.rowHeight};b.prototype.getStartIdx=function(){return 0};b.prototype.getRowCount=function(){return this.dataProvider.length};b.prototype.draw=function(){this.isInvalid("data")&&this.drawItems();this.validate()};b.prototype.drawItems=function(){var a=this,c=this.container.getScrollTop();this.removeAllItems();for(var g,b=this.getDataProvider(),k=0;k<b.length;k++)g=this.getItem(b[k],
k),this.addItem(g);this.container.setScrollTop(c);this.container.requestAnimationFrame(function(){0<a.visibleItems.length&&(a.rowHeight=a.visibleItems[0].getHeight())})};b.prototype.getItem=function(a,c){var g;this.useCache&&0<this.itemsCache.length?(g=this.itemsCache.pop(),g.setData(a),g.setIndex(c)):(g=this.itemRendererFactory(a,c),g.setLabelField(this.labelField));return g};b.prototype.addItem=function(a){this.visibleItems.push(a);this.addChild(a)};b.prototype.removeAllItems=function(){for(;0<
this.visibleItems.length;)this._removeItem(this.visibleItems.pop())};b.prototype.removeItem=function(a){for(var c=0;c<this.visibleItems.length;c++)if(this.visibleItems[c]===a){this.visibleItems.splice(c,1);break}this._removeItem(a)};b.prototype._removeItem=function(a){null!=this.container.find(a.container.element.nodeName)&&a.container.remove()};b.prototype.onItemClick=function(a){a=d.UIElement.convert(a.target).closest("li");if(null!=a){a=parseInt(a.attr("data-index"));var c=this.getStartIdx()+a,
g=this.selectedItem,b=this.selectedIndex;this.setSelectedIndex(a);this.dispatchWith(events._Event.CHANGE,this,{selectedItem:this.selectedItem,selectedIndex:this.selectedIndex,realIndex:c,prevItem:g,prevIndex:b})}};b.prototype.getDataProvider=function(){return this.dataProvider};b.prototype.setDataProvider=function(a,c){void 0===c&&(c=!0);this.dataProvider=a;c&&this.invalidate("data")};b.prototype.getLabelField=function(){return this.labelField};b.prototype.setLabelField=function(a){this.labelField!=
a&&(this.labelField=a,this.invalidate("data"))};b.prototype.setItemRendererFactory=function(a){this.itemRendererFactory=a;this.invalidate("data")};b.prototype.validateItemAt=function(a){-1<a&&a<this.visibleItems.length&&this.visibleItems[a].validateNow()};b.prototype.validateItem=function(a,c){void 0===c&&(c="");for(var g,b=0;b<this.visibleItems.length;b++)if(g=this.visibleItems[b].getData(),0==c.length&&g===a||0<c.length&&g.hasOwnProperty(c)&&g[c]==a[c]){this.visibleItems[b].validateNow();break}};
b.prototype.getSelectedIndex=function(){return this.selectedIndex};b.prototype.setSelectedIndex=function(a){var c=this.getDataProvider();-1<a&&a<c.length?this.updateSelectedItem(c[a],a):this.updateSelectedItem(null,-1)};b.prototype.getSelectedItem=function(){return this.selectedItem};b.prototype.setSelectedItem=function(a,c){var g=this.getDataProvider();if(utils.nullOrUndefined(a)||utils.nullOrEmpty(c))-1<g.indexOf(a)&&this.updateSelectedItem(a,g.indexOf(a));else for(var b=0;b<g.length;b++)if(!utils.nullOrUndefined(g[b])&&
g[b][c]==a[c]){this.updateSelectedItem(g[b],b);break}};b.prototype.updateSelectedItem=function(a,c){if(this.allowMultipleSelection){var g=-1<this.selectedIndices.indexOf(c);!(g=!g)&&2>this.selectedIndices.length||(g?(this.selectedIndices.push(c),this.selectedItems.push(a)):(this.selectedIndices.splice(this.selectedIndices.indexOf(c),1),this.selectedItems.splice(this.selectedItems.indexOf(a),1)),this.markSelected&&(a.isSelected=g,this.validateItemAt(c)))}else this.markSelected&&null!=this.selectedItem&&
(this.selectedItem.isSelected=!1,this.validateItemAt(this.selectedIndex)),this.selectedItem=a,this.selectedIndex=c,this.markSelected&&null!=this.selectedItem&&(this.selectedItem.isSelected=!0,this.validateItemAt(this.selectedIndex))};b.prototype.defaultItemRendererFactory=function(a,c){var g=new d.renderers.UIItemRenderer;g.setData(a);g.setIndex(c);return g};b.prototype.getMinHeight=function(){return this.getRowHeight()};b.prototype.getMaxHeight=function(){return this.getRowHeight()*this.getDataProvider().length};
Object.defineProperty(b.prototype,"allowMultipleSelection",{get:function(){return this._allowMultipleSelection},set:function(a){this._allowMultipleSelection=a},enumerable:!0,configurable:!0});b.prototype.getSelectedIndices=function(){return this.selectedIndices};b.prototype.setSelectedIndices=function(a){this.selectedIndices=a;this.selectedItems.length=0;a=this.getDataProvider();for(var c=0;c<a.length;c++)-1<this.selectedIndices.indexOf(c)?(this.selectedItems.push(a[c]),this.markSelected&&(a[c].isSelected=
!0,this.validateItemAt(c))):this.markSelected&&(a[c].isSelected=!1,this.validateItemAt(c))};b.prototype.getSelectedItems=function(){return this.selectedItems};b.prototype.setSelectedItems=function(a){this.selectedItems=a;this.selectedIndices.length=0;a=this.getDataProvider();for(var c=0;c<a.length;c++)-1<this.selectedItems.indexOf(a[c])?(this.selectedIndices.push(c),this.markSelected&&(a[c].isSelected=!0,this.validateItemAt(c))):this.markSelected&&(a[c].isSelected=!1,this.validateItemAt(c))};b.prototype.droppable=
function(a){this.container.droppable(a,this)};b.DEFAULT_ROW_HEIGHT=21;b.DEFAULT_ROW_HEIGHT_MOBILE=31;return b}(d.UIComponentBase);e.UIList=h})(d.lists||(d.lists={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(f){function b(){var a=f.call(this,"div","wdr-ui-dropdown")||this;a.prompt="Choose item";a.mouseHandler=function(c){return a.handleMouse(c)};a._allowMultipleSelection=!1;a.container.display="inline-block";a.dropDownBtn=new e.UIDropDownButton;a.dropDownBtn.addEventListener(events._Event.CHANGE,function(){return a.onBtnChange()});a.dropDownListWrap=new d.UIComponentBase("div","wdr-ui-dropdown-list");a.dropDownListWrap.hide();a.dropDownList=new e.UIList;a.dropDownList.markSelected=
!0;a.dropDownList.setItemRendererFactory(a.itemRendererFactory);a.dropDownList.addEventListener(events._Event.CHANGE,function(c){return a.onListChange(c)});a.dropDownListWrap.addChild(a.dropDownList);a.addChild(a.dropDownBtn);a.addChild(a.dropDownListWrap);return a}__extends(b,f);b.prototype.itemRendererFactory=function(a,c){var g=new d.renderers.SelectItemRenderer;g.setData(a);g.setIndex(c);return g};b.prototype.onListChange=function(a){this.enablePrompt(null==a.data.selectedItem);this.dispatchWith(events._Event.CHANGE,
this,a.data);this.allowMultipleSelection||this.close()};b.prototype.onBtnChange=function(){this.dropDownBtn.getSelection()?this.open():this.close()};b.prototype.enablePrompt=function(a){var c=this.dropDownList.getSelectedItem(),c=a||this.allowMultipleSelection||null==c?this.prompt:c[this.getLabelField()];this.dropDownBtn.setLabel(c);this.container.toggleClass("wdr-ui-prompt",a)};b.prototype.setPrompt=function(a){this.prompt!==a&&(this.prompt=a,this.enablePrompt(!0))};b.prototype.getPrompt=function(){return this.prompt};
b.prototype.open=function(){this.getEnabled()&&(this.dropDownListWrap.show(),this.dropDownList.setWidth(this.dropDownBtn.getWidth(!0)),this.dropDownBtn.setSelection(1),document.body.addEventListener("mousedown",this.mouseHandler))};b.prototype.handleMouse=function(a){null==d.UIElement.convert(a.target).closest(".wdr-ui-dropdown")&&(document.body.removeEventListener("mousedown",this.mouseHandler),this.close())};b.prototype.close=function(){this.getEnabled()&&(this.dropDownListWrap.hide(),this.dropDownBtn.setSelection(0),
document.body.removeEventListener("mouseup",this.mouseHandler))};b.prototype.getDataProvider=function(){return this.dropDownList.getDataProvider()};b.prototype.setDataProvider=function(a){this.dropDownList.setDataProvider(a)};b.prototype.getLabelField=function(){return this.dropDownList.getLabelField()};b.prototype.setLabelField=function(a){this.dropDownList.setLabelField(a)};b.prototype.setItemRendererFactory=function(a){this.dropDownList.setItemRendererFactory(a)};b.prototype.validateNow=function(){this.dropDownList.validateNow()};
b.prototype.validateItemAt=function(a){this.dropDownList.validateItemAt(a)};b.prototype.getSelectedIndex=function(){return this.dropDownList.getSelectedIndex()};b.prototype.setSelectedIndex=function(a){this.dropDownList.setSelectedIndex(a);this.enablePrompt(null==this.dropDownList.getSelectedItem())};b.prototype.getSelectedIndices=function(){return this.dropDownList.getSelectedIndices()};b.prototype.setSelectedIndices=function(a){this.dropDownList.setSelectedIndices(a);this.enablePrompt(!0)};b.prototype.getSelectedItem=
function(){return this.dropDownList.getSelectedItem()};b.prototype.setSelectedItem=function(a,c){this.dropDownList.setSelectedItem(a,c);this.enablePrompt(null==this.dropDownList.getSelectedItem())};b.prototype.getSelectedItems=function(){return this.dropDownList.getSelectedItems()};b.prototype.setSelectedItems=function(a){this.dropDownList.setSelectedItems(a);this.enablePrompt(!0)};b.prototype.show=function(){f.prototype.show.call(this)};b.prototype.getRowHeight=function(){return this.dropDownList.getRowHeight()};
b.prototype.getRowCount=function(){return this.dropDownList.getRowCount()};b.prototype.validateItem=function(a,c){};b.prototype.getMinHeight=function(){return 0};b.prototype.getMaxHeight=function(){return 0};Object.defineProperty(b.prototype,"allowMultipleSelection",{get:function(){return this._allowMultipleSelection},set:function(a){this._allowMultipleSelection=a;this.dropDownList.allowMultipleSelection=a;this._allowMultipleSelection?this.dropDownList.container.addClass("wdr-ui-dropdown-multiple-selection-list"):
this.dropDownList.container.removeClass("wdr-ui-dropdown-multiple-selection-list")},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"markSelected",{set:function(a){this.dropDownList.markSelected=a},enumerable:!0,configurable:!0});return b}(d.UIComponentBase);e.UIDropDownList=h})(d.lists||(d.lists={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(f){function b(){var a=f.call(this)||this;a.addClass("wdr-ui-vlist");a._list=new e.UIList;a.addChild(a._list);a._placeholder=new d.UIComponentBase("div","wdr-ui-vlist-placeholder");a.addChild(a._placeholder);a.addEventListener("scroll",function(){return a.onScroll()});return a}__extends(b,f);b.prototype.onScroll=function(){this.invalidate("data")};b.prototype.draw=function(){this._placeholder.setHeight(Math.min(this.getMaxHeight(),b.MAX_HEIGHT));if(this.isInvalid("data")){this._list.setDataProvider(this.getDataProvider());
var a=this.getStartIdx()*this.getRowHeight()*this.getScale()-this.getScaleFix();this._list.container.top=Math.min(a,this._placeholder.getHeight()-this._list.container.height)}this.validate()};b.prototype.getScale=function(){return this.getMaxHeight()>b.MAX_HEIGHT?b.MAX_HEIGHT/this.getMaxHeight():1};b.prototype.getStartIdx=function(){return 1!=this.getScale()?Math.floor((this.getScrollPosition()+this.getScaleFix())/this.getScale()/this.getRowHeight()):Math.floor(this.getScrollPosition()/this.getRowHeight())};
b.prototype.getScaleFix=function(){return 1!=this.getScale()?(this.getHeight()/this.getScale()-this.getHeight())*(this.getScrollPosition()/b.MAX_HEIGHT)*this.getScale():0};Object.defineProperty(b.prototype,"allowMultipleSelection",{get:function(){return this._list.allowMultipleSelection},set:function(a){this._list.allowMultipleSelection=a},enumerable:!0,configurable:!0});b.prototype.getLabelField=function(){return this._list.getLabelField()};b.prototype.setLabelField=function(a){this._list.setLabelField(a)};
b.prototype.setItemRendererFactory=function(a){this._list.setItemRendererFactory(a)};b.prototype.validateItemAt=function(a){this._list.validateItemAt(a)};b.prototype.validateItem=function(a,c){void 0===c&&(c="");this._list.validateItem(a,c)};b.prototype.getRowHeight=function(){return 37};b.prototype.getRowCount=function(){return 0<this.getRowHeight()?Math.ceil(this.getHeight()/this.getRowHeight())+1:0};b.prototype.getSelectedIndex=function(){return this._list.getSelectedIndex()};b.prototype.setSelectedIndex=
function(a){this._list.setSelectedIndex(a)};b.prototype.getSelectedIndices=function(){return this._list.getSelectedIndices()};b.prototype.setSelectedIndices=function(a){this._list.setSelectedIndices(a)};b.prototype.getSelectedItem=function(){return this._list.getSelectedItem()};b.prototype.setSelectedItem=function(a,c){this._list.setSelectedItem(a,c)};b.prototype.getSelectedItems=function(){return this._list.getSelectedItems()};b.prototype.setSelectedItems=function(a){this._list.setSelectedItems(a)};
b.prototype.getMinHeight=function(){return this._list.getRowHeight()};b.prototype.getMaxHeight=function(){return this.getRowHeight()*this.getSmartDataProvider().getLength()};b.prototype.getSmartDataProvider=function(){return this.smartDataProvider};b.prototype.setSmartDataProvider=function(a){this.smartDataProvider=a};b.prototype.getScrollPosition=function(){return this.container.getScrollTop()};b.prototype.setScrollPosition=function(a){this.container.setScrollTop(a)};b.prototype.setDataProvider=
function(a){this.getSmartDataProvider()&&(this.getSmartDataProvider().setItems(a),this.setScrollPosition(0),this.invalidate("data"))};b.prototype.getDataProvider=function(){var a=this.getStartIdx(),c=a+this.getRowCount();return this.getSmartDataProvider()?this.getSmartDataProvider().getItems(a,c):[]};b.MAX_HEIGHT=1E6;return b}(d.UIComponentBase);e.UIVirtualList=h})(d.lists||(d.lists={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(e){function b(){var a=e.call(this)||this;a.addClass("wdr-ui-dropdown-btn");a.labelDisplay=new d.UILabel;a.addChild(a.labelDisplay);return a}__extends(b,e);b.prototype.setLabel=function(a){this.labelDisplay.setLabel(a)};return b}(d.UIToggleButton);e.UIDropDownButton=h})(d.lists||(d.lists={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(d){function b(){var a=d.call(this,"li")||this;a.labelField="label";return a}__extends(b,d);b.prototype.getData=function(){return this.data};b.prototype.setData=function(a){null!=a&&(this.data=a,this.invalidate("data"))};b.prototype.getIndex=function(){return parseInt(this.container.attr("data-index"))};b.prototype.setIndex=function(a){this.container.attr("data-index",a)};b.prototype.getLabelField=function(){return this.labelField};b.prototype.setLabelField=
function(a){this.labelField!=a&&(this.labelField=a,this.invalidate("data"))};b.prototype.getLabelFunction=function(){return this.labelFunction};b.prototype.setLabelFunction=function(a){this.labelFunction!=a&&(this.labelFunction=a,this.invalidate("data"))};b.prototype.draw=function(){this.isInvalid("data")&&this.container.text(this.data[this.labelField]);this.validate()};return b}(d.UIComponentBase);e.UIItemRenderer=h})(d.renderers||(d.renderers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(e){function b(){return e.call(this)||this}__extends(b,e);b.prototype.draw=function(){var a=this.getData();null==this.label&&(this.label=new d.UILabel,this.label.setId("#wdr-text-display"),this.container.append(this.label.container));this.label.setLabel(a[this.getLabelField()],!0);this.container.toggleClass("wdr-selected",!0===a.isSelected);this.container.toggleClass("wdr-not-selected",!0!==a.isSelected)};return b}(e.UIItemRenderer);e.SelectItemRenderer=h})(d.renderers||
(d.renderers={}))})(uicontrols||(uicontrols={}));
(function(d){(function(e){var h=function(){function e(b,a){var c=this;this._mouseDownHandler=function(a){return c.onMouseDown(a)};this._mouseUpHandler=function(a){return c.onMouseUp(a)};this._mouseMoveHandler=function(a){return c.onMouseMove(a)};this.target=b;this.options=a;this.createHandles()}e.prototype.createHandles=function(){for(var b=0;b<this.options.sides.length;b++)this.createHandle(this.options.sides[b])};e.prototype.createHandle=function(b){var a=new d.UIElement("div","wdr-resizable-handle");
a.addClass("wdr-"+b);a.addEventListener("mousedown",this._mouseDownHandler);this.target.addChild(a);return a};e.prototype.onMouseDown=function(b){b=d.UIElement.convert(b.target);b.hasClass("wdr-left")?this._currentSide="left":b.hasClass("wdr-right")&&(this._currentSide="right");this.startResizing()};e.prototype.onMouseUp=function(b){this.onResize(b.clientX,b.clientY);this.stopResizing()};e.prototype.onMouseMove=function(b){if(this._boundingRect&&(b.clientX<this._boundingRect.left||b.clientX>this._boundingRect.right||
b.clientY<this._boundingRect.top||b.clientY>this._boundingRect.bottom))this.onMouseUp(b);else this.onResize(b.clientX,b.clientY)};e.prototype.onResize=function(b,a){var c={left:this._originalPosition.left,top:this._originalPosition.top},g={width:this._originalSize.width,height:this._originalSize.height};"left"==this._currentSide&&(c.left=b,g.width+=this._originalPosition.left-c.left);"right"==this._currentSide&&(g.width=b-this._originalPosition.left);this.options.resize&&this.options.resize({side:this._currentSide,
originalPosition:this._originalPosition,originalSize:this._originalSize,position:c,size:g})};e.prototype.startResizing=function(){document.addEventListener("mousemove",this._mouseMoveHandler);document.addEventListener("mouseup",this._mouseUpHandler);this._originalSize={width:this.target.getWidth(!0),height:this.target.getHeight(!0)};this._originalPosition={left:this.target.getOffset().left,top:this.target.getOffset().top};this._boundingRect=this.options.containtment?this.options.containtment.getBoundingClientRect():
null};e.prototype.stopResizing=function(){document.removeEventListener("mousemove",this._mouseMoveHandler);document.removeEventListener("mouseup",this._mouseUpHandler)};e.prototype.dispose=function(){document.removeEventListener("mousemove",this._mouseMoveHandler);document.removeEventListener("mouseup",this._mouseUpHandler)};return e}();e.ResizableHelper=h})(d.resizable||(d.resizable={}))})(uicontrols||(uicontrols={}));
(function(d){(function(d){var h=function(){function d(b,a){void 0===a&&(a=1E3);var c=this;this.touchStartHandler=function(a){return c.onTouchStart(a)};this.touchEndHandler=function(a){return c.onTouchEnd(a)};this.target=b;this.delay=a}d.prototype.listen=function(b){this.handler=b;this.target.addEventListener("touchstart",this.touchStartHandler);this.target.addEventListener("touchend",this.touchEndHandler)};d.prototype.stop=function(){this.target.removeEventListener("touchstart",this.touchStartHandler);
this.target.removeEventListener("touchend",this.touchEndHandler)};d.prototype.onTouchStart=function(b){var a=this;this.timer=utils.fmSetTimeout(function(){return a.callHandler(b)},this.delay)};d.prototype.onTouchEnd=function(b){this.timer&&utils.fmClearTimeout(this.timer)};d.prototype.callHandler=function(b){this.handler(b,b&&0<b.changedTouches.length?b.changedTouches[0]:null)};return d}();d.LongPressListener=h})(d._utils||(d._utils={}))})(uicontrols||(uicontrols={}));var pivot;
(function(d){var e=function(){function c(a,g,b){void 0===g&&(g=0);void 0===b&&(b=c.LITTLE_ENDIAN);this._dynamicSize=!0;this._byteLength=0;this._byteOffset=g;this.buffer=a;this.position=0;this.endianness=b}Object.defineProperty(c.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(c){this._byteOffset=c;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"byteLength",
{get:function(){return this._byteLength-this._byteOffset},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(c){this._buffer=c;this._dataView=0==this._byteOffset?new DataView(this._buffer):new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"dataView",{get:function(){return this._dataView},set:function(c){this._byteOffset=
c.byteOffset;this._buffer=c.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+c.byteLength},enumerable:!0,configurable:!0});c.prototype.seek=function(c){c=Math.max(0,Math.min(this.byteLength,c));this.position=isNaN(c)||!isFinite(c)?0:c};c.prototype.writeString=function(c){this.writeUint8Array(h.encode(c))};c.prototype.writeUint32=function(c,a){void 0===a&&(a=null);this._realloc(4);this._dataView.setUint32(this.position,c,null==a?this.endianness:a);
this.position+=4};c.prototype.writeUint8=function(c){this._realloc(1);this._dataView.setUint8(this.position,c);this.position+=1};c.prototype.writeUint8Array=function(c){this._realloc(1*c.length);if(c instanceof Uint8Array&&0==this.byteOffset+this.position%c.BYTES_PER_ELEMENT)this.memcpy(this._buffer,this.byteOffset+this.position,c.buffer,0,c.byteLength),this.mapUint8Array(c.length);else for(var a=0;a<c.length;a++)this.writeUint8(c[a])};c.prototype.readString=function(c,a){return f.decode(this.mapUint8Array(c))};
c.prototype.readUint32=function(){var c=this._dataView.getUint32(this.position,this.endianness);this.position+=4;return c};c.prototype.readUint8=function(){var c=this._dataView.getUint8(this.position);this.position+=1;return c};c.prototype.readUint8Array=function(c){void 0===c&&(c=-1);c=0>c?this.byteLength-this.position:c;var a=new Uint8Array(c);this.memcpy(a.buffer,0,this.buffer,this.byteOffset+this.position,c*a.BYTES_PER_ELEMENT);this.position+=a.byteLength;return a};c.prototype.mapUint8Array=function(c){this._realloc(1*
c);var a=new Uint8Array(this._buffer,this.byteOffset+this.position,c);this.position+=1*c;return a};c.prototype._realloc=function(c){if(this._dynamicSize){c=this._byteOffset+this.position+c;var a=this._buffer.byteLength;if(c<=a)c>this._byteLength&&(this._byteLength=c);else{for(1>a&&(a=1);c>a;)a*=2;var a=new ArrayBuffer(a),g=new Uint8Array(this._buffer);(new Uint8Array(a,0,g.length)).set(g);this.buffer=a;this._byteLength=c}}};c.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var c=
new ArrayBuffer(this._byteLength),a=new Uint8Array(c),g=new Uint8Array(this._buffer,0,a.length);a.set(g);this.buffer=c}};c.prototype.memcpy=function(c,a,g,b,m){c=new Uint8Array(c,a,m);g=new Uint8Array(g,b,m);c.set(g)};c.BIG_ENDIAN=!1;c.LITTLE_ENDIAN=!0;return c}();d.DataStream=e;var h=function(){function c(){}c.encode=function(b){b=b?String(b):"";var k=[],d=new g(k);b=new m(b);null==c.encoder&&(c.encoder=new a);for(;b.get()!==c.EOF_code_point;)c.encoder.encode(d,b);var e;do e=c.encoder.encode(d,b);
while(e!==c.EOF_byte);return new Uint8Array(k)};c.EOF_byte=-1;c.EOF_code_point=-1;return c}();d.TextEncoder=h;var f=function(){function a(){}a.decode=function(g){g||(g=new Uint8Array(0));g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength);g=new c(g);var m=new k,d;null==a.decoder&&(a.decoder=new b);for(;g.get()!==a.EOF_byte;)d=a.decoder.decode(g),null!==d&&d!==a.EOF_code_point&&m.emit(d);do d=a.decoder.decode(g),null!==d&&d!==a.EOF_code_point&&m.emit(d);while(d!==a.EOF_code_point);return m.str()};
a.EOF_byte=-1;a.EOF_code_point=-1;return a}();d.TextDecoder=f;var b=function(){function c(){this.EOF_code_point=this.EOF_byte=-1;this.utf8_lower_boundary=this.utf8_bytes_seen=this.utf8_bytes_needed=this.utf8_code_point=0}c.prototype.decode=function(c){var a=c.get();if(a===this.EOF_byte)return this.EOF_code_point;c.offset(1);if(0===this.utf8_bytes_needed){if(this.inRange(a,0,127))return a;if(this.inRange(a,194,223))this.utf8_bytes_needed=1,this.utf8_lower_boundary=128,this.utf8_code_point=a-192;else if(this.inRange(a,
224,239))this.utf8_bytes_needed=2,this.utf8_lower_boundary=2048,this.utf8_code_point=a-224;else if(this.inRange(a,240,244))this.utf8_bytes_needed=3,this.utf8_lower_boundary=65536,this.utf8_code_point=a-240;else return this.EOF_code_point;this.utf8_code_point*=Math.pow(64,this.utf8_bytes_needed);return null}if(!this.inRange(a,128,191))return this.utf8_lower_boundary=this.utf8_bytes_seen=this.utf8_bytes_needed=this.utf8_code_point=0,c.offset(-1),this.EOF_code_point;this.utf8_bytes_seen+=1;this.utf8_code_point+=
(a-128)*Math.pow(64,this.utf8_bytes_needed-this.utf8_bytes_seen);if(this.utf8_bytes_seen!==this.utf8_bytes_needed)return null;c=this.utf8_code_point;a=this.utf8_lower_boundary;this.utf8_lower_boundary=this.utf8_bytes_seen=this.utf8_bytes_needed=this.utf8_code_point=0;return this.inRange(c,a,1114111)&&!this.inRange(c,55296,57343)?c:this.EOF_code_point};c.prototype.inRange=function(c,a,g){return a<=c&&c<=g};return c}();d.UTF8Decoder=b;var a=function(){function c(){this.EOF_code_point=this.EOF_byte=
-1}c.prototype.inRange=function(c,a,g){return a<=c&&c<=g};c.prototype.div=function(c,a){return Math.floor(c/a)};c.prototype.encode=function(c,a){var g=a.get();if(g===this.EOF_code_point)return this.EOF_byte;a.offset(1);if(this.inRange(g,55296,57343))return this.EOF_code_point;if(this.inRange(g,0,127))return c.emit(g);var b,m;this.inRange(g,128,2047)?(b=1,m=192):this.inRange(g,2048,65535)?(b=2,m=224):this.inRange(g,65536,1114111)&&(b=3,m=240);for(m=c.emit(this.div(g,Math.pow(64,b))+m);0<b;)m=this.div(g,
Math.pow(64,b-1)),m=c.emit(128+m%64),b-=1;return m};return c}();d.UTF8Encoder=a;var c=function(){function c(a){this.EOF_byte=-1;this.pos=0;this.bytes=a}c.prototype.get=function(){return this.pos>=this.bytes.length?this.EOF_byte:Number(this.bytes[this.pos])};c.prototype.offset=function(c){this.pos+=c;if(0>this.pos)throw Error("Seeking past start of the buffer");if(this.pos>this.bytes.length)throw Error("Seeking past EOF");};c.prototype.match=function(c){if(c.length>this.pos+this.bytes.length)return!1;
var a;for(a=0;a<c.length;a+=1)if(Number(this.bytes[this.pos+a])!==c[a])return!1;return!0};return c}();d.ByteInputStream=c;var g=function(){function c(a){this.EOF_byte=-1;this.pos=0;this.bytes=a}c.prototype.emit=function(c){var a=this.EOF_byte,g;for(g=0;g<arguments.length;++g)a=Number(arguments[g]),this.bytes[this.pos++]=a;return a};return c}();d.ByteOutputStream=g;var m=function(){function c(a){this.pos=0;this.EOF_code_point=-1;this._str=a;this.cps=this.getCps(this._str)}c.prototype.getCps=function(c){for(var a=
[],g=0,b=c.length;g<c.length;){var m=c.charCodeAt(g);if(this.inRange(m,55296,57343))if(this.inRange(m,56320,57343))a.push(65533);else if(g===b-1)a.push(65533);else{var k=c.charCodeAt(g+1);this.inRange(k,56320,57343)?(m&=1023,k&=1023,g+=1,a.push(65536+(m<<10)+k)):a.push(65533)}else a.push(m);g+=1}return a};c.prototype.inRange=function(c,a,g){return a<=c&&c<=g};c.prototype.offset=function(c){this.pos+=c;if(0>this.pos)throw Error("Seeking past start of the buffer");if(this.pos>this.cps.length)throw Error("Seeking past EOF");
};c.prototype.get=function(){return this.pos>=this.cps.length?this.EOF_code_point:this.cps[this.pos]};return c}();d.CodePointInputStream=m;var k=function(){function c(){this._str=""}c.prototype.str=function(){return this._str};c.prototype.emit=function(c){65535>=c?this._str+=String.fromCharCode(c):(c-=65536,this._str+=String.fromCharCode(55296+(c>>10&1023)),this._str+=String.fromCharCode(56320+(c&1023)))};return c}();d.CodePointOutputStream=k})(pivot||(pivot={}));var misc;
(function(d){var e=function(d){function e(){var b=d.call(this)||this;b.connected=!1;return b}__extends(e,d);e.prototype.load=function(b){var a=this;this.url=b;this.connected=!1;this.close();this.xhr=new XMLHttpRequest;this.xhr.open("GET",b,!0);this.xhr.responseType="arraybuffer";this.xhr.onload=function(c){return a.onComplete(c)};this.xhr.onprogress=function(c){return a.onProgress(c)};this.xhr.onerror=function(c){return a.onError(c)};this.xhr.onreadystatechange=function(c){return a.onReadyStateChange(c)};
this.xhr.send()};e.prototype.onComplete=function(b){this.response=this.xhr.response;this.dispatch(new events._Event(events._Event.COMPLETE,this))};e.prototype.onProgress=function(b){this.dispatch(b)};e.prototype.onError=function(b){this.dispatch(b)};e.prototype.onReadyStateChange=function(b){null!=this.xhr&&4===this.xhr.readyState&&200!==this.xhr.status&&this.dispatch(new events._Event(events._Event.ERROR,this,this.xhr.statusText));null!=this.xhr&&3>this.xhr.readyState&&!this.connected&&(this.connected=
!0,this.dispatch(new events._Event(events._Event.CONNECTED)))};e.prototype.close=function(){null!=this.xhr&&this.xhr.abort()};e.prototype.dispose=function(){this.response=null;null!=this.xhr&&(this.xhr.onload=null,this.xhr.onprogress=null,this.xhr.onerror=null,this.xhr.onreadystatechange=null);this.xhr=null};return e}(events.EventDispatcher);d.URLBinaryLoader=e})(misc||(misc={}));
(function(d){var e=function(c){function g(){var a=c.call(this)||this;a.dataType=h.TEXT;a.contentType=f.TEXT_PLAIN;a.requestMethod=b.GET;a.connected=!1;a.withCredentials=!1;a._lastProgressTriggered=0;a._lastEvent=null;a.progressInterval=0;a.requestHeaders=[];a.data={};a._bytesLoaded=0;return a}__extends(g,c);g.prototype.load=function(c,a){var g=this;void 0===a&&(a=null);this.url=c;this._bytesLoaded=0;this.connected=!1;this.processRequestHeader(a);this.close();this.xhr=new XMLHttpRequest;this.xhr.open(this.requestMethod,
this.url,!0);this.xhr.onerror=function(c){return g.onError(c)};this.xhr.onreadystatechange=function(c){return g.onReadyStateChange(c)};this.xhr.onprogress=function(c){return g.onProgress(c)};this.xhr.setRequestHeader("Content-type",this.contentType);for(var b=0;b<this.requestHeaders.length;b++)this.xhr.setRequestHeader(this.requestHeaders[b].header,this.requestHeaders[b].value);this.xhr.send(this.data)};g.prototype.processRequestHeader=function(c){this.requestHeaders=[];if(null!=c)for(var g in c)this.requestHeaders.push(new a(g,
c[g]))};g.prototype.getBytesLoaded=function(){return this._bytesLoaded};g.prototype.success=function(){this.response=this.xhr.response||this.xhr.responseText;this._bytesLoaded=this._lastEvent?this._lastEvent.loaded:this.response.length;this.dispatch(new events._Event(events._Event.COMPLETE,this))};g.prototype.onReadyStateChange=function(c){null!=this.xhr&&4===this.xhr.readyState&&(200===this.xhr.status?this.success():this.dispatch(new events._Event(events._Event.ERROR,this,this.xhr.statusText)));
null!=this.xhr&&3>this.xhr.readyState&&!this.connected&&(this.connected=!0,this.dispatch(new events._Event(events._Event.CONNECTED)))};g.prototype.onProgress=function(c){utils.getTimer()-this._lastProgressTriggered>this.progressInterval?(this.response=this.xhr.response||this.xhr.responseText,this._bytesLoaded=c.loaded,this.dispatch(c),this._lastProgressTriggered=utils.getTimer(),this._lastEvent=null):this._lastEvent=c};g.prototype.onError=function(c){this.dispatch(new events._Event(events._Event.ERROR,
this))};g.prototype.close=function(){null!=this.xhr&&(this.xhr.onprogress=null,this.xhr.onreadystatechange=null,this.xhr.abort())};g.prototype.dispose=function(){this.data=this.response=null;this.requestHeaders=[];null!=this.xhr&&(this.xhr.onprogress=null,this.xhr.onreadystatechange=null);this._lastProgressTriggered=this._lastEvent=this.xhr=null};return g}(events.EventDispatcher);d.URLStream=e;var h=function(){function c(){}c.TEXT="text";c.XML="xml";c.HTML="html";c.JSON="json";return c}();d.DataType=
h;var f=function(){function c(){}c.TEXT_PLAIN="text/plain";c.TEXT_XML="text/xml";c.APPLICATION_JSON="application/json";c.APPLICATION_URLENCODED="application/x-www-form-urlencoded";return c}();d.ContentType=f;var b=function(){function c(){}c.POST="POST";c.GET="GET";return c}();d.URLRequestMethod=b;var a=function(){return function(c,a){this.header=c;this.value=a}}();d.URLRequestHeader=a;e=function(){function c(){this.data={}}c.prototype.toString=function(){var c=[],a;for(a in this.data)c.push(a+"="+
this.data[a]);return c.join("&")};return c}();d.URLVariables=e})(misc||(misc={}));
(function(d){var e=function(d){function b(){var a=d.call(this)||this;a.dialogOpened=!1;document.body.onfocus=function(){return a.onFocus()};return a}__extends(b,d);b.prototype.browse=function(a){var c=this;void 0===a&&(a=[]);this.input=document.createElement("input");this.input.setAttribute("type","file");this.input.style.display="none";document.body.appendChild(this.input);this.input.setAttribute("accept",a.join(","));this.input.addEventListener("change",function(){return c.onChange()});this.dialogOpened=
!0;this.input.click()};b.prototype.onChange=function(){this.dialogOpened=!1;utils.nullOrUndefined(this.input.files)||utils.nullOrUndefined(this.input.files[0])||(this.file=this.input.files[0],this.dispatchWith(events._Event.SELECT))};b.prototype.onFocus=function(){var a=this;this.dialogOpened&&utils.fmSetTimeout(function(){(utils.nullOrUndefined(a.input.files)||utils.nullOrUndefined(a.input.files[0]))&&a.dispatchWith(events._Event.CANCEL);a.dialogOpened=!1},500)};b.prototype.load=function(a){var c=
this;void 0===a&&(a=h.TEXT);null!=this.file&&(this.reader=new FileReader,this.reader.onload=function(a){return c.onLoad(a)},this.reader.onprogress=function(a){return c.onProgress(a)},this.reader.onerror=function(a){return c.onError(a)},a==h.ARRAY_BUFFER?this.reader.readAsArrayBuffer(this.file):this.reader.readAsText(this.file))};b.prototype.onLoad=function(a){this.response=this.reader.result;this.dispatch(new events._Event(events._Event.COMPLETE,this))};b.prototype.onProgress=function(a){this.dispatch(a)};
b.prototype.onError=function(a){this.dispatch(a)};b.prototype.dispose=function(){this.reader=this.file=this.response=null};return b}(events.EventDispatcher);d.FileReference=e;var h=function(){function d(){}d.TEXT="TEXT";d.ARRAY_BUFFER="ARRAY_BUFFER";return d}();d.ReadMethod=h})(misc||(misc={}));
(function(d){var e=function(){function b(){}Object.defineProperty(b.prototype,"item",{get:function(){return this[0]},enumerable:!0,configurable:!0});b.prototype.find=function(a){return void 0===this.item?this:this.item.find(a)};b.prototype.text=function(){return void 0===this.item?"":this.item.text()};b.prototype.attr=function(a,c){return void 0===this.item?void 0:c?this.item.attr(a,c):this.item.attr(a)};b.prototype.children=function(){for(var a=new b,c=0;void 0!==this[c];)a[c++]=h.convert(this[c]);
return a};b.prototype.push=function(a){this[this.length]=a;return this};Object.defineProperty(b.prototype,"length",{get:function(){for(var a=0;void 0!==this[a];)a++;return a},enumerable:!0,configurable:!0});return b}();d.XMLNodeList=e;var h=function(b){function a(){return null!==b&&b.apply(this,arguments)||this}__extends(a,b);a.prototype.text=function(c){return c||!1===c?(this.textContent=c.toString(),this):c=utils.nullOrUndefined(this.textContent)?"":this.textContent};a.prototype.append=function(c){if(utils.nullOrUndefined(c)||
"string"==typeof c&&utils.nullOrEmpty(c))return this;(c instanceof CDATASection||""!=c.textContent)&&this.appendChild(c);return this};a.prototype.isEmpty=function(){return""==this.text()};a.prototype.find=function(c){c=this.querySelectorAll(c);for(var g=new e,b=0;b<c.length;b++)g[b]=a.convert(c[b]);return g};a.prototype.attr=function(c,a){if(a||!1===a)return this.setAttribute(c,a),this;a=this.getAttribute(c);null==a&&(a=void 0);return a};a.prototype.getChildren=function(){for(var c=new e,g=this.firstElementChild;g;)g.nodeType===
Node.ELEMENT_NODE&&c.push(a.convert(g)),g=g.nextElementSibling;return c};Object.defineProperty(a.prototype,"length",{get:function(){return this.childNodes.length},enumerable:!0,configurable:!0});a.convert=function(c){c.find=a.prototype.find;c.append=a.prototype.append;c.text=a.prototype.text;c.attr=a.prototype.attr;c.isEmpty=a.prototype.isEmpty;c.getChildren=a.prototype.getChildren;return c};return a}(Element);d.XMLNode=h;var f=function(){function b(){throw Error("Singleton");}b.create=function(a){if(null==
a.firstChild){a=(new DOMParser).parseFromString(a,"text/xml");if(b.isParseError(a))return null;a=a.firstElementChild?a.firstElementChild:a.firstChild}else a=a.firstChild;return h.convert(a)};b.isParseError=function(a){if(!a.getElementsByTagName("parsererror")||!a.getElementsByTagName("parsererror")[0])return!1;var c=a.getElementsByTagName("parsererror")[0].namespaceURI;return 0<a.getElementsByTagNameNS(c,"parsererror").length};b.cdata=function(a){return b.doc.createCDATASection(a)};b.toXMLString=
function(a,c){void 0===c&&(c=!1);null==b.serializer&&(b.serializer=new XMLSerializer);var g=b.serializer.serializeToString(a);!0==c&&(g=b.format(g));return g.trim()};b.format=function(a){a=a.replace(/>\s{0,}</g,"><").replace(/</g,"~::~<").replace(/\s*xmlns\:/g,"~::~xmlns:").replace(/\s*xmlns\=/g,"~::~xmlns=").split("~::~");for(var c=a.length,g=!1,b=0,k="",d=0,e=["\n"],d=0;20>d;d++)e.push(e[d]+"    ");for(d=0;d<c;d++)if(-1<a[d].search(/<!/)){if(k+=e[b]+a[d],g=!0,-1<a[d].search(/--\x3e/)||-1<a[d].search(/\]>/)||
-1<a[d].search(/!DOCTYPE/))g=!1}else-1<a[d].search(/--\x3e/)||-1<a[d].search(/\]>/)?(k+=a[d],g=!1):/^<\w/.exec(a[d-1])&&/^<\/\w/.exec(a[d])&&/^<[\w:\-\.\,]+/.exec(a[d-1])[0]==/^<\/[\w:\-\.\,]+/.exec(a[d])[0].replace("/","")?(k+=a[d],g||b--):k=-1<a[d].search(/<\w/)&&-1==a[d].search(/<\//)&&-1==a[d].search(/\/>/)?g?k+=a[d]:k+=e[b++]+a[d]:-1<a[d].search(/<\w/)&&-1<a[d].search(/<\//)?g?k+=a[d]:k+=e[b]+a[d]:-1<a[d].search(/<\//)?g?k+=a[d]:k+=e[--b]+a[d]:-1<a[d].search(/\/>/)?g?k+=a[d]:k+=e[b]+a[d]:-1<
a[d].search(/<\?/)?k+(e[b]+a[d]):-1<a[d].search(/xmlns\:/)||-1<a[d].search(/xmlns\=/)?k+(e[b]+a[d]):k+a[d];a="\n"==k[0]?k.slice(1):k;a=a.replace(/[\r\n\s]*<\!\[CDATA\[/g,"<![CDATA[");return a=a.replace(/]]\x3e\s*/g,"]]\x3e")};b.doc=(new DOMParser).parseFromString("<tmp/>","text/xml");return b}();d.XML=f})(misc||(misc={}));
(function(d){var e=function(){function d(){}d.print=function(d,b,a){void 0===b&&(b="");void 0===a&&(a="");var c="printer-"+(new Date).getTime(),g=(new uicontrols.UIElement("iframe")).attr("name",c);g.css("width","1px").css("height","1px").css("position","absolute").css("left","-9999px");uicontrols.UIElement.convert(document.body).append(g);var c=window.frames[c],m=c.document;m.open();m.write("<!DOCTYPE html>");m.write("<html>");m.write("<head>");m.write("<title>");m.write(a);m.write("</title>");m.write("<style>");
m.write(b+"body{-webkit-print-color-adjust:exact;}");m.write("</style>");m.write("</head>");m.write("<body>");m.write(d);m.write("</body>");m.write("</html>");m.close();c.focus();c.print();utils.fmSetTimeout(function(){g.remove()},2E3)};return d}();d.PrintJob=e})(misc||(misc={}));var utils;
(function(d){var e=function(){function b(){this.listeners={}}Object.defineProperty(b.prototype,"target",{get:function(){return null},enumerable:!0,configurable:!0});b.prototype.areListenersEqual=function(a,c){return a.type===c.type&&a.handler===c.handler&&a.useCapture===c.useCapture};b.prototype.hasEventListener=function(a,c){if(d.nullOrUndefined(this.listeners[a]))return!1;for(var g=0;g<this.listeners[a].length;g++)if(this.areListenersEqual(this.listeners[a][g],c))return!0;return!1};b.prototype.addEventListener=
function(a,c,g){var b={type:a,handler:c,useCapture:g};this.hasEventListener(a,b)||(d.nullOrUndefined(this.listeners[a])&&(this.listeners[a]=[]),this.listeners[a].push(b),this.target.addEventListener(a,c,g))};b.prototype.removeEventListener=function(a,c,g){c={type:a,handler:c,useCapture:g};for(a in this.listeners){for(var b=[],k=0;k<this.listeners[a].length;k++)this.areListenersEqual(this.listeners[a][k],c)?"boolean"===typeof g?this.target.removeEventListener(a,this.listeners[a][k].handler,g):this.target.removeEventListener(a,
this.listeners[a][k].handler):b.push(this.listeners[a][k]);this.listeners[a]=b}};b.prototype.dispose=function(){for(var a in this.listeners)for(var c=0;c<this.listeners[a].length;c++)this.target.removeEventListener(a,this.listeners[a][c].handler,!0),this.target.removeEventListener(a,this.listeners[a][c].handler,!1);this.listeners={}};return b}(),h=function(b){function a(){return null!==b&&b.apply(this,arguments)||this}__extends(a,b);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};
Object.defineProperty(a.prototype,"target",{get:function(){return document},enumerable:!0,configurable:!0});return a}(e),e=function(b){function a(){return null!==b&&b.apply(this,arguments)||this}__extends(a,b);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};Object.defineProperty(a.prototype,"target",{get:function(){return window},enumerable:!0,configurable:!0});return a}(e),f=function(){function b(){}b.dispose=function(){for(;0<b.timeouts.length;)clearTimeout(b.timeouts.pop());
for(;0<b.intervals.length;)clearInterval(b.intervals.pop())};b.timeouts=[];b.intervals=[];return b}();d.Timers=f;d.fmSetTimeout=function(b,a){var c=setTimeout(b,a);f.timeouts.push(c);return c};d.fmClearTimeout=function(b){clearTimeout(b);f.timeouts.splice(f.timeouts.indexOf(b),1)};d.fmSetInterval=function(b,a){var c=setInterval(b,a);f.intervals.push(c);return c};d.fmClearInterval=function(b){clearInterval(b);f.intervals.splice(f.intervals.indexOf(b),1)};d.fmdocument=h.getInstance();d.fmwindow=e.getInstance()})(utils||
(utils={}));
(function(d){var e=function(d){function e(b){var a=d.call(this)||this;a._scrollListener=function(){return a.scrollListener()};a._dispatchResize=function(){return a._dispatchResize()};a._target=b;a.startListener(a._target.element);return a}__extends(e,d);e.prototype.resetTriggers=function(b){var a=b.__resizeTriggers__;b=a.firstElementChild;var a=a.lastElementChild,c=b.firstElementChild;a.scrollLeft=a.scrollWidth;a.scrollTop=a.scrollHeight;c.style.width=b.offsetWidth+1+"px";c.style.height=b.offsetHeight+
1+"px";b.scrollLeft=b.scrollWidth;b.scrollTop=b.scrollHeight};e.prototype.checkTriggers=function(b){return b.offsetWidth!=b.__resizeLast__.width||b.offsetHeight!=b.__resizeLast__.height};e.prototype.scrollListener=function(){var b=this;if(null!=this._target){var a=this._target.element;this.resetTriggers(a);a.__resizeRAF__&&this._target.cancelAnimationFrame(a.__resizeRAF__);a.__resizeRAF__=this._target.requestAnimationFrame(function(){b.checkTriggers(a)&&(a.__resizeLast__.width=a.offsetWidth,a.__resizeLast__.height=
a.offsetHeight,b.dispatchResize())})}};e.prototype.dispatchResize=function(){this.dispatchWith(events._Event.RESIZE)};e.prototype.startListener=function(b){b.attachEvent?b.attachEvent("onresize",this._dispatchResize):b.__resizeTriggers__||("static"==getComputedStyle(b).position&&(b.style.position="relative"),b.__resizeLast__={},b.__resizeListeners__=[],b.__resizeTriggers__=document.createElement("div"),b.__resizeTriggers__.className="wdr-resize-triggers",b.__resizeTriggers__.innerHTML='<div class="wdr-expand-trigger"><div></div></div><div class="wdr-contract-trigger"></div>',
b.appendChild(b.__resizeTriggers__),this.resetTriggers(b),b.addEventListener("scroll",this._scrollListener,!0))};e.prototype.stopListener=function(b){b.detachEvent?b.detachEvent("onresize",this._dispatchResize):(b.removeEventListener("scroll",this._scrollListener),b.__resizeTriggers__=!b.removeChild(b.__resizeTriggers__))};e.prototype.dispose=function(){this._target&&this._target.element&&this.stopListener(this._target.element);this._dispatchResize=this._scrollListener=this._target=null};return e}(events.EventDispatcher);
d.ResizeListener=e})(utils||(utils={}));
(function(d){var e=function(){function d(){}d.isHttpURL=function(d){return null!=d&&(0==d.indexOf("http://")||0==d.indexOf("https://"))};d.isBlobURL=function(d){return null!=d&&0==d.indexOf("blob:http")};d.getUrl=function(e,b){void 0===b&&(b=!1);if(!e)return"()";e=e.trim();if(0==e.length)return"()";if(d.isBlobURL(e))return e;if(b){var a=-1<e.indexOf("?")?"&":"?";e+=a+Math.round(Date.now()/3600)}if(d.isHttpURL(e)||0==e.indexOf("file")||"/"==e.substr(0,1))return e;if(-1!=e.indexOf("..")){for(a=e.split("/");".."==
a[0];)0<a.length&&a.shift();e="/"+a.join("/");"/"==e.substr(0,1)&&(e=e.substring(1))}return e};d.addTimestamp=function(d){var b=-1<d.indexOf("?")?"&":"?";return d+=b+Math.round(Date.now()/3600)};return d}();d.URLUtils=e})(utils||(utils={}));
(function(d){var e=function(){function d(){}d.isUTCFormat=function(d){return"UTC:"==d.slice(0,4)};d.format=function(e,b){var a=!1;"UTC:"==b.slice(0,4)&&(b=b.slice(4),a=!0);var c=a?"getUTC":"get",g=e[c+"Date"](),m=e[c+"Day"](),k=e[c+"Month"](),l=e[c+"FullYear"](),s=e[c+"Hours"](),r=e[c+"Minutes"](),n=e[c+"Seconds"](),c=e[c+"Milliseconds"](),p=a?0:e.getTimezoneOffset(),q={d:g,dd:d.pad(g),ddd:d.i18n.dayNames[m],dddd:d.i18n.dayNames[m+7],D:g,DD:d.pad(g),DDD:d.i18n.dayNames[m],DDDD:d.i18n.dayNames[m+7],
M:k+1,MM:d.pad(k+1),MMM:d.i18n.monthNames[k],MMMM:d.i18n.monthNames[k+12],yy:String(l).slice(2),yyyy:l,YY:String(l).slice(2),YYYY:l,h:s%12||12,hh:d.pad(s%12||12),H:s,HH:d.pad(s),m:r,mm:d.pad(r),s:n,ss:d.pad(n),l:d.pad(c,3),L:d.pad(99<c?Math.round(c/10):c),t:12>s?"a":"p",tt:12>s?"am":"pm",T:12>s?"A":"P",TT:12>s?"AM":"PM",Z:a?"UTC":(String(e).match(d.timezone)||[""]).pop().replace(d.timezoneClip,""),o:(0<p?"-":"+")+d.pad(100*Math.floor(Math.abs(p)/60)+Math.abs(p)%60,4),S:["th","st","nd","rd"][3<g%10?
0:(10!=g%100-g%10?1:0)*g%10]};return b.replace(d.token,function(c){return c in q?q[c]:c.slice(1,c.length-1)})};d.pad=function(d,b){var a=""+d;for(b=b||2;a.length<b;)a="0"+a;return a};d.setDayNames=function(e,b){d.i18n.dayNames=b.concat(e)};d.setMonthNames=function(e,b){d.i18n.monthNames=b.concat(e)};d.token=/d{1,4}|D{1,4}|m{1,4}|M{1,4}|yy(?:yy)?|YY(?:YY)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g;d.timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
d.timezoneClip=/[^-+\dA-Z]/g;d.i18n={dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")};return d}();d.DateFormat=e})(utils||(utils={}));
(function(d){function e(){for(var d=[],b=0;b<arguments.length;b++)d[b]=arguments[b];for(b=0;b<d.length;b++)if("undefined"===typeof d[b]||null===d[b])return!0;return!1}var h=function(){function f(){}f.toBoolean=function(b){return void 0!==b&&null!==b&&("true"==b.toLowerCase()||"on"==b.toLowerCase())};f.generateID=function(){var b=(new Date).getTime()-(new Date(2012,2,8)).getTime();if(f.lastGeneratedID==b)return b.toString(35)+(f.lastGeneratedIDSuffix++).toString();f.lastGeneratedID=b;f.lastGeneratedIDSuffix=
0;return b.toString(35)};f.bind=function(b){for(var a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];if(d.nullOrUndefined(b))return b;for(c=0;c<a.length;c++)b=b.replace(RegExp("\\{"+c+"\\}","gi"),null==a[c]?"":a[c].toString());return b};f.concat=function(b,a){if(0==b.length)return a;var c=0<b.length?b.charCodeAt(b.length-1):-1,g=0<b.length?b.charCodeAt(b.length-2):-1,m="";if(-1!=g&&128<g&&256>g&&!(191<g&&224>g))return m=a.charCodeAt(0),m=String.fromCharCode((g&15)<<12|(c&63)<<6|m&63),b.substr(0,
b.length-2)+m+a.substr(1);if(!(128>c||256<c)){if(191<c&&224>c)return g=a.charCodeAt(0),m=String.fromCharCode((c&31)<<6|g&63),b.substr(0,b.length-1)+m+a.substr(1);if(256>c)return g=a.charCodeAt(0),m=a.charCodeAt(1),m=String.fromCharCode((c&15)<<12|(g&63)<<6|m&63),b.substr(0,b.length-1)+m+a.substr(2)}return b+a};f.toTime=function(b){if(isNaN(b))return pivot.model._labels.Labels.INVALID_DATE;var a="",c=0>b;0>b&&(b*=-1);b=Math.round(b);var g=b%60,a=10>g?"0"+g:g.toString();b=(b-g)/60;g=b%60;a=(10>g?"0"+
g:g.toString())+":"+a;b=(b-g)/60;g=b%24;a=(10>g?"0"+g:g.toString())+":"+a;b=(b-g)/24;0<b&&(a=b.toString()+"d "+a);c&&(a="-"+a);return a};f.toDate=function(b,a){void 0===a&&(a="dd/MM/yyyy");if(isNaN(b)||0==b)return pivot.model._labels.Labels.INVALID_DATE;var c=new Date(b);return isNaN(c.getTime())?"":d.DateFormat.format(c,a)};f.toDateTime=function(b,a){void 0===a&&(a="dd/MM/yyyy HH:mm:ss");return f.toDate(b,a)};f.isDate=function(b){return this.matchesISODate(b)&&!isNaN(Date.parse(b))&&(1<b.match(/\d+/).length||
1==b.match(/\d+/).length&&(new Date(Date.parse(b))).toDateString()!=(new Date(Date.parse(b.match(/\d+/)[0]))).toDateString())};f.matchesISODate=function(b){return d.detectBrowser().isChrome&&!b.match(/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/i)?!1:!0};f.fromRgbToHex=
function(b){if(e(b))return 0;if("#"===b.substr(0,1))return parseInt(b.substr(1),16);"transparent"==b&&(b="rgb(255,255,255)");b=b.replace(/[^\d,]/g,"");b=b.split(",");var a=parseInt(b[0]),c=parseInt(b[1]),g=parseInt(b[2]);0===parseInt(b[3])&&(a=c=g=255);return g|c<<8|a<<16};f.strToUint8Arr=function(b){for(var a=new Uint8Array(b.length),c=0,g=b.length;c<g;++c)a[c]=b.charCodeAt(c);return a};f.strToUint8ArrExtended=function(b){for(var a=new pivot.DataStream(new ArrayBuffer(b.length)),c=0,g=b.length;c<
g;++c)a.writeString(b.charAt(c));a.seek(0);return a.readUint8Array(a.byteLength)};f.dataURItoUint8Arr=function(b){b=-1!==b.split(",")[0].indexOf("base64")?atob(b.split(",")[1]):decodeURI(b.split(",")[1]);return f.strToUint8Arr(b)};f.decode2=function(b){var a,c,g,m,k,d;a="";g=b.length;for(c=0;c<g;)switch(m=b[c++],m>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(m);break;case 12:case 13:k=b[c++];a+=String.fromCharCode((m&31)<<6|k&63);break;case 14:k=b[c++],d=b[c++],
a+=String.fromCharCode((m&15)<<12|(k&63)<<6|(d&63)<<0)}return a};f.decode=function(b){for(var a="",c=0;c<b.length;c++)a+=String.fromCharCode(b[c]);return decodeURIComponent(escape(a))};f.contains=function(b,a){return-1<b.toLowerCase().indexOf(a)};f.parseBool=function(b){"string"==typeof b&&(b=String(b).toLowerCase());return"true"===b||"on"===b||1===b||!0===b};f.toNumber=function(b){if(null==b)return NaN;if("number"===typeof b)return b;"string"!==typeof b&&(b=b.toString());","==pivot.model.format.FormatManager.getFormat("").thousandsSeparator&&
(b=b.replace(/,/gi,""));b=b.replace(",",".");b=b.replace(/[^[,|\.|\-|\d|e]]*/gi,"");return parseFloat(b)};f.trim=function(b,a){void 0===a&&(a=null);if(null==b)return"";for(var c=0;f.isWhitespace(b.charAt(c),a);)++c;for(var g=b.length-1;f.isWhitespace(b.charAt(g),a);)--g;return g>=c?b.slice(c,g+1):""};f.trimLeft=function(b,a){void 0===a&&(a=null);if(null==b)return"";for(var c=0;f.isWhitespace(b.charAt(c),a);)++c;var g=b.length-1;return g>=c?b.slice(c,g+1):""};f.isWhitespace=function(b,a){void 0===
a&&(a=null);if(null!=a&&b==a)return!1;switch(b){case " ":case "\t":case "\r":case "\n":case "\f":return!0}return!1};f.isEntity=function(b){for(var a in f.entityMap)if(f.entityMap[a]==b)return!0;return!1};f.escapeHtml=function(b,a){void 0===a&&(a=!1);return a?b.replace(/[<>"'\/]/g,function(c){return f.entityMap[c]}):b.replace(/[&<>"'\/]/g,function(c){return f.entityMap[c]})};f.lastGeneratedIDSuffix=0;f.entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return f}();
d.StringUtils=h;d.nullOrUndefined=e;d.nullOrEmpty=function(d){if(e(d)||"string"!=typeof d||0==d.trim().length)return!0;d=d.trim();for(var b=0;b<d.length;b++)if(0!=d.charCodeAt(b))return!1;return!0};d.strEncode=function(d){return d.replace(/\|/g,"{%7C}")};d.strDecode=function(d){return d.replace(/{%7C}/g,"|")}})(utils||(utils={}));
(function(d){var e=function(){function d(){}d.sortOn=function(e,b,a,c){a>>=1;var g=1==a%2;a=a>>1>>1;var m=1==a%2;a>>=1;a=1==a%2;if(m)return e=d.sortIndices(e,b,c),g&&e.reverse(),e;a?d.sortNumeric(e,b):""==b?e.sort():e.sort(function(c,a){return c[b]==a[b]?0:c[b]>a[b]?1:-1});g&&e.reverse();return e};d.sort=function(e,b,a){void 0===b&&(b=0);return d.sortOn(e,"",b,a)};d.sortNumeric=function(d,b){""==b?d.sort(function(a,c){return isNaN(a)?1:isNaN(c)?-1:a-c}):d.sort(function(a,c){return isNaN(a[b])?1:isNaN(c[b])?
-1:a[b]-c[b]})};d.sortIndices=function(d,b,a){var c=[],g;for(g in d)c.push([d[g],parseInt(g)]);""==b?a?c.sort(function(c,g){return a(c[0],g[0])}):c.sort(function(c,a){return c[0]==a[0]?0:c[0]>a[0]?1:-1}):a?c.sort(function(c,g){return a(c[0][b],g[0][b])}):c.sort(function(c,a){return c[0][b]==a[0][b]?0:c[0][b]>a[0][b]?1:-1});d=[];for(var m in c)d.push(c[m][1]);return d};d.find=function(d,b,a){void 0===a&&(a=null);for(var c=d.length-1;-1<c;c--)if(null===a&&d[c]===b||null!==a&&d[c][a]===b)return d[c];
return null};d.findIndex=function(d,b,a){void 0===a&&(a=null);for(var c=d.length-1;-1<c;c--)if(null===a&&d[c]===b||null!==a&&d[c][a]===b)return c;return-1};d.insert=function(d,b,a){for(var c=0;c<b.length;c++)d.splice(a+c,0,b[c])};d.CASEINSENSITIVE=1;d.DESCENDING=2;d.UNIQUESORT=4;d.RETURNINDEXEDARRAY=8;d.NUMERIC=16;return d}();d.ArrayUtils=e})(utils||(utils={}));
(function(d){var e=function(){function e(){this.values={};this.keys=[]}e.prototype.addItem=function(d,b){void 0===this.values[d]&&this.keys.push(d);this.values[d]=b};e.prototype.addUniqueItem=function(d,b){this.keys.push(d);this.values[d]=b};e.prototype.unshift=function(d,b){this.keys.unshift(d);this.values[d]=b};e.prototype.setItemAt=function(d,b,a){this.keys[a]=d;this.values[d]=b};e.prototype.addItemAt=function(d,b,a){null!=this.getItem(d)&&this.removeItem(d);this.keys.splice(a,0,d);this.values[d]=
b};e.prototype.removeItem=function(d){null!=this.getItem(d)&&(this.keys.splice(this.indexOf(d),1),delete this.values[d])};e.prototype.removeItemAt=function(d){var b=this.getKeyAt(d);null!=b&&(this.keys.splice(d,1),delete this.values[b])};Object.defineProperty(e.prototype,"length",{get:function(){return this.keys.length},set:function(d){},enumerable:!0,configurable:!0});e.prototype.indexOf=function(d){return this.keys.indexOf(d)};e.prototype.keyExists=function(d){return null!=this.values[d]};e.prototype.getItem=
function(d){return this.values[d]};e.prototype.getItemAt=function(d){return this.getItem(this.keys[d])};e.prototype.getKeyAt=function(d){return this.keys[d]};e.prototype.moveItemAt=function(d,b){this.keys.splice(b,0,this.keys.splice(d,1)[0])};e.prototype.slice=function(f,b){void 0===f&&(f=0);void 0===b&&(b=0);0==b&&(b=this.length-f);for(var a=new e,c=0;c<b;c++)this.length>c+f&&(d.nullOrUndefined(this.getItemAt(c+f))||a.addItem(this.getKeyAt(c+f),this.getItemAt(c+f)));return a};e.prototype.concat=
function(d,b){void 0===b&&(b=!0);if(!b)return this._concat(d),null;var a,c=new e;for(a=0;a<this.length;a++)c.addItem(this.getKeyAt(a),this.getItemAt(a));for(a=0;a<d.length;a++)c.addItem(d.getKeyAt(a),d.getItemAt(a));return c};e.prototype._concat=function(d){var b,a=d.length;for(b=0;b<a;b++)this.addItem(d.getKeyAt(b),d.getItemAt(b))};e.prototype.splice=function(d,b){void 0===b&&(b=0);var a=new e;d+b>this.length&&(b=this.length-d);1>b&&(b=this.length);for(var c=0;c<this.length;c++)(c<d||c>=d+b)&&a.addItem(this.getKeyAt(c),
this.getItemAt(c));return a};e.prototype.reverse=function(){var d,b=new e;for(d=this.length-1;-1<d;d--)b.addItem(this.getKeyAt(d),this.getItemAt(d));return b};e.prototype.toArray=function(d){void 0===d&&(d=!1);if(d)return this.keys.slice(0);d=[];for(var b=0;b<this.length;b++)d.push(this.getItemAt(b));return d};e.prototype.toKeyArray=function(d){void 0===d&&(d=!1);if(d)return this.keys.slice(0);d=[];for(var b=0;b<this.length;b++)d.push(this.getKeyAt(b));return d};e.fromArray=function(d){for(var b=
new e,a=0;a<d.length;a++)b.addItem(a.toString(),d[a]);return b};e.convert=function(d,b){for(var a=new e,c=0;c<d.length;c++)a.addItem(d[c][b],d[c]);return a};e.prototype.toString=function(){var d=[],b;for(b in this.keys){var a="{"+b+": "+this.getItem(b)+"}";d.push(a)}return d.join(", ")};return e}();d.AssociativeArray=e})(utils||(utils={}));
(function(d){var e=function(){function d(){this.quotes=[]}d.prototype.parse=function(d){try{this.quotes=[];for(var b=[],a=!1,c="",g=0;g<d.length;g++){var m=d.charAt(g);'"'==m||"'"==m?(a&&(this.quotes.push(c),b.push(m),c=""),a=!a):a&&(c+=m)}d="  "+d;for(var k,g=0;g<this.quotes.length;g++)if("truestyle"!=this.quotes[g].toLowerCase()){var e=b[g]+this.quotes[g]+b[g],h=d.substring(0,d.indexOf(e)+e.length+2);k=/(\w\w\w\()[\'|\"][^\'|^\"]*[\'|\"]/i;if(k.test(h))d=d.replace(e,"@"+g);else{k=/(\W)[\'|\"][^\'|^\"]*[\'|\"]/i;
var r=(-1!=h.indexOf("#value")||-1!=h.indexOf("#updateDifference")||-1!=h.indexOf("#updatePercent"))&&-1!=h.indexOf("if(");k.test(h)&&!r?d=d.replace(e,"sum(@"+g+")"):(k=/(\W)[\'|\"][^\'|^\"]*[\'|\"]/i,d=d.replace(e,"@"+g))}}k=/\#value/g;d=d.replace(k,"value()");k=/\#updateDifference/g;d=d.replace(k,"updateDifference()");k=/\#updatePercent/g;d=d.replace(k,"updatePercent()");d=d.toLocaleLowerCase();var n=this._parse(d),n=n[1][0]}catch(p){return null}return n};d.prototype._parse=function(d){for(var b=
[],a="",c=d.length,g=0;g<d.length;g++){var m=d.charAt(g);if("("==m)a+="$"+b.length+";",m=this._parse(d.slice(g+1)),b.push(m[1]),g=g+m[0]+1;else if(")"==m){c=g;break}else a+=m}d=[];a=a.split(",");for(g=0;g<a.length;g++)d.push(this._parseOperands(a[g],b));return[c,d]};d.prototype._parseOperands=function(d,b){for(var a=[[" or "," and "],"== != >= <= = > <".split(" "),["-","+"],["/","*"],["^"]],c=0;c<a.length;c++){var g=Number.MIN_VALUE,m=a[c][0];if(3==c){var g=d.indexOf(a[c][0]),k=d.indexOf(a[c][1]);
-1!=g&&-1!=k?m=g<k?a[c][0]:a[c][1]:-1!=g?m=a[c][0]:-1!=k&&(m=a[c][1])}else for(k=0;k<a[c].length;k++){var e=d.indexOf(a[c][k]);-1!=e&&e>=g&&(m=a[c][k],g=e+m.length)}g=d.split(m);2<g.length&&(k=g[g.length-1],g.pop(),g=[g.join(m),k]);if(2==g.length)return[m.trim(),[this._parseOperands(g[0],b),this._parseOperands(g[1],b)],!0]}return this._parseElements(d,b)};d.prototype._parseElements=function(d,b){d=d.trim();if(-1!=d.indexOf("$")){var a=d.split("$"),c=a[0],a=parseInt(a[1]);if(0<c.length){var g="string"!=
typeof b[a][0];("min"==c||"max"==c)&&1<b[a].length&&(g=!0,"string"==typeof b[a][0]&&(b[a][0]=["sum",[b[a][0]],!1]),"string"==typeof b[a][1]&&(b[a][1]=["sum",[b[a][1]],!1]));return[c,b[a],g]}return b[a][0]}if(-1!=d.indexOf("@"))return c=parseInt(d.slice(1)),this.quotes[c];if("truestyle"==d.toLowerCase()||"truestyle"==d.substring(1,d.length-1).toLowerCase())return"truestyle";c=parseFloat(d);return isNaN(c)?0:c};return d}();d.Lexer=e})(utils||(utils={}));
(function(d){var e=function(){function d(){}Object.defineProperty(d,"isMac",{get:function(){return/Mac/i.test(navigator.platform)},enumerable:!0,configurable:!0});Object.defineProperty(d,"isWin",{get:function(){return/Win/i.test(navigator.platform)},enumerable:!0,configurable:!0});Object.defineProperty(d,"isIOS",{get:function(){return/(iPhone|iPod|iPad)/i.test(navigator.platform)||/(iPhone|iPod|iPad)/i.test(navigator.userAgent)},enumerable:!0,configurable:!0});Object.defineProperty(d,"isAnd",{get:function(){return/Android/i.test(navigator.userAgent)},
enumerable:!0,configurable:!0});return d}();d.OSUtil=e})(utils||(utils={}));
(function(d){var e=function(){function e(){}e.isEmptyObject=function(e){for(var b in e)if(!d.nullOrUndefined(e[b]))return!1;return!0};e.deepCopy=function(d){if(d instanceof Array)return e.deepCopyArray(d);var b={},a;for(a in d)b[a]="object"!=typeof d[a]?d[a]:e.deepCopy(d[a]);return b};e.deepCopyArray=function(d){for(var b=[],a=0;a<d.length;a++)b[a]="object"!=typeof d[a]?d[a]:e.deepCopy(d[a]);return b};return e}();d.ObjectUtils=e})(utils||(utils={}));
(function(d){var e=function(){function d(){throw Error("Singleton");}d.dispose=function(){d.queue=[];d.instance=null;d.runningThread=null};d.addTask=function(b,a,c,g){void 0===c&&(c=null);void 0===g&&(g=null);d.queue.push({taskFunction:b,context:a,args:c,completeCallback:g});null==d.runningThread&&d.run()};d.run=function(){d.runningThread=new h(d.queue.shift(),function(){return d.onTaskComplete()});d.runningThread.run()};d.pause=function(){null!=d.runningThread&&d.runningThread.stop()};d.resume=function(){null!=
d.runningThread?d.runningThread.run():0<d.queue.length&&d.run()};d.onTaskComplete=function(){d.runningThread=null;0<d.queue.length&&this.run()};d.cancel=function(){null!=d.runningThread&&(d.runningThread.stop(),d.runningThread=null);d.queue=[]};d.isRunning=function(){return null!=d.runningThread};d.adjustTaskSize=function(b,a){10<b-50?a=Math.floor(0.95*a):-10>b-50&&(a=Math.floor(1.05*a));return Math.max(5,a)};d.queue=[];return d}();d.ThreadManager=e;var h=function(){function e(b,a){void 0===a&&(a=
null);this.delay=1;this.isComplete=!1;this.task=b;this.completeCallback=a}e.prototype.run=function(){var b=this;this.currentTimeout=d.fmSetTimeout(function(){return b.doTask()},this.delay)};e.prototype.stop=function(){d.fmClearTimeout(this.currentTimeout)};e.prototype.doTask=function(){var b=this;this.isComplete=this.task.taskFunction.call(this.task.context,this.task.args);if(!0==this.isComplete)this.onComplete();else this.currentTimeout=d.fmSetTimeout(function(){return b.doTask()},this.delay)};e.prototype.onComplete=
function(){null!=this.completeCallback&&this.completeCallback();null!=this.task.completeCallback&&this.task.completeCallback()};e.prototype.dispose=function(){this.stop();this.completeCallback=this.task=null};return e}()})(utils||(utils={}));
(function(d){function e(){var d=navigator.userAgent.toLowerCase(),e={};e.isFirefox=/mozilla/.test(d)&&/firefox/.test(d);e.isChrome=/webkit/.test(d)&&/chrome/.test(d)&&!/edge/.test(d);e.isEdge=/edge/.test(d);e.isSafari=/applewebkit/.test(d)&&/safari/.test(d)&&!/chrome/.test(d);e.isOpera=/opera/.test(d);e.isMsie=/msie/.test(d);e.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(d)||/iPad|iPhone|iPod|BlackBerry/i.test(navigator.platform);e.version=NaN;e.isMsie||e.isFirefox||e.isChrome||
e.isSafari||e.isOpera||!/trident/.test(d)||(e.isMsie=!0,e.version=11);if(isNaN(e.version))for(var b=["chrome","firefox","msie","safari","opera"],a=0;a<b.length;a++)try{e.version=parseInt(d.match(RegExp("("+b[a]+")( |/)([0-9]+)"))[3]);break}catch(c){}return e}d.browserVersion=function(){return e()};d.detectBrowser=e;d.isFullscreen=function(){return null!=document.fullscreenElement||null!=document.mozFullScreenElement||null!=document.webkitFullscreenElement||null!=document.msFullscreenElement};d.isHTML5Supported=
function(){try{var d;if(d=void 0!==ArrayBuffer){var e;if(e=void 0!==DataView){var b;if(b=void 0!==Uint8Array){var a;if(window.chrome&&navigator.userAgent.match(/chrome.\d*/gi)){var c=navigator.userAgent.match(/chrome.\d*/gi)[0];a=12<=parseInt(c.replace(/[^\d]/g,""))}else a=!0;b=a&&(window.opera?15<=window.opera.version():!0)&&(navigator.userAgent.match("Safari/")?!navigator.userAgent.match("Version/5.")&&!navigator.userAgent.match("Version/6.0"):!0)}e=b}d=e}return d}catch(g){return!1}};d.getCookie=
function(d){var e=document.cookie,b=e.indexOf(" "+d+"=");-1==b&&(b=e.indexOf(d+"="));-1==b?e=null:(b=e.indexOf("=",b)+1,d=e.indexOf(";",b),-1==d&&(d=e.length),e=decodeURI(e.substring(b,d)));return e};d.setCookie=function(d,e){var b=new Date;b.setDate(b.getDate()+1825);e=encodeURI(e)+"; expires="+b.toUTCString();document.cookie=d+"="+e};d.isLandscapeOrientation=function(){return screen.orientation&&-1<screen.orientation.type.indexOf("landscape")};d.isPortraitOrientation=function(){return screen.orientation&&
-1<screen.orientation.type.indexOf("portrait")};d.viewportWidth=function(){return Math.max(document.documentElement.clientWidth)};d.viewportHeight=function(){return Math.max(document.documentElement.clientHeight)}})(utils||(utils={}));
(function(d){var e=function(e){function b(a,c){void 0===c&&(c=0);var g=e.call(this)||this;g._currentCount=0;g._delay=0;g._repeatCount=0;g._running=!1;g._delay=a;g._repeatCount=c;return g}__extends(b,e);b.prototype.onTimer=function(){this._currentCount++;this.dispatch(new events._Event(h.TIMER));0<this._repeatCount&&this._currentCount>=this._repeatCount&&(this.stop(),this.dispatch(new events._Event(h.TIMER_COMPLETE)))};b.prototype.start=function(){var a=this;this._running||(this._intervalId=d.fmSetInterval(function(){return a.onTimer()},
this._delay),this._running=!0)};b.prototype.stop=function(){this._running&&!d.nullOrUndefined(this._intervalId)&&(d.fmClearInterval(this._intervalId),this._running=!1)};b.prototype.reset=function(){this._currentCount=0;this.stop()};Object.defineProperty(b.prototype,"currentCount",{get:function(){return this._currentCount},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"running",{get:function(){return this._running},set:function(a){},enumerable:!0,configurable:!0});
Object.defineProperty(b.prototype,"repeatCount",{get:function(){return this._repeatCount},set:function(a){this._repeatCount=a;this._currentCount>=this._repeatCount&&this.stop()},enumerable:!0,configurable:!0});return b}(events.EventDispatcher);d.Timer=e;var h=function(){function d(){}d.TIMER="timer";d.TIMER_COMPLETE="complete";return d}();d.TimerEvent=h;d.getTimer=function(){return"undefined"!==typeof performance&&"function"===typeof window.performance.now?performance.now():(new Date).getTime()}})(utils||
(utils={}));
(function(d){var e=function(e){function b(a){var c=e.call(this)||this;c._isFocused=!1;c._keydownHandler=function(a){return c.onKeyDown(a)};c.inputKeyUpHandler=function(a){return c.onInputKeyUp(a)};if(null!=b._instance)throw Error("KeyboardListener is singleton");c.target=a;d.browserVersion().isMobile||(d.fmdocument.addEventListener("keydown",c._keydownHandler),c._inputContainer=new uicontrols.UIElement("div"),c._inputContainer.attr("id","pivot-hiddenInputContainer"),c._inputContainer.css("position","fixed").css("left",
"0px").css("top","0px").css("opacity","0").css("width","0px").css("height","0px"),c._inputContainer.hide(),c._input=new uicontrols.UITextArea,c._input.setId("pivot-hiddenInput"),c._input.container.css("width","1px").css("height","1px").css("padding","0px"),c._input.addEventListener("focusin",function(){c._isFocused=!0}),c._input.addEventListener("focusout",function(){c._isFocused=!1}),c._inputContainer.append(c._input.container),a.append(c._inputContainer));return c}__extends(b,e);b.getInstance=function(){null==
b._instance&&(b._instance=new b(pivot._view.PivotView.stage.container));return b._instance};Object.defineProperty(b.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!0,configurable:!0});b.prototype.onKeyDown=function(a){var c=new h(h.KEY_DOWN);c.keyCode=a.keyCode;c.altKey=a.altKey;c.ctrlKey=a.ctrlKey;c.metaKey=a.metaKey;c.shiftKey=a.shiftKey;this.dispatch(c)};b.prototype.onInputKeyUp=function(a){this._inputContainer.hide();this._input.setText("");this._input.container.blur();
this._input.removeEventListener("keyup",this.inputKeyUpHandler)};b.prototype.copy=function(a){this._inputContainer.show();this._input.setText(a);this._input.container.focus();this._input.selectAll();this._input.container.focus();this._input.addEventListener("keyup",this.inputKeyUpHandler)};return b}(events.EventDispatcher);d.KeyboardListener=e;var h=function(d){function b(a){return d.call(this,a)||this}__extends(b,d);b.KEY_DOWN="event_keydown";return b}(events._Event);d.KeyboardEvent=h})(utils||(utils=
{}));(function(d){d.debug=function(){for(var d=[],h=0;h<arguments.length;h++)d[h]=arguments[h];if(null!=console&&null!=console.log)for(h=utils.browserVersion().isFirefox&&utils.browserVersion().isMobile?0:1;h<d.length;h++);};d.stackTrace=function(){var d=Error();return d&&d.stack?d.stack.substr(77):""}})(pivot||(pivot={}));
(function(d){d.uialert=function(h,f,b,a,c,g){void 0===f&&(f="");void 0===b&&(b=e.ALERT);void 0===a&&(a=null);void 0===c&&(c=null);void 0===g&&(g=!1);d._view.AlertView.getInstance().openView(h,f,b,a,c,g)};var e=function(){function d(){}d.ALERT="alert";d.CONFIRMATION="confirmation";d.ERROR="error";d.INFO="info";return d}();d.AlertType=e})(pivot||(pivot={}));(function(d){d.preloader=function(e,h,f,b,a){void 0===e&&(e=!0);d._view.Preloader.getInstance().show(e,h,f,b,a)}})(pivot||(pivot={}));
(function(d){(function(e){var h=function(h){function b(){var a=h.call(this)||this;if(null!=b.instance)throw Error("Singleton");a.cube_=d.data_.Cube.getInstance();a.state_=new e._state.StateManager;return a}__extends(b,h);b.getInstance=function(){null==this.instance&&(this.instance=new b);return this.instance};b.prototype.init=function(a){b.id=a.id?a.id:"";e.JavaScriptHandlers.setHandlers(a);e._labels.LabelsManager.getInstance().reset();d._view.grid.vo.GridCell.customizeCellFunction=a.customizeCell;
this.state_.init(a)};b.prototype.open=function(){this.state_.open()};b.prototype.load=function(a){this.state_.load(a)};b.prototype.save=function(a,c,g,b,d){void 0===c&&(c=null);void 0===d&&(d=!1);return this.state_.save(a,c,g,b,d)};b.prototype.setReport=function(a){this.state_.setReport(a)};b.prototype.getReport=function(a){void 0===a&&(a={});return this.state_.getReport(a)};b.prototype.clear=function(){this.state_.clear()};b.prototype.checkDataObject=function(a){var c={};utils.nullOrUndefined(a.dataSourceType)||
(c.dataSourceType=a.dataSourceType);utils.nullOrUndefined(a.filename)||(c.filename=a.filename);utils.nullOrUndefined(a.requestHeader)||(c.requestHeader=a.requestHeader);utils.nullOrUndefined(a.fieldSeparator)||(c.fieldSeparator=a.fieldSeparator);utils.nullOrUndefined(a.recordsetDelimiter)||(c.recordsetDelimiter=a.recordsetDelimiter);utils.nullOrUndefined(a.browseForFile)||(c.browseForFile=a.browseForFile);utils.nullOrUndefined(a.data)||(c.data=a.data);utils.nullOrUndefined(a.ignoreQuotedLineBreaks)||
(c.ignoreQuotedLineBreaks=a.ignoreQuotedLineBreaks);utils.nullOrUndefined(a.hash)||(c.hash=a.hash);utils.nullOrUndefined(a.username)||(c.username=a.username);utils.nullOrUndefined(a.password)||(c.password=a.password);return c};b.prototype.connectTo=function(a){this.state_.connectTo(this.checkDataObject(a))};b.prototype.updateData=function(a,c){c.partial?this.state_.updateDataPartial(a.data,c):this.state_.updateData(this.checkDataObject(a),c)};b.prototype.getData=function(a,c,g){if(null!=g)d.Pivot.instance.on("update",
function(){d.Pivot.instance.getData(a,g)});if(null!=a&&null!=a.slice){var b=a.slice instanceof d.data_._structure.Slice?a.slice:d.data_._structure.Slice.fromObject(e.report.SliceValueObject.fromObject(a.slice),this.cube_.structure_);e.integration.IntegrationDataManager.getInstance().selectData(b,c)}else b=e.integration.IntegrationDataManager.getInstance().getData(),c(b.toObject())};b.prototype.getAllConditions=function(){return e.condition.ConditionManager.getObjects()};b.prototype.getCondition=function(a){return(a=
e.condition.ConditionManager.get(a))?a.toObject():null};b.prototype.addCondition=function(a){e.condition.ConditionManager.add(e.condition.vo.ConditionValueObject.fromObject(a))};b.prototype.removeCondition=function(a){e.condition.ConditionManager.remove(a)};b.prototype.removeAllConditions=function(){e.condition.ConditionManager.removeAll()};b.prototype.addCalculatedMeasure=function(a){this.cube_.addCalculatedMeasure(a)};b.prototype.removeCalculatedMeasure=function(a){this.cube_.removeCalculatedMeasure(a)};
b.prototype.removeAllCalculatedMeasures=function(){this.cube_.removeAllCalculatedMeasures()};b.prototype.expandAllData=function(a){void 0===a&&(a=!0);this.cube_.slice_.expandAll=!0;this.cube_.slice_.drillAll=a;this.cube_.slice_.clearExpands();this.cube_.slice_.clearDrills();d.data_.dataprovider_.DataProviderFactory.dispose();this.refresh()};b.prototype.expandData=function(a){this.dataProvider_.expandData(a)};b.prototype.collapseAllData=function(){this.cube_.slice_.expandAll=!1;this.cube_.slice_.drillAll=
!1;this.cube_.slice_.columnAxis.expandedTuples=[];this.cube_.slice_.columnAxis.drilledTuples=[];this.cube_.slice_.rowAxis.expandedTuples=[];this.cube_.slice_.rowAxis.drilledTuples=[];d.data_.dataprovider_.DataProviderFactory.dispose();this.refresh()};b.prototype.collapseData=function(a){this.dataProvider_.collapseData(a)};b.prototype.setOptions=function(a){null!=a.localSettingsUrl&&delete a.localSettingsUrl;null!=a.zoom&&delete a.zoom;e._options.OptionsManager.setOptions(a,!1)};b.prototype.print=
function(a){e.printing.PrintingManager.getInstance().print(a)};b.prototype.exportTo=function(a,c,g){void 0===c&&(c=null);void 0===g&&(g=null);e._export.ExportManager.exportTo(a,c,g)};b.prototype.getFilter=function(a){if(null==this.cube_||null==this.cube_.structure_)return[];var c=[];if((a=this.cube_.structure_.allHierarchies(!1).getItem(a))&&a.hasFilter())for(var g=a.filter,b=0;b<g.length;b++){var d=g.getItemAt(b);c.push({caption:d.caption,uniqueName:d.uniqueName,hierarchyName:a.uniqueName,parentMember:d.parent.uniqueName})}return c};
b.prototype.getFilterProperties=function(a){if(null==this.cube_||null==this.cube_.structure_)return[];var c={};c.type=d.data_.consts.FilterType.NONE;c.members=[];if((a=this.cube_.structure_.allHierarchies(!1).getItem(a))&&a.hasFilter()){if(a.hasMembersFilter()){c.type="members";for(var g=a.filterMembers,b=0;b<g.length;b++){var k=g.getItemAt(b);c.members.push({caption:k.caption,uniqueName:k.uniqueName,hierarchyName:a.uniqueName,parentMember:k.parent.uniqueName})}}a.hasValuesFilter()&&(c.type=a.filterType,
c.quantity=a.filterQuantity,c.measure=a.filterMeasureName,c.measureName=a.filterMeasureName)}return c};b.prototype.setFilter=function(a,c,g){void 0===g&&(g=!1);if(a=this.cube_.structure_.allHierarchies(!1).getItem(a)){var b={};b.members=c;b.negation=g;d.data_._structure.GenericHierarchy.filterFromObject(b,a);e.JavaScriptHandlers.getInstance().dispatch(new e.APIEvent(e.JavaScriptHandlers.REPORT_CHANGE));this.cube_.filter()}};b.prototype.clearFilter=function(a){if(a=this.cube_.structure_.allHierarchies(!1).getItem(a))a.clearFilter(),
this.cube_.select()};b.prototype.getRows=function(){if(null==this.cube_||null==this.cube_.slice_)return[];for(var a=this.cube_.slice_.rows,c=[],g=0;g<a.length;g++){var b=a.getItemAt(g);c.push({caption:b.caption,uniqueName:b.uniqueName,sort:b.sortName,folder:b.folder})}return c};b.prototype.getColumns=function(){if(null==this.cube_||null==this.cube_.slice_)return[];for(var a=this.cube_.slice_.columns,c=[],g=0;g<a.length;g++){var b=a.getItemAt(g);c.push({caption:b.caption,uniqueName:b.uniqueName,sort:b.sortName,
folder:b.folder})}return c};b.prototype.getPages=function(){if(null==this.cube_||null==this.cube_.slice_)return[];for(var a=this.cube_.slice_.pages,c=[],g=0;g<a.length;g++){var b=a.getItemAt(g);c.push({caption:b.caption,uniqueName:b.uniqueName,sort:b.sortName,folder:b.folder})}return c};b.prototype.getMeasures=function(){if(null==this.cube_||null==this.cube_.slice_)return[];var a,c,g,b=[];if(e._options.OptionsManager.flatView){var k=this.cube_.slice_.flatten();for(a=0;a<k.length;a++)if(c=k.getItemAt(a),
c=this.cube_.structure_.hierarchyToMeasure(c.uniqueName))g=d.data_._structure.GenericMeasure.toObject(c),g.availableAggregations=[],g.availableAggregationsCaptions=[],g.caption=g.grandTotalCaption=c.originalCaption,b.push(g)}else for(k=this.cube_.slice_.measures_,a=0;a<k.length;a++){c=k.getItemAt(a);g=d.data_._structure.GenericMeasure.toObject(c);var l=c.availableAggregations;0!=c.availableAggregations.length||c.calculated||(l=d.data_.consts.AggregationName.ALL_AGGREGATIONS);g.availableAggregations=
l;g.availableAggregationsCaptions=d.data_.consts.AggregationName.aggregationCaptions(l);b.push(g)}return b};b.prototype.getAllMeasures=function(){if(null==this.cube_||null==this.cube_.structure_)return[];for(var a=this.cube_.structure_.measures_,c=[],g=0;g<a.length;g++){var b=a.getItemAt(g),k=d.data_._structure.GenericMeasure.toObject(b);if(e._options.OptionsManager.flatView)k.availableAggregations=[],k.availableAggregationsCaptions=[],k.caption=k.grandTotalCaption=b.originalCaption;else{var l=b.availableAggregations;
0!=b.availableAggregations.length||b.calculated||(l=d.data_.consts.AggregationName.ALL_AGGREGATIONS);k.availableAggregations=l;k.availableAggregationsCaptions=d.data_.consts.AggregationName.aggregationCaptions(l)}c.push(k)}return c};b.prototype.replaceHierarchyCaption=function(a){this.cube_.structure_.allHierarchies(!1).getItem(a.name).label=a.caption};b.prototype.getAllHierarchies=function(){if(null==this.cube_||null==this.cube_.structure_)return[];for(var a=this.cube_.structure_.allHierarchies(!1),
c=[],g=0;g<a.length;g++){var b=a.getItemAt(g);c.push({caption:b.caption,uniqueName:b.uniqueName,folder:b.folder})}return c};b.prototype.sortValues=function(a,c,g,b){a=this.cube_.slice_.axes.getItem(a);if(null!=a){if(b=this.cube_.structure_.measures_.getItem(b))a.sortType=c,a.sortTuple=g,a.sortMeasure=b;this.cube_.sort()}};b.prototype.setSort=function(a,c){var g=this.cube_.structure_.allHierarchies(!1).getItem(a);if(g){var b=this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.COLUMNS_AXIS),k=this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.ROWS_AXIS);
-1!=b.hierarchies.indexOf(g.uniqueName)?this.cube_.clearSortValues(k):-1!=k.hierarchies.indexOf(g.uniqueName)&&this.cube_.clearSortValues(b);g.sortName=c;e._options.OptionsManager.flatView&&(this.dataProvider_.columnSortType=c,this.dataProvider_.columnSortTuple=this.dataProvider_.getColumnTupleByName(g.uniqueName),this.dataProvider_.columnSortMeasure=this.cube_.structure_.hierarchyToMeasure(g.uniqueName))}this.cube_.select()};b.prototype.getSort=function(a){if(null==this.cube_||null==this.cube_.structure_)return"";
a=this.cube_.structure_.allHierarchies(!1).getItem(a);return null!=a?a.sortName:""};b.prototype.setTopX=function(a,c,g){a=this.cube_.structure_.allHierarchies(!1).getItem(a);var b=e._options.OptionsManager.flatView?this.cube_.structure_.measures_.getItem(g):this.cube_.slice_.measures_.getItem(g);a&&b&&!a.isMeasures&&(a.filterType=d.data_.consts.FilterType.TOP,a.filterQuantity=c,a.filterMeasureName=g,a.sortName=d.data_.consts.SortType.UNSORTED,c=this.cube_.slice_.findAxis(d.data_.consts.AxisName.ROWS_AXIS),
g=this.cube_.slice_.findAxis(d.data_.consts.AxisName.COLUMNS_AXIS),-1!=c.hierarchies.indexOf(a.uniqueName)&&(g.sortTuple=[],g.sortType=d.data_.consts.SortType.DESC,g.sortMeasure=this.cube_.slice_.measures_.getItem(a.filterMeasureName)),-1!=g.hierarchies.indexOf(a.uniqueName)&&(c.sortTuple=[],c.sortType=d.data_.consts.SortType.DESC,c.sortMeasure=this.cube_.slice_.measures_.getItem(a.filterMeasureName)));this.cube_.filter()};b.prototype.setBottomX=function(a,c,g){a=this.cube_.structure_.allHierarchies(!1).getItem(a);
var b=e._options.OptionsManager.flatView?this.cube_.structure_.measures_.getItem(g):this.cube_.slice_.measures_.getItem(g);a&&b&&!a.isMeasures&&(a.filterType=d.data_.consts.FilterType.BOTTOM,a.filterQuantity=c,a.filterMeasureName=g,a.sortName=d.data_.consts.SortType.UNSORTED,c=this.cube_.slice_.findAxis(d.data_.consts.AxisName.ROWS_AXIS),g=this.cube_.slice_.findAxis(d.data_.consts.AxisName.COLUMNS_AXIS),-1!=c.hierarchies.indexOf(a.uniqueName)&&(g.sortTuple=[],g.sortType=d.data_.consts.SortType.ASC,
g.sortMeasure=this.cube_.slice_.measures_.getItem(a.filterMeasureName)),-1!=g.hierarchies.indexOf(a.uniqueName)&&(c.sortTuple=[],c.sortType=d.data_.consts.SortType.ASC,c.sortMeasure=this.cube_.slice_.measures_.getItem(a.filterMeasureName)));this.cube_.filter()};b.prototype.getMembers=function(a,c,g){if(null==this.cube_||null==this.cube_.structure_)return[];a=this.cube_.structure_.allHierarchies(!1).getItem(a);c=[];a&&(c=this.getAllChildren(a.allMember),null!=g&&g(c));return c};b.prototype.getChildrenByMember=
function(a,c){for(var g=""==c?a.allMember.children:a.findMember(c).children,b=[],d=0;d<g.length;d++){var e=g.getItemAt(d),h=e.level.num==e.hierarchy_.levels_.length-1;e.uniqueName!=a.allMemberName&&b.push({caption:e.caption,uniqueName:e.uniqueName,hierarchyName:a.uniqueName,parentMember:e.parent.isAll?"(All)":e.parent.uniqueName,isLeaf:h})}return b};b.prototype.getAllChildren=function(a){a=a.hierarchy_.sortChildren(a,!1);for(var c=[],g=0;g<a.length;g++){var b=a.getItemAt(g),d=b.level.num==b.hierarchy_.levels_.length-
1,l=[];if(1!=b.children.length||b.children.getItemAt(0).caption!=e._labels.Labels.MEMBER_BLANK)l=this.getAllChildren(b);c.push({caption:b.caption,uniqueName:b.uniqueName,hierarchyName:b.hierarchy_.uniqueName,children:l,parentMember:b.parent.isAll?"(All)":b.parent.uniqueName,isLeaf:d})}return c};b.prototype.runQuery=function(a){this.state_.runQuery(a)};b.prototype.getOptions=function(){return e._options.OptionsManager.getOptions(!0,!0).toObject()};b.prototype.getFormat=function(a){a=this.cube_&&this.cube_.structure_?
this.cube_.structure_.findMeasure(a):null;return(a?a.getFormat():e.format.FormatManager.getFormat("")).toObject(!0)};b.prototype.setFormat=function(a,c){a.hasOwnProperty("name")||(a.name=utils.StringUtils.generateID());try{e.format.FormatManager.setFormat(a)}catch(g){d.uialert("Can't add format. Component's configuration requires more parameters.");return}try{var b=this.cube_.structure_.findMeasure(c);b&&(b.format=a.name);if(""!=a.name&&(""==c||null==c))for(var k=0;k<this.cube_.structure_.measures_.length;k++)b=
this.cube_.structure_.measures_.getItemAt(k),b.format=a.name}catch(l){d.uialert("List of measures is empty. There is nothing to format.")}};b.prototype.refresh=function(){this.cube_.filter()};b.prototype.dispose=function(){d.data_.dataprovider_.DataProviderFactory.dispose();this.cube_&&this.cube_.dispose();this.state_&&this.state_.dispose();this.dataProvider_=this.state_=this.cube_=null;b.instance=null};b.id="WebDataRocks";return b}(events.EventDispatcher);e.PivotModel=h})(d.model||(d.model={}))})(pivot||
(pivot={}));
(function(d){(function(d){var h=function(){return function(d,b){void 0===b&&(b=null);this.type=d;this.data=b}}();d.APIEvent=h;h=function(d){function b(){var a=this,a=d.call(this)||this;if(null!=b.instance)throw Error("Singleton");return a}__extends(b,d);b.getInstance=function(){null==b.instance&&(b.instance=new b);return b.instance};b.dispose=function(){b.instance=null};b.toTypes=function(a){return b.isValidType(a)?a:""};b.isValidType=function(a){return-1<b.types.indexOf(a)};b.prototype.addEventListener=function(a,
c,g){void 0===g&&(g=0);a=b.toTypes(a);b.isValidType(a)&&d.prototype.addEventListener.call(this,a,c,g)};b.prototype.removeEventListener=function(a,c){a=b.toTypes(a);b.isValidType(a)&&d.prototype.removeEventListener.call(this,a,c)};b.setHandlers=function(a){b.setHandler(b.READY,a[b.READY]);b.setHandler(b.OPENING_REPORT_FILE,a[b.OPENING_REPORT_FILE]);b.setHandler(b.LOADING_REPORT_FILE,a[b.LOADING_REPORT_FILE]);b.setHandler(b.REPORT_FILE_LOADED,a[b.REPORT_FILE_LOADED]);b.setHandler(b.REPORT_FILE_ERROR,
a[b.REPORT_FILE_ERROR]);b.setHandler(b.REPORT_FILE_CANCELLED,a[b.REPORT_FILE_CANCELLED]);b.setHandler(b.REPORT_CHANGE,a[b.REPORT_CHANGE]);b.setHandler(b.LOADING_DATA,a[b.LOADING_DATA]);b.setHandler(b.DATA_LOADED,a[b.DATA_LOADED]);b.setHandler(b.DATA_ERROR,a[b.DATA_ERROR]);b.setHandler(b.DATA_FILE_CANCELLED,a[b.DATA_FILE_CANCELLED]);b.setHandler(b.DATA_CHANGED,a[b.DATA_CHANGED]);b.setHandler(b.RUNNING_QUERY,a[b.RUNNING_QUERY]);b.setHandler(b.QUERY_COMPLETE,a[b.QUERY_COMPLETE]);b.setHandler(b.QUERY_ERROR,
a[b.QUERY_ERROR]);b.setHandler(b.LOADING_LOCALIZATION,a[b.LOADING_LOCALIZATION]);b.setHandler(b.LOCALIZATION_LOADED,a[b.LOCALIZATION_LOADED]);b.setHandler(b.LOCALIZATION_ERROR,a[b.LOCALIZATION_ERROR]);b.setHandler(b.REPORT_COMPLETE,a[b.REPORT_COMPLETE]);b.setHandler(b.PRINT_START,a[b.PRINT_START]);b.setHandler(b.PRINT_COMPLETE,a[b.PRINT_COMPLETE]);b.setHandler(b.EXPORT_START,a[b.EXPORT_START]);b.setHandler(b.EXPORT_COMPLETE,a[b.EXPORT_COMPLETE]);b.setHandler(b.UPDATE,a[b.UPDATE]);b.setHandler(b.BEFORE_GRID_DRAW,
a[b.BEFORE_GRID_DRAW]);b.setHandler(b.AFTER_GRID_DRAW,a[b.AFTER_GRID_DRAW]);b.setHandler(b.CELL_CLICK,a[b.CELL_CLICK]);b.setHandler(b.CELL_DOUBLE_CLICK,a[b.CELL_DOUBLE_CLICK]);b.setHandler(b.FILTER_OPEN,a[b.FILTER_OPEN]);b.setHandler(b.FILDS_LIST_OPEN,a[b.FILDS_LIST_OPEN]);b.setHandler(b.FILDS_LIST_CLOSE,a[b.FILDS_LIST_CLOSE]);b.setHandler(b.BEFORE_TOOLBAR_CREATED,a[b.BEFORE_TOOLBAR_CREATED])};b.setHandler=function(a,c){if(c){"string"==typeof c&&(c=b.getFunctionByName(c));var g=c;a!=b.BEFORE_TOOLBAR_CREATED&&
a!=b.BEFORE_GRID_DRAW&&a!=b.AFTER_GRID_DRAW&&(g=function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];utils.fmSetTimeout(function(){c.apply(null,a)},1)});b.getInstance().addEventListener(a,g)}};b.getFunctionByName=function(a,c){void 0===c&&(c=window);for(var g=a.split("."),b=g.pop(),d=0;d<g.length;d++){if(null==c)return null;c=c[g[d]]}return c[b]};b.OPENING_REPORT_FILE="openingreportfile";b.LOADING_REPORT_FILE="loadingreportfile";b.REPORT_FILE_LOADED="reportfileloaded";b.REPORT_FILE_ERROR=
"reportfileerror";b.REPORT_FILE_CANCELLED="reportfilecancelled";b.LOADING_DATA="loadingdata";b.DATA_LOADED="dataloaded";b.DATA_ERROR="dataerror";b.DATA_FILE_CANCELLED="datafilecancelled";b.DATA_CHANGED="datachanged";b.RUNNING_QUERY="runningquery";b.QUERY_COMPLETE="querycomplete";b.QUERY_ERROR="queryerror";b.LOADING_LOCALIZATION="loadinglocalization";b.LOCALIZATION_LOADED="localizationloaded";b.LOCALIZATION_ERROR="localizationerror";b.REPORT_COMPLETE="reportcomplete";b.REPORT_CHANGE="reportchange";
b.EXPORT_START="exportstart";b.EXPORT_COMPLETE="exportcomplete";b.PRINT_START="printstart";b.PRINT_COMPLETE="printcomplete";b.READY="ready";b.UPDATE="update";b.BEFORE_GRID_DRAW="beforegriddraw";b.AFTER_GRID_DRAW="aftergriddraw";b.CELL_CLICK="cellclick";b.CELL_DOUBLE_CLICK="celldoubleclick";b.FILTER_OPEN="filteropen";b.FILDS_LIST_OPEN="fieldslistopen";b.FILDS_LIST_CLOSE="fieldslistclose";b.BEFORE_TOOLBAR_CREATED="beforetoolbarcreated";b.types=[b.READY,b.OPENING_REPORT_FILE,b.LOADING_REPORT_FILE,b.REPORT_FILE_LOADED,
b.REPORT_FILE_ERROR,b.REPORT_FILE_CANCELLED,b.LOADING_DATA,b.DATA_LOADED,b.DATA_ERROR,b.DATA_FILE_CANCELLED,b.DATA_CHANGED,b.RUNNING_QUERY,b.QUERY_COMPLETE,b.QUERY_ERROR,b.LOADING_LOCALIZATION,b.LOCALIZATION_LOADED,b.LOCALIZATION_ERROR,b.REPORT_COMPLETE,b.REPORT_CHANGE,b.PRINT_START,b.PRINT_COMPLETE,b.EXPORT_START,b.EXPORT_COMPLETE,b.UPDATE,b.BEFORE_GRID_DRAW,b.AFTER_GRID_DRAW,b.CELL_CLICK,b.CELL_DOUBLE_CLICK,b.FILTER_OPEN,b.FILDS_LIST_OPEN,b.FILDS_LIST_CLOSE,b.BEFORE_TOOLBAR_CREATED];return b}(events.EventDispatcher);
d.JavaScriptHandlers=h})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){var h=function(){function d(){}d.valid=function(b){if(void 0==b)return!0;b=b.toLowerCase();return-1==b.indexOf("<script")&&-1==b.indexOf("javascript:")&&-1==b.indexOf("<iframe")&&-1==b.indexOf("<object")&&-1==b.indexOf("expression(")&&-1==b.indexOf("onmouseover")&&-1==b.indexOf("onerror")};d.validate=function(b,a){void 0===a&&(a=!1);return utils.StringUtils.escapeHtml(b,a)};return d}();d.XSSCheck=h})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){}b.getInstance=function(){null==b.instance&&(b.instance=new b);return b.instance};b.dispose=function(){b.instance=null};b.prototype.getData=function(){var a=d.data_.dataprovider_.DataProviderFactory.getDataProvider();return this.composeData(a)};b.prototype.selectData=function(a,c){var g=d.data_.Cube.getInstance(),b=d.data_.LocalDataStorage.clone(g.localDataStorage);b.slice_=a;b.filter();b.select();g=new d.data_.dataprovider_.ChartDataProvider;
g.reset();g.dataStorage=b;g.slice=a;g.load();b=this.composeData(g);c(b.toObject());g.reset()};b.prototype.composeData=function(a){var c=new h.OutputDataValueObject;if(void 0==a.slice)return c;c.slice=a.slice.toObject();c.meta={vAmount:a.slice.measures_.length,formats:[]};var g=0,b=0;if(a.dataLoaded&&!a.isEmpty){var d,l;d="on"==e._options.OptionsManager.showGrandTotals||"rows"==e._options.OptionsManager.showGrandTotals?a.dataWidth-1:a.dataWidth;l="on"==e._options.OptionsManager.showGrandTotals||"columns"==
e._options.OptionsManager.showGrandTotals?a.dataHeight-1:a.dataHeight;var f,r,n=NaN,p="",p="",q;c.data=[];f=[];r=[];q={};for(var t=0;t<a.measures.length;t++){n=a.measures.getItemAt(t);c.meta["v"+t+"Name"]=n.caption;var u=e.PivotModel.getInstance().getFormat(n.uniqueName);c.meta.formats.push(u);n=a.getValue(f,r,n);q["v"+t]=n}c.data.push(q);for(u=0;u<l;u++){q={};f=a.getRowTuple(u);g=Math.max(g,f.length);r=[];t=a.rowsOnly;for(n=0;n<f.length;n++){var v=n,p=t.getItemAt(v),x=f[n],x=p.members.getItemAt(x);
c.meta["r"+v+"Name"]=p.caption;p=this.getDataFromMember(x);q["r"+v]=p}for(t=0;t<a.measures.length;t++)n=a.measures.getItemAt(t),n=a.getValue(f,r,n),q["v"+t]=n;c.data.push(q)}for(var w=0;w<d;w++){q={};f=[];r=a.getColumnTuple(w);b=Math.max(b,r.length);t=a.columnsOnly;for(n=0;n<r.length;n++)v=n,p=t.getItemAt(v),x=r[n],x=p.members.getItemAt(x),c.meta["c"+v+"Name"]=p.caption,p=this.getDataFromMember(x),q["c"+v]=p;for(t=0;t<a.measures.length;t++)n=a.measures.getItemAt(t),n=a.getValue(f,r,n),q["v"+t]=n;
c.data.push(q)}for(u=0;u<l;u++)for(f=a.getRowTuple(u),g=Math.max(g,f.length),w=0;w<d;w++){r=a.getColumnTuple(w);b=Math.max(b,r.length);q={};t=a.rowsOnly;for(n=0;n<f.length;n++)v=n,p=t.getItemAt(v),x=f[n],x=p.members.getItemAt(x),p=this.getDataFromMember(x),q["r"+v]=p;t=a.columnsOnly;for(n=0;n<r.length;n++)v=n,p=t.getItemAt(v),x=r[n],x=p.members.getItemAt(x),p=this.getDataFromMember(x),q["c"+v]=p;for(t=0;t<a.measures.length;t++)n=a.measures.getItemAt(t),n=a.getValue(f,r,n),q["v"+t]=n;c.data.push(q)}}c.meta.rAmount=
g;c.meta.cAmount=b;return c};b.prototype.getDataFromMember=function(a){return a.level.type==d.data_.types.LevelType.NUMBER||a.level.type==d.data_.types.LevelType.TIME?a.levelOrdinal:a.level.type==d.data_.types.LevelType.TIME_DATE?Date.parse(a.caption):a.level.type==d.data_.types.LevelType.DAY?isNaN(parseFloat(a.caption))?a.caption:parseFloat(a.caption):a.caption};return b}();h.IntegrationDataManager=f})(e.integration||(e.integration={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){this.slice={};this.meta={};this.data=[]}b.prototype.toObject=function(){var a={},c;for(c in this)"slice"!=c&&"function"!==typeof this[c]&&(a[c]=this[c]);return a};return b}();d.OutputDataValueObject=e})(d.integration||(d.integration={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.DEFAULT_EXPORT_TITLE="WebDataRocks Reporting Tool";return b}();d.Labels=e})(d._labels||(d._labels={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.prototype.load=function(a,c,g){var b=this;this.successHandler=c;this.errorHandler=g;this.xhr=new XMLHttpRequest;this.xhr.open("GET",a,!0);this.xhr.onerror=function(c){return b.onError(c)};this.xhr.onreadystatechange=function(c){return b.onReadyStateChange(c)};this.xhr.send()};b.prototype.onReadyStateChange=function(a){null!=this.xhr&&4===this.xhr.readyState&&(200===this.xhr.status?this.success():this.errorHandler())};b.prototype.success=
function(){if(this.xhr.response&&null==this.xhr.response.error){if(null!=this.successHandler)this.onLoaded(this.xhr.response)}else this.errorHandler&&this.errorHandler()};b.prototype.onError=function(a){null!=this.errorHandler&&this.errorHandler()};b.prototype.onLoaded=function(a){try{var c=JSON.parse(a);this.successHandler(d.LabelsValueObject.fromObject(c))}catch(g){console.error(g),this.errorHandler()}};return b}();d.LabelsLoader=e})(d._labels||(d._labels={}))})(d.model||(d.model={}))})(pivot||
(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){if(null!=b.instance)throw Error("Singleton");this.defaults=new d.LabelsValueObject;this.defaults.setDefaults()}b.getInstance=function(){null==b.instance&&(b.instance=new b);return b.instance};b.dispose=function(){d.Labels.MONTHS_LABELS=null;d.Labels.MONTHS_LABELS_SHORT=null;d.Labels.WEEKDAYS_LABELS=null;d.Labels.WEEKDAYS_LABELS_SHORT=null;d.Labels.QUARTER_LABELS=null;b.instance.defaults=null;b.instance.globals=null;b.instance.reports=null;
b.instance=null};b.prototype.getReportLocalization=function(){return this.reports};b.prototype.setReportLocalization=function(a){this.reports!=a&&(this.reports=a,this.updateLabels())};b.prototype.updateLabels=function(){d.Labels.FIELDS_LIST_FLAT_HIERARCHY_BOX=this.getLabel("fieldsList/flatHierarchyBox");d.Labels.FIELDS_LIST_HIERARCHY_BOX=this.getLabel("fieldsList/hierarchyBox");d.Labels.FIELDS_LIST_FILTER_BOX=this.getLabel("fieldsList/filterBox");d.Labels.FIELDS_LIST_ROW_BOX=this.getLabel("fieldsList/rowBox");
d.Labels.FIELDS_LIST_COLUMN_BOX=this.getLabel("fieldsList/columnBox");d.Labels.FIELDS_LIST_MEASURE_BOX=this.getLabel("fieldsList/measureBox");d.Labels.FIELDS_LIST_VALUES=this.getLabel("fieldsList/values");d.Labels.FIELDS_LIST_ADD_CALCULATED_MEASURE=this.getLabel("fieldsList/addCalculatedMeasure");d.Labels.FIELDS_LIST_EXPAND_ALL=this.getLabel("fieldsList/expandAll");d.Labels.FIELDS_LIST_COLLAPSE_ALL=this.getLabel("fieldsList/collapseAll");d.Labels.FIELDS_LIST_FORMULAS_GROUP_NAME=this.getLabel("fieldsList/formulasGroupName");
d.Labels.FIELDS_LIST_ALL_FIELDS=this.getLabel("fieldsList/allFields");d.Labels.FIELDS_LIST_ROWS=this.getLabel("fieldsList/rows");d.Labels.FIELDS_LIST_COLUMNS=this.getLabel("fieldsList/columns");d.Labels.FIELDS_LIST_FILTERS=this.getLabel("fieldsList/filters");d.Labels.FIELDS_LIST_DROP_FIELD=this.getLabel("fieldsList/dropField");d.Labels.FIELDS_LIST_TITLE=this.getLabel("fieldsList/title");d.Labels.FIELDS_LIST_SUBTITLE=this.getLabel("fieldsList/subtitle");d.Labels.FILTER_ALL=this.getLabel("filter/all");
d.Labels.FILTER_MULTIPLE_ITEMS=this.getLabel("filter/multipleItems");d.Labels.FILTER_SELECT_ALL=this.getLabel("filter/selectAll");d.Labels.FILTER_SELECT_ALL_RESULTS=this.getLabel("filter/selectAllResults");d.Labels.FILTER_TOP=this.getLabel("filter/top");d.Labels.FILTER_BOTTOM=this.getLabel("filter/bottom");d.Labels.FILTER_ASC_SORT=this.getLabel("filter/ascSort");d.Labels.FILTER_DESC_SORT=this.getLabel("filter/descSort");d.Labels.FILTER_TOP_X=this.getLabel("filter/topX");d.Labels.FILTER_TOP_X_CLEAR=
this.getLabel("filter/clearTopX");d.Labels.FILTER_SEARCH=this.getLabel("filter/search");d.Labels.FILTER_AMOUNT_SELECTED=this.getLabel("filter/amountSelected");d.Labels.FILTER_AMOUNT_FOUND=this.getLabel("filter/amountFound");d.Labels.FILTER_SORT=this.getLabel("filter/sort");d.Labels.DRILL_THROUGH_TITLE=this.getLabel("drillThrough/title");d.Labels.DRILL_THROUGH_ROW=this.getLabel("drillThrough/row");d.Labels.DRILL_THROUGH_COLUMN=this.getLabel("drillThrough/column");d.Labels.DRILL_THROUGH_VALUE=this.getLabel("drillThrough/value");
d.Labels.CALCULATED_VIEW_TITLE=this.getLabel("calculatedView/title");d.Labels.CALCULATED_VIEW_MEASURE_BOX=this.getLabel("calculatedView/measureBox");d.Labels.CALCULATED_VIEW_MEASURE_NAME=this.getLabel("calculatedView/measureName");d.Labels.CALCULATED_VIEW_FORMULA=this.getLabel("calculatedView/formula");d.Labels.CALCULATED_VIEW_FORMULA_PROMPT=this.getLabel("calculatedView/formulaPrompt");d.Labels.CALCULATED_VIEW_CALCULATE_INDI_VALUES=this.getLabel("calculatedView/calculateIndividualValues");d.Labels.CALCULATED_VIEW_REMOVE_VALUE=
this.getLabel("calculatedView/removeValue");d.Labels.CALCULATED_VIEW_REMOVE_VALUE_TITLE=this.getLabel("calculatedView/removeValueTitle");d.Labels.CALCULATED_VIEW_REMOVE_VALUE_MESSAGE=this.getLabel("calculatedView/removeValueMessage");d.Labels.CALCULATED_VIEW_HEADER=this.getLabel("calculatedView/header");d.Labels.CALCULATED_VIEW_ALL_VALUES=this.getLabel("calculatedView/allValues");d.Labels.GRID_TOTAL=this.getLabel("grid/total");d.Labels.GRID_TOTALS=this.getLabel("grid/totals");d.Labels.GRID_GRAND_TOTAL=
this.getLabel("grid/grandTotal");d.Labels.MEMBER_BLANK=this.getLabel("grid/blankMember");d.Labels.INVALID_DATE=this.getLabel("grid/dateInvalidCaption");d.Labels.TOOLTIPS_ROW=this.getLabel("tooltips/row");d.Labels.TOOLTIPS_COLUMN=this.getLabel("tooltips/column");d.Labels.TOOLTIPS_HEADER_RESIZE=this.getLabel("tooltips/headerResize");d.Labels.TOOLTIPS_HEADER_FIT=this.getLabel("tooltips/headerFit");d.Labels.TOOLTIPS_FILTER_ICON=this.getLabel("tooltips/filterIcon");d.Labels.TOOLTIPS_FILTERED=this.getLabel("tooltips/filtered");
d.Labels.TOOLTIPS_EXPAND_ICON=this.getLabel("tooltips/expandIcon");d.Labels.TOOLTIPS_COLLAPSE_ICON=this.getLabel("tooltips/collapseIcon");d.Labels.TOOLTIPS_DRILL_DOWN=this.getLabel("tooltips/drillDown");d.Labels.TOOLTIPS_DRILL_UP=this.getLabel("tooltips/drillUp");d.Labels.TOOLTIPS_SORT_ICON=this.getLabel("tooltips/sortIcon");d.Labels.TOOLTIPS_SORTED_DESC=this.getLabel("tooltips/sortedDescIcon");d.Labels.TOOLTIPS_SORTED_ASC=this.getLabel("tooltips/sortedAscIcon");d.Labels.TOOLTIPS_CLOSE=this.getLabel("tooltips/close");
d.Labels.SUM_CAPTION=this.getLabel("aggregations/sum/caption");d.Labels.SUM_TOTAL_CAPTION=this.getLabel("aggregations/sum/totalCaption");d.Labels.SUM_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/sum/grandTotalCaption");d.Labels.COUNT_CAPTION=this.getLabel("aggregations/count/caption");d.Labels.COUNT_TOTAL_CAPTION=this.getLabel("aggregations/count/totalCaption");d.Labels.COUNT_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/count/grandTotalCaption");d.Labels.DISTINCT_COUNT_CAPTION=this.getLabel("aggregations/distinctCount/caption");
d.Labels.DISTINCT_COUNT_TOTAL_CAPTION=this.getLabel("aggregations/distinctCount/totalCaption");d.Labels.DISTINCT_COUNT_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/distinctCount/grandTotalCaption");d.Labels.DIFFERENCE_CAPTION=this.getLabel("aggregations/difference/caption");d.Labels.DIFFERENCE_TOTAL_CAPTION=this.getLabel("aggregations/difference/totalCaption");d.Labels.DIFFERENCE_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/difference/grandTotalCaption");d.Labels.PERCENT_DIFFERENCE_CAPTION=
this.getLabel("aggregations/percentDifference/caption");d.Labels.PERCENT_DIFFERENCE_TOTAL_CAPTION=this.getLabel("aggregations/percentDifference/totalCaption");d.Labels.PERCENT_DIFFERENCE_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/percentDifference/grandTotalCaption");d.Labels.AVERAGE_CAPTION=this.getLabel("aggregations/average/caption");d.Labels.AVERAGE_TOTAL_CAPTION=this.getLabel("aggregations/average/totalCaption");d.Labels.AVERAGE_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/average/grandTotalCaption");
d.Labels.PRODUCT_CAPTION=this.getLabel("aggregations/product/caption");d.Labels.PRODUCT_TOTAL_CAPTION=this.getLabel("aggregations/product/totalCaption");d.Labels.PRODUCT_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/product/grandTotalCaption");d.Labels.MIN_CAPTION=this.getLabel("aggregations/min/caption");d.Labels.MIN_TOTAL_CAPTION=this.getLabel("aggregations/min/totalCaption");d.Labels.MIN_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/min/grandTotalCaption");d.Labels.MAX_CAPTION=this.getLabel("aggregations/max/caption");
d.Labels.MAX_TOTAL_CAPTION=this.getLabel("aggregations/max/totalCaption");d.Labels.MAX_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/max/grandTotalCaption");d.Labels.PERCENT_CAPTION=this.getLabel("aggregations/percent/caption");d.Labels.PERCENT_TOTAL_CAPTION=this.getLabel("aggregations/percent/totalCaption");d.Labels.PERCENT_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/percent/grandTotalCaption");d.Labels.PERCENT_COLUMN_CAPTION=this.getLabel("aggregations/percentOfColumn/caption");d.Labels.PERCENT_COLUMN_TOTAL_CAPTION=
this.getLabel("aggregations/percentOfColumn/totalCaption");d.Labels.PERCENT_COLUMN_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/percentOfColumn/grandTotalCaption");d.Labels.PERCENT_ROW_CAPTION=this.getLabel("aggregations/percentOfRow/caption");d.Labels.PERCENT_ROW_TOTAL_CAPTION=this.getLabel("aggregations/percentOfRow/totalCaption");d.Labels.PERCENT_ROW_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/percentOfRow/grandTotalCaption");d.Labels.INDEX_CAPTION=this.getLabel("aggregations/index/caption");
d.Labels.INDEX_TOTAL_CAPTION=this.getLabel("aggregations/index/totalCaption");d.Labels.INDEX_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/index/grandTotalCaption");d.Labels.NONE_CAPTION=this.getLabel("aggregations/none/caption");d.Labels.MEDIAN_CAPTION=this.getLabel("aggregations/median/caption");d.Labels.MEDIAN_TOTAL_CAPTION=this.getLabel("aggregations/median/totalCaption");d.Labels.MEDIAN_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/median/grandTotalCaption");d.Labels.STDEVP_CAPTION=this.getLabel("aggregations/stdevp/caption");
d.Labels.STDEVP_TOTAL_CAPTION=this.getLabel("aggregations/stdevp/totalCaption");d.Labels.STDEVP_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/stdevp/grandTotalCaption");d.Labels.STDEVS_CAPTION=this.getLabel("aggregations/stdevs/caption");d.Labels.STDEVS_TOTAL_CAPTION=this.getLabel("aggregations/stdevs/totalCaption");d.Labels.STDEVS_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/stdevs/grandTotalCaption");d.Labels.RUNNING_TOTALS_CAPTION=this.getLabel("aggregations/runningTotals/caption");d.Labels.RUNNING_TOTALS_TOTAL_CAPTION=
this.getLabel("aggregations/runningTotals/totalCaption");d.Labels.RUNNING_TOTALS_GRAND_TOTAL_CAPTION=this.getLabel("aggregations/runningTotals/grandTotalCaption");d.Labels.ERROR=this.getLabel("messages/error");d.Labels.WARNING=this.getLabel("messages/warning");d.Labels.LIMITATION=this.getLabel("messages/limitation");d.Labels.BROWSE=this.getLabel("messages/browse");d.Labels.CONFIRMATION=this.getLabel("messages/confirmation");d.Labels.REPORT_FILE_TYPE=this.getLabel("messages/reportFileType");d.Labels.MESSAGE_LOADING=
this.getLabel("messages/loading");d.Labels.MESSAGE_LOADING_CONFIGURATION=this.getLabel("messages/loadingConfiguration");d.Labels.MESSAGE_LOADING_DATA=this.getLabel("messages/loadingData");d.Labels.MESSAGE_LOADING_WAITING=this.getLabel("messages/waiting");d.Labels.MESSAGE_LOADING_PROGRESS=this.getLabel("messages/progress");d.Labels.MESSAGE_LOADING_PROGRESS_UNKNOWN=this.getLabel("messages/progressUnknown");d.Labels.MESSAGE_ANALYZING_DATA=this.getLabel("messages/analyzing");d.Labels.MESSAGE_ANALYZING_PROGRESS=
this.getLabel("messages/analyzingProgress");d.Labels.MESSAGE_ANALYZING_RECORDS=this.getLabel("messages/analyzingRecords");d.Labels.MESSAGE_SAVING=this.getLabel("messages/saving");d.Labels.MESSAGE_LOADING_DIMENSIONS=this.getLabel("messages/loadingDimensions");d.Labels.MESSAGE_LOADING_HIERARCHIES=this.getLabel("messages/loadingHierarchies");d.Labels.MESSAGE_LOADING_MEASURES=this.getLabel("messages/loadingMeasures");d.Labels.MESSAGE_LOADING_MEMBERS=this.getLabel("messages/loadingMembers");d.Labels.MESSAGE_LOADING_LEVELS=
this.getLabel("messages/loadingLevels");d.Labels.MESSAGE_FULLSCREEN=this.getLabel("messages/fullscreen");d.Labels.MESSAGE_EXPORT_COMPLETE=this.getLabel("messages/exportComplete");d.Labels.MESSAGE_EXPORT_PROGRESS=this.getLabel("messages/exportProgress");d.Labels.MESSAGE_EXPORT_ERROR=this.getLabel("messages/exportError");d.Labels.MESSAGE_GENERATING_PDF=this.getLabel("messages/generatingPDF");d.Labels.MESSAGE_PLEASE_WAIT=this.getLabel("messages/pleaseWait");d.Labels.MESSAGE_PAGES_WERE_GENERATED=this.getLabel("messages/pagesWereGenerated");
d.Labels.MESSAGE_UPLOADING=this.getLabel("messages/uploading");d.Labels.MESSAGE_CANT_SAVE_FILE=this.getLabel("messages/cantSaveFile");d.Labels.MESSAGE_CANT_WRITE_TO_CLIPBOARD=this.getLabel("messages/cantSaveToClipboard");d.Labels.MESSAGE_SAVE_REPORT_TO_FILE=this.getLabel("messages/saveReportToFile");d.Labels.MESSAGE_LOAD_REPORT_FROM_FILE=this.getLabel("messages/loadReportFromFile");d.Labels.MESSAGE_INPUT_NEW_NAME=this.getLabel("messages/inputNewName");d.Labels.MESSAGE_INPUT_REPORT_NAME=this.getLabel("messages/inputReportName");
d.Labels.MESSAGE_INVALID_DATASOURCE=this.getLabel("messages/invalidDataSource");d.Labels.MESSAGE_DATA_STREAM_ERROR=this.getLabel("messages/dataStreamError");d.Labels.MESSAGE_UNABLE_TO_OPEN_FILE=this.getLabel("messages/unableToOpenFile");d.Labels.MESSAGE_DOUBLE_FILE_BROWSING_SESSION=this.getLabel("messages/unableTwoFileBrowsingSessions");d.Labels.MESSAGE_INAPPROPRIATE_FILE_FORMAT=this.getLabel("messages/inappropriateFileFormat");d.Labels.MESSAGE_INVALID_JSON_DATA=this.getLabel("messages/invalidJSONdata");
d.Labels.MESSAGE_WRONG_FORMULA_FORMAT=this.getLabel("messages/wrongFormulaFormat");d.Labels.MESSAGE_EXCEL_PDF_EXPORT_LIMITATION=this.getLabel("messages/excelPdfExportLimitation");d.Labels.MESSAGE_EXPORT_LIMITATION=this.getLabel("messages/excelExportLimitation");d.Labels.MESSAGE_NO_DATA_AVAILABLE=this.getLabel("messages/noDataAvailable");d.Labels.MESSAGE_SAVE_DATA_TO_FILE=this.getLabel("messages/saveDataToFile");d.Labels.MESSAGE_DATA_WAS_UPDATED=this.getLabel("messages/dataWasUpdated");d.Labels.MESSAGE_OCSV_INCOMPATIBLE=
this.getLabel("messages/ocsvIncompatible");d.Labels.MESSAGE_UNKNOWN_ERROR=this.getLabel("messages/unknownError");d.Labels.MESSAGE_INVALID_REPORT_FORMAT=this.getLabel("messages/invalidReportFormat");d.Labels.MESSAGE_CSV_HEADER_PARSING_ERROR=this.getLabel("messages/csvHeaderParsingError");d.Labels.MESSAGE_TOO_MANY_COLUMNS_IN_CLASSIC_MODE=this.getLabel("messages/tooManyColumnsInClassicMode");d.Labels.MESSAGE_CANT_EXPAND=this.getLabel("messages/cantExpand");d.Labels.MESSAGE_CANT_EXPAND_TITLE=this.getLabel("messages/cantExpandTitle");
d.Labels.MESSAGE_NO_GOOGLE_CLIENT_KEY=this.getLabel("messages/noGoogleClientKey");d.Labels.BUTTON_OK=this.getLabel("buttons/ok");d.Labels.BUTTON_APPLY=this.getLabel("buttons/apply");d.Labels.BUTTON_CANCEL=this.getLabel("buttons/cancel");d.Labels.BUTTON_SAVE=this.getLabel("buttons/save");d.Labels.BUTTON_CLEAR=this.getLabel("buttons/clear");d.Labels.BUTTON_SELECT=this.getLabel("buttons/select");d.Labels.BUTTON_YES=this.getLabel("buttons/yes");d.Labels.BUTTON_NO=this.getLabel("buttons/no");d.Labels.CONTEXT_MENU_CLEAR_SORTING=
this.getLabel("contextMenu/clearSorting");d.Labels.CONTEXT_MENU_COLLAPSE=this.getLabel("contextMenu/collapse");d.Labels.CONTEXT_MENU_DRILL_THROUGH=this.getLabel("contextMenu/drillThrough");d.Labels.CONTEXT_MENU_EXPAND=this.getLabel("contextMenu/expand");d.Labels.CONTEXT_MENU_OPEN_FILTER=this.getLabel("contextMenu/openFilter");d.Labels.CONTEXT_MENU_SORT_COLUMN_ASC=this.getLabel("contextMenu/sortColumnAsc");d.Labels.CONTEXT_MENU_SORT_COLUMN_DESC=this.getLabel("contextMenu/sortColumnDesc");d.Labels.CONTEXT_MENU_SORT_ROW_ASC=
this.getLabel("contextMenu/sortRowAsc");d.Labels.CONTEXT_MENU_SORT_ROW_DESC=this.getLabel("contextMenu/sortRowDesc");d.Labels.YEAR=this.getLabel("date/year");d.Labels.QUARTER=this.getLabel("date/quarter");d.Labels.MONTH=this.getLabel("date/month");d.Labels.DAY=this.getLabel("date/day");d.Labels.QUARTER_LABELS=[this.getLabel("quarters/q1"),this.getLabel("quarters/q2"),this.getLabel("quarters/q3"),this.getLabel("quarters/q4")];d.Labels.MONTHS_LABELS=[this.getLabel("months/january"),this.getLabel("months/february"),
this.getLabel("months/march"),this.getLabel("months/april"),this.getLabel("months/may"),this.getLabel("months/june"),this.getLabel("months/july"),this.getLabel("months/august"),this.getLabel("months/september"),this.getLabel("months/october"),this.getLabel("months/november"),this.getLabel("months/december")];d.Labels.MONTHS_LABELS_SHORT=[this.getLabel("monthsShort/january"),this.getLabel("monthsShort/february"),this.getLabel("monthsShort/march"),this.getLabel("monthsShort/april"),this.getLabel("monthsShort/may"),
this.getLabel("monthsShort/june"),this.getLabel("monthsShort/july"),this.getLabel("monthsShort/august"),this.getLabel("monthsShort/september"),this.getLabel("monthsShort/october"),this.getLabel("monthsShort/november"),this.getLabel("monthsShort/december")];d.Labels.WEEKDAYS_LABELS=[this.getLabel("weekdays/first"),this.getLabel("weekdays/second"),this.getLabel("weekdays/third"),this.getLabel("weekdays/fourth"),this.getLabel("weekdays/fifth"),this.getLabel("weekdays/sixth"),this.getLabel("weekdays/seventh")];
d.Labels.WEEKDAYS_LABELS_SHORT=[this.getLabel("weekdaysShort/first"),this.getLabel("weekdaysShort/second"),this.getLabel("weekdaysShort/third"),this.getLabel("weekdaysShort/fourth"),this.getLabel("weekdaysShort/fifth"),this.getLabel("weekdaysShort/sixth"),this.getLabel("weekdaysShort/seventh")];utils.DateFormat.setDayNames(d.Labels.WEEKDAYS_LABELS,d.Labels.WEEKDAYS_LABELS_SHORT);utils.DateFormat.setMonthNames(d.Labels.MONTHS_LABELS,d.Labels.MONTHS_LABELS_SHORT)};b.prototype.getLabel=function(a){if(!1==
utils.nullOrUndefined(this.reports)){var c=this.reports.getLabel(a);if(!1==utils.nullOrUndefined(c))return c}return!1==utils.nullOrUndefined(this.globals)&&(c=this.globals.getLabel(a),!1==utils.nullOrUndefined(c))?c:this.defaults.getLabel(a)};b.prototype.reset=function(){this.reports=null;this.updateLabels()};b.prototype.load=function(a,c,g){var b=this;void 0===g&&(g=!1);try{if("string"==typeof a&&!1==utils.nullOrEmpty(a))(new d.LabelsLoader).load(utils.URLUtils.getUrl(a,!0),function(a){b.onLoadingComplete(a,
g);null!=c&&c(!0)},function(){null!=c&&c(!1)});else{if(a instanceof Object)this.onLoadingComplete(d.LabelsValueObject.fromObject(a),g);else this.reset();null!=c&&c(!0)}}catch(k){console.error(k),null!=c&&c(!1)}};b.prototype.onLoadingComplete=function(a,c){void 0===c&&(c=!1);c?this.globals=a:this.reports=a;this.updateLabels()};b.prototype.generateLocalization=function(){var a=new d.LabelsValueObject;a.setDefaults();a.merge(this.globals);return a.toObject()};b.prototype.getCurrentLocalization=function(){var a=
new d.LabelsValueObject;a.setDefaults();a.merge(this.globals);this.reports&&a.merge(this.reports);return a};return b}();d.LabelsManager=e})(d._labels||(d._labels={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){this.fieldsList={flatHierarchyBox:null,hierarchyBox:null,filterBox:null,rowBox:null,columnBox:null,measureBox:null,values:null,addCalculatedMeasure:null,expandAll:null,collapseAll:null,formulasGroupName:null,allFields:null,rows:null,columns:null,filters:null,dropField:null,title:null,subtitle:null};this.filter={all:null,multipleItems:null,selectAll:null,selectAllResults:null,top:null,bottom:null,ascSort:null,descSort:null,topX:null,
clearTopX:null,measuresPrompt:null,search:null,amountSelected:null,amountFound:null,sort:null};this.drillThrough={title:null,row:null,column:null,value:null};this.calculatedView={title:null,measureBox:null,measureName:null,formula:null,formulaPrompt:null,calculateIndividualValues:null,removeValue:null,removeValueTitle:null,removeValueMessage:null,header:null,allValues:null};this.grid={total:null,totals:null,grandTotal:null,blankMember:null,dateInvalidCaption:null};this.tooltips={row:null,column:null,
headerResize:null,headerFit:null,filterIcon:null,filtered:null,expandIcon:null,collapseIcon:null,drillDown:null,drillUp:null,sortIcon:null,sortedDescIcon:null,sortedAscIcon:null,close:null};this.aggregations={sum:{caption:null,totalCaption:null,grandTotalCaption:null},count:{caption:null,totalCaption:null,grandTotalCaption:null},distinctCount:{caption:null,totalCaption:null,grandTotalCaption:null},difference:{caption:null,totalCaption:null,grandTotalCaption:null},percentDifference:{caption:null,totalCaption:null,
grandTotalCaption:null},average:{caption:null,totalCaption:null,grandTotalCaption:null},product:{caption:null,totalCaption:null,grandTotalCaption:null},min:{caption:null,totalCaption:null,grandTotalCaption:null},max:{caption:null,totalCaption:null,grandTotalCaption:null},percent:{caption:null,totalCaption:null,grandTotalCaption:null},percentOfColumn:{caption:null,totalCaption:null,grandTotalCaption:null},percentOfRow:{caption:null,totalCaption:null,grandTotalCaption:null},index:{caption:null,totalCaption:null,
grandTotalCaption:null},none:{caption:null},median:{caption:null,totalCaption:null,grandTotalCaption:null},stdevp:{caption:null,totalCaption:null,grandTotalCaption:null},stdevs:{caption:null,totalCaption:null,grandTotalCaption:null},runningTotals:{caption:null,totalCaption:null,grandTotalCaption:null}};this.messages={error:null,warning:null,limitation:null,browse:null,confirmation:null,reportFileType:null,loading:null,loadingConfiguration:null,loadingData:null,waiting:null,progress:null,progressUnknown:null,
analyzing:null,analyzingProgress:null,analyzingRecords:null,saving:null,loadingDimensions:null,loadingHierarchies:null,loadingMeasures:null,loadingMembers:null,loadingLevels:null,loadingProperties:null,fullscreen:null,exportComplete:null,exportProgress:null,exportError:null,generatingPDF:null,pleaseWait:null,pagesWereGenerated:null,uploading:null,cantSaveFile:null,cantSaveToClipboard:null,saveReportToFile:null,loadReportFromFile:null,inputNewName:null,inputReportName:null,invalidDataSource:null,dataStreamError:null,
unableToOpenFile:null,unableTwoFileBrowsingSessions:null,noGoogleClientKey:null,inappropriateFileFormat:null,invalidJSONdata:null,wrongFormulaFormat:null,excelPdfExportLimitation:null,excelExportLimitation:null,noDataAvailable:null,saveDataToFile:null,dataWasUpdated:null,ocsvIncompatible:null,unknownError:null,invalidReportFormat:null,csvHeaderParsingError:null,tooManyColumnsInClassicMode:null,cantExpand:null,cantExpandTitle:null};this.buttons={ok:null,apply:null,cancel:null,save:null,clear:null,
select:null,yes:null,no:null};this.contextMenu={clearSorting:null,collapse:null,drillThrough:null,expand:null,openFilter:null,sortColumnAsc:null,sortColumnDesc:null,sortRowAsc:null,sortRowDesc:null};this.date={year:null,quarter:null,month:null,day:null};this.quarters={q1:null,q2:null,q3:null,q4:null};this.months={january:null,february:null,march:null,april:null,may:null,june:null,july:null,august:null,september:null,october:null,november:null,december:null};this.monthsShort={january:null,february:null,
march:null,april:null,may:null,june:null,july:null,august:null,september:null,october:null,november:null,december:null};this.weekdays={first:null,second:null,third:null,fourth:null,fifth:null,sixth:null,seventh:null};this.weekdaysShort={first:null,second:null,third:null,fourth:null,fifth:null,sixth:null,seventh:null};this.toolbar={connect:null,connect_local_csv:null,connect_local_json:null,connect_remote_csv:null,connect_remote_csv_mobile:null,connect_remote_json:null,connect_remote_json_mobile:null,
connect_google_drive:null,open:null,local_report:null,remote_report:null,remote_report_mobile:null,save:null,save_json:null,load_json:null,grid:null,grid_flat:null,grid_classic:null,grid_compact:null,format:null,format_cells:null,format_cells_mobile:null,conditional_formatting:null,conditional_formatting_mobile:null,options:null,fullscreen:null,minimize:null,"export":null,export_print:null,export_html:null,export_csv:null,export_excel:null,export_image:null,export_pdf:null,fields:null,ok:null,apply:null,
done:null,cancel:null,value:null,"delete":null,"if":null,then:null,open_remote_csv:null,open_remote_json:null,csv:null,open_remote_report:null,choose_value:null,text_align:null,align_left:null,align_right:null,none:null,space:null,thousand_separator:null,decimal_separator:null,decimal_places:null,currency_symbol:null,currency_align:null,null_value:null,is_percent:null,true_value:null,false_value:null,conditional:null,add_condition:null,less_than:null,less_than_or_equal:null,greater_than:null,greater_than_or_equal:null,
equal_to:null,not_equal_to:null,between:null,is_empty:null,all_values:null,and:null,and_symbole:null,cp_text:null,cp_highlight:null,layout_options:null,layout:null,compact_view:null,classic_view:null,flat_view:null,grand_totals:null,grand_totals_off:null,grand_totals_on:null,grand_totals_on_rows:null,grand_totals_on_columns:null,subtotals:null,subtotals_off:null,subtotals_on:null,subtotals_on_rows:null,subtotals_on_columns:null,choose_page_orientation:null,landscape:null,portrait:null,message_error:null,
message_no_google_client_id:null}}b.prototype.setDefaults=function(){this.fieldsList.flatHierarchyBox="Select and arrange columns";this.fieldsList.hierarchyBox="Drag Dimensions";this.fieldsList.filterBox="Drop & Arrange Report Filter";this.fieldsList.rowBox="Drop & Arrange Rows";this.fieldsList.columnBox="Drop & Arrange Columns";this.fieldsList.measureBox="Drop & Arrange Values";this.fieldsList.values="Values";this.fieldsList.allFields="All Fields";this.fieldsList.rows="Rows";this.fieldsList.columns=
"Columns";this.fieldsList.filters="Report Filters";this.fieldsList.dropField="Drop field here";this.fieldsList.addCalculatedMeasure="Add calculated value";this.fieldsList.expandAll="Expand All";this.fieldsList.collapseAll="Collapse All";this.fieldsList.formulasGroupName="Calculated Values";this.fieldsList.title="Fields";this.fieldsList.subtitle="Drag and drop fields to arrange";this.filter.ascSort="Az";this.filter.descSort="zA";this.filter.topX="Top 10";this.filter.clearTopX="Clear";this.filter.top=
"Top";this.filter.bottom="Bottom";this.filter.measuresPrompt="Choose value";this.filter.search="Search";this.filter.selectAll="Select All";this.filter.selectAllResults="Select All Results";this.filter.amountSelected="{0} of {1} selected";this.filter.amountFound="{0} of {1} found are selected";this.filter.multipleItems="Multiple Items";this.filter.all="All";this.filter.sort="Sort:";this.drillThrough.title="Details";this.drillThrough.row="Row: <b>{0}</b>";this.drillThrough.column="Column: <b>{0}</b>";
this.drillThrough.value="{0}: <b>{1}</b>";this.calculatedView.title="Calculated Value";this.calculatedView.measureBox="Drag values to formula";this.calculatedView.measureName="Value name";this.calculatedView.formula="Formula";this.calculatedView.formulaPrompt="Drop values and edit formula here";this.calculatedView.calculateIndividualValues="Calculate individual values";this.calculatedView.removeValue="Remove";this.calculatedView.removeValueTitle="Remove {0}?";this.calculatedView.removeValueMessage=
"Are you sure you want to remove this calculated value?";this.calculatedView.header="Add calculated value";this.calculatedView.allValues="All values";this.grid.total="Total";this.grid.totals="Totals";this.grid.grandTotal="Grand Total";this.grid.blankMember="(blank)";this.grid.dateInvalidCaption="Invalid date";this.tooltips.row="Row:";this.tooltips.column="Column:";this.tooltips.headerResize="Drag to resize";this.tooltips.headerFit="Double click to fit";this.tooltips.filterIcon="Click to filter";this.tooltips.filtered=
"Filtered";this.tooltips.expandIcon="Click to expand";this.tooltips.collapseIcon="Click to collapse";this.tooltips.drillDown="Click to drill down";this.tooltips.drillUp="Click to drill up";this.tooltips.sortIcon="Click to sort Desc";this.tooltips.sortedDescIcon="Click to sort Asc";this.tooltips.sortedAscIcon="Click to sort Desc";this.tooltips.close="Click to close";this.aggregations.sum.caption="Sum";this.aggregations.sum.totalCaption="Sum of {0}";this.aggregations.sum.grandTotalCaption="Total Sum of {0}";
this.aggregations.count.caption="Count";this.aggregations.count.totalCaption="Count of {0}";this.aggregations.count.grandTotalCaption="Total Count of {0}";this.aggregations.distinctCount.caption="Distinct Count";this.aggregations.distinctCount.totalCaption="Distinct Count of {0}";this.aggregations.distinctCount.grandTotalCaption="Total Distinct Count of {0}";this.aggregations.average.caption="Average";this.aggregations.average.totalCaption="Average of {0}";this.aggregations.average.grandTotalCaption=
"Total Average of {0}";this.aggregations.product.caption="Product";this.aggregations.product.totalCaption="Product of {0}";this.aggregations.product.grandTotalCaption="Total Product of {0}";this.aggregations.min.caption="Min";this.aggregations.min.totalCaption="Min of {0}";this.aggregations.min.grandTotalCaption="Total Min of {0}";this.aggregations.max.caption="Max";this.aggregations.max.totalCaption="Max of {0}";this.aggregations.max.grandTotalCaption="Total Max of {0}";this.aggregations.percent.caption=
"% of Grand Total";this.aggregations.percent.totalCaption="% of Grand Total of {0}";this.aggregations.percent.grandTotalCaption="Total % of Grand Total of {0}";this.aggregations.percentOfColumn.caption="% of Column";this.aggregations.percentOfColumn.totalCaption="% of Column of {0}";this.aggregations.percentOfColumn.grandTotalCaption="Total % of Column of {0}";this.aggregations.percentOfRow.caption="% of Row";this.aggregations.percentOfRow.totalCaption="% of Row of {0}";this.aggregations.percentOfRow.grandTotalCaption=
"Total % of Row of {0}";this.aggregations.index.caption="Index";this.aggregations.index.totalCaption="Index of {0}";this.aggregations.index.grandTotalCaption="Index of {0}";this.aggregations.difference.caption="Difference";this.aggregations.difference.totalCaption="Difference of {0}";this.aggregations.difference.grandTotalCaption="Difference of {0}";this.aggregations.percentDifference.caption="% Difference";this.aggregations.percentDifference.totalCaption="% Difference of {0}";this.aggregations.percentDifference.grandTotalCaption=
"% Difference of {0}";this.aggregations.none.caption="No Calculation";this.aggregations.median.caption="Median";this.aggregations.median.totalCaption="Median of {0}";this.aggregations.median.grandTotalCaption="Total Median of {0}";this.aggregations.stdevp.caption="Population StDev";this.aggregations.stdevp.totalCaption="Population StDev of {0}";this.aggregations.stdevp.grandTotalCaption="Total Population StDev of {0}";this.aggregations.stdevs.caption="Sample StDev";this.aggregations.stdevs.totalCaption=
"Sample StDev of {0}";this.aggregations.stdevs.grandTotalCaption="Total Sample StDev of {0}";this.aggregations.runningTotals.caption="Running Totals";this.aggregations.runningTotals.totalCaption="Running Totals of {0}";this.aggregations.runningTotals.grandTotalCaption="Running Totals of {0}";this.messages.error="Error!";this.messages.warning="Warning!";this.messages.limitation="Limitation!";this.messages.browse="Browse";this.messages.confirmation="Confirmation";this.messages.reportFileType="WebDataRocks report file";
this.messages.loading="Loading...";this.messages.loadingConfiguration="";this.messages.loadingData="Loading data...";this.messages.uploading="Uploading...";this.messages.waiting="Waiting for the response {0} sec.";this.messages.progress="{0}K";this.messages.progressUnknown="loaded {0}K";this.messages.analyzing="Analyzing data...";this.messages.analyzingProgress="{0} records of {1} ({2}%)";this.messages.analyzingRecords="{0} records";this.messages.saving="Saving...";this.messages.loadingDimensions=
"Loading dimensions...";this.messages.loadingHierarchies="Loading hierarchies...";this.messages.loadingMeasures="Loading measures...";this.messages.loadingMembers="Loading members...";this.messages.loadingLevels="Loading levels...";this.messages.fullscreen="Open report in full screen?";this.messages.exportComplete='Export data is created, please click "Save" button to save the _data.';this.messages.generatingPDF="Generating PDF";this.messages.pleaseWait="Please wait.";this.messages.pagesWereGenerated=
"pages were generated.";this.messages.exportProgress="Export in progress...";this.messages.exportError="Failed to export. An unexpected error occurred.";this.messages.cantSaveFile="Cannot save file.";this.messages.cantSaveToClipboard="Error: Cannot write to the clipboard.";this.messages.saveReportToFile='Report is ready to be saved to file, please click "Save" button to save the report.';this.messages.saveDataToFile='Data is ready to be saved to file, please click "Save" button to save the file.';
this.messages.loadReportFromFile="Select report file to be loaded.";this.messages.inputNewName="Input new name";this.messages.inputReportName="Please input report name";this.messages.dataStreamError="Stream error occurred while loading '{0}'";this.messages.unableToOpenFile="Unable to open file {0}.<br/><br/>It seems that this file doesn't exist or 'Access-Control-Allow-Origin' header is absent in the resource requested.";this.messages.unableTwoFileBrowsingSessions="Browse file dialog is already opened.";
this.messages.noGoogleClientKey="Please enter Google Client Key in index.html file.";this.messages.wrongFormulaFormat="Wrong formula format. Please check.";this.messages.inappropriateFileFormat="The data file is of inappropriate format.";this.messages.invalidJSONdata="JSON data is invalid.";this.messages.excelPdfExportLimitation="Export to Microsoft Excel or PDF is not available in the current edition.";this.messages.excelExportLimitation="Export is not available in the current edition.";this.messages.noDataAvailable=
"Data source is empty. Please check the CSV file.";this.messages.csvHeaderParsingError="CSV header parsing error.";this.messages.dataWasUpdated="Data source has been updated on the server. Refresh the report?";this.messages.ocsvIncompatible="Unable to read data source. It seems that OCSV file was compressed with a newer version. Please update the component to version {0} or newer.";this.messages.unknownError="Unknown error occurred.";this.messages.invalidReportFormat="Invalid report format or access to file is denied.";
this.messages.tooManyColumnsInClassicMode="Too many columns for classic form. Switched layout to compact form.";this.messages.cantExpand="Some fields cannot be expanded. Please narrow down the data set.";this.messages.cantExpandTitle="Data set is too large";this.buttons.ok="OK";this.buttons.apply="Apply";this.buttons.cancel="Cancel";this.buttons.save="Save";this.buttons.clear="Clear";this.buttons.select="Select";this.buttons.yes="Yes";this.buttons.no="No";this.contextMenu.drillThrough="Drill through";
this.contextMenu.openFilter="Open filter";this.contextMenu.collapse="Collapse";this.contextMenu.expand="Expand";this.contextMenu.sortRowDesc="Sort row desc";this.contextMenu.sortRowAsc="Sort row asc";this.contextMenu.clearSorting="Clear sorting";this.contextMenu.sortColumnDesc="Sort column desc";this.contextMenu.sortColumnAsc="Sort column asc";this.date.year="Year";this.date.quarter="Quarter";this.date.month="Month";this.date.day="Day";this.quarters.q1="Quarter 1";this.quarters.q2="Quarter 2";this.quarters.q3=
"Quarter 3";this.quarters.q4="Quarter 4";this.months.january="January";this.months.february="February";this.months.march="March";this.months.april="April";this.months.may="May";this.months.june="June";this.months.july="July";this.months.august="August";this.months.september="September";this.months.october="October";this.months.november="November";this.months.december="December";this.monthsShort.january="Jan";this.monthsShort.february="Feb";this.monthsShort.march="Mar";this.monthsShort.april="Apr";
this.monthsShort.may="May";this.monthsShort.june="Jun";this.monthsShort.july="Jul";this.monthsShort.august="Aug";this.monthsShort.september="Sep";this.monthsShort.october="Oct";this.monthsShort.november="Nov";this.monthsShort.december="Dec";this.weekdays.first="Sunday";this.weekdays.second="Monday";this.weekdays.third="Tuesday";this.weekdays.fourth="Wednesday";this.weekdays.fifth="Thursday";this.weekdays.sixth="Friday";this.weekdays.seventh="Saturday";this.weekdaysShort.first="Sun";this.weekdaysShort.second=
"Mon";this.weekdaysShort.third="Tue";this.weekdaysShort.fourth="Wed";this.weekdaysShort.fifth="Thu";this.weekdaysShort.sixth="Fri";this.weekdaysShort.seventh="Sat";this.toolbar.connect="Connect";this.toolbar.connect_local_csv="To local CSV";this.toolbar.connect_local_json="To local JSON";this.toolbar.connect_google_drive="To Google Drive";this.toolbar.connect_remote_csv="To remote CSV";this.toolbar.connect_remote_csv_mobile="CSV";this.toolbar.connect_remote_json="To remote JSON";this.toolbar.connect_remote_json_mobile=
"JSON";this.toolbar.open="Open";this.toolbar.local_report="Local report";this.toolbar.remote_report="Remote report";this.toolbar.remote_report_mobile="Report";this.toolbar.save="Save";this.toolbar.load_json="JSON report";this.toolbar.grid="Grid";this.toolbar.grid_flat="Flat";this.toolbar.grid_classic="Classic";this.toolbar.grid_compact="Compact";this.toolbar.format="Format";this.toolbar.format_cells="Format cells";this.toolbar.format_cells_mobile="Format";this.toolbar.conditional_formatting="Conditional formatting";
this.toolbar.conditional_formatting_mobile="Conditional";this.toolbar.options="Options";this.toolbar.fullscreen="Fullscreen";this.toolbar.minimize="Minimize";this.toolbar["export"]="Export";this.toolbar.export_print="Print";this.toolbar.export_html="To HTML";this.toolbar.export_csv="To CSV";this.toolbar.export_excel="To Excel";this.toolbar.export_image="To Image";this.toolbar.export_pdf="To PDF";this.toolbar.fields="Fields";this.toolbar.ok="OK";this.toolbar.apply="Apply";this.toolbar.done="Done";
this.toolbar.cancel="Cancel";this.toolbar.value="Value";this.toolbar["delete"]="Delete";this.toolbar["if"]="If";this.toolbar.then="Then";this.toolbar.open_remote_csv="Open remote CSV";this.toolbar.open_remote_json="Open remote JSON";this.toolbar.csv="CSV";this.toolbar.credentials="credentials";this.toolbar.username="Username";this.toolbar.password="Password";this.toolbar.open_remote_report="Open remote report";this.toolbar.choose_value="Choose value";this.toolbar.text_align="Text align";this.toolbar.align_left=
"left";this.toolbar.align_right="right";this.toolbar.none="None";this.toolbar.space="(Space)";this.toolbar.thousand_separator="Thousand separator";this.toolbar.decimal_separator="Decimal separator";this.toolbar.decimal_places="Decimal places";this.toolbar.currency_symbol="Currency symbol";this.toolbar.currency_align="Currency align";this.toolbar.null_value="Null value";this.toolbar.is_percent="Format as percent";this.toolbar.true_value="true";this.toolbar.false_value="false";this.toolbar.conditional=
"Conditional";this.toolbar.add_condition="Add condition";this.toolbar.less_than="Less than";this.toolbar.less_than_or_equal="Less than or equal to";this.toolbar.greater_than="Greater than";this.toolbar.greater_than_or_equal="Greater than or equal to";this.toolbar.equal_to="Equal to";this.toolbar.not_equal_to="Not equal to";this.toolbar.between="Between";this.toolbar.is_empty="Empty";this.toolbar.all_values="All values";this.toolbar.and="and";this.toolbar.and_symbole="&";this.toolbar.cp_text="Text";
this.toolbar.cp_highlight="Highlight";this.toolbar.layout_options="Layout options";this.toolbar.layout="Layout";this.toolbar.compact_view="Compact form";this.toolbar.classic_view="Classic form";this.toolbar.flat_view="Flat form";this.toolbar.grand_totals="Grand totals";this.toolbar.grand_totals_off="Do not show grand totals";this.toolbar.grand_totals_on="Show grand totals";this.toolbar.grand_totals_on_rows="Show for rows only";this.toolbar.grand_totals_on_columns="Show for columns only";this.toolbar.subtotals=
"Subtotals";this.toolbar.subtotals_off="Do not show subtotals";this.toolbar.subtotals_on="Show subtotals";this.toolbar.subtotals_on_rows="Show subtotal rows only";this.toolbar.subtotals_on_columns="Show subtotal columns only";this.toolbar.choose_page_orientation="Choose page orientation";this.toolbar.landscape="Landscape";this.toolbar.portrait="Portrait";this.toolbar.message_error=this.messages.error;this.toolbar.message_no_google_client_id=this.messages.noGoogleClientKey};b.prototype.getLabel=function(a){a=
a.split("/");return 1==a.length?this[a[0]]:2!=a.length||utils.nullOrUndefined(this[a[0]])||utils.nullOrUndefined(this[a[0]][a[1]])?3!=a.length||utils.nullOrUndefined(this[a[0]])||utils.nullOrUndefined(this[a[0]][a[1]])||utils.nullOrUndefined(this[a[0]][a[1]][a[2]])?null:this[a[0]][a[1]][a[2]]:this[a[0]][a[1]]};b.prototype.merge=function(a){b.nodeFromObject(a,this)};b.prototype.toObject=function(){var a={},c;for(c in this)this[c]instanceof Function||utils.nullOrUndefined(this[c])||(a[c]=this[c]);return JSON.stringify(a,
null,2)};b.fromObject=function(a){var c=new b;b.nodeFromObject(a,c);return c};b.nodeFromObject=function(a,c){if(!utils.nullOrUndefined(a)&&!utils.nullOrUndefined(c)&&a instanceof Object)for(var g in a){var m=a[g];utils.nullOrUndefined(m)||("string"==typeof m?c[g]=m:m instanceof Object&&b.nodeFromObject(m,c[g]))}};return b}();d.LabelsValueObject=e})(d._labels||(d._labels={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function a(){}a.REPORT_FILE_LOADED="load";a.REPORT_FILE_FAILED="fail";a.REPORT_FILE_CANCELLED="cancel";return a}();d.ReportEvent=e;var b=function(a){function c(c){var b=a.call(this,e.REPORT_FILE_LOADED)||this;b.report=c;return b}__extends(c,a);return c}(events._Event);d.ReportFileLoadedEvent=b;b=function(a){function c(c){var b=a.call(this,e.REPORT_FILE_FAILED)||this;b.message=c;return b}__extends(c,a);return c}(events._Event);d.ReportFileFailedEvent=
b})(d.report||(d.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c.defaultFilename="report.json";return c}__extends(a,b);a.prototype.open=function(){var c=this;this.localReportLoader=new h.LocalReportLoader;this.localReportLoader.addEventListener(h.ReportEvent.REPORT_FILE_LOADED,function(a){return c.onReportFileLoaded(a)});this.localReportLoader.addEventListener(h.ReportEvent.REPORT_FILE_FAILED,function(a){return c.onReportFileFailed(a)});this.localReportLoader.addEventListener(h.ReportEvent.REPORT_FILE_CANCELLED,
function(){return c.onReportFileCancelled()});this.localReportLoader.load()};a.prototype.load=function(c){var a=this;d.preloader(!0,e._labels.Labels.MESSAGE_LOADING);this.urlReportLoader=new h.UrlReportLoader;this.urlReportLoader.addEventListener(h.ReportEvent.REPORT_FILE_LOADED,function(c){return a.onReportFileLoaded(c)});this.urlReportLoader.addEventListener(h.ReportEvent.REPORT_FILE_FAILED,function(c){return a.onReportFileFailed(c)});this.urlReportLoader.load(utils.URLUtils.addTimestamp(c))};a.prototype.cancel=
function(){this.localReportLoader&&(this.localReportLoader.removeAllEventListeners(h.ReportEvent.REPORT_FILE_LOADED),this.localReportLoader.removeAllEventListeners(h.ReportEvent.REPORT_FILE_FAILED),this.localReportLoader=null);this.urlReportLoader&&(this.urlReportLoader.removeAllEventListeners(h.ReportEvent.REPORT_FILE_LOADED),this.urlReportLoader.removeAllEventListeners(h.ReportEvent.REPORT_FILE_FAILED),this.urlReportLoader=null);this.removeAllEventListeners(h.ReportEvent.REPORT_FILE_LOADED);this.removeAllEventListeners(h.ReportEvent.REPORT_FILE_FAILED)};
a.prototype.onReportFileLoaded=function(c){this.dispatch(new h.ReportFileLoadedEvent(c.report))};a.prototype.onReportFileFailed=function(c){d.uialert(c.message,e._labels.Labels.ERROR,d.AlertType.ERROR);this.dispatchWith(h.ReportEvent.REPORT_FILE_FAILED)};a.prototype.onReportFileCancelled=function(){this.dispatchWith(h.ReportEvent.REPORT_FILE_CANCELLED)};a.prototype.save=function(c,a,b,k,e,f){var r=this;void 0===a&&(a=null);void 0===e&&(e=!1);this.saveCallbackHandler=b;b=!1;var n="string"==typeof c?
c:null,p=k;k=e;c instanceof Object&&(c.hasOwnProperty("filename")&&(n=c.filename),c.hasOwnProperty("destination")&&(a=c.destination),c.hasOwnProperty("url")&&(p=c.url),c.hasOwnProperty("embedData")&&(k=c.embedData));if(null==n||""==n)n=this.defaultFilename;f.connectionInfo.dataSourceType==d.data_.consts.DataSourceType.CSV&&f.options.gridType!=d._view.grid.GridType.FLAT&&(f.connectionInfo instanceof d.data_.vo.FileConnectionInfo&&f.connectionInfo.browseForFile||f.connectionInfo.embedded||k)&&(c=new d.data_.vo.CSVConnectionInfo,
c.embedded=!0,f.connectionInfo=c,b=!0);a=null==a?h.DestinationType.FILE:a.toLowerCase();switch(a){case h.DestinationType.SERVER:b?(new d.data_.csv.CSVSaver).getData(function(c){return r.saveToServer(p,n,f,c)}):this.saveToServer(p,n,f);break;case h.DestinationType.FILE:b?(new d.data_.csv.CSVSaver).getData(function(c){return r.saveToFile(n,f,c)}):this.saveToFile(n,f);break;default:b?(new d.data_.csv.CSVSaver).getData(function(c){return r.saveToFile(n,f,c)}):this.saveToFile(n,f)}return null};a.prototype.dispatchReportSaved=
function(c){if(null!=this.saveCallbackHandler)try{this.saveCallbackHandler(c)}catch(a){this.saveCallbackHandler("Error! "+a)}};a.prototype.defineReportType=function(c){return JSON.stringify(c.toObject(),null,4)};a.prototype.saveToFile=function(c,a,b){void 0===b&&(b=null);var k=[this.defineReportType(a)];null!=b&&(k.push("\n"),k.push(b));try{var l=this;d.uialert(e._labels.Labels.MESSAGE_SAVE_REPORT_TO_FILE,e._labels.Labels.CONFIRMATION,d.AlertType.CONFIRMATION,[e._labels.Labels.BUTTON_SAVE,e._labels.Labels.BUTTON_CANCEL],
[function(){var a=new Blob(k,{type:"text/js;charset=utf-8"});savingAs(a,c);l.dispatchReportSaved(!0)},function(){l.dispatchReportSaved(!1)}])}catch(f){d.uialert(e._labels.Labels.MESSAGE_CANT_SAVE_FILE,e._labels.Labels.ERROR,d.AlertType.ERROR),this.dispatchReportSaved(!1)}};a.prototype.saveToServer=function(c,a,b,k){var l=this;void 0===k&&(k=null);utils.nullOrEmpty(c)&&d.uialert("Report cannot be saved. Save report url is empty.",e._labels.Labels.WARNING,d.AlertType.ERROR);var f=new misc.URLVariables;
f.data.name=a;f.data.report=null==k?this.defineReportType(b):this.defineReportType(b)+"\n"+k;f.data.type="json";var h=new misc.URLStream;h.data=f.toString();h.contentType=misc.ContentType.APPLICATION_URLENCODED;h.requestMethod=misc.URLRequestMethod.POST;h.addEventListener(events._Event.COMPLETE,function(){return l.onSaveComplete(h)});h.addEventListener(events._Event.ERROR,function(){return l.onError(h)});h.load(c);d.preloader(!0,e._labels.Labels.MESSAGE_UPLOADING);return null};a.prototype.onSaveComplete=
function(c){d.preloader(!1);this.dispatchReportSaved(c.response)};a.prototype.onError=function(c){d.preloader(!1);this.dispatchReportSaved(!1);c=e.XSSCheck.valid(c.url)?c.url:e.XSSCheck.validate(c.url);d.uialert(e._labels.Labels.MESSAGE_CANT_SAVE_FILE+utils.StringUtils.bind(' (<a href="{0}">{0}</a>)',c),e._labels.Labels.ERROR,d.AlertType.ERROR)};return a}(events.EventDispatcher);h.ReportManager=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){this.withDefaults=!1;this.connectionInfo=new d.data_.vo.ConnectionInfo;this.slice=new h.SliceValueObject;this.options=new e._options.vo.OptionsValueObject;this.formats=[];this.conditions=[];this.columnSizes={};this.rowSizes={};this.columnHeaderSizes=[];this.rowHeaderSizes=[];this.rowFilterSizes=[];this.columnSizesByIdx={};this.rowSizesByIdx={};this.customFields=[];this.labels={};this.localization=null}b.fromObject=function(a){if(null==
a)return null;a instanceof b||(a=b.toPlainObject(a));var c=new b;c.connectionInfo=d.data_.vo.ConnectionInfo.fromObject(null!=a.connectionInfo?a.connectionInfo:a);c.options=e._options.vo.OptionsValueObject.fromObject(null!=a.options?a.options:a);c.slice=h.SliceValueObject.fromObject(null!=a.slice?a.slice:a,c.connectionInfo,c.options.gridType==d._view.grid.GridType.FLAT);null!=a.formats&&a.formats.length&&(c.formats=a.formats);null!=a.conditions&&a.conditions.length&&(c.conditions=a.conditions);null!=
a.columnSizes&&"string"!=typeof a.columnSizes&&(c.columnSizes=a.columnSizes);null!=a.rowSizes&&"string"!=typeof a.rowSizes&&(c.rowSizes=a.rowSizes);null!=a.columnHeaderSizes&&"string"!=typeof a.columnHeaderSizes&&(c.columnHeaderSizes=a.columnHeaderSizes);null!=a.rowHeaderSizes&&"string"!=typeof a.rowHeaderSizes&&(c.rowHeaderSizes=a.rowHeaderSizes);null!=a.rowFilterSizes&&"string"!=typeof a.rowFilterSizes&&(c.rowFilterSizes=a.rowFilterSizes);null!=a.columnSizesByIdx&&(c.columnSizesByIdx=a.columnSizesByIdx);
null!=a.rowSizesByIdx&&(c.rowSizesByIdx=a.rowSizesByIdx);null!=a.customFields&&(c.customFields=a.customFields);null!=a.localization&&(c.localization=a.localization);return c};b.prototype.toObject=function(){var a={},c=this.connectionInfo.toObject(this.withDefaults);utils.ObjectUtils.isEmptyObject(c)||(a.dataSource=c);c=this.slice.toObject(this.withDefaults);utils.ObjectUtils.isEmptyObject(c)||(a.slice=c);c=this.options.toObject();utils.ObjectUtils.isEmptyObject(c)||(a.options=c);c=this.composeConditionsObject();
0<c.length&&(a.conditions=c);if(null!=this.formats&&0!=this.formats.length){for(var c=[],g=!this.options.saveAllFormats&&5<this.formats.length,b=0;b<this.formats.length;b++){var d=this.formats[b];""!=d.name&&(null==this.slice.formatsInUse[d.name]||g&&!this.slice.formatsInUse[d.name])||c.push(d)}a.formats=c}c=this.composeTableSizesObject();utils.ObjectUtils.isEmptyObject(c)||(a.tableSizes=c);null!=this.customFields&&0!=this.customFields.length&&(a.customFields=this.customFields);null!=this.localization&&
""!=this.localization&&(a.localization=this.localization);return a};b.prototype.composeConditionsObject=function(){for(var a=[],c=0;c<this.conditions.length;c++){var g=this.conditions[c],b={};b.formula=g.formula;-1<g.row&&(b.row=g.row);-1<g.column&&(b.column=g.column);-1<g.isTotal&&(b.isTotal=1==g.isTotal?!0:!1);g.measure&&0<g.measure.length&&(b.measure=g.measure);g.hierarchy&&0<g.hierarchy.length&&(b.hierarchy=g.hierarchy);g.member&&0<g.member.length&&(b.member=g.member);g.format&&!utils.ObjectUtils.isEmptyObject(g.format)&&
(b.format=g.format);a.push(b)}return a};b.prototype.composeTableSizesObject=function(){var a={},c,g,b,d;if(null!=this.columnHeaderSizes&&!utils.ObjectUtils.isEmptyObject(this.columnHeaderSizes)||null!=this.columnSizes&&!utils.ObjectUtils.isEmptyObject(this.columnSizes)){a.columns=[];if(null!=this.columnHeaderSizes&&!utils.ObjectUtils.isEmptyObject(this.columnHeaderSizes))for(g=0;g<this.columnHeaderSizes.length;g++)null!=this.columnHeaderSizes[g]&&a.columns.push({idx:g,width:this.columnHeaderSizes[g]});
g=h.SliceValueObject.findMeasure(this.slice.columns);if(null!=this.columnSizes&&!utils.ObjectUtils.isEmptyObject(this.columnSizes))for(c in this.columnSizes)b=c.split(","),0<=g?(d=b.pop(),a.columns.push({tuple:b,measure:d,width:this.columnSizes[c]})):a.columns.push({tuple:b,width:this.columnSizes[c]})}if(null!=this.rowFilterSizes&&!utils.ObjectUtils.isEmptyObject(this.rowFilterSizes)||null!=this.rowHeaderSizes&&!utils.ObjectUtils.isEmptyObject(this.rowHeaderSizes)||null!=this.rowSizes&&!utils.ObjectUtils.isEmptyObject(this.rowSizes)){a.rows=
[];if(null!=this.rowFilterSizes&&!utils.ObjectUtils.isEmptyObject(this.rowFilterSizes))for(g=0;g<this.rowFilterSizes.length;g++)null!=this.rowFilterSizes[g]&&a.rows.push({idx:g,height:this.rowFilterSizes[g]});if(null!=this.rowHeaderSizes&&!utils.ObjectUtils.isEmptyObject(this.rowHeaderSizes))for(g=0;g<this.rowHeaderSizes.length;g++)null!=this.rowHeaderSizes[g]&&a.rows.push({idx:g,height:this.rowHeaderSizes[g]});g=h.SliceValueObject.findMeasure(this.slice.rows);if(null!=this.rowSizes&&!utils.ObjectUtils.isEmptyObject(this.rowSizes))for(c in this.rowSizes)b=
c.split(","),0<=g?(d=b.pop(),a.rows.push({tuple:b,measure:d,height:this.rowSizes[c]})):a.rows.push({tuple:b,height:this.rowSizes[c]})}return a};b.toPlainObject=function(a){var c={};if(void 0==a)return c;null!=a.columnSizes&&(c.columnSizes=a.columnSizes);null!=a.rowSizes&&(c.rowSizes=a.rowSizes);null!=a.columnHeaderSizes&&(c.columnHeaderSizes=a.columnHeaderSizes);null!=a.rowHeaderSizes&&(c.rowHeaderSizes=a.rowHeaderSizes);null!=a.rowFilterSizes&&(c.rowFilterSizes=a.rowFilterSizes);null!=a.rowSizesByIdx&&
(c.rowSizesByIdx=a.rowSizesByIdx);null!=a.columnSizesByIdx&&(c.columnSizesByIdx=a.columnSizesByIdx);null!=a.customFields&&(c.customFields=a.customFields);null!=a.labels&&(c.labels=a.labels);c.connectionInfo=null!=a.connectionInfo?d.data_.vo.ConnectionInfo.toPlainObject(a.connectionInfo):d.data_.vo.ConnectionInfo.toPlainObject(a);c.slice=null!=a.slice?h.SliceValueObject.toPlainObject(a.slice):h.SliceValueObject.toPlainObject(a);c.options=null!=a.options?e._options.vo.OptionsValueObject.toPlainObject(a.options):
e._options.vo.OptionsValueObject.toPlainObject(a);null!=a.formats&&0<a.formats.length&&(c.formats=a.formats);null!=a.conditions&&0<a.conditions.length&&(c.conditions=a.conditions);if(null!=a.tableSizes){var g,b;if(null!=a.tableSizes.columns){var k=a.tableSizes.columns;for(g=0;g<k.length;g++)if(null!=k[g].idx&&(null==c.columnSizesByIdx&&(c.columnSizesByIdx={}),c.columnSizesByIdx[parseInt(k[g].idx)]=parseInt(k[g].width)),null!=k[g].tuple||null!=k[g].measure)null==c.columnSizes&&(c.columnSizes={}),b=
null==k[g].tuple?[]:k[g].tuple.slice(),null!=k[g].measure&&b.push(k[g].measure),c.columnSizes[b.join(",")]=parseInt(k[g].width)}if(null!=a.tableSizes.rows)for(k=a.tableSizes.rows,g=0;g<k.length;g++)if(null!=k[g].idx&&(null==c.rowSizesByIdx&&(c.rowSizesByIdx={}),c.rowSizesByIdx[parseInt(k[g].idx)]=parseInt(k[g].height)),null!=k[g].tuple||null!=k[g].measure)null==c.rowSizes&&(c.rowSizes={}),b=null==k[g].tuple?[]:k[g].tuple.slice(),null!=k[g].measure&&b.push(k[g].measure),c.rowSizes[b.join(",")]=parseInt(k[g].height)}null!=
a.localization&&(c.localization=a.localization);return c};b.prototype.merge=function(a){if(utils.nullOrUndefined(a))return this;a=b.toPlainObject(a);var c=b.toPlainObject(this),g;for(g in a)a.hasOwnProperty(g)&&("connectionInfo"==g?d.data_.vo.ConnectionInfo.fromObject(a.connectionInfo).isEmpty||(c[g]=a[g]):"options"==g?(this.options.mergeWith(a[g]),c[g]=e._options.vo.OptionsValueObject.toPlainObject(this.options)):c[g]=a[g]);return b.fromObject(c)};return b}();h.ReportValueObject=f})(e.report||(e.report=
{}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){return null!==b&&b.apply(this,arguments)||this}__extends(a,b);a.prototype.dispatchReportLoaded=function(c){c?this.dispatch(new h.ReportFileLoadedEvent(c)):this.dispatch(new h.ReportFileFailedEvent(e._labels.Labels.MESSAGE_INVALID_REPORT_FORMAT))};a.prototype.parseReport=function(c){try{var a=-1,a=c.indexOf("/**----**");return JSON.parse(-1<a?c.substring(0,a):c)}catch(b){return console.error(b),null}};a.prototype.getStringByteLength=
function(c){var a=new d.DataStream(new ArrayBuffer(0),0,d.DataStream.BIG_ENDIAN);a.writeString(c);return a.byteLength};return a}(events.EventDispatcher);h.ReportLoader=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c.counter=0;c.embeddedStartDataSign="\x3c!--";c.embeddedDataJSONStartSign="/**----**";return c}__extends(a,b);a.prototype.load=function(c){var a=this;this.url=c;this.bytesLoaded=0;this.loader=new misc.URLStream;this.loader.dataType=misc.DataType.TEXT;this.loader.addEventListener(events._Event.PROGRESS,function(c){return a.onProgress(c)});this.loader.addEventListener(events._Event.COMPLETE,function(){return a.onLoaded()});
this.loader.addEventListener(events._Event.ERROR,function(){return a.onError()});this.loader.load(c)};a.prototype.onProgress=function(c){c=0;if(null!=this.loader&&-1<(c=this.loader.response.indexOf("</config>"))&&c+this.embeddedDataJSONStartSign.length+1<this.loader.response.length)this.onLoaded()};a.prototype.onLoaded=function(){if(null!=this.loader){this.loader.removeAllEventListeners(events._Event.COMPLETE);var c=this.parseReport(this.loader.response);if(c instanceof h.ReportValueObject){if(c.connectionInfo instanceof
d.data_.vo.CSVConnectionInfo&&!0==c.connectionInfo.embedded){var a=c.connectionInfo;a.filename=this.loader.url;a.embeddedDataOffset=this.getStringByteLength(this.loader.response.substring(0,this.loader.response.indexOf("</config>")+9)+"\n");this.loader.response.indexOf(this.embeddedStartDataSign);c.connectionInfo=a}}else utils.nullOrUndefined(c)||utils.nullOrUndefined(c.dataSource)||!0!=c.dataSource.embedded||(c.dataSource.filename=this.loader.url,c.dataSource.embeddedDataOffset=this.getStringByteLength(this.loader.response.substring(0,
this.loader.response.indexOf(this.embeddedDataJSONStartSign))));this.dispatchReportLoaded(c);this.dispose()}};a.prototype.onError=function(){this.loader.removeAllEventListeners(events._Event.PROGRESS);this.loader.removeAllEventListeners(events._Event.COMPLETE);this.loader.removeAllEventListeners(events._Event.ERROR);var c=e.XSSCheck.valid(this.url)?this.url:e.XSSCheck.validate(this.url),c=utils.StringUtils.bind(e._labels.Labels.MESSAGE_UNABLE_TO_OPEN_FILE,c);this.dispatch(new h.ReportFileFailedEvent(c));
this.dispose()};a.prototype.dispose=function(){null!=this.loader&&(this.loader.removeAllEventListeners(),this.loader.dispose(),this.loader=null)};return a}(h.ReportLoader);h.UrlReportLoader=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){return b.call(this)||this}__extends(a,b);a.prototype.load=function(){var c=this;this.file=new misc.FileReference;this.file.addEventListener(events._Event.SELECT,function(){return c.onSelected()});this.file.addEventListener(events._Event.COMPLETE,function(){return c.onLoaded()});this.file.addEventListener(events._Event.CANCEL,function(){return c.onCancel()});this.file.addEventListener(events._Event.ERROR,function(){return c.onError()});
this.file.browse([".json",".js"])};a.prototype.onSelected=function(){null!=this.file&&this.file.load(misc.ReadMethod.ARRAY_BUFFER)};a.prototype.onLoaded=function(){try{var c=new d.DataStream(this.file.response,0,d.DataStream.BIG_ENDIAN),a=c.readString(c.byteLength),b=this.parseReport(a);if(b instanceof h.ReportValueObject){if(b.connectionInfo instanceof d.data_.vo.CSVConnectionInfo&&!0==b.connectionInfo.embedded){var k=b.connectionInfo;k.embeddedDataToLoad=this.file.response;k.embeddedDataOffset=
this.getStringByteLength(a.substring(0,a.indexOf("</config>")+9)+"\n");b.connectionInfo=k}}else utils.nullOrUndefined(b)||utils.nullOrUndefined(b.dataSource)||!0!=b.dataSource.embedded||(b.dataSource.embeddedDataToLoad=this.file.response,b.dataSource.embeddedDataOffset=this.getStringByteLength(a.substring(0,a.indexOf("/**----**"))));this.dispatchReportLoaded(b);this.dispose()}catch(e){console.error(e),this.onError()}};a.prototype.onError=function(){var c=utils.StringUtils.bind(e._labels.Labels.MESSAGE_UNABLE_TO_OPEN_FILE,
"");this.dispatch(new h.ReportFileFailedEvent(c));this.dispose()};a.prototype.onCancel=function(){this.dispatchWith(h.ReportEvent.REPORT_FILE_CANCELLED);this.dispose()};a.prototype.dispose=function(){null!=this.file&&(this.file.removeAllEventListeners(),this.file.dispose(),this.file=null)};return a}(h.ReportLoader);h.LocalReportLoader=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.validType=function(a){return a==b.FILE||a==b.SERVER||a==b.BINARY||a==b.PLAIN};b.FILE="file";b.SERVER="server";b.BINARY="binary";b.PLAIN="plain";return b}();d.DestinationType=e})(d.report||(d.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.customFields=[];return b}();d.CustomFieldsManager=e})(d.report||(d.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){this.rows=[];this.columns=[];this.pages=[];this.measures=[];this.rowSorting={};this.columnSorting={};this.expandedRows=[];this.expandedColumns=[];this.drilledRows=[];this.drilledColumns=[];this.drillAll=this.expandAll=!1;this.flatOrder=[];this.formatsInUse={}}b.prototype.normalizeSlice=function(a){if(0<=b.findMeasure(a.rows)){var c=b.findMeasure(a.columns);0<=c&&(a.columns[c]=a.columns[0],a.columns.shift())}};b.findMeasure=function(a){for(var c=
d.data_.Cube.MEASURES_NAME,g=0;g<a.length;g++)if(a[g].uniqueName==c)return g;return-1};b.readExpandedFromObject=function(a){for(var c=[],g,b=0;b<a.length;b++){g=[];g.push(null!=a[b].measure?a[b].measure:"");if(null!=a[b].tuple)for(var d=0;d<a[b].tuple.length;d++)g.push(a[b].tuple[d]);c.push(g)}return c};b.readDrilledFromObject=function(a){for(var c=[],g,b=0;b<a.length;b++){g=[];g.push(null!=a[b].level?a[b].level:"");g.push(null!=a[b].measure?a[b].measure:-1);if(null!=a[b].tuple){g.push(a[b].tuple[a[b].tuple.length-
1]);for(var d=0;d<a[b].tuple.length;d++)g.push(a[b].tuple[d])}c.push(g)}return c};b.fromObject=function(a,c,g){void 0===c&&(c=null);void 0===g&&(g=!1);if(null==a)return null;a instanceof b||(a=b.toPlainObject(a));var m=new b;null!=a.measures&&a.measures.length&&(m.measures=a.measures);null==c&&e.PivotModel.getInstance();null!=a.pages&&a.pages.length&&(m.pages=b.hierarchiesFromObject(a.pages));null!=a.columns&&a.columns.length&&(m.columns=b.hierarchiesFromObject(a.columns,g));null!=a.rows&&a.rows.length&&
(m.rows=b.hierarchiesFromObject(a.rows,g));null!=a.flatOrder&&a.flatOrder.length&&(m.flatOrder=a.flatOrder);m.normalizeSlice(m);null!=a.rowSorting&&(m.rowSorting=a.rowSorting);null!=a.columnSorting&&(m.columnSorting=a.columnSorting);null!=a.expandAll&&(m.expandAll=a.expandAll);null!=a.expandedRows&&a.expandedRows.length&&(m.expandedRows=a.expandedRows);null!=a.expandedColumns&&a.expandedColumns.length&&(m.expandedColumns=a.expandedColumns);null!=a.drillAll&&(m.drillAll=a.drillAll);null!=a.drilledRows&&
a.drilledRows.length&&(m.drilledRows=a.drilledRows);null!=a.drilledColumns&&a.drilledColumns.length&&(m.drilledColumns=a.drilledColumns);return m};b.hierarchiesFromObject=function(a,c){void 0===c&&(c=!1);for(var g=[],b=0;b<a.length;b++){g[b]={};c&&!a[b].sort&&(a[b].sort=d.data_.consts.SortType.UNSORTED);for(var k in a[b])"sort"==k?g[b].sortName=a[b].sort:g[b][k]=a[b][k]}return g};b.prototype.toObject=function(a){void 0===a&&(a=!1);var c={},g,b=[];for(g=0;g<this.pages.length;g++)b.push(this.hierarchyToJSON(this.pages[g],
a));0<b.length&&(c.reportFilters=b);b=[];for(g=0;g<this.rows.length;g++)b.push(this.hierarchyToJSON(this.rows[g],a));0<b.length&&(c.rows=b);b=[];for(g=0;g<this.columns.length;g++)b.push(this.hierarchyToJSON(this.columns[g],a));0<b.length&&(c.columns=b);b=[];for(g=0;g<this.measures.length;g++)b.push(this.measureToJSON(this.measures[g],a));0<b.length&&(c.measures=b);if(null!=this.rowSorting&&null!=this.rowSorting.type&&this.rowSorting.type!=d.data_.consts.SortType.UNSORTED||null!=this.columnSorting&&
this.columnSorting.type&&this.columnSorting.type!=d.data_.consts.SortType.UNSORTED)c.sorting={},null!=this.rowSorting&&null!=this.rowSorting.type&&this.rowSorting.type!=d.data_.consts.SortType.UNSORTED&&(c.sorting.row=this.rowSorting),null!=this.columnSorting&&this.columnSorting.type&&this.columnSorting.type!=d.data_.consts.SortType.UNSORTED&&(c.sorting.column=this.columnSorting);g={};if(a||this.expandAll)g.expandAll=this.expandAll;0<this.expandedRows.length&&(g.rows=this.expandedElementsToJSON(this.expandedRows));
0<this.expandedColumns.length&&(g.columns=this.expandedElementsToJSON(this.expandedColumns));utils.ObjectUtils.isEmptyObject(g)||(c.expands=g);g={};if(a||this.drillAll)g.drillAll=this.drillAll;0<this.drilledRows.length&&(g.rows=this.drilledElementsToJSON(this.drilledRows));0<this.drilledColumns.length&&(g.columns=this.drilledElementsToJSON(this.drilledColumns));utils.ObjectUtils.isEmptyObject(g)||(c.drills=g);0<this.flatOrder.length&&(c.flatOrder=this.flatOrder);return c};b.prototype.expandedElementsToJSON=
function(a){for(var c=[],g,b,d,e=0;e<a.length;e++)g={},b=a[e].slice(0),d=b.shift(),0!=b.length&&(g.tuple=b,""!=d&&(g.measure=d),c.push(g));return c};b.prototype.drilledElementsToJSON=function(a){for(var c=[],g,b,d,e,f=0;f<a.length;f++)g={},e=a[f].slice(0),b=e.shift(),d=e.shift(),e.shift(),0!=e.length&&(g.tuple=e,""!=d&&(g.measure=d),""!=b&&(g.level=b),c.push(g));return c};b.prototype.measureToJSON=function(a,c){var g={};g.uniqueName=a.uniqueName;if(null!=a.formula&&""!=a.formula)g.formula=a.formula,
a.individual&&(g.individual=!0),g.caption=a.caption;else if(c||a.aggregation!=d.data_.consts.AggregationName.NONE)g.aggregation=a.aggregation;if(c||!1==a.active)g.active=a.active;null!=a.format&&""!=a.format&&(g.format=a.format,this.formatsInUse[a.format]=a.active);null!=a.availableAggregations&&0<a.availableAggregations.length&&(g.availableAggregations=a.availableAggregations);return g};b.prototype.hierarchyToJSON=function(a,c){var g={};g.uniqueName=a.uniqueName;null!=a.activeLevelName&&(g.levelName=
a.activeLevelName);if(null!=a.filter&&(g.filter={},null!=a.filter.type&&a.filter.type!=d.data_.consts.FilterType.NONE&&(g.filter={type:a.filter.type,quantity:a.filter.quantity,measure:a.filter.measure}),null!=a.filter.members)){var b="string"==typeof a.filter.members?a.filter.members.split(","):a.filter.members;0<b.length&&(g.filter.members=b,!0===a.filter.negation&&(g.filter.negation=a.filter.negation))}a.filterEnabled||(g.filterEnabled=!0);a.uniqueName!=d.data_.Cube.MEASURES_NAME&&a.sortName&&(c||
a.sortName!=d.data_._structure.GenericHierarchy.DEFAULT_SORT_NAME)&&(g.sort=a.sortName);a.uniqueName!=d.data_.Cube.MEASURES_NAME&&a.sortAs&&(g.sortAs=a.sortAs);return g};b.toPlainObject=function(a){var c={};if(void 0==a)return c;null!=a.pages&&(c.pages=a.pages);null!=a.reportFilters&&(c.pages=a.reportFilters);null!=a.rows&&(c.rows=a.rows);null!=a.columns&&(c.columns=a.columns);null!=a.measures&&(c.measures=a.measures);null!=a.rowSorting&&(c.rowSorting=a.rowSorting,null!=c.rowSorting.tuple&&"string"==
typeof c.rowSorting.tuple&&(c.rowSorting.tuple=c.rowSorting.tuple.split(",")));null!=a.sorting&&null!=a.sorting.row&&(c.rowSorting=a.sorting.row);null!=a.columnSorting&&(c.columnSorting=a.columnSorting,null!=c.columnSorting.tuple&&"string"==typeof c.columnSorting.tuple&&(c.columnSorting.tuple=c.columnSorting.tuple.split(",")));null!=a.sorting&&null!=a.sorting.column&&(c.columnSorting=a.sorting.column);null!=a.expandAll&&(c.expandAll=a.expandAll);null!=a.expandedRows&&(c.expandedRows=a.expandedRows);
null!=a.expandedColumns&&(c.expandedColumns=a.expandedColumns);null!=a.expands&&(null!=a.expands.expandAll&&(c.expandAll=a.expands.expandAll),null!=a.expands.rows&&(c.expandedRows=b.readExpandedFromObject(a.expands.rows)),null!=a.expands.columns&&(c.expandedColumns=b.readExpandedFromObject(a.expands.columns)));null!=a.drillAll&&(c.drillAll=a.drillAll);null!=a.drilledRows&&(c.drilledRows=a.drilledRows);null!=a.drilledColumns&&(c.drilledColumns=a.drilledColumns);null!=a.drills&&(null!=a.drills.drillAll&&
(c.drillAll=a.drills.drillAll),null!=a.drills.rows&&(c.drilledRows=b.readDrilledFromObject(a.drills.rows)),null!=a.drills.columns&&(c.drilledColumns=b.readDrilledFromObject(a.drills.columns)));null!=a.flatOrder&&(c.flatOrder=a.flatOrder);null!=a.slice&&(a=a.slice,null!=a.pages&&a.pages.length&&(c.pages=a.pages),null!=a.reportFilters&&a.reportFilters.length&&(c.pages=a.reportFilters),null!=a.rows&&a.rows.length&&(c.rows=a.rows),null!=a.columns&&a.columns.length&&(c.columns=a.columns),null!=a.measures&&
a.measures.length&&(c.measures=a.measures),null!=a.sorting&&null!=a.sorting.row&&(c.rowSorting=a.sorting.row),null!=a.sorting&&null!=a.sorting.column&&(c.columnSorting=a.sorting.column),null!=a.expands&&(null!=a.expands.expandAll&&(c.expandAll=a.expands.expandAll),null!=a.expands.rows&&(c.expandedRows=b.readExpandedFromObject(a.expands.rows)),null!=a.expands.columns&&(c.expandedColumns=b.readExpandedFromObject(a.expands.columns))),null!=a.drills&&(null!=a.drills.drillAll&&(c.drillAll=a.drills.drillAll),
null!=a.drills.rows&&(c.drilledRows=b.readDrilledFromObject(a.drills.rows)),null!=a.drills.columns&&(c.drilledColumns=b.readDrilledFromObject(a.drills.columns))),null!=a.flatOrder&&a.flatOrder.length&&(c.flatOrder=a.flatOrder));return c};return b}();h.SliceValueObject=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){(function(f){var b=function(){function a(){this.formats=new utils.AssociativeArray;this.conditions=new utils.AssociativeArray;this.customFields=[];this.rowSizes={};this.columnSizes={};this.startTableRow=0;this.rowHeaderSizes={};this.columnHeaderSizes={};this.rowFilterSizes={};this.expandedRows=[];this.expandedColumns=[];this.drilledRows=[];this.drilledColumns=[];this.localization=null;this.labels={};this.withGlobals=this.withDefaults=!1}a.toReport=function(c){var a,
b=new e.report.ReportValueObject;b.withDefaults=c.withDefaults;b.connectionInfo=c._connectionInfo;if(c._slice){var k=d.data_._structure.Axis.toObject(c._slice.findAxis(d.data_.consts.AxisName.ROWS_AXIS)),l=d.data_._structure.Axis.toObject(c._slice.findAxis(d.data_.consts.AxisName.COLUMNS_AXIS));a=d.data_._structure.Axis.toObject(c._slice.findAxis(d.data_.consts.AxisName.PAGES_AXIS));b.slice=new e.report.SliceValueObject;b.slice.rows=k.hierarchies;b.slice.columns=l.hierarchies;b.slice.pages=a.hierarchies;
b.slice.measures=[];var f;for(a=0;a<c._slice.measures_.length;a++)f=c._slice.measures_.getItemAt(a),f=d.data_._structure.GenericMeasure.toObject(f),f.active=!0,b.slice.measures.push(f);for(a=0;a<c._structure.measures_.length;a++)f=c._structure.measures_.getItemAt(a),c._slice.measures_.keyExists(f.uniqueName)||f.hasDefaultParams()||(f=d.data_._structure.GenericMeasure.toObject(f),f.active=!1,b.slice.measures.push(f));b.slice.rowSorting=k.sort;b.slice.columnSorting=l.sort;b.slice.expandAll=c._slice.expandAll;
b.slice.expandedRows=c.expandedRows;b.slice.expandedColumns=c.expandedColumns;b.slice.drillAll=c._slice.drillAll;b.slice.drilledRows=c.drilledRows;b.slice.drilledColumns=c.drilledColumns;b.slice.flatOrder=c._slice.flatOrder}b.options=c._options;k=[];for(a=0;a<c.formats.length;a++)k[a]=c.formats.getItemAt(a).toObject();b.formats=k;k=[];for(a=0;a<c.conditions.length;a++)k[a]=e.condition.vo.ConditionValueObject.toObject(c.conditions.getItemAt(a));b.conditions=k;b.customFields=c.customFields;b.labels=
c.labels;var h;a={};for(h in c.columnSizes)a[h]=c.columnSizes[h];b.columnSizes=a;k=[];for(h in c.columnHeaderSizes)a=parseInt(h),k[a]=c.columnHeaderSizes[h];b.columnHeaderSizes=k;a={};for(h in c.rowSizes)a[h]=c.rowSizes[h];b.rowSizes=a;k=[];for(h in c.rowHeaderSizes)a=parseInt(h),k[a+c.startTableRow]=c.rowHeaderSizes[h];b.rowHeaderSizes=k;k=[];if(0!=c.startTableRow)for(h in c.rowFilterSizes)a=parseInt(h),k[a]=c.rowFilterSizes[h];b.rowFilterSizes=k;b.localization=c.localization;return b};return a}();
f.StateValueObject=b})(h.vo||(h.vo={}))})(e._state||(e._state={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){var a=this;this.MARGINS=25;this._printInProgress=!1;this.printCompletedHandler=function(){return a.onPrintCompleted()};this.footerHeight=this.headerHeight=0}b.getInstance=function(){null==b._instance&&(b._instance=new b);return b._instance};b.dispose=function(){b._instance=null};b.prototype.print=function(a){void 0===a&&(a=null);this._printInProgress||(this._printInProgress=!0,this._options=a||new e.printing.PrintOptions,e.PivotModel.getInstance().addEventListener(d.PivotEvent.PRINT_COMPLETE,
this.printCompletedHandler),e.PivotModel.getInstance().dispatchWith(d.PivotEvent.PRINT))};b.prototype.onPrintCompleted=function(){e.PivotModel.getInstance().removeEventListener(d.PivotEvent.PRINT_COMPLETE,this.printCompletedHandler);this._printInProgress=!1};b.prototype.run=function(a,c){this.grid=a;this.dataProvider=c;this.gridLayout=null!=a?a.gridLayout:null;this.start()};b.prototype.start=function(){var a=this;this.pageNumber=0;this._pageWidth=576-2*this.MARGINS;this._pageHeight=756-2*this.MARGINS;
this.pages=new uicontrols.UIElement("div");this.stylesList=[];this.rowsShift=this.columnsShift=0;utils.ThreadManager.addTask(this.generatePageColumn,this,null,function(){return a.finish()})};b.prototype.clear=function(){this._printInProgress=!1;this.columnsShift=this.pageNumber=this.rowsShift=this.columnsShift=0;this.pages=this.printSprite=null;this.footerHeight=this.headerHeight=0};b.prototype.generatePageColumn=function(){return this.addColumn()};b.prototype.addColumn=function(){if(null==this.printSprite)this.printSprite=
this.createPage(),this.printTable=this.printSprite.find("table");else if(!(this.printSprite.getWidth(!0)<=this._pageWidth&&0!=this.columnsShift)&&(this.printSprite.getWidth(!0)>this._pageWidth&&(this.columnsShift--,this.printSprite.find("td:last-child").remove()),this.addPageToPJ(),this.printSprite=this.createPage(),this.printTable=this.printSprite.find("table"),!1==this.grid.isFlatTable)){var a=this.columnsShift;0!=this.columnsShift&&(this.columnsShift=0,this.addColumnOnPage(),this.columnsShift=
a,this.columnsShift+1<=this.dataProvider.extendedDataWidth-(this.grid.isFlatTable?1:0)&&(this.columnsShift+=1))}this.addColumnOnPage();if(!0==this.shift())this.addPageToPJ();else return!1;return!0};b.prototype.createPage=function(){var a=(new uicontrols.UIElement("div")).addClass("page");a.css("position","absolute").css("left","-9999px");if(null!=this._options.header){var c=this.createHeaderFooter(this._options.header);a.append(c)}var g=new uicontrols.UIElement("table");0==this.pageNumber&&0<e._options.OptionsManager.gridTitle.length&&
g.append((new uicontrols.UIElement("caption")).text(e._options.OptionsManager.gridTitle));a.append(g);if(null!=this._options.footer){var b=this.createHeaderFooter(this._options.footer);a.append(b)}this.grid.container.append(a);this.headerHeight=null!=c?c.getHeight():0;this.footerHeight=null!=b?b.getHeight():0;return a};b.prototype.createHeaderFooter=function(a){var c=new uicontrols.UIElement("div");a=a.replace(/##PAGE-NUMBER##/gi,(this.pageNumber+1).toString());a=a.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString());
c.html(a);return c};b.prototype.addPageToPJ=function(){this.pageNumber++;d.preloader(!0,e._labels.Labels.MESSAGE_PLEASE_WAIT,this.pageNumber+" "+e._labels.Labels.MESSAGE_PAGES_WERE_GENERATED,!0);this.rowHeightSum>this._pageHeight&&(this._rowIdx--,this.printSprite.find("tr:last-child").remove());this.printSprite.detach();this.printSprite.css("position","").css("left","");this.pages.append(this.printSprite);return!1};b.prototype.shift=function(){++this.columnsShift;this.columnsShift>this.dataProvider.extendedDataWidth-
(this.grid.isFlatTable?1:0)&&(this.columnsShift=0,this.rowsShift+=this._rowIdx-this.grid.FIRST_DATA_ROW);return 1E3<=this.pageNumber||this.rowsShift>=this.dataProvider.extendedDataHeight?!0:!1};b.prototype.addColumnOnPage=function(){this.rowHeightSum=0;var a=this.grid.START_HEADERS_COLUMN+this.columnsShift,c=this._pageHeight-this.headerHeight-this.footerHeight;for(this._rowIdx=this.grid.START_TABLE_ROW;this.rowHeightSum<=c&&this._rowIdx<this.dataProvider.extendedDataHeight+this.grid.FIRST_DATA_ROW-
this.rowsShift;this._rowIdx++){this.rowIndex=this._rowIdx<this.grid.FIRST_DATA_ROW?this._rowIdx:this._rowIdx+this.rowsShift;var g=this.gridLayout.getCell(this.rowIndex,a,!0,!0);this.rowHeightSum+=this.addCell(this._rowIdx,this.columnsShift,g);if(this.rowHeightSum>=c)break}};b.prototype.addCell=function(a,c,g){c=this.printTable.find("tr",!0);for(c=0<c.length?c[a]:null;null==c;)this.printTable.append(new uicontrols.UIElement("tr")),c=this.printTable.find("tr",!0)[a];a="<td {0}>"+(g?g.getLabel():"")+
"</td>";if(null==g)a=utils.StringUtils.bind(a,"class='cell'");else{var b="",d="";g.isCustomized&&(d=g.style.getStyleString(),b=g.style.getCustomClassString(),this.appendStylesList(g.style.customStyleNames));b=g.isRowHeader?b+(" rowHeaderCell level"+g.level):g.isColumnHeader?b+" columnHeaderCell":g.isFilterHeader?b+" filterHeaderCell":g.isTotal&&""!=g.getLabel()?b+" totalCell":b+" cell";""!=b.trim()&&(b="class='"+b.trim()+"'");""!=d.trim()&&(d="style='"+d.trim()+"maxWidth:400px'");a=utils.StringUtils.bind(a,
b+" "+d)}c.element.innerHTML+=a;return c.getHeight(!0)+4};b.prototype.appendStylesList=function(a){for(var c=0;c<a.length;c++)0>this.stylesList.indexOf(a[c])&&this.stylesList.push(a[c])};b.prototype.finish=function(){d.preloader(!0,e._labels.Labels.MESSAGE_PLEASE_WAIT,"Sending pages to printer...",!1,!0);misc.PrintJob.print(this.pages.html(),this.generateStyle(),e._options.OptionsManager.gridTitle);d.preloader(!1);e.PivotModel.getInstance().dispatchWith(d.PivotEvent.PRINT_COMPLETE);this.clear()};
b.prototype.generateStyle=function(){for(var a="",c=uicontrols.UIElement.convert(this.gridLayout.element),g=c.find("#wdr-data-sheet"),a=a+utils.StringUtils.bind("table{width:100%;border-collapse:collapse;{0}}\n",d._view.grid.vo.StyleValueObject.fromItemToString(c,["font-family","font-size"])),a=a+utils.StringUtils.bind("caption{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.TITLE,c)),a=a+utils.StringUtils.bind("td{white-space:nowrap;{0}}\n",utils.browserVersion().isChrome?
"":"border: 1px solid #eee;"),a=a+utils.StringUtils.bind(".cell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL,g)),a=a+utils.StringUtils.bind(".totalCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.TOTAL,g)),a=a+utils.StringUtils.bind(".rowHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+
" "+d._view.grid.vo.GridStyleName.HEADER_ROW,c)),a=a+utils.StringUtils.bind(".columnHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_COLUMN,c)),a=a+utils.StringUtils.bind(".filterHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.FILTER_HEADER,
c)),g=1;20>=g;g++)a+=utils.StringUtils.bind(".level{0}{{1}}\n",g,d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.HEADER_ROW+" "+d._view.grid.vo.GridStyleName.LEVEL+g,c,["padding-left"]));for(g=0;g<this.stylesList.length;g++)a+=utils.StringUtils.bind(".{0}{{1}}\n",this.stylesList[g],d._view.grid.vo.StyleValueObject.fromClassToString(this.stylesList[g],c));a=(a+".page:not(:last-child), svg { page-break-after: always; }").replace(/background-color:rgb\(33, 33, 33\)/g,
"background-color:rgb(255, 255, 255)");return a=a.replace(/background-color:rgb\(66, 66, 66\)/g,"background-color:rgb(247, 247, 247)")};return b}();h.PrintingManager=f})(e.printing||(e.printing={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.fromObject=function(a){var c=new b;null!=a&&(null!=a.header&&(c.header=a.header),null!=a.footer&&(c.footer=a.footer));return c};return b}();d.PrintOptions=e})(d.printing||(d.printing={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;a._defaults=new h.vo.OptionsValueObject;a._defaults.setDefaults();a._options=new h.vo.OptionsValueObject;if(a.instance)throw Error("Singleton");return c}__extends(a,b);a.getInstance=function(){utils.nullOrUndefined(a.instance)&&(a.instance=new a);return a.instance};a.dispose=function(){a._globals._defaults=null;a._globals=null;a._options=null;a._defaults=null;a.instance=null};a.setGlobalOptions=function(c){a._globals=
c};a.getOptions=function(c,g){void 0===c&&(c=!1);void 0===g&&(g=!1);var b=new h.vo.OptionsValueObject;c&&b.mergeWith(a._defaults);g&&b.mergeWith(a._globals);b.mergeWith(a._options);c||b.cleanFromDefaults();return b};a.clear=function(){this._options=new h.vo.OptionsValueObject};a.setOptions=function(c,g){void 0===g&&(g=!0);if(utils.nullOrUndefined(a._options)||g){var b=a.configuratorOpened;a._options=new h.vo.OptionsValueObject;a._options.configuratorOpened=b}var b=h.vo.OptionsValueObject.toPlainObject(c),
k=!1;a.dispatchSuspended=!0;var e=a.getOptions(!0,!0),f;for(f in b)if(void 0!=e[f]&&b[f]!=e[f]&&(k=!0,a.optionAffectDataProvider(f))){a.optionAffectedDataProvider=!0;break}a._options.mergeWith(b);d.data_._structure.GenericHierarchy.DEFAULT_SORT_NAME=a.defaultHierarchySortName;a.dispatchSuspended=!1;k&&a.dispatchReportChange()};a.optionAffectDataProvider=function(c){return-1<a._optionsAffectDataProvider.indexOf(c)};a.getOption=function(c){return null!=a._options[c]?a._options[c]:a._globals&&null!=
a._globals[c]?a._globals[c]:a._defaults[c]};Object.defineProperty(a,"configuratorOpened",{get:function(){return a._options.configuratorOpened},set:function(c){a._options.configuratorOpened=c},enumerable:!0,configurable:!0});Object.defineProperty(a,"configuratorActive",{get:function(){return a.getOption("configuratorActive")},set:function(c){a._options.configuratorActive!=c&&(a.configuratorOpened=a._options.configuratorActive=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,
"configuratorButton",{get:function(){return a.getOption("configuratorButton")},set:function(c){a._options.configuratorButton!=c&&(a._options.configuratorButton=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"classicView",{get:function(){return a.getOption("gridType")==d._view.grid.GridType.CLASSIC},set:function(c){a._options.gridType!=d._view.grid.GridType.CLASSIC&&(a._options.gridType=d._view.grid.GridType.CLASSIC,a.optionAffectedDataProvider=a.optionAffectDataProvider("gridType"),
a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"flatView",{get:function(){return a.getOption("gridType")==d._view.grid.GridType.FLAT},set:function(c){a._options.gridType!=d._view.grid.GridType.FLAT&&(a._options.gridType=d._view.grid.GridType.FLAT,a.optionAffectedDataProvider=a.optionAffectDataProvider("gridType"),a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"gridType",{get:function(){return a.getOption("gridType")},set:function(c){a._options.gridType!=
c&&(a._options.gridType=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"gridTitle",{get:function(){return a.getOption("gridTitle")},set:function(c){a._options.gridTitle!=c&&(a._options.gridTitle=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showFilter",{get:function(){return a.getOption("showFilter")},set:function(c){a._options.showFilter!=c&&(a._options.showFilter=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});
Object.defineProperty(a,"showDefaultSlice",{get:function(){return a.getOption("showDefaultSlice")},set:function(c){a._options.showDefaultSlice!=c&&(a._options.showDefaultSlice=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showEmptyData",{get:function(){return a.getOption("showEmptyData")},set:function(c){a._options.showEmptyData!=c&&(a._options.showEmptyData=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showAggregations",
{get:function(){return a.getOption("showAggregations")},set:function(c){a._options.showAggregations!=c&&(a._options.showAggregations=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showHierarchyCaptions",{get:function(){return a.getOption("showHierarchyCaptions")},set:function(c){a._options.showHierarchyCaptions!=c&&(a._options.showHierarchyCaptions=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showExtraTotalLabels",{get:function(){return a.getOption("showExtraTotalLabels")},
set:function(c){a._options.showExtraTotalLabels!=c&&(a._options.showExtraTotalLabels=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showHeaders",{get:function(){return a.getOption("showHeaders")},set:function(c){a._options.showHeaders!=c&&(a._options.showHeaders=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"sorting",{get:function(){return a.getOption("sorting")},set:function(c){a._options.sorting!=c&&(a._options.sorting=
c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"drillThrough",{get:function(){return a.getOption("drillThrough")},set:function(c){a._options.drillThrough!=c&&(a._options.drillThrough=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showDrillThroughConfigurator",{get:function(){return a.getOption("showDrillThroughConfigurator")},set:function(c){a._options.showDrillThroughConfigurator!=c&&(a._options.showDrillThroughConfigurator=
c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showHierarchies",{get:function(){return a.getOption("showHierarchies")},set:function(c){a._options.showHierarchies!=c&&(a._options.showHierarchies=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"saveAllFormats",{get:function(){return a.getOption("saveAllFormats")},set:function(c){a._options.saveAllFormats!=c&&(a._options.saveAllFormats=c,a.dispatchReportChange())},enumerable:!0,
configurable:!0});Object.defineProperty(a,"showTotals",{get:function(){return a.getOption("showTotals")},set:function(c){a._options.showTotals!=c&&(a._options.showTotals=c,a.optionAffectedDataProvider=a.optionAffectDataProvider("showTotals"),a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showAutoCalculationBar",{get:function(){return a.getOption("showAutoCalculationBar")},set:function(c){if(a._options.showAutoCalculationBar!=c){var g=!utils.nullOrUndefined(a._options.showAutoCalculationBar);
a._options.showAutoCalculationBar=c;g&&a.dispatchReportChange()}},enumerable:!0,configurable:!0});Object.defineProperty(a,"showGrandTotals",{get:function(){return a.getOption("showGrandTotals")},set:function(c){a._options.showGrandTotals!=c&&(a._options.showGrandTotals=c,a.optionAffectedDataProvider=a.optionAffectDataProvider("showGrandTotals"),a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"datePattern",{get:function(){return a.getOption("datePattern")},set:function(c){a._options.datePattern!=
c&&(a._options.datePattern=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"dateTimePattern",{get:function(){return a.getOption("dateTimePattern")},set:function(c){a._options.dateTimePattern!=c&&(a._options.dateTimePattern=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showCalculatedValuesButton",{get:function(){return a.getOption("showCalculatedValuesButton")},set:function(c){a._options.showCalculatedValuesButton!=c&&(a._options.showCalculatedValuesButton=
c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"selectEmptyCells",{get:function(){return a.getOption("selectEmptyCells")},set:function(c){a._options.selectEmptyCells!=c&&(a._options.selectEmptyCells=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"defaultHierarchySortName",{get:function(){return a.getOption("defaultHierarchySortName")},set:function(c){a._options.defaultHierarchySortName!=c&&(a._options.defaultHierarchySortName=
c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showAggregationLabels",{get:function(){return a.getOption("showAggregationLabels")},set:function(c){a._options.showAggregationLabels!=c&&(a._options.showAggregationLabels=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"grandTotalsPosition",{get:function(){return a.getOption("grandTotalsPosition")},set:function(c){a._options.grandTotalsPosition!=c&&(a._options.grandTotalsPosition=
c,a.optionAffectedDataProvider=a.optionAffectDataProvider("grandTotalsPosition"),a.dispatchReportChange())},enumerable:!0,configurable:!0});Object.defineProperty(a,"showReportFiltersArea",{get:function(){return a.getOption("showReportFiltersArea")},set:function(c){a._options.showReportFiltersArea!=c&&(a._options.showReportFiltersArea=c,a.dispatchReportChange())},enumerable:!0,configurable:!0});a.dispatchReportChange=function(){a.dispatchSuspended||a.getInstance().dispatch(new events._Event(e._state.StateEvent.REPORT_CHANGED))};
a.optionAffectedDataProvider=!1;a.dispatchSuspended=!1;a._optionsAffectDataProvider=["gridType","showTotals","showGrandTotals","grandTotalsPosition"];a.defaultDatePattern="dd/MM/yyyy";a.defaultDateTimePattern="dd/MM/yyyy HH:mm:ss";return a}(events.EventDispatcher);h.OptionsManager=f})(e._options||(e._options={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(){function a(){this._defaults={configuratorActive:!1,configuratorOpened:!1,configuratorButton:!0,gridType:d._view.grid.GridType.COMPACT,gridTitle:"",showFilter:!0,showDefaultSlice:!0,showEmptyData:!0,showAggregations:!0,showHierarchyCaptions:!0,drillthroughMaxRows:1E3,showHeaders:!0,showReportFiltersArea:!0,showExtraTotalLabels:!1,drillThrough:!0,showDrillThroughConfigurator:!0,sorting:"on",showHierarchies:!0,saveAllFormats:!1,showTotals:"on",
showGrandTotals:"on",showAutoCalculationBar:!0,datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy HH:mm:ss",showCalculatedValuesButton:!0,selectEmptyCells:!0,defaultHierarchySortName:d.data_.consts.SortType.ASC,showAggregationLabels:!0,grandTotalsPosition:"top"}}a.prototype.setDefaults=function(){for(var c in this._defaults)this[c]=this._defaults[c]};a.prototype.cleanFromDefaults=function(){for(var c in this._defaults)this[c]==this._defaults[c]&&(this[c]=void 0)};a.fromObject=function(c){var g=
new a;if(void 0==c)return g;null!=c.options&&(c=c.options);c instanceof a||(c=a.toPlainObject(c));null!=c.configuratorActive&&(g.configuratorActive=c.configuratorActive);null!=c.configuratorButton&&(g.configuratorButton=c.configuratorButton);null!=c.gridTitle&&(g.gridTitle=c.gridTitle);null!=c.gridType&&(g.gridType=c.gridType);null!=c.showFilter&&(g.showFilter=c.showFilter);null!=c.showDefaultSlice&&(g.showDefaultSlice=c.showDefaultSlice);null!=c.showEmptyData&&(g.showEmptyData=c.showEmptyData);null!=
c.showAggregations&&(g.showAggregations=c.showAggregations);null!=c.showHierarchyCaptions&&(g.showHierarchyCaptions=c.showHierarchyCaptions);null!=c.showHeaders&&(g.showHeaders=c.showHeaders);null!=c.showReportFiltersArea&&(g.showReportFiltersArea=c.showReportFiltersArea);null!=c.showExtraTotalLabels&&(g.showExtraTotalLabels=c.showExtraTotalLabels);null!=c.drillThrough&&(g.drillThrough=c.drillThrough);null!=c.showDrillThroughConfigurator&&(g.showDrillThroughConfigurator=c.showDrillThroughConfigurator);
null!=c.sorting&&(g.sorting=c.sorting,"true"==g.sorting.toString().toLowerCase()&&(g.sorting="on"),"false"==g.sorting.toString().toLowerCase()&&(g.sorting="off"));null!=c.showHierarchies&&(g.showHierarchies=c.showHierarchies);null!=c.saveAllFormats&&(g.saveAllFormats=c.saveAllFormats);null!=c.showTotals&&(g.showTotals=c.showTotals,"true"==g.showTotals.toString().toLowerCase()&&(g.showTotals="on"),"false"==g.showTotals.toString().toLowerCase()&&(g.showTotals="off"));null!=c.showGrandTotals&&(g.showGrandTotals=
c.showGrandTotals,"true"==g.showGrandTotals.toString().toLowerCase()&&(g.showGrandTotals="on"),"false"==g.showGrandTotals.toString().toLowerCase()&&(g.showGrandTotals="off"));null!=c.showAutoCalculationBar&&(g.showAutoCalculationBar=c.showAutoCalculationBar);null!=c.datePattern&&(g.datePattern=c.datePattern);null!=c.dateTimePattern&&(g.dateTimePattern=c.dateTimePattern);null!=c.showCalculatedValuesButton&&(g.showCalculatedValuesButton=c.showCalculatedValuesButton);null!=c.selectEmptyCells&&(g.selectEmptyCells=
c.selectEmptyCells);null!=c.defaultHierarchySortName&&(g.defaultHierarchySortName=c.defaultHierarchySortName);null!=c.showAggregationLabels&&(g.showAggregationLabels=c.showAggregationLabels);null!=c.grandTotalsPosition&&(g.grandTotalsPosition=c.grandTotalsPosition);return g};a.toPlainObject=function(c){var a={};if(void 0==c)return a;null!=c.configuratorActive&&(a.configuratorActive=c.configuratorActive);null!=c.configuratorButton&&(a.configuratorButton=c.configuratorButton);null!=c.showAggregations&&
(a.showAggregations=c.showAggregations);null!=c.showCalculatedValuesButton&&(a.showCalculatedValuesButton=c.showCalculatedValuesButton);null!=c.drillThrough&&(a.drillThrough=c.drillThrough);null!=c.showDrillThroughConfigurator&&(a.showDrillThroughConfigurator=c.showDrillThroughConfigurator);null!=c.sorting&&(a.sorting=c.sorting);null!=c.datePattern&&(a.datePattern=c.datePattern);null!=c.dateTimePattern&&(a.dateTimePattern=c.dateTimePattern);null!=c.saveAllFormats&&(a.saveAllFormats=c.saveAllFormats);
null!=c.showDefaultSlice&&(a.showDefaultSlice=c.showDefaultSlice);null!=c.showEmptyData&&(a.showEmptyData=c.showEmptyData);null!=c.defaultHierarchySortName&&(a.defaultHierarchySortName=c.defaultHierarchySortName);null!=c.selectEmptyCells&&(a.selectEmptyCells=c.selectEmptyCells);null!=c.showAggregationLabels&&(a.showAggregationLabels=c.showAggregationLabels);null!=c.classicView&&(a.classicView=c.classicView);null!=c.flatView&&(a.flatView=c.flatView);null!=c.gridType&&(a.gridType=c.gridType);null!=
c.gridTitle&&(a.gridTitle=c.gridTitle);null!=c.showFilter&&(a.showFilter=c.showFilter);null!=c.showHeaders&&(a.showHeaders=c.showHeaders);null!=c.showTotals&&(a.showTotals=c.showTotals);null!=c.showGrandTotals&&(a.showGrandTotals=c.showGrandTotals);null!=c.showAutoCalculationBar&&(a.showAutoCalculationBar=c.showAutoCalculationBar);null!=c.grandTotalsPosition&&(a.grandTotalsPosition=c.grandTotalsPosition);null!=c.showExtraTotalLabels&&(a.showExtraTotalLabels=c.showExtraTotalLabels);null!=c.showHierarchies&&
(a.showHierarchies=c.showHierarchies);null!=c.showHierarchyCaptions&&(a.showHierarchyCaptions=c.showHierarchyCaptions);null!=c.drillthroughMaxRows&&(a.drillthroughMaxRows=c.drillthroughMaxRows);null!=c.showReportFiltersArea&&(a.showReportFiltersArea=c.showReportFiltersArea);null!=c.grid&&(c=c.grid,null!=c.type&&(a.gridType=c.type),null!=c.title&&(a.gridTitle=c.title),null!=c.showFilter&&(a.showFilter=c.showFilter),null!=c.showHeaders&&(a.showHeaders=c.showHeaders),null!=c.showAutoCalculationBar&&
(a.showAutoCalculationBar=c.showAutoCalculationBar),null!=c.showTotals&&(a.showTotals=c.showTotals,"true"==a.showTotals.toString().toLowerCase()&&(a.showTotals="on"),"false"==a.showTotals.toString().toLowerCase()&&(a.showTotals="off")),null!=c.showGrandTotals&&(a.showGrandTotals=c.showGrandTotals,"true"==a.showGrandTotals.toString().toLowerCase()&&(a.showGrandTotals="on"),"false"==a.showGrandTotals.toString().toLowerCase()&&(a.showGrandTotals="off")),null!=c.grandTotalsPosition&&(a.grandTotalsPosition=
c.grandTotalsPosition),null!=c.showExtraTotalLabels&&(a.showExtraTotalLabels=c.showExtraTotalLabels),null!=c.showHierarchies&&(a.showHierarchies=c.showHierarchies),null!=c.showHierarchyCaptions&&(a.showHierarchyCaptions=c.showHierarchyCaptions),null!=c.drillthroughMaxRows&&(a.drillthroughMaxRows=c.drillthroughMaxRows),null!=c.showReportFiltersArea&&(a.showReportFiltersArea=c.showReportFiltersArea));return a};a.prototype.toObject=function(){var c={},a={};this.gridType===d._view.grid.GridType.COMPACT?
a.type=d._view.grid.GridType.COMPACT:this.gridType===d._view.grid.GridType.CLASSIC?a.type=d._view.grid.GridType.CLASSIC:this.gridType===d._view.grid.GridType.FLAT&&(a.type=d._view.grid.GridType.FLAT);null!=this.gridTitle&&(a.title=this.gridTitle);null!=this.showFilter&&(a.showFilter=this.showFilter);null!=this.showHeaders&&(a.showHeaders=this.showHeaders);null!=this.showTotals&&(a.showTotals=this.showTotals);null!=this.showGrandTotals&&(a.showGrandTotals=this.showGrandTotals);null!=this.grandTotalsPosition&&
(a.grandTotalsPosition=this.grandTotalsPosition);null!=this.showExtraTotalLabels&&(a.showExtraTotalLabels=this.showExtraTotalLabels);null!=this.showHierarchies&&(a.showHierarchies=this.showHierarchies);null!=this.showHierarchyCaptions&&(a.showHierarchyCaptions=this.showHierarchyCaptions);null!=this.drillthroughMaxRows&&(a.drillthroughMaxRows=this.drillthroughMaxRows);null!=this.showReportFiltersArea&&(a.showReportFiltersArea=this.showReportFiltersArea);null!=this.showAutoCalculationBar&&(a.showAutoCalculationBar=
this.showAutoCalculationBar);utils.ObjectUtils.isEmptyObject(a)||(c.grid=a);null!=this.configuratorActive&&(c.configuratorActive=this.configuratorActive);null!=this.configuratorButton&&(c.configuratorButton=this.configuratorButton);null!=this.showAggregations&&(c.showAggregations=this.showAggregations);null!=this.showCalculatedValuesButton&&(c.showCalculatedValuesButton=this.showCalculatedValuesButton);null!=this.drillThrough&&(c.drillThrough=this.drillThrough);null!=this.showDrillThroughConfigurator&&
(c.showDrillThroughConfigurator=this.showDrillThroughConfigurator);null!=this.sorting&&(c.sorting=this.sorting);null!=this.datePattern&&(c.datePattern=this.datePattern);null!=this.dateTimePattern&&(c.dateTimePattern=this.dateTimePattern);null!=this.saveAllFormats&&(c.saveAllFormats=this.saveAllFormats);null!=this.showDefaultSlice&&(c.showDefaultSlice=this.showDefaultSlice);null!=this.showEmptyData&&(c.showEmptyData=this.showEmptyData);null!=this.defaultHierarchySortName&&(c.defaultHierarchySortName=
this.defaultHierarchySortName);null!=this.selectEmptyCells&&(c.selectEmptyCells=this.selectEmptyCells);null!=this.showAggregationLabels&&(c.showAggregationLabels=this.showAggregationLabels);return c};a.prototype.mergeWith=function(c){for(var a in c)this._defaults.hasOwnProperty(a)&&void 0!=c[a]&&(this[a]=c[a])};return a}();e.OptionsValueObject=b})(e.vo||(e.vo={}))})(e._options||(e._options={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(b){function a(){var c=b.call(this)||this;if(null!=a.instance)throw Error("Singleton");return c}__extends(a,b);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.dispose=function(){a.conditions=null;a.instance=null};a.add=function(c){null!=c&&(a.conditions.addItem(c.id,c),this.dispatchReportChange())};a.get=function(c){return a.conditions.getItem(c)};a.remove=function(c){a.conditions.removeItem(c);this.dispatchReportChange()};
a.removeAll=function(){a.conditions=new utils.AssociativeArray;this.dispatchReportChange()};a.getObjects=function(){for(var c=[],g=0;g<a.conditions.length;g++){var b=a.conditions.getItemAt(g);b.isUpdate||c.push(b.toObject())}return c};a.dispatchReportChange=function(){a.getInstance().dispatchWith(d._state.StateEvent.REPORT_CHANGED)};a.conditions=new utils.AssociativeArray;return a}(events.EventDispatcher);h.ConditionManager=f})(d.condition||(d.condition={}))})(d.model||(d.model={}))})(pivot||(pivot=
{}));
(function(d){(function(e){(function(e){(function(e){var b=function(){function c(){this.id="";this.column=this.row=-1;this.formula=this.hierarchy=this.member=this.measure="";this.params=[]}Object.defineProperty(c.prototype,"isUpdate",{get:function(){return-1<this.formula.toLowerCase().indexOf(d.data_.consts.FunctionName.UPDATE_DIFFERENCE)||-1<this.formula.toLowerCase().indexOf(d.data_.consts.FunctionName.UPDATE_PERCENT)},enumerable:!0,configurable:!0});c.prototype.toObject=function(){var c={};c.id=
this.id;c.row=this.row;c.column=this.column;void 0!==this.isTotal&&(c.isTotal=this.isTotal);c.measure=this.measure;c.member=this.member;c.hierarchy=this.hierarchy;c.formula=this.formula;null!=this.format&&(c.format=this.format.toObject(),c.formatCSS=this.format.toString());return c};c.toObject=function(c){return c.toObject()};c.fromObject=function(g){var b=new c;b.id=null!=g.id?g.id:utils.StringUtils.generateID();null!=g.row&&(b.row=g.row);null!=g.column&&(b.column=g.column);if(null!=g.isTotal){if(!0==
g.isTotal||1==g.isTotal)b.isTotal=!0;if(!1==g.isTotal||0==g.isTotal)b.isTotal=!1}null!=g.measure&&(b.measure=g.measure);b.formula=g.formula;null!=g.trueStyle&&null==g.format&&(g.format=g.trueStyle);null!=g.format&&(b.format="string"===typeof g.format?a.fromString(g.format):a.fromObject(g.format));g=new utils.Lexer;b.params=g.parse(b.formula);return null==b.params?null:b};return c}();e.ConditionValueObject=b;var a=function(){function c(){}c.fromObject=function(a){var b=new c;if(null==a)return b;null!=
a.backgroundColor&&(b.backgroundColor=c.color(a.backgroundColor));null!=a.color&&(b.color=c.color(a.color));null!=a.fontFamily&&(b.fontFamily=a.fontFamily);null!=a.fontSize&&(b.fontSize=c.size(a.fontSize));null!=a.italic&&a.italic&&(b.fontStyle="italic");null!=a.fontStyle&&(b.fontStyle=a.fontStyle);null!=a.bold&&a.bold&&(b.fontWeight="bold");null!=a.fontWeight&&(b.fontWeight=a.fontWeight);null!=a.padding&&(b.padding=c.size(Math.round(1.5*a.padding)));null!=a.textAlign&&(b.textAlign=a.textAlign);null!=
a.textIndent&&(b.textIndent=c.size(a.textIndent));return b};c.fromString=function(a){var b={};a=a.split(";");if(null!=a)for(var d=0;d<a.length;d++){var e=a[d].split(":")[0],f=a[d].split(":")[1];""!=e&&(b[e]=f)}return c.fromObject(b)};c.prototype.toObject=function(){var c={};null!=this.backgroundColor&&(c.backgroundColor=this.backgroundColor);null!=this.color&&(c.color=this.color);null!=this.fontFamily&&(c.fontFamily=this.fontFamily);null!=this.fontSize&&(c.fontSize=this.fontSize);null!=this.fontStyle&&
(c.fontStyle=this.fontStyle);null!=this.fontWeight&&(c.fontWeight=this.fontWeight);null!=this.padding&&(c.padding=this.padding);null!=this.textAlign&&(c.textAlign=this.textAlign);null!=this.textIndent&&(c.textIndent=this.textIndent);return c};c.prototype.toCSSObject=function(){var c={};null!=this.backgroundColor&&(c["background-color"]=this.backgroundColor);null!=this.color&&(c.color=this.color);null!=this.fontFamily&&(c["font-family"]=this.fontFamily);null!=this.fontSize&&(c["font-size"]=this.fontSize);
null!=this.fontStyle&&(c["font-style"]=this.fontStyle);null!=this.fontWeight&&(c["font-weight"]=this.fontWeight);null!=this.padding&&(c.padding=this.padding);null!=this.textAlign&&(c["text-align"]=this.textAlign);null!=this.textIndent&&(c["text-indent"]=this.textIndent);return c};c.prototype.toString=function(){var c="",a=this.toCSSObject(),b;for(b in a)c+=b+":"+a[b]+";";return c};c.color=function(c){return c.replace("0x","#")};c.size=function(c){return"number"==typeof c?c+"px":"string"==typeof c&&
0>c.indexOf("px")?c.trim()+"px":c};return c}();e.CSSValueObject=a})(e.vo||(e.vo={}))})(e.condition||(e.condition={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;if(null!=a.instance)throw Error("Singleton");return c}__extends(a,b);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.dispose=function(){a.rowFilterSizes=null;a.rowHeaderSizes=null;a.rowSizes=null;a.rowSizesByIdx=null;a._rowSizesNamed=null;a._rowSizesNamedToApply=null;a.columnHeaderSizes=null;a.columnSizes=null;a.columnSizesByIdx=null;a._columnSizesNamed=null;a._columnSizesNamedToApply=
null;a.instance=null};Object.defineProperty(a,"rowSizesNamed",{get:function(){return this._rowSizesNamed=a.toNamedSizes(d.data_.consts.AxisName.ROWS_AXIS)},enumerable:!0,configurable:!0});Object.defineProperty(a,"columnSizesNamed",{get:function(){return this._columnSizesNamed=a.toNamedSizes(d.data_.consts.AxisName.COLUMNS_AXIS)},enumerable:!0,configurable:!0});a.clear=function(){a.rowSizes={};a.columnSizes={};a._rowSizesNamedToApply={};a._rowSizesNamed={};a._columnSizesNamedToApply={};a._columnSizesNamed=
{};a.rowSizesByIdx={};a.columnSizesByIdx={};a.rowHeaderSizes={};a.columnHeaderSizes={};a.rowFilterSizes={}};a.applySizes=function(c,g,b,d,e,f,h){if(a.basedOnNamesArray(c)||a.basedOnNamesArray(g))a._rowSizesNamedToApply=a.convertSizes(c),a._columnSizesNamedToApply=a.convertSizes(g),a.processSizes();else if(a.basedOnNamesObject(c)||a.basedOnNamesObject(g))a._rowSizesNamedToApply=c,a._columnSizesNamedToApply=g,a.processSizes();a.rowSizesByIdx=b;a.columnSizesByIdx=d;a.rowHeaderSizes=e;a.columnHeaderSizes=
f;a.rowFilterSizes=h};a.processSizes=function(){if(e.PivotModel.getInstance().state_.reportState==e._state.StateEvent.REPORT_COMPLETE)this.onDataLoaded();else d.data_.Cube.getInstance().addEventListener(d.data_.DataEvent.QUERY_COMPLETE,a.onDataLoaded,1)};a.basedOnNamesArray=function(c){var a=/[A-Za-z]+/,b;for(b in c)if(-1<c[b].toString().search(a))return!0;return!1};a.basedOnNamesObject=function(c){var a=/[A-Za-z]+/,b;for(b in c)if(-1<b.toString().search(a))return!0;return!1};a.convertSizes=function(c){var a=
{};if(null!=c)for(var b in c){var d=c[b];if(d instanceof Array&&0<d.length){var e=parseInt(d.pop());a[d.toString()]=e}}return a};a.onDataLoaded=function(){d.data_.Cube.getInstance().removeEventListener(d.data_.DataEvent.QUERY_COMPLETE,a.onDataLoaded);a.rowSizes=a.fromNamedSizes(d.data_.consts.AxisName.ROWS_AXIS);a._rowSizesNamedToApply={};a.columnSizes=a.fromNamedSizes(d.data_.consts.AxisName.COLUMNS_AXIS);a._columnSizesNamedToApply={}};a.fromNamedSizes=function(c){var g={},b=c==d.data_.consts.AxisName.ROWS_AXIS?
a._rowSizesNamedToApply:a._columnSizesNamedToApply,k;for(k in b){var l=k.split(","),f=b[k],h=d.data_.Cube.getInstance().slice_.axes.getItem(c).hasMeasures,n;h&&!e._options.OptionsManager.flatView&&(n=l[l.length-1],l.splice(l.length-1,1));for(var p=!1,q=[],t=0;t<l.length;t++)if(e._options.OptionsManager.flatView)if(c==d.data_.consts.AxisName.ROWS_AXIS)q.push(l[t]);else{var u=l[t],u=d.data_.Cube.getInstance().localDataStorage.keys.indexOf(u);if(-1==u){p=!0;break}q.push(u)}else{u=l[t];u=(c==d.data_.consts.AxisName.ROWS_AXIS?
d.data_.Cube.getInstance().slice_.rowsOnly.getItemAt(t):d.data_.Cube.getInstance().slice_.columnsOnly.getItemAt(t)).members.getItem(u);if(null==u){p=!0;break}u.isAll?q.push(""):q.push(u.ordinal.toString())}if(!p){if(h&&!e._options.OptionsManager.flatView){l=d.data_.Cube.getInstance().slice_.measures_.indexOf(n);if(""!=n&&-1==l)continue;q.push(l)}g[q.toString()]=f}}return g};a.toNamedSizes=function(c){var g={},b=c==d.data_.consts.AxisName.ROWS_AXIS?a.rowSizes:a.columnSizes,k;for(k in b){var l=k.split(","),
f=b[k],h=d.data_.Cube.getInstance().slice_.axes.getItem(c).hasMeasures,n;h&&!e._options.OptionsManager.flatView&&(n=parseInt(l[l.length-1]),l.splice(l.length-1,1));for(var p=!1,q=[],t=0;t<l.length;t++)if(e._options.OptionsManager.flatView)if(c==d.data_.consts.AxisName.ROWS_AXIS)q.push(l[t]);else{var u=""===l[t]?0:parseInt(l[t]),u=d.data_.Cube.getInstance().localDataStorage.keys[u];if(null==u){p=!0;break}q.push(u)}else{var u=""===l[t]?0:parseInt(l[t]),v=c==d.data_.consts.AxisName.ROWS_AXIS?d.data_.Cube.getInstance().slice_.rowsOnly.getItemAt(t):
d.data_.Cube.getInstance().slice_.columnsOnly.getItemAt(t);if(null==v){p=!0;break}u=v.members.getItemAt(u);if(null==u){p=!0;break}q.push(u.uniqueName)}if(!p){if(h&&!e._options.OptionsManager.flatView){if(n>=d.data_.Cube.getInstance().slice_.measures_.length)continue;-1==n&&1==d.data_.Cube.getInstance().slice_.measures_.length&&(n=0);q.push(d.data_.Cube.getInstance().slice_.measures_.getKeyAt(n))}g[q.toString()]=f}}return g};a.rowSizes={};a.columnSizes={};a._rowSizesNamedToApply={};a._rowSizesNamed=
{};a._columnSizesNamedToApply={};a._columnSizesNamed={};a.startTableRow=0;a.rowSizesByIdx={};a.columnSizesByIdx={};a.rowHeaderSizes={};a.columnHeaderSizes={};a.rowFilterSizes={};return a}(events.EventDispatcher);h.SizesManager=f})(e.sizes||(e.sizes={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){}b.run=function(a,c,g,m){var k=this;d.preloader(!0,e._labels.Labels.MESSAGE_PLEASE_WAIT,"...",!0,!0);b.clear();b.grid=a;b.dataHeight=m;b.dataWidth=g;b.coords=a.gridLayout.coords;b.exportOptions=c;b.pdf=new jsPDF(c.pageOrientation,"mm","a4",!utils.browserVersion().isMsie);b.pageHeight=b.fullPageHeight-2*b.PAGE_MARGIN;b.pageWidth=b.fullPageWidth-2*b.PAGE_MARGIN;b.totalColumnCount=b.grid.FIRST_DATA_COLUMN+g;b.totalRowCount=b.grid.FIRST_DATA_ROW+
m;b.widthSize={};b.currentYPos=b.PAGE_MARGIN;try{b.calculateColumnCount(),b.getStyles(),b.createHeaderAndFooter(b.exportOptions.header,b.exportOptions.footer,function(){return k.onHeaderAndFooterCreated()})}catch(l){console.error("Export PDF error:",l),d.uialert(e._labels.Labels.MESSAGE_EXPORT_ERROR,e._labels.Labels.ERROR,d.AlertType.ERROR),d.preloader(!1),e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE)),b.clear()}};b.createHeaderAndFooter=function(a,c,g){try{b.headerHeight=
0;b.footerHeight=0;var m=null==a,k=null==c;if(m&&k)g();else{if(!m){a=a.replace(/##PAGE-NUMBER##/gi,(b.pageNumber+1).toString());a=a.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString());var e=new uicontrols.UIElement("div");e.css("position","absolute");e.css("background","white");e.setWidth(b.mm2px(b.fullPageWidth-2*b.HEADER_FOOTER_MARGIN));e.html(a);d._view.PivotView.stage.container.prepend(e);html2canvas(e.element).then(function(c){e.remove();b.headerImage=c;b.headerHeight=b.px2mm(c.height);
m=!0;k&&g()})}if(!k){c=c.replace(/##PAGE-NUMBER##/gi,(b.pageNumber+1).toString());c=c.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString());var f=new uicontrols.UIElement("div");f.css("position","absolute");f.css("background","white");f.setWidth(b.mm2px(b.fullPageWidth-2*b.HEADER_FOOTER_MARGIN));f.html(c);d._view.PivotView.stage.container.prepend(f);html2canvas(f.element).then(function(c){f.remove();b.footerImage=c;b.footerHeight=b.px2mm(c.height);k=!0;m&&g()})}}}catch(h){b.headerImage=null,b.headerHeight=
0,b.footerImage=null,b.footerHeight=0,g()}};b.addHeader=function(a,c){a.addImage(c,"JPEG",b.HEADER_FOOTER_MARGIN,b.HEADER_FOOTER_MARGIN)};b.addFooter=function(a,c){a.addImage(c,"JPEG",b.HEADER_FOOTER_MARGIN,b.fullPageHeight-b.footerHeight-b.HEADER_FOOTER_MARGIN)};b.addHeaderAndFooter=function(){null!=b.headerImage&&b.addHeader(b.pdf,b.headerImage);null!=b.footerImage&&b.addFooter(b.pdf,b.footerImage);b.pageHeight=b.fullPageHeight;b.pageHeight-=0==b.headerHeight?b.PAGE_MARGIN:b.headerHeight+2*b.HEADER_FOOTER_MARGIN;
b.pageHeight-=0==b.footerHeight?b.PAGE_MARGIN:b.footerHeight+2*b.HEADER_FOOTER_MARGIN;b.currentYPos=0==b.headerHeight?b.PAGE_MARGIN:b.headerHeight+2*b.HEADER_FOOTER_MARGIN};Object.defineProperty(b,"fullPageHeight",{get:function(){return"portrait"===b.exportOptions.pageOrientation?297:210},enumerable:!0,configurable:!0});Object.defineProperty(b,"fullPageWidth",{get:function(){return"portrait"===b.exportOptions.pageOrientation?210:297},enumerable:!0,configurable:!0});b.onHeaderAndFooterCreated=function(){b.addHeaderAndFooter();
b.addTitle(e._options.OptionsManager.gridTitle,b.pdf);utils.nullOrEmpty(e._options.OptionsManager.gridTitle)||0!=b.pageNumber||(b.currentYPos+=5);b.preprocessData();utils.ThreadManager.addTask(b.generateRow,null,null,function(){return b.onPdfGenerated()})};b.addTitle=function(a,c){if(!utils.nullOrEmpty(a)){c.setTextColor(0,0,0);c.setFontStyle("bold");c.setFontSize(12);var g=12*c.getStringUnitWidth(a)/c.internal.scaleFactor;c.text(a,(c.internal.pageSize.width-g)/2,b.currentYPos)}};b.getStyles=function(){var a=
b.grid.gridLayout,c=a.find("#wdr-data-sheet");b.cellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL,c);b.totalCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.TOTAL,c);b.rowHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_ROW,uicontrols.UIElement.convert(a.element));
b.columnHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_COLUMN,uicontrols.UIElement.convert(a.element));b.filterHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.FILTER_HEADER,uicontrols.UIElement.convert(a.element))};b.getColumnWidth=function(a){a=b.pixel2mm(b.grid.gridLayout.coords.getColWidth(a));
a=a<b.pageWidth?a:b.pageWidth-1;return 0.9*a};b.setDefaultCellStyle=function(a,c){if(null!=a&&a.isCustomized){var g=0<a.style.customStyleNames.length?d._view.grid.vo.StyleValueObject.fromClass(a.style.getCustomClassString()):d._view.grid.vo.StyleValueObject.fromString(a.style.getStyleString());g.merge(c);c=g}c.color=c.color||"rgb(0,0,0)";"rgb(33, 33, 33)"==c.backgroundColor&&(c.color="rgb(242, 242, 242)");c.backgroundColor=c.backgroundColor||"rgb(0,0,0,0)";c.borderColor=c.borderColor||"rgb(222,222,222)";
c.fontSize=c.fontSize||11;return c};b.getOptionsForCell=function(a){return{fontSize:0.85*a.fontSize,fontName:null==a.fontFamily?b.FONT_NAME:a.fontFamily,fontStyle:d._view.grid.vo.FontStylePDFType.getFontStyle(parseFloat(a.fontWeight))}};b.preprocessData=function(){b.heigthSize=Array(b.totalRowCount);for(var a=0,c=0,g=0,m;c<b.totalRowCount;){for(var g=a=0,k=0.8*Math.max(b.px2mm(b.coords.getRowHeight(c)),6);a<b.totalColumnCount;){m=b.grid.gridLayout.getCell(c,a,!0,!0);var e=new d._view.grid.vo.StyleValueObject,
e=b.cellStyle.clone(),e=b.setDefaultCellStyle(m,e);if(null!=m){var f=m.getLabel();"number"===typeof f&&(m.value=f,f+="",m.numeric=!0);f=f.replace(/<(?:.|\n)*?>/gi,"");m=null!=b.widthSize&&null!=b.widthSize[a]?b.widthSize[a]:b.getColumnWidth(a);e=b.pdf.splitTextToSize(f,m,b.getOptionsForCell(e));e=(1<e.length?b.px2mm(e.length*(11+2*b.PADDING)-2*b.PADDING):b.px2mm(11*e.length-b.PADDING))/k;e=1>e?k:(e+1)*k;e=e>b.pageHeight/2?(b.pageHeight-1)/2:e;g=e>g?e:g}a++}b.heigthSize[c]=g;c++}};b.generateRow=function(){if(b._addingHeaderFooter)return!1;
for(var a=utils.getTimer(),c=0;c<b.BLOCK_SIZE;c++){if(b.pageIsFilled&&(b.addNewPage(),b._addingHeaderFooter))return!1;var g=0,m=b.PAGE_MARGIN,k,g=!1,l="",f=b.currentRowIdx-b.currentStartRowIdx<b.grid.FIRST_DATA_ROW&&b.currentRowIdx>b.grid.START_HEADERS_COLUMN?b.currentRowIdx-b.currentStartRowIdx:b.currentRowIdx,h=b.heigthSize[f];for(b.currentColIdx=b.currentStartColIdx;b.currentColIdx<b.currentColumnCount+b.currentStartColIdx;)if(k=(g=e._options.OptionsManager.flatView?!1:b.currentColIdx==b.currentStartColIdx&&
b.currentColIdx>b.grid.START_HEADERS_COLUMN)?b.grid.START_HEADERS_COLUMN:b.currentColIdx,!b.allRowsGenerated()&&b.rowsHeightSum+h<=b.pageHeight){g=null!=b.widthSize&&null!=b.widthSize[k]?b.widthSize[k]:b.getColumnWidth(k);if(0.9*(m+g)>b.pageWidth)break;k=b.grid.gridLayout.getCell(f,k,!0,!0);l=utils.nullOrUndefined(k)?"":k.getLabel();"number"===typeof l&&(k.value=l,l+="",k.numeric=!0);var l=l.replace(/<(?:.|\n)*?>/gi,""),n=l.match(/&#(\d{3,4});/gi);if(n)for(var p,q=0;q<n.length;q++)p=parseInt(n[q].substring(2,
n[q].length-1)),l=l.replace(n[q],String.fromCharCode(p));n=[l];q=new d._view.grid.vo.StyleValueObject;null!=k&&k.isRowHeader?(q=b.rowHeaderCellStyle.clone(),q=b.setDefaultCellStyle(k,q),n=b.pdf.splitTextToSize(l,g,b.getOptionsForCell(q))):null!=k&&k.isColumnHeader?(q=b.columnHeaderCellStyle.clone(),q=b.setDefaultCellStyle(k,q),n=b.pdf.splitTextToSize(l,g,b.getOptionsForCell(q))):null!=k&&k.isFilterHeader?(q=b.filterHeaderCellStyle.clone(),q=b.setDefaultCellStyle(k,q)):null!=k&&k.isTotal&&""!=k.getLabel()?
(q=b.totalCellStyle.clone(),q=b.setDefaultCellStyle(k,q)):(q=b.cellStyle.clone(),q=b.setDefaultCellStyle(k,q),n=b.pdf.splitTextToSize(l,g,b.getOptionsForCell(q)));p=n.length;var t=1<p?b.px2mm(n.length*(q.fontSize+2*b.PADDING)-2*b.PADDING):b.px2mm(n.length*q.fontSize-b.PADDING);t>b.pageHeight/2&&(t=(b.pageHeight-20)/2,p=Math.floor(b.mm2px(t)/(q.fontSize+2*b.PADDING)));q.fontSize*=0.7;var u=d._view.grid.vo.StyleValueObject.parseRGB(q.backgroundColor);b.pdf.setFillColor(u[0],u[1],u[2],0!=u[3]?void 0:
0);u=d._view.grid.vo.StyleValueObject.parseRGB(q.borderColor);b.pdf.setDrawColor(u[0],u[1],u[2],0!=u[3]?void 0:0);u=d._view.grid.vo.StyleValueObject.parseRGB(q.color);b.pdf.setTextColor(u[0],u[1],u[2]);b.pdf.setFontStyle("bold"==q.fontWeight?"bold":"normal");b.pdf.setFontSize(q.fontSize);b.pdf.rect(m,b.currentYPos,g,h,"FD");t=b.currentYPos+(h-t)/2+b.PADDING;if("right"==q.textAlign)if(1<n.length)for(c=0;c<p;c++)b.pdf.text(n[c],m+g-b.PADDING,t,null,null,"right"),t+=2*b.PADDING;else b.pdf.text(l,m+g-
b.PADDING,t,null,null,"right");else if(1<n.length)for(c=0;c<p;c++)q=!e._options.OptionsManager.classicView&&null!=k&&0<k.level?(k.level+1)*b.PADDING:b.PADDING,b.pdf.text(n[c],m+q,t),t+=2*b.PADDING;else q=!e._options.OptionsManager.classicView&&null!=k&&0<k.level?(k.level+1)*b.PADDING:b.PADDING,b.pdf.text(l,m+q,t);b.currentColIdx++;m+=g}else{b.pageIsFilled=!0;break}b.pageIsFilled||(b.currentYPos+=h,b.rowsHeightSum+=h,b.currentRowIdx++);if(b.allColumnsGenerated()&&b.allRowsGenerated())break}b.BLOCK_SIZE=
utils.ThreadManager.adjustTaskSize(utils.getTimer()-a,b.BLOCK_SIZE);return b.allColumnsGenerated()&&b.allRowsGenerated()};b.allColumnsGenerated=function(){return b.currentStartColIdx+b.currentColumnCount>=b.dataWidth+b.grid.FIRST_DATA_COLUMN};b.allRowsGenerated=function(){return b.currentRowIdx>=b.dataHeight+b.grid.FIRST_DATA_ROW};b.addNewPage=function(){b.pdf.addPage();b.pageNumber++;b.pageIsFilled=!1;b._addingHeaderFooter=!0;b.createHeaderAndFooter(b.exportOptions.header,b.exportOptions.footer,
function(){b._addingHeaderFooter=!1;b.addHeaderAndFooter()});b.rowsHeightSum=0;1<b.pageNumber&&(b.shiftRows(),b.shiftColumns());d.preloader(!0,e._labels.Labels.MESSAGE_PLEASE_WAIT,b.pageNumber+1+" "+e._labels.Labels.MESSAGE_PAGES_WERE_GENERATED,!0)};b.shiftRows=function(){b.allColumnsGenerated()&&!b.allRowsGenerated()?(b.currentRowIdx-=b.grid.FIRST_DATA_ROW,b.currentStartRowIdx=b.currentRowIdx):b.currentRowIdx=b.currentStartRowIdx};b.shiftColumns=function(){b.allColumnsGenerated()?b.allRowsGenerated()||
(b.currentStartColIdx=0,b.currentColIdx=0):(b.currentStartColIdx+=b.currentColumnCount,b.currentColIdx=b.currentStartColIdx);b.calculateColumnCount()};b.calculateColumnCount=function(){b.currentColumnCount=0;var a=b.currentStartColIdx,c=0,g=0;if(e._options.OptionsManager.flatView?0:b.currentStartColIdx>=b.grid.FIRST_DATA_COLUMN)c=b.getColumnWidth(b.grid.START_HEADERS_COLUMN),g+=c,b.currentColumnCount++,b.currentStartColIdx--,b.currentColIdx--;for(;a<b.totalColumnCount;)if(c=b.getColumnWidth(a),c>
b.pageWidth/2-b.PAGE_MARGIN&&(c=(b.pageWidth+b.PAGE_MARGIN)/2,b.widthSize[a]=c),g+=c,g<=b.pageWidth)b.currentColumnCount++,a++;else{0==b.currentColumnCount&&(b.currentColumnCount=1);break}};b.onPdfGenerated=function(){0==b.exportOptions.filename.length&&(b.exportOptions.filename="pivot.pdf");var a=b.pdf.output(),a=utils.StringUtils.strToUint8Arr(a);h.ExportManager.save(a,b.exportOptions);b.clear();e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))};b.clear=function(){b.grid=
null;b.exportOptions=null;b.pdf=null;b.dataWidth=0;b.dataHeight=0;b.totalColumnCount=0;b.totalRowCount=0;b.currentColumnCount=0;b.currentColIdx=0;b.currentStartColIdx=0;b.currentRowIdx=0;b.currentStartRowIdx=0;b.rowsHeightSum=0;b.currentYPos=0;b.pageIsFilled=!1;b.pageNumber=0;b.pageHeight=0;b.pageWidth=0;b.headerHeight=0;b.headerImage=null;b.footerHeight=0;b.footerImage=null};b.pixel2mm=function(a){return 0.264*a};b.mm2px=function(a){return 3.779*a};b.px2mm=function(a){return a/3.779};b.FONT_NAME=
"Helvetica";b.PAGE_MARGIN=15;b.pageIsFilled=!1;b.pageNumber=0;b.HEADER_FOOTER_MARGIN=5;b.headerHeight=0;b.footerHeight=0;b._addingHeaderFooter=!1;b.BLOCK_SIZE=20;b.PADDING=b.pixel2mm(8);return b}();h.ExportPDF=f})(e._export||(e._export={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){throw Error("Singleton");}b.run=function(a,c,g,m){b.grid=a;b.dataWidth=g;b.dataHeight=m;b.exportOptions=c;try{b.exportToHTML()}catch(k){console.error("Export HTML error:",k),d.uialert(e._labels.Labels.MESSAGE_EXPORT_ERROR,e._labels.Labels.ERROR,d.AlertType.ERROR),d.preloader(!1),e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE)),b.clear()}};b.exportToHTML=function(){d.preloader(!0,e._labels.Labels.MESSAGE_EXPORT_PROGRESS);
b.htmlString="";b.rowIdx=b.grid.START_TABLE_ROW;b.stylesList=[];utils.ThreadManager.addTask(b.generateRow,null,null,b.onHTMLExportComplete)};b.generateStyle=function(){for(var a="",c=b.grid.gridLayout,g=c.find("#wdr-data-sheet"),a=a+utils.StringUtils.bind("body{{0}}\n",d._view.grid.vo.StyleValueObject.fromItemToString(uicontrols.UIElement.convert(c.element),["font-family"])),a=a+utils.StringUtils.bind(".grid{border-collapse:collapse;{0}border-top:1px solid #e9e9e9;border-left:1px solid #e9e9e9;}\n",
d._view.grid.vo.StyleValueObject.fromItemToString(uicontrols.UIElement.convert(c.element),["font-family","font-size","color"])),a=a+utils.StringUtils.bind(".title{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.TITLE,uicontrols.UIElement.convert(c.element))),a=a+utils.StringUtils.bind(".cell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL,g)),a=a+utils.StringUtils.bind(".totalCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+
" "+d._view.grid.vo.GridStyleName.TOTAL,g)),a=a+utils.StringUtils.bind(".rowHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_ROW,uicontrols.UIElement.convert(c.element))),a=a+utils.StringUtils.bind(".columnHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_COLUMN,
uicontrols.UIElement.convert(c.element))),a=a+utils.StringUtils.bind(".filterHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.FILTER_HEADER,uicontrols.UIElement.convert(c.element))),g=1;20>=g;g++)a+=utils.StringUtils.bind(".level{0}{{1}}\n",g,d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.HEADER_ROW+" "+d._view.grid.vo.GridStyleName.LEVEL+
g,uicontrols.UIElement.convert(c.element),["padding-left"]));for(g=0;g<b.stylesList.length;g++)a+=utils.StringUtils.bind(".{0}{{1}}\n",b.stylesList[g],d._view.grid.vo.StyleValueObject.fromClassToString(b.stylesList[g],uicontrols.UIElement.convert(c.element)));return a};b.appendStylesList=function(a){for(var c=0;c<a.length;c++)0>b.stylesList.indexOf(a[c])&&b.stylesList.push(a[c])};b.generateRow=function(){for(var a=utils.getTimer(),c=Math.min(b.rowIdx+b.BLOCK_SIZE,b.dataHeight+b.grid.FIRST_DATA_ROW),
g,m="";b.rowIdx<c;b.rowIdx++){for(var m="",d=b.grid.START_HEADERS_COLUMN;d<b.dataWidth+b.grid.FIRST_DATA_COLUMN;d++)if(g=b.grid.gridLayout.getCell(b.rowIdx,d,!0,!0),m+="<td {0}>"+(g?g.getLabel():"")+"</td>",null==g)m=utils.StringUtils.bind(m,"class='cell'");else{var e="",f="";g.isCustomized&&(f=g.style.getStyleString(),e=g.style.getCustomClassString(),b.appendStylesList(g.style.customStyleNames));e=g.isRowHeader?e+(" rowHeaderCell level"+g.level):g.isColumnHeader?e+" columnHeaderCell":g.isFilterHeader?
e+" filterHeaderCell":g.isTotal&&""!=g.getLabel()?e+" totalCell":e+" cell";null!=g&&g.isFilterHeader&&(e+=" level"+g.level);""!=e.trim()&&(e="class='"+e.trim()+"'");f+="width:"+b.grid.gridLayout.coords.getColWidth(d)+"px;";""!=f.trim()&&(f="style='"+f.trim()+"'");m=utils.StringUtils.bind(m,e+" "+f)}b.rowsString+="<tr>"+m+"</tr>"}b.BLOCK_SIZE=utils.ThreadManager.adjustTaskSize(utils.getTimer()-a,b.BLOCK_SIZE);b.showProgress(b.rowIdx);return b.rowIdx>=b.dataHeight+b.grid.FIRST_DATA_ROW};b.showProgress=
function(a){d.preloader(!0,e._labels.Labels.MESSAGE_EXPORT_PROGRESS,utils.StringUtils.bind("{0}%",(a/(b.dataHeight+b.grid.FIRST_DATA_ROW)*100).toFixed(0)))};b.onHTMLExportComplete=function(){d.preloader(!1);b.saveHTMLExport();b.clear()};b.saveHTMLExport=function(){0==b.exportOptions.filename.length&&(b.exportOptions.filename="pivotgrid.html");var a="";if(!utils.nullOrEmpty(b.exportOptions.header))var c=b.exportOptions.header,c=c.replace(/##PAGE-NUMBER##/gi,""),c=c.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString()),
a=a+c;a+="<div class='title'>"+e._options.OptionsManager.gridTitle+"</div>";a+="<table class='grid'>"+b.rowsString+"</table>";utils.nullOrEmpty(b.exportOptions.footer)||(c=b.exportOptions.footer,c=c.replace(/##PAGE-NUMBER##/gi,""),c=c.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString()),a+=c);b.htmlString="<!DOCTYPE html><html><head><meta charset='UTF-8'/>";b.htmlString+="<title>"+(utils.nullOrEmpty(e._options.OptionsManager.gridTitle)?e._labels.Labels.DEFAULT_EXPORT_TITLE:e._options.OptionsManager.gridTitle)+
"</title>";b.htmlString+="<style>"+b.generateStyle()+"</style></head>";b.htmlString+="<body>"+a+"</body></html>";h.ExportManager.save(b.htmlString,b.exportOptions);e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))};b.clear=function(){b.rowIdx=0;b.htmlString="";b.rowsString="";b.dataWidth=0;b.dataHeight=0;b.grid=null;b.exportOptions=null};b.rowIdx=0;b.htmlString="";b.rowsString="";b.BLOCK_SIZE=20;return b}();h.ExportHTML=f})(e._export||(e._export={}))})(d.model||
(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){throw Error("Singleton");}b.run=function(a,c,g,m){b.grid=a;b.dataWidth=g;b.dataHeight=m;b.exportOptions=c;try{b.exportToXLS()}catch(k){console.error("Export XLS error:",k),d.uialert(e._labels.Labels.MESSAGE_EXPORT_ERROR,e._labels.Labels.ERROR,d.AlertType.ERROR),d.preloader(!1),e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))}};b.exportToXLS=function(){d.preloader(!0,e._labels.Labels.MESSAGE_EXPORT_PROGRESS);
b.rowIdx=b.grid.START_TABLE_ROW;b.xlsPadding=0;b.xlsDocument=new xls.XLS;var a=utils.nullOrEmpty(e._options.OptionsManager.gridTitle)?e._labels.Labels.DEFAULT_EXPORT_TITLE:e._options.OptionsManager.gridTitle.replace(/[^a-zA-Z\d\s\-|+@#$^&()_,.!]/g,""),a=0<b.exportOptions.excelSheetName.length?b.exportOptions.excelSheetName:a;30<a.length&&(a=a.substr(0,27)+"...");a=new xls.XLSSheet(a);b.xlsDocument.sheets.push(a);b.getStyles();b.addTitle();b.addXLSCustomFields();b.addFilters();utils.ThreadManager.addTask(b.generateXLSRow,
null,null,function(){return b.onXLSExportComplete()})};b.getStyles=function(){var a=b.grid.gridLayout.element;b.cellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL,uicontrols.UIElement.convert(a));b.totalCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.TOTAL,uicontrols.UIElement.convert(a));b.rowHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+
d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_ROW,uicontrols.UIElement.convert(a));b.columnHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_COLUMN,uicontrols.UIElement.convert(a));b.filterHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.FILTER_HEADER,
uicontrols.UIElement.convert(a));for(var c=1;20>=c;c++)b.rowHeaderLevelsCellStyle[c]=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_ROW+" "+d._view.grid.vo.GridStyleName.LEVEL+c,uicontrols.UIElement.convert(a))};b.onXLSExportComplete=function(){b.mergeTitleCells();d.preloader(!1);b.saveXLSExport()};b.saveXLSExport=function(){b.rowIdx=b.grid.START_TABLE_ROW;0==b.exportOptions.filename.length&&
(b.exportOptions.filename="pivot.xlsx");h.ExportManager.save(b.xlsDocument.toUint8Array(),b.exportOptions);b.xlsDocument=null;b.exportOptions=null;e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))};b.generateXLSRow=function(){for(var a=utils.getTimer(),c=b.dataHeight+b.grid.FIRST_DATA_ROW;b.rowIdx<c;b.rowIdx++){if(100<utils.getTimer()-a){a=b.rowIdx/c*100;if(100<a)return!1;d.preloader(!0,e._labels.Labels.MESSAGE_EXPORT_PROGRESS,utils.StringUtils.bind("{0}% ({1} rows)",
a.toFixed(0),b.rowIdx.toString()));break}for(var g=b.grid.START_HEADERS_COLUMN;g<b.dataWidth+b.grid.FIRST_DATA_COLUMN;g++){var m=b.grid.gridLayout.getCell(b.rowIdx,g,!0,!0),k=utils.nullOrUndefined(m)?"":m.getLabel(),l;utils.nullOrUndefined(m)||null!=m.measure&&(m.measure.type==d.data_.types.MeasureType.DATE?isNaN(m.value)||(l=b.convertToExcelDate(m.value)):m.measure.type==d.data_.types.MeasureType.DATETIME&&(isNaN(m.value)||(l=b.convertToExcelDateTime(m.value))));"number"===typeof k&&(m.value=k,k+=
"",m.numeric=!0);var f=null!=m&&(m.isRowHeader||m.isColumnHeader);b.exportOptions.excelExportAll&&""==k&&null!=m&&null!=m.member&&(k=m.member.caption);if(""!=k.trim()||f){f=new d._view.grid.vo.StyleValueObject;f=null!=m&&m.isRowHeader?0<m.level&&b.rowHeaderLevelsCellStyle[m.level]?b.rowHeaderLevelsCellStyle[m.level].clone():b.rowHeaderCellStyle.clone():null!=m&&m.isColumnHeader?b.columnHeaderCellStyle.clone():null!=m&&m.isFilterHeader?b.filterHeaderCellStyle.clone():null!=m&&m.isTotal&&""!=m.getLabel()?
b.totalCellStyle.clone():b.cellStyle.clone();if(null!=m&&m.isCustomized){var h=0<m.style.customStyleNames.length?d._view.grid.vo.StyleValueObject.fromClass(m.style.getCustomClassString()):d._view.grid.vo.StyleValueObject.fromString(m.style.getStyleString());h.merge(f);f=h}f.color=f.color||"rgb(0,0,0)";"rgb(33, 33, 33)"==f.backgroundColor&&(f.color="rgb(242, 242, 242)");f.backgroundColor=f.backgroundColor||"rgb(255,255,255)";f.fontSize=f.fontSize?b.px2pt(f.fontSize):8;var n=new xls.styles.fonts.XLSStyleFont("Tahoma",
f.fontSize,utils.StringUtils.fromRgbToHex(f.color));n.bold="bold"==f.fontWeight;n.italic=!1;var p=null,q=h=!1;if(m.numeric){if(null!=m.measure){var p=m.measure.getFormat(),q=""!=p.nullValue?!0:q,h=m.measure.aggregation==d.data_.consts.AggregationName.PERCENT||m.measure.aggregation==d.data_.consts.AggregationName.PERCENT_COLUMN||m.measure.aggregation==d.data_.consts.AggregationName.PERCENT_ROW||m.measure.aggregation==d.data_.consts.AggregationName.PERCENT_DIFFERENCE||m.measure.calculated&&-1<m.measure.formula.indexOf("percent"),
t=p.toXLSFormatCode();if(h||p.isPercent)p=p.clone(),p.currencySymbol=""==p.currencySymbol?"%":p.currencySymbol,t=p.toXLSFormatCode();p=new xls.styles.format.XLSStyleFormat(""==t?0:-1,t)}}else null==m.measure||m.measure.type!=d.data_.types.MeasureType.DATE&&m.measure.type!=d.data_.types.MeasureType.DATETIME||(p=new xls.styles.format.XLSStyleFormat(14,""));p&&b.xlsDocument.styleSheet.addFormat(p);n=new xls.styles.XLSStyle(n,utils.StringUtils.fromRgbToHex(f.backgroundColor),p,f.textAlign);!e._options.OptionsManager.classicView&&
m&&m.isRowHeader&&0<m.level&&(n.textIndent=m.level);b.xlsDocument.styleSheet.addStyle(n);p=null!=m.measure?m.measure.getFormat():null;m.numeric?null==p||m.label!=p.infinityValue&&m.label!=p.divideByZeroValue?(l=null==p||!h&&"%"!=p.currencySymbol?m.value:m.value/100,b.xlsDocument.sheets[0].setCell(b.rowIdx-b.grid.START_TABLE_ROW+b.xlsPadding,g,isNaN(m.value)&&q?m.getLabel():l,n)):b.xlsDocument.sheets[0].setCell(b.rowIdx-b.grid.START_TABLE_ROW+b.xlsPadding,g,m.getLabel(),n):!m.isValue||null==m.measure||
m.measure.type!=d.data_.types.MeasureType.DATE&&m.measure.type!=d.data_.types.MeasureType.DATETIME?m.isValue&&null!=m.measure&&m.measure.aggregation==d.data_.consts.AggregationName.NONE?b.xlsDocument.sheets[0].setCell(b.rowIdx-b.grid.START_TABLE_ROW+b.xlsPadding,g,m.value,n):b.xlsDocument.sheets[0].setCell(b.rowIdx-b.grid.START_TABLE_ROW+b.xlsPadding,g,k,n):b.xlsDocument.sheets[0].setCell(b.rowIdx-b.grid.START_TABLE_ROW+b.xlsPadding,g,l,n);null!=m&&(0==b.xlsDocument.sheets[0].getColumnWidth(g)&&(m=
b.convertPixelsToWidth(b.grid.gridLayout.coords.getColWidth(g)),b.xlsDocument.sheets[0].setColumnWidth(g,m)),g!=b.grid.START_HEADERS_COLUMN||b.grid.gridLayout.coords.isRowHeightDefault(b.rowIdx)||(m=b.convertPixelsToPoints(b.grid.gridLayout.coords.getRowHeight(b.rowIdx)),b.xlsDocument.sheets[0].setRowHeight(b.rowIdx+b.xlsPadding,m)),k.length>f.width&&b.xlsDocument.sheets[0].setColumnWidth(g,b.convertPixelsToPoints(k.length+b.cellPadding)>b.convertPixelsToPoints(b.DEFAULT_CELL_WIDTH)?b.convertPixelsToPoints(b.DEFAULT_CELL_WIDTH):
b.convertPixelsToPoints(k.length+b.cellPadding)))}}}return b.rowIdx>=c};b.convertToExcelDate=function(a){if(!utils.DateFormat.isUTCFormat(e._options.OptionsManager.datePattern)){var c=(new Date(a)).getTimezoneOffset();a-=6E4*c}a=-Date.parse("1899-12-30")+a;return Math.floor(a/864E5)};b.convertToExcelDateTime=function(a){if(!utils.DateFormat.isUTCFormat(e._options.OptionsManager.dateTimePattern)){var c=(new Date(a)).getTimezoneOffset();a-=6E4*c}return(-Date.parse("1899-12-30")+a)/864E5};b.px2pt=function(a){return 0.75*
a};b.convertPixelsToPoints=function(a){return 0>=a?0:b.defaultExcelCellHeightPoints/b.defaultExcelCellHeightPixels*a*(b.defaultExcelCellHeightPixels/d._view.grid.sheet.GridCoords.CELL_HEIGHT)};b.convertPixelsToWidth=function(a){return 0>=a?0:((a-5)/7*100+0.5)/100};b.addXLSCustomFields=function(){var a=e.report.CustomFieldsManager.customFields;if(0<a.length){var c=getComputedStyle(d._view.PivotView.stage.container.find("."+d._view.grid.vo.GridStyleName.HEADER_COLUMN).element),g=new xls.styles.fonts.XLSStyleFont(c.fontFamily,
parseInt(c.fontSize)-2,utils.StringUtils.fromRgbToHex(c.color));g.bold="bold"===c.fontWeight;g.italic="italic"===c.fontStyle;g=new xls.styles.XLSStyle(g,utils.StringUtils.fromRgbToHex(c.backgroundColor));g.textAlign=c.textAlign;b.xlsDocument.styleSheet.addStyle(g);b.xlsDocument.sheets[0].setCell(b.xlsPadding,0,"Report Information",g);b.xlsDocument.sheets[0].setCell(b.xlsPadding,1,"",g);var c=getComputedStyle(d._view.PivotView.stage.container.find("."+d._view.grid.vo.GridStyleName.CELL).element),m=
new xls.styles.fonts.XLSStyleFont(c.fontFamily,parseInt(c.fontSize)-2,utils.StringUtils.fromRgbToHex(c.color));m.bold="bold"===c.fontWeight;m.italic="italic"===c.fontStyle;m=new xls.styles.XLSStyle(m,utils.StringUtils.fromRgbToHex(c.backgroundColor));m.textAlign=c.textAlign;b.xlsDocument.styleSheet.addStyle(m);for(c=0;c<a.length;c++)b.xlsDocument.sheets[0].setCell(c+1+b.xlsPadding,0,String(a[c].name),g),b.xlsDocument.sheets[0].setCell(c+1+b.xlsPadding,1,String(a[c].value),g)}b.xlsPadding+=0==a.length?
0:a.length+2};b.addTitle=function(){var a=e._options.OptionsManager.gridTitle;if(0!=a.length){var c=getComputedStyle(d._view.PivotView.stage.container.find("."+d._view.grid.vo.GridStyleName.TITLE).element),g=new xls.styles.fonts.XLSStyleFont(c.fontFamily,parseInt(c.fontSize)-2,utils.StringUtils.fromRgbToHex(c.color));g.bold="bold"===c.fontWeight;g.italic="italic"===c.fontStyle;c=new xls.styles.XLSStyle(g,utils.StringUtils.fromRgbToHex(c.backgroundColor));c.textAlign="center";b.xlsDocument.styleSheet.addStyle(c);
b.xlsDocument.sheets[0].setCell(0,0,a,c);b.xlsPadding=1}};b.mergeTitleCells=function(){if(0<e._options.OptionsManager.gridTitle.length){var a=b.xlsDocument.sheets[0];a.mergeCells(0,0,Math.min(a.columnsCount,10))}};b.addFilters=function(){if(b.exportOptions.showFilters){var a=e.PivotModel.getInstance().cube_.slice_.allHierarchies(),c=[],g="",m,k=!0,l=getComputedStyle(d._view.PivotView.stage.container.find("."+d._view.grid.vo.GridStyleName.HEADER).element),f=new xls.styles.fonts.XLSStyleFont(l.fontFamily,
parseInt(l.fontSize)-2,utils.StringUtils.fromRgbToHex(l.color));f.bold="bold"===l.fontWeight;f.italic="italic"===l.fontStyle;f=new xls.styles.XLSStyle(f,utils.StringUtils.fromRgbToHex(l.backgroundColor));f.textAlign=l.textAlign;b.xlsDocument.styleSheet.addStyle(f);var h=getComputedStyle(d._view.PivotView.stage.container.find("."+d._view.grid.vo.GridStyleName.CELL).element),l=new xls.styles.fonts.XLSStyleFont(h.fontFamily,parseInt(h.fontSize)-2,utils.StringUtils.fromRgbToHex(h.color));l.bold="bold"===
h.fontWeight;l.italic="italic"===h.fontStyle;l=new xls.styles.XLSStyle(l,utils.StringUtils.fromRgbToHex(h.backgroundColor));l.textAlign=h.textAlign;b.xlsDocument.styleSheet.addStyle(l);for(var h=b.xlsDocument.sheets[0],g=!1,n=0,p=0;p<a.length;p++)if(m=a.getItemAt(p),g=m.dimension.type==d.data_.types.DimensionType.MD_DIMTYPE_TIME,m.hasFilter()){c.length=0;if(g)g=b.composeDateRange(m);else{for(var q=0;q<m.filterMembers.length;q++)g=m.filterMembers.getItemAt(q),c.push(g.caption);g=c.join(", ")}k&&(h.setCell(n+
b.xlsPadding,0,"",f),h.setCell(n+b.xlsPadding,1,"Filters",f),n++);h.setCell(n+b.xlsPadding,0,m.caption,f);h.setCell(n+b.xlsPadding,1,g,l);n++;k=!1}if(e._options.OptionsManager.gridType==d._view.grid.GridType.FLAT)for(a=e.PivotModel.getInstance().cube_.slice_.measuresAll,p=0;p<a.length;p++)if(m=e.PivotModel.getInstance().cube_.slice_.measureToHierarchy(a.getItemAt(p)),m.hasFilter()){for(q=c.length=0;q<m.filterMembers.length;q++)g=m.filterMembers.getItemAt(q),c.push(g.caption);g=c.join(", ");k&&(h.setCell(n+
b.xlsPadding,0,"",f),h.setCell(n+b.xlsPadding,1,"Filters",f),n++);h.setCell(n+b.xlsPadding,0,m.caption,f);h.setCell(n+b.xlsPadding,1,g,l);n++;k=!1}b.xlsPadding+=k?0:n+1}};b.composeDateRange=function(a){var c,g,m,d=!1,e=[],d=g="";null!=b.sortedMembers&&(b.sortedMembers.length=0);b.sortMembers(a.allMember);for(var f=b.composeFilteredMembers(a),h=!1,n=0;n<b.sortedMembers.length;n++)g=b.sortedMembers[n],d=n==b.sortedMembers.length-1,!h&&a.filterMembers.keyExists(g.uniqueName)&&(h=!0,c=g),h&&(a.filterMembers.keyExists(g.uniqueName)&&
(m=g),-1<f.indexOf(g)&&!d||(m=null!=m?m:c,g=b.composeDate(c),d=m.uniqueName!=c.uniqueName?":"+b.composeDate(m,!0):"",m=c=null,h=!1,e.push(g+d)));return e.join(", ")};b.sortMembers=function(a){null==b.sortedMembers&&(b.sortedMembers=[]);a.isAll||b.sortedMembers.push(a);a=a.hierarchy_.sortChildren(a,!1,d.data_.consts.SortType.ASC);for(var c=a.length,g,m=0;m<c;m++)g=a.getItemAt(m),0<g.children.length?b.sortMembers(g):b.sortedMembers.push(g)};b.composeDate=function(a,c){void 0===c&&(c=!1);var g=a,b=[];
for(b.push(a.caption);g&&g.uniqueName!=a.uniqueName&&!g.level.isLast&&0<g.children.length;)b.push(g.caption),g=g.hierarchy_.sortChildren(g,!1,d.data_.consts.SortType.ASC),g=g.getItemAt(c?g.length-1:0);for(g=a.parent;g&&!g.isAll;)b.unshift(g.caption),g=g.parent;return b.join("-")};b.composeFilteredMembers=function(a){var c=[];a=a.filterMembers;for(var g,b,d=0;d<a.length;d++){g=a.getItemAt(d);c.push(g);b=g.descendants;for(var e=0;e<b.length;e++)c.push(b.getItemAt(e));if(!(g.parent&&!g.parent.isAll&&
-1<c.indexOf(g.parent)))for(;g.parent&&!g.parent.isAll;)g=g.parent,c.push(g)}return c};b.rowIdx=0;b.xlsPadding=0;b.cellPadding=3;b.DEFAULT_CELL_WIDTH=100;b.rowHeaderLevelsCellStyle=[];b.defaultExcelCellHeightPoints=14.3;b.defaultExcelCellHeightPixels=38;return b}();h.ExportXLS=f})(e._export||(e._export={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function c(){}c.exportTo=function(g,m,k){void 0===m&&(m=null);void 0===k&&(k=null);c._exportInProgress?this.delayedExports.push({type:g,options:m,callback:k}):(g=g.toLowerCase(),g=a.validType(g)?g:a.PDF,e.PivotModel.getInstance().addEventListener(d.PivotEvent.EXPORT_COMPLETE,c.exportCompleteHandler),c._exportInProgress=!0,c.callbackHandler=k,utils.nullOrUndefined(m)&&(m=new h.ExportOptions),m.type=g,g=new b(g,m,k),e.PivotModel.getInstance().dispatch(g))};
c.stopExport=function(){d.preloader(!1);e.PivotModel.getInstance().removeEventListener(d.PivotEvent.EXPORT_COMPLETE,c.exportCompleteHandler);c._exportInProgress=!1};c.onExportCompleted=function(a){c.stopExport();0<c.delayedExports.length&&(a=c.delayedExports.shift(),this.exportTo(a.type,a.options,a.callback))};c.save=function(a,b){switch(b.destinationType.toLowerCase()){case e.report.DestinationType.FILE:c.saveToFile(a,b);break;case e.report.DestinationType.SERVER:c.saveToServer(a,b);break;case e.report.DestinationType.BINARY:c.saveToBinary(a,
b);break;case e.report.DestinationType.PLAIN:c.saveToPlain(a,b);break;default:c.saveToFile(a,b)}};c.saveToServer=function(g,b){switch(b.type){case a.HTML:case a.EXCEL:case a.PDF:c.saveToServerAsBinary(g,b);break;default:var k=e.XSSCheck.validate(b.type);d.uialert("Unknown type of export: '"+k+"'",e._labels.Labels.ERROR)}};c.saveToFile=function(g,b){var k;switch(b.type){case a.HTML:k="text/html;charset=utf-8";b.filename=c.appendFileExtension(b.filename,".html");break;case a.EXCEL:k="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
b.filename=c.appendFileExtension(b.filename,".xlsx");break;case a.PDF:k="application/pdf";b.filename=c.appendFileExtension(b.filename,".pdf");break;default:k="text/plain;charset=utf-8"}var l=[g];try{var f=new Blob(l,{type:k});savingAs(f,b.filename);c.triggerCallback({data:g,fielname:b.filename,type:b.type})}catch(h){d.uialert(e._labels.Labels.MESSAGE_CANT_SAVE_FILE,e._labels.Labels.ERROR,d.AlertType.ERROR),c.triggerCallback(null,{message:e._labels.Labels.MESSAGE_CANT_SAVE_FILE})}};c.appendFileExtension=
function(c,a){c.indexOf(a)!=c.length-a.length&&(c+=a);return c};c.saveToServerAsBinary=function(a,b){var k=new utils.Timer(500);k.addEventListener(utils.TimerEvent.TIMER,function(c){d.preloader(!0,e._labels.Labels.MESSAGE_UPLOADING,(k.currentCount/10).toString()+" sec")});var l=new misc.URLStream;l.addEventListener(events._Event.ERROR,function(a){d.uialert(e._labels.Labels.MESSAGE_CANT_SAVE_FILE,e._labels.Labels.ERROR);k.stop();d.preloader(!1);c.triggerCallback(null,{message:e._labels.Labels.MESSAGE_CANT_SAVE_FILE})});
l.addEventListener(events._Event.COMPLETE,function(){k.stop();d.preloader(!1);c.triggerCallback({data:a,fielname:b.filename,type:b.type,response:l.response})});var f=new Blob([a],{type:"application/octet-binary"}),h=new FormData;h.append("filedata",f,b.filename);for(var n in b.extendedParameters)h.append(n,b.extendedParameters[n]);l.requestMethod=misc.URLRequestMethod.POST;l.data=h;l.contentType=!1;l.load(b.url);k.start()};c.saveToBinary=function(c,a){};c.saveToPlain=function(c,a){};c.triggerCallback=
function(a,b){void 0===a&&(a=null);void 0===b&&(b=null);null!=c.callbackHandler&&c.callbackHandler.call(null,a,b)};c._exportInProgress=!1;c.delayedExports=[];c.exportCompleteHandler=function(a){return c.onExportCompleted(a)};return c}();h.ExportManager=f;var b=function(c){function a(g,b,e){var f=c.call(this,d.PivotEvent.EXPORT)||this;f.exportType=g;f.exportOptions=b;f.callbackHandler=e;return f}__extends(a,c);return a}(events._Event);h.ExportEvent=b;var a=function(){function c(){}c.validType=function(a){return a===
c.EXCEL||a===c.HTML||a===c.PDF};c.EXCEL="excel";c.HTML="html";c.PDF="pdf";return c}();h.ExportType=a})(e._export||(e._export={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(){function b(a){void 0===a&&(a="file");this.showHeaders=!0;this.destinationType=d.model.report.DestinationType.FILE;this.filename="";this.url="()";this.type=e.ExportType.HTML;this.pageOrientation="portrait";this.excelSheetName="";this.showFilters=this.excelExportAll=!1;this.extendedParameters={};this.destinationType=a}b.fromObject=function(a){var c=new b;if(utils.nullOrUndefined(a))return c;a.hasOwnProperty("showHeaders")&&(c.showHeaders="true"===
a.showHeaders||!0===a.showHeaders);a.hasOwnProperty("filename")&&(c.filename=a.filename);a.hasOwnProperty("url")&&(c.url=a.url);a.hasOwnProperty("excelSheetName")&&(c.excelSheetName=a.excelSheetName);a.hasOwnProperty("excelExportAll")&&(c.excelExportAll=a.excelExportAll);!a.hasOwnProperty("pageOrientation")||"portrait"!==a.pageOrientation&&"landscape"!==a.pageOrientation||(c.pageOrientation=a.pageOrientation.toLowerCase());a.hasOwnProperty("destinationType")&&d.model.report.DestinationType.validType(a.destinationType.toString().toLowerCase())&&
(c.destinationType=a.destinationType.toString().toLowerCase());void 0!=a.showFilters&&(c.showFilters=a.showFilters);void 0!=a.extendedParameters&&(c.extendedParameters=a.extendedParameters);void 0!=a.header&&(c.header=a.header);void 0!=a.footer&&(c.footer=a.footer);return c};return b}();e.ExportOptions=f})(e._export||(e._export={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.getFormat=function(a){return b.formats.keyExists(a)?b.formats.getItem(a):""!=a&&b.formats.keyExists("")?b.formats.getItem(""):b.getDefaultFormat()};b.setFormat=function(a){var c=d.vo.FormatValueObject.fromObject(a);b.cleanFormats.addItem(c.name,c);if(null!=b.defaultFormat)c.mergeDefaults(b.defaultFormat);else if(""==c.name)for(b.defaultFormat=a,a=0;a<b.formats.length;a++)b.formats.getItemAt(a).mergeDefaults(b.defaultFormat);b.formats.addItem(c.name,
c)};b.getAllFormats=function(){return b.cleanFormats.slice()};b.clear=function(){b.formats=new utils.AssociativeArray;b.cleanFormats=new utils.AssociativeArray;b.defaultFormat=null};b.getDefaultFormat=function(){return new d.vo.FormatValueObject};b.formatExists=function(a){return b.formats.keyExists(a)};b.dispose=function(){b.formats=null;b.cleanFormats=null;b.defaultFormat=null};b.formats=new utils.AssociativeArray;b.cleanFormats=new utils.AssociativeArray;b.defaultFormat=null;return b}();d.FormatManager=
e})(d.format||(d.format={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){(function(f){var b=function(){function a(c){void 0===c&&(c="");this.name="";this._params={};this._defaults={thousandsSeparator:" ",decimalSeparator:".",decimalPlaces:-1,maxDecimalPlaces:-1,maxSymbols:20,currencySymbol:"",currencySymbolAlign:"left",nullValue:"",infinityValue:"Infinity",divideByZeroValue:"Infinity",textAlign:"",isPercent:!1,isCount:!1};this.name=c}Object.defineProperty(a.prototype,"params",{get:function(){return this._params},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"thousandsSeparator",{get:function(){return void 0!=this._params.thousandsSeparator?this._params.thousandsSeparator:this._defaults.thousandsSeparator},set:function(c){this._params.thousandsSeparator=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"decimalSeparator",{get:function(){return void 0!=this._params.decimalSeparator?this._params.decimalSeparator:this._defaults.decimalSeparator},set:function(c){this._params.decimalSeparator=c},enumerable:!0,
configurable:!0});Object.defineProperty(a.prototype,"decimalPlaces",{get:function(){return void 0!=this._params.decimalPlaces?this._params.decimalPlaces:this._defaults.decimalPlaces},set:function(c){this._params.decimalPlaces=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maxDecimalPlaces",{get:function(){return void 0!=this._params.maxDecimalPlaces?this._params.maxDecimalPlaces:this._defaults.maxDecimalPlaces},set:function(c){this._params.maxDecimalPlaces=c},enumerable:!0,
configurable:!0});Object.defineProperty(a.prototype,"maxSymbols",{get:function(){return void 0!=this._params.maxSymbols?this._params.maxSymbols:this._defaults.maxSymbols},set:function(c){this._params.maxSymbols=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"currencySymbol",{get:function(){return void 0!=this._params.currencySymbol?this._params.currencySymbol:this._defaults.currencySymbol},set:function(c){this._params.currencySymbol=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"currencySymbolAlign",{get:function(){return void 0!=this._params.currencySymbolAlign?this._params.currencySymbolAlign:this._defaults.currencySymbolAlign},set:function(c){this._params.currencySymbolAlign=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"nullValue",{get:function(){return void 0!=this._params.nullValue?this._params.nullValue:this._defaults.nullValue},set:function(c){this._params.nullValue=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"infinityValue",
{get:function(){return void 0!=this._params.infinityValue?this._params.infinityValue:this._defaults.infinityValue},set:function(c){this._params.infinityValue=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"divideByZeroValue",{get:function(){return void 0!=this._params.divideByZeroValue?this._params.divideByZeroValue:this._defaults.divideByZeroValue},set:function(c){this._params.divideByZeroValue=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"textAlign",
{get:function(){return void 0!=this._params.textAlign?this._params.textAlign:this._defaults.textAlign},set:function(c){this._params.textAlign=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isPercent",{get:function(){return void 0!=this._params.isPercent?this._params.isPercent:this._defaults.isPercent},set:function(c){this._params.isPercent=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isCount",{get:function(){return void 0!=this._params.isCount?this._params.isCount:
this._defaults.isCount},set:function(c){this._params.isCount=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"currencySymbolLength",{get:function(){return 1<this.currencySymbol.length&&"&"==this.currencySymbol.charAt(0)&&";"==this.currencySymbol.charAt(this.currencySymbol.length-1)?1:this.currencySymbol.length},set:function(c){},enumerable:!0,configurable:!0});a.prototype.applyFormat=function(c){return utils.NumberFormatter.format(c,this)};a.prototype.toXLSFormatCode=function(){var c,
a="";if(-1==this.decimalPlaces&&""==this.currencySymbol)return"";if("%"==this.currencySymbol){var b=-1==this.decimalPlaces?0:this.decimalPlaces,a=0<b?"0.":"0";for(c=0;c<b;c++)a+="0";return a+=this.currencySymbol}a=""!=this.thousandsSeparator?"#,##0":"###0";if(0<this.decimalPlaces)for(a+=".",c=0;c<this.decimalPlaces;c++)a+="0";""!=this.currencySymbol&&(a="left"==this.currencySymbolAlign?"\\"+this.currencySymbol+a:a+"\\"+this.currencySymbol);return a};a.prototype.toObject=function(c){void 0===c&&(c=
!1);var a={};a.name=this.name;if(c)a.thousandsSeparator=this.thousandsSeparator,a.decimalSeparator=this.decimalSeparator,a.decimalPlaces=this.decimalPlaces,a.maxDecimalPlaces=this.maxDecimalPlaces,a.maxSymbols=this.maxSymbols,a.currencySymbol=this.currencySymbol,a.currencySymbolAlign=this.currencySymbolAlign,a.nullValue=this.nullValue,a.infinityValue=this.infinityValue,a.divideByZeroValue=this.divideByZeroValue,a.textAlign=""!=this.textAlign?this.textAlign:"right",a.isPercent=this.isPercent,a.isCount=
this.isCount;else for(var b in this._params)a[b]="textAlign"==b?""==this.textAlign?"right":this.textAlign:this._params[b];return a};a.fromObject=function(c){var g=new a;null!=c.name&&(g.name=c.name);null!=c.thousandsSeparator&&d.XSSCheck.valid(c.thousandsSeparator)&&(g.thousandsSeparator=d.XSSCheck.validate(c.thousandsSeparator,!0));null!=c.decimalSeparator&&d.XSSCheck.valid(c.decimalSeparator)&&(g.decimalSeparator=d.XSSCheck.validate(c.decimalSeparator));null!=c.decimalPlaces&&-1<parseInt(c.decimalPlaces)&&
(g.decimalPlaces=isNaN(parseInt(c.decimalPlaces))?-1:parseInt(c.decimalPlaces));null!=c.maxDecimalPlaces&&-1<parseInt(c.maxDecimalPlaces)&&(g.maxDecimalPlaces=c.maxDecimalPlaces);null!=c.maxSymbols&&1<parseInt(c.maxSymbols)&&(g.maxSymbols=c.maxSymbols);null!=c.currencySymbol&&d.XSSCheck.valid(c.currencySymbol)&&(g.currencySymbol=d.XSSCheck.validate(c.currencySymbol,!0));null!=c.currencySymbolAlign&&d.XSSCheck.valid(c.currencySymbolAlign)&&(g.currencySymbolAlign=d.XSSCheck.validate(c.currencySymbolAlign));
null!=c.nullValue&&d.XSSCheck.valid(c.nullValue)&&(g.nullValue=d.XSSCheck.validate(c.nullValue));null!=c.infinityValue&&d.XSSCheck.valid(c.infinityValue)&&(g.infinityValue=d.XSSCheck.validate(c.infinityValue));null!=c.divideByZeroValue&&d.XSSCheck.valid(c.divideByZeroValue)&&(g.divideByZeroValue=d.XSSCheck.validate(c.divideByZeroValue));null!=c.textAlign&&d.XSSCheck.valid(c.textAlign)&&(g.textAlign=d.XSSCheck.validate(c.textAlign));null!=c.isPercent&&(g.isPercent=!0==c.isPercent);null!=c.isCount&&
(g.isCount=!0==c.isCount);return g};a.prototype.clone=function(){var c=new a;c.name=this.name;this._params.hasOwnProperty("thousandsSeparator")&&(c.thousandsSeparator=this.thousandsSeparator);this._params.hasOwnProperty("decimalSeparator")&&(c.decimalSeparator=this.decimalSeparator);this._params.hasOwnProperty("decimalPlaces")&&(c.decimalPlaces=this.decimalPlaces);this._params.hasOwnProperty("maxDecimalPlaces")&&(c.maxDecimalPlaces=this.maxDecimalPlaces);this._params.hasOwnProperty("maxSymbols")&&
(c.maxSymbols=this.maxSymbols);this._params.hasOwnProperty("currencySymbol")&&(c.currencySymbol=this.currencySymbol);this._params.hasOwnProperty("currencySymbolAlign")&&(c.currencySymbolAlign=this.currencySymbolAlign);this._params.hasOwnProperty("nullValue")&&(c.nullValue=this.nullValue);this._params.hasOwnProperty("infinityValue")&&(c.infinityValue=this.infinityValue);this._params.hasOwnProperty("divideByZeroValue")&&(c.divideByZeroValue=this.divideByZeroValue);this._params.hasOwnProperty("textAlign")&&
(c.textAlign=this.textAlign);this._params.hasOwnProperty("isPercent")&&(c.isPercent=this.isPercent);this._params.hasOwnProperty("isPercent")&&(c.isCount=this.isCount);var g={},b;for(b in this._defaults)g[b]=this._defaults[b];c._defaults=g;return c};a.prototype.mergeDefaults=function(c){for(var a in c)this._defaults[a]=c[a]};return a}();f.FormatValueObject=b})(h.vo||(h.vo={}))})(d.format||(d.format={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){var e=function(){function e(){}e.format=function(f,b,a,c,g){void 0===b&&(b=null);void 0===a&&(a=!1);void 0===c&&(c=!1);void 0===g&&(g=-1);null==b&&(b=e.defaultFormatVO);if(isNaN(f)||d.nullOrUndefined(f))return b.nullValue;if(Infinity==f)return b.infinityValue;if(f==pivot.data_.consts.DataConsts.DIVIDE_BY_ZERO)return b.divideByZeroValue;a||(a=b.isCount);f=b.isPercent&&"%"!=b.currencySymbol?100*f:f;var m=c?"%":b.currencySymbol,m=!c&&b.isPercent&&"%"!=b.currencySymbol?"%":m;b.currencySymbolAlign=
b.isPercent?"right":b.currencySymbolAlign;var k=a?0:b.decimalPlaces,l="";if(0==f&&0>k)return l="0",!a&&0<m.length&&(l=e.formatCurrency(l,m,b.currencySymbolAlign,c)),l;l=0>f?b.maxSymbols-1:b.maxSymbols;1<b.thousandsSeparator.length&&!d.StringUtils.isEntity(b.thousandsSeparator)&&(l-=Math.floor(l/3)*b.thousandsSeparator.length);!a&&0<b.currencySymbolLength&&(l-=b.currencySymbolLength);b.thousandsSeparator="&#39;"==b.thousandsSeparator?"'":b.thousandsSeparator;var s=f.toString().split(".");if(1<s.length&&
10<=s[1].length){for(var s=s[1],r=0,n=0,p=s.length-2;0<=p;p--)if("9"!=s.charAt(p)&&"0"!=s.charAt(p)||s.charAt(p)!=s.charAt(p+1))if(4>r)r=0;else{n=p+1;break}else r++;4<=r&&(s=Math.pow(10,n),f=Math.round(f*s)/s)}s=4<k?Math.pow(10,l-k-1):Math.pow(10,l-4);r=Math.pow(10,-(l-4));-1<g&&(k=g);Math.abs(f)>s?(g=Math.round(Math.log(f)/Math.LN10),g=Math.round(Math.log(g)/Math.LN10+1),l=0>f?b.maxSymbols-g-5:b.maxSymbols-g-4,20<l&&(l=20),1>l&&(l=1),l=f.toExponential(l)):Math.abs(f)<r&&0>k?(g=Math.round(Math.log(f)/
Math.LN10),g=Math.round(Math.log(-g)/Math.LN10+1),l=l-4-g,20<l&&(l=20),1>l&&(l=1),l=f.toExponential(l)):0>k?(g=1,1<Math.abs(f)?(g=Math.round(Math.log(Math.abs(f))/Math.LN10),g=Math.pow(10,l-g-2)):g=Math.pow(10,l-2),l=(Math.round(Math.abs(f)*g)/g).toString(),0>f&&(l="-"+l)):l=0==k?Math.round(f).toString():f.toFixed(k);-1==l.indexOf("e")&&(l=l.split("."),g=e.formatThousands(l[0],b),s=1<l.length?l[1]:"",(1<l.length||0<k)&&0!=b.maxDecimalPlaces?(-1<b.maxDecimalPlaces&&s.length>b.maxDecimalPlaces&&(s=
s.substr(0,b.maxDecimalPlaces)),l=g+b.decimalSeparator+s):l=g);!a&&0<m.length&&(l=e.formatCurrency(l,m,b.currencySymbolAlign,c));return l=e.checkNegativeZero(l,f)};e.formatThousands=function(d,b){void 0===b&&(b=null);var a=0>parseFloat(d);a&&(d=d.substr(1));var c=d;if(3<d.length){null==b&&(null==e.defaultFormatVO&&(e.defaultFormatVO=new pivot.model.format.vo.FormatValueObject("")),b=e.defaultFormatVO);var c=Math.floor(d.length/3),g=[],m=d.length%3;0<m&&g.push(d.substr(0,m));for(var k=0;k<c;k++)g.push(d.substr(m+
3*k,3));c=g.join(b.thousandsSeparator)}a&&(c="-"+c);return c};e.formatCurrency=function(d,b,a,c){return d="left"!=a||c?d+b:0==d.indexOf("-")?"-"+b+d.substr(1):b+d};e.checkNegativeZero=function(d,b){return 0<=b||-1==d.indexOf("-")||-1<d.search("[1-9]+")?d:d.replace("-","")};e.defaultFormatVO=new pivot.model.format.vo.FormatValueObject;return e}();d.NumberFormatter=e})(utils||(utils={}));
(function(d){(function(d){var h=function(){function f(){}f.getStructureLoader=function(b){var a=null;switch(b.dataSourceType){case d.consts.DataSourceType.CSV:a=!0==b.embedded?new d.csv.CSVEmbeddedLoader:new d.csv.CSVLoader;break;case d.consts.DataSourceType.JSON:a=new d.json.JSONLoader}return a};return f}();d.StructureLoaderFactory=h})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){var h=function(){return function(){this.mdx=this.type="";this.axisName=d.consts.AxisName.ROWS_AXIS;this.tuple=[]}}();d.Query=h})(d.data_||(d.data_={}))})(pivot||(pivot={}));(function(d){(function(d){var h=function(){function d(){}d.MEMBERS="members";d.ASCENDANTS="ascendants";d.DESCENDANTS="descendants";d.SIBLINGS="siblings";d.SEARCH="search";return d}();d.MembersLoaderState=h})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){var h=function(){function b(){}b.BEFORE_STRUCTURE_LOADING="BEFORE_STRUCTURE_LOADING";b.STRUCTURE_CONNECTED="STRUCTURE_CONNECTED";b.STRUCTURE_LOADED="STRUCTURE_LOADED";b.STRUCTURE_CANCELLED="STRUCTURE_CANCELLED";b.STRUCTURE_LOADING_FAILED="STRUCTURE_LOADING_FAILED";b.BEFORE_QUERY="BEFORE_QUERY";b.QUERY_COMPLETE="QUERY_COMPLETE";b.QUERY_ERROR="QUERY_ERROR";return b}();d.DataEvent=h;var f=function(b){function a(c){var a=b.call(this,h.BEFORE_QUERY)||this;a.queryType=c;return a}
__extends(a,b);return a}(events._Event);d.BeforeQueryEvent=f;f=function(b){function a(c){var a=b.call(this,h.QUERY_COMPLETE)||this;a.queryType=d.consts.QueryType.SELECT;a.queryType=c;return a}__extends(a,b);return a}(events._Event);d.QueryCompleteEvent=f})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c.rowTuples=[];c._rowTuples=[];c.columnTuples=[];c._columnTuples=[];c.rowDepths=[];c.rowType=[];c.columnDepths=[];c._name="";c.queryCompleteHandler=function(){return c.onQueryComplete()};c.beforeQueryHandler=function(a){return c.onBeforeQuery(a)};c.structureLoadedHandler=function(a){return c.onStructureLoaded()};c._rows=new utils.AssociativeArray;c._rowLevels=[];c._columnLevels=[];c._columns=new utils.AssociativeArray;
c._pages=new utils.AssociativeArray;c._measures=new utils.AssociativeArray;c._measuresPosition=0;c._dataLoaded=!1;c._rowMaxDepth=0;c._columnMaxDepth=0;c._measureDepth=0;c.queryType=e.consts.QueryType.SELECT;c._showUnexpandedDataAlert=!1;c._fillRowTuplesStart=0;a.counter++;c.cube_=e.Cube.getInstance();return c}__extends(a,b);a.getInstance=function(){null==a.instance&&(a.instance=new a,a.instance._name="grid"+a.counter);return a.instance};a.prototype.addEventListeners=function(){this.cube_.addEventListener(e.DataEvent.QUERY_COMPLETE,
this.queryCompleteHandler,1);this.cube_.addEventListener(e.DataEvent.BEFORE_QUERY,this.beforeQueryHandler);this.cube_.addEventListener(e.DataEvent.STRUCTURE_LOADED,this.structureLoadedHandler,1)};a.prototype.removeEventListeners=function(){this.cube_.removeEventListener(e.DataEvent.QUERY_COMPLETE,this.queryCompleteHandler);this.cube_.removeEventListener(e.DataEvent.BEFORE_QUERY,this.beforeQueryHandler);this.cube_.removeEventListener(e.DataEvent.STRUCTURE_LOADED,this.structureLoadedHandler)};Object.defineProperty(a.prototype,
"dataStorage",{get:function(){return null!=this._dataStorage?this._dataStorage:this.cube_.localDataStorage},set:function(c){this._dataStorage=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"slice",{get:function(){return null!=this._slice?this._slice:this.cube_.slice_},set:function(c){this._slice=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isClassic",{get:function(){return d.model._options.OptionsManager.classicView},set:function(c){},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"rows",{get:function(){return this._rows},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowsOnly",{get:function(){return this.slice.rowsOnly},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowLevels",{get:function(){return this._rowLevels},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnLevels",{get:function(){return this._columnLevels},set:function(c){},
enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columns",{get:function(){return this._columns},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnsOnly",{get:function(){return this.slice.columnsOnly},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"pages",{get:function(){return this._pages},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measures",{get:function(){return this._measures},
set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuresPosition",{get:function(){return this._measuresPosition},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataLoaded",{get:function(){return this.slice&&this._dataLoaded},set:function(c){this._dataLoaded=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowMaxDepth",{get:function(){return this._rowMaxDepth},set:function(c){},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"columnMaxDepth",{get:function(){return this._columnMaxDepth},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measureDepth",{get:function(){return this._measureDepth},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowAxis",{get:function(){return this._rowAxis},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnAxis",{get:function(){return this._columnAxis},
set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowCount",{get:function(){return this._rowAxis?this._rowAxis.hasMeasures?this._rowAxis.hierarchies.length-1:this._rowAxis.hierarchies.length:0},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnCount",{get:function(){return this._columnAxis?this._columnAxis.hasMeasures?this._columnAxis.hierarchies.length-1:this._columnAxis.hierarchies.length:0},set:function(c){},enumerable:!0,
configurable:!0});Object.defineProperty(a.prototype,"multiMeasures",{get:function(){return 1<this._measures.length||this._columnAxis.hasMeasures&&d.model._options.OptionsManager.showExtraTotalLabels},set:function(c){},enumerable:!0,configurable:!0});a.prototype.getExpandedRows=function(){return this._rowAxis&&!this.isAllExpanded()?this._rowAxis.expandedTuples:[]};a.prototype.setExpandedRows=function(c){this._rowAxis&&!this.isAllExpanded()&&(this._rowAxis.expandedTuples=c)};a.prototype.getExpandedColumns=
function(){return this._columnAxis&&!this.isAllExpanded()?this._columnAxis.expandedTuples:[]};a.prototype.setExpandedColumns=function(c){this._columnAxis&&!this.isAllExpanded()&&(this._columnAxis.expandedTuples=c)};a.prototype.getCollapsedRows=function(){return this._rowAxis&&this.isAllExpanded()?this._rowAxis.expandedTuples:[]};a.prototype.setCollapsedRows=function(c){this._rowAxis&&this.isAllExpanded()&&(this._rowAxis.expandedTuples=c)};a.prototype.getCollapsedColumns=function(){return this._columnAxis&&
this.isAllExpanded()?this._columnAxis.expandedTuples:[]};a.prototype.setCollapsedColumns=function(c){this._columnAxis&&this.isAllExpanded()&&(this._columnAxis.expandedTuples=c)};a.prototype.getDrilledDownRows=function(){return this._rowAxis&&!this.isAllDrilled()?this._rowAxis.drilledTuples:[]};a.prototype.setDrilledDownRows=function(c){this._rowAxis&&!this.isAllDrilled()&&(this._rowAxis.drilledTuples=c)};a.prototype.getDrilledDownColumns=function(){return this._columnAxis&&!this.isAllDrilled()?this._columnAxis.drilledTuples:
[]};a.prototype.setDrilledDownColumns=function(c){this._columnAxis&&!this.isAllDrilled()&&(this._columnAxis.drilledTuples=c)};a.prototype.getDrilledUpRows=function(){return this._rowAxis&&this.isAllDrilled()?this._rowAxis.drilledTuples:[]};a.prototype.setDrilledUpRows=function(c){this._rowAxis&&this.isAllDrilled()&&(this._rowAxis.drilledTuples=c)};a.prototype.getDrilledUpColumns=function(){return this._columnAxis&&this.isAllDrilled()?this._columnAxis.drilledTuples:[]};a.prototype.setDrilledUpColumns=
function(c){this._columnAxis&&this.isAllDrilled()&&(this._columnAxis.drilledTuples=c)};a.prototype.isAllDrilled=function(){return this.slice.drillAll};a.prototype.isAllExpanded=function(){return this.slice.expandAll};Object.defineProperty(a.prototype,"rowSortType",{get:function(){var c=e.consts.SortType.UNSORTED;this._rowAxis&&(c=this._rowAxis.sortType,c==e.consts.SortType.UNSORTED&&this._rowAxis.totalSortMeasure&&this._rowAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=this._rowAxis.totalSortType));
return c},set:function(c){this._rowAxis&&(this._rowAxis.sortType=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowSortTuple",{get:function(){var c;this._rowAxis&&(c=this._rowAxis.sortTuple,this._rowAxis.sortType==e.consts.SortType.UNSORTED&&this._rowAxis.totalSortMeasure&&this._rowAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=[]));return c},set:function(c){this._rowAxis&&(this._rowAxis.sortTuple=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowSortMeasure",
{get:function(){var c;this._rowAxis&&(c=this._rowAxis.sortMeasure,this._rowAxis.sortType==e.consts.SortType.UNSORTED&&this._rowAxis.totalSortMeasure&&this._rowAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=this._rowAxis.totalSortMeasure));return c},set:function(c){this._rowAxis&&(this._rowAxis.sortMeasure=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasRowSorting",{get:function(){if(this.rowSortType==e.consts.SortType.UNSORTED||null==this.rowSortTuple)return!1;if(1>this.rowSortTuple.length)return!0;
var c=!1;try{c=this.isRowExpanded(this.rowSortTuple.slice(0,this.rowSortTuple.length-1))}catch(a){}return c},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortType",{get:function(){var c=e.consts.SortType.UNSORTED;this._columnAxis&&(c=this._columnAxis.sortType,c==e.consts.SortType.UNSORTED&&this._columnAxis.totalSortMeasure&&this._columnAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=this._columnAxis.totalSortType));return c},set:function(c){this._columnAxis&&
(this._columnAxis.sortType=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortTuple",{get:function(){var c;this._columnAxis&&(c=this._columnAxis.sortTuple,this._columnAxis.sortType==e.consts.SortType.UNSORTED&&this._columnAxis.totalSortMeasure&&this._columnAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=[]));return c},set:function(c){this._columnAxis&&(this._columnAxis.sortTuple=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortMeasure",
{get:function(){var c;this._columnAxis&&(c=this._columnAxis.sortMeasure,this._columnAxis.sortType==e.consts.SortType.UNSORTED&&this._columnAxis.totalSortMeasure&&this._columnAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=this._columnAxis.totalSortMeasure));return c},set:function(c){this._columnAxis&&(this._columnAxis.sortMeasure=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasColumnSorting",{get:function(){if(this.columnSortType==e.consts.SortType.UNSORTED||null==this.columnSortTuple)return!1;
if(1>this.columnSortTuple.length)return!0;var c=!1;try{c=this.isColumnExpanded(this.columnSortTuple.slice(0,this.columnSortTuple.length-1))}catch(a){}return c},set:function(c){},enumerable:!0,configurable:!0});a.prototype.reset=function(c){void 0===c&&(c=!0);this.dataLoaded=!1;this._measures=new utils.AssociativeArray;this._rows=new utils.AssociativeArray;this._columns=new utils.AssociativeArray;this._pages=new utils.AssociativeArray;this._rowLevels=[];this._columnLevels=[];this._rowTuples=[];this._columnTuples=
[];this.rowTuples=[];this.columnTuples=[];this.rowDepths=[];this.columnDepths=[];this._columnMaxDepth=this._rowMaxDepth=0;this.rowType=[];c&&(this._columnAxis&&(this._columnAxis.expandedTuples=[]),this._rowAxis&&(this._rowAxis.expandedTuples=[]),this._columnAxis&&(this._columnAxis.drilledTuples=[]),this._rowAxis&&(this._rowAxis.drilledTuples=[]))};a.prototype.onBeforeQuery=function(c){this.queryType=c.queryType;this.dataLoaded=!1;c.queryType==e.consts.QueryType.SELECT&&this.reset();c.queryType!=e.consts.QueryType.DRILL_UP&&
c.queryType!=e.consts.QueryType.DRILL_DOWN||this.reset(!1)};a.prototype.onQueryComplete=function(){this.load()};a.prototype.onStructureLoaded=function(){this.dataLoaded=!1;this.reset()};a.prototype.load=function(){if(null==this.dataStorage&&(this.dataStorage=this.cube_.localDataStorage,null==this.dataStorage))return;if(this.slice){this._columnAxis=this.slice.findAxis(e.consts.AxisName.COLUMNS_AXIS);this._rowAxis=this.slice.findAxis(e.consts.AxisName.ROWS_AXIS);if(0==this.columnTuples.length&&0==this.rowTuples.length||
this.queryType==e.consts.QueryType.FILTER){this.isAllExpanded()?this.dataStorage.expandAll(this.slice.drillAll):(this.dataStorage.expand([],e.consts.AxisName.ROWS_AXIS,null),this.dataStorage.expand([],e.consts.AxisName.COLUMNS_AXIS,null));var c,a,b;(0<this.getDrilledDownRows().length||0<this.getDrilledUpRows().length)&&this._drillRows();(0<this.getDrilledDownColumns().length||0<this.getDrilledUpColumns().length)&&this._drillColumns();if(this.queryType==e.consts.QueryType.FILTER)if(this.slice.expandAll){var d=
this.getCollapsedRows();if(0<d.length)for(c=0;c<d.length;c++)try{a=this.slice.measures_.getItemAt(d[c][0]),b=d[c].slice(1),this.dataStorage.collapse(b,e.consts.AxisName.ROWS_AXIS,a)}catch(l){}d=this.getCollapsedColumns();if(0<this.getCollapsedColumns().length)for(c=0;c<this.getCollapsedColumns().length;c++)try{a=this.slice.measures_.getItemAt(d[c][0]),b=d[c].slice(1),this.dataStorage.collapse(b,e.consts.AxisName.COLUMNS_AXIS,a)}catch(f){}}else{d=this.getExpandedRows();if(0<d.length)for(c=0;c<d.length;c++)try{a=
this.slice.measures_.getItemAt(d[c][0]),b=d[c].slice(1),this.dataStorage.expand(b,e.consts.AxisName.ROWS_AXIS,a)}catch(h){}d=this.getExpandedColumns();if(0<d.length)for(c=0;c<d.length;c++)try{a=this.slice.measures_.getItemAt(d[c][0]),b=d[c].slice(1),this.dataStorage.expand(b,e.consts.AxisName.COLUMNS_AXIS,a)}catch(n){}}(0<this.getDrilledDownRows().length||0<this.getDrilledUpRows().length)&&this._drillRows();(0<this.getDrilledDownColumns().length||0<this.getDrilledUpColumns().length)&&this._drillColumns()}this.prepare();
this.dataLoaded=!0}else this._rowAxis=this._columnAxis=null};a.prototype._drillRows=function(){var c,a,b,d,l,f=this.rowAxis.hierarchies.slice();f.removeItem(e.Cube.MEASURES_NAME);if(this.isAllDrilled())for(var h=this.getDrilledUpRows(),n=0;n<h.length;n++)try{c=this.slice.measures_.getItemAt(h[n][0]),b=h[n].slice(2),d=f.getItemAt(b.length-1),l=d.members.getItem(h[n][1]),this.dataStorage.isRowDrilledDown(b,l,c)&&this.dataStorage.drillUp(b,l,e.consts.AxisName.ROWS_AXIS,c)}catch(p){}else for(h=this.getDrilledDownRows(),
n=0;n<h.length;n++)try{if("string"==typeof h[n][0]?(a=h[n][0],c=this.slice.measures_.getItemAt(h[n][1]),b=h[n].slice(3),d=f.getItemAt(b.length-1),l=d.members.getItem(h[n][2])):(c=this.slice.measures_.getItemAt(h[n][0]),b=h[n].slice(2),d=f.getItemAt(b.length-1),l=d.members.getItem(h[n][1])),void 0!==a)if(d.findLevel(a).num<l.level.num){var q=this.ascendantByLevel(l,a);b[b.length-1]=q.ordinal;d.drillUpMember(q);this.dataStorage.drillUp(b,q,e.consts.AxisName.ROWS_AXIS,c)}else this.dataStorage.drillDownTo(b,
l,e.consts.AxisName.ROWS_AXIS,a);else this.dataStorage.isRowDrilledDown(b,l,c)||(this.dataStorage.hierarchize(b,l,e.consts.AxisName.ROWS_AXIS),this.dataStorage.drillDown(b,l,e.consts.AxisName.ROWS_AXIS,c))}catch(t){}};a.prototype._drillColumns=function(){var c,a,b,d,l=this.columnAxis.hierarchies.slice();l.removeItem(e.Cube.MEASURES_NAME);if(this.isAllDrilled())for(var f=this.getDrilledUpColumns(),h=0;h<f.length;h++)try{c=this.slice.measures_.getItemAt(f[h][0]),a=f[h].slice(2),b=l.getItemAt(a.length-
1),d=b.members.getItem(f[h][1]),this.dataStorage.isColumnDrilledDown(a,d,c)&&this.dataStorage.drillUp(a,d,e.consts.AxisName.COLUMNS_AXIS,c)}catch(n){}else for(f=this.getDrilledDownColumns(),h=0;h<f.length;h++)try{c=this.slice.measures_.getItemAt(f[h][0]),a=f[h].slice(2),b=l.getItemAt(a.length-1),d=b.members.getItem(f[h][1]),this.dataStorage.isColumnDrilledDown(a,d,c)||(this.dataStorage.hierarchize(a,d,e.consts.AxisName.COLUMNS_AXIS),this.dataStorage.drillDown(a,d,e.consts.AxisName.COLUMNS_AXIS,c))}catch(p){}};
a.prototype.prepare=function(){this._showUnexpandedDataAlert=!1;this.slice?(this._measures=this.slice.measures_,this._measuresPosition=this._rowAxis.hasMeasures?this._rowAxis.measuresPosition:this._columnAxis.measuresPosition,this._rows=this.slice.rows,this._columns=this.slice.columns,this._pages=this.slice.pages):(this._measures=new utils.AssociativeArray,this._measuresPosition=0,this._rows=new utils.AssociativeArray,this._columns=new utils.AssociativeArray,this._pages=new utils.AssociativeArray);
this._rowLevels=[];this._columnLevels=[];this._rowTuples=[];this._columnTuples=[];this.rowTuples=[];this.columnTuples=[];this.rowDepths=[];this.columnDepths=[];this.rowType=[];this._columnMaxDepth=this._rowMaxDepth=0;var c=this.dataStorage.result[0],a=this.dataStorage.result[1],b;if(!utils.nullOrUndefined(this.slice)&&!this.slice.isEmpty){(!this._rowAxis.hasMeasures||1<this._rows.length||this.isClassic)&&this.fillRowTuples(c,[],0);if("on"==d.model._options.OptionsManager.showGrandTotals||"columns"==
d.model._options.OptionsManager.showGrandTotals||this._rowAxis.hasMeasures&&1==this._rows.length)this.rowTuples.push([]),this.rowDepths.push(0);if(!this.isClassic)if(this._rowAxis.hasMeasures&&this.multiMeasures){this.rowDepths=[];this.rowType=[];if(1<this._rows.length)for(0!=this.measuresPosition&&this.fillRowTuples1(c,[],-1,0),b=0;b<this._measures.length;b++)"on"==d.model._options.OptionsManager.showGrandTotals||"columns"==d.model._options.OptionsManager.showGrandTotals?(this._rowTuples.push([[],
b]),this.rowDepths.push(0)):0!=this._measuresPosition||"off"!=d.model._options.OptionsManager.showGrandTotals&&"rows"!=d.model._options.OptionsManager.showGrandTotals||(this._rowTuples.push([[],b]),this.rowDepths.push(0)),0==this.measuresPosition&&this.fillRowTuples1(c,[],b,1);if(0==this.measuresPosition&&("on"==d.model._options.OptionsManager.showGrandTotals||"columns"==d.model._options.OptionsManager.showGrandTotals||this._rowAxis.hasMeasures&&1==this._rows.length))for(b=0;b<this._measures.length;b++)this._rowTuples.push([[],
b]),this.rowDepths.push(0)}else this._rowTuples=this.rowTuples;(!this._columnAxis.hasMeasures||1<this._columns.length)&&this.fillColumnTuples(a,[],0);this._measureDepth=-1;if("on"==d.model._options.OptionsManager.showGrandTotals||"rows"==d.model._options.OptionsManager.showGrandTotals||this._columnAxis.hasMeasures&&1==this._columns.length)this.columnTuples.push([]),this.columnDepths.push(0);if(this._columnAxis.hasMeasures&&this.multiMeasures){this.columnDepths=[];if(1<this._columns.length)for(0!=
this._measuresPosition&&this.fillColumnTuples1(a,[],-1,0),b=0;b<this._measures.length;b++)"on"==d.model._options.OptionsManager.showGrandTotals||"rows"==d.model._options.OptionsManager.showGrandTotals?(this._columnTuples.push([[],b]),this.columnDepths.push(0)):0!=this._measuresPosition||"off"!=d.model._options.OptionsManager.showGrandTotals&&"columns"!=d.model._options.OptionsManager.showGrandTotals||(this._columnTuples.push([[],b]),this.columnDepths.push(0)),0==this._measuresPosition&&this.fillColumnTuples1(a,
[],b,0);if(0==this._measuresPosition&&("on"==d.model._options.OptionsManager.showGrandTotals||"rows"==d.model._options.OptionsManager.showGrandTotals||this._columnAxis.hasMeasures&&1==this._columns.length))for(b=0;b<this._measures.length;b++)this._columnTuples.push([[],b]),this.columnDepths.push(0)}else this._columnTuples=this.columnTuples;for(c=0;c<this.rowDepths.length;c++)this.rowDepths[c]>this._rowMaxDepth&&(this._rowMaxDepth=this.rowDepths[c]);this._rowMaxDepth++;for(c=0;c<this.columnDepths.length;c++)this.columnDepths[c]>
this._columnMaxDepth&&(this._columnMaxDepth=this.columnDepths[c]);this._columnMaxDepth++;0<this.slice.columnsOnly.length&&this._columnAxis.hasMeasures&&this.multiMeasures&&this._columnMaxDepth++;-1==this._measureDepth?this._measureDepth=0==this.measuresPosition?0:this._columnMaxDepth:this._measureDepth++;this._showUnexpandedDataAlert&&d.uialert(d.model._labels.Labels.MESSAGE_CANT_EXPAND,d.model._labels.Labels.MESSAGE_CANT_EXPAND_TITLE,d.AlertType.ALERT)}};a.prototype.showRowTuples=function(){for(var c=
0;c<this.rowTuples.length;c++);};a.prototype.showRowTuples1=function(){for(var c=0;c<this._rowTuples.length;c++)this.getRowTuple(c,!0),this.getRowMeasure(c)};a.prototype.showColumnTuples=function(){for(var c=0;c<this.columnTuples.length;c++);};a.prototype.showColumnTuples1=function(){for(var c=0;c<this._columnTuples.length;c++)this.getColumnTuple(c,!0),this.getColumnMeasure(c)};a.prototype.fillRowTuples=function(c,a,b){var d=a.length;if(d=this._rowAxis.hasMeasures&&a.length>=this._measuresPosition?
this._rows.getItemAt(d+1):this._rows.getItemAt(d))0==b&&(this._fillRowTuplesStart=Date.now()),this.isClassic?this._fillRowChildren(d.allMember,c,a,b):this.fillRowChildren(d.allMember,c,a,b)};a.prototype.isEmptyOnRows=function(c){for(var a=0;a<this.measures.length;a++)if(!isNaN(this.getValue(c,[],this.measures.getItemAt(a))))return!1;return!0};a.prototype.isEmptyOnColumns=function(c){for(var a=0;a<this.measures.length;a++)if(!isNaN(this.getValue([],c,this.measures.getItemAt(a))))return!1;return!0};
a.prototype.fillRowChildren=function(c,b,m,d){if(null!=c){var e;e=c.hierarchy_.sortChildren(c,!1,"");e=this.sortRowsByValue(e,b,m);c=this.rowsOnly.indexOf(c.hierarchy_.uniqueName)<this.rowsOnly.length-1;for(var f=0;f<e.length;f++){var h=e.getItemAt(f);0==f&&this.fillRowLevels(h);if(null!=b[h.ordinal]&&!h.isAll){var n=m.slice(0);n.push(h.ordinal);if(!this.isEmptyOnRows(n)){var p=!h.isLeaf&&this.dataStorage.isRowDrilledDown(n,h),q=c&&this.dataStorage.isRowExpanded(n);this.rowTuples.push(n);this.rowDepths.push(d);
Date.now()-this._fillRowTuplesStart<a.SCRIPT_EXECUTION_TIMEOUT&&(p?this.fillRowChildren(h,b,m,d+1):q&&this.fillRowTuples(b[h.ordinal],n,d+1))}}}}};a.prototype.fillRowTuples1=function(c,a,b,d){if(!this.isClassic){var e=a.length;(e=this._rowAxis.hasMeasures&&a.length>=this._measuresPosition?this._rows.getItemAt(e+1):this._rows.getItemAt(e))&&this.fillRowChildren1(e.allMember,c,a,b,d)}};a.prototype.fillRowChildren1=function(c,a,b,d,e){if(null!=c){var f=b.length;c=c.hierarchy_.sortChildren(c,!1,"");c=
this.sortRowsByValue(c,a,b);for(var h,n=0;n<c.length;n++){var p=c.getItemAt(n);if(null!=a[p.ordinal]&&!p.isAll){var q=b.slice(0);q.push(p.ordinal);if(!this.isEmptyOnRows(q))if(f<this._measuresPosition)if(this._rowTuples.push([q,-1]),this.rowDepths.push(e),f==this._measuresPosition-1&&this.dataStorage.isRowExpanded(q,d))for(h=0;h<this._measures.length;h++)this.dataStorage.isRowDrilledDown(q,p,h)?this.fillRowChildren1(p,a,b,h,e+2):(this._rowTuples.push([q,h]),this.rowDepths.push(e+1),this.dataStorage.isRowExpanded(q)&&
this.fillRowTuples1(a[p.ordinal],q,h,e+2));else{for(h=0;h<this._measures.length;h++)this._rowTuples.push([q,h]),this.rowDepths.push(e+1);this.dataStorage.isRowDrilledDown(q,p,d)?this.fillRowChildren1(p,a,b,d,e+2):this.dataStorage.isRowExpanded(q,d)&&this.fillRowTuples1(a[p.ordinal],q,d,e+2)}else this._rowTuples.push([q,d]),this.rowDepths.push(e),this.dataStorage.isRowDrilledDown(q,p,d)?this.fillRowChildren1(p,a,b,d,e+1):this.dataStorage.isRowExpanded(q,d)&&this.fillRowTuples1(a[p.ordinal],q,d,e+1)}}}};
a.prototype._fillRowChildren=function(c,b,m,k){if(null!=c){c=c.hierarchy_.sortChildren(c,!1,"");c=this.sortRowsByValue(c,b,m);for(var e=0;e<c.length;e++){var f=c.getItemAt(e);0==e&&this.fillRowLevels(f);if(null!=b[f.ordinal]&&!f.isAll){var h=m.slice(0);h.push(f.ordinal);if(!this.isEmptyOnRows(h)){var n=this.dataStorage.isRowDrilledDown(h,f),p=this.dataStorage.isRowExpanded(h),q=this.rowTuples.length;this.rowCount>h.length&&(this.rowType[q]=1,void 0==this.rowDepths[q]&&(this.rowDepths[q]=k));if(Date.now()-
this._fillRowTuplesStart<a.SCRIPT_EXECUTION_TIMEOUT)n?this._fillRowChildren(f,b,m,k+1):p&&this.fillRowTuples(b[f.ordinal],h,k+1);else if(n||p)this._showUnexpandedDataAlert=!0;if(n||p){if("on"==d.model._options.OptionsManager.showTotals||"rows"==d.model._options.OptionsManager.showTotals)this.rowTuples.push(h),this.rowType[this.rowTuples.length-1]=2,this.rowDepths[this.rowTuples.length-1]=k;n&&this.rowDepths[q]>k&&(this.rowDepths[q]=k,this.rowType[q]=0)}else this.rowTuples.push(h),void 0==this.rowType[this.rowTuples.length-
1]&&(this.rowType[this.rowTuples.length-1]=0,this.rowDepths[this.rowTuples.length-1]=k)}}}}};a.prototype.fillRowLevels=function(c){this.fillLevels(this._rowLevels,c)};a.prototype.fillColumnLevels=function(c){this.fillLevels(this._columnLevels,c)};a.prototype.fillLevels=function(c,a){if(-1==c.indexOf(a.level.uniqueName))if(1>=a.level.num)c.push(a.level.uniqueName);else{var b=c.indexOf(a.parent.level.uniqueName);c.splice(b+1,0,a.level.uniqueName)}};a.prototype.isValidSortTuple=function(c,a){for(var b=
0;b<c.length;b++){var d=a.getItemAt(b);if(d.hasFilter()){var e=d.members.getItemAt(c[b]);if(!d.filter.keyExists(e.uniqueName))return!1}}return!0};a.prototype.sortRowsByValue=function(c,a,b){if(!this.hasColumnSorting)return c;var d=this.columnSortTuple;if(!this.isValidSortTuple(d,this.columnsOnly))return c;for(var l=[],f=[],h=[],n=new utils.AssociativeArray,p,q=0;q<c.length;q++)if(p=c.getItemAt(q),null!=a[p.ordinal]&&!p.isAll){var t=b.slice(0);t.push(p.ordinal);t=this.getValue(t,d,this.columnSortMeasure);
isNaN(t)?h.push(p):(l.push(t),f.push(p))}c=this.columnSortType!=e.consts.SortType.DESC?utils.ArrayUtils.sort(l,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.RETURNINDEXEDARRAY):utils.ArrayUtils.sort(l,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.DESCENDING|utils.ArrayUtils.RETURNINDEXEDARRAY);for(q=0;q<c.length;q++)p=f[c[q]],null!=p&&n.addItem(p.uniqueName,p);for(q=0;q<h.length;q++)p=h[q],this.columnSortType==e.consts.SortType.DESC?n.addItem(p.uniqueName,p):n.addItemAt(p.uniqueName,p,q);return n};a.prototype.sortColumnsByValue=
function(c,a,b){if(!this.hasRowSorting)return c;var d=this.rowSortTuple;if(!this.isValidSortTuple(d,this.rowsOnly))return c;for(var l=[],f=[],h=[],n,p=new utils.AssociativeArray,q=0;q<c.length;q++)if(n=c.getItemAt(q),null!=a[n.ordinal]&&!n.isAll){var t=b.slice(0);t.push(n.ordinal);t=this.getValue(d,t,this.rowSortMeasure);isNaN(t)?h.push(n):(l.push(t),f.push(n))}c=this.rowSortType!=e.consts.SortType.DESC?utils.ArrayUtils.sort(l,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.RETURNINDEXEDARRAY):utils.ArrayUtils.sort(l,
utils.ArrayUtils.NUMERIC|utils.ArrayUtils.DESCENDING|utils.ArrayUtils.RETURNINDEXEDARRAY);for(q=0;q<c.length;q++)n=f[c[q]],null!=n&&p.addItem(n.uniqueName,n);for(q=0;q<h.length;q++)n=h[q],this.rowSortType==e.consts.SortType.DESC?p.addItem(n.uniqueName,n):p.addItemAt(n.uniqueName,n,q);return p};a.prototype.fillColumnTuples=function(c,a,b){var d=a.length;(d=this._columnAxis.hasMeasures&&a.length>=this._measuresPosition?this._columns.getItemAt(d+1):this._columns.getItemAt(d))&&this.fillColumnChildren(d.allMember,
c,a,b)};a.prototype.fillColumnChildren=function(c,a,b,d){c=c.hierarchy_.sortChildren(c,!1,"");c=this.sortColumnsByValue(c,a,b);for(var e=0;e<c.length;e++){var f=c.getItemAt(e);0==e&&this.fillColumnLevels(f);if(null!=a[f.ordinal]&&!f.isAll){var h=b.slice(0);h.push(f.ordinal);if(!this.isEmptyOnColumns(h)){var n=this.dataStorage.isColumnExpanded(h);this.columnTuples.push(h);this.columnDepths.push(d);this.dataStorage.isColumnDrilledDown(h,f)?this.fillColumnChildren(f,a,b,d+1):n&&this.fillColumnTuples(a[f.ordinal],
h,d+1)}}}};a.prototype.fillColumnTuples1=function(c,a,b,d){var e=a.length;(e=this._columnAxis.hasMeasures&&a.length>=this._measuresPosition?this._columns.getItemAt(e+1):this._columns.getItemAt(e))&&this.fillColumnChildren1(e.allMember,c,a,b,d)};a.prototype.fillColumnChildren1=function(c,a,b,d,e){var f=b.length;c=c.hierarchy_.sortChildren(c,!1,"");c=this.sortColumnsByValue(c,a,b);for(var h,n=0;n<c.length;n++){var p=c.getItemAt(n);if(null!=a[p.ordinal]&&!p.isAll){var q=b.slice(0);q.push(p.ordinal);
if(!this.isEmptyOnColumns(q)){var t=this.dataStorage.isColumnExpanded(q,d);if(f<this._measuresPosition)if(this._columnAxis.hasMeasures&&this._measureDepth<e+1&&(this._measureDepth=e+1),f==this._measuresPosition-1&&t)if(this.dataStorage.isColumnDrilledDown(q,p)){for(h=0;h<this._measures.length;h++)this._columnTuples.push([q,h]),this.columnDepths.push(e);this.fillColumnChildren1(p,a,b,d,e+1)}else for(h=0;h<this._measures.length;h++)this._columnTuples.push([q,h]),this.columnDepths.push(e),this.dataStorage.isColumnExpanded(q,
h)&&this.fillColumnTuples1(a[p.ordinal],q,h,e+1);else{for(h=0;h<this._measures.length;h++)this._columnTuples.push([q,h]),this.columnDepths.push(e);this.dataStorage.isColumnDrilledDown(q,p,d)?this.fillColumnChildren1(p,a,b,d,e+1):t&&this.fillColumnTuples1(a[p.ordinal],q,d,e+1)}else this._columnTuples.push([q,d]),this.columnDepths.push(e),this.dataStorage.isColumnDrilledDown(q,p,d)?this.fillColumnChildren1(p,a,b,d,e+1):t&&this.fillColumnTuples1(a[p.ordinal],q,d,e+1)}}}};Object.defineProperty(a.prototype,
"isEmpty",{get:function(){return 0==this.columnTuples.length&&0==this.rowTuples.length},set:function(c){},enumerable:!0,configurable:!0});a.prototype.getRowDepth=function(c){return this.isClassic?this.rowDepths[this._rowAxis.hasMeasures?Math.floor(c/this._measures.length):c]:this.rowDepths[c]};a.prototype.getRowType=function(c){return this.isClassic?this.rowType[this._rowAxis.hasMeasures?Math.floor(c/this._measures.length):c]:this.rowType[c]};a.prototype.getColumnType=function(c){return 1};a.prototype.getColumnDepth=
function(c){return this.columnDepths[c]};a.prototype.getRowHierarchyIdx=function(c){return this._rowAxis.hasMeasures&&(c.length>this._measuresPosition||0==this._measuresPosition)?c.length:c.length-1};a.prototype.getRowHierarchy=function(c){c=this.getRowHierarchyIdx(c);return this._rows.getItemAt(c)};a.prototype.getColumnHierarchyIdx=function(c){return this._columnAxis.hasMeasures&&(c.length>this._measuresPosition||0==this._measuresPosition)?c.length:c.length-1};a.prototype.getColumnHierarchy=function(c){c=
this.getColumnHierarchyIdx(c);return this._columns.getItemAt(c)};Object.defineProperty(a.prototype,"dataWidth",{get:function(){return this.columnTuples.length},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataHeight",{get:function(){return this.rowTuples.length},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"extendedDataWidth",{get:function(){return this._columnTuples.length},set:function(c){},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"extendedDataHeight",{get:function(){return this.isClassic?(this.rowAxis&&this.rowAxis.hasMeasures?this._measures.length:1)*this.rowTuples.length:this._rowTuples.length},set:function(c){},enumerable:!0,configurable:!0});a.prototype.isRowExpanded=function(c,a){void 0===a&&(a=null);return this.dataStorage.isRowExpanded(c,a)};a.prototype.isColumnExpanded=function(c,a){void 0===a&&(a=null);return this.dataStorage.isColumnExpanded(c,a)};a.prototype.isRowDrilledDown=function(c,
a,b){void 0===b&&(b=null);return this.dataStorage.isRowDrilledDown(c,a,b)};a.prototype.isColumnDrilledDown=function(c,a,b){void 0===b&&(b=null);return this.dataStorage.isColumnDrilledDown(c,a,b)};a.prototype.isAggregated=function(c,a){return this.dataStorage.isAggregated(c,a)};a.prototype.getColumnTupleIndex=function(c){c=c.slice(0);for(var a=this._columnAxis.hasMeasures,b=a?c.pop():-1,d=this._columnTuples,e=0;e<d.length;e++){var f=!0,h;if(a&&this.multiMeasures){if(b!=d[e][1])continue;h=d[e][0]}else h=
d[e];if(h.length==c.length){for(var n=0;n<h.length;n++)if(h[n]!=c[n]){f=!1;break}if(f)return e}}return-1};a.prototype.getRowTupleIndex=function(c){c=c.slice(0);for(var a=this._rowAxis.hasMeasures,b=a?c.pop():-1,d=this.isClassic?this.rowTuples:this._rowTuples,e=0;e<d.length;e++){var f=!0,h;if(a&&this.multiMeasures){if(b!=d[e][1])continue;h=d[e][0]}else h=d[e];if(h.length==c.length){for(var n=0;n<h.length;n++)if(h[n]!=c[n]){f=!1;break}if(f)return e}}return-1};a.prototype.getRowTuple=function(c,a){void 0===
a&&(a=!1);if(0>c||null==this._rowAxis||null==this._measures)return null;if(a&&this._rowAxis.hasMeasures&&this.multiMeasures){if(this.isClassic){var b=Math.floor(c/this._measures.length);return null==this.rowTuples[b]?null:this.rowTuples[b].slice(0)}return null==this._rowTuples[c]?null:this._rowTuples[c][0].slice(0)}return null==this.rowTuples[c]?null:this.rowTuples[c].slice(0)};a.prototype.getColumnTuple=function(c,a){void 0===a&&(a=!1);return 0>c||null==this._columnAxis||null==this._measures?null:
a&&this._columnAxis.hasMeasures&&this.multiMeasures?null==this._columnTuples[c]?null:this._columnTuples[c][0].slice():null==this.columnTuples[c]?null:this.columnTuples[c].slice()};a.prototype.getColumnTupleByName=function(c,a){return null};a.prototype.getColumnTupleForExport=function(c){return this._columnAxis.hasMeasures&&this.multiMeasures?this._columnTuples[c]:this.columnTuples[c]};a.prototype.getRowMeasure=function(c){return null==this._rowTuples[c]?null:this._rowAxis.hasMeasures&&this.multiMeasures?
this._measures.getItemAt(this._rowTuples[c][1]):null};a.prototype.getRowMeasureIndex=function(c){return null==this._rowTuples[c]?-1:this._rowAxis.hasMeasures&&this.multiMeasures?this._rowTuples[c][1]:-1};a.prototype.getColumnMeasure=function(c){return null==this._columnTuples[c]?null:this._columnAxis.hasMeasures&&this.multiMeasures?this._measures.getItemAt(this._columnTuples[c][1]):null};a.prototype.getColumnMeasureIndex=function(c){return null==this._columnTuples[c]?-1:this._columnAxis.hasMeasures&&
this.multiMeasures?this._columnTuples[c][1]:-1};a.prototype.getMeasure=function(c,a){if(null==this._measures||null==this._rowAxis||null==this._columnAxis)return null;if(this.multiMeasures){if(this._rowAxis.hasMeasures){if(this.isClassic){var b=c%this._measures.length;return null==this.rowTuples[Math.floor(c/this.measures.length)]?this._measures.getItemAt(0):this._measures.getItemAt(b)}return null==this._rowTuples[c]?this._measures.getItemAt(0):this._measures.getItemAt(this._rowTuples[c][1])}return null==
this._columnTuples[a]?this._measures.getItemAt(0):this._measures.getItemAt(this._columnTuples[a][1])}return this._measures.getItemAt(0)};a.prototype.drillThrough=function(c,a,b){return this.dataStorage.drillThrough(c,a,b)};a.prototype.save=function(c,a,b,d,e){this.dataStorage.save(c,a,b,d,e)};a.prototype.getUpdatedValue=function(c,a,b){return this.dataStorage.getUpdatedValue(c,a,b)};a.prototype.getRecordId=function(c,a,b){return null};a.prototype.getValue=function(c,a,b){var d;if(b.aggregation==e.consts.AggregationName.PERCENT)return d=
this.dataStorage.getValue([],[],b),c=this.dataStorage.getValue(c,a,b),Math.abs(100*c/d);if(b.aggregation==e.consts.AggregationName.PERCENT_COLUMN)return d=this.dataStorage.getValue([],a,b),c=this.dataStorage.getValue(c,a,b),100*c/d;if(b.aggregation==e.consts.AggregationName.PERCENT_ROW)return d=this.dataStorage.getValue(c,[],b),c=this.dataStorage.getValue(c,a,b),100*c/d;if(b.aggregation==e.consts.AggregationName.INDEX){d=this.dataStorage.getValue([],[],b);var l=this.dataStorage.getValue(c,[],b),f=
this.dataStorage.getValue([],a,b);c=this.dataStorage.getValue(c,a,b);return Math.abs(d*c/(f*l))}return b.aggregation==e.consts.AggregationName.DIFFERENCE?this.getDifference(c,a,b,!1):b.aggregation==e.consts.AggregationName.PERCENT_DIFFERENCE?this.getDifference(c,a,b,!0):b.aggregation==e.consts.AggregationName.RUNNING_TOTALS?this.dataStorage.getRunningTotals(c,a,b,this.rowAxis.hasMeasures?e.consts.AxisName.ROWS_AXIS:e.consts.AxisName.COLUMNS_AXIS):this.dataStorage.getValue(c,a,b)};a.prototype.getDifference=
function(c,a,b,d){return this.rowAxis.hasMeasures?this.getDifferenceColumn(c,a,b,d):this.getDifferenceRow(c,a,b,d)};a.prototype.getDifferenceColumn=function(c,a,b,d){var e;if(0<this.columns.length){e=this.getColumnTupleIndex(a);if(0>e)return 0;if(0==e||0==a.length)return NaN;e=this.getColumnTuple(e-1);if(a.length!=e.length)return NaN;e=this.dataStorage.getValue(c,e,b)}else{c.slice(0);c.push(-1);e=this.getRowTupleIndex(c);c.pop();if(0==e||0==c.length)return NaN;if(0>e)return 0;e=this.getRowTuple(e-
1,!0);if(c.length!=e.length)return NaN;e=this.dataStorage.getValue(e,a,b)}c=this.dataStorage.getValue(c,a,b);return d?(c-e)/e*100:c-e};a.prototype.getDifferenceRow=function(c,a,b,d){var e;if(0<this.rows.length){e=this.getRowTupleIndex(c);if(0==e||0==c.length)return NaN;if(0>e)return 0;e=this.getRowTuple(e-1);if(c.length!=e.length)return NaN;e=this.dataStorage.getValue(e,a,b)}else{a=a.slice(0);a.push(0);e=this.getColumnTupleIndex(a);a.pop();if(0==e||0==a.length)return NaN;if(0>e)return 0;e=this.getColumnTuple(e-
1,!0);if(a.length!=e.length)return NaN;e=this.dataStorage.getValue(c,e,b)}c=this.dataStorage.getValue(c,a,b);return d?(c-e)/e*100:c-e};a.prototype.calculate=function(c,a,b,d){return this.dataStorage.calculate(c,a,b,d)};a.prototype.expandData=function(c){this.dataLoaded&&(c=this.slice.allHierarchies().getItem(c),null!=c&&this.expandHierarchy(c))};a.prototype.expandHierarchy=function(c){var a=this.slice.rows.keyExists(c.uniqueName)?e.consts.AxisName.ROWS_AXIS:e.consts.AxisName.COLUMNS_AXIS,b=a==e.consts.AxisName.ROWS_AXIS?
this.slice.rowsOnly.length:this.slice.columnsOnly.length;c=a==e.consts.AxisName.ROWS_AXIS?this.slice.rowsOnly.indexOf(c.uniqueName):this.slice.columnsOnly.indexOf(c.uniqueName);if(c+1!=b){var b=[],d=(a==e.consts.AxisName.ROWS_AXIS?this.slice.rowsOnly:this.slice.columnsOnly).slice(0,c+1);this.getTuples([],d,b);for(var d=a==this.slice.axisWithMeasures.uniqueName?this.slice.axisWithMeasures.measuresPosition:-1,l=0;l<b.length;l++)if(0<=d&&d<=c&&1<this.slice.measures_.length)for(var f=0;f<this.slice.measures_.length;f++){var h=
this.slice.measures_.getItemAt(f);b[l].length>d?this.expand(b[l],a,h,!1):this.expand(b[l],a,null,!1)}else this.expand(b[l],a,null,!1);this.cube_.dispatch(new e.QueryCompleteEvent(e.consts.QueryType.EXPAND))}};a.prototype.getTuples=function(c,a,b,d){void 0===d&&(d=!0);if(0!=a.length)for(var e=a.getItemAt(0),e=e.hasFilter()?e.filter:e.members,f=0;f<e.length;f++){var h=e.getItemAt(f);if(!h.isAll){var n=c.slice(0);n.push(h.ordinal);(d||!d&&1==a.length)&&b.push(n.slice(0));this.getTuples(n.slice(0),a.slice(1),
b,d)}}};a.prototype.collapseData=function(c){this.dataLoaded&&(c=this.slice.allHierarchies().getItem(c),null!=c&&this.collapseHierarchy(c))};a.prototype.collapseHierarchy=function(c){var a=this.slice.rows.keyExists(c.uniqueName)?e.consts.AxisName.ROWS_AXIS:e.consts.AxisName.COLUMNS_AXIS,b=a==e.consts.AxisName.ROWS_AXIS?this.slice.rowsOnly.length:this.slice.columnsOnly.length;c=a==e.consts.AxisName.ROWS_AXIS?this.slice.rowsOnly.indexOf(c.uniqueName):this.slice.columnsOnly.indexOf(c.uniqueName);if(c+
1!=b){var b=[],d=(a==e.consts.AxisName.ROWS_AXIS?this.slice.rowsOnly:this.slice.columnsOnly).slice(0,c+1);this.getTuples([],d,b,!1);for(var d=a==this.slice.axisWithMeasures.uniqueName?this.slice.axisWithMeasures.measuresPosition:-1,l=0;l<b.length;l++)if(0<=d&&d<=c&&1<this.slice.measures_.length)for(var f=0;f<this.slice.measures_.length;f++){var h=this.slice.measures_.getItemAt(f);b[l].length>d?this.collapse(b[l],a,h,!1):this.collapse(b[l],a,null,!1)}else this.collapse(b[l],a,null,!1);this.cube_.dispatch(new e.QueryCompleteEvent(e.consts.QueryType.COLLAPSE))}};
a.prototype.expandAll=function(){this.dataLoaded&&(this.reset(),this.slice.expandAll?this.dataStorage.expandAll(this.slice.drillAll):this.cube_.select())};a.prototype.sort=function(){this.prepare();this.cube_.dispatchWith(d.model._state.StateEvent.REPORT_CHANGED)};Object.defineProperty(a.prototype,"lastRowsTupleInteracted",{get:function(){return this._lastRowsTupleInteracted},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"lastColsTupleInteracted",{get:function(){return this._lastColsTupleInteracted},
enumerable:!0,configurable:!0});a.prototype.expand=function(c,a,b,k){void 0===b&&(b=null);void 0===k&&(k=!0);a==e.consts.AxisName.ROWS_AXIS&&(this._lastRowsTupleInteracted=c);a==e.consts.AxisName.COLUMNS_AXIS&&(this._lastColsTupleInteracted=c);var l=this.slice.findAxis(a),f=c.slice(0),l=b&&l.hasMeasures?this._measures.indexOf(b.uniqueName):-1;f.unshift(l);var h=[];if(this.isAllExpanded())if(a==e.consts.AxisName.ROWS_AXIS){for(var h=[],n=this.getCollapsedRows(),l=0;l<n.length;l++)f.toString()!=n[l].toString()&&
h.push(n[l]);this.setCollapsedRows(h)}else{h=[];n=this.getCollapsedColumns();for(l=0;l<n.length;l++)f.toString()!=n[l].toString()&&h.push(n[l]);this.setCollapsedColumns(h)}else a==e.consts.AxisName.ROWS_AXIS?(h=this.getExpandedRows().slice(0),h.push(f),this.setExpandedRows(h)):(h=this.getExpandedColumns().slice(0),h.push(f),this.setExpandedColumns(h));this.cube_.expand(c,a,b,k);this.cube_.dispatchWith(d.model._state.StateEvent.REPORT_CHANGED)};a.prototype.collapse=function(c,a,b,k){void 0===b&&(b=
null);void 0===k&&(k=!0);a==e.consts.AxisName.ROWS_AXIS&&(this._lastRowsTupleInteracted=c.slice(0,c.length-1));a==e.consts.AxisName.COLUMNS_AXIS&&(this._lastColsTupleInteracted=c.slice(0,c.length-1));var l=this.slice.findAxis(a),f=c.slice(0),l=b&&l.hasMeasures?this._measures.indexOf(b.uniqueName):-1;f.unshift(l);var h=[];if(this.isAllExpanded())a==e.consts.AxisName.ROWS_AXIS?(h=this.getCollapsedRows().slice(0),h.push(f),this.setCollapsedRows(h)):(h=this.getCollapsedColumns().slice(0),h.push(f),this.setCollapsedColumns(h));
else if(a==e.consts.AxisName.ROWS_AXIS){for(var h=[],n=this.getExpandedRows(),l=0;l<n.length;l++)f.toString()!=n[l].toString()&&h.push(n[l]);this.setExpandedRows(h)}else{h=[];n=this.getExpandedColumns();for(l=0;l<n.length;l++)f.toString()!=n[l].toString()&&h.push(n[l]);this.setExpandedColumns(h)}this.cube_.collapse(c,a,b,k);this.cube_.dispatchWith(d.model._state.StateEvent.REPORT_CHANGED)};a.prototype.drillUp=function(c,a,b,k,l){void 0===k&&(k=null);if(void 0!==l)return this.drillUpTo(c,a,b,k,l);
var f=this.slice.findAxis(b);l=[];var h=c.slice(0);h.unshift(a.uniqueName);f=k&&f.hasMeasures?this._measures.indexOf(k.uniqueName):-1;h.unshift(f);if(this.isAllDrilled())b==e.consts.AxisName.ROWS_AXIS?(l=this.getDrilledUpRows().slice(0),l.push(h),this.setDrilledUpRows(l)):(l=this.getDrilledUpColumns().slice(0),l.push(h),this.setDrilledUpColumns(l));else if(b==e.consts.AxisName.ROWS_AXIS){var n=this.getDrilledDownRows(),p;for(p in n)f=n[p],"string"==typeof f[0]&&(f=f.slice(1)),f.toString()!=h.toString()&&
l.push(f);this.setDrilledDownRows(l)}else{n=this.getDrilledDownColumns();for(p in n)f=n[p],"string"==typeof f[0]&&(f=f.slice(1)),f.toString()!=h.toString()&&l.push(f);this.setDrilledDownColumns(l)}this.cube_.drillUp(c,a,b,k);this.cube_.dispatchWith(d.model._state.StateEvent.REPORT_CHANGED)};a.prototype.ascendantByLevel=function(c,a){for(var b=c;void 0!==b&&b.level.uniqueName!=a;)b=b.parent;return b};a.prototype.drillUpTo=function(c,a,b,d,l){void 0===d&&(d=null);var f=this.ascendantByLevel(a,l),h,
n=this.slice.findAxis(b),p=[],q=c.slice(0);q.unshift(a.uniqueName);n=d&&n.hasMeasures?this._measures.indexOf(d.uniqueName):-1;q.unshift(n);q.unshift(l);p.push(q);if(b==e.consts.AxisName.ROWS_AXIS){for(var t=this.getDrilledDownRows(),n=t.length-1;0<=n;n--)q=t[n],h="string"==typeof q[0]?a.hierarchy_.findMember(q[2]):a.hierarchy_.findMember(q[1]),h=this.ascendantByLevel(h,l),void 0!==h&&h.uniqueName==f.uniqueName||p.unshift(q);this.setDrilledDownRows(p)}else{t=this.getDrilledDownColumns();for(n=t.length-
1;0<=n;n--)q=t[n],h="string"==typeof q[0]?a.hierarchy_.findMember(q[2]):a.hierarchy_.findMember(q[1]),h=this.ascendantByLevel(h,l),void 0!==h&&h.uniqueName==f.uniqueName||p.unshift(q);this.setDrilledDownColumns(p)}q=c.slice(0);q[q.length-1]=f.ordinal;this.cube_.drillUp(q,f,b,d)};a.prototype.drillDown=function(c,a,b,k,l){void 0===k&&(k=null);if(void 0!==l)return this.drillDownTo(c,a,b,k,l);var f=this.slice.findAxis(b);l=[];var h=c.slice(0);h.unshift(a.uniqueName);f=k&&f.hasMeasures?this._measures.indexOf(k.uniqueName):
-1;h.unshift(f);if(this.isAllDrilled())if(b==e.consts.AxisName.ROWS_AXIS){var n=this.getDrilledUpRows(),p;for(p in n)f=n[p],f.toString()!=h.toString()&&l.push(f);this.setDrilledUpRows(l)}else{n=this.getDrilledUpColumns();for(p in n)f=n[p],f.toString()!=h.toString()&&l.push(f);this.setDrilledUpColumns(l)}else b==e.consts.AxisName.ROWS_AXIS?(l=this.getDrilledDownRows().slice(0),l.push(h),this.setDrilledDownRows(l)):(l=this.getDrilledDownColumns().slice(0),l.push(h),this.setDrilledDownColumns(l));this.cube_.drillDown(c,
a,b,k);this.cube_.dispatchWith(d.model._state.StateEvent.REPORT_CHANGED)};a.prototype.drillDownTo=function(c,a,b,d,l){var f=this.slice.findAxis(b),h=[];c=c.slice(0);c.unshift(a.uniqueName);a=d&&f.hasMeasures?this._measures.indexOf(d.uniqueName):-1;c.unshift(a);c.unshift(l);b==e.consts.AxisName.ROWS_AXIS?(h=this.getDrilledDownRows().slice(0),h.push(c),this.setDrilledDownRows(h)):(h=this.getDrilledDownColumns().slice(0),h.push(c),this.setDrilledDownColumns(h))};a.dispose=function(){a.instance&&(a.instance.removeEventListeners(),
a.instance.removeAllEventListeners());a.instance=null};a.counter=0;a.SCRIPT_EXECUTION_TIMEOUT=9E3;return a}(events.EventDispatcher);h.ViewDataProvider=f})(e.dataprovider_||(e.dataprovider_={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(){function a(){}a.getDataProvider=function(c){void 0===c&&(c="");""==c&&(c=d.model._options.OptionsManager.flatView?b.FLAT:b.PIVOT);var g=null,g=c==b.FLAT?e.FlatViewDataProvider.getInstance():e.ViewDataProvider.getInstance();g.addEventListeners();a.dataProvider_!=g?(a.dataProvider_&&a.dataProvider_.removeEventListeners(),g.load()):d.model._options.OptionsManager.optionAffectedDataProvider&&(g.load(),d.model._options.OptionsManager.optionAffectedDataProvider=
!1);a.dataProvider_=g;return a.dataProvider_};a.dispose=function(){e.FlatViewDataProvider.dispose();e.ViewDataProvider.dispose();a.dataProvider_=null};a.dataProvider_=null;return a}();e.DataProviderFactory=f;var b=function(){function a(){}a.PIVOT="pivot";a.FLAT="flat";return a}();e.DataProviderType=b})(e.dataprovider_||(e.dataprovider_={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c._measures=new utils.AssociativeArray;c._dataLoaded=!1;c.queryCompleteHandler=function(){return c.onQueryComplete()};c._columnSortType=d.consts.SortType.UNSORTED;c._columnSortTuple=null;c.indices=[];c.colIndices=[];c.cube_=d.Cube.getInstance();return c}__extends(a,b);Object.defineProperty(a.prototype,"dataStorage",{get:function(){return null!=this._dataStorage?this._dataStorage:this.cube_.localDataStorage},
set:function(c){this._dataStorage=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"slice",{get:function(){return null!=this._slice?this._slice:this.cube_.slice_},set:function(c){this._slice=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measures",{get:function(){return this._measures},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"multiMeasures",{get:function(){return 1<this._measures.length},set:function(c){},enumerable:!0,
configurable:!0});Object.defineProperty(a.prototype,"dataLoaded",{get:function(){return this.slice&&this._dataLoaded},set:function(c){},enumerable:!0,configurable:!0});a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.prototype.addEventListeners=function(){this.cube_.addEventListener(d.DataEvent.QUERY_COMPLETE,this.queryCompleteHandler,1)};a.prototype.removeEventListeners=function(){this.cube_.removeEventListener(d.DataEvent.QUERY_COMPLETE,this.queryCompleteHandler)};
a.prototype.load=function(){if(null==this.dataStorage&&(this.dataStorage=this.cube_.localDataStorage,null==this.dataStorage))return;this.slice&&(this.dataStorage.expand([],d.consts.AxisName.ROWS_AXIS,null),this.dataStorage.expand([],d.consts.AxisName.COLUMNS_AXIS,null),this.prepare(),this._dataLoaded=!0)};a.prototype.onQueryComplete=function(){this.load()};a.prototype.prepare=function(){var c,a,b,k=this.slice?this.slice.flatten(!0):new utils.AssociativeArray;this.colIndices.length=0;this.colNames=
new utils.AssociativeArray;this._measures=new utils.AssociativeArray;for(c=0;c<k.length;c++)b=k.getItemAt(c),a=this.cube_.structure_.hierarchyToMeasure(b.uniqueName),null==a&&(a=this.cube_.structure_.calculatedMeasures.getItem(b.uniqueName)),a&&this._measures.addItem(a.uniqueName,a),a=this.dataStorage.factKeys.indexOf(b.uniqueName),this.colIndices.push(a),this.colNames.addItem(b.uniqueName,this.colIndices.length-1);if(this.hasColumnSorting)this._sort();else for(c=0;c<k.length;c++)if(b=k.getItemAt(c),
b.sortName!=d.consts.SortType.UNSORTED){this._columnSortType=b.sortName;this._columnSortTuple=this.getColumnTuple(c);this._columnSortMeasure=this.cube_.structure_.hierarchyToMeasure(b.uniqueName);null==this._columnSortMeasure&&(this._columnSortMeasure=this.cube_.structure_.calculatedMeasures.getItem(b.uniqueName));this.sort();break}};Object.defineProperty(a.prototype,"measuresPosition",{get:function(){return 0},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowMaxDepth",
{get:function(){return 0},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnMaxDepth",{get:function(){return 0},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measureDepth",{get:function(){return 0},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rows",{get:function(){return new utils.AssociativeArray},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"rowsOnly",{get:function(){return new utils.AssociativeArray},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowLevels",{get:function(){return[]},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnLevels",{get:function(){return[]},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columns",{get:function(){return new utils.AssociativeArray},set:function(c){},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"columnsOnly",{get:function(){return new utils.AssociativeArray},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"pages",{get:function(){return new utils.AssociativeArray},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowAxis",{get:function(){return new d._structure.Axis(d.consts.AxisName.ROWS_AXIS)},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnAxis",
{get:function(){return new d._structure.Axis(d.consts.AxisName.COLUMNS_AXIS)},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowCount",{get:function(){return 1},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnCount",{get:function(){return 0},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowSortType",{get:function(){return null},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"rowSortTuple",{get:function(){return null},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowSortMeasure",{get:function(){return null},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasRowSorting",{get:function(){return!1},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortType",{get:function(){return this._columnSortType},set:function(c){c=c.toLowerCase();this._columnSortType=
c==d.consts.SortType.ASC||c==d.consts.SortType.DESC?c:d.consts.SortType.UNSORTED},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortTuple",{get:function(){return this._columnSortTuple},set:function(c){this._columnSortTuple=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortMeasure",{get:function(){return this._columnSortMeasure},set:function(c){this._columnSortMeasure=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasColumnSorting",
{get:function(){return this._columnSortType==d.consts.SortType.UNSORTED||null==this._columnSortTuple?!1:!0},set:function(c){},enumerable:!0,configurable:!0});a.prototype.reset=function(c){this._dataLoaded=!1;this._sortedHierarchy=null;this._measures=new utils.AssociativeArray;this.indices.length=0;this.colIndices.length=0;this.colNames=new utils.AssociativeArray;this._columnSortTuple=this._columnSortMeasure=null;this._columnSortType=d.consts.SortType.UNSORTED};Object.defineProperty(a.prototype,"isEmpty",
{get:function(){return 0==this.colIndices.length},set:function(c){},enumerable:!0,configurable:!0});a.prototype.getRowDepth=function(c){return 0};a.prototype.getRowType=function(c){return 0};a.prototype.getColumnType=function(c){return 0};a.prototype.getColumnDepth=function(c){return 1};a.prototype.getRowHierarchyIdx=function(c){return 0};a.prototype.getRowHierarchy=function(c){return this.getColumnHierarchy(c)};a.prototype.getColumnHierarchyIdx=function(c){return 0};a.prototype.getColumnHierarchy=
function(c){return this.cube_.structure_.allHierarchies().getItem(this.dataStorage.keys[c[0]])};Object.defineProperty(a.prototype,"dataWidth",{get:function(){return this.colIndices.length},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataHeight",{get:function(){return this.dataStorage?this.dataStorage.result[0]:0},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"extendedDataWidth",{get:function(){return this.colIndices.length},
set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"extendedDataHeight",{get:function(){return this.dataStorage.getRowCount()},set:function(c){},enumerable:!0,configurable:!0});a.prototype.isRowExpanded=function(c,a){return!1};a.prototype.isColumnExpanded=function(c,a){return!1};a.prototype.isRowDrilledDown=function(c,a,b){return!1};a.prototype.isColumnDrilledDown=function(c,a,b){return!1};a.prototype.isAggregated=function(c,a){return!1};a.prototype.getColumnTupleIndex=
function(c){for(var a=0;a<this.colIndices.length;a++)if(this.colIndices[a].toString()==c.toString())return a;return-1};a.prototype.getRowTupleIndex=function(c){if(0<this.indices.length&&c[0]<this.indices.length)for(var a=0;a<this.indices.length;a++){if(this.indices[a].toString()==c.toString())return a}else return c[0];return-1};a.prototype.getRowTuple=function(c,a){return 0>c?null:0<this.indices.length&&c<this.indices.length?[this.indices[c]]:[c]};a.prototype.getColumnTuple=function(c,a){return 0>
c?null:0<this.colIndices.length&&c<this.colIndices.length?[this.colIndices[c]]:[c]};a.prototype.getColumnTupleByName=function(c,a){void 0===a&&(a=!1);var b=this.colNames.getItem(c);return this.getColumnTuple(b,a)};a.prototype.getColumnTupleForExport=function(c){return null};a.prototype.getRowMeasure=function(c){return null};a.prototype.getRowMeasureIndex=function(c){return 0};a.prototype.getColumnMeasure=function(c){return null};a.prototype.getColumnMeasureIndex=function(c){return 0};a.prototype.getMeasure=
function(c,a){var b=this.getColumnTuple(a);return this._measures.getItem(this.dataStorage.factKeys[b[0]])};a.prototype.getUpdatedValue=function(c,a,b){return null==c?this.dataStorage.getFlatUpdatedValue(null,b):this.dataStorage.getFlatUpdatedValue(c[0],b)};a.prototype.getValue=function(c,a,b){return null==a&&null==c?this.dataStorage.getValue([],[],b):this.dataStorage.getFlatValue(c[0],a[0],b,b.type!=d.types.MeasureType.COUNT)};a.prototype.getRecordId=function(c,a,b){return null==a&&null==c?null:this.dataStorage.getRecordId(c[0],
a[0],b)};a.prototype.sort=function(){this._sort()};a.prototype._sort=function(){if(this.hasColumnSorting){this._columnSortMeasure.type!=d.types.MeasureType.COUNT?this.sortRowsByValue():this.sortRowsByMembers();this._sortedHierarchy&&(this._sortedHierarchy.sortName=d.consts.SortType.UNSORTED);var c=this.getColumnHierarchy(this._columnSortTuple);c&&(c.sortName=this._columnSortType,this._sortedHierarchy=c)}};a.prototype.sortRowsByValue=function(){var c,a,b=[];for(c=0;c<this.extendedDataHeight;c++)a=
this.getValue([c],this._columnSortTuple,this._columnSortMeasure),b[c]=isNaN(a)?Number.NEGATIVE_INFINITY:a;this.indices=this._columnSortType!=d.consts.SortType.DESC?utils.ArrayUtils.sort(b,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.RETURNINDEXEDARRAY):utils.ArrayUtils.sort(b,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.DESCENDING|utils.ArrayUtils.RETURNINDEXEDARRAY)};a.prototype.sortRowsByMembers=function(){var c=this,a=this.getColumnHierarchy(this._columnSortTuple);if(null!=a){var b,k,l=[];b=a.levels_.getItemAt(1).type;
var f=b==d.types.LevelType.YEAR||b==d.types.LevelType.MONTH||b==d.types.LevelType.DAY;for(b=0;b<this.extendedDataHeight;b++)k=this.getValue([b],this._columnSortTuple,this._columnSortMeasure),k=a.members.getItemAt(k),l.push(f?k.uniqueName:k.caption);if(f){this.sortedIndex={};f=a.sortChildren(a.allMember,!1,this._columnSortType);for(b=0;b<a.members.length;b++)k=a.members.getItemAt(b),this.sortedIndex[k.uniqueName]=f.indexOf(k.uniqueName);this.indices=utils.ArrayUtils.sort(l,utils.ArrayUtils.RETURNINDEXEDARRAY,
function(a,b){return c.sortFunction(a,b)})}else this.indices=this._columnSortType!=d.consts.SortType.DESC?utils.ArrayUtils.sort(l,utils.ArrayUtils.RETURNINDEXEDARRAY):utils.ArrayUtils.sort(l,utils.ArrayUtils.DESCENDING|utils.ArrayUtils.RETURNINDEXEDARRAY)}};a.prototype.sortFunction=function(c,a){var b=this.sortedIndex[c],d=this.sortedIndex[a];return b>d?1:b<d?-1:0};a.prototype.calculate=function(c,a,b,d){return this.dataStorage.calculateFlat(c,a,b,d)};a.prototype.expandData=function(c){};a.prototype.collapseData=
function(c){};a.prototype.expandAll=function(){};Object.defineProperty(a.prototype,"lastRowsTupleInteracted",{get:function(){return null},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"lastColsTupleInteracted",{get:function(){return null},enumerable:!0,configurable:!0});a.prototype.expand=function(c,a,b,d){};a.prototype.collapse=function(c,a,b,d){};a.prototype.drillUp=function(c,a,b,d){};a.prototype.drillDown=function(c,a,b,d){};a.prototype.drillThrough=function(c,a,b){return[]};
a.prototype.save=function(c,a,b,d,e){this.dataStorage.saveFlat(c,a,b,d,e)};Object.defineProperty(a.prototype,"isClassic",{get:function(){return!1},set:function(c){},enumerable:!0,configurable:!0});a.dispose=function(){a.instance&&(a.instance.removeAllEventListeners(),a.instance.removeEventListeners());a.instance=null};return a}(events.EventDispatcher);h.FlatViewDataProvider=f})(d.dataprovider_||(d.dataprovider_={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(b){function a(){return b.call(this)||this}__extends(a,b);a.getInstance=function(){null==a._instance&&(a._instance=new a,a._instance._name="chart"+d.ViewDataProvider.counter);return a._instance};Object.defineProperty(a.prototype,"isClassic",{get:function(){return!1},set:function(c){},enumerable:!0,configurable:!0});a.dispose=function(){a._instance&&(a._instance.removeEventListeners(),a._instance.removeAllEventListeners());a._instance=null};return a}(d.ViewDataProvider);
d.ChartDataProvider=e})(d.dataprovider_||(d.dataprovider_={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(){function b(a,c){void 0===c&&(c="");this.data={};this.uniqueName=a;this.caption=c}Object.defineProperty(b.prototype,"caption",{get:function(){return this._caption},set:function(a){null==a&&(a="");a=a.toString();"number"==typeof a?this._caption=""+a:""==a.trim()?this._caption=d.model._labels.Labels.MEMBER_BLANK:this._caption=a},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"uniqueName",{get:function(){return this._uniqueName},
set:function(a){this._uniqueName=a},enumerable:!0,configurable:!0});b.prototype._getProperty=function(a){if(this._hasProperty(a))return this.data[a]};b.prototype._setProperty=function(a,c){this.data[a]=c};b.prototype._hasProperty=function(a){return this.data.hasOwnProperty(a)};b.prototype.toString=function(){return this.uniqueName};b.prototype.toObject=function(){var a={};a.caption=this.caption;a.uniqueName=this.uniqueName;return a};b.prototype.fromObject=function(a){for(var c in a)null!=this[c]&&
(this[c]=a[c])};return b}();e.GenericElement=f})(e._structure||(e._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(c,g){void 0===g&&(g="");var m=b.call(this,c,g)||this;m._type=1;m._origin=0;m._folder="";m._allMemberName="";m._sortName=a.DEFAULT_SORT_NAME;m._sortAs=null;m._filter=new utils.AssociativeArray;m._filterMembers=new utils.AssociativeArray;m.__filterMembersChanged=!1;m._filterMembersNegated=new utils.AssociativeArray;m.__filterMembersNegatedChanged=!1;m._members=new utils.AssociativeArray;m._drilledDownMembers=new utils.AssociativeArray;
m._levels=new utils.AssociativeArray;m._isHierarchy=!1;m._filterEnabled=!0;m._predefinedDrillDowns=[];m.cache=[];m.cacheWithDescendants=[];m._filterType=e.consts.FilterType.NONE;m._filterQuantity=-1;m._filterMeasureName="";var d=c+".(All)",l=new h.GenericLevel(d,"All",0);m.addLevel(l);var l=c+".(All Member)",f=new h.GenericMember(l,"All");m.addMember(f,d);m.allMemberName=l;return m}__extends(a,b);Object.defineProperty(a.prototype,"dimension",{get:function(){return this._dimension},set:function(c){this._dimension=
c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this._type},set:function(c){this._type=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"origin",{get:function(){return this._origin},set:function(c){this._origin=c;this._isHierarchy=1==(c&1)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"quantity",{get:function(){return this.members.length},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"folder",{get:function(){return this._folder},set:function(c){"undefined"==c?this._folder="":this._folder=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"levels_",{get:function(){return this._levels},set:function(c){},enumerable:!0,configurable:!0});a.prototype.addLevel=function(c){c.hierarchy=this;this._levels.addItem(c.uniqueName,c);this._drilledDownMembers.addItemAt(c.uniqueName,new utils.AssociativeArray,c.num)};a.prototype.addLevelAt=function(c,a){c.hierarchy=this;this._levels.addItemAt(c.uniqueName,
c,a);for(var b=2;b<this._levels.length;b++)this._levels.getItemAt(b).num++;this._drilledDownMembers.addItemAt(c.uniqueName,new utils.AssociativeArray,c.num)};a.prototype.findLevel=function(c){return this._levels.getItem(c)};Object.defineProperty(a.prototype,"isHierarchy",{get:function(){return 2<this.levels_.length},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isMeasures",{get:function(){return this.uniqueName==e.Cube.MEASURES_NAME},set:function(c){},enumerable:!0,
configurable:!0});Object.defineProperty(a.prototype,"filterEnabled",{get:function(){return this._filterEnabled},set:function(c){this._filterEnabled=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"members",{get:function(){return this._members},set:function(c){},enumerable:!0,configurable:!0});a.prototype.clear=function(){this._members=new utils.AssociativeArray};a.prototype.addMember=function(c,a,b){void 0===a&&(a="");void 0===b&&(b="");""==a&&(a=this.levels_&&1<this.levels_.length?
this.levels_.getItemAt(1).uniqueName:this.uniqueName+"."+this.caption,this.caption==d.model._labels.Labels.MEMBER_BLANK&&(a=this.uniqueName+".[]"));null==this.findMember(c.uniqueName)&&(c.hierarchy_=this,c.parent=this.findMember(b)||this.allMember,c.level=this.findLevel(a),null!=c.parent&&c.parent.addChild(c),c.ordinal=this._members.length,this._members.addItem(c.uniqueName,c),this.cache=[],this.cacheWithDescendants=[])};a.prototype.drillDownMember=function(c){null!=c&&(c.isDrilledDown=!0,this._drilledDownMembers.getItem(c.level.uniqueName).addItem(c.uniqueName,
c))};a.prototype.drillUpMember=function(c){c.isDrilledDown=!1;this._drilledDownMembers.getItem(c.level.uniqueName).removeItem(c.uniqueName);c=c.descendants;for(var a=0;a<c.length;a++){var b=c.getItemAt(a);b.isDrilledDown&&this.drillUpMember(b)}};a.prototype.drilledDownMembers=function(c){return this._drilledDownMembers.getItem(c.uniqueName)};Object.defineProperty(a.prototype,"drillDownDepth",{get:function(){for(var c=1;c<this.levels_.length;c++){var a=this.levels_.getItemAt(c);if(0==this.drilledDownMembers(a).length)return c}return 1},
set:function(c){},enumerable:!0,configurable:!0});a.prototype.findMemberByCaption=function(c){for(var a=0;a<this.members.length;a++)if(this.members.getItemAt(a).caption==c)return this.members.getItemAt(a);return null};a.prototype.findMember=function(c){return this.members.getItem(c)};a.prototype.clearSort=function(c){void 0===c&&(c=!1);this.sortName=c?e.consts.SortType.UNSORTED:a.DEFAULT_SORT_NAME};a.prototype.clearSortCache=function(){this.cache=[]};Object.defineProperty(a.prototype,"sortName",{get:function(){return this._sortName},
set:function(c){this._sortName=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"sortAs",{get:function(){return this._sortAs},set:function(c){this._sortAs=c},enumerable:!0,configurable:!0});a.prototype.sort=function(){return this.sortChildren(this.allMember)};a.prototype.sortChildren=function(c,a,b){void 0===a&&(a=!0);void 0===b&&(b="");if(null==c)return new utils.AssociativeArray;e.consts.SortType.isValid(b)||(b=this._sortName);if(a){if(null!=this.cacheWithDescendants[c.ordinal]){if(null!=
this.cacheWithDescendants[c.ordinal][b])return this.cacheWithDescendants[c.ordinal][b];if(!this.isHierarchy){if(b==e.consts.SortType.DESC&&null!=this.cacheWithDescendants[c.ordinal][e.consts.SortType.ASC])return this.cacheWithDescendants[c.ordinal][e.consts.SortType.DESC]=this.cacheWithDescendants[c.ordinal][e.consts.SortType.ASC].reverse(),this.cacheWithDescendants[c.ordinal][e.consts.SortType.DESC];if(b==e.consts.SortType.ASC&&null!=this.cacheWithDescendants[c.ordinal][e.consts.SortType.DESC])return this.cacheWithDescendants[c.ordinal][e.consts.SortType.ASC]=
this.cacheWithDescendants[c.ordinal][e.consts.SortType.DESC].reverse(),this.cacheWithDescendants[c.ordinal][e.consts.SortType.ASC]}}}else if(null!=this.cache[c.ordinal]){if(null!=this.cache[c.ordinal][b])return this.cache[c.ordinal][b];if(!this.isHierarchy){if(b==e.consts.SortType.DESC&&null!=this.cache[c.ordinal][e.consts.SortType.ASC])return this.cache[c.ordinal][e.consts.SortType.DESC]=this.cache[c.ordinal][e.consts.SortType.ASC].reverse(),this.cache[c.ordinal][e.consts.SortType.DESC];if(b==e.consts.SortType.ASC&&
null!=this.cache[c.ordinal][e.consts.SortType.DESC])return this.cache[c.ordinal][e.consts.SortType.ASC]=this.cache[c.ordinal][e.consts.SortType.DESC].reverse(),this.cache[c.ordinal][e.consts.SortType.ASC]}}var d=this._sortName;this._sortName=b;var l;l=a?c.descendants:c.children;1E6<l.length?l=a?c.descendants:c.children:this._sortName==e.consts.SortType.UNSORTED?(l=a?c.descendants:c.children,0<l.length&&l.getItemAt(0).isAll&&l.removeItemAt(0)):l=this.sortByCaption(c,a);a?(null==this.cacheWithDescendants[c.ordinal]&&
(this.cacheWithDescendants[c.ordinal]=[]),this.cacheWithDescendants[c.ordinal][b]=l):(null==this.cache[c.ordinal]&&(this.cache[c.ordinal]=[]),this.cache[c.ordinal][b]=l);this._sortName=d;return l};a.prototype._sortByCaptionOptimized=function(c,a){var b=c.getChildrenCaptions(),d=b.captions,b=b.members;this._sortName==e.consts.SortType.DESC&&(d=d.reverse(),b=b.reverse());for(var l=new utils.AssociativeArray,f=0;f<d.length;f++)if(null!=d[f]){var h;this._sortName==e.consts.SortType.ASC&&(h=utils.ArrayUtils.sort(d[f],
utils.ArrayUtils.CASEINSENSITIVE|utils.ArrayUtils.RETURNINDEXEDARRAY));this._sortName==e.consts.SortType.DESC&&(h=utils.ArrayUtils.sort(d[f],utils.ArrayUtils.DESCENDING|utils.ArrayUtils.CASEINSENSITIVE|utils.ArrayUtils.RETURNINDEXEDARRAY));for(var n=0;n<h.length;n++){var p=b[f][h[n]];l.addUniqueItem(p.uniqueName,p);a&&(p=this.sortChildren(p),0<p.length&&l.concat(p,!1))}}return l};a.prototype.checkIfMonth=function(c){try{if("month"==c.level.caption.toLowerCase())return!0;if(12<c.children.length)return!1;
for(var a=0;a<c.children.length;a++){var b=c.children.getItemAt(a).caption.split(" ")[0];if(-1==d.model._labels.Labels.MONTHS_LABELS.indexOf(b)&&-1==d.model._labels.Labels.MONTHS_LABELS_SHORT.indexOf(b))return!1}var k=c.hierarchy_.levels_.indexOf(c.level.uniqueName);if(c.hierarchy_.levels_.length<k+2)return!1;c.hierarchy_.levels_.getItemAt(k+1).type=e.types.LevelType.MONTH;c.hierarchy_.levels_.getItemAt(k+2).type=e.types.LevelType.DAY;return!0}catch(l){}return!1};a.prototype.sortByCaption=function(c,
a){var b=this.levels_.getItemAt(c.level.num+1),d=b&&b.type==e.types.LevelType.YEAR,l=b&&b.type==e.types.LevelType.HALFYEAR,f=b&&b.type==e.types.LevelType.QUARTER,h=b&&b.type==e.types.LevelType.MONTH,n=b&&b.type==e.types.LevelType.WEEK,p=b&&b.type==e.types.LevelType.DAY,q=b&&b.type==e.types.LevelType.HOUR,t=b&&b.type==e.types.LevelType.MINUTE,u=b&&b.type==e.types.LevelType.NUMBER,v=b&&b.type==e.types.LevelType.TIME||b&&b.type==e.types.LevelType.DATE,x=b&&b.type==e.types.LevelType.TIME_DATE,w=this.sortAs==
e.consts.SortType.NUMERIC_RANGE;if(!(f||h||n||v||p||q||t||u||x)){if(1E3<c.children.length)return this._sortByCaptionOptimized(c,a);this.checkIfMonth(c)&&(h=!0)}var y=c.children.toArray();f||h||n||p||q||t||x||l||d?y=this.sortOrdinal(y,b?b.type:-1):v?y=this.sortDate(y):u?(this._sortName==e.consts.SortType.ASC&&utils.ArrayUtils.sortOn(y,"levelOrdinal",utils.ArrayUtils.NUMERIC),this._sortName==e.consts.SortType.DESC&&utils.ArrayUtils.sortOn(y,"levelOrdinal",utils.ArrayUtils.DESCENDING|utils.ArrayUtils.NUMERIC)):
w?y.sort(this.numericRangeSort):(this._sortName==e.consts.SortType.ASC&&utils.ArrayUtils.sortOn(y,"caption",utils.ArrayUtils.CASEINSENSITIVE),this._sortName==e.consts.SortType.DESC&&utils.ArrayUtils.sortOn(y,"caption",utils.ArrayUtils.DESCENDING|utils.ArrayUtils.CASEINSENSITIVE));b=new utils.AssociativeArray;for(d=0;d<y.length;d++)l=y[d],b.addUniqueItem(l.uniqueName,l),a&&!c.isLeaf&&(l=this.sortChildren(l,a),0<l.length&&b.concat(l,!1));return b};a.prototype.sortOrdinal=function(c,a){a==e.types.LevelType.MONTH?
c=this.sortMonths(c):a==e.types.LevelType.DAY?c=this.sortWeekdays(c):a==e.types.LevelType.QUARTER||a==e.types.LevelType.HALFYEAR||a==e.types.LevelType.YEAR?c=utils.ArrayUtils.sortOn(c,"caption",utils.ArrayUtils.CASEINSENSITIVE|(this.sortName==e.consts.SortType.DESC?utils.ArrayUtils.DESCENDING:0)):(this.sortName==e.consts.SortType.ASC&&utils.ArrayUtils.sortOn(c,"levelOrdinal",utils.ArrayUtils.NUMERIC),this.sortName==e.consts.SortType.DESC&&utils.ArrayUtils.sortOn(c,"levelOrdinal",utils.ArrayUtils.DESCENDING|
utils.ArrayUtils.NUMERIC));return c};a.prototype.sortMonths=function(c){for(var a=this,b=[],d=[],l=0;l<c.length;++l){var f=c[l];this._checkIfMonth(f.caption)?d.push(f):b.push(f)}this.sortName==e.consts.SortType.ASC&&utils.ArrayUtils.sortOn(b,"caption",utils.ArrayUtils.CASEINSENSITIVE);this.sortName==e.consts.SortType.DESC&&utils.ArrayUtils.sortOn(b,"caption",utils.ArrayUtils.DESCENDING|utils.ArrayUtils.CASEINSENSITIVE);d.sort(function(c,b){return a.dateTimeMonthSort(c,b)});return d.concat(b)};a.prototype.sortWeekdays=
function(c){for(var a=this,b=[],d=[],l=0;l<c.length;++l){var f=c[l];this._checkIfWeekday(f.caption)?d.push(f):b.push(f)}this.sortName==e.consts.SortType.ASC&&utils.ArrayUtils.sortOn(b,"caption",utils.ArrayUtils.CASEINSENSITIVE|utils.ArrayUtils.NUMERIC);this.sortName==e.consts.SortType.DESC&&utils.ArrayUtils.sortOn(b,"caption",utils.ArrayUtils.DESCENDING|utils.ArrayUtils.CASEINSENSITIVE|utils.ArrayUtils.NUMERIC);d.sort(function(c,b){return a.weekDaySort(c,b)});return d.concat(b)};a.prototype._checkIfMonth=
function(c){return-1!=d.model._labels.Labels.MONTHS_LABELS.indexOf(c)||-1!=d.model._labels.Labels.MONTHS_LABELS_SHORT.indexOf(c)};a.prototype._checkIfWeekday=function(c){return-1!=d.model._labels.Labels.WEEKDAYS_LABELS.indexOf(c)||-1!=d.model._labels.Labels.WEEKDAYS_LABELS_SHORT.indexOf(c)};a.prototype.dateTimeMonthSort=function(c,a){var b=this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.MONTHS_LABELS.indexOf(c.caption):d.model._labels.Labels.MONTHS_LABELS.indexOf(a.caption);-1==b&&(b=
this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.MONTHS_LABELS_SHORT.indexOf(c.caption):d.model._labels.Labels.MONTHS_LABELS_SHORT.indexOf(a.caption));var k=this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.MONTHS_LABELS.indexOf(a.caption):d.model._labels.Labels.MONTHS_LABELS.indexOf(c.caption);-1==k&&(k=this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.MONTHS_LABELS_SHORT.indexOf(a.caption):d.model._labels.Labels.MONTHS_LABELS_SHORT.indexOf(c.caption));return b>k?1:
b<k?-1:0};a.prototype.weekDaySort=function(c,a){var b=this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.WEEKDAYS_LABELS.indexOf(c.caption):d.model._labels.Labels.WEEKDAYS_LABELS.indexOf(a.caption);-1==b&&(b=this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.WEEKDAYS_LABELS_SHORT.indexOf(c.caption):d.model._labels.Labels.WEEKDAYS_LABELS_SHORT.indexOf(a.caption));var k=this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.WEEKDAYS_LABELS.indexOf(a.caption):d.model._labels.Labels.WEEKDAYS_LABELS.indexOf(c.caption);
-1==k&&(k=this.sortName==e.consts.SortType.ASC?d.model._labels.Labels.WEEKDAYS_LABELS_SHORT.indexOf(a.caption):d.model._labels.Labels.WEEKDAYS_LABELS_SHORT.indexOf(c.caption));return b>k?1:b<k?-1:0};a.prototype.sortDate=function(c){this._sortName==e.consts.SortType.ASC&&utils.ArrayUtils.sortOn(c,"levelOrdinal",utils.ArrayUtils.NUMERIC);this._sortName==e.consts.SortType.DESC&&utils.ArrayUtils.sortOn(c,"levelOrdinal",utils.ArrayUtils.DESCENDING|utils.ArrayUtils.NUMERIC);return c};a.prototype.numericRangeSort=
function(c,a){var b=c.caption.match(/(?:\d*\.)?\d+/),d=a.caption.match(/(?:\d*\.)?\d+/),b=b&&0<b.length?parseFloat(b[0]):Number.POSITIVE_INFINITY,d=d&&0<d.length?parseFloat(d[0]):Number.POSITIVE_INFINITY;return b>d?1:b<d?-1:0};a.prototype.membersByLevel=function(c){c=this._levels.getItem(c).num;for(var a=new utils.AssociativeArray,b=this.sort(),d=0;d<b.length;d++){var e=b.getItemAt(d);e&&e.level.num==c&&a.addItem(e.uniqueName,e)}return a};Object.defineProperty(a.prototype,"filter",{get:function(){return 0<
this._filter.length?this._filter:this.filterMembers},set:function(c){this._filter=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"filterMembers",{get:function(){this.__filterMembersNegatedChanged&&(this._filterMembers=new utils.AssociativeArray,0<this._filterMembersNegated.length&&(this._filterMembers=this.createOpposite(this._filterMembersNegated)),this.__filterMembersNegatedChanged=!1);return this._filterMembers},set:function(c){c.length+1==this.members.length&&(c=new utils.AssociativeArray);
this.__filterMembersChanged=!0;this._filterMembers=c;this._filterMembersNegated=new utils.AssociativeArray},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"filterMembersNegated",{get:function(){this.__filterMembersChanged&&(this._filterMembersNegated=new utils.AssociativeArray,0<this._filterMembers.length&&(this._filterMembersNegated=this.createOpposite(this._filterMembers)),this.__filterMembersChanged=!1);return this._filterMembersNegated},set:function(c){c.length+1==this.members.length&&
(c=new utils.AssociativeArray);this.__filterMembersNegatedChanged=!0;this._filterMembersNegated=c;this._filterMembers=new utils.AssociativeArray},enumerable:!0,configurable:!0});a.prototype.createOpposite=function(c){for(var a=this.members.slice(1),b=0;b<c.length;b++){var d=c.getItemAt(b);a.removeItem(d.uniqueName);this.removeMemberChildren(a,d);d.parent&&this.removeMemberParent(a,d.parent)}this.checkMemberChildren(a,this.allMember);return a};a.prototype.checkMemberChildren=function(c,a){for(var b=
0;b<a.children.length;b++){var d=a.children.getItemAt(b);0<d.children.length&&(c.getItem(d.uniqueName)?c.getItem(d.children.getItemAt(0).uniqueName)&&this.removeMemberChildren(c,d):this.checkMemberChildren(c,d))}};a.prototype.removeMemberChildren=function(c,a){if(a)for(var b=a.children,d=0;d<b.length;d++)c.removeItem(b.getItemAt(d).uniqueName),this.removeMemberChildren(c,b.getItemAt(d))};a.prototype.removeMemberParent=function(c,a){a&&(c.removeItem(a.uniqueName),a.parent&&this.removeMemberParent(c,
a.parent))};Object.defineProperty(a.prototype,"filterType",{get:function(){return-1==this._filterQuantity?e.consts.FilterType.NONE:this._filterType},set:function(c){c=c.toLowerCase();this._filterType=c==e.consts.FilterType.TOP||c==e.consts.FilterType.BOTTOM?c:e.consts.FilterType.NONE},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"filterQuantity",{get:function(){return this._filterQuantity},set:function(c){isNaN(c)||1>c?(this._filterQuantity=-1,this._filterType=e.consts.FilterType.NONE):
this._filterQuantity=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"filterMeasureName",{get:function(){return this._filterMeasureName},set:function(c){this._filterMeasureName=c},enumerable:!0,configurable:!0});a.prototype.clearFilter=function(){this.clearMembersFilter();this.clearValuesFilter()};a.prototype.clearMembersFilter=function(){this._filter=new utils.AssociativeArray;this._filterMembers=new utils.AssociativeArray;this._filterMembersNegated=new utils.AssociativeArray};
a.prototype.clearValuesFilter=function(){this._filter=new utils.AssociativeArray;this._filterQuantity=-1;this._filterType=e.consts.FilterType.NONE;this._filterMeasureName=""};a.prototype.hasFilter=function(){return this.hasMembersFilter()||this.hasValuesFilter()};a.prototype.hasMembersFilter=function(){return 0<this._filterMembers.length||0<this._filterMembersNegated.length};a.prototype.hasValuesFilter=function(){return this._filterType&&this.filterType!=e.consts.FilterType.NONE};a.prototype.filterByLevel=
function(c){for(var a=new utils.AssociativeArray,b=0<this._filter.length?this._filter:this._filterMembers,d=0;d<b.length;d++){var e=b.getItemAt(d);e.level.num==c&&a.addItem(e.uniqueName,e)}return a};Object.defineProperty(a.prototype,"allMemberName",{get:function(){return this._allMemberName},set:function(c){this._allMemberName=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"allMember",{get:function(){this._allMember||(this._allMember=this.findMember(this._allMemberName),this.drillDownMember(this._allMember));
return this._allMember},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"predefinedDrillDowns",{get:function(){return this._predefinedDrillDowns},set:function(c){this._predefinedDrillDowns=c},enumerable:!0,configurable:!0});a.toObject=function(c){var b={};b.uniqueName=c.uniqueName;b.caption=c.caption;b.filterEnabled=c.filterEnabled;b.sortName=c.sortName;b.sortAs=c.sortAs;b.type=c.type;b.filter=a.filterToObject(c);return b};a.filterToObject=function(c){if(!1==c.hasFilter())return null;
var a={};c.hasValuesFilter()&&(a={type:c.filterType,quantity:c.filterQuantity,measure:c.filterMeasureName,measureName:c.filterMeasureName});c.hasMembersFilter()&&(c.filterMembers.length<c.members.length/2?a.members=c.filterMembers.toArray(!0):(a.negation=!0,a.members=c.filterMembersNegated.toArray(!0)));return a};a.fromObject=function(c,b){void 0===b&&(b=null);var d=c.uniqueName;null==b&&(b=new a(d));c.hasOwnProperty("caption")&&(b.caption=c.caption);c.hasOwnProperty("sortName")&&(b.sortName=c.sortName);
c.hasOwnProperty("sortAs")&&(b.sortAs=c.sortAs);c.hasOwnProperty("filterEnabled")&&(b.filterEnabled=c.filterEnabled);c.hasOwnProperty("type")&&(b.type=c.type);c.hasOwnProperty("origin")&&(b.origin=c.origin);c.hasOwnProperty("folder")&&(b.folder=c.folder);c.hasOwnProperty("filter")&&a.filterFromObject(c.filter,b);c.hasOwnProperty("allMemberName")&&(b.allMemberName=c.allMemberName);return b};a.filterFromObject=function(c,a){if(null!=c){if(c.hasOwnProperty("members")){for(var b,d,l=new utils.AssociativeArray,
f=0;f<c.members.length;f++)b="string"==typeof c.members[f]?c.members[f]:c.members[f].uniqueName,d=a.findMember(b),null!=d&&l.addItem(b,d);c.negation?a.filterMembersNegated=l:a.filterMembers=l}b=c.hasOwnProperty("type")?c.type:e.consts.FilterType.NONE;d=c.hasOwnProperty("quantity")?Number(c.quantity):-1;l="";c.hasOwnProperty("measureName")&&(l=c.measureName);c.hasOwnProperty("measure")&&(l=c.measure);b!=e.consts.FilterType.NONE&&(a.filterType=b,a.filterQuantity=d,a.filterMeasureName=l)}};a.DEFAULT_SORT_NAME=
"asc";return a}(h.GenericElement);h.GenericHierarchy=f})(e._structure||(e._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(b){function a(c,a,d){void 0===a&&(a="");void 0===d&&(d=0);c=b.call(this,c,a)||this;c._type=1;c._properties=new utils.AssociativeArray;c._number=d;return c}__extends(a,b);Object.defineProperty(a.prototype,"num",{get:function(){return this._number},set:function(c){this._number=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this._type},set:function(c){this._type=c},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"isLast",{get:function(){return this._hierarchy.levels_.length-1==this._number},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hierarchy",{get:function(){return this._hierarchy},set:function(c){this._hierarchy=c},enumerable:!0,configurable:!0});return a}(d.GenericElement);d.GenericLevel=e})(d._structure||(d._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(b){function a(c,a){var d=b.call(this,c,a)||this;d._ordinal=1;d._levelOrdinal=0;d._isDrilledDown=!1;d._numDescendants=-1;d._hasCaptionSorting=-1;return d}__extends(a,b);Object.defineProperty(a.prototype,"ordinal",{get:function(){return this._ordinal},set:function(c){this._ordinal=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"levelOrdinal",{get:function(){return this._levelOrdinal},set:function(c){this._levelOrdinal=c},enumerable:!0,
configurable:!0});Object.defineProperty(a.prototype,"hierarchy_",{get:function(){return this._hierarchy},set:function(c){this._hierarchy=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"parent",{get:function(){return this._parent},set:function(c){this._parent=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"root",{get:function(){if(2>this._level.num)return this;var c=this;do c=c.parent;while(1<c.level.num);return c},set:function(c){},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"level",{get:function(){return this._level},set:function(c){this._level=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isAll",{get:function(){return null!=this.hierarchy_.allMember&&this.hierarchy_.allMember.uniqueName==this.uniqueName},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isDrilledDown",{get:function(){return this._isDrilledDown},set:function(c){this._isDrilledDown=c},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"children",{get:function(){return this._hasProperty("_children_")?this._getProperty("_children_"):new utils.AssociativeArray},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"descendants",{get:function(){if(this._hasProperty("_descendants_"))return this._getProperty("_descendants_");var c=new utils.AssociativeArray;c.addItem(this.uniqueName,this);if(0==this.numDescendants)return c;for(var a=this.children.length,b=0;b<a;b++){var d=
this.children.getItemAt(b);d.isLeaf?c.addItem(d.uniqueName,d):0<d.numDescendants?c.concat(d.descendants,!1):c.addItem(d.uniqueName,d)}0<c.length&&this._setProperty("descendants",c);return c},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numDescendants",{get:function(){if(-1<this._numDescendants)return this._numDescendants;if(!this._hasProperty("_children_"))return this._numDescendants=0;for(var c=this.children.length,a=c,b=0;b<c;b++)var d=this.children.getItemAt(b),
a=a+d.numDescendants;return a},set:function(c){},enumerable:!0,configurable:!0});a.prototype.getChildrenCaptions=function(){return{captions:this.captions,members:this.captionMembers}};a.prototype.clearDescendantsCache=function(){this._hasProperty("_descendants_")&&delete this._descendants_;this.parent&&this.parent.clearDescendantsCache()};Object.defineProperty(a.prototype,"captions",{get:function(){this._hasProperty("_captions_")||(this.captions=[]);return this._getProperty("_captions_")},set:function(c){this._setProperty("_captions_",
c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"captionMembers",{get:function(){this._hasProperty("_captionMembers_")||(this.captionMembers=[]);return this._getProperty("_captionMembers_")},set:function(c){this._setProperty("_captionMembers_",c)},enumerable:!0,configurable:!0});a.prototype.addChild=function(c){var a=this.children;a.addItem(c.uniqueName,c);this._setProperty("_children_",a);c.parent=this;this._numDescendants=-1;this.clearDescendantsCache();1==this.hasCaptionSorting(c)&&
(a=c.caption.charAt(0).toLowerCase().charCodeAt(0),null==this.captions[a]&&(this.captions[a]=[],this.captionMembers[a]=[]),this.captions[a].push(c.caption),this.captionMembers[a].push(c));1E6<this.children.length&&(this._hasCaptionSorting=0,this.captions=[],this.captionMembers=[])};a.prototype.removeChild=function(c){this.children.removeItem(c.uniqueName);this.clearDescendantsCache();if(1==this.hasCaptionSorting(c)){var a=c.caption.charAt(0).toLowerCase().charCodeAt(0);c=this.captions[a].indexOf(c.caption);
this.captions[a].splice(c,1);this.captionMembers[a].splice(c,1)}};a.prototype.hasCaptionSorting=function(c){return-1!=this._hasCaptionSorting?this._hasCaptionSorting:this._hasCaptionSorting=c.level.type==d.types.LevelType.HOUR||c.level.type==d.types.LevelType.MINUTE||c.level.type==d.types.LevelType.DAY||c.level.type==d.types.LevelType.NUMBER?0:1};a.prototype.toString=function(){return this.uniqueName+" : "+this._ordinal};Object.defineProperty(a.prototype,"isLeaf",{get:function(){return!this._hasProperty("_children_")||
0==this.children.length},set:function(c){},enumerable:!0,configurable:!0});a.toObject=function(c){var a={};a.uniqueName=c.uniqueName;a.caption=c.caption;a.hierarchyName=c.hierarchy_.uniqueName;return a};return a}(h.GenericElement);h.GenericMember=f})(d._structure||(d._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(c,a){void 0===a&&(a="");var d=b.call(this,c,a)||this;d._folder="";d._format="";d._type=e.types.MeasureType.NUMBER;d._grandTotalCaption="";d._defaultAggregation=e.consts.AggregationName.SUM;d._aggregation="";d._availableAggregations=[];d._params=[];d._formula="";d._individual=!1;d._hidden=!1;d._defaultAggregation=e.consts.AggregationName.SUM;return d}__extends(a,b);Object.defineProperty(a.prototype,"caption",{get:function(){if(this._customCaption)return this._customCaption;
if(!1==d.model._options.OptionsManager.showAggregationLabels)return this._caption;switch(this.aggregation){case e.consts.AggregationName.COUNT:return utils.StringUtils.bind(d.model._labels.Labels.COUNT_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.PRODUCT:return utils.StringUtils.bind(d.model._labels.Labels.PRODUCT_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.DISTINCT_COUNT:return utils.StringUtils.bind(d.model._labels.Labels.DISTINCT_COUNT_TOTAL_CAPTION,this._caption);
case e.consts.AggregationName.AVERAGE:return utils.StringUtils.bind(d.model._labels.Labels.AVERAGE_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.MAX:return utils.StringUtils.bind(d.model._labels.Labels.MAX_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.MIN:return utils.StringUtils.bind(d.model._labels.Labels.MIN_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.PERCENT:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.PERCENT_COLUMN:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_COLUMN_TOTAL_CAPTION,
this._caption);case e.consts.AggregationName.PERCENT_ROW:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_ROW_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.INDEX:return utils.StringUtils.bind(d.model._labels.Labels.INDEX_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.DIFFERENCE:return utils.StringUtils.bind(d.model._labels.Labels.DIFFERENCE_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.PERCENT_DIFFERENCE:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_DIFFERENCE_TOTAL_CAPTION,
this._caption);case e.consts.AggregationName.MEDIAN:return utils.StringUtils.bind(d.model._labels.Labels.MEDIAN_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.STDEVP:return utils.StringUtils.bind(d.model._labels.Labels.STDEVP_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.STDEVS:return utils.StringUtils.bind(d.model._labels.Labels.STDEVS_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.RUNNING_TOTALS:return utils.StringUtils.bind(d.model._labels.Labels.RUNNING_TOTALS_TOTAL_CAPTION,
this._caption);case e.consts.AggregationName.NONE:return this._caption}return utils.StringUtils.bind(d.model._labels.Labels.SUM_TOTAL_CAPTION,this._caption)},set:function(c){""==c.trim()?this._caption=d.model._labels.Labels.MEMBER_BLANK:this._caption=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"originalCaption",{get:function(){return this._caption},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"customCaption",{get:function(){return this._customCaption},
set:function(c){this._customCaption=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"folder",{get:function(){return this._folder},set:function(c){this._folder=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"format",{get:function(){return this._format},set:function(c){this._format=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"individual",{get:function(){return this._individual},set:function(c){this._individual=c},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"hidden",{get:function(){return this._hidden},set:function(c){this._hidden=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this._type},set:function(c){this._type=c;this._type!=e.types.MeasureType.NUMBER&&this._type!=e.types.MeasureType.TIME&&(this._type==e.types.MeasureType.DATE||this._type==e.types.MeasureType.DATETIME?(this.availableAggregations=[e.consts.AggregationName.COUNT,e.consts.AggregationName.DISTINCT_COUNT,
e.consts.AggregationName.MAX,e.consts.AggregationName.MIN],this._defaultAggregation=e.consts.AggregationName.MAX):(this.availableAggregations=[e.consts.AggregationName.COUNT,e.consts.AggregationName.DISTINCT_COUNT],this._defaultAggregation=e.consts.AggregationName.COUNT))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"grandTotalCaption",{get:function(){if(this.calculated)return this._caption;if(this._grandTotalCaption)return this._grandTotalCaption;if(!1==d.model._options.OptionsManager.showAggregationLabels)return this._caption;
switch(this.aggregation){case e.consts.AggregationName.SUM:return utils.StringUtils.bind(d.model._labels.Labels.SUM_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.COUNT:return utils.StringUtils.bind(d.model._labels.Labels.COUNT_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.PRODUCT:return utils.StringUtils.bind(d.model._labels.Labels.PRODUCT_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.DISTINCT_COUNT:return utils.StringUtils.bind(d.model._labels.Labels.DISTINCT_COUNT_GRAND_TOTAL_CAPTION,
this._caption);case e.consts.AggregationName.AVERAGE:return utils.StringUtils.bind(d.model._labels.Labels.AVERAGE_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.MAX:return utils.StringUtils.bind(d.model._labels.Labels.MAX_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.MIN:return utils.StringUtils.bind(d.model._labels.Labels.MIN_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.PERCENT:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_GRAND_TOTAL_CAPTION,
this._caption);case e.consts.AggregationName.PERCENT_COLUMN:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_COLUMN_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.PERCENT_ROW:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_ROW_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.INDEX:return utils.StringUtils.bind(d.model._labels.Labels.INDEX_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.DIFFERENCE:return utils.StringUtils.bind(d.model._labels.Labels.DIFFERENCE_GRAND_TOTAL_CAPTION,
this._caption);case e.consts.AggregationName.PERCENT_DIFFERENCE:return utils.StringUtils.bind(d.model._labels.Labels.PERCENT_DIFFERENCE_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.MEDIAN:return utils.StringUtils.bind(d.model._labels.Labels.MEDIAN_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.STDEVP:return utils.StringUtils.bind(d.model._labels.Labels.STDEVP_GRAND_TOTAL_CAPTION,this._caption);case e.consts.AggregationName.STDEVS:return utils.StringUtils.bind(d.model._labels.Labels.STDEVS_GRAND_TOTAL_CAPTION,
this._caption);case e.consts.AggregationName.RUNNING_TOTALS:return utils.StringUtils.bind(d.model._labels.Labels.RUNNING_TOTALS_GRAND_TOTAL_CAPTION,this._caption)}return this._caption},set:function(c){this._grandTotalCaption=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"aggregation",{get:function(){return""==this._aggregation?this._defaultAggregation:this._aggregation},set:function(c){c&&c.toLowerCase()!=this._aggregation?(c=c.toLowerCase(),e.consts.AggregationName.deprecatedType(c)&&
(c=e.consts.AggregationName.fromDeprecatedToValid(c)),e.consts.AggregationName.validType(c)||this.calculated&&c==e.consts.AggregationName.NONE?(this._grandTotalCaption=this._customCaption=void 0,this._aggregation=c,!this.calculated&&0<this.availableAggregations.length&&-1==this.availableAggregations.indexOf(c)&&(this._aggregation=this._availableAggregations[0])):this.resolveColisionsForAggregations()):""==c&&this.resolveColisionsForAggregations()},enumerable:!0,configurable:!0});a.prototype.resolveColisionsForAggregations=
function(){this._grandTotalCaption=this._customCaption=void 0;this._aggregation=0<this._availableAggregations.length?this._availableAggregations[0]:this._defaultAggregation};Object.defineProperty(a.prototype,"availableAggregations",{get:function(){return this._availableAggregations},set:function(c){this._availableAggregations=[];if(null==c)this._availableAggregations=[];else if(this.type!=e.types.MeasureType.NUMBER&&this._type!=e.types.MeasureType.TIME&&0==this._availableAggregations.length)this._availableAggregations=
this._type==e.types.MeasureType.DATE||this._type==e.types.MeasureType.DATETIME?[e.consts.AggregationName.COUNT,e.consts.AggregationName.DISTINCT_COUNT,e.consts.AggregationName.MAX,e.consts.AggregationName.MIN]:[e.consts.AggregationName.COUNT,e.consts.AggregationName.DISTINCT_COUNT];else for(var a=0;a<c.length;a++){var b=c[a].trim().toLowerCase();e.consts.AggregationName.deprecatedType(b)&&(b=e.consts.AggregationName.fromDeprecatedToValid(b));(this.type==e.types.MeasureType.NUMBER||this._type==e.types.MeasureType.TIME||
b==e.consts.AggregationName.COUNT||b==e.consts.AggregationName.DISTINCT_COUNT)&&e.consts.AggregationName.validType(b)&&this._availableAggregations.push(b)}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"params",{get:function(){return this._params},set:function(c){this._params=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"calculated",{get:function(){return null!=this.formula&&""!=this.formula},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"formula",{get:function(){return this._formula},set:function(c){this._formula=c},enumerable:!0,configurable:!0});a.toObject=function(c){var a={};a.uniqueName=c.uniqueName;a.name=c.originalCaption;c.calculated&&(a.formula=c.formula);a.format=c.format;a.individual=c.individual;a.availableAggregations=c.availableAggregations;a.aggregation=c.aggregation;a.caption=c.caption;a.originalCaption=c.originalCaption;a.grandTotalCaption=c.grandTotalCaption;a.folder=c.folder;a.type=c.type;a.calculated=c.calculated;
return a};a.fromObject=function(c,a){void 0===a&&(a=null);var b=c.uniqueName;null==a&&(a=new h.GenericMeasure(b));c.hasOwnProperty("type")&&(a.type="string"==typeof c.type?e.types.MeasureType.fromColumnType(parseInt(c.type)):c.type);c.hasOwnProperty("individual")&&(a.individual=c.individual);c.hasOwnProperty("formula")&&(a.formula=c.formula);c.hasOwnProperty("format")&&(a.format=c.format);c.hasOwnProperty("availableAggregations")&&(a.availableAggregations=c.availableAggregations);a.aggregation=c.hasOwnProperty("aggregation")?
c.aggregation:a.calculated?e.consts.AggregationName.NONE:"";c.hasOwnProperty("caption")&&(a.caption=c.caption);c.hasOwnProperty("name")&&(a.caption=c.name);c.hasOwnProperty("grandTotalCaption")&&(a.grandTotalCaption=c.grandTotalCaption);c.hasOwnProperty("folder")&&(a.folder=c.folder);a.calculated&&(b=new utils.Lexer,a.params=b.parse(a.formula));return a};a.prototype.hasDefaultParams=function(){var c=new a("","");return this.individual!=c.individual||this.formula!=c.formula||this.format!=c.format||
this.type==e.types.MeasureType.COUNT&&this.aggregation!=e.consts.AggregationName.COUNT&&this.aggregation!=e.consts.AggregationName.NONE||this.type==e.types.MeasureType.NUMBER&&this.aggregation!=e.consts.AggregationName.SUM&&this.aggregation!=e.consts.AggregationName.NONE?!1:!0};a.prototype.getFormat=function(c){void 0===c&&(c=!1);var a;a=d.model.format.FormatManager.formatExists(this.format)?d.model.format.FormatManager.getFormat(this.format):""!=this.format&&d.model.format.FormatManager.formatExists("")?
d.model.format.FormatManager.getFormat(""):d.model.format.FormatManager.getDefaultFormat();c&&utils.nullOrUndefined(a.params.textAlign)&&this.type!=e.types.MeasureType.NUMBER&&this.type!=e.types.MeasureType.TIME&&this.type!=e.types.MeasureType.DATETIME&&(a=a.clone(),a.textAlign="left");return a};return a}(h.GenericElement);h.GenericMeasure=f})(e._structure||(e._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(b){function a(c,a){void 0===a&&(a="");var d=b.call(this,c,a)||this;d.hierarchies=new utils.AssociativeArray;return d}__extends(a,b);Object.defineProperty(a.prototype,"hierarchies",{get:function(){return this._hierarchies},set:function(c){this._hierarchies=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this._type},set:function(c){this._type=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"structure",{get:function(){return this._structure},set:function(c){this._structure=c},enumerable:!0,configurable:!0});a.prototype.addHierarchy=function(c){c.dimension=this;this._hierarchies.addItem(c.uniqueName,c)};a.prototype.findHierarchy=function(c){return this._hierarchies.getItem(c)};a.fromObject=function(c,b){void 0===b&&(b=null);var d=c.uniqueName;null==b&&(b=new a(d));void 0!==c.caption&&(b.caption=c.caption);void 0!==c.type&&(b.type=c.type);return b};return a}(d.GenericElement);d.GenericDimension=
e})(d._structure||(d._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){this._isComplete=!1;this.id=this.deleteId="";this.levels=[];this._dimensions=new utils.AssociativeArray;this._measures=new utils.AssociativeArray;this._measureToHierarchyMap={};this._hierarchyToMeasureMap={};var a=new h.GenericHierarchy(e.Cube.MEASURES_NAME,e.Cube.MEASURES_NAME),c=new h.GenericDimension(e.Cube.MEASURES_NAME,e.Cube.MEASURES_NAME);c.type=e.types.DimensionType.MD_DIMTYPE_MEASURE;c.addHierarchy(a);this.addDimension(c);
this.fields=new utils.AssociativeArray;this.types=[];this.id=this.deleteId=""}Object.defineProperty(b.prototype,"isComplete",{get:function(){return this._isComplete},set:function(a){this._isComplete=a},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"dimensions",{get:function(){return this._dimensions},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"measures_",{get:function(){return this._measures},set:function(a){},enumerable:!0,configurable:!0});
Object.defineProperty(b.prototype,"calculatedMeasures",{get:function(){for(var a=new utils.AssociativeArray,c=0;c<this._measures.length;c++){var b=this._measures.getItemAt(c);b.calculated&&a.addItem(b.uniqueName,b)}return a},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"regularMeasures",{get:function(){for(var a=new utils.AssociativeArray,c=0;c<this._measures.length;c++){var b=this._measures.getItemAt(c);b.calculated||a.addItem(b.uniqueName,b)}return a},set:function(a){},
enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"measuresHierarchy",{get:function(){var a=this.findDimension(e.Cube.MEASURES_NAME);if(null==a){var c=new h.GenericHierarchy(e.Cube.MEASURES_NAME,e.Cube.MEASURES_NAME),a=new h.GenericDimension(e.Cube.MEASURES_NAME,e.Cube.MEASURES_NAME);a.type=e.types.DimensionType.MD_DIMTYPE_MEASURE;a.addHierarchy(c);this.addDimension(a)}return a.findHierarchy(e.Cube.MEASURES_NAME)},set:function(a){},enumerable:!0,configurable:!0});b.prototype.addDimension=
function(a){null==this.findDimension(a.uniqueName)&&(a.structure=this,this.dimensions.addItem(a.uniqueName,a))};b.prototype.findDimension=function(a){return this.dimensions.getItem(a)};b.prototype.allHierarchies=function(a){void 0===a&&(a=!1);for(var c=new utils.AssociativeArray,b=0;b<this.dimensions.length;b++){var d=this.dimensions.getItemAt(b);if(a||d.type!=e.types.DimensionType.MD_DIMTYPE_MEASURE)c=c.concat(d.hierarchies)}return c};b.prototype.findHierarchy=function(a){return this.allHierarchies(!0).getItem(a)};
b.prototype.addMeasure=function(a){this.measures_.addItem(a.uniqueName,a)};b.prototype.findMeasure=function(a){return this.measures_.getItem(a)};b.prototype.removeMeasure=function(a){return this.measures_.removeItem(a)};b.prototype.clear=function(){this._measureToHierarchyMap={};this._hierarchyToMeasureMap={};this.fields=new utils.AssociativeArray;this.types=[];this.id=this.deleteId="";this._dimensions=new utils.AssociativeArray;this._measures=new utils.AssociativeArray;this.isComplete=!1};b.prototype.measureToHierarchy=
function(a){return this._measureToHierarchyMap[a]};b.prototype.hierarchyToMeasure=function(a){return this._hierarchyToMeasureMap[a]};b.prototype.getDataType=function(a){return this.types[a]};b.prototype.getDataField=function(a){return this.fields.getItem(a)};b.prototype.getDataKeys=function(){return this.fields.toArray(!0)};b.prototype.addKeys=function(a,c){this._measureToHierarchyMap[a]=this.findHierarchy(c);this._hierarchyToMeasureMap[c]=this.findMeasure(a)};b.prototype._addMeasure=function(a,c){var b=
new h.GenericMeasure(a.uniqueName,a.caption);b.type=c;this.addMeasure(b);this.addKeys(b.uniqueName,a.uniqueName);this.localDataStorage.addFactKey(b.uniqueName)};b.prototype.addStringHierarchy=function(a,c,b){var m=c.uniqueName;c=new h.GenericHierarchy(m,c.caption);a.addHierarchy(c);this.localDataStorage.addKey(m);a=new h.GenericLevel(c.caption==d.model._labels.Labels.MEMBER_BLANK?m+".[]":m,c.caption,1);c.addLevel(a);this._addMeasure(c,e.types.MeasureType.COUNT);this.fields.addItem(b,c)};b.prototype.addHierarchicalDateHierarchy=
function(a,c,b){var m=c.uniqueName,k=c.caption;a.type=e.types.DimensionType.MD_DIMTYPE_TIME;k=new h.GenericHierarchy(m,k);a.addHierarchy(k);a=new h.GenericLevel(m+".Year",d.model._labels.Labels.YEAR,k.levels_.length);a.type=e.types.LevelType.YEAR;k.addLevel(a);this.localDataStorage.addKey(k.uniqueName);c.type==e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS&&(c=m+".Quarter",a=new h.GenericLevel(c,d.model._labels.Labels.QUARTER,k.levels_.length),a.type=e.types.LevelType.QUARTER,k.addLevel(a),
this.localDataStorage.addKey(c,k.uniqueName));c=m+".Month";a=new h.GenericLevel(c,d.model._labels.Labels.MONTH,k.levels_.length);a.type=e.types.LevelType.MONTH;k.addLevel(a);this.localDataStorage.addKey(c,k.uniqueName);m+=".Day";a=new h.GenericLevel(m,d.model._labels.Labels.DAY,k.levels_.length);a.type=e.types.LevelType.DAY;k.addLevel(a);this.localDataStorage.addKey(m,k.uniqueName);this._addMeasure(k,e.types.MeasureType.COUNT);this.fields.addItem(b,k)};b.prototype.addLevelOfHierarchy=function(a,c,
b){var d=c.hasOwnProperty("hierarchy")?c.hierarchy:c.uniqueName,k=c.hasOwnProperty("hierarchy")?c.hierarchy:c.caption,l=a.findHierarchy(d);null==l&&(l=new h.GenericHierarchy(d,k),a.addHierarchy(l));k=0;if(c.hasOwnProperty("parent")){d=l.findLevel(c.parent);if(null==d){null==this.levels[l.uniqueName]&&(this.levels[l.uniqueName]=[]);this.levels[l.uniqueName][c.parent]=[c,b];return}k=l.levels_.indexOf(d.uniqueName)}d=c.hasOwnProperty("level")?c.level:b;c=c.hasOwnProperty("level")?c.level:b;c=new h.GenericLevel(d,
c,k+1);l.addLevel(c);1==c.num?this.localDataStorage.addKey(l.uniqueName):this.localDataStorage.addKey(d,l.uniqueName);this._addMeasure(l,e.types.MeasureType.COUNT);this.fields.addItem(b,c);this.levels[l.uniqueName]&&this.levels[l.uniqueName][d]&&this.addLevelOfHierarchy(a,this.levels[l.uniqueName][d][0],this.levels[l.uniqueName][d][1])};b.prototype.addDateHierarchy=function(a,c,b){var m=c.uniqueName,k=c.caption;a.type=e.types.DimensionType.MD_DIMTYPE_TIME;var l=m+".Year",f=k+"."+d.model._labels.Labels.YEAR;
c=new h.GenericHierarchy(l,f);c.type=e.types.DataFieldType.typeNum(e.types.DataFieldType.DATE);a.addHierarchy(c);f=new h.GenericLevel(l+"."+f,f,1);f.type=e.types.LevelType.YEAR;c.addLevel(f);this.localDataStorage.addKey(l);this._addMeasure(c,e.types.MeasureType.COUNT);l=m+".Month";f=k+"."+d.model._labels.Labels.MONTH;c=new h.GenericHierarchy(l,f);a.addHierarchy(c);f=new h.GenericLevel(l+"."+f,f,1);f.type=e.types.LevelType.MONTH;c.addLevel(f);this.localDataStorage.addKey(l);this._addMeasure(c,e.types.MeasureType.COUNT);
m+=".Day";k=k+"."+d.model._labels.Labels.DAY;c=new h.GenericHierarchy(m,k);a.addHierarchy(c);k=new h.GenericLevel(m+"."+k,k,1);k.type=e.types.LevelType.DAY;c.addLevel(k);this.localDataStorage.addKey(m);this._addMeasure(c,e.types.MeasureType.COUNT);this.fields.addItem(b,a)};b.prototype.addNumberHierarchy=function(a,c,b){var d=c.uniqueName,k=c.caption;c=new h.GenericHierarchy(d,k);a.addHierarchy(c);this.localDataStorage.addKey(d);a=new h.GenericLevel(d+"."+k,k,1);a.type=e.types.LevelType.NUMBER;c.addLevel(a);
this._addMeasure(c,e.types.MeasureType.NUMBER);this.fields.addItem(b,c)};b.prototype.addMonthHierarchy=function(a,c,b){var d=c.uniqueName,k=c.caption;c=new h.GenericHierarchy(d,k);a.addHierarchy(c);this.localDataStorage.addKey(d);a=new h.GenericLevel(d+"."+k,k,1);a.type=e.types.LevelType.MONTH;c.addLevel(a);this._addMeasure(c,e.types.MeasureType.COUNT);this.fields.addItem(b,c)};b.prototype.addWeekdayHierarchy=function(a,c,b){var d=c.uniqueName,k=c.caption;c=new h.GenericHierarchy(d,k);a.addHierarchy(c);
this.localDataStorage.addKey(d);a=new h.GenericLevel(d+"."+k,k,1);a.type=e.types.LevelType.DAY;c.addLevel(a);this._addMeasure(c,e.types.MeasureType.COUNT);this.fields.addItem(b,c)};b.prototype.addDateStringHierarchy=function(a,c,b){var d=c.uniqueName,k=c.caption;c=new h.GenericHierarchy(d,k);a.addHierarchy(c);this.localDataStorage.addKey(d);a=new h.GenericLevel(d+"."+k,k,1);a.type=e.types.LevelType.TIME;c.addLevel(a);this._addMeasure(c,e.types.MeasureType.DATE);this.fields.addItem(b,c)};b.prototype.addTimeHierarchy=
function(a,c,b){var d=c.uniqueName,k=c.caption;c=new h.GenericHierarchy(d,k);a.addHierarchy(c);this.localDataStorage.addKey(d);a=new h.GenericLevel(d+"."+k,k,1);a.type=e.types.LevelType.NUMBER;c.addLevel(a);this._addMeasure(c,e.types.MeasureType.TIME);this.fields.addItem(b,c)};b.prototype.addDateTimeHierarchy=function(a,c,b){var d=c.uniqueName,k=c.caption;c=new h.GenericHierarchy(d,k);a.addHierarchy(c);this.localDataStorage.addKey(d);a=new h.GenericLevel(d+"."+k,k,1);a.type=e.types.LevelType.NUMBER;
c.addLevel(a);this._addMeasure(c,e.types.MeasureType.DATETIME);this.fields.addItem(b,c)};b.prototype.isMetaObject=function(a){return a.hasOwnProperty("type")||a.hasOwnProperty("caption")||a.hasOwnProperty("hierarchy")||a.hasOwnProperty("level")||a.hasOwnProperty("parent")||a.hasOwnProperty("dimensionCaption")};b.prototype.addDataStructure=function(a){var c=!1,b;for(b in a)null==a[b]&&(a[b]=""),"string"==typeof a[b]||"number"==typeof a[b]?this.addDataFieldString(b,e.types.DataFieldType.typeFromValue(a[b])):
a[b]instanceof Date?this.addDataFieldString(b,e.types.DataFieldType.DATE):a[b]instanceof Array||(this.isMetaObject(a[b])&&(c=!0),a[b].hasOwnProperty("formula")?!1==utils.nullOrEmpty(a[b].formula)&&this.addCalculatedMeasure(a[b],b):this.addDataField(a[b],b));this.isComplete=!0;return c};b.prototype.addCalculatedMeasure=function(a,c){var b;b=new e._structure.GenericMeasure(c,void 0==a.caption?c:a.caption);b.formula=a.formula;b.grandTotalCaption=void 0==a.grandTotalCaption?d.model._labels.Labels.GRID_GRAND_TOTAL:
a.grandTotalCaption;d.model.PivotModel.getInstance().addCalculatedMeasure(b)};b.prototype.addDataFieldString=function(a,c){this.addDataField({uniqueName:a,caption:a,type:c},a)};b.prototype.addDataField=function(a,c){void 0===c&&(c="");var b={},d;for(d in a)b[d]=a[d];b.hasOwnProperty("uniqueName")||(b.uniqueName=c);b.hasOwnProperty("caption")&&""!=b.caption||(b.caption=c);""==c&&(c=b.uniqueName);d=e.types.DataFieldType.STRING;b.hasOwnProperty("type")&&(d=String(b.type).trim().toLowerCase());b.type=
d;var k;b.hasOwnProperty("hierarchy")?k=this.findDimension(b.hierarchy):d==e.types.DataFieldType.LEVEL&&b.hasOwnProperty("hierarchy")&&(k=this.findDimension(b.hierarchy));null==k&&(k=e._structure.GenericDimension.fromObject(b),b.hasOwnProperty("hierarchy")&&(k.uniqueName=b.hierarchy),k.caption=b.hasOwnProperty("caption")?b.caption:b.hasOwnProperty("hierarchy")?b.hierarchy:k.caption,d==e.types.DataFieldType.LEVEL&&b.hasOwnProperty("hierarchy")&&(k.uniqueName=b.hierarchy),this.addDimension(k));this.types[c]=
d;switch(d){case e.types.DataFieldType.STRING:this.addStringHierarchy(k,b,c);break;case e.types.DataFieldType.NUMBER:this.addNumberHierarchy(k,b,c);break;case e.types.DataFieldType.MONTH:this.addMonthHierarchy(k,b,c);break;case e.types.DataFieldType.WEEKDAY:this.addWeekdayHierarchy(k,b,c);break;case e.types.DataFieldType.DATE:this.addDateHierarchy(k,b,c);break;case e.types.DataFieldType.DATETIME:this.addDateTimeHierarchy(k,b,c);break;case e.types.DataFieldType.TIME:this.addTimeHierarchy(k,b,c);break;
case e.types.DataFieldType.LEVEL:this.addLevelOfHierarchy(k,b,c);break;case e.types.DataFieldType.HIERARCHICAL_DATE:case e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS:this.addHierarchicalDateHierarchy(k,b,c);break;case e.types.DataFieldType.DATE_STRING:this.addDateStringHierarchy(k,b,c);break;case e.types.DataFieldType.ID:this.id=c;this.fields.addItem(c,null);break;case e.types.DataFieldType.DELETE:this.deleteId=c;break;case e.types.DataFieldType.HIDDEN:break;default:this.addStringHierarchy(k,
b,c)}};return b}();h.GenericStructure=f})(e._structure||(e._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(){function b(a){this._hierarchies=new utils.AssociativeArray;this.totalSortType=d.consts.SortType.UNSORTED;this._sortTuple=this.__sortTuple=null;this._expandedTuples=[];this._drilledTuples=[];this._sortType=d.consts.SortType.UNSORTED;this._name=a}Object.defineProperty(b.prototype,"sortTuple",{get:function(){if(null!=this.__sortTuple)return this.__sortTuple;var a=null;if(null!=this._sortTuple)for(var c=0,a=[],b=0;b<this._hierarchies.length;b++){var d=
this.hierarchies.getItemAt(b);if(!d.isMeasures){if(!this._sortTuple[c])break;if("number"==typeof this._sortTuple[c]){a=this._sortTuple;break}else{var k=this._sortTuple[c].toString().trim();if(!/\D/.test(k)){a=this._sortTuple;break}}d=d.findMember(this._sortTuple[c].toString().trim());if(null!=d)a.push(d.ordinal);else if(this._sortTuple[c]){a=null;break}}c++}return this.__sortTuple=a},set:function(a){this._sortTuple=a;this.__sortTuple=null},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,
"sortNamedTuple",{get:function(){var a=null,c=this.sortTuple;if(null!=c)for(var b=0,a=[],d=0;d<this._hierarchies.length;d++){var k=this.hierarchies.getItemAt(d);if(!k.isMeasures){if(!c[b])break;var e=""===c[d]?0:parseInt(c[d]),k=k.members.getItemAt(e);if(null!=k)a.push(k.uniqueName);else if(c[b]){a=null;break}}b++}return a},set:function(a){this.sortTuple=a},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"expandedTuples",{get:function(){return this._expandedTuples},set:function(a){if(null==
a)this._expandedTuples=[];else if(this.hasMeasures)this._expandedTuples=a;else{this._expandedTuples=[];for(var c=0;c<a.length;c++){var b=a[c];b[0]=-1;this._expandedTuples.push(b)}}},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"expandedTuplesBasedOnUniqueNames",{get:function(){for(var a=[],c,b,d,k,e,f,h=0;h<this.expandedTuples.length;h++){c=this.expandedTuples[h].slice(0);b=[];d=c.shift();k="";for(var n=e=0;n<c.length;n++)f=this.hierarchies.getItemAt(e),f.isMeasures&&(-1<d&&(k=
f.members.getItemAt(d).uniqueName),e++,f=this.hierarchies.getItemAt(e)),null!=f.members.getItemAt(c[n])&&b.push(f.members.getItemAt(c[n]).uniqueName),e++;b.unshift(k);a.push(b)}return a},enumerable:!0,configurable:!0});b.prototype.parseExpandedTuplesBasedOnUniqueNames=function(a,c){void 0===c&&(c=null);for(var b=[],d,k,e,f,h,n,p=0;p<a.length;p++){d=a[p].slice(0);if(isNaN(parseInt(d[0]))){k=[];f=-1;e=d.shift();h=0;if(0<this.hierarchies.length)for(var q=0;q<d.length;q++){n=this.hierarchies.getItemAt(h);
if(utils.nullOrUndefined(n))return[];n.isMeasures&&(""!=e&&(f=c?c.indexOf(e):n.members.indexOf(e)),h++,n=this.hierarchies.getItemAt(h));k.push(n.members.indexOf(d[q]));h++}k.unshift(f)}else k=d;b.push(k)}return b};Object.defineProperty(b.prototype,"drilledTuples",{get:function(){return this._drilledTuples},set:function(a){if(utils.nullOrUndefined(a))this._drilledTuples=[];else{var c;if(this.hasMeasures)this._drilledTuples=a;else{this._drilledTuples=[];for(var b=0;b<a.length;b++)c=a[b],"string"==typeof c[0]?
c[1]=-1:c[0]=-1,this._drilledTuples.push(c)}this.setPredefinedDrillDowns(a)}},enumerable:!0,configurable:!0});b.prototype.setPredefinedDrillDowns=function(a){var c,b=this._hierarchies.slice();b.removeItem(d.Cube.MEASURES_NAME);for(var m,k=0;k<a.length;k++){c=a[k].slice(0);"string"==typeof c[0]&&(m=c.shift());var l=b.getItemAt(c.length-3);if(null==l)break;var f=c[1];isNaN(parseFloat(c[1]))||(c=l.members.getItemAt(c[1]),null!=c&&(f=c.uniqueName));-1==l.predefinedDrillDowns.indexOf(f)&&l.predefinedDrillDowns.push([m,
f])}};Object.defineProperty(b.prototype,"drilledTuplesBasedOnUniqueNames",{get:function(){for(var a=[],c,b,d,k,e,f,h,n,p=0;p<this.drilledTuples.length;p++){c=this.drilledTuples[p].slice(0);b=[];e=d="";"string"==typeof c[0]&&(d=c.shift());k=c.shift();f=c.shift();for(var q=h=0;q<c.length;q++)n=this.hierarchies.getItemAt(h),n.isMeasures&&(-1<k&&(e=n.members.getItemAt(k).uniqueName),h++,n=this.hierarchies.getItemAt(h)),null!=n.members.getItemAt(c[q])&&b.push(n.members.getItemAt(c[q]).uniqueName),h++;
b.unshift(f);b.unshift(e);b.unshift(d);a.push(b)}return a},enumerable:!0,configurable:!0});b.prototype.parseDrilledTuplesBasedOnUniqueNames=function(a,c){void 0===c&&(c=null);for(var b=[],d,k,e,f,h,n,p,q,t=0;t<a.length;t++){d=a[t].slice(0);if(isNaN(parseInt(d[d.length-1]))){k=[];f=-1;e=d.shift();h=d.shift();n=d.shift();p=0;if(0<this.hierarchies.length)for(var u=0;u<d.length;u++){q=this.hierarchies.getItemAt(p);if(utils.nullOrUndefined(q))return[];q.isMeasures&&(""!=h&&(f=c?c.indexOf(h):q.members.indexOf(h)),
p++,q=this.hierarchies.getItemAt(p));k.push(q.members.indexOf(d[u]));p++}k.unshift(n);k.unshift(f);""!=e&&k.unshift(e)}else k=d;b.push(k)}return b};Object.defineProperty(b.prototype,"sortType",{get:function(){return this._sortType},set:function(a){a=a.toLowerCase();this._sortType=a==d.consts.SortType.ASC||a==d.consts.SortType.DESC?a:d.consts.SortType.UNSORTED},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"uniqueName",{get:function(){return this._name},set:function(a){this._name=
a},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"caption",{get:function(){return this._caption},set:function(a){this._caption=a},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"hierarchies",{get:function(){return this._hierarchies},set:function(a){this.expandedTuples=[];this.drilledTuples=[];this._sortTuple=null;this._sortType=d.consts.SortType.UNSORTED;this.sortMeasure=null;this._hierarchies=a},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,
"size",{get:function(){for(var a=1,c=0;c<this._hierarchies.length;c++)a*=this._hierarchies.getItemAt(c).size;return a},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"measuresPosition",{get:function(){return this._hierarchies.indexOf(d.Cube.MEASURES_NAME)},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"measuresHierarchy",{get:function(){return this._hierarchies.getItem(d.Cube.MEASURES_NAME)},set:function(a){},enumerable:!0,
configurable:!0});Object.defineProperty(b.prototype,"hasMeasures",{get:function(){return-1<this.measuresPosition},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"depth",{get:function(){for(var a=0,c=0;c<this._hierarchies.length;c++)var b=this._hierarchies.getItemAt(c),a=a+b.drillDownDepth;return a},set:function(a){},enumerable:!0,configurable:!0});b.prototype.toString=function(){return"[Axis:"+this._name+" ]"};b.fromObject=function(a,c,g,m,k,l,f){void 0===f&&(f=
null);a=new b(a);a.hierarchies=new utils.AssociativeArray;var h;if(c)for(h=0;h<c.length;h++)if(null!=c[h].uniqueName){var n=l.findHierarchy(c[h].uniqueName);null!=n&&(d._structure.GenericHierarchy.fromObject(c[h],n),n.isMeasures&&a.uniqueName==d.consts.AxisName.PAGES_AXIS||a.hierarchies.addItem(n.uniqueName,n))}g&&(h=l.findMeasure(g.measure?g.measure:""),null!=h&&null!=g.tuple?a.setSort(h,g.tuple,g.type):a.sortToSet=g);if(m&&0<m.length){n=[];for(h=0;h<m.length;h++){c=m[h];l=[];0<c.length&&l.push((isNaN(parseInt(c[0])),
c[0]));for(g=1;g<c.length;g++)l.push((isNaN(parseInt(c[g])),c[g]));n.push(l)}m=n}a.expandedTuples=m?a.parseExpandedTuplesBasedOnUniqueNames(m,f):[];if(k&&0<k.length){m=[];for(h=0;h<k.length;h++){c=k[h];l=[];0<c.length&&l.push((isNaN(parseInt(c[0])),c[0]));for(g=1;g<c.length;g++)l.push((isNaN(parseInt(c[g])),c[g]));m.push(l)}k=m}a.drilledTuples=k?a.parseDrilledTuplesBasedOnUniqueNames(k,f):[];return a};b.toObject=function(a){for(var c={},b=[],m=0;m<a.hierarchies.length;m++){var k=h.GenericHierarchy.toObject(a.hierarchies.getItemAt(m));
b.push(k)}c.hierarchies=b;a.sortType==d.consts.SortType.UNSORTED||utils.nullOrUndefined(a.sortTuple)||utils.nullOrUndefined(a.sortMeasure)||(c.sort={type:a.sortType,tuple:a.sortNamedTuple,measure:a.sortMeasure.uniqueName});return c};b.prototype.setSort=function(a,c,b){this.sortMeasure=a;this.sortTuple=c;this.sortType=b;0==c.length&&(this.totalSortType=this.sortType,this.totalSortMeasure=this.sortMeasure)};return b}();h.Axis=f})(d._structure||(d._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot=
{}));
(function(d){(function(e){var h;(function(f){var b=function(){function a(c){this._axes=new utils.AssociativeArray;this._measures=new utils.AssociativeArray;this._drillAll=this._expandAll=!1;this._flatOrder=[];this.structure=c;this.addAxis(new e._structure.Axis(e.consts.AxisName.ROWS_AXIS));this.addAxis(new e._structure.Axis(e.consts.AxisName.COLUMNS_AXIS));this.addAxis(new e._structure.Axis(e.consts.AxisName.PAGES_AXIS))}Object.defineProperty(a.prototype,"axes",{get:function(){return this._axes},set:function(c){},
enumerable:!0,configurable:!0});a.prototype.addAxis=function(c){this._axes.addItem(c.uniqueName,c);c.hasMeasures&&(this._axisWithMeasures=c)};a.prototype.findAxis=function(c){return this._axes.getItem(c)};Object.defineProperty(a.prototype,"axisWithMeasures",{get:function(){if(null==this._axisWithMeasures){for(var c=0;c<this._axes.length;c++){var a=this._axes.getItemAt(c);if(a.hasMeasures){this._axisWithMeasures=a;break}}null==this._axisWithMeasures&&(this._axisWithMeasures=this.findAxis(e.consts.AxisName.COLUMNS_AXIS))}this._axisWithMeasures.hasMeasures||
(c=this.structure.measuresHierarchy)&&this._axisWithMeasures.hierarchies.addItem(c.uniqueName,c);return this._axisWithMeasures},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"regularMeasures",{get:function(){for(var c=new utils.AssociativeArray,a=0;a<this._measures.length;a++){var b=this._measures.getItemAt(a);b.calculated||c.addItem(b.uniqueName,b)}return c},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"calculatedMeasures",
{get:function(){for(var c=new utils.AssociativeArray,a=0;a<this._measures.length;a++){var b=this._measures.getItemAt(a);b.calculated&&c.addItem(b.uniqueName,b)}return c},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuresAll",{get:function(){return this._measures},set:function(c){this.measures_=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measures_",{get:function(){for(var c=new utils.AssociativeArray,a=0;a<this._measures.length;a++){var b=
this._measures.getItemAt(a);b.hidden||c.addItem(b.uniqueName,b)}return c},set:function(c){this._measures=c;c=this.axisWithMeasures.measuresHierarchy;if(null!=c&&(c.clear(),null!=this._measures))for(var a=0;a<this._measures.length;a++){var b=this._measures.getItemAt(a),b=new h.GenericMember(b.uniqueName,b.caption);c.addMember(b,"","",!1)}},enumerable:!0,configurable:!0});a.prototype.allHierarchies=function(c,a,b){void 0===c&&(c=!0);void 0===a&&(a=!0);void 0===b&&(b=!1);for(var d=new utils.AssociativeArray,
e=0;e<this._axes.length;e++)var f=this._axes.getItemAt(e),d=d.concat(f.hierarchies);c||d.removeItem(this.structure.measuresHierarchy.uniqueName);if(!a)for(c=0;c<this.pages.length;c++)d.removeItem(this.pages.getKeyAt(e));if(b)for(e=0;e<this.measures_.length;e++)b=this.measures_.getItemAt(e),b.calculated||(b=this.structure.measureToHierarchy(b.uniqueName),d.addItem(b.uniqueName,b));return d};a.prototype.clear=function(){for(var c=0;c<this._axes.length;c++)this._axes.getItemAt(c).hierarchies=new utils.AssociativeArray;
this._measures=new utils.AssociativeArray};Object.defineProperty(a.prototype,"rows",{get:function(){return this.findAxis(e.consts.AxisName.ROWS_AXIS).hierarchies},set:function(c){var a=this.findAxis(e.consts.AxisName.ROWS_AXIS);null==a&&(a=new f.Axis(e.consts.AxisName.ROWS_AXIS));a.hierarchies=c;null==c&&(a.hierarchies=new utils.AssociativeArray);this.addAxis(a)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columns",{get:function(){return this.findAxis(e.consts.AxisName.COLUMNS_AXIS).hierarchies},
set:function(c){var a=this.findAxis(e.consts.AxisName.COLUMNS_AXIS);null==a&&(a=new f.Axis(e.consts.AxisName.COLUMNS_AXIS));a.hierarchies=c;null==c&&(a.hierarchies=new utils.AssociativeArray);this.addAxis(a)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"pages",{get:function(){return this.findAxis(e.consts.AxisName.PAGES_AXIS).hierarchies},set:function(c){var a=this.findAxis(e.consts.AxisName.PAGES_AXIS);null==a&&(a=new f.Axis(e.consts.AxisName.PAGES_AXIS));a.hierarchies=c;null==
c&&(a.hierarchies=new utils.AssociativeArray);this.addAxis(a)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowsOnly",{get:function(){return this.axisWithMeasures.uniqueName==e.consts.AxisName.ROWS_AXIS?this.rows.splice(this.axisWithMeasures.measuresPosition,1):this.rows},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnsOnly",{get:function(){return this.axisWithMeasures.uniqueName==e.consts.AxisName.COLUMNS_AXIS?this.columns.splice(this.axisWithMeasures.measuresPosition,
1):this.columns},set:function(c){},enumerable:!0,configurable:!0});a.prototype.clone=function(){var c=new a(this.structure);c.rows=this.rows.slice();c.columns=this.columns.slice();c.pages=this.pages.slice();c.measures_=this.measures_.slice();c.flatOrder=this.flatOrder.slice(0);return c};a.areRowsDiffer=function(c,b,d){void 0===d&&(d=!0);if(null==b)return!0;var k=c.rows.length!=b.rows.length;if(!k)for(var l=0;l<c.rows.length;l++)if(c.rows.getItemAt(l).uniqueName!=b.rows.getItemAt(l).uniqueName){k=
!0;break}!k&&d&&c.findAxis(e.consts.AxisName.ROWS_AXIS).hasMeasures&&b.findAxis(e.consts.AxisName.ROWS_AXIS).hasMeasures&&(k=a.areMeasuresDiffer(c,b));return k};a.areColumnsDiffer=function(c,b,d){void 0===d&&(d=!0);if(null==b)return!0;var k=c.columns.length!=b.columns.length;if(!k)for(var l=0;l<c.columns.length;l++)if(c.columns.getItemAt(l).uniqueName!=b.columns.getItemAt(l).uniqueName){k=!0;break}!k&&d&&c.findAxis(e.consts.AxisName.COLUMNS_AXIS).hasMeasures&&b.findAxis(e.consts.AxisName.COLUMNS_AXIS).hasMeasures&&
(k=a.areMeasuresDiffer(c,b));return k};a.areMeasuresDiffer=function(c,a){if(null==a)return!0;var b=c.measures_.length!=a.measures_.length;if(!b)for(var d=0;d<c.measures_.length;d++)if(c.measures_.getItemAt(d).uniqueName!=a.measures_.getItemAt(d).uniqueName){b=!0;break}return b};a.fromObject=function(c,b){for(var d=new a(b),k=new utils.AssociativeArray,l=0;l<c.measures.length;l++)if(c.measures[l].hasOwnProperty("uniqueName")){var f=b.measures_.getItem(c.measures[l].uniqueName);null==f&&utils.nullOrEmpty(c.measures[l].formula)||
(f=e._structure.GenericMeasure.fromObject(c.measures[l],f),f.calculated&&!b.measures_.keyExists(f.uniqueName)&&b.addMeasure(f),(utils.nullOrUndefined(c.measures[l].active)||c.measures[l].active)&&k.addItem(f.uniqueName,f))}l=e._structure.Axis.fromObject(e.consts.AxisName.ROWS_AXIS,c.rows,c.rowSorting,c.expandedRows,c.drilledRows,b,k.toArray(!0));f=e._structure.Axis.fromObject(e.consts.AxisName.COLUMNS_AXIS,c.columns,c.columnSorting,c.expandedColumns,c.drilledColumns,b,k.toArray(!0));d.rows=l.hierarchies;
d.columns=f.hierarchies;d.pages=e._structure.Axis.fromObject(e.consts.AxisName.PAGES_AXIS,c.pages,null,[],[],b).hierarchies;d.measures_=k;d.expandAll=c.expandAll;d.drillAll=c.drillAll;d.flatOrder=c.flatOrder;d.addAxis(l);d.addAxis(f);return d};a.prototype.toObject=function(){for(var c={rows:[]},a=0;a<this.rows.length;a++){var b=this.rows.getItemAt(a).toObject();c.rows[a]=b}c.columns=[];for(a=0;a<this.columns.length;a++)b=this.columns.getItemAt(a).toObject(),c.columns[a]=b;c.pages=[];for(a=0;a<this.pages.length;a++)b=
this.pages.getItemAt(a).toObject(),c.pages[a]=b;c.measures=[];for(a=0;a<this.measures_.length;a++)b=this.measures_.getItemAt(a).toObject(),c.measures[a]=b;return c};a.prototype.parseExpandedTuples=function(){for(var c=0;c<this._axes.length;c++)this._axes.getItemAt(c).parseExpandedTuples()};a.prototype.flatten=function(c){void 0===c&&(c=!1);for(var a=this.allHierarchies(!1),b=0;b<this.measures_.length;b++){var d=this.measures_.getItemAt(b),e=this.measureToHierarchy(d.uniqueName);null!=e&&a.addItem(e.uniqueName,
e);d.calculated&&c&&(e=new f.GenericHierarchy(d.uniqueName,d.caption),a.addItem(d.uniqueName,e))}c=new utils.AssociativeArray;for(b=0;b<this.flatOrder.length;b++)d=this.flatOrder[b],a.keyExists(d)&&(c.addItem(d,a.getItem(d)),a.removeItem(d));for(b=0;b<a.length;b++)c.addItem(a.getKeyAt(b),a.getItemAt(b));return c};a.prototype.isEqual=function(c){if(null==c||this.pages.length!=c.pages.length||this.rows.length!=c.rows.length||this.columns.length!=c.columns.length||this.measures_.length!=c.measures_.length)return!1;
for(var a=0;a<this.pages.length;a++)if(this.pages.getKeyAt(a)!=c.pages.getKeyAt(a))return!1;for(a=0;a<this.rows.length;a++)if(this.rows.getKeyAt(a)!=c.rows.getKeyAt(a))return!1;for(a=0;a<this.columns.length;a++)if(this.columns.getKeyAt(a)!=c.columns.getKeyAt(a))return!1;for(a=0;a<this.measures_.length;a++)if(this.measures_.getKeyAt(a)!=c.measures_.getKeyAt(a)||this.measures_.getItemAt(a).aggregation!=c.measures_.getItemAt(a).aggregation)return!1;return!0};a.prototype.measureToHierarchy=function(c){return this.structure.measureToHierarchy(c)};
a.prototype.hierarchyToMeasure=function(c){return this.structure.hierarchyToMeasure(c)};Object.defineProperty(a.prototype,"isEmpty",{get:function(){return 0==this.allHierarchies(!1).length&&0==this.measures_.length},set:function(c){},enumerable:!0,configurable:!0});a.prototype.makeDefault=function(){var c;if(d.model._options.OptionsManager.flatView){this.rows=new utils.AssociativeArray;this.columns=new utils.AssociativeArray;this.pages=new utils.AssociativeArray;for(var a=new utils.AssociativeArray,
b=[],k=0;k<this.structure.measures_.length;k++)c=this.structure.measures_.getItemAt(k),b.push(c.uniqueName),c.type==e.types.MeasureType.COUNT?(c=this.structure.measureToHierarchy(c.uniqueName))&&this.rows.addItem(c.uniqueName,c):a.addItem(c.uniqueName,c);this._flatOrder=b;this.measures_=a}else{for(k=0;k<this.structure.measures_.length&&(c=this.structure.measures_.getItemAt(k),c.type!=e.types.MeasureType.NUMBER?null==a&&(a=this.structure.measureToHierarchy(c.uniqueName)):null==b&&(b=c),null==a||null==
b);k++);null==b?b=this.structure.measures_.getItemAt(0):null==a?(c=this.structure.measures_.getItemAt(0),a=this.structure.measureToHierarchy(c.uniqueName)):null==a&&null==b&&0<this.structure.measures_.length&&(b=this.structure.measures_.getItemAt(0),a=this.structure.measureToHierarchy(b.uniqueName));null!=a&&null!=b&&(this.pages=new utils.AssociativeArray,this.rows=new utils.AssociativeArray,this.columns=new utils.AssociativeArray,this.rows.addItem(a.uniqueName,a),a=new utils.AssociativeArray,a.addItem(b.uniqueName,
b),this.measures_=a)}};Object.defineProperty(a.prototype,"expandAll",{get:function(){return this._expandAll},set:function(c){this._expandAll=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"drillAll",{get:function(){return this._drillAll},set:function(c){this._drillAll=c},enumerable:!0,configurable:!0});a.prototype.clearExpands=function(){this.rowAxis.expandedTuples=[];this.columnAxis.expandedTuples=[]};a.prototype.clearDrills=function(){this.rowAxis.drilledTuples=[];this.columnAxis.drilledTuples=
[]};Object.defineProperty(a.prototype,"flatOrder",{get:function(){null==this._flatOrder&&(this._flatOrder=[]);return this._flatOrder},set:function(c){this._flatOrder=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowAxis",{get:function(){return this.axes.getItem(e.consts.AxisName.ROWS_AXIS)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnAxis",{get:function(){return this.axes.getItem(e.consts.AxisName.COLUMNS_AXIS)},enumerable:!0,configurable:!0});
a.prototype.mergeExpandsAndDrills=function(c){utils.nullOrUndefined(c)||(this.expandAll=c.expandAll,this.drillAll=c.drillAll,a.areRowsDiffer(this,c,!1)?(this.rowAxis.expandedTuples=this.cutTuples(c.rowAxis.expandedTuples,this.getCommonFieldsCount(this.rowAxis.hierarchies,c.rowAxis.hierarchies)),this.rowAxis.drilledTuples=this.cutTuples(c.rowAxis.drilledTuples,this.getCommonFieldsCount(this.rowAxis.hierarchies,c.rowAxis.hierarchies)+2)):(this.rowAxis.expandedTuples=this.cloneTuples(c.rowAxis.expandedTuples),
this.rowAxis.drilledTuples=this.cloneTuples(c.rowAxis.drilledTuples)),a.areColumnsDiffer(this,c,!1)?(this.columnAxis.expandedTuples=this.cutTuples(c.columnAxis.expandedTuples,this.getCommonFieldsCount(this.columnAxis.hierarchies,c.columnAxis.hierarchies)),this.columnAxis.drilledTuples=this.cutTuples(c.columnAxis.drilledTuples,this.getCommonFieldsCount(this.columnAxis.hierarchies,c.columnAxis.hierarchies)+2)):(this.columnAxis.expandedTuples=this.cloneTuples(c.columnAxis.expandedTuples),this.columnAxis.drilledTuples=
this.cloneTuples(c.columnAxis.drilledTuples)))};a.prototype.removeMeasure=function(c){this._measures.removeItem(c)};a.prototype.getCommonFieldsCount=function(c,a){for(var b=0,d=Math.min(c.length,a.length),e=0;e<d;e++){var f=c.getItemAt(e),h=a.getItemAt(e);if(f.uniqueName!=h.uniqueName)break;f.isMeasures||b++}return b};a.prototype.cutTuples=function(c,a){var b=[];if(1<a)for(var d=0;d<c.length;d++){var e=c[d];e.length<=a&&b.push(e.slice())}return b};a.prototype.cloneTuples=function(c){for(var a=[],
b=0;b<c.length;b++)a.push(c[b].slice());return a};return a}();f.Slice=b})(h=e._structure||(e._structure={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function a(){var c=this;this.beforeBeforeLastByte=this.beforeLastByte=this.lastByte=0;this.fileExtensions=[".csv"];this.onAuthApiLoadHandler=function(){return c.onAuthApiLoad()};this.onhandleAuthResultHandler=function(a){return c.handleAuthResult(a)};this.tickHandler=function(){return c.onTick()};this.timerCompleteHandler=function(){return c.onTimerComplete()};this.lastPosition=0;this.isStarted=!1;this.preloaderTime=0;this.cube_=e.Cube.getInstance();
this.fileExtensions=[".csv"]}a.prototype.clear=function(){this.data=[];this.dataLoadedLength=this.bytesLoaded=0;this.connected=!1;this.chunkIndex=this.lastPosition=0;this.recordsetDelimiter="\n";this.fieldEnclosureToken='"';this.columnType=[];this.hasSizeHeader=this.isFileFailed=this.isFileLoaded=this.isHeaderParsed=!1;this.lastByte=0;this.lastRow="";this.rowIdx=this.beforeBeforeLastByte=this.beforeLastByte=0;this.BLOCK_SIZE=100;null!=this.loader&&(this.loader.removeAllEventListeners(),this.loader.dispose(),
this.loader=null);this.stopTimer()};a.prototype.load=function(c,a,b,k,e){try{if(this.clear(),this.filename=c.filename,this.successHandler=a,this.errorHandler=b,this.connectedHandler=k,this.cancelledHandler=e,this.fieldSeparator=c.fieldSeparator,this.ignoreQuotedLineBreaks=c.ignoreQuotedLineBreaks,c.isDemo)this.generate();else{if(void 0!==this.filename&&""!=this.filename&&"()"!=this.filename.substr(-2)||!1!==c.browseForFile)this.filename=utils.URLUtils.getUrl(this.filename,!0);else this.onFileError();
!0===c.browseForFile?this.browseFile():this.isGooggleDrive(c.filename)&&utils.nullOrUndefined(c.requestHeader)?this.authorizeGoogleDrive():(d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA),this.loadFile(this.filename,c.requestHeader))}}catch(f){console.error(f.stack),this.onFileError()}};a.prototype.generate=function(){};a.prototype.authorizeGoogleDrive=function(){window.gapi&&window.gapi.load("auth",{callback:this.onAuthApiLoadHandler})};a.prototype.onAuthApiLoad=function(){if(""==d._view.PivotView.stage.getToolbar().googleClientId||
null==d._view.PivotView.stage.getToolbar().googleClientId)this.onGoogleClientIdNotSet();else window.gapi.auth.authorize({client_id:d._view.PivotView.stage.getToolbar().googleClientId,scope:d._view.PivotView.stage.getToolbar().googleScope,immediate:!1},this.onhandleAuthResultHandler)};a.prototype.handleAuthResult=function(c){var a={};c&&!c.error?(a.Authorization="Bearer "+c.access_token,d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA),this.loadFile(this.filename,a)):(d.preloader(!1),this.onFileError())};
a.prototype.isGooggleDrive=function(c){return-1<c.indexOf("www.googleapis.com/drive")};a.prototype.onGoogleClientIdNotSet=function(){d.uialert(d.model._labels.Labels.MESSAGE_NO_GOOGLE_CLIENT_KEY,d.model._labels.Labels.ERROR,d.AlertType.ERROR)};a.prototype.browseFile=function(){var c=this;this.fileReference=new misc.FileReference;this.fileReference.addEventListener(events._Event.SELECT,function(){return c.onFileSelected()});this.fileReference.addEventListener(events._Event.COMPLETE,function(){return c.onFileComplete()});
this.fileReference.addEventListener(events._Event.PROGRESS,function(a){return c.onFileProgress(a)});this.fileReference.addEventListener(events._Event.CANCEL,function(){return c.onFileCancelled()});this.fileReference.addEventListener(events._Event.ERROR,function(){return c.onFileError()});this.fileReference.browse(this.fileExtensions)};a.prototype.onFileSelected=function(){d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,"",!0,!0);this.loader=this.fileReference;this.fileReference.load();
this.fileReference=null};a.prototype.loadFile=function(c,a){var b=this;void 0===a&&(a=null);var d=new misc.URLStream;d.dataType=misc.DataType.TEXT;d.addEventListener(events._Event.COMPLETE,function(){return b.onFileComplete()});d.addEventListener(events._Event.CONNECTED,function(){return b.onFileConnected()});d.addEventListener(events._Event.PROGRESS,function(c){return b.onFileProgress(c)});d.addEventListener(events._Event.ERROR,function(){return b.onFileError()});d.load(c,a);this.loader=d;this.timer=
new utils.Timer(100,1E3);this.timer.addEventListener(utils.TimerEvent.TIMER,this.tickHandler);this.timer.addEventListener(utils.TimerEvent.TIMER_COMPLETE,this.timerCompleteHandler);this.timer.start()};a.prototype.onTick=function(){0<this.bytesLoaded||this.isFileLoaded||this.isFileFailed?this.stopTimer():null!=this.timer&&d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_LOADING_WAITING,utils.NumberFormatter.format(this.timer.currentCount/
10,new d.model.format.vo.FormatValueObject,!1,!1,1)))};a.prototype.onTimerComplete=function(){this.timer.running&&this.stopTimer()};a.prototype.stopTimer=function(){this.timer&&this.timer.running&&(this.timer.stop(),this.timer.removeEventListener(utils.TimerEvent.TIMER,this.tickHandler),this.timer.removeEventListener(utils.TimerEvent.TIMER_COMPLETE,this.timerCompleteHandler))};a.prototype.onFileCancelled=function(){null!=this.cancelledHandler&&(this.cancelledHandler(),this.cancelledHandler=null);
this.clear()};a.prototype.onFileError=function(){d.preloader(!1);if(!1==this.isFileFailed){this.isFileFailed=!0;var c=d.model.XSSCheck.valid(this.filename)?this.filename:d.model.XSSCheck.validate(this.filename);d.uialert(utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_UNABLE_TO_OPEN_FILE,c),d.model._labels.Labels.ERROR,d.AlertType.ERROR)}null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null);this.stopTimer()};a.prototype.onHeaderParsingError=function(){d.preloader(!1);d.uialert(utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_CSV_HEADER_PARSING_ERROR),
d.model._labels.Labels.ERROR,d.AlertType.ERROR)};a.prototype.onFileProgress=function(c){if(404==c.target.status)this.onFileError();else if(!utils.nullOrUndefined(this.loader))try{var a=this.loader.response;if(null!=a&&0!=a.length&&(this.bytesLoaded!=c.loaded||this.dataLoadedLength!=a.length)&&(this.hasSizeHeader=0<c.total&&c.lengthComputable,this.dataLoadedLength=a.length,this.bytesLoaded=c.loaded,1E4<a.length-this.lastPosition||c.loaded==c.total))if(this.bytesLoaded>d.model.license.Limitations.MAX_CSV)d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),
d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge)),d.preloader(!1),null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null),this.stopTimer();else{this.isFileLoaded=c.loaded==c.total;void 0!==a&&this.parseChunk(a.substring(this.lastPosition,a.length));this.lastPosition=a.length;var b=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_LOADING_PROGRESS,utils.NumberFormatter.formatThousands(c.loaded.toFixed(0)),utils.NumberFormatter.formatThousands(c.total.toFixed(0)));
d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,b)}}catch(k){console.error(k.stack),this.onFileError()}};a.prototype.onFileConnected=function(){this.connected=!0;d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,"")};a.prototype.setConnected=function(){null!=this.connectedHandler&&(this.connectedHandler(),this.connectedHandler=null)};a.prototype.onFileComplete=function(){if(!utils.nullOrUndefined(this.loader))try{if(0==this.lastPosition||!this.hasSizeHeader){var c=this.loader.response;
this.connected=!0;c.length>d.model.license.Limitations.MAX_CSV?(d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge)),d.preloader(!1),null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null),this.clear()):(this.isFileLoaded=!0,this.isStarted?this.hasSizeHeader||(this.lastPosition<c.length?(this.parseChunk(c.substring(this.lastPosition,c.length)),this.lastPosition=c.length):
this.data.push(this.lastRow)):this.parseChunk(c),this.parseAllDataRows(),this.onDataParsed())}}catch(a){console.error(a.stack),this.onFileError()}};a.isCSVValid=function(c){c=c.toLowerCase();return-1!=c.indexOf("<html>")||-1!=c.indexOf("<config>")||0==c.trim().length||-1!=c.indexOf("<!doctype")?(d.uialert(d.model._labels.Labels.MESSAGE_INAPPROPRIATE_FILE_FORMAT,d.model._labels.Labels.ERROR,d.AlertType.ERROR),!1):!0};a.prototype.parseChunk=function(c){this.isStarted=!0;this.setConnected();0==this.chunkIndex&&
-1==c.indexOf("\n")&&-1!=c.indexOf("\r")&&(this.recordsetDelimiter="\r");void 0===this.fieldSeparator&&(this.fieldSeparator=this.chooseSeparator(-1==c.indexOf("\n")&&-1==c.indexOf("\r")?c:c.substring(0,c.indexOf(this.recordsetDelimiter))));this.appendData(c);!1==this.isHeaderParsed&&(1<this.data.length||d.model._options.OptionsManager.showEmptyData)&&(this.parseHeader(this.data.shift(),this.data[0]),this.isHeaderParsed=!0)};a.prototype.onDataParsed=function(){d.preloader(!1);this.isHeaderParsed?null!=
this.successHandler&&this.successHandler():(d.uialert(d.model._labels.Labels.MESSAGE_NO_DATA_AVAILABLE,d.model._labels.Labels.ERROR,d.AlertType.ALERT),null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null));this.clear()};a.prototype.parseHeader=function(c,b){if(a.isCSVValid(c))try{utils.nullOrUndefined(this.fieldSeparator)&&(this.fieldSeparator=",");var m=a.splitRow(c,this.fieldSeparator),k=a.splitRow(b,this.fieldSeparator);this.columnNames=[];for(var l=0;l<m.length;l++){var f=this.getColumnValue(k[l]),
h=m[l],n=null;if(0<m[l].length&&-1<m[l].indexOf("{")){var p=m[l].substr(m[l].indexOf(":")+1,m[l].length);if(0<p.length){h=m[l].substring(0,m[l].indexOf(":"));try{n=JSON.parse(p)}catch(q){console.error("The following JSON meta object for the field '"+m[l].substring(0,m[l].indexOf(":"))+"' in CSV is invalid: "+p),console.error(q.stack),m[l]=h}}}var t;if(utils.nullOrUndefined(n)){var u=this.getColumnType(m[l],f,0==k.length);t=this.getColumnName(m[l]);var v=this.getColumnCaption(t),x=this.getColumnAlias(m[l])||
v;this.columnType[l]=u;this.columnNames.push(t);n={type:u,caption:x,uniqueName:t};if(u==e.types.DataFieldType.LEVEL){var w=t.split(":");n.hierarchy=w[0];n.level=w.pop();if(0<w.length){var y=w.pop();n.parent=y}}}else{if(utils.nullOrUndefined(n.type)||!e.types.DataFieldType.valid(n.type))""==f||void 0===f?n.type=e.types.DataFieldType.STRING:isNaN(Number(f))?isNaN(Number(f))&&(n.type=utils.StringUtils.isDate(f)&&d.model._options.OptionsManager.datePattern==d.model._options.OptionsManager.defaultDatePattern?
e.types.DataFieldType.DATE:e.types.DataFieldType.STRING):n.type=e.types.DataFieldType.NUMBER;t=this.getColumnName(h);if(utils.nullOrUndefined(n.caption)||""==n.caption.length)n.caption=this.getColumnCaption(t);this.columnType[l]=n.type;this.columnNames.push(t)}this.cube_.structure_.addDataField(n,t)}}catch(z){console.error(z.stack),this.onHeaderParsingError()}else this.onFileError()};a.prototype.getColumnValue=function(c){void 0!==c&&null!==c&&(c=c.replace(",","."));return c};a.prototype.getColumnCaption=
function(c){var a=c.split(b.ALIAS_DELIMITER);if(1<a.length)return a[1];this.hasParentHierarchy(c)&&(a=c.split(":"));return a[a.length-1]};a.prototype.getColumnName=function(c){c=c.trim().split(b.ALIAS_DELIMITER)[0];c=this.removeColumnFlags(c);if(-1<this.columnNames.indexOf(c)){for(var a=1,d=c;-1<this.columnNames.indexOf(d);)d=c+a,a++;c=d}return c};a.prototype.getColumnAlias=function(c){c=c.split(b.ALIAS_DELIMITER);return 1<c.length?c[1]:null};a.prototype.removeColumnFlags=function(c){return c.replace(/^(\+|dt\+|t\+|n\+|-|ds\+|d\+|m\+|w\+|D\+|D4\+|url\+|img\+|id\+)/,
"")};a.prototype.getColumnType=function(c,a,b){var k=e.types.DataFieldType.NUMBER;c=c.trim();if(utils.nullOrUndefined(a)&&!b)return e.types.DataFieldType.STRING;"+"==c.charAt(0)?k=e.types.DataFieldType.STRING:"t+"==c.substr(0,2)?k=e.types.DataFieldType.TIME:"dt+"==c.substr(0,3)?k=e.types.DataFieldType.DATETIME:"n+"==c.substr(0,2)?k=e.types.DataFieldType.NUMBER:"-"==c.charAt(0)?k=e.types.DataFieldType.NUMBER:"ds+"==c.substr(0,3)?k=e.types.DataFieldType.DATE_STRING:"d+"==c.substr(0,2)?k=e.types.DataFieldType.DATE:
"m+"==c.substr(0,2)?k=e.types.DataFieldType.MONTH:"w+"==c.substr(0,2)?k=e.types.DataFieldType.WEEKDAY:"D+"==c.substr(0,2)?k=e.types.DataFieldType.HIERARCHICAL_DATE:"D4+"==c.substr(0,3)?k=e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS:"id+"==c.substr(0,3)?k=e.types.DataFieldType.ID:""==a||void 0===a?k=e.types.DataFieldType.STRING:isNaN(Number(a))&&(k=utils.StringUtils.isDate(a)&&d.model._options.OptionsManager.datePattern==d.model._options.OptionsManager.defaultDatePattern?e.types.DataFieldType.DATE:
e.types.DataFieldType.STRING);k==e.types.DataFieldType.STRING&&this.hasParentHierarchy(c)&&(k=e.types.DataFieldType.LEVEL);return k};a.prototype.hasParentHierarchy=function(c){"+"==c.charAt(0)&&(c=c.substr(1));return 1<c.split(":").length&&-1<this.columnNames.indexOf(c.split(":")[0].trim())};a.prototype.parseDataRows=function(){for(var c=utils.getTimer(),a=this.data.length;50>utils.getTimer()-c&&this.rowIdx!=a;)this.parseDataRow(this.data[this.rowIdx++]);500<utils.getTimer()-this.preloaderTime&&this.isFileLoaded&&
(c=d.model._labels.Labels.MESSAGE_ANALYZING_DATA,a=(this.rowIdx/this.data.length*100).toFixed(0),a=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_PROGRESS,utils.NumberFormatter.formatThousands(this.rowIdx.toFixed(0)),utils.NumberFormatter.formatThousands(this.data.length.toFixed(0)),a),d.preloader(!0,c,a),this.preloaderTime=utils.getTimer());return this.isFileLoaded&&this.rowIdx>=this.data.length};a.prototype.parseAllDataRows=function(){for(d.preloader(!0,d.model._labels.Labels.MESSAGE_ANALYZING_DATA,
utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_RECORDS,utils.NumberFormatter.formatThousands(this.data.length.toFixed(0))));this.rowIdx<this.data.length;this.rowIdx++)this.parseDataRow(this.data[this.rowIdx])};a.prototype.parseDataRow=function(c){if(!utils.nullOrEmpty(c)&&void 0!==this.columnNames){c=utils.StringUtils.trim(c,this.fieldSeparator);if(c.split(this.fieldSeparator).length<this.columnNames.length)for(var a=c.split(this.fieldSeparator).length;a<this.columnNames.length;a++)c=
c.concat(this.fieldSeparator);c+=" ";for(var b=!1,k=!1,l="",f=0,h=[],n=[],p="",a=0;a<c.length;a++){var q=c.charAt(a);a==c.length-1||q==this.fieldSeparator&&!b?(a==c.length-1&&(l+=q),l=l.trim(),l=l.replace("\r",""),l.charAt(0)==this.fieldEnclosureToken&&l.charAt(l.length-1)==this.fieldEnclosureToken&&(l=l.slice(1,l.length-1)),this.columnType[f]==e.types.DataFieldType.ID&&(p=l),d.model.XSSCheck.valid(l)||(l=d.model.XSSCheck.validate(l)),null!=this.columnNames[f]&&this.cube_.localDataStorage.addMember(this.columnNames[f],
l,this.columnType[f],h,n),b=k=!1,l="",f++):q==this.fieldEnclosureToken?(k||(l+=q),b=!b,k=!0):(l+=q,k=!1)}this.cube_.localDataStorage.insert(h,n,p)}};a.prototype.appendData=function(c){void 0!==this.lastRow&&0<this.lastRow.length&&(c=utils.StringUtils.concat(this.lastRow,c));c=this.splitLines(c);for(var a=0;a<c.length;a++)this.data.push(c[a]);!0!=this.isFileLoaded&&(this.lastRow=this.data.pop())};a.prototype.splitLines=function(c){var a=!1;c=c.split(this.recordsetDelimiter);if(!1==this.ignoreQuotedLineBreaks)for(var b=
0;b<c.length;b++)a?(this.isQuoteOpen(c[b])&&(a=!1),c[b-1]+="<br/>"+c[b],c.splice(b,1),b--):this.isQuoteOpen(c[b])&&(a=!0);return c};a.prototype.isQuoteOpen=function(c){return 1==this.countChar(c,this.fieldEnclosureToken)%2};a.prototype.countChar=function(c,a){var b=0;if(c)for(var d=0;d<c.length;d++)c.charAt(d)==a&&b++;return b};a.prototype.chooseSeparator=function(c){if(void 0==this.fieldSeparator){var a=c.split(",").length;c=c.split(";").length;return a>c?",":";"}};a.splitRow=function(c,a,b){void 0===
b&&(b='"');if(null==c)return[];for(var d="",e=!1,f=!1,h=[],n=0;n<c.length;n++){var p=c.charAt(n);n==c.length-1||p==a&&!e?(n==c.length-1&&p==a?(h.push(d),d=""):n==c.length-1&&(d+=p),d=d.trim(),d.charAt(0)==b&&d.charAt(d.length-1)==b&&(d=d.slice(1,d.length-1)),e=f=!1,h.push(d),d=""):p==b?(f||(d+=p),e=!e,f=!0):(d+=p,f=!1)}return h};a.splitRowWithMeta=function(c,a,b,d,e){void 0===b&&(b='"');void 0===d&&(d="{");void 0===e&&(e="}");if(null==c)return[];for(var f="",h=!1,n=!1,p=!1,q=[],t=0;t<c.length;t++){var u=
c.charAt(t);t==c.length-1||u==a&&!h&&!p?(t==c.length-1&&u==a?(q.push(f),f=""):t==c.length-1&&(f+=u),f=f.trim(),f.charAt(0)==b&&f.charAt(f.length-1)==b&&(f=f.slice(1,f.length-1)),p=h=n=!1,q.push(f),f=""):u==b?(n||(f+=u),h=!h,n=!0):(n=!1,u==d?p=!0:u==e&&(p=!1),f+=u)}return q};a.timeCaption=function(c){return c&&0<c.length?c:d.model._labels.Labels.INVALID_DATE};a.prototype.loadMembers=function(c,a,b){};a.prototype.loadMemberChildren=function(c,a,b,d){};a.prototype.loadMemberDescendants=function(c,a,
b,d){};a.prototype.searchMembers=function(c,a,b,d){};a.prototype.cancel=function(){this.clear();this.connectedHandler=this.errorHandler=this.successHandler=null};return a}();h.CSVLoader=f;var b=function(){function a(){}a.NAN="N";a.FLOAT="F";a.DELIMITER="|";a.NEW_LINE="\n";a.ALIAS_DELIMITER="+T+";return a}();h.Consts=b})(e.csv||(e.csv={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){this._embedded=!1;this._dataOffset=0;this.FIELD_DELIMITER=",";this.RECORDSET_DELIMITER="\n";this._cube=e.Cube.getInstance();this._isStarted=!1;this._embeddedDataStartSign="\x3c!--";this._embeddedDataStopSign="--\x3e";this._embeddedDataJSONStartSign="/**----**";this._embeddedDataJSONStopSign="**--!--**/";this._currentDataStopSign=this._currentDataStartSign="";this._preloaderTime=0;this.regDelimiter=RegExp("%d%","g");this.regQuote=
RegExp("%q%","g");this.regNewline=RegExp("%n%","g")}b.prototype.load=function(a,c,b,d,k){try{this.clear(),this._connectionInfo=a,this._successHandler=c,this.connectedHandler=d,this.cancelledHandler=k,this._errorHandler=b,this._embedded=this._connectionInfo.embedded,this._dataOffset=this._connectionInfo.embeddedDataOffset,this._dataToLoad=this._connectionInfo.embeddedDataToLoad,this._embeddedDataStarted=!1,this._embedded&&null!=this._dataToLoad&&this.loadEmbedded(this._dataToLoad)}catch(e){console.error(e.stack),
this.onFileError()}};b.prototype.defineCurrentDataSigns=function(a){this._currentDataStartSign=-1<a.indexOf(this._embeddedDataJSONStartSign)?this._embeddedDataJSONStartSign:this._embeddedDataStartSign;this._currentDataStopSign=this._currentDataStartSign==this._embeddedDataJSONStartSign?this._embeddedDataJSONStopSign:this._embeddedDataStopSign};b.prototype.loadEmbedded=function(a){var c=this;this.BLOCK_SIZE=2E3;this._bytesLoaded=0;try{var b=new d.DataStream(a,this._dataOffset,d.DataStream.BIG_ENDIAN);
utils.getTimer();var m=b.byteLength>this.BLOCK_SIZE?this.BLOCK_SIZE:b.byteLength,k=b.readString(m);this.defineCurrentDataSigns(k);this._dataStrFromBytes="";this._dataStrFromBytes+=k.substring(this._currentDataStartSign.length);this._bytesLoaded+=m;this._bytesToLoad=b.byteLength;if(this._bytesLoaded<this._bytesToLoad)utils.ThreadManager.addTask(this.loadBytes,this,b,function(){return c.onComplete()});else this.onComplete()}catch(e){console.error(e.stack),this.onFileError()}};b.prototype.loadBytes=
function(a){var c=this._bytesToLoad-this._bytesLoaded>this.BLOCK_SIZE?this.BLOCK_SIZE:this._bytesToLoad-this._bytesLoaded;a=a.readString(c);this._bytesLoaded+=c;this._dataStrFromBytes+=a;this.showLoadingProgress(this._bytesLoaded,this._bytesToLoad);return this._bytesLoaded>=this._bytesToLoad};b.prototype.showLoadingProgress=function(a,c){var b=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_RECORDS,(a/c*100).toFixed(0)+"%");d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING,b)};
b.prototype.onComplete=function(){d.preloader(!1);this._isFileLoaded=!0;this.processStringFromBytes(this._dataStrFromBytes)};b.prototype.setConnected=function(){null!=this.connectedHandler&&(this.connectedHandler(),this.connectedHandler=null)};b.prototype.processStringFromBytes=function(a){a=utils.StringUtils.trimLeft(a);this.parseChunk(a)};b.prototype.onTick=function(){this._timerCount++;if(0<this._bytesLoaded||this._isFileLoaded||this._isFileFailed)utils.fmClearInterval(this._timer),this._timerCount=
0;else{var a=this._timerCount/10;this._isConnected?(196<a&&(a=196),a=utils.NumberFormatter.format(a/2,new d.model.format.vo.FormatValueObject,!1,!1,1)+"%"):a=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_LOADING_WAITING,utils.NumberFormatter.format(a,new d.model.format.vo.FormatValueObject,!1,!1,1));d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,a)}};b.prototype.onFileError=function(){utils.fmClearInterval(this._timer);d.preloader(!1);!1==this._isFileFailed&&(this._isFileFailed=
!0,d.uialert(utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_UNABLE_TO_OPEN_FILE,""),d.model._labels.Labels.ERROR,d.AlertType.ERROR));null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null);this.clear()};b.prototype.parseChunk=function(a){this._isStarted=!0;this.setConnected();this.appendData(a);!1==this._isHeaderParsed&&1<this._data.length&&(this._data.shift(),this.parseHeader(this._data.shift()),this._isHeaderParsed=!0,this.parseAllDataRows(),this.onDataParsed())};b.prototype.appendData=
function(a){void 0!==this._lastRow&&0<this._lastRow.length&&(a=utils.StringUtils.concat(this._lastRow,a));a=0<=a.indexOf(this.RECORDSET_DELIMITER)?a.split(this.RECORDSET_DELIMITER):[];for(var c=0;c<a.length;c++)this._data.push(a[c]);!0!=this._isFileLoaded&&(this._lastRow=this._data.pop(),this._lastRow=this._lastRow==this._currentDataStopSign?this._data.pop():this._lastRow)};b.prototype.parseHeader=function(a){a=h.CSVLoader.splitRowWithMeta(a,this.FIELD_DELIMITER);this._columnNames=[];for(var c=0;c<
a.length;c++){var b=a[c],d={};if(0<a[c].length&&-1<a[c].indexOf("{")){var k=a[c].substr(a[c].indexOf(":")+1,a[c].length);if(0<k.length){b=a[c].substring(0,a[c].indexOf(":"));try{d=JSON.parse(k)}catch(e){console.error("The following JSON meta object for the field '"+a[c].substring(0,a[c].indexOf(":"))+"' in CSV is invalid: "+k),console.error(e.stack)}}}b=this.getColumnName(b);if(utils.nullOrUndefined(d.caption)||""==d.caption.length)d.caption=this.getColumnCaption(b);this._columnType[c]=d.type;this._columnNames.push(b);
this._cube.structure_.addDataField(d,b)}};b.prototype.getColumnCaption=function(a){var c=a.split(h.Consts.ALIAS_DELIMITER);if(1<c.length)return c[1];this.hasParentHierarchy(a)&&(c=a.split(":"));return c[c.length-1]};b.prototype.hasParentHierarchy=function(a){"+"==a.charAt(0)&&(a=a.substr(1));return 1<a.split(":").length&&-1<this._columnNames.indexOf(a.split(":")[0].trim())};b.prototype.getColumnName=function(a){a=a.trim().split(h.Consts.ALIAS_DELIMITER)[0];a=this.removeColumnFlags(a);a=this.decodeChars(a);
if(-1<this._columnNames.indexOf(a)){for(var c=1,b=a;-1<this._columnNames.indexOf(b);)b=a+c,c++;a=b}return a};b.prototype.removeColumnFlags=function(a){return a.replace(/^(\+|dt\+|t\+|n\+|-|ds\+|d\+|m\+|w\+|D\+|D4\+|url\+|img\+|id\+)/,"")};b.prototype.parseAllDataRows=function(){for(d.preloader(!0,d.model._labels.Labels.MESSAGE_ANALYZING_DATA,utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_RECORDS,utils.NumberFormatter.formatThousands(this._data.length.toFixed(0))));this._rowIdx<this._data.length;this._rowIdx++)this.parseDataRow(this._data[this._rowIdx])};
b.prototype.parseDataRows=function(){var a=utils.getTimer(),c=this._rowIdx+this.BLOCK_SIZE;for(c>this._data.length&&(c=this._data.length);this._rowIdx<c;this._rowIdx++)this.parseDataRow(this._data[this._rowIdx]);this.BLOCK_SIZE=utils.ThreadManager.adjustTaskSize(utils.getTimer()-a,this.BLOCK_SIZE);1E3<utils.getTimer()-this._preloaderTime&&this._isFileLoaded&&(a=d.model._labels.Labels.MESSAGE_ANALYZING_DATA,c=(this._rowIdx/this._data.length*100).toFixed(0),c=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_PROGRESS,
utils.NumberFormatter.formatThousands(this._rowIdx.toFixed(0)),utils.NumberFormatter.formatThousands(this._data.length.toFixed(0)),c),d.preloader(!0,a,c),this._preloaderTime=utils.getTimer());return this._isFileLoaded&&this._rowIdx>=this._data.length};b.prototype.parseDataRow=function(a){if(!utils.nullOrEmpty(a)&&void 0!==this._columnNames&&a!=this._currentDataStopSign){if(a.split(this.FIELD_DELIMITER).length<this._columnNames.length)for(var c=a.split(this.FIELD_DELIMITER).length;c<this._columnNames.length;c++)a=
a.concat(this.FIELD_DELIMITER);var b=[],d=[];a=a.split(this.FIELD_DELIMITER);for(c=0;c<a.length;c++)this.parseDataValue(a[c],c,b,d);this._cube.localDataStorage.insert(b,d)}};b.prototype.parseDataValue=function(a,c,b,m){var k=!0;if(null!=this._columnNames[c]){if(this._columnType[c]==e.types.DataFieldType.STRING||this._columnType[c]==e.types.DataFieldType.WEEKDAY||this._columnType[c]==e.types.DataFieldType.MONTH){if("^"==a.charAt(0)){var l=parseInt(a.substring(1));if(!1==isNaN(l)){var f=this._cube.structure_.getDataField(this._columnNames[c]),
l=f.members.getItemAt(l+1);null!=l&&(a=l.caption==d.model._labels.Labels.MEMBER_BLANK?"":l.caption,k=!1)}}}else if(this._columnType[c]==e.types.DataFieldType.LEVEL)"^"==a.charAt(0)&&(l=parseInt(a.substring(1)),!1==isNaN(l)&&(f=this._cube.structure_.getDataField(this._columnNames[c]),null==f.members&&(f=this._cube.structure_.getDataField(this._columnNames[c]).hierarchy),l=f.members.getItemAt(l+1),null!=l&&(a=l.caption==d.model._labels.Labels.MEMBER_BLANK?"":l.caption,k=!1)));else if(this._columnType[c]==
e.types.DataFieldType.DATE||this._columnType[c]==e.types.DataFieldType.DATE_STRING||this._columnType[c]==e.types.DataFieldType.HIERARCHICAL_DATE||this._columnType[c]==e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS)a=1E3*parseInt(a),k=!1;!0==k&&(a=this.decodeChars(a));this._cube.localDataStorage.addMember(this._columnNames[c],a,this._columnType[c],b,m)}};b.prototype.decodeChars=function(a){return a.replace(this.regDelimiter,",").replace(this.regQuote,'"').replace(this.regNewline,"\n")};b.prototype.onDataParsed=
function(){d.preloader(!1);this._isHeaderParsed?this.successHandler():(d.uialert(d.model._labels.Labels.MESSAGE_NO_DATA_AVAILABLE,d.model._labels.Labels.ERROR,d.AlertType.ALERT),this.errorHandler(),this._errorHandler=null);this.clear()};b.prototype.clear=function(){this._data=[];this._currentDataStopSign=this._currentDataStartSign="";this._bytesLoaded=0;this._isConnected=!1;this._columnType=[];this._hasSizeHeader=this._isFileFailed=this._isFileLoaded=this._isHeaderParsed=!1;this._lastRow="";this._rowIdx=
0;this.BLOCK_SIZE=100;utils.fmClearInterval(this._timer)};b.prototype.successHandler=function(){null!=this._successHandler&&this._successHandler()};b.prototype.errorHandler=function(){null!=this._errorHandler&&this._errorHandler()};b.prototype.loadDimensions=function(a){};b.prototype.loadHierarchies=function(a){};b.prototype.loadLevels=function(a){};b.prototype.loadMeasures=function(a){};b.prototype.loadMembers=function(a,c,b){};b.prototype.loadMemberChildren=function(a,c,b,d){};b.prototype.loadMemberDescendants=
function(a,c,b,d){};b.prototype.searchMembers=function(a,c,b,d){};b.prototype.cancel=function(){this.connectedHandler=this.errorHandler=this.successHandler=null};return b}();h.CSVEmbeddedLoader=f})(e.csv||(e.csv={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function a(){this.NaN="NaN";this._embeddedJSONDataStart="/**----**";this._embeddedJSONDataFinish="**--!--**/"}a.prototype.getData=function(c){this._callback=c;d.preloader(!0,d.model._labels.Labels.MESSAGE_SAVING);this.preprocessHeader();this.composeData()};a.prototype.preprocessHeader=function(){this._allHierarchies=e.Cube.getInstance().structure_.allHierarchies();this._columnsList=[];var c;for(this._colIdx=0;this._colIdx<this._allHierarchies.length;){c=
this._allHierarchies.getItemAt(this._colIdx);var a=e.Cube.getInstance().structure_.hierarchyToMeasure(c.uniqueName).type;a!=e.types.MeasureType.COUNT&&a!=e.types.MeasureType.DATE?this.processMeasureColumn(e.Cube.getInstance().structure_.hierarchyToMeasure(c.uniqueName)):this.processHierarchyColumn(c);this._colIdx++}};a.prototype.composeData=function(){var c=this;this._rowIdx=0;this._data="";this._facts=e.Cube.getInstance().localDataStorage.getFacts();this._tuples=e.Cube.getInstance().localDataStorage.getTuples();
utils.ThreadManager.addTask(this.composeLine,this,null,function(){return c.onDataCreated()})};a.prototype.composeLine=function(){var c=utils.getTimer();for(this._colIdxDifference=this._colIdx=0;this._rowIdx<this._tuples.length;){for(;this._colIdx+this._colIdxDifference<this._tuples[this._rowIdx].length;)this.addMember(this.composeMember()),this._colIdx++;this._rowIdx++;this._data+="\n";this._colIdxDifference=this._colIdx=0;if(100<utils.getTimer()-c)break}this.showSavingProgress(this._rowIdx,this._tuples.length);
return this._rowIdx>=this._tuples.length};a.prototype.composeMember=function(){var c=this._columnsList[this._colIdx].type,a;c!=e.types.DataFieldType.DATE&&c!=e.types.DataFieldType.DATE_STRING&&c!=e.types.DataFieldType.LEVEL&&c!=e.types.DataFieldType.HIERARCHICAL_DATE&&c!=e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS&&c!=e.types.DataFieldType.TIME&&c!=e.types.DataFieldType.DATETIME&&(a=this._allHierarchies.getItem(this._columnsList[this._colIdx].uniqueName).members.getItemAt(this._tuples[this._rowIdx][this._colIdx+
this._colIdxDifference]).caption);if(c==e.types.DataFieldType.NUMBER)return null!=a?a.toString():"";if(c!=e.types.DataFieldType.STRING&&c!=e.types.DataFieldType.WEEKDAY&&c!=e.types.DataFieldType.MONTH){if(c==e.types.DataFieldType.LEVEL){c=this._allHierarchies.getItem(this._columnsList[this._colIdx].hierarchy);a=c.members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]).caption;for(var b=this._colIdx,d=0;d<c.levels_.length-2;d++)this.addMember(this.composeStringData(a,b)),
this._colIdx++,a=null==this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]||""==this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]+""?"":c.members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]).caption;return this.composeStringData(a,b)}if(c==e.types.DataFieldType.DATE_STRING)return this._allHierarchies.getItem(this._columnsList[this._colIdx].uniqueName).members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]).levelOrdinal/
1E3+"";if(c==e.types.DataFieldType.DATE)return a="",c=this._allHierarchies.getItem(this._columnsList[this._colIdx].uniqueName+".Year").members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]),a+=c.caption+"-",this._colIdxDifference++,c=this._allHierarchies.getItem(this._columnsList[this._colIdx].uniqueName+".Month").members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]),a+=c.caption+"-",this._colIdxDifference++,c=this._allHierarchies.getItem(this._columnsList[this._colIdx].uniqueName+
".Day").members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]),a+=c.caption,(new Date(a)).getTime()/1E3+Math.abs(60*(new Date).getTimezoneOffset())+"";if(c==e.types.DataFieldType.HIERARCHICAL_DATE||c==e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS)return this.composeHierarchicalDateData(c);if(c==e.types.DataFieldType.TIME||c==e.types.DataFieldType.DATETIME)return this._facts[this._rowIdx][this._colIdx+this._colIdxDifference]+""}return this.composeStringData(a)};
a.prototype.addMember=function(c){this._data+=c==this.NaN||c==d.model._labels.Labels.MEMBER_BLANK?"":c;this._data+=this._colIdx+this._colIdxDifference<this._tuples[this._rowIdx].length-1?",":""};a.prototype.composeStringData=function(c,a){void 0===a&&(a=this._colIdx);if(""==c)return c;this._columnsList[a].members.keyExists(c)||this._columnsList[a].members.addItem(c,this._columnsList[a].members.length);return this.encodeChars(c)};a.prototype.encodeChars=function(c){return c.replace(/,/g,"%d%").replace(/\"/g,
"%q%").replace(/\n/g,"%n%")};a.prototype.composeHierarchicalDateData=function(c){this._colIdxDifference+=2;this._colIdxDifference=c==e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS?this._colIdxDifference+1:this._colIdxDifference;return this._allHierarchies.getItem(this._columnsList[this._colIdx].uniqueName).members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]).levelOrdinal/1E3+""};a.prototype.onDataCreated=function(){d.preloader(!1);null!=this._callback&&this._callback(this.getResult())};
a.prototype.processHierarchyColumn=function(c){var a=this.getHierarchyType(c);a==e.types.DataFieldType.LEVEL?this.processLevelsColumn(c):a==e.types.DataFieldType.DATE?(this._columnsList.push(this.createColumn(a,c.dimension.uniqueName,c.dimension.caption)),this._colIdx+=2):this._columnsList.push(this.createColumn(a,c.uniqueName,c.caption))};a.prototype.getResult=function(){for(var c=this._embeddedJSONDataStart+"\n___csv___WDR___"+d.Pivot.BUILD_VERSION+"\n",a=0;a<this._columnsList.length;a++)c+=this._columnsList[a].uniqueName,
c+=":{",c+='"type": "'+this._columnsList[a].type+'"',this._columnsList[a].isLevel?(c+=', "hierarchy": "'+this._columnsList[a].hierarchy+'"',c+=', "level": "'+this._columnsList[a].uniqueName+'"',utils.nullOrUndefined(this._columnsList[a].parent)||(c+=', "parent": "'+this._columnsList[a].parent+'"')):this._columnsList[a].uniqueName!=this._columnsList[a].caption&&(c+=', "caption": "'+this._columnsList[a].caption+'"'),c+="}",c+=a<this._columnsList.length-1?",":"";return c+"\n"+this._data+this._embeddedJSONDataFinish};
a.prototype.processMeasureColumn=function(c){this._columnsList.push(this.createColumn(e.types.MeasureType.toDataFieldType(c.type),c.uniqueName,c.originalCaption,!0))};a.prototype.processLevelsColumn=function(c){var a=c.uniqueName;c=c.levels_;for(var b,d,l=1;l<c.length;l++){d=l;b=c.getItem(c.getKeyAt(l));var f;1<d&&(f=c.getItem(c.getKeyAt(d-1)).uniqueName);b=this.createColumn(e.types.DataFieldType.LEVEL,b.uniqueName,b.caption);b.isLevel=!0;b.hierarchy=a;utils.nullOrUndefined(f)||(b.parent=f);this._columnsList.push(b)}};
a.prototype.getHierarchyType=function(c){if(c.dimension.type.toString()==e.types.DataFieldType.DATE_STRING)return e.types.DataFieldType.DATE_STRING;var a=e.types.DataFieldType.typeName(c.type);2<c.levels_.length&&(a=4==c.levels_.length&&c.levels_.getItemAt(1).uniqueName==c.uniqueName+".Year"?e.types.DataFieldType.HIERARCHICAL_DATE:5==c.levels_.length&&c.levels_.getItemAt(1).uniqueName==c.uniqueName+".Year"?e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS:e.types.DataFieldType.LEVEL);return a};
a.prototype.showSavingProgress=function(c,a){var b=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_RECORDS,(c/a*100).toFixed(0)+"%");d.preloader(!0,d.model._labels.Labels.MESSAGE_SAVING,b)};a.prototype.createColumn=function(c,a,d,k){void 0===k&&(k=!1);var e=new b;e.type=c;e.uniqueName=a;e.caption=d;e.isMeasure=k;return e};return a}();h.CSVSaver=f;var b=function(){function a(){this._isLevel=!1;this._members=new utils.AssociativeArray}Object.defineProperty(a.prototype,"members",{get:function(){return this._members},
enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this._type},set:function(c){this._type=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"uniqueName",{get:function(){return this._uniqueName},set:function(c){this._uniqueName=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"caption",{get:function(){return this._caption},set:function(c){this._caption=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"isMeasure",{get:function(){return this._isMeasure},set:function(c){this._isMeasure=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isLevel",{get:function(){return this._isLevel},set:function(c){this._isLevel=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hierarchy",{get:function(){return this._hierarchyUniqueName},set:function(c){this._hierarchyUniqueName=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"parent",{get:function(){return this._parentUniqueName},
set:function(c){this._parentUniqueName=c},enumerable:!0,configurable:!0});return a}();h.Column=b})(e.csv||(e.csv={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c.CHUNK_SIZE=1E4;c.factsCounter=0;c.fileExtensions=[".js",".json"];return c}__extends(a,b);a.prototype.load=function(c,a,d,k,e){this.clear();this.successHandler=a;this.errorHandler=d;this.connectedHandler=k;this.cancelledHandler=e;!0===c.browseForFile?this.browseFile():void 0!==c.filename&&""!=c.filename&&"()"!=c.filename.substr(-2)?b.prototype.load.call(this,c,a,d,k,e):this.addData(c.data)};a.prototype.onFileProgress=
function(c){if(!utils.nullOrUndefined(this.loader))try{if(1E4<c.loaded-this.bytesLoaded){var a=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_LOADING_PROGRESS,utils.NumberFormatter.formatThousands((c.loaded/1E3).toFixed(0)),utils.NumberFormatter.formatThousands((c.total/1E3).toFixed(0)));d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,a)}this.bytesLoaded=c.loaded}catch(b){console.error(b.stack),this.onFileError()}};a.prototype.onFileComplete=function(){if(!utils.nullOrUndefined(this.loader)){var c=
this.loader.response;this.connected=!0;c.length>d.model.license.Limitations.MAX_JSON?(d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge)),d.preloader(!1),null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null),this.clear()):(this.isFileLoaded=!0,this.parseChunk(c))}};a.prototype.parseChunk=function(c){try{var a=JSON.parse(c);utils.nullOrUndefined(a.items)||(a=a.items);
if(utils.nullOrUndefined(a.length)){this.invalidFormat();return}}catch(b){this.invalidFormat();return}d.preloader(!1);this.addData(a)};a.prototype.addData=function(c){utils.nullOrUndefined(c.items)||(c=c.items);if(!(utils.nullOrUndefined(c)||1>c.length))if(JSON.stringify(c).length>d.model.license.Limitations.MAX_JSON&&15649632E5<Date.now()||c.toString().length>d.model.license.Limitations.MAX_JSON)d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge));
else{this.setConnected();var a=!1,b=c[0]&&c[0]instanceof Array;b?this.parseHeader(c[0].toString(),c[1].toString()):a=this.cube_.structure_.addDataStructure(c[0]);this.data=c.slice();this.factsCounter=0;(a||b)&&this.data.shift();this.parseAllDataRows();this.onParseComplete()}};a.prototype.updateData=function(c){if(!(utils.nullOrUndefined(c)||1>c.length))if(JSON.stringify(c).length>d.model.license.Limitations.MAX_JSON&&15649632E5<Date.now()||c.toString().length>d.model.license.Limitations.MAX_JSON)d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),
d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge));else{this.cube_.localDataStorage.clearUpdates();for(var a=c[1]&&c[1]instanceof Array,b=0;b<c.length;b++)a?this.cube_.localDataStorage.insertArray(c[b],!0):this.cube_.localDataStorage.insertObject(c[b],!0)}};a.prototype.onParseComplete=function(){d.preloader(!1);this.successHandler()};a.prototype.parseDataRow=function(c){var a=this.factsCounter;c=a+this.CHUNK_SIZE;for(var b=this.data[1]&&this.data[1]instanceof Array;a<
c;a++){if(a==this.data.length)return!0;b?this.cube_.localDataStorage.insertArray(this.data[a]):this.cube_.localDataStorage.insertObject(this.data[a]);this.factsCounter++}c=Math.round(this.factsCounter/this.data.length*100);100<c&&(c=100);d.preloader(!0,d.model._labels.Labels.MESSAGE_ANALYZING_DATA,utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_PROGRESS,utils.NumberFormatter.formatThousands(this.factsCounter.toString()),utils.NumberFormatter.formatThousands(this.data.length.toString()),
c.toString()));return!1};a.prototype.parseAllDataRows=function(){d.preloader(!0,d.model._labels.Labels.MESSAGE_ANALYZING_DATA,utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_RECORDS,utils.NumberFormatter.formatThousands(this.data.length.toFixed(0))));for(var c=this.data[1]&&this.data[1]instanceof Array;this.factsCounter<this.data.length;this.factsCounter++)c?this.cube_.localDataStorage.insertArray(this.data[this.factsCounter]):this.cube_.localDataStorage.insertObject(this.data[this.factsCounter])};
a.prototype.invalidFormat=function(){d.preloader(!1);d.uialert(d.model._labels.Labels.MESSAGE_INVALID_JSON_DATA,d.model._labels.Labels.ERROR);this.errorHandler();this.stopTimer()};return a}(e.csv.CSVLoader);h.JSONLoader=f})(e.json||(e.json={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.valid=function(a){return a==b.JSON||a==b.CSV||a==b.EMPTY};b.CSV="csv";b.JSON="json";b.EMPTY="";return b}();d.DataSourceType=e})(d.consts||(d.consts={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));(function(d){(function(d){(function(d){var e=function(){function b(){}b.TOP="top";b.BOTTOM="bottom";b.NONE="none";return b}();d.FilterType=e})(d.consts||(d.consts={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.isValid=function(a){return a==b.UNSORTED||a==b.ASC||a==b.DESC};b.UNSORTED="unsorted";b.ASC="asc";b.DESC="desc";b.NUMERIC_RANGE="numericRange";return b}();d.SortType=e})(d.consts||(d.consts={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.ROWS_AXIS="rows";b.COLUMNS_AXIS="columns";b.PAGES_AXIS="pages";return b}();d.AxisName=e})(d.consts||(d.consts={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));(function(d){(function(d){(function(d){var e=function(){function b(){}b.MD_DIMTYPE_UNKNOWN=0;b.MD_DIMTYPE_TIME=1;b.MD_DIMTYPE_MEASURE=2;b.MD_DIMTYPE_OTHER=3;return b}();d.DimensionType=e})(d.types||(d.types={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.fromDataFieldType=function(a){var c=b.DEFAULT;switch(a){case d.DataFieldType.NUMBER:c=b.MEASURE;break;case d.DataFieldType.DATE:c=b.DATE}return c};b.toDataFieldType=function(a){var c=d.DataFieldType.STRING;switch(a){case b.MEASURE:c=d.DataFieldType.NUMBER;break;case b.DATE:c=d.DataFieldType.DATE}return c};b.DEFAULT=0;b.DATE=1;b.MEASURE=2;return b}();d.HierarchyType=e})(d.types||(d.types={}))})(d.data_||(d.data_={}))})(pivot||
(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.fromColumnType=function(a){switch(a){case 13:return b.TIME;case 15:return b.DATETIME;case 3:return b.BOOLEAN;case 12:return b.NUMBER}return b.COUNT};b.fromDataType=function(a){var c=b.COUNT;switch(a){case "number":c=b.NUMBER;break;case "string":c=b.STRING;break;case "boolean":c=b.BOOLEAN;break;case "date":c=b.DATE;break;case "timestamp":c=b.TIME;break;case "count":c=b.COUNT}return c};b.toDataFieldType=function(a){switch(a){case b.STRING:return d.DataFieldType.STRING;case b.BOOLEAN:return d.DataFieldType.BOOLEAN;
case b.DATE:return d.DataFieldType.DATE;case b.DATETIME:return d.DataFieldType.DATETIME;case b.TIME:return d.DataFieldType.TIME}return d.DataFieldType.NUMBER};b.NUMBER=1;b.STRING=2;b.BOOLEAN=3;b.DATE=4;b.TIME=5;b.DATETIME=6;b.COUNT=7;return b}();d.MeasureType=e})(d.types||(d.types={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.ALL=0;b.STRING=1;b.NUMBER=2;b.BOOLEAN=3;b.DATE=4;b.TIME=5;b.YEAR=6;b.HALFYEAR=7;b.QUARTER=8;b.MONTH=9;b.WEEK=10;b.WEEKDAY=11;b.DAY=12;b.HOUR=13;b.MINUTE=14;b.SECOND=15;b.MILLISECOND=16;b.TIME_DATE=17;return b}();d.LevelType=e})(d.types||(d.types={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.typeName=function(a){return b.allStrings[a]};b.typeNum=function(a){return b.allStrings.indexOf(a)};b.valid=function(a){return-1<b.allStrings.indexOf(a)};b.typeFromValue=function(a){return""===a?b.STRING:"number"!=typeof a&&isNaN(Number(a))?0<Date.parse(a)?utils.detectBrowser().isChrome&&!a.match(/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/i)?
b.STRING:b.DATE:b.STRING:b.NUMBER};b.STRING="string";b.NUMBER="number";b.BOOLEAN="boolean";b.LEVEL="level";b.MONTH="month";b.WEEKDAY="weekday";b.DATE="date";b.DATE_STRING="date string";b.HIERARCHICAL_DATE="year/month/day";b.HIERARCHICAL_DATE_WITH_QUARTERS="year/quarter/month/day";b.TIME="time";b.DATETIME="datetime";b.ID="id";b.DELETE="delete";b.HIDDEN="hidden";b.allStrings=[b.NUMBER,b.STRING,b.BOOLEAN,b.LEVEL,b.MONTH,b.WEEKDAY,b.DATE,b.DATE_STRING,b.HIERARCHICAL_DATE,b.HIERARCHICAL_DATE_WITH_QUARTERS,
b.TIME,b.DATETIME,b.ID,b.DELETE,b.HIDDEN];return b}();d.DataFieldType=e})(d.types||(d.types={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(){function b(){}b.aggregationCaption=function(a){return a==b.SUM?d.model._labels.Labels.SUM_CAPTION:a==b.COUNT?d.model._labels.Labels.COUNT_CAPTION:a==b.DISTINCT_COUNT||a==b.DISTINCT_COUNT_DEPRECATED?d.model._labels.Labels.DISTINCT_COUNT_CAPTION:a==b.AVERAGE?d.model._labels.Labels.AVERAGE_CAPTION:a==b.PRODUCT?d.model._labels.Labels.PRODUCT_CAPTION:a==b.MIN?d.model._labels.Labels.MIN_CAPTION:a==b.MAX?d.model._labels.Labels.MAX_CAPTION:a==b.PERCENT?
d.model._labels.Labels.PERCENT_CAPTION:a==b.PERCENT_COLUMN||a==b.PERCENT_COLUMN_DEPRECATED?d.model._labels.Labels.PERCENT_COLUMN_CAPTION:a==b.PERCENT_ROW?d.model._labels.Labels.PERCENT_ROW_CAPTION:a==b.INDEX?d.model._labels.Labels.INDEX_CAPTION:a==b.DIFFERENCE?d.model._labels.Labels.DIFFERENCE_CAPTION:a==b.PERCENT_DIFFERENCE?d.model._labels.Labels.PERCENT_DIFFERENCE_CAPTION:a==b.NONE?d.model._labels.Labels.NONE_CAPTION:a==b.MEDIAN?d.model._labels.Labels.MEDIAN_CAPTION:a==b.STDEVP?d.model._labels.Labels.STDEVP_CAPTION:
a==b.STDEVS?d.model._labels.Labels.STDEVS_CAPTION:a==b.RUNNING_TOTALS?d.model._labels.Labels.RUNNING_TOTALS_CAPTION:a};b.aggregationCaptions=function(a){void 0===a&&(a=null);var c=[];a=a?a:b.ALL_AGGREGATIONS;for(var g=0;g<a.length;g++)c.push(b.aggregationCaption(a[g]));return c};b.aggregationTotalCaptions=function(a){void 0===a&&(a=null);var c=[];a=a?a:b.ALL_AGGREGATIONS;for(var g=0;g<a.length;g++)a[g]==b.SUM&&c.push(d.model._labels.Labels.SUM_TOTAL_CAPTION),a[g]==b.COUNT&&c.push(d.model._labels.Labels.COUNT_TOTAL_CAPTION),
a[g]!=b.DISTINCT_COUNT&&a[g]!=b.DISTINCT_COUNT_DEPRECATED||c.push(d.model._labels.Labels.DISTINCT_COUNT_TOTAL_CAPTION),a[g]==b.AVERAGE&&c.push(d.model._labels.Labels.AVERAGE_TOTAL_CAPTION),a[g]==b.PRODUCT&&c.push(d.model._labels.Labels.PRODUCT_TOTAL_CAPTION),a[g]==b.MIN&&c.push(d.model._labels.Labels.MIN_TOTAL_CAPTION),a[g]==b.MAX&&c.push(d.model._labels.Labels.MAX_TOTAL_CAPTION),a[g]==b.PERCENT&&c.push(d.model._labels.Labels.PERCENT_TOTAL_CAPTION),a[g]!=b.PERCENT_COLUMN&&a[g]!=b.PERCENT_COLUMN_DEPRECATED||
c.push(d.model._labels.Labels.PERCENT_COLUMN_TOTAL_CAPTION),a[g]==b.PERCENT_ROW&&c.push(d.model._labels.Labels.PERCENT_ROW_TOTAL_CAPTION),a[g]==b.INDEX&&c.push(d.model._labels.Labels.INDEX_TOTAL_CAPTION),a[g]==b.DIFFERENCE&&c.push(d.model._labels.Labels.DIFFERENCE_TOTAL_CAPTION),a[g]==b.PERCENT_DIFFERENCE&&c.push(d.model._labels.Labels.PERCENT_DIFFERENCE_TOTAL_CAPTION),a[g]==b.NONE&&c.push("{0}"),a[g]==b.MEDIAN&&c.push(d.model._labels.Labels.MEDIAN_TOTAL_CAPTION),a[g]==b.STDEVP&&c.push(d.model._labels.Labels.STDEVP_TOTAL_CAPTION),
a[g]==b.STDEVS&&c.push(d.model._labels.Labels.STDEVS_TOTAL_CAPTION),a[g]==b.RUNNING_TOTALS&&c.push(d.model._labels.Labels.RUNNING_TOTALS_TOTAL_CAPTION);return c};b.validType=function(a){return-1!=b.ALL_AGGREGATIONS.indexOf(a)||a==b.NONE};b.validForDateTimeFormatting=function(a){return-1!=b.AGGREGATIONS_COMPATIBLE_WITH_DATETIME_FORMATTING.indexOf(a)||a==b.NONE};b.validForTimeFormatting=function(a){return-1!=b.AGGREGATIONS_COMPATIBLE_WITH_TIME_FORMATTING.indexOf(a)||a==b.NONE};b.isCount=function(a){return-1!=
b.AGGREGATIONS_WITH_COUNT_FORMATTING.indexOf(a)};b.isPercent=function(a){return-1!=b.AGGREGATIONS_WITH_PERCENT_FORMATTING.indexOf(a)};b.deprecatedType=function(a){return a==b.DISTINCT_COUNT_DEPRECATED||a==b.PERCENT_COLUMN_DEPRECATED};b.fromDeprecatedToValid=function(a){switch(a){case b.DISTINCT_COUNT_DEPRECATED:return b.DISTINCT_COUNT;case b.PERCENT_COLUMN_DEPRECATED:return b.PERCENT_COLUMN;default:return""}};b.SUM="sum";b.COUNT="count";b.DISTINCT_COUNT="distinctcount";b.DISTINCT_COUNT_DEPRECATED=
"distinct count";b.AVERAGE="average";b.PERCENT="percent";b.PERCENT_COLUMN="percentofcolumn";b.PERCENT_ROW="percentofrow";b.PERCENT_COLUMN_DEPRECATED="percent of column";b.PRODUCT="product";b.INDEX="index";b.MIN="min";b.MAX="max";b.NONE="none";b.DIFFERENCE="difference";b.PERCENT_DIFFERENCE="%difference";b.MEDIAN="median";b.STDEVP="stdevp";b.STDEVS="stdevs";b.RUNNING_TOTALS="runningtotals";b.ALL_AGGREGATIONS=[b.SUM,b.COUNT,b.DISTINCT_COUNT,b.AVERAGE,b.MEDIAN,b.PRODUCT,b.MIN,b.MAX,b.PERCENT,b.PERCENT_COLUMN,
b.PERCENT_ROW,b.INDEX,b.DIFFERENCE,b.PERCENT_DIFFERENCE,b.STDEVP,b.STDEVS,b.RUNNING_TOTALS];b.AGGREGATIONS_COMPATIBLE_WITH_DATETIME_FORMATTING=[b.SUM,b.AVERAGE,b.MEDIAN,b.PRODUCT,b.MIN,b.MAX];b.AGGREGATIONS_COMPATIBLE_WITH_TIME_FORMATTING=[b.SUM,b.AVERAGE,b.MEDIAN,b.PRODUCT,b.MIN,b.MAX,b.DIFFERENCE,b.STDEVP,b.STDEVS,b.RUNNING_TOTALS];b.AGGREGATIONS_WITH_COUNT_FORMATTING=[b.COUNT,b.DISTINCT_COUNT];b.AGGREGATIONS_WITH_PERCENT_FORMATTING=[b.PERCENT,b.PERCENT_COLUMN,b.PERCENT_ROW,b.PERCENT_DIFFERENCE];
return b}();e.AggregationName=f})(e.consts||(e.consts={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.ADD="+";b.SUBTRACT="-";b.MULTIPLY="*";b.DIVIDE="/";b.POWER="^";b.LESS="<";b.GREATER=">";b.EQUAL="=";b.EQUAL_2="==";b.NOT_EQUAL="!=";b.LESS_OR_EQUAL="<=";b.GREATER_OR_EQUAL=">=";b.OR="or";b.AND="and";b.IF="if";b.ABS="abs";b.MIN="min";b.MAX="max";b.BLANK="isnan";b.NOT_BLANK="!isnan";b.VALUE="value";b.UPDATE_DIFFERENCE="updatedifference";b.UPDATE_PERCENT="updatepercent";return b}();d.FunctionName=e})(d.consts||(d.consts={}))})(d.data_||
(d.data_={}))})(pivot||(pivot={}));(function(d){(function(d){(function(d){var e=function(){function b(){}b.SELECT="select";b.EXPAND="expand";b.COLLAPSE="collapse";b.DRILL_UP="drillUp";b.DRILL_DOWN="drillDown";b.DRILL_DOWN_TO="drillDownTo";b.DRILL_THROUGH="drillThrough";b.FILTER="filter";b.SEARCH="search";return b}();d.QueryType=e})(d.consts||(d.consts={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.DIVIDE_BY_ZERO=0.001122334400556678;return b}();d.DataConsts=e})(d.consts||(d.consts={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(){function b(){this._dataSourceType=d.consts.DataSourceType.EMPTY;this.isUpdateData=!1}Object.defineProperty(b.prototype,"dataSourceType",{get:function(){return this._dataSourceType},set:function(a){this._dataSourceType=a.toLowerCase()},enumerable:!0,configurable:!0});b.prototype.isEqual=function(a){return a&&this.dataSourceType==a.dataSourceType};Object.defineProperty(b.prototype,"isEmpty",{get:function(){return this._dataSourceType==d.consts.DataSourceType.EMPTY},
set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"isDemo",{get:function(){return this._dataSourceType==d.consts.DataSourceType.CSV&&"this"==this.filename},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"isInlineData",{get:function(){return!1},set:function(a){},enumerable:!0,configurable:!0});b.fromObject=function(a){if(void 0==a)return new b;utils.nullOrUndefined(a.connectionInfo)||(a=a.connectionInfo);a instanceof b||a instanceof h.CSVConnectionInfo||
a instanceof h.JSONConnectionInfo||(a=b.toPlainObject(a));utils.nullOrUndefined(a.dataSourceType)||(a.dataSourceType=a.dataSourceType.toLowerCase());if(!utils.nullOrUndefined(a.filename)&&utils.nullOrUndefined(a.dataSourceType)){var c=a.filename.split("?")[0].toLowerCase();".csv"==c.substr(-4)?a.dataSourceType=d.consts.DataSourceType.CSV:".json"==c.substr(-5)||".js"==c.substr(-3)?a.dataSourceType=d.consts.DataSourceType.JSON:a.dataSourceType=d.consts.DataSourceType.CSV}!utils.nullOrUndefined(a.data)&&
a.data instanceof Array&&(a.dataSourceType=d.consts.DataSourceType.JSON,a.data=a.data.slice());switch(a.dataSourceType){case d.consts.DataSourceType.CSV:return h.CSVConnectionInfo.fromObject(a);case d.consts.DataSourceType.JSON:return h.JSONConnectionInfo.fromObject(a);default:return new b}};b.toPlainObject=function(a){var c={};null!=a.dataSourceType&&(c.dataSourceType=a.dataSourceType);null!=a.filename&&(c.filename=a.filename);null!=a.requestHeader&&(c.requestHeader=a.requestHeader);null!=a.browseForFile&&
(c.browseForFile=a.browseForFile);null!=a.fieldSeparator&&(c.fieldSeparator=a.fieldSeparator);null!=a.recordsetDelimiter&&(c.recordsetDelimiter=a.recordsetDelimiter);null!=a.ignoreQuotedLineBreaks&&(c.ignoreQuotedLineBreaks=a.ignoreQuotedLineBreaks);null!=a.embedded&&(c.embedded=a.embedded);null!=a.embeddedDataOffset&&(c.embeddedDataOffset=a.embeddedDataOffset);null!=a.embeddedDataToLoad&&(c.embeddedDataToLoad=a.embeddedDataToLoad);null!=a.data&&(c.data=a.data);null!=a.checkUpdates&&(c.checkUpdates=
a.checkUpdates);null!=a.url&&(c.url=a.url);null!=a.hash&&(c.hash=a.hash);null!=a.username&&(c.username=a.username);null!=a.password&&(c.password=a.password);null!=a.dataSource&&(a=a.dataSource,null!=a.dataSourceType&&(c.dataSourceType=a.dataSourceType),null!=a.filename&&(c.filename=a.filename),null!=a.browseForFile&&(c.browseForFile=a.browseForFile),null!=a.fieldSeparator&&(c.fieldSeparator=a.fieldSeparator),null!=a.recordsetDelimiter&&(c.recordsetDelimiter=a.recordsetDelimiter),null!=a.ignoreQuotedLineBreaks&&
(c.ignoreQuotedLineBreaks=a.ignoreQuotedLineBreaks),null!=a.embedded&&(c.embedded=a.embedded),null!=a.embeddedDataOffset&&(c.embeddedDataOffset=a.embeddedDataOffset),null!=a.embeddedDataToLoad&&(c.embeddedDataToLoad=a.embeddedDataToLoad),null!=a.isOCSV2Data&&(c.isOCSV2Data=a.isOCSV2Data),null!=a.data&&(c.data=a.data),null!=a.url&&(c.url=a.url),a=a.credentials,null!=a&&(null!=a.hash&&(c.hash=a.hash),null!=a.username&&(c.username=a.username),null!=a.password&&(c.password=a.password)));return c};b.prototype.toObject=
function(a){a={};this.dataSourceType!=d.consts.DataSourceType.EMPTY&&(a.dataSourceType=this.dataSourceType);return a};return b}();h.ConnectionInfo=f})(d.vo||(d.vo={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(b){function a(){var c=null!==b&&b.apply(this,arguments)||this;c.browseForFile=!1;c.requestHeader=null;return c}__extends(a,b);a.prototype.isEqual=function(c){return b.prototype.isEqual.call(this,c)&&this.filename==c.filename&&!1==this.browseForFile&&!1==c.browseForFile};return a}(d.ConnectionInfo);d.FileConnectionInfo=e})(d.vo||(d.vo={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c.checkUpdates=!1;c.dataSourceType=d.consts.DataSourceType.JSON;return c}__extends(a,b);Object.defineProperty(a.prototype,"isEmpty",{get:function(){return utils.nullOrEmpty(this.filename)&&(null==this.browseForFile||!1==this.browseForFile)&&utils.nullOrUndefined(this.data)},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isInlineData",{get:function(){return!utils.nullOrUndefined(this.data)},
set:function(c){},enumerable:!0,configurable:!0});a.prototype.isEqual=function(c){return c==this?!0:b.prototype.isEqual.call(this,c)&&utils.nullOrUndefined(c.data)};a.fromObject=function(c){var b=new a;void 0!==c.browseForFile&&(b.browseForFile=c.browseForFile);void 0!==c.filename&&""!=c.filename&&(b.filename=c.filename);void 0!==c.data&&(b.data=c.data);void 0!==c.checkUpdates&&(b.checkUpdates=c.checkUpdates);void 0!==c.requestHeader&&(b.requestHeader=c.requestHeader);return b};a.prototype.toObject=
function(c){void 0===c&&(c=!1);var a={};a.dataSourceType=this.dataSourceType;if(c||this.browseForFile)a.browseForFile=this.browseForFile;this.filename&&(a.filename=this.filename);utils.nullOrUndefined(this.data)||(a.data=this.data);return a};return a}(h.FileConnectionInfo);h.JSONConnectionInfo=f})(d.vo||(d.vo={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c.recordsetDelimiter="\n";c.ignoreQuotedLineBreaks=!0;c.embedded=!1;c.embeddedDataOffset=0;c.dataSourceType=d.consts.DataSourceType.CSV;return c}__extends(a,b);Object.defineProperty(a.prototype,"isEmpty",{get:function(){return utils.nullOrEmpty(this.filename)&&(null==this.browseForFile||!1==this.browseForFile)&&(null==this.embedded||!1==this.embedded)},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"isInlineData",{get:function(){return!utils.nullOrUndefined(this.data)},set:function(c){},enumerable:!0,configurable:!0});a.prototype.isEqual=function(c){return b.prototype.isEqual.call(this,c)&&!1==this.embedded&&!1==c.embedded};a.fromObject=function(c){var b=new a;void 0!==c.browseForFile&&(b.browseForFile=c.browseForFile);void 0!==c.filename&&""!=c.filename&&(b.filename=c.filename);void 0!==c.fieldSeparator&&(b.fieldSeparator=c.fieldSeparator);void 0!==c.recordsetDelimiter&&(b.recordsetDelimiter=
c.recordsetDelimiter);void 0!==c.ignoreQuotedLineBreaks&&(b.ignoreQuotedLineBreaks=c.ignoreQuotedLineBreaks);void 0!==c.embedded&&(b.embedded=c.embedded);void 0!==c.embeddedDataOffset&&(b.embeddedDataOffset=c.embeddedDataOffset);void 0!==c.embeddedDataToLoad&&(b.embeddedDataToLoad=c.embeddedDataToLoad);void 0!==c.requestHeader&&(b.requestHeader=c.requestHeader);return b};a.prototype.toObject=function(c){void 0===c&&(c=!1);var a={};a.dataSourceType=this.dataSourceType;if(c||this.browseForFile&&!this.embedded)a.browseForFile=
this.browseForFile;this.filename&&(a.filename=this.filename);this.fieldSeparator&&(a.fieldSeparator=this.fieldSeparator);this.recordsetDelimiter&&"\n"!=this.recordsetDelimiter&&(a.recordsetDelimiter=this.recordsetDelimiter);if(c||!1==this.ignoreQuotedLineBreaks)a.ignoreQuotedLineBreaks=this.ignoreQuotedLineBreaks;this.embedded&&(a.embedded=this.embedded);return a};return a}(h.FileConnectionInfo);h.CSVConnectionInfo=f})(d.vo||(d.vo={}))})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(e){var h=function(f){function b(a,c){var g=f.call(this)||this;g.isUIReady=!1;g.model_=d.model.PivotModel.getInstance();g.width=0;g.height=0;g.lastWidth=0;g.lastHeight=0;g.delayedDraws=[];g.notReadyCount=0;g.drawn=!1;g.drillthroughClosedHandler=function(){return g.onDrillThroughClosed()};g.isFocused=!0;g.setId("wdr-pivot-view");null!=g.parentContainer&&g.parentContainer.dispose();a.empty();g.parentContainer=a;b.stage=g;var m=c.width?"number"===typeof c.width?c.width+"px":-1<
c.width.indexOf("px")||c.width.indexOf("%")==c.width.length-1?c.width:c.width+"px":"100%",k=c.height?"number"===typeof c.height?c.height+"px":-1<c.height.indexOf("px")||c.height.indexOf("%")==c.height.length-1?c.height:c.height+"px":"500px",l=/\d+(?=px|%)/,m=m.match(l)?m:"100%",k=k.match(l)?k:"500px";g.parentContainer.css("width",m);g.parentContainer.css("height",k);g.container.css("width",m);g.container.css("height",k);g.parentContainer.append(g.container);g.container.requestAnimationFrame(function(){g.toolbar=
c.toolbar?new WebDataRocksToolbar(g.parentContainer.element,d.Pivot.instance.api,"html5",m,d.model._labels.LabelsManager.getInstance().getCurrentLocalization().toolbar):null;d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.BEFORE_TOOLBAR_CREATED,g.toolbar));g.toolbar&&null!=g.toolbar.create&&g.toolbar.create();g.setControls();g.draw()});g.model_.state_.addEventListener(d.model._state.StateEvent.LOADING_REPORT_FILE,function(){return g.onLoadingReportFile()});
g.model_.state_.addEventListener(d.model._state.StateEvent.EMPTY_SLICE,function(){return g.onEmptySlice()});g.model_.state_.addEventListener(d.model._state.StateEvent.LOADING_DATA,function(){return g.onLoadingData()});g.model_.state_.addEventListener(d.model._state.StateEvent.RUNNING_QUERY,function(){return g.onBeforeDataQuery()});g.model_.state_.addEventListener(d.model._state.StateEvent.QUERY_COMPLETE,function(){return g.onDataQueryComplete()});g.model_.state_.addEventListener(d.model._state.StateEvent.REPORT_COMPLETE,
function(){return g.onReportComplete()});g.model_.state_.addEventListener(d.model._state.StateEvent.LOCALIZATION_LOADED,function(){return g.onLocalizationLoaded()});g.model_.addEventListener(d.PivotEvent.EXPORT,function(c){return g.onExport(c)});g.model_.addEventListener(d.PivotEvent.PRINT,function(){return g.onPrint()});g.model_.addEventListener(e.ViewEvent.CALCULATED_VIEW_OPEN,function(c){return g.onOpenCalculatedView(c)});g.model_.addEventListener(e.ViewEvent.CONTEXT_MENU_OPEN,function(c){return g.onOpenContextMenu(c)});
g.addEventListener(e.ViewEvent.AFTER_GRID_DRAW,function(){return g.onAfterGridDraw()});utils.fmdocument.addEventListener("fullscreenchange",function(c){return g.onDocumentFullScreen(c)},!1);utils.fmdocument.addEventListener("mozfullscreenchange",function(c){return g.onDocumentFullScreen(c)},!1);utils.fmdocument.addEventListener("webkitfullscreenchange",function(c){return g.onDocumentFullScreen(c)},!1);utils.fmdocument.addEventListener("MSFullscreenChange",function(c){return g.onDocumentFullScreen(c)},
!1);g.parentContainer.addEventListener("fullscreenchange",function(c){return g.onFullScreen(c)},!1);g.parentContainer.addEventListener("mozfullscreenchange",function(c){return g.onFullScreen(c)},!1);g.parentContainer.addEventListener("webkitfullscreenchange",function(c){return g.onFullScreen(c)},!1);g.parentContainer.addEventListener("MSFullscreenChange",function(c){return g.onFullScreen(c)},!1);return g}__extends(b,f);Object.defineProperty(b.prototype,"toolbarHeight",{get:function(){if(this.toolbar){var a=
uicontrols.UIElement.convert(document.getElementById("wdr-toolbar-wrapper"));return null==a?0:a.height}return 0},enumerable:!0,configurable:!0});Object.defineProperty(b,"stageWidth",{get:function(){var a=b.stage.container.borderWidth;return b.stage.parentContainer.getWidth(utils.isFullscreen())-a.left-a.right},enumerable:!0,configurable:!0});Object.defineProperty(b,"stageHeight",{get:function(){var a=b.stage.container.borderWidth;return b.stage.parentContainer.getHeight(utils.isFullscreen())-a.top-
a.bottom},enumerable:!0,configurable:!0});Object.defineProperty(b,"gridWidth",{get:function(){return b.stageWidth},enumerable:!0,configurable:!0});Object.defineProperty(b,"gridHeight",{get:function(){return b.stage.pivotHeight()},enumerable:!0,configurable:!0});b.prototype.pivotHeight=function(){return b.stageHeight-b.stage.toolbarHeight};b.prototype.draw=function(a){var c=this;void 0===a&&(a=!1);this.clearDelays();if(this.drawn||this.isUIReady){var b=this.container.requestAnimationFrame(function(b){c.clearDelays();
c._draw(a)});this.delayedDraws.push(b)}else 1E3>this.notReadyCount++?this.notReadyTimeout=utils.fmSetTimeout(function(){c.draw(a)},10):this.parentContainer.visible&&(console.error("WebDataRocks:\nPivot cannot be drawn."),console.error("document.visibilityState:",document.visibilityState),"hidden"!=document.visibilityState&&alert("WebDataRocks:\nPivot cannot be drawn."))};b.prototype.clearDelays=function(){for(;0<this.delayedDraws.length;)this.container.cancelAnimationFrame(this.delayedDraws.pop());
this.delayedDraws=[];utils.fmClearTimeout(this.notReadyTimeout);utils.fmClearTimeout(this.renderCompleteTimeout)};b.prototype.updateContainerSize=function(){if(!this.parentContainer)return!1;var a=utils.isFullscreen(),c=this.parentContainer.getWidth();a&&(c=window.screen.width);var b=this.parentContainer.getHeight();a&&(b=window.screen.height);b-=this.toolbarHeight;if(this.lastWidth!==c||this.lastHeight!==b)this.container.css("width",c+"px"),this.container.css("height",b+"px");return this.lastWidth!==
c||this.lastHeight!==b};b.prototype.onWindowResize=function(a){this.toolbar&&null!=this.toolbar.applyToolbarLayoutClasses&&this.toolbar.applyToolbarLayoutClasses();this.draw(!0)};b.prototype.onLoadingReportFile=function(){this.model_.state_.reportType==d.model._state.ReportType.INIT&&this.drawEmptyView()};b.prototype.onEmptySlice=function(){this.draw()};b.prototype.onLoadingData=function(){this.model_.state_.reportType!=d.model._state.ReportType.UPDATE_DATA&&this.model_.state_.reportType!=d.model._state.ReportType.CONNECT_TO&&
this.drawEmptyView()};b.prototype.onBeforeDataQuery=function(){};b.prototype.onDataQueryComplete=function(){this.model_.state_.reportType!=d.model._state.ReportType.INIT&&this.model_.state_.reportType!=d.model._state.ReportType.LOAD&&this.draw()};b.prototype.onLocalizationLoaded=function(){null!=this.toolbar&&this.toolbar.updateLabels(d.model._labels.LabelsManager.getInstance().getCurrentLocalization().toolbar)};b.prototype.onReportComplete=function(){this.model_.state_.reportType==d.model._state.ReportType.CLEAR?
this.drawEmptyView():this.parentContainer&&this.draw()};b.prototype.onDocumentFullScreen=function(a){this.handleFullScreen()};b.prototype.onFullScreen=function(a){a.stopPropagation();this.handleFullScreen()};b.prototype.handleFullScreen=function(){var a=this,c=utils.isFullscreen();null!=d.model.JavaScriptHandlers.jsFullScreenHandler&&d.model.JavaScriptHandlers.jsFullScreenHandler.call(null,c);c=this.container.requestAnimationFrame(function(){a.updateContainerSize()&&a.draw(!0)});this.delayedDraws.push(c)};
b.prototype.setControls=function(){var a=this;this.toolbar&&(this.container.height-=this.toolbarHeight);this.gridView=new e.grid.GridView;this.gridView.addEventListener(e.ViewEvent.FILTER_OPEN,function(c){return a.onFilterOpenGrid(c)});this.gridView.addEventListener(e.ViewEvent.DRILL_THROUGH_OPEN,function(c){return a.onDrillThroughOpen(c)});this.addChild(this.gridView);this.fieldsView=new e.config.FieldsView;this.fieldsView.addEventListener(events._Event.OPENED,function(c){return a.onWindowOpenClose(c)});
this.fieldsView.addEventListener(events._Event.CLOSED,function(c){return a.onWindowOpenClose(c)});this.fieldsView.addEventListener(e.config.FieldsView.EVENT_OPEN,function(c){return a.onFieldsViewOpen(c)});this.fieldsView.addEventListener(e.config.FieldsView.EVENT_APPLY_SLICE,function(c){return a.onFieldsViewApplySlice(c)});this.addChild(this.fieldsView);var c=new uicontrols.UILabel;c.html('<a href="https://webdatarocks.com/?r=wdr" target="_blank">WebDataRocks.com</a>');c.addClass("wdr-credits");this.addChild(c);
utils.fmdocument.addEventListener("keydown",function(c){return a.onKeyDown(c)});this.container.attr("tabindex",0);this.container.addEventListener("focusin",function(c){a.isFocused=!0});this.container.addEventListener("focusout",function(c){a.isFocused=!1});this._resizeListener=new utils.ResizeListener(this.parentContainer.parent);this._resizeListener.addEventListener(events._Event.RESIZE,function(c){return a.onWindowResize(c)});this.isUIReady=!0};b.prototype._draw=function(a){void 0===a&&(a=!1);null!=
this.model_&&(this.drawn=!0,this.updateContainerSize(),null!=this.filterView&&this.filterView.draw(),utils.nullOrUndefined(this.model_.state_.connectionInfo_)||this.model_.state_.connectionInfo_.isEmpty||!d.model._options.OptionsManager.configuratorButton?this.fieldsView.hide():this.fieldsView.show(),a||d.model._options.OptionsManager.configuratorActive||e.calculated.CalculatedView.addingMeasureFlag||(d.model._options.OptionsManager.configuratorOpened=!1),null!=this.model_.cube_.slice_&&this.model_.cube_.slice_.isEmpty&&
(d.model._options.OptionsManager.configuratorOpened=!0),d.model._options.OptionsManager.configuratorOpened&&null!=this.model_.state_.connectionInfo_&&!this.model_.state_.connectionInfo_.isEmpty?this.fieldsView.open(this.model_.cube_.structure_,this.model_.cube_.slice_,this.model_.state_.connectionInfo_.dataSourceType):this.fieldsView.close(),this.drawGrid(a),null!=this.drillThroughView&&this.drillThroughView.isVisible()&&(d.model._options.OptionsManager.flatView?this.drillThroughView.close():this.drillThroughView.redraw()),
this.lastWidth=this.getWidth(),this.lastHeight=this.getHeight())};b.prototype.drawEmptyView=function(){this.drawGrid(!1,!0);utils.nullOrUndefined(this.fieldsView)||this.fieldsView.close()};b.prototype.drawGrid=function(a,c){void 0===a&&(a=!1);void 0===c&&(c=!1);null!=this.gridView&&(a||null==this.filterView||this.filterView.close(),this.gridView.dataProvider=c?null:this.model_.dataProvider_=d.data_.dataprovider_.DataProviderFactory.getDataProvider(),this.gridView.container.css("top","").css("left",
"").css("right","").css("bottom",""),this.gridView.container.css("position","absolute"),this.gridView.show(),this.gridView.container.css("height",b.gridHeight+"px"),this.gridView.container.css("width",b.stageWidth+"px"),a||this.model_.cube_.connectionInfo_&&this.model_.cube_.connectionInfo_.isUpdateData||this.gridView.clearSizes(),this.gridView.draw(),d.model._options.OptionsManager.flatView&&this.fieldsView.isOpen&&this.fieldsView.open(this.model_.cube_.structure_,this.model_.cube_.slice_,this.model_.state_.connectionInfo_.dataSourceType))};
b.prototype.onDrillThroughOpen=function(a){null==this.drillThroughView&&this.addDrillThroughView();this.drillThroughView.addEventListener(e.grid.GridEvent.DRILLTHROUGH_CLOSED,this.drillthroughClosedHandler);var c=this.model_.cube_.structure_.findMeasure(a.data.measure);this.drillThroughView.openView(this.model_.dataProvider_,this.model_.cube_.slice_,a.data.columnTuple,a.data.rowTuple,c)};b.prototype.onDrillThroughClosed=function(){this.drillThroughView.removeEventListener(e.grid.GridEvent.DRILLTHROUGH_CLOSED,
this.drillthroughClosedHandler);this.model_.cube_.refresh()};b.prototype.openFieldsList=function(){null!=this.model_.state_.connectionInfo_&&this.fieldsView.open(this.model_.cube_.structure_,this.model_.cube_.slice_,this.model_.state_.connectionInfo_.dataSourceType)};b.prototype.onFieldsViewApplySlice=function(a){d.Pivot.instance.runQuery(a.data)};b.prototype.onFilterOpenGrid=function(a){null==this.filterView&&this.addFilterView();this.onFilterOpen(a)};b.prototype.onFilterOpen=function(a){var c={hierarchy:d.data_._structure.GenericHierarchy.toObject(a.hierarchy)};
d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.FILTER_OPEN,c));this.openFilter(a.hierarchy)};b.prototype.openFilter=function(a){null==this.filterView&&this.addFilterView();this.filterView.openView(a)};b.prototype.closeFieldsList=function(){this.fieldsView.close()};b.prototype.onFieldsViewOpen=function(a){this.openFieldsList()};b.prototype.onWindowOpenClose=function(a){};b.prototype.onKeyDown=function(a){this.isFocused&&(73===a.keyCode&&a.ctrlKey&&
a.altKey&&this.showLicenseInfo(),27===a.keyCode&&(null!=this.filterView&&this.filterView.close(),null!=this.drillThroughView&&this.drillThroughView.close(),null!=this.calculatedView&&this.calculatedView.isVisible()?this.calculatedView.close():this.fieldsView.close()))};b.prototype.onExport=function(a){this.drillThroughView&&this.drillThroughView.isVisible()?this.drillThroughView.exportTo(a.exportType,a.exportOptions,a.callbackHandler):this.gridView.exportTo(a.exportType,a.exportOptions,a.callbackHandler)};
b.prototype.onPrint=function(){this.gridView.print()};b.prototype.showLicenseInfo=function(){var a=new Date(parseFloat(d.Pivot.BUILD_DATE)/61),a=d.Pivot.BUILD_VERSION+" (build "+utils.StringUtils.toDateTime(a.getTime())+") <br/><br/>",a=a+d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.info);d.uialert(a,d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.componentInfo),d.AlertType.INFO)};b.prototype.getCell=function(a,c){return this.gridView.getCell(a,c)};b.prototype.getSelectedCell=
function(){return this.gridView.getSelectedCell()};b.prototype.setSelectedCell=function(a,c){this.gridView.setSelectedCell(a,c)};b.prototype.removeSelection=function(){this.gridView.removeSelection()};b.prototype.onOpenCalculatedView=function(a){null==this.calculatedView&&this.addCalculatedView();this.calculatedView.openView(a.data?a.data.measureName:"")};b.prototype.onOpenContextMenu=function(a){null==this.contextMenu&&this.addContextMenu();this.contextMenu.showWith(this.container,a.data.menuItems,
a.data.coords)};b.prototype.onAfterGridDraw=function(){var a=this;0==this.delayedDraws.length&&(this.renderCompleteTimeout=utils.fmSetTimeout(function(){a.dispatchWith(e.ViewEvent.RENDER_COMPLETE)},1))};b.prototype.addCalculatedView=function(){this.calculatedView=new e.calculated.CalculatedView;this.addChild(this.calculatedView)};b.prototype.addDrillThroughView=function(){this.drillThroughView=new e.grid.DrillThroughView;this.addChild(this.drillThroughView)};b.prototype.addFilterView=function(){var a=
this;this.filterView=new e.filter.FilterView;this.filterView.addEventListener(events._Event.OPENED,function(c){return a.onWindowOpenClose(c)});this.filterView.addEventListener(events._Event.CLOSED,function(c){return a.onWindowOpenClose(c)});this.addChild(this.filterView)};b.prototype.getToolbar=function(){return this.toolbar};b.prototype.addContextMenu=function(){this.contextMenu=new e.ContextMenuView;this.contextMenu.hide();this.addChild(this.contextMenu)};b.prototype.dispose=function(){this.model_=
null;this.gridView.dispose();this.container.dispose();this.parentContainer.dispose();e.AlertView.dispose();e.filter.FilterModel.dispose();e.PreloaderView.dispose();uicontrols.dragndrop.DragManager.dispose();b.stage=null;this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=null)};return b}(uicontrols.containers.UIContainer);e.PivotView=h})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){var h=function(){function f(){this._timer=0;this._show=!1;this._details=this._message="";this._transparent=!1}f.prototype.show=function(b,a,c,g,d){var k=this;void 0===g&&(g=!0);void 0===d&&(d=!1);b?(d&&this.showImmediately(b,a,c,g),!1==this._show?(this._show=b,this._message=a,this._details=c,this._transparent=g,this._timer=utils.fmSetTimeout(function(){return k.timerHandler()},f.DELAY)):0==this._timer?this.showImmediately(b,a,c,g):(this._show=b,this._message=a,this._details=
c,this._transparent=g)):(d&&this.showImmediately(b,a,c,g),!0==this._show&&(this._show=b,this._timer=utils.fmSetTimeout(function(){return k.timerHandler()},f.DELAY)))};f.prototype.showImmediately=function(b,a,c,g){this.resetTimer();this.preloaderFunction(b,a,c,g)};f.prototype.timerHandler=function(){this.resetTimer();this.preloaderFunction(this._show,this._message,this._details,this._transparent)};f.prototype.resetTimer=function(){utils.fmClearTimeout(this._timer);this._timer=0};f.prototype.preloaderFunction=
function(b,a,c,g){d.PreloaderView.getInstance()&&d.PreloaderView.getInstance().openView(b,a,c,g)};f.getInstance=function(){null==f._instance&&(f._instance=new f);return f._instance};f.dispose=function(){f._instance=null};f.DELAY=250;return f}();d.Preloader=h})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){var h=function(f){function b(){var a=this;if(null!=b._instance)throw Error("Singleton");a=f.call(this,d.PivotView.stage.container)||this;a.setId("wdr-preloader-view");a.setControls();return a}__extends(b,f);b.prototype.openView=function(a,c,b,d){void 0===a&&(a=!0);void 0===c&&(c="");void 0===b&&(b="");void 0===d&&(d=!0);this._message=c;this._details=b;this._transparent=d;a?this.open():this.close()};b.prototype.open=function(){f.prototype.open.call(this);this.draw()};b.prototype.setControls=
function(){this.overlay.addClass("wdr-overlay-preloader");this.overlay.removeEventListener("click",this._overlayClickHandler);this._imgSpinner=new uicontrols.UIComponentBase("div");this._imgSpinner.setId("wdr-spinner");this.addChild(this._imgSpinner);this._txtMessage=new uicontrols.UILabel;this._txtMessage.setId("wdr-message-label");this.addChild(this._txtMessage);this._txtDetails=new uicontrols.UILabel;this._txtDetails.setId("wdr-details-label");this.addChild(this._txtDetails);this.hide();d.PivotView.stage.addChild(this)};
b.prototype.draw=function(){this.overlay.setOpaque(!this._transparent);this.setMessage(this._message);this.setDetails(this._details);this.validate()};b.prototype.setMessage=function(a){this._txtMessage.setLabel(a)};b.prototype.setDetails=function(a){this._txtDetails.setLabel(a)};b.prototype.close=function(){f.prototype.close.call(this);this.clear()};b.prototype.clear=function(){this.setMessage("");this.setMessage("")};b.getInstance=function(){if(null==d.PivotView.stage)return null;null==b._instance&&
(b._instance=new b);return b._instance};b.dispose=function(){b._instance=null};return b}(uicontrols.containers.UIPopup);d.PreloaderView=h})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){var h=function(f){function b(){var a=f.call(this)||this;a.setId("wdr-context-menu");a.list=new uicontrols.lists.UIList;a.list.setItemRendererFactory(a.itemRendererFactory);a.list.setLabelField("caption");a.list.addEventListener(events._Event.CHANGE,function(c){return a.onListChange(c)});a.addChild(a.list);a.container.disableSelection();return a}__extends(b,f);b.prototype.showWith=function(a,c,b){var m=this;0!=c.length&&(this.setData(c),this.show(),a=a.getOffset(),b.top-=
a.top+5,b.left-=a.left+5,this.container.offset(b),this.container.addEventListener("mouseleave",function(){return m.hide()}),utils.browserVersion().isMobile?d.PivotView.stage.container.addEventListener("touchstart",function(c){return m.onStageMouseDown(c)}):d.PivotView.stage.container.addEventListener("mousedown",function(c){return m.onStageMouseDown(c)}))};b.prototype.onStageMouseDown=function(a){null==uicontrols.UIElement.convert(a.target).closest("#wdr-context-menu")&&this.hide()};b.prototype.setData=
function(a){for(var c=[],b=0;b<a.length;b++)c.push(a[b]);this.list.setDataProvider(c)};b.prototype.onListChange=function(a){null!=a.data.selectedItem.handler&&a.data.selectedItem.handler(a.data.selectedItem.data);this.hide()};b.prototype.itemRendererFactory=function(a,c){var b=new uicontrols.renderers.SelectItemRenderer;b.setData(a);b.setIndex(c);return b};return b}(uicontrols.containers.UIBorderContainer);d.ContextMenuView=h})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;c.START_TABLE_ROW=0;c.START_HEADERS_ROW=0;c.START_HEADERS_COLUMN=0;c.FIRST_DATA_ROW=0;c.FIRST_DATA_COLUMN=0;c._model=d.model.PivotModel.getInstance();c.conditions=[];c.setId("wdr-grid-view");utils.browserVersion().isMobile?(new uicontrols._utils.LongPressListener(c.container)).listen(function(a,b){return c.onLongPress(a,b)}):utils.fmdocument.addEventListener("contextmenu",function(a){return c.onContextMenu(a)});
return c}__extends(a,b);a.prototype.dispose=function(){this._model=this.dataProvider=null;this.gridLayout&&this.gridLayout.dispose();this._gridLayout=null};a.prototype.createCompactLayout=function(){var c=this,a=new h.sheet.CompactGridLayout;a.id="wdr-grid-layout";a.getDataFunction=function(a,b){return c.getData(a,b)};a.addEventListener(h.GridEvent.MOUSE_CLICK,function(a){return c.onGridClick(a)});a.addEventListener(h.GridEvent.MOUSE_SINGLE_DOUBLE_CLICK,function(a){return c.onGridSingleDoubleClick(a)});
a.addEventListener(h.GridEvent.FILTER_CLICK,function(a){return c.onFilterClick(a)});a.addEventListener(h.GridEvent.RESIZE_COLUMN,function(a){return c.onResizeColumn(a)});a.addEventListener(h.GridEvent.RESIZE_ROW,function(a){return c.onResizeRow(a)});this.container.append(a);return a};a.prototype.createClassicLayout=function(){var c=this,a=new h.sheet.classic.ClassicGridLayout;a.id="wdr-grid-layout";a.getDataFunction=function(a,b){return c.getData(a,b)};a.addEventListener(h.GridEvent.MOUSE_CLICK,function(a){return c.onGridClick(a)});
a.addEventListener(h.GridEvent.MOUSE_SINGLE_DOUBLE_CLICK,function(a){return c.onGridSingleDoubleClick(a)});a.addEventListener(h.GridEvent.FILTER_CLICK,function(a){return c.onFilterClick(a)});a.addEventListener(h.GridEvent.RESIZE_COLUMN,function(a){return c.onResizeColumn(a)});a.addEventListener(h.GridEvent.RESIZE_ROW,function(a){return c.onResizeRow(a)});this.container.append(a);return a};a.prototype.createFlatLayout=function(){var c=this,a=new h.sheet.flat.FlatGridLayout;a.id="wdr-grid-layout";a.getDataFunction=
function(a,b){return c.getData(a,b)};a.addEventListener(h.GridEvent.MOUSE_CLICK,function(a){return c.onGridClick(a)});a.addEventListener(h.GridEvent.MOUSE_SINGLE_DOUBLE_CLICK,function(a){return c.onGridSingleDoubleClick(a)});a.addEventListener(h.GridEvent.FILTER_CLICK,function(a){return c.onFilterClick(a)});a.addEventListener(h.GridEvent.RESIZE_COLUMN,function(a){return c.onResizeColumn(a)});a.addEventListener(h.GridEvent.RESIZE_ROW,function(a){return c.onResizeRow(a)});this.container.append(a);return a};
a.prototype.getCurrentLayout=function(){if(d.model._options.OptionsManager.classicView){if(this.gridLayout&&this.gridLayout.type==h.sheet.classic.ClassicGridLayout.TYPE)return this.gridLayout;null!=this.gridLayout&&this.gridLayout.removeFromParent(!0);return this.createClassicLayout()}if(d.model._options.OptionsManager.flatView){if(this.gridLayout&&this.gridLayout.type==h.sheet.flat.FlatGridLayout.TYPE)return this.gridLayout;null!=this.gridLayout&&this.gridLayout.removeFromParent(!0);return this.createFlatLayout()}if(this.gridLayout&&
this.gridLayout.type==h.sheet.CompactGridLayout.TYPE)return this.gridLayout;null!=this.gridLayout&&this.gridLayout.removeFromParent(!0);return this.createCompactLayout()};a.prototype.draw=function(){this._gridLayout=this.getCurrentLayout();if(null!=this.gridLayout){this.gridLayout.smoothTimeout=this._model.state_.updateActive?100:1E3;if(this.dataProvider&&this.dataProvider.dataLoaded&&!this.dataProvider.isEmpty){this.gridLayout.clearData();this.START_HEADERS_ROW=this.START_HEADERS_COLUMN=this.START_TABLE_ROW=
0;var c,a,b,k,l=this.dataProvider.columnMaxDepth,f=d.model._options.OptionsManager.classicView?0<this.dataProvider.rowsOnly.length?1:0:this.dataProvider.rowCount;f>=l+1?(c=0,a=c+f,b=c+(f-l)-1):(b=0,c=0<this.dataProvider.columnCount?b+(l-f)+1:b,0==this.dataProvider.columnsOnly.length&&0==this.dataProvider.rowsOnly.length&&(c+=1),a=c+f);k=b;this.START_TABLE_ROW=Math.min(c,k);this.START_HEADERS_ROW=k;this.START_HEADERS_COLUMN=0;this.FIRST_DATA_ROW=a;this.FIRST_DATA_COLUMN=this.isFlatTable?0:d.model._options.OptionsManager.classicView?
this.dataProvider.rowAxis.hasMeasures&&this.dataProvider.multiMeasures?this.dataProvider.rowLevels.length+1:this.dataProvider.rowLevels.length:0==this.dataProvider.rows.length?0:1;d.model._options.OptionsManager.showHierarchyCaptions||(this.START_HEADERS_ROW=1==f&&0==this.dataProvider.columnCount?0:-1,this.FIRST_DATA_ROW=l);this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"top"==d.model._options.OptionsManager.grandTotalsPosition&&this.FIRST_DATA_ROW++;this.gridLayout.setDataSize(this.dataProvider.extendedDataHeight+
(this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"bottom"==d.model._options.OptionsManager.grandTotalsPosition?1:0),this.dataProvider.extendedDataWidth);this.gridLayout.freezeColumns(this.FIRST_DATA_COLUMN);this.gridLayout.freezeRows(this.FIRST_DATA_ROW);this.gridLayout instanceof h.sheet.CompactGridLayout&&(this.gridLayout.colsFilter.rowIndex=this.FIRST_DATA_ROW-this.dataProvider.columnMaxDepth-1,this.gridLayout.colsFilter.setHierarchies(this.dataProvider.columnsOnly),this.gridLayout.rowsFilter.setHierarchies(this.dataProvider.rowsOnly),
this.gridLayout.pageFilter.setHierarchies(this.dataProvider.pages));this.gridLayout instanceof h.sheet.classic.ClassicGridLayout&&(this.gridLayout.colsFilter.rowIndex=this.FIRST_DATA_ROW-this.dataProvider.columnMaxDepth-1,this.gridLayout.colsFilter.setHierarchies(this.dataProvider.columnsOnly),this.gridLayout.rowsFilter.setHierarchies(this.dataProvider.rowsOnly),this.gridLayout.pageFilter.setHierarchies(this.dataProvider.pages));(1<this.dataProvider.columns.length||!this.dataProvider.columnAxis.hasMeasures)&&
d.model._options.OptionsManager.showHierarchyCaptions&&this.addFilterCell(b,this.FIRST_DATA_COLUMN,d.data_.consts.AxisName.COLUMNS_AXIS);(1<this.dataProvider.rows.length||!this.dataProvider.rowAxis.hasMeasures)&&d.model._options.OptionsManager.showHierarchyCaptions&&(d.model._options.OptionsManager.classicView?this._addFilterCell(c,0):this.addFilterCell(c,0,d.data_.consts.AxisName.ROWS_AXIS));this.resizeColumnsByIdx();this.resizeHeaderColumns();this.resizeColumns();this.resizeRowsByIdx();this.resizeHeaderRows();
this.resizeRows()}else this.gridLayout.clearAll();this.conditions=d.model.condition.ConditionManager.conditions.toArray();this.gridLayout.resize(e.PivotView.gridWidth,e.PivotView.gridHeight);this.gridLayout.draw()}};a.prototype.clearSizes=function(){null!=this.gridLayout&&(this.gridLayout.clearColSizes(0),this.gridLayout.clearRowSizes(0))};a.prototype.getData=function(c,a,b){void 0===b&&(b=!1);if(null==this.dataProvider||!this.dataProvider.dataLoaded||c<this.START_HEADERS_ROW||a<this.START_HEADERS_COLUMN)return null;
var k=c-this.FIRST_DATA_ROW,e=a-this.FIRST_DATA_COLUMN;if((k>this.dataProvider.extendedDataHeight-1||e>this.dataProvider.extendedDataWidth-1)&&!(this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"bottom"==d.model._options.OptionsManager.grandTotalsPosition&&k==this.dataProvider.extendedDataHeight&&e<=this.dataProvider.extendedDataWidth-1))return null;var f=this.dataProvider.getRowTuple(k,!0),h=this.dataProvider.getColumnTuple(e,!0);if(null==f&&null==h)return null;var n=this.dataProvider.getMeasure(k,
e);if(this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"top"==d.model._options.OptionsManager.grandTotalsPosition&&(d.model._options.OptionsManager.showHierarchyCaptions&&1==c||!d.model._options.OptionsManager.showHierarchyCaptions&&0==c)||this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"bottom"==d.model._options.OptionsManager.grandTotalsPosition&&(d.model._options.OptionsManager.showHierarchyCaptions&&c==this.dataProvider.extendedDataHeight+1||!d.model._options.OptionsManager.showHierarchyCaptions&&
c==this.dataProvider.extendedDataHeight))return this.getFlatGrandTotal(f,h,n);if(null==f)return b=1==(d.model._options.OptionsManager.classicView?1:this.dataProvider.rowsOnly.length)&&0==this.dataProvider.columnCount?c-this.START_HEADERS_ROW:c-this.START_HEADERS_ROW-1,0==this.dataProvider.rowsOnly.length&&0==this.dataProvider.columnsOnly.length&&(b=c-this.START_HEADERS_ROW),c=this.dataProvider.getColumnDepth(e),this.getColumnCell(h,n,c,b,a);e=this.dataProvider.getRowDepth(k);k=this.dataProvider.getRowType(k);
return null==h?d.model._options.OptionsManager.classicView?this._getRowCell(f,n,e,a,k):this.getRowCell(f,n,e):this.getDataCell(f,h,n,c,a,b,e,k)};a.prototype.getDataCell=function(c,a,b,k,e,f,r,n){void 0===f&&(f=!1);void 0===r&&(r=NaN);void 0===n&&(n=-1);if(null==b)return null;var p=b.getFormat().clone();if(b.aggregation==d.data_.consts.AggregationName.PERCENT||b.aggregation==d.data_.consts.AggregationName.PERCENT_COLUMN||b.aggregation==d.data_.consts.AggregationName.PERCENT_ROW||b.aggregation==d.data_.consts.AggregationName.PERCENT_DIFFERENCE)p.currencySymbol=
"%",p.currencySymbolAlign="right";var q=new h.vo.GridCell;q.isValue=!0;q.columnTuple=a;q.measure=b;q.hierarchy=this._model.cube_.structure_.measureToHierarchy(b.uniqueName);q.rowTuple=c;d.model._options.OptionsManager.classicView?0==c.length?q.level=0:(r=this.getLevelIdxByTuple(c),-1<r&&(q.level=r)):d.model._options.OptionsManager.flatView||(q.level=r);r=this.dataProvider.getValue(c,a,b);q.value=r;if(this.isFlatTable){p=b.getFormat(!0).clone();if(b.type==d.data_.types.MeasureType.COUNT){var t=this.dataProvider.getColumnHierarchy(a).members.getItemAt(r);
null!=t&&(q.member=t,q.label=t.caption)}else b.type==d.data_.types.MeasureType.NUMBER?"string"===typeof r?q.label=r:(q.label=utils.NumberFormatter.format(r,p),q.numeric=!0):b.type==d.data_.types.MeasureType.DATE?q.label=utils.StringUtils.toDate(r,d.model._options.OptionsManager.datePattern):b.type==d.data_.types.MeasureType.TIME?isNaN(r)||(q.label=utils.StringUtils.toTime(r)):b.type!=d.data_.types.MeasureType.DATETIME||isNaN(r)||(q.label=utils.StringUtils.toDateTime(r,d.model._options.OptionsManager.dateTimePattern));
q.recordId=this.dataProvider.getRecordId(c,a,b)}else b.type==d.data_.types.MeasureType.NUMBER||b.type==d.data_.types.MeasureType.COUNT?"string"===typeof r?q.label=r:(q.label=utils.NumberFormatter.format(r,p),q.numeric=!0):b.type==d.data_.types.MeasureType.DATE?q.label=d.data_.consts.AggregationName.validForDateTimeFormatting(b.aggregation)?utils.StringUtils.toDate(q.value,d.model._options.OptionsManager.datePattern):utils.NumberFormatter.format(r,p):b.type==d.data_.types.MeasureType.TIME?isNaN(r)||
(q.label=d.data_.consts.AggregationName.validForDateTimeFormatting(b.aggregation)?utils.StringUtils.toTime(r):utils.NumberFormatter.format(r,p)):b.type==d.data_.types.MeasureType.DATETIME?isNaN(q.value)||(q.label=d.data_.consts.AggregationName.validForDateTimeFormatting(b.aggregation)?utils.StringUtils.toDateTime(r,d.model._options.OptionsManager.dateTimePattern):utils.NumberFormatter.format(r,p)):q.label=r;if(f)return q;f=!1;if(this.dataProvider.rowCount>c.length||this.dataProvider.columnCount>a.length){f=
!0;q.isTotalRow=this.dataProvider.rowCount>c.length;q.isTotalColumn=this.dataProvider.columnCount>a.length;if("on"!=d.model._options.OptionsManager.showTotals){t=this.dataProvider.measureDepth;if(0!=c.length&&(this.dataProvider.isRowExpanded(c)||this.dataProvider.isRowExpanded(c,b))&&("off"==d.model._options.OptionsManager.showTotals||"columns"==d.model._options.OptionsManager.showTotals)||0!=a.length&&(this.dataProvider.isColumnExpanded(a)||this.dataProvider.isColumnExpanded(a,b))&&("off"==d.model._options.OptionsManager.showTotals||
"rows"==d.model._options.OptionsManager.showTotals))return null;if(0==t&&1<this.dataProvider.measures.length)if(this.dataProvider.rowAxis.hasMeasures&&("off"==d.model._options.OptionsManager.showTotals||"columns"==d.model._options.OptionsManager.showTotals)){if(k<("on"==d.model._options.OptionsManager.showGrandTotals||"columns"==d.model._options.OptionsManager.showGrandTotals?this.FIRST_DATA_ROW+this.dataProvider.extendedDataHeight-this.dataProvider.measures.length:this.FIRST_DATA_ROW+this.dataProvider.extendedDataHeight)&&
this.dataProvider.isRowExpanded(c,b))return null}else if(this.dataProvider.columnAxis.hasMeasures&&("off"==d.model._options.OptionsManager.showTotals||"rows"==d.model._options.OptionsManager.showTotals)&&e<("on"==d.model._options.OptionsManager.showGrandTotals||"rows"==d.model._options.OptionsManager.showGrandTotals?this.FIRST_DATA_COLUMN+this.dataProvider.extendedDataWidth-this.dataProvider.measures.length:this.FIRST_DATA_COLUMN+this.dataProvider.extendedDataWidth)&&this.dataProvider.isColumnExpanded(a,
b))return null}q.isGrandTotalRow=0==c.length;q.isGrandTotalColumn=0==a.length;q.isClassicTotalRow=q.isTotalRow&&2==n&&!q.isGrandTotalRow}""!=p.textAlign&&q.customize({"text-align":p.textAlign});if(0<this.conditions.length&&q.measure)for(n=0;n<this.conditions.length;n++)if(p=this.conditions[n],!(p.row!=k&&-1!=p.row||p.column!=e&&-1!=p.column||p.measure!=b.uniqueName&&""!=p.measure&&p.measure!=b.uniqueName||p.isTotal!==f&&void 0!==p.isTotal||""!=p.hierarchy&&!this.checkHierarchyCondition(c,a,p.hierarchy,
p.member)))if(t=p.params.slice(0),p.isUpdate){if(this._model.state_.updateActive){var u=this.dataProvider.getUpdatedValue(c,a,b);u&&(-1<p.formula.toLowerCase().indexOf(d.data_.consts.FunctionName.UPDATE_DIFFERENCE)?r=u.difference:-1<p.formula.toLowerCase().indexOf(d.data_.consts.FunctionName.UPDATE_PERCENT)&&(r=100*u.percent),t=this.dataProvider.calculate(c,a,t,r),null!=t&&q.customizeWithClass(t))}}else t=this.dataProvider.calculate(c,a,t,r),!0!=t&&"truestyle"!=t||null==p.format?null!=t&&!1!=t&&q.customizeWithClass(t):
(q.customize(p.format.toCSSObject()),q.conditions.push(p.id)),q.showTooltip=!0;return q};a.prototype.getFlatGrandTotal=function(c,a,b){if(null==b)return null;var k=new h.vo.GridCell;k.isValue=!0;k.columnTuple=a;k.measure=b;k.hierarchy=this._model.cube_.structure_.measureToHierarchy(b.uniqueName);k.rowTuple=c;if(b.type==d.data_.types.MeasureType.NUMBER||b.type==d.data_.types.MeasureType.TIME||b.type==d.data_.types.MeasureType.DATETIME){var e=b.getFormat().clone();if(b.aggregation==d.data_.consts.AggregationName.PERCENT||
b.aggregation==d.data_.consts.AggregationName.PERCENT_COLUMN||b.aggregation==d.data_.consts.AggregationName.PERCENT_ROW||b.aggregation==d.data_.consts.AggregationName.PERCENT_DIFFERENCE||b.calculated&&-1<b.formula.indexOf("percent"))e.currencySymbol="%",e.currencySymbolAlign="right";k.value=this.dataProvider.getValue(null,null,b);b.type==d.data_.types.MeasureType.NUMBER?(k.label=utils.NumberFormatter.format(k.value,e),k.numeric=!0):b.type==d.data_.types.MeasureType.TIME?isNaN(k.value)||(k.label=d.data_.consts.AggregationName.validForDateTimeFormatting(b.aggregation)?
utils.StringUtils.toTime(k.value):utils.NumberFormatter.format(k.value,e)):b.type!=d.data_.types.MeasureType.DATETIME||isNaN(k.value)||(k.label=d.data_.consts.AggregationName.validForDateTimeFormatting(b.aggregation)?utils.StringUtils.toDateTime(k.value,d.model._options.OptionsManager.dateTimePattern):utils.NumberFormatter.format(k.value,e));k.isGrandTotalRow=!0;""!=e.textAlign&&k.customize({"text-align":e.textAlign});if(0<this.conditions.length)for(e=0;e<this.conditions.length;e++){var f=this.conditions[e],
r=f.params.slice(0);if(f.measure==b.uniqueName&&f.isUpdate&&this._model.state_.updateActive){var n=this.dataProvider.getUpdatedValue(c,a,b);if(n){var p;-1<f.formula.toLowerCase().indexOf(d.data_.consts.FunctionName.UPDATE_DIFFERENCE)?p=n.difference:-1<f.formula.toLowerCase().indexOf(d.data_.consts.FunctionName.UPDATE_PERCENT)&&(p=100*n.percent);f=this.dataProvider.calculate(c,a,r,p);null!=f&&k.customizeWithClass(f)}}}}return k};a.prototype.checkHierarchyCondition=function(c,a,b,d){var e=this.dataProvider.columns.indexOf(b);
if(-1<e){if(e<a.length)return c=this.dataProvider.columns.getItem(b),a[e]&&c.members.getItemAt(a[e]).uniqueName==d}else if(a=this.dataProvider.rows.indexOf(b),-1<a&&a<c.length)return b=this.dataProvider.rows.getItem(b),c[a]&&b.members.getItemAt(c[a]).uniqueName==d;return!1};a.prototype.getColumnCell=function(c,a,b,d,e){return this.isFlatTable?this._getFlatTableColumnCell(c,a,b,d):this._getColumnCell(c,a,b,d,e)};a.prototype._getColumnCell=function(c,a,b,k,e){if(0==c.length){if(this.dataProvider.rowAxis.hasMeasures&&
k==this.dataProvider.columnMaxDepth-1)return this.getGrandTotalCell(a,d.data_.consts.AxisName.COLUMNS_AXIS);c=this.dataProvider.extendedDataWidth-this.dataProvider.measures.length+1;if(this.dataProvider.columnAxis.hasMeasures&&k==this.dataProvider.columnMaxDepth-1&&e>=c&&1==this.dataProvider.measures.length)return this.getGrandTotalCell(a,d.data_.consts.AxisName.COLUMNS_AXIS);c="on"==d.model._options.OptionsManager.showGrandTotals||"rows"==d.model._options.OptionsManager.showGrandTotals?this.FIRST_DATA_COLUMN+
this.dataProvider.extendedDataWidth-this.dataProvider.measures.length:this.FIRST_DATA_COLUMN+this.dataProvider.extendedDataWidth;return this.dataProvider.columnAxis.hasMeasures&&0==k&&e>=c&&1<this.dataProvider.columnMaxDepth?e==c?(e=this.getHeaderCell(),e.label=d.model._labels.Labels.GRID_TOTALS,e):this.getEmptyHeaderCell():this.dataProvider.columnAxis.hasMeasures&&0==k&&1<this.dataProvider.columnMaxDepth?this.getGrandTotalCell(a,d.data_.consts.AxisName.COLUMNS_AXIS):this.dataProvider.columnAxis.hasMeasures&&
k==this.dataProvider.columnMaxDepth-1?e>=c||1==this.dataProvider.columnAxis.hierarchies.length?this.getGrandTotalCell(a,d.data_.consts.AxisName.COLUMNS_AXIS):this.getHeaderCell():this.dataProvider.columnAxis.hasMeasures&&0<k&&e<=c?this.getHeaderCell():0<=k?this.getEmptyHeaderCell():null}var f=this.dataProvider.columnAxis.hasMeasures&&(c.length>this.dataProvider.measuresPosition||0==this.dataProvider.measuresPosition)?c.length:c.length-1,r=this.dataProvider.columns.getItemAt(f);this.dataProvider.columnAxis.hasMeasures&&
f>this.dataProvider.measuresPosition&&(1==this.dataProvider.measures.length?f--:b++);if(b>k)return 0<=k?this.getEmptyHeaderCell():null;e=new h.vo.GridCell;e.isColumnHeader=!0;e.measure=this.dataProvider.columnAxis.hasMeasures&&(1<this.dataProvider.measures.length||d.model._options.OptionsManager.showExtraTotalLabels)?a:null;var n=!1,p=r.members.getItemAt(c[c.length-1]),q=this.dataProvider.measureDepth;if(this.dataProvider.columnAxis.hasMeasures&&1<this.dataProvider.measures.length&&k==q-1||this.dataProvider.columnAxis.hasMeasures&&
d.model._options.OptionsManager.showExtraTotalLabels&&k==q-1&&1!=q||this.dataProvider.columnAxis.hasMeasures&&d.model._options.OptionsManager.showExtraTotalLabels&&k==q&&1==q&&2>this.dataProvider.measures.length)e.label=a.caption,e.isMeasureHeader=!0,p=null;else{if(this.dataProvider.columnAxis.hasMeasures&&0<this.dataProvider.measures.indexOf(a.uniqueName)&&k<q)return this.getEmptyHeaderCell();b<k?f==k?(n=c.length-1!=this.dataProvider.columnCount-1&&!p.isAll,e.label=p.caption):(e.label=this.dataProvider.columnMaxDepth-
1==k&&d.model._options.OptionsManager.showExtraTotalLabels?null!=a?a.caption:d.model._labels.Labels.GRID_TOTAL:"",p=null):(n=c.length-1!=this.dataProvider.columnCount-1&&!p.isAll,e.label=p.caption,this.dataProvider.columnAxis.hasMeasures&&k<q&&(e.measure=a=null))}k=null==p?!1:this.dataProvider.isColumnDrilledDown(c,p,a);p&&(1!=p.children.length||p.children.getItemAt(0).caption!=d.model._labels.Labels.MEMBER_BLANK&&p.children.getItemAt(0).caption!=d.model._labels.Labels.INVALID_DATE)&&!p.isAll&&p.hierarchy_.isHierarchy&&
!p.level.isLast&&(n||d.model._options.OptionsManager.showHierarchies?k?e.drilledDown=!0:e.drilledUp=!0:k?e.expanded=!0:e.collapsed=!0);n&&!k&&(this.dataProvider.isColumnExpanded(c,a)?e.expanded=!0:e.collapsed=!0);"on"!=d.model._options.OptionsManager.sorting&&"columns"!=d.model._options.OptionsManager.sorting||""==e.label||(e.sortable=!0,!this.dataProvider.columnSortTuple||this.dataProvider.columnSortTuple.toString()!=c.toString()||null!=a&&this.dataProvider.columnSortMeasure.uniqueName!=a.uniqueName||
(this.dataProvider.columnSortType==d.data_.consts.SortType.DESC?e.sortedDesc=!0:this.dataProvider.columnSortType==d.data_.consts.SortType.ASC&&(e.sortedAsc=!0)));e.isTotalColumn=this.dataProvider.columnCount>c.length;e.tuple=c;e.url=void 0;e.hierarchy=r;e.member=p;return e};a.prototype._getFlatTableColumnCell=function(c,a,b,e){e=this.dataProvider.getColumnHierarchy(c);if(null==e){if(null==a)return null;b=new h.vo.GridCell;b.isColumnHeader=!0;b.label=a.caption;return b}b=new h.vo.GridCell;b.isColumnHeader=
!0;b.isFilterHeader=!0;b.hasHierarchyName=e.filterEnabled;b.filtered=e.hasFilter();b.label=e.caption;b.tuple=c;b.hierarchy=e;b.member=null;b.measure=a;b.draggable=!0;if("on"==d.model._options.OptionsManager.sorting||"columns"==d.model._options.OptionsManager.sorting)b.sortable=!0,!this.dataProvider.columnSortTuple||this.dataProvider.columnSortTuple.toString()!=c.toString()||this.dataProvider.columnSortMeasure!=a&&null!=a||(c=this.dataProvider.columnSortType,c==d.data_.consts.SortType.DESC?b.sortedDesc=
!0:c==d.data_.consts.SortType.ASC&&(b.sortedAsc=!0));return b};a.prototype.getHeaderCell=function(){var c=new h.vo.GridCell;c.isColumnHeader=!0;return c};a.prototype.getEmptyHeaderCell=function(){var c=this.getHeaderCell();c.isEmpty=!0;return c};a.prototype.getGrandTotalCell=function(c,a){var b=new h.vo.GridCell;b.label=null==c?d.model._labels.Labels.GRID_GRAND_TOTAL:c.grandTotalCaption;b.isMeasureHeader=null!=c;if(a==d.data_.consts.AxisName.COLUMNS_AXIS){b.isColumnHeader=!0;b.isTotalColumn=b.isGrandTotalColumn=
!0;if("on"==d.model._options.OptionsManager.sorting||"columns"==d.model._options.OptionsManager.sorting)b.sortable=!0,!this.dataProvider.columnSortTuple||""!=this.dataProvider.columnSortTuple.toString()||this.dataProvider.columnSortMeasure!=c&&null!=c||(this.dataProvider.columnSortType==d.data_.consts.SortType.DESC?b.sortedDesc=!0:this.dataProvider.columnSortType==d.data_.consts.SortType.ASC&&(b.sortedAsc=!0));this.dataProvider.columnAxis.hasMeasures?b.measure=c:b.label=d.model._labels.Labels.GRID_GRAND_TOTAL}else{b.isRowHeader=
!0;b.isTotalRow=b.isGrandTotalRow=!0;if("on"==d.model._options.OptionsManager.sorting||"rows"==d.model._options.OptionsManager.sorting)b.sortable=!0,!this.dataProvider.rowSortTuple||""!=this.dataProvider.rowSortTuple.toString()||this.dataProvider.rowSortMeasure!=c&&null!=c||(this.dataProvider.rowSortType==d.data_.consts.SortType.DESC?b.sortedDesc=!0:this.dataProvider.rowSortType==d.data_.consts.SortType.ASC&&(b.sortedAsc=!0));this.dataProvider.rowAxis.hasMeasures?b.measure=c:b.label=d.model._labels.Labels.GRID_GRAND_TOTAL;
b.level=0}b.tuple=[];return b};a.prototype.getRowCell=function(c,a,b){if(0==c.length)return this.getGrandTotalCell(a,d.data_.consts.AxisName.ROWS_AXIS);var e=this.dataProvider.rowAxis.hasMeasures&&c.length>this.dataProvider.measuresPosition?c.length:c.length-1,l=c[c.length-1],f=this.dataProvider.rows.getItemAt(e),r=new h.vo.GridCell;r.isRowHeader=!0;var n=!1,l=f.members.getItemAt(l);r.level=b;null!=a&&this.dataProvider.rowAxis.hasMeasures&&this.dataProvider.multiMeasures&&e<=this.dataProvider.measuresPosition?
(r.label=a.caption,l=null):l&&(r.label=l.caption,n=c.length!=this.dataProvider.rowCount&&!l.isAll);b=null==l?!1:this.dataProvider.isRowDrilledDown(c,l,a);l&&!l.isAll&&l.hierarchy_.isHierarchy&&!l.isLeaf&&(1!=l.children.length||l.children.getItemAt(0).caption!=d.model._labels.Labels.MEMBER_BLANK&&l.children.getItemAt(0).caption!=d.model._labels.Labels.INVALID_DATE)&&(d.model._options.OptionsManager.showHierarchies?b?r.drilledDown=!0:r.drilledUp=!0:b?r.expanded=!0:r.collapsed=!0);n&&!b&&(this.dataProvider.isRowExpanded(c,
a)?r.expanded=!0:r.collapsed=!0);if("on"==d.model._options.OptionsManager.sorting||"rows"==d.model._options.OptionsManager.sorting)r.sortable=!0,this.dataProvider.rowSortTuple&&this.dataProvider.rowSortTuple.toString()==c.toString()&&this.dataProvider.rowSortMeasure==a&&(this.dataProvider.rowSortType==d.data_.consts.SortType.DESC?r.sortedDesc=!0:this.dataProvider.rowSortType==d.data_.consts.SortType.ASC&&(r.sortedAsc=!0));r.isTotalRow=this.dataProvider.rowCount>c.length;r.tuple=c;r.url=void 0;r.hierarchy=
f;r.member=l;r.measure=this.dataProvider.rowAxis.hasMeasures&&1<this.dataProvider.measures.length?a:null;return r};a.prototype._getRowCell=function(c,a,b,e,l){if(0==c.length){if(0==e)return this.getGrandTotalCell(a,d.data_.consts.AxisName.ROWS_AXIS);var f=new h.vo.GridCell;f.isRowHeader=!0;f.isTotalRow=f.isGrandTotalRow=!0;f.isEmpty=!0;f.level=b;return f}for(var r=e,n,f=this.dataProvider.rowLevels[e],p,q,t=0;t<this.dataProvider.rowsOnly.length;t++){var u=this.dataProvider.rowsOnly.getItemAt(t);p=
u.findLevel(f);if(null!=p){n=u;r=t;break}}t=null==c[r]?0:c[r];f=new h.vo.GridCell;f.isRowHeader=!0;f.isTotalRow=this.dataProvider.rowCount>c.length;f.isClassicTotalRow=f.isTotalRow&&2==l;p=!1;b>e&&(p=!0);b>e&&2==l&&(p=!0);b+1<e&&2==l&&(p=!0);f.level=Math.min(c.length-1,e);var v=c.slice(0),u=!1;if(e==this.dataProvider.rowLevels.length)f.label=a.caption,u=!0;else{var x=!1,v=null==a?0:this.dataProvider.measures.indexOf(a.uniqueName),w=n.members.getItemAt(t);q=this.dataProvider.rowLevels.indexOf(w.level.uniqueName)-
e;var y=null!=w&&2!=l;if(0>q)if(w.isAll)u=!0;else return f;else if(0<q)for(t=0;t<q;t++)w=w.parent;w&&(t=this.dataProvider.rowLevels.indexOf(w.level.uniqueName),-1<t&&(f.level=t));f.member=w;if(2==l)w&&b==e&&(f.label=this.dataProvider.rowAxis.hasMeasures&&1<this.dataProvider.measures.length?w.caption+" "+a.caption:w.caption+" "+d.model._labels.Labels.GRID_TOTAL,u=!0);else{if(0>q)return utils.nullOrEmpty(f.label)&&(f.isEmpty=!0),t=this.getLevelIdxByTuple(c),-1<t&&(f.level=t),f;0<v&&(w=null);w&&0!=w.ordinal&&
(f.label=w.caption);x=1==l&&r<this.dataProvider.rowsOnly.length-1&&0==v}v=c.slice(0,r+1);if(y&&w){v[r]=w.ordinal;var z=this.dataProvider.isRowDrilledDown(v,w,a);w.isAll||!w.hierarchy_.isHierarchy||w.isLeaf||2==l||1==w.children.length&&(w.children.getItemAt(0).caption==d.model._labels.Labels.MEMBER_BLANK||w.children.getItemAt(0).caption==d.model._labels.Labels.INVALID_DATE)||(d.model._options.OptionsManager.showHierarchies?z?f.drilledDown=!0:f.drilledUp=!0:z?f.expanded=!0:f.collapsed=!0)}x&&!z&&(this.dataProvider.isRowExpanded(v,
a)?f.expanded=!0:f.collapsed=!0)}if(p)f.label="",f.sortedAsc=f.sortedDesc=f.collapsed=f.expanded=f.drilledDown=f.drilledUp=!1;else if(f.tuple=v,f.url=void 0,f.hierarchy=n,f.measure=a,"on"==d.model._options.OptionsManager.sorting||"rows"==d.model._options.OptionsManager.sorting)f.sortable=!0,this.dataProvider.rowSortTuple&&this.dataProvider.rowSortTuple.toString()==v.toString()&&this.dataProvider.rowSortMeasure==a&&(this.dataProvider.rowSortType==d.data_.consts.SortType.DESC?f.sortedDesc=!0:this.dataProvider.rowSortType==
d.data_.consts.SortType.ASC&&(f.sortedAsc=!0));u&&(t=this.getLevelIdxByTuple(c),-1<t&&(f.level=t));utils.nullOrEmpty(f.label)&&(f.isEmpty=!0,f.isExpandedArea=2==l&&w&&e-1>b?!1:!0);return f};a.prototype.getLevelIdxByTuple=function(c){return(c=this.dataProvider.getRowHierarchy(c).members.getItemAt(c[c.length-1]))?this.dataProvider.rowLevels.indexOf(c.level.uniqueName):-1};a.prototype.onGridClick=function(c){utils.nullOrUndefined(c.cell)||!c.cell.isColumnHeader&&!c.cell.isRowHeader||(c.cell.activeElementType==
h.vo.GridCellElementType.DRILL?this.drill(c.cell):c.cell.activeElementType==h.vo.GridCellElementType.LINK&&c.cell.isLink||(utils.nullOrUndefined(c.cell.member)||c.cell.activeElementType==h.vo.GridCellElementType.RIGHT_ICON?c.cell.activeElementType==h.vo.GridCellElementType.RIGHT_ICON&&(c.cell.isColumnHeader&&this.sortColumn(c.cell),c.cell.isRowHeader&&this.sortRow(c.cell)):d.model._options.OptionsManager.showHierarchies||c.cell.member.isLeaf?this.expandCollapse(c.cell):this.drill(c.cell)))};a.prototype.onFilterClick=
function(c){d.model._options.OptionsManager.showFilter&&this.dispatch(new e.FilterOpenEvent(c.hierarchy))};a.prototype.drill=function(c){if(c.drilledUp||c.drilledDown||c.expanded||c.collapsed){var a=c.tuple,b=d.model._options.OptionsManager.classicView?null:c.measure,e=c.member;if(null!=e&&!e.isAll&&!e.isLeaf){var f;c.isRowHeader?(c=d.data_.consts.AxisName.ROWS_AXIS,f=this.dataProvider.isRowDrilledDown(a,e,b)):(c=d.data_.consts.AxisName.COLUMNS_AXIS,f=this.dataProvider.isColumnDrilledDown(a,e,b));
f?this.dataProvider.drillUp(a,e,c,b):this.dataProvider.drillDown(a,e,c,b)}}};a.prototype.expandCollapse=function(c){if(c.expanded||c.collapsed){var a=c.tuple,b=c.isColumnHeader?d.data_.consts.AxisName.COLUMNS_AXIS:d.data_.consts.AxisName.ROWS_AXIS,e=d.model._options.OptionsManager.classicView&&b==d.data_.consts.AxisName.ROWS_AXIS?null:c.measure;c.expanded?(this.gridLayout.clearData(),this.dataProvider.collapse(a,b,e)):c.collapsed&&(this.gridLayout.clearData(),this.dataProvider.expand(a,b,e));c.isColumnHeader?
this.gridLayout.clearColSizes(c.colIdx+1):this.gridLayout.clearRowSizes(c.rowIdx+1)}};a.prototype.onGridSingleDoubleClick=function(c){c.isSingleClick?this.singleClick(c.cell):(this.isDrillThroughAvailable&&d.model._options.OptionsManager.drillThrough&&!this.isFlatTable&&this.drillThrough(c.cell),this.doubleClick(c.cell))};a.prototype.drillThrough=function(c){c.isValue&&!c.measure.calculated&&this.dispatchWith(e.ViewEvent.DRILL_THROUGH_OPEN,this,{measure:c.measure.uniqueName,columnTuple:c.columnTuple,
rowTuple:c.rowTuple})};a.prototype.singleClick=function(c){var a=c.toObject();this.setCoordsToCell(a,c.colIdx,c.rowIdx);d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.CELL_CLICK,a))};a.prototype.doubleClick=function(c){var a=c.toObject();this.setCoordsToCell(a,c.colIdx,c.rowIdx);d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.CELL_DOUBLE_CLICK,a))};a.prototype.setCoordsToCell=function(c,a,b){c.x=this.gridLayout.coords.getRelativeColX(a,
this.gridLayout.isSmooth);c.y=this.gridLayout.coords.getRelativeRowY(b,this.gridLayout.isSmooth);c.width=this.gridLayout.coords.getColWidth(a);c.height=this.gridLayout.coords.getRowHeight(b)};a.prototype.sortRow=function(c,a){void 0===a&&(a="");var b=c.tuple,e=c.measure;null==e&&(e=this.dataProvider.measures.getItemAt(0));this.dataProvider.rowSortTuple&&this.dataProvider.rowSortTuple.toString()==b.toString()&&this.dataProvider.rowSortMeasure==e?this.dataProvider.rowSortType=this.dataProvider.rowSortType==
d.data_.consts.SortType.DESC?d.data_.consts.SortType.ASC:d.data_.consts.SortType.DESC:(this.dataProvider.rowSortType=d.data_.consts.SortType.DESC,this.dataProvider.rowSortTuple=b,this.dataProvider.rowSortMeasure=e);""!=a&&(this.dataProvider.rowSortType=a);this.dataProvider.sort();this.gridLayout.clearColSizes(0);this.draw()};a.prototype.sortColumn=function(c,a){void 0===a&&(a="");var b=c.tuple,e=c.measure;null==e&&(e=this.dataProvider.measures.getItemAt(0));b&&this.dataProvider.columnSortTuple&&this.dataProvider.columnSortTuple.toString()==
b.toString()&&this.dataProvider.columnSortMeasure==e?this.dataProvider.columnSortType=this.dataProvider.columnSortType==d.data_.consts.SortType.DESC?d.data_.consts.SortType.ASC:d.data_.consts.SortType.DESC:(this.dataProvider.columnSortType=e.type==d.data_.types.MeasureType.COUNT?d.data_.consts.SortType.ASC:d.data_.consts.SortType.DESC,this.dataProvider.columnSortTuple=b,this.dataProvider.columnSortMeasure=e);""!=a&&(this.dataProvider.columnSortType=a);this.dataProvider.sort();this.gridLayout.clearRowSizes(0);
this.draw()};a.prototype.clearColumnSorting=function(){this.dataProvider.columnSortType=d.data_.consts.SortType.UNSORTED;this.dataProvider.columnSortTuple=null;this.dataProvider.columnSortMeasure=null;this._model.cube_.clearSortValues(this.dataProvider.rowAxis);this.dataProvider.sort();this.gridLayout.clearRowSizes(0);this.draw()};a.prototype.clearRowSorting=function(){this.dataProvider.rowSortType=d.data_.consts.SortType.UNSORTED;this.dataProvider.rowSortTuple=null;this.dataProvider.rowSortMeasure=
null;this._model.cube_.clearSortValues(this.dataProvider.columnAxis);this.dataProvider.sort();this.gridLayout.clearColSizes(0);this.draw()};a.prototype.onLongPress=function(c,a){var b=this.gridLayout.getCellByElement(c.target);null==b||utils.nullOrEmpty(b.label)&&isNaN(b.value)||(this.showContextMenu(b,{left:a.clientX,top:a.clientY}),this.gridLayout.deselect())};a.prototype.onContextMenu=function(c){var a=this.gridLayout.selectedCells[0]||this.gridLayout.getCellByElement(c.target);null==a||utils.nullOrEmpty(a.label)&&
isNaN(a.value)||(c.preventDefault(),this.showContextMenu(a,{left:c.clientX,top:c.clientY}),this.gridLayout.deselect())};a.prototype.showContextMenu=function(c,a){var b=this;if(null!=c){var k=[];!c.isValue||isNaN(c.value)||this.isFlatTable||c.measure.calculated||!d.model._options.OptionsManager.drillThrough||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_DRILL_THROUGH,handler:function(){b.drillThrough(c)}});c.isFilterHeader&&d.model._options.OptionsManager.showFilter&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_OPEN_FILTER,
handler:function(){b.dispatch(new e.FilterOpenEvent(c.hierarchy))}});if(c.isRowHeader||c.isColumnHeader)c.expanded&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_COLLAPSE,handler:function(){b.expandCollapse(c)}}),c.collapsed&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_EXPAND,handler:function(){b.expandCollapse(c)}});c.isRowHeader&&!c.isFilterHeader&&(c.sortedDesc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_ROW_DESC,handler:function(){b.sortRow(c,d.data_.consts.SortType.DESC)}}),
c.sortedAsc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_ROW_ASC,handler:function(){b.sortRow(c,d.data_.consts.SortType.ASC)}}),(c.sortedAsc||c.sortedDesc)&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_CLEAR_SORTING,handler:function(){b.clearRowSorting()}}));c.isColumnHeader&&!c.isFilterHeader&&(c.sortedDesc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_COLUMN_DESC,handler:function(){b.sortColumn(c,d.data_.consts.SortType.DESC)}}),c.sortedAsc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_COLUMN_ASC,
handler:function(){b.sortColumn(c,d.data_.consts.SortType.ASC)}}),(c.sortedAsc||c.sortedDesc)&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_CLEAR_SORTING,handler:function(){b.clearColumnSorting()}}));0<k.length&&this._model.dispatchWith(e.ViewEvent.CONTEXT_MENU_OPEN,this,{menuItems:k,coords:a})}};a.prototype.addFilterCell=function(c,a,b){for(var e=b==d.data_.consts.AxisName.COLUMNS_AXIS?this.dataProvider.columnsOnly:this.dataProvider.rowsOnly,f,s=0,r=0;r<e.length;r++){var n=e.getItemAt(r);
n.isMeasures||(f=new h.vo.GridCell,f.label=n.caption,f.isFilterHeader=!0,f.draggable=!0,f.hasHierarchyName=!0,f.filtered=n.hasFilter(),f.level=s,f.hierarchy=n,b==d.data_.consts.AxisName.COLUMNS_AXIS?(f.isFrozen=!this.isFlatTable,this.gridLayout.dataProvider.setDataFrozen(c,a+r,f)):(f.isRowHeader=!0,this.gridLayout.dataProvider.setDataFrozen(c+s,a,f),s++))}};a.prototype._addFilterCell=function(c,a){for(var b=this.dataProvider.rowsOnly,d,e=0,f=this.dataProvider.rowAxis.hasMeasures&&1<this.dataProvider.measures.length?
this.FIRST_DATA_COLUMN-1:this.FIRST_DATA_COLUMN,r=0;r<b.length;r++){var n=b.getItemAt(r),p;d=new h.vo.GridCell;d.label=n.caption;d.isFilterHeader=!0;d.draggable=!0;d.hasHierarchyName=!0;d.filtered=n.hasFilter();d.hierarchy=n;this.gridLayout.dataProvider.setDataFrozen(c,a+e,d);e++;if(2<n.levels_.length)for(var q=2;q<n.levels_.length&&!(p=n.levels_.getItemAt(q),-1!=this.dataProvider.rowLevels.indexOf(p.uniqueName)&&(d=new h.vo.GridCell,d.label=p.caption,d.isRowHeader=!0,d.hasHierarchyName=!0,this.gridLayout.dataProvider.setDataFrozen(c,
a+e,d),e++),e>=f);q++);if(e>=f)break}};Object.defineProperty(a.prototype,"isFlatTable",{get:function(){return d.model._options.OptionsManager.flatView},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isDrillThroughAvailable",{get:function(){return!d.model._options.OptionsManager.flatView},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"gridLayout",{get:function(){return this._gridLayout},enumerable:!0,configurable:!0});a.prototype.exportTo=function(c,a,b){c==
d.model._export.ExportType.HTML&&d.model._export.ExportHTML.run(this,a,this.dataProvider.extendedDataWidth,this.dataProvider.extendedDataHeight);c==d.model._export.ExportType.PDF&&d.model._export.ExportPDF.run(this,a,this.dataProvider.extendedDataWidth,this.dataProvider.extendedDataHeight);c==d.model._export.ExportType.EXCEL&&d.model._export.ExportXLS.run(this,a,this.dataProvider.extendedDataWidth,this.dataProvider.extendedDataHeight)};a.prototype.print=function(){d.model.printing.PrintingManager.getInstance().run(this,
this.dataProvider)};a.prototype.getCell=function(c,a){var b=this.gridLayout.getCell(c,a,!0,!0);if(null==b){b=new h.vo.GridCell;b.rowIdx=c;b.colIdx=a;var d=this.getData(c,a,!0);b.value=d?d.value:NaN;isNaN(b.value)||(b.label=utils.NumberFormatter.format(b.value))}-1==b.rowIdx&&(b.rowIdx=c);-1==b.colIdx&&(b.colIdx=a);d=b.toObject();this.setCoordsToCell(d,b.colIdx,b.rowIdx);return d};a.prototype.getSelectedCell=function(){if(utils.nullOrUndefined(this.gridLayout))return null;var c=this.gridLayout.selectedCells.map(function(c){return c.toObject()});
if(0==c.length)return null;if(1<c.length)return c;c=c[0];this.setCoordsToCell(c,c.columnIndex,c.rowIndex);return c};a.prototype.setSelectedCell=function(c,a){this.gridLayout.select(c,a,c,a)};a.prototype.removeSelection=function(){this.gridLayout.deselect()};Object.defineProperty(a.prototype,"gridRowCount",{get:function(){return this.dataProvider.dataLoaded?this.dataProvider.extendedDataHeight+this.FIRST_DATA_ROW:0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"gridColumnCount",
{get:function(){return this.dataProvider.dataLoaded?this.dataProvider.extendedDataWidth+this.FIRST_DATA_COLUMN:0},enumerable:!0,configurable:!0});a.prototype.onResizeColumn=function(c){this._onResizeColumn(c.data.colIdx,c.data.width)};a.prototype.onResizeRow=function(c){this._onResizeRow(c.data.rowIdx,c.data.height)};a.prototype._onResizeColumn=function(c,a){if(c<this.FIRST_DATA_COLUMN)0<a?d.model.sizes.SizesManager.columnHeaderSizes[c]=a:delete d.model.sizes.SizesManager.columnHeaderSizes[c];else{var b=
this.dataProvider.getColumnTuple(c-this.FIRST_DATA_COLUMN,!0);if(null!=b){var e=this.dataProvider.getColumnMeasureIndex(c-this.FIRST_DATA_COLUMN);this.dataProvider.columnAxis.hasMeasures&&b.push(e);0<a?d.model.sizes.SizesManager.columnSizes[b.join(",")]=a:delete d.model.sizes.SizesManager.columnSizes[b.join(",")]}}};a.prototype.resizeColumnsByIdx=function(){var c=d.model.sizes.SizesManager.columnSizesByIdx;d.model.sizes.SizesManager.columnSizesByIdx={};var a=[],b;for(b in c)if(c[b]){var e=parseInt(b);
a[e]=c[b]}for(var f in a)this.gridLayout.resizeColumn(parseInt(f),a[f]),this._onResizeColumn(parseInt(f),a[f])};a.prototype.resizeHeaderColumns=function(){var c=d.model.sizes.SizesManager.columnHeaderSizes,a=[],b;for(b in c)c[b]&&(a[b]=c[b]);for(var e in a)c=parseInt(e),c<this.FIRST_DATA_COLUMN&&this.gridLayout.resizeColumn(c,a[c])};a.prototype.resizeColumns=function(){var c=d.model.sizes.SizesManager.columnSizes,a=[],b;for(b in c)if(c[b]){var e=""==b?[]:b.split(","),e=this.dataProvider.getColumnTupleIndex(e);
-1!=e&&(e+=this.FIRST_DATA_COLUMN,a[e]=c[b])}for(var f in a)this.gridLayout.resizeColumn(parseInt(f),a[f])};a.prototype.resizeRowsByIdx=function(){var c=d.model.sizes.SizesManager.rowSizesByIdx;d.model.sizes.SizesManager.rowSizesByIdx={};var a=[],b;for(b in c)if(c[b]){var e=parseInt(b);a[e]=c[b]}for(var f in a)this.gridLayout.resizeRow(parseInt(f),a[f]),this._onResizeRow(parseInt(f),a[f])};a.prototype.resizeHeaderRows=function(){d.model.sizes.SizesManager.startTableRow=this.START_TABLE_ROW;var c=
d.model.sizes.SizesManager.rowHeaderSizes,a=[],b;for(b in c)if(c[b]){var e=parseInt(b)+this.START_TABLE_ROW;a[e]=c[b]}for(var f in a)parseInt(f)<this.FIRST_DATA_ROW&&this.gridLayout.resizeRow(parseInt(f),a[f])};a.prototype.resizeRows=function(){var c=d.model.sizes.SizesManager.rowSizes,a=[],b;for(b in c)if(c[b]){var e=""==b?[]:b.split(","),e=this.dataProvider.getRowTupleIndex(e);-1!=e&&(e+=this.FIRST_DATA_ROW,a[e]=c[b])}for(var f in a)this.gridLayout.resizeRow(parseInt(f),a[f])};a.prototype._onResizeRow=
function(c,a){d.model.sizes.SizesManager.startTableRow=this.START_TABLE_ROW;if(c<this.START_TABLE_ROW)0<a?d.model.sizes.SizesManager.rowFilterSizes[c]=a:delete d.model.sizes.SizesManager.rowFilterSizes[c];else if(c<this.FIRST_DATA_ROW)0<a?d.model.sizes.SizesManager.rowHeaderSizes[c-this.START_TABLE_ROW]=a:delete d.model.sizes.SizesManager.rowHeaderSizes[c-this.START_TABLE_ROW];else{var b=this.dataProvider.getRowTuple(c-this.FIRST_DATA_ROW,!0);if(null!=b){var e=this.dataProvider.getRowMeasureIndex(c-
this.FIRST_DATA_ROW);this.dataProvider.rowAxis.hasMeasures&&b.push(e);0<a?d.model.sizes.SizesManager.rowSizes[b.join(",")]=a:delete d.model.sizes.SizesManager.rowSizes[b.join(",")]}}};return a}(uicontrols.containers.UIContainer);h.GridView=f})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function a(){}a.MOUSE_CLICK="mclick";a.MOUSE_DOUBLE_CLICK="dblclick";a.MOUSE_SINGLE_DOUBLE_CLICK="singledoubleclick";a.MOUSE_UP="mup";a.MOUSE_DOWN="mdown";a.MOUSE_MOVE="mmove";a.MOUSE_LEAVE="mleave";a.HEADER_RESIZED="hresized";a.HEADER_RESIZING="hresizing";a.SHRINK_TO_FIT="shrink";a.DRILLTHROUGH_CLOSED="dthclosed";a.LONG_PRESS="long";a.FILTER_CLICK="filter_click";a.RESIZE_COLUMN="resize_c";a.RESIZE_ROW="resize_r";return a}();d.GridEvent=e;var b=
function(a){function c(c,b){void 0===b&&(b=null);var d=a.call(this,e.MOUSE_CLICK)||this;d.cell=c;d.element=b;return d}__extends(c,a);return c}(events._Event);d.GridClickEvent=b;b=function(a){function c(c){var b=a.call(this,e.MOUSE_DOUBLE_CLICK)||this;b.cell=c;return b}__extends(c,a);return c}(events._Event);d.GridDoubleClickEvent=b;b=function(a){function c(c,b,d){void 0===d&&(d=null);var l=a.call(this,e.MOUSE_SINGLE_DOUBLE_CLICK)||this;l.cell=c;l.isSingleClick=b;l.element=d;return l}__extends(c,a);
return c}(events._Event);d.GridSingleDoubleClickEvent=b;b=function(a){function c(c){var b=a.call(this,e.MOUSE_DOWN)||this;b.cell=c;return b}__extends(c,a);return c}(events._Event);d.GridMouseDownEvent=b;b=function(a){function c(c){var b=a.call(this,e.MOUSE_MOVE)||this;b.cell=c;return b}__extends(c,a);return c}(events._Event);d.GridMouseMoveEvent=b;b=function(a){function c(c){var b=a.call(this,e.MOUSE_UP)||this;b.cell=c;return b}__extends(c,a);return c}(events._Event);d.GridMouseUpEvent=b;b=function(a){function c(c,
b){var d=a.call(this,e.LONG_PRESS)||this;d.cell=c;d.coords=b;return d}__extends(c,a);return c}(events._Event);d.GridLongPressEvent=b;b=function(a){function c(c,b,d){void 0===d&&(d=null);var l=a.call(this,e.FILTER_CLICK)||this;l.hierarchy=c;l.cell=b;l.element=d;return l}__extends(c,a);return c}(events._Event);d.FilterClickEvent=b})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.validate=function(a){return a==b.COMPACT||a==b.CLASSIC||a==b.FLAT?a:b.COMPACT};b.COMPACT="compact";b.CLASSIC="classic";b.FLAT="flat";return b}();d.GridType=e})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){var h=function(f){function b(){var a=this;if(null!=b._instance)throw Error("Singleton");a=f.call(this,e.PivotView.stage.container)||this;a.setId("wdr-alert-view");a.setControls();return a}__extends(b,f);b.getInstance=function(){null==b._instance&&(b._instance=new b);return b._instance};b.dispose=function(){b._instance=null};b.prototype.setControls=function(){this.overlay.addClass("wdr-overlay-alert");this._buttons=[];var a=new uicontrols.UIComponentBase("div","wdr-content");
this.addChild(a);this._txtTitle=new uicontrols.UILabel;this._txtTitle.addClass("wdr-popup-title");a.addChild(this._txtTitle);this._txtMessage=new uicontrols.UILabel;a.addChild(this._txtMessage);this._toolbar=new uicontrols.UIComponentBase("div","wdr-ui-btns-row");a.addChild(this._toolbar);this._icon=new uicontrols.UIComponentBase("div","wdr-alert-icon");this.addChild(this._icon)};b.prototype.openView=function(a,c,b,m,k,f){void 0===a&&(a="");void 0===c&&(c="");void 0===b&&(b=d.AlertType.ALERT);void 0===
m&&(m=null);void 0===k&&(k=null);void 0===f&&(f=!1);this.clear();this.setTitle(c);this.setMessage(a);this.setIcon(b);this.setButtons(m,k);e.PivotView.stage.addChild(this);this.isOpaque=f;this.open();this.centerPosition()};b.prototype.clear=function(){this.setTitle("");for(this.setMessage("");0<this._buttons.length;)this._buttons.pop().removeFromParent();this.container.toggleClass("wdr-alert",!1);this.container.toggleClass("wdr-confirmation",!1);this.container.toggleClass("wdr-error",!1);this.container.toggleClass("wdr-info",
!1);this.container.toggleClass("wdr-question",!1)};b.prototype.setTitle=function(a){this._txtTitle.setSelectable(!1);this._txtTitle.setLabel(a)};b.prototype.setMessage=function(a){this._txtMessage.setLabel(a,!0)};b.prototype.setButtons=function(a,c){var b=this;null==a&&(a=[d.model._labels.Labels.BUTTON_OK]);a.reverse();null!=c&&c.reverse();this._handlers=c;for(var m,e=0;e<a.length;e++)m=new uicontrols.UIButton,m.setLabel(a[e]),m.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(c){return b.buttonClickHandler(c)}),
this._buttons.push(m),this.isPrimary(a[e])&&m.addClass("wdr-ui-btn-dark"),this.isPrimary(a[e])&&(utils.OSUtil.isMac||utils.OSUtil.isIOS)?this._toolbar.addChild(m):this.isPrimary(a[e])?this._toolbar.container.prepend(m.container):this._toolbar.addChild(m)};b.prototype.isPrimary=function(a){switch(a){case d.model._labels.Labels.BUTTON_OK:case d.model._labels.Labels.BUTTON_SAVE:case d.model._labels.Labels.BUTTON_YES:return!0}return!1};b.prototype.buttonClickHandler=function(a){a=a.target;for(var c=-1,
b=0;b<this._buttons.length;b++)if(this._buttons[b]==a){c=b;break}if(!(0>c)&&(this.close(),null!=this._handlers&&null!=this._handlers[c]))this._handlers[c]()};b.prototype.setIcon=function(a){this._icon.container.removeAllChildren();a==d.AlertType.ALERT?this._icon.container.addChild(this.createIconAlert()):a==d.AlertType.CONFIRMATION?this._icon.container.addChild(this.createIconConfirmation()):a==d.AlertType.ERROR?this._icon.container.addChild(this.createIconError()):a==d.AlertType.INFO&&this._icon.container.addChild(this.createIconInfo())};
b.prototype.createIconConfirmation=function(){var a=new uicontrols.UIElement("span","wdr-circle");a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_confirm"));return a};b.prototype.createIconInfo=function(){var a=new uicontrols.UIElement("span","wdr-circle");a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_info"));return a};b.prototype.createIconAlert=function(){var a=new uicontrols.UIElement("span","wdr-triangle-wrap");a.addChild(new uicontrols.UIElement("span",
"wdr-triangle"));a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_warning"));return a};b.prototype.createIconError=function(){var a=new uicontrols.UIElement("span","wdr-hexagon");a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_arrow"));return a};b.prototype.close=function(){f.prototype.close.call(this);this.clear()};b.prototype.onOverlayClick=function(){this.isOpaque||f.prototype.onOverlayClick.call(this)};return b}(uicontrols.containers.UIPopup);e.AlertView=
h})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this,e.PivotView.stage.container)||this;c.slice=null;c.originalSlice=null;c.columnTuple=null;c.rowTuple=null;c.measure=null;c.START_TABLE_ROW=0;c.START_HEADERS_ROW=0;c.START_HEADERS_COLUMN=0;c.FIRST_DATA_ROW=0;c.FIRST_DATA_COLUMN=0;c.setId("wdr-drillthrough-view");c.setControls();return c}__extends(a,b);a.prototype.setControls=function(){var c=this;this.headerGroup=new uicontrols.containers.UIContainer("wdr-header-container");this.addChild(this.headerGroup);
this._txtTitle=new uicontrols.UILabel;this._txtTitle.addClass("wdr-popup-title");this._txtTitle.setSelectable(!1);this.headerGroup.addChild(this._txtTitle);this._btnClose=new uicontrols.UIButton;this._btnClose.addClass("wdr-ui-btn-close");this._btnClose.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return c.close()});this.headerGroup.addChild(this._btnClose);this.detailsGroup=new uicontrols.containers.UIContainer("wdr-details-container");this.addChild(this.detailsGroup);this._txtRowDetails=
new uicontrols.UILabel;this._txtRowDetails.addClass("wdr-ui-label-light");this.detailsGroup.addChild(this._txtRowDetails);this._txtColDetails=new uicontrols.UILabel;this._txtColDetails.addClass("wdr-ui-label-light");this.detailsGroup.addChild(this._txtColDetails);this._txtMeasureDetails=new uicontrols.UILabel;this._txtMeasureDetails.addClass("wdr-ui-label-light");this.detailsGroup.addChild(this._txtMeasureDetails);this.sheetGroup=new uicontrols.containers.UIContainer("wdr-grid-container");this.addChild(this.sheetGroup);
this.gridLayout=new h.sheet.flat.FlatGridLayout;this.gridLayout.isDrillThrough=!0;this.gridLayout.getDataFunction=function(a,b){return c.getData(a,b)};this.sheetGroup.container.addChild(this.gridLayout)};a.prototype.openView=function(c,a,b,k,f){var h=this;void 0===c&&(c=null);void 0===a&&(a=null);void 0===b&&(b=null);void 0===k&&(k=null);void 0===f&&(f=null);this.dataProvider=c;this.setSlice(a.clone());this.originalSlice=a;this.rowTuple=k;this.columnTuple=b;this.measure=f;this.tmpShowHeaders=d.model._options.OptionsManager.showHeaders;
d.model._options.OptionsManager.showHeaders=!0;this.data=this.dataProvider.drillThrough(this.rowTuple,this.columnTuple,this.measure);this.keys=this.data.shift();d.model._options.OptionsManager.showDrillThroughConfigurator&&null==this._fieldsView&&(this._fieldsView=new e.config.FieldsView,this._fieldsView.modalParent=e.PivotView.stage.container,this._fieldsView.isForDillThrough=!0,this._fieldsView.containtment=this.gridLayout.element,this._fieldsView.addEventListener(e.config.FieldsView.EVENT_OPEN,
function(){return h.onFieldsViewOpen()}),this._fieldsView.addEventListener(e.config.FieldsView.EVENT_APPLY_SLICE,function(c){return h.onFieldsViewApplySlice(c)}),this.sheetGroup.addChild(this._fieldsView));this.gridLayout.addEventListener(e.config.FieldsView.EVENT_APPLY_SLICE,function(c){return h.onFieldsViewApplySlice(c)});this.open();this.redraw()};a.prototype.onDataLoaded=function(c){this.data=c;d.preloader(!1);null!=this.data&&(this.open(),this.redraw())};a.prototype.setSlice=function(c){this.slice=
c};a.prototype.redraw=function(){this._txtTitle.setLabel(d.model._labels.Labels.DRILL_THROUGH_TITLE);this._txtRowDetails.setLabel(this.getRowDetails(),!0);this._txtColDetails.setLabel(this.getColDetails(),!0);this._txtMeasureDetails.setLabel(this.getMeasureDetails(),!0);this.setWidth(e.PivotView.stageWidth-80);var c=e.PivotView.stage.container.getHeight(!0)-this.detailsGroup.container.getHeight(!0)-this.headerGroup.container.getHeight(!0)-30-this.container.padding.top-this.container.padding.bottom-
40,a=this.getWidth()-2;this.gridLayout.clearAll();this.gridLayout.resize(a,c);this.gridLayout.width=a;this.gridLayout.height=c;this.gridLayout.freezeRows(1);this.gridLayout.setDataSize(this.data.length,this.slice.flatten().length);this.gridLayout.draw();this.centerPosition()};a.prototype.close=function(){b.prototype.close.call(this);!1==utils.nullOrUndefined(this.tmpShowHeaders)&&(d.model._options.OptionsManager.showHeaders=this.tmpShowHeaders);this.dispatchWith(h.GridEvent.DRILLTHROUGH_CLOSED)};
a.prototype.getData=function(c,a){if(0==c)return this.getHeaderCell(a);var b=new h.vo.GridCell;b.isDrillThrough=!0;b.isValue=!0;var e;if(null==this.data||null==this.data[c-1])return null;e=this.slice.flatten();if(a<this.data[c-1].length){var f=e.getItemAt(a);if(null==f)return null;e=this.keys.indexOf(f.uniqueName);2<f.levels_.length&&(e=this.keys.indexOf(f.levels_.getKeyAt(f.levels_.length-1)));var s=this.getNotNullMemberIdx(c,e);b.hierarchy=f;b.label=this.getMemberFullCaption(f.members.getItemAt(s));
var r=this.slice.hierarchyToMeasure(f.uniqueName);if(null==r)return null;e=r.getFormat(!0).clone();this.originalSlice.measures_.keyExists(r.uniqueName)&&(f=f.members.getItemAt(s),null!=f&&(b.value=f.levelOrdinal,b.label=r.type==d.data_.types.MeasureType.NUMBER?utils.NumberFormatter.format(b.value,e):f.caption));""!=e.textAlign&&b.customize({"text-align":e.textAlign});b.measure=r}else return null;return b};a.prototype.getNotNullMemberIdx=function(c,a){for(;null==this.data[c-1][a];)a--;return this.data[c-
1][a]};a.prototype.getMemberFullCaption=function(c){for(var a=[];c&&c.parent;)a.unshift(c.caption),c=c.parent;return a.join(" / ")};a.prototype.getHeaderCell=function(c){var a=new h.vo.GridCell;a.isDrillThrough=!0;a.isColumnHeader=!0;c=this.slice.flatten().getItemAt(c);if(null==c)return null;a.label=c.caption;return a};a.prototype.getRowDetails=function(){for(var c,a=[],b=0;b<this.rowTuple.length;b++){c=this.originalSlice.rowsOnly.getItemAt(b);if(null==c)return null;c=c.members.getItemAt(this.rowTuple[b]);
a.push(c.caption)}a=0<a.length?utils.StringUtils.bind(d.model._labels.Labels.DRILL_THROUGH_ROW,a.join(" - ")):"";return a=a.replace(/<br\s*[\/]?>/gi," ")};a.prototype.getColDetails=function(){for(var c,a=[],b=0;b<this.columnTuple.length;b++){c=this.originalSlice.columnsOnly.getItemAt(b);if(null==c)return null;c=c.members.getItemAt(this.columnTuple[b]);a.push(c.caption)}a=0<a.length?utils.StringUtils.bind(d.model._labels.Labels.DRILL_THROUGH_COLUMN,a.join(" - ")):"";return a=a.replace(/<br\s*[\/]?>/gi,
" ")};a.prototype.getMeasureDetails=function(){var c=this.measure.getFormat().clone(),a=this.dataProvider.getValue(this.rowTuple,this.columnTuple,this.measure),c=utils.NumberFormatter.format(a,c),c=utils.StringUtils.bind(d.model._labels.Labels.DRILL_THROUGH_VALUE,this.measure.caption,c),c=c.replace(/<br\s*[\/]?>/gi," ");this.value=a;return c};a.prototype.onFieldsViewOpen=function(){this._fieldsView&&this._fieldsView.open(d.data_.Cube.getInstance().structure_,this.slice)};a.prototype.onFieldsViewApplySlice=
function(c){c=c.data instanceof d.data_._structure.Slice?c.data:d.data_._structure.Slice.fromObject(d.model.report.SliceValueObject.fromObject(c.data),d.data_.Cube.getInstance().structure_);this.setSlice(c);this.redraw()};a.prototype.exportTo=function(c,a,b){b=this.slice?this.slice.flatten().length:this.data[0]?this.data[0].length:0;var e=this.data?this.data.length+1:0;c==d.model._export.ExportType.HTML&&d.model._export.ExportHTML.run(this,a,b,e);c==d.model._export.ExportType.PDF&&d.model._export.ExportPDF.run(this,
a,b,e);c==d.model._export.ExportType.EXCEL&&d.model._export.ExportXLS.run(this,a,b,e)};a.prototype.saveData=function(c,a,b){var d=this;this.timer&&this.timer.running&&this.timer.stop();null==this.timer&&(this.timer=new utils.Timer(1E3,1));this.timer.addEventListener(utils.TimerEvent.TIMER_COMPLETE,function(){return d.onTimeComplete()});this.timer.start();(a=this.getData(c,a))&&a.label!=b&&a.value!=b&&this.dataProvider.save(this.rowTuple,this.columnTuple,a.hierarchy,b,c-1);this.draw()};a.prototype.onTimeComplete=
function(){this._txtRowDetails.setLabel(this.getRowDetails(),!0);this._txtColDetails.setLabel(this.getColDetails(),!0);this._txtMeasureDetails.setLabel(this.getMeasureDetails(),!0);this.timer.stop()};return a}(uicontrols.containers.UIPopup);h.DrillThroughView=f})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(){function a(){this.value=NaN;this.label="";this.level=NaN;this.sortedDesc=this.sortedAsc=this.sortable=this.drilledDown=this.drilledUp=this.draggable=this.collapsed=this.expanded=this.filtered=this.hasHierarchyName=this.showTooltip=this.isLink=this.isValue=this.isClassicTotalRow=this.isGrandTotalColumn=this.isGrandTotalRow=this.isTotalColumn=this.isTotalRow=this.isMeasureHeader=this.isColumnHeader=this.isRowHeader=this.isFrozen=this.isFilterHeader=
this.isCustomized=this.numeric=!1;this.colIdx=this.rowIdx=-1;this.recordId=null;this.isDrillThrough=this.isExpandedArea=this.isEmpty=!1;this.conditions=[];this.url="";this.isKPIStatus=this.isKPITrend=!1;this.activeElementType=e.GridCellElementType.BACKGROUND}Object.defineProperty(a.prototype,"isTotal",{get:function(){return this.isTotalRow||this.isTotalColumn},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isGrandTotal",{get:function(){return this.isGrandTotalRow||this.isGrandTotalColumn},
enumerable:!0,configurable:!0});a.prototype.getDrillLabel=function(){return this.drilledDown||this.drilledUp?this.hierarchy.levels_.getItemAt(this.member.level.num+1).caption:""};a.prototype.getLabel=function(){if(null!=a.customizeCellFunction){var c=new HtmlNodeWrapper;c.clear();c.tag="div";c.text+=this.label;a.customizeCellFunction(c.node,this.toObject());var b=c.text,b=d.model.XSSCheck.valid(b)?b:d.model.XSSCheck.validate(b);c.clear();c=document.createElement("div");c.innerHTML=b;return c.textContent?
c.textContent.trim():b}return this.label};a.prototype.customize=function(c){this.isCustomized=!0;null==this.style&&(this.style=new e.CellStyle);this.style.addCSS(c)};a.prototype.customizeWithClass=function(c){this.isCustomized=!0;null==this.style&&(this.style=new e.CellStyle);this.style.addStyle(c);this.style.addCustomStyle(c)};a.prototype.toObject=function(){if(this.obj)return this.obj;var c,a=d.model.PivotModel.getInstance(),b,e=[];if(!d.model._options.OptionsManager.flatView&&(b=this.isColumnHeader&&
this.tuple?this.tuple:this.columnTuple))for(var f=a.cube_.slice_?a.cube_.slice_.columnsOnly:new utils.AssociativeArray,h=0;h<b.length;h++)c=f.getItemAt(h),c=c.members.getItemAt(b[h]),e.push({caption:c.caption,uniqueName:c.uniqueName,hierarchyCaption:c.hierarchy_.caption,hierarchyUniqueName:c.hierarchy_.uniqueName});f=[];if(!d.model._options.OptionsManager.flatView&&(b=this.isRowHeader&&this.tuple?this.tuple:this.rowTuple))for(a=a.cube_.slice_?a.cube_.slice_.rowsOnly:new utils.AssociativeArray,h=0;h<
b.length;h++)c=a.getItemAt(h),c=c.members.getItemAt(b[h]),f.push({caption:c.caption,uniqueName:c.uniqueName,hierarchyCaption:c.hierarchy_.caption,hierarchyUniqueName:c.hierarchy_.uniqueName});b={columnIndex:this.colIdx,columns:e,label:this.label,measure:this.measure?d.data_._structure.GenericMeasure.toObject(this.measure):null,hierarchy:this.hierarchy?d.data_._structure.GenericHierarchy.toObject(this.hierarchy):null,member:this.member?d.data_._structure.GenericMember.toObject(this.member):null,rowIndex:this.rowIdx,
rows:f,type:this.isColumnHeader||this.isRowHeader||this.isFilterHeader?"header":"value",value:this.value,recordId:this.recordId,isTotal:this.isTotal,isTotalRow:this.isTotalRow,isTotalColumn:this.isTotalColumn,isClassicTotalRow:this.isClassicTotalRow,isGrandTotal:this.isGrandTotal,isGrandTotalRow:this.isGrandTotalRow,isGrandTotalColumn:this.isGrandTotalColumn,isDrillThrough:this.isDrillThrough};isNaN(this.level)||(b.level=this.level);0<this.conditions.length&&(b.conditions=this.conditions);return this.obj=
b};a.customizeCellFunction=null;return a}();e.GridCell=b})(e.vo||(e.vo={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(d){var b=function(){function a(){this.styleNames=[];this.customStyleNames=[];this.css={}}a.prototype.addStyle=function(a){-1==this.styleNames.indexOf(a)&&this.styleNames.push(a)};a.prototype.addCustomStyle=function(a){-1==this.customStyleNames.indexOf(a)&&this.customStyleNames.push(a)};a.prototype.addCSS=function(a){for(var b in a)this.css[b]=a[b]};a.prototype.getClassString=function(){return this.styleNames.join(" ")};a.prototype.getCustomClassString=
function(){return this.customStyleNames.join(" ")};a.prototype.getStyleString=function(){var a="",b;for(b in this.css)a+=b+":"+this.css[b]+";";return a};return a}();d.CellStyle=b})(d.vo||(d.vo={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){(function(f){var b=function(){function a(){}a.getFontStyle=function(c){return 500<c?a.BOLD:a.NORMAL};a.NORMAL="";a.BOLD="Bold";return a}();f.FontStylePDFType=b;b=function(){function a(){}a.prototype.merge=function(a){this.color=this.color||a.color;this.backgroundColor=this.backgroundColor||a.backgroundColor;this.backgroundImage=this.backgroundImage||a.backgroundImage;this.borderColor=this.borderColor||a.borderColor;this.fontSize=this.fontSize||a.fontSize;this.fontWeight=
this.fontWeight||a.fontWeight;this.textAlign=this.textAlign||a.textAlign;this.fontFamily=this.fontFamily||a.fontFamily;this.width=this.width||a.width;this.maxWidth=this.maxWidth||a.maxWidth;this.height=this.height||a.height;this.maxHeight=this.maxHeight||a.maxHeight};a.prototype.clone=function(){var c=new a;c.color=this.color;c.backgroundColor=this.backgroundColor;c.backgroundImage=this.backgroundImage;c.borderColor=this.borderColor;c.fontSize=this.fontSize;c.fontWeight=this.fontWeight;c.textAlign=
this.textAlign;c.fontFamily=this.fontFamily;c.width=this.width;c.maxWidth=this.maxWidth;c.height=this.height;c.maxHeight=this.maxHeight;return c};a.fromItem=function(c,b){void 0===b&&(b=null);var d=new a;if(null==b||null!=b&&b.css("color")!=c.css("color"))d.color=c.css("color");if(null==b||null!=b&&b.css("background-color")!=c.css("background-color"))d.backgroundColor=c.css("background-color");if(null==b||null!=b&&b.css("background-image")!=c.css("background-image"))d.backgroundImage=c.css("background-image");
if(null==b||null!=b&&b.css("border-color")!=c.css("border-color"))d.borderColor=c.css("border-color");if(null==b||null!=b&&b.css("font-size")!=c.css("font-size"))d.fontSize=parseInt(c.css("font-size"));if(null==b||null!=b&&b.css("font-weight")!=c.css("font-weight"))d.fontWeight=c.css("font-weight");if(null==b||null!=b&&b.css("fill")!=c.css("fill"))d.fill=c.css("fill");if(null==b||null!=b&&b.css("text-align")!=c.css("text-align"))d.textAlign=c.css("text-align");if(null==b||null!=b&&b.css("font-family")!=
c.css("font-family"))d.fontFamily=c.css("font-family");if(null==b||null!=b&&b.css("width")!=c.css("width"))d.width=parseInt(c.css("width"));if(null==b||null!=b&&b.css("max-width")!=c.css("max-width"))d.maxWidth=parseInt(c.css("max-width"));if(null==b||null!=b&&b.css("height")!=c.css("height"))d.height=parseInt(c.css("height"));if(null==b||null!=b&&b.css("max-height")!=c.css("max-height"))d.maxHeight=parseInt(c.css("max-height"));return d};a.fromClass=function(c,b,m){void 0===b&&(b=null);void 0===
m&&(m=!0);var k=new uicontrols.UIElement("div");k.addClass(c).hide();c=new uicontrols.UIElement("div");null==b?d.PivotView.stage.container.append(k).append(c):b.append(k).append(c);b=a.fromItem(k,m?c:null);k.remove();c.remove();return b};a.fromString=function(c){var b=new a,d=0;for(c=c.replace(/ /g,";");-1<(d=c.indexOf(";"));)this.defineStyle(c.substring(0,d),b),c=c.substring(d+1);return b};a.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,b,d){return c+c+b+b+d+d});
a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return null==a?"":"rgb("+parseInt(a[1],16)+","+parseInt(a[2],16)+","+parseInt(a[3],16)+")"};a.defineStyle=function(a,b){-1<a.indexOf("background-color")?b.backgroundColor=this.hexToRgb(a.substring(17,a.length)):-1<a.indexOf("background-image")?b.backgroundImage=a.substring(17,a.length):-1<a.indexOf("border-color")?b.borderColor=this.hexToRgb(a.substring(13,a.length)):-1<a.indexOf("color")?b.color=this.hexToRgb(a.substring(6,a.length)):-1<a.indexOf("font-size")?
b.fontSize=parseInt(a.substring(10,a.length)):-1<a.indexOf("fill")?b.fill=this.hexToRgb(a.substring(5,a.length)):-1<a.indexOf("text-align")?b.textAlign=a.substring(11,a.length):-1<a.indexOf("max-width")?b.maxWidth=parseInt(a.substring(10,a.length)):-1<a.indexOf("max-height")?b.maxHeight=parseInt(a.substring(11,a.length)):-1<a.indexOf("width")&&(b.width=parseInt(a.substring(6,a.length)))};a.fromItemToString=function(c,b,d){void 0===b&&(b=null);void 0===d&&(d=null);var e="";null==b&&(b=a.DEFAULT_CSS_PROPERIES);
for(var f=0;f<b.length;f++)if(null==d||null!=d&&c.css(b[f])!=d.css(b[f]))e+=b[f]+":"+c.css(b[f])+";";return e};a.fromClassToString=function(c,b,m,k){void 0===b&&(b=null);void 0===m&&(m=null);void 0===k&&(k=void 0);var f=new uicontrols.UIElement("div");f.addClass(c).hide();void 0===k&&(k=new uicontrols.UIElement("div"),k.hide());null==b?d.PivotView.stage.container.append(f).append(k):b.append(f).append(k);c=a.fromItemToString(f,m,k);f.remove();null!=k&&k.remove();return c};a.parseRGB=function(a){var b=
[],d=a.split("rgb");2<d.length&&(a=d[2]);a=a.replace(/[^\d,]/g,"");a=a.split(",");for(d=0;d<a.length;d++)b[d]=parseInt(a[d]);void 0==b[3]&&(b[3]=1);return b};a.DEFAULT_CSS_PROPERIES="background-color background-image color font-family font-size font-weight text-align padding-top padding-left padding-right padding-bottom border border-top-width border-top-color border-top-style border-bottom-width border-bottom-color border-bottom-style border-left-width border-left-color border-left-style border-right-width border-right-color border-right-style".split(" ");
return a}();f.StyleValueObject=b})(h.vo||(h.vo={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(d){var b=function(){function a(){}a.TITLE="wdr-pivot-title";a.CELL="wdr-cell";a.CELL_EMPTY="wdr-empty";a.SHEET_HEADER="wdr-sheet-header";a.HEADER="wdr-header";a.HEADER_COLUMN="wdr-header-c";a.HEADER_ROW="wdr-header-r";a.MEASURE_HEADER="wdr-measure-header";a.FILTER_HEADER="wdr-filter-header";a.PAGE_HEADER="wdr-page-header";a.PAGE_HEADER_ITEMS="wdr-page-header-items";a.FILTER_ICON="wdr-filter-icon";a.FILTERED="wdr-filtered";a.FILTERED_ICON="wdr-filtered-icon";
a.HEADER_DRAGGABLE="wdr-draggable";a.HEADER_DROPPABLE="wdr-droppable";a.TOTAL="wdr-total";a.GRAND_TOTAL="wdr-grand-total";a.HIERARCHY="wdr-hierarchy-link";a.LINK="wdr-link";a.V_SORT="wdr-v-sort";a.V_SORT_ICON="wdr-v-sort-icon";a.V_SORT_ASC="wdr-v-sort-asc";a.V_SORT_DESC="wdr-v-sort-desc";a.H_SORT="wdr-h-sort";a.H_SORT_ICON="wdr-h-sort-icon";a.H_SORT_ASC="wdr-h-sort-asc";a.H_SORT_DESC="wdr-h-sort-desc";a.SORT_ICON="wdr-sort-icon";a.EXPANDED="wdr-expanded";a.EXPANDED_ICON="wdr-expanded-icon";a.COLLAPSED=
"wdr-collapsed";a.COLLAPSED_ICON="wdr-collapsed-icon";a.LEVEL="wdr-level-";a.DRILLED_UP="wdr-drilled-up";a.DRILLED_DOWN="wdr-drilled-down";a.ICON="wdr-icon";return a}();d.GridStyleName=b})(d.vo||(d.vo={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(d){var b=function(){function a(){}a.LEFT_ICON="left icon";a.MAIN_ICON="main icon";a.RIGHT_ICON="right icon";a.LABEL="label";a.DRILL="drill";a.LINK="link";a.BACKGROUND="backgroud";return a}();d.GridCellElementType=b})(d.vo||(d.vo={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){(function(f){var b=function(){function a(){this._cellMaxHeight=this._cellMaxWidth=this._dataContentHeight=this._dataContentWidth=-1;this.filtersHeight=this.titleHeight=this.scrollLeft=this.scrollTop=this.firstDataColIdx=this.firstDataRowIdx=this.frozenRowsCount=this.frozenColsCount=this.dataRowsCount=this.dataColsCount=this._sheetHeaderHeight=this._sheetHeaderWidth=0;this._scaleTreshold=15E5;this._scaleY=this._scaleX=1;this._colsWidth=[];this._rowsHeight=[];
this._colsWidthPending=[];this._rowsHeightPending=[];this._colsWidthExplicit=[];this._rowsHeightExplicit=[];this._scrollBarSize=a.getScrollBarSize();this._scaleTreshold=a.getScaleTreshold();this._sheetHeaderWidth=a.SHEET_HEADER_WIDTH;this._sheetHeaderHeight=a.SHEET_HEADER_HEIGHT;this.setDefaults()}Object.defineProperty(a.prototype,"gridStartY",{get:function(){return this.titleHeight+this.filtersHeight},enumerable:!0,configurable:!0});a.getScrollBarSize=function(){return utils.browserVersion().isMobile||
utils.OSUtil.isMac?0:utils.browserVersion().isEdge?12:17};a.getScaleTreshold=function(){return utils.detectBrowser().isChrome||utils.detectBrowser().isFirefox?1E7:15E5};a.prototype.clearColSizes=function(a){this._colsWidth.length>a&&(this._colsWidth.length=a);this._colsWidthPending.length>a&&(this._colsWidthPending.length=a);this._colsWidthExplicit.length>a&&(this._colsWidthExplicit.length=a);this._dataContentWidth=-1};a.prototype.clearRowSizes=function(a){this._rowsHeight.length>a&&(this._rowsHeight.length=
a);this._rowsHeightPending.length>a&&(this._rowsHeightPending.length=a);this._rowsHeightExplicit.length>a&&(this._rowsHeightExplicit.length=a);this._dataContentHeight=-1};a.prototype.reset=function(){this._colsWidth.length=0;this._rowsHeight.length=0;this._colsWidthPending.length=0;this._rowsHeightPending.length=0;this._colsWidthExplicit.length=0;this._rowsHeightExplicit.length=0;this._dataContentHeight=this._dataContentWidth=-1;this.filtersHeight=this.titleHeight=this.scrollLeft=this.scrollTop=this.firstDataColIdx=
this.firstDataRowIdx=this.frozenRowsCount=this.frozenColsCount=this.dataRowsCount=this.dataColsCount=0;this._sheetHeaderWidth=a.SHEET_HEADER_WIDTH;this._sheetHeaderHeight=a.SHEET_HEADER_HEIGHT;this._scaleY=this._scaleX=1;this._cellMaxHeight=this._cellMaxWidth=-1;this.setDefaults()};a.prototype.setDefaults=function(){var c=e.grid.vo.StyleValueObject.fromClass(utils.browserVersion().isMobile?"wdr-grid-column-mobile":"wdr-grid-column");a.CELL_WIDTH=isNaN(c.width)?100:Math.max(a.CELL_MIN_WIDTH,c.width);
isNaN(c.maxWidth)||(this._cellMaxWidth=Math.max(a.CELL_MIN_WIDTH,c.maxWidth));c=e.grid.vo.StyleValueObject.fromClass(utils.browserVersion().isMobile?"wdr-grid-row-mobile":"wdr-grid-row");a.CELL_HEIGHT=isNaN(c.height)?30:Math.max(a.CELL_MIN_HEIGHT,c.height);isNaN(c.maxHeight)||(this._cellMaxHeight=Math.max(a.CELL_MIN_HEIGHT,c.maxHeight))};Object.defineProperty(a.prototype,"cellMaxWidth",{get:function(){return this._cellMaxWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"cellMaxHeight",
{get:function(){return this._cellMaxHeight},enumerable:!0,configurable:!0});a.prototype.setScale=function(){var a=this.calcRangeHeight(this.frozenRowsCount,this.frozenRowsCount+this.dataRowsCount);this._scaleY=a>this._scaleTreshold?this._scaleTreshold/a:1;a=this.calcRangeWidth(this.frozenColsCount,this.frozenColsCount+this.dataColsCount);this._scaleX=a>this._scaleTreshold?this._scaleTreshold/a:1};a.prototype.resize=function(a,b,d){void 0===d&&(d=!1);this._layoutWidth=a;this._layoutHeight=b;d&&(this._originalWidth=
a,this._originalHeight=b)};Object.defineProperty(a.prototype,"scrollBarWidth",{get:function(){return this.hasVerticalScroll?this._scrollBarSize:0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scrollBarHeight",{get:function(){return this.hasHorizontalScroll?this._scrollBarSize:0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scrollBarSize",{get:function(){return this._scrollBarSize},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"originalWidth",
{get:function(){return this._originalWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"originalHeight",{get:function(){return this._originalHeight},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutWidth",{get:function(){return this._layoutWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutHeight",{get:function(){return this._layoutHeight},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"availableHeight",
{get:function(){return this._layoutHeight-this.scrollBarHeight-this.gridStartY},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"availableWidth",{get:function(){return this._layoutWidth-this.scrollBarWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataWidth",{get:function(){return this._layoutWidth-this.rowHeadersWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataHeight",{get:function(){return this._layoutHeight-this.colHeadersHeight-
this.gridStartY},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maxColsCount",{get:function(){return this.frozenColsCount+this.dataColsCount},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maxRowsCount",{get:function(){return this.frozenRowsCount+this.dataRowsCount},enumerable:!0,configurable:!0});a.prototype.getRowHeight=function(c){var b=isNaN(this._rowsHeight[c])?a.CELL_HEIGHT:this._rowsHeight[c];return 0<this.cellMaxHeight&&!this.isRowHeightExplicit(c)?
Math.min(this.cellMaxHeight,b):b};a.prototype.setRowHeight=function(c,b,d,e){void 0===d&&(d=!1);void 0===e&&(e=!1);b=Math.max(b,a.CELL_MIN_HEIGHT);if(d){if(isNaN(this._rowsHeightPending[c])||b>this._rowsHeightPending[c])this._rowsHeightPending[c]=b}else this._rowsHeight[c]=b,this._dataContentHeight=-1;e&&(this._rowsHeightExplicit[c]=!0)};a.prototype.resetRowHeight=function(a){this.isRowHeightExplicit(a)&&(delete this._rowsHeight[a],delete this._rowsHeightPending[a],delete this._rowsHeightExplicit[a],
this._dataContentHeight=-1)};a.prototype.getColWidth=function(c){if(-1==c)return this.getSheetHeaderWidth();if(c>=this.maxColsCount)return Math.max(100,a.CELL_WIDTH);var b=isNaN(this._colsWidth[c])?a.CELL_WIDTH:this._colsWidth[c];return 0<this.cellMaxWidth&&!this.isColWidthExplicit(c)?Math.min(this.cellMaxWidth,b):b};a.prototype.setColWidth=function(c,b,d,e){void 0===d&&(d=!1);void 0===e&&(e=!1);b=Math.max(b,a.CELL_MIN_WIDTH);if(d){if(isNaN(this._colsWidthPending[c])||b>this._colsWidthPending[c])this._colsWidthPending[c]=
b}else-1==c?this._sheetHeaderWidth=b:this._colsWidth[c]=b,this._dataContentWidth=-1;e&&(this._colsWidthExplicit[c]=!0)};a.prototype.resetColWidth=function(a){this.isColWidthExplicit(a)&&(delete this._colsWidth[a],delete this._colsWidthPending[a],delete this._colsWidthExplicit[a],this._dataContentWidth=-1)};a.prototype.isColWidthExplicit=function(a){return!0===this._colsWidthExplicit[a]};a.prototype.isRowHeightExplicit=function(a){return!0===this._rowsHeightExplicit[a]};a.prototype.applyPendingSizes=
function(){for(var a=0;a<this._rowsHeightPending.length;a++)if(!this.isRowHeightExplicit(a)){var b=this._rowsHeightPending[a];!isNaN(b)&&b>this.getRowHeight(a)&&this.setRowHeight(a,b)}this._rowsHeightPending.length=0;for(a=-1;a<this._colsWidthPending.length;a++)this.isColWidthExplicit(a)||(b=this._colsWidthPending[a],!isNaN(b)&&b>this.getColWidth(a)&&this.setColWidth(a,b));this._colsWidthPending.length=0};a.prototype.getRowIndexAtPosition=function(a,b){void 0===b&&(b=!1);var d=a/this.dataContentHeight*
(this.layoutHeight/this._scaleY-this.layoutHeight)*this._scaleY;if(1!=this._scaleY&&a+d>=this.dataContentHeight-this.layoutHeight){for(var e=this.maxRowsCount,d=this.dataContentHeight;d>a;)d-=this.getRowHeight(e),e--;return e+1}for(var e=b?0:this.frozenRowsCount,f=0;f<a+d;)f+=this.getRowHeight(e)*this._scaleY,e++;return e};a.prototype.getColIndexAtPosition=function(a,b){void 0===b&&(b=!1);var d=a/this.dataContentWidth*(this.layoutWidth/this._scaleX-this.layoutWidth)*this._scaleX;if(1!=this._scaleX&&
a+d>=this.dataContentWidth-this.layoutWidth){for(var e=this.maxColsCount,d=this.dataContentWidth;d>a;)d-=this.getColWidth(e),e--;return e+1}for(var e=b?0:this.frozenColsCount,f=0;f<a+d;)f+=this.getColWidth(e)*this._scaleX,e++;return e};a.prototype.getVisibleRowsCount=function(a){for(var b=0,d=0,e=this.dataHeight;d<e;)d+=this.getRowHeight(a+b),b++;return b};a.prototype.getVisibleColsCount=function(a){for(var b=0,d=0,e=this.dataWidth;d<e;)d+=this.getColWidth(a+b),b++;return b};Object.defineProperty(a.prototype,
"dataContentWidth",{get:function(){return 0<=this._dataContentWidth?this._dataContentWidth:this._dataContentWidth=1>this._scaleX?this._scaleTreshold:this.calcRangeWidth(this.frozenColsCount,this.frozenColsCount+this.dataColsCount)},enumerable:!0,configurable:!0});a.prototype.calcRangeWidth=function(c,b){if(c>=b)return 0;var d=0,e=0,f=0,h;for(h in this._colsWidth)f=parseInt(h),!isNaN(f)&&!isNaN(this._colsWidth[f])&&f>=c&&f<b&&(e++,d+=this.getColWidth(f));f=Math.min(b,this.maxColsCount);d+=(f-c-e)*
(0<this.cellMaxWidth?Math.min(this.cellMaxWidth,a.CELL_WIDTH):a.CELL_WIDTH);b>=this.maxColsCount&&(d+=(b-this.maxColsCount)*this.getColWidth(b));return d};Object.defineProperty(a.prototype,"dataContentHeight",{get:function(){return 0<=this._dataContentHeight?this._dataContentHeight:this._dataContentHeight=1>this._scaleY?this._scaleTreshold:this.calcRangeHeight(this.frozenRowsCount,this.frozenRowsCount+this.dataRowsCount)},enumerable:!0,configurable:!0});a.prototype.calcRangeHeight=function(c,b){if(c>=
b)return 0;var d=0,e=0,f=0,h;for(h in this._rowsHeight)f=parseInt(h),!isNaN(f)&&!isNaN(this._rowsHeight[f])&&f>=c&&f<b&&(e++,d+=this.getRowHeight(f));return d+=(b-c-e)*(0<this.cellMaxHeight?Math.min(this.cellMaxHeight,a.CELL_HEIGHT):a.CELL_HEIGHT)};a.prototype.clearCache=function(){this._dataContentWidth=this._dataContentHeight=-1};Object.defineProperty(a.prototype,"minDataWidth",{get:function(){for(var c=0,b=this.frozenColsCount+this.dataColsCount,d=this.frozenColsCount;d<b;d++)if(c+=this.getColWidth(d),
c>a.MIN_DATA_WIDTH)return a.MIN_DATA_WIDTH;return c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowHeadersWidth",{get:function(){for(var a=this.getSheetHeaderWidth(),b=0;b<this.frozenColsCount;b++)a+=this.getColWidth(b);return a},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"colHeadersHeight",{get:function(){for(var a=this.getSheetHeaderHeight(),b=0;b<this.frozenRowsCount;b++)a+=this.getRowHeight(b);return a},enumerable:!0,configurable:!0});a.prototype.getSheetHeaderWidth=
function(){return d.model._options.OptionsManager.showHeaders?this._sheetHeaderWidth:0};a.prototype.getSheetHeaderHeight=function(){return d.model._options.OptionsManager.showHeaders?this._sheetHeaderHeight:0};a.prototype.getColIndexWithUndefinedWidth=function(){for(var a=this.frozenColsCount;a<this.dataColsCount;a++)if(!this.isColWidthDefined(a))return a;return null};a.prototype.getColIndicesWithUndefinedWidth=function(a){for(var b=[],d=this.frozenColsCount;d<this.dataColsCount&&(this.isColWidthDefined(d)||
(b.push(d),!(b.length>=a)));d++);return b};a.prototype.isColWidthDefined=function(a,b){void 0===b&&(b=!0);return!isNaN(this._colsWidth[a])||(b?!isNaN(this._colsWidthPending[a]):!1)};Object.defineProperty(a.prototype,"hasHorizontalScroll",{get:function(){return this.dataContentWidth+(this.dataContentHeight>this.dataHeight?this.scrollBarSize:0)>this.dataWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasVerticalScroll",{get:function(){return this.dataContentHeight+(this.dataContentWidth>
this.dataWidth?this.scrollBarSize:0)>this.dataHeight},enumerable:!0,configurable:!0});a.prototype.getRowY=function(a,b){void 0===b&&(b=!1);var m=d.model._options.OptionsManager.showHeaders&&b?this.getSheetHeaderHeight():0;return m+=this.calcRangeHeight(b?0:this.frozenRowsCount,a)};a.prototype.getColX=function(a,b){void 0===b&&(b=!1);var m=d.model._options.OptionsManager.showHeaders&&b?this.getSheetHeaderWidth():0;return m+=this.calcRangeWidth(b?0:this.frozenColsCount,a)};Object.defineProperty(a.prototype,
"canDrawAll",{get:function(){return utils.browserVersion().isEdge||utils.browserVersion().isMsie?!1:500>this.maxColsCount*this.maxRowsCount},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"canDrawSmooth",{get:function(){return utils.browserVersion().isEdge||utils.browserVersion().isMsie?!1:(this.hasVerticalScroll||this.hasHorizontalScroll)&&1E5>this.maxColsCount*this.maxRowsCount},enumerable:!0,configurable:!0});a.prototype.getBoundTop=function(c){void 0===c&&(c=!1);return this.canDrawAll?
this.frozenRowsCount:c?Math.max(this.frozenRowsCount,this.firstDataRowIdx-a.ROWS_OFFSET):Math.max(this.frozenRowsCount,this.firstDataRowIdx)};a.prototype.getBoundLeft=function(c){void 0===c&&(c=!1);return this.canDrawAll?this.frozenColsCount:c?Math.max(this.frozenColsCount,this.firstDataColIdx-a.COLS_OFFSET):Math.max(this.frozenColsCount,this.firstDataColIdx)};a.prototype.getBoundBottom=function(c){void 0===c&&(c=!1);var b=this.getVisibleRowsCount(this.firstDataRowIdx);return this.canDrawAll?this.hasVerticalScroll?
this.maxRowsCount:this.firstDataRowIdx+b:c?Math.min(this.firstDataRowIdx+b+(this.hasVerticalScroll?a.ROWS_OFFSET:0),this.hasVerticalScroll?this.maxRowsCount:Number.MAX_VALUE):this.firstDataRowIdx+b};a.prototype.getBoundRight=function(c){void 0===c&&(c=!1);var b=this.getVisibleColsCount(this.firstDataColIdx);return this.canDrawAll?this.hasHorizontalScroll?this.maxColsCount:this.firstDataColIdx+b:c?Math.min(this.firstDataColIdx+b+(this.hasHorizontalScroll?a.COLS_OFFSET:0),this.hasHorizontalScroll?this.maxColsCount:
Number.MAX_VALUE):this.firstDataColIdx+b};a.prototype.isOnColEdge=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.getBoundRight());return 0<this.scrollLeft&&a>=this.maxColsCount};a.prototype.isOnRowEdge=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.getBoundBottom());return 0<this.scrollTop&&a>=this.maxRowsCount};a.prototype.getColEdgeOffset=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.firstDataColIdx);return this.isOnColEdge()?this.dataContentWidth-this.scrollLeft-this.calcRangeWidth(a,
this.maxColsCount):0};a.prototype.getRowEdgeOffset=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.firstDataRowIdx);return this.isOnRowEdge()?this.dataContentHeight-this.scrollTop-this.calcRangeHeight(a,this.maxRowsCount):0};a.prototype.getRowIdxByRelativePosition=function(a,b){if(a<this.gridStartY)return NaN;if(d.model._options.OptionsManager.showHeaders&&a<this.gridStartY+this.getSheetHeaderHeight())return-1;var m=0,e=this.gridStartY+this.getSheetHeaderHeight();if(a>this.colHeadersHeight)if(m=
this.firstDataRowIdx,e=this.gridStartY+this.colHeadersHeight,b&&m>this.frozenRowsCount){var f=this.scrollTop-this.getRowY(m-1);0<f&&(e-=f,m--)}else b||(a-=this.getRowEdgeOffset());for(;e<a;)e+=this.getRowHeight(m),m++;return m-1};a.prototype.getColIdxByRelativePosition=function(a,b){if(d.model._options.OptionsManager.showHeaders&&a<this.getSheetHeaderWidth())return-1;var m=0,e=this.getSheetHeaderWidth();if(a>this.rowHeadersWidth)if(m=this.firstDataColIdx,e=this.rowHeadersWidth,b&&m>this.frozenColsCount){var f=
this.scrollLeft-this.getColX(m-1);0<f&&(e-=f,m--)}else b||(a-=this.getColEdgeOffset());for(;e<a;)e+=this.getColWidth(m),m++;return m-1};a.prototype.getRelativeRowY=function(a,b,d){void 0===d&&(d=!0);var e=0,f=(d?this.gridStartY:0)+this.getSheetHeaderHeight();a>this.frozenRowsCount&&(e=this.firstDataRowIdx,f=(d?this.gridStartY:0)+this.colHeadersHeight,e<=a&&(f+=b?this.getRowY(this.firstDataRowIdx)-this.scrollTop:this.getRowEdgeOffset()));return f+=this.calcRangeHeight(e,a)};a.prototype.getRelativeColX=
function(a,b){var d=0,e=this.getSheetHeaderWidth();a>this.frozenColsCount&&(d=this.firstDataColIdx,e=this.rowHeadersWidth,d<=a&&(e+=b?this.getColX(this.firstDataColIdx)-this.scrollLeft:this.getColEdgeOffset()));return e+=this.calcRangeWidth(d,a)};a.prototype.isRowHeightDefault=function(a){return isNaN(this._rowsHeight[a])};Object.defineProperty(a.prototype,"freeSpaceRight",{get:function(){return this.scrollLeft+this.dataWidth-this.dataContentWidth-this.scrollBarWidth},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"freeSpaceTop",{get:function(){return this.scrollTop+this.dataHeight-this.dataContentHeight-this.scrollBarHeight},enumerable:!0,configurable:!0});a.ROWS_OFFSET=5;a.COLS_OFFSET=5;a.CELL_WIDTH=100;a.CELL_HEIGHT=30;a.CELL_MIN_WIDTH=50;a.CELL_MIN_HEIGHT=30;a.SHEET_HEADER_HEIGHT=25;a.SHEET_HEADER_WIDTH=25;a.MIN_DATA_WIDTH=200;return a}();f.GridCoords=b})(h.sheet||(h.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(c,b){var d=a.call(this,"div")||this;d._isDirty=!1;d.cell=new HtmlNodeWrapper;d._coords=c;d._getDataFunc=b;d.element.addEventListener("click",function(a){return d.onMouseEvent(a)});return d}__extends(c,a);c.prototype.calculateSizes=function(a){void 0===a&&(a=!1);for(var c=!1,b=this.element.children,d=0;d<b.length;d++)for(var e=b.item(d),c=this.updateRowHeight(e,!0)||c,e=e.children,f=0;f<e.length;f++)c=this.updateColWidth(e.item(f),
a)||c;this._isDirty=c};Object.defineProperty(c.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!0,configurable:!0});c.prototype.updateRowHeight=function(a,c){void 0===c&&(c=!1);if(null!=this._coords){var b=!1,d=parseInt(a.getAttribute("data-r"));if(isNaN(d)||this._coords.isRowHeightExplicit(d))return!1;var e=a.clientHeight;this._coords.getRowHeight(d)<e?(this._coords.setRowHeight(d,Math.round(e+1),c),b=!0):e<=f.GridCoords.CELL_HEIGHT&&this._coords.setRowHeight(d,f.GridCoords.CELL_HEIGHT,
c);return b}};c.prototype.updateColWidth=function(a,c){void 0===c&&(c=!1);if(null!=this._coords){var b=!1,d=parseInt(a.getAttribute("data-c"));if(isNaN(d)||a.classList.contains(e.vo.GridStyleName.SHEET_HEADER)&&0<=d||this._coords.isColWidthExplicit(d))return!1;var s=a.clientWidth;this._coords.getColWidth(d)<s?(this._coords.setColWidth(d,Math.round(s+2),c),b=!0):-1!=d&&s<=f.GridCoords.CELL_WIDTH&&this._coords.setColWidth(d,f.GridCoords.CELL_WIDTH,c);return b}};c.prototype.createCell=function(a,c,b){void 0===
b&&(b=!1);var f=this._getDataFunc?this._getDataFunc(a,c):null;this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);var s=a>=this._coords.maxRowsCount||c>=this._coords.maxColsCount;!f&&s&&this.cell.addClass(e.vo.GridStyleName.CELL_EMPTY);f&&f.isRowHeader&&(this.cell.addClass(e.vo.GridStyleName.HEADER),this.cell.addClass(e.vo.GridStyleName.HEADER_ROW),this.cell.addClass(e.vo.GridStyleName.LEVEL+f.level));f&&f.isColumnHeader&&(this.cell.addClass(e.vo.GridStyleName.HEADER),
this.cell.addClass(e.vo.GridStyleName.HEADER_COLUMN));f&&f.isMeasureHeader&&this.cell.addClass(e.vo.GridStyleName.MEASURE_HEADER);f&&f.isTotal&&this.cell.addClass(e.vo.GridStyleName.TOTAL);f&&f.isGrandTotal&&this.cell.addClass(e.vo.GridStyleName.GRAND_TOTAL);f&&f.expanded&&(this.cell.addClass(e.vo.GridStyleName.EXPANDED),this.cell.text+=this.createIcon(e.vo.GridStyleName.EXPANDED_ICON,d.model._labels.Labels.TOOLTIPS_COLLAPSE_ICON));f&&f.collapsed&&(this.cell.addClass(e.vo.GridStyleName.COLLAPSED),
this.cell.text+=this.createIcon(e.vo.GridStyleName.COLLAPSED_ICON,d.model._labels.Labels.TOOLTIPS_EXPAND_ICON));this.cell.text+=f?f.label:"";f&&(f.drilledUp||f.drilledDown)&&(this.cell.text+='<span class="'+e.vo.GridStyleName.HIERARCHY+'" title="'+(f.drilledUp?d.model._labels.Labels.TOOLTIPS_DRILL_DOWN:d.model._labels.Labels.TOOLTIPS_DRILL_UP)+'">'+f.getDrillLabel()+"</span>",f.drilledUp&&this.cell.addClass(e.vo.GridStyleName.DRILLED_UP),f.drilledDown&&this.cell.addClass(e.vo.GridStyleName.DRILLED_DOWN));
f&&f.isColumnHeader&&(f.sortable&&!f.isEmpty&&(this.cell.text=f.sortedAsc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.V_SORT_ASC],d.model._labels.Labels.TOOLTIPS_SORTED_ASC):f.sortedDesc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.V_SORT_DESC],d.model._labels.Labels.TOOLTIPS_SORTED_DESC):this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.V_SORT_ICON],d.model._labels.Labels.TOOLTIPS_SORT_ICON)),f.isEmpty&&
this.cell.addClass(e.vo.GridStyleName.CELL_EMPTY),f.isEmpty||this.cell.addClass(e.vo.GridStyleName.V_SORT));f&&f.isRowHeader&&(f.sortable&&!f.isEmpty&&(this.cell.text=f.sortedAsc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.H_SORT_ASC],d.model._labels.Labels.TOOLTIPS_SORTED_ASC):f.sortedDesc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.H_SORT_DESC],d.model._labels.Labels.TOOLTIPS_SORTED_DESC):this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,
e.vo.GridStyleName.H_SORT_ICON],d.model._labels.Labels.TOOLTIPS_SORT_ICON)),this.cell.addClass(e.vo.GridStyleName.H_SORT));this.cell.attr["data-c"]=c;this.cell.attr["data-r"]=a;0!=c||d.model._options.OptionsManager.showHeaders||(this.cell.style.height=this._coords.getRowHeight(a)+"px");if(f&&f.style){for(var r=0;r<f.style.styleNames.length;r++)this.cell.addClass(f.style.styleNames[r]);var r=f.style.css,n;for(n in r)this.cell.style[n]=r[n]}this.setCellSize(this.cell,a,c,f&&f.isValue);b&&(this.cell.style.top=
this._coords.getRowY(a,a<this._coords.frozenRowsCount)+"px",this.cell.style.left=this._coords.getColX(c,c<this._coords.frozenColsCount)+"px");null==e.vo.GridCell.customizeCellFunction||s||(null==f&&(f=new e.vo.GridCell,f.rowIdx=a,f.colIdx=c),e.vo.GridCell.customizeCellFunction(this.cell.node,f.toObject()));return this.cell};c.prototype.isCellEmpty=function(a,c){if(this._getDataFunc){var b=this._getDataFunc(a,c);return utils.nullOrUndefined(b)||utils.nullOrEmpty(b.label)}return!0};c.prototype.setCellSize=
function(a,c,b,d){void 0===d&&(d=!1);this._coords.isColWidthExplicit(b)||this._coords.isRowHeightExplicit(c)?(a.style.width=this._coords.getColWidth(b)+"px",a.style.height=this._coords.getRowHeight(c)+"px"):(a.style["min-width"]=this._coords.getColWidth(b)+"px",a.style[d?"height":"min-height"]=this._coords.getRowHeight(c)+"px");!this._coords.isColWidthExplicit(b)&&0<this._coords.cellMaxWidth&&(a.style["max-width"]=this._coords.cellMaxWidth+"px");!this._coords.isRowHeightExplicit(c)&&0<this._coords.cellMaxHeight&&
(a.style["max-height"]=this._coords.cellMaxHeight+"px")};c.prototype.createIcon=function(a,c){void 0===c&&(c=null);a instanceof Array&&(a=a.join(" "));var b='<i class="'+e.vo.GridStyleName.ICON+" "+a+'"';c&&(b+='title="'+c+'"');return b+"></i>"};c.prototype.createSheetHeaderCell=function(){this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);this.cell.addClass(e.vo.GridStyleName.SHEET_HEADER);this.cell.style.width=this._coords.getSheetHeaderWidth()+"px";this.cell.style.height=
this._coords.getSheetHeaderHeight()+"px";return this.cell};c.prototype.createColumnSheetHeaderCell=function(a,c){void 0===c&&(c=!1);this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);this.cell.addClass(e.vo.GridStyleName.SHEET_HEADER);this.cell.text+=a+1;this.cell.style.width=this._coords.getColWidth(a)+"px";0<this._coords.cellMaxWidth&&!this._coords.isColWidthExplicit(a)&&(this.cell.style["max-width"]=this._coords.cellMaxWidth+"px");this.cell.style.height=this._coords.getSheetHeaderHeight()+
"px";this.cell.attr["data-r"]=-1;this.cell.attr["data-c"]=a;c&&(this.cell.style.left=this._coords.getColX(a,!1)+"px");return this.cell};c.prototype.createRowSheetHeaderCell=function(a,c){void 0===c&&(c=!1);this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);this.cell.addClass(e.vo.GridStyleName.SHEET_HEADER);this.cell.text+=a+1;this.cell.style["min-width"]=this._coords.getSheetHeaderWidth()+"px";this.cell.style.height=this._coords.getRowHeight(a)+"px";this.cell.style["line-height"]=
this._coords.getRowHeight(a)-2+"px";0<this._coords.cellMaxHeight&&!this._coords.isRowHeightExplicit(a)&&(this.cell.style["max-height"]=this._coords.cellMaxHeight+"px");this.cell.attr["data-r"]=a;this.cell.attr["data-c"]=-1;c&&(this.cell.style.top=this._coords.getRowY(a,!1)+"px");return this.cell};c.prototype.getCellByPosition=function(a,c){var b=this._coords.getColIndexAtPosition(a)-1,d=this._coords.getRowIndexAtPosition(c)-1,f=null;null!=this._getDataFunc&&(f=this._getDataFunc(d,b));null==f&&(f=
new e.vo.GridCell,f.rowIdx=d,f.colIdx=b);return f};c.prototype.getCellByElement=function(a){for(;!a.hasClass(e.vo.GridStyleName.CELL);)if(a=a.parent,null==a)return null;var c=parseInt(a.attr("data-c"));a=parseInt(a.attr("data-r"));var b=null;null!=this._getDataFunc&&(b=this._getDataFunc(a,c));null==b&&(b=new e.vo.GridCell,b.rowIdx=a,b.colIdx=c);return b};c.prototype.onMouseEvent=function(a){var c=uicontrols.UIElement.convert(a.target),b=this.getCellByElement(c)||this.getCellByPosition(a.offsetX,a.offsetY),
d;switch(a.type){case "click":d=new e.GridClickEvent(b,c)}d&&this.dispatch(d)};c.prototype.dispose=function(){a.prototype.dispose.call(this);this._coords=this._getDataFunc=null};return c}(uicontrols.UIElement);f.AbstractSheet=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(e){var b=function(a){function c(c,b){var d=a.call(this,c,b)||this;d.SWITCH_TO_SMOOTH_DELAY=1E3;d._isSmooth=!1;d.addClass("wdr-sheet-canvas");d._scrollPane=new ScrollPane;d.addChild(d._scrollPane);d._bounds=new e.Bounds;d._boundsSmooth=new e.Bounds;return d}__extends(c,a);c.prototype.draw=function(){};c.prototype.drawSmooth=function(){};Object.defineProperty(c.prototype,"isSmooth",{get:function(){return this._isSmooth},set:function(a){this._isSmooth!=
a&&(this._isSmooth=a,this.dispatchWith(this.isSmooth?c.EVENT_SWITCHED_TO_SMOOTH:c.EVENT_SWITCHED_TO_SIMPLE))},enumerable:!0,configurable:!0});c.prototype.switchToSimple=function(){!1!=this.isSmooth&&(this._bounds.reset(),this._boundsSmooth.reset(),this.draw())};c.prototype.clearBounds=function(){this._bounds.reset()};c.prototype.clearBoundsSmooth=function(){this._boundsSmooth.reset()};c.prototype.clearAllBounds=function(){this.clearBounds();this.clearBoundsSmooth()};c.prototype.calculateSizes=function(a){void 0===
a&&(a=!1);for(var c=!1,b=this._scrollPane.content.element.children,d=0;d<b.length;d++)for(var e=b.item(d),c=this.updateRowHeight(e,a)||c,e=e.children,f=0;f<e.length;f++)var h=e.item(f),c=this.updateColWidth(h,a)||c;this._isDirty=c};c.prototype.calculateSizesSmooth=function(a){void 0===a&&(a=!1);for(var c=!1,b=this.scrollPane.placeholder.element.children,d=0;d<b.length;d++)var e=b.item(d),c=this.updateColWidth(e,a)||c,c=this.updateRowHeight(e,a)||c;this._isDirty=c};c.prototype.setContentSize=function(){this._scrollPane.content.width=
this._width-this._coords.scrollBarWidth;this._scrollPane.content.height=this._height-this._coords.scrollBarHeight};Object.defineProperty(c.prototype,"scrollPane",{get:function(){return this._scrollPane},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"width",{get:function(){return this._width},set:function(a){this._width!=a&&(this.element.style.minWidth=a+"px",this._width=a,this._scrollPane.width=a)},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"height",{get:function(){return this._height},
set:function(a){this._height!=a&&(this.element.style.height=a+"px",this._height=a,this._scrollPane.height=a)},enumerable:!0,configurable:!0});c.prototype.onMouseEvent=function(a){var c=null,b=null;a.target==this.scrollPane.placeholder.element?c=this.getCellByPosition(a.offsetX,a.offsetY):(b=uicontrols.UIElement.convert(a.target),c=this.getCellByElement(b)||this.getCellByPosition(a.offsetX,a.offsetY));if(null!=c&&null!=b){var e=d.vo.GridCellElementType.BACKGROUND;b.hasClass(d.vo.GridStyleName.HIERARCHY)?
e=d.vo.GridCellElementType.DRILL:b.hasClass(d.vo.GridStyleName.EXPANDED_ICON)||b.hasClass(d.vo.GridStyleName.COLLAPSED_ICON)?e=d.vo.GridCellElementType.LEFT_ICON:b.hasClass(d.vo.GridStyleName.SORT_ICON)?e=d.vo.GridCellElementType.RIGHT_ICON:b.hasClass(d.vo.GridStyleName.LINK)&&(e=d.vo.GridCellElementType.LINK);c.activeElementType=e}var f;switch(a.type){case "click":f=new d.GridClickEvent(c,b);break;case "mousedown":f=new d.GridMouseDownEvent(c);break;case "mouseup":f=new d.GridMouseUpEvent(c);break;
case "mousemove":f=new d.GridMouseMoveEvent(c)}f&&this.dispatch(f)};c.EVENT_SWITCHED_TO_SMOOTH="switched_to_smooth";c.EVENT_SWITCHED_TO_SIMPLE="switched_to_simple";return c}(e.AbstractSheet);e.BaseSheet=b})(d.sheet||(d.sheet={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(d){var b=function(){function a(a,b,d,e){void 0===a&&(a=0);void 0===b&&(b=0);void 0===d&&(d=0);void 0===e&&(e=0);this.left=a;this.top=b;this.right=d;this.bottom=e}a.prototype.set=function(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom};a.prototype.reset=function(){this.bottom=this.right=this.top=this.left=0};a.prototype.contains=function(a){return this.left<=a.left&&this.top<=a.top&&this.right>=a.right&&this.bottom>=a.bottom};
a.prototype.clone=function(){return new a(this.left,this.top,this.right,this.bottom)};return a}();d.Bounds=b})(d.sheet||(d.sheet={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(c){function b(a){void 0===a&&(a=null);var d=c.call(this,"div","wdr-auto-calculation-bar")||this;d._listOfAggregations=["average","count","sum"];d.aggregationLables={};d._coordinates={right:-1E3,bottom:1E3};d._aggregationsElements=new utils.AssociativeArray;d._listOfAggregations=null==a?d._listOfAggregations:a;d.initAggregationLabels();d.setControls();return d}__extends(b,c);b.prototype.initAggregationLabels=function(){this.aggregationLables.average=
d.model._labels.Labels.AVERAGE_CAPTION;this.aggregationLables.sum=d.model._labels.Labels.SUM_CAPTION;this.aggregationLables.count=d.model._labels.Labels.COUNT_CAPTION};Object.defineProperty(b.prototype,"aggregationsElements",{get:function(){return this._aggregationsElements},enumerable:!0,configurable:!0});b.prototype.setControls=function(){this._relativeContainer=new uicontrols.UIElement("div");this._relativeContainer.css("position","relative");this.addChild(this.relativeContainer);this._absoluteContainer=
new uicontrols.UIElement("div","wdr-auto-calculation-bar-conainer");this.absoluteContainer.css("position","absolute");this._relativeContainer.addChild(this.absoluteContainer);for(var c=null,b=0;b<this.listOfAggregations.length;b++)c=new a,c.setAggregationLabel(this.aggregationLables[this.listOfAggregations[b]]),this.absoluteContainer.addChild(c),this.aggregationsElements.addItem(this.listOfAggregations[b],c)};b.prototype.isCoordinationChanged=function(){return-1E3!=this._coordinates.right&&1E3!=this._coordinates.bottom};
b.prototype.setValue=function(a,c){this.aggregationsElements.getItem(a).setAggregationResult(c)};b.prototype.hideAggregationElement=function(a){this.aggregationsElements.getItem(a).hide()};Object.defineProperty(b.prototype,"absoluteContainer",{get:function(){return this._absoluteContainer},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"relativeContainer",{get:function(){return this._relativeContainer},enumerable:!0,configurable:!0});b.prototype.makeAggregationsVissible=function(){for(var a=
null,c=0;c<this.aggregationsElements.length;c++)a=this.aggregationsElements.getItemAt(c),a.visible||a.show()};b.prototype.isAllAggregationsHidden=function(){for(var a=0;a<this.aggregationsElements.length;a++)if(this.aggregationsElements.getItemAt(a).visible)return!1;return!0};Object.defineProperty(b.prototype,"coordinates",{get:function(){return this._coordinates},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"listOfAggregations",{get:function(){return this._listOfAggregations},
enumerable:!0,configurable:!0});b.prototype.resetCoordinates=function(){this._coordinates={right:-1E3,bottom:1E3}};b.prototype.clear=function(){for(;0<this.aggregationsElements.length;)this.aggregationsElements.getItemAt(0).dispose(),this.aggregationsElements.removeItemAt(0);this.dispose()};return b}(uicontrols.UIElement);e.AutoCalculationBar=b;var a=function(a){function b(){var d=a.call(this,"div","wdr-auto-calculation-bar-content")||this;d.display="inline-block";d.setControls();return d}__extends(b,
a);b.prototype.setControls=function(){this.aggregationLabel=new uicontrols.UIElement("div","wdr-auto-calculation-bar-content-text");this.addChild(this.aggregationLabel);this.aggregationResult=new uicontrols.UIElement("div","wdr-auto-calculation-bar-content-results");this.addChild(this.aggregationResult)};b.prototype.show=function(){this.element.style.display=this.display};b.prototype.setAggregationLabel=function(a){this.aggregationLabel.text(a+":")};b.prototype.setAggregationResult=function(a){this.aggregationResult.text(a)};
return b}(uicontrols.UIElement);e.AutoCalculationBarContent=a})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(){function a(){this._generalMeasure=null}a.prototype.recalculateAutoCalculationBar=function(a,b){var e=0;this.generalMeasure=this.findGeneralMeasure(b);var k=null==this.generalMeasure?d.model.format.FormatManager.getFormat("").clone():this.generalMeasure.getFormat().clone();k.decimalPlaces=k.decimalPlaces==d.model.format.FormatManager.getDefaultFormat().decimalPlaces?2:k.decimalPlaces;for(var f=0;f<a.listOfAggregations.length;f++)e=
this.calculateSelectedCells(a.listOfAggregations[f],b),0!=e?a.setValue(a.listOfAggregations[f],this.getFormatedValue(e,a.listOfAggregations[f],k.clone())):a.hideAggregationElement(a.listOfAggregations[f]);this.generalMeasure=null};a.prototype.getFormatedValue=function(a,b,e){var k="count"==b||null!=this.generalMeasure&&d.data_.consts.AggregationName.isCount(this.generalMeasure.aggregation),f="count"!=b&&null!=this.generalMeasure&&d.data_.consts.AggregationName.isPercent(this.generalMeasure.aggregation),
h=null!=this.generalMeasure&&this.generalMeasure.type==d.data_.types.MeasureType.TIME&&d.data_.consts.AggregationName.validForTimeFormatting(this.generalMeasure.aggregation);e.isPercent="count"==b?!1:e.isPercent;e.currencySymbol=null!=this.generalMeasure&&this.generalMeasure.aggregation==d.data_.consts.AggregationName.INDEX?"":e.currencySymbol;return h&&!isNaN(a)&&"count"!=b?utils.StringUtils.toTime(a):utils.NumberFormatter.format(a,e,k,f)};a.prototype.calculateSelectedCells=function(a,b){switch(a){case "sum":return this.calculateSelectedCellsSum(b);
case "average":return this.calculateSelectedCellsAverage(b);case "count":return this.calculateSelectedCellsCount(b)}return 0};a.prototype.calculateSelectedCellsSum=function(a){for(var b=0,d=0;d<a.length;d++)b+=a[d].isValue&&!isNaN(a[d].value)&&this.isNumericType(a[d])?a[d].value:0;return b};a.prototype.calculateSelectedCellsAverage=function(a){for(var b=0,d=0,e=0;e<a.length;e++)a[e].isValue&&!isNaN(a[e].value)&&this.isNumericType(a[e])&&(b+=a[e].value,d++);return 0==d?0:b/d};a.prototype.calculateSelectedCellsCount=
function(a){for(var b=0,d=0;d<a.length;d++)(a[d].isValue&&!isNaN(a[d].value)||a[d].isDrillThrough&&""!=a[d].label)&&b++;return b};a.prototype.findGeneralMeasure=function(a){for(var b=null,d=0;d<a.length;d++)if(this.isNumericType(a[d])&&null==b&&!utils.nullOrUndefined(a[d].measure))b=a[d].measure;else if(this.isNumericType(a[d])&&null!=b&&b.uniqueName!=a[d].measure.uniqueName){b=null;break}return b};a.prototype.isNumericType=function(a){return a.isValue&&null!=a.measure&&(null==a.member||d.data_.types.MeasureType.COUNT!=
a.measure.type)&&d.data_.types.MeasureType.DATE!=a.measure.type&&d.data_.types.MeasureType.DATETIME!=a.measure.type||!isNaN(a.value)};Object.defineProperty(a.prototype,"generalMeasure",{get:function(){return this._generalMeasure},set:function(a){this._generalMeasure=a},enumerable:!0,configurable:!0});return a}();e.AutoCalculationManager=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(d){var b=function(){function a(a){this.frozenCells=[];this.data=[];this.coords=a}a.prototype.reset=function(){this.data=[];this.frozenCells=[]};a.prototype.setData=function(a,b,d,e){void 0===e&&(e=!1);d.rowIdx=a;d.colIdx=b;if(b<this.coords.frozenColsCount||e)null==this.data[a]&&(this.data[a]=[]),this.data[a][b]=d};a.prototype.setDataFrozen=function(a,b,d){null==this.frozenCells[a]&&(this.frozenCells[a]=[]);this.frozenCells[a][b]=d};a.prototype.positionFrozenCells=
function(a){if(null!=this.frozenCells[a]){for(var b=[],d=!1,e=0;e<this.frozenCells[a].length;e++){if(null!=this.frozenCells[a][e]||!d){var f=this.frozenCells[a][e];null!=f&&(f.colIdx=b.length);b.push(f)}null!=this.frozenCells[a][e]&&(d=!0)}this.frozenCells[a]=b}};a.prototype.cellExists=function(a,b){void 0===this.data[a]&&(this.data[a]=[]);return void 0!==this.data[a][b]};a.prototype.getData=function(a,b,d){void 0===d&&(d=!0);if(!1==this.cellExists(a,b)){var e=this.getDataFunction(a,b);null!=e&&(e.rowIdx=
a,e.colIdx=b);if(d)this.data[a][b]=e;else return e}return null===this.data[a][b]?void 0:this.data[a][b]};a.prototype.clearDataRow=function(a){if(a<this.coords.frozenRowsCount)for(var b=this.data[a]?this.data[a].length:0,d=1;d<b;d++)this.data[a]&&(this.data[a][d]=null);else this.data[a]&&(this.data[a]=null)};a.prototype.clearDataColumn=function(a){for(var b=this.data.length,d=0;d<b;d++)0==a&&d<this.coords.frozenRowsCount||this.data[d]&&(this.data[d][a]=null)};a.prototype.getDataFrozen=function(a,b){return this.frozenCells[a]&&
this.frozenCells[a][b]?this.frozenCells[a][b]:null};a.prototype.clearCell=function(a,b){null!=this.data[a]&&(this.data[a][b]=this.getData(a,b))};a.prototype.dispose=function(){this.reset();this.getDataFunction=null};return a}();d.SheetDataProvider=b})(d.sheet||(d.sheet={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(){function c(a){var c=this;this._to=this._from=null;this._isFocused=!1;this.listOfSelectedCells=new utils.AssociativeArray;this._rowsSelectedSet={};this._columnsSelectedSet={};this.focusHandler=function(){c._isFocused=!0};this.blurHandler=function(){c._isFocused=!1};this.keydownHandler=function(a){return c.onKeyDown(a)};this.gridLayout=a;this.gridLayout.element.setAttribute("tabindex","0");this.gridLayout.element.addEventListener("focus",
this.focusHandler);this.gridLayout.element.addEventListener("focusin",this.focusHandler);this.gridLayout.element.addEventListener("blur",this.blurHandler);this.gridLayout.element.addEventListener("focusout",this.blurHandler);this.coords=this.gridLayout.coords;this.selectionCanvas=new e.SelectionCanvas(this,this.gridLayout);this.selectedCellsCalculator=new e.AutoCalculationManager;this.keyboardListener=utils.KeyboardListener.getInstance();this.keyboardListener.addEventListener(utils.KeyboardEvent.KEY_DOWN,
this.keydownHandler)}c.prototype.dispose=function(){this.gridLayout.element&&this.gridLayout.element.removeEventListener("focus",this.focusHandler);this.gridLayout.element&&this.gridLayout.element.removeEventListener("blur",this.blurHandler);null!=this.listOfSelectedCells&&0<this.listOfSelectedCells.length&&this.clearMultySelect();this.keyboardListener.removeEventListener(utils.KeyboardEvent.KEY_DOWN,this.keydownHandler);this.keyboardListener=this.gridLayout=null;this.selectionCanvas.dispose()};c.prototype.draw=
function(){this.selectionCanvas.redraw()};c.prototype.preDraw=function(a,c){this.runSelect(a,c);this.draw()};c.prototype.preDrawHeader=function(a,c){this.selectionCanvas.isCtrlPressed||(null==this.selectionCanvas.selectedHeader&&(this.selectionCanvas.selectedHeader=new e.SelectionCanvasElement(this.gridLayout)),this.selectionCanvas.selectedHeader.cellKey=a.toString()+"|"+c.toString(),this.draw())};c.prototype.select=function(a,c){this.deselect();this._from=a;this._to=c;this.preDraw(a,c)};c.prototype.runSelect=
function(a,c){null!=this.selectionCanvas.selectedHeader&&(this.selectionCanvas.selectedHeader.remove(),this.selectionCanvas.selectedHeader=null);if(!this.selectionCanvas.isCtrlPressed||this.isCoordinatesValid(a,c))if(this.listOfSelectedCells.keyExists(this.composeCellKey(a,c)))b=this.listOfSelectedCells.getItem(this.composeCellKey(a,c)),null!=b.rowOverlay&&delete this._rowsSelectedSet[a.y.toString()],null!=b.colOverlay&&delete this._columnsSelectedSet[a.x.toString()],b.remove(),this.listOfSelectedCells.removeItem(this.composeCellKey(a,
c));else if(null!=a&&null!=c){var b=new e.SelectionCanvasElement(this.gridLayout);b.cellKey=this.composeCellKey(a,c);this.listOfSelectedCells.addItem(b.cellKey,b)}};c.prototype.clearMultySelect=function(){for(;0<this.listOfSelectedCells.length;)this.listOfSelectedCells.getItemAt(0).remove(),this.listOfSelectedCells.removeItemAt(0);this._rowsSelectedSet={};this._columnsSelectedSet={}};c.prototype.composeCellKey=function(a,c){return a.x.toString()+"|"+a.y.toString()+"|"+c.x.toString()+"|"+c.y.toString()};
c.prototype.decomposeCellKey=function(a){a=a.split("|");var c={};4==a.length?(c.from=new d._view.grid.sheet.Point(parseInt(a[0]),parseInt(a[1])),c.to=new d._view.grid.sheet.Point(parseInt(a[2]),parseInt(a[3]))):2==a.length&&(c.row=parseInt(a[0]),c.column=parseInt(a[1]));return c};c.prototype.isArea=function(a){a=this.decomposeCellKey(a.cellKey);return!a.from.equals(a.to)};c.prototype.isPointInArea=function(a){return this._rowsSelectedSet.hasOwnProperty(a.y.toString())&&this._columnsSelectedSet.hasOwnProperty(a.x.toString())&&
this._rowsSelectedSet[a.y.toString()]==e.CellType.AREA&&this._columnsSelectedSet[a.x.toString()]==e.CellType.AREA};c.prototype.isCoordinatesValid=function(a,c){return null==a||null==c||!a.equals(c)||this.isPointInArea(a)||this.isPointInArea(c)||0>a.x*a.y||0>c.x*c.y?!1:!0};c.prototype.selectAll=function(){this.select(new a(0,0),new a(this.coords.getBoundRight(),this.coords.getBoundBottom()))};c.prototype.selectTo=function(a){if(null!=this._from&&!this._from.equals(a)){var c=this._from;this.deselect();
this._from=c;this._to=a;this.preDraw(c,a)}};c.prototype.selectRow=function(a){this.deselect();this.preDrawHeader(a,-1)};c.prototype.selectColumn=function(a){this.deselect();this.preDrawHeader(-1,a)};c.prototype.deselect=function(){!this.selectionCanvas.isCtrlPressed&&0<this.listOfSelectedCells.length&&this.clearMultySelect();null!=this.selectionCanvas.selectedHeader&&(this.selectionCanvas.selectedHeader.remove(),this.selectionCanvas.selectedHeader=null);this._to=this._from=null};c.prototype.clear=
function(){this.deselect();this.draw()};c.prototype.isAutoCalculationBarAvailable=function(){return 1<this.selectedCells.length||null!=this.selectedCells.getItemAt(0)&&this.isArea(this.selectedCells.getItemAt(0))};Object.defineProperty(c.prototype,"selectedCells",{get:function(){return this.listOfSelectedCells},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"to",{get:function(){return this._to},set:function(a){this._to=a},enumerable:!0,configurable:!0});c.prototype.fromCol=function(a,
c){return a&&c?Math.min(a.x,c.x):-1};c.prototype.toCol=function(a,c){return a&&c?Math.max(a.x,c.x):-1};c.prototype.fromRow=function(a,c){return a&&c?Math.min(a.y,c.y):-1};c.prototype.toRow=function(a,c){return a&&c?Math.max(a.y,c.y):-1};c.prototype.move=function(a,c,b){void 0===c&&(c=!1);void 0===b&&(b=!1);switch(a){case 37:this.moveLeft(c,b);break;case 38:this.moveUp(c,b);break;case 39:this.moveRight(c,b);break;case 40:this.moveDown(c,b)}};Object.defineProperty(c.prototype,"rowsSelectedSet",{get:function(){return this._rowsSelectedSet},
enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"columnsSelectedSet",{get:function(){return this._columnsSelectedSet},enumerable:!0,configurable:!0});c.prototype.moveLeft=function(a,c){void 0===c&&(c=!1);this.moveHorizontal(-1,c)};c.prototype.moveRight=function(a,c){void 0===c&&(c=!1);this.moveHorizontal(1,c)};c.prototype.moveUp=function(a,c){void 0===c&&(c=!1);this.moveVertical(-1,c)};c.prototype.moveDown=function(a,c){void 0===c&&(c=!1);this.moveVertical(1,c)};c.prototype.moveHorizontal=
function(c,b){void 0===b&&(b=!1);if(1==this.listOfSelectedCells.length){var d=this.decomposeCellKey(this.listOfSelectedCells.getItemAt(0).cellKey),e=d.from,f=d.to,d=b?f.x:e.x,h=b?f.x:e.x,d=Math.max(0,Math.min(d+c,this.coords.maxColsCount-1)),n=0;d<this.coords.firstDataColIdx?(n=Math.max(d,this.coords.frozenColsCount),this.gridLayout.scrollToColumn(n)):d>=this.coords.getVisibleColsCount(this.coords.firstDataColIdx)+this.coords.firstDataColIdx-1&&(n=this.coords.firstDataColIdx+(d-h),this.gridLayout.scrollToColumn(n+
1));f=b?f.y:e.y;h=d;this.select(new a(b?e.x:d,e.y),new a(h,f))}};c.prototype.moveVertical=function(c,b){void 0===b&&(b=!1);if(1==this.listOfSelectedCells.length){var d=this.decomposeCellKey(this.listOfSelectedCells.getItemAt(0).cellKey),e=d.from,f=d.to,d=b?f.y:e.y,h=b?f.y:e.y,d=Math.max(0,Math.min(d+c,this.coords.maxRowsCount-1)),n=0;d<this.coords.firstDataRowIdx?(n=Math.max(d,this.coords.frozenRowsCount),this.gridLayout.scrollToRow(n)):d>=this.coords.getVisibleRowsCount(this.coords.firstDataRowIdx)+
this.coords.firstDataRowIdx-1&&(n=this.coords.firstDataRowIdx+(d-h),this.gridLayout.scrollToRow(n+1));h=d;f=b?f.x:e.x;this.select(new a(e.x,b?e.y:d),new a(f,h))}};Object.defineProperty(c.prototype,"autoCalculationManager",{get:function(){return this.selectedCellsCalculator},enumerable:!0,configurable:!0});c.prototype.onKeyDown=function(a){if(null!=this.keyboardListener&&(this._isFocused||this.keyboardListener.isFocused)){var c=a.ctrlKey||a.metaKey;switch(a.keyCode){case 32:c||this.gridLayout.triggerCellAction(this.gridLayout.selectedCells[0]);
break;case 65:c&&this.selectAll();break;case 37:case 38:case 39:case 40:this.move(a.keyCode,a.ctrlKey,a.shiftKey),a.originalEvent.preventDefault()}!c||a.altKey||a.shiftKey||this.keyboardListener.isFocused||this.copy()}};c.prototype.copy=function(){var a="";if(0<this.listOfSelectedCells.length)for(var c=null,c=null,b=0;b<this.listOfSelectedCells.length;b++)c=this.listOfSelectedCells.getItemAt(b),null!=c.cellElement&&(c=this.decomposeCellKey(c.cellKey),a+=this.copyElement(c.from,c.to),b<this.listOfSelectedCells.length-
1&&(a+="\n"));0<a.length&&this.keyboardListener.copy(a)};c.prototype.copyElement=function(a,c){var b="";if(null==a||null==c)return b;var d,e=Math.min(a.x,c.x),f=Math.max(a.x,c.x);d=Math.min(a.y,c.y);for(var h=Math.max(a.y,c.y),p=d;p<=h;p++){for(var q=e;q<=f;q++){q>e&&(b+="\t");d=this.gridLayout.getCell(p,q,!0,!0);if(null==d&&(d=p<this.coords.firstDataRowIdx&&q>=this.coords.firstDataColIdx?this.gridLayout.getCell(p,q-this.coords.firstDataColIdx+this.coords.frozenColsCount,!0,!0):null,null==d))continue;
b+=null==d?"":d.label}p<h&&(b+="\n")}return b};return c}();e.SelectionManager=b;var a=function(){function a(c,b){void 0===c&&(c=0);void 0===b&&(b=0);this.x=c;this.y=b}a.prototype.equals=function(a){return a.x==this.x&&a.y==this.y};return a}();e.Point=a})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(){function c(a,c){var b=this;this._started=this.isCtrlPressed=!1;this._calculatedArea=this._selectedHeader=null;this.autoCalculationBarMargin=5;this.scrollbarSize=17;this.mouseEventHandler=function(a){return b.onMouseEvent(a)};this.mouseLeaveHandler=function(a){return b.onMouseLeave(a)};this.manager=a;this.gridLayout=c;this.coords=this.gridLayout.coords;this._calculatedArea=new f.AutoCalculationBar;this._calculatedArea.hide();this.gridLayout.addChild(this._calculatedArea);
this.gridLayout.element.addEventListener("mousedown",this.mouseEventHandler);this.gridLayout.element.addEventListener("mouseup",this.mouseEventHandler)}Object.defineProperty(c.prototype,"started",{get:function(){return this._started},set:function(a){this._started=a;this.started||(this.gridLayout.element.removeEventListener("mousemove",this.mouseEventHandler),document.removeEventListener("mousemove",this.mouseLeaveHandler))},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"selectedHeader",
{get:function(){return this._selectedHeader},set:function(a){this._selectedHeader=a},enumerable:!0,configurable:!0});c.prototype.onMouseEvent=function(a){if(1==a.which){var c=uicontrols.UIElement.convert(a.target);if("mousedown"!=a.type||!(c.hasClass(e.vo.GridStyleName.FILTER_HEADER)||c.hasClass(e.vo.GridStyleName.FILTER_ICON)||c.hasClass(e.vo.GridStyleName.FILTERED_ICON)||null!=c.closest(".wdr-filters"))){var b=this.gridLayout.getOffset(),c=a.clientX-b.left,b=a.clientY-b.top;if(!(c>this.coords.availableWidth||
b>this.coords.gridStartY+this.coords.availableHeight||(b=this.coords.getRowIdxByRelativePosition(b,this.gridLayout.isSmooth),c=this.coords.getColIdxByRelativePosition(c,this.gridLayout.isSmooth),isNaN(b)||isNaN(c))))switch(this.isCtrlPressed=utils.OSUtil.isWin&&a.ctrlKey||utils.OSUtil.isMac&&a.metaKey,a.type){case "mousedown":this.onMouseDown(b,c);break;case "mousemove":this.onMouseMove(b,c);break;case "mouseup":this.onMouseUp(b,c)}}}};c.prototype.onMouseLeave=function(a){var c=uicontrols.UIElement.convert(this.gridLayout.element),
b=a.clientX;a=a.clientY;(b<c.left||a<c.top||b>c.left+this.gridLayout.width||a>c.top+this.gridLayout.height)&&this.stopSelection()};c.prototype.select=function(a,c,b,d){this.started=!1;this.manager.select(new f.Point(c,a),new f.Point(d,b))};c.prototype.stopSelection=function(){this.started=!1};c.prototype.onMouseDown=function(a,c){this.started=!0;this.manager.select(new f.Point(c,a),new f.Point(c,a));this.gridLayout.element.addEventListener("mousemove",this.mouseEventHandler);utils.fmdocument.addEventListener("mousemove",
this.mouseLeaveHandler)};c.prototype.onMouseUp=function(a,c){this.started&&(this.started=!1,-1==a?this.manager.selectColumn(c):-1==c?this.manager.selectRow(a):this.manager.selectTo(new f.Point(c,a)))};c.prototype.onMouseMove=function(a,c){this.started&&(!this.manager.to||this.manager.to.x==c&&this.manager.to.y==a||this.manager.selectTo(new f.Point(c,a)))};c.prototype.dispose=function(){this.gridLayout.element&&this.gridLayout.element.removeEventListener("mousedown",this.mouseEventHandler);this.gridLayout.element&&
this.gridLayout.element.removeEventListener("mouseup",this.mouseEventHandler);this._calculatedArea.dispose();this.coords=this.gridLayout=this.manager=null;null!=this.selectedHeader&&(this.selectedHeader.remove(),this.selectedHeader=null)};c.prototype.redraw=function(){var a=null,c=null;this._calculatedArea.resetCoordinates();for(var b=0;b<this.manager.selectedCells.length;b++)a=this.manager.selectedCells.getItemAt(b),c=this.manager.decomposeCellKey(this.manager.selectedCells.getKeyAt(b)),this._redraw(a,
c.from,c.to);this._redrawAutoCalculationBar(this._calculatedArea);this.drawHeader(this.selectedHeader)};c.prototype.drawHeader=function(a){if(null!=a){a.hide();var c=this.manager.decomposeCellKey(a.cellKey);-1!=c.row&&this.drawSelectedRow(c.row,a);-1!=c.column&&this.drawSelectedColumn(c.column,a)}};c.prototype._redrawAutoCalculationBar=function(a){a.hide();if(this.manager.isAutoCalculationBarAvailable()&&d.model._options.OptionsManager.showAutoCalculationBar&&a.isCoordinationChanged()&&null!=d.data_.Cube.getInstance()&&
null!=d.data_.Cube.getInstance().structure_&&(a.makeAggregationsVissible(),this.updateAutoCalculationBar(a),!a.isAllAggregationsHidden())){a.show();a.top=a.coordinates.bottom;for(var c=this.coords.getRelativeColX(this.coords.frozenColsCount,this.gridLayout.isSmooth),b=0,e=0;e<a.aggregationsElements.length;e++)b+=a.aggregationsElements.getItemAt(e).width;b=b+2*this.autoCalculationBarMargin+2*(a.aggregationsElements.length-1)*this.autoCalculationBarMargin;a.absoluteContainer.width=b;c-a.coordinates.right+
b>this.coords.scrollLeft?a.coordinates.right=a.coordinates.left+b:c>a.coordinates.right-b?(a.absoluteContainer.css("left","auto"),a.absoluteContainer.right=0,b=a.coordinates.right-c):a.coordinates.rightRaw>=this.coords.availableWidth&&(a.absoluteContainer.css("left","right"),a.absoluteContainer.left=0,b=b-(a.coordinates.rightRaw-this.coords.availableWidth)-1,b=0>b?0:b);this.coords.gridStartY+this.coords.availableHeight<=a.coordinates.bottom+a.height&&(a.top=a.coordinates.bottom-this.scrollbarSize);
a.left=a.coordinates.right-b;a.relativeContainer.width=b;a.width=b}};c.prototype.updateAutoCalculationBar=function(a){this.manager.isAutoCalculationBarAvailable()&&this.manager.autoCalculationManager.recalculateAutoCalculationBar(a,this.gridLayout.selectedCells)};c.prototype._redraw=function(a,c,b){a.hide();var e=Math.min(c.x,b.x),f=Math.min(c.y,b.y),h=Math.max(c.x,b.x);c=Math.max(c.y,b.y);d.model._options.OptionsManager.showHeaders&&this.drawHeaderSelection(e,h,f,c,a);b=this.coords.availableWidth;
var n=this.coords.gridStartY+this.coords.availableHeight,p=Math.max(this.coords.gridStartY,this.coords.getRelativeRowY(f,this.gridLayout.isSmooth)-1),q=this.coords.getRelativeRowY(c+1,this.gridLayout.isSmooth),t=Math.min(n,q),u=Math.max(0,this.coords.getRelativeColX(e,this.gridLayout.isSmooth)-1),v=this.coords.getRelativeColX(h+1,this.gridLayout.isSmooth),x=Math.min(b,v),w=t-p,y=x-u;2>=y||2>=w?null!=a.cellElement&&a.cellElement.hide():u<b&&p<n?(null!=a.cellElement&&(a.cellElement.show(),a.cellElement.top=
p,a.cellElement.left=u,a.cellElement.width=y,a.cellElement.height=w,this._calculatedArea.coordinates.bottom*this._calculatedArea.coordinates.right<=x*t&&(this._calculatedArea.coordinates.left=u,this._calculatedArea.coordinates.right=x,this._calculatedArea.coordinates.bottom=t,this._calculatedArea.coordinates.rightRaw=v)),f<this.coords.frozenRowsCount&&v>x&&(a.createColFix(),a.colFix.top=p,a.colFix.left=x,a.colFix.width=Math.min(v,this.coords.layoutWidth)-x,a.colFix.height=Math.min(t,this.coords.gridStartY+
this.coords.colHeadersHeight)-p,a.colFix.toggleClass("wdr-clear-border-bottom",c>this.coords.frozenRowsCount),a.colFix.toggleClass("wdr-clear-border-right",v>this.coords.layoutWidth),a.colFix.removeClass("wdr-clear-border"),a.colFix.show()),e<this.coords.frozenColsCount&&q>t&&(a.createRowFix(),a.rowFix.top=t,a.rowFix.left=u,a.rowFix.width=Math.min(x,this.coords.rowHeadersWidth)-u,a.rowFix.height=Math.min(q,this.coords.layoutHeight)-t,a.rowFix.toggleClass("wdr-clear-border-bottom",q>this.coords.layoutHeight),
a.rowFix.toggleClass("wdr-clear-border-right",h>this.coords.frozenColsCount),a.rowFix.removeClass("wdr-clear-border"),a.rowFix.show()),null!=a.cellElement&&(a.cellElement.toggleClass("wdr-clear-border-right",v>x),a.cellElement.toggleClass("wdr-clear-border-bottom",q>t))):null!=a.cellElement&&a.cellElement.hide()};c.prototype.drawSelectedRow=function(a,c){if(!isNaN(a)){null==c.rowOverlay&&c.createRowOverlay();var b=this.coords.getRelativeRowY(a,this.gridLayout.isSmooth),d=this.coords.getRelativeRowY(a+
1,this.gridLayout.isSmooth),e=Math.min(this.coords.gridStartY+this.coords.availableHeight,d);b<this.coords.gridStartY+this.coords.availableHeight?(c.rowOverlay.left=0,c.rowOverlay.top=b,c.rowOverlay.width=this.coords.availableWidth,c.rowOverlay.height=e-b,c.rowOverlay.show(),d>e&&(c.createRowFix(),c.rowFix.top=e,c.rowFix.left=0,c.rowFix.width=this.coords.rowHeadersWidth,c.rowFix.height=Math.min(d,this.coords.layoutHeight)-e,c.rowFix.addClass("wdr-clear-border"),c.rowFix.show())):c.rowOverlay.hide()}};
c.prototype.drawSelectedColumn=function(a,c){if(!isNaN(a)){null==c.colOverlay&&c.createColOverlay();var b=this.coords.getRelativeColX(a,this.gridLayout.isSmooth),d=this.coords.getRelativeColX(a+1,this.gridLayout.isSmooth),e=Math.min(this.coords.availableWidth,d);b<this.coords.availableWidth?(c.colOverlay.left=b,c.colOverlay.top=this.coords.gridStartY,c.colOverlay.width=e-b,c.colOverlay.height=this.coords.availableHeight,c.colOverlay.show(),d>e&&(c.createColFix(),c.colFix.top=this.coords.gridStartY,
c.colFix.left=e,c.colFix.width=Math.min(d,this.coords.layoutWidth)-e,c.colFix.height=this.coords.colHeadersHeight,c.colFix.addClass("wdr-clear-border"),c.colFix.show())):c.colOverlay.hide()}};c.prototype.drawHeaderSelection=function(a,c,b,d,e){this.processHeaders(a,c,b,d,e);this.drawHeaderColumn(e.colOverlay,a,c);this.drawHeaderRow(e.rowOverlay,b,d)};c.prototype.processHeaders=function(c,b,d,e,f){if(!this.manager.rowsSelectedSet.hasOwnProperty(d.toString())){f.createRowOverlay();for(var h=d;h<=e;h++)this.manager.rowsSelectedSet[h.toString()]=
d==e&&c==b?a.ONE_CELL:a.AREA}if(!this.manager.columnsSelectedSet.hasOwnProperty(c.toString()))for(f.createColOverlay(),h=c;h<=b;h++)this.manager.columnsSelectedSet[h.toString()]=d==e&&c==b?a.ONE_CELL:a.AREA};c.prototype.drawHeaderColumn=function(a,c,b){null!=a&&(c=this.coords.getRelativeColX(c,this.gridLayout.isSmooth),b=Math.min(this.coords.layoutWidth,this.coords.getRelativeColX(b+1,this.gridLayout.isSmooth)),c<this.coords.layoutWidth?(a.left=c,a.top=this.coords.gridStartY,a.width=b-c,a.height=
this.coords.getSheetHeaderHeight(),a.show()):a.hide())};c.prototype.drawHeaderRow=function(a,c,b){null!=a&&(c=this.coords.getRelativeRowY(c,this.gridLayout.isSmooth),b=Math.min(this.coords.layoutHeight,this.coords.getRelativeRowY(b+1,this.gridLayout.isSmooth)),a.left=0,a.top=c,a.width=this.coords.getSheetHeaderWidth(),a.height=b-c,a.show())};return c}();f.SelectionCanvas=b;var a=function(){function a(){}a.ONE_CELL=1;a.AREA=2;return a}();f.CellType=a;b=function(){function a(c){this.gridLayout=this._rowFix=
this._colFix=this._rowOverlay=this._colOverlay=this._cellElement=null;this.gridLayout=c;this._cellElement=this.createUIElement()}a.prototype.createUIElement=function(){var a=new uicontrols.UIElement("div","wdr-sheet-selection-canvas");a.hide();this.gridLayout.addChild(a);return a};a.prototype.createCellElement=function(){null==this._cellElement&&(this._cellElement=this.createUIElement())};a.prototype.createColOverlay=function(){null==this._colOverlay&&(this._colOverlay=this.createUIElement(),this._colOverlay.addClass("wdr-sheet-selection-header"))};
a.prototype.createRowOverlay=function(){null==this._rowOverlay&&(this._rowOverlay=this.createUIElement(),this._rowOverlay.addClass("wdr-sheet-selection-header"))};a.prototype.createRowFix=function(){null==this._rowFix&&(this._rowFix=this.createUIElement(),this._rowFix.addClass("wdr-clear-border-top"))};a.prototype.createColFix=function(){null==this._colFix&&(this._colFix=this.createUIElement(),this._colFix.addClass("wdr-clear-border-left"))};Object.defineProperty(a.prototype,"cellKey",{get:function(){return this._cellKey},
set:function(a){this._cellKey=a},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowFix",{get:function(){return this._rowFix},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"colFix",{get:function(){return this._colFix},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowOverlay",{get:function(){return this._rowOverlay},set:function(a){this._rowOverlay=a},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"colOverlay",{get:function(){return this._colOverlay},
set:function(a){this._colOverlay=a},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"cellElement",{get:function(){return this._cellElement},set:function(a){this._cellElement=a},enumerable:!0,configurable:!0});a.prototype.hide=function(){this.colOverlay&&this.colOverlay.hide();this.rowOverlay&&this.rowOverlay.hide();this.colFix&&this.colFix.hide();this.rowFix&&this.rowFix.hide();this.cellElement&&this.cellElement.hide()};a.prototype.remove=function(){null!=this.cellElement&&(this.cellElement.remove(),
this._cellElement=null);null!=this.colOverlay&&(this.colOverlay.remove(),this._colOverlay=null);null!=this.rowOverlay&&(this.rowOverlay.remove(),this._rowOverlay=null);null!=this.colFix&&(this.colFix.remove(),this._colFix=null);null!=this.rowFix&&(this.rowFix.remove(),this._rowFix=null);this.gridLayout=null};return a}();f.SelectionCanvasElement=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
var ScrollPane=function(d){function e(){var e=d.call(this,"div","wdr-scroll-pane")||this;e._placeholder=new uicontrols.UIElement("div","wdr-scroll-placeholder");e._content=new uicontrols.UIElement("div","wdr-scroll-content");e.addChild(e._content);e.addChild(e._placeholder);return e}__extends(e,d);Object.defineProperty(e.prototype,"contentWidth",{get:function(){return this._placeholder.width},set:function(d){this._placeholder.width=d},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,
"contentHeight",{get:function(){return this._placeholder.height},set:function(d){this._placeholder.height=d},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"scrollLeft",{get:function(){return this.element.scrollLeft},set:function(d){this.element.scrollLeft=d},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"scrollTop",{get:function(){return this.element.scrollTop},set:function(d){this.element.scrollTop=d},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,
"content",{get:function(){return this._content},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"horizontalScroll",{set:function(d){this.element.style.overflowX=d?"scroll":"hidden"},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"verticalScroll",{set:function(d){this.element.style.overflowY=d?"scroll":"hidden"},enumerable:!0,configurable:!0});
return e}(uicontrols.UIElement);
(function(d){(function(e){(function(e){(function(e){var b=function(a){function c(c){var b=a.call(this,c,null)||this;b._coords=c;return b}__extends(c,a);c.prototype.draw=function(){var a=[],c=new HtmlNodeWrapper;if(d.model._options.OptionsManager.showHeaders){c.tag="div";c.addClass("wdr-row");c.text+=this.createSheetHeaderCell().toHtml();for(var b=0;b<this._coords.frozenColsCount;b++)c.text+=this.createColumnSheetHeaderCell(b).toHtml();a.push(c.toHtml());for(b=0;b<this._coords.frozenRowsCount;b++)c.text=this.createRowSheetHeaderCell(b).toHtml(),
a.push(c.toHtml())}a=a.join("");this.element.innerHTML!=a&&this.html(a)};c.prototype.clear=function(){};return c}(e.AbstractSheet);e.SheetHeaders=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
var HtmlNode=function(){function d(d){void 0===d&&(d="div");this.text=this.tag="";this.style={};this.attr={};this.classes=[];this.tag=d}d.prototype.addClass=function(d){0>this.classes.indexOf(d)&&this.classes.push(d)};d.prototype.toHtml=function(){var d="<"+this.tag,h=[],f;for(f in this.style)h.push(f+":"+this.style[f]);0<h.length&&(d+=' style="'+h.join(";")+';"');0<this.classes.length&&(d+=' class="'+this.classes.join(" ")+'"');for(var b in this.attr)d+=" "+b+'="'+this.attr[b]+'"';return d+=">"+
(this.text||"")+"</"+this.tag+">"};return d}(),HtmlNodeWrapper=function(){function d(d){void 0===d&&(d="div");this._node=new HtmlNode;this.clear();this.tag=d}Object.defineProperty(d.prototype,"node",{get:function(){return this._node},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"tag",{get:function(){return this.node.tag},set:function(d){this.node.tag=d},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"text",{get:function(){return this.node.text},set:function(d){this.node.text=
d},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"style",{get:function(){return this.node.style},set:function(d){this.node.style=d},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"attr",{get:function(){return this.node.attr},set:function(d){this.node.attr=d},enumerable:!0,configurable:!0});d.prototype.addClass=function(d){this.node.addClass(d)};d.prototype.clear=function(){this.tag="div";this.text="";this.style={};this.attr={};this.node.classes=[]};d.prototype.toHtml=
function(d){void 0===d&&(d=!0);var h=this.node.toHtml();d&&this.clear();null!=pivot._view.grid.vo.GridCell.customizeCellFunction&&(h=pivot.model.XSSCheck.valid(h)?h:pivot.model.XSSCheck.validate(h));return h};return d}();
(function(d){(function(d){(function(d){(function(d){var b=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.draw=function(){this.setContentSize();var a=this.getBounds();if(this.isSmooth||this._coords.isOnRowEdge(a.bottom)||this._coords.isOnColEdge(a.right)||!this._bounds.contains(a)){var c=a.clone();0!=this._coords.maxColsCount&&(c.right=Math.min(c.right,this._coords.maxColsCount));0!=this._coords.maxRowsCount&&(c.bottom=Math.min(c.bottom,this._coords.maxRowsCount));
if(!this.isSmooth||!this._boundsSmooth.contains(c)||!this._coords.canDrawAll&&(a.left>this._coords.frozenColsCount&&a.left<=this._boundsSmooth.left||a.top>this._coords.frozenRowsCount&&a.top<=this._boundsSmooth.top)){this._coords.isOnColEdge(a.right)&&(a.left=Math.max(a.left-1,this._coords.frozenColsCount));this._coords.isOnRowEdge(a.bottom)&&(a.top=Math.max(a.top-1,this._coords.frozenRowsCount));for(var c=[],b=new HtmlNodeWrapper,d=a.top;d<a.bottom;d++){b.tag="div";b.addClass("wdr-row");b.attr["data-r"]=
d;for(var e=a.left;e<a.right;++e)b.text+=this.createCell(d,e).toHtml();c.push(b.toHtml())}this.scrollPane.placeholder.html("");this.scrollPane.placeholder.visible=this._coords.hasHorizontalScroll||this._coords.hasVerticalScroll;this.scrollPane.content.html(c.join(""));this.scrollPane.content.show();c.length=0;this.isSmooth=!1;this._bounds.set(a)}}};c.prototype.adjustScrollPaneOffset=function(){this.scrollPane.content.left=this._coords.getColEdgeOffset(this._bounds.left);this.scrollPane.content.top=
this._coords.getRowEdgeOffset(this._bounds.top)};c.prototype.drawSmooth=function(){var a=this.getBounds(!0);if(!(this.isSmooth&&this._coords.canDrawAll&&this._boundsSmooth.contains(a))){this._boundsSmooth=a;for(var a=[],c=this._boundsSmooth.top;c<this._boundsSmooth.bottom;c++){this._coords.getRowHeight(c);for(var b=this._boundsSmooth.left;b<this._boundsSmooth.right;++b)a.push(this.createCell(c,b,!0).toHtml())}this.scrollPane.placeholder.html(a.join(""));this.scrollPane.placeholder.show();this.scrollPane.content.hide();
this.scrollPane.content.html("");a=this.getBounds();this.isSmooth||this._coords.isOnRowEdge(a.bottom)||(this.scrollPane.scrollTop=this._coords.getRowY(this._coords.firstDataRowIdx,!1));this.isSmooth||this._coords.isOnColEdge(a.right)||(this.scrollPane.scrollLeft=this._coords.getColX(this._coords.firstDataColIdx,!1));this.isSmooth=!0}};c.prototype.getBounds=function(a){void 0===a&&(a=!1);var c=new d.Bounds;c.top=this._coords.getBoundTop(a);c.left=this._coords.getBoundLeft(a);c.bottom=this._coords.getBoundBottom(a);
c.right=this._coords.getBoundRight(a);return c};c.prototype.setContentSize=function(){this.scrollPane.contentWidth=Math.max(this._coords.dataContentWidth,this._coords.dataWidth-this._coords.scrollBarWidth);this.scrollPane.contentHeight=Math.max(this._coords.dataContentHeight,this._coords.dataHeight-this._coords.scrollBarHeight);this.scrollPane.content.right=this._coords.scrollBarWidth;this.scrollPane.content.bottom=this._coords.scrollBarHeight;this.scrollPane.horizontalScroll=this._coords.hasHorizontalScroll;
this.scrollPane.verticalScroll=this._coords.hasVerticalScroll};return c}(d.BaseSheet);d.DataSheet=b})(d.sheet||(d.sheet={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.draw=function(){this.setContentSize();var a=this.getBounds();if(this.isSmooth||this._coords.isOnRowEdge(a.bottom)||!this._bounds.contains(a)){var c=a.clone();0!=this._coords.maxRowsCount&&(c.bottom=Math.min(c.bottom,this._coords.maxRowsCount));if(!this.isSmooth||!this._boundsSmooth.contains(c)){this._coords.isOnRowEdge(a.bottom)&&(a.top=Math.max(a.top-
1,this._coords.frozenRowsCount));for(var c=[],b=new HtmlNodeWrapper,e=a.top;e<a.bottom;e++){b.tag="div";b.addClass("wdr-row");b.attr["data-r"]=e;d.model._options.OptionsManager.showHeaders&&(b.text+=this.createRowSheetHeaderCell(e).toHtml());for(var f=a.left;f<a.right;++f)b.text+=this.createCell(e,f).toHtml();c.push(b.toHtml())}this.scrollPane.placeholder.html("");this.scrollPane.placeholder.hide();this.scrollPane.content.html(c.join(""));this.scrollPane.content.show();c.length=0;this._isSmooth=!1;
this._bounds.set(a)}}};c.prototype.createRowSheetHeaderCell=function(c,b){void 0===b&&(b=!1);this.cell=a.prototype.createRowSheetHeaderCell.call(this,c,b);b||(this.cell.style["min-height"]=this.cell.style.height,delete this.cell.style.height,delete this.cell.style["line-height"]);return this.cell};c.prototype.adjustScrollPaneOffset=function(){this.scrollPane.content.top=this._coords.getRowEdgeOffset(this._bounds.top)};c.prototype.getBounds=function(a){void 0===a&&(a=!1);var c=new f.Bounds;c.top=this._coords.getBoundTop(a);
c.left=0;c.bottom=this._coords.getBoundBottom(a);c.right=this._coords.frozenColsCount;a&&c.bottom==this._coords.maxRowsCount&&c.bottom++;return c};c.prototype.drawSmooth=function(){var a=this.getBounds(!0);if(!(this.isSmooth&&this._coords.canDrawAll&&this._boundsSmooth.contains(a))){this._boundsSmooth=a;for(var a=[],c=this._boundsSmooth.top;c<this._boundsSmooth.bottom;c++){d.model._options.OptionsManager.showHeaders&&a.push(this.createRowSheetHeaderCell(c,!0).toHtml());for(var b=this._boundsSmooth.left;b<
this._boundsSmooth.right;++b)a.push(this.createCell(c,b,!0).toHtml())}this.scrollPane.placeholder.html(a.join(""));this.scrollPane.content.hide();this.scrollPane.content.html("");this.scrollPane.placeholder.show();this.isSmooth||this._coords.isOnRowEdge(this._bounds.bottom)?this._scrollPane.scrollTop=this._coords.scrollTop:this.scrollPane.scrollTop=this._coords.getRowY(this._coords.firstDataRowIdx,!1);this.isSmooth=!0}};c.prototype.setContentSize=function(){this.scrollPane.contentHeight=this._coords.dataContentHeight+
this._coords.scrollBarHeight;this.scrollPane.content.bottom=0;this.scrollPane.scrollTop=this._coords.scrollTop};c.prototype.getCellByPosition=function(a,c){var b=this._coords.getColIndexAtPosition(a,!0)-1,d=this._coords.getRowIndexAtPosition(c)-1,f=this._getDataFunc(d,b);null==f&&(f=new e.vo.GridCell,f.rowIdx=d,f.colIdx=b);return f};return c}(f.BaseSheet);f.RowHeadersSheet=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.draw=function(){utils.fmClearTimeout(this._bgTimeout);this.setContentSize();var a=this.getBounds();if(this.isSmooth||this._coords.isOnColEdge(a.right)||!this._bounds.contains(a)){var c=a.clone();0!=this._coords.maxColsCount&&(c.right=Math.min(c.right,this._coords.maxColsCount));if(!this.isSmooth||!this._boundsSmooth.contains(c)){this._coords.isOnColEdge(a.right)&&
(a.left=Math.max(a.left-1,this._coords.frozenColsCount));c=[];d.model._options.OptionsManager.showHeaders&&c.push(this.createSheetHeaders(a));for(var b=new HtmlNodeWrapper,e=a.top;e<a.bottom;e++){b.tag="div";b.addClass("wdr-row");b.attr["data-r"]=e;for(var f=a.left;f<a.right;++f)b.text+=this.createCell(e,f).toHtml();c.push(b.toHtml())}this.scrollPane.placeholder.html("");this.scrollPane.placeholder.hide();this.scrollPane.content.html(c.join(""));this.scrollPane.content.show();c.length=0;this.isSmooth=
!1;this._bounds.set(a)}}};c.prototype.adjustScrollPaneOffset=function(){this.scrollPane.content.left=this._coords.getColEdgeOffset(this._bounds.left)};c.prototype.getBounds=function(a){void 0===a&&(a=!1);var c=new f.Bounds;c.top=0;c.left=this._coords.getBoundLeft(a);c.bottom=this._coords.frozenRowsCount;c.right=this._coords.getBoundRight(a);a&&c.right==this._coords.maxColsCount&&c.right++;return c};c.prototype.drawSmooth=function(){var a=this.getBounds(!0);if(!(this.isSmooth&&this._coords.canDrawAll&&
this._boundsSmooth.contains(a))){this._boundsSmooth=a;utils.fmClearTimeout(this._bgTimeout);for(var a=[],c=this._boundsSmooth.top;c<this._boundsSmooth.bottom;c++)for(var b=this._boundsSmooth.left;b<this._boundsSmooth.right;++b)a.push(this.createCell(c,b,!0).toHtml());c="";d.model._options.OptionsManager.showHeaders&&(c+=this.createSheetHeaders(this._boundsSmooth,!0));c+=a.join("");this.scrollPane.placeholder.html(c);this.scrollPane.content.hide();this.scrollPane.content.html("");this.scrollPane.placeholder.show();
this.isSmooth||this._coords.isOnColEdge(this._bounds.right)?this.scrollPane.scrollLeft=this._coords.scrollLeft:this.scrollPane.scrollLeft=this._coords.getColX(this._coords.firstDataColIdx,!1);this.isSmooth=!0}};c.prototype.setContentSize=function(){this.scrollPane.contentWidth=this._coords.dataContentWidth+this._coords.scrollBarWidth;this.scrollPane.content.right=0};c.prototype.backgroundProcess=function(){var a=this;utils.fmClearTimeout(this._bgTimeout);for(var c=[],b=this._coords.getColIndicesWithUndefinedWidth(50),
d=0;d<this._coords.frozenRowsCount;d++)for(var e=0;e<b.length;e++){var f=b[e];this.isCellEmpty(d,f)||c.push(this.createCell(d,f,!0).toHtml())}if(0<c.length){var h=this._scrollPane.placeholder.element,p=h.children.length,q=h.innerHTML;h.innerHTML=q+c.join();this.requestAnimationFrame(function(){for(p;p<h.children.length;p++)a.updateColWidth(h.children.item(p));h.innerHTML=q;a._bgTimeout=utils.fmSetTimeout(function(){return a.backgroundProcess()},500)})}};c.prototype.createSheetHeaders=function(a,c){void 0===
c&&(c=!1);for(var b="",d=a.left;d<a.right;++d)b+=this.createColumnSheetHeaderCell(d,c).toHtml();c||(d=new HtmlNodeWrapper,d.tag="div",d.addClass("wdr-row"),d.text=b,b=d.toHtml());return b};c.prototype.getCellByPosition=function(a,c){var b=this._coords.getColIndexAtPosition(a)-1,d=this._coords.getRowIndexAtPosition(c,!0)-1,f=this._getDataFunc(d,b);null==f&&(f=new e.vo.GridCell,f.rowIdx=d,f.colIdx=b);return f};c.prototype.clearDrawings=function(){utils.fmClearTimeout(this._bgTimeout)};c.prototype.dispose=
function(){this.clearDrawings();a.prototype.dispose.call(this)};return c}(f.BaseSheet);f.ColumnHeadersSheet=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){(function(f){var b=function(a){function c(){var c=a.call(this,"div","wdr-grid-layout")||this;c.smoothTimeout=1E3;c.animationDraws=[];c._isHeadersDirty=!1;c.colsScrollHandler=function(a){return c.onColsScroll(a)};c.rowsScrollHandler=function(a){return c.onRowsScroll(a)};c.dataScrollHandler=function(){return c.onDataScroll()};c.sheetHeaderDbClickHandler=function(a){return c.onSheetHeaderDbClick(a)};c.clicks=0;c.disableSelection();c._coords=new f.GridCoords;c._dataProvider=
new f.SheetDataProvider(c._coords);c._selectionManager=new f.SelectionManager(c);c.setControls();return c}__extends(c,a);c.prototype.setControls=function(){this.createTitle();this.createSheetHeaders();this.createColsSheet();this.createRowsSheet();this.createDataSheet();this.createResizeHandles()};c.prototype.createTitle=function(){this._title=new uicontrols.UILabel;this._title.container.display="block";this._title.setId("wdr-grid-title");this._title.addClass("wdr-pivot-title");this._title.setSelectable(!0);
this._title.container.css("position","relative");this._title.hide();this.addComponent(this._title)};c.prototype.createSheetHeaders=function(){this._sheetHeaders=new f.SheetHeaders(this._coords);this._sheetHeaders.id="wdr-sheet-headers";this.addChild(this._sheetHeaders)};c.prototype.createColsSheet=function(){var a=this;this._colsSheet=new f.ColumnHeadersSheet(this._coords,function(c,b){return a.getCell(c,b)});this._colsSheet.id="wdr-cols-sheet";this._colsSheet.scrollPane.element.addEventListener("wheel",
this.colsScrollHandler);this._colsSheet.addEventListener(h.GridEvent.MOUSE_CLICK,function(c){return a.onClick(c)});this.addChild(this._colsSheet)};c.prototype.createRowsSheet=function(){var a=this;this._rowsSheet=new f.RowHeadersSheet(this._coords,function(c,b){return a.getCell(c,b)});this._rowsSheet.id="wdr-rows-sheet";this._rowsSheet.scrollPane.element.addEventListener("wheel",this.rowsScrollHandler);this._rowsSheet.addEventListener(h.GridEvent.MOUSE_CLICK,function(c){return a.onClick(c)});this.addChild(this._rowsSheet)};
c.prototype.createDataSheet=function(){var a=this;this._dataSheet=new f.DataSheet(this._coords,function(c,b){return a.getCell(c,b)});this._dataSheet.id="wdr-data-sheet";this._dataSheet.scrollPane.element.addEventListener("scroll",this.dataScrollHandler,!0);this._dataSheet.addEventListener(f.BaseSheet.EVENT_SWITCHED_TO_SIMPLE,function(c){return a.onModeSwitched(c)});this._dataSheet.addEventListener(f.BaseSheet.EVENT_SWITCHED_TO_SMOOTH,function(c){return a.onModeSwitched(c)});this._dataSheet.addEventListener(h.GridEvent.MOUSE_CLICK,
function(c){return a.onClick(c)});this.addChild(this._dataSheet)};c.prototype.createResizeHandles=function(){var a=this;this._colResizeHandles=new f.ColumnResizeHandles(this);this._colResizeHandles.id="wdr-cols-resize";this._colResizeHandles.addEventListener(h.GridEvent.RESIZE_COLUMN,function(c){return a.onColResize(c)});this.addChild(this._colResizeHandles);this._rowResizeHandles=new f.RowResizeHandles(this);this._rowResizeHandles.id="wdr-rows-resize";this._rowResizeHandles.addEventListener(h.GridEvent.RESIZE_ROW,
function(c){return a.onRowResize(c)});this.addChild(this._rowResizeHandles);this.element.addEventListener("dblclick",this.sheetHeaderDbClickHandler)};c.prototype.draw=function(){var a=this;this._coords.clearCache();this._dataSheet.width&&this._dataSheet.height||this.drawLayout();this._coords.setScale();this.adjustScrollPosition()||(utils.fmClearTimeout(this._drawSmoothTimer),this.disposeAnimationDraws(),this.animationDraws.push(this.requestAnimationFrame(function(){return a._draw()})))};c.prototype.disposeAnimationDraws=
function(){for(;0<this.animationDraws.length;)this.cancelAnimationFrame(this.animationDraws.pop())};c.prototype._draw=function(){var a=this;e.PivotView.stage.dispatchWith(e.ViewEvent.BEFORE_GRID_DRAW,this,{smooth:!1});this._coords.applyPendingSizes();this.drawFirst();this._isHeadersDirty&&(this.calculateSizesFirst()&&(this._coords.applyPendingSizes(),this._colsSheet.clearBounds(),this._rowsSheet.clearBounds(),this.drawFirst()),this._isHeadersDirty=!1);this.drawLast();d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.AFTER_GRID_DRAW,
{smooth:!1}));this.animationDraws.push(this.requestAnimationFrame(function(){a.drawLayout();a._selectionManager.draw()}));this.animationDraws.push(this.requestAnimationFrame(function(){var c=a.calculateSizesAll();c?(a._colsSheet.clearBounds(),a._rowsSheet.clearBounds(),a._dataSheet.clearBounds(),a.draw()):a._coords.canDrawSmooth&&(utils.fmClearTimeout(a._drawSmoothTimer),a._drawSmoothTimer=utils.fmSetTimeout(function(){return a.drawSmooth()},a.smoothTimeout));c||a.makeFieldsDraggable()}));this.animationDraws.push(this.requestAnimationFrame(function(){e.PivotView.stage.dispatchWith(e.ViewEvent.AFTER_GRID_DRAW,
a,{smooth:!1})}))};c.prototype.drawFirst=function(){this._coords.titleHeight=utils.nullOrEmpty(d.model._options.OptionsManager.gridTitle)?0:this._title.getHeight(!0);this._colsSheet.draw();this._colsSheet.adjustScrollPaneOffset();this._rowsSheet.draw();this._rowsSheet.adjustScrollPaneOffset()};c.prototype.drawLast=function(){this._sheetHeaders.draw();this._selectionManager.draw();this._colResizeHandles.draw();this._rowResizeHandles.draw();this._dataSheet.draw();this._dataSheet.adjustScrollPaneOffset()};
c.prototype.calculateSizesFirst=function(){this._colsSheet.calculateSizes(!0);this._rowsSheet.calculateSizes(!0);return this._colsSheet.isDirty||this._rowsSheet.isDirty};c.prototype.calculateSizesAll=function(){this._dataSheet.calculateSizes(!0);this._colsSheet.calculateSizes(!0);this._rowsSheet.calculateSizes(!0);return this._dataSheet.isDirty||this._colsSheet.isDirty||this._rowsSheet.isDirty};c.prototype.drawSmooth=function(){var a=this;this.disposeAnimationDraws();this.animationDraws.push(this.requestAnimationFrame(function(){return a._drawSmooth()}))};
c.prototype._drawSmooth=function(){var a=this;e.PivotView.stage.dispatchWith(e.ViewEvent.BEFORE_GRID_DRAW,this,{smooth:!0});this._colsSheet.drawSmooth();this._rowsSheet.drawSmooth();this._dataSheet.drawSmooth();d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.AFTER_GRID_DRAW,{smooth:!0}));this.type==f.flat.FlatGridLayout.TYPE&&this.makeFieldsDraggable();this.animationDraws.push(this.requestAnimationFrame(function(){a._colsSheet.calculateSizesSmooth(!0);
a._rowsSheet.calculateSizesSmooth(!0);a._dataSheet.calculateSizesSmooth(!0);if(a._colsSheet.isDirty||a._rowsSheet.isDirty||a._dataSheet.isDirty)a._colsSheet.clearBoundsSmooth(),a._rowsSheet.clearBoundsSmooth(),a._dataSheet.clearBoundsSmooth();a._coords.canDrawAll||a._colsSheet.backgroundProcess()}));this.animationDraws.push(this.requestAnimationFrame(function(){e.PivotView.stage.dispatchWith(e.ViewEvent.AFTER_GRID_DRAW,a,{smooth:!0})}))};c.prototype.onModeSwitched=function(a){var c=this;a.type==f.BaseSheet.EVENT_SWITCHED_TO_SIMPLE&&
this.animationDraws.push(this.requestAnimationFrame(function(){c._colsSheet.switchToSimple();c._rowsSheet.switchToSimple()}))};c.prototype.onDataScroll=function(){this.setScroll(this._dataSheet.scrollPane.scrollTop,this._dataSheet.scrollPane.scrollLeft)};c.prototype.onRowsScroll=function(a){this.coords.hasVerticalScroll&&(a=a.wheelDeltaY||a.deltaY||a.wheelDelta||0,utils.browserVersion().isFirefox&&(a*=-40),utils.browserVersion().isMsie&&(a*=-1),isNaN(a)||0==a||(this._dataSheet.scrollPane.scrollTop=
this._coords.scrollTop-a))};c.prototype.onColsScroll=function(a){this.coords.hasHorizontalScroll&&(a=a.wheelDeltaX||a.deltaX||0,utils.browserVersion().isFirefox&&(a*=-40),utils.browserVersion().isMsie&&(a*=-1),0!=a&&(this._dataSheet.scrollPane.scrollLeft=this._coords.scrollLeft-a))};Object.defineProperty(c.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"coords",{get:function(){return this._coords},enumerable:!0,configurable:!0});
c.prototype.drawLayout=function(){this.width=this.coords.layoutWidth;this.height=this.coords.layoutHeight;utils.nullOrEmpty(d.model._options.OptionsManager.gridTitle)?this._title.hide():(this._title.setLabel(d.model._options.OptionsManager.gridTitle),this._title.show());this._colResizeHandles.left=0;this._colResizeHandles.top=this.coords.gridStartY;this._colResizeHandles.right=0;this._colResizeHandles.height=this.coords.getSheetHeaderHeight();this._rowResizeHandles.left=0;this._rowResizeHandles.top=
this.coords.gridStartY;this._rowResizeHandles.bottom=0;this._rowResizeHandles.width=this.coords.getSheetHeaderWidth()};c.prototype.triggerCellAction=function(a){null!=a&&this.dispatch(new h.GridClickEvent(a))};Object.defineProperty(c.prototype,"selectedCells",{get:function(){var a=[];if(0<this.selectionManager.selectedCells.length)for(var c=null,b=0;b<this._selectionManager.selectedCells.length;b++)null!=this._selectionManager.selectedCells.getItemAt(b).cellElement&&(c=this._selectionManager.decomposeCellKey(this._selectionManager.selectedCells.getItemAt(b).cellKey),
this.getSelectedCells(a,c.from,c.to));return a},enumerable:!0,configurable:!0});c.prototype.getSelectedCells=function(a,c,b){var d=null;if(c&&b)for(var e=this._selectionManager.fromRow(c,b);e<=this._selectionManager.toRow(c,b);e++)for(var f=this._selectionManager.fromCol(c,b);f<=this._selectionManager.toCol(c,b);f++)d=this.getCell(e,f,!0,!0),null==d&&(d=new h.vo.GridCell,d.rowIdx=e,d.colIdx=f),a.push(d)};c.prototype.getCell=function(a,c,b,d){void 0===d&&(d=!1);b=this._dataProvider.getData(a,c,!d);
return d&&null==b?this._dataProvider.getDataFrozen(a,c):b};c.prototype.insertCell=function(a,c,b,d){void 0===d&&(d=!1);this._dataProvider.setData(a,c,b,d)};c.prototype.resize=function(a,c){this._coords.resize(a,c,!0)};Object.defineProperty(c.prototype,"getDataFunction",{set:function(a){this._dataProvider.getDataFunction=a},enumerable:!0,configurable:!0});c.prototype.setDataSize=function(a,c){this._coords.dataRowsCount=a;this._coords.dataColsCount=c};c.prototype.freezeRows=function(a){a!=this._coords.frozenRowsCount&&
(this._coords.firstDataRowIdx=a+(this._coords.firstDataRowIdx-this._coords.frozenRowsCount));this._coords.frozenRowsCount=a};c.prototype.freezeColumns=function(a){a!=this._coords.frozenColsCount&&(this._coords.firstDataColIdx=a+(this._coords.firstDataColIdx-this._coords.frozenColsCount));this._coords.firstDataColIdx<a&&(this._coords.firstDataColIdx=a);this._coords.frozenColsCount=a};c.prototype.clearAll=function(){this._isHeadersDirty=!0;this._dataProvider.reset();this._coords.reset();this._colsSheet.clearAllBounds();
this._rowsSheet.clearAllBounds();this._dataSheet.clearAllBounds();this._selectionManager.clear();this._dataSheet.scrollPane.scrollTop=0;this._dataSheet.scrollPane.scrollLeft=0;this.clearDrawings()};c.prototype.clearData=function(){this._dataProvider.reset();this._colsSheet.clearAllBounds();this._rowsSheet.clearAllBounds();this._dataSheet.clearAllBounds();this._coords.clearCache()};c.prototype.clearColSizes=function(a){this._isHeadersDirty=!0;this._coords.clearColSizes(a)};c.prototype.clearRowSizes=
function(a){this._isHeadersDirty=!0;this._coords.clearRowSizes(a)};c.prototype.select=function(a,c,b,d){this._selectionManager.select(new f.Point(c,a),new f.Point(d,b))};c.prototype.deselect=function(){this._selectionManager.clear()};c.prototype.clearDrawings=function(){this.disposeAnimationDraws();utils.fmClearTimeout(this._drawSmoothTimer);utils.fmClearTimeout(this.clickTimeout);this._colsSheet.clearDrawings()};c.prototype.dispose=function(){this._dataProvider.dispose();this._selectionManager.dispose();
this.clearDrawings();this._colsSheet.removeAllEventListeners();this._colsSheet.scrollPane.element&&this._colsSheet.scrollPane.element.removeEventListener("wheel",this.colsScrollHandler);this._colsSheet.dispose();this._rowsSheet.removeAllEventListeners();this._rowsSheet.scrollPane.element&&this._rowsSheet.scrollPane.element.removeEventListener("wheel",this.rowsScrollHandler);this._rowsSheet.dispose();this._dataSheet.removeAllEventListeners();this._dataSheet.scrollPane.element&&this._dataSheet.scrollPane.element.removeEventListener("scroll",
this.dataScrollHandler);this._dataSheet.dispose();this._colResizeHandles.removeAllEventListeners();this._colResizeHandles.dispose();this._rowResizeHandles.removeAllEventListeners();this._rowResizeHandles.dispose();this.element&&this.element.removeEventListener("dbclick",this.sheetHeaderDbClickHandler);a.prototype.dispose.call(this)};c.prototype.onClick=function(a){null!=a.cell&&this.dispatch(a);this.onClickForApi(a)};c.prototype.onFilterClick=function(a){this.dispatch(a)};c.prototype.onClickForApi=
function(a){var c=this;this.clicks++;1==this.clicks&&(this.clickTimeout=utils.fmSetTimeout(function(){if(1==c.clicks){if(a.cell){var b=new h.GridSingleDoubleClickEvent(a.cell,!0,a.element);c.dispatch(b)}}else a.cell&&(b=new h.GridSingleDoubleClickEvent(a.cell,!1,a.element),c.dispatch(b));c.clicks=0},300))};c.prototype.setScroll=function(a,c){void 0===a&&(a=NaN);void 0===c&&(c=NaN);var b=!1;isNaN(a)||a==this.coords.scrollTop||(this.coords.scrollTop=a,this.coords.firstDataRowIdx=this.coords.getRowIndexAtPosition(a),
this._rowsSheet.scrollPane.scrollTop=a,b=!0);isNaN(c)||c==this.coords.scrollLeft||(this.coords.scrollLeft=c,this.coords.firstDataColIdx=this.coords.getColIndexAtPosition(c),this._colsSheet.scrollPane.scrollLeft=c,b=!0);b&&this.draw()};c.prototype.onColResize=function(a){this.dispatch(a);this._coords.applyPendingSizes();0<a.data.width?this._coords.setColWidth(a.data.colIdx,a.data.width,!1,!0):this._coords.resetColWidth(a.data.colIdx);this.drawAfterResize()};c.prototype.onRowResize=function(a){this.dispatch(a);
this._coords.applyPendingSizes();0<a.data.height?this._coords.setRowHeight(a.data.rowIdx,a.data.height,!1,!0):this._coords.resetRowHeight(a.data.rowIdx);this.drawAfterResize()};c.prototype.onSheetHeaderDbClick=function(a){if(!1!=d.model._options.OptionsManager.showHeaders){var c=this.getOffset(),b=a.clientX-c.left;a=a.clientY-c.top;b>this.coords.getSheetHeaderWidth()&&a>this.coords.gridStartY+this.coords.getSheetHeaderHeight()||(a=this.coords.getRowIdxByRelativePosition(a,this.isSmooth),b=this.coords.getColIdxByRelativePosition(b,
this.isSmooth),-1!=a||isNaN(b)||this._colResizeHandles.dispatchWith(h.GridEvent.RESIZE_COLUMN,this,{width:-1,colIdx:b}),-1!=b||isNaN(a)||this._rowResizeHandles.dispatchWith(h.GridEvent.RESIZE_ROW,this,{height:-1,rowIdx:a}))}};c.prototype.drawAfterResize=function(){this._colsSheet.clearAllBounds();this._rowsSheet.clearAllBounds();this._dataSheet.clearAllBounds();this.adjustScrollPosition()||this.draw()};c.prototype.adjustScrollPosition=function(){var a=!1;0<this._coords.scrollLeft&&this._coords.freeSpaceRight>
this._coords.scrollLeft&&(this._dataSheet.scrollPane.scrollLeft=0,a=!0);0<this._coords.scrollTop&&this._coords.freeSpaceTop>this._coords.scrollTop&&(this._dataSheet.scrollPane.scrollTop=0,a=!0);return a};c.prototype.getCellByElement=function(a){var c=uicontrols.UIElement.convert(a).closest(".wdr-cell");return null!=c?(a=parseInt(c.attr("data-r")),c=parseInt(c.attr("data-c")),this.getCell(a,c,!0,!0)):null};Object.defineProperty(c.prototype,"isSmooth",{get:function(){return this._dataSheet.isSmooth},
enumerable:!0,configurable:!0});c.prototype.scrollToRow=function(a){this._dataSheet.scrollPane.scrollTop=this.coords.getRowY(a)};c.prototype.scrollToColumn=function(a){this._dataSheet.scrollPane.scrollLeft=this.coords.getColX(a)};Object.defineProperty(c.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"selectionManager",{get:function(){return this._selectionManager},enumerable:!0,configurable:!0});c.prototype.resizeColumn=
function(a,c){this.coords.setColWidth(a,c,!1,!0)};c.prototype.resizeRow=function(a,c){this.coords.setRowHeight(a,c,!1,!0)};c.prototype.makeFieldsDraggable=function(){var a=this;this.droppable({onDrop:function(c,b,d,e){return a.onDrop(c,b,d,e)},onDragOver:function(c,b,d,e){return a.onDragOver(c,b,d,e)},onDragLeave:function(c,b,d,e){return a.onDragLeave(c,b,d,e)}})};c.prototype.createHeaderDragHelper=function(a){var c=new uicontrols.UIElement("span");c.addClass("wdr-helper");c.addClass("wdr-draggable");
c.addClass("wdr-header-helper");c.css("position","absolute");c.css("z-index",100);c.text(a.element.firstChild.textContent);return c};c.prototype.onDragOver=function(a,c,b,d){a=uicontrols.UIElement.convert(d.target);a.hasClass("wdr-header-drop-indicator")||this.showIndicator(a,a)};c.prototype.onDragLeave=function(a,c,b,d){this.removeDropIndicator()};c.prototype.onDrop=function(a,c,b,d){};c.prototype.showIndicator=function(a,c){};c.prototype.createDropIndicator=function(){return this._dropIndicator?
this._dropIndicator:new uicontrols.UIElement("div","wdr-header-drop-indicator")};c.prototype.removeDropIndicator=function(){this._dropIndicator&&(this._dropIndicator.removeFromParent(!0),this._dropIndicator=null)};return c}(uicontrols.UIElement);f.BaseGridLayout=b})(h.sheet||(h.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(c){var b=a.call(this,c,null)||this;b._coords=c;b._hierarchies=[];b.addClass("wdr-filters");b.addEventListener(e.GridEvent.MOUSE_CLICK,function(a){return b.onClick(a)});return b}__extends(c,a);c.prototype.draw=function(){for(var a=[],c=new HtmlNodeWrapper,b=0;b<this._coords.frozenRowsCount;b++){c.tag="div";c.addClass("wdr-row");for(var e=0;e<this._coords.frozenColsCount;e++)if(d.model._options.OptionsManager.showHierarchyCaptions){var f=
b-this._coords.frozenRowsCount+this._hierarchies.length;c.text+=this.createFilterCell(b,e,0<=f?this._hierarchies[f]:null).toHtml()}else c.text+=this.createCell(b,e).toHtml();a.push(c.toHtml())}a=a.join("");this.element.innerHTML!=a&&this.html(a)};c.prototype.createFilterCell=function(a,c,b){var f=this._hierarchies.indexOf(b);this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);this.cell.addClass(e.vo.GridStyleName.HEADER);this.cell.addClass(e.vo.GridStyleName.HEADER_ROW);
b?(this.cell.addClass(e.vo.GridStyleName.LEVEL+f),this.cell.text=b.caption,d.model._options.OptionsManager.showFilter&&(this.cell.addClass(e.vo.GridStyleName.FILTER_HEADER),b.hasFilter()&&(this.cell.addClass(e.vo.GridStyleName.FILTERED),this.cell.text+=this.createIcon(e.vo.GridStyleName.FILTERED_ICON,d.model._labels.Labels.TOOLTIPS_FILTERED)),this.cell.attr.title=d.model._labels.Labels.TOOLTIPS_FILTER_ICON,this.cell.text+=this.createIcon(e.vo.GridStyleName.FILTER_ICON))):this.cell.addClass(e.vo.GridStyleName.CELL_EMPTY);
this.setCellSize(this.cell,a,c);this.cell.attr["data-c"]=c;this.cell.attr["data-r"]=a;0<=f&&(this.cell.attr["data-h"]=f);return this.cell};c.prototype.setHierarchies=function(a){for(var c=this._hierarchies.length=0;c<a.length;c++){var b=a.getItemAt(c);!1==b.isMeasures&&this._hierarchies.push(b)}};c.prototype.onClick=function(a){var c=a.element;c.hasClass(e.vo.GridStyleName.FILTER_HEADER)&&(c=parseInt(c.attr("data-h")),isNaN(c)||this.dispatch(new e.FilterClickEvent(this._hierarchies[c],a.cell)))};
c.prototype.clear=function(){this._hierarchies.length=0;this.draw()};return c}(f.AbstractSheet);f.RowsFilter=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(c){var b=a.call(this,c,null)||this;b.rowIndex=0;b._coords=c;b._hierarchies=[];b.addClass("wdr-filters");b.hide();b.addEventListener(e.GridEvent.MOUSE_CLICK,function(a){return b.onClick(a)});return b}__extends(c,a);c.prototype.draw=function(){this.removeAllChildren();if(d.model._options.OptionsManager.showHierarchyCaptions){var a=new HtmlNodeWrapper("div");a.addClass("wdr-row");a.style.height=this._coords.getRowHeight(this.rowIndex)+
"px";for(var c=0;c<this._hierarchies.length;c++)a.text+=this.createFilterCell(this.rowIndex,c,this._hierarchies[c]).toHtml();this.html(a.toHtml());0==this._hierarchies.length?this.hide():this.show()}else this.hide()};c.prototype.createFilterCell=function(a,c,b){this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);this.cell.addClass(e.vo.GridStyleName.HEADER);b&&(this.cell.text=b.caption,d.model._options.OptionsManager.showFilter&&(this.cell.addClass(e.vo.GridStyleName.FILTER_HEADER),
this.cell.attr.title=d.model._labels.Labels.TOOLTIPS_FILTER_ICON,b.hasFilter()&&(this.cell.addClass(e.vo.GridStyleName.FILTERED),this.cell.text+=this.createIcon(e.vo.GridStyleName.FILTERED_ICON,d.model._labels.Labels.TOOLTIPS_FILTERED)),this.cell.text+=this.createIcon(e.vo.GridStyleName.FILTER_ICON)));this.cell.style["min-height"]=this._coords.getRowHeight(a)+"px";this.cell.attr["data-r"]=a;this.cell.attr["data-h"]=c;return this.cell};c.prototype.setHierarchies=function(a){for(var c=this._hierarchies.length=
0;c<a.length;c++){var b=a.getItemAt(c);!1==b.isMeasures&&this._hierarchies.push(b)}0==this._hierarchies.length?this.hide():this.show()};c.prototype.onClick=function(a){a=a.element;if(a.hasClass(e.vo.GridStyleName.FILTER_HEADER)){var c=parseInt(a.attr("data-h"));isNaN(c)||this.dispatch(new e.FilterClickEvent(this._hierarchies[c],null,a))}};c.prototype.clear=function(){this._hierarchies.length=0;this.draw()};return c}(f.AbstractSheet);f.ColumnsFilter=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||
(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(c){function b(){var a=c.call(this)||this;a._hierarchies=[];a.addClass("wdr-ui-hgroup");a.addClass("wdr-filters");a.hide();return a}__extends(b,c);b.prototype.draw=function(){var c=this;this.removeAllChildren();if(d.model._options.OptionsManager.showFilter&&d.model._options.OptionsManager.showReportFiltersArea){for(var b=0;b<this._hierarchies.length;b++){var e=new a(this._hierarchies[b],!0);e.container.attr("data-h",b);e.addEventListener(uicontrols.UIButton.CLICK_EVENT,
function(a){return c.onClick(a)});this.addChild(e.container)}0==this._hierarchies.length?this.hide():this.show()}else this.hide()};b.prototype.setHierarchies=function(a){for(var c=this._hierarchies.length=0;c<a.length;c++){var b=a.getItemAt(c);!1==b.isMeasures&&this._hierarchies.push(b)}this.draw()};b.prototype.onClick=function(a){a=a.target;this.dispatch(new e.FilterClickEvent(a.hierarchy,null,a.container))};b.prototype.clear=function(){this._hierarchies.length=0;this.draw()};Object.defineProperty(b.prototype,
"isEmpty",{get:function(){return 0==this._hierarchies.length},enumerable:!0,configurable:!0});return b}(uicontrols.UIElement);f.PagesFilter=b;var a=function(a){function b(d,g){void 0===g&&(g=!1);var f=a.call(this)||this;f._isPage=!1;f._hierarchy=d;f._isPage=g;f.setLabel(f._hierarchy.caption);f.removeClass("wdr-ui-btn");f.addClass(e.vo.GridStyleName.FILTER_HEADER);f.addClass(e.vo.GridStyleName.HEADER);f._filterIcon=new uicontrols.UIElement("i",e.vo.GridStyleName.ICON);f._filterIcon.addClass(e.vo.GridStyleName.FILTER_ICON);
f.container.append(f._filterIcon);f._filteredIcon=new uicontrols.UIElement("i",e.vo.GridStyleName.ICON);f._filteredIcon.addClass(e.vo.GridStyleName.FILTERED_ICON);f.container.append(f._filteredIcon);f.isFiltered=f._hierarchy.hasFilter();f._isPage&&(f._description=new uicontrols.UILabel,f._description.setLabel(f.getFilterDescription()),f._description.addClass("wdr-filter-desc"),f.addChild(f._description));return f}__extends(b,a);Object.defineProperty(b.prototype,"hierarchy",{get:function(){return this._hierarchy},
enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"isFiltered",{get:function(){return this.container.hasClass("wdr-filtered")},set:function(a){this.container.toggleClass("wdr-filtered",a)},enumerable:!0,configurable:!0});b.prototype.getFilterDescription=function(){var a=d.model._labels.Labels.FILTER_ALL;this.hierarchy.hasFilter()&&(a=1==this.hierarchy.filter.length?this.hierarchy.filter.getItemAt(0).caption:d.model._labels.Labels.FILTER_MULTIPLE_ITEMS);return a};return b}(uicontrols.UIButton);
f.FilterCell=a})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(){var b=a.call(this)||this;b._type=c.TYPE;b.addClass("wdr-compact-view");return b}__extends(c,a);c.prototype.setControls=function(){a.prototype.setControls.call(this);this.createColsFilter();this.createRowsFilter();this.createPageFilter()};c.prototype.createColsFilter=function(){var a=this;this._colsFilter=new f.ColumnsFilter(this._coords);this._colsFilter.id="wdr-cols-filter";this._colsFilter.addEventListener(e.GridEvent.FILTER_CLICK,
function(c){return a.onFilterClick(c)});this.addChild(this._colsFilter)};c.prototype.createRowsFilter=function(){var a=this;this._rowsFilter=new f.RowsFilter(this._coords);this._rowsFilter.id="wdr-rows-filter";this._rowsFilter.addEventListener(e.GridEvent.FILTER_CLICK,function(c){return a.onFilterClick(c)});this._rowsFilter.addEventListener(e.GridEvent.MOUSE_CLICK,function(c){return a.onClick(c)});this.addChild(this._rowsFilter)};c.prototype.createPageFilter=function(){var a=this;this._pageFilter=
new f.PagesFilter;this._pageFilter.id="wdr-page-filter";this._pageFilter.addEventListener(e.GridEvent.FILTER_CLICK,function(c){return a.onFilterClick(c)});this.addChild(this._pageFilter)};c.prototype.drawFirst=function(){this._coords.filtersHeight=this._pageFilter.isEmpty?0:this._pageFilter.element.offsetHeight;a.prototype.drawFirst.call(this);this._rowsFilter.draw()};c.prototype.drawLast=function(){a.prototype.drawLast.call(this);this._colsFilter.draw()};c.prototype.calculateSizesFirst=function(){this._rowsFilter.calculateSizes(!0);
return a.prototype.calculateSizesFirst.call(this)||this._rowsFilter.isDirty};c.prototype.calculateSizesAll=function(){this._rowsFilter.calculateSizes(!0);return a.prototype.calculateSizesAll.call(this)||this._rowsFilter.isDirty};c.prototype.drawLayout=function(){a.prototype.drawLayout.call(this);this._pageFilter.isEmpty||(this._pageFilter.top=this._coords.titleHeight,this._pageFilter.left=0,this._pageFilter.right=0);this._colResizeHandles.top=this._coords.gridStartY;this._rowResizeHandles.top=this._coords.gridStartY;
this._sheetHeaders.top=this._coords.gridStartY;this._sheetHeaders.left=0;this._sheetHeaders.width=this._coords.rowHeadersWidth;this._sheetHeaders.height=this._coords.colHeadersHeight;this._rowsFilter.left=this._coords.getColX(0,!0);this._rowsFilter.top=this._coords.gridStartY+this._coords.getRowY(0,!0);this._colsFilter.top=this._coords.gridStartY+this._coords.getRowY(this._colsFilter.rowIndex,!0);this._colsFilter.left=this._coords.rowHeadersWidth;this._colsFilter.right=Math.max(0,this._coords.layoutWidth-
this._coords.getRelativeColX(this._coords.maxColsCount,this.isSmooth));this._colsSheet.left=this._coords.rowHeadersWidth;this._colsSheet.top=this._coords.gridStartY;this._colsSheet.width=this._coords.dataWidth;this._colsSheet.height=this._coords.layoutHeight-this._coords.gridStartY;this._rowsSheet.left=0;this._rowsSheet.top=this._coords.colHeadersHeight+this._coords.gridStartY;this._rowsSheet.width=this._coords.layoutWidth;this._rowsSheet.height=this._coords.dataHeight;this._dataSheet.left=this._coords.rowHeadersWidth-
1;this._dataSheet.top=this._coords.colHeadersHeight+this._coords.gridStartY-1;this._dataSheet.width=this._coords.dataWidth;this._dataSheet.height=this._coords.dataHeight+1};c.prototype.drawAfterResize=function(){a.prototype.drawAfterResize.call(this);this._rowsFilter.draw();this._colsFilter.draw()};c.prototype.makeFieldsDraggable=function(){var c=this;a.prototype.makeFieldsDraggable.call(this);for(var b={createHelper:function(a){return c.createHeaderDragHelper(a)}},d=this._colsFilter.find(".wdr-header:not(.wdr-empty)",
!0),e=0;e<d.length;e++)d[e].draggable(b);d=this._rowsFilter.find(".wdr-header:not(.wdr-empty)",!0);for(e=0;e<d.length;e++)d[e].draggable(b);d=this._pageFilter.find(".wdr-header:not(.wdr-empty)",!0);for(e=0;e<d.length;e++)d[e].draggable(b)};c.prototype.onDrop=function(a,c,b,e){b=this.getDropTargetFilter(b);if(null==b)this.removeDropIndicator();else if(e=this.getDropPosition(b,this._dropIndicator),this.removeDropIndicator(),!isNaN(e)){var f=parseInt(a.attr("data-h")),h=a.closest(".wdr-filters");c=d.data_.Cube.getInstance().slice_.clone();
var n;h==this._colsFilter?(n=c.columnsOnly.getItemAt(f),f=c.columns.indexOf(n.uniqueName)):h==this._rowsFilter?(n=c.rowsOnly.getItemAt(f),f=c.rows.indexOf(n.uniqueName)):h==this._pageFilter&&(n=c.pages.getItemAt(f),f=c.pages.indexOf(n.uniqueName));null==n||b==h&&f==e||(a.hide(),b==h?b==this._colsFilter?c.columns.moveItemAt(f,e):b==this._rowsFilter?c.rows.moveItemAt(f,e):b==this._pageFilter&&c.pages.moveItemAt(f,e):(c.columns.removeItem(n.uniqueName),c.rows.removeItem(n.uniqueName),c.pages.removeItem(n.uniqueName),
b==this._colsFilter?c.columns.addItemAt(n.uniqueName,n,e):b==this._rowsFilter?c.rows.addItemAt(n.uniqueName,n,e):b==this._pageFilter&&c.pages.addItemAt(n.uniqueName,n,e)),1<c.columns.length&&c.columns.getItemAt(0).isMeasures&&(a=c.columns.getItemAt(0),c.columns.splice(0,1),c.columns.addItemAt(a.uniqueName,a,c.columns.length)),d.model.PivotModel.getInstance().runQuery(c))}};c.prototype.getDropPosition=function(a,c){return a==this._colsFilter?this.getColumnDropPosition(c):a==this._rowsFilter?this.getRowDropPosition(c):
a==this._pageFilter?this.getPageDropPosition(c):NaN};c.prototype.getColumnDropPosition=function(a){var c=d.data_.Cube.getInstance().slice_;if(null!=a){a=a.index();if(a>c.columns.length)return c.columns.length;c=c.columns.indexOf("[Measures]");0<=c&&c<=a&&0!=a&&a++;return a}return NaN};c.prototype.getRowDropPosition=function(a){var c=d.data_.Cube.getInstance().slice_;if(null!=a){a=a.parent.hasClass("wdr-filters")?c.rows.length:(a=a.parent.find(".wdr-header"))?parseInt(a.attr("data-h")):0;if(a>c.rows.length)return c.rows.length;
c=c.rows.indexOf("[Measures]");0<=c&&c<=a&&0!=a&&a++;return a}return NaN};c.prototype.getPageDropPosition=function(a){var c=d.data_.Cube.getInstance().slice_;return null!=a?(a=a.index(),a>c.columns.length?c.columns.length:a):NaN};c.prototype.getDropTargetFilter=function(a){var c=a.closest(".wdr-filters");if(null==c){var b=a.closest(".wdr-cell");null!=b?(a=parseInt(b.attr("data-r")),b=parseInt(b.attr("data-c")),this.isOverColumns(a,b)?c=this._colsFilter:this.isOverRows(a,b)&&(c=this._rowsFilter)):
(b=a.closest(".wdr-resize-handles"),null!=b&&("wdr-cols-resize"==b.id?c=this._colsFilter:"wdr-rows-resize"==b.id&&(c=this._rowsFilter)))}return c};c.prototype.isOverColumns=function(a,c){return c>=this.coords.frozenColsCount};c.prototype.isOverRows=function(a,c){return c<=this.coords.frozenColsCount};c.prototype.showIndicator=function(a,c){a=this.getDropTargetFilter(a);if(null==a)this.removeDropIndicator();else{var b=c.closest(".wdr-header:not(.wdr-empty)");null!=c.closest(".wdr-filters")&&null!=
b?(this._dropIndicator=this.createDropIndicator(),a==this._pageFilter?b.before(this._dropIndicator):c.before(this._dropIndicator)):(this._dropIndicator=this.createDropIndicator(),a==this._colsFilter?this._colsFilter.find(".wdr-row").append(this._dropIndicator):a==this._rowsFilter?null!=c.closest(".wdr-filters")?this._rowsFilter.find(".wdr-header").before(this._dropIndicator):this._type==f.classic.ClassicGridLayout.TYPE?this._rowsFilter.find(".wdr-header").parent.append(this._dropIndicator):this._rowsFilter.append(this._dropIndicator):
a==this._pageFilter&&this._pageFilter.append(this._dropIndicator))}};c.prototype.clearAll=function(){a.prototype.clearAll.call(this);this._colsFilter.clear();this._pageFilter.clear();this._rowsFilter.clear()};Object.defineProperty(c.prototype,"colsFilter",{get:function(){return this._colsFilter},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"rowsFilter",{get:function(){return this._rowsFilter},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"pageFilter",{get:function(){return this._pageFilter},
enumerable:!0,configurable:!0});c.prototype.dispose=function(){this._colsFilter.removeAllEventListeners();this._colsFilter.dispose();this._rowsFilter.removeAllEventListeners();this._rowsFilter.dispose();this._pageFilter.removeAllEventListeners();a.prototype.dispose.call(this)};c.TYPE="compact";return c}(f.BaseGridLayout);f.CompactGridLayout=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(a){function c(c){var b=a.call(this,"div","wdr-resize-handles")||this;b._mouseDownHandler=function(a){return b.onMouseDown(a)};b._mouseUpHandler=function(a){return b.onMouseUp(a)};b._mouseMoveHandler=function(a){return b.onMouseMove(a)};b._handle=new HtmlNodeWrapper;b._gridLayout=c;b._coords=c.coords;b.element.addEventListener("mousedown",b._mouseDownHandler);document.body.addEventListener("mouseup",b._mouseUpHandler);b._indicator=
new uicontrols.UIElement("div","wdr-indicator");b._indicator.hide();b.addChild(b._indicator);b._wrapper=new uicontrols.UIElement("div","wdr-wrapper");b._wrapper.attr("title",d.model._labels.Labels.TOOLTIPS_HEADER_FIT);b.addChild(b._wrapper);return b}__extends(c,a);c.prototype.draw=function(){this._wrapper.attr("title",d.model._labels.Labels.TOOLTIPS_HEADER_FIT)};c.prototype.createHandle=function(a){this._handle.tag="div";this._handle.addClass("wdr-handle");this._handle.attr["data-idx"]=a;this._handle.attr.title=
d.model._labels.Labels.TOOLTIPS_HEADER_RESIZE;return this._handle};c.prototype.onMouseDown=function(a){if(a.target.classList.contains("wdr-handle")){this._currentHandle=a.target;this._currentHandle.classList.add("wdr-active");this._baseOffset=this.getOffset();document.body.addEventListener("mousemove",this._mouseMoveHandler);a.stopImmediatePropagation();var c=parseInt(this._currentHandle.getAttribute("data-idx"));this.startResizing(this._currentHandle,c);a.preventDefault();a.stopImmediatePropagation()}};
c.prototype.startResizing=function(a,c){};c.prototype.onMouseUp=function(a){document.body.removeEventListener("mousemove",this._mouseMoveHandler);this._currentHandle&&(this._currentHandle.classList.remove("wdr-active"),a=parseInt(this._currentHandle.getAttribute("data-idx")),this.stopResizing(this._currentHandle,a),this._currentHandle=null,this._indicator.hide())};c.prototype.stopResizing=function(a,c){};c.prototype.onMouseMove=function(a){var c=a.clientX-this._baseOffset.left,b=a.clientY-this._baseOffset.top;
if(0>c||0>b||c>this._coords.layoutWidth||b>this._coords.layoutHeight)this.onMouseUp(a);else this.positionHandle(this._currentHandle,c,b),this._indicator.show()};c.prototype.positionHandle=function(a,c,b){};c.prototype.dispose=function(){this.element&&this.element.removeEventListener("mousedown",this._mouseDownHandler);document.body.removeEventListener("mousemove",this._mouseMoveHandler);document.body.removeEventListener("mouseup",this._mouseUpHandler);a.prototype.dispose.call(this)};return c}(uicontrols.UIElement);
e.ResizeHandles=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(e){var b=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.draw=function(){a.prototype.draw.call(this);this._wrapper.removeAllChildren();for(var c="",b=0;b<this._coords.frozenRowsCount;b++)c+=this.createHandle(b).toHtml(!0);for(var b=this._coords.getBoundTop(),d=Math.min(this._coords.maxRowsCount,this._coords.getBoundBottom());b<d;b++)c+=this.createHandle(b).toHtml(!0);this._wrapper.html(c)};c.prototype.createHandle=
function(c){a.prototype.createHandle.call(this,c);this._handle.style.top=this._coords.getRelativeRowY(c,this._gridLayout.isSmooth,!1)+this._coords.getRowHeight(c)+"px";return this._handle};c.prototype.startResizing=function(a,c){this._startY=this._coords.getRelativeRowY(c,this._gridLayout.isSmooth,!1)};c.prototype.stopResizing=function(a,c){var b=Math.round(a.offsetTop+a.clientHeight/2-this._startY),b=Math.max(e.GridCoords.CELL_MIN_HEIGHT,b);this.dispatchWith(d.GridEvent.RESIZE_ROW,this,{height:b,
rowIdx:c})};c.prototype.positionHandle=function(a,c,b){b=Math.max(this._startY+e.GridCoords.CELL_MIN_HEIGHT,b);a.style.top=b+"px";this._indicator.top=b;this._indicator.width=this._coords.availableWidth};return c}(e.ResizeHandles);e.RowResizeHandles=b})(d.sheet||(d.sheet={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){(function(e){var b=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.draw=function(){a.prototype.draw.call(this);this._wrapper.removeAllChildren();for(var c="",b=0;b<this._coords.frozenColsCount;b++)c+=this.createHandle(b).toHtml(!0);for(var d=Math.min(this._coords.maxColsCount,this._coords.getBoundRight()),b=this._coords.getBoundLeft();b<d;b++)c+=this.createHandle(b).toHtml(!0);this._wrapper.html(c)};c.prototype.createHandle=
function(c){a.prototype.createHandle.call(this,c);this._handle.style.left=this._coords.getRelativeColX(c,this._gridLayout.isSmooth)+this._coords.getColWidth(c)+"px";return this._handle};c.prototype.startResizing=function(a,c){this._startX=this._coords.getRelativeColX(c,this._gridLayout.isSmooth)};c.prototype.stopResizing=function(a,c){var b=Math.round(a.offsetLeft+a.clientWidth/2-this._startX),b=Math.max(e.GridCoords.CELL_MIN_WIDTH,b);this.dispatchWith(d.GridEvent.RESIZE_COLUMN,this,{width:b,colIdx:c})};
c.prototype.positionHandle=function(a,c,b){c=Math.max(this._startX+e.GridCoords.CELL_MIN_WIDTH,c);a.style.left=c+"px";this._indicator.left=c;this._indicator.height=this._coords.availableHeight};return c}(e.ResizeHandles);e.ColumnResizeHandles=b})(d.sheet||(d.sheet={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){(function(b){var a=function(a){function g(){var b=a.call(this)||this;b._type=g.TYPE;b.removeClass("wdr-compact-view");b.addClass("wdr-classic-view");return b}__extends(g,a);g.prototype.createRowsFilter=function(){var a=this;this._rowsFilter=new b.ClassicRowsFilter(this._coords);this._rowsFilter.id="wdr-rows-filter";this._rowsFilter.addEventListener(e.GridEvent.FILTER_CLICK,function(c){return a.onFilterClick(c)});this._rowsFilter.addEventListener(e.GridEvent.MOUSE_CLICK,
function(c){return a.onClick(c)});this.addChild(this._rowsFilter)};g.prototype.drawFirst=function(){this.isClassicViewOk?a.prototype.drawFirst.call(this):(d.uialert(d.model._labels.Labels.MESSAGE_TOO_MANY_COLUMNS_IN_CLASSIC_MODE,d.model._labels.Labels.CONFIRMATION,d.AlertType.CONFIRMATION),d.model.PivotModel.getInstance().setOptions({gridType:e.GridType.COMPACT}),d.model.PivotModel.getInstance().refresh())};Object.defineProperty(g.prototype,"isClassicViewOk",{get:function(){return this._coords.dataWidth>
this._coords.minDataWidth},enumerable:!0,configurable:!0});g.prototype.clearDrawings=function(){a.prototype.clearDrawings.call(this);this._rowsFilter.clearDrawings()};g.prototype.getRowDropPosition=function(a){var c=d.data_.Cube.getInstance().slice_;if(null!=a){a=a.index();if(a>c.rows.length)return c.rows.length;c=c.rows.indexOf("[Measures]");0<=c&&c<=a&&0!=a&&a++;return a}return NaN};g.TYPE="classic";return g}(f.CompactGridLayout);b.ClassicGridLayout=a})(f.classic||(f.classic={}))})(e.sheet||(e.sheet=
{}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){(function(b){var a=function(a){function b(d){return a.call(this,d)||this}__extends(b,a);b.prototype.dispose=function(){utils.fmClearTimeout(this._timeout);a.prototype.dispose.call(this)};b.prototype.draw=function(){for(var a=this,c=[],b=new HtmlNodeWrapper,e=0;e<this._coords.frozenRowsCount;e++){b.tag="div";b.addClass("wdr-row");for(var g=0;g<this._coords.frozenColsCount;g++)b.text=d.model._options.OptionsManager.showHierarchyCaptions?b.text+this.createFilterCell(e,
g,e==this._coords.frozenRowsCount-1?this._hierarchies[g]:null).toHtml():b.text+this.createCell(e,g).toHtml();c.push(b.toHtml())}this.html(c.join(""));this._timeout=utils.fmSetTimeout(function(){return a.calculateSizes(!0)},0)};b.prototype.clearDrawings=function(){utils.fmClearTimeout(this._timeout)};return b}(e.RowsFilter);b.ClassicRowsFilter=a})(e.classic||(e.classic={}))})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){(function(f){(function(b){var a=function(a){function g(){var b=a.call(this)||this;b._isDrillThrough=!1;b._hierachiesList=null;b.colsScrollHander=function(a){return b.onColsScroll(a)};b._type=g.TYPE;b.addClass("wdr-flat-view");return b}__extends(g,a);g.prototype.createColsSheet=function(){var a=this;this._colsSheet=new b.FlatColumnsSheet(this._coords,function(c,b){return a.getCell(c,b)});this._colsSheet.id="wdr-cols-sheet";this._colsSheet.scrollPane.element.addEventListener("wheel",
this.colsScrollHander);this._colsSheet.addEventListener(h.GridEvent.MOUSE_CLICK,function(c){return a.onClick(c)});this._colsSheet.addEventListener(h.GridEvent.MOUSE_CLICK,function(c){return a.onClickForApi(c)});this._colsSheet.addEventListener(h.GridEvent.FILTER_CLICK,function(c){return a.onFilterClick(c)});this.addChild(this._colsSheet)};g.prototype.drawLayout=function(){a.prototype.drawLayout.call(this);this._sheetHeaders.top=this._coords.gridStartY;this._sheetHeaders.left=0;this._sheetHeaders.width=
this._coords.rowHeadersWidth;this._sheetHeaders.height=this._coords.colHeadersHeight;this._colsSheet.left=this._coords.rowHeadersWidth;this._colsSheet.top=this._coords.gridStartY;this._colsSheet.width=this._coords.dataWidth;this._colsSheet.height=this._coords.layoutHeight-this._coords.gridStartY;this._rowsSheet.left=0;this._rowsSheet.top=this._coords.colHeadersHeight+this._coords.gridStartY;this._rowsSheet.width=this._coords.layoutWidth;this._rowsSheet.height=this._coords.dataHeight;this._dataSheet.left=
this._coords.rowHeadersWidth-1;this._dataSheet.top=this._coords.colHeadersHeight+this._coords.gridStartY-1;this._dataSheet.width=this._coords.dataWidth;this._dataSheet.height=this._coords.dataHeight+1};g.prototype.drawLast=function(){a.prototype.drawLast.call(this)};Object.defineProperty(g.prototype,"isDrillThrough",{get:function(){return this._isDrillThrough},set:function(a){this._isDrillThrough=a},enumerable:!0,configurable:!0});g.prototype.makeFieldsDraggable=function(){var b=this;a.prototype.makeFieldsDraggable.call(this);
for(var d={createHelper:function(a){return b.createHeaderDragHelper(a)}},e=this._colsSheet.find(".wdr-header",!0),g=0;g<e.length;g++)e[g].draggable(d)};g.prototype.showIndicator=function(a,c){var b=c.closest(".wdr-cell");null!=b?(b=parseInt(b.attr("data-c")),b=Math.min(b,this.coords.dataColsCount),this._dropIndicator=this.createDropIndicator(),this._dropIndicator.left=this.coords.getRelativeColX(b,this.isSmooth)-(b==this.coords.dataColsCount?0:this._dropIndicator.width),this._dropIndicator.top=this._coords.gridStartY+
this.coords.getRelativeRowY(0,this.isSmooth)-1,this._dropIndicator.height=this.coords.getRowHeight(0)+1,this.append(this._dropIndicator)):this.removeDropIndicator()};g.prototype.onDrop=function(a,c,b,g){this.removeDropIndicator();g=b.closest(".wdr-cell");null!=g&&(c=d.data_.Cube.getInstance().slice_.clone(),b=this.isDrillThrough&&null!=this._hierachiesList?this._hierachiesList:c.flatten(),g=parseInt(g.attr("data-c")),a=parseInt(a.attr("data-c")),g=Math.max(0,Math.min(g,b.length-1)),a!=g&&(b.moveItemAt(a,
g),0<c.flatOrder.length&&(c.flatOrder=b.toKeyArray()),this.isDrillThrough?(this._hierachiesList=b,c.flatOrder=b.toKeyArray(),this.dispatchWith(e.config.FieldsView.EVENT_APPLY_SLICE,this,c)):(c.rows=b,d.model.PivotModel.getInstance().runQuery(c))))};g.TYPE="flat";return g}(f.BaseGridLayout);b.FlatGridLayout=a})(f.flat||(f.flat={}))})(h.sheet||(h.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){(function(b){var a=function(a){function b(d,g){var f=a.call(this,d,g)||this;f.addEventListener(e.GridEvent.MOUSE_CLICK,function(a){return f.onFilterClick(a)});return f}__extends(b,a);b.prototype.onFilterClick=function(a){null!=a.cell&&a.cell.isFilterHeader&&null!=a.cell.hierarchy&&a.cell.activeElementType!=e.vo.GridCellElementType.RIGHT_ICON&&this.dispatch(new e.FilterClickEvent(a.cell.hierarchy,a.cell))};b.prototype.createCell=function(b,g,f){void 0===
f&&(f=!1);this.cell=a.prototype.createCell.call(this,b,g,f);(b=this._getDataFunc?this._getDataFunc(b,g):null)&&b.isFilterHeader&&(this.cell.addClass(e.vo.GridStyleName.FILTER_HEADER),b.filtered&&(this.cell.addClass(e.vo.GridStyleName.FILTERED),this.cell.text+=this.createIcon(e.vo.GridStyleName.FILTERED_ICON,d.model._labels.Labels.TOOLTIPS_FILTERED)),this.cell.attr.title=d.model._labels.Labels.TOOLTIPS_FILTER_ICON,this.cell.text+=this.createIcon(e.vo.GridStyleName.FILTER_ICON));return this.cell};return b}(f.ColumnHeadersSheet);
b.FlatColumnsSheet=a})(f.flat||(f.flat={}))})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(b){function a(){var a=b.call(this,"div")||this;a.leaveHandler=function(b){return a.onMouseLeave(b)};a.list=new uicontrols.lists.UIList;a.list.markSelected=!0;a.list.setItemRendererFactory(a.itemRendererFactory);a.list.setLabelField("caption");a.list.addEventListener(events._Event.CHANGE,function(b){return a.onListChange(b)});a.addChild(a.list);a.container.disableSelection();var d=new uicontrols.UIElement("div","wdr-arrow");a.container.addChild(d);
return a}__extends(a,b);a.prototype.showWith=function(a,b){this.origin=b;this.fieldData=a;this.setData(a);this.show();this.container.addEventListener("mouseleave",this.leaveHandler);document.body.addEventListener("mousedown",this.leaveHandler);var d=b.getOffset(this.container.element.offsetParent);this.container.css("right",this.container.element.offsetParent.clientWidth-d.left+"px");this.container.css("top",d.top-this.getHeight()/2+b.getHeight()/2+"px")};a.prototype.onMouseLeave=function(a){if("mousedown"!=
a.type||null==uicontrols.UIElement.convert(event.target).closest("#wdr-aggregations-view"))this.container.removeEventListener("mouseleave",this.leaveHandler),document.body.removeEventListener("mousedown",this.leaveHandler),this.hide()};a.prototype.onStageMouseDown=function(a){null==uicontrols.UIElement.convert(a.target).closest("#wdr-aggregations-view")&&this.hide()};a.prototype.setData=function(a){for(var b,d=0,e=[],f=0;f<a.availableAggregations.length;f++)b={caption:a.availableAggregationsCaptions[f],
aggregation:a.availableAggregations[f]},void 0!=a.availableAggregationsTotalCaptions&&(b.totalCaption=a.availableAggregationsTotalCaptions[f]),e.push(b),a.availableAggregations[f]==a.aggregation&&(d=f);this.list.setDataProvider(e);this.list.setSelectedIndex(d);this.list.container.setScrollTop(0)};a.prototype.onListChange=function(a){this.dispatchWith(events._Event.CHANGE,this,{fieldData:this.fieldData,aggrData:a.data.selectedItem,origin:this.origin});this.hide()};a.prototype.itemRendererFactory=function(a,
b){var d=new uicontrols.renderers.SelectItemRenderer;d.setData(a);d.setIndex(b);return d};return a}(uicontrols.UIComponentBase);d.AggregationsView=e})(d.config||(d.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(){function a(){}a.prototype.update=function(a,b,d){this._structure=a;this._slice=b;this._dataSourceType=d;this.clearSearch();this.updateSlice();this.updateStructure()};a.prototype.updateSlice=function(){this.pages=this.getPages();this.rows=this.getRows();this.markValues(this.rows);this.columns=this.getColumns();this.markValues(this.columns);this.measures=this.getMeasures();this.markMeasures(this.measures)};a.prototype.updateStructure=
function(){this._hierarchies=[];this.allHierarchies=[];this.addHierarchies(this._hierarchies,this.getAllHierarchies());this.removeSingleDimensions(this._hierarchies);this.addMeasures(this._hierarchies,this.getAllMeasures());this.sortHierarchies(this._hierarchies);if(a.expandFormulas){a.expandFormulas=!1;var c=utils.ArrayUtils.find(this._hierarchies,"/"+d.model._labels.Labels.FIELDS_LIST_FORMULAS_GROUP_NAME,"uniqueName");null!=c&&this.expandField(c)}this.markSelected(this.pages);this.markSelected(this.columns);
this.markSelected(this.rows);this.markSelected(this.measures)};a.prototype.onCalculatedValueAdded=function(a){if(null!=this._structure){var b=utils.ArrayUtils.find(this.getAllMeasures(),a,"uniqueName");null!=b&&(b.isMeasure=!0,b.showAggregations=this.isMeasuresAsHierarchies,a=utils.ArrayUtils.findIndex(this.measures,a,"uniqueName"),0<=a?(b.isChanged=!0,this.measures[a]=b):this.measures.push(b));this.updateStructure()}};a.prototype.onCalculatedValueRemoved=function(a){null!=this._slice&&null!=this._structure&&
(this.updateSlice(),this.updateStructure())};a.prototype.removeItemByName=function(a,b){for(var d=0;d<a.length;d++)if(a[d].uniqueName==b){a.splice(d,1);break}};a.prototype.markValues=function(a){a=utils.ArrayUtils.find(a,d.data_.Cube.MEASURES_NAME,"uniqueName");null!=a&&(a.caption=d.model._labels.Labels.FIELDS_LIST_VALUES,a.isValues=!0)};a.prototype.markMeasures=function(a){for(var b=0;b<a.length;b++)a[b].isMeasure=!0,a[b].showAggregations=d.model._options.OptionsManager.showAggregations};a.prototype.markSelected=
function(a){for(var b,d=0;d<a.length;d++)a[d].isSelected=!0,b=this.findItem(a[d].uniqueName,a[d].isMeasure),this._slice.allHierarchies().getItem(a[d].uniqueName),null!=b&&this.selectField(b,!0)};a.prototype.selectField=function(a,b){a.isSelected=b;null!=a.parent&&a.parent.isSelected!=b&&(!0==b?this.selectField(a.parent,b):!1==this.hasSelected(a.parent.children)&&this.selectField(a.parent,b));if(a.isLevelFolder&&!1==b)for(var d=0;d<a.children.length;d++)this.selectField(a.children[d],b)};a.prototype.hasSelected=
function(a){for(var b=0;b<a.length;b++)if(!0===a[b].isSelected)return!0;return!1};a.prototype.addHierarchies=function(a,b){for(var e,f,l=0;l<b.length;l++)e=this._structure.hierarchyToMeasure(b[l].uniqueName),null!=e&&e.type!=d.data_.types.MeasureType.COUNT&&""!=b[l].folder?(f=utils.ArrayUtils.find(this.allHierarchies,"Folder."+b[l].folder,"uniqueName"),null==f&&(f={isFolder:!0},f.uniqueName="Folder."+b[l].folder,f.caption=b[l].folder,f.children=[],a.push(f),this.allHierarchies.push(f)),b[l].level=
1,b[l].parent=f,f.children.push(b[l])):(e=utils.ArrayUtils.find(a,b[l].dimensionUniqueName,"uniqueName"),null==e&&(e={isFolder:!0},e.uniqueName=b[l].dimensionUniqueName,e.caption=b[l].dimensionCaption,e.children=[],e.level=0,a.push(e),this.allHierarchies.push(e)),b[l].isLevel?(e=""==b[l].folder?e:f,e=utils.ArrayUtils.find(e.children,b[l].hierarchyName,"uniqueName"),b[l].level=e.level+1,b[l].parent=e,null==e.children&&(e.children=[]),e.children.push(b[l]),e.isLevelFolder=!0):""!=b[l].folder?(f=utils.ArrayUtils.find(e.children,
e.uniqueName+b[l].folder,"uniqueName"),null==f&&(f={isFolder:!0},f.uniqueName=e.uniqueName+b[l].folder,f.caption=b[l].folder,f.children=[],f.level=1,f.parent=e,e.children.push(f),this.allHierarchies.push(f)),b[l].level=2,b[l].parent=f,f.children.push(b[l])):(b[l].level=1,b[l].parent=e,e.children.push(b[l]))),this.allHierarchies.push(b[l])};a.prototype.addMeasures=function(a,b){for(var e,f={},l=0;l<b.length;l++){b[l].isMeasure=!0;b[l].showAggregations=d.model._options.OptionsManager.showAggregations;
b[l].calculated&&(b[l].groupName=d.model._labels.Labels.FIELDS_LIST_FORMULAS_GROUP_NAME);this.isMeasuresAsHierarchies&&(e=this.toHierarchyUniqueName(b[l].uniqueName),e=utils.ArrayUtils.find(this.allHierarchies,e,"uniqueName"));if(this.isMeasuresAsHierarchies&&null!=e)e.measureItem=b[l],e.measureItem.hierarchyItem=e,b[l].parent=e.parent;else if(""!=b[l].groupName){var h=this.addMeasureFolders(f,b[l].groupName,b[l].folder.split("\\"),b[l].calculated),r=h.folder;null!=r&&0>r.children.indexOf(b[l])&&
r.children.push(b[l]);null!=h.root&&0>a.indexOf(h.root)&&a.push(h.root);b[l].level=h.folder.level+1;b[l].parent=r}else b[l].level=0,a.push(b[l]);this.allHierarchies.push(b[l])}};a.prototype.addMeasureFolders=function(a,b,d,e){void 0===e&&(e=!1);d.unshift(b);b="";for(var f=0,h,r,n,p=0;p<d.length;p++){var q=b+"/"+d[p];utils.nullOrEmpty(d[p])||(r=a[q],null==r&&(r={},r.caption=d[p],r.uniqueName=q,r.folder=b,r.children=[],r.level=f,r.isFolder=!0,r.isMeasuresFolder=!0,r.isCalculatedMeasuresFolder=e,this.allHierarchies.push(r),
a[r.uniqueName]=r),(r.parent=h)&&h.children&&0>h.children.indexOf(r)&&h.children.push(r),null==n&&(n=r),b+="/"+d[p],a=a[b],h=r,f++)}return{folder:r,root:n}};a.prototype.removeSingleDimensions=function(a){for(var b,d=0;d<a.length;d++)if(!0===a[d].isFolder&&1==a[d].children.length&&!0!==a[d].children[0].isFolder&&!a[d].children[0].calculated&&(b=a[d].children[0],b.level=0,b.parent=null,a.splice(d,1,b),b.children))for(var e=0;e<b.children.length;e++)b.children[e].level-=1};a.prototype.sortHierarchies=
function(a){var b=this;a.sort(function(a,c){var d=b.getFieldRank(a),e=b.getFieldRank(c);return d==e?a.caption.localeCompare(c.caption):e-d})};a.prototype.getFieldRank=function(a){return!0===a.isLevel?0:!0===a.isFolder&&!0!==a.isMeasuresFolder?3:!0!==a.isFolder&&!0!==a.isMeasure?2:!0===a.isFolder&&!0===a.isMeasuresFolder?1:0};a.prototype.collapseField=function(a){if(!this.isSearch){for(var b=this._hierarchies.indexOf(a)+1,d=0;d<a.children.length;d++)!0===a.children[d].isExpanded&&this.collapseField(a.children[d]);
this._hierarchies.splice(b,a.children.length);a.isExpanded=!1}};a.prototype.expandField=function(a){if(!this.isSearch){var b=this._hierarchies.indexOf(a)+1;a.isLevelFolder||this.sortHierarchies(a.children);utils.ArrayUtils.insert(this._hierarchies,a.children,b);a.isExpanded=!0}};a.prototype.toHierarchyUniqueName=function(a){a=this._structure.measureToHierarchy(a);return null!=a?a.uniqueName:""};a.prototype.toMeasureUniqueName=function(a){a=this._structure.hierarchyToMeasure(a);return null!=a?a.uniqueName:
""};a.prototype.findHierarchy=function(a){for(var b=0;b<this.allHierarchies.length;b++)if(!this.allHierarchies[b].isMeasure&&!this.allHierarchies[b].isFolder&&this.allHierarchies[b].uniqueName==a)return this.allHierarchies[b]};a.prototype.findMeasure=function(a){for(var b=0;b<this.allHierarchies.length;b++)if(this.allHierarchies[b].isMeasure&&!this.allHierarchies[b].isFolder&&this.allHierarchies[b].uniqueName==a)return this.allHierarchies[b]};a.prototype.findItem=function(a,b){void 0===b&&(b=!1);
return b?this.findMeasure(a):this.findHierarchy(a)};a.prototype.isValidSlice=function(){return 0<this.measures.length};a.prototype.getSlice=function(){return{pages:this.toPlainArray(this.pages),rows:this.toPlainArray(this.rows),columns:this.toPlainArray(this.columns),measures:this.toPlainArray(this.measures),flatOrder:this._slice?this._slice.flatOrder:[]}};a.prototype.isSliceDifferent=function(a){return null==this._slice?!0:this.isDifferent(a.pages,this._slice.pages.toArray())||this.isDifferent(a.rows,
this._slice.rows.toArray())||this.isDifferent(a.columns,this._slice.columns.toArray())||this.isDifferent(a.measures,this._slice.measures_.toArray())};a.prototype.toPlainArray=function(a){for(var b=[],d,e=0;e<a.length;e++)d={uniqueName:a[e].uniqueName},a[e].isMeasure&&(d.aggregation=a[e].aggregation,d.isChanged=a[e].isChanged),a[e].isLevel&&(d.activeLevelName=a[e].uniqueName,d.uniqueName=a[e].hierarchyName),b.push(d);return b};a.prototype.isDifferent=function(a,b){if(a.length!=b.length)return!0;for(var d=
0;d<b.length;d++)if(a[d].uniqueName!=b[d].uniqueName||a[d].aggregation!=b[d].aggregation||a[d].activeLevelName!=b[d].activeLevelName||a[d].isChanged)return!0;return!1};Object.defineProperty(a.prototype,"isMeasuresAsHierarchies",{get:function(){var a=this._dataSourceType;return a==d.data_.consts.DataSourceType.CSV||a==d.data_.consts.DataSourceType.JSON},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isExpandAll",{get:function(){for(var a=0;a<this._hierarchies.length;a++)if((this._hierarchies[a].isFolder||
this._hierarchies[a].isMeasuresFolder||this._hierarchies[a].isLevelFolder)&&!this._hierarchies[a].isExpanded)return!0;return!1},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasFolders",{get:function(){for(var a=0;a<this._hierarchies.length;a++)if(this._hierarchies[a].isFolder||this._hierarchies[a].isMeasuresFolder||this._hierarchies[a].isLevelFolder)return!0;return!1},enumerable:!0,configurable:!0});a.prototype.collapseAll=function(){if(!this.isSearch){for(var a=0;a<this._hierarchies.length;a++)if(this._hierarchies[a].isFolder||
this._hierarchies[a].isMeasuresFolder||this._hierarchies[a].isLevelFolder)this._hierarchies[a].isExpanded=!1;for(var b=[],a=0;a<this._hierarchies.length;a++)0==this._hierarchies[a].level&&b.push(this._hierarchies[a]);this._hierarchies.splice(0,this._hierarchies.length);utils.ArrayUtils.insert(this._hierarchies,b,0)}};a.prototype.expandAll=function(){if(!this.isSearch){this.collapseAll();for(var a=0;a<this._hierarchies.length;a++)(this._hierarchies[a].isFolder||this._hierarchies[a].isLevelFolder)&&
this._expandField(this._hierarchies[a],a+1)}};a.prototype._expandField=function(a,b){a.isExpanded=!0;null!=a.children&&0<a.children.length&&(this.sortHierarchies(a.children),utils.ArrayUtils.insert(this._hierarchies,a.children,b))};a.prototype.getPages=function(){return null!=this._slice?this.convertHierarchies(this._slice.pages):[]};a.prototype.getRows=function(){return null!=this._slice?this.convertHierarchies(this._slice.rows):[]};a.prototype.getColumns=function(){return null!=this._slice?this.convertHierarchies(this._slice.columns):
[]};a.prototype.getMeasures=function(){return null!=this._slice?this.convertMeasures(this._slice.measures_):[]};a.prototype.getAllHierarchies=function(){return null!=this._structure?this.convertHierarchies(this._structure.allHierarchies(!1),!0):[]};a.prototype.getAllMeasures=function(){return null!=this._structure?this.convertMeasures(this._structure.measures_):[]};a.prototype.convertHierarchies=function(a,b){void 0===b&&(b=!1);for(var d=[],e=0;e<a.length;e++){var f=a.getItemAt(e);d.push({caption:f.caption,
uniqueName:f.uniqueName,dimensionUniqueName:f.dimension.uniqueName,dimensionCaption:f.dimension.caption,folder:f.folder,isLevel:!1,isLevelFolder:f.isHierarchy&&b});if(f.isHierarchy&&b)for(var h=0;h<f.levels_.length;h++)if(0!=h){var r=f.levels_.getItemAt(h);d.push({caption:r.caption,uniqueName:r.uniqueName,dimensionUniqueName:f.dimension.uniqueName,dimensionCaption:f.dimension.caption,folder:f.folder,hierarchyName:f.uniqueName,hierarchyCaption:f.caption,isLevel:!0,isLevelFolder:!1})}}return d};a.prototype.convertMeasures=
function(a){for(var b=[],e=0;e<a.length;e++){var f=a.getItemAt(e),l=d.data_._structure.GenericMeasure.toObject(f),h=f.availableAggregations;0!=f.availableAggregations.length||f.calculated||(h=d.data_.consts.AggregationName.ALL_AGGREGATIONS);l.availableAggregations=h;l.availableAggregationsCaptions=d.data_.consts.AggregationName.aggregationCaptions(h);l.availableAggregationsTotalCaptions=d.data_.consts.AggregationName.aggregationTotalCaptions(h);b.push(l)}return b};a.prototype.search=function(a){a=
a.toLowerCase();if(this.searchPhrase!=a){this.searchPhrase=a;this.searchedHierarchies=[];for(var b=this.allHierarchies.length,d=0;d<b;d++){var e=this.allHierarchies[d];e.isFolder||e.isMeasure&&this.isMeasuresAsHierarchies||!utils.StringUtils.contains(e.caption,a)||(this.addParents(e,this.searchedHierarchies),this.searchedHierarchies.push(e))}}};a.prototype.addParents=function(a,b){if(a.parent&&0>b.indexOf(a.parent)){for(var d=[];null!=a.parent;)d.push(a.parent),a=a.parent;for(var d=d.reverse(),e=
0;e<d.length;e++)0>b.indexOf(d[e])&&b.push(d[e])}};a.prototype.clearSearch=function(){this.searchPhrase="";this.searchedHierarchies=null};Object.defineProperty(a.prototype,"isSearch",{get:function(){return!utils.nullOrEmpty(this.searchPhrase)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isSearchNeeded",{get:function(){return this.allHierarchies&&50<this.allHierarchies.length},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isCalculatedAvailable",{get:function(){return d.model._options.OptionsManager.showCalculatedValuesButton},
enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hierarchies",{get:function(){return this.isSearch?this.searchedHierarchies:this._hierarchies},enumerable:!0,configurable:!0});a.expandFormulas=!1;return a}();e.PivotFieldsModel=b})(e._pivot||(e._pivot={}))})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){(function(f){var b=function(a){function c(c){var b=a.call(this)||this;b.type="pivot";b.calculatedValueAddedHandler=function(a){return b.onCalculatedValueAdded(a)};b.calculatedValueRemovedHandler=function(a){return b.onCalculatedValueRemoved(a)};b.model=new f.PivotFieldsModel;b.view=new f.PivotFieldsView(b,c);b.view.addEventListener(events._Event.CLOSED,function(a){return b.dispatch(a)});b.lists=[b.view.lstPages,b.view.lstRows,b.view.lstColumns,b.view.lstMeasures];
b.view.btnOk&&b.view.btnOk.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return b.onOkClick()});b.view.btnCancel&&b.view.btnCancel.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return b.onCancelClick()});null!=b.view.aggrView&&b.view.aggrView.addEventListener(events._Event.CHANGE,function(a){return b.onAggregationChange(a)});b.view.lstHierarchies&&(b.view.lstHierarchies.container.addEventListener("click",function(a){return b.onHierarchyFieldClick(a)}),b.view.lstHierarchies.droppable({onDrop:function(a,
c,d,e){return b.onHierarchiesDrop(a,c,d,e)},onDragEnter:function(a,c,d,e){return b.onHierarchiesDragEnterOrOver(a,c,d,e)},onDragOver:function(a,c,d,e){return b.onHierarchiesDragEnterOrOver(a,c,d,e)},onDragLeave:function(a,c,d,e){return b.onDragLeave(a,c,d,e)},itemSelector:"li"}),b.view.lstHierarchies.container.disableSelection());c={onDrop:function(a,c,d,e){return b.onDrop(a,c,d,e)},onDragEnter:function(a,c,d,e){return b.onDragEnterOrOver(a,c,d,e)},onDragOver:function(a,c,d,e){return b.onDragEnterOrOver(a,
c,d,e)},onDragLeave:function(a,c,d,e){return b.onDragLeave(a,c,d,e)},itemSelector:"li"};b.view.lstPages&&(b.view.lstPages.droppable(c),b.view.lstPages.container.addEventListener("dblclick",function(a){return b.onFieldDoubleClick(a)}),b.view.lstPages.container.disableSelection());b.view.lstRows&&(b.view.lstRows.droppable(c),b.view.lstRows.container.addEventListener("dblclick",function(a){return b.onFieldDoubleClick(a)}),b.view.lstRows.container.disableSelection());b.view.lstColumns&&(b.view.lstColumns.droppable(c),
b.view.lstColumns.container.addEventListener("dblclick",function(a){return b.onFieldDoubleClick(a)}),b.view.lstColumns.container.disableSelection());b.view.lstMeasures&&(b.view.lstMeasures.container.addEventListener("click",function(a){return b.onMeasureFieldClick(a)}),b.view.lstMeasures.container.addEventListener("dblclick",function(a){return b.onFieldDoubleClick(a)}),b.view.lstMeasures.droppable(c),b.view.lstMeasures.container.disableSelection());b.view.btnAddMeasure&&b.view.btnAddMeasure.addEventListener(uicontrols.UIButton.CLICK_EVENT,
function(){return b.onAddMeasureClick()});b.view.btnCollapseExpand&&b.view.btnCollapseExpand.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return b.onCollapseExpandClick()});b.view.inpSearch&&(b.view.inpSearch.setChangeDelay(500),b.view.inpSearch.addEventListener(uicontrols.UITextInput.CHANGE_EVENT,function(){return b.onSearchChange()}));return b}__extends(c,a);c.prototype.onCancelClick=function(){this.view.close()};c.prototype.onOkClick=function(){this.applySlice();this.view.close()};
c.prototype.onSearchChange=function(){this.model.search(this.view.inpSearch.getText());this.view.lstHierarchies.container.toggleClass("wdr-searched",this.model.isSearch);this.view.lstHierarchies.setDataProvider(this.model.hierarchies);this.validateList(this.view.lstHierarchies);this.view.btnCollapseExpand&&this.view.btnCollapseExpand.isVisible(this.model.hasFolders&&!this.model.isSearch)};c.prototype.applySlice=function(){var a=this.model.getSlice();this.model.isSliceDifferent(a)&&this.dispatchWith(h.FieldsView.EVENT_APPLY_SLICE,
this,a)};c.prototype.onCalculatedValueAdded=function(a){d.model.PivotModel.getInstance().removeEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_ADDED,this.calculatedValueAddedHandler);this.model.onCalculatedValueAdded(a.data.measureUniqueName);this.updateView()};c.prototype.onCalculatedValueRemoved=function(a){d.model.PivotModel.getInstance().removeEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_REMOVED,this.calculatedValueRemovedHandler);this.model.onCalculatedValueRemoved(a.data);
this.updateView()};c.prototype.onAddMeasureClick=function(){d.model.PivotModel.getInstance().dispatchWith(e.ViewEvent.CALCULATED_VIEW_OPEN);d.model.PivotModel.getInstance().addEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_ADDED,this.calculatedValueAddedHandler)};c.prototype.onCollapseExpandClick=function(){this.model.isExpandAll?this.model.expandAll():this.model.collapseAll();this.validateList(this.view.lstHierarchies);this.view.setLabels()};c.prototype.onFieldDoubleClick=function(a){var c=
uicontrols.UIElement.convert(a.target).closest("ul");null!=c&&(c=this.getListById(c.attr("id")),a=uicontrols.UIElement.convert(a.target).closest("li"),null!=a&&(a=parseInt(a.attr("data-index")),this.removeField(c,a)))};c.prototype.onMeasureFieldClick=function(a){var c=uicontrols.UIElement.convert(a.target).closest("li");null!=c&&(c=parseInt(c.attr("data-index")),c=this.model.measures[c],"wdr-aggr-display"==uicontrols.UIElement.convert(a.target).attr("id")&&this.view.aggrView.showWith(c,uicontrols.UIElement.convert(a.target)))};
c.prototype.onAggregationChange=function(a){var c=a.data.fieldData,b=a.data.aggrData;uicontrols.UIElement.convert(a.data.origin);c.aggregation=b.aggregation;c.caption=d.model._options.OptionsManager.showAggregationLabels?utils.StringUtils.bind(b.totalCaption,c.name):c.name;this.view.lstMeasures.validateItem(c);a=utils.ArrayUtils.find(this.model.hierarchies,c.uniqueName,"uniqueName");null!=a&&(this.model.isMeasuresAsHierarchies&&null!=a.measureItem&&(a=a.measureItem),a.aggregation=c.aggregation,a.caption=
c.caption,this.view.lstHierarchies.validateItem(a))};c.prototype.onHierarchyFieldClick=function(a){var c=uicontrols.UIElement.convert(a.target).closest("li");if(null!=c){var c=parseInt(c.attr("data-index")),b=this.model.hierarchies[c];if("wdr-aggr-display"==uicontrols.UIElement.convert(a.target).attr("id"))this.view.aggrView.showWith(b,uicontrols.UIElement.convert(a.target));else if("wdr-calc-display"==uicontrols.UIElement.convert(a.target).attr("id"))d.model.PivotModel.getInstance().dispatchWith(e.ViewEvent.CALCULATED_VIEW_OPEN,
null,{measureName:b.uniqueName}),d.model.PivotModel.getInstance().addEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_ADDED,this.calculatedValueAddedHandler),d.model.PivotModel.getInstance().addEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_REMOVED,this.calculatedValueRemovedHandler);else if(b.isFolder||b.isLevelFolder&&"wdr-moreicon-display"!=uicontrols.UIElement.convert(a.target).attr("id"))!0===b.isExpanded?this.model.collapseField(b):this.model.expandField(b),
this.validateList(this.view.lstHierarchies),this.view.setLabels();else{if(!0==b.isSelected||null!=b.measureItem&&!0==b.measureItem.isSelected)!0==b.isSelected&&(this.model.selectField(b,!1),this.findAndRemoveField(b)),null!=b.measureItem&&!0==b.measureItem.isSelected&&(this.model.selectField(b.measureItem,!1),this.findAndRemoveField(b.measureItem));else if(b.isMeasure)this.model.selectField(b,!0),this.model.measures.push(b),this.validateList(this.view.lstMeasures);else if(b.measureItem&&b.measureItem.type!=
d.data_.types.MeasureType.COUNT&&b.measureItem.type!=d.data_.types.MeasureType.DATE)this.model.selectField(b.measureItem,!0),this.model.measures.push(b.measureItem),this.validateList(this.view.lstMeasures);else{if(b.isLevel)for(b.parent.isSelected&&this.findAndRemoveField(b.parent),a=0;a<b.parent.children.length;a++){var f=b.parent.children[a];f.uniqueName!=b.uniqueName&&(f.isSelected&&this.findAndRemoveField(f),f.isSelected=!1)}this.model.selectField(b,!0);this.model.rows.push(b);this.validateList(this.view.lstRows)}this.validateItemRecursivelyAt(this.view.lstHierarchies,
c);this.validateSlice()}}};c.prototype.validateItemRecursivelyAt=function(a,c){a.validateItemAt(c);var b=a.getDataProvider()[c];null!=b.parent&&this.validateItemRecursively(a,b.parent);if(b.isLevelFolder)for(var d=0;d<b.children.length;d++)a.validateItem(b.children[d]);if(b.isLevel)for(d=0;d<b.parent.children.length;d++)a.validateItem(b.parent.children[d])};c.prototype.validateItemRecursively=function(a,c){a.validateItem(c);c.parent&&this.validateItemRecursively(a,c.parent);if(c.isLevelFolder)for(var b=
0;b<c.children.length;b++)a.validateItem(c.children[b]);if(c.isLevel)for(b=0;b<c.parent.children.length;b++)a.validateItem(c.parent.children[b])};c.prototype.onDragStart=function(a){return!0};c.prototype.onHierarchiesDrop=function(a,c,b,d){a&&a.closest("ul")&&(c=parseInt(a.attr("data-index")),a=this.getListById(a.closest("ul").attr("id")),a!=this.view.lstHierarchies&&this.removeField(a,c))};c.prototype.onHierarchiesDragEnterOrOver=function(a,c,b,d){a&&a.closest("ul")&&(a=this.getListById(a.closest("ul").attr("id")),
a!=this.view.lstHierarchies&&(a.container.hasClass("wdr-droppable")?c&&c.addClass("wdr-droppable-valid"):c&&c.addClass("wdr-droppable-invalid")))};c.prototype.onDragEnterOrOver=function(a,c,b,d){this.removeDropIndicator();a&&a.closest("ul")&&(b instanceof uicontrols.lists.UIList||(b=this.getListById(b.attr("id"))),c=this.getListById(a.closest("ul").attr("id")),c.container.hasClass("wdr-droppable")&&this.isDropAllowed(this.getDataByElement(a,c),c,b)&&(d instanceof MouseEvent?this.showIndicator(uicontrols.UIElement.convert(d.target)):
(a=d.changedTouches[0],this.showIndicator(uicontrols.UIElement.convert(document.elementFromPoint(a.clientX,a.clientY))))))};c.prototype.isDropAllowed=function(a,c,b){return a.isValues&&b!=this.view.lstColumns&&b!=this.view.lstRows||!1==this.model.isMeasuresAsHierarchies&&(b!=this.view.lstMeasures&&a.isMeasure||b==this.view.lstMeasures&&!a.isMeasure)||a.calculated&&b!=this.view.lstMeasures||c==this.view.lstHierarchies&&null!=utils.ArrayUtils.find(b.getDataProvider(),a.uniqueName,"uniqueName")?!1:!0};
c.prototype.getDataByElement=function(a,c){var b=parseInt(a.attr("data-index"));return c.getDataProvider()[b]};c.prototype.onDragLeave=function(a,c,b,d){this.removeDropIndicator();a&&a.closest("ul")&&c&&(c.removeClass("wdr-droppable-valid"),c.removeClass("wdr-droppable-invalid"))};c.prototype.onDrop=function(a,c,b,d){this.removeDropIndicator();a&&a.closest("ul")&&(c instanceof uicontrols.lists.UIList||(c=this.getListById(c.attr("id"))),d=this.getListById(a.closest("ul").attr("id")),!1!=this.isDropAllowed(this.getDataByElement(a,
d),d,c)&&(b=b?parseFloat(b.attr("data-index")):c.getDataProvider().length,a=parseInt(a.attr("data-index")),d!=c||a!=b))&&(d==this.view.lstHierarchies&&c!=this.view.lstHierarchies?this.addField(d,c,a,b):this.moveField(d,c,a,b),this.validateView())};c.prototype.showIndicator=function(a){var c=a.closest("li");null!=c?(this._dropIndicator=this.createDropIndicator(),c.before(this._dropIndicator)):(a=a.closest("ul"),null!=a&&(this._dropIndicator=this.createDropIndicator(),0<a.element.children.length?a.append(this._dropIndicator):
a.prepend(this._dropIndicator)))};c.prototype.createDropIndicator=function(){return new uicontrols.UIElement("div","wdr-drop-indicator")};c.prototype.removeDropIndicator=function(){this._dropIndicator&&(this._dropIndicator.removeFromParent(!0),this._dropIndicator=null)};c.prototype.moveField=function(a,c,b,d){var e=a.getDataProvider()[b];a==c?(a=c.getDataProvider(),b<d&&(d-=1),a.splice(d,0,a.splice(b,1)[0])):(e=a.getDataProvider()[b],a.getDataProvider().splice(b,1),a.validateNow(),c==this.view.lstMeasures&&
(this.model.selectField(e,!1),e=this.model.findMeasure(this.model.toMeasureUniqueName(e.uniqueName))),a==this.view.lstMeasures&&(this.model.selectField(e,!1),e=this.model.findHierarchy(this.model.toHierarchyUniqueName(e.uniqueName))),null!=e&&(this.model.selectField(e,!0),this.findAndRemoveField(e),c.getDataProvider().splice(d,0,e)));this.validateList(c);this.validateSlice()};c.prototype.addField=function(a,c,b,d){b=a.getDataProvider()[b];if(b.isLevel){b.parent.isSelected&&this.findAndRemoveField(b.parent);
for(var e=0;e<b.parent.children.length;e++){var f=b.parent.children[e];f.uniqueName!=b.uniqueName&&(f.isSelected&&this.findAndRemoveField(f),f.isSelected=!1)}this.validateItemRecursively(this.view.lstHierarchies,b)}this.model.isMeasuresAsHierarchies&&c==this.view.lstMeasures&&null!=b.measureItem&&(b=b.measureItem);b.isSelected?(this.model.selectField(b,!1),this.findAndRemoveField(b,a,!0),this.model.selectField(b,!0)):(this.model.selectField(b,!0),a=utils.ArrayUtils.findIndex(this.view.lstHierarchies.getDataProvider(),
b.uniqueName,"uniqueName"),this.validateItemRecursivelyAt(this.view.lstHierarchies,a),this.view.lstHierarchies.validateItemAt(a));c.getDataProvider().splice(d,0,b);this.validateList(c);this.validateSlice()};c.prototype.removeField=function(a,c){if(!(a.getDataProvider().length<=c)){var b=a.getDataProvider()[c];b.isValues||(a.getDataProvider().splice(c,1),this.validateList(a),b=this.model.findItem(b.uniqueName,b.isMeasure),null!=b&&(this.model.selectField(b,!1),this.validateItemRecursively(this.view.lstHierarchies,
null!=b.hierarchyItem?b.hierarchyItem:b),b.isLevel&&(this.model.selectField(b.parent,!1),this.validateItemRecursively(this.view.lstHierarchies,b.parent))),this.validateSlice())}};c.prototype.findAndRemoveField=function(a,c,b){void 0===c&&(c=null);void 0===b&&(b=!1);for(var d=-1,e=0;e<this.lists.length;e++)this.lists[e]==c||this.lists[e]==this.view.lstMeasures&&b||(d=utils.ArrayUtils.findIndex(this.lists[e].getDataProvider(),a.uniqueName,"uniqueName"),-1==d&&(d=utils.ArrayUtils.findIndex(this.lists[e].getDataProvider(),
a.uniqueName,"hierarchyName")),-1<d&&(this.lists[e].getDataProvider().splice(d,1),this.validateList(this.lists[e])))};c.prototype.getListById=function(a){switch(a){case this.view.lstHierarchies.getId():return this.view.lstHierarchies;case this.view.lstPages.getId():return this.view.lstPages;case this.view.lstRows.getId():return this.view.lstRows;case this.view.lstColumns.getId():return this.view.lstColumns;case this.view.lstMeasures.getId():return this.view.lstMeasures}return null};c.prototype.update=
function(a,c,b,d){void 0===b&&(b="");void 0===d&&(d=!0);d&&this.model.update(a,c,b);this.updateView()};c.prototype.validateSlice=function(){this.view.btnOk&&this.view.btnOk.setEnabled(this.model.isValidSlice())};Object.defineProperty(c.prototype,"isExpandAll",{get:function(){return this.model.isExpandAll},enumerable:!0,configurable:!0});c.prototype.updateView=function(){var a=this;this.view.reset&&this.view.reset();this.view.btnAddMeasure&&this.view.btnAddMeasure.isVisible(this.model.isCalculatedAvailable);
this.view.lstHierarchies&&this.view.lstHierarchies.setDataProvider(this.model.hierarchies,!1);this.view.lstPages&&this.view.lstPages.setDataProvider(this.model.pages,!1);this.view.lstRows&&this.view.lstRows.setDataProvider(this.model.rows,!1);this.view.lstColumns&&this.view.lstColumns.setDataProvider(this.model.columns,!1);this.view.lstMeasures&&this.view.lstMeasures.setDataProvider(this.model.measures,!1);this.view.btnCollapseExpand&&this.view.btnCollapseExpand.isVisible(this.model.hasFolders);this.view.searchWrap&&
this.view.searchWrap.isVisible(this.model.isSearchNeeded);this.view.inpSearch&&(this.view.inpSearch.clear(!1),this.model.clearSearch());this.view.setLabels();this.view.container.requestAnimationFrame(function(){a.validateView()})};c.prototype.validateList=function(a){var c=this;a.validateNow();var b={onDragStart:function(a){return c.onDragStart(a)},createHelper:function(a){return c.view.createHelper(a)}};utils.browserVersion().isMobile&&(b.handle="#wdr-drag-handle");var d=a.container.find("li",!0);
if(a==this.view.lstHierarchies)for(a=0;a<d.length;a++)d[a].hasClass("wdr-folder")&&!d[a].hasClass("wdr-level-folder")||d[a].draggable(b);else for(a.droppable({onDrop:function(a,b,d,e){return c.onDrop(a,b,d,e)},onDragEnter:function(a,b,d,e){return c.onDragEnterOrOver(a,b,d,e)},onDragOver:function(a,b,d,e){return c.onDragEnterOrOver(a,b,d,e)},onDragLeave:function(a,b,d,e){return c.onDragLeave(a,b,d,e)},itemSelector:"li"}),a=0;a<d.length;a++)d[a].draggable(b)};c.prototype.validateView=function(){try{this.validateSlice(),
this.validateList(this.view.lstHierarchies),this.validateList(this.view.lstPages),this.validateList(this.view.lstRows),this.validateList(this.view.lstColumns),this.validateList(this.view.lstMeasures)}catch(a){}};return c}(events.EventDispatcher);f.PivotFieldsController=b})(h._pivot||(h._pivot={}))})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(c,b){var d=a.call(this,b)||this;d.toolbarHeight=0;d.controller=c;d.addClass("wdr-pivot-fields");d.setControls();d.container.disableSelection();d.container.resizable({sides:["left","right"],resize:function(a){return d.onViewResize(a)}});return d}__extends(c,a);c.prototype.onViewResize=function(a){this.setWidth(a.size.width+(a.size.width-a.originalSize.width));this.addLayoutClasses();this.centerPosition()};c.prototype.setControls=
function(){var a=this,c=new uicontrols.UIComponentBase("div","wdr-popup-header wdr-ui-row");this.addChild(c);var b=new uicontrols.UIComponentBase("div","wdr-ui-col wdr-vam");c.addChild(b);this.lblTitle=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_TITLE);this.lblTitle.addClass("wdr-popup-title");b.addChild(this.lblTitle);this.lblSubtitle=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_SUBTITLE);this.lblSubtitle.addClass("wdr-popup-subtitle");b.addChild(this.lblSubtitle);b=new uicontrols.UIComponentBase("div",
"wdr-ui-col wdr-vam wdr-tar wdr-ui-btns-row");c.addChild(b);this.btnAddMeasure=new uicontrols.UIButton("wdr-ui-btn-light wdr-icon-act_calc");this.btnAddMeasure.setId("wdr-btn-add-measure");this.btnAddMeasure.setLabel(d.model._labels.Labels.FIELDS_LIST_ADD_CALCULATED_MEASURE);b.addChild(this.btnAddMeasure);this.btnCancel=new uicontrols.UIButton;this.btnCancel.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.btnOk=new uicontrols.UIButton("wdr-ui-btn-dark");this.btnOk.setLabel(d.model._labels.Labels.BUTTON_APPLY);
utils.OSUtil.isIOS||utils.OSUtil.isMac?(b.addChild(this.btnCancel),b.addChild(this.btnOk)):(b.addChild(this.btnOk),b.addChild(this.btnCancel));c=new uicontrols.UIComponentBase("div","wdr-popup-content");this.addChild(c);var f=new uicontrols.UIComponentBase("div","wdr-ui-row");c.addChild(f);b=new uicontrols.UIComponentBase("div","wdr-ui-col-3");f.addChild(b);var s=new uicontrols.UIComponentBase("div","wdr-list-wrap wdr-list-wrap-all");b.addChild(s);var r=new uicontrols.UIComponentBase("div","wdr-list-header wdr-list-header-wide");
s.addChild(r);b=new uicontrols.UIComponentBase("div","wdr-list-header-label-wrap");r.addChild(b);this.lblHierarchies=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_ALL_FIELDS);b.addChild(this.lblHierarchies);this.btnCollapseExpand=new uicontrols.UIButton("wdr-ui-link-btn");this.btnCollapseExpand.removeClass("wdr-ui-btn");this.btnCollapseExpand.setId("wdr-btn-collapse-expand-all");this.btnCollapseExpand.setLabel(d.model._labels.Labels.FIELDS_LIST_COLLAPSE_ALL);b.addChild(this.btnCollapseExpand);
this.searchWrap=new uicontrols.UIComponentBase("div","wdr-search-wrap");r.addChild(this.searchWrap);b=new uicontrols.UIComponentBase("button","wdr-search-btn");b.addEventListener("click",function(){return a.onSearchClick()});this.searchWrap.addChild(b);r=new uicontrols.UIComponentBase("span","wdr-ui-icon wdr-icon-act_search");b.addChild(r);this.inpSearch=new uicontrols.UITextInput;this.inpSearch.addClass("wdr-search-inp");this.searchWrap.addChild(this.inpSearch);b=new uicontrols.UIComponentBase("span",
"wdr-close-search wdr-ui-icon wdr-icon-act_close");b.addEventListener("click",function(){return a.onSearchCloseClick()});this.searchWrap.addChild(b);r=new uicontrols.UIComponentBase("div","wdr-list-content");s.addChild(r);this.lstHierarchies=new uicontrols.lists.UIList;this.lstHierarchies.setId("wdr-lst-hierarchies");this.lstHierarchies.setItemRendererFactory(function(c,b){return a.selectableItemRendererFactory(c,b)});this.lstHierarchies.setLabelField("caption");r.addChild(this.lstHierarchies);b=
new uicontrols.UIComponentBase("div","wdr-ui-col-3");f.addChild(b);s=new uicontrols.UIComponentBase("div","wdr-list-wrap wdr-list-wrap-pages");s.setId("wdr-wrap-pages");b.addChild(s);r=new uicontrols.UIComponentBase("div","wdr-list-header");s.addChild(r);this.lblPages=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_FILTERS);r.addChild(this.lblPages);r=new uicontrols.UIComponentBase("div","wdr-list-content");s.addChild(r);this.lstPages=new uicontrols.lists.UIList;this.lstPages.setId("wdr-lst-pages");
this.lstPages.setItemRendererFactory(function(c,b){return a.fieldItemRendererFactory(c,b)});this.lstPages.setLabelField("caption");r.addChild(this.lstPages);this.lblPagesPrompt=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);this.lblPagesPrompt.addClass("wdr-prompt");s.addChild(this.lblPagesPrompt);s=new uicontrols.UIComponentBase("div","wdr-list-wrap wdr-list-wrap-rows");s.setId("wdr-wrap-rows");b.addChild(s);r=new uicontrols.UIComponentBase("div","wdr-list-header");s.addChild(r);
this.lblRows=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_ROWS);r.addChild(this.lblRows);r=new uicontrols.UIComponentBase("div","wdr-list-content");s.addChild(r);this.lstRows=new uicontrols.lists.UIList;this.lstRows.setId("wdr-lst-rows");this.lstRows.setItemRendererFactory(function(c,b){return a.fieldItemRendererFactory(c,b)});this.lstRows.setLabelField("caption");r.addChild(this.lstRows);this.lblRowsPrompt=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);this.lblRowsPrompt.addClass("wdr-prompt");
s.addChild(this.lblRowsPrompt);b=new uicontrols.UIComponentBase("div","wdr-ui-col-3");f.addChild(b);s=new uicontrols.UIComponentBase("div","wdr-list-wrap wdr-list-wrap-cols");s.setId("wdr-wrap-columns");b.addChild(s);r=new uicontrols.UIComponentBase("div","wdr-list-header");s.addChild(r);this.lblColumns=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_COLUMNS);r.addChild(this.lblColumns);r=new uicontrols.UIComponentBase("div","wdr-list-content");s.addChild(r);this.lstColumns=new uicontrols.lists.UIList;
this.lstColumns.setId("wdr-lst-columns");this.lstColumns.setItemRendererFactory(function(c,b){return a.fieldItemRendererFactory(c,b)});this.lstColumns.setLabelField("caption");r.addChild(this.lstColumns);this.lblColumnsPrompt=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);this.lblColumnsPrompt.addClass("wdr-prompt");s.addChild(this.lblColumnsPrompt);s=new uicontrols.UIComponentBase("div","wdr-list-wrap wdr-list-wrap-measures");s.setId("wdr-wrap-measures");b.addChild(s);r=new uicontrols.UIComponentBase("div",
"wdr-list-header");s.addChild(r);this.lblMeasures=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_VALUES);r.addChild(this.lblMeasures);r=new uicontrols.UIComponentBase("div","wdr-list-content");s.addChild(r);this.lstMeasures=new uicontrols.lists.UIList;this.lstMeasures.setId("wdr-lst-measures");this.lstMeasures.setItemRendererFactory(function(c,b){return a.fieldItemRendererFactory(c,b)});this.lstMeasures.setLabelField("caption");r.addChild(this.lstMeasures);this.lblMeasuresPrompt=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);
this.lblMeasuresPrompt.addClass("wdr-prompt");s.addChild(this.lblMeasuresPrompt);this.aggrView=new e.AggregationsView;this.aggrView.setId("wdr-aggregations-view");this.aggrView.hide();c.addChild(this.aggrView)};c.prototype.setLabels=function(){this.lblTitle.setLabel(d.model._labels.Labels.FIELDS_LIST_TITLE);this.lblSubtitle.setLabel(d.model._labels.Labels.FIELDS_LIST_SUBTITLE);this.btnCancel.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.btnOk.setLabel(d.model._labels.Labels.BUTTON_APPLY);this.lblHierarchies.setLabel(d.model._labels.Labels.FIELDS_LIST_ALL_FIELDS);
this.lblPages.setLabel(d.model._labels.Labels.FIELDS_LIST_FILTERS);this.lblRows.setLabel(d.model._labels.Labels.FIELDS_LIST_ROWS);this.lblColumns.setLabel(d.model._labels.Labels.FIELDS_LIST_COLUMNS);this.lblMeasures.setLabel(d.model._labels.Labels.FIELDS_LIST_VALUES);this.btnAddMeasure.setLabel(d.model._labels.Labels.FIELDS_LIST_ADD_CALCULATED_MEASURE);this.lblPagesPrompt.setLabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);this.lblRowsPrompt.setLabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);
this.lblColumnsPrompt.setLabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);this.lblMeasuresPrompt.setLabel(d.model._labels.Labels.FIELDS_LIST_DROP_FIELD);this.btnCollapseExpand.setLabel(this.controller.isExpandAll?d.model._labels.Labels.FIELDS_LIST_EXPAND_ALL:d.model._labels.Labels.FIELDS_LIST_COLLAPSE_ALL)};c.prototype.fieldItemRendererFactory=function(a,c){var b=new e.renderers.FieldItemRenderer;b.setData(a);b.setIndex(c);return b};c.prototype.selectableItemRendererFactory=function(a,c){var b=
new e.renderers.SelectableItemRenderer(a,c);b.setIndex(c);return b};c.prototype.onSearchClick=function(){this.searchWrap.addClass("wdr-search-opened");this.inpSearch.container.focus()};c.prototype.onSearchCloseClick=function(){this.searchWrap.removeClass("wdr-search-opened");this.inpSearch.clear()};c.prototype.reset=function(){this.searchWrap.removeClass("wdr-search-opened");this.inpSearch.clear(!1)};c.prototype.createHelper=function(a){var c=new uicontrols.UIElement("span");c.attr("id","wdr-drag-handle");
c.addClass("wdr-helper");c.addClass("wdr-draggable");c.toggleClass("wdr-values",a.hasClass("wdr-values"));c.css("width",a.css("width"));c.css("position","absolute");c.css("z-index",100);c.attr("data-index",a.attr("data-index"));c.text(a.text());return c};c.prototype.addLayoutClasses=function(c){a.prototype.addLayoutClasses.call(this,!0)};return c}(uicontrols.containers.UIPopup);f.PivotFieldsView=b})(e._pivot||(e._pivot={}))})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var a=b.call(this)||this;a.addClass("wdr-fields-view-wrap");a.setControls();return a}__extends(a,b);a.prototype.setControls=function(){var a=this;this.openBtn=new uicontrols.UIButton;this.openBtn.setId("wdr-btn-open-fields");this.openBtn.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(b){return a.onOpenClick()});this.addChild(this.openBtn)};a.prototype.open=function(a,b,e){void 0===e&&(e="");this.container.toggleClass("wdr-fields-opened",
!0);this.isForDillThrough||(d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.FILDS_LIST_OPEN)),d.model._options.OptionsManager.configuratorOpened=!0);this._isFlat=d.model._options.OptionsManager.flatView;this.controller=this.getController();this.controller.update(a,b,e,this.hasChanged);this.controller.view.setId("wdr-fields-view");this.controller.view.container.toggleClass("wdr-dt-fields",this.isForDillThrough);this.controller.view.overlay.container.toggleClass("wdr-dt-fields-overlay",
this.isForDillThrough);this._modalParent?this._modalParent.addChild(this.controller.view.container):this.addChild(this.controller.view);this.isVisible()||this.show();this.controller.view.open();this._isActive=!0;this._prevSlice=d.data_.Cube.getInstance().slice_?d.data_.Cube.getInstance().slice_.clone():null;this._connectionInfo=d.data_.Cube.getInstance().connectionInfo_};Object.defineProperty(a.prototype,"isFlatChange",{get:function(){return this._isFlat!=d.model._options.OptionsManager.flatView},
enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isActiveChange",{get:function(){return this._isActive!=d.model._options.OptionsManager.configuratorOpened},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isDataSourceChange",{get:function(){return null==this._connectionInfo||null==d.data_.Cube.getInstance().structure_||!this._connectionInfo.isEqual(d.data_.Cube.getInstance().connectionInfo_)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isSliceChange",
{get:function(){return null==d.data_.Cube.getInstance().slice_&&null!=this._prevSlice||null!=d.data_.Cube.getInstance().slice_&&null==this._prevSlice||d.data_.Cube.getInstance().slice_&&this._prevSlice&&!d.data_.Cube.getInstance().slice_.isEqual(this._prevSlice)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasChanged",{get:function(){return this.isActiveChange||this.isDataSourceChange||this.isSliceChange||this.isFlatChange},enumerable:!0,configurable:!0});a.prototype.getController=
function(){var c=this,b=null,d=this._isFlat||this._isForDillThrough,f=this._modalParent||e.PivotView.stage.container;null==this.controller?b=d?new h.flat.FlatFieldsController(f):new h._pivot.PivotFieldsController(f):d&&"flat"!=this.controller.type?b=new h.flat.FlatFieldsController(f):d||"pivot"==this.controller.type||(b=new h._pivot.PivotFieldsController(f));if(null==b)return this.controller;this.controller&&this.controller.removeAllEventListeners();b.addEventListener(events._Event.CLOSED,function(){return c.onViewClosed()});
b.addEventListener(a.EVENT_APPLY_SLICE,function(a){return c.onApplySlice(a)});return b};a.prototype.onApplySlice=function(a){this.dispatch(a)};a.prototype.onViewClosed=function(){this._isActive=void 0;this._connectionInfo=null;this._isFlat=void 0;this.isForDillThrough||(d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.FILDS_LIST_CLOSE)),d.model._options.OptionsManager.getInstance(),d.model._options.OptionsManager.configuratorButton?this.show():this.hide(),
d.model._options.OptionsManager.configuratorOpened=!1,this.dispatchWith(events._Event.CLOSED));this.container.toggleClass("wdr-fields-opened",!1)};a.prototype.close=function(){this.controller&&this.controller.view.close()};a.prototype.onOpenClick=function(){this.dispatchWith(a.EVENT_OPEN)};Object.defineProperty(a.prototype,"isForDillThrough",{get:function(){return this._isForDillThrough},set:function(a){this._isForDillThrough=a},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"modalParent",
{set:function(a){this._modalParent=a},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"containtment",{set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isOpen",{get:function(){return this._isActive},enumerable:!0,configurable:!0});a.EVENT_APPLY_SLICE="EVENT_APPLY_SLICE";a.EVENT_OPEN="EVENT_OPEN";return a}(uicontrols.UIComponentBase);h.FieldsView=f})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(a){function c(){var c=a.call(this)||this;c.createTextDisplay();return c}__extends(c,a);c.prototype.createTextDisplay=function(){null==this.textDisplay&&(this.textDisplay=new uicontrols.UIElement("span"),this.textDisplay.attr("id","wdr-text-display"))};c.prototype.createArrgDisplay=function(){null==this.aggrDisplay&&(this.aggrDisplay=new uicontrols.UIElement("span"),this.aggrDisplay.attr("id","wdr-aggr-display"))};c.prototype.createDragHandle=
function(){null==this.dragHandle&&(this.dragHandle=new uicontrols.UIElement("span"),this.dragHandle.attr("id","wdr-drag-handle"))};c.prototype.draw=function(){var a=this.getData();this.container.empty();var c="",c=null!=this.getLabelFunction()?this.getLabelFunction()(a):a.isLevel?a.hierarchyCaption+" / "+a[this.getLabelField()]:a[this.getLabelField()];this.textDisplay.text(c);this.textDisplay.attr("title",c);this.container.append(this.textDisplay);!0==a.isMeasure&&!0==a.showAggregations&&1<a.availableAggregations.length&&
d.model._options.OptionsManager.showAggregations&&(this.createArrgDisplay(),this.container.append(this.aggrDisplay));this.createDragHandle();this.container.append(this.dragHandle);this.container.toggleClass("wdr-measure",!0===a.isMeasure);this.container.toggleClass("wdr-values",!0===a.isValues);this.container.toggleClass("wdr-selected",!0===a.isSelected);this.container.toggleClass("wdr-level",!0===a.isLevel)};return c}(uicontrols.renderers.UIItemRenderer);e.FieldItemRenderer=b})(e.renderers||(e.renderers=
{}))})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){(function(f){var b=function(a){function c(c,b){void 0===c&&(c=null);var d=a.call(this)||this;d.data=c;d.createIconDisplay();d.createTextDisplay();return d}__extends(c,a);c.prototype.createIconDisplay=function(){null==this.iconDisplay&&(this.iconDisplay=new uicontrols.UIElement("span"),this.iconDisplay.attr("id","wdr-icon-display"))};c.prototype.createMoreIconDisplay=function(){null==this.moreIconDisplay&&(this.moreIconDisplay=new uicontrols.UIElement("span"),
this.moreIconDisplay.attr("id","wdr-moreicon-display"))};c.prototype.createTextDisplay=function(){null==this.textDisplay&&(this.textDisplay=new uicontrols.UIElement("span"),this.textDisplay.attr("id","wdr-text-display"))};c.prototype.createArrgDisplay=function(){null==this.aggrDisplay&&(this.aggrDisplay=new uicontrols.UIElement("span"),this.aggrDisplay.attr("id","wdr-aggr-display"))};c.prototype.createCalcDisplay=function(){null==this.calcDisplay&&(this.calcDisplay=new uicontrols.UIElement("span"),
this.calcDisplay.attr("id","wdr-calc-display"))};c.prototype.createDragHandle=function(){null==this.dragHandle&&(this.dragHandle=new uicontrols.UIElement("span"),this.dragHandle.attr("id","wdr-drag-handle"))};c.prototype.draw=function(){var a=this.getData();this.container.empty();this.container.append(this.iconDisplay);a.isLevelFolder&&(this.createMoreIconDisplay(),this.container.append(this.moreIconDisplay));this.textDisplay.text(a[this.getLabelField()]);this.textDisplay.attr("title",a[this.getLabelField()]);
this.container.append(this.textDisplay);!0===a.isMeasure&&!0===a.calculated&&!0===a.showAggregations&&(this.createCalcDisplay(),this.container.append(this.calcDisplay));a.isFolder||a.isMeasuresFolder?null!=this.dragHandle&&this.dragHandle.remove():(this.createDragHandle(),this.container.append(this.dragHandle));for(var c=!0===a.isSelected||null!=a.measureItem&&!0===a.measureItem.isSelected,b=1;10>b;b++)this.container.toggleClass("wdr-level-"+b,a.level===b);this.container.toggleClass("wdr-selected",
!0===c);this.container.toggleClass("wdr-checked",!0!==a.isFolder&&!0!==a.isLevel&&!0===c);this.container.toggleClass("wdr-unchecked",!0!==a.isFolder&&!0!==a.isLevel&&!0!==c);this.container.toggleClass("wdr-measure",!0===a.isMeasure);this.container.toggleClass("wdr-folder",!0===a.isFolder||!0===a.isLevelFolder);this.container.toggleClass("wdr-level-folder",!0===a.isLevelFolder);this.container.toggleClass("wdr-level",!0===a.isLevel);this.container.toggleClass("wdr-measures-folder",!0===a.isMeasuresFolder);
this.container.toggleClass("wdr-measures-calculated-folder",!0===a.isMeasuresFolder&&!0===a.isCalculatedMeasuresFolder);this.container.toggleClass("wdr-calculated",!0===a.calculated);this.container.toggleClass(d.grid.vo.GridStyleName.COLLAPSED,(!0===a.isFolder||!0===a.isLevelFolder)&&!0!==a.isExpanded);this.container.toggleClass(d.grid.vo.GridStyleName.EXPANDED,(!0===a.isFolder||!0===a.isLevelFolder)&&!0===a.isExpanded)};return c}(uicontrols.renderers.UIItemRenderer);f.SelectableItemRenderer=b})(h.renderers||
(h.renderers={}))})(d.config||(d.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(e){var b=function(){function a(){this.newCalculated=[]}a.prototype.update=function(a,b){this._structure=a;this._slice=b;this.hierarchies=[];var e,f=null,h=this._structure.calculatedMeasures;if(null!=this._slice)for(var f=this._slice.flatten(!0),s=0;s<f.length;s++)e=f.getItemAt(s),h.keyExists(e.uniqueName)&&(e=h.getItem(e.uniqueName),e.showAggregations=d.model._options.OptionsManager.showAggregations,e.isMeasure=!0),e.isSelected=!0,this.hierarchies.push(e);
for(var r=[],n=this._structure.allHierarchies(!1),s=0;s<n.length;s++)e=n.getItemAt(s),null==f||f.keyExists(e.uniqueName)||(e.isSelected=!1,r.push(e));for(s=0;s<h.length;s++)e=h.getItemAt(s),null==f||f.keyExists(e.uniqueName)||(e.isSelected=b.measures_.keyExists(e.uniqueName)||-1<this.newCalculated.indexOf(e.uniqueName),e.showAggregations=d.model._options.OptionsManager.showAggregations,e.isMeasure=!0,r.push(e));r.sort(function(a,c){return a.caption<c.caption?-1:a.caption>c.caption?1:0});for(s=0;s<
r.length;s++)e=r[s],this.hierarchies.push(e)};a.prototype.isValidSlice=function(){return!0};a.prototype.toPlainArray=function(a,b){for(var d=[],e=0;e<b.length;e++){var f=a[b[e]];f.isSelected&&d.push(f.uniqueName)}return d};a.prototype.getSlice=function(a){var b=this._slice.clone();a=this.toPlainArray(this.hierarchies,a);b.flatOrder=a;for(var d=b.flatten(!0),e,f=b.measures_,h=0;h<a.length;h++){var r=a[h];d.keyExists(r)||((e=this._structure.allHierarchies().getItem(r))?b.rows.addItem(r,e):this._structure.calculatedMeasures.keyExists(r)&&
(f.addItem(r,this._structure.calculatedMeasures.getItem(r)),b.measures_=f))}for(h=0;h<d.length;h++)e=d.getItemAt(h),-1==a.indexOf(e.uniqueName)&&(b.columns.keyExists(e.uniqueName)&&b.columns.removeItem(e.uniqueName),b.rows.keyExists(e.uniqueName)&&b.rows.removeItem(e.uniqueName),r=this._structure.hierarchyToMeasure(e.uniqueName),null==r&&(r=this._structure.calculatedMeasures.getItem(e.uniqueName)),f.keyExists(r.uniqueName)&&f.removeItem(r.uniqueName));b.measures_=f;this.newCalculated=[];return b};
a.prototype.onCalculatedValueAdded=function(a){if(null!=this._slice&&null!=this._structure){this.update(this._structure,this._slice);var b=utils.ArrayUtils.find(this.hierarchies,a,"uniqueName");null!=b&&(b.isSelected=!0);this.newCalculated.push(a)}};a.prototype.onCalculatedValueRemoved=function(a){null!=this._slice&&null!=this._structure&&this.update(this._structure,this._slice)};a.prototype.isSliceDifferent=function(a){a=a.flatten(!0);var b=this._slice.flatten(!0);if(a.length!=b.length)return!0;
for(var d=0;d<a.length;d++)if(a.getKeyAt(d)!=b.getKeyAt(d))return!0;return!1};a.prototype.getSelectAllSelection=function(){for(var a=0,b=0;b<this.hierarchies.length;b++)this.hierarchies[b].isSelected&&a++;return 0==a?uicontrols.UICheckBox.UNSELECTED:a==this.hierarchies.length?uicontrols.UICheckBox.SELECTED:uicontrols.UICheckBox.SEMI_SELECTED};return a}();e.FlatFieldsModel=b})(e.flat||(e.flat={}))})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){(function(f){var b=function(a){function c(c){var b=a.call(this)||this;b.type="flat";b.calculatedValueAddedHandler=function(a){return b.onCalculatedValueAdded(a)};b.calculatedValueRemovedHandler=function(a){return b.onCalculatedValueRemoved(a)};b.model_=new f.FlatFieldsModel;b.view=new f.FlatFieldsView(b,c);b.view.addEventListener(events._Event.CLOSED,function(a){return b.dispatch(a)});b.view.btnOk&&b.view.btnOk.addEventListener(uicontrols.UIButton.CLICK_EVENT,
function(){return b.onOkClick()});b.view.btnCancel&&b.view.btnCancel.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return b.onCancelClick()});b.view.lstHierarchies&&(b.view.lstHierarchies.container.addEventListener("click",function(a){return b.onHierarchyFieldClick(a)}),b.view.lstHierarchies.container.droppable({onDrop:function(a,c,d,e){return b.onDrop(a,c,d,e)},onDragEnter:function(a,c,d,e){return b.onDragEnterOrOver(a,c,d,e)},onDragOver:function(a,c,d,e){return b.onDragEnterOrOver(a,
c,d,e)},onDragLeave:function(a,c,d,e){return b.onDragLeave(a,c,d,e)},itemSelector:"li"}));b.view.selectAllCbx&&b.view.selectAllCbx.addEventListener(events._Event.CHANGE,function(){return b.onSelectAllChange()});b.view.btnAddMeasure&&b.view.btnAddMeasure.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return b.onAddMeasureClick()});return b}__extends(c,a);c.prototype.onDragEnterOrOver=function(a,c,b,d){this.removeDropIndicator();a&&a.closest("ul")&&(c&&c.addClass("wdr-droppable-valid"),
a.addClass("wdr-drag-over"),this.showIndicator(uicontrols.UIElement.convert(d.target)))};c.prototype.onDragLeave=function(a,c,b,d){this.removeDropIndicator();a&&a.closest("ul")&&(c&&c.removeClass("wdr-droppable-valid"),c&&c.removeClass("wdr-droppable-invalid"),a.removeClass("wdr-drag-over"))};c.prototype.onDrop=function(a,c,b,d){this.removeDropIndicator();a&&a.closest("ul")&&(a=parseInt(a.attr("data-index")),b=b?parseFloat(b.attr("data-index")):this.view.lstHierarchies.getDataProvider().length,a!=
b&&(c=this.view.lstHierarchies.getDataProvider(),a<b&&(b-=1),c.splice(b,0,c.splice(a,1)[0]),this.updateView()))};c.prototype.onCancelClick=function(){this.view.close()};c.prototype.onOkClick=function(){this.applySlice();this.view.close()};c.prototype.onSelectAllChange=function(){for(var a=this.view.selectAllCbx.checked,c=this.model_.hierarchies,b=0;b<c.length;b++)c[b].isSelected=a;this.view.lstHierarchies.validateNow()};c.prototype.onHierarchyFieldClick=function(a){var c=uicontrols.UIElement.convert(a.target).closest("li");
if(null!=c){var c=parseInt(c.attr("data-index")),b=this.model_.hierarchies[c];"wdr-calc-display"==uicontrols.UIElement.convert(a.target).attr("id")?d.model.PivotModel.getInstance().dispatchWith(e.ViewEvent.CALCULATED_VIEW_OPEN,null,{measureName:b.uniqueName}):(b.isSelected=!b.isSelected,this.view.lstHierarchies&&this.view.lstHierarchies.validateItemAt(c),this.view.selectAllCbx&&this.view.selectAllCbx.setSelection(this.model_.getSelectAllSelection()))}};c.prototype.onAddMeasureClick=function(){d.model.PivotModel.getInstance().dispatchWith(e.ViewEvent.CALCULATED_VIEW_OPEN);
d.model.PivotModel.getInstance().addEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_ADDED,this.calculatedValueAddedHandler);d.model.PivotModel.getInstance().addEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_REMOVED,this.calculatedValueRemovedHandler)};c.prototype.onCalculatedValueAdded=function(a){d.model.PivotModel.getInstance().removeEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_ADDED,this.calculatedValueAddedHandler);this.model_.onCalculatedValueAdded(a.data.measureUniqueName);
this.updateView()};c.prototype.onCalculatedValueRemoved=function(a){d.model.PivotModel.getInstance().removeEventListener(e.calculated.CalculatedView.EVENT_CALCULATED_VALUE_REMOVED,this.calculatedValueRemovedHandler);this.model_.onCalculatedValueRemoved(a.data);this.updateView()};c.prototype.updateView=function(){var a=this;if(this.view.lstHierarchies){this.view.lstHierarchies.setDataProvider(this.model_.hierarchies);this.validateSlice();this.view.lstHierarchies.validateNow();var c={createHelper:function(c){return a.view.createHelper(c)}};
utils.browserVersion().isMobile&&(c.handle="#wdr-drag-handle");for(var b=this.view.lstHierarchies.container.find("li",!0),d=0;d<b.length;d++)b[d].draggable(c)}};c.prototype.update=function(a,c){this.model_.update(a,c);this.updateView();this.view.selectAllCbx&&this.view.selectAllCbx.setSelection(this.model_.getSelectAllSelection());this.view.setLabels()};c.prototype.validateSlice=function(){this.view.btnOk&&this.view.btnOk.setEnabled(this.model_.isValidSlice())};c.prototype.applySlice=function(){for(var a=
[],c=this.view.lstHierarchies.container.find("li",!0),b=0;b<c.length;b++){var d=parseInt(c[b].attr("data-index"));a.push(d)}a=this.model_.getSlice(a);this.model_.isSliceDifferent(a)&&this.dispatchWith(h.FieldsView.EVENT_APPLY_SLICE,this,a)};c.prototype.showIndicator=function(a){var c=a.closest("li");null!=c?(this._dropIndicator=this.createDropIndicator(),c.before(this._dropIndicator)):(a=a.closest("ul"),null!=a&&(this._dropIndicator=this.createDropIndicator(),0<a.element.children.length?a.append(this._dropIndicator):
a.prepend(this._dropIndicator)))};c.prototype.createDropIndicator=function(){return new uicontrols.UIElement("div","wdr-drop-indicator")};c.prototype.removeDropIndicator=function(){this._dropIndicator&&(this._dropIndicator.removeFromParent(!0),this._dropIndicator=null)};return c}(events.EventDispatcher);f.FlatFieldsController=b})(h.flat||(h.flat={}))})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){(function(f){var b=function(a){function c(c,b){var d=a.call(this,b)||this;d.addClass("wdr-flat-fields");d.controller=c;d.setControls();return d}__extends(c,a);c.prototype.setControls=function(){var a=new uicontrols.UIComponentBase("div","wdr-popup-header wdr-ui-row");this.addChild(a);var c=new uicontrols.UIComponentBase("div","wdr-ui-col wdr-vam");a.addChild(c);this.lblTitle=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_TITLE);this.lblTitle.addClass("wdr-popup-title");
c.addChild(this.lblTitle);this.lblSubtitle=new uicontrols.UILabel(d.model._labels.Labels.FIELDS_LIST_FLAT_HIERARCHY_BOX);this.lblSubtitle.addClass("wdr-popup-subtitle");c.addChild(this.lblSubtitle);c=new uicontrols.UIComponentBase("div","wdr-ui-col wdr-vam wdr-tar wdr-ui-btns-row");a.addChild(c);this.btnAddMeasure=new uicontrols.UIButton("wdr-ui-btn-light wdr-icon-act_calc");this.btnAddMeasure.setId("wdr-btn-add-measure");c.addChild(this.btnAddMeasure);this.btnCancel=new uicontrols.UIButton;this.btnCancel.setLabel(d.model._labels.Labels.BUTTON_CANCEL);
this.btnOk=new uicontrols.UIButton("wdr-ui-btn-dark");this.btnOk.setLabel(d.model._labels.Labels.BUTTON_APPLY);utils.OSUtil.isIOS||utils.OSUtil.isMac?(c.addChild(this.btnCancel),c.addChild(this.btnOk)):(c.addChild(this.btnOk),c.addChild(this.btnCancel));c=new uicontrols.UIComponentBase("div","wdr-popup-content");this.addChild(c);a=new uicontrols.UIComponentBase("div","wdr-list-wrap");c.addChild(a);c=new uicontrols.UIComponentBase("div","wdr-list-header");a.addChild(c);this.selectAllCbx=new uicontrols.UICheckBox;
this.selectAllCbx.setId("wdr-select-all-cbx");this.selectAllCbx.setLabel(d.model._labels.Labels.FILTER_SELECT_ALL);c.addChild(this.selectAllCbx);c=new uicontrols.UIComponentBase("div","wdr-list-content");a.addChild(c);this.lstHierarchies=new uicontrols.lists.UIList;this.lstHierarchies.setId("wdr-lst-hierarchies");this.lstHierarchies.setItemRendererFactory(this.selectableItemRendererFactory);this.lstHierarchies.setLabelField("caption");c.addChild(this.lstHierarchies)};c.prototype.selectableItemRendererFactory=
function(a,c){var b=new e.renderers.SelectableItemRenderer(a,c);b.setData(a);b.setIndex(c);return b};c.prototype.setLabels=function(){this.lblTitle.setLabel(d.model._labels.Labels.FIELDS_LIST_TITLE);this.lblSubtitle.setLabel(d.model._labels.Labels.FIELDS_LIST_FLAT_HIERARCHY_BOX);this.btnCancel.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.btnOk.setLabel(d.model._labels.Labels.BUTTON_APPLY);this.selectAllCbx.setLabel(d.model._labels.Labels.FILTER_SELECT_ALL)};c.prototype.createHelper=function(a){var c=
new uicontrols.UIElement("span");c.attr("id","wdr-drag-handle");c.addClass("wdr-helper");c.addClass("wdr-draggable");c.toggleClass("wdr-values",a.hasClass("wdr-values"));c.css("width",a.css("width"));c.css("position","absolute");c.css("z-index",100);c.attr("data-index",a.attr("data-index"));c.text(a.text());return c};return c}(uicontrols.containers.UIPopup);f.FlatFieldsView=b})(e.flat||(e.flat={}))})(e.config||(e.config={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(b){function a(){var a=b.call(this,d.PivotView.stage.container)||this;a.setId("wdr-calculated-view");a.container.disableSelection();a.overlay.addClass("wdr-calculated-view-overlay");a.controller=new h.CalculatedController;a.controller.addEventListener(events._Event.CLOSE,function(){return a.close()});a.addChild(a.controller.view);return a}__extends(a,b);a.prototype.openView=function(a){this.controller.update(a);this.open()};a.prototype.close=function(){b.prototype.close.call(this);
this.controller.clear()};a.EVENT_CALCULATED_VALUE_ADDED="EVENT_CALCULATED_VALUE_ADDED";a.EVENT_CALCULATED_VALUE_REMOVED="EVENT_CALCULATED_VALUE_REMOVED";a.addingMeasureFlag=!1;return a}(uicontrols.containers.UIPopup);h.CalculatedView=f})(d.calculated||(d.calculated={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){this.model_=d.model.PivotModel.getInstance();this.funcButtonsDataProvider=[{name:"_addBtn",label:"+",func:d.data_.consts.FunctionName.ADD},{name:"_subtractBtn",label:"-",func:d.data_.consts.FunctionName.SUBTRACT},{name:"_multiplyBtn",label:"\u00d7",func:d.data_.consts.FunctionName.MULTIPLY},{name:"_divideBtn",label:"\u00f7",func:d.data_.consts.FunctionName.DIVIDE},{name:"_powerBtn",label:"^",func:d.data_.consts.FunctionName.POWER},
{name:"_equalBtn",label:"=",func:d.data_.consts.FunctionName.EQUAL},{name:"_lessBtn",label:"<",func:d.data_.consts.FunctionName.LESS},{name:"_greaterBtn",label:">",func:d.data_.consts.FunctionName.GREATER},{name:"_lessOrEqualBtn",label:"\u2264",func:d.data_.consts.FunctionName.LESS_OR_EQUAL},{name:"_greaterOrEqualBtn",label:"\u2265",func:d.data_.consts.FunctionName.GREATER_OR_EQUAL},{name:"_equalBtn2",label:"==",func:d.data_.consts.FunctionName.EQUAL_2},{name:"_notEqualBtn",label:"!=",func:d.data_.consts.FunctionName.NOT_EQUAL},
{name:"_orBtn",label:"OR",func:d.data_.consts.FunctionName.OR},{name:"_andBtn",label:"AND",func:d.data_.consts.FunctionName.AND},{name:"_ifBtn",label:"IF",func:d.data_.consts.FunctionName.IF},{name:"_absBtn",label:"ABS",func:d.data_.consts.FunctionName.ABS},{name:"_minBtn",label:"MIN",func:d.data_.consts.FunctionName.MIN},{name:"_maxBtn",label:"MAX",func:d.data_.consts.FunctionName.MAX}]}b.prototype.update=function(a){utils.nullOrEmpty(a)||(this.currentMeasure=this.model_.cube_.structure_.findMeasure(a))};
Object.defineProperty(b.prototype,"showAggregations",{get:function(){return!0},enumerable:!0,configurable:!0});b.prototype.getAllMeasures=function(){return this.model_.getAllMeasures()};b.prototype.removeMeasure=function(a){h.CalculatedView.addingMeasureFlag=!0;this.model_.removeCalculatedMeasure(a.uniqueName);this.model_.dispatchWith(h.CalculatedView.EVENT_CALCULATED_VALUE_REMOVED,null,a.uniqueName);utils.fmSetTimeout(function(){h.CalculatedView.addingMeasureFlag=!1},1E3)};b.prototype.addMeasure=
function(a,c,b){void 0===c&&(c="");void 0===b&&(b=!1);c=0<c.length?c:this.generateMeasureName();var f;if(null!=this.currentMeasure){if(this.currentMeasure.caption!=c||this.currentMeasure.formula!=a||this.currentMeasure.individual!=b)f=new d.data_._structure.GenericMeasure(this.currentMeasure.uniqueName,c),f.formula=a,f.individual=b}else f=new d.data_._structure.GenericMeasure(c,c),f.formula=a,f.individual=b;null!=f&&(h.CalculatedView.addingMeasureFlag=!0,e.config._pivot.PivotFieldsModel.expandFormulas=
!0,this.model_.addCalculatedMeasure(f),this.model_.dispatchWith(h.CalculatedView.EVENT_CALCULATED_VALUE_ADDED,null,{measureUniqueName:f.uniqueName}),utils.fmSetTimeout(function(){h.CalculatedView.addingMeasureFlag=!1},1E3))};b.prototype.isValidFormula=function(a){a=(new utils.Lexer).parse(a);return null!=a&&void 0!=a.length};b.prototype.generateMeasureName=function(){for(var a=d.model._labels.Labels.CALCULATED_VIEW_FORMULA+" #",c=0,b=this.model_.cube_.structure_.calculatedMeasures,e=RegExp(d.model._labels.Labels.CALCULATED_VIEW_FORMULA+
" #"),f=0;f<b.length;f++){var h=b.getItemAt(f).caption;e.test(h)&&(c=Math.max(c,parseInt(h.substr(d.model._labels.Labels.CALCULATED_VIEW_FORMULA.length+2))))}return a+(c+1)};return b}();h.CalculatedModel=f})(e.calculated||(e.calculated={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var a=b.call(this)||this;a.model_=new h.CalculatedModel;a.view=new h.CalculatedViewContent(a);a.view.removeButton&&a.view.removeButton.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(b){return a.onRemoveBtnClick(b)});a.view.measuresDragList&&a.view.measuresDragList.setItemRendererFactory(function(b,d){return a.fieldItemRendererFactory(b,d)});a.view.formulaInput&&a.view.formulaInput.container.droppable({onDrop:function(b){return a.onMeasureDrop(b)},
onDragEnter:function(){return a.onFormulaDragEnterOrOver()},onDragOver:function(){return a.onFormulaDragEnterOrOver()},onDragLeave:function(){return a.onFormulaDragLeave()},itemSelector:"li"});a.view.btnOk&&a.view.btnOk.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return a.onOkClick()});a.view.btnCancel&&a.view.btnCancel.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return a.onCancelClick()});a.view.aggrView&&a.view.aggrView.addEventListener(events._Event.CHANGE,function(b){return a.onAggrChange(b)});
if(a.view.funcBtns)for(var d=0;d<a.view.funcBtns.length;d++)a.view.funcBtns[d].addEventListener(uicontrols.UIButton.CLICK_EVENT,function(b){return a.onFuncBtnClick(b)});return a}__extends(a,b);a.prototype.onFormulaDragEnterOrOver=function(){this.view.formulaInput.addClass("wdr-droppable-over")};a.prototype.onFormulaDragLeave=function(){this.view.formulaInput.removeClass("wdr-droppable-over")};a.prototype.onMeasureDrop=function(a){this.view.formulaInput.removeClass("wdr-droppable-over");a=parseInt(a.attr("data-index"));
a=this.view.measuresDragList.getDataProvider()[a];this.addNewFieldToFormula(a)};a.prototype.fieldItemRendererFactory=function(a,b){var f=this,k=new e.config.renderers.FieldItemRenderer;k.setData(a);k.setIndex(b);k.setLabelFunction(function(a){return a.name+" ("+d.data_.consts.AggregationName.aggregationCaption(a.aggregation)+")"});k.addEventListener("click",function(a){return f.onAggrClick(a)});k.addEventListener("dblclick",function(a){return f.onItemDblClick(a)});return k};Object.defineProperty(a.prototype,
"funcButtonsDataProvider",{get:function(){return this.model_.funcButtonsDataProvider},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isFormulaEmpty",{get:function(){return 0==this.view.formulaInput.getText().length},enumerable:!0,configurable:!0});a.prototype.update=function(a){this.model_.update(a);null!=this.model_.currentMeasure?(this.view.nameInput&&(this.view.nameInput.setText(this.model_.currentMeasure.caption),this.view.nameInput.container.toggleClass("wdr-compact",!0)),
this.view.formulaInput&&this.view.formulaInput.setText(this.model_.currentMeasure.formula),this.view.removeButton&&this.view.removeButton.isVisible(!0)):(this.view.nameInput&&this.view.nameInput.container.toggleClass("wdr-compact",!1),this.view.cbxIndiValues&&(this.view.cbxIndiValues.checked=!1),this.view.removeButton&&this.view.removeButton.isVisible(!1));this.view.cbxIndiValues&&(this.view.cbxIndiValues.checked=this.model_.currentMeasure?this.model_.currentMeasure.individual:!1);this.view.setLabels();
this.updateMeasuresList()};a.prototype.updateMeasuresList=function(){for(var a=this,b=this.model_.getAllMeasures(),e=[],f=0;f<b.length;f++)if(null==this.model_.currentMeasure||this.model_.currentMeasure.uniqueName!=b[f].uniqueName)b[f].isMeasure=!0,b[f].showAggregations=this.model_.showAggregations&&!b[f].calculated&&b[f].type!=d.data_.types.MeasureType.COUNT,e.push(b[f]);e.sort(this.compareFunction);if(this.view.measuresDragList)for(this.view.measuresDragList.setDataProvider(e),b={createHelper:function(b){return a.view.createHelper(b)}},
utils.browserVersion().isMobile&&(b.handle="#wdr-drag-handle"),e=this.view.measuresDragList.container.find("li",!0),f=0;f<e.length;f++)e[f].draggable(b)};a.prototype.clear=function(){this.view.nameInput&&this.view.nameInput.setText("");this.view.formulaInput&&this.view.formulaInput.setText("");this.model_.currentMeasure=null};a.prototype.compareFunction=function(a,b){return a.name>b.name?1:-1};a.prototype.onRemoveBtnClick=function(a){if(utils.browserVersion().isMobile)this.onRemoveMeasure();else this.showRemoveAlert()};
a.prototype.showRemoveAlert=function(){var a=this,b,e;utils.OSUtil.isIOS||utils.OSUtil.isMac?(b=[d.model._labels.Labels.BUTTON_NO,d.model._labels.Labels.BUTTON_YES],e=[null,function(){return a.onRemoveMeasure()}]):(b=[d.model._labels.Labels.BUTTON_YES,d.model._labels.Labels.BUTTON_NO],e=[function(){return a.onRemoveMeasure()},null]);var f=d.model.XSSCheck.valid(this.model_.currentMeasure.caption)?this.model_.currentMeasure.caption:d.model.XSSCheck.validate(this.model_.currentMeasure.caption);d.uialert(d.model._labels.Labels.CALCULATED_VIEW_REMOVE_VALUE_MESSAGE,
utils.StringUtils.bind(d.model._labels.Labels.CALCULATED_VIEW_REMOVE_VALUE_TITLE,f),d.AlertType.ALERT,b,e)};a.prototype.onRemoveMeasure=function(){this.model_.removeMeasure(this.model_.currentMeasure);this.close()};a.prototype.onAggrClick=function(a){if("wdr-aggr-display"==a.target.id){var b=parseInt(uicontrols.UIElement.convert(a.target).closest("li").attr("data-index")),b=this.view.measuresDragList.getDataProvider()[b];this.view.aggrView.showWith(b,uicontrols.UIElement.convert(a.target))}};a.prototype.onItemDblClick=
function(a){a=parseInt(uicontrols.UIElement.convert(a.target).closest("li").attr("data-index"));a=this.view.measuresDragList.getDataProvider()[a];this.addNewFieldToFormula(a)};a.prototype.addNewFieldToFormula=function(a){null!=a&&(a.aggregation==d.data_.consts.AggregationName.NONE?this.insertText(utils.StringUtils.bind('"{0}"',a.uniqueName)):this.insertText(utils.StringUtils.bind('{0}("{1}")',a.aggregation,a.uniqueName)))};a.prototype.onAggrChange=function(a){var b=a.data.fieldData;a=a.data.aggrData;
b.aggregation=a.aggregation;b.caption=a.caption+" of "+b.name;this.view.measuresDragList.validateItem(b)};a.prototype.onFuncBtnClick=function(a){a=parseInt(a.target.container.attr("data-index"));a=this.funcButtonsDataProvider[a].func;a==d.data_.consts.FunctionName.IF||a==d.data_.consts.FunctionName.ABS||a==d.data_.consts.FunctionName.MIN||a==d.data_.consts.FunctionName.MAX||a==d.data_.consts.FunctionName.VALUE?this.addSpecialOperation(a):this.addOperation(a)};a.prototype.onCancelClick=function(){this.close()};
a.prototype.onOkClick=function(){var a=this.view.formulaInput.getText();0==a.length?this.close():!1==this.model_.isValidFormula(a)?d.uialert(d.model._labels.Labels.MESSAGE_WRONG_FORMULA_FORMAT):(this.model_.addMeasure(a,this.view.nameInput.getText(),this.view.cbxIndiValues.checked),this.close())};a.prototype.close=function(){this.dispatchWith(events._Event.CLOSE)};a.prototype.insertText=function(a,b){void 0===b&&(b=0);var d=this.view.formulaInput.getSelectionBeginIndex();this.view.formulaInput.getSelectionEndIndex();
var e=this.view.formulaInput.getText();-1==d&&(d=this.lastPosition);0==d||" "==e.charAt(d-1)?(this.view.formulaInput.insertText(a+" "),this.lastPosition=d+a.length+1):(this.view.formulaInput.insertText(" "+a+" "),this.lastPosition=d+a.length+2);this.lastPosition-=b;this.view.formulaInput.setSelection(this.lastPosition)};a.prototype.addOperation=function(a){this.insertText(a)};a.prototype.addSpecialOperation=function(a){var b=this.view.formulaInput.getSelectionBeginIndex(),d=this.view.formulaInput.getSelectionEndIndex(),
e=this.view.formulaInput.getText();"if"==a?this.insertText(a+"("+e.slice(b,d)+", , )",6):this.insertText(a+"("+e.slice(b,d)+")",2)};return a}(events.EventDispatcher);h.CalculatedController=f})(e.calculated||(e.calculated={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(a){var d=b.call(this)||this;d.controller=a;d.setControls();return d}__extends(a,b);a.prototype.setControls=function(){var a=this,b=new uicontrols.UIComponentBase("div","wdr-popup-header wdr-ui-row");this.addChild(b);var f=new uicontrols.UIComponentBase("div","wdr-ui-col wdr-vam");b.addChild(f);this.titleLabel=new uicontrols.UILabel(d.model._labels.Labels.CALCULATED_VIEW_TITLE);this.titleLabel.addClass("wdr-popup-title");f.addChild(this.titleLabel);
this.subtitleLabel=new uicontrols.UILabel(d.model._labels.Labels.CALCULATED_VIEW_MEASURE_BOX);this.subtitleLabel.addClass("wdr-popup-subtitle");f.addChild(this.subtitleLabel);f=new uicontrols.UIComponentBase("div","wdr-ui-col wdr-vam wdr-tar wdr-ui-btns-row");b.addChild(f);this.removeButton=new uicontrols.UIButton("wdr-ui-btn-light wdr-icon-act_trash");this.removeButton.setId("wdr-remove-btn");this.removeButton.container.attr("title",d.model._labels.Labels.CALCULATED_VIEW_REMOVE_VALUE);f.addChild(this.removeButton);
this.btnCancel=new uicontrols.UIButton("wdr-ui-btn");this.btnCancel.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.btnOk=new uicontrols.UIButton("wdr-ui-btn-dark");this.btnOk.setLabel(d.model._labels.Labels.BUTTON_APPLY);utils.OSUtil.isIOS||utils.OSUtil.isMac?(f.addChild(this.btnCancel),f.addChild(this.btnOk)):(f.addChild(this.btnOk),f.addChild(this.btnCancel));b=new uicontrols.UIComponentBase("div","wdr-popup-content");this.addChild(b);this.nameInput=new uicontrols.UITextInput;this.nameInput.setId("wdr-name-input");
this.nameInput.setPrompt(d.model._labels.Labels.CALCULATED_VIEW_MEASURE_NAME);b.addChild(this.nameInput);this.measuresDragList=new uicontrols.lists.UIList;this.measuresDragList.setId("wdr-lst-measures");this.measuresDragList.useCache=!1;this.measuresDragList.setLabelField("caption");b.addChild(this.measuresDragList);this.cbxIndiValues=new uicontrols.UICheckBox;this.cbxIndiValues.setLabel(d.model._labels.Labels.CALCULATED_VIEW_CALCULATE_INDI_VALUES);b.addChild(this.cbxIndiValues);this.funcBtnsContainer=
new uicontrols.UIComponentBase("div","wdr-ui-row");this.funcBtnsContainer.setId("wdr-func-btn-group");b.addChild(this.funcBtnsContainer);this.funcBtns=[];for(var f=this.controller.funcButtonsDataProvider,k=0;k<f.length;k++){var h=new uicontrols.UIButton("wdr-ui-col-9 wdr-calc-action");h.removeClass("wdr-ui-btn");h.setName(f[k].name);h.setLabel(f[k].label);h.container.attr("data-index",k);this.funcBtnsContainer.addChild(h);this.funcBtns.push(h)}f=new uicontrols.UIComponentBase("div","wdr-formula-wrap");
b.addChild(f);this.formulaInput=new uicontrols.UITextArea;this.formulaInput.setId("wdr-formula-input");this.formulaInput.addEventListener(uicontrols.UITextInput.CHANGE_EVENT,function(){return a.onFormulaChange()});f.addChild(this.formulaInput);this.lblFormulaPrompt=new uicontrols.UILabel(d.model._labels.Labels.CALCULATED_VIEW_FORMULA_PROMPT);this.lblFormulaPrompt.addClass("wdr-prompt");f.addChild(this.lblFormulaPrompt);this.aggrView=new e.config.AggregationsView;this.aggrView.setId("wdr-aggregations-view");
this.aggrView.hide();b.addChild(this.aggrView)};a.prototype.setLabels=function(){this.titleLabel.setLabel(d.model._labels.Labels.CALCULATED_VIEW_TITLE);this.subtitleLabel.setLabel(d.model._labels.Labels.CALCULATED_VIEW_MEASURE_BOX);this.btnOk.setLabel(d.model._labels.Labels.BUTTON_APPLY);this.btnCancel.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.nameInput.setPrompt(d.model._labels.Labels.CALCULATED_VIEW_MEASURE_NAME);this.cbxIndiValues.setLabel(d.model._labels.Labels.CALCULATED_VIEW_CALCULATE_INDI_VALUES);
this.lblFormulaPrompt.setLabel(d.model._labels.Labels.CALCULATED_VIEW_FORMULA_PROMPT);this.removeButton.container.attr("title",d.model._labels.Labels.CALCULATED_VIEW_REMOVE_VALUE)};a.prototype.createHelper=function(a){var b=new uicontrols.UIElement("span");b.attr("id","wdr-drag-handle");b.addClass("wdr-helper");b.addClass("wdr-draggable");b.css("width",a.css("width"));b.css("position","absolute");b.css("z-index",100);b.attr("data-index",a.attr("data-index"));b.text(a.text());return b};a.prototype.onFormulaChange=
function(){this.lblFormulaPrompt.isVisible(0==this.formulaInput.getText().length)};return a}(uicontrols.UIComponentBase);h.CalculatedViewContent=f})(e.calculated||(e.calculated={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){var h=function(){function b(){}b.FILTER_OPEN="FILTER_OPEN";b.FILTER_CLOSE="FILTER_CLOSE";b.FILTER_SELECTION_CHANGE="FILTER_SELECTION_CHANGE";b.FILTER_COLLAPSE_EXPAND="FILTER_COLLAPSE_EXPAND";b.CALCULATED_VIEW_OPEN="CALCULATED_VIEW_OPEN";b.CALCULATED_VIEW_CLOSE="CALCULATED_VIEW_CLOSE";b.DRILL_THROUGH_OPEN="DRILL_THROUGH_OPEN";b.DRILL_THROUGH_CLOSE="DRILL_THROUGH_CLOSE";b.CONTEXT_MENU_OPEN="CONTEXT_MENU_OPEN";b.CLASSIC_TO_COMPACT="CLASSIC_TO_COMPACT";b.RENDER_COMPLETE="RENDER_COMPLETE";
b.BEFORE_GRID_DRAW="beforegriddraw";b.AFTER_GRID_DRAW="aftergriddraw";return b}();d.ViewEvent=h;var f=function(b){function a(a){var d=b.call(this,h.FILTER_OPEN)||this;d.hierarchy=a;return d}__extends(a,b);return a}(events._Event);d.FilterOpenEvent=f})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){this.allMembers=[];this.selectedMembers=[];this.searchedMembers=[];this.searchPhrase="";this.isAllSelected=!0}b.prototype.setHierarchy=function(a){this.currentHierarchy=a};b.prototype.getHierarchy=function(){return this.currentHierarchy};b.prototype.setSortType=function(a){this.sortType=a;this.allMembers=this.currentHierarchy.sortChildren(this.currentHierarchy.allMember,!1,this.sortType).toArray()};b.prototype.getSortType=function(){return this.sortType};
b.prototype.select=function(a,b){if(this.isAllSelected!=b)this.selectedMembers.push(a);else{var d=this.selectedMembers.indexOf(a);-1<d&&this.selectedMembers.splice(d,1)}this.selectedMembers.length==this.allMembers.length&&this.selectAll(!this.isAllSelected)};b.prototype.search=function(a,b){a=a.toLowerCase();if(this.searchPhrase===a)b();else if(this.searchPhrase=a,0==this.searchPhrase.length)b();else{this.searchedMembers.length=0;for(var d=this.allMembers.length,e=0,e=0;e<d;e++)utils.StringUtils.contains(this.allMembers[e].caption,
a)&&this.searchedMembers.push(this.allMembers[e]);b(this.searchedMembers)}};b.prototype.setSearchedMembers=function(a){null!=a?this.searchedMembers=a:this.searchedMembers.length=0};b.prototype.selectAll=function(a){if(this.isSearched())for(var b=this.searchedMembers.length,d=0;d<b;d++)utils.StringUtils.contains(this.searchedMembers[d].caption,this.searchPhrase)&&this.select(this.searchedMembers[d],a);else this.isAllSelected=a,this.selectedMembers.length=0};b.prototype.selectDescendants=function(a){};
b.prototype.getTotalSelectedLength=function(){var a=0,a=this.isAllSelected||this.isSearched()?this.isAllSelected&&this.isSearched()?this.searchedMembers.length+this.countTheDifference()-this.selectedMembers.length:this.isAllSelected||0!=this.selectedMembers.length?this.allMembers.length-this.selectedMembers.length:this.selectedMembers.length:this.selectedMembers.length;return 0<a?a:0};b.prototype.countTheDifference=function(){for(var a=0,b=0,d=0;b<this.selectedMembers.length;){for(;d<this.searchedMembers.length&&
this.searchedMembers[d].uniqueName!=this.selectedMembers[b].uniqueName;)d++;this.searchedMembers.length==d&&a++;d=0;b++}return a};b.prototype.getSelectedLength=function(){if(this.isSearched()){for(var a=0,b=0;b<this.searchedMembers.length;b++)0>utils.ArrayUtils.findIndex(this.selectedMembers,this.searchedMembers[b].uniqueName,"uniqueName")==this.isAllSelected&&a++;return a}return this.getTotalSelectedLength()};b.prototype.setFilterItems=function(a){this.selectedMembers.length=0;var b=a.length;this.isAllSelected=
0==b;if(!this.isAllSelected)for(var d=0;d<b;d++)this.selectedMembers.push(a[d])};b.prototype.getFilterItems=function(){var a=0,b=[],d=[],d=this.isSearched()&&this.isAllSelected?this.searchedMembers:this.selectedMembers,e=d.length;if(this.isSearched()&&this.isAllSelected)for(d=a=0;a<this.searchedMembers.length;){for(;d<this.selectedMembers.length&&this.searchedMembers[a].uniqueName!=this.selectedMembers[d].uniqueName;)d++;d==this.selectedMembers.length&&b.push(this.searchedMembers[a]);d=0;a++}else for(;a<
e;a++)b[a]=d[a];a=this.isSearched()&&this.isAllSelected?!1:0==b.length?!1:this.isAllSelected;return{items:b,negation:a}};b.prototype.setItems=function(a){this.allMembers=a;this.searchPhrase="";this.searchedMembers.length=0};b.prototype.getItems=function(a,b){for(var d,e=[],f=a,h=RegExp("("+this.searchPhrase+")","i"),s=this.isSearched()?this.searchedMembers:this.allMembers;f<b&&!(f>s.length-1);f++)d=s[f],d={member:d,label:this.isSearched()?d.caption.replace(h,"<b>$1</b>"):d.caption,isSelected:(-1==
this.selectedMembers.indexOf(d)?this.isAllSelected:!this.isAllSelected)?1:0,levelNum:0,rightMargin:b-a<s.length-1?15:0},e.push(d);return e};b.prototype.getLength=function(){return this.isSearched()?this.searchedMembers.length:this.allMembers.length};b.prototype.getTotalLength=function(){return this.getLength()};b.prototype.isSearched=function(){return 0<this.searchPhrase.length};b.prototype.expand=function(a){};b.prototype.collapse=function(a){};return b}();d.MembersFilterDataProvider=e})(d.filter||
(d.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(){function b(){this.numParentsInSearch=0;this.members=[];this.selectedMembers=[];this.searchedMembers=[];this.partlySelectedMembers=[];this.expandedMembers=[];this.searchPhrase="";this.isAllSelected=!0;this.sortType=d.data_.consts.SortType.UNSORTED}b.prototype.setHierarchy=function(a){this.currentHierarchy=a;this.members.length=0};b.prototype.getHierarchy=function(){return this.currentHierarchy};b.prototype.setSortType=function(a){this.sortType=
a;this.members.length=0;this.insertDescendants(this.currentHierarchy.allMember,-1)};b.prototype.getSortType=function(){return this.sortType};b.prototype.setItems=function(a){for(var b=0,e=a.length,f;b<e;b++)f=a[b],f.isAll||(this.members.push(f),f.isDrilledDown&&f.children&&0<f.children.length&&(this.expandedMembers.push(f),this.setItems(this.sortType===d.data_.consts.SortType.UNSORTED?f.children.toArray():this.currentHierarchy.sortChildren(f,!1,this.sortType).toArray())))};b.prototype.getItems=function(a,
b){for(var d=a,e=[],f,h=RegExp("("+this.searchPhrase+")","i"),s=this.isSearched()?this.searchedMembers:this.members;d<b&&!(d>s.length-1);d++)f=s[d],f={member:f,levelNum:f.level.num,label:this.isSearched()?f.caption.replace(h,"<b>$1</b>"):f.caption,isSelected:this.isSelected(f),isSearched:this.isSearched(),isExpanded:this.isExpanded(f),rightMargin:b-a<s.length-1?17:0},e.push(f);return e};b.prototype.isSelected=function(a){var b=(-1==this.selectedMembers.indexOf(a)?this.isAllSelected:!this.isAllSelected)?
1:0;0<this.selectedMembers.length&&-1!=this.partlySelectedMembers.indexOf(a)&&(b=-1);return b};b.prototype.isExpanded=function(a){return this.isSearched()||a.isLeaf?-1:-1!=this.expandedMembers.indexOf(a)?1:0};b.prototype.getLength=function(){return this.isSearched()?this.searchedMembers.length:this.members.length};b.prototype.getTotalLength=function(){return this.isSearched()?this.searchedMembers.length-this.numParentsInSearch:this.currentHierarchy?this.currentHierarchy.members.length-1:0};b.prototype.select=
function(a,b){var d=-1,d=this.selectedMembers.indexOf(a);this.isAllSelected!==b?(-1==d&&this.selectedMembers.push(a),0<a.children.length&&this.pushDescendantsToSelected(a)):(-1!=d&&this.selectedMembers.splice(d,1),0<a.children.length&&this.removeDescendantsFromSelected(a));d=utils.ArrayUtils.findIndex(this.partlySelectedMembers,a.uniqueName,"uniqueName");-1!=d&&this.partlySelectedMembers.splice(d,1);this.selectParents(a);this.selectedMembers.length===this.currentHierarchy.members.length-1&&(this.selectedMembers.length=
0,this.partlySelectedMembers.length=0,this.isAllSelected=!this.isAllSelected)};b.prototype.selectDescendants=function(a){-1==this.partlySelectedMembers.indexOf(a)&&(-1==this.selectedMembers.indexOf(a)?this.removeDescendantsFromSelected(a):this.pushDescendantsToSelected(a))};b.prototype.selectParents=function(a){var b,d=a.parent;if(d&&!d.isAll){a=utils.ArrayUtils.findIndex(this.selectedMembers,d.uniqueName,"uniqueName");b=utils.ArrayUtils.findIndex(this.partlySelectedMembers,d.uniqueName,"uniqueName");
var e=-1!=a;this.hasSelectedChildren(d,!1)?(this.hasSelectedChildren(d)?(-1==b&&this.partlySelectedMembers.push(d),this.isAllSelected&&e&&this.selectedMembers.splice(a,1)):(-1!=b&&this.partlySelectedMembers.splice(b,1),this.isAllSelected&&!e&&this.selectedMembers.push(d)),!this.isAllSelected&&e&&this.selectedMembers.splice(a,1)):(-1!=b&&this.partlySelectedMembers.splice(b,1),this.isAllSelected&&e?this.selectedMembers.splice(a,1):this.isAllSelected||e||this.selectedMembers.push(d));this.selectParents(d)}};
b.prototype.hasSelectedChildren=function(a,b){void 0===b&&(b=!0);for(var d=0,e=a.children.toArray(),f=e.length,h;d<f;d++)if(h=e[d],-1==utils.ArrayUtils.findIndex(this.selectedMembers,h.uniqueName,"uniqueName")==this.isAllSelected==b||-1!=utils.ArrayUtils.findIndex(this.partlySelectedMembers,h.uniqueName,"uniqueName"))return!0;return!1};b.prototype.pushDescendantsToSelected=function(a){for(var b=0,d,e,f=a.children.toArray(),h=f.length;b<h;b++)e=f[b],a=utils.ArrayUtils.findIndex(this.selectedMembers,
e.uniqueName,"uniqueName"),d=utils.ArrayUtils.findIndex(this.partlySelectedMembers,e.uniqueName,"uniqueName"),-1==a&&this.selectedMembers.push(e),-1!=d&&this.partlySelectedMembers.splice(d,1),0<e.children.length&&this.pushDescendantsToSelected(e)};b.prototype.removeDescendantsFromSelected=function(a){for(var b=0,d,e,f=a.children.toArray(),h=f.length;b<h;b++)e=f[b],a=utils.ArrayUtils.findIndex(this.selectedMembers,e.uniqueName,"uniqueName"),d=utils.ArrayUtils.findIndex(this.partlySelectedMembers,e.uniqueName,
"uniqueName"),-1!=a&&this.selectedMembers.splice(a,1),-1!=d&&this.partlySelectedMembers.splice(d,1),0<e.children.length&&this.removeDescendantsFromSelected(e)};b.prototype.selectAll=function(a){if(this.isSearched())for(var b=this.searchedMembers.length,d=0;d<b;d++)utils.StringUtils.contains(this.searchedMembers[d].caption,this.searchPhrase)&&this.select(this.searchedMembers[d],a);else this.isAllSelected=a,this.selectedMembers.length=0,this.partlySelectedMembers.length=0};b.prototype.getSelectedLength=
function(){if(this.isSearched()){for(var a=0,b=this.searchedMembers.length,d=0;d<b;d++)utils.StringUtils.contains(this.searchedMembers[d].caption,this.searchPhrase)&&0>utils.ArrayUtils.findIndex(this.selectedMembers,this.searchedMembers[d].uniqueName,"uniqueName")==this.isAllSelected&&a++;return a}return this.getTotalSelectedLength()};b.prototype.getTotalSelectedLength=function(){var a=this.isAllSelected?this.currentHierarchy.members.length-this.selectedMembers.length-this.partlySelectedMembers.length-
1:this.selectedMembers.length;return 0>a?0:a};b.prototype.setFilterItems=function(a){var b=a.length;this.selectedMembers.length=0;this.partlySelectedMembers.length=0;if(0==b)this.isAllSelected=!0;else{this.isAllSelected=!1;for(var d,e,f=0;f<b;f++)for(d=a[f],e=d.children.toArray(),e=e.length,this.selectedMembers.push(d),0<e&&this.pushDescendantsToSelected(d);d.parent&&!d.parent.isAll;)d=d.parent,-1==utils.ArrayUtils.findIndex(this.partlySelectedMembers,d.uniqueName,"uniqueName")&&this.partlySelectedMembers.push(d)}};
b.prototype.getFilterItems=function(){for(var a=0,b=[],d,e,f,h=[],h=this.isSearched()&&this.isAllSelected?this.searchedMembers:this.selectedMembers,s=h.length;a<s;a++)d=h[a],e=d.parent,f=-1,utils.nullOrUndefined(e)||(f=utils.ArrayUtils.findIndex(h,e.uniqueName,"uniqueName")),-1===f&&b.push(d);a=this.isSearched()&&this.isAllSelected?!1:0==b.length?!1:this.isAllSelected;return{items:b,negation:a}};b.prototype.search=function(a,b){a=a.toLowerCase();if(this.searchPhrase===a)b();else if(this.searchPhrase=
a,0==this.searchPhrase.length)b();else{this.numParentsInSearch=this.searchedMembers.length=0;this.fillSearchTree(this.currentHierarchy.allMember,a);for(var d=0,e=0,e=0;e<this.searchedMembers.length;e++)d=this.insertParentsToSearch(this.searchedMembers[e],e),this.numParentsInSearch+=d,e+=d;b(this.searchedMembers)}};b.prototype.setSearchedMembers=function(a){null!=a?this.searchedMembers=a:this.searchedMembers.length=0};b.prototype.insertParentsToSearch=function(a,b){var d=a.parent,e=0;utils.nullOrUndefined(d)||
d.isAll||(-1==utils.ArrayUtils.findIndex(this.searchedMembers,d.uniqueName,"uniqueName")&&(e++,this.searchedMembers.splice(b,0,d)),e+=this.insertParentsToSearch(d,b));return e};b.prototype.fillSearchTree=function(a,b){for(var d=a.children,e=d.length,f,h=0;h<e;h++)f=d.getItemAt(h),utils.StringUtils.contains(f.caption,b)&&this.searchedMembers.push(f),this.fillSearchTree(f,b)};b.prototype.isSearched=function(){return 0<this.searchPhrase.length};b.prototype.expand=function(a){-1==this.expandedMembers.indexOf(a)&&
this.expandedMembers.push(a);this.showDescendants(a,!0)};b.prototype.collapse=function(a){var b=this.expandedMembers.indexOf(a);-1!=b&&this.expandedMembers.splice(b,1);this.showDescendants(a,!1)};b.prototype.showDescendants=function(a,b){var d=utils.ArrayUtils.findIndex(this.members,a.uniqueName,"uniqueName");b?this.insertDescendants(a,d):this.members.splice(d+1,this.getNumDescendants(a))};b.prototype.insertDescendants=function(a,b){for(var e=this.sortType===d.data_.consts.SortType.UNSORTED?a.children.toArray():
this.currentHierarchy.sortChildren(a,!1,this.sortType).toArray(),f,k=e.length-1,h=b+1;-1<k;k--)f=e[k],this.members.splice(h,0,f),-1<this.expandedMembers.indexOf(f)&&this.insertDescendants(f,h)};b.prototype.getNumDescendants=function(a){a=a.children.toArray();for(var b=a.length,d=b,e,f=0;f<b;f++)e=a[f],-1<this.expandedMembers.indexOf(e)&&(d+=this.getNumDescendants(e));return d};return b}();e.MembersTreeDataProvider=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(b){function a(a){var d=b.call(this)||this;d.controller=a;d.setControls();return d}__extends(a,b);a.prototype.setControls=function(){var a=new uicontrols.UIComponentBase("div","wdr-popup-header wdr-ui-row");this.addChild(a);var b=new uicontrols.UIComponentBase("div","wdr-ui-col-2 wdr-vam");a.addChild(b);this.titleLabel=new uicontrols.UILabel;this.titleLabel.addClass("wdr-popup-title");b.addChild(this.titleLabel);b=new uicontrols.UIComponentBase("div",
"wdr-ui-col wdr-vam wdr-ui-btns-row");a.addChild(b);this.cancelBtn=new uicontrols.UIButton("wdr-ui-btn");this.cancelBtn.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.okBtn=new uicontrols.UIButton("wdr-ui-btn-dark");this.okBtn.setLabel(d.model._labels.Labels.BUTTON_APPLY);utils.OSUtil.isIOS||utils.OSUtil.isMac?(b.addChild(this.cancelBtn),b.addChild(this.okBtn)):(b.addChild(this.okBtn),b.addChild(this.cancelBtn));a=new uicontrols.UIComponentBase("div","wdr-ui-row");this.addChild(a);this.sortContainer=
new uicontrols.UIComponentBase("div","wdr-ui-col-2");this.sortContainer.container.display="inline-block";a.addChild(this.sortContainer);this.sortLabel=new uicontrols.UILabel;this.sortLabel.setId("wdr-sort-label");this.sortLabel.addClass("wdr-ui-label-light");this.sortLabel.setLabel(d.model._labels.Labels.FILTER_SORT);this.sortContainer.addChild(this.sortLabel);b=new uicontrols.UIComponentBase("div","wdr-sort-btns");this.sortContainer.addChild(b);this.azBtn=new uicontrols.UIToggleButton;this.azBtn.container.addClass("wdr-sort-btn");
this.azBtn.setLabel(d.model._labels.Labels.FILTER_ASC_SORT);b.addChild(this.azBtn);this.zaBtn=new uicontrols.UIToggleButton;this.zaBtn.container.addClass("wdr-sort-btn");this.zaBtn.setLabel(d.model._labels.Labels.FILTER_DESC_SORT);b.addChild(this.zaBtn);b=new uicontrols.UIComponentBase("div","wdr-ui-col-2 wdr-tar wdr-topx-col");b.container.display="inline-block";a.addChild(b);this.top10Btn=new uicontrols.UIToggleButton;this.top10Btn.setId("wdr-top10-btn");this.top10Btn.addClass("wdr-ui-toggle-btn-dark");
this.top10Btn.setLabel(d.model._labels.Labels.FILTER_TOP_X);b.addChild(this.top10Btn);this.clearTopBtn=new uicontrols.UIComponentBase("span","wdr-btn-canceltopx");this.clearTopBtn.setId("wdr-clear-top-btn");this.clearTopBtn.container.attr("title",d.model._labels.Labels.FILTER_TOP_X_CLEAR);this.top10Btn.addChild(this.clearTopBtn);this.topBottomView=new e.TopBottomView;this.topBottomView.setId("wdr-filters-topx-view");this.topBottomView.hide();this.addChild(this.topBottomView);this.membersView=new e.MembersView;
this.membersView.addClass("wdr-ft-contentheight-220");this.addChild(this.membersView)};Object.defineProperty(a.prototype,"selectAllCbx",{get:function(){return this.membersView.selectAllCbx},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"membersFilterList",{get:function(){return this.membersView.membersFilterList},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"selectedAmountLabel",{get:function(){return this.membersView.selectedAmountLabel},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"searchInput",{get:function(){return this.membersView.searchInput},enumerable:!0,configurable:!0});a.prototype.setLabels=function(){this.top10Btn.setLabel(d.model._labels.Labels.FILTER_TOP_X);this.clearTopBtn.container.attr("title",d.model._labels.Labels.FILTER_TOP_X_CLEAR);this.azBtn.setLabel(d.model._labels.Labels.FILTER_ASC_SORT);this.zaBtn.setLabel(d.model._labels.Labels.FILTER_DESC_SORT);this.searchInput.setPrompt(d.model._labels.Labels.FILTER_SEARCH);this.selectAllCbx.setLabel(d.model._labels.Labels.FILTER_SELECT_ALL);
this.okBtn.setLabel(d.model._labels.Labels.BUTTON_APPLY);this.cancelBtn.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.sortLabel.setLabel(d.model._labels.Labels.FILTER_SORT);this.topBottomView.setLabels()};return a}(uicontrols.containers.UIContainer);e.FilterViewContent=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(b){function a(){var a=b.call(this,"div","wdr-filters-table")||this,f=new uicontrols.UIComponentBase("div","wdr-filters-table-header wdr-fth-withsearch");a.addChild(f);a.selectAllCbx=new uicontrols.UICheckBox;a.selectAllCbx.setLabel(d.model._labels.Labels.FILTER_SELECT_ALL);f.addChild(a.selectAllCbx);a.selectedAmountLabel=new uicontrols.UILabel;a.selectedAmountLabel.setId("wdr-select-counter");f.addChild(a.selectedAmountLabel);a.searchWrap=new uicontrols.UIComponentBase("div",
"wdr-search-wrap");f.addChild(a.searchWrap);f=new uicontrols.UIComponentBase("a","wdr-search-btn");f.container.text(d.model._labels.Labels.FILTER_SEARCH);f.addEventListener("click",function(){return a.onSearchClick()});a.searchWrap.addChild(f);var m=new uicontrols.UIComponentBase("span","wdr-ui-icon wdr-icon-act_search");f.addChild(m);a.searchInput=new uicontrols.UITextInput;a.searchInput.addClass("wdr-search-inp");a.searchWrap.addChild(a.searchInput);f=new uicontrols.UIComponentBase("span","wdr-close-search wdr-ui-icon wdr-icon-act_close");
f.addEventListener("click",function(){return a.onSearchCloseClick()});a.searchWrap.addChild(f);f=new uicontrols.UIComponentBase("div","wdr-filters-table-content");a.addChild(f);a.membersFilterList=new e.FilterList;a.membersFilterList.setSmartDataProvider(new e.MembersFilterDataProvider);a.membersFilterList.setId("wdr-members-filter-list");f.addChild(a.membersFilterList);return a}__extends(a,b);a.prototype.onSearchClick=function(){this.searchWrap.addClass("wdr-search-opened");this.searchInput.container.focus();
this.selectedAmountLabel.hide()};a.prototype.onSearchCloseClick=function(){this.searchWrap.removeClass("wdr-search-opened");this.searchInput.clear();this.selectedAmountLabel.show()};a.prototype.reset=function(){this.onSearchCloseClick()};return a}(uicontrols.UIComponentBase);e.MembersView=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(b){function a(){var a=b.call(this)||this;a.levelMargin=20;a.expandBtn=new uicontrols.UIToggleButton;a.expandBtn.removeClass("wdr-ui-toggle-btn");a.expandBtn.addClass("wdr-expand-toggle-btn");a.expandBtn.addEventListener(events._Event.CHANGE,function(){return a.onCollapseExpand()});a.container.append(a.expandBtn.container);a.selectedCheckBox=new uicontrols.UICheckBox;a.selectedCheckBox.addEventListener(events._Event.CHANGE,function(){return a.onSelect()});
a.container.append(a.selectedCheckBox.container);a.container.addEventListener("click",function(b){return a.onClick(b)});a.invalidate("all");return a}__extends(a,b);a.prototype.onCollapseExpand=function(){var a=this.getData();a.isExpanded=this.expandBtn.getSelection();this.container.dispatchWith(d.FilterList.EXPAND_EVENT,this,a)};a.prototype.onClick=function(a){a.target==this.container.element&&(this.selectedCheckBox.toggle(),this.onSelect())};a.prototype.onSelect=function(){var a=this.getData();a.isSelected=
this.selectedCheckBox.getSelection();this.container.dispatchWith(d.FilterList.SELECT_EVENT,this,a)};a.prototype.draw=function(){if(this.isInvalid("data")){var a=this.getData();if(this.expandBtn&&this.selectedCheckBox&&a){this.container.css("padding-left","");var b=this.levelMargin*(a.levelNum-1);a.isSearched||-1!==a.isExpanded||(b+=30);0<b&&this.container.css("padding-left",b+"px");isNaN(a.isExpanded)||-1===a.isExpanded||a.isSearched?this.expandBtn.hide():(this.expandBtn.show(),this.expandBtn.setSelection(a.isExpanded));
b=a[this.getLabelField()];b=b.replace(/<(?:.|\n)*?>/gi,"");this.selectedCheckBox.setLabel(b,!0);this.selectedCheckBox.setSelection(a.isSelected)}}};return a}(uicontrols.renderers.UIItemRenderer);d.FilterListItemRenderer=e})(d.filter||(d.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(b){function a(){var a=b.call(this)||this;a.setItemRendererFactory(function(b,d){return a.getItemRendererFactory(b,d)});return a}__extends(a,b);a.prototype.getItemRendererFactory=function(b,d){var f=this,k=new e.FilterListItemRenderer;k.setData(b);k.setIndex(d);k.addEventListener(a.SELECT_EVENT,function(a){return f.onSelect(a)});k.addEventListener(a.EXPAND_EVENT,function(a){return f.onExpand(a)});return k};a.prototype.onSelect=function(b){b=b.data;
this.setSelected(b,1===b.isSelected);this.dispatch(new events._Event(a.SELECT_EVENT,this))};a.prototype.onExpand=function(b){var e=this,f=b.data;if(1===f.isExpanded)if(0===f.member.children.length)d.model.PivotModel.getInstance().cube_.loadMemberChildren(f.member.hierarchy_,f.member,function(a){return e.onChildrenLoaded(f.member)});else this.onChildrenLoaded(f.member);else this.getSmartDataProvider().collapse(f.member),this.invalidate("data"),this.dispatch(new events._Event(a.EXPAND_EVENT,this))};
a.prototype.onChildrenLoaded=function(b){d.preloader(!1);this.getSmartDataProvider().selectDescendants(b);this.getSmartDataProvider().expand(b);this.invalidate("data");this.dispatch(new events._Event(a.EXPAND_EVENT,this))};a.prototype.getSmartDataProvider=function(){return this.filterDataProvider};a.prototype.setSmartDataProvider=function(a){this.filterDataProvider=a};a.prototype.getFilterItems=function(){return this.getSmartDataProvider().getFilterItems()};a.prototype.setFilterItems=function(a){this.getSmartDataProvider().setFilterItems(a);
this.invalidate("data")};a.prototype.getSelectedLength=function(){return this.getSmartDataProvider().getSelectedLength()};a.prototype.getTotalSelectedLength=function(){return this.getSmartDataProvider().getTotalSelectedLength()};a.prototype.getTotalLength=function(){return this.getSmartDataProvider().getLength()};a.prototype.getTotalItemsCount=function(){return this.getSmartDataProvider().getTotalLength()};a.prototype.setSelected=function(a,b){this.getSmartDataProvider().select(a.member,b);this.invalidate("data")};
a.prototype.selectAll=function(a){this.getSmartDataProvider().selectAll(a);this.invalidate("data")};a.prototype.search=function(a,b){var d=this;this.getSmartDataProvider().search(a,function(a){d.getSmartDataProvider().setSearchedMembers(a);d.invalidate("data");b()})};a.prototype.isSearched=function(){return this.getSmartDataProvider().isSearched()};a.prototype.setHierarchy=function(a){this.getSmartDataProvider().setHierarchy(a)};a.prototype.sort=function(a){a!==this.getSmartDataProvider().getSortType()&&
(this.getSmartDataProvider().setSortType(a),this.invalidate("data"))};a.SELECT_EVENT="_";a.EXPAND_EVENT="__";return a}(uicontrols.lists.UIVirtualList);e.FilterList=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(e){var f=function(b){function a(){var a=b.call(this,"div")||this;a._isEmpty=!0;a.addClass("wdr-filters-subview");a.quantityInput=new uicontrols.UITextInput;a.quantityInput.setId("wdr-top-amount-input");a.quantityInput.setRestriction(/^\d+$/);a.quantityInput.setType("number");a.quantityInput.addEventListener(uicontrols.UITextInput.CHANGE_EVENT,function(){return a.onQuantityChange()});a.addChild(a.quantityInput);var e=new uicontrols.UIComponentBase("div");e.setId("wdr-topx-btns");
a.addChild(e);a.btnTop=new uicontrols.UIToggleButton;a.btnTop.setId("wdr-btn-top");a.btnTop.addClass("wdr-topx-btn");a.btnTop.setLabel(d.model._labels.Labels.FILTER_TOP);a.btnTop.addEventListener(events._Event.CHANGE,function(){return a.onBtnTopChange()});e.addChild(a.btnTop);a.btnBottom=new uicontrols.UIToggleButton;a.btnBottom.setId("wdr-btn-bottom");a.btnBottom.addClass("wdr-topx-btn");a.btnBottom.setLabel(d.model._labels.Labels.FILTER_BOTTOM);a.btnBottom.addEventListener(events._Event.CHANGE,
function(){return a.onBtnBottomChange()});e.addChild(a.btnBottom);a.measuresDropDown=new uicontrols.lists.UIDropDownList;a.measuresDropDown.setId("wdr-top-measures-dropdown");a.measuresDropDown.setLabelField("caption");a.measuresDropDown.setPrompt("");a.measuresDropDown.addEventListener(events._Event.CHANGE,function(b){return a.onMeasuresChange(b)});a.addChild(a.measuresDropDown);return a}__extends(a,b);a.prototype.onBtnTopChange=function(){this._isEmpty=!1;this.btnBottom.setSelection(1-this.btnTop.getSelection());
this.dispatch(new events._Event(a.CHANGE_EVENT,this))};a.prototype.onBtnBottomChange=function(){this._isEmpty=!1;this.btnTop.setSelection(1-this.btnBottom.getSelection());this.dispatch(new events._Event(a.CHANGE_EVENT,this))};a.prototype.onMeasuresChange=function(b){this._isEmpty=!1;this.dispatch(new events._Event(a.CHANGE_EVENT,this))};a.prototype.onQuantityChange=function(){this._isEmpty=!1;""==this.getFilterType()&&this.setFilterType(d.data_.consts.FilterType.TOP);this.dispatch(new events._Event(a.CHANGE_EVENT,
this))};a.prototype.setMeasures=function(a){this.measuresDropDown.setDataProvider(a);this.measuresDropDown.setSelectedIndex(0)};a.prototype.getSelectedMeasure=function(){return this.measuresDropDown.getSelectedItem()};a.prototype.setSelectedMeasure=function(a){this._isEmpty=!1;this.measuresDropDown.setSelectedItem(a,"uniqueName")};a.prototype.reset=function(){this._isEmpty=!0;var a=d.model._options.OptionsManager.flatView;this.btnTop.setSelection(a?0:1);this.btnBottom.setSelection(0);this.measuresDropDown.setSelectedIndex(0);
this.measuresDropDown.isVisible(!a);this.quantityInput.setText("10")};a.prototype.setLabels=function(){this.btnTop.setLabel(d.model._labels.Labels.FILTER_TOP);this.btnBottom.setLabel(d.model._labels.Labels.FILTER_BOTTOM);this.measuresDropDown.setPrompt("")};a.prototype.getFilterType=function(){return 1===this.btnTop.getSelection()?d.data_.consts.FilterType.TOP:1===this.btnBottom.getSelection()?d.data_.consts.FilterType.BOTTOM:""};a.prototype.setFilterType=function(a){a==d.data_.consts.FilterType.TOP?
(this._isEmpty=!1,this.btnTop.setSelection(1),this.btnBottom.setSelection(0)):a==d.data_.consts.FilterType.BOTTOM&&(this._isEmpty=!1,this.btnTop.setSelection(0),this.btnBottom.setSelection(1))};a.prototype.getFilterQuantity=function(){return parseInt(this.quantityInput.getText())};a.prototype.setFilterQuantity=function(a){this._isEmpty=!1;this.quantityInput.setText(a.toString())};Object.defineProperty(a.prototype,"isEmpty",{get:function(){return this._isEmpty},enumerable:!0,configurable:!0});a.CHANGE_EVENT=
"_";return a}(uicontrols.UIComponentBase);e.TopBottomView=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function b(){this.sortTypeChanged=!1;if(null!=b.instance)throw"FilterModel is singleton!";this.pivotInstance=d.Pivot.instance;this.modelLocator=d.model.PivotModel.getInstance();this.zeroCoord=e.PivotView.stage.position()}b.getInstance=function(){null==b.instance&&(b.instance=new b);return b.instance};b.dispose=function(){b.instance=null};b.prototype.getHierarchies=function(){return this.hierarchies};b.prototype.setHierarchies=function(a){this.hierarchies=
a};b.prototype.update=function(a){this.currentCoord={top:this.zeroCoord.top,left:this.zeroCoord.left};var b=this.modelLocator.cube_.slice_.allHierarchies(!1,!0,this.isFlatTable).toArray();this.setHierarchies(b);this.setCurrentHierarchy(a);this.measures=this.modelLocator.cube_.slice_.measures_.toArray()};b.prototype.clearValuesFilter=function(){this.filterType=d.data_.consts.FilterType.NONE;this.filterQuantity=-1;this.filterMeasureName=""};b.prototype.setCurrentHierarchy=function(a){if(this.currentHierarchy=
a)this.sortType=this.currentHierarchy.sortName,this.sortTypeChanged=!1,this.filterMeasureName=this.currentHierarchy.filterMeasureName,this.filterQuantity=this.currentHierarchy.filterQuantity,this.filterType=this.currentHierarchy.filterType,this.members=this.sortType!==d.data_.consts.SortType.UNSORTED?this.currentHierarchy.sortChildren(this.currentHierarchy.allMember,!1,this.sortType).toArray():this.currentHierarchy.allMember.children.toArray()};b.prototype.getTopBottomMeasures=function(){return this.isFlatTable?
[this.modelLocator.cube_.structure_.hierarchyToMeasure(this.currentHierarchy.uniqueName)]:this.measures};b.prototype.getSortType=function(){return this.sortType};b.prototype.setSortType=function(a){this.sortType=a;this.sortTypeChanged=!0};b.prototype.applyChanges=function(){this.currentHierarchy.hasValuesFilter()&&this.isValuesFilterEmpty&&this.modelLocator.clearFilter(this.currentHierarchy.uniqueName);this.applyMembersFilter();this.applyValuesFilter();this.applySort()};Object.defineProperty(b.prototype,
"isValuesFilterEmpty",{get:function(){return!this.filterMeasureName||0===this.filterMeasureName.length||isNaN(this.filterQuantity)||1>this.filterQuantity||!this.filterType||0===this.filterType.length||this.filterType===d.data_.consts.FilterType.NONE},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"isValuesFilterChanged",{get:function(){return this.currentHierarchy.filterMeasureName!==this.filterMeasureName||this.currentHierarchy.filterQuantity!==this.filterQuantity||this.currentHierarchy.filterType!==
this.filterType?!0:!1},enumerable:!0,configurable:!0});b.prototype.applyValuesFilter=function(){!this.isValuesFilterEmpty&&this.isValuesFilterChanged&&("top"===this.filterType?this.modelLocator.setTopX(this.currentHierarchy.uniqueName,this.filterQuantity,this.filterMeasureName):"bottom"===this.filterType&&this.modelLocator.setBottomX(this.currentHierarchy.uniqueName,this.filterQuantity,this.filterMeasureName))};b.prototype.isMembersFilterChanged=function(){if(this.filteredMembers.length!==this.currentHierarchy.filterMembers.length&&
!this.filterNegation)return!0;for(var a=0,b=this.filteredMembers.length;a<b;a++)if(this.filterNegation===this.currentHierarchy.filterMembers.keyExists(this.filteredMembers[a].uniqueName))return!0;return this.filterNegation&&this.currentHierarchy&&this.currentHierarchy.filterMembers.length+this.filteredMembers.length!==this.currentHierarchy.members.length-1?!0:!1};b.prototype.applyMembersFilter=function(){this.isMembersFilterChanged()&&this.modelLocator.setFilter(this.currentHierarchy.uniqueName,this.filteredMembers,
this.filterNegation)};b.prototype.isSortTypeChanged=function(){return this.sortTypeChanged};b.prototype.applySort=function(){this.isSortTypeChanged()&&this.modelLocator.setSort(this.currentHierarchy.uniqueName,this.sortType)};Object.defineProperty(b.prototype,"isPages",{get:function(){return!this.isFlatTable&&this.modelLocator.cube_.slice_.pages.keyExists(this.currentHierarchy.uniqueName)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"isFlatTable",{get:function(){return d.model._options.OptionsManager.flatView},
enumerable:!0,configurable:!0});return b}();h.FilterModel=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(b){function a(){var a=b.call(this)||this;a.model=h.FilterModel.getInstance();a.view=new h.FilterViewContent(a);null!=a.view.hierarchiesList&&a.view.hierarchiesList.addEventListener(events._Event.CHANGE,function(b){return a.onHierarchiesListChange(b)});null!=a.view.searchInput&&a.view.searchInput.addEventListener(uicontrols.UITextInput.CHANGE_EVENT,function(b){return a.onSearchInputChange(b.data)});null!=a.view.membersFilterList&&(a.view.membersFilterList.addEventListener(h.FilterList.SELECT_EVENT,
function(){return a.onMembersFilterSelect()}),a.view.membersFilterList.addEventListener(h.FilterList.EXPAND_EVENT,function(){return a.onMembersFilterExpand()}));null!=a.view.selectAllCbx&&a.view.selectAllCbx.addEventListener(events._Event.CHANGE,function(){return a.onSelectAllChange()});null!=a.view.azBtn&&a.view.azBtn.addEventListener(events._Event.CHANGE,function(){return a.onAzBtnChange()});null!=a.view.zaBtn&&a.view.zaBtn.addEventListener(events._Event.CHANGE,function(){return a.onZaBtnChange()});
null!=a.view.top10Btn&&a.view.top10Btn.addEventListener(events._Event.CHANGE,function(){return a.onTop10Change()});null!=a.view.clearTopBtn&&a.view.clearTopBtn.container.addEventListener("click",function(b){return a.onClearTop(b)});null!=a.view.topBottomView&&a.view.topBottomView.addEventListener(h.TopBottomView.CHANGE_EVENT,function(){return a.onTopBottomChange()});null!=a.view.okBtn&&a.view.okBtn.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(b){return a.onOkClick(b)});null!=a.view.cancelBtn&&
a.view.cancelBtn.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(b){return a.onCancelClick(b)});return a}__extends(a,b);a.prototype.onDataUpdated=function(){this.update(this.model.currentHierarchy)};a.prototype.onClearTop=function(a){a.stopImmediatePropagation();this.model.clearValuesFilter();this.view.topBottomView&&(this.view.topBottomView.reset(),this.view.topBottomView.hide());this.view.top10Btn&&(this.view.top10Btn.container.removeClass("wdr-not-empty"),this.view.top10Btn.setSelection(0))};
a.prototype.onTopBottomChange=function(){if(this.view.topBottomView){this.model.filterType=this.view.topBottomView.getFilterType();this.model.filterQuantity=this.view.topBottomView.getFilterQuantity();var a=this.view.topBottomView.getSelectedMeasure();this.model.filterMeasureName=a?a.uniqueName:""}this.view.top10Btn&&this.view.top10Btn.container.addClass("wdr-not-empty")};a.prototype.onTop10Change=function(){this.view.topBottomView&&this.view.topBottomView.isVisible(1===this.view.top10Btn.getSelection())};
a.prototype.onOkClick=function(a){this.dispatchWith("close");a=this.view.membersFilterList.getFilterItems();this.model.filteredMembers=a.items;this.model.filterNegation=a.negation;this.model.applyChanges()};a.prototype.onCancelClick=function(a){this.dispatchWith("close")};a.prototype.onAzBtnChange=function(){1===this.view.azBtn.getSelection()&&(this.view.zaBtn.setSelection(0),this.model.setSortType(d.data_.consts.SortType.ASC),this.view.membersFilterList&&this.view.membersFilterList.sort(this.model.getSortType()));
0===this.view.azBtn.getSelection()&&0===this.view.zaBtn.getSelection()&&(this.model.setSortType(d.data_.consts.SortType.UNSORTED),this.view.membersFilterList&&this.view.membersFilterList.sort(this.model.getSortType()))};a.prototype.onZaBtnChange=function(){1===this.view.zaBtn.getSelection()&&(this.view.azBtn.setSelection(0),this.model.setSortType(d.data_.consts.SortType.DESC),this.view.membersFilterList&&this.view.membersFilterList.sort(this.model.getSortType()));0===this.view.azBtn.getSelection()&&
0===this.view.zaBtn.getSelection()&&(this.model.setSortType(d.data_.consts.SortType.UNSORTED),this.view.membersFilterList&&this.view.membersFilterList.sort(this.model.getSortType()))};a.prototype.onSelectAllChange=function(){this.view.membersFilterList&&(this.view.membersFilterList.selectAll(1==this.view.selectAllCbx.getSelection()),this.view.membersFilterList.getTotalSelectedLength(),this.view.okBtn.setEnabled(0<this.view.membersFilterList.getTotalSelectedLength()));this.updateSelectedLabel()};a.prototype.onMembersFilterSelect=
function(){this.view.okBtn.setEnabled(0<this.view.membersFilterList.getTotalSelectedLength());this.updateAllSelectedCbx();this.updateSelectedLabel()};a.prototype.onMembersFilterExpand=function(){this.updateLayout();this.updateSelectedLabel()};a.prototype.updateAllSelectedCbx=function(){0==this.view.membersFilterList.getSelectedLength()?this.view.selectAllCbx.setSelection(0):this.view.membersFilterList.getTotalItemsCount()>this.view.membersFilterList.getSelectedLength()?this.view.selectAllCbx.setSelection(-1):
this.view.membersFilterList.getTotalItemsCount()==this.view.membersFilterList.getSelectedLength()&&this.view.selectAllCbx.setSelection(1)};a.prototype.update=function(a){var b=this;!1!=this.view.isVisible()&&(1E4<a.members.length?(d.preloader(!0,"Please, wait","Sorting members...",!0,!0),setTimeout(function(){b.model.update(a);b.updateView();d.preloader(!1)},50)):(this.model.update(a),this.updateView()))};a.prototype.onSearchInputChange=function(a){var b=this;a.trim()==a&&this.view.membersFilterList&&
this.view.membersFilterList.search(a,function(){return b.onSearchComplete()})};a.prototype.onSearchComplete=function(){this.updateLayout();this.updateSelectedLabel();this.updateAllSelectedCbx()};a.prototype.updateView=function(){this.view.setLabels();this.view.container.toggleClass("wdr-filter-pages-layout",this.model.isPages);this.view.membersView&&this.view.membersView.reset();this.view.searchInput&&(this.view.searchInput.clear(),this.view.searchInput.setChangeDelay(0));this.view.top10Btn&&(d.data_.types.MeasureType.STRING==
d.data_.types.MeasureType.fromDataType(this.model.currentHierarchy.dimension.type+"")&&d.model._options.OptionsManager.flatView?this.view.top10Btn.hide():this.view.top10Btn.show());this.updateSortType();this.updateHierarchy();this.updateMembers();this.updateTopBottom();this.updateLayout();this.updateSelectedLabel();var a=!this.model.isPages;this.view.azBtn&&(a?this.view.azBtn.show():this.view.azBtn.hide());this.view.zaBtn&&(a?this.view.zaBtn.show():this.view.zaBtn.hide());this.view.top10Btn&&(this.isAvailableTopX?
this.view.top10Btn.show():this.view.top10Btn.hide());this.view.sortContainer&&(a?this.view.sortContainer.show():this.view.sortContainer.hide())};Object.defineProperty(a.prototype,"isAvailableTopX",{get:function(){if(this.model.isFlatTable){var a=this.model.modelLocator.cube_.structure_.hierarchyToMeasure(this.model.currentHierarchy.uniqueName);return a&&a.type==d.data_.types.MeasureType.NUMBER}return!this.model.isPages},enumerable:!0,configurable:!0});a.prototype.updateMembers=function(){var a=this.model.currentHierarchy;
this.view.selectAllCbx&&this.view.selectAllCbx.setSelection(0<a.filterMembers.length?-1:1);var b;b=2<a.levels_.length?new h.MembersTreeDataProvider:new h.MembersFilterDataProvider;this.view.membersFilterList&&(this.view.membersFilterList.setSmartDataProvider(b),this.view.membersFilterList.setHierarchy(a),this.view.membersFilterList.setDataProvider(this.model.members),this.view.membersFilterList.setFilterItems(a.filterMembers.toArray()),this.view.membersFilterList.sort(this.model.getSortType()))};
a.prototype.updateHierarchy=function(){this.view.titleLabel&&this.view.titleLabel.setLabel(this.model.currentHierarchy.caption);this.view.toolbar&&this.view.toolbar.setHeader(this.model.currentHierarchy.caption)};a.prototype.updateLayout=function(){if(this.view.membersFilterList&&0<this.view.membersFilterList.getTotalLength())if(this.view.selectAllCbx&&this.view.selectAllCbx.show(),0==this.view.explicitListHeight||isNaN(this.view.explicitListHeight)){var a=utils.browserVersion().isMobile?utils.viewportHeight()-
50:e.PivotView.stage.getY()+e.PivotView.stageHeight-window.document.documentElement.scrollTop,a=Math.min(a,parseFloat(window.document.documentElement.style.height))-this.view.membersFilterList.container.offset().top+window.document.documentElement.scrollTop-e.PivotView.stage.toolbarHeight,a=Math.max(a,84);this.setOptimalListHeight(a,!0)}else this.setOptimalListHeight(this.view.explicitListHeight,!1);else this.view.selectAllCbx&&this.view.selectAllCbx.hide()};a.prototype.updateSortType=function(){this.view.azBtn&&
this.view.azBtn.setSelection("asc"===this.model.getSortType()?1:0);this.view.zaBtn&&this.view.zaBtn.setSelection("desc"===this.model.getSortType()?1:0)};a.prototype.updateTopBottom=function(){this.view.topBottomView&&(this.view.topBottomView.reset(),this.view.topBottomView.setMeasures(this.model.getTopBottomMeasures()));"top"===this.model.filterType||"bottom"===this.model.filterType?(this.view.topBottomView&&(this.view.topBottomView.setFilterType(this.model.filterType),this.view.topBottomView.setFilterQuantity(this.model.filterQuantity),
this.view.topBottomView.setSelectedMeasure(utils.ArrayUtils.find(this.model.measures,this.model.filterMeasureName,"uniqueName")),this.view.topBottomView.show()),this.view.top10Btn&&this.view.top10Btn.setSelection(1)):(this.view.topBottomView&&this.view.topBottomView.hide(),this.view.top10Btn&&this.view.top10Btn.setSelection(0));var a=this.view.topBottomView?this.view.topBottomView.isEmpty:!0;this.view.top10Btn&&this.view.top10Btn.container.toggleClass("wdr-not-empty",!a)};a.prototype.setOptimalListHeight=
function(a,b){var d=Math.max(Math.min(a,this.view.membersFilterList.getMaxHeight()),this.view.membersFilterList.getMinHeight());if(b)var e=d%this.view.membersFilterList.getRowHeight(),d=d-e;this.view.membersFilterList.setHeight(d);this.view.table&&this.view.contentPanel.setHeight(this.view.table.getHeight())};a.prototype.updateSelectedLabel=function(){var a="";this.view.membersFilterList&&(a=this.view.membersFilterList.isSearched()?utils.StringUtils.bind(d.model._labels.Labels.FILTER_AMOUNT_FOUND,
this.view.membersFilterList.getSelectedLength(),this.view.membersFilterList.getTotalItemsCount()):utils.StringUtils.bind(d.model._labels.Labels.FILTER_AMOUNT_SELECTED,this.view.membersFilterList.getSelectedLength(),this.view.membersFilterList.getTotalItemsCount()));this.view.selectedAmountLabel&&this.view.selectedAmountLabel.setLabel(a);this.view.selectAllCbx&&this.view.selectAllCbx.setLabel(this.view.membersFilterList&&this.view.membersFilterList.isSearched()?d.model._labels.Labels.FILTER_SELECT_ALL_RESULTS:
d.model._labels.Labels.FILTER_SELECT_ALL)};a.prototype.onHierarchiesListChange=function(a){var b=a.data.selectedItem;-1<a.data.selectedIndex&&(this.model.setCurrentHierarchy(b),this.updateView())};return a}(events.EventDispatcher);h.FilterController=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(h){var f=function(b){function a(){var a=b.call(this,d.PivotView.stage.container)||this;a.setId("wdr-filter-view");a.addClass("wdr-noselect");a.controller=new h.FilterController;a.controller.addEventListener("close",function(){return a.close()});a.addChild(a.controller.view);a.controller.view.show();return a}__extends(a,b);a.prototype.openView=function(a){this.open();this.controller.update(a);this.centerPosition();this.dispatchWith(events._Event.OPENED)};a.prototype.close=
function(){b.prototype.close.call(this);this.dispatchWith(events._Event.CLOSED)};return a}(uicontrols.containers.UIPopup);h.FilterView=f})(d.filter||(d.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={}));var xls;
(function(d){var e=function(){function e(){this.styleSheet=new d.styles.XLSStyleSheet;this.sheets=[];d.styles.format.XLSStyleFormat.lastNumFmtId=d.styles.format.XLSStyleFormat.defaultNumFmtId}e.prototype.toUint8Array=function(){utils.getTimer();var e=new JSZip;e.file("[Content_Types].xml",d.XLSTemplates.XML_HEADER+this.composeContentTypeXMLString());e.file("_rels/.rels",d.XLSTemplates.XML_HEADER+d.XLSTemplates._RELS);e.file("xl/_rels/workbook.xml.rels",d.XLSTemplates.XML_HEADER+this.composeWorkbookRelsXMLString());
e.file("xl/workbook.xml",d.XLSTemplates.XML_HEADER+this.composeWorkbookXMLString());e.file("xl/theme/theme1.xml",d.XLSTemplates.XML_HEADER+d.XLSTemplates.THEME);for(var b=0;b<this.sheets.length;b++){var a=this.sheets[b].toXMLString();e.file("xl/worksheets/sheet"+(b+1)+".xml",d.XLSTemplates.XML_HEADER+a)}e.file("xl/sharedStrings.xml",d.XLSTemplates.XML_HEADER+this.composeSharedStrings());e.file("xl/styles.xml",d.XLSTemplates.XML_HEADER+this.styleSheet.toXMLString());e.file("docProps/app.xml",d.XLSTemplates.XML_HEADER+
d.XLSTemplates.APP_XML);e.file("docProps/core.xml",d.XLSTemplates.XML_HEADER+d.XLSTemplates.CORE_XML);return e.generate({compression:"STORE",type:"uint8array"})};e.prototype.composeSharedStrings=function(){var e="";misc.XML.create("<axis/>").attr("name","rows");for(var b=0;b<d.XLSSharedStrings.strings.length;b++)var a=utils.StringUtils.escapeHtml(d.XLSSharedStrings.strings[b]),e=e+("<si><t>"+a+"</t></si>");return utils.StringUtils.bind(d.XLSTemplates.SHARED_STRING_XML,e)};e.prototype.composeWorkbookXMLString=
function(){for(var e="",b=0;b<this.sheets.length;b++)e+=utils.StringUtils.bind('<sheet name="{0}" sheetId="{1}" r:id="{2}"/>',this.sheets[b].name,b+1,"rId"+(b+4));return utils.StringUtils.bind(d.XLSTemplates.WORKBOOK_XML,e)};e.prototype.composeWorkbookRelsXMLString=function(){for(var e="",b=0;b<this.sheets.length;b++)e+=utils.StringUtils.bind(d.XLSTemplates.WORKBOOK_XML_RELS_SHEET,"rId"+(b+4),"worksheets/sheet"+(b+1)+".xml");return utils.StringUtils.bind(d.XLSTemplates.WORKBOOK_XML_RELS,e)};e.prototype.composeContentTypeXMLString=
function(){for(var e="",b=0;b<this.sheets.length;b++)e+=utils.StringUtils.bind(d.XLSTemplates.CONTENT_TYPES_XML_SHEET,"/xl/worksheets/sheet"+(b+1)+".xml");return utils.StringUtils.bind(d.XLSTemplates.CONTENT_TYPES_XML,e)};return e}();d.XLS=e})(xls||(xls={}));
(function(d){var e=function(){function e(d,b,a,c){void 0===d&&(d=0);void 0===b&&(b=0);void 0===a&&(a="");void 0===c&&(c=0);this.row=d;this.column=b;this.value=a;this.styleIndex=c}Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){"number"===typeof e&&isNaN(e)&&(e="");if("string"===typeof e){e=e.replace(RegExp("<br/?>","gmi"),"\n");e=e.replace("/&/gmi",
"");e=e.replace(RegExp("<[^<]+?>","gmi"),"");var b=d.XLSSharedStrings.strings.indexOf(e);-1==b?(this._value=d.XLSSharedStrings.strings.length,d.XLSSharedStrings.strings.push(e)):this._value=b;this._type=d.XLSType.STRING}else this._value=e,this._type="number"===typeof e?d.XLSType.NUMBER:null===e?d.XLSType.NULL:!1===e?d.XLSType.MERGED:d.XLSType.UNKNOWN},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"id",{get:function(){for(var d="",b=this.column+1,a=0;26<b;){var c=0<b%26?b%26:26,
b=b/26;26==c&&b--;d=String.fromCharCode(c+64)+d;if(3==a++)break}d=String.fromCharCode(b+64)+d;return d+(this.row+1)},set:function(d){},enumerable:!0,configurable:!0});e.prototype.toString=function(){return"XLSCell {row: "+this.row+", column: "+this.column+", type: "+this.type+", id: "+this.id+", value: "+this.value+"}"};return e}();d.XLSCell=e})(xls||(xls={}));(function(d){var e=function(){function d(){}d.strings=[];return d}();d.XLSSharedStrings=e})(xls||(xls={}));
(function(d){var e=function(){function e(d){this.cells=[];this.maxColumn=this.maxRow=0;this.columns=[];this.rows=[];this.mergedCells=[];this.name=d}Object.defineProperty(e.prototype,"maxCell",{get:function(){return this.getCell(this.maxRow,this.maxColumn)},set:function(d){},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"columnsCount",{get:function(){return this.maxColumn+1},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"rowsCount",{get:function(){return this.maxRow+
1},enumerable:!0,configurable:!0});e.prototype.setColumnWidth=function(d,b){this.columns[d]=b};e.prototype.getColumnWidth=function(d){return this.columns[d]?this.columns[d]:0};e.prototype.setRowHeight=function(d,b){this.rows[d]=b};e.prototype.getRowHeight=function(d){return this.rows[d]?this.rows[d]:0};e.prototype.setCell=function(e,b,a,c){void 0===c&&(c=null);null==this.cells[e]&&(this.cells[e]=[]);this.cells[e][b]=a instanceof d.XLSCell?a:new d.XLSCell(e,b,a,null==c?0:c.index);this.maxRow<e&&(this.maxRow=
e);this.maxColumn<b&&(this.maxColumn=b)};e.prototype.getCell=function(e,b){var a;null!=this.cells[e]&&(a=this.cells[e][b]);null==a&&(a=new d.XLSCell(e,b,null));return a};e.prototype.mergeCells=function(e,b,a){var c=this.getCell(e,b);if(null!=c){for(var g=c.id,h,k=b+1;k<b+a;k++)h=new d.XLSCell(e,k,!1,c.styleIndex),this.cells[e][k]=h;g+=":"+(h?h.id:c.id);this.mergedCells.push(g)}};e.prototype.toXMLString=function(){utils.getTimer();for(var e="",b=0;b<this.cells.length;b++){var a=this.cells[b];if(null!=
a&&0!=a.length){for(var c="",g=0;g<a.length;g++){var h=a[g];null!=h&&h.type!=d.XLSType.NULL&&(c=h.type==d.XLSType.MERGED?c+('<c r="'+h.id+'" s="'+h.styleIndex.toString()+'" />'):c+('<c r="'+h.id+'" s="'+h.styleIndex.toString()+'"'+(h.type==d.XLSType.STRING?' t="s"':"")+"><v>"+h.value+"</v></c>"))}e=isNaN(this.rows[b])?e+utils.StringUtils.bind('<row spans="1:3" r="{0}"  >{1}</row>',b+1,c):e+utils.StringUtils.bind('<row spans="1:3" r="{0}" x14ac:dyDescent="0.25" ht="{1}" customHeight="1">{2}</row>',
b+1,this.rows[b],c)}}b="";for(a=0;a<this.columns.length;a++)isNaN(this.columns[a])||(b+=utils.StringUtils.bind('<col min="{0}" max="{1}" width="{2}" customWidth="1" />',a+1,a+1,this.columns[a]));c="";for(a=0;a<this.mergedCells.length;a++)c+=utils.StringUtils.bind('<mergeCell ref="{0}"/>',this.mergedCells[a]);a=0<this.mergedCells.length?utils.StringUtils.bind('<mergeCells count="{0}">{1}</mergeCells>',this.mergeCells.length,c):"";return utils.StringUtils.bind(d.XLSTemplates.SHEET_XML,this.getCell(0,
0).id+":"+this.maxCell.id,b,e,a)};return e}();d.XLSSheet=e})(xls||(xls={}));(function(d){var e=function(){function d(){}d.NULL=0;d.NUMBER=1;d.STRING=2;d.MERGED=98;d.UNKNOWN=99;return d}();d.XLSType=e})(xls||(xls={}));
(function(d){(function(d){var h=function(){function f(b,a,c,f){void 0===c&&(c=null);void 0===f&&(f=null);this.index=0;a instanceof d.fills.XLSStyleFill?this.fill=a:!isNaN(a)&&-1<a?this.fill=new d.fills.XLSStyleFill(a):this.fill=new d.fills.XLSStyleFill;this.font=b instanceof d.fonts.XLSStyleFont?b:new d.fonts.XLSStyleFont(b);this.format=c&&c instanceof d.format.XLSStyleFormat?c:new d.format.XLSStyleFormat(0,"");null!=f&&(this.textAlign=f)}Object.defineProperty(f.prototype,"id",{get:function(){return this.fill.id+
":"+this.font.id+":"+this.textIndent+":"+this.textAlign+":"+this.format.id},set:function(b){},enumerable:!0,configurable:!0});f.prototype.toXMLString=function(){var b="",b=this.textIndent||this.textAlign?utils.StringUtils.bind('<alignment vertical="center" horizontal="{0}" wrapText="1"{1}/>',utils.nullOrUndefined(this.textAlign)?"left":this.textAlign,utils.nullOrUndefined(this.textIndent)?"":' indent="'+this.textIndent+'"'):'<alignment vertical="center" wrapText="1"/>';return utils.StringUtils.bind('<xf numFmtId="{0}"{1} fontId="{2}" fillId="{3}" borderId="1" xfId="0" applyFont="1" applyFill="1"{4}>{5}</xf>',
this.format.numFmtId,0<this.format.numFmtId?' applyNumberFormat = "1"':"",this.font.fontIndex,this.fill.fillIndex,0<b.length?' applyAlignment="1"':"",b)};return f}();d.XLSStyle=h})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(e){var h=function(){function f(){this.styles=new utils.AssociativeArray;this.fills=new utils.AssociativeArray;this.fonts=new utils.AssociativeArray;this.formats=new utils.AssociativeArray;this.addFill(new e.fills.XLSStyleFill);var b=new e.fills.XLSStyleFill;b.patternFill.patternType="solid";b.fillIndex=1;this.fills.addItem("solid",b)}f.prototype.addStyle=function(b){this.styles.keyExists(b.id)?b.index=this.styles.getItem(b.id).index:(this.addFill(b.fill),this.addFont(b.font),
this.styles.addItem(b.id,b),b.index=this.styles.length)};f.prototype.addFill=function(b){this.fills.keyExists(b.id)?b.fillIndex=this.fills.getItem(b.id).fillIndex:(b.fillIndex=this.fills.length,this.fills.addItem(b.id,b))};f.prototype.addFont=function(b){this.fonts.keyExists(b.id)?b.fontIndex=this.fonts.getItem(b.id).fontIndex:(this.fonts.addItem(b.id,b),b.fontIndex=this.fonts.length)};f.prototype.addFormat=function(b){this.formats.keyExists(b.id)?b.numFmtId=this.formats.getItem(b.id).numFmtId:(-1==
b.numFmtId&&(b.numFmtId=e.format.XLSStyleFormat.getNextAvailableCustomNumFmtId()),this.formats.addItem(b.id,b))};f.prototype.toXMLString=function(){var b="",a="",c="",e="",f;if(0<this.formats.length){var k=0,h="";for(f=0;f<this.formats.length;f++){var s=this.formats.getItemAt(f);""!=s.formatCode&&(s=s.toXMLString(),h+=s,k++)}0<k&&(b='<numFmts count="'+k+'">'+h+"</numFmts>")}for(f=0;f<this.fills.length;f++)k=this.fills.getItemAt(f),a+=k.toXMLString();for(f=0;f<this.fonts.length;f++)k=this.fonts.getItemAt(f),
c+=k.toXMLString();for(f=0;f<this.styles.length;f++)k=this.styles.getItemAt(f),e+=k.toXMLString();return utils.StringUtils.bind(d.XLSTemplates.STYLES_XML,b,this.fonts.length+1,c,this.fills.length,a,this.styles.length+1,e)};return f}();e.XLSStyleSheet=h})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(d){(function(d){var e=function(){function b(a){this.rgb=a}Object.defineProperty(b.prototype,"id",{get:function(){return this.rgb.toString(16)},set:function(a){},enumerable:!0,configurable:!0});b.prototype.toXMLString=function(a){void 0===a&&(a="");0==a.length&&(a="color");a="<"+a;this.auto&&(a+=' auto="'+this.auto+'"');this.theme&&(a+=' theme="'+this.theme+'"');this.tint&&(a+=' tint="'+this.tint+'"');this.indexed&&(a+=' indexed="'+this.indexed+'"');for(var b=this.rgb.toString(16).toUpperCase();6>
b.length;)b="0"+b;return a+(' rgb="FF'+b+'"/>')};return b}();d.XLSStyleColor=e})(d.color||(d.color={}))})(d.styles||(d.styles={}))})(xls||(xls={}));(function(d){(function(d){(function(d){var e=function(b){function a(a){return b.call(this,a)||this}__extends(a,b);a.prototype.toXMLString=function(a){return b.prototype.toXMLString.call(this,"bgColor")};return a}(d.XLSStyleColor);d.XLSStyleBgColor=e})(d.color||(d.color={}))})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(d){(function(d){var e=function(b){function a(a){return b.call(this,a)||this}__extends(a,b);a.prototype.toXMLString=function(a){return b.prototype.toXMLString.call(this,"fgColor")};return a}(d.XLSStyleColor);d.XLSStyleFgColor=e})(d.color||(d.color={}))})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(d){(function(d){var e=function(){function b(a){void 0===a&&(a=-1);this.fillIndex=0;this.patternFill=new d.XLSStylePatternFill(a)}b.prototype.toXMLString=function(){return"<fill>"+this.patternFill.toXMLString()+"</fill>"};Object.defineProperty(b.prototype,"id",{get:function(){return this.patternFill.id},set:function(a){},enumerable:!0,configurable:!0});return b}();d.XLSStyleFill=e})(d.fills||(d.fills={}))})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(d){(function(h){var f=function(){function b(a){void 0===a&&(a=-1);this.patternType="solid";-1<a?(this.fgColor=new d.color.XLSStyleFgColor(a),this.bgColor=new d.color.XLSStyleBgColor(a)):this.patternType="none"}Object.defineProperty(b.prototype,"id",{get:function(){return utils.nullOrUndefined(this.fgColor)?"none":this.fgColor.id},enumerable:!0,configurable:!0});b.prototype.toXMLString=function(){return utils.StringUtils.bind('<patternFill patternType="{0}">{1}{2}</patternFill>',
this.patternType,utils.nullOrUndefined(this.fgColor)?"":this.fgColor.toXMLString(),utils.nullOrUndefined(this.bgColor)?"":this.bgColor.toXMLString())};return b}();h.XLSStylePatternFill=f})(d.fills||(d.fills={}))})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(d){(function(h){var f=function(){function b(a,b,f){this.fontIndex=0;utils.nullOrUndefined(a)||(this.name=a);utils.nullOrUndefined(b)||(this.size=b);utils.nullOrUndefined(f)||(this.hexColor=new d.color.XLSStyleColor(f))}Object.defineProperty(b.prototype,"id",{get:function(){return this.name+","+this.size+","+(utils.nullOrUndefined(this.hexColor)?"":this.hexColor.id)+","+this.bold+","+this.italic},set:function(a){},enumerable:!0,configurable:!0});b.prototype.toXMLString=function(){var a=
"<font>";this.bold&&(a+="<b/>");this.size&&(a+='<sz val="'+this.size+'"/>');this.hexColor&&(a+=this.hexColor.toXMLString());if(this.name){var b=this.name;this.name.indexOf(",")&&(b=this.name.split(",")[0].trim());a+='<name val="'+b+'"/>'}return a+"</font>"};return b}();h.XLSStyleFont=f})(d.fonts||(d.fonts={}))})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(d){(function(d){var e=function(){function b(a,b){this.formatCode="";this.numFmtId=a;this.formatCode=b}b.prototype.toXMLString=function(){return'<numFmt numFmtId="'+this.numFmtId+'" formatCode="'+this.formatCode+'"/>'};Object.defineProperty(b.prototype,"id",{get:function(){return""!=this.formatCode?this.formatCode:this.numFmtId.toString()},set:function(a){},enumerable:!0,configurable:!0});b.getNextAvailableCustomNumFmtId=function(){return b.lastNumFmtId++};b.defaultNumFmtId=
1;b.lastNumFmtId=b.defaultNumFmtId;return b}();d.XLSStyleFormat=e})(d.format||(d.format={}))})(d.styles||(d.styles={}))})(xls||(xls={}));
(function(d){(function(e){var h=function(){function f(b){this.tuples=[];this.facts=[];this.allIndices=[];this.filtered=[];this.rowResult=[];this.columnResult=[];this.keys=[];this.levels=[];this.drilled=[];this.factKeys=[];this.calculatedKeys=[];this.individualKeys=[];this.ids=[];this.pageFields=[];this.columnFields=[];this.rowFields=[];this.sizes=[];this.filters=[];this.subfilters=[];this.factIndices=[];this.values=[];this.updates=[];this.updatesCache=[];this.datePattern="dd/MM/yyyy";this.dateTimePattern=
"dd/MM/yyyy HH:mm:ss";this._grandTotals=[];this.productIdx=0;this.cube_=b}f.prototype.clearData=function(){this.clearValues();this.rowResult=[];this.columnResult=[];this.allMeasures=this.allHierarchies=null};f.prototype.clearValues=function(){this.ids=[];this.tuples=[];this.facts=[];this.drilled=[];this.levels=[];this.values=[];this.updates=[];this.updatesCache=[];this.allIndices=[];this.filtered=[];this.filters=[]};f.prototype.clearAll=function(){this.clearData();this.sizes=[];this.keys=[];this.factKeys=
[];this.allIndices=[]};f.prototype.clearUpdates=function(){this.updates=[];this.updatesCache=[];this.values=[]};Object.defineProperty(f.prototype,"slice_",{get:function(){return null!=this._slice?this._slice:this.cube_.slice_},set:function(b){this._slice=b},enumerable:!0,configurable:!0});f.clone=function(b){var a=new f(b.cube_);a.allIndices=b.allIndices.slice(0);a.ids=b.ids.slice(0);a.tuples=b.tuples.slice(0);a.facts=b.facts.slice(0);a.levels=b.levels.slice(0);a.keys=b.keys.slice(0);a.factKeys=b.factKeys.slice(0);
return a};f.prototype.addKey=function(b,a){void 0===a&&(a="");if(-1!=this.keys.indexOf(b))return this.keys.indexOf(b);if(""==a)this.levels[this.keys.length]=[-1,this.keys.length];else{var c=this.keys.indexOf(a);this.levels[c]&&this.levels[c].push(this.keys.length)}this.keys.push(b);return this.keys.length-1};f.prototype._addKey=function(b,a){void 0===a&&(a=-1);if(-1!=this.keys.indexOf(b))return this.keys.indexOf(b);-1==a?this.levels[this.keys.length]=[-1,this.keys.length]:this.levels[a].push(this.keys.length);
this.keys.push(b);return this.keys.length-1};f.prototype.addFactKey=function(b,a,c){void 0===a&&(a=null);void 0===c&&(c=!1);this.calculatedKeys[this.factKeys.length]=a;this.individualKeys[this.factKeys.length]=c;this.factKeys.push(b)};f.prototype.updateFactKey=function(b,a,c){void 0===a&&(a=null);void 0===c&&(c=!1);b=this.factKeys.indexOf(b);0<=b&&(this.calculatedKeys[b]=a,this.individualKeys[b]=c)};f.prototype.removeFactKey=function(b){b=this.factKeys.indexOf(b);this.factKeys.splice(b,1)};f.prototype.delete_=
function(b){var a=this.ids.indexOf(b);if(!utils.nullOrUndefined(b)&&-1<a)for(b=0;b<this.factKeys.length;b++)this.facts[a][b]=NaN,null==this.updates[b]&&(this.updates[b]=[]),this.updates[b][a]={difference:-this.facts[a][b],percent:-1}};f.prototype.update=function(b,a,c){var d=this.ids.indexOf(c);if(!utils.nullOrUndefined(c)&&-1<d){for(c=0;c<this.factKeys.length;c++)if(this.facts[d][c]!=a[c]){var e=a[c]-this.facts[d][c];isNaN(e)||(null==this.updates[c]&&(this.updates[c]=[]),this.updates[c][d]={difference:e,
percent:e/this.facts[d][c]})}this.facts[d]=a;this.tuples[d]=b}else{d=this.tuples.length;utils.nullOrUndefined(c)||(this.ids[d]=c);for(c=0;c<this.factKeys.length;c++)e=a[c],isNaN(e)||(null==this.updates[c]&&(this.updates[c]=[]),this.updates[c][d]={difference:e,percent:1});this.allIndices.push(d);this.tuples.push(b);this.facts.push(a)}};f.prototype.insert=function(b,a,c){-1<b.indexOf(0)||(this.allIndices.push(this.tuples.length),utils.nullOrUndefined(c)||(this.ids[this.tuples.length]=c),this.tuples.push(b),
this.facts.push(a))};f.prototype.insertChunk=function(b,a,c,d,f){for(var k=[],h=[],s=0;s<b.length;s++){if(-1==b[s][1])return;h[s]=b[s][1];k[this.levels[this.rowFields[s]][b[s][0]]]=h[s]}b=[];for(s=0;s<a.length;s++){if(-1==a[s][1])return;b[s]=a[s][1];k[this.levels[this.columnFields[s]][a[s][0]]]=b[s]}a=this.calculateIndex(h,b);h=this.tuples.length;void 0!==this.values[a]?(h=this.findTuple(k),this.facts[h]=c):(this.allIndices.push(h),this.tuples.push(k),this.facts.push(c));0<d.length&&(k=f==e.consts.AxisName.ROWS_AXIS?
this.getNode(d,this.rowResult):this.getNode(d,this.columnResult),-1==k[0][0].indexOf(h)&&k[0][0].push(h),this.cube_.queryType==e.consts.QueryType.DRILL_DOWN_TO&&(d=d.slice(0,-1),f=f==e.consts.AxisName.ROWS_AXIS?this.getNode(d,this.rowResult):this.getNode(d,this.columnResult),-1==f[0][0].indexOf(h)&&f[0][0].push(h)));this.values[a]=c};f.prototype.findTuple=function(b){for(var a,c=0;c<this.tuples.length;c++)if(b.length==this.tuples[c].length){a=!0;for(var d=0;d<b.length;d++)if(b[d]!=this.tuples[c][d]){a=
!1;break}if(a)return c}return this.tuples.length};f.prototype.keyToMembers=function(b){b=b.split("_");for(var a=b[0].split("-"),c=a[0].split(","),d=a[1].split(","),e=this.slice_.rowsOnly,f=this.slice_.columnsOnly,a="",h,s=[],r=0;r<e.length;r++)h=e.getItemAt(r),h=h.members.getItemAt(parseInt(c[r])),s.push(h.caption);a=s.join(",");s=[];for(r=0;r<f.length;r++)h=f.getItemAt(r),h=h.members.getItemAt(parseInt(d[r])),s.push(h.caption);a+=" - "+s.join(",");b=this.slice_.measures_.getItemAt(parseInt(b[1]));
return a+=" + "+b.caption};f.prototype.timeCaption=function(b){return b&&0<b.length&&"NaN"!=b?b:d.model._labels.Labels.INVALID_DATE};f.prototype.addStringMember=function(b,a,c,d){b=this.cube_.structure_.getDataField(b);var f=b.uniqueName+"."+a,k=b.findMember(f);null==k&&(k=new e._structure.GenericMember(f,a),b.addMember(k));c.push(k.ordinal);null==a||""==a?d.push(NaN):d.push(1)};f.prototype.addNumberMember=function(b,a,c,d){b=this.cube_.structure_.getDataField(b);var f=b.uniqueName+"."+a,k=b.findMember(f),
h=utils.StringUtils.toNumber(a);null==k&&(k=new e._structure.GenericMember(f,a),b.addMember(k));k.levelOrdinal=h;c.push(k.ordinal);d.push(h)};f.prototype.validateDate=function(b){return null==b||"string"!==typeof b?"":b=b.trim()};f.prototype.addDateTimeMember=function(b,a,c,d){b=this.cube_.structure_.getDataField(b);var f;a instanceof Date?f=a.getTime():"number"==typeof a?f=a:(f=Date.parse(this.validateDate(a)),isNaN(f)&&(f=parseInt(a)));a=utils.StringUtils.toDateTime(f,this.dateTimePattern);var k=
b.uniqueName+"."+a,h=b.findMember(k);null==h&&(h=new e._structure.GenericMember(k,a),h.levelOrdinal=f,b.addMember(h));c.push(h.ordinal);d.push(f)};f.prototype.addTimeMember=function(b,a,c,d){b=this.cube_.structure_.getDataField(b);var f=parseFloat(a),k=isNaN(a)||""==a?"":utils.StringUtils.toTime(f),h=b.uniqueName+"."+k,s=b.findMember(h);null==s&&(s=new e._structure.GenericMember(h,k),s.levelOrdinal=a,b.addMember(s));c.push(s.ordinal);d.push(f)};f.prototype.addDateStringMember=function(b,a,c,d){b=
this.cube_.structure_.getDataField(b);a=a instanceof Date?a.getTime():"number"==typeof a?a:Date.parse(this.validateDate(a));var f=utils.StringUtils.toDate(a,this.datePattern),k=b.uniqueName+"."+f,h=b.findMember(k);null==h&&(h=new e._structure.GenericMember(k,f),h.levelOrdinal=a,b.addMember(h));c.push(h.ordinal);d.push(a)};f.prototype.addHierarchcalDateMember=function(b,a,c,f,h){b=this.cube_.structure_.getDataField(b);var k,l;k=a instanceof Date?a:"number"==typeof a?new Date(a):new Date(this.validateDate(a));
var s="",r="",n=a="",p="",q=0,t=1;null!=k&&(p=Math.floor(k.getUTCMonth()/3),r=d.model._labels.Labels.QUARTER_LABELS[p],n=d.model._labels.Labels.MONTHS_LABELS[k.getUTCMonth()],p=k.getUTCDate().toString(),s=k.getUTCFullYear().toString(),q=k.getTime());k=b.levels_.getItemAt(t++);b=k.hierarchy;var u=b.uniqueName+"."+s;l=b.findMember(u);null==l&&(l=new e._structure.GenericMember(u,this.timeCaption(s)),b.addMember(l,k.uniqueName));c.push(l.ordinal);var v;h&&(k=b.levels_.getItemAt(t++),v=k.uniqueName+"."+
s+"/"+r,l=b.findMember(v),null==l&&(l=new e._structure.GenericMember(v,this.timeCaption(r)),b.addMember(l,k.uniqueName,u)),c.push(l.ordinal),a="/"+r);k=b.levels_.getItemAt(t++);r=k.uniqueName+"."+s+a+"/"+n;l=b.findMember(r);null==l&&(l=new e._structure.GenericMember(r,this.timeCaption(n)),b.addMember(l,k.uniqueName,h?v:u));c.push(l.ordinal);k=b.levels_.getItemAt(t++);h=k.uniqueName+"."+s+a+"/"+n+"/"+p;l=b.findMember(h);null==l&&(l=new e._structure.GenericMember(h,this.timeCaption(p)),l.levelOrdinal=
q,b.addMember(l,k.uniqueName,r));c.push(l.ordinal);f.push(1)};f.prototype.addDateMember=function(b,a,c,f){var h=this.cube_.structure_.getDataField(b),k,l="",s="";b="";var r=0;try{k=a instanceof Date?a:"number"==typeof a?new Date(a):new Date(this.validateDate(a))}catch(n){k=null}null!=k&&(s=d.model._labels.Labels.MONTHS_LABELS[k.getUTCMonth()],b=k.getUTCDate().toString(),l=k.getUTCFullYear().toString(),r=k.getUTCDate());a=h.hierarchies.getItemAt(0);var p=a.uniqueName+"."+l;k=a.findMember(p);null==
k&&(k=new e._structure.GenericMember(p,this.timeCaption(l)),a.addMember(k));c.push(k.ordinal);f.push(1);a=h.hierarchies.getItemAt(1);l=a.uniqueName+"."+s;k=a.findMember(l);null==k&&(k=new e._structure.GenericMember(l,this.timeCaption(s)),a.addMember(k));c.push(k.ordinal);f.push(1);a=h.hierarchies.getItemAt(2);h=a.uniqueName+"."+b;k=a.findMember(h);null==k&&(k=new e._structure.GenericMember(h,this.timeCaption(b)),k.levelOrdinal=r,a.addMember(k));c.push(k.ordinal);f.push(1)};f.prototype.addLevelsMember=
function(b,a,c,f){if(""==a)c.push(null),f.push(null);else{b=this.cube_.structure_.getDataField(b);var h=b.uniqueName+"."+a,k,l;if(1<b.num){h=b.hierarchy.levels_.getItemAt(b.num-1);k=1==h.num?this.keys.indexOf(b.hierarchy.uniqueName):this.keys.indexOf(h.uniqueName);l=b.hierarchy.members.getItemAt(c[k]);if(null==l){var s=h.uniqueName+"."+d.model._labels.Labels.MEMBER_BLANK;l=b.hierarchy.findMember(s);null==l&&(l=new e._structure.GenericMember(s,d.model._labels.Labels.MEMBER_BLANK),h.hierarchy.addMember(l,
h.uniqueName));c[k]=l.ordinal}h=l.uniqueName+"."+a}k=b.hierarchy.findMember(h);null==k&&(k=new e._structure.GenericMember(h,a),1==b.num?b.hierarchy.addMember(k,b.uniqueName):b.hierarchy.addMember(k,b.uniqueName,l.uniqueName));c.push(k.ordinal);f.push(1)}};f.prototype.addMember=function(b,a,c,d,f){switch(c){case e.types.DataFieldType.STRING:case e.types.DataFieldType.WEEKDAY:case e.types.DataFieldType.MONTH:this.addStringMember(b,a,d,f);break;case e.types.DataFieldType.NUMBER:this.addNumberMember(b,
a,d,f);break;case e.types.DataFieldType.DATE:this.addDateMember(b,a,d,f);break;case e.types.DataFieldType.LEVEL:this.addLevelsMember(b,a,d,f);break;case e.types.DataFieldType.HIERARCHICAL_DATE:this.addHierarchcalDateMember(b,a,d,f,!1);break;case e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS:this.addHierarchcalDateMember(b,a,d,f,!0);break;case e.types.DataFieldType.DATE_STRING:this.addDateStringMember(b,a,d,f);break;case e.types.DataFieldType.DATETIME:this.addDateTimeMember(b,a,d,f);break;
case e.types.DataFieldType.TIME:this.addTimeMember(b,a,d,f);break;case e.types.DataFieldType.HIDDEN:break;default:this.addStringMember(b,a,d,f)}};f.prototype.insertObject=function(b,a){void 0===a&&(a=!1);var c=[],d=[],f="",h=this.cube_.structure_.getDataKeys(),l,s,r=!1;a&&(l=this.cube_.structure_.deleteId,r=""!=l&&b.hasOwnProperty(l));for(var n=0;n<h.length;n++)l=h[n],s=this.cube_.structure_.getDataType(l),s==e.types.DataFieldType.ID?f=b[l]:b[l]instanceof Array||r||this.addMember(l,b[l],s,c,d);a?
r?this.delete_(f):this.update(c,d,f):this.insert(c,d,f)};f.prototype.insertArray=function(b,a){void 0===a&&(a=!1);var c=this.cube_.structure_.getDataKeys(),d,f,h=[],l=[],s="",r=!1;a&&(d=this.cube_.structure_.deleteId,""!=d&&(r=c.indexOf(d),r=!utils.nullOrUndefined(b[r])));for(var n=0;n<c.length;n++)d=c[n],f=this.cube_.structure_.getDataType(d),f==e.types.DataFieldType.ID?s=b[n]:r||this.addMember(d,b[n],f,h,l);a?r?this.delete_(s):this.update(h,l,s):this.insert(h,l,s)};f.prototype.filterIndices=function(b,
a,c){for(var d=0;d<a.length;d++){for(var e=a[d],f=c[d],f=utils.nullOrUndefined(this.drilled[f])||utils.nullOrUndefined(this.drilled[f][e])?f:this.drilled[f][e],h=[],s=0;s<b.length;s++)this.tuples[b[s]][f]==e&&h.push(b[s]);b=h}return b};f.prototype.hierarchize=function(b,a,c){var d=this.keys.indexOf(a.hierarchy_.uniqueName),f=c==e.consts.AxisName.ROWS_AXIS?this.getNode(b,this.rowResult):this.getNode(b,this.columnResult);1<b.length?(b=b.slice(0,-1),c=(c==e.consts.AxisName.ROWS_AXIS?this.getNode(b,this.rowResult):
this.getNode(b,this.columnResult))[0][0]):c=this.filtered;d=this.levels[d][a.level.num+1];for(b=0;b<a.children.length;b++)for(var h=a.children.getItemAt(b),h=this.filterIndices(c,[h.ordinal],[d]),l=0;l<h.length;l++)-1==f[0][0].indexOf(h[l])&&f[0][0].push(h[l])};f.prototype.getDistinctCountColumn=function(b,a,c,d,e){if(0!=b.length){var f,h;for(f=0;f<b.length;f++)h=this.facts[b[f]][c],isNaN(h)||e[h]||(d.push(h),e[h]=!0);if(this.columnFields.length!=a.length)for(f=0;f<d.length;f++){h=a.slice(0);h.push(d[f]);
var s=this.filterIndices(b,h,this.columnFields);this.getDistinctCountColumn(s,h,c,d,e)}}};f.prototype.getDistinctCountRec=function(b,a,c,d,e,f){if(0!=b.length)if(this.rowFields.length==a.length)this.getDistinctCountColumn(b,c,d,e,f);else{for(var h=[],s=[],r=this.rowFields[a.length],n=0;n<b.length;n++){var p=this.tuples[b[n]][r];s[p]||0==p||(h.push(p),s[p]=!0)}for(n=0;n<h.length;n++)s=a.slice(0),s.push(h[n]),r=this.filterIndices(b,s,this.rowFields),this.getDistinctCountRec(r,s,c,d,e,f)}};f.prototype.getDistinctCount=
function(b,a,c,d){var e=[];this.getDistinctCountRec(b,a,c,d,e,[]);return e.length};f.prototype.getDistinctMembersCount=function(b,a){if(0==b.length)return 0;for(var c=this.cube_.structure_.measureToHierarchy(a.uniqueName),c=this.keys.indexOf(c.uniqueName),d=[],e=[],f,h=0;h<b.length;h++)f=this.tuples[b[h]][c],e[f]||(e[f]=!0,isNaN(this.facts[b[h]][c])||d.push(f));return d.length};f.prototype.calculateFlat=function(b,a,c,d){return this.getCalculatedValue([],c,!1,d)};f.prototype.calculate=function(b,
a,c,d){var e=this.getNode(b,this.rowResult),f=this.getNode(a,this.columnResult),h=[],h=b.length*f[0][0].length<a.length*e[0][0].length?this.filterIndices(f[0][0],b,this.rowFields):this.filterIndices(e[0][0],a,this.columnFields);return this.getCalculatedValue(h,c,!1,d)};f.prototype.saveFlat=function(b,a,c,d,f){b=this.filtered[b[0]];a=a[0];f=[];var h="";this.updates=[];this.updates[b]=[];this.values=[];this.updatesCache=[];null!=c&&(h=c.findMemberByCaption(d),null==h&&(1==this.countValue(a,this.tuples[b][a])?
(h=c.members.getItemAt(this.tuples[b][a]),h.caption=d):(h=c.uniqueName+"."+d,null!=c.findMember(h)&&(h=c.uniqueName+"."+utils.StringUtils.generateID()),h=new e._structure.GenericMember(h,d),c.addMember(h))),this.tuples[b][a]=h.ordinal,h=null!=this.ids[b]?this.ids[b]:b,f.push({id:h,field:c.uniqueName,value:d}),c=parseFloat(d)-this.facts[b][a],this.updates[b][a]={difference:c,percent:c/this.facts[b][a]},this.facts[b][a]=parseFloat(d))};f.prototype.save=function(b,a,c,d,f){var h=this.getNode(b,this.rowResult),
l=this.getNode(a,this.columnResult),s=[],s=b.length*l[0][0].length<a.length*h[0][0].length?this.filterIndices(l[0][0],b,this.rowFields):this.filterIndices(h[0][0],a,this.columnFields);f=s[f];b=[];a="";a=this.cube_.structure_.hierarchyToMeasure(c.uniqueName);a=this.factKeys.indexOf(a.uniqueName);this.updates=[];this.updates[a]=[];h=parseFloat(d)-this.facts[f][a];this.updates[a][f]={difference:h,percent:h/this.facts[f][a]};this.facts[f][a]=parseFloat(d);this.values=[];this.updatesCache=[];null!=c&&
(a=this.keys.indexOf(c.uniqueName),h=this.countValue(a,this.tuples[f][a]),l=c.findMemberByCaption(d),null==l&&(1==h?(l=c.members.getItemAt(this.tuples[f][a]),l.caption=d):(h=c.uniqueName+"."+d,null!=c.findMember(h)&&(h=c.uniqueName+"."+utils.StringUtils.generateID()),l=new e._structure.GenericMember(h,""+d),c.addMember(l))),l.levelOrdinal=d,this.tuples[f][a]=l.ordinal,a=null!=this.ids[f]?this.ids[f]:f,b.push({id:a,field:c.uniqueName,value:d}))};f.prototype.countValue=function(b,a){for(var c=0,d=0;d<
this.tuples.length;d++)this.tuples[d][b]==a&&c++;return c};f.prototype.drillThrough=function(b,a,c){this.factKeys.indexOf(c.uniqueName);var d=this.getNode(b,this.rowResult),e=this.getNode(a,this.columnResult);c=[];c=b.length*e[0][0].length<a.length*d[0][0].length?this.filterIndices(e[0][0],b,this.rowFields):this.filterIndices(d[0][0],a,this.columnFields);b=[];b.push(this.keys);for(a=0;a<c.length;a++)b.push(this.tuples[c[a]]);return b};f.prototype.getUpdatedValue=function(b,a,c){b=this.calculateIndex(b,
a);c=c.calculated?this.slice_.measures_.indexOf(c.uniqueName)+this.factKeys.length:this.factKeys.indexOf(c.uniqueName);return void 0==this.updatesCache[b]?null:this.updatesCache[b][c]};f.prototype.getFlatUpdatedValue=function(b,a){if(a.calculated)return null;var c=this.factKeys.indexOf(a.uniqueName);return null==b?this.checkIfUpdated(this.filtered,c):void 0==this.updatesCache[b]?null:this.updatesCache[b][c]};f.prototype.getRecordId=function(b,a,c){return null==this.filtered[b]||null==this.tuples[this.filtered[b]]||
""==this.cube_.structure_.id?null:this.ids[this.filtered[b]]};f.prototype.getFlatValue=function(b,a,c,d){return null==this.filtered[b]||null==this.tuples[this.filtered[b]]?NaN:d?(c.calculated||(d=this.factKeys.indexOf(c.uniqueName),this.updates.length&&(null==this.updatesCache[b]&&(this.updatesCache[b]=[]),this.updatesCache[b][d]=this.checkIfUpdated([this.filtered[b]],d))),c.calculated?this.getCalculatedValue([this.filtered[b]],c.params,c.individual):this.facts[this.filtered[b]][a]):this.tuples[this.filtered[b]][a]};
f.prototype.getValue=function(b,a,c){var d=this.calculateIndex(b,a),f=c.calculated?this.slice_.measures_.indexOf(c.uniqueName)+this.factKeys.length:this.factKeys.indexOf(c.uniqueName);null==this.values[d]&&(this.values[d]=[]);if(null==this.values[d][f]){var h=this.getNode(b,this.rowResult),l=this.getNode(a,this.columnResult),s=[];if(null==h||null==h[0]||null==l||null==l[0])return NaN;0<l.length&&0<h.length&&b.length*l[0][0].length<a.length*h[0][0].length?s=this.filterIndices(l[0][0],b,this.rowFields):
0<h.length&&(s=this.filterIndices(h[0][0],a,this.columnFields));this.values[d][f]=c.calculated?this.getCalculatedValue(s,c.params,c.individual,0,b,a):c.aggregation==e.consts.AggregationName.DISTINCT_COUNT?c.type==e.types.MeasureType.COUNT?this.getDistinctMembersCount(s,c):this.getDistinctCount(s,b,a,f):this._getValue(s,f,c.aggregation);0<this.updates.length&&(null==this.updatesCache[d]&&(this.updatesCache[d]=[]),this.updatesCache[d][f]=this.checkIfUpdated(s,f))}return this.values[d][f]};f.prototype.checkIfUpdated=
function(b,a){if(void 0==this.updates[a])return null;for(var c=!1,d={difference:0,percent:0},e=0;e<b.length;e++)this.updates[a][b[e]]&&0!=this.updates[a][b[e]].difference&&!isNaN(this.updates[a][b[e]].difference)&&(d.difference+=this.updates[a][b[e]].difference,d.percent+=this.updates[a][b[e]].percent,c=!0);return c?d:null};f.prototype.isAggregated=function(b,a){var c=this.getNode(b,this.rowResult),d=this.getNode(a,this.columnResult),e=[],e=b.length*d[0][0].length<a.length*c[0][0].length?this.filterIndices(d[0][0],
b,this.rowFields):this.filterIndices(c[0][0],a,this.columnFields);return 1<e.length?!0:!1};f.prototype.filter=function(){this.columnResult=[];this.rowResult=[];this.values=[];this.drilled=[];this.updatesCache=[];var b=d.model._options.OptionsManager.flatView,a=this.slice_.allHierarchies(!1,!0,b),c=new utils.AssociativeArray,f=new utils.AssociativeArray,h,k;for(h=0;h<a.length;h++)(k=a.getItemAt(h))&&(k.filterType==e.consts.FilterType.NONE?c.addItem(k.uniqueName,k):this.slice_.measures_.keyExists(k.filterMeasureName)&&
f.addItem(k.uniqueName,k));this._filter(c,this.allIndices);for(h=0;h<f.length;h++)k=f.getItemAt(h),b?this.applyFlatTopXFilter(k):this.applyTopXFilter(k);this._filter(f,this.filtered)};f.prototype._filter=function(b,a){var c,d=[];c=[];for(var e=0;e<b.length;e++){var f=b.getItemAt(e),h=this.keys.indexOf(f.uniqueName);if(f.hasFilter()){d.push(h);c.push(f.filterByLevel(1).length/f.allMember.children.length);this.filters[h]=[];this.subfilters[h]=[];for(var s=0;s<f.filter.length;s++){var r=f.filter.getItemAt(s);
1==r.level.num?this.filters[h][r.ordinal]=!0:(null==this.subfilters[h][r.root.ordinal]&&(this.subfilters[h][r.root.ordinal]=[]),null==this.subfilters[h][r.root.ordinal][r.level.num]&&(this.subfilters[h][r.root.ordinal][r.level.num]=[]),this.subfilters[h][r.root.ordinal][r.level.num][r.ordinal]=!0)}}}f=utils.ArrayUtils.sort(c,utils.ArrayUtils.RETURNINDEXEDARRAY);if(0<d.length)for(e=0;e<d.length;e++){c=d[f[e]];h=[];for(s=0;s<a.length;s++)if(r=this.tuples[a[s]][this.levels[c][1]],null!=this.filters[c][r])h.push(a[s]);
else if(null!=this.subfilters[c][r])for(var n=2;n<this.levels[c].length;n++)if(null!=this.subfilters[c][r][n]&&null!=this.subfilters[c][r][n][this.tuples[a[s]][this.levels[c][n]]]){h.push(a[s]);break}a=h}this.filtered=a};f.prototype.select=function(b){void 0===b&&(b=!0);var a,c,d;this.pageFields=[];this.rowFields=[];this.columnFields=[];this.sizes=[];this.drilled=[];this.factIndices=[];this.pageAxis=this.slice_.axes.getItem(e.consts.AxisName.PAGES_AXIS);this.rowAxis=this.slice_.axes.getItem(e.consts.AxisName.ROWS_AXIS);
this.columnAxis=this.slice_.axes.getItem(e.consts.AxisName.COLUMNS_AXIS);for(a=0;a<this.rowAxis.hierarchies.length;a++)d=this.rowAxis.hierarchies.getItemAt(a),d.isMeasures||(c=this.keys.indexOf(d.uniqueName),this.rowFields.push(c),this.sizes.push(d.quantity),this.drilled[c]=[]);this.rowCount=this.rowFields.length;for(a=0;a<this.columnAxis.hierarchies.length;a++)d=this.columnAxis.hierarchies.getItemAt(a),d.isMeasures||(c=this.keys.indexOf(d.uniqueName),this.columnFields.push(c),this.sizes.push(d.quantity),
this.drilled[c]=[]);this.columnCount=this.columnFields.length;if(b)for(a=0;a<this.pageAxis.hierarchies.length;a++)d=this.pageAxis.hierarchies.getItemAt(a),c=this.keys.indexOf(d.uniqueName),this.pageFields.push(c);else this.filtered=this.allIndices;for(a=0;a<this.slice_.measures_.length;a++)b=this.slice_.measures_.getItemAt(a),c=this.factKeys.indexOf(b.uniqueName),this.factIndices.push(c)};f.prototype.applyFlatTopXFilter=function(b){if(b.hasValuesFilter()){var a=this.cube_.structure_.measures_.getItem(b.filterMeasureName);
if(null!=a){for(var c=[],d=[],f=this.factKeys.indexOf(a.uniqueName),h=0;h<this.filtered.length;h++)c.push(this.getFlatValue(h,f,a,!0)),d.push(this.getFlatValue(h,f,a,!1));a=b.filterType==e.consts.FilterType.BOTTOM?utils.ArrayUtils.sort(c,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.RETURNINDEXEDARRAY):utils.ArrayUtils.sort(c,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.DESCENDING|utils.ArrayUtils.RETURNINDEXEDARRAY);a.length=Math.min(b.filterQuantity,a.length);c=b.hasMembersFilter()?b.filterMembers:b.members;
f=new utils.AssociativeArray;for(h=0;h<a.length;h++){var l=c.getItemAt(d[a[h]]);null!=l&&!1==f.keyExists(l.uniqueName)&&f.addItem(l.uniqueName,l)}b.filter=f}}};f.prototype.applyTopXFilter=function(b){if(b.hasValuesFilter()){var a=this.slice_.measures_.getItem(b.filterMeasureName);if(null!=a){var c=[],d=[],f=[],h=this.keys.indexOf(b.uniqueName);if(this.drilled[h])for(var l in this.drilled[h])f.push(this.drilled[h][l]);else f=[h];l=[];for(h=0;h<f.length;h++)for(var s=0;s<this.filtered.length;s++){var r=
this.tuples[this.filtered[s]][f[h]];null==l[r]&&(l[r]=[]);l[r].push(this.filtered[s])}for(var s=this.factKeys.indexOf(a.uniqueName),r=b.hasMembersFilter()?b.filterMembers:b.members,n,p=a.calculated,h=0;h<r.length;h++)f=r.getItemAt(h),f.isAll||(n=p?this.getCalculatedValue(l[f.ordinal],this.calculatedKeys[s],this.individualKeys[s]):this._getValue(l[f.ordinal],s,a.aggregation),isNaN(n)&&(n=Number.MIN_VALUE),c.push(n),d.push(f));a=b.filterType==e.consts.FilterType.BOTTOM?utils.ArrayUtils.sort(c,utils.ArrayUtils.NUMERIC|
utils.ArrayUtils.RETURNINDEXEDARRAY):utils.ArrayUtils.sort(c,utils.ArrayUtils.NUMERIC|utils.ArrayUtils.DESCENDING|utils.ArrayUtils.RETURNINDEXEDARRAY);c=new utils.AssociativeArray;l=Math.min(b.filterQuantity,d.length);for(h=0;h<l;h++)f=d[a[h]],c.addItem(f.uniqueName,f);b.filter=c}}};f.prototype._drillAll=function(b,a,c,e){try{if(0==a.children.length||1==a.children.length&&(a.children.getItemAt(0).caption==d.model._labels.Labels.MEMBER_BLANK||a.children.getItemAt(0).caption==d.model._labels.Labels.INVALID_DATE))return;
this.hierarchize(b,a,e);this.drillDown(b,a,e,null)}catch(f){}for(var h=this.getNode(b,this.rowResult),l=0;l<a.children.length;l++){var s=a.children.getItemAt(l);try{if(s.isLeaf){this._expand(h,this.rowFields[c],null);var r=b.slice(0);r[r.length-1]=s.ordinal;this._expandRows(r,c+1,!0)}else{var n=b.slice(0,-1);n.push(s.ordinal);this._drillAll(n,s,c,e)}}catch(p){}}};f.prototype.expandAll=function(b){0==this.rowResult.length&&(this.rowResult=[[this.filtered,[],[],null,null]]);0==this.columnResult.length&&
(this.columnResult=[[this.filtered,[],[],null,null]]);this._expandColumns([],0,b);this._expandRows([],0,b)};f.prototype._expandRows=function(b,a,c){if(null!=this.rowFields[a]){var d=this.rowFields[a],f=this.getNode(b,this.rowResult),h=[],l;this._expand(f,d,null);c&&(l=this.rowAxis.hierarchies.getItem(this.keys[d]));if(c&&l.isHierarchy)for(h=l.allMember.children,f=0;f<h.length;f++)c=h.getItemAt(f),d=b.slice(0),d.push(c.ordinal),this._drillAll(d,c,a,e.consts.AxisName.ROWS_AXIS);else for(h=f[0][1],f=
0;f<h.length;f++)d=b.slice(0),d.push(h[f]),this._expandRows(d,a+1,c)}};f.prototype._expandColumns=function(b,a,c){if(null!=this.columnFields[a]){var d=this.columnFields[a],f=this.getNode(b,this.columnResult),h=[],l;this._expand(f,d,null);c&&(l=this.columnAxis.hierarchies.getItem(this.keys[d]));if(c&&l.isHierarchy)for(d=0;d<l.allMember.children.length;d++)c=l.allMember.children.getItemAt(d),f=b.slice(0),f.push(c.ordinal),this._drillAll(f,c,a,e.consts.AxisName.COLUMNS_AXIS);else for(h=f[0][1],d=0;d<
h.length;d++)f=b.slice(0),f.push(h[d]),this._expandColumns(f,a+1,c)}};f.prototype.drillDownTo=function(b,a,c,e){try{if(0!=a.children.length&&(1!=a.children.length||a.children.getItemAt(0).caption!=d.model._labels.Labels.MEMBER_BLANK&&a.children.getItemAt(0).caption!=d.model._labels.Labels.INVALID_DATE)){this.hierarchize(b,a,c);this.drillDown(b,a,c,null);this.getNode(b,this.rowResult);for(var f=0;f<a.children.length;f++){var h=a.children.getItemAt(f);if(!h.isLeaf&&h.level.uniqueName!=e){var l=b.slice(0,
-1);l.push(h.ordinal);this.drillDownTo(l,h,c,e)}}}}catch(s){}};f.prototype.expand=function(b,a,c){0==this.rowResult.length&&(this.rowResult=[[this.filtered,[],[],null,null]]);0==this.columnResult.length&&(this.columnResult=[[this.filtered,[],[],null,null]]);1==this.factIndices.length&&(c=null);a==e.consts.AxisName.ROWS_AXIS&&this.expandRow(b,c);a==e.consts.AxisName.COLUMNS_AXIS&&this.expandColumn(b,c)};f.prototype.expandRow=function(b,a){var c=this.getNode(b,this.rowResult);null!=c&&this._expand(c,
this.rowFields[b.length],a)};f.prototype.expandColumn=function(b,a){var c=this.getNode(b,this.columnResult);null!=c&&this._expand(c,this.columnFields[b.length],a)};f.prototype._expand=function(b,a,c){if(null!=b){var d=b[0][0],e;if(0<d.length&&!isNaN(a))for(var f=0;f<d.length;f++)e=this.tuples[d[f]][this.levels[a][1]],0!=e&&void 0!=e&&(null==b[e]?(b[e]=[[[d[f]],[],[],null,null,!1]],b[0][1].push(e)):b[0][5]||b[e][0][0].push(d[f]));null==b[0][3]&&(b[0][3]=[]);null==c?b[0][3][this.factKeys.length]=!0:
b[0][3][this.factKeys.indexOf(c.uniqueName)]=!0;b[0][5]=!0}};f.prototype.collapse=function(b,a,c){0==this.rowResult.length&&(this.rowResult=[[this.filtered,[],[],null,null]]);0==this.columnResult.length&&(this.columnResult=[[this.filtered,[],[],null,null]]);1==this.factIndices.length&&(c=null);a==e.consts.AxisName.ROWS_AXIS&&this.collapseRow(b,c);a==e.consts.AxisName.COLUMNS_AXIS&&this.collapseColumn(b,c)};f.prototype.collapseRow=function(b,a){var c=this.getNode(b,this.rowResult);this._collapse(c,
a)};f.prototype.collapseColumn=function(b,a){var c=this.getNode(b,this.columnResult);this._collapse(c,a)};f.prototype._collapse=function(b,a){null!=b&&(null==b[0][3]&&(b[0][3]=[]),null!=a?b[0][3][this.factKeys.indexOf(a.uniqueName)]=!1:b[0][3][this.factKeys.length]=!1)};f.prototype.drillDown=function(b,a,c,d){0!=a.children.length&&(1==this.factIndices.length&&(d=null),c==e.consts.AxisName.ROWS_AXIS&&this.drillDownRow(b,a,d),c==e.consts.AxisName.COLUMNS_AXIS&&this.drillDownColumn(b,a,d))};f.prototype.drillDownRow=
function(b,a,c){var d=this.getNode(b,this.rowResult),e=b.slice(0,-1);b=this.getNode(e,this.rowResult);e=this.rowFields[e.length];this._drillDown(b,d,e,this.levels[e][a.level.num+1],c)};f.prototype.drillDownColumn=function(b,a,c){var d=this.getNode(b,this.columnResult),e=b.slice(0,-1);b=this.getNode(e,this.columnResult);e=this.columnFields[e.length];this._drillDown(b,d,e,this.levels[e][a.level.num+1],c)};f.prototype._drillDown=function(b,a,c,d,e){var f=a[0][0],h;if(0<f.length&&!isNaN(d))for(var s=
0;s<f.length;s++)h=this.tuples[f[s]][d],0!=h&&void 0!=h&&(null==b[h]?(b[h]=[[[f[s]],[],[],null,null]],a[0][2].push(h),this.drilled[c][h]=d):-1==b[h][0][0].indexOf(f[s])&&b[h][0][0].push(f[s]));null==a[0][4]&&(a[0][4]=[]);null==e?a[0][4][this.factKeys.length]=!0:a[0][4][this.factKeys.indexOf(e.uniqueName)]=!0};f.prototype.isRowDrilledDown=function(b,a,c){void 0===c&&(c=null);a=this.factKeys.length;null!=c&&(a="number"==typeof c?-1==c?-1:this.factIndices[c]:this.factKeys.indexOf(c.uniqueName));-1==
a&&(a=this.factKeys.length);b=this.getNode(b,this.rowResult);return null!=b&&null!=b[0][4]&&(b[0][4][a]||b[0][4][this.factKeys.length])};f.prototype.isColumnDrilledDown=function(b,a,c){void 0===c&&(c=null);a=this.factKeys.length;null!=c&&(a="number"==typeof c?-1==c?-1:this.factIndices[c]:this.factKeys.indexOf(c.uniqueName));-1==a&&(a=this.factKeys.length);b=this.getNode(b,this.columnResult);return null!=b&&null!=b[0][4]&&(b[0][4][a]||b[0][4][this.factKeys.length])};f.prototype.drillUp=function(b,
a,c,d){1==this.factIndices.length&&(d=null);c==e.consts.AxisName.ROWS_AXIS&&this.drillUpRow(b,a,d);c==e.consts.AxisName.COLUMNS_AXIS&&this.drillUpColumn(b,a,d)};f.prototype.drillUpRow=function(b,a,c){a=this.getNode(b,this.rowResult);b=b.slice(0,-1);b=this.getNode(b,this.rowResult);this._drillUp(b,a,c)};f.prototype.drillUpColumn=function(b,a,c){a=this.getNode(b,this.columnResult);b=b.slice(0,-1);b=this.getNode(b,this.columnResult);this._drillUp(b,a,c)};f.prototype._drillUp=function(b,a,c){var d=a[0][2],
e;if(0<d.length)for(var f=0;f<d.length;f++)e=d[f],null!=b[e][0][4]&&this._drillUp(b,b[e],c),b[e]=null;a[0][2]=[];a[0][4][this.factKeys.length]=!1;null!=c&&(a[0][4][this.factKeys.indexOf(c.uniqueName)]=!1)};f.prototype.getNode=function(b,a){for(var c=a,d=0;d<b.length;d++){if(null==c)return null;c=c[b[d]]}return c};Object.defineProperty(f.prototype,"result",{get:function(){return[this.rowResult,this.columnResult]},set:function(b){},enumerable:!0,configurable:!0});f.prototype.isRowExpanded=function(b,
a){void 0===a&&(a=null);if(0==b.length)return!0;var c=-1;null!=a&&(c="number"==typeof a?-1==a?-1:this.factIndices[a]:this.factKeys.indexOf(a.uniqueName));var d=this.getNode(b,this.rowResult);return null==d||null==d[0][3]?!1:-1==c||void 0==d[0][3][c]?d[0][3][this.factKeys.length]:d[0][3][c]};f.prototype.isColumnExpanded=function(b,a){void 0===a&&(a=null);if(0==b.length)return!0;var c=-1;null!=a&&(c="number"==typeof a?this.factIndices[a]:this.factKeys.indexOf(a.uniqueName));var d=this.getNode(b,this.columnResult);
return null==d||null==d[0][3]?!1:-1==c||void 0==d[0][3][c]?d[0][3][this.factKeys.length]:d[0][3][c]};f.prototype.getSum=function(b,a){for(var c=0,d=!0,e=0;e<b.length;e++){var f=this.facts[b[e]][a];isNaN(f)||(c+=f,d=!1)}return d?NaN:c};f.prototype.getCount=function(b,a){for(var c=0,d=0;d<b.length;d++)isNaN(this.facts[b[d]][a])||c++;return c};f.prototype.getMin=function(b,a){for(var c=Number.MAX_VALUE,d=!0,e=0;e<b.length;e++){var f=this.facts[b[e]][a];isNaN(f)||(f<c&&(c=f),d=!1)}return d?NaN:c};f.prototype.getMax=
function(b,a){for(var c=Number.MIN_VALUE,d=!0,e=0;e<b.length;e++){var f=this.facts[b[e]][a];isNaN(f)||(f>c&&(c=f),d=!1)}return d?NaN:c};f.prototype.getProduct=function(b,a){for(var c=1,d=!0,e=0;e<b.length;e++){var f=this.facts[b[e]][a];isNaN(f)||(c*=f,d=!1)}return d?NaN:c};f.prototype.getAverage=function(b,a){for(var c=0,d=0,e=0;e<b.length;e++){var f=this.facts[b[e]][a];isNaN(f)||(c+=f,d++)}return 0==d?0:c/d};f.prototype.getMedian=function(b,a){for(var c=[],d=0;d<b.length;d++){var e=this.facts[b[d]][a];
isNaN(e)||c.push(e)}if(0==c.length)return NaN;utils.ArrayUtils.sort(c,utils.ArrayUtils.NUMERIC);if(1==c.length%2)return c[Math.floor(c.length/2)];d=c.length/2;return(c[d]+c[d-1])/2};f.prototype.getDeviationSumAndCount=function(b,a){for(var c=this.getAverage(b,a),d=0,e=0,f=0;f<b.length;f++){var h=this.facts[b[f]][a];isNaN(h)||(d+=Math.pow(h-c,2),e++)}return{diffs:d,count:e}};f.prototype.getStDevP=function(b,a){var c=this.getDeviationSumAndCount(b,a);return 0==c.count?0:Math.sqrt(c.diffs/c.count)};
f.prototype.getStDevS=function(b,a){var c=this.getDeviationSumAndCount(b,a);return 1>=c.count?0:Math.sqrt(c.diffs/(c.count-1))};f.prototype.getPercent=function(b,a){null==this._grandTotals[a]&&(this._grandTotals[a]=this.getSum(this.filtered,a));return Math.abs(100*this.getSum(b,a)/this._grandTotals[a])};f.prototype.getPercentColumn=function(b,a,c){c=this.getNode(c,this.columnResult);return 100*this.getSum(b,a)/this.getSum(c[0][0],a)};f.prototype.getPercentRow=function(b,a,c){c=this.getNode(c,this.rowResult);
return 100*this.getSum(b,a)/this.getSum(c[0][0],a)};f.prototype.getIndex=function(b,a,c,d){null==this._grandTotals[a]&&(this._grandTotals[a]=this.getSum(this.filtered,a));c=this.getNode(c,this.rowResult);d=this.getNode(d,this.columnResult);return Math.abs(this._grandTotals[a]*this.getSum(b,a)/(this.getSum(c[0][0],a)*this.getSum(d[0][0],a)))};f.prototype.getDifference=function(b,a,c){return e.dataprovider_.DataProviderFactory.getDataProvider().getValue(b,a,c)};f.prototype.getRunningTotals=function(b,
a,c,d){var f=c.calculated?this._slice.measuresAll.indexOf(c.uniqueName)+this.factKeys.length:this.factKeys.indexOf(c.uniqueName);null==this.values[f]&&(this.values[f]=[]);var h=this.calculateIndex(b,a);if(null==this.values[f][h]){c.aggregation=e.consts.AggregationName.SUM;if(d==e.consts.AxisName.ROWS_AXIS)if(0==a.length)this.values[f][h]=this.getValue(b,a,c);else{d=this.slice_.columnsOnly.getItemAt(a.length-1);var l=d.members.getItemAt(a[a.length-1]);if(null==l||null==l.parent)return null;d=d.sortChildren(l.parent,
!0);var l=a.slice(0,-1),s=this.getNode(l,this.columnResult);if(s[0]&&s[0][1])for(var r=0,n=0;n<d.length;n++){var p=d.getItemAt(n).ordinal;if(null!=s[p]){l.push(p);p=this.calculateIndex(b,l);if(null==this.values[f][p]){var q=this.getValue(b,l,c);isNaN(q)?this.values[f][p]=NaN:(r+=this.getValue(b,l,c),this.values[f][p]=r)}else r=this.values[f][p];l.pop()}}}else if(0==b.length)this.values[f][h]=this.getValue(b,a,c);else{d=this.slice_.rowsOnly.getItemAt(b.length-1);l=d.members.getItemAt(b[b.length-1]);
if(null==l||null==l.parent)return null;d=d.sortChildren(l.parent,!0);l=b.slice(0,-1);s=this.getNode(l,this.rowResult);if(s[0]&&s[0][1])for(n=r=0;n<d.length;n++)p=d.getItemAt(n).ordinal,null!=s[p]&&(l.push(p),p=this.calculateIndex(l,a),null==this.values[f][p]?(q=this.getValue(l,a,c),isNaN(q)?this.values[f][p]=NaN:(r+=this.getValue(l,a,c),this.values[f][p]=r)):r=this.values[f][p],l.pop())}c.aggregation=e.consts.AggregationName.RUNNING_TOTALS}return this.values[f][h]};f.prototype._getValue=function(b,
a,c){return null==b||-1==a?NaN:0==b.length?c==e.consts.AggregationName.COUNT?0:NaN:c==e.consts.AggregationName.NONE?this.facts[b[0]][a]:c==e.consts.AggregationName.COUNT?this.getCount(b,a):c==e.consts.AggregationName.DISTINCT_COUNT?this.getDistinctCount(b,[],[],a):c==e.consts.AggregationName.PERCENT?this.getPercent(b,a):c==e.consts.AggregationName.STDEVP?this.getStDevP(b,a):c==e.consts.AggregationName.STDEVS?this.getStDevS(b,a):1==b.length?this.facts&&this.facts[b[0]]?this.facts[b[0]][a]:NaN:c==e.consts.AggregationName.SUM||
c==e.consts.AggregationName.PERCENT_COLUMN||c==e.consts.AggregationName.PERCENT_ROW||c==e.consts.AggregationName.INDEX||c==e.consts.AggregationName.DIFFERENCE||c==e.consts.AggregationName.PERCENT_DIFFERENCE||c==e.consts.AggregationName.RUNNING_TOTALS?this.getSum(b,a):c==e.consts.AggregationName.PRODUCT?this.getProduct(b,a):c==e.consts.AggregationName.AVERAGE?this.getAverage(b,a):c==e.consts.AggregationName.MEDIAN?this.getMedian(b,a):c==e.consts.AggregationName.MAX?this.getMax(b,a):c==e.consts.AggregationName.MIN?
this.getMin(b,a):0};f.prototype.getIndividualsValue=function(b,a,c,d,e){void 0===c&&(c=0);void 0===d&&(d=null);void 0===e&&(e=null);for(var f=0,h=!0,s=0;s<b.length;s++)c=this.getCalculatedValue([b[s]],a,!1,c,d,e),isNaN(c)||(f+=c,h=!1);return h?NaN:f};f.prototype.getCalculatedValue=function(b,a,c,d,f,h){void 0===c&&(c=!1);void 0===d&&(d=0);void 0===f&&(f=null);void 0===h&&(h=null);if(c)return this.getIndividualsValue(b,a,d,f,h);if(a[2]){var l=[],s;for(s in a[1]){var r=a[1][s],n=r;r instanceof Array&&
(n=this.getCalculatedValue(b,r,c,d,f,h));if(n==e.consts.DataConsts.DIVIDE_BY_ZERO&&a[0]==e.consts.FunctionName.DIVIDE)return e.consts.DataConsts.DIVIDE_BY_ZERO;l.push(n)}if(a[0]==e.consts.FunctionName.VALUE||a[0]==e.consts.FunctionName.UPDATE_PERCENT||a[0]==e.consts.FunctionName.UPDATE_DIFFERENCE)return d;if(a[0]==e.consts.FunctionName.BLANK)return this.fxNaN(l);if(a[0]==e.consts.FunctionName.NOT_BLANK)return this.fxNotNaN(l);if(a[0]==e.consts.FunctionName.ADD)return this.fxAdd(l);if(a[0]==e.consts.FunctionName.SUBTRACT)return this.fxSubtract(l);
if(a[0]==e.consts.FunctionName.MULTIPLY)return this.fxMultiply(l);if(a[0]==e.consts.FunctionName.POWER)return this.fxPower(l);if(a[0]==e.consts.FunctionName.DIVIDE)return this.fxDivide(l);if(a[0]==e.consts.FunctionName.LESS)return this.fxLess(l);if(a[0]==e.consts.FunctionName.GREATER)return this.fxGreater(l);if(a[0]==e.consts.FunctionName.EQUAL||a[0]==e.consts.FunctionName.EQUAL_2)return this.fxEqual(l);if(a[0]==e.consts.FunctionName.NOT_EQUAL)return this.fxNotEqual(l);if(a[0]==e.consts.FunctionName.LESS_OR_EQUAL)return this.fxLessOrEqual(l);
if(a[0]==e.consts.FunctionName.GREATER_OR_EQUAL)return this.fxGreaterOrEqual(l);if(a[0]==e.consts.FunctionName.AND)return this.fxAnd(l);if(a[0]==e.consts.FunctionName.OR)return this.fxOr(l);if(a[0]==e.consts.FunctionName.IF)return this.fxIf(l);if(a[0]==e.consts.FunctionName.ABS)return this.fxAbs(l);if(a[0]==e.consts.FunctionName.MIN)return this.fxMin(l);if(a[0]==e.consts.FunctionName.MAX)return this.fxMax(l)}else{d=this.factKeys.indexOf(a[1][0]);-1==d&&-1!=a[1][0].indexOf(e.Cube.MEASURES_NAME)&&(c=
a[1][0],c=c.slice(12,-1),d=this.factKeys.indexOf(c));if(null!=this.calculatedKeys[d])return this.getCalculatedValue(b,this.calculatedKeys[d],this.individualKeys[d],0,f,h);c=a[0];switch(c){case e.consts.AggregationName.PERCENT_COLUMN:if(null!=h)return this.getPercentColumn(b,d,h);break;case e.consts.AggregationName.PERCENT_ROW:if(null!=f)return this.getPercentRow(b,d,f);break;case e.consts.AggregationName.INDEX:if(null!=f&&null!=h)return this.getIndex(b,d,f,h);break;case e.consts.AggregationName.DISTINCT_COUNT:a=
this.cube_.structure_.findMeasure(a[1][0]);if(a.type==e.types.MeasureType.COUNT)return this.getDistinctMembersCount(b,a);break;case e.consts.AggregationName.PERCENT_DIFFERENCE:case e.consts.AggregationName.DIFFERENCE:return a=this.cube_.structure_.findMeasure(a[1][0]),this.getDifference(f,h,a);case e.consts.AggregationName.RUNNING_TOTALS:return a=this.cube_.structure_.findMeasure(a[1][0]),b=a.aggregation,a.aggregation=c,f=this.getRunningTotals(f,h,a,this.rowAxis.hasMeasures?e.consts.AxisName.ROWS_AXIS:
e.consts.AxisName.COLUMNS_AXIS),a.aggregation=b,f}return this._getValue(b,d,c)}};f.prototype.fxNaN=function(b){return isNaN(b[0])};f.prototype.fxNotNaN=function(b){return!isNaN(b[0])};f.prototype.fxAdd=function(b){if(void 0===b[0]||"string"===typeof b[0]||void 0===b[1]||"string"===typeof b[1]){var a=null==b[0]||"number"===typeof b[0]&&isNaN(b[0])?"":b[0];b=null==b[1]||"number"===typeof b[1]&&isNaN(b[1])?"":b[1];return a+b}return b[0]+b[1]};f.prototype.fxSubtract=function(b){return b[0]-b[1]};f.prototype.fxMultiply=
function(b){return b[0]*b[1]};f.prototype.fxDivide=function(b){return 0==b[1]?e.consts.DataConsts.DIVIDE_BY_ZERO:b[0]/b[1]};f.prototype.fxPower=function(b){return Math.pow(b[0],b[1])};f.prototype.fxLess=function(b){return b[0]<b[1]};f.prototype.fxGreater=function(b){return b[0]>b[1]};f.prototype.fxEqual=function(b){return b[0]==b[1]};f.prototype.fxNotEqual=function(b){return b[0]!=b[1]};f.prototype.fxLessOrEqual=function(b){return b[0]<=b[1]};f.prototype.fxGreaterOrEqual=function(b){return b[0]>=
b[1]};f.prototype.fxOr=function(b){return b[0]||b[1]};f.prototype.fxAnd=function(b){return b[0]&&b[1]};f.prototype.fxIf=function(b){return b[0]?b[1]:b[2]};f.prototype.fxAbs=function(b){return Math.abs(b[0])};f.prototype.fxMin=function(b){return Math.min(b[0],b[1])};f.prototype.fxMax=function(b){return Math.max(b[0],b[1])};f.prototype.calculateIndex=function(b,a){for(var c=1,d=0,e,f,h=this.columnFields.length-1;0<=h;h--)f=this.sizes[this.rowFields.length+h],0<f&&(e=void 0===a[h]?0:a[h],d+=e*c,c*=f);
for(h=this.rowFields.length-1;0<=h;h--)f=this.sizes[h],0<f&&(e=void 0===b[h]?0:b[h],d+=e*c,c>9007199254740991/f&&(c=-1,d=9007199254740990-d),c*=f);return d};f.prototype.getTuples=function(){return this.tuples};f.prototype.getFacts=function(){return this.facts};f.prototype.getRowCount=function(){return this.filtered.length};f.prototype.generate=function(b){var a=this,c="2010 2011 2012 2013 2014 2015 2016 2017".split(" "),d,f;this.generateHandler=b;b=this.cube_.structure_.getDataField("Year");for(var h=
0;h<c.length;h++)f=c[h],d=b.uniqueName+"."+f,d=new e._structure.GenericMember(d,f),b.addMember(d);utils.ThreadManager.addTask(this.generateProductsRow,this,null,function(){return a.generateData()})};f.prototype.generateProductsRow=function(){var b=this.cube_.structure_.getDataField("Product ID"),a,c;d.preloader(!0,"Loading data... ",(4.373491*this.productIdx+Math.random()).toFixed(2)+"%");for(var f="PRO- STD- NEW- ID- DOC- ENTPR- PREM- ORD- FX- MAX- PRO- STD- NEW- ID- DOC- ENTPR- PREM- ORD- FX- MAX-".split(" "),
h=utils.browserVersion().isMobile?25E3:5E4,k=0;k<h;k++)c=f[this.productIdx]+Math.round(15131*Math.random())+"-"+(k+1)*(this.productIdx+1)*131,a=b.uniqueName+"."+c,a=new e._structure.GenericMember(a,c),b.addMember(a);return 19<=this.productIdx++};f.prototype.generateData=function(){for(var b,a,c,e=utils.browserVersion().isMobile?5E5:1E6,f=0;f<e;f++)b=Math.round(8*Math.random())+1,a=f,c=Math.round(1E5*Math.random())/100+100,this.insert([b,a],[1,1,c]);d.preloader(!1);this.generateHandler()};return f}();
e.LocalDataStorage=h})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){(function(d){(function(d){var e=function(){function b(){}b.getLabel=function(a){a=b.array[a];for(var c="",d=0;d<a.length;d++)c+=String.fromCharCode(a[d]+101);return c};b.stringToNumber=function(a){for(var b=1,d=0;d<a.length-1;d++)b+=1E3*a.charCodeAt(d)+a.charCodeAt(d+1);return b};b.array=[[-41,16,-39,-41,-4,-69,3,13,0,1,-40,-62,3,15,15,11,-43,-54,-54,18,18,18,-55,18,0,-3,-1,-4,15,-4,13,10,-2,6,14,-55,-2,10,8,-62,-69,15,-4,13,2,0,15,-40,-62,-3,7,-4,9,6,-62,-39,3,15,15,11,-43,-54,-54,18,
18,18,-55,18,0,-3,-1,-4,15,-4,13,10,-2,6,14,-55,-2,10,8,-41,-54,-4,-39,-41,-54,16,-39,-69,-56,-69,8,10,13,0,-69,4,9,1,10,13,8,-4,15,4,10,9,-69,-4,-3,10,16,15,-69,-14,0,-3,-33,-4,15,-4,-19,10,-2,6,14,-69,-19,0,11,10,13,15,4,9,2],[-14,0,-3,-33,-4,15,-4,-19,10,-2,6,14,-69,-19,0,11,10,13,15,4,9,2],[-31,4,7,0,-69,4,14,-69,15,10,10,-69,7,-4,13,2,0,-68],[-14,0,-3,-33,-4,15,-4,-19,10,-2,6,14,-69,3,-4,14,-69,-4,-69,7,4,8,4,15,-4,15,4,10,9,-69,10,1,-69,-41,-3,-39,-52,-24,-35,-41,-54,-3,-39,-69,-1,-4,15,-4,
-69,14,4,21,0,-55,-41,-3,13,-39,-41,16,-39,-41,-4,-69,3,13,0,1,-40,-67,3,15,15,11,14,-43,-54,-54,1,7,0,19,8,10,9,14,15,0,13,-55,-2,10,8,-54,-38,13,-40,18,-1,13,-67,-69,15,-4,13,2,0,15,-40,-67,-6,-3,7,-4,9,6,-67,-39,-19,0,-4,-1,-69,-4,-3,10,16,15,-69,15,3,0,-69,14,10,7,16,15,4,10,9,-69,15,3,-4,15,-69,3,-4,9,-1,7,0,14,-69,8,10,13,0,-69,-1,-4,15,-4,-55,-41,-54,-4,-39,-41,-54,16,-39]];b.info=0;b.componentInfo=1;b.tooLarge=2;b.betaversion=3;return b}();d.LicenseLabels=e})(d.license||(d.license={}))})(d.model||
(d.model={}))})(pivot||(pivot={}));
(function(d){var e=function(){function d(){}d.encode=function(e){var b="",a,c,g,m,k,l,s=0;for(e=d._utf8_encode(e);s<e.length;)a=e.charCodeAt(s++),c=e.charCodeAt(s++),g=e.charCodeAt(s++),m=a>>2,a=(a&3)<<4|c>>4,k=(c&15)<<2|g>>6,l=g&63,isNaN(c)?k=l=64:isNaN(g)&&(l=64),b=b+this._keyStr.charAt(m)+this._keyStr.charAt(a)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return b};d.decode=function(e){var b="",a,c,g,m,k,l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<e.length;)a=this._keyStr.indexOf(e.charAt(l++)),
c=this._keyStr.indexOf(e.charAt(l++)),m=this._keyStr.indexOf(e.charAt(l++)),k=this._keyStr.indexOf(e.charAt(l++)),a=a<<2|c>>4,c=(c&15)<<4|m>>2,g=(m&3)<<6|k,b+=String.fromCharCode(a),64!=m&&(b+=String.fromCharCode(c)),64!=k&&(b+=String.fromCharCode(g));return b=d._utf8_decode(b)};d._utf8_encode=function(d){d=d.replace(/\r\n/g,"\n");for(var b="",a=0;a<d.length;a++){var c=d.charCodeAt(a);128>c?b+=String.fromCharCode(c):(127<c&&2048>c?b+=String.fromCharCode(c>>6|192):(b+=String.fromCharCode(c>>12|224),
b+=String.fromCharCode(c>>6&63|128)),b+=String.fromCharCode(c&63|128))}return b};d._utf8_decode=function(d){for(var b="",a=0,c=0,e=0,h=0;a<d.length;)c=d.charCodeAt(a),128>c?(b+=String.fromCharCode(c),a++):191<c&&224>c?(e=d.charCodeAt(a+1),b+=String.fromCharCode((c&31)<<6|e&63),a+=2):(e=d.charCodeAt(a+1),h=d.charCodeAt(a+2),b+=String.fromCharCode((c&15)<<12|(e&63)<<6|h&63),a+=3);return b};d._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return d}();d.Base64=e})(utils||
(utils={}));(function(d){(function(d){(function(d){var e=function(){function b(){}b.MAX_CSV=1048576;b.MAX_JSON=1048576;return b}();d.Limitations=e})(d.license||(d.license={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){(function(e){(function(h){var f=function(){function a(){}a.UNDEFINED="UNDEFINED";a.START_REPORT="START_REPORT";a.OPENING_REPORT_FILE="OPENING_REPORT_FILE";a.LOADING_REPORT_FILE="LOADING_REPORT_FILE";a.REPORT_FILE_LOADED="REPORT_FILE_LOADED";a.REPORT_FILE_ERROR="REPORT_FILE_ERROR";a.REPORT_FILE_CANCELLED="REPORT_FILE_CANCELLED";a.REPORT_CHANGED="REPORT_CHANGED";a.REPORT_DEFINED="REPORT_DEFINED";a.LOADING_DATA="LOADING_DATA";a.DATA_LOADED="DATA_LOADED";a.DATA_ERROR="DATA_ERROR";a.DATA_FILE_CANCELLED=
"DATA_FILE_CANCELLED";a.CONNECTED_TO_DATA_SOURCE="CONNECTED_TO_DATA_SOURCE";a.EMPTY_SLICE="EMPTY_SLICE";a.REBASE_CONNECTION="REBASE_CONNECTION";a.RUNNING_QUERY="RUNNING_QUERY";a.QUERY_COMPLETE="QUERY_COMPLETE";a.QUERY_ERROR="QUERY_ERROR";a.LOADING_LOCALIZATION="LOADING_LOCALIZATION";a.LOCALIZATION_LOADED="LOCALIZATION_LOADED";a.LOCALIZATION_ERROR="LOCALIZATION_ERROR";a.REPORT_COMPLETE="REPORT_COMPLETE";return a}();h.StateEvent=f;var b=function(){function a(){}a.UNDEFINED="UNDEFINED";a.INIT="INIT";
a.CLEAR="CLEAR";a.SET_REPORT="SET_REPORT";a.RUN_QUERY="RUN_QUERY";a.UPDATE_DATA="UPDATE_DATA";a.UPDATE_DATA_PARTIAL="UPDATE_DATA_PARTIAL";a.CONNECT_TO="CONNECT_TO";a.LOAD="LOAD";a.OPEN="OPEN";a.COMPLETE="COMPLETE";return a}();h.ReportType=b;var a=function(a){function g(){var g=a.call(this)||this;g.cube_=d.data_.Cube.getInstance();g._globalLocalization=null;g.reportType=b.UNDEFINED;g.reportState=f.UNDEFINED;g._isReportComplete=!1;g._isReportDefined=!1;g.updateActive=!1;g.connectedToDataSourceHandler=
function(){return g.onConnectedToDataSource()};g.structureLoadedHandler=function(){return g.onStructureLoaded()};g.dataFileCancelledHandler=function(){return g.onDataFileCancelled()};g.structureLoadingFailedHandler=function(){return g.onStructureLoadingFailed()};g.beforeQueryHandler=function(){return g.onBeforeQuery()};g.queryCompleteHandler=function(){return g.onQueryComplete()};g.queryErrorHandler=function(){return g.onQueryError()};g.reportManager=new e.report.ReportManager;e._options.OptionsManager.getInstance();
return g}__extends(g,a);Object.defineProperty(g.prototype,"connectionInfo_",{get:function(){return utils.nullOrUndefined(this._connectionInfo)||this._connectionInfo.isEmpty?this._globalConnectionInfo:this._connectionInfo},set:function(a){this._connectionInfo=a},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"isReportComplete",{get:function(){return this._isReportComplete},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"isReportDefined",{get:function(){return this._isReportDefined},
enumerable:!0,configurable:!0});g.prototype.init=function(a){var c=this;utils.nullOrUndefined(a)&&(a={});this.reportType=b.INIT;this.globalReport=utils.nullOrUndefined(a.global)?{}:utils.ObjectUtils.deepCopy(a.global);this.setReportState(f.START_REPORT);e._options.OptionsManager.getInstance().addEventListener(f.REPORT_CHANGED,function(){return c.dispatchReportChange()});e.sizes.SizesManager.getInstance().addEventListener(f.REPORT_CHANGED,function(){return c.dispatchReportChange()});e.condition.ConditionManager.getInstance().addEventListener(f.REPORT_CHANGED,
function(){return c.dispatchReportChange()});null!=d._view.PivotView.stage.getToolbar()&&utils.fmSetTimeout(function(){d._view.PivotView.stage.getToolbar().updateDataSourceType()},1);this.globalReportVO=e.report.ReportValueObject.fromObject(this.globalReport);this.spreadGlobal(this.globalReportVO);this.applyEmptyState();if("string"==typeof a.report)this._load(a.report);else{var g=a.report||{};e._options.OptionsManager.setOptions(e._options.vo.OptionsValueObject.fromObject(null!=g.options?g.options:
g));utils.fmSetTimeout(function(){c.reportType==b.INIT&&c._setReport(a.report||{})},1)}};g.prototype.setReportState=function(a){this.reportState=a;if(a==f.START_REPORT||a==f.OPENING_REPORT_FILE||a==f.LOADING_REPORT_FILE)this._isReportDefined=this._isReportComplete=!1;a==f.REPORT_COMPLETE&&(this._isReportDefined=this._isReportComplete=!0);a==f.REPORT_DEFINED&&(this._isReportDefined=!0);this.dispatchWith(a)};g.prototype.setReport=function(a){utils.nullOrUndefined(a)&&(a={});this.reportType=b.SET_REPORT;
this.cancel();this.setReportState(f.START_REPORT);this._setReport(a.report||{})};g.prototype.runQuery=function(a){this.reportType=b.RUN_QUERY;a=a instanceof d.data_._structure.Slice?a:d.data_._structure.Slice.fromObject(e.report.SliceValueObject.fromObject(a),this.cube_.structure_);var c=d.data_._structure.Slice.areRowsDiffer(a,this.cube_.slice_,!1),g=d.data_._structure.Slice.areColumnsDiffer(a,this.cube_.slice_,!1);!d.data_._structure.Slice.areMeasuresDiffer(a,this.cube_.slice_)||c||g||e.sizes.SizesManager.applySizes(e.sizes.SizesManager.rowSizesNamed,
e.sizes.SizesManager.columnSizesNamed,e.sizes.SizesManager.rowSizesByIdx,e.sizes.SizesManager.columnSizesByIdx,e.sizes.SizesManager.rowHeaderSizes,e.sizes.SizesManager.columnHeaderSizes,e.sizes.SizesManager.rowFilterSizes);c&&(e.sizes.SizesManager.rowSizes={});g&&(e.sizes.SizesManager.columnSizes={});a.mergeExpandsAndDrills(this.cube_.slice_);e.JavaScriptHandlers.getInstance().dispatch(new e.APIEvent(e.JavaScriptHandlers.REPORT_CHANGE));this.setReportState(f.RUNNING_QUERY);this.cube_.setSlice(a);
this.cube_.filter()};g.prototype.updateData=function(a,c){this.reportType=b.UPDATE_DATA;this.cancel();this.setReportState(f.START_REPORT);var g=this.getReport();c.ignoreSorting&&(g.slice.columnSorting={},g.slice.rowSorting={});if(c.ignoreScroll){var h=this.cube_.slice_;this.cube_.setSlice(d.data_._structure.Slice.fromObject(e.report.SliceValueObject.fromObject({}),this.cube_.structure_));this.cube_.setSlice(h)}g.connectionInfo=d.data_.vo.ConnectionInfo.fromObject(a);this._setReport(g,!0)};g.prototype.updateDataPartial=
function(a,c){var g=this;this.reportType=b.UPDATE_DATA_PARTIAL;this.cancel();this.setReportState(f.START_REPORT);c.ignoreSorting&&(this.reportVO.slice.columnSorting={},this.reportVO.slice.rowSorting={});if(c.ignoreScroll){var h=this.cube_.slice_;this.cube_.setSlice(d.data_._structure.Slice.fromObject(e.report.SliceValueObject.fromObject({}),this.cube_.structure_));this.cube_.setSlice(h)}this.reportVO.connectionInfo.data=a;this.cube_.updateData(a);this.addDataListeners();d.data_.dataprovider_.DataProviderFactory.getDataProvider().reset(!1);
this.updateActive=!0;utils.fmSetTimeout(function(){g.updateActive=!1},500);this.cube_.filter()};g.prototype.connectTo=function(a){this.reportType=b.CONNECT_TO;this.cancel();this.setReportState(f.START_REPORT);this._setReport(a)};g.prototype.load=function(a){this.reportType=b.LOAD;this.cancel();this._load(a)};g.prototype._load=function(a){var b=this;this.setReportState(f.LOADING_REPORT_FILE);this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_LOADED,function(a){return b.onReportFileLoaded(a)});
this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_FAILED,function(){return b.onReportFileFailed()});this.reportManager.load(a)};g.prototype.open=function(){var a=this;this.reportType=b.OPEN;this.setReportState(f.OPENING_REPORT_FILE);this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_LOADED,function(b){return a.onReportFileLoaded(b)});this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_FAILED,function(){return a.onReportFileFailed()});this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_CANCELLED,
function(){return a.onReportFileCancelled()});this.reportManager.open()};g.prototype.onReportFileLoaded=function(a){d.preloader(!1);this.setReportState(f.REPORT_FILE_LOADED);this._setReport(a.report)};g.prototype.onReportFileFailed=function(){d.preloader(!1);this.setReportState(f.REPORT_FILE_ERROR);this.setReportState(f.REPORT_DEFINED);this.setReportState(f.REPORT_COMPLETE)};g.prototype.onReportFileCancelled=function(){this.setReportState(f.REPORT_FILE_CANCELLED);this.setReportState(f.REPORT_DEFINED);
this.setReportState(f.REPORT_COMPLETE)};g.prototype.dispatchReportChange=function(){this.reportState!=f.REPORT_COMPLETE&&this.reportState!=f.QUERY_COMPLETE||e.JavaScriptHandlers.getInstance().dispatch(new e.APIEvent(e.JavaScriptHandlers.REPORT_CHANGE))};g.prototype._setReport=function(a,b){void 0===b&&(b=!1);this.reportVO=e.report.ReportValueObject.fromObject(a);this.reportVO.connectionInfo.isUpdateData=b;this.loadLocalization()};g.prototype.onReportComplete=function(){this.reportType=b.COMPLETE};
g.prototype.getReport=function(a){void 0===a&&(a={});return h.vo.StateValueObject.toReport(this.getCurrentState(a))};g.prototype.clear=function(){this.cancel();this.reportType=b.CLEAR;this.applyEmptyState();this.cube_.cancel();this.setReportState(f.REPORT_COMPLETE)};g.prototype.cancel=function(){this.reportManager.cancel();this.removeDataListeners();this.updateActive=!1;d.preloader(!1)};g.prototype.loadLocalization=function(){var a=this;if(null!=this.globalReport.localization&&""!=this.globalReport.localization)this.setReportState(f.LOADING_LOCALIZATION),
e._labels.LabelsManager.getInstance().load(this.globalReport.localization,function(b){return a.onGlobalLocalizationLoaded(b)},!0),this.globalReport.localization=null;else this.onGlobalLocalizationLoaded(!0)};g.prototype.onGlobalLocalizationLoaded=function(a){var b=this;null==this.reportVO.localization||""==this.reportVO.localization?(e._labels.LabelsManager.getInstance().reset(),this.onLocalizationLoaded(a)):(this.setReportState(f.LOADING_LOCALIZATION),e._labels.LabelsManager.getInstance().load(this.reportVO.localization,
function(a){return b.onLocalizationLoaded(a)}))};g.prototype.onLocalizationLoaded=function(a){a?this.setReportState(f.LOCALIZATION_LOADED):this.setReportState(f.LOCALIZATION_ERROR);this.loadStructureAndData()};g.prototype.loadStructureAndData=function(){this.reportType!=b.CONNECT_TO&&this.reportType!=b.OPEN&&(this.applyEmptyState(),e._options.OptionsManager.setOptions(this.reportVO.options),e._options.OptionsManager.configuratorOpened=e._options.OptionsManager.configuratorActive);var a=this.reportType;
this.setReportState(f.REPORT_DEFINED);a==this.reportType&&(a=this.reportVO.connectionInfo,!utils.nullOrUndefined(this.connectionInfo_)&&!this.connectionInfo_.isEmpty&&this.connectionInfo_.isEqual(a)&&this.cube_.connectionInfo_&&this.cube_.structure_&&this.cube_.structure_.isComplete?(d.data_.dataprovider_.DataProviderFactory.getDataProvider(),this.addDataListeners(),this.cube_.rebaseConnection()):(a.isEmpty&&this._globalConnectionInfo&&!this._globalConnectionInfo.isEmpty&&(a=this._globalConnectionInfo),
a.isEmpty?(this.connectionInfo_=a,this.cube_.cancel(),this.setReportState(f.REPORT_COMPLETE),d.preloader(!1)):(a.isInlineData||this.setReportState(f.LOADING_DATA),d.data_.dataprovider_.DataProviderFactory.getDataProvider(),this.addDataListeners(),this.cube_.connect(a))))};g.prototype.onConnectedToDataSource=function(a){this.reportType==b.CONNECT_TO&&(this.applyEmptyState(),this.cube_.slice_&&this.cube_.slice_.clear(),this.cube_.structure_&&this.cube_.structure_.clear());this.setReportState(f.CONNECTED_TO_DATA_SOURCE);
this.connectionInfo_=this.reportVO.connectionInfo};g.prototype.onStructureLoaded=function(a){a=d.data_._structure.Slice.fromObject(this.reportVO.slice,this.cube_.structure_);this.applyReport();this.cube_.setSlice(a);this.setReportState(f.DATA_LOADED);this.cube_.filter()};g.prototype.onDataFileCancelled=function(){this.setReportState(f.DATA_FILE_CANCELLED);this.setReportState(f.REPORT_COMPLETE)};g.prototype.onStructureLoadingFailed=function(){e._options.OptionsManager.setOptions(this.reportVO.options);
this.cube_.cancel();d.preloader(!1);this.setReportState(f.DATA_ERROR);this.setReportState(f.REPORT_COMPLETE)};g.prototype.onBeforeQuery=function(){this.setReportState(f.RUNNING_QUERY)};g.prototype.onQueryComplete=function(){this.setReportState(f.QUERY_COMPLETE);this.reportState!=f.REPORT_COMPLETE&&this.setReportState(f.REPORT_COMPLETE)};g.prototype.onQueryError=function(){this.setReportState(f.QUERY_ERROR);this.reportState!=f.REPORT_COMPLETE&&this.setReportState(f.REPORT_COMPLETE)};g.prototype.addDataListeners=
function(){var a=this;this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_CONNECTED,this.connectedToDataSourceHandler);this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_LOADED,this.structureLoadedHandler);this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_CANCELLED,this.dataFileCancelledHandler);this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_LOADING_FAILED,this.structureLoadingFailedHandler);this.cube_.addEventListener(d.data_.DataEvent.BEFORE_QUERY,this.beforeQueryHandler);
this.cube_.addEventListener(d.data_.DataEvent.QUERY_COMPLETE,this.queryCompleteHandler);this.cube_.addEventListener(d.data_.DataEvent.QUERY_ERROR,this.queryErrorHandler);this.cube_.addEventListener(f.REPORT_CHANGED,function(){return a.dispatchReportChange()})};g.prototype.removeDataListeners=function(){this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_CONNECTED,this.connectedToDataSourceHandler);this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_LOADED,this.structureLoadedHandler);
this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_CANCELLED,this.dataFileCancelledHandler);this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_LOADING_FAILED,this.structureLoadingFailedHandler);this.cube_.removeEventListener(d.data_.DataEvent.BEFORE_QUERY,this.beforeQueryHandler);this.cube_.removeEventListener(d.data_.DataEvent.QUERY_COMPLETE,this.queryCompleteHandler);this.cube_.removeEventListener(d.data_.DataEvent.QUERY_ERROR,this.queryErrorHandler)};g.prototype.save=function(a,
b,c,d,e){void 0===e&&(e=!1);return this.reportManager.save(a,b,c,d,e,this.getReport(a instanceof Object?a:{}))};g.prototype.getCurrentState=function(a){var b=a.hasOwnProperty("withDefaults")?!0==a.withDefaults:!1;a=a.hasOwnProperty("withGlobals")?!0==a.withGlobals:!1;var c=new h.vo.StateValueObject;c.withDefaults=b;c.withGlobals=a;c._connectionInfo=a&&this._connectionInfo.isEmpty&&!this._globalConnectionInfo.isEmpty?this._globalConnectionInfo:this._connectionInfo;c._structure=this.cube_.structure_;
c._slice=this.cube_.slice_;c._options=e._options.OptionsManager.getOptions(b,a);c.formats=e.format.FormatManager.getAllFormats();c.conditions=e.condition.ConditionManager.conditions;c.customFields=e.report.CustomFieldsManager.customFields;c.rowSizes=e.sizes.SizesManager.rowSizesNamed;c.columnSizes=e.sizes.SizesManager.columnSizesNamed;c.startTableRow=e.sizes.SizesManager.startTableRow;c.rowHeaderSizes=e.sizes.SizesManager.rowHeaderSizes;c.columnHeaderSizes=e.sizes.SizesManager.columnHeaderSizes;c.rowFilterSizes=
e.sizes.SizesManager.rowFilterSizes;c.expandedRows=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.ROWS_AXIS).expandedTuplesBasedOnUniqueNames:[];c.expandedColumns=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.COLUMNS_AXIS).expandedTuplesBasedOnUniqueNames:[];c.drilledRows=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.ROWS_AXIS).drilledTuplesBasedOnUniqueNames:[];c.drilledColumns=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.COLUMNS_AXIS).drilledTuplesBasedOnUniqueNames:
[];this.reportVO&&(c.localization=a&&null==this.reportVO.localization&&null!=this._globalLocalization?this._globalLocalization:this.reportVO.localization);return c};g.prototype.spreadGlobal=function(a){this._globalConnectionInfo=a.connectionInfo;e._options.OptionsManager.setGlobalOptions(a.options);this._globalLocalization=a.localization};g.prototype.applyEmptyState=function(){d.data_.dataprovider_.DataProviderFactory.dispose();e.sizes.SizesManager.clear();e.condition.ConditionManager.removeAll();
e.format.FormatManager.clear();e.report.CustomFieldsManager.customFields=[];e._options.OptionsManager.clear()};g.prototype.applyReport=function(){e._options.OptionsManager.setOptions(this.reportVO.options);e.sizes.SizesManager.clear();e.sizes.SizesManager.applySizes(this.reportVO.rowSizes,this.reportVO.columnSizes,this.reportVO.rowSizesByIdx,this.reportVO.columnSizesByIdx,this.reportVO.rowHeaderSizes,this.reportVO.columnHeaderSizes,this.reportVO.rowFilterSizes);var a;e.condition.ConditionManager.removeAll();
for(a=0;a<this.reportVO.conditions.length;a++){var b=e.condition.vo.ConditionValueObject.fromObject(this.reportVO.conditions[a]);e.condition.ConditionManager.add(b)}e.format.FormatManager.clear();for(a=0;a<this.reportVO.formats.length;a++)e.format.FormatManager.setFormat(this.reportVO.formats[a]);e.report.CustomFieldsManager.customFields=this.reportVO.customFields};g.prototype.dispose=function(){this.cancel();e.condition.ConditionManager.dispose();e._options.OptionsManager.dispose();e.printing.PrintingManager.dispose();
e.integration.IntegrationDataManager.dispose();e._labels.LabelsManager.dispose();e.sizes.SizesManager.dispose();e.format.FormatManager.dispose();e.report.CustomFieldsManager.customFields=[];this._connectionInfo=this.reportManager=null;this.globalReport={};this.cube_=this.reportVO=this.globalReportVO=null};return g}(events.EventDispatcher);h.StateManager=a})(e._state||(e._state={}))})(d.model||(d.model={}))})(pivot||(pivot={}));
(function(d){var e=function(){function d(){}d.CONTENT_TYPES_XML='<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>{0}</Types>';d.CONTENT_TYPES_XML_SHEET=
'<Override PartName="{0}" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>';d._RELS='<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>';
d.APP_XML='<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>3</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="3" baseType="lpstr"><vt:lpstr>Sheet1</vt:lpstr><vt:lpstr>Sheet2</vt:lpstr><vt:lpstr>Sheet3</vt:lpstr></vt:vector></TitlesOfParts><Company>Amazon.com</Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>14.0300</AppVersion></Properties>';
d.CORE_XML='<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>EC2</dc:creator><cp:lastModifiedBy>EC2</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">2010-12-22T15:19:38Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2010-12-22T15:20:08Z</dcterms:modified></cp:coreProperties>';
d.WORKBOOK_XML='<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9302"/><workbookPr defaultThemeVersion="124226"/><bookViews><workbookView xWindow="360" yWindow="210" windowWidth="16860" windowHeight="9150"/></bookViews><sheets>{0}</sheets><calcPr calcId="144525"/></workbook>';d.WORKBOOK_XML_RELS='<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>{0}</Relationships>';
d.WORKBOOK_XML_RELS_SHEET='<Relationship Id="{0}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="{1}"/>';d.THEME='<a:theme name="Office Theme" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F497D"/></a:dk2><a:lt2><a:srgbClr val="EEECE1"/></a:lt2><a:accent1><a:srgbClr val="4F81BD"/></a:accent1><a:accent2><a:srgbClr val="C0504D"/></a:accent2><a:accent3><a:srgbClr val="9BBB59"/></a:accent3><a:accent4><a:srgbClr val="8064A2"/></a:accent4><a:accent5><a:srgbClr val="4BACC6"/></a:accent5><a:accent6><a:srgbClr val="F79646"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Cambria"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af"/><a:font script="Hang" typeface="\ub9d1\uc740 \uace0\ub515"/><a:font script="Hans" typeface="\u5b8b\u4f53"/><a:font script="Hant" typeface="\u65b0\u7d30\u660e\u9ad4"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface ="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af"/><a:font script="Hang" typeface="\ub9d1\uc740 \uace0\ub515"/><a:font script="Hans" typeface="\u5b8b\u4f53"/><a:font script="Hant" typeface="\u65b0\u7d30\u660e\u9ad4"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface ="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:shade val="51000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="80000"><a:schemeClr val="phClr"><a:shade val="93000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="94000"/><a:satMod val="135000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:spDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style></a:spDef><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/></a:theme>';
d.STYLES_XML='<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">{0}<fonts count="{1}" x14ac:knownFonts="1"><font><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font>{2}</fonts><fills count="{3}">{4}</fills><borders count="2"><border><left/><right/><top/><bottom/><diagonal/></border><border><left style="thin"><color theme="0" tint="-0.14996795556505021"/></left><right style="thin"><color theme="0" tint="-0.14996795556505021"/></right><top style="thin"><color theme="0" tint="-0.14996795556505021"/></top><bottom style="thin"><color theme="0" tint="-0.14996795556505021"/></bottom><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="{5}"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>{6}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext></extLst></styleSheet>';
d.SHARED_STRING_XML='<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="5" uniqueCount="5">{0}</sst>';d.SHEET_XML='<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><dimension ref="{0}"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"><selection activeCell="A1" sqref="A1"/></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15" defaultColWidth="15" x14ac:dyDescent="0.25"/><cols>{1}</cols><sheetData>{2}</sheetData>{3}<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>';
d.XML_HEADER='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';return d}();d.XLSTemplates=e})(xls||(xls={}));
(function(d){(function(e){var h=function(f){function b(){var a=f.call(this)||this;a.queryType=e.consts.QueryType.SELECT;if(null!=b.instance)throw Error("Singleton");return a}__extends(b,f);b.getInstance=function(){void 0==b.instance&&(b.instance=new b);return b.instance};b.prototype.setSlice=function(a){a.isEmpty&&d.model._options.OptionsManager.showDefaultSlice&&a.makeDefault();a&&!a.isEqual(this.slice_)&&this.dispatchWith("slice_changed");this.slice_=a};b.prototype.rebaseConnection=function(){this.structure_&&
(this.structure_.isComplete=!1,this.removeAllCalculatedMeasures());for(var a=this.structure_.allHierarchies(!1),b=0;b<a.length;b++){var e=a.getItemAt(b);e.clearFilter();e.clearSort(d.model._options.OptionsManager.flatView)}this.slice_&&this.slice_.clear();this.dispatchStructureLoaded()};b.prototype.connect=function(a){var b=this;utils.nullOrUndefined(this.__structureLoader)||this.__structureLoader.cancel();this.__structureLoader=e.StructureLoaderFactory.getStructureLoader(a);this.__structureLoader.load(a,
function(){return b.dispatchStructureLoaded()},function(){b.dispatchWith(e.DataEvent.STRUCTURE_LOADING_FAILED)},function(){b.cancel(!1);b.connectionInfo_=a;b.structureLoader=b.__structureLoader;b.localDataStorage=new e.LocalDataStorage(b);b.__structureLoader=null;b.localDataStorage.datePattern=d.model._options.OptionsManager.datePattern;b.localDataStorage.dateTimePattern=d.model._options.OptionsManager.dateTimePattern;null!=b.structure_&&b.structure_.clear();b.structure_=new e._structure.GenericStructure;
b.structure_.localDataStorage=b.localDataStorage;b.dispatchWith(e.DataEvent.STRUCTURE_CONNECTED)},function(){b.dispatchWith(e.DataEvent.STRUCTURE_CANCELLED)})};b.prototype.dispatchStructureLoaded=function(){this.structure_.isComplete=!0;this.dispatchWith(e.DataEvent.STRUCTURE_LOADED)};b.prototype.cancel=function(a){void 0===a&&(a=!0);utils.ThreadManager.isRunning()&&utils.ThreadManager.cancel();this.structureLoader&&(this.structureLoader.cancel(),this.structureLoader=null);a&&this.structure_&&(this.structure_.clear(),
this.structure_=null);a&&this.slice_&&(this.slice_.clear(),this.slice_=null);a&&this.localDataStorage&&(this.localDataStorage.clearAll(),this.localDataStorage=null)};b.prototype.dispatchQueryComplete=function(){var a=new e.QueryCompleteEvent(this.queryType);this.dispatch(a)};b.prototype.dispatchQueryError=function(){this.dispatchWith(e.DataEvent.QUERY_ERROR)};b.prototype.filter=function(){this.queryType=e.consts.QueryType.FILTER;this.select()};b.prototype.clearSortValues=function(a){a.sortMeasure=
null;a.sortTuple=null;a.sortType=e.consts.SortType.UNSORTED;a.totalSortType=e.consts.SortType.UNSORTED;a.totalSortMeasure=null};b.prototype.sort=function(){this.dispatchQueryComplete()};b.prototype.expand=function(a,b,d,f){void 0===d&&(d=null);void 0===f&&(f=!0);this._tuple=a;this._axisName=b;this._measure=d;this.queryType=e.consts.QueryType.EXPAND;var h=new e.BeforeQueryEvent(e.consts.QueryType.EXPAND);this.dispatch(h);this.localDataStorage.expand(a,b,d);f&&this.dispatchQueryComplete()};b.prototype.collapse=
function(a,b,d,f){void 0===d&&(d=null);void 0===f&&(f=!0);this.localDataStorage.collapse(a,b,d);this.query=new e.Query;this.queryType=this.query.type=e.consts.QueryType.COLLAPSE;f&&this.dispatchQueryComplete()};b.prototype.drillDown=function(a,b,d,f){void 0===f&&(f=null);this._tuple=a;this._axisName=d;this._measure=f;this._member=b;this._levelName=void 0;b.hierarchy_.drillDownMember(b);this.queryType=e.consts.QueryType.DRILL_DOWN;var h=new e.BeforeQueryEvent(e.consts.QueryType.DRILL_DOWN);this.dispatch(h);
this.localDataStorage.drillDown(a,b,d,f);this.dispatchQueryComplete()};b.prototype.drillUp=function(a,b,d,f){void 0===f&&(f=null);b.hierarchy_.drillUpMember(b);this.localDataStorage.drillUp(a,b,d,f);this.query=new e.Query;this.queryType=this.query.type=e.consts.QueryType.DRILL_UP;a=new e.BeforeQueryEvent(e.consts.QueryType.DRILL_UP);this.dispatch(a);this.dispatchQueryComplete()};b.prototype.select=function(){var a=new e.BeforeQueryEvent(this.queryType==e.consts.QueryType.FILTER?this.queryType:e.consts.QueryType.SELECT);
this.dispatch(a);for(a=0;a<this.slice_.pages.length;a++)this.slice_.pages.getItemAt(a).clearValuesFilter();this.structure_.measures_.length>this.localDataStorage.factKeys.length&&this.addCalculatedMeasuresToDataStorage();this.localDataStorage.filter();this.localDataStorage.select();this.dispatchQueryComplete()};b.prototype.addCalculatedMeasuresToDataStorage=function(){for(var a=0;a<this.structure_.measures_.length;a++){var b=this.structure_.measures_.getItemAt(a);if(b.calculated){for(var d=!0,e=0;e<
this.localDataStorage.factKeys.length;e++)this.localDataStorage.factKeys[e].toString()==b.uniqueName&&(d=!1);d&&this.localDataStorage.addFactKey(b.uniqueName,b.params,b.individual)}}this.slice_.axisWithMeasures.sortToSet&&(a=this.slice_.axisWithMeasures.sortToSet,(b=this.structure_.findMeasure(a.measure))&&this.slice_.axisWithMeasures.setSort(b,a.tuple,a.type))};b.prototype.addCalculatedMeasure=function(a){if(null==this.structure_.findMeasure(a.uniqueName)){if(a.calculated){var b=new utils.Lexer;
a.params=b.parse(a.formula)}a.calculated&&null==a.params||(this.structure_.measuresHierarchy&&this.structure_.addMeasure(a),a.calculated?this.localDataStorage.addFactKey(a.uniqueName,a.params,a.individual):this.localDataStorage.addFactKey(a.uniqueName),this.structure_.isComplete&&this.refresh())}else b=new utils.Lexer,a.params=b.parse(a.formula),a.calculated&&null==a.params||(this.localDataStorage.updateFactKey(a.uniqueName,a.params,a.individual),b=this.structure_.findMeasure(a.uniqueName),b.caption=
a.caption,b.formula=a.formula,b.individual=a.individual,b.params=a.params,this.structure_.isComplete&&this.refresh())};b.prototype.removeCalculatedMeasure=function(a,b){void 0===b&&(b=!0);var d=this.structure_.findMeasure(a);d&&d.calculated&&(this.structure_.removeMeasure(a),this.localDataStorage.removeFactKey(a),this.slice_.removeMeasure(a),b&&this.structure_.isComplete&&this.refresh())};b.prototype.removeAllCalculatedMeasures=function(){for(var a=0;a<this.structure_.measures_.length;){var b=this.structure_.measures_.getItemAt(a);
b.calculated?this.removeCalculatedMeasure(b.uniqueName,!1):a++}this.structure_.isComplete&&this.refresh()};b.prototype.refresh=function(){this.structure_.isComplete?(this.connectionInfo_.dataSourceType==e.consts.DataSourceType.EMPTY&&utils.nullOrUndefined(this.slice_)&&this.dispatchStructureLoaded(),this.filter()):this.connectionInfo_.dataSourceType==e.consts.DataSourceType.EMPTY&&this.dispatchStructureLoaded()};b.prototype.loadMemberChildren=function(a,b,d){var e=this;this.structureLoader.loadMemberChildren(a,
b,d,function(){return e.dispatchQueryError()})};b.prototype.updateData=function(a){this.structureLoader.updateData(a);this.dispatchStructureLoaded()};b.prototype.dispose=function(){utils.ThreadManager.dispose();try{this.structure_.clear()}catch(a){}this.slice_=this.structure_=null;try{this.localDataStorage.clearAll()}catch(c){}this.localDataStorage=null;try{this.structureLoader.cancel()}catch(d){}this.structureLoader=null;try{this.__structureLoader.cancel()}catch(e){}this.__structureLoader=null;b.instance=
null};b.MEASURES_NAME="Measures";return b}(events.EventDispatcher);e.Cube=h})(d.data_||(d.data_={}))})(pivot||(pivot={}));
(function(d){var e=function(){function e(b,a){var c=this;this.isCreationComplete=!1;this.api=null;this.delayedApiCallsOnReportDefined=[];this.delayedApiCallsOnReportReady=[];null!=e.instance&&e.instance.dispose();e.instance=this;this.api=a;utils.nullOrUndefined(b)&&(b={});if(!1!=utils.isHTML5Supported()||!1!=confirm("WebDataRocks Reporting Component is not completely supported by this version of browser. Please update your browser. Continue anyway?")){var g;b.container instanceof HTMLElement?g=b.container:
utils.nullOrUndefined(b.container)||(g="#"==b.container.substr(0,1)?b.container.substring(1):b.container,g=document.getElementById(g));null==g?(g=!1==utils.nullOrEmpty(b.container)?"WebDataRocks Reporting Component:\nUnable to create the component. DOM element with id '"+b.container+"' is not found.":"WebDataRocks Reporting Component:\nUnable to create the component. DOM element is null.",console.error(g),alert(g)):(this.model_=d.model.PivotModel.getInstance(),this.model_.state_.addEventListener(d.model._state.StateEvent.OPENING_REPORT_FILE,
function(){return c.onOpeningReportFile()}),this.model_.state_.addEventListener(d.model._state.StateEvent.LOADING_REPORT_FILE,function(){return c.onLoadingReportFile()}),this.model_.state_.addEventListener(d.model._state.StateEvent.REPORT_FILE_LOADED,function(){return c.onReportFileLoaded()}),this.model_.state_.addEventListener(d.model._state.StateEvent.REPORT_FILE_ERROR,function(){return c.onReportFileError()}),this.model_.state_.addEventListener(d.model._state.StateEvent.REPORT_FILE_CANCELLED,function(){return c.onReportFileCancelled()}),
this.model_.state_.addEventListener(d.model._state.StateEvent.REPORT_DEFINED,function(){return c.onReportDefined()}),this.model_.state_.addEventListener(d.model._state.StateEvent.LOADING_DATA,function(){return c.onLoadingData()}),this.model_.state_.addEventListener(d.model._state.StateEvent.DATA_LOADED,function(){return c.onDataLoaded()}),this.model_.state_.addEventListener(d.model._state.StateEvent.DATA_ERROR,function(){return c.onDataError()}),this.model_.state_.addEventListener(d.model._state.StateEvent.DATA_FILE_CANCELLED,
function(){return c.onDataFileCancelled()}),this.model_.state_.addEventListener(d.model._state.StateEvent.LOADING_LOCALIZATION,function(){return c.onLoadingLocalization()}),this.model_.state_.addEventListener(d.model._state.StateEvent.LOCALIZATION_LOADED,function(){return c.onLocalizationLoaded()}),this.model_.state_.addEventListener(d.model._state.StateEvent.LOCALIZATION_ERROR,function(){return c.onLocalizationError()}),this.model_.state_.addEventListener(d.model._state.StateEvent.EMPTY_SLICE,function(){return c.onEmptySlice()}),
this.model_.state_.addEventListener(d.model._state.StateEvent.RUNNING_QUERY,function(){return c.onRunningQuery()}),this.model_.state_.addEventListener(d.model._state.StateEvent.QUERY_COMPLETE,function(){return c.onQueryComplete()}),this.model_.state_.addEventListener(d.model._state.StateEvent.QUERY_ERROR,function(){return c.onQueryError()}),this.model_.state_.addEventListener(d.model._state.StateEvent.REPORT_COMPLETE,function(){return c.onReportComplete()}),this.model_.addEventListener(h.EXPORT,function(){return c.onExportStart()}),
this.model_.addEventListener(h.EXPORT_COMPLETE,function(){return c.onExportComplete()}),this.model_.addEventListener(h.PRINT,function(){return c.onPrintStart()}),this.model_.addEventListener(h.PRINT_COMPLETE,function(){return c.onPrintComplete()}),this.view_=new d._view.PivotView(uicontrols.UIElement.convert(g),b),this.view_.addEventListener(d._view.ViewEvent.BEFORE_GRID_DRAW,function(a){return c.onBeforeGridDraw(a)}),this.view_.addEventListener(d._view.ViewEvent.RENDER_COMPLETE,function(){return c.onRenderComplete()}),
this.model_.init(b),this.isCreationComplete=!0)}}Object.defineProperty(e.prototype,"isReportComplete",{get:function(){return this.model_&&this.model_.state_&&this.model_.state_.isReportComplete},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"isReportDefined",{get:function(){return this.model_&&this.model_.state_&&this.model_.state_.isReportDefined},enumerable:!0,configurable:!0});e.prototype.runDelayedCalls=function(){var b=this;utils.fmSetTimeout(function(){for(;0<b.delayedApiCallsOnReportReady.length;)b.delayedApiCallsOnReportReady.shift().call(b)},
1)};e.prototype.delayApiCall=function(b,a){void 0===a&&(a=1);0==a?this.delayedApiCallsOnReportDefined.push(b):this.delayedApiCallsOnReportReady.push(b)};e.prototype.onOpeningReportFile=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.OPENING_REPORT_FILE))};e.prototype.onLoadingReportFile=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.LOADING_REPORT_FILE))};e.prototype.onReportFileLoaded=
function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.REPORT_FILE_LOADED))};e.prototype.onReportFileError=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.REPORT_FILE_ERROR))};e.prototype.onReportFileCancelled=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.REPORT_FILE_CANCELLED))};e.prototype.onReportDefined=function(){for(this.model_.state_.reportType==
d.model._state.ReportType.INIT&&utils.fmSetTimeout(function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.READY))},1);0<this.delayedApiCallsOnReportDefined.length;)this.delayedApiCallsOnReportDefined.shift().call(this)};e.prototype.onLoadingLocalization=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.LOADING_LOCALIZATION))};e.prototype.onLocalizationLoaded=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.LOCALIZATION_LOADED))};
e.prototype.onLocalizationError=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.LOCALIZATION_ERROR))};e.prototype.onLoadingData=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.LOADING_DATA))};e.prototype.onDataLoaded=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.DATA_LOADED))};e.prototype.onDataFileCancelled=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.DATA_FILE_CANCELLED))};
e.prototype.onDataError=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.DATA_ERROR))};e.prototype.onEmptySlice=function(){};e.prototype.onRunningQuery=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.RUNNING_QUERY))};e.prototype.onQueryComplete=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.QUERY_COMPLETE));d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.UPDATE))};
e.prototype.onQueryError=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.QUERY_ERROR))};e.prototype.onReportComplete=function(){};e.prototype.onBeforeGridDraw=function(b){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.BEFORE_GRID_DRAW,b.data))};e.prototype.onRenderComplete=function(){var b=this;this.isReportComplete&&this.model_.state_.reportType!=d.model._state.ReportType.COMPLETE&&utils.fmSetTimeout(function(){b.runDelayedCalls();
b.model_.state_.reportType=d.model._state.ReportType.COMPLETE;d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.REPORT_COMPLETE))},1)};e.prototype.onExportStart=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.EXPORT_START))};e.prototype.onExportComplete=function(){utils.fmSetTimeout(function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.EXPORT_COMPLETE))},
1)};e.prototype.onPrintStart=function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.PRINT_START))};e.prototype.onPrintComplete=function(){utils.fmSetTimeout(function(){d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.PRINT_COMPLETE))},1)};e.prototype.getAllConditions=function(){return this.isReportComplete?this.model_.getAllConditions():null};e.prototype.getCondition=function(b){return this.isReportComplete?
this.model_.getCondition(b):null};e.prototype.addCondition=function(b){var a=this;this.isReportComplete?null!=b&&this.model_.addCondition(b):this.delayApiCall(function(){return a.addCondition(b)})};e.prototype.removeCondition=function(b){var a=this;this.isReportComplete?this.model_.removeCondition(b):this.delayApiCall(function(){return a.removeCondition(b)})};e.prototype.removeAllConditions=function(){var b=this;this.isReportComplete?this.model_.removeAllConditions():this.delayApiCall(function(){return b.removeAllConditions()})};
e.prototype.open=function(){this.model_.open()};e.prototype.load=function(b){this.model_.load(b)};e.prototype.getReport=function(b){return this.model_.getReport(b).toObject()};e.prototype.setReport=function(b){if("string"==typeof b)try{b=JSON.parse(b)}catch(a){d.uialert(d.model._labels.Labels.MESSAGE_INVALID_REPORT_FORMAT,d.model._labels.Labels.ERROR,d.AlertType.ERROR);return}this.model_.setReport({report:b})};e.prototype.getData=function(b,a,c){var d=this;this.isReportComplete?this.model_.getData(b,
a,c):this.delayApiCall(function(){return d.getData(b,a,c)})};e.prototype.save=function(b,a,c,e,f){var h=this;void 0===b&&(b={filename:"report.json"});void 0===a&&(a=null);void 0===c&&(c=null);void 0===e&&(e=null);void 0===f&&(f=!1);var l=c;this.isReportComplete?(b instanceof Object&&b.hasOwnProperty("callbackHandler")&&(l=b.callbackHandler),null!=l&&"string"==typeof l&&(l=d.model.JavaScriptHandlers.getFunctionByName(l)),this.model_.save(b,a,null!=l?function(a){return l(a)}:null,e,f)):this.delayApiCall(function(){return h.save(b,
a,c,e,f)})};e.prototype.updateData=function(b,a){var c=this;null!=b&&(utils.nullOrUndefined(a)?a={partial:!1}:"boolean"==typeof a&&(a={partial:a}),this.isReportDefined?this.model_.updateData(b,a):this.delayApiCall(function(){return c.updateData(b,a)},0))};e.prototype.connectTo=function(b){var a=this;null!=b&&(this.isReportDefined?this.model_.connectTo(b):this.delayApiCall(function(){return a.connectTo(b)},0))};e.prototype.addCalculatedMeasure=function(b){var a=this;this.isReportComplete?null!=b&&
this.model_.addCalculatedMeasure(d.data_._structure.GenericMeasure.fromObject(b)):this.delayApiCall(function(){return a.addCalculatedMeasure(b)})};e.prototype.removeCalculatedMeasure=function(b){var a=this;this.isReportComplete?this.model_.removeCalculatedMeasure(b):this.delayApiCall(function(){return a.removeCalculatedMeasure(b)})};e.prototype.removeAllCalculatedMeasures=function(){var b=this;this.isReportComplete?this.model_.removeAllCalculatedMeasures():this.delayApiCall(function(){return b.removeAllCalculatedMeasures()})};
e.prototype.clear=function(){var b=this;this.isReportComplete?this.model_.clear():this.delayApiCall(function(){return b.clear()})};e.prototype.dispose=function(){utils.fmdocument.dispose();utils.fmwindow.dispose();utils.Timers.dispose();this.model_.dispose();this.view_.dispose();this.model_=this.view_=null;e.instance=null;d.model.JavaScriptHandlers.dispose()};e.prototype.refresh=function(){var b=this;this.isReportComplete?this.view_.draw():this.delayApiCall(function(){return b.refresh()})};e.prototype.expandAllData=
function(b){var a=this;void 0===b&&(b=!0);this.isReportComplete?this.model_.expandAllData(b):this.delayApiCall(function(){return a.expandAllData(b)})};e.prototype.expandData=function(b){var a=this;this.isReportComplete?this.model_.expandData(b):this.delayApiCall(function(){return a.expandData(b)})};e.prototype.collapseAllData=function(){var b=this;this.isReportComplete?this.model_.collapseAllData():this.delayApiCall(function(){return b.collapseAllData()})};e.prototype.collapseData=function(b){var a=
this;this.isReportComplete?this.model_.collapseData(b):this.delayApiCall(function(){return a.collapseData(b)})};e.prototype.print=function(b){var a=this;void 0===b&&(b=null);this.isReportComplete?this.model_.print(d.model.printing.PrintOptions.fromObject(b)):this.delayApiCall(function(){return a.print(b)})};e.prototype.exportTo=function(b,a,c){var e=this;void 0===a&&(a=null);void 0===c&&(c=null);if(this.isReportComplete){if(null!=b){null!=c&&"string"==typeof c&&(c=d.model.JavaScriptHandlers.getFunctionByName(c));
var f=null!=c?function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return c.apply(null,a)}:null;this.model_.exportTo(b,d.model._export.ExportOptions.fromObject(a),f)}}else this.delayApiCall(function(){return e.exportTo(b,a,c)})};e.prototype.getFilter=function(b){return this.isReportComplete?this.model_.getFilter(b):null};e.prototype.getFilterProperties=function(b){return this.isReportComplete?this.model_.getFilterProperties(b):null};e.prototype.setFilter=function(b,a,c){var d=this;
void 0===c&&(c=!1);this.isReportComplete?this.model_.setFilter(b,a,c):this.delayApiCall(function(){return d.setFilter(b,a,c)})};e.prototype.clearFilter=function(b){var a=this;this.isReportComplete?this.model_.clearFilter(b):this.delayApiCall(function(){return a.clearFilter(b)})};e.prototype.on=function(b,a){"string"==typeof a&&(a=d.model.JavaScriptHandlers.getFunctionByName(a));d.model.JavaScriptHandlers.getInstance().addEventListener(b,a)};e.prototype.off=function(b,a){"string"==typeof a&&(a=d.model.JavaScriptHandlers.getFunctionByName(a));
null==a?d.model.JavaScriptHandlers.getInstance().removeAllEventListeners(b):d.model.JavaScriptHandlers.getInstance().removeEventListener(b,a)};e.prototype.getRows=function(){return this.isReportComplete?this.model_.getRows():null};e.prototype.getColumns=function(){return this.isReportComplete?this.model_.getColumns():null};e.prototype.getPages=function(){return this.isReportComplete?this.model_.getPages():null};e.prototype.getMeasures=function(){return this.isReportComplete?this.model_.getMeasures():
null};e.prototype.getAllMeasures=function(){return this.isReportComplete?this.model_.getAllMeasures():null};e.prototype.sortValues=function(b,a,c,d){var e=this;this.isReportComplete?this.model_.sortValues(b,a,c,d):this.delayApiCall(function(){return e.sortValues(b,a,c,d)})};e.prototype.setSort=function(b,a){var c=this;this.isReportComplete?this.model_.setSort(b,a):this.delayApiCall(function(){return c.setSort(b,a)})};e.prototype.getSort=function(b){return this.isReportComplete?this.model_.getSort(b):
null};e.prototype.setTopX=function(b,a,c){var d=this;this.isReportComplete?this.model_.setTopX(b,a,c):this.delayApiCall(function(){return d.setTopX(b,a,c)})};e.prototype.setBottomX=function(b,a,c){var d=this;this.isReportComplete?this.model_.setBottomX(b,a,c):this.delayApiCall(function(){return d.setBottomX(b,a,c)})};e.prototype.getOptions=function(){return this.isReportComplete?this.model_.getOptions():null};e.prototype.setOptions=function(b){var a=this;this.isReportComplete?this.model_.setOptions(b):
this.delayApiCall(function(){return a.setOptions(b)})};e.prototype.getMembers=function(b,a,c){var e=this;if(this.isReportComplete)return"string"==typeof c&&(c=d.model.JavaScriptHandlers.getFunctionByName(c)),this.model_.getMembers(b,a,c);this.delayApiCall(function(){return e.getMembers(b,a,c)})};e.prototype.runQuery=function(b){var a=this;this.isReportComplete?null!=b&&this.model_.runQuery(b):this.delayApiCall(function(){return a.runQuery(b)})};e.prototype.getAllHierarchies=function(){return this.isReportComplete?
this.model_.getAllHierarchies():null};e.prototype.replaceHierarchyCaption=function(b){var a=this;this.isReportComplete?this.model_.replaceHierarchyCaption(b):this.delayApiCall(function(){return a.replaceHierarchyCaption(b)})};e.prototype.getFormat=function(b){return this.isReportComplete?this.model_.getFormat(b):null};e.prototype.setFormat=function(b,a){var c=this;this.isReportComplete?null!=b&&this.model_.setFormat(b,a):this.delayApiCall(function(){return c.setFormat(b,a)})};e.prototype.getCell=
function(b,a){return this.isReportComplete?this.view_.getCell(b,a):null};e.prototype.getSelectedCell=function(){return this.isReportComplete?this.view_.getSelectedCell():null};e.prototype.setSelectedCell=function(b,a){var c=this;this.isReportComplete?this.view_.setSelectedCell(b,a):this.delayApiCall(function(){return c.setSelectedCell(b,a)})};e.prototype.removeSelection=function(){var b=this;this.isReportComplete?this.view_.removeSelection():this.delayApiCall(function(){return b.removeSelection()})};
e.prototype.openFieldsList=function(){var b=this;this.isCreationComplete?this.view_.openFieldsList():this.delayApiCall(function(){return b.openFieldsList()})};e.prototype.closeFieldsList=function(){var b=this;this.isCreationComplete?this.view_.closeFieldsList():this.delayApiCall(function(){return b.closeFieldsList()})};e.prototype.customizeCell=function(b){d._view.grid.vo.GridCell.customizeCellFunction=b;this.isCreationComplete&&this.refresh()};e.BUILD_VERSION="Version 1.3.3";e.BUILD_DATE="97420653026663";
return e}();d.Pivot=e;var h=function(){function d(){}d.PRINT="print";d.PRINT_COMPLETE="printcomplete";d.EXPORT="export";d.EXPORT_COMPLETE="exportcomplete";return d}();d.PivotEvent=h})(pivot||(pivot={}));
function PivotApi(d){var e={version:pivot.Pivot.BUILD_VERSION},h=new pivot.Pivot(d,e);e.getAllConditions=function(){return h.getAllConditions()};e.getCondition=function(b){return h.getCondition(b)};e.addCondition=function(b){return h.addCondition(b)};e.removeCondition=function(b){return h.removeCondition(b)};e.removeAllConditions=function(){return h.removeAllConditions()};e.open=function(){return h.open()};e.load=function(b){return h.load(b)};e.getReport=function(b){return h.getReport(b)};e.setReport=
function(b){return h.setReport(b)};e.getData=function(b,a,c){return h.getData(b,a,c)};e.save=function(b,a,c,d,e){void 0===b&&(b={filename:"report.json"});void 0===a&&(a=null);void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!1);return h.save(b,a,c,d,e)};e.updateData=function(b,a){return h.updateData(b,a)};e.connectTo=function(b){return h.connectTo(b)};e.addCalculatedMeasure=function(b){return h.addCalculatedMeasure(b)};e.removeCalculatedMeasure=function(b){return h.removeCalculatedMeasure(b)};
e.removeAllCalculatedMeasures=function(){return h.removeAllCalculatedMeasures()};e.clear=function(){return h.clear()};e.dispose=function(){h.dispose()};e.refresh=function(){return h.refresh()};e.expandAllData=function(b){void 0===b&&(b=!0);return h.expandAllData(b)};e.expandData=function(b){return h.expandData(b)};e.collapseAllData=function(){return h.collapseAllData()};e.collapseData=function(b){return h.collapseData(b)};e.print=function(b){void 0===b&&(b=null);return h.print(b)};e.exportTo=function(b,
a,c){void 0===a&&(a=null);void 0===c&&(c=null);return h.exportTo(b,a,c)};e.getFilter=function(b){return h.getFilter(b)};e.getFilterProperties=function(b){return h.getFilterProperties(b)};e.setFilter=function(b,a,c){void 0===c&&(c=!1);return h.setFilter(b,a,c)};e.clearFilter=function(b){return h.clearFilter(b)};e.runQuery=function(b){return h.runQuery(b)};e.on=function(b,a){return h.on(b,a)};e.off=function(b,a){return h.off(b,a)};e.getRows=function(){return h.getRows()};e.getColumns=function(){return h.getColumns()};
e.getReportFilters=function(){return h.getPages()};e.getMeasures=function(){return h.getMeasures()};e.getAllMeasures=function(){return h.getAllMeasures()};e.sortValues=function(b,a,c,d){return h.sortValues(b,a,c,d)};e.setSort=function(b,a){return h.setSort(b,a)};e.getSort=function(b){return h.getSort(b)};e.setTopX=function(b,a,c){return h.setTopX(b,a,c)};e.setBottomX=function(b,a,c){return h.setBottomX(b,a,c)};e.getOptions=function(){return h.getOptions()};e.setOptions=function(b){return h.setOptions(b)};
e.getMembers=function(b,a,c){return h.getMembers(b,a,c)};e.getAllHierarchies=function(){return h.getAllHierarchies()};e.replaceHierarchyCaption=function(b){return h.replaceHierarchyCaption(b)};e.getFormat=function(b){return h.getFormat(b)};e.setFormat=function(b,a){return h.setFormat(b,a)};e.getCell=function(b,a){return h.getCell(b,a)};e.getSelectedCell=function(){return h.getSelectedCell()};e.setSelectedCell=function(b,a){return h.setSelectedCell(b,a)};e.removeSelection=function(){return h.removeSelection()};
e.openFieldsList=function(){return h.openFieldsList()};e.closeFieldsList=function(){return h.closeFieldsList()};e.customizeCell=function(b){return h.customizeCell(b)};if(void 0!==window.WebDataRocksHighcharts){e.highcharts={instance:e};for(var f in window.WebDataRocksHighcharts)e.highcharts[f]=window.WebDataRocksHighcharts[f]}if(void 0!==window.WebDataRocksFusioncharts)for(f in e.fusioncharts={instance:e},window.WebDataRocksFusioncharts)e.fusioncharts[f]=window.WebDataRocksFusioncharts[f];if(void 0!==
window.WebDataRocksGooglecharts)for(f in e.googlecharts={instance:e},window.WebDataRocksGooglecharts)e.googlecharts[f]=window.WebDataRocksGooglecharts[f];if(void 0!==window.WebDataRocksAmcharts)for(f in e.amcharts={instance:e},window.WebDataRocksAmcharts)e.amcharts[f]=window.WebDataRocksAmcharts[f];return window.webdatarocks=e}this.PivotApi=PivotApi;
;return this.PivotApi(a)}});
var WebDataRocksToolbar=function(a,b,d,f,m){this.pivot=b;this.pivotContainer=a;this.width="number"==typeof f||0>f.indexOf("px")&&0>f.indexOf("%")?f+"px":f;this.Labels=m};
WebDataRocksToolbar.prototype.getTabs=function(){var a=[],b=this.Labels;a.push({title:b.connect,id:"wdr-tab-connect",icon:this.icons.connect,menu:[{title:b.connect_local_csv,id:"wdr-tab-connect-local-csv",handler:this.connectLocalCSVHandler,mobile:!1,icon:this.icons.connect_csv},{title:b.connect_local_json,id:"wdr-tab-connect-local-json",handler:this.connectLocalJSONHandler,mobile:!1,icon:this.icons.connect_json},{title:this.osUtils.isMobile?b.connect_remote_csv_mobile:b.connect_remote_csv,id:"wdr-tab-connect-remote-csv",
handler:this.connectRemoteCSV,icon:this.icons.connect_csv},{title:this.osUtils.isMobile?b.connect_remote_json_mobile:b.connect_remote_json,id:"wdr-tab-connect-remote-json",handler:this.connectRemoteJSON,icon:this.icons.connect_json}]});a.push({title:b.open,id:"wdr-tab-open",icon:this.icons.open,menu:[{title:b.local_report,id:"wdr-tab-open-local-report",handler:this.openLocalReport,mobile:!1,icon:this.icons.open_local},{title:this.osUtils.isMobile?b.remote_report_mobile:b.remote_report,id:"wdr-tab-open-remote-report",
handler:this.openRemoteReport,icon:this.icons.open_remote}]});a.push({title:b.save,id:"wdr-tab-save",handler:this.saveHandler,mobile:!1,icon:this.icons.save});a.push({title:b.export,id:"wdr-tab-export",mobile:!1,icon:this.icons.export,menu:[{title:b.export_print,id:"wdr-tab-export-print",handler:this.printHandler,icon:this.icons.export_print},{title:b.export_html,id:"wdr-tab-export-html",handler:this.exportHandler,args:"html",icon:this.icons.export_html},{title:b.export_excel,id:"wdr-tab-export-excel",
handler:this.exportHandler,args:"excel",icon:this.icons.export_excel},{title:b.export_pdf,id:"wdr-tab-export-pdf",handler:this.exportHandler,args:"pdf",icon:this.icons.export_pdf}]});a.push({title:b.format,id:"wdr-tab-format",icon:this.icons.format,rightGroup:!0,menu:[{title:this.osUtils.isMobile?b.format_cells_mobile:b.format_cells,id:"wdr-tab-format-cells",handler:this.formatCellsHandler,icon:this.icons.format_number},{title:this.osUtils.isMobile?b.conditional_formatting_mobile:b.conditional_formatting,
id:"wdr-tab-format-conditional",handler:this.conditionalFormattingHandler,icon:this.icons.format_conditional}]});a.push({title:b.options,id:"wdr-tab-options",handler:this.optionsHandler,icon:this.icons.options,rightGroup:!0});a.push({title:b.fields,id:"wdr-tab-fields",handler:this.fieldsHandler,icon:this.icons.fields,rightGroup:!0});void 0!=document.addEventListener&&a.push({title:b.fullscreen,id:"wdr-tab-fullscreen",handler:this.fullscreenHandler,mobile:!1,icon:this.icons.fullscreen,rightGroup:!0});
return a};WebDataRocksToolbar.prototype.create=function(){this.popupManager=new WebDataRocksToolbar.PopupManager(this);this.dataProvider=this.getTabs();this.init()};
WebDataRocksToolbar.prototype.applyToolbarLayoutClasses=function(){if(!this.osUtils.isMobile){var a=this,b=function(){if(a.toolbarWrapper){var b=a.toolbarWrapper.getBoundingClientRect().width;a.toolbarWrapper.classList.remove("wdr-layout-500");a.toolbarWrapper.classList.remove("wdr-layout-360");a.toolbarWrapper.classList.remove("wdr-layout-300");500>b&&a.toolbarWrapper.classList.add("wdr-layout-500");360>b&&a.toolbarWrapper.classList.add("wdr-layout-360");300>b&&a.toolbarWrapper.classList.add("wdr-layout-300")}};
b();window.addEventListener("resize",b)}};
WebDataRocksToolbar.prototype.init=function(){this.container=this.pivotContainer;this.container.style.position=""==this.container.style.position?"relative":this.container.style.position;this.toolbarWrapper=document.createElement("div");this.toolbarWrapper.id="wdr-toolbar-wrapper";this.toolbarWrapper.style.width=this.width;this.osUtils.isMobile&&this.addClass(this.toolbarWrapper,"wdr-mobile");this.addClass(this.toolbarWrapper,"wdr-toolbar-ui");this.toolbarWrapper.style.width=this.width;var a=document.createElement("ul");
a.id="wdr-toolbar";var b=document.createElement("div");b.classList.add("wdr-toolbar-group-right");a.appendChild(b);for(var d=0;d<this.dataProvider.length;d++)if(!this.isDisabled(this.dataProvider[d]))if(this.osUtils.isMobile&&null!=this.dataProvider[d].menu&&!0!=this.dataProvider[d].collapse)for(var f=0;f<this.dataProvider[d].menu.length;f++)this.isDisabled(this.dataProvider[d].menu[f])||a.appendChild(this.createTab(this.dataProvider[d].menu[f]));else f=this.dataProvider[d].divider?this.createDivider(this.dataProvider[d]):
this.createTab(this.dataProvider[d]),b&&this.dataProvider[d].rightGroup?b.appendChild(f):a.appendChild(f);this.toolbarWrapper.appendChild(a);this.container.insertBefore(this.toolbarWrapper,this.container.firstChild);this.updateLabels(this.Labels);this.applyToolbarLayoutClasses()};
WebDataRocksToolbar.prototype.updateLabels=function(a){a=this.Labels=a;this.setText(document.querySelector("#wdr-tab-connect > a > span"),a.connect);this.setText(document.querySelector("#wdr-tab-connect-local-csv > a > span"),a.connect_local_csv);this.setText(document.querySelector("#wdr-tab-connect-local-json > a > span"),a.connect_local_json);this.setText(document.querySelector("#wdr-tab-connect-remote-csv > a > span"),this.osUtils.isMobile?a.connect_remote_csv_mobile:a.connect_remote_csv);this.setText(document.querySelector("#wdr-tab-open > a > span"),
a.open);this.setText(document.querySelector("#wdr-tab-open-local-report > a > span"),a.local_report);this.setText(document.querySelector("#wdr-tab-open-remote-report > a > span"),this.osUtils.isMobile?a.remote_report_mobile:a.remote_report);this.setText(document.querySelector("#wdr-tab-save > a > span"),a.save);this.setText(document.querySelector("#wdr-tab-format > a > span"),a.format);this.setText(document.querySelector("#wdr-tab-format-cells > a > span"),this.osUtils.isMobile?a.format_cells_mobile:
a.format_cells);this.setText(document.querySelector("#wdr-tab-format-conditional > a > span"),this.osUtils.isMobile?a.conditional_formatting_mobile:a.conditional_formatting);this.setText(document.querySelector("#wdr-tab-options > a > span"),a.options);this.setText(document.querySelector("#wdr-tab-fullscreen > a > span"),a.fullscreen);this.setText(document.querySelector("#wdr-tab-export > a > span"),a.export);this.setText(document.querySelector("#wdr-tab-export-print > a > span"),a.export_print);this.setText(document.querySelector("#wdr-tab-export-html > a > span"),
a.export_html);this.setText(document.querySelector("#wdr-tab-export-excel > a > span"),a.export_excel);this.setText(document.querySelector("#wdr-tab-export-pdf > a > span"),a.export_pdf);this.setText(document.querySelector("#wdr-tab-fields > a > span"),a.fields)};
WebDataRocksToolbar.prototype.icons={connect:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-305.5 396.5 36 36"><title>menu_connect</title><path fill="#555" d="M-274.5 425.409s-.988.277-1.422.761l-3.536-1.783c.189-.509.258-1.066.07-1.572l3.719-1.76a2.36 2.36 0 0 0 3.317.147 2.341 2.341 0 0 0 .157-3.3 2.335 2.335 0 0 0-4.055 1.582c-.009.122-.008.237.001.358l-3.896 1.884a2.281 2.281 0 0 0-1.359-.451 2.338 2.338 0 0 0-2.177 2.481 2.33 2.33 0 0 0 2.177 2.179c.491 0 .967-.156 1.359-.451l3.921 1.892a2.317 2.317 0 0 0 1.981 2.604 2.316 2.316 0 0 0 2.604-1.981c.171-1.269-1-2.432-2.262-2.603a8.794 8.794 0 0 0-.6-.026v.039zM-301.592 413.883c-.008.105-.908.222.092.326v6.836c0 2.587 5.827 5.455 13.177 5.455h1.081c-1.146-3 .303-6.854 3.299-8.155-1.448.172-2.868.069-4.334.069-7.056.009-12.775-2.093-13.315-4.531z"/><path fill="#555" d="M-288.5 416.217c7.377 0 13-2.097 13-4.683v-6.853c0-2.586-5.647-4.682-13-4.682-7.352 0-13 2.104-13 4.69v6.853c0 2.586 5.648 4.675 13 4.675zm.177-15.268c5.903 0 10.691 1.661 10.691 3.741s-4.796 3.741-10.691 3.741c-5.894 0-10.683-1.67-10.683-3.741 0-2.072 4.79-3.741 10.683-3.741z"/></svg>',connect_csv:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path d="M11 24l6 0V27h-6V24z"/><path d="M12.8 22L12.8 22l1.2-2.5L15.1 22h1.9l-2-3.9L16.9 14h-1.8l-1 2.5L12.9 14h-1.8l1.9 3.9L11 22H12.8z"/><path d="M19 19h6v3h-6V19z"/><path d="M19 14h6v3L19 17V14z"/><path d="M19 24h6v3h-6V24z"/><path d="M23 4H7v28h22V11L23 4zM8 31V5h14v7h6v19H8L8 31z"/></svg>',
connect_json:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path d="M23 4H7v28h22V11L23 4zM8 31V5h14v7h6v19H8L8 31z"/><path d="M19 24c0 0.6-0.4 1-1 1 -0.6 0-1-0.4-1-1v-2c0-0.6 0.4-1 1-1 0.6 0 1 0.4 1 1V24zM21 18v-2c0-0.6-0.4 0-1 0 -0.6 0-1-0.4-1-1 0-0.6 0.4-1 1-1 1.7 0 3 0.3 3 2v2c0 1.1 0.9 2 2 2 0.6 0 1 0.4 1 1 0 0.6-0.4 1-1 1 -1.1 0-2 0.9-2 2v2c0 1.7-1.3 2-3 2 -0.6 0-1-0.4-1-1s0.4-1 1-1c0.6 0 1 0.6 1 0v-2c0-1.2 0.5-2.3 1.4-3C21.5 20.3 21 19.2 21 18zM11 20c1.1 0 2-0.9 2-2v-2c0-1.7 1.3-2 3-2 0.6 0 1 0.4 1 1 0 0.6-0.4 1-1 1 -0.6 0-1-0.6-1 0v2c0 1.2-0.5 2.3-1.4 3 0.8 0.7 1.4 1.8 1.4 3v2c0 0.6 0.4 0 1 0 0.6 0 1 0.4 1 1s-0.4 1-1 1c-1.7 0-3-0.3-3-2v-2c0-1.1-0.9-2-2-2 -0.6 0-1-0.4-1-1C10 20.4 10.4 20 11 20z"/><path d="M18 17c0.6 0 1 0.4 1 1s-0.4 1-1 1 -1-0.4-1-1S17.4 17 18 17z"/></svg>',
open:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-305.5 396.5 36 36"><title>menu_open</title><path fill="#555" d="M-279.351 408.5h8.976c.064 0 .126-.067.167-.025.021.052.021.055 0 .107l-2.053 20.701c-.01.117-.104.217-.219.217h-30.102c-.116 0-.21-.104-.221-.22l-1.989-16.009c-.022-.041-.022.124 0 .083.042-.054.115.146.178.146h21.198c.87 0 1.665-.726 2.053-1.499l1.812-3.446a.414.414 0 0 1 .2-.055zm-4.052 2.473c.084-.011.162-.052.194-.126l1.813-3.288c.408-.754 1.196-1.059 2.054-1.059h7.842v-2.637c0-1.102-.83-2.166-1.929-2.25-.053 0-.183-.113-.235-.113h-18.328c-.104 0-.188.006-.241-.09.01-1.1-.858-1.91-1.958-1.91h-6.902c-1.226 0-2.406.864-2.406 2.089v9.426l20.096-.042z"/></svg>',
open_local:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><style>.a{fill:none;}</style><path d="M30.9 10.6C30.8 10.4 30.2 10 30 10h-1V8c0-0.4-0.6-1-1-1H15l-1-2H8C7.6 5 7 5.6 7 6v4H6c-0.2 0-0.8 0.4-0.9 0.6 -0.1 0.1-0.2 0.3-0.1 0.5l2.1 19.5C7.2 30.8 7.7 31 8 31h20c0.3 0 0.8-0.2 0.9-0.5l2.1-19.5C31 10.9 31 10.7 30.9 10.6zM28 30H8L6 11h24L28 30z"/><line x1="11" y1="23" x2="11" y2="23" class="a"/><line x1="25" y1="23" x2="25" y2="23" class="a"/><polygon points="11 15 11 23 17 23 17 25 14 25 14 26 22 26 22 25 19 25 19 23 25 23 25 15 "/></svg>',
open_remote:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path d="M30.9 10.6C30.8 10.4 30.2 10 30 10h-1V8c0-0.4-0.6-1-1-1H15l-1-2H8C7.6 5 7 5.6 7 6v4H6c-0.2 0-0.8 0.4-0.9 0.6 -0.1 0.1-0.2 0.3-0.1 0.5l2.1 19.5C7.2 30.8 7.7 31 8 31h20c0.3 0 0.8-0.2 0.9-0.5l2.1-19.5C31 10.9 31 10.7 30.9 10.6zM28 30H8L6 11h24L28 30z"/><path d="M24.8 18.1l-0.8 1.5c-0.2 0.2-0.5 0.2-0.8 0 -1.3-1.2-3.2-1.9-5.3-1.9 -2.1 0-4 0.7-5.3 1.9 -0.2 0.2-0.5 0.2-0.8 0l-0.8-1.5c-0.1-0.1-0.2-0.2-0.2-0.3 0-0.1 0.1-0.2 0.2-0.3 1.7-1.5 4.1-2.5 6.8-2.5 2.7 0 5.1 0.9 6.8 2.5 0.1 0 0.2 0.2 0.2 0.3C25 17.9 24.9 18 24.8 18.1zM18 19.6c1.5 0 2.8 0.5 3.8 1.4 0.2 0.2 0.2 0.5 0 0.7l-0.8 1.5c-0.2 0.2-0.5 0.2-0.8 0 -0.6-0.5-1.4-0.8-2.3-0.8 -0.9 0-1.7 0.3-2.3 0.8 -0.2 0.2-0.5 0.2-0.8 0l-0.8-1.5c-0.2-0.2-0.2-0.5 0-0.7C15.2 20.1 16.5 19.6 18 19.6zM18 23.4c0.8 0 1.4 0.6 1.4 1.3 0 0.7-0.6 1.3-1.4 1.3 -0.8 0-1.4-0.6-1.4-1.3C16.6 24 17.2 23.4 18 23.4z"/></svg>',
save:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-17.5 774.5 36 36"><title>menu_save</title><g fill="#555"><path d="M15.191 783.284l-5.457-5.467a1.101 1.101 0 0 0-.781-.317h-.835c-.2 0-.618.163-.618.363v8.889c0 .618-.245.748-.853.748H-5.638c-.617 0-.862-.14-.862-.748v-8.889c0-.2-.409-.363-.609-.363h-6.283c-.618 0-1.108.499-1.108 1.107v27.785c0 .617.5 1.107 1.108 1.107h27.784c.618 0 1.108-.499 1.108-1.107v-22.337c0-.29-.109-.562-.309-.771zM8.98 801.463c0 .618-.499 1.037-1.107 1.037H-6.873c-.617 0-.627-.357-.627-.966v-8.626c0-.617.019-1.408.627-1.408H7.882c.618 0 1.108.613 1.108 1.223l-.01 8.74z"/><path d="M-4.167 784.5h9.361c.2 0 .306.228.306.028v-6.665c0-.2-.106-.363-.306-.363h-9.361c-.2 0-.333.163-.333.363v6.665c0 .191.124-.028.333-.028zm5.667-4.294c0-.618.392-1.108 1-1.108.618 0 1 .5 1 1.108v1.97c0 .618-.392 1.108-1 1.108-.618 0-1-.5-1-1.108v-1.97zM4.168 796.5h-7.31c-.617 0-1.108.393-1.108 1s.5 1 1.108 1h7.31c.617 0 1.107-.393 1.107-1s-.498-1-1.107-1z"/></g></svg>',
export:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-17.5 774.5 36 36"><title>menu_export</title><g fill="#555"><path d="M15.446 795.615l-4.289-6.461c-.346-.515-.803-.654-1.428-.654H7.788c-.186 0-.346-.029-.363.156-.008.076.017.07.059.137l4.76 7.108c.042.06.034.337-.017.38-.025.025-.067.219-.102.219H6.699c-.194 0-.354-.063-.363.125-.305 3.23-3.174 5.495-6.407 5.192-2.81-.263-5.039-2.329-5.3-5.14-.009-.195-.168-.178-.363-.178h-5.401c-.076 0-.144-.281-.144-.357 0-.025.008-.157.017-.175l4.76-7.203c.102-.16.05-.245-.109-.347-.06-.035-.118.082-.187.082h-1.94c-.616 0-1.199.145-1.553.658l-4.664 6.547c-.203.304-.545.586-.545.95v9.216c1 .911 1.267 1.646 2.187 1.629h27.625c.903.009 1.188-.709 1.188-1.611v-9.233c1-.373.157-.735-.054-1.04z"/><path d="M-3.674 783.5H-2.5v10.2c1 1.4 1.764 2.464 3.165 2.371 1.274-.083 1.835-1.097 2.835-2.371v-10.2h1.207c.346 0 .641-.04.65-.387.008-.151-.042-.193-.144-.311l-4.186-5.11c-.228-.287-.642-.302-.929-.073-.042.034-.076.081-.101.115l-4.135 5.172c-.22.271-.187.447.084.668.11.085.244-.074.38-.074z"/></g></svg>',
export_print:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-17.5 774.5 36 36"><title>dd_save_print</title><path fill="#555" d="M-5.5 798.685v3.815h11v-7h-11v3.185zm2-1.185h7v1h-7v-1zm0 2h7v1h-7v-1zM5.5 786.308V782.5h-11v7h11z"/><path fill="#555" d="M8.94 786.5H7.5v4h-14v-4h-1.44c-1.493 0-2.56 1.064-2.56 2.558v6.87c0 1.493 1.067 2.572 2.56 2.572h1.44v-4h14v4h1.44c1.493 0 2.56-1.064 2.56-2.557v-6.878c0-1.501-1.074-2.565-2.56-2.565z"/></svg>',export_excel:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path d="M24.4 15h-3.8L18 18.6 15.3 15h-3.8l4.5 5.2L11 27h7.3L18 25h-2l2-3L21.1 27H25l-5.1-6.8L24.4 15z"/><path d="M23 4H7v28h22V11L23 4zM8 31V5h14v7h6v19H8L8 31z"/></svg>',
export_html:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path d="M25.7 20.8l-2.3-2.5c-0.2-0.2-0.4-0.3-0.6-0.3 -0.2 0-0.4 0.1-0.6 0.3 -0.3 0.4-0.3 1 0 1.4l1.7 1.9 -1.7 1.9c-0.2 0.2-0.3 0.4-0.3 0.7 0 0.3 0.1 0.5 0.3 0.7 0.2 0.2 0.4 0.3 0.6 0.3 0.2 0 0.4-0.1 0.6-0.3l2.3-2.5C26.1 21.8 26.1 21.2 25.7 20.8z"/><path d="M14 24c0-0.3-0.1-0.5-0.3-0.7l-1.7-1.9 1.7-1.9c0.3-0.4 0.3-1 0-1.4 -0.2-0.2-0.4-0.3-0.6-0.3 -0.2 0-0.4 0.1-0.6 0.3l-2.3 2.5c-0.3 0.4-0.3 1 0 1.4l2.3 2.5c0.2 0.2 0.4 0.3 0.6 0.3 0.2 0 0.4-0.1 0.6-0.3C13.9 24.5 14 24.3 14 24z"/><path d="M20.4 15.1c-0.1 0-0.2-0.1-0.3-0.1 -0.4 0-0.8 0.3-0.9 0.6l-4.1 11.1c-0.1 0.2-0.1 0.5 0 0.7 0.1 0.2 0.3 0.4 0.5 0.5C15.7 28 15.8 28 16 28c0.4 0 0.8-0.3 0.9-0.6l4.1-11.1C21.1 15.8 20.9 15.2 20.4 15.1z"/><path d="M23 4H7v28h22V11L23 4zM8 31V5h14v7h6v19H8L8 31z"/></svg>',
export_pdf:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><path d="M17.2 17.1L17.2 17.1C17.3 17.1 17.3 17.1 17.2 17.1c0.1-0.5 0.2-0.7 0.2-1V15.8c0.1-0.6 0.1-1 0-1.1 0 0 0 0 0-0.1l-0.1-0.1 0 0 0 0c0 0 0 0.1-0.1 0.1C16.9 15.2 16.9 16 17.2 17.1L17.2 17.1zM13.8 24.8c-0.2 0.1-0.4 0.2-0.6 0.3 -0.8 0.7-1.3 1.5-1.5 1.8l0 0 0 0 0 0C12.5 26.9 13.1 26.2 13.8 24.8 13.9 24.8 13.9 24.8 13.8 24.8 13.9 24.8 13.8 24.8 13.8 24.8zM24.1 23.1c-0.1-0.1-0.6-0.5-2.1-0.5 -0.1 0-0.1 0-0.2 0l0 0c0 0 0 0 0 0.1 0.8 0.3 1.6 0.6 2.1 0.6 0.1 0 0.1 0 0.2 0l0 0h0.1c0 0 0 0 0-0.1l0 0C24.2 23.3 24.1 23.3 24.1 23.1zM24.6 24c-0.2 0.1-0.6 0.2-1 0.2 -0.9 0-2.2-0.2-3.4-0.8 -1.9 0.2-3.4 0.5-4.5 0.9 -0.1 0-0.1 0-0.2 0.1 -1.3 2.4-2.5 3.5-3.4 3.5 -0.2 0-0.3 0-0.4-0.1l-0.6-0.3v-0.1c-0.1-0.2-0.1-0.3-0.1-0.6 0.1-0.6 0.8-1.6 2.1-2.4 0.2-0.1 0.6-0.3 1-0.6 0.3-0.6 0.7-1.2 1.1-2 0.6-1.1 0.9-2.3 1.2-3.3l0 0c-0.4-1.4-0.7-2.1-0.2-3.7 0.1-0.5 0.4-0.9 0.9-0.9h0.2c0.2 0 0.4 0.1 0.7 0.2 0.8 0.8 0.4 2.6 0 4.1 0 0.1 0 0.1 0 0.1 0.4 1.2 1.1 2.3 1.8 2.9 0.3 0.2 0.6 0.5 1 0.7 0.6 0 1-0.1 1.5-0.1 1.3 0 2.2 0.2 2.6 0.8 0.1 0.2 0.1 0.5 0.1 0.7C24.9 23.5 24.8 23.8 24.6 24zM17.3 19.6c-0.2 0.8-0.7 1.7-1.1 2.7 -0.2 0.5-0.4 0.8-0.7 1.2h0.1 0.1l0 0c1.5-0.6 2.8-0.9 3.7-1 -0.2-0.1-0.3-0.2-0.4-0.3C18.4 21.6 17.7 20.7 17.3 19.6z"/><path d="M23 4H7v28h22V11L23 4zM8 31V5h14v7h6v19H8L8 31z"/></svg>',
format:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-17.5 774.5 36 36"><title>menu_format</title><g fill="#555"><path d="M15.144 781.92a7.62 7.62 0 0 0-4.238-4.157 4.634 4.634 0 0 0-1.201-.254.99.99 0 0 0-.906.36l-10.797 10.829c-1.462 1.462-2.916 2.908-4.37 4.378a1.347 1.347 0 0 0-.326.596c-.481 2.197-.939 4.402-1.413 6.607a.639.639 0 0 0 .792.793l6.551-1.381c.253-.049.49-.171.67-.359 5.063-5.08 10.127-10.144 15.19-15.207.237-.229.384-.548.4-.882a8.491 8.491 0 0 0-.352-1.323zm-16.825 16.652l-2.54.531a2.367 2.367 0 0 0-1.911-1.87c.18-.906.384-1.813.571-2.729a2.05 2.05 0 0 1 1.078.229 6.007 6.007 0 0 1 2.671 2.605c.139.318.245.653.311.996 0 .157 0 .157-.18.238z"/><path d="M6.568 804.5H-11.5v-18h7.761l1.83-2.118 1.593-1.882h-12.455c-.947 0-1.729 1.241-1.729 2.18v21.097c0 .947.77 1.724 1.726 1.724H8.283c.947 0 2.217-.769 2.217-1.724v-12.488l-4 3.438v7.773h.068z"/></g></svg>',
format_number:'<svg xmlns="http://www.w3.org/2000/svg" width="52" height="36" viewBox="0 0 52 36"><path d="M31 19.2v-3.4l2.5-0.4c0.2-0.7 0.5-1.4 0.9-2.1l-1.4-2 2.4-2.4 2 1.4c0.7-0.4 1.4-0.7 2.1-0.9l0.4-2.5h3.4l0.4 2.5c0.7 0.2 1.4 0.5 2.1 0.9l2-1.4 2.4 2.4 -1.4 2c0.4 0.7 0.7 1.4 0.9 2.1L52 15.8v3.4l-2.5 0.4c-0.2 0.7-0.5 1.4-0.9 2.1l1.4 2 -2.4 2.4 -2-1.5c-0.7 0.4-1.4 0.7-2.1 0.9l-0.4 2.5h-3.4l-0.4-2.5c-0.7-0.2-1.4-0.5-2.1-0.9l-2 1.5 -2.4-2.4 1.4-2c-0.4-0.7-0.7-1.4-0.9-2.1L31 19.2zM41.5 21c1.9 0 3.5-1.6 3.5-3.5 0-1.9-1.6-3.5-3.5-3.5 -1.9 0-3.5 1.6-3.5 3.5C38 19.4 39.6 21 41.5 21z"/><path d="M38 30H1V6h36V5H0v26h38V30L38 30z"/><path d="M9.4 21.1c-0.3 0.3-0.7 0.4-1.2 0.4 -0.5 0-0.9-0.2-1.2-0.5s-0.4-0.8-0.4-1.4H5c0 0.9 0.2 1.7 0.7 2.2 0.5 0.6 1.2 0.9 2 1v1.3h1.1v-1.4c0.8-0.1 1.5-0.4 1.9-0.9 0.5-0.5 0.7-1.1 0.7-1.9 0-0.4-0.1-0.8-0.2-1.1 -0.1-0.3-0.3-0.6-0.5-0.8 -0.2-0.2-0.5-0.4-0.8-0.6 -0.3-0.2-0.8-0.4-1.4-0.6 -0.6-0.2-1-0.4-1.2-0.7s-0.4-0.6-0.4-1c0-0.4 0.1-0.8 0.4-1 0.2-0.2 0.6-0.4 1-0.4 0.4 0 0.8 0.2 1 0.5 0.3 0.3 0.4 0.8 0.4 1.4h1.6c0-0.9-0.2-1.6-0.6-2.2 -0.4-0.6-1-0.9-1.8-1v-1.5H7.9v1.5C7.1 12.6 6.5 12.9 6 13.4s-0.7 1.1-0.7 1.9c0 1.1 0.5 2 1.6 2.6 0.3 0.2 0.8 0.4 1.3 0.6 0.6 0.2 1 0.4 1.2 0.7s0.4 0.6 0.4 1C9.8 20.5 9.7 20.8 9.4 21.1z"/><path d="M16.3 12.6h-0.2l-3.8 1.5v1.4l2.4-0.8v8.1h1.6V12.6z"/><path d="M19.9 23.8c0.2-0.5 0.4-1 0.4-1.5l0-1.2h-1.5v1.3c0 0.3-0.1 0.6-0.2 1 -0.1 0.3-0.3 0.7-0.5 1.1l0.9 0.5C19.3 24.7 19.6 24.3 19.9 23.8z"/><path d="M27 16.7c0-1.4-0.3-2.5-0.8-3.2s-1.3-1.1-2.4-1.1c-1.1 0-1.9 0.4-2.4 1.1 -0.5 0.7-0.8 1.8-0.8 3.3v1.8c0 1.4 0.3 2.5 0.8 3.2s1.3 1.1 2.4 1.1c1.1 0 1.9-0.4 2.4-1.1 0.5-0.7 0.8-1.8 0.8-3.3V16.7zM25.4 18.9c0 0.9-0.1 1.6-0.4 2 -0.2 0.4-0.6 0.6-1.2 0.6 -0.5 0-0.9-0.2-1.2-0.7 -0.3-0.5-0.4-1.2-0.4-2.1v-2.3c0-0.9 0.1-1.5 0.4-2 0.3-0.4 0.6-0.6 1.2-0.6 0.5 0 0.9 0.2 1.2 0.7 0.3 0.4 0.4 1.1 0.4 2.1V18.9z"/></svg>',
format_conditional:'<svg xmlns="http://www.w3.org/2000/svg" width="52" height="36" viewBox="0 0 52 36"><polygon points="38 5 0 5 0 31 26 31 26 30 1 30 1 6 37 6 37 10 38 10 "/><path d="M9 13H8.6L5 14.4v1.4l2-0.8V23h2V13z"/><path d="M17 22h-4l2.4-2.9c0.6-0.7 1-1.3 1.3-1.8 0.3-0.5 0.4-1.1 0.4-1.5 0-0.8-0.3-1.5-0.8-2 -0.5-0.5-1.2-0.7-2.2-0.7 -0.6 0-1.2 0.1-1.7 0.4s-0.9 0.6-1.1 1C11.1 14.9 11 16 11 16h1.6c0 0 0.1-0.9 0.4-1.3s0.7-0.4 1.2-0.4c0.4 0 0.8 0.2 1 0.5 0.3 0.3 0.4 0.7 0.4 1.1 0 0.4-0.1 0.7-0.3 1.1 -0.2 0.4-0.6 0.8-1.1 1.3L11 21.9V23h6V22z"/><path d="M21 19h0.8c0.6 0 1-0.1 1.3 0.2 0.3 0.3 0.4 0.6 0.4 1.1 0 0.5-0.1 0.8-0.4 1.1 -0.3 0.3-0.6 0.4-1.1 0.4 -0.5 0-0.8-0.3-1.1-0.5C20.6 20.9 20.5 21 20.5 20h-1.5c0 1 0.3 1.6 0.8 2.1s1.3 0.8 2.1 0.8c0.9 0 1.6-0.2 2.2-0.7 0.6-0.5 0.8-1.2 0.8-2.1 0-0.5-0.1-1-0.4-1.4 -0.3-0.4-0.6-0.7-1.1-0.9 0.4-0.2 0.7-0.5 1-0.9 0.3-0.4 0.4-0.8 0.4-1.2 0-0.9-0.3-1.5-0.8-2 -0.5-0.5-1.2-0.7-2.1-0.7 -0.5 0-1 0.1-1.5 0.3 -0.4 0.2-0.8 0.7-1 1.1S19.1 15 19.1 16h1.5c0-1 0.1-0.9 0.4-1.1 0.3-0.3 0.6-0.5 1-0.5 0.5 0 0.8 0.1 1 0.3s0.3 0.6 0.3 1.1c0 0.5-0.1 0.7-0.4 1C22.7 17 22.3 17 21.9 17H21V19z"/><path d="M47.8 7C50.1 7 52 8.9 52 11.2c0 1-0.3 1.8-0.8 2.5l-1.7 1.7L43.6 9.5l1.7-1.7C46 7.3 46.8 7 47.8 7zM30.7 22.4L29 30l7.6-1.7 11.6-11.6 -5.9-5.9L30.7 22.4zM42 17.9l-5.1 5.1 -0.9-0.9 5.1-5L42 17.9z"/></svg>',
options:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-17.5 774.5 36 36"><title>menu_options</title><path fill="#555" d="M11.363 789.058l-.76-1.838a33.692 33.692 0 0 0 1.601-4.223l-2.327-2.328a31.444 31.444 0 0 0-4.142 1.691l-1.829-.76a32.88 32.88 0 0 0-1.83-4.101h-3.291a32.106 32.106 0 0 0-1.731 4.133l-1.83.76a33.556 33.556 0 0 0-4.206-1.609l-2.328 2.32a31.563 31.563 0 0 0 1.69 4.141l-.759 1.838a34.366 34.366 0 0 0-4.117 1.838v3.3a32.519 32.519 0 0 0 4.117 1.731l.759 1.829a33.633 33.633 0 0 0-1.608 4.223l2.327 2.328a32.986 32.986 0 0 0 4.133-1.699l1.83.76a31.481 31.481 0 0 0 1.862 4.108h3.291a32.194 32.194 0 0 0 1.732-4.133l1.837-.76a33.57 33.57 0 0 0 4.207 1.609l2.327-2.328a31.481 31.481 0 0 0-1.69-4.141l.76-1.838a32.532 32.532 0 0 0 4.108-1.829v-3.3a30.142 30.142 0 0 0-4.133-1.722zM.5 799.202a6.706 6.706 0 1 1 6.706-6.706A6.71 6.71 0 0 1 .5 799.202z"/></svg>',
fields:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-17.5 774.5 36 36"><title>menu_fields</title><g fill="#555"><path d="M11.351 787.279c1.112.367 2.027 1.221 2.55 2.221H13.5v-10.627c0-.744-.089-1.357-.825-1.373h-26.339c-.736.008-.836.612-.836 1.349v21.656c0 .735.093.995.836.995h10.836c-.008 0 .205-1.314.629-2.025-.073-.098-.123.025-.18.025H-12.5v-6h10.563l.83-1.699c.4-.76 1.606-1.258 1.606-1.667V785.5h10.843l.009 1.779zM-1.5 791.5h-11v-6h11v6z"/><path d="M15.805 801.444l-1.602-1.308c0-.237.082-.49.082-.817a2.483 2.483 0 0 0-.082-.817l1.602-1.389a.399.399 0 0 0 .082-.49l-1.528-2.86a.364.364 0 0 0-.278-.123.678.678 0 0 0-.18 0l-1.912.866a6.95 6.95 0 0 0-1.299-.817l-.311-1.989c-.017-.195-.188-.199-.384-.199H6.93c-.147 0-.384.037-.384.199l-.311 2.053c-.458.229-.899.468-1.299.786l-1.912-.834c-.041-.008-.09-.016-.131-.008a.356.356 0 0 0-.319.192l-1.528 2.817c-.082.164-.082.408.082.489l1.749 1.308c0 .237-.082.489-.082.816a2.48 2.48 0 0 0 .082.817l-1.602 1.356a.399.399 0 0 0-.082.49l1.528 2.86a.364.364 0 0 0 .278.123.678.678 0 0 0 .18 0l1.912-.817c.4.318.842.597 1.299.817l.311 2.116a.322.322 0 0 0 .221.4c.033.008.065.017.09.017h3.065c.147 0 .384-.164.384-.327l.311-2.215c.466-.212.907-.49 1.299-.817l1.831.817a.441.441 0 0 0 .54-.163l1.528-2.86c.056-.08-.018-.326-.165-.489zm-7.306.744a2.865 2.865 0 0 1-3.064-2.664c-.114-1.585 1.079-2.95 2.664-3.064a2.867 2.867 0 0 1 3.072 2.868 2.804 2.804 0 0 1-2.672 2.86z"/></g></svg>',
fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="-17.5 774.5 36 36"><title>menu_fullscreen_open</title><g fill="#555"><path d="M-7.5 779.976V777.5h-7v7h3v-2.752l3.758 4.067 1.74-1.846-4.342-4.003 2.844.01zM-7.742 799.096l-3.758 4.101V800.5h-3v7h7v-2h-2.618l-.049-.371 4.124-4.054-1.699-1.979zM8.746 785.913l3.754-4.092v2.679h3v-7h-7v2h2.602l.082.381-4.126 4.041 1.688 1.991zM13.5 800.5v2.598l-.382.074-4.058-4.003-1.882 1.575 4.006 3.756H8.5v3h7v-7h-2zM-4 786.5h9c1.104 0 2.5.908 2.5 2.011v7.996c0 1.103-1.396 1.993-2.5 1.993h-9c-1.104 0-2.5-.891-2.5-1.993v-8.005c0-1.103 1.396-2.002 2.5-2.002z"/></g></svg>'};
WebDataRocksToolbar.prototype.connectLocalCSVHandler=function(){this.pivot.connectTo({dataSourceType:"csv",browseForFile:!0})};WebDataRocksToolbar.prototype.connectLocalJSONHandler=function(){this.pivot.connectTo({dataSourceType:"json",browseForFile:!0})};WebDataRocksToolbar.prototype.connectRemoteCSV=function(){this.showConnectToRemoteCSVDialog()};WebDataRocksToolbar.prototype.connectRemoteJSON=function(){this.showConnectToRemoteJSONDialog()};WebDataRocksToolbar.prototype.openLocalReport=function(){this.pivot.open()};
WebDataRocksToolbar.prototype.openRemoteReport=function(){this.showOpenRemoteReportDialog()};WebDataRocksToolbar.prototype.saveHandler=function(){this.pivot.save("report.json","file")};WebDataRocksToolbar.prototype.formatCellsHandler=function(){this.showFormatCellsDialog()};WebDataRocksToolbar.prototype.conditionalFormattingHandler=function(){this.showConditionalFormattingDialog()};WebDataRocksToolbar.prototype.optionsHandler=function(){this.showOptionsDialog()};
WebDataRocksToolbar.prototype.fieldsHandler=function(){this.pivot.openFieldsList()};WebDataRocksToolbar.prototype.printHandler=function(){this.pivot.print()};WebDataRocksToolbar.prototype.exportHandler=function(a){"pdf"==a?this.showExportPdfDialog():this.pivot.exportTo(a)};WebDataRocksToolbar.prototype.fullscreenHandler=function(){this.toggleFullscreen()};WebDataRocksToolbar.prototype.defaults={};
WebDataRocksToolbar.prototype.showConnectToRemoteCSVDialog=function(){var a=this,b=this.Labels,d=this.popupManager.createPopup();d.content.classList.add("wdr-popup-w500");d.setTitle(b.open_remote_csv);d.setToolbar([{id:"wdr-btn-open",label:b.open,handler:function(){0<f.value.length&&a.pivot.connectTo({filename:f.value,dataSourceType:"csv"})},isPositive:!0},{id:"wdr-btn-cancel",label:b.cancel}]);var b=document.createElement("div"),f=document.createElement("input");f.id="wdr-inp-file-url";f.type="text";
f.value="https://cdn.webdatarocks.com/data/data.csv";b.appendChild(f);d.setContent(b);this.popupManager.addPopup(d.content)};
WebDataRocksToolbar.prototype.showConnectToRemoteJSONDialog=function(){var a=this,b=this.Labels,d=this.popupManager.createPopup();d.content.classList.add("wdr-popup-w500");d.setTitle(b.open_remote_json);d.setToolbar([{id:"wdr-btn-open",label:b.open,handler:function(){0<f.value.length&&a.pivot.connectTo({filename:f.value,dataSourceType:"json"})},isPositive:!0},{id:"wdr-btn-cancel",label:b.cancel}]);var b=document.createElement("div"),f=document.createElement("input");f.id="wdr-inp-file-url";f.type=
"text";f.value="https://cdn.webdatarocks.com/data/data.json";b.appendChild(f);d.setContent(b);this.popupManager.addPopup(d.content)};
WebDataRocksToolbar.prototype.showOpenRemoteReportDialog=function(){var a=this,b=this.Labels,d=this.popupManager.createPopup();d.content.classList.add("wdr-popup-w500");d.setTitle(b.open_remote_report);d.setToolbar([{id:"wdr-btn-open",label:b.open,handler:function(){0<f.value.length&&a.pivot.load(f.value)},isPositive:!0},{id:"wdr-btn-cancel",label:b.cancel}]);var b=document.createElement("div"),f=document.createElement("input");f.type="text";var m=a.pivot.getOptions()||{};f.value=m.grid&&"flat"==
m.grid.type?"https://cdn.webdatarocks.com/reports/report-flat.json":"https://cdn.webdatarocks.com/reports/report.json";b.appendChild(f);d.setContent(b);this.popupManager.addPopup(d.content)};
WebDataRocksToolbar.prototype.showFormatCellsDialog=function(){var a=this,b=this.Labels,d=function(){n.disabled=h.disabled=w.disabled=p.disabled=q.disabled=r.disabled=s.disabled=t.disabled="empty"==e.value;var b=a.pivot.getFormat(e.value);n.value="left"==b.textAlign||"right"==b.textAlign?b.textAlign:"right";h.value=b.thousandsSeparator;w.value=b.decimalSeparator;p.value=b.decimalPlaces;q.value=b.currencySymbol;r.value=b.currencySymbolAlign;s.value=b.nullValue;t.value=!0==b.isPercent?!0:!1},f=this.popupManager.createPopup();
f.content.id="wdr-popup-format-cells";f.setTitle(this.osUtils.isMobile?b.format:b.format_cells);f.setToolbar([{id:"wdr-btn-apply",label:b.apply,handler:function(){var b={};""==e.value&&(b.name="");b.textAlign=n.value;b.thousandsSeparator=h.value;b.decimalSeparator=w.value;b.decimalPlaces=p.value;b.currencySymbol=q.value;b.currencySymbolAlign=r.value;b.nullValue=s.value;b.isPercent="true"==t.value?!0:!1;a.pivot.setFormat(b,""==e.value?null:e.value);a.pivot.refresh()},isPositive:!0},{id:"wdr-btn-cancel",
label:b.cancel}],!0);var m=document.createElement("div"),g=document.createElement("div");g.classList.add("wdr-inp-group");m.appendChild(g);var c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);var k=document.createElement("label");k.classList.add("wdr-uc");a.setText(k,b.choose_value);c.appendChild(k);var l=a.createSelect(),e=l.select;e.onchange=d;e.options[0]=new Option(b.choose_value,"empty");e.options[0].disabled=!0;e.options[1]=
new Option(b.all_values,"");c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);g=document.createElement("div");g.classList.add("wdr-inp-group");m.appendChild(g);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.text_align);c.appendChild(k);var l=a.createSelect(),n=l.select;n.options[0]=new Option(b.align_left,
"left");n.options[1]=new Option(b.align_right,"right");c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.thousand_separator);c.appendChild(k);var l=a.createSelect(),h=l.select;h.options[0]=new Option(b.none,"");h.options[1]=new Option(b.space," ");h.options[2]=new Option(",",",");h.options[3]=new Option(".",".");c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");
c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.decimal_separator);c.appendChild(k);var l=a.createSelect(),w=l.select;w.options[0]=new Option(".",".");w.options[1]=new Option(",",",");c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.decimal_places);c.appendChild(k);for(var l=a.createSelect(),p=l.select,k=0;11>k;k++)p.options[k]=
new Option(0===k?b.none:k-1,k-1);c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.currency_symbol);c.appendChild(k);var q=document.createElement("input");q.classList.add("wdr-inp");q.type="text";c.appendChild(q);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,
b.currency_align);c.appendChild(k);var l=a.createSelect(),r=l.select;r.options[0]=new Option(b.align_left,"left");r.options[1]=new Option(b.align_right,"right");c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.null_value);c.appendChild(k);var s=document.createElement("input");s.classList.add("wdr-inp");s.type="text";c.appendChild(s);c=document.createElement("div");c.classList.add("wdr-inp-row");
c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.is_percent);c.appendChild(k);var l=a.createSelect(),t=l.select;t.options[0]=new Option(b.true_value,!0);t.options[1]=new Option(b.false_value,!1);c.appendChild(l);f.setContent(m);this.popupManager.addPopup(f.content);b=a.pivot.getMeasures();for(k=0;k<b.length;k++)e.options[k+2]=new Option(b[k].caption,b[k].uniqueName);d()};
WebDataRocksToolbar.prototype.showConditionalFormattingDialog=function(){var a=this,b=this.Labels,d=this.pivot.getAllConditions(),f=function(a){for(var b=a.match(/\W\d+\.*\d*/g),c=[],d=!1,f="",g=0;g<a.length;g++)'"'==a[g]||"'"==a[g]?(d?c.push(f):f="",d=!d):d&&(f+=a[g]);a=a.match(/<=|>=|<|>|=|=|!=|isNaN/g);return null==b&&null==c?{}:{value1:null!=b?b[0].replace(/\s/,""):c[0],value2:null!=b&&1<b.length?b[1].replace(/\s/,""):"",sign:a?a.join(""):""}},m=this.popupManager.createPopup();m.content.id="wdr-popup-conditional";
m.setTitle(this.osUtils.isMobile?b.conditional:b.conditional_formatting);m.setToolbar([{id:"wdr-btn-apply",label:b.apply,handler:function(){a.pivot.removeAllConditions();for(var b=0;b<d.length;b++){var c;c=d[b].sign;var e=d[b].value1,f=d[b].value2,g="",m=null==f||0==f.length,p="><"===c,q="isNaN"===c;(null==e||0==e.length)&&!q||p&&m||(p&&!m?g="AND(#value > "+e+", #value < "+f+")":q?g="isNaN(#value)":(isNaN(parseFloat(e))&&(e="'"+e+"'"),g="#value "+c+" "+e));c=g;if(null==c)return;d[b].formula=c;a.pivot.addCondition(d[b])}a.pivot.refresh()},
isPositive:!0},{id:"wdr-btn-cancel",label:b.cancel}],!0);var g=document.createElement("a");g.id="wdr-add-btn";g.setAttribute("href","javascript:void(0)");g.classList.add("wdr-ui-btn");g.classList.add("wdr-ui-btn-light");g.classList.add("wdr-button-add");g.onclick=function(){var b={sign:"<",value1:"0",measures:a.pivot.getMeasures(),format:{fontFamily:"Arial",fontSize:"12px",color:"#000000",backgroundColor:"#FFFFFF"}};d.push(b);c.appendChild(a.createConditionalFormattingItem(b,d));a.popupManager.centerPopup(m.content)};
g.setAttribute("title",b.add_condition);b=document.createElement("span");b.classList.add("wdr-icon");b.classList.add("wdr-icon-act_add");g.appendChild(b);m.toolbar.insertBefore(g,m.toolbar.firstChild);var c=document.createElement("div");c.classList.add("wdr-popup-content");c.onclick=function(b){b.target.classList.contains("wdr-cr-delete")&&a.popupManager.centerPopup(m.content)};for(g=0;g<d.length;g++)b=f(d[g].formula),d[g].value1=b.value1,d[g].value2=b.value2,d[g].sign=b.sign,d[g].measures=a.pivot.getMeasures(),
c.appendChild(a.createConditionalFormattingItem(d[g],d));m.setContent(c);this.popupManager.addPopup(m.content)};WebDataRocksToolbar.prototype.defaults.fontSizes="8px 9px 10px 11px 12px 13px 14px".split(" ");WebDataRocksToolbar.prototype.defaults.fonts="Arial;Lucida Sans Unicode;Verdana;Courier New;Palatino Linotype;Tahoma;Impact;Trebuchet MS;Georgia;Times New Roman".split(";");
WebDataRocksToolbar.prototype.defaults.conditions=[{label:"less_than",sign:"<"},{label:"less_than_or_equal",sign:"<="},{label:"greater_than",sign:">"},{label:"greater_than_or_equal",sign:">="},{label:"equal_to",sign:"="},{label:"not_equal_to",sign:"!="},{label:"between",sign:"><"},{label:"is_empty",sign:"isNaN"}];
WebDataRocksToolbar.prototype.createConditionalFormattingItem=function(a,b){var d=this,f=this.Labels,m=function(a,b){h[0]=new Option(f.all_values,"");for(var c=d.pivot.getOptions()||{},c=c.grid&&"flat"==c.grid.type,e=0;e<a.length;e++)c&&7==a[e].type||(h[h.options.length]=new Option(a[e].caption,a[e].uniqueName));null!=b?h.value=b:h.selectedIndex=0},g=function(){"sign"in a&&"><"===a.sign?(p.classList.remove("wdr-width120"),p.classList.add("wdr-width50"),p.style.display="inline-block",r.value="value2"in
a?a.value2:"0",r.style.display="inline-block",q.style.display="inline-block"):("sign"in a&&"isNaN"===a.sign?p.style.display="none":(p.classList.add("wdr-width120"),p.classList.remove("wdr-width50"),p.style.display="inline-block"),r.style.display="none",q.style.display="none")},c=function(){var b=a.format;null!=b&&(v.style.backgroundColor=b.backgroundColor||"#fff",v.style.color=b.color||"#000",v.style.fontFamily=b.fontFamily||"Arial",v.style.fontSize=b.fontSize||"12px")},k=document.createElement("div");
k.classList.add("wdr-condition-row");var l=document.createElement("div");l.classList.add("wdr-wrap-relative");k.appendChild(l);var e=document.createElement("span");e.classList.add("wdr-cr-delete");e.classList.add("wdr-icon");e.classList.add("wdr-icon-act_trash");e.onclick=function(){var c=b.indexOf(a);-1<c&&b.splice(c,1);k.parentNode.removeChild(k)};l.appendChild(e);e=document.createElement("div");e.classList.add("wdr-cr-inner");l.appendChild(e);var n=document.createElement("div");n.classList.add("wdr-cr-lbl");
n.classList.add("wdr-width50");d.setText(n,f.value+":");e.appendChild(n);n=d.createSelect();n.id="wdr-values";var h=n.select;"measures"in a?(m(a.measures,a.measure),h.disabled=0===a.measures.length):h.disabled=!0;h.onchange=function(){a.measure=h.value};e.appendChild(n);n=d.createSelect();n.id="wdr-conditions";var w=n.select;(function(a){for(var b=0;b<d.defaults.conditions.length;b++)w[b]=new Option(f[d.defaults.conditions[b].label],d.defaults.conditions[b].sign);null!=a?w.value=a:w.selectedIndex=
0})("sign"in a?a.sign:null);w.onchange=function(){a.sign=w.value;"sign"in a&&"><"===a.sign?a.value2=0:("sign"in a&&"isNaN"===a.sign&&delete a.value1,delete a.value2);g()};e.appendChild(n);var p=document.createElement("input");p.classList.add("wdr-number-inp");p.classList.add("wdr-width50");p.type="number";p.value="value1"in a?a.value1:"0";p.onchange=function(){a.value1=0==p.value.length?"0":p.value};e.appendChild(p);var q=document.createElement("span");q.id="wdr-and-label";q.classList.add("wdr-width20");
d.setText(q,f.and_symbole);e.appendChild(q);var r=document.createElement("input");r.classList.add("wdr-number-inp");r.classList.add("wdr-width50");r.type="number";r.value="value2"in a?a.value2:"0";r.onchange=function(){a.value2=0==r.value.length?"0":r.value};e.appendChild(r);g();e=document.createElement("div");e.classList.add("wdr-cr-inner");l.appendChild(e);n=document.createElement("div");n.classList.add("wdr-cr-lbl");n.classList.add("wdr-width50");d.setText(n,f.format+":");e.appendChild(n);n=d.createSelect();
n.id="wdr-font-family";var s=n.select;(function(a){for(var b=0;b<d.defaults.fonts.length;b++)s[b]=new Option(d.defaults.fonts[b],d.defaults.fonts[b]);s.value=null==a?"Arial":a})(a.hasOwnProperty("format")&&a.format.hasOwnProperty("fontFamily")?a.format.fontFamily:null);s.onchange=function(){null!=a.format&&(a.format.fontFamily=s.value,c())};e.appendChild(n);n=d.createSelect();n.id="wdr-font-size";var t=n.select;(function(a){for(var b=0;b<d.defaults.fontSizes.length;b++)t[b]=new Option(d.defaults.fontSizes[b],
d.defaults.fontSizes[b]);t.value=null==a?"12px":a})(a.hasOwnProperty("format")&&a.format.hasOwnProperty("fontSize")?a.format.fontSize:null);t.onchange=function(){null!=a.format&&(a.format.fontSize=t.value,c())};e.appendChild(n);var u=new WebDataRocksToolbar.ColorPicker(this,k);u.setColor(a.hasOwnProperty("format")&&a.format.hasOwnProperty("backgroundColor")?a.format.backgroundColor:"0xFFFFFF","bg");u.setColor(a.hasOwnProperty("format")&&a.format.hasOwnProperty("color")?a.format.color:"0x000000","font");
u.changeHandler=function(){null!=a.format&&(v.style.color=u.fontColor||"#000",v.style.backgroundColor=u.backgroundColor||"#fff")};u.applyHandler=function(){null!=a.format&&(a.format.color=u.fontColor,a.format.backgroundColor=u.backgroundColor,c())};u.cancelHandler=function(){null!=a.format&&(u.setColor(a.format.hasOwnProperty("backgroundColor")?a.format.backgroundColor:"0xFFFFFF","bg"),u.setColor(a.format.hasOwnProperty("color")?a.format.color:"0x000000","font"));c()};e.appendChild(u.element);var v=
document.createElement("input");v.id="wdr-sample";v.classList.add("wdr-inp");v.type="number";v.value="73.93";v.style.pointerEvents="none";e.appendChild(v);c();return k};
WebDataRocksToolbar.prototype.showOptionsDialog=function(){var a=this,b=this.Labels,d=this.popupManager.createPopup();d.content.id="wdr-popup-options";d.setTitle(this.osUtils.isMobile?b.options:b.layout_options);d.setToolbar([{id:"wdr-btn-apply",label:b.apply,handler:function(){var b;n.checked?b="off":w.checked?b="on":p.checked?b="rows":q.checked&&(b="columns");var c;u.checked?c="off":v.checked?c="on":x.checked?c="rows":y.checked&&(c="columns");var d="compact";s&&s.checked?d="classic":t&&t.checked&&
(d="flat");var e=a.pivot.getOptions(),e={grid:{showGrandTotals:b,showTotals:c,type:d}};a.pivot.setOptions(e);a.pivot.refresh()},isPositive:!0},{id:"wdr-btn-cancel",label:b.cancel}],!0);var f=document.createElement("div");f.classList.add("wdr-popup-content");var m=document.createElement("div");m.classList.add("wdr-ui-row");f.appendChild(m);var g=document.createElement("div");g.classList.add("wdr-ui-col-2");m.appendChild(g);var c=document.createElement("div");c.classList.add("wdr-title-2");a.setText(c,
b.grand_totals);g.appendChild(c);var k="wdr-grand-totals-"+Date.now(),c=document.createElement("ul");c.classList.add("wdr-radiobtn-list");g.appendChild(c);var l=document.createElement("li"),e=document.createElement("div");e.classList.add("wdr-radio-wrap");var n=document.createElement("input");n.type="radio";n.name=k;n.id="wdr-gt-1";n.value="off";e.appendChild(n);var h=document.createElement("label");h.setAttribute("for","wdr-gt-1");a.setText(h,b.grand_totals_off);e.appendChild(h);l.appendChild(e);
c.appendChild(l);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var w=document.createElement("input");w.type="radio";w.name=k;w.id="wdr-gt-2";w.value="on";e.appendChild(w);h=document.createElement("label");h.setAttribute("for","wdr-gt-2");a.setText(h,b.grand_totals_on);e.appendChild(h);l.appendChild(e);c.appendChild(l);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var p=document.createElement("input");
p.type="radio";p.name=k;p.id="wdr-gt-3";p.value="rows";e.appendChild(p);h=document.createElement("label");h.setAttribute("for","wdr-gt-3");a.setText(h,b.grand_totals_on_rows);e.appendChild(h);l.appendChild(e);c.appendChild(l);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var q=document.createElement("input");q.type="radio";q.name=k;q.id="wdr-gt-4";q.value="rows";e.appendChild(q);h=document.createElement("label");h.setAttribute("for","wdr-gt-4");a.setText(h,
b.grand_totals_on_columns);e.appendChild(h);l.appendChild(e);c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-title-2");a.setText(c,b.layout);g.appendChild(c);var r="wdr-layout-"+Date.now(),c=document.createElement("ul");c.classList.add("wdr-radiobtn-list");g.appendChild(c);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");k=document.createElement("input");k.type="radio";k.name=r;k.id="wdr-lt-1";k.value="compact";e.appendChild(k);
h=document.createElement("label");h.setAttribute("for","wdr-lt-1");a.setText(h,b.compact_view);e.appendChild(h);l.appendChild(e);c.appendChild(l);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var s=document.createElement("input");s.type="radio";s.name=r;s.id="wdr-lt-2";s.value="classic";e.appendChild(s);h=document.createElement("label");h.setAttribute("for","wdr-lt-2");a.setText(h,b.classic_view);e.appendChild(h);l.appendChild(e);c.appendChild(l);
g=a.pivot.getReport({withDefaults:!0,withGlobals:!0});l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var t=document.createElement("input");t.type="radio";t.name=r;t.id="wdr-lt-3";t.value="flat";e.appendChild(t);h=document.createElement("label");h.setAttribute("for","wdr-lt-3");a.setText(h,b.flat_view);e.appendChild(h);l.appendChild(e);c.appendChild(l);g=document.createElement("div");g.classList.add("wdr-ui-col-2");m.appendChild(g);c=document.createElement("div");
c.classList.add("wdr-title-2");a.setText(c,b.subtotals);g.appendChild(c);m="wdr-subtotals-"+Date.now();c=document.createElement("ul");c.classList.add("wdr-radiobtn-list");g.appendChild(c);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var u=document.createElement("input");u.type="radio";u.name=m;u.id="wdr-st-1";u.value="off";e.appendChild(u);h=document.createElement("label");h.setAttribute("for","wdr-st-1");a.setText(h,b.subtotals_off);e.appendChild(h);
l.appendChild(e);c.appendChild(l);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var v=document.createElement("input");v.type="radio";v.name=m;v.id="wdr-st-2";v.value="on";e.appendChild(v);h=document.createElement("label");h.setAttribute("for","wdr-st-2");a.setText(h,b.subtotals_on);e.appendChild(h);l.appendChild(e);c.appendChild(l);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var x=document.createElement("input");
x.type="radio";x.name=m;x.id="wdr-st-3";x.value="rows";e.appendChild(x);h=document.createElement("label");h.setAttribute("for","wdr-st-3");a.setText(h,b.subtotals_on_rows);e.appendChild(h);l.appendChild(e);c.appendChild(l);l=document.createElement("li");e=document.createElement("div");e.classList.add("wdr-radio-wrap");var y=document.createElement("input");y.type="radio";y.name=m;y.id="wdr-st-4";y.value="columns";e.appendChild(y);h=document.createElement("label");h.setAttribute("for","wdr-st-4");a.setText(h,
b.subtotals_on_columns);e.appendChild(h);l.appendChild(e);c.appendChild(l);d.setContent(f);this.popupManager.addPopup(d.content);g=a.pivot.getOptions()||{};b=g.grid||{};"off"==b.showGrandTotals||!1==b.showGrandTotals?n.checked=!0:"on"==b.showGrandTotals||!0==b.showGrandTotals?w.checked=!0:"rows"==b.showGrandTotals?p.checked=!0:"columns"==b.showGrandTotals&&(q.checked=!0);"off"==b.showTotals?u.checked=!0:"on"==b.showTotals?v.checked=!0:"rows"==b.showTotals?x.checked=!0:"columns"==b.showTotals&&(y.checked=
!0);"flat"==b.type&&t?t.checked=!0:"classic"==b.type&&s?s.checked=!0:k&&(k.checked=!0)};
WebDataRocksToolbar.prototype.showExportPdfDialog=function(){var a=this,b=this.Labels,d=this.popupManager.createPopup();d.setTitle(b.choose_page_orientation);d.setToolbar([{id:"wdr-btn-apply",label:b.apply,handler:function(){var b="portrait";k.checked&&(b="landscape");a.pivot.exportTo("pdf",{pageOrientation:b})},isPositive:!0},{id:"wdr-btn-cancel",label:b.cancel}]);var f=document.createElement("div"),m=document.createElement("ul");m.classList.add("wdr-radiobtn-list");f.appendChild(m);var g=document.createElement("li");
m.appendChild(g);var c=document.createElement("div");c.classList.add("wdr-radio-wrap");g.appendChild(c);g=document.createElement("input");g.id="wdr-portrait-radio";g.type="radio";g.name="wdr-pdf-orientation";g.checked=!0;c.appendChild(g);g=document.createElement("label");g.setAttribute("for","wdr-portrait-radio");a.setText(g,b.portrait);c.appendChild(g);g=document.createElement("li");m.appendChild(g);c=document.createElement("div");c.classList.add("wdr-radio-wrap");g.appendChild(c);var k=document.createElement("input");
k.id="wdr-landscape-radio";k.type="radio";k.name="wdr-pdf-orientation";c.appendChild(k);g=document.createElement("label");g.setAttribute("for","wdr-landscape-radio");a.setText(g,b.landscape);c.appendChild(g);d.setContent(f);this.popupManager.addPopup(d.content)};WebDataRocksToolbar.prototype.toggleFullscreen=function(){this.isFullscreen()?this.exitFullscreen():this.enterFullscreen(this.container)};
WebDataRocksToolbar.prototype.isFullscreen=function(){return document.fullScreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement};
WebDataRocksToolbar.prototype.enterFullscreen=function(a){if(a.requestFullscreen||a.webkitRequestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen&&window==top){this.containerStyle={width:this.container.style.width,height:this.container.style.height,position:this.container.style.position,top:this.container.style.top,bottom:this.container.style.bottom,left:this.container.style.left,right:this.container.style.right,marginTop:this.container.style.marginTop,marginLeft:this.container.style.left,
toolbarWidth:this.toolbarWrapper.style.width};this.container.style.width="100%";this.container.style.height="100%";this.container.style.position="fixed";this.container.style.top="0px";this.container.style.left="0px";this.toolbarWrapper.style.width="100%";if(a.requestFullscreen)a.requestFullscreen();else if(a.webkitRequestFullScreen){var b=navigator.userAgent;-1<b.indexOf("Safari")&&-1==b.indexOf("Chrome")?a.webkitRequestFullScreen():a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}else a.mozRequestFullScreen?
a.mozRequestFullScreen():a.msRequestFullscreen&&(window==top?a.msRequestFullscreen():alert("Fullscreen mode in IE 11 is not currently supported while Pivot embeded in iframe."));a.addEventListener("fullscreenchange",function(){window.screenTop||window.screenY||this.isFullscreen()||this.exitFullscreen()}.bind(this),!1);a.addEventListener("webkitfullscreenchange",function(){window.screenTop||window.screenY||this.isFullscreen()||this.exitFullscreen()}.bind(this),!1);a.addEventListener("mozfullscreenchange",
function(){window.fullScreen||window.innerWidth==screen.width&&window.innerHeight==screen.height||this.exitFullscreen()}.bind(this),!1)}};
WebDataRocksToolbar.prototype.exitFullscreen=function(){this.container.style.width=this.containerStyle.width;this.container.style.height=this.containerStyle.height;this.container.style.position=this.containerStyle.position;this.container.style.top=this.containerStyle.top;this.container.style.left=this.containerStyle.left;this.container.style.marginTop=this.containerStyle.marginTop;this.container.style.marginLeft=this.containerStyle.marginLeft;this.toolbarWrapper.style.width=this.containerStyle.toolbarWidth;
document.exitFullscreen?document.exitFullscreen():document.cancelFullscreen?document.cancelFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullScreen?document.webkitExitFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()};WebDataRocksToolbar.prototype.nullOrUndefined=function(a){return"undefined"===typeof a||null===a};
WebDataRocksToolbar.prototype.hasClass=function(a,b){return a.className.match(RegExp("(\\s|^)"+b+"(\\s|$)"))};WebDataRocksToolbar.prototype.addClass=function(a,b){this.hasClass(a,b)||(a.className+=" "+b)};WebDataRocksToolbar.prototype.removeClass=function(a,b){this.hasClass(a,b)&&(a.className=a.className.replace(RegExp("(\\s|^)"+b+"(\\s|$)")," "))};WebDataRocksToolbar.prototype.setText=function(a,b){a&&(void 0!==a.innerText&&(a.innerText=b),void 0!==a.textContent&&(a.textContent=b))};
WebDataRocksToolbar.prototype.createSelect=function(){var a=document.createElement("div");a.classList.add("wdr-select");var b=document.createElement("select");a.appendChild(b);a.select=b;return a};WebDataRocksToolbar.prototype.createDivider=function(a){a=document.createElement("li");a.className="wdr-divider";return a};
WebDataRocksToolbar.prototype.createTab=function(a){var b=document.createElement("li");b.id=a.id;var d=document.createElement("a");a.hasOwnProperty("class_attr")&&d.setAttribute("class",a.class_attr);d.setAttribute("href","javascript:void(0)");if(a.icon){var f=document.createElement("div");f.classList.add("wdr-svg-icon");f.innerHTML=a.icon;d.appendChild(f)}f=document.createElement("span");this.setText(f,a.title);d.appendChild(f);var m=this,f="function"==typeof a.handler?a.handler:this[a.handler];
this.nullOrUndefined(f)||(d.onclick=function(a,b){return function(){a.call(m,b)}}(f,a.args));this.nullOrUndefined(this[a.onShowHandler])||(d.onmouseover=function(a){return function(){a.call(m)}}(this[a.onShowHandler]));b.onmouseover=function(){m.showDropdown(this)};b.onmouseout=function(){m.hideDropdown(this)};b.appendChild(d);null==a.menu||this.osUtils.isMobile&&!0!=a.collapse||b.appendChild(this.createTabMenu(a.menu));return b};
WebDataRocksToolbar.prototype.showDropdown=function(a){var b=a.querySelectorAll(".wdr-dropdown")[0];b&&(b.style.display="block",b.getBoundingClientRect().right>this.toolbarWrapper.getBoundingClientRect().right&&(b.style.right=0,this.addClass(a,"wdr-align-rigth")))};WebDataRocksToolbar.prototype.hideDropdown=function(a){var b=a.querySelectorAll(".wdr-dropdown")[0];b&&(b.style.display="none",b.style.right=null,this.removeClass(a,"wdr-align-rigth"))};
WebDataRocksToolbar.prototype.createTabMenu=function(a){var b=document.createElement("div");b.className="wdr-dropdown wdr-shadow-container";var d=document.createElement("ul");d.className="wdr-dropdown-content";for(var f=0;f<a.length;f++)this.isDisabled(a[f])||d.appendChild(a[f].divider?this.createMenuDivider():this.createTab(a[f]));b.appendChild(d);return b};WebDataRocksToolbar.prototype.createMenuDivider=function(){var a=document.createElement("li");a.className="wdr-v-divider";return a};
WebDataRocksToolbar.prototype.isDisabled=function(a){return this.nullOrUndefined(a)?!0:!1===a.ios&&this.osUtils.isIOS||!1===a.android&&this.osUtils.isAndroid||!1===a.mobile&&this.osUtils.isMobile};WebDataRocksToolbar.prototype.getElementById=function(a,b){var d=function(a,b){for(var g=0;g<a.childNodes.length;g++){var c=a.childNodes[g];if(c.id==b)return c;c=d(c,b);if(null!=c)return c}return null};return d(b||this.toolbarWrapper,a)};
WebDataRocksToolbar.prototype.osUtils={isIOS:navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.platform.match(/iPhone|iPad|iPod/i)?!0:!1,isMac:/Mac/i.test(navigator.platform),isAndroid:navigator.userAgent.match(/Android/i)?!0:!1,isBlackBerry:/BlackBerry/i.test(navigator.platform),isMobile:navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.platform.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Android/i)||/BlackBerry/i.test(navigator.platform)};
WebDataRocksToolbar.PopupManager=function(a){this.toolbar=a;this.activePopup=null};WebDataRocksToolbar.PopupManager.prototype.createPopup=function(){return new WebDataRocksToolbar.PopupManager.PopupWindow(this)};
WebDataRocksToolbar.PopupManager.prototype.addPopup=function(a){if(null!=a){this.removePopup();this.modalOverlay=this.createModalOverlay();this.activePopup=a;this.toolbar.toolbarWrapper.appendChild(a);this.toolbar.toolbarWrapper.appendChild(this.modalOverlay);this.addLayoutClasses(a);this.centerPopup(a);var b=this;a.resizeHandler=function(){a&&(b.addLayoutClasses(a),b.centerPopup(a))};window.addEventListener("resize",a.resizeHandler)}};
WebDataRocksToolbar.PopupManager.prototype.addLayoutClasses=function(a){a.classList.remove("wdr-layout-tablet");a.classList.remove("wdr-layout-mobile");a.classList.remove("wdr-layout-mobile-small");var b=this.getBoundingRect(this.toolbar.container);768>b.width&&a.classList.add("wdr-layout-tablet");580>b.width&&a.classList.add("wdr-layout-mobile");460>b.width&&a.classList.add("wdr-layout-mobile-small")};
WebDataRocksToolbar.PopupManager.prototype.centerPopup=function(a){var b=this.getBoundingRect(this.toolbar.container),d=this.getBoundingRect(a),f=this.getBoundingRect(this.toolbar.toolbarWrapper);a.style.zIndex=parseInt(this.modalOverlay.style.zIndex)+1;this.modalOverlay.style.height=b.height+"px";a.style.left=Math.max(0,(f.width-d.width)/2)+"px";a.style.top=Math.max(0,(b.height-d.height)/2)+"px"};
WebDataRocksToolbar.PopupManager.prototype.removePopup=function(a){a=a||this.activePopup;null!=this.modalOverlay&&(this.toolbar.toolbarWrapper.removeChild(this.modalOverlay),this.modalOverlay=null);null!=a&&(this.toolbar.toolbarWrapper.removeChild(a),this.activePopup=null,window.removeEventListener("resize",a.resizeHandler))};
WebDataRocksToolbar.PopupManager.prototype.getBoundingRect=function(a){var b=a.getBoundingClientRect();return{left:b.left,right:b.right,top:b.top,bottom:b.bottom,width:b.width||a.clientWidth,height:b.height||a.clientHeight}};WebDataRocksToolbar.PopupManager.prototype.createModalOverlay=function(){var a=document.createElement("div");a.className="wdr-modal-overlay";a.id="wdr-popUp-modal-overlay";var b=this;a.addEventListener("click",function(a){b.removePopup(b.activePopup)});return a};
WebDataRocksToolbar.PopupManager.PopupWindow=function(a){this.popupManager=a;var b=document.createElement("div");b.className="wdr-panel-content";var d=document.createElement("div");d.className="wdr-title-bar";var f=document.createElement("div");f.className="wdr-title-text";var m=document.createElement("div");m.className="wdr-toolbox";m.style.clear="both";this.content=document.createElement("div");this.content.className="wdr-popup wdr-panel wdr-toolbar-ui wdr-ui";this.content.appendChild(b);b.appendChild(d);
d.appendChild(f);this.setTitle=function(a){WebDataRocksToolbar.prototype.setText(f,a)};this.setContent=function(a){b.insertBefore(a,d.nextSibling)};var g=this;this.setToolbar=function(a,k){m.innerHTML="";for(var l=a.length-1;0<=l;l--){var e=document.createElement("a");e.setAttribute("href","javascript:void(0)");e.className="wdr-ui-btn"+(a[l].isPositive?" wdr-ui-btn-dark":"");a[l].id&&(e.id=a[l].id);WebDataRocksToolbar.prototype.setText(e,a[l].label);e.onclick=function(a){return function(){null!=a&&
a.call();g.popupManager.removePopup()}}(a[l].handler);!0===a[l].disabled?WebDataRocksToolbar.prototype.addClass(e,"wdr-ui-disabled"):WebDataRocksToolbar.prototype.removeClass(e,"wdr-ui-disabled");a[l].isPositive&&(WebDataRocksToolbar.prototype.osUtils.isMac||WebDataRocksToolbar.prototype.osUtils.isIOS)?m.appendChild(e):m.insertBefore(e,m.firstChild)}k?(m.classList.add("wdr-ui-col"),d.appendChild(m),d.classList.add("wdr-ui-row"),f.classList.add("wdr-ui-col")):b.appendChild(m)};this.toolbar=m;this.titleBar=
d;this.title=f;return this};
WebDataRocksToolbar.ColorPicker=function(a,b){function d(a){a=a.target.getAttribute("data-c");h.drawShades(h.colors[a]);h.setColor(a,h.currentType,!0)}function f(a){a=a.target.getAttribute("data-c");h.setColor(a,h.currentType,!0)}function m(a){h.currentType=a;k.classList.remove("wdr-current");l.classList.remove("wdr-current");"bg"==a?(l.classList.add("wdr-current"),h.setColor(h.backgroundColor,a,!1)):(k.classList.add("wdr-current"),h.setColor(h.fontColor,a,!1))}function g(){h.closePopup();h.cancelHandler&&
h.cancelHandler()}this.toolbar=a;this.element=document.createElement("div");this.element.classList.add("wdr-colorpick-wrap");this.element.classList.add("wdr-width40");this.colorPickerButton=document.createElement("div");this.colorPickerButton.classList.add("wdr-colorpick-btn");this.element.appendChild(this.colorPickerButton);this.colorPickerIcon=document.createElement("span");this.colorPickerIcon.classList.add("wdr-icon");this.colorPickerIcon.classList.add("wdr-icon-act_font");this.colorPickerButton.appendChild(this.colorPickerIcon);
this.popup=document.createElement("div");this.popup.classList.add("wdr-colorpick-popup");this.popup.onclick=function(a){a.stopPropagation()};b.appendChild(this.popup);var c=document.createElement("div");c.classList.add("wdr-color-targ-switch");this.popup.appendChild(c);var k=document.createElement("a");k.classList.add("wdr-cts-item");k.classList.add("wdr-current");k.href="javascript:void(0);";k.innerHTML=a.Labels.cp_text;k.onclick=function(){m("font")};c.appendChild(k);var l=document.createElement("a");
l.classList.add("wdr-cts-item");l.innerHTML=a.Labels.cp_highlight;l.href="javascript:void(0);";l.onclick=function(){m("bg")};c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-cp-sett-row");this.popup.appendChild(c);this.colorInput=document.createElement("input");this.colorInput.type="text";this.colorInput.classList.add("wdr-inp");this.colorInput.classList.add("wdr-width140");this.colorInput.classList.add("wdr-tac");this.colorInput.onchange=function(){var a=h.colorInput.value;h.isColor(a)&&
h.setColor(a,h.currentType,!0)};c.appendChild(this.colorInput);this.colorPreview=document.createElement("div");this.colorPreview.classList.add("wdr-cp-curr-color");this.colorPreview.classList.add("wdr-width140");c.appendChild(this.colorPreview);this.mainColors=document.createElement("div");this.mainColors.classList.add("wdr-row-9colors");this.popup.appendChild(this.mainColors);for(var e in this.colors){c=document.createElement("div");c.classList.add("wdr-r9c-item");c.style.backgroundColor=e;c.setAttribute("data-c",
e);c.addEventListener("click",d);this.mainColors.appendChild(c);var n=document.createElement("span");n.classList.add("wdr-cp-currentmark");n.classList.add("wdr-icon");n.classList.add("wdr-icon-act_check");c.appendChild(n);n=document.createElement("span");n.classList.add("wdr-r9c-arrow");n.style.borderTopColor=e;c.appendChild(n)}this.shadeColors=document.createElement("div");this.shadeColors.classList.add("wdr-row-4colors");this.popup.appendChild(this.shadeColors);for(e=0;8>e;e++)c=document.createElement("div"),
c.classList.add("wdr-r4c-item"),c.addEventListener("click",f),this.shadeColors.appendChild(c),n=document.createElement("span"),n.classList.add("wdr-cp-currentmark"),n.classList.add("wdr-icon"),n.classList.add("wdr-icon-act_check"),c.appendChild(n);this.drawShades(this.colors["#000000"]);c=document.createElement("div");c.classList.add("wdr-cp-btns-row");this.popup.appendChild(c);e=document.createElement("a");e.innerHTML=a.Labels.apply;e.classList.add("wdr-ui-btn");e.classList.add("wdr-ui-btn-dark");
e.addEventListener("click",function(){h.closePopup();h.applyHandler&&h.applyHandler()});n=document.createElement("a");n.innerHTML=a.Labels.cancel;n.classList.add("wdr-ui-btn");n.addEventListener("click",g);WebDataRocksToolbar.prototype.osUtils.isMac||WebDataRocksToolbar.prototype.osUtils.isIOS?(c.appendChild(n),c.appendChild(e)):(c.appendChild(e),c.appendChild(n));this.currentType="font";this.colorPickerButton.addEventListener("click",function(a){a.stopPropagation();h.isOpened()?h.closePopup():h.openPopup()});
document.body.addEventListener("click",function(a){g()});var h=this};
WebDataRocksToolbar.ColorPicker.prototype.colors={"#000000":"#000000 #212121 #424242 #616161 #757575 #9E9E9E #BDBDBD #FFFFFF".split(" "),"#F44336":"#D32F2F #E53935 #F44336 #EF5350 #E57373 #EF9A9A #FFCDD2 #FFEBEE".split(" "),"#FF9800":"#F57C00 #FB8C00 #FF9800 #FFA726 #FFB74D #FFCC80 #FFE0B2 #FFF3E0".split(" "),"#FFEB3B":"#FBC02D #FDD835 #FFEB3B #FFEE58 #FFF176 #FFF59D #FFF9C4 #FFFDE7".split(" "),"#8BC34A":"#689F38 #7CB342 #8BC34A #9CCC65 #AED581 #C5E1A5 #DCEDC8 #F1F8E9".split(" "),"#009688":"#00796B #00897B #009688 #26A69A #4DB6AC #80CBC4 #B2DFDB #E0F2F1".split(" "),
"#03A9F4":"#0288D1 #039BE5 #03A9F4 #29B6F6 #4FC3F7 #81D4FA #B3E5FC #E1F5FE".split(" "),"#3F51B5":"#303F9F #3949AB #3F51B5 #5C6BC0 #7986CB #9FA8DA #C5CAE9 #E8EAF6".split(" "),"#9C27B0":"#7B1FA2 #8E24AA #9C27B0 #AB47BC #BA68C8 #CE93D8 #E1BEE7 #F3E5F5".split(" ")};WebDataRocksToolbar.ColorPicker.prototype.isOpened=function(){return this.popup.parentElement&&this.popup.parentElement.classList.contains("wdr-popup-opened")};
WebDataRocksToolbar.ColorPicker.prototype.drawShades=function(a){if(a)for(var b=this.shadeColors.children,d=0;d<b.length;d++){var f=b[d];f.setAttribute("data-c",a[d]);f.style.backgroundColor=a[d];f.style.borderRight="#FFFFFF"==a[d]?"1px solid #d5d5d5":"none";f.style.borderBottom="#FFFFFF"==a[d]?"1px solid #d5d5d5":"none"}};
WebDataRocksToolbar.ColorPicker.prototype.setColor=function(a,b,d){"string"===typeof a&&0==a.indexOf("0x")&&(a="#"+a.substr(2));"bg"==b?(this.backgroundColor=a,this.colorPickerButton.style.backgroundColor=a):(this.fontColor=a,this.colorPickerIcon.style.color=a);this.colorInput.value=a;this.colorPreview.style.backgroundColor=a;this.drawSelected();d&&this.changeHandler&&this.changeHandler()};
WebDataRocksToolbar.ColorPicker.prototype.drawSelected=function(){var a="bg"==this.currentType?this.backgroundColor:this.fontColor,b=this.findMain(a);this.drawShades(this.colors[b]);for(var d=this.mainColors.children,f=0;f<d.length;f++)d[f].classList.remove("wdr-current");(b=this.mainColors.querySelector("[data-c='"+b+"']"))&&b.classList.add("wdr-current");d=this.shadeColors.children;for(f=0;f<d.length;f++)d[f].classList.remove("wdr-current");(a=this.shadeColors.querySelector("[data-c='"+a+"']"))&&
a.classList.add("wdr-current")};WebDataRocksToolbar.ColorPicker.prototype.findMain=function(a){"string"===typeof a&&0==a.indexOf("0x")&&(a="#"+a.substr(2));for(var b in this.colors)if(0<=this.colors[b].indexOf(a))return b};WebDataRocksToolbar.ColorPicker.prototype.isColor=function(a){return a.match(/^#?[0-9A-Fa-f]{6}$/g)};WebDataRocksToolbar.ColorPicker.prototype.closePopup=function(){this.popup.parentElement&&this.popup.parentElement.classList.remove("wdr-popup-opened")};
WebDataRocksToolbar.ColorPicker.prototype.openPopup=function(){for(var a=this.toolbar.toolbarWrapper.querySelectorAll(".wdr-colorpick-popup"),b=0;b<a.length;b++)a[b].parentElement.classList.remove("wdr-popup-opened");this.popup.parentElement&&(a=this.toolbar.toolbarWrapper.querySelector("#wdr-popup-conditional .wdr-panel-content"),b=this.getWhere(this.colorPickerButton,a),0>this.getWhere(this.colorPickerButton,document.body).top-this.popup.clientHeight?(this.popup.classList.remove("wdr-arrow-down"),
this.popup.classList.add("wdr-arrow-up"),this.popup.style.top=this.colorPickerButton.clientHeight+b.top+11+"px",this.popup.style.bottom=""):(this.popup.classList.add("wdr-arrow-down"),this.popup.classList.remove("wdr-arrow-up"),this.popup.style.bottom=a.clientHeight-b.top+5+"px",this.popup.style.top=""),this.popup.style.left=b.left+this.colorPickerButton.clientWidth/2+2+"px",this.popup.parentElement.classList.add("wdr-popup-opened"))};
WebDataRocksToolbar.ColorPicker.prototype.getWhere=function(a,b){var d=0,f=0,m=0,g=0;if(a.offsetParent){for(var d=a.offsetLeft,f=a.offsetTop,c=a;(c=c.parentNode)&&c!=b;)m=c.scrollTop?c.scrollTop:0,g=0,d-=g,f-=m;for(;(a=a.offsetParent)&&a!=b;)d+=a.offsetLeft,f+=a.offsetTop}return{top:f+0,left:d+0}};

/** @license FileSaver.js | Copyright (c) 2016 Eli Grey [https://github.com/eligrey/FileSaver.js] | MIT License [https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md] */
var savingAs=savingAs||"undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var k=a.document,n=k.createElementNS("http://www.w3.org/1999/xhtml","a"),w="download"in n,x=function(c){var e=k.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,a,0,0,0,0,0,!1,!1,!1,!1,0,null);c.dispatchEvent(e)},q=a.webkitRequestFileSystem,u=a.requestFileSystem||q||a.mozRequestFileSystem,
y=function(c){(a.setImmediate||a.setTimeout)(function(){throw c;},0)},r=0,s=function(c){var e=function(){"string"===typeof c?(a.URL||a.webkitURL||a).revokeObjectURL(c):c.remove()};a.chrome?e():setTimeout(e,500)},t=function(c,a,d){a=[].concat(a);for(var b=a.length;b--;){var l=c["on"+a[b]];if("function"===typeof l)try{l.call(c,d||c)}catch(f){y(f)}}},m=function(c,e){var d=this,b=c.type,l=!1,f,p,k=function(){t(d,["writestart","progress","write","writeend"])},g=function(){if(l||!f)f=(a.URL||a.webkitURL||
a).createObjectURL(c);p?p.location.href=f:void 0==a.open(f,"_blank")&&"undefined"!==typeof safari&&(a.location.href=f);d.readyState=d.DONE;k();s(f)},h=function(a){return function(){if(d.readyState!==d.DONE)return a.apply(this,arguments)}},m={create:!0,exclusive:!1},v;d.readyState=d.INIT;e||(e="download");if(w)f=(a.URL||a.webkitURL||a).createObjectURL(c),n.href=f,n.download=e,x(n),d.readyState=d.DONE,k(),s(f);else{a.chrome&&b&&"application/octet-stream"!==b&&(v=c.slice||c.webkitSlice,c=v.call(c,0,
c.size,"application/octet-stream"),l=!0);q&&"download"!==e&&(e+=".download");if("application/octet-stream"===b||q)p=a;u?(r+=c.size,u(a.TEMPORARY,r,h(function(a){a.root.getDirectory("saved",m,h(function(a){var b=function(){a.getFile(e,m,h(function(a){a.createWriter(h(function(b){b.onwriteend=function(b){p.location.href=a.toURL();d.readyState=d.DONE;t(d,"writeend",b);s(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&g()};["writestart","progress","write","abort"].forEach(function(a){b["on"+
a]=d["on"+a]});b.write(c);d.abort=function(){b.abort();d.readyState=d.DONE};d.readyState=d.WRITING}),g)}),g)};a.getFile(e,{create:!1},h(function(a){a.remove();b()}),h(function(a){a.code===a.NOT_FOUND_ERR?b():g()}))}),g)}),g)):g()}},b=m.prototype;b.abort=function(){this.readyState=this.DONE;t(this,"abort")};b.readyState=b.INIT=0;b.WRITING=1;b.DONE=2;b.error=b.onwritestart=b.onprogress=b.onwrite=b.onabort=b.onerror=b.onwriteend=null;return function(a,b){return new m(a,b)}}}("undefined"!==typeof self&&
self||"undefined"!==typeof window&&window||this.content);"undefined"!==typeof module&&null!==module?module.exports=savingAs:"undefined"!==typeof define&&null!==define&&null!=define.amd&&define("savingAs",function(){return savingAs});
/** @license jsPDF v1.5.3 | Copyright (c) 2010-2016 James Hall <james@parall.ax> [https://github.com/MrRio/jsPDF] | MIT License [https://github.com/MrRio/jsPDF/blob/master/MIT-LICENSE.txt] */
!function(t){"function"==typeof define&&define.amd?t():t()}(function(){"use strict";function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){if("object"!==se(t.console)){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=i)}var s,l,h,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,l="",h=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,h[s++]=c.charAt(e)+c.charAt(n)+c.charAt(r)+c.charAt(i),a<t.length;);l=h.join("");var u=t.length%3;return(u?l.slice(0,u-3):l)+"===".slice(u||3)}),void 0===t.atob&&(t.atob=function(t){var e,n,r,i,o,a,s=0,l=0,h=[];if(!t)return t;for(t+="";e=(a=c.indexOf(t.charAt(s++))<<18|c.indexOf(t.charAt(s++))<<12|(i=c.indexOf(t.charAt(s++)))<<6|(o=c.indexOf(t.charAt(s++))))>>16&255,n=a>>8&255,r=255&a,h[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s<t.length;);return h.join("")}),Array.prototype.map||(Array.prototype.map=function(t){if(null==this||"function"!=typeof t)throw new TypeError;for(var e=Object(this),n=e.length>>>0,r=new Array(n),i=1<arguments.length?arguments[1]:void 0,o=0;o<n;o++)o in e&&(r[o]=t.call(i,e[o],o,e));return r}),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){if(null==this||"function"!=typeof t)throw new TypeError;for(var n=Object(this),r=n.length>>>0,i=0;i<r;i++)i in n&&t.call(e,n[i],i,n)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=e[i];if(t.call(r,o,i,e))return o;i++}},configurable:!0,writable:!0}),Object.keys||(Object.keys=(s=Object.prototype.hasOwnProperty,l=!{toString:null}.propertyIsEnumerable("toString"),u=(h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(t){if("object"!==se(t)&&("function"!=typeof t||null===t))throw new TypeError;var e,n,r=[];for(e in t)s.call(t,e)&&r.push(e);if(l)for(n=0;n<u;n++)s.call(t,h[n])&&r.push(h[n]);return r})),"function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var n=arguments[e];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")}),String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")}),Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")());var t,e,n,_,l,F,P,p,d,k,a,o,s,h,u,c,r,i,f,g,m,y,v,w,b,x,I,C,B,N,L,A,S,j,E,M,O,q,T,R,D,U,z,H,W,V,G,Y,J,X,K,Z,Q,$,tt,et,nt,rt,it,ot,at,st,lt=function(ie){function oe(o){if("object"!==se(o))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var a={};this.subscribe=function(t,e,n){if(n=n||!1,"string"!=typeof t||"function"!=typeof e||"boolean"!=typeof n)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");a.hasOwnProperty(t)||(a[t]={});var r=Math.random().toString(35);return a[t][r]=[e,!!n],r},this.unsubscribe=function(t){for(var e in a)if(a[e][t])return delete a[e][t],0===Object.keys(a[e]).length&&delete a[e],!0;return!1},this.publish=function(t){if(a.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1),n=[];for(var r in a[t]){var i=a[t][r];try{i[0].apply(o,e)}catch(t){ie.console&&console.error("jsPDF PubSub Error",t.message,t)}i[1]&&n.push(r)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return a}}function ae(t,e,i,n){var r={},o=[],a=1;"object"===se(t)&&(t=(r=t).orientation,e=r.unit||e,i=r.format||i,n=r.compress||r.compressPdf||n,o=r.filters||(!0===n?["FlateEncode"]:o),a="number"==typeof r.userUnit?Math.abs(r.userUnit):1),e=e||"mm",t=(""+(t||"P")).toLowerCase();var s=r.putOnlyUsedFonts||!0,K={},l={internal:{},__private__:{}};l.__private__.PubSub=oe;var h="1.3",u=l.__private__.getPdfVersion=function(){return h},c=(l.__private__.setPdfVersion=function(t){h=t},{a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]}),f=(l.__private__.getPageFormats=function(){return c},l.__private__.getPageFormat=function(t){return c[t]});"string"==typeof i&&(i=f(i)),i=i||f("a4");var p,Z=l.f2=l.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(2)},Q=l.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return t.toFixed(3)},d="00000000000000000000000000000000",g=l.__private__.getFileId=function(){return d},m=l.__private__.setFileId=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d=t};l.setFileId=function(t){return m(t),this},l.getFileId=function(){return g()};var y=l.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),n=e<0?"+":"-",r=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),o=[n,P(r),"'",P(i),"'"].join("");return["D:",t.getFullYear(),P(t.getMonth()+1),P(t.getDate()),P(t.getHours()),P(t.getMinutes()),P(t.getSeconds()),o].join("")},v=l.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),a=parseInt(t.substr(14,2),10);parseInt(t.substr(16,2),10),parseInt(t.substr(20,2),10);return new Date(e,n,r,i,o,a,0)},w=l.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),"object"===se(t)&&"[object Date]"===Object.prototype.toString.call(t))e=y(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");e=t}return p=e},b=l.__private__.getCreationDate=function(t){var e=p;return"jsDate"===t&&(e=v(p)),e};l.setCreationDate=function(t){return w(t),this},l.getCreationDate=function(t){return b(t)};var x,N,L,A,S,$,_,F,P=l.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},k=!1,I=[],C=[],B=0,tt=(l.__private__.setCustomOutputDestination=function(t){N=t},l.__private__.resetCustomOutputDestination=function(t){N=void 0},l.__private__.out=function(t){var e;return t="string"==typeof t?t:t.toString(),(e=void 0===N?k?I[x]:C:N).push(t),k||(B+=t.length+1),e}),j=l.__private__.write=function(t){return tt(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},E=l.__private__.getArrayBuffer=function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},M=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]],et=(l.__private__.getStandardFonts=function(t){return M},r.fontSize||16),O=(l.__private__.setFontSize=l.setFontSize=function(t){return et=t,this},l.__private__.getFontSize=l.getFontSize=function(){return et}),nt=r.R2L||!1,q=(l.__private__.setR2L=l.setR2L=function(t){return nt=t,this},l.__private__.getR2L=l.getR2L=function(t){return nt},l.__private__.setZoomMode=function(t){var e=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^\d*\.?\d*\%$/.test(t))L=t;else if(isNaN(t)){if(-1===e.indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');L=t}else L=parseInt(t,10)}),T=(l.__private__.getZoomMode=function(){return L},l.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');A=t}),R=(l.__private__.getPageMode=function(){return A},l.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');S=t}),D=(l.__private__.getLayoutMode=function(){return S},l.__private__.setDisplayMode=l.setDisplayMode=function(t,e,n){return q(t),R(e),T(n),this},{title:"",subject:"",author:"",keywords:"",creator:""}),U=(l.__private__.getDocumentProperty=function(t){if(-1===Object.keys(D).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return D[t]},l.__private__.getDocumentProperties=function(t){return D},l.__private__.setDocumentProperties=l.setProperties=l.setDocumentProperties=function(t){for(var e in D)D.hasOwnProperty(e)&&t[e]&&(D[e]=t[e]);return this},l.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(D).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return D[t]=e},0),z=[],rt={},H={},W=0,V=[],G=[],it=new oe(l),Y=r.hotfixes||[],J=l.__private__.newObject=function(){var t=X();return ot(t,!0),t},X=l.__private__.newObjectDeferred=function(){return z[++U]=function(){return B},U},ot=function(t,e){return e="boolean"==typeof e&&e,z[t]=B,e&&tt(t+" 0 obj"),t},at=l.__private__.newAdditionalObject=function(){var t={objId:X(),content:""};return G.push(t),t},st=X(),lt=X(),ht=l.__private__.decodeColorString=function(t){var e=t.split(" ");if(2===e.length&&("g"===e[1]||"G"===e[1])){var n=parseFloat(e[0]);e=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return r},ut=l.__private__.encodeColorString=function(t){var e;"string"==typeof t&&(t={ch1:t});var n=t.ch1,r=t.ch2,i=t.ch3,o=t.ch4,a=(t.precision,"draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"]);if("string"==typeof n&&"#"!==n.charAt(0)){var s=new RGBColor(n);if(s.ok)n=s.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var l=parseInt(n.substr(1),16);n=l>>16&255,r=l>>8&255,i=255&l}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=Z(n/255)+" "+a[0];break;case 3:default:e=Q(n/255)+" "+a[0]}else if(void 0===o||"object"===se(o)){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.000","1.000","1.000",a[1]].join(" ");if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),a[1]].join(" ");break;default:case 3:e=[Q(n/255),Q(r/255),Q(i/255),a[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),Z(o/255),a[2]].join(" ");break;case 3:default:e=[Q(n/255),Q(r/255),Q(i/255),Q(o/255),a[2]].join(" ")}return e},ct=l.__private__.getFilters=function(){return o},ft=l.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||ct(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,o=e.length,a={};!0===n&&(n=["FlateEncode"]);var s=t.additionalKeyValues||[],l=(a=void 0!==ae.API.processDataByFilters?ae.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());0!==a.data.length&&(s.push({key:"Length",value:a.data.length}),!0===i&&s.push({key:"Length1",value:o})),0!=l.length&&(l.split("/").length-1==1?s.push({key:"Filter",value:l}):s.push({key:"Filter",value:"["+l+"]"})),tt("<<");for(var h=0;h<s.length;h++)tt("/"+s[h].key+" "+s[h].value);tt(">>"),0!==a.data.length&&(tt("stream"),tt(a.data),tt("endstream"))},pt=l.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;ot(r,!0);V[x].mediaBox.topRightX,V[x].mediaBox.bottomLeftX,V[x].mediaBox.topRightY,V[x].mediaBox.bottomLeftY;tt("<</Type /Page"),tt("/Parent "+t.rootDictionaryObjId+" 0 R"),tt("/Resources "+t.resourceDictionaryObjId+" 0 R"),tt("/MediaBox ["+parseFloat(Z(t.mediaBox.bottomLeftX))+" "+parseFloat(Z(t.mediaBox.bottomLeftY))+" "+Z(t.mediaBox.topRightX)+" "+Z(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&tt("/CropBox ["+Z(t.cropBox.bottomLeftX)+" "+Z(t.cropBox.bottomLeftY)+" "+Z(t.cropBox.topRightX)+" "+Z(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&tt("/BleedBox ["+Z(t.bleedBox.bottomLeftX)+" "+Z(t.bleedBox.bottomLeftY)+" "+Z(t.bleedBox.topRightX)+" "+Z(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&tt("/TrimBox ["+Z(t.trimBox.bottomLeftX)+" "+Z(t.trimBox.bottomLeftY)+" "+Z(t.trimBox.topRightX)+" "+Z(t.trimBox.topRightY)+"]"),null!==t.artBox&&tt("/ArtBox ["+Z(t.artBox.bottomLeftX)+" "+Z(t.artBox.bottomLeftY)+" "+Z(t.artBox.topRightX)+" "+Z(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&tt("/UserUnit "+t.userUnit),it.publish("putPage",{objId:r,pageContext:V[e],pageNumber:e,page:n}),tt("/Contents "+i+" 0 R"),tt(">>"),tt("endobj");var o=n.join("\n");return ot(i,!0),ft({data:o,filters:ct()}),tt("endobj"),r},dt=l.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=W;t++)V[t].objId=X(),V[t].contentsObjId=X();for(t=1;t<=W;t++)n.push(pt({number:t,data:I[t],objId:V[t].objId,contentsObjId:V[t].contentsObjId,mediaBox:V[t].mediaBox,cropBox:V[t].cropBox,bleedBox:V[t].bleedBox,trimBox:V[t].trimBox,artBox:V[t].artBox,userUnit:V[t].userUnit,rootDictionaryObjId:st,resourceDictionaryObjId:lt}));ot(st,!0),tt("<</Type /Pages");var r="/Kids [";for(e=0;e<W;e++)r+=n[e]+" 0 R ";tt(r+"]"),tt("/Count "+W),tt(">>"),tt("endobj"),it.publish("postPutPages")},gt=function(){!function(){for(var t in rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&(e=rt[t],it.publish("putFont",{font:e,out:tt,newObject:J,putStream:ft}),!0!==e.isAlreadyPutted&&(e.objectNumber=J(),tt("<<"),tt("/Type /Font"),tt("/BaseFont /"+e.postScriptName),tt("/Subtype /Type1"),"string"==typeof e.encoding&&tt("/Encoding /"+e.encoding),tt("/FirstChar 32"),tt("/LastChar 255"),tt(">>"),tt("endobj")));var e}(),it.publish("putResources"),ot(lt,!0),tt("<<"),function(){for(var t in tt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),tt("/Font <<"),rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&tt("/"+t+" "+rt[t].objectNumber+" 0 R");tt(">>"),tt("/XObject <<"),it.publish("putXobjectDict"),tt(">>")}(),tt(">>"),tt("endobj"),it.publish("postPutResources")},mt=function(t,e,n){H.hasOwnProperty(e)||(H[e]={}),H[e][n]=t},yt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(rt).length+1).toString(10),a={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return it.publish("addFont",{font:a,instance:this}),void 0!==o&&(rt[o]=a,mt(o,e,n)),o},vt=l.__private__.pdfEscape=l.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,a,s,l,h,u;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&rt[$].metadata&&rt[$].metadata[i]&&rt[$].metadata[i].encoding&&(o=rt[$].metadata[i].encoding,!a&&rt[$].encoding&&(a=rt[$].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(l=!1,s=[],n=0,r=t.length;n<r;n++)(h=a[t.charCodeAt(n)])?s.push(String.fromCharCode(h)):s.push(t[n]),s[n].charCodeAt(0)>>8&&(l=!0);t=s.join("")}for(n=t.length;void 0===l&&0!==n;)t.charCodeAt(n-1)>>8&&(l=!0),n--;if(!l)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n<r;n++){if((u=(h=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(u),s.push(h-(u<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},wt=l.__private__.beginPage=function(t,e){var n,r="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&(n=f(t.toLowerCase()))&&(t=n[0],e=n[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=i[0],e=i[1]),r){switch(r.substr(0,1)){case"l":t<e&&(r="s");break;case"p":e<t&&(r="s")}"s"===r&&(n=t,t=e,e=n)}(14400<t||14400<e)&&(console.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),t=Math.min(14400,t),e=Math.min(14400,e)),i=[t,e],k=!0,I[++W]=[],V[W]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t),topRightY:Number(e)}},xt(W)},bt=function(){wt.apply(this,arguments),Dt(Rt),tt(Jt),0!==te&&tt(te+" J"),0!==ne&&tt(ne+" j"),it.publish("addPage",{pageNumber:W})},xt=function(t){0<t&&t<=W&&(x=t)},Nt=l.__private__.getNumberOfPages=l.getNumberOfPages=function(){return I.length-1},Lt=function(t,e,n){var r,i=void 0;return n=n||{},t=void 0!==t?t:rt[$].fontName,e=void 0!==e?e:rt[$].fontStyle,r=t.toLowerCase(),void 0!==H[r]&&void 0!==H[r][e]?i=H[r][e]:void 0!==H[t]&&void 0!==H[t][e]?i=H[t][e]:!1===n.disableWarning&&console.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=H.times[e])&&(i=H.times.normal),i},At=l.__private__.putInfo=function(){for(var t in J(),tt("<<"),tt("/Producer (jsPDF "+ae.version+")"),D)D.hasOwnProperty(t)&&D[t]&&tt("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+vt(D[t])+")");tt("/CreationDate ("+p+")"),tt(">>"),tt("endobj")},St=l.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||st;switch(J(),tt("<<"),tt("/Type /Catalog"),tt("/Pages "+e+" 0 R"),L||(L="fullwidth"),L){case"fullwidth":tt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":tt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":tt("/OpenAction [3 0 R /Fit]");break;case"original":tt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+L;"%"===n.substr(n.length-1)&&(L=parseInt(L)/100),"number"==typeof L&&tt("/OpenAction [3 0 R /XYZ null null "+Z(L)+"]")}switch(S||(S="continuous"),S){case"continuous":tt("/PageLayout /OneColumn");break;case"single":tt("/PageLayout /SinglePage");break;case"two":case"twoleft":tt("/PageLayout /TwoColumnLeft");break;case"tworight":tt("/PageLayout /TwoColumnRight")}A&&tt("/PageMode /"+A),it.publish("putCatalog"),tt(">>"),tt("endobj")},_t=l.__private__.putTrailer=function(){tt("trailer"),tt("<<"),tt("/Size "+(U+1)),tt("/Root "+U+" 0 R"),tt("/Info "+(U-1)+" 0 R"),tt("/ID [ <"+d+"> <"+d+"> ]"),tt(">>")},Ft=l.__private__.putHeader=function(){tt("%PDF-"+h),tt("%ºß¬à")},Pt=l.__private__.putXRef=function(){var t=1,e="0000000000";for(tt("xref"),tt("0 "+(U+1)),tt("0000000000 65535 f "),t=1;t<=U;t++){"function"==typeof z[t]?tt((e+z[t]()).slice(-10)+" 00000 n "):void 0!==z[t]?tt((e+z[t]).slice(-10)+" 00000 n "):tt("0000000000 00000 n ")}},kt=l.__private__.buildDocument=function(){k=!1,B=U=0,C=[],z=[],G=[],st=X(),lt=X(),it.publish("buildDocument"),Ft(),dt(),function(){it.publish("putAdditionalObjects");for(var t=0;t<G.length;t++){var e=G[t];ot(e.objId,!0),tt(e.content),tt("endobj")}it.publish("postPutAdditionalObjects")}(),gt(),At(),St();var t=B;return Pt(),_t(),tt("startxref"),tt(""+t),tt("%%EOF"),k=!0,C.join("\n")},It=l.__private__.getBlob=function(t){return new Blob([E(t)],{type:"application/pdf"})},Ct=l.output=l.__private__.output=((F=function(t,e){e=e||{};var n=kt();switch("string"==typeof e?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return n;case"save":l.save(e.filename);break;case"arraybuffer":return E(n);case"blob":return It(n);case"bloburi":case"bloburl":if(void 0!==ie.URL&&"function"==typeof ie.URL.createObjectURL)return ie.URL&&ie.URL.createObjectURL(It(n))||void 0;console.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":return"data:application/pdf;filename="+e.filename+";base64,"+btoa(n);case"dataurlnewwindow":var r='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="'+this.output("datauristring")+'"></iframe></body></html>',i=ie.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return ie.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1<Y.indexOf(t)};switch(e){case"pt":_=1;break;case"mm":_=72/25.4;break;case"cm":_=72/2.54;break;case"in":_=72;break;case"px":_=1==Bt("px_scaling")?.75:96/72;break;case"pc":case"em":_=12;break;case"ex":_=6;break;default:throw new Error("Invalid unit: "+e)}w(),m();var jt=l.__private__.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:V[t].objId,pageNumber:t,pageContext:V[t]}},Et=l.__private__.getPageInfoByObjId=function(t){for(var e in V)if(V[e].objId===t)break;if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");return jt(e)},Mt=l.__private__.getCurrentPageInfo=function(){return{objId:V[x].objId,pageNumber:x,pageContext:V[x]}};l.addPage=function(){return bt.apply(this,arguments),this},l.setPage=function(){return xt.apply(this,arguments),this},l.insertPage=function(t){return this.addPage(),this.movePage(x,t),this},l.movePage=function(t,e){if(e<t){for(var n=I[t],r=V[t],i=t;e<i;i--)I[i]=I[i-1],V[i]=V[i-1];I[e]=n,V[e]=r,this.setPage(e)}else if(t<e){for(n=I[t],r=V[t],i=t;i<e;i++)I[i]=I[i+1],V[i]=V[i+1];I[e]=n,V[e]=r,this.setPage(e)}return this},l.deletePage=function(){return function(t){0<t&&t<=W&&(I.splice(t,1),--W<x&&(x=W),this.setPage(x))}.apply(this,arguments),this};l.__private__.text=l.text=function(t,e,n,i){var r;"number"!=typeof t||"number"!=typeof e||"string"!=typeof n&&!Array.isArray(n)||(r=n,n=e,e=t,t=r);var o=arguments[3],a=arguments[4],s=arguments[5];if("object"===se(o)&&null!==o||("string"==typeof a&&(s=a,a=null),"string"==typeof o&&(s=o,o=null),"number"==typeof o&&(a=o,o=null),i={flags:o,angle:a,align:s}),(o=o||{}).noBOM=o.noBOM||!0,o.autoencode=o.autoencode||!0,isNaN(e)||isNaN(n)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return c;var l,h="",u="number"==typeof i.lineHeightFactor?i.lineHeightFactor:Tt,c=i.scope||this;function f(t){for(var e,n=t.concat(),r=[],i=n.length;i--;)"string"==typeof(e=n.shift())?r.push(e):Array.isArray(t)&&1===e.length?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function p(t,e){var n;if("string"==typeof t)n=e(t)[0];else if(Array.isArray(t)){for(var r,i,o=t.concat(),a=[],s=o.length;s--;)"string"==typeof(r=o.shift())?a.push(e(r)[0]):Array.isArray(r)&&"string"===r[0]&&(i=e(r[0],r[1],r[2]),a.push([i[0],i[1],i[2]]));n=a}return n}var d=!1,g=!0;if("string"==typeof t)d=!0;else if(Array.isArray(t)){for(var m,y=t.concat(),v=[],w=y.length;w--;)("string"!=typeof(m=y.shift())||Array.isArray(m)&&"string"!=typeof m[0])&&(g=!1);d=g}if(!1===d)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');var b=rt[$].encoding;"WinAnsiEncoding"!==b&&"StandardEncoding"!==b||(t=p(t,function(t,e,n){return[(r=t,r=r.split("\t").join(Array(i.TabLen||9).join(" ")),vt(r,o)),e,n];var r})),"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]);var x=et/c.internal.scaleFactor,N=x*(Tt-1);switch(i.baseline){case"bottom":n-=N;break;case"top":n+=x-N;break;case"hanging":n+=x-2*N;break;case"middle":n+=x/2-N}0<(O=i.maxWidth||0)&&("string"==typeof t?t=c.splitTextToSize(t,O):"[object Array]"===Object.prototype.toString.call(t)&&(t=c.splitTextToSize(t.join(" "),O)));var L={text:t,x:e,y:n,options:i,mutex:{pdfEscape:vt,activeFontKey:$,fonts:rt,activeFontSize:et}};it.publish("preProcessText",L),t=L.text;a=(i=L.options).angle;var A=c.internal.scaleFactor,S=[];if(a){a*=Math.PI/180;var _=Math.cos(a),F=Math.sin(a);S=[Z(_),Z(F),Z(-1*F),Z(_)]}void 0!==(M=i.charSpace)&&(h+=Q(M*A)+" Tc\n");i.lang;var P=-1,k=void 0!==i.renderingMode?i.renderingMode:i.stroke,I=c.internal.getCurrentPageInfo().pageContext;switch(k){case 0:case!1:case"fill":P=0;break;case 1:case!0:case"stroke":P=1;break;case 2:case"fillThenStroke":P=2;break;case 3:case"invisible":P=3;break;case 4:case"fillAndAddForClipping":P=4;break;case 5:case"strokeAndAddPathForClipping":P=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":P=6;break;case 7:case"addToPathForClipping":P=7}var C=void 0!==I.usedRenderingMode?I.usedRenderingMode:-1;-1!==P?h+=P+" Tr\n":-1!==C&&(h+="0 Tr\n"),-1!==P&&(I.usedRenderingMode=P);s=i.align||"left";var B=et*u,j=c.internal.pageSize.getWidth(),E=(A=c.internal.scaleFactor,rt[$]),M=i.charSpace||Qt,O=i.maxWidth||0,q=(o={},[]);if("[object Array]"===Object.prototype.toString.call(t)){var T,R;v=f(t);"left"!==s&&(R=v.map(function(t){return c.getStringUnitWidth(t,{font:E,charSpace:M,fontSize:et})*et/A}));var D,U=Math.max.apply(Math,R),z=0;if("right"===s){e-=R[0],t=[];var H=0;for(w=v.length;H<w;H++)U-R[H],T=0===H?(D=Wt(e),Vt(n)):(D=(z-R[H])*A,-B),t.push([v[H],D,T]),z=R[H]}else if("center"===s){e-=R[0]/2,t=[];for(H=0,w=v.length;H<w;H++)(U-R[H])/2,T=0===H?(D=Wt(e),Vt(n)):(D=(z-R[H])/2*A,-B),t.push([v[H],D,T]),z=R[H]}else if("left"===s){t=[];for(H=0,w=v.length;H<w;H++)T=0===H?Vt(n):-B,D=0===H?Wt(e):0,t.push(v[H])}else{if("justify"!==s)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[];for(O=0!==O?O:j,H=0,w=v.length;H<w;H++)T=0===H?Vt(n):-B,D=0===H?Wt(e):0,H<w-1&&q.push(((O-R[H])/(v[H].split(" ").length-1)*A).toFixed(2)),t.push([v[H],D,T])}}!0===("boolean"==typeof i.R2L?i.R2L:nt)&&(t=p(t,function(t,e,n){return[t.split("").reverse().join(""),e,n]}));L={text:t,x:e,y:n,options:i,mutex:{pdfEscape:vt,activeFontKey:$,fonts:rt,activeFontSize:et}};it.publish("postProcessText",L),t=L.text,l=L.mutex.isHex;v=f(t);t=[];var W,V,G,Y=0,J=(w=v.length,"");for(H=0;H<w;H++)J="",Array.isArray(v[H])?(W=parseFloat(v[H][1]),V=parseFloat(v[H][2]),G=(l?"<":"(")+v[H][0]+(l?">":")"),Y=1):(W=Wt(e),V=Vt(n),G=(l?"<":"(")+v[H]+(l?">":")")),void 0!==q&&void 0!==q[H]&&(J=q[H]+" Tw\n"),0!==S.length&&0===H?t.push(J+S.join(" ")+" "+W.toFixed(2)+" "+V.toFixed(2)+" Tm\n"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+" "+V.toFixed(2)+" Td\n"+G):t.push(J+G);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var X="BT\n/"+$+" "+et+" Tf\n"+(et*u).toFixed(2)+" TL\n"+Kt+"\n";return X+=h,X+=t,tt(X+="ET"),K[$]=!0,c},l.__private__.lstext=l.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},l.__private__.clip=l.clip=function(t){tt("evenodd"===t?"W*":"W"),tt("n")},l.__private__.clip_fixed=l.clip_fixed=function(t){console.log("clip_fixed is deprecated"),l.clip(t)};var Ot=l.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},qt=l.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};l.__private__.line=l.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},l.__private__.lines=l.lines=function(t,e,n,r,i,o){var a,s,l,h,u,c,f,p,d,g,m,y;if("number"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Ot(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(tt(Q(Wt(e))+" "+Q(Vt(n))+" m "),a=r[0],s=r[1],h=t.length,g=e,m=n,l=0;l<h;l++)2===(u=t[l]).length?(g=u[0]*a+g,m=u[1]*s+m,tt(Q(Wt(g))+" "+Q(Vt(m))+" l")):(c=u[0]*a+g,f=u[1]*s+m,p=u[2]*a+g,d=u[3]*s+m,g=u[4]*a+g,m=u[5]*s+m,tt(Q(Wt(c))+" "+Q(Vt(f))+" "+Q(Wt(p))+" "+Q(Vt(d))+" "+Q(Wt(g))+" "+Q(Vt(m))+" c"));return o&&tt(" h"),null!==i&&tt(qt(i)),this},l.__private__.rect=l.rect=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ot(i))throw new Error("Invalid arguments passed to jsPDF.rect");return tt([Z(Wt(t)),Z(Vt(e)),Z(n*_),Z(-r*_),"re"].join(" ")),null!==i&&tt(qt(i)),this},l.__private__.triangle=l.triangle=function(t,e,n,r,i,o,a){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!Ot(a))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-t,r-e],[i-n,o-r],[t-i,e-o]],t,e,[1,1],a,!0),this},l.__private__.roundedRect=l.roundedRect=function(t,e,n,r,i,o,a){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!Ot(a))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var s=4/3*(Math.SQRT2-1);return this.lines([[n-2*i,0],[i*s,0,i,o-o*s,i,o],[0,r-2*o],[0,o*s,-i*s,o,-i,o],[2*i-n,0],[-i*s,0,-i,-o*s,-i,-o],[0,2*o-r],[0,-o*s,i*s,-o,i,-o]],t+i,e,[1,1],a),this},l.__private__.ellipse=l.ellipse=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ot(i))throw new Error("Invalid arguments passed to jsPDF.ellipse");var o=4/3*(Math.SQRT2-1)*n,a=4/3*(Math.SQRT2-1)*r;return tt([Z(Wt(t+n)),Z(Vt(e)),"m",Z(Wt(t+n)),Z(Vt(e-a)),Z(Wt(t+o)),Z(Vt(e-r)),Z(Wt(t)),Z(Vt(e-r)),"c"].join(" ")),tt([Z(Wt(t-o)),Z(Vt(e-r)),Z(Wt(t-n)),Z(Vt(e-a)),Z(Wt(t-n)),Z(Vt(e)),"c"].join(" ")),tt([Z(Wt(t-n)),Z(Vt(e+a)),Z(Wt(t-o)),Z(Vt(e+r)),Z(Wt(t)),Z(Vt(e+r)),"c"].join(" ")),tt([Z(Wt(t+o)),Z(Vt(e+r)),Z(Wt(t+n)),Z(Vt(e+a)),Z(Wt(t+n)),Z(Vt(e)),"c"].join(" ")),null!==i&&tt(qt(i)),this},l.__private__.circle=l.circle=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||!Ot(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,e,n,n,r)};l.setFont=function(t,e){return $=Lt(t,e,{disableWarning:!1}),this},l.setFontStyle=l.setFontType=function(t){return $=Lt(void 0,t),this};l.__private__.getFontList=l.getFontList=function(){var t,e,n,r={};for(t in H)if(H.hasOwnProperty(t))for(e in r[t]=n=[],H[t])H[t].hasOwnProperty(e)&&n.push(e);return r};l.addFont=function(t,e,n,r){yt.call(this,t,e,n,r=r||"Identity-H")};var Tt,Rt=r.lineWidth||.200025,Dt=l.__private__.setLineWidth=l.setLineWidth=function(t){return tt((t*_).toFixed(2)+" w"),this},Ut=(l.__private__.setLineDash=ae.API.setLineDash=function(t,e){if(t=t||[],e=e||0,isNaN(e)||!Array.isArray(t))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return t=t.map(function(t){return(t*_).toFixed(3)}).join(" "),e=parseFloat((e*_).toFixed(3)),tt("["+t+"] "+e+" d"),this},l.__private__.getLineHeight=l.getLineHeight=function(){return et*Tt}),zt=(Ut=l.__private__.getLineHeight=l.getLineHeight=function(){return et*Tt},l.__private__.setLineHeightFactor=l.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(Tt=t),this}),Ht=l.__private__.getLineHeightFactor=l.getLineHeightFactor=function(){return Tt};zt(r.lineHeight);var Wt=l.__private__.getHorizontalCoordinate=function(t){return t*_},Vt=l.__private__.getVerticalCoordinate=function(t){return V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY-t*_},Gt=l.__private__.getHorizontalCoordinateString=function(t){return Z(t*_)},Yt=l.__private__.getVerticalCoordinateString=function(t){return Z(V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY-t*_)},Jt=r.strokeColor||"0 G",Xt=(l.__private__.getStrokeColor=l.getDrawColor=function(){return ht(Jt)},l.__private__.setStrokeColor=l.setDrawColor=function(t,e,n,r){return Jt=ut({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"draw",precision:2}),tt(Jt),this},r.fillColor||"0 g"),Kt=(l.__private__.getFillColor=l.getFillColor=function(){return ht(Xt)},l.__private__.setFillColor=l.setFillColor=function(t,e,n,r){return Xt=ut({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"fill",precision:2}),tt(Xt),this},r.textColor||"0 g"),Zt=l.__private__.getTextColor=l.getTextColor=function(){return ht(Kt)},Qt=(l.__private__.setTextColor=l.setTextColor=function(t,e,n,r){return Kt=ut({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"text",precision:3}),this},r.charSpace||0),$t=l.__private__.getCharSpace=l.getCharSpace=function(){return Qt},te=(l.__private__.setCharSpace=l.setCharSpace=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Qt=t,this},0);l.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2};l.__private__.setLineCap=l.setLineCap=function(t){var e=l.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return tt((te=e)+" J"),this};var ee,ne=0;l.__private__.setLineJoin=l.setLineJoin=function(t){var e=l.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return tt((ne=e)+" j"),this},l.__private__.setMiterLimit=l.setMiterLimit=function(t){if(t=t||0,isNaN(t))throw new Error("Invalid argument passed to jsPDF.setMiterLimit");return ee=parseFloat(Z(t*_)),tt(ee+" M"),this};for(var re in l.save=function(r,t){if(r=r||"generated.pdf",(t=t||{}).returnPromise=t.returnPromise||!1,!1!==t.returnPromise)return new Promise(function(t,e){try{var n=le(It(kt()),r);"function"==typeof le.unload&&ie.setTimeout&&setTimeout(le.unload,911),t(n)}catch(t){e(t.message)}});le(It(kt()),r),"function"==typeof le.unload&&ie.setTimeout&&setTimeout(le.unload,911)},ae.API)ae.API.hasOwnProperty(re)&&("events"===re&&ae.API.events.length?function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0],r=e[i][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(it,ae.API.events):l[re]=ae.API[re]);return l.internal={pdfEscape:vt,getStyle:qt,getFont:function(){return rt[Lt.apply(l,arguments)]},getFontSize:O,getCharSpace:$t,getTextColor:Zt,getLineHeight:Ut,getLineHeightFactor:Ht,write:j,getHorizontalCoordinate:Wt,getVerticalCoordinate:Vt,getCoordinateString:Gt,getVerticalCoordinateString:Yt,collections:{},newObject:J,newAdditionalObject:at,newObjectDeferred:X,newObjectDeferredBegin:ot,getFilters:ct,putStream:ft,events:it,scaleFactor:_,pageSize:{getWidth:function(){return(V[x].mediaBox.topRightX-V[x].mediaBox.bottomLeftX)/_},setWidth:function(t){V[x].mediaBox.topRightX=t*_+V[x].mediaBox.bottomLeftX},getHeight:function(){return(V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY)/_},setHeight:function(t){V[x].mediaBox.topRightY=t*_+V[x].mediaBox.bottomLeftY}},output:Ct,getNumberOfPages:Nt,pages:I,out:tt,f2:Z,f3:Q,getPageInfo:jt,getPageInfoByObjId:Et,getCurrentPageInfo:Mt,getPDFVersion:u,hasHotfix:Bt},Object.defineProperty(l.internal.pageSize,"width",{get:function(){return(V[x].mediaBox.topRightX-V[x].mediaBox.bottomLeftX)/_},set:function(t){V[x].mediaBox.topRightX=t*_+V[x].mediaBox.bottomLeftX},enumerable:!0,configurable:!0}),Object.defineProperty(l.internal.pageSize,"height",{get:function(){return(V[x].mediaBox.topRightY-V[x].mediaBox.bottomLeftY)/_},set:function(t){V[x].mediaBox.topRightY=t*_+V[x].mediaBox.bottomLeftY},enumerable:!0,configurable:!0}),function(t){for(var e=0,n=M.length;e<n;e++){var r=yt(t[e][0],t[e][1],t[e][2],M[e][3],!0);K[r]=!0;var i=t[e][0].split("-");mt(r,i[0],i[1]||"")}it.publish("addFonts",{fonts:rt,dictionary:H})}(M),$="F1",bt(i,t),it.publish("initialized"),l}return ae.API={events:[]},ae.version="1.5.3",ie.jsPDF=ae,"function"==typeof define&&define.amd?define("jsPDF",function(){return ae}):"undefined"!=typeof module&&module.exports?(module.exports=ae,module.exports.jsPDF=ae):ie.jsPDF=ae,ae}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")());
/**
   * @license
   * Copyright (c) 2016 Alexander Weidt,
   * https://github.com/BiggA94
   * 
   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
   */
(function(t,e){var A,n=1,S=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},y=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},_=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(2)},s=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(5)};t.__acroform__={};var r=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},v=function(t){return t*n},w=function(t){return t/n},l=function(t){var e=new j,n=Y.internal.getHeight(t)||0,r=Y.internal.getWidth(t)||0;return e.BBox=[0,0,Number(_(r)),Number(_(n))],e},i=t.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<<e},o=t.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&=~(1<<e)},a=t.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<e)?0:1},b=t.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return a(t,e-1)},x=t.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return i(t,e-1)},N=t.__acroform__.clearBitForPdf=function(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return o(t,e-1)},c=t.__acroform__.calculateCoordinates=function(t){var e=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,r=t[0],i=t[1],o=t[2],a=t[3],s={};return s.lowerLeft_X=e(r)||0,s.lowerLeft_Y=n(i+a)||0,s.upperRight_X=e(r+o)||0,s.upperRight_Y=n(i)||0,[Number(_(s.lowerLeft_X)),Number(_(s.lowerLeft_Y)),Number(_(s.upperRight_X)),Number(_(s.upperRight_Y))]},f=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,r=h(t,n),i=A.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(A.__private__.encodeColorString(t.color)),e.push("/"+i+" "+_(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var o=new l(t);return o.stream=e.join("\n"),o}},h=function(i,t){var e=i.maxFontSize||12,n=(i.fontName,{text:"",fontSize:""}),o=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" "),r=(A.__private__.encodeColorString(i.color),e),a=Y.internal.getHeight(i)||0;a=a<0?-a:a;var s=Y.internal.getWidth(i)||0;s=s<0?-s:s;var l=function(t,e,n){if(t+1<o.length){var r=e+" "+o[t+1];return F(r,i,n).width<=s-4}return!1};r++;t:for(;;){t="";var h=F("3",i,--r).height,u=i.multiline?a-r:(a-h)/2,c=-2,f=u+=2,p=0,d=0,g=0;if(r<=0){t="(...) Tj\n",t+="% Width of Text: "+F(t,i,r=12).width+", FieldWidth:"+s+"\n";break}g=F(o[0]+" ",i,r).width;var m="",y=0;for(var v in o)if(o.hasOwnProperty(v)){m=" "==(m+=o[v]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var w=parseInt(v);g=F(m+" ",i,r).width;var b=l(w,m,r),x=v>=o.length-1;if(b&&!x){m+=" ";continue}if(b||x){if(x)d=w;else if(i.multiline&&a<(h+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(a<(h+2)*(y+2)+2)continue t;d=w}for(var N="",L=p;L<=d;L++)N+=o[L]+" ";switch(N=" "==N.substr(N.length-1)?N.substr(0,N.length-1):N,g=F(N,i,r).width,i.textAlign){case"right":c=s-g-2;break;case"center":c=(s-g)/2;break;case"left":default:c=2}t+=_(c)+" "+_(f)+" Td\n",t+="("+S(N)+") Tj\n",t+=-_(c)+" 0 Td\n",f=-(r+2),g=0,p=d+1,y++,m=""}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},u={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:"reference",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},L=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=c.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),"object"===se(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);i.push({key:"AP",value:"<</N "+a+">>"}),A.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var s="";for(var l in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(l)){var h=r.appearanceStreamContent[l];if(s+="/"+l+" ",s+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var u;if(h.hasOwnProperty(n))"function"==typeof(u=h[n])&&(u=u.call(this,r)),s+="/"+n+" "+u+" ",0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u)}else"function"==typeof(u=h)&&(u=u.call(this,r)),s+="/"+n+" "+u,0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u);s+=">>"}i.push({key:"AP",value:"<<\n"+s+">>"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out("endobj")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"===se(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,M.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(u)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",p),A.internal.events.subscribe("putCatalog",g),A.internal.events.subscribe("postPutPages",L),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n<t.length;n++)switch(0!==n&&(e+=" "),se(t[n])){case"boolean":case"number":case"object":e+=t[n].toString();break;case"string":"/"!==t[n].substr(0,1)?e+="("+S(t[n].toString())+")":e+=t[n].toString()}return e+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")};var C=function(t){return(t=t||"").toString(),t="("+S(t)+")"},B=function(){var e;Object.defineProperty(this,"objId",{configurable:!0,get:function(){if(e||(e=A.internal.newObjectDeferred()),!e)throw new Error("AcroFormPDFObject: Couldn't create Object ID");return e},set:function(t){e=t}})};B.prototype.toString=function(){return this.objId+" 0 R"},B.prototype.putStream=function(){var t=this.getKeyValueListForStream();A.internal.putStream({data:this.stream,additionalKeyValues:t}),A.internal.out("endobj")},B.prototype.getKeyValueListForStream=function(){return function(t){var e=[],n=Object.getOwnPropertyNames(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n)if(!1===Object.getOwnPropertyDescriptor(t,n[r]).configurable){var i=n[r],o=t[i];o&&(Array.isArray(o)?e.push({key:i,value:I(o)}):o instanceof B?e.push({key:i,value:o.objId+" 0 R"}):"function"!=typeof o&&e.push({key:i,value:o}))}return e}(this)};var j=function(){B.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writeable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writeable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writeable:!0});var e,n=[];Object.defineProperty(this,"BBox",{configurable:!1,writeable:!0,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writeable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};r(j,B);var E=function(){B.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return 0<t.length?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e)return"("+e+")"},set:function(t){e=t}})};r(E,B);var M=function t(){B.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute F supplied.');e=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(e,3))},set:function(t){!0===Boolean(t)?this.F=x(e,3):this.F=N(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');n=t}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(t){r=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:w(r[0])},set:function(t){r[0]=v(t)}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:w(r[1])},set:function(t){r[1]=v(t)}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:w(r[2])},set:function(t){r[2]=v(t)}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:w(r[3])},set:function(t){r[3]=v(t)}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var o=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!o||o.length<1){if(this instanceof H)return;o="FieldObject"+t.FieldNum++}return"("+S(o)+")"},set:function(t){o=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return o},set:function(t){o=t}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(t){a=t}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(t){s=t}});var l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return w(l)},set:function(t){l=v(t)}});var h=50;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return w(h)},set:function(t){h=v(t)}});var u="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return u},set:function(t){u=t}});var c="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!c||this instanceof H||this instanceof V))return C(c)},set:function(t){t=t.toString(),c=t}});var f=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof D==!1?C(f):f},set:function(t){t=t.toString(),f=this instanceof D==!1?"("===t.substr(0,1)?y(t.substr(1,t.length-2)):y(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof D==!0?y(f.substr(1,f.length-1)):f},set:function(t){t=t.toString(),f=this instanceof D==!0?"/"+t:t}});var p=null;Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof D==!1?C(p):p},set:function(t){t=t.toString(),p=this instanceof D==!1?"("===t.substr(0,1)?y(t.substr(1,t.length-2)):y(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof D==!0?y(p.substr(1,p.length-1)):p},set:function(t){t=t.toString(),p=this instanceof D==!0?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var d,g=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,writeable:!0,get:function(){return g},set:function(t){t=Boolean(t),g=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writeable:!0,get:function(){if(d)return d},set:function(t){d=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,1):this.Ff=N(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,2):this.Ff=N(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,3):this.Ff=N(this.Ff,3)}});var m=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==m)return m},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');m=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t="left";switch(m){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:m=2;break;case"center":case 1:m=1;break;case"left":case 0:default:m=0}}})};r(M,B);var O=function(){M.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var r=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return I(r)},set:function(t){var e,n;n=[],"string"==typeof(e=t)&&(n=function(t,e,n){n||(n=1);for(var r,i=[];r=e.exec(t);)i.push(r[n]);return i}(e,/\((.*?)\)/g)),r=n}}),this.getOptions=function(){return r},this.setOptions=function(t){r=t,this.sort&&r.sort()},this.addOption=function(t){t=(t=t||"").toString(),r.push(t),this.sort&&r.sort()},this.removeOption=function(t,e){for(e=e||!1,t=(t=t||"").toString();-1!==r.indexOf(t)&&(r.splice(r.indexOf(t),1),!1!==e););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,18):this.Ff=N(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=x(this.Ff,19):this.Ff=N(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=x(this.Ff,20),r.sort()):this.Ff=N(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,22):this.Ff=N(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,27):this.Ff=N(this.Ff,27)}}),this.hasAppearanceStream=!1};r(O,M);var q=function(){O.call(this),this.fontName="helvetica",this.combo=!1};r(q,O);var T=function(){q.call(this),this.combo=!0};r(T,q);var R=function(){T.call(this),this.edit=!0};r(R,T);var D=function(){M.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,15):this.Ff=N(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,16):this.Ff=N(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,17):this.Ff=N(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){if(0!==Object.keys(n).length){var t,e=[];for(t in e.push("<<"),n)e.push("/"+t+" ("+n[t]+")");return e.push(">>"),e.join("\n")}},set:function(t){"object"===se(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};r(D,M);var U=function(){D.call(this),this.pushButton=!0};r(U,D);var z=function(){D.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(z,D);var H=function(){var e,n;M.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===se(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,M),z.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},z.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){D.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,D);var V=function(){M.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=N(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=N(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=N(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=N(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,M);var G=function(){V.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=N(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=l(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=h(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+_(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=l(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),a=Y.internal.getWidth(t),s=h(t,t.caption);return i.push("1 g"),i.push("0 0 "+_(a)+" "+_(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+_(a-1)+" "+_(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+_(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),a=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(_(r.x1.x)+" "+_(r.x1.y)+" m"),n.push(_(r.x2.x)+" "+_(r.x2.y)+" l"),n.push(_(r.x4.x)+" "+_(r.x4.y)+" m"),n.push(_(r.x3.x)+" "+_(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=Y.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(_(n.x1.x)+" "+_(n.x1.y)+" m"),r.push(_(n.x2.x)+" "+_(n.x2.y)+" l"),r.push(_(n.x4.x)+" "+_(n.x4.y)+" m"),r.push(_(n.x3.x)+" "+_(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof M))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof D==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof O==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return J.call(this,t)};"object"==se(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=O,e.ListBox=q,e.ComboBox=T,e.EditBox=R,e.Button=D,e.PushButton=U,e.RadioButton=z,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=O,t.AcroFormListBox=q,t.AcroFormComboBox=T,t.AcroFormEditBox=R,t.AcroFormButton=D,t.AcroFormPushButton=U,t.AcroFormRadioButton=z,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:O,ListBox:q,ComboBox:T,EditBox:R,Button:D,PushButton:U,RadioButton:z,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}})((window.tmp=lt).API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global),
/** @license
   * jsPDF addImage plugin
   * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/
   *               2013 Chris Dowling, https://github.com/gingerchris
   *               2013 Trinh Ho, https://github.com/ineedfat
   *               2013 Edwin Alejandro Perez, https://github.com/eaparango
   *               2013 Norah Smith, https://github.com/burnburnrocket
   *               2014 Diego Casorran, https://github.com/diegocr
   *               2014 James Robb, https://github.com/jamesbrobb
   *
   * 
   */
function(x){var N="addImage_",l={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},h=x.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in x.isArrayBufferView(t)&&(t=x.arrayBufferToBinaryString(t)),l)for(i=l[a],n=0;n<i.length;n+=1){for(o=!0,r=0;r<i[n].length;r+=1)if(void 0!==i[n][r]&&i[n][r]!==t.charCodeAt(r)){o=!1;break}if(!0===o){s=a;break}}return"UNKNOWN"===s&&"UNKNOWN"!==e&&(console.warn('FileType of Image not recognized. Processing image as "'+e+'".'),s=e),s},n=function t(e){for(var n=this.internal.newObject(),r=this.internal.write,i=this.internal.putStream,o=(0,this.internal.getFilters)();-1!==o.indexOf("FlateEncode");)o.splice(o.indexOf("FlateEncode"),1);e.n=n;var a=[];if(a.push({key:"Type",value:"/XObject"}),a.push({key:"Subtype",value:"/Image"}),a.push({key:"Width",value:e.w}),a.push({key:"Height",value:e.h}),e.cs===this.color_spaces.INDEXED?a.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(e.pal.length/3-1)+" "+("smask"in e?n+2:n+1)+" 0 R]"}):(a.push({key:"ColorSpace",value:"/"+e.cs}),e.cs===this.color_spaces.DEVICE_CMYK&&a.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),a.push({key:"BitsPerComponent",value:e.bpc}),"dp"in e&&a.push({key:"DecodeParms",value:"<<"+e.dp+">>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",l=0,h=e.trns.length;l<h;l++)s+=e.trns[l]+" "+e.trns[l]+" ";a.push({key:"Mask",value:"["+s+"]"})}"smask"in e&&a.push({key:"SMask",value:n+1+" 0 R"});var u=void 0!==e.f?["/"+e.f]:void 0;if(i({data:e.data,additionalKeyValues:a,alreadyAppliedFilters:u}),r("endobj"),"smask"in e){var c="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,f={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:c,data:e.smask};"f"in e&&(f.f=e.f),t.call(this,f)}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),i({data:this.arrayBufferToBinaryString(new Uint8Array(e.pal))}),r("endobj"))},L=function(){var t=this.internal.collections[N+"images"];for(var e in t)n.call(this,t[e])},A=function(){var t,e=this.internal.collections[N+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).i,t.n,"0","R")},S=function(t){return"function"==typeof x["process"+t.toUpperCase()]},_=function(t){return"object"===se(t)&&1===t.nodeType},F=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n=""+t.getAttribute("src");if(0===n.indexOf("data:image/"))return unescape(n);var r=x.loadFile(n);if(void 0!==r)return btoa(r)}if("CANVAS"===t.nodeName){var i=t;return t.toDataURL("image/jpeg",1)}(i=document.createElement("canvas")).width=t.clientWidth||t.width,i.height=t.clientHeight||t.height;var o=i.getContext("2d");if(!o)throw"addImage requires canvas to be supported by browser.";return o.drawImage(t,0,0,i.width,i.height),i.toDataURL("png"==(""+e).toLowerCase()?"image/png":"image/jpeg")},P=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n};x.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"},x.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},x.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},x.sHashCode=function(t){var e,n=0;if(0===(t=t||"").length)return n;for(e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return n},x.isString=function(t){return"string"==typeof t},x.validateStringAsBase64=function(t){(t=t||"").toString().trim();var e=!0;return 0===t.length&&(e=!1),t.length%4!=0&&(e=!1),!1===/^[A-Za-z0-9+\/]+$/.test(t.substr(0,t.length-2))&&(e=!1),!1===/^[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==$/.test(t.substr(-2))&&(e=!1),e},x.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));\S*;*base64,(.+)$/g.exec(t)},x.extractImageFromDataUrl=function(t){var e=(t=t||"").split("base64,"),n=null;if(2===e.length){var r=/^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(e[0]);Array.isArray(r)&&(n={mimeType:r[1],charset:r[2],data:e[1]})}return n},x.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},x.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer},x.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))},x.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n},x.arrayBufferToBinaryString=function(t){if("function"==typeof atob)return atob(this.arrayBufferToBase64(t))},x.arrayBufferToBase64=function(t){for(var e,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(t),o=i.byteLength,a=o%3,s=o-a,l=0;l<s;l+=3)n+=r[(16515072&(e=i[l]<<16|i[l+1]<<8|i[l+2]))>>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},x.createImageInfo=function(t,e,n,r,i,o,a,s,l,h,u,c,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),l&&(p.dp=l),h&&(p.trns=h),u&&(p.pal=u),c&&(p.smask=c),f&&(p.p=f),p},x.addImage=function(t,e,n,r,i,o,a,s,l){var h="";if("string"!=typeof e){var u=o;o=i,i=r,r=n,n=e,e=u}if("object"===se(t)&&!_(t)&&"imageData"in t){var c=t;t=c.imageData,e=c.format||e||"UNKNOWN",n=c.x||n||0,r=c.y||r||0,i=c.w||i,o=c.h||o,a=c.alias||a,s=c.compression||s,l=c.rotation||c.angle||l}var f=this.internal.getFilters();if(void 0===s&&-1!==f.indexOf("FlateEncode")&&(s="SLOW"),"string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[N+"images"];return t||(this.internal.collections[N+"images"]=t={},this.internal.events.subscribe("putResources",L),this.internal.events.subscribe("putXobjectDict",A)),t}.call(this);if(!((p=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=a)||0===w.length)&&(a="string"==typeof(v=t)?x.sHashCode(v):x.isArrayBufferView(v)?x.sHashCode(x.arrayBufferToBinaryString(v)):null),p=P(a,b)))){if(this.isString(t)&&(""!==(h=this.convertStringToImageData(t))?t=h:void 0!==(h=x.loadFile(t))&&(t=h)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this["process"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),a,((g=s)&&"string"==typeof g&&(g=g.toUpperCase()),g in x.image_compression?g:x.image_compression.NONE),d)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),h=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var c=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(c),p(f),p(-1*f),p(c),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,h(t),u(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([h(n),"0","0",h(r),"0","0","cm"].join(" "))):this.internal.write([h(n),"0","0",h(r),h(t),u(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,p,p.i,b,l),this},x.convertStringToImageData=function(t){var e,n="";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw x.validateStringAsBase64(e)?new Error("atob-Error in jsPDF.convertStringToImageData "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return n};var u=function(t,e){return t.subarray(e,e+5)};x.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if("JPEG"!==h(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r<i;){if(r+=n,255!==t.charCodeAt(r))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(r+1)||193===t.charCodeAt(r+1)||194===t.charCodeAt(r+1)||195===t.charCodeAt(r+1)||196===t.charCodeAt(r+1)||197===t.charCodeAt(r+1)||198===t.charCodeAt(r+1)||199===t.charCodeAt(r+1))return e=256*t.charCodeAt(r+5)+t.charCodeAt(r+6),[256*t.charCodeAt(r+7)+t.charCodeAt(r+8),e,t.charCodeAt(r+9)];r+=2,n=256*t.charCodeAt(r)+t.charCodeAt(r+1)}}(t)),this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)&&(a=function(t){if(65496!=(t[0]<<8|t[1]))throw new Error("Supplied data is not a JPEG");for(var e,n=t.length,r=(t[4]<<8)+t[5],i=4;i<n;){if(r=((e=u(t,i+=r))[2]<<8)+e[3],(192===e[1]||194===e[1])&&255===e[0]&&7<r)return{width:((e=u(t,i+5))[2]<<8)+e[3],height:(e[0]<<8)+e[1],numcomponents:e[4]};i+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")}(t),t=i||this.arrayBufferToBinaryString(t)),void 0===o)switch(a.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;default:case 3:o=this.color_spaces.DEVICE_RGB}return this.createImageInfo(t,a.width,a.height,o,8,s,e,n)},x.processJPG=function(){return this.processJPEG.apply(this,arguments)},x.getImageProperties=function(t){var e,n,r="";if(_(t)&&(t=F(t)),this.isString(t)&&(""!==(r=this.convertStringToImageData(t))?t=r:void 0!==(r=x.loadFile(t))&&(t=r)),n=this.getImageFileTypeByImageData(t),!S(n))throw new Error("addImage does not support files of type '"+n+"', please ensure that a plugin for '"+n+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(t=this.binaryStringToUint8Array(t))),!(e=this["process"+n.toUpperCase()](t)))throw new Error("An unknown error occurred whilst processing the image");return{fileType:n,width:e.w,height:e.h,colorSpace:e.cs,compressionMode:e.f,bitsPerComponent:e.bpc}}}(lt.API),
/**
   * @license
   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
t=lt.API,lt.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(t){for(var e=this.internal.getPageInfoByObjId(t.objId),n=t.pageContext.annotations,r=function(t){if(void 0!==t&&""!=t)return!0},i=!1,o=0;o<n.length&&!i;o++)switch((l=n[o]).type){case"link":if(r(l.options.url)||r(l.options.pageNumber)){i=!0;break}case"reference":case"text":case"freetext":i=!0}if(0!=i){this.internal.write("/Annots ["),this.internal.pageSize.height;var a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString;for(o=0;o<n.length;o++){var l;switch((l=n[o]).type){case"reference":this.internal.write(" "+l.object.objId+" 0 R ");break;case"text":var h=this.internal.newAdditionalObject(),u=this.internal.newAdditionalObject(),c=l.title||"Note";m="<</Type /Annot /Subtype /Text "+(p="/Rect ["+a(l.bounds.x)+" "+s(l.bounds.y+l.bounds.h)+" "+a(l.bounds.x+l.bounds.w)+" "+s(l.bounds.y)+"] ")+"/Contents ("+l.contents+")",m+=" /Popup "+u.objId+" 0 R",m+=" /P "+e.objId+" 0 R",m+=" /T ("+c+") >>",h.content=m;var f=h.objId+" 0 R";m="<</Type /Annot /Subtype /Popup "+(p="/Rect ["+a(l.bounds.x+30)+" "+s(l.bounds.y+l.bounds.h)+" "+a(l.bounds.x+l.bounds.w+30)+" "+s(l.bounds.y)+"] ")+" /Parent "+f,l.open&&(m+=" /Open true"),m+=" >>",u.content=m,this.internal.write(h.objId,"0 R",u.objId,"0 R");break;case"freetext":var p="/Rect ["+a(l.bounds.x)+" "+s(l.bounds.y)+" "+a(l.bounds.x+l.bounds.w)+" "+s(l.bounds.y+l.bounds.h)+"] ",d=l.color||"#000000";m="<</Type /Annot /Subtype /FreeText "+p+"/Contents ("+l.contents+")",m+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+d+")",m+=" /Border [0 0 0]",m+=" >>",this.internal.write(m);break;case"link":if(l.options.name){var g=this.annotations._nameMap[l.options.name];l.options.pageNumber=g.page,l.options.top=g.y}else l.options.top||(l.options.top=0);p="/Rect ["+a(l.x)+" "+s(l.y)+" "+a(l.x+l.w)+" "+s(l.y+l.h)+"] ";var m="";if(l.options.url)m="<</Type /Annot /Subtype /Link "+p+"/Border [0 0 0] /A <</S /URI /URI ("+l.options.url+") >>";else if(l.options.pageNumber)switch(m="<</Type /Annot /Subtype /Link "+p+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(l.options.pageNumber).objId+" 0 R",l.options.magFactor=l.options.magFactor||"XYZ",l.options.magFactor){case"Fit":m+=" /Fit]";break;case"FitH":m+=" /FitH "+l.options.top+"]";break;case"FitV":l.options.left=l.options.left||0,m+=" /FitV "+l.options.left+"]";break;case"XYZ":default:var y=s(l.options.top);l.options.left=l.options.left||0,void 0===l.options.zoom&&(l.options.zoom=0),m+=" /XYZ "+l.options.left+" "+y+" "+l.options.zoom+"]"}""!=m&&(m+=" >>",this.internal.write(m))}}this.internal.write("]")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},
/**
   * @license
   * Copyright (c) 2017 Aras Abbasi 
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
function(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==h[t.charCodeAt(0)]},u=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return u(t)&&r(t)&&h[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return u(t)&&0<=n.indexOf(t.charCodeAt(0))},s=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return u(t)&&r(t)&&1<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return u(t)&&r(t)&&2<=h[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return u(t)&&r(t)&&3<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return u(t)&&r(t)&&4==h[t.charCodeAt(0)].length}),c=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r=0,i="",o=0;for(e=0;e<t.length;e+=1)void 0!==n[t.charCodeAt(e)]?(o++,"number"==typeof(n=n[t.charCodeAt(e)])&&(r=-1!==(r=f(t.charAt(e),t.charAt(e-o),t.charAt(e+1)))?r:0,i+=String.fromCharCode(n),n=a,o=0),e===t.length-1&&(n=a,i+=t.charAt(e-(o-1)),e-=o-1,o=0)):(n=a,i+=t.charAt(e-o),e-=o,o=0);return i},f=(t.__arabicParser__.isArabicDiacritic=function(t){return void 0!==t&&void 0!==e[t.charCodeAt(0)]},t.__arabicParser__.getCorrectForm=function(t,e,n){return u(t)?!1===r(t)?-1:!s(t)||!u(e)&&!u(n)||!u(n)&&i(e)||i(t)&&!u(e)||i(t)&&o(e)||i(t)&&i(e)?0:l(t)&&u(e)&&!i(e)&&u(n)&&s(n)?3:i(t)||!u(n)?1:2:-1}),p=t.__arabicParser__.processArabic=t.processArabic=function(t){var e=0,n=0,r=0,i="",o="",a="",s=(t=t||"").split("\\s+"),l=[];for(e=0;e<s.length;e+=1){for(l.push(""),n=0;n<s[e].length;n+=1)i=s[e][n],o=s[e][n-1],a=s[e][n+1],u(i)?(r=f(i,o,a),l[e]+=-1!==r?String.fromCharCode(h[i.charCodeAt(0)][r]):i):l[e]+=i;l[e]=c(l[e])}return l.join(" ")};t.events.push(["preProcessText",function(t){var e=t.text,n=(t.x,t.y,t.options||{}),r=(t.mutex,n.lang,[]);if("[object Array]"===Object.prototype.toString.call(e)){var i=0;for(r=[],i=0;i<e.length;i+=1)"[object Array]"===Object.prototype.toString.call(e[i])?r.push([p(e[i][0]),e[i][1],e[i][2]]):r.push([p(e[i])]);t.text=r}else t.text=p(e)}])}(lt.API),lt.API.autoPrint=function(t){var e;switch((t=t||{}).variant=t.variant||"non-conform",t.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this},
/**
   * @license
   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
e=lt.API,(n=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var r=300;Object.defineProperty(this,"height",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(t){i=t}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},n.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new n,this.canvas.pdf=this}]),
/** 
   * @license
   * ====================================================================
   * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
   *               2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
   *               2013 Lee Driscoll, https://github.com/lsdriscoll
   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
   *               2014 James Hall, james@parall.ax
   *               2014 Diego Casorran, https://github.com/diegocr
   *
   * 
   * ====================================================================
   */
_=lt.API,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,p=function(t,e,n,r,i){F={x:t,y:e,w:n,h:r,ln:i}},d=function(){return F},k={left:0,top:0,bottom:0},_.setHeaderFunction=function(t){l=t},_.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var s=0;s<t.length;s++)i<(a=this.getStringUnitWidth(t[s])*n)&&(i=a);0!==i&&(o=t.length)}return{w:i/=r,h:Math.max((o*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/r,0)}},_.cellAddPage=function(){var t=this.margins||k;this.addPage(),p(t.left,t.top,void 0,void 0),P+=1},_.cellInitialize=function(){F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1},_.cell=function(t,e,n,r,i,o,a){var s=d(),l=!1;if(void 0!==s.ln)if(s.ln===o)t=s.x+s.w,e=s.y;else{var h=this.margins||k;s.y+s.h+r+13>=this.internal.pageSize.getHeight()-h.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var u=0;u<i.length;u++){var c=i[u],f=this.getStringUnitWidth(c)*this.internal.getFontSize()/this.internal.scaleFactor;this.text(c,t+n-f-3,e+this.internal.getLineHeight()*(u+1))}}else this.text(i,t+3,e+this.internal.getLineHeight());return p(t,e,n,r,o),this},_.arrayMax=function(t,e){var n,r,i,o=t[0];for(n=0,r=t.length;n<r;n+=1)i=t[n],e?-1===e(o,i)&&(o=i):o<i&&(o=i);return o},_.table=function(t,e,n,r,i){if(!n)throw"No data for PDF table";var o,a,s,l,h,u,c,f,p,d,g=[],m=[],y={},v={},w=[],b=[],x=!1,N=!0,L=12,A=k;if(A.width=this.internal.pageSize.getWidth(),i&&(!0===i.autoSize&&(x=!0),!1===i.printHeaders&&(N=!1),i.fontSize&&(L=i.fontSize),i.css&&void 0!==i.css["font-size"]&&(L=16*i.css["font-size"]),i.margins&&(A=i.margins)),this.lnMod=0,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,this.printHeaders=N,this.margins=A,this.setFontSize(L),this.table_font_size=L,null==r)g=Object.keys(n[0]);else if(r[0]&&"string"!=typeof r[0])for(a=0,s=r.length;a<s;a+=1)o=r[a],g.push(o.name),m.push(o.prompt),v[o.name]=o.width*(19.049976/25.4);else g=r;if(x)for(d=function(t){return t[o]},a=0,s=g.length;a<s;a+=1){for(y[o=g[a]]=n.map(d),w.push(this.getTextDimensions(m[a]||o,{scaleFactor:1}).w),c=0,l=(u=y[o]).length;c<l;c+=1)h=u[c],w.push(this.getTextDimensions(h,{scaleFactor:1}).w);v[o]=_.arrayMax(w),w=[]}if(N){var S=this.calculateLineHeight(g,v,m.length?m:g);for(a=0,s=g.length;a<s;a+=1)o=g[a],b.push([t,e,v[o],S,String(m.length?m[a]:o)]);this.setTableHeaderRow(b),this.printHeaderRow(1,!1)}for(a=0,s=n.length;a<s;a+=1)for(f=n[a],S=this.calculateLineHeight(g,v,f),c=0,p=g.length;c<p;c+=1)o=g[c],this.cell(t,e,v[o],S,f[o],a+2,o.align);return this.lastCellPos=F,this.table_x=t,this.table_y=e,this},_.calculateLineHeight=function(t,e,n){for(var r,i=0,o=0;o<t.length;o++){n[r=t[o]]=this.splitTextToSize(String(n[r]),e[r]-3);var a=this.internal.getLineHeight()*n[r].length+3;i<a&&(i=a)}return i},_.setTableHeaderRow=function(t){this.tableHeaderRow=t},_.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var n,r,i,o;if(this.printingHeaderRow=!0,void 0!==l){var a=l(this,P);p(a[0],a[1],a[2],a[3],-1)}this.setFontStyle("bold");var s=[];for(i=0,o=this.tableHeaderRow.length;i<o;i+=1)this.setFillColor(200,200,200),n=this.tableHeaderRow[i],e&&(this.margins.top=13,n[1]=this.margins&&this.margins.top||0,s.push(n)),r=[].concat(n),this.cell.apply(this,r.concat(t));0<s.length&&this.setTableHeaderRow(s),this.setFontStyle("normal"),this.printingHeaderRow=!1},
/**
   * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
   *
   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
   */
function(t,e){var l,i,o,h,u,c=function(t){return t=t||{},this.isStrokeTransparent=t.isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||"#000000",this.fillStyle=t.fillStyle||"#000000",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||"10px sans-serif",this.textBaseline=t.textBaseline||"alphabetic",this.textAlign=t.textAlign||"left",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||"miter",this.lineCap=t.lineCap||"butt",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new M,this.globalCompositeOperation=t.globalCompositeOperation||"normal",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new j,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new j,this.ignoreClearRect="boolean"!=typeof t.ignoreClearRect||t.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new n(this),l=this.internal.f2,this.internal.f3,i=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,h=this.internal.getHorizontalCoordinate,u=this.internal.getVerticalCoordinate}]);var n=function(t){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}}),Object.defineProperty(this,"pdf",{get:function(){return t}});var e=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return e},set:function(t){e=Boolean(t)}});var n=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return n},set:function(t){n=Boolean(t)}});var r=0;Object.defineProperty(this,"posX",{get:function(){return r},set:function(t){isNaN(t)||(r=t)}});var i=0;Object.defineProperty(this,"posY",{get:function(){return i},set:function(t){isNaN(t)||(i=t)}});var o=!1;Object.defineProperty(this,"autoPaging",{get:function(){return o},set:function(t){o=Boolean(t)}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(t){a=t}});var s=[];Object.defineProperty(this,"pageBreaks",{get:function(){return s},set:function(t){s=t}});var l=new c;Object.defineProperty(this,"ctx",{get:function(){return l},set:function(t){t instanceof c&&(l=t)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(t){l.path=t}});var h=[];Object.defineProperty(this,"ctxStack",{get:function(){return h},set:function(t){h=t}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(t){var e;e=f(t),this.ctx.fillStyle=e.style,this.ctx.isFillTransparent=0===e.a,this.ctx.fillOpacity=e.a,this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}),this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(t){var e=f(t);this.ctx.strokeStyle=e.style,this.ctx.isStrokeTransparent=0===e.a,this.ctx.strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):(e.a,this.pdf.setDrawColor(e.r,e.g,e.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(t){-1!==["butt","round","square"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==["bevel","round","miter"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(t){-1!==["right","end","center","left","start"].indexOf(t)&&(this.ctx.textAlign=t)}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(t){var e;if(this.ctx.font=t,null!==(e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(t))){var n=e[1],r=(e[2],e[3]),i=e[4],o=e[5],a=e[6];i="px"===o?Math.floor(parseFloat(i)):"em"===o?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)),this.pdf.setFontSize(i);var s="";("bold"===r||700<=parseInt(r,10)||"bold"===n)&&(s="bold"),"italic"===n&&(s+="italic"),0===s.length&&(s="normal");for(var l="",h=a.toLowerCase().replace(/"|'/g,"").split(/\s*,\s*/),u={arial:"Helvetica",verdana:"Helvetica",helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",courier:"Courier",times:"Times",cursive:"Times",fantasy:"Times",serif:"Times"},c=0;c<h.length;c++){if(void 0!==this.pdf.internal.getFont(h[c],s,{noFallback:!0,disableWarning:!0})){l=h[c];break}if("bolditalic"===s&&void 0!==this.pdf.internal.getFont(h[c],"bold",{noFallback:!0,disableWarning:!0}))l=h[c],s="bold";else if(void 0!==this.pdf.internal.getFont(h[c],"normal",{noFallback:!0,disableWarning:!0})){l=h[c],s="normal";break}}if(""===l)for(c=0;c<h.length;c++)if(u[h[c]]){l=u[h[c]];break}l=""===l?"Times":l,this.pdf.setFont(l,s)}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(t){this.ctx.globalCompositeOperation=t}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(t){this.ctx.globalAlpha=t}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(t){this.ctx.ignoreClearRect=Boolean(t)}})};n.prototype.fill=function(){r.call(this,"fill",!1)},n.prototype.stroke=function(){r.call(this,"stroke",!1)},n.prototype.beginPath=function(){this.path=[{type:"begin"}]},n.prototype.moveTo=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new j(t,e));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new j(t,e)},n.prototype.closePath=function(){var t=new j(0,0),e=0;for(e=this.path.length-1;-1!==e;e--)if("begin"===this.path[e].type&&"object"===se(this.path[e+1])&&"number"==typeof this.path[e+1].x){t=new j(this.path[e+1].x,this.path[e+1].y),this.path.push({type:"lt",x:t.x,y:t.y});break}"object"===se(this.path[e+2])&&"number"==typeof this.path[e+2].x&&this.path.push(JSON.parse(JSON.stringify(this.path[e+2]))),this.path.push({type:"close"}),this.ctx.lastPoint=new j(t.x,t.y)},n.prototype.lineTo=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new j(t,e));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new j(n.x,n.y)},n.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),r.call(this,null,!0)},n.prototype.quadraticCurveTo=function(t,e,n,r){if(isNaN(n)||isNaN(r)||isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var i=this.ctx.transform.applyToPoint(new j(n,r)),o=this.ctx.transform.applyToPoint(new j(t,e));this.path.push({type:"qct",x1:o.x,y1:o.y,x:i.x,y:i.y}),this.ctx.lastPoint=new j(i.x,i.y)},n.prototype.bezierCurveTo=function(t,e,n,r,i,o){if(isNaN(i)||isNaN(o)||isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new j(i,o)),s=this.ctx.transform.applyToPoint(new j(t,e)),l=this.ctx.transform.applyToPoint(new j(n,r));this.path.push({type:"bct",x1:s.x,y1:s.y,x2:l.x,y2:l.y,x:a.x,y:a.y}),this.ctx.lastPoint=new j(a.x,a.y)},n.prototype.arc=function(t,e,n,r,i,o){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i))throw console.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(o=Boolean(o),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new j(t,e));t=a.x,e=a.y;var s=this.ctx.transform.applyToPoint(new j(0,n)),l=this.ctx.transform.applyToPoint(new j(0,0));n=Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))}Math.abs(i-r)>=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!N.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");L.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("q");if(this.pdf.setPage(e),t){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new c(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},n.prototype.restore=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("Q");this.pdf.setPage(e),t&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin)},n.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var f=function(t){var e,n,r,i;if(!0===t.isCanvasGradient&&(t=t.getColor()),!t)return{r:0,g:0,b:0,a:0,style:t};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t))i=r=n=e=0;else{var o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t);if(null!==o)e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=1;else if(null!==(o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/.exec(t)))e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=parseFloat(o[4]);else{if(i=1,"string"==typeof t&&"#"!==t.charAt(0)){var a=new RGBColor(t);t=a.ok?a.toHex():"#000000"}4===t.length?(e=t.substring(1,2),e+=e,n=t.substring(2,3),n+=n,r=t.substring(3,4),r+=r):(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7)),e=parseInt(e,16),n=parseInt(n,16),r=parseInt(r,16)}}return{r:e,g:n,b:r,a:i,style:t}},N=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},L=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};n.prototype.fillText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw console.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!N.call(this)){n=a.call(this,n);var i=B(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;s.call(this,{text:t,x:e,y:n,scale:o,angle:i,align:this.textAlign,maxWidth:r})}},n.prototype.strokeText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw console.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!L.call(this)){r=isNaN(r)?void 0:r,n=a.call(this,n);var i=B(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;s.call(this,{text:t,x:e,y:n,scale:o,renderingMode:"stroke",angle:i,align:this.textAlign,maxWidth:r})}},n.prototype.measureText=function(t){if("string"!=typeof t)throw console.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var e=this.pdf,n=this.pdf.internal.scaleFactor,r=e.internal.getFontSize(),i=e.getStringUnitWidth(t)*r/e.internal.scaleFactor;return new function(t){var e=(t=t||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return e}}),this}({width:i*=Math.round(96*n/72*1e4)/1e4})},n.prototype.scale=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new M(t,0,0,e,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},n.prototype.rotate=function(t){if(isNaN(t))throw console.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var e=new M(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0);this.ctx.transform=this.ctx.transform.multiply(e)},n.prototype.translate=function(t,e){if(isNaN(t)||isNaN(e))throw console.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new M(1,0,0,1,t,e);this.ctx.transform=this.ctx.transform.multiply(n)},n.prototype.transform=function(t,e,n,r,i,o){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o))throw console.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var a=new M(t,e,n,r,i,o);this.ctx.transform=this.ctx.transform.multiply(a)},n.prototype.setTransform=function(t,e,n,r,i,o){t=isNaN(t)?1:t,e=isNaN(e)?0:e,n=isNaN(n)?0:n,r=isNaN(r)?1:r,i=isNaN(i)?0:i,o=isNaN(o)?0:o,this.ctx.transform=new M(t,e,n,r,i,o)},n.prototype.drawImage=function(t,e,n,r,i,o,a,s,l){var h=this.pdf.getImageProperties(t),u=1,c=1,f=1,p=1;void 0!==r&&void 0!==s&&(f=s/r,p=l/i,u=h.width/r*s/r,c=h.height/i*l/i),void 0===o&&(o=e,a=n,n=e=0),void 0!==r&&void 0===s&&(s=r,l=i),void 0===r&&void 0===s&&(s=h.width,l=h.height);var d=this.ctx.transform.decompose(),g=B(d.rotate.shx);d.scale.sx,d.scale.sy;for(var m,y=new M,v=((y=(y=(y=y.multiply(d.translate)).multiply(d.skew)).multiply(d.scale)).applyToPoint(new j(s,l)),y.applyToRectangle(new E(o-e*f,a-n*p,r*u,i*c))),w=F.call(this,v),b=[],x=0;x<w.length;x+=1)-1===b.indexOf(w[x])&&b.push(w[x]);if(b.sort(),this.autoPaging)for(var N=b[0],L=b[b.length-1],A=N;A<L+1;A++){if(this.pdf.setPage(A),0!==this.ctx.clip_path.length){var S=this.path;m=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=P(m,this.posX,-1*this.pdf.internal.pageSize.height*(A-1)+this.posY),k.call(this,"fill",!0),this.path=S}var _=JSON.parse(JSON.stringify(v));_=P([_],this.posX,-1*this.pdf.internal.pageSize.height*(A-1)+this.posY)[0],this.pdf.addImage(t,"jpg",_.x,_.y,_.w,_.h,null,null,g)}else this.pdf.addImage(t,"jpg",v.x,v.y,v.w,v.h,null,null,g)};var F=function(t,e,n){var r=[];switch(e=e||this.pdf.internal.pageSize.width,n=n||this.pdf.internal.pageSize.height,t.type){default:case"mt":case"lt":r.push(Math.floor((t.y+this.posY)/n)+1);break;case"arc":r.push(Math.floor((t.y+this.posY-t.radius)/n)+1),r.push(Math.floor((t.y+this.posY+t.radius)/n)+1);break;case"qct":var i=w(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x,t.y);r.push(Math.floor(i.y/n)+1),r.push(Math.floor((i.y+i.h)/n)+1);break;case"bct":var o=b(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x2,t.y2,t.x,t.y);r.push(Math.floor(o.y/n)+1),r.push(Math.floor((o.y+o.h)/n)+1);break;case"rect":r.push(Math.floor((t.y+this.posY)/n)+1),r.push(Math.floor((t.y+t.h+this.posY)/n)+1)}for(var a=0;a<r.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<r[a];)v.call(this);return r},v=function(){var t=this.fillStyle,e=this.strokeStyle,n=this.font,r=this.lineCap,i=this.lineWidth,o=this.lineJoin;this.pdf.addPage(),this.fillStyle=t,this.strokeStyle=e,this.font=n,this.lineCap=r,this.lineWidth=i,this.lineJoin=o},P=function(t,e,n){for(var r=0;r<t.length;r++)switch(t[r].type){case"bct":t[r].x2+=e,t[r].y2+=n;case"qct":t[r].x1+=e,t[r].y1+=n;case"mt":case"lt":case"arc":default:t[r].x+=e,t[r].y+=n}return t},r=function(t,e){for(var n,r,i=this.fillStyle,o=this.strokeStyle,a=(this.font,this.lineCap),s=this.lineWidth,l=this.lineJoin,h=JSON.parse(JSON.stringify(this.path)),u=JSON.parse(JSON.stringify(this.path)),c=[],f=0;f<u.length;f++)if(void 0!==u[f].x)for(var p=F.call(this,u[f]),d=0;d<p.length;d+=1)-1===c.indexOf(p[d])&&c.push(p[d]);for(f=0;f<c.length;f++)for(;this.pdf.internal.getNumberOfPages()<c[f];)v.call(this);if(c.sort(),this.autoPaging){var g=c[0],m=c[c.length-1];for(f=g;f<m+1;f++){if(this.pdf.setPage(f),this.fillStyle=i,this.strokeStyle=o,this.lineCap=a,this.lineWidth=s,this.lineJoin=l,0!==this.ctx.clip_path.length){var y=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=P(n,this.posX,-1*this.pdf.internal.pageSize.height*(f-1)+this.posY),k.call(this,t,!0),this.path=y}r=JSON.parse(JSON.stringify(h)),this.path=P(r,this.posX,-1*this.pdf.internal.pageSize.height*(f-1)+this.posY),!1!==e&&0!==f||k.call(this,t,e)}}else k.call(this,t,e);this.path=h},k=function(t,e){if(("stroke"!==t||e||!L.call(this))&&("stroke"===t||e||!N.call(this))){var n=[];this.ctx.globalAlpha;this.ctx.fillOpacity<1&&this.ctx.fillOpacity;for(var r,i=this.path,o=0;o<i.length;o++){var a=i[o];switch(a.type){case"begin":n.push({begin:!0});break;case"close":n.push({close:!0});break;case"mt":n.push({start:a,deltas:[],abs:[]});break;case"lt":var s=n.length;if(!isNaN(i[o-1].x)){var l=[a.x-i[o-1].x,a.y-i[o-1].y];if(0<s)for(;0<=s;s--)if(!0!==n[s-1].close&&!0!==n[s-1].begin){n[s-1].deltas.push(l),n[s-1].abs.push(a);break}}break;case"bct":l=[a.x1-i[o-1].x,a.y1-i[o-1].y,a.x2-i[o-1].x,a.y2-i[o-1].y,a.x-i[o-1].x,a.y-i[o-1].y];n[n.length-1].deltas.push(l);break;case"qct":var h=i[o-1].x+2/3*(a.x1-i[o-1].x),u=i[o-1].y+2/3*(a.y1-i[o-1].y),c=a.x+2/3*(a.x1-a.x),f=a.y+2/3*(a.y1-a.y),p=a.x,d=a.y;l=[h-i[o-1].x,u-i[o-1].y,c-i[o-1].x,f-i[o-1].y,p-i[o-1].x,d-i[o-1].y];n[n.length-1].deltas.push(l);break;case"arc":n.push({deltas:[],abs:[],arc:!0}),Array.isArray(n[n.length-1].abs)&&n[n.length-1].abs.push(a)}}r=e?null:"stroke"===t?"stroke":"fill";for(o=0;o<n.length;o++){if(n[o].arc)for(var g=n[o].abs,m=0;m<g.length;m++){var y=g[m];if(void 0!==y.startAngle){var v=B(y.startAngle),w=B(y.endAngle),b=y.x,x=y.y;A.call(this,b,x,y.radius,v,w,y.counterclockwise,r,e)}else I.call(this,y.x,y.y)}if(!n[o].arc&&!0!==n[o].close&&!0!==n[o].begin){b=n[o].start.x,x=n[o].start.y;C.call(this,n[o].deltas,b,x,null,null)}}r&&S.call(this,r),e&&_.call(this)}},a=function(t){var e=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=e*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+e-n;case"hanging":return t+e-2*n;case"middle":return t+e/2-n;case"ideographic":return t;case"alphabetic":default:return t}};n.prototype.createLinearGradient=function(){var t=function(){};return t.colorStops=[],t.addColorStop=function(t,e){this.colorStops.push([t,e])},t.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},t.isCanvasGradient=!0,t},n.prototype.createPattern=function(){return this.createLinearGradient()},n.prototype.createRadialGradient=function(){return this.createLinearGradient()};var A=function(t,e,n,r,i,o,a,s){this.pdf.internal.scaleFactor;for(var l=y(r),h=y(i),u=g.call(this,n,l,h,o),c=0;c<u.length;c++){var f=u[c];0===c&&p.call(this,f.x1+t,f.y1+e),d.call(this,t,e,f.x2,f.y2,f.x3,f.y3,f.x4,f.y4)}s?_.call(this):S.call(this,a)},S=function(t){switch(t){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},_=function(){this.pdf.clip()},p=function(t,e){this.pdf.internal.out(i(t)+" "+o(e)+" m")},s=function(t){var e;switch(t.align){case"right":case"end":e="right";break;case"center":e="center";break;case"left":case"start":default:e="left"}var n=this.ctx.transform.applyToPoint(new j(t.x,t.y)),r=this.ctx.transform.decompose(),i=new M;i=(i=(i=i.multiply(r.translate)).multiply(r.skew)).multiply(r.scale);for(var o,a=this.pdf.getTextDimensions(t.text),s=this.ctx.transform.applyToRectangle(new E(t.x,t.y,a.w,a.h)),l=i.applyToRectangle(new E(t.x,t.y-a.h,a.w,a.h)),h=F.call(this,l),u=[],c=0;c<h.length;c+=1)-1===u.indexOf(h[c])&&u.push(h[c]);if(u.sort(),!0===this.autoPaging)for(var f=u[0],p=u[u.length-1],d=f;d<p+1;d++){if(this.pdf.setPage(d),0!==this.ctx.clip_path.length){var g=this.path;o=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=P(o,this.posX,-1*this.pdf.internal.pageSize.height*(d-1)+this.posY),k.call(this,"fill",!0),this.path=g}var m=JSON.parse(JSON.stringify(s));if(m=P([m],this.posX,-1*this.pdf.internal.pageSize.height*(d-1)+this.posY)[0],.01<=t.scale){var y=this.pdf.internal.getFontSize();this.pdf.setFontSize(y*t.scale)}this.pdf.text(t.text,m.x,m.y,{angle:t.angle,align:e,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),.01<=t.scale&&this.pdf.setFontSize(y)}else{if(.01<=t.scale){y=this.pdf.internal.getFontSize();this.pdf.setFontSize(y*t.scale)}this.pdf.text(t.text,n.x+this.posX,n.y+this.posY,{angle:t.angle,align:e,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),.01<=t.scale&&this.pdf.setFontSize(y)}},I=function(t,e,n,r){n=n||0,r=r||0,this.pdf.internal.out(i(t+n)+" "+o(e+r)+" l")},C=function(t,e,n){return this.pdf.lines(t,e,n,null,null)},d=function(t,e,n,r,i,o,a,s){this.pdf.internal.out([l(h(n+t)),l(u(r+e)),l(h(i+t)),l(u(o+e)),l(h(a+t)),l(u(s+e)),"c"].join(" "))},g=function(t,e,n,r){var i=2*Math.PI,o=e;(o<i||i<o)&&(o%=i);var a=n;(a<i||i<a)&&(a%=i);for(var s=[],l=Math.PI/2,h=r?-1:1,u=e,c=Math.min(i,Math.abs(a-o));1e-5<c;){var f=u+h*Math.min(c,l);s.push(m.call(this,t,u,f)),c-=Math.abs(f-u),u=f}return s},m=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),o=t*Math.sin(r),a=i,s=-o,l=a*a+s*s,h=l+a*i+s*o,u=4/3*(Math.sqrt(2*l*h)-h)/(a*o-s*i),c=a-u*s,f=s+u*a,p=c,d=-f,g=r+e,m=Math.cos(g),y=Math.sin(g);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:c*m-f*y,y2:c*y+f*m,x3:p*m-d*y,y3:p*y+d*m,x4:t*Math.cos(n),y4:t*Math.sin(n)}},B=function(t){return 180*t/Math.PI},y=function(t){return t*Math.PI/180},w=function(t,e,n,r,i,o){var a=t+.5*(n-t),s=e+.5*(r-e),l=i+.5*(n-i),h=o+.5*(r-o),u=Math.min(t,i,a,l),c=Math.max(t,i,a,l),f=Math.min(e,o,s,h),p=Math.max(e,o,s,h);return new E(u,f,c-u,p-f)},b=function(t,e,n,r,i,o,a,s){for(var l,h,u,c,f,p,d,g,m,y,v,w,b,x=n-t,N=r-e,L=i-n,A=o-r,S=a-i,_=s-o,F=0;F<41;F++)g=(p=(h=t+(l=F/40)*x)+l*((c=n+l*L)-h))+l*(c+l*(i+l*S-c)-p),m=(d=(u=e+l*N)+l*((f=r+l*A)-u))+l*(f+l*(o+l*_-f)-d),b=0==F?(w=y=g,v=m):(y=Math.min(y,g),v=Math.min(v,m),w=Math.max(w,g),Math.max(b,m));return new E(Math.round(y),Math.round(v),Math.round(w-y),Math.round(b-v))},j=function(t,e){var n=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(t){isNaN(t)||(n=parseFloat(t))}});var r=e||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var i="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return i},set:function(t){i=t.toString()}}),this},E=function(t,e,n,r){j.call(this,t,e),this.type="rect";var i=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return i},set:function(t){isNaN(t)||(i=parseFloat(t))}});var o=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return o},set:function(t){isNaN(t)||(o=parseFloat(t))}}),this},M=function(t,e,n,r,i,o){var a=[];return Object.defineProperty(this,"sx",{get:function(){return a[0]},set:function(t){a[0]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"shy",{get:function(){return a[1]},set:function(t){a[1]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"shx",{get:function(){return a[2]},set:function(t){a[2]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"sy",{get:function(){return a[3]},set:function(t){a[3]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"tx",{get:function(){return a[4]},set:function(t){a[4]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"ty",{get:function(){return a[5]},set:function(t){a[5]=Math.round(1e5*t)/1e5}}),Object.defineProperty(this,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(this,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(this,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(this,"isIdentity",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),this.sx=isNaN(t)?1:t,this.shy=isNaN(e)?0:e,this.shx=isNaN(n)?0:n,this.sy=isNaN(r)?1:r,this.tx=isNaN(i)?0:i,this.ty=isNaN(o)?0:o,this};M.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,n=t.sx*this.shy+t.shy*this.sy,r=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,o=t.tx*this.sx+t.ty*this.shx+this.tx,a=t.tx*this.shy+t.ty*this.sy+this.ty;return new M(e,n,r,i,o,a)},M.prototype.decompose=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty,a=Math.sqrt(t*t+e*e),s=(t/=a)*n+(e/=a)*r;n-=t*s,r-=e*s;var l=Math.sqrt(n*n+r*r);return s/=l,t*(r/=l)<e*(n/=l)&&(t=-t,e=-e,s=-s,a=-a),{scale:new M(a,0,0,l,0,0),translate:new M(1,0,0,1,i,o),rotate:new M(t,e,-e,t,0,0),skew:new M(1,0,s,1,0,0)}},M.prototype.applyToPoint=function(t){var e=t.x*this.sx+t.y*this.shx+this.tx,n=t.x*this.shy+t.y*this.sy+this.ty;return new j(e,n)},M.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),n=this.applyToPoint(new j(t.x+t.w,t.y+t.h));return new E(e.x,e.y,n.x-e.x,n.y-e.y)},M.prototype.clone=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty;return new M(t,e,n,r,i,o)}}(lt.API,"undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()),
/**
   * jsPDF filters PlugIn
   * Copyright (c) 2014 Aras Abbasi 
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
a=lt.API,o=function(t){var r,e,n,i,o,a,s,l,h,u;for(/[^\x00-\xFF]/.test(t),e=[],n=0,i=(t+=r="\0\0\0\0".slice(t.length%4||4)).length;n<i;n+=4)0!==(o=(t.charCodeAt(n)<<24)+(t.charCodeAt(n+1)<<16)+(t.charCodeAt(n+2)<<8)+t.charCodeAt(n+3))?(a=(o=((o=((o=((o=(o-(u=o%85))/85)-(h=o%85))/85)-(l=o%85))/85)-(s=o%85))/85)%85,e.push(a+33,s+33,l+33,h+33,u+33)):e.push(122);return function(t,e){for(var n=r.length;0<n;n--)t.pop()}(e),String.fromCharCode.apply(String,e)+"~>"},s=function(t){var r,e,n,i,o,a=String,s="length",l="charCodeAt",h="slice",u="replace";for(t[h](-2),t=t[h](0,-2)[u](/\s/g,"")[u]("z","!!!!!"),n=[],i=0,o=(t+=r="uuuuu"[h](t[s]%5||5))[s];i<o;i+=5)e=52200625*(t[l](i)-33)+614125*(t[l](i+1)-33)+7225*(t[l](i+2)-33)+85*(t[l](i+3)-33)+(t[l](i+4)-33),n.push(255&e>>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[s];0<n;n--)t.pop()}(n),a.fromCharCode.apply(a,n)},h=function(t){for(var e="",n=0;n<t.length;n+=1)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e+=">"},u=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r<t.length;r+=2)n+=String.fromCharCode("0x"+(t[r]+t[r+1]));return n},c=function(t,e){e=Object.assign({predictor:1,colors:1,bitsPerComponent:8,columns:1},e);for(var n,r,i=[],o=t.length;o--;)i[o]=t.charCodeAt(o);return n=a.adler32cs.from(t),(r=new Deflater(6)).append(new Uint8Array(i)),t=r.flush(),(i=new Uint8Array(t.length+6)).set(new Uint8Array([120,156])),i.set(t,2),i.set(new Uint8Array([255&n,n>>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)},a.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n<e.length;n+=1)switch(e[n]){case"ASCII85Decode":case"/ASCII85Decode":r=s(r),i.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":r=o(r),i.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":r=u(r),i.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":r=h(r),i.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":r=c(r),i.push("/FlateDecode");break;default:throw'The filter: "'+e[n]+'" is not implemented'}return{data:r,reverseChain:i.reverse().join(" ")}},(
/**
   * jsPDF fileloading PlugIn
   * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
r=lt.API).loadFile=function(t,e,n){var r;e=e||!0,n=n||function(){};try{r=function(t,e,n){var r=new XMLHttpRequest,i=[],o=0,a=function(t){var e=t.length,n=String.fromCharCode;for(o=0;o<e;o+=1)i.push(n(255&t.charCodeAt(o)));return i.join("")};if(r.open("GET",t,!e),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===e&&(r.onload=function(){return a(this.responseText)}),r.send(null),200===r.status)return e?a(r.responseText):void 0;console.warn('Unable to load file "'+t+'"')}(t,e)}catch(t){r=void 0}return r},r.loadImageFile=r.loadFile,
/**
   * Copyright (c) 2018 Erik Koopmans
   * Released under the MIT License.
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
i=lt.API,f="undefined"!=typeof window&&window||"undefined"!=typeof global&&global,g=function(t){var e=se(t);return"undefined"===e?"undefined":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===e?"object":"unknown"},m=function(t,e){var n=document.createElement(t);if(e.className&&(n.className=e.className),e.innerHTML){n.innerHTML=e.innerHTML;for(var r=n.getElementsByTagName("script"),i=r.length;0<i--;null)r[i].parentNode.removeChild(r[i])}for(var o in e.style)n.style[o]=e.style[o];return n},(((y=function t(e){var n=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),r=t.convert(Promise.resolve(),n);return r=(r=r.setProgress(1,t,1,[t])).set(e)}).prototype=Object.create(Promise.prototype)).constructor=y).convert=function(t,e){return t.__proto__=e||y.prototype,t},y.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{}}},y.prototype.from=function(t,e){return this.then(function(){switch(e=e||function(t){switch(g(t)){case"string":return"string";case"element":return"canvas"===t.nodeName.toLowerCase?"canvas":"element";default:return"unknown"}}(t)){case"string":return this.set({src:m("div",{innerHTML:t})});case"element":return this.set({src:t});case"canvas":return this.set({canvas:t});case"img":return this.set({img:t});default:return this.error("Unknown source type.")}})},y.prototype.to=function(t){switch(t){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},y.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var t={position:"relative",display:"inline-block",width:Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:"white"},e=function t(e,n){for(var r=3===e.nodeType?document.createTextNode(e.nodeValue):e.cloneNode(!1),i=e.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(t(i,n));return 1===e.nodeType&&("CANVAS"===e.nodeName?(r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0)):"TEXTAREA"!==e.nodeName&&"SELECT"!==e.nodeName||(r.value=e.value),r.addEventListener("load",function(){r.scrollTop=e.scrollTop,r.scrollLeft=e.scrollLeft},!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===e.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=m("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=m("div",{className:"html2pdf__container",style:t}),this.prop.container.appendChild(e),this.prop.container.firstChild.appendChild(m("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},y.prototype.toCanvas=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(function(){var t=Object.assign({},this.opt.html2canvas);if(delete t.onrendered,this.isHtml2CanvasLoaded())return html2canvas(this.prop.container,t)}).then(function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},y.prototype.toContext2d=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(function(){var t=this.opt.jsPDF,e=Object.assign({async:!0,allowTaint:!0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete e.onrendered,t.context2d.autoPaging=!0,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,e.windowHeight=e.windowHeight||0,e.windowHeight=0==e.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):e.windowHeight,this.isHtml2CanvasLoaded())return html2canvas(this.prop.container,e)}).then(function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},y.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var t=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=t})},y.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},y.prototype.output=function(t,e,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(t,e):this.outputPdf(t,e)},y.prototype.outputPdf=function(t,e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(t,e)})},y.prototype.outputImg=function(t,e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(t){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+t+'" is not supported.'}})},y.prototype.isHtml2CanvasLoaded=function(){var t=void 0!==f.html2canvas;return t||console.error("html2canvas not loaded."),t},y.prototype.save=function(t){if(this.isHtml2CanvasLoaded())return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(t?{filename:t}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},y.prototype.doCallback=function(t){if(this.isHtml2CanvasLoaded())return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},y.prototype.set=function(e){if("object"!==g(e))return this;var t=Object.keys(e||{}).map(function(t){if(t in y.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}},this);return this.then(function(){return this.thenList(t)})},y.prototype.get=function(e,n){return this.then(function(){var t=e in y.template.prop?this.prop[e]:this.opt[e];return n?n(t):t})},y.prototype.setMargin=function(t){return this.then(function(){switch(g(t)){case"number":t=[t,t,t,t];case"array":if(2===t.length&&(t=[t[0],t[1],t[0],t[1]]),4===t.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=t}).then(this.setPageSize)},y.prototype.setPageSize=function(t){function e(t,e){return Math.floor(t*e/72*96)}return this.then(function(){(t=t||lt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(t.inner={width:t.width-this.opt.margin[1]-this.opt.margin[3],height:t.height-this.opt.margin[0]-this.opt.margin[2]},t.inner.px={width:e(t.inner.width,t.k),height:e(t.inner.height,t.k)},t.inner.ratio=t.inner.height/t.inner.width),this.prop.pageSize=t})},y.prototype.setProgress=function(t,e,n,r){return null!=t&&(this.progress.val=t),null!=e&&(this.progress.state=e),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},y.prototype.updateProgress=function(t,e,n,r){return this.setProgress(t?this.progress.val+t:null,e||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},y.prototype.then=function(t,e){var n=this;return this.thenCore(t,e,function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,function(t){return n.updateProgress(null,e),t}).then(e,t).then(function(t){return n.updateProgress(1),t})})},y.prototype.thenCore=function(t,e,n){n=n||Promise.prototype.then;var r=this;t&&(t=t.bind(r)),e&&(e=e.bind(r));var i=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?r:y.convert(Object.assign({},r),Promise.prototype),o=n.call(i,t,e);return y.convert(o,r.__proto__)},y.prototype.thenExternal=function(t,e){return Promise.prototype.then.call(this,t,e)},y.prototype.thenList=function(t){var e=this;return t.forEach(function(t){e=e.thenCore(t)}),e},y.prototype.catch=function(t){t&&(t=t.bind(this));var e=Promise.prototype.catch.call(this,t);return y.convert(e,this)},y.prototype.catchExternal=function(t){return Promise.prototype.catch.call(this,t)},y.prototype.error=function(t){return this.then(function(){throw new Error(t)})},y.prototype.using=y.prototype.set,y.prototype.saveAs=y.prototype.save,y.prototype.export=y.prototype.output,y.prototype.run=y.prototype.then,lt.getPageSize=function(t,e,n){if("object"===se(t)){var r=t;t=r.orientation,e=r.unit||e,n=r.format||n}e=e||"mm",n=n||"a4",t=(""+(t||"P")).toLowerCase();var i=(""+n).toLowerCase(),o={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(e){case"pt":var a=1;break;case"mm":a=72/25.4;break;case"cm":a=72/2.54;break;case"in":a=72;break;case"px":a=.75;break;case"pc":case"em":a=12;break;case"ex":a=6;break;default:throw"Invalid unit: "+e}if(o.hasOwnProperty(i))var s=o[i][1]/a,l=o[i][0]/a;else try{s=n[1],l=n[0]}catch(t){throw new Error("Invalid format: "+n)}if("p"===t||"portrait"===t){if(t="p",s<l){var h=l;l=s,s=h}}else{if("l"!==t&&"landscape"!==t)throw"Invalid orientation: "+t;t="l",l<s&&(h=l,l=s,s=h)}return{width:l,height:s,unit:e,k:a}},i.html=function(t,e){(e=e||{}).callback=e.callback||function(){},e.html2canvas=e.html2canvas||{},e.html2canvas.canvas=e.html2canvas.canvas||this.canvas,e.jsPDF=e.jsPDF||this,e.jsPDF;var n=new y(e);return e.worker?n:n.from(t).doCallback()},lt.API.addJS=function(t){return b=t,this.internal.events.subscribe("postPutResources",function(t){v=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(v+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),w=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+b+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==v&&void 0!==w&&this.internal.out("/Names <</JavaScript "+v+" 0 R>>")}),this},(
/**
   * @license
   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
x=lt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0<this.outline.root.children.length)for(var n=t.outline.render().split(/\r\n/),r=0;r<n.length;r++){var i=n[r],o=e.exec(i);if(null!=o){var a=o[1];t.internal.newObjectDeferredBegin(a,!1)}t.internal.write(i)}if(this.outline.createNamedDestinations){var s=this.internal.pages.length,l=[];for(r=0;r<s;r++){var h=t.internal.newObject();l.push(h);var u=t.internal.getPageInfo(r+1);t.internal.write("<< /D["+u.objId+" 0 R /XYZ null null null]>> endobj")}var c=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r<l.length;r++)t.internal.write("(page_"+(r+1)+")"+l[r]+" 0 R");t.internal.write(" ] >>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+c+" 0 R"),t.internal.write(">>","endobj")}}]),x.events.push(["putCatalog",function(){0<this.outline.root.children.length&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+namesOid+" 0 R"))}]),x.events.push(["initialized",function(){var a=this;a.outline={createNamedDestinations:!1,root:{children:[]}},a.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root),t.children.push(r),r},a.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=a,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},a.outline.genIds_r=function(t){t.id=a.internal.newObjectDeferred();for(var e=0;e<t.children.length;e++)this.genIds_r(t.children[e])},a.outline.renderRoot=function(t){this.objStart(t),this.line("/Type /Outlines"),0<t.children.length&&(this.line("/First "+this.makeRef(t.children[0])),this.line("/Last "+this.makeRef(t.children[t.children.length-1]))),this.line("/Count "+this.count_r({count:0},t)),this.objEnd()},a.outline.renderItems=function(t){this.ctx.pdf.internal.getCoordinateString;for(var e=this.ctx.pdf.internal.getVerticalCoordinateString,n=0;n<t.children.length;n++){var r=t.children[n];this.objStart(r),this.line("/Title "+this.makeString(r.title)),this.line("/Parent "+this.makeRef(t)),0<n&&this.line("/Prev "+this.makeRef(t.children[n-1])),n<t.children.length-1&&this.line("/Next "+this.makeRef(t.children[n+1])),0<r.children.length&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1])));var i=this.count=this.count_r({count:0},r);if(0<i&&this.line("/Count "+i),r.options&&r.options.pageNumber){var o=a.internal.getPageInfo(r.options.pageNumber);this.line("/Dest ["+o.objId+" 0 R /XYZ 0 "+e(0)+" 0]")}this.objEnd()}for(n=0;n<t.children.length;n++)r=t.children[n],this.renderItems(r)},a.outline.line=function(t){this.ctx.val+=t+"\r\n"},a.outline.makeRef=function(t){return t.id+" 0 R"},a.outline.makeString=function(t){return"("+a.internal.pdfEscape(t)+")"},a.outline.objStart=function(t){this.ctx.val+="\r\n"+t.id+" 0 obj\r\n<<\r\n"},a.outline.objEnd=function(t){this.ctx.val+=">> \r\nendobj\r\n"},a.outline.count_r=function(t,e){for(var n=0;n<e.children.length;n++)t.count++,this.count_r(t,e.children[n]);return t.count}}]),
/**
   * @license
   * 
   * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
   *
   * 
   * ====================================================================
   */
I=lt.API,C=function(){var t="function"==typeof Deflater;if(!t)throw new Error("requires deflate.js for compression");return t},B=function(t,e,n,r){var i=5,o=E;switch(r){case I.image_compression.FAST:i=3,o=j;break;case I.image_compression.MEDIUM:i=6,o=M;break;case I.image_compression.SLOW:i=9,o=O}t=A(t,e,n,o);var a=new Uint8Array(N(i)),s=L(t),l=new Deflater(i),h=l.append(t),u=l.flush(),c=a.length+h.length+u.length,f=new Uint8Array(c+4);return f.set(a),f.set(h,a.length),f.set(u,a.length+h.length),f[c++]=s>>>24&255,f[c++]=s>>>16&255,f[c++]=s>>>8&255,f[c++]=255&s,I.arrayBufferToBinaryString(f)},N=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},L=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0<o;){for(o-=n=e<o?e:o;i+=r+=t[a++],--n;);r%=65521,i%=65521}return(i<<16|r)>>>0},A=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),h=T(),u=0;u<s;u++){if(a=u*e,i=t.subarray(a,a+e),r)l.set(r(i,n,o),a+u);else{for(var c=0,f=h.length,p=[];c<f;c++)p[c]=h[c](i,n,o);var d=R(p.concat());l.set(p[d],a+u)}o=i}return l},S=function(t,e,n){var r=Array.apply([],t);return r.unshift(0),r},j=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=1;o<a;o++)r=t[o-e]||0,i[o+1]=t[o]-r+256&255;return i},E=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=2;o<a;o++)r=n&&n[o]||0,i[o+1]=t[o]-r+256&255;return i},M=function(t,e,n){var r,i,o=[],a=0,s=t.length;for(o[0]=3;a<s;a++)r=t[a-e]||0,i=n&&n[a]||0,o[a+1]=t[a]+256-(r+i>>>1)&255;return o},O=function(t,e,n){var r,i,o,a,s=[],l=0,h=t.length;for(s[0]=4;l<h;l++)r=t[l-e]||0,i=n&&n[l]||0,o=n&&n[l-e]||0,a=q(r,i,o),s[l+1]=t[l]-a+256&255;return s},q=function(t,e,n){var r=t+e-n,i=Math.abs(r-t),o=Math.abs(r-e),a=Math.abs(r-n);return i<=o&&i<=a?t:o<=a?e:n},T=function(){return[S,j,E,M,O]},R=function(t){for(var e,n,r,i=0,o=t.length;i<o;)((e=D(t[i].slice(1)))<n||!n)&&(n=e,r=i),i++;return r},D=function(t){for(var e=0,n=t.length,r=0;e<n;)r+=Math.abs(t[e++]);return r},I.processPNG=function(t,e,n,r,i){var o,a,s,l,h,u,c=this.color_spaces.DEVICE_RGB,f=this.decode.FLATE_DECODE,p=8;if(this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)){if("function"!=typeof PNG||"function"!=typeof kt)throw new Error("PNG support requires png.js and zlib.js");if(t=(o=new PNG(t)).imgData,p=o.bits,c=o.colorSpace,l=o.colors,-1!==[4,6].indexOf(o.colorType)){if(8===o.bits)for(var d,g=(_=32==o.pixelBitlength?new Uint32Array(o.decodePixels().buffer):16==o.pixelBitlength?new Uint16Array(o.decodePixels().buffer):new Uint8Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*o.colors),y=new Uint8Array(g),v=o.pixelBitlength-o.bits,w=0,b=0;w<g;w++){for(x=_[w],d=0;d<v;)m[b++]=x>>>d&255,d+=o.bits;y[w]=x>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,N=1<o.colors,L=b=w=0;w<g;)x=_[w++],m[b++]=x>>>0&255,N&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),y[L++]=x>>>16&255;p=8}r!==I.image_compression.NONE&&C()?(t=B(m,o.width*o.colors,o.colors,r),u=B(y,o.width,1,r)):(t=m,u=y,f=null)}if(3===o.colorType&&(c=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;w<g;++w)S+=A[w];if((S/=255)==g-1&&-1!==A.indexOf(0))s=[A.indexOf(0)];else if(S!==g){var _=o.decodePixels();for(y=new Uint8Array(_.length),w=0,g=_.length;w<g;w++)y[w]=A[_[w]];u=B(y,o.width,1)}}var F=function(t){var e;switch(t){case I.image_compression.FAST:e=11;break;case I.image_compression.MEDIUM:e=13;break;case I.image_compression.SLOW:e=14;break;default:e=12}return e}(r);return a=f===this.decode.FLATE_DECODE?"/Predictor "+F+" /Colors "+l+" /BitsPerComponent "+p+" /Columns "+o.width:"/Colors "+l+" /BitsPerComponent "+p+" /Columns "+o.width,(this.isArrayBuffer(t)||this.isArrayBufferView(t))&&(t=this.arrayBufferToBinaryString(t)),(u&&this.isArrayBuffer(u)||this.isArrayBufferView(u))&&(u=this.arrayBufferToBinaryString(u)),this.createImageInfo(t,o.width,o.height,c,p,f,e,n,a,s,h,u,F)}throw new Error("Unsupported PNG image data, try using JPEG instead.")},(
/**
   * @license
   * Copyright (c) 2017 Aras Abbasi 
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
U=lt.API).processGIF89A=function(t,e,n,r,i){var o=new At(t),a=o.width,s=o.height,l=[];o.decodeAndBlitFrameRGBA(0,l);var h={data:l,width:a,height:s},u=new _t(100).encode(h,100);return U.processJPEG.call(this,u,e,n,r)},U.processGIF87A=U.processGIF89A,(
/**
   * Copyright (c) 2018 Aras Abbasi 
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
z=lt.API).processBMP=function(t,e,n,r,i){var o=new Ft(t,!1),a=o.width,s=o.height,l={data:o.getData(),width:a,height:s},h=new _t(100).encode(l,100);return z.processJPEG.call(this,h,e,n,r)},lt.API.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"FYRO Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]&&(this.internal.languageSettings.languageCode=t,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},
/** @license
   * MIT license.
   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
   *               2014 Diego Casorran, https://github.com/diegocr
   *
   * 
   * ====================================================================
   */
H=lt.API,W=H.getCharWidthsArray=function(t,e){var n,r,i,o=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),s=e.charSpace||this.internal.getCharSpace(),l=e.widths?e.widths:o.metadata.Unicode.widths,h=l.fof?l.fof:1,u=e.kerning?e.kerning:o.metadata.Unicode.kerning,c=u.fof?u.fof:1,f=0,p=l[0]||h,d=[];for(n=0,r=t.length;n<r;n++)i=t.charCodeAt(n),"function"==typeof o.metadata.widthOfString?d.push((o.metadata.widthOfGlyph(o.metadata.characterToGlyph(i))+s*(1e3/a)||0)/1e3):d.push((l[i]||p)/h+(u[i]&&u[i][f]||0)/c),f=i;return d},V=H.getArraySum=function(t){for(var e=t.length,n=0;e;)n+=t[--e];return n},G=H.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(t,n,i)/n:V(W.apply(this,arguments))},Y=function(t,e,n,r){for(var i=[],o=0,a=t.length,s=0;o!==a&&s+e[o]<n;)s+=e[o],o++;i.push(t.slice(0,o));var l=o;for(s=0;o!==a;)s+e[o]>r&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},J=function(t,e,n){n||(n={});var r,i,o,a,s,l,h=[],u=[h],c=n.textIndent||0,f=0,p=0,d=t.split(" "),g=W.apply(this,[" ",n])[0];if(l=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(l).join(" "),y=[];d.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),d=y,l=G.apply(this,[m,n])}for(o=0,a=d.length;o<a;o++){var v=0;if(r=d[o],l&&"\n"==r[0]&&(r=r.substr(1),v=1),i=W.apply(this,[r,n]),e<c+f+(p=V(i))||v){if(e<p){for(s=Y.apply(this,[r,i,e-(c+f),e]),h.push(s.shift()),h=[s.pop()];s.length;)u.push([s.shift()]);p=V(i.slice(r.length-(h[0]?h[0].length:0)))}else h=[r];u.push(h),c=p+l,f=g}else h.push(r),c+=f+p,f=g}if(l)var w=function(t,e){return(e?m:"")+t.join(" ")};else w=function(t){return t.join(" ")};return u.map(w)},H.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),o=function(t){var e={0:1},n={};if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var r=this.internal.getFont(t.fontName,t.fontStyle),i="Unicode";return r.metadata[i]?{widths:r.metadata[i].widths||e,kerning:r.metadata[i].kerning||n}:{font:r.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(t)?t:t.split(/\r?\n/);var a=1*this.internal.scaleFactor*e/i;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=n.lineIndent;var s,l,h=[];for(s=0,l=r.length;s<l;s++)h=h.concat(J.apply(this,[r[s],a,o]));return h},
/** @license
   jsPDF standard_fonts_metrics plugin
   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
   * MIT license.
   * 
   * ====================================================================
   */
X=lt.API,Z={codePages:["WinAnsiEncoding"],WinAnsiEncoding:(K=function(t){for(var e="klmnopqrstuvwxyz",n={},r=0;r<e.length;r++)n[e[r]]="0123456789abcdef"[r];var i,o,a,s,l,h={},u=1,c=h,f=[],p="",d="",g=t.length-1;for(r=1;r!=g;)l=t[r],r+=1,"'"==l?o=o?(s=o.join(""),i):[]:o?o.push(l):"{"==l?(f.push([c,s]),c={},s=i):"}"==l?((a=f.pop())[0][a[1]]=c,s=i,c=a[0]):"-"==l?u=-1:s===i?n.hasOwnProperty(l)?(p+=n[l],s=parseInt(p,16)*u,u=1,p=""):p+=l:n.hasOwnProperty(l)?(d+=n[l],c[s]=parseInt(d,16)*u,u=1,s=i,d=""):d+=l;return h})("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},Q={Unicode:{Courier:Z,"Courier-Bold":Z,"Courier-BoldOblique":Z,"Courier-Oblique":Z,Helvetica:Z,"Helvetica-Bold":Z,"Helvetica-BoldOblique":Z,"Helvetica-Oblique":Z,"Times-Roman":Z,"Times-Bold":Z,"Times-BoldItalic":Z,"Times-Italic":Z}},$={Unicode:{"Courier-Oblique":K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":K("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":K("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":K("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:K("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:K("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":K("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:K("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":K("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":K("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":K("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":K("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}},X.events.push(["addFont",function(t){var e,n,r,i=t.font,o="Unicode";(e=$[o][i.postScriptName])&&((n=i.metadata[o]?i.metadata[o]:i.metadata[o]={}).widths=e.widths,n.kerning=e.kerning),(r=Q[o][i.postScriptName])&&((n=i.metadata[o]?i.metadata[o]:i.metadata[o]={}).encoding=r).codePages&&r.codePages.length&&(i.encoding=r.codePages[0])}]),
/**
   * @license
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   */
tt=lt,"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||"undefined"!=typeof window&&window||Function("return this")(),tt.API.events.push(["addFont",function(t){var e=t.font,n=t.instance;if(void 0!==n&&n.existsFileInVFS(e.postScriptName)){var r=n.getFileFromVFS(e.postScriptName);if("string"!=typeof r)throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+e.postScriptName+"').");e.metadata=tt.API.TTFFont.open(e.postScriptName,e.fontName,r,e.encoding),e.metadata.Unicode=e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},e.metadata.glyIdsUsed=[0]}else if(!1===e.isStandardFont)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+e.postScriptName+"').")}]),(
/** @license
   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
   * 
   * 
   * ====================================================================
   */
et=lt.API).addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error("addSVG needs values for 'x' and 'y'");function o(t){for(var e=parseFloat(t[1]),n=parseFloat(t[2]),r=[],i=3,o=t.length;i<o;)"c"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2]),parseFloat(t[i+3]),parseFloat(t[i+4]),parseFloat(t[i+5]),parseFloat(t[i+6])]),i+=7):"l"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2])]),i+=3):i+=1;return[e,n,r]}var a,s,l,h,u,c,f,p,d=(h=document,p=h.createElement("iframe"),u=".jsPDF_sillysvg_iframe {display:none;position:absolute;}",(f=(c=h).createElement("style")).type="text/css",f.styleSheet?f.styleSheet.cssText=u:f.appendChild(c.createTextNode(u)),c.getElementsByTagName("head")[0].appendChild(f),p.name="childframe",p.setAttribute("width",0),p.setAttribute("height",0),p.setAttribute("frameborder","0"),p.setAttribute("scrolling","no"),p.setAttribute("seamless","seamless"),p.setAttribute("class","jsPDF_sillysvg_iframe"),h.body.appendChild(p),p),g=(a=t,(l=((s=d).contentWindow||s.contentDocument).document).write(a),l.close(),l.getElementsByTagName("svg")[0]),m=[1,1],y=parseFloat(g.getAttribute("width")),v=parseFloat(g.getAttribute("height"));y&&v&&(r&&i?m=[r/y,i/v]:r?m=[r/y,r/y]:i&&(m=[i/v,i/v]));var w,b,x,N,L=g.childNodes;for(w=0,b=L.length;w<b;w++)(x=L[w]).tagName&&"PATH"===x.tagName.toUpperCase()&&((N=o(x.getAttribute("d").split(" ")))[0]=N[0]*m[0]+e,N[1]=N[1]*m[1]+n,this.lines.call(this,N[2],N[0],N[1],m));return this},et.addSVG=et.addSvg,et.addSvgAsImage=function(t,e,n,r,i,o,a,s){if(isNaN(e)||isNaN(n))throw console.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw console.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=i;var h=l.getContext("2d");return h.fillStyle="#fff",h.fillRect(0,0,l.width,l.height),canvg(l,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0}),this.addImage(l.toDataURL("image/jpeg",1),e,n,r,i,a,s),this},lt.API.putTotalPages=function(t){var e,n=0;n=parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},lt.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),s=[],l=0,h=0,u=0,c=!0;function f(t,e){var n,r=!1;for(n=0;n<t.length;n+=1)t[n]===e&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===t||!0===e){var p=a.length;for(u=0;u<p;u+=1)n[a[u]].value=n[a[u]].defaultValue,n[a[u]].explicitSet=!1}if("object"===se(t))for(r in t)if(i=t[r],f(a,r)&&void 0!==i){if("boolean"===n[r].type&&"boolean"==typeof i)n[r].value=i;else if("name"===n[r].type&&f(n[r].valueSet,i))n[r].value=i;else if("integer"===n[r].type&&Number.isInteger(i))n[r].value=i;else if("array"===n[r].type){for(l=0;l<i.length;l+=1)if(c=!0,1===i[l].length&&"number"==typeof i[l][0])s.push(String(i[l]-1));else if(1<i[l].length){for(h=0;h<i[l].length;h+=1)"number"!=typeof i[l][h]&&(c=!1);!0===c&&s.push([i[l][0]-1,i[l][1]-1].join(" "))}n[r].value="["+s.join(" ")+"]"}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
/** ==================================================================== 
   * jsPDF XMP metadata plugin
   * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
   * 
   * 
   * ====================================================================
   */
nt=lt.API,ot=it=rt="",nt.addMetadata=function(t,e){return it=e||"http://jspdf.default.namespaceuri/",rt=t,this.internal.events.subscribe("postPutResources",function(){if(rt){var t='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+it+'"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(rt)),i=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),o=unescape(encodeURIComponent("</x:xmpmeta>")),a=n.length+r.length+i.length+e.length+o.length;ot=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ot=""}),this.internal.events.subscribe("putCatalog",function(){ot&&this.internal.write("/Metadata "+ot+" 0 R")}),this},function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<s;++a){if(n=e.metadata.characterToGlyph(t.charCodeAt(a)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(a),-1==r.indexOf(n)&&(r.push(n),r.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(i[4-n.length],n)}return o.join("")},p=function(t){var e,n,r,i,o,a,s;for(o="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n  /Registry (Adobe)\n  /Ordering (UCS)\n  /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],a=0,s=(n=Object.keys(t).sort(function(t,e){return t-e})).length;a<s;a++)e=n[a],100<=r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),i=("0000"+t[e].toString(16)).slice(-4),e=("0000"+(+e).toString(16)).slice(-4),r.push("<"+e+"><"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),a="",s=0;s<o.length;s++)a+=String.fromCharCode(o[s]);var l=n();r({data:a,addLength1:!0}),e("endobj");var h=n();r({data:p(t.metadata.toUnicode),addLength1:!0}),e("endobj");var u=n();e("<<"),e("/Type /FontDescriptor"),e("/FontName /"+t.fontName),e("/FontFile2 "+l+" 0 R"),e("/FontBBox "+f.API.PDFObject.convert(t.metadata.bbox)),e("/Flags "+t.metadata.flags),e("/StemV "+t.metadata.stemV),e("/ItalicAngle "+t.metadata.italicAngle),e("/Ascent "+t.metadata.ascender),e("/Descent "+t.metadata.decender),e("/CapHeight "+t.metadata.capHeight),e(">>"),e("endobj");var c=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+u+" 0 R"),e("/W "+f.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+h+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+c+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",a=0;a<i.length;a++)o+=String.fromCharCode(i[a]);var s=n();r({data:o,addLength1:!0}),e("endobj");var l=n();r({data:p(t.metadata.toUnicode),addLength1:!0}),e("endobj");var h=n();for(e("<<"),e("/Descent "+t.metadata.decender),e("/CapHeight "+t.metadata.capHeight),e("/StemV "+t.metadata.stemV),e("/Type /FontDescriptor"),e("/FontFile2 "+s+" 0 R"),e("/Flags 96"),e("/FontBBox "+f.API.PDFObject.convert(t.metadata.bbox)),e("/FontName /"+t.fontName),e("/ItalicAngle "+t.metadata.italicAngle),e("/Ascent "+t.metadata.ascender),e(">>"),e("endobj"),t.objectNumber=n(),a=0;a<t.metadata.hmtx.widths.length;a++)t.metadata.hmtx.widths[a]=parseInt(t.metadata.hmtx.widths[a]*(1e3/t.metadata.head.unitsPerEm));e("<</Subtype/TrueType/Type/Font/ToUnicode "+l+" 0 R/BaseFont/"+t.fontName+"/FontDescriptor "+h+" 0 R/Encoding/"+t.encoding+" /FirstChar 29 /LastChar 255 /Widths "+f.API.PDFObject.convert(t.metadata.hmtx.widths)+">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var h=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},l=s.pdfEscape,h=s.activeFontKey,u=s.fonts,c=(s.activeFontSize,""),f=0,p="",d=u[n=h].encoding;if("Identity-H"!==u[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(p=r,n=h,"[object Array]"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;f<p.length;f+=1)u[n].metadata.hasOwnProperty("cmap")&&(e=u[n].metadata.cmap.unicode.codeMap[p[f].charCodeAt(0)]),e?c+=p[f]:p[f].charCodeAt(0)<256&&u[n].metadata.hasOwnProperty("Unicode")?c+=p[f]:c+="";var g="";return parseInt(n.slice(1))<14||"WinAnsiEncoding"===d?g=function(t){for(var e="",n=0;n<t.length;n++)e+=""+t.charCodeAt(n).toString(16);return e}(l(c,n)):"Identity-H"===d&&(g=m(c,u[n])),s.isHex=!0,{text:g,x:i,y:o,options:a,mutex:s}};e.events.push(["postProcessText",function(t){var e=t.text||"",n=t.x,r=t.y,i=t.options,o=t.mutex,a=(i.lang,[]),s={text:e,x:n,y:r,options:i,mutex:o};if("[object Array]"===Object.prototype.toString.call(e)){var l=0;for(l=0;l<e.length;l+=1)"[object Array]"===Object.prototype.toString.call(e[l])&&3===e[l].length?a.push([h(Object.assign({},s,{text:e[l][0]})).text,e[l][1],e[l][2]]):a.push(h(Object.assign({},s,{text:e[l]})).text);t.text=a}else t.text=h(Object.assign({},s,{text:e})).text}])}(lt,"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||"undefined"!=typeof window&&window||Function("return this")()),at=lt.API,st=function(t){return void 0!==t&&(void 0===t.vFS&&(t.vFS={}),!0)},at.existsFileInVFS=function(t){return!!st(this.internal)&&void 0!==this.internal.vFS[t]},at.addFileToVFS=function(t,e){return st(this.internal),this.internal.vFS[t]=e,this},at.getFileFromVFS=function(t){return st(this.internal),void 0!==this.internal.vFS[t]?this.internal.vFS[t]:null},lt.API.addHTML=function(t,d,g,s,m){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof d&&(s=d,m=g),"function"==typeof s&&(m=s,s=null),"function"!=typeof m&&(m=function(){});var e=this.internal,y=e.scaleFactor,v=e.pageSize.getWidth(),w=e.pageSize.getHeight();if((s=s||{}).onrendered=function(l){d=parseInt(d)||0,g=parseInt(g)||0;var t=s.dim||{},h=Object.assign({top:0,right:0,bottom:0,left:0,useFor:"content"},s.margin),e=t.h||Math.min(w,l.height/y),u=t.w||Math.min(v,l.width/y)-d,c=s.format||"JPEG",f=s.imageCompression||"SLOW";if(l.height>w-h.top-h.bottom&&s.pagesplit){var p=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i,o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||"#ffffff",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?h.top:g,i.left=0!==n?h.left:d,o=(v-h.left-h.right)*y<l.width,"content"===h.useFor?0===n?(t=Math.min((v-h.left)*y,l.width),e=Math.min((w-h.top)*y,l.height-n)):(t=Math.min(v*y,l.width),e=Math.min(w*y,l.height-n),i.top=0):(t=Math.min((v-h.left-h.right)*y,l.width),e=Math.min((w-h.bottom-h.top)*y,l.height-n)),o)for(;;){"content"===h.useFor&&(0===r?t=Math.min((v-h.left)*y,l.width):(t=Math.min(v*y,l.width-r),i.left=0));var s=[a=p(l,r,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f];if(this.addImage.apply(this,s),(r+=t)>=l.width)break;this.addPage()}else s=[a=p(l,0,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f],this.addImage.apply(this,s);if((n+=e)>=l.height)break;this.addPage()}m(u,n,null,s)}.bind(this);if("CANVAS"===l.nodeName){var r=new Image;r.onload=n,r.src=l.toDataURL("image/png"),l=r}else n()}else{var i=Math.random().toString(35),o=[l,d,g,u,e,c,i,f];this.addImage.apply(this,o),m(u,e,i,o)}}.bind(this),"undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"==typeof rasterizeHTML)return null;var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"),s.width=s.width||v*y,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})},
/**
   * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser
   * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
   *               2014 Diego Casorran, https://github.com/diegocr
   *               2014 Daniel Husar, https://github.com/danielhusar
   *               2014 Wolfgang Gassler, https://github.com/woolfg
   *               2014 Steven Spungin, https://github.com/flamenco
   *
   * @license
   * 
   * ====================================================================
   */
function(t){var P,k,i,a,s,l,h,u,I,w,f,c,p,n,C,B,d,g,m,j;P=function(){return function(t){return e.prototype=t,new e};function e(){}}(),w=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},c=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},p=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1<t.indexOf("pt")&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"),void 0,16,(e=n[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])?n[t]=e/16:(e=parseFloat(t))?n[t]=e/16:(e=t.match(/([\d\.]+)(px)/),Array.isArray(e)&&3===e.length?n[t]=parseFloat(e[1])/16:n[t]=1)},I=function(t){var e,n,r,i,o;return o=t,i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(o,null):o.currentStyle?o.currentStyle:o.style,n=void 0,(e={})["font-family"]=c((r=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),i[t]})("font-family"))||"times",e["font-style"]=a[r("font-style")]||"normal",e["text-align"]=s[r("text-align")]||"left","bold"===(n=l[r("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=p(r("font-size"))||1,e["line-height"]=p(r("line-height"))||1,e.display="inline"===r("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&p(r("margin-top"))||0,e["margin-bottom"]=n&&p(r("margin-bottom"))||0,e["padding-top"]=n&&p(r("padding-top"))||0,e["padding-bottom"]=n&&p(r("padding-bottom"))||0,e["margin-left"]=n&&p(r("margin-left"))||0,e["margin-right"]=n&&p(r("margin-right"))||0,e["padding-left"]=n&&p(r("padding-left"))||0,e["padding-right"]=n&&p(r("padding-right"))||0,e["page-break-before"]=r("page-break-before")||"auto",e.float=h[r("cssFloat")]||"none",e.clear=u[r("clear")]||"none",e.color=r("color"),e},C=function(t,e,n){var r,i,o,a,s;if(o=!1,a=i=void 0,r=n["#"+t.id])if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;if(r=n[t.nodeName],!o&&r)if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;for(s="string"==typeof t.className?t.className.split(" "):[],i=0;i<s.length;i++)if(r=n["."+s[i]],!o&&r)if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;return o},j=function(t,e){var n,r,i,o,a,s,l,h,u;for(n=[],r=[],i=0,u=t.rows[0].cells.length,l=t.clientWidth;i<u;)h=t.rows[0].cells[i],r[i]={name:h.textContent.toLowerCase().replace(/\s+/g,""),prompt:h.textContent.replace(/\r?\n/g,""),width:h.clientWidth/l*e.pdf.internal.pageSize.getWidth()},i++;for(i=1;i<t.rows.length;){for(s=t.rows[i],a={},o=0;o<s.cells.length;)a[r[o].name]=s.cells[o].textContent.replace(/\r?\n/g,""),o++;n.push(a),i++}return{rows:n,headers:r}};var E={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},M=1;k=function(t,i,e){var n,r,o,a,s,l,h,u;for(r=t.childNodes,n=void 0,(s="block"===(o=I(t)).display)&&(i.setBlockBoundary(),i.setBlockStyle(o)),a=0,l=r.length;a<l;){if("object"===se(n=r[a])){if(i.executeWatchFunctions(n),1===n.nodeType&&"HEADER"===n.nodeName){var c=n,f=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=f,k(c,i,e),i.pdf.margins_doc.top=i.y+10,i.y+=10},!1)}if(8===n.nodeType&&"#comment"===n.nodeName)~n.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top);else if(1!==n.nodeType||E[n.nodeName])if(3===n.nodeType){var p=n.nodeValue;if(n.nodeValue&&"LI"===n.parentNode.nodeName)if("OL"===n.parentNode.parentNode.nodeName)p=M+++". "+p;else{var d=o["font-size"],g=(3-.75*d)*i.pdf.internal.scaleFactor,m=.75*d*i.pdf.internal.scaleFactor,y=1.74*d/i.pdf.internal.scaleFactor;u=function(t,e){this.pdf.circle(t+g,e+m,y,"FD")}}16&n.ownerDocument.body.compareDocumentPosition(n)&&i.addText(p,o)}else"string"==typeof n&&i.addText(n,o);else{var v;if("IMG"===n.nodeName){var w=n.getAttribute("src");v=B[i.pdf.sHashCode(w)||w]}if(v){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+n.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(n));var b=I(n),x=i.x,N=12/i.pdf.internal.scaleFactor,L=(b["margin-left"]+b["padding-left"])*N,A=(b["margin-right"]+b["padding-right"])*N,S=(b["margin-top"]+b["padding-top"])*N,_=(b["margin-bottom"]+b["padding-bottom"])*N;void 0!==b.float&&"right"===b.float?x+=i.settings.width-n.width-A:x+=L,i.pdf.addImage(v,x,i.y+S,n.width,n.height),v=void 0,"right"===b.float||"left"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!E[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===b.float?-n.width-L-A:0,i.y+n.height+S+_,n.width)),i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===I(n).clear&&(i.y=t,!0)}.bind(this,i.y+n.height,i.pdf.internal.getNumberOfPages())),i.settings.width-=n.width+L+A,"left"===b.float&&(i.x+=n.width+L+A)):i.y+=n.height+S+_}else if("TABLE"===n.nodeName)h=j(n,i),i.y+=10,i.pdf.table(i.x,i.y,h.rows,h.headers,{autoSize:!1,printHeaders:e.printHeaders,margins:i.pdf.margins_doc,css:I(n)}),i.y=i.pdf.lastCellPos.y+i.pdf.lastCellPos.h+20;else if("OL"===n.nodeName||"UL"===n.nodeName)M=1,C(n,i,e)||k(n,i,e),i.y+=10;else if("LI"===n.nodeName){var F=i.x;i.x+=20/i.pdf.internal.scaleFactor,i.y+=3,C(n,i,e)||k(n,i,e),i.x=F}else"BR"===n.nodeName?(i.y+=o["font-size"]*i.pdf.internal.scaleFactor,i.addText("\u2028",P(o))):C(n,i,e)||k(n,i,e)}}a++}if(e.outY=i.y,s)return i.setBlockBoundary(u)},B={},d=function(t,o,e,n){var a,r=t.getElementsByTagName("img"),i=r.length,s=0;function l(){o.pdf.internal.events.publish("imagesLoaded"),n(a)}function h(e,n,r){if(e){var i=new Image;a=++s,i.crossOrigin="",i.onerror=i.onload=function(){if(i.complete&&(0===i.src.indexOf("data:image/")&&(i.width=n||i.width||0,i.height=r||i.height||0),i.width+i.height)){var t=o.pdf.sHashCode(e)||e;B[t]=B[t]||i}--s||l()},i.src=e}}for(;i--;)h(r[i].getAttribute("src"),r[i].width,r[i].height);return s||l()},g=function(t,o,a){var s=t.getElementsByTagName("footer");if(0<s.length){s=s[0];var e=o.pdf.internal.write,n=o.y;o.pdf.internal.write=function(){},k(s,o,a);var l=Math.ceil(o.y-n)+5;o.y=n,o.pdf.internal.write=e,o.pdf.margins_doc.bottom+=l;for(var r=function(t){var e=void 0!==t?t.pageNumber:1,n=o.y;o.y=o.pdf.internal.pageSize.getHeight()-o.pdf.margins_doc.bottom,o.pdf.margins_doc.bottom-=l;for(var r=s.getElementsByTagName("span"),i=0;i<r.length;++i)-1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")&&(r[i].innerHTML=e),-1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&(r[i].innerHTML="###jsPDFVarTotalPages###");k(s,o,a),o.pdf.margins_doc.bottom+=l,o.y=n},i=s.getElementsByTagName("span"),h=0;h<i.length;++h)-1<(" "+i[h].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&o.pdf.internal.events.subscribe("htmlRenderingFinished",o.pdf.putTotalPages.bind(o.pdf,"###jsPDFVarTotalPages###"),!0);o.pdf.internal.events.subscribe("addPage",r,!1),r(),E.FOOTER=1}},m=function(t,e,n,r,i,o){if(!e)return!1;var a,s,l,h;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(a=e.replace(/<\/?script[^>]*?>/gi,""),h="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",l.innerHTML='<iframe style="height:1px;width:1px" name="'+h+'" />',document.body.appendChild(l),(s=window.frames[h]).document.open(),s.document.writeln(a),s.document.close(),e=s.document.body);var u,c=new f(t,n,r,i);return d.call(this,e,c,i.elementHandlers,function(t){g(e,c,i.elementHandlers),k(e,c,i.elementHandlers),c.pdf.internal.events.publish("htmlRenderingFinished"),u=c.dispose(),"function"==typeof o?o(u):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")}),u||{x:c.x,y:c.y}},(f=function(t,e,n,r){return this.pdf=t,this.x=e,this.y=n,this.settings=r,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},f.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},f.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(0<this.watchFunctions.length){for(var r=0;r<this.watchFunctions.length;++r)!0===this.watchFunctions[r](t)?e=!0:n.push(this.watchFunctions[r]);this.watchFunctions=n}return e},f.prototype.splitFragmentsIntoLines=function(t,e){var n,r,i,o,a,s,l,h,u,c,f,p,d,g;for(12,c=this.pdf.internal.scaleFactor,o={},s=l=h=g=a=i=u=r=void 0,p=[f=[]],n=0,d=this.settings.width;t.length;)if(a=t.shift(),g=e.shift(),a)if((i=o[(r=g["font-family"])+(u=g["font-style"])])||(i=this.pdf.internal.getFont(r,u).metadata.Unicode,o[r+u]=i),h={widths:i.widths,kerning:i.kerning,fontSize:12*g["font-size"],textIndent:n},l=this.pdf.getStringUnitWidth(a,h)*h.fontSize/c,"\u2028"==a)f=[],p.push(f);else if(d<n+l){for(s=this.pdf.splitTextToSize(a,d,h),f.push([s.shift(),g]);s.length;)f=[[s.shift(),g]],p.push(f);n=this.pdf.getStringUnitWidth(f[0][0],h)*h.fontSize/c}else f.push([a,g]),n+=l;if(void 0!==g["text-align"]&&("center"===g["text-align"]||"right"===g["text-align"]||"justify"===g["text-align"]))for(var m=0;m<p.length;++m){var y=this.pdf.getStringUnitWidth(p[m][0][0],h)*h.fontSize/c;0<m&&(p[m][0][1]=P(p[m][0][1]));var v=d-y;if("right"===g["text-align"])p[m][0][1]["margin-left"]=v;else if("center"===g["text-align"])p[m][0][1]["margin-left"]=v/2;else if("justify"===g["text-align"]){var w=p[m][0][0].split(" ").length-1;p[m][0][1]["word-spacing"]=v/w,m===p.length-1&&(p[m][0][1]["word-spacing"]=0)}}return p},f.prototype.RenderTextFragment=function(t,e){var n,r;r=0,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()&&(this.pdf.internal.write("ET","Q"),this.pdf.addPage(),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),r=Math.max(r,e["line-height"],e["font-size"]),this.pdf.internal.write(0,(-12*r).toFixed(2),"Td")),n=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var i=this.getPdfColor(e.color);i!==this.lastTextColor&&(this.pdf.internal.write(i),this.lastTextColor=i),void 0!==e["word-spacing"]&&0<e["word-spacing"]&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw"),this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf","("+this.pdf.internal.pdfEscape(t)+") Tj"),void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw")},f.prototype.getPdfColor=function(t){var e,n,r,i=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=i)e=parseInt(i[1]),n=parseInt(i[2]),r=parseInt(i[3]);else{if("string"==typeof t&&"#"!=t.charAt(0)){var o=new RGBColor(t);t=o.ok?o.toHex():"#000000"}e=t.substring(1,3),e=parseInt(e,16),n=t.substring(3,5),n=parseInt(n,16),r=t.substring(5,7),r=parseInt(r,16)}if("string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var a=parseInt(e.substr(1),16);e=a>>16&255,n=a>>8&255,r=255&a}var s=this.f3;return 0===e&&0===n&&0===r||void 0===n?s(e/255)+" g":[s(e/255),s(n/255),s(r/255),"rg"].join(" ")},f.prototype.f3=function(t){return t.toFixed(3)},f.prototype.renderParagraph=function(t){var e,n,r,i,o,a,s,l,h,u,c,f,p;if(r=w(this.paragraph.text),f=this.paragraph.style,e=this.paragraph.blockstyle,this.paragraph.priorblockstyle||{},this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e},r.join("").trim()){s=this.splitFragmentsIntoLines(r,f),l=a=void 0,n=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,c=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n,u=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n,this.priorMarginBottom=e["margin-bottom"]||0,"always"===e["page-break-before"]&&(this.pdf.addPage(),this.y=0,c=((e["margin-top"]||0)+(e["padding-top"]||0))*n),h=this.pdf.internal.write,o=i=void 0,this.y+=c,h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var d=0;s.length;){for(i=l=0,o=(a=s.shift()).length;i!==o;)a[i][0].trim()&&(l=Math.max(l,a[i][1]["line-height"],a[i][1]["font-size"]),p=7*a[i][1]["font-size"]),i++;var g=0,m=0;for(void 0!==a[0][1]["margin-left"]&&0<a[0][1]["margin-left"]&&(g=(m=this.pdf.internal.getCoordinateString(a[0][1]["margin-left"]))-d,d=m),h(g+Math.max(e["margin-left"]||0,0)*n,(-12*l).toFixed(2),"Td"),i=0,o=a.length;i!==o;)a[i][0]&&this.RenderTextFragment(a[i][0],a[i][1]),i++;if(this.y+=l*n,this.executeWatchFunctions(a[0][1])&&0<s.length){var y=[],v=[];s.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(y.push(t[e][0]+" "),v.push(t[e][1])),++e}),s=this.splitFragmentsIntoLines(w(y),v),h("ET","Q"),h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-p/2),h("ET","Q"),this.y+=u}},f.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)},f.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t},f.prototype.addText=function(t,e){return this.paragraph.text.push(t),this.paragraph.style.push(e)},i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},l={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},a={normal:"normal",italic:"italic",oblique:"italic"},s={left:"left",right:"right",center:"center",justify:"justify"},h={none:"none",right:"right",left:"left"},u={none:"none",both:"both"},n={normal:1},t.fromHTML=function(t,e,n,r,i,o){return this.margins_doc=o||{top:0,bottom:0},r||(r={}),r.elementHandlers||(r.elementHandlers={}),m(this,t,isNaN(e)?4:e,isNaN(n)?4:n,r,i)}}(lt.API),lt.API,("undefined"!=typeof window&&window||"undefined"!=typeof global&&global).html2pdf=function(t,a,e){var n=a.canvas;if(n){var r,i;if((n.pdf=a).annotations={_nameMap:[],createAnnotation:function(t,e){var n,r=a.context2d._wrapX(e.left),i=a.context2d._wrapY(e.top),o=(a.context2d._page(e.top),t.indexOf("#"));n=0<=o?{name:t.substring(o+1)}:{url:t},a.link(r,i,e.right-e.left,e.bottom-e.top,n)},setName:function(t,e){var n=a.context2d._wrapX(e.left),r=a.context2d._wrapY(e.top),i=a.context2d._page(e.top);this._nameMap[t]={page:i,x:n,y:r}}},n.annotations=a.annotations,a.context2d._pageBreakAt=function(t){this.pageBreaks.push(t)},a.context2d._gotoPage=function(t){for(;a.internal.getNumberOfPages()<t;)a.addPage();a.setPage(t)},"string"==typeof t){t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");var o,s,l=document.createElement("iframe");document.body.appendChild(l),null!=(o=l.contentDocument)&&null!=o||(o=l.contentWindow.document),o.open(),o.write(t),o.close(),r=o.body,s=o.body||{},t=o.documentElement||{},i=Math.max(s.scrollHeight,s.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}else s=(r=t).body||{},i=Math.max(s.scrollHeight,s.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight);var h={async:!0,allowTaint:!0,backgroundColor:"#ffffff",canvas:n,imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1,windowHeight:i=a.internal.pageSize.getHeight(),scrollY:i};a.context2d.pageWrapYEnabled=!0,a.context2d.pageWrapY=a.internal.pageSize.getHeight(),html2canvas(r,h).then(function(t){e&&(l&&l.parentElement.removeChild(l),e(a))})}else alert("jsPDF canvas plugin not installed")},window.tmp=html2pdf,function(f){var r=f.BlobBuilder||f.WebKitBlobBuilder||f.MSBlobBuilder||f.MozBlobBuilder;f.URL=f.URL||f.webkitURL||function(t,e){return(e=document.createElement("a")).href=t,e};var n=f.Blob,p=URL.createObjectURL,d=URL.revokeObjectURL,o=f.Symbol&&f.Symbol.toStringTag,t=!1,e=!1,g=!!f.ArrayBuffer,i=r&&r.prototype.append&&r.prototype.getBlob;try{t=2===new Blob(["ä"]).size,e=2===new Blob([new Uint8Array([1,2])]).size}catch(t){}function a(t){return t.map(function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var n=new Uint8Array(t.byteLength);n.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=n.buffer}return e}return t})}function s(t,e){e=e||{};var n=new r;return a(t).forEach(function(t){n.append(t)}),e.type?n.getBlob(e.type):n.getBlob()}function l(t,e){return new n(a(t),e||{})}if(f.Blob&&(s.prototype=Blob.prototype,l.prototype=Blob.prototype),o)try{File.prototype[o]="File",Blob.prototype[o]="Blob",FileReader.prototype[o]="FileReader"}catch(t){}function h(){var t=!!f.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,e=f.XMLHttpRequest&&f.XMLHttpRequest.prototype.send;t&&e&&(XMLHttpRequest.prototype.send=function(t){t instanceof Blob&&this.setRequestHeader("Content-Type",t.type),e.call(this,t)});try{new File([],"")}catch(t){try{var n=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();f.File=n}catch(t){n=function(t,e,n){var r=new Blob(t,n),i=n&&void 0!==n.lastModified?new Date(n.lastModified):new Date;return r.name=e,r.lastModifiedDate=i,r.lastModified=+i,r.toString=function(){return"[object File]"},o&&(r[o]="File"),r};f.File=n}}}t?(h(),f.Blob=e?f.Blob:l):i?(h(),f.Blob=s):function(){function a(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e.push(r):r<2048?e.push(192|r>>6,128|63&r):r<55296||57344<=r?e.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&t.charCodeAt(n)),e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return e}function e(t){var e,n,r,i,o,a;for(e="",r=t.length,n=0;n<r;)switch((i=t[n++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=String.fromCharCode(i);break;case 12:case 13:o=t[n++],e+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=t[n++],a=t[n++],e+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&a)<<0)}return e}function s(t){for(var e=new Array(t.byteLength),n=new Uint8Array(t),r=e.length;r--;)e[r]=n[r];return e}function n(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=0;r<t.length;r+=3){var i=t[r],o=r+1<t.length,a=o?t[r+1]:0,s=r+2<t.length,l=s?t[r+2]:0,h=i>>2,u=(3&i)<<4|a>>4,c=(15&a)<<2|l>>6,f=63&l;s||(f=64,o||(c=64)),n.push(e[h],e[u],e[c],e[f])}return n.join("")}var t=Object.create||function(t){function e(){}return e.prototype=t,new e};if(g)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&-1<r.indexOf(Object.prototype.toString.call(t))};function h(t,e){for(var n=0,r=(t=t||[]).length;n<r;n++){var i=t[n];i instanceof h?t[n]=i._buffer:"string"==typeof i?t[n]=a(i):g&&(ArrayBuffer.prototype.isPrototypeOf(i)||l(i))?t[n]=s(i):g&&(o=i)&&DataView.prototype.isPrototypeOf(o)?t[n]=s(i.buffer):t[n]=a(String(i))}var o;this._buffer=[].concat.apply([],t),this.size=this._buffer.length,this.type=e&&e.type||""}function i(t,e,n){var r=h.call(this,t,n=n||{})||this;return r.name=e,r.lastModifiedDate=n.lastModified?new Date(n.lastModified):new Date,r.lastModified=+r.lastModifiedDate,r}if(h.prototype.slice=function(t,e,n){return new h([this._buffer.slice(t||0,e||this._buffer.length)],{type:n})},h.prototype.toString=function(){return"[object Blob]"},(i.prototype=t(h.prototype)).constructor=i,Object.setPrototypeOf)Object.setPrototypeOf(i,h);else try{i.__proto__=h}catch(t){}function o(){if(!(this instanceof o))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var n=document.createDocumentFragment();this.addEventListener=n.addEventListener,this.dispatchEvent=function(t){var e=this["on"+t.type];"function"==typeof e&&e(t),n.dispatchEvent(t)},this.removeEventListener=n.removeEventListener}function u(t,e,n){if(!(e instanceof h))throw new TypeError("Failed to execute '"+n+"' on 'FileReader': parameter 1 is not of type 'Blob'.");t.result="",setTimeout(function(){this.readyState=o.LOADING,t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend"))})}i.prototype.toString=function(){return"[object File]"},o.EMPTY=0,o.LOADING=1,o.DONE=2,o.prototype.error=null,o.prototype.onabort=null,o.prototype.onerror=null,o.prototype.onload=null,o.prototype.onloadend=null,o.prototype.onloadstart=null,o.prototype.onprogress=null,o.prototype.readAsDataURL=function(t){u(this,t,"readAsDataURL"),this.result="data:"+t.type+";base64,"+n(t._buffer)},o.prototype.readAsText=function(t){u(this,t,"readAsText"),this.result=e(t._buffer)},o.prototype.readAsArrayBuffer=function(t){u(this,t,"readAsText"),this.result=t._buffer.slice()},o.prototype.abort=function(){},URL.createObjectURL=function(t){return t instanceof h?"data:"+t.type+";base64,"+n(t._buffer):p.call(URL,t)},URL.revokeObjectURL=function(t){d&&d.call(URL,t)};var c=f.XMLHttpRequest&&f.XMLHttpRequest.prototype.send;c&&(XMLHttpRequest.prototype.send=function(t){t instanceof h?(this.setRequestHeader("Content-Type",t.type),c.call(this,e(t._buffer))):c.call(this,t)}),f.FileReader=o,f.File=i,f.Blob=h}()}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")());var ht,ut,ct,ft,pt,dt,gt,mt,yt,vt,wt,bt,xt,Nt,Lt,le=le||function(s){if(!(void 0===s||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=s.document,l=function(){return s.URL||s.webkitURL||s},h=t.createElementNS("http://www.w3.org/1999/xhtml","a"),u="download"in h,c=/constructor/i.test(s.HTMLElement)||s.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),p=s.setImmediate||s.setTimeout,d=function(t){p(function(){throw t},0)},g=function(t){setTimeout(function(){"string"==typeof t?l().revokeObjectURL(t):t.remove()},4e4)},m=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},r=function(t,n,e){e||(t=m(t));var r,i=this,o="application/octet-stream"===t.type,a=function(){!function(t,e,n){for(var r=(e=[].concat(e)).length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t)}catch(t){d(t)}}}(i,"writestart progress write writeend".split(" "))};if(i.readyState=i.INIT,u)return r=l().createObjectURL(t),void p(function(){var t,e;h.href=r,h.download=n,t=h,e=new MouseEvent("click"),t.dispatchEvent(e),a(),g(r),i.readyState=i.DONE},0);!function(){if((f||o&&c)&&s.FileReader){var e=new FileReader;return e.onloadend=function(){var t=f?e.result:e.result.replace(/^data:[^;]*;/,"data:attachment/file;");s.open(t,"_blank")||(s.location.href=t),t=void 0,i.readyState=i.DONE,a()},e.readAsDataURL(t),i.readyState=i.INIT}r||(r=l().createObjectURL(t)),o?s.location.href=r:s.open(r,"_blank")||(s.location.href=r);i.readyState=i.DONE,a(),g(r)}()},e=r.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download",n||(t=m(t)),navigator.msSaveOrOpenBlob(t,e)}:(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,function(t,e,n){return new r(t,e||t.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0);function At(x){var t=0;if(71!==x[t++]||73!==x[t++]||70!==x[t++]||56!==x[t++]||56!=(x[t++]+1&253)||97!==x[t++])throw"Invalid GIF 87a/89a header.";var N=x[t++]|x[t++]<<8,e=x[t++]|x[t++]<<8,n=x[t++],r=n>>7,i=1<<(7&n)+1;x[t++];x[t++];var o=null;r&&(o=t,t+=3*i);var a=!0,s=[],l=0,h=null,u=0,c=null;for(this.width=N,this.height=e;a&&t<x.length;)switch(x[t++]){case 33:switch(x[t++]){case 255:if(11!==x[t]||78==x[t+1]&&69==x[t+2]&&84==x[t+3]&&83==x[t+4]&&67==x[t+5]&&65==x[t+6]&&80==x[t+7]&&69==x[t+8]&&50==x[t+9]&&46==x[t+10]&&48==x[t+11]&&3==x[t+12]&&1==x[t+13]&&0==x[t+16])t+=14,c=x[t++]|x[t++]<<8,t++;else for(t+=12;;){if(0===(A=x[t++]))break;t+=A}break;case 249:if(4!==x[t++]||0!==x[t+4])throw"Invalid graphics extension block.";var f=x[t++];l=x[t++]|x[t++]<<8,h=x[t++],0==(1&f)&&(h=null),u=f>>2&7,t++;break;case 254:for(;;){if(0===(A=x[t++]))break;t+=A}break;default:throw"Unknown graphic control label: 0x"+x[t-1].toString(16)}break;case 44:var p=x[t++]|x[t++]<<8,d=x[t++]|x[t++]<<8,g=x[t++]|x[t++]<<8,m=x[t++]|x[t++]<<8,y=x[t++],v=y>>6&1,w=o,b=!1;if(y>>7){b=!0;w=t,t+=3*(1<<(7&y)+1)}var L=t;for(t++;;){var A;if(0===(A=x[t++]))break;t+=A}s.push({x:p,y:d,width:g,height:m,has_local_palette:b,palette_offset:w,data_offset:L,data_length:t-L,transparent_index:h,interlaced:!!v,delay:l,disposal:u});break;case 59:a=!1;break;default:throw"Unknown gif block: 0x"+x[t-1].toString(16)}this.numFrames=function(){return s.length},this.loopCount=function(){return c},this.frameInfo=function(t){if(t<0||t>=s.length)throw"Frame index out of range.";return s[t]},this.decodeAndBlitFrameBGRA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);St(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,l=N-s,h=s,u=4*(n.y*N+n.x),c=4*((n.y+n.height)*N+n.x),f=u,p=4*l;!0===n.interlaced&&(p+=4*(s+l)*7);for(var d=8,g=0,m=i.length;g<m;++g){var y=i[g];if(0===h&&(h=s,c<=(f+=p)&&(p=l+4*(s+l)*(d-1),f=u+(s+l)*(d<<1),d>>=1)),y===a)f+=4;else{var v=x[o+3*y],w=x[o+3*y+1],b=x[o+3*y+2];e[f++]=b,e[f++]=w,e[f++]=v,e[f++]=255}--h}},this.decodeAndBlitFrameRGBA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);St(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,l=N-s,h=s,u=4*(n.y*N+n.x),c=4*((n.y+n.height)*N+n.x),f=u,p=4*l;!0===n.interlaced&&(p+=4*(s+l)*7);for(var d=8,g=0,m=i.length;g<m;++g){var y=i[g];if(0===h&&(h=s,c<=(f+=p)&&(p=l+4*(s+l)*(d-1),f=u+(s+l)*(d<<1),d>>=1)),y===a)f+=4;else{var v=x[o+3*y],w=x[o+3*y+1],b=x[o+3*y+2];e[f++]=v,e[f++]=w,e[f++]=b,e[f++]=255}--h}}}function St(t,e,n,r){for(var i=t[e++],o=1<<i,a=o+1,s=a+1,l=i+1,h=(1<<l)-1,u=0,c=0,f=0,p=t[e++],d=new Int32Array(4096),g=null;;){for(;u<16&&0!==p;)c|=t[e++]<<u,u+=8,1===p?p=t[e++]:--p;if(u<l)break;var m=c&h;if(c>>=l,u-=l,m!==o){if(m===a)break;for(var y=m<s?m:g,v=0,w=y;o<w;)w=d[w]>>8,++v;var b=w;if(r<f+v+(y!==m?1:0))return void console.log("Warning, gif stream longer than expected.");n[f++]=b;var x=f+=v;for(y!==m&&(n[f++]=b),w=y;v--;)w=d[w],n[--x]=255&w,w>>=8;null!==g&&s<4096&&(d[s++]=g<<8|b,h+1<=s&&l<12&&(++l,h=h<<1|1)),g=m}else s=a+1,h=(1<<(l=i+1))-1,g=null}return f!==r&&console.log("Warning, gif stream shorter than expected."),n}try{exports.GifWriter=function(y,t,e,n){var v=0,r=void 0===(n=void 0===n?{}:n).loop?null:n.loop,w=void 0===n.palette?null:n.palette;if(t<=0||e<=0||65535<t||65535<e)throw"Width/Height invalid.";function b(t){var e=t.length;if(e<2||256<e||e&e-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return e}y[v++]=71,y[v++]=73,y[v++]=70,y[v++]=56,y[v++]=57,y[v++]=97;var i=0,o=0;if(null!==w){for(var a=b(w);a>>=1;)++i;if(a=1<<i,--i,void 0!==n.background){if(a<=(o=n.background))throw"Background index out of range.";if(0===o)throw"Background index explicitly passed as 0."}}if(y[v++]=255&t,y[v++]=t>>8&255,y[v++]=255&e,y[v++]=e>>8&255,y[v++]=(null!==w?128:0)|i,y[v++]=o,y[v++]=0,null!==w)for(var s=0,l=w.length;s<l;++s){var h=w[s];y[v++]=h>>16&255,y[v++]=h>>8&255,y[v++]=255&h}if(null!==r){if(r<0||65535<r)throw"Loop count invalid.";y[v++]=33,y[v++]=255,y[v++]=11,y[v++]=78,y[v++]=69,y[v++]=84,y[v++]=83,y[v++]=67,y[v++]=65,y[v++]=80,y[v++]=69,y[v++]=50,y[v++]=46,y[v++]=48,y[v++]=3,y[v++]=1,y[v++]=255&r,y[v++]=r>>8&255,y[v++]=0}var x=!1;this.addFrame=function(t,e,n,r,i,o){if(!0===x&&(--v,x=!1),o=void 0===o?{}:o,t<0||e<0||65535<t||65535<e)throw"x/y invalid.";if(n<=0||r<=0||65535<n||65535<r)throw"Width/Height invalid.";if(i.length<n*r)throw"Not enough pixels for the frame size.";var a=!0,s=o.palette;if(null==s&&(a=!1,s=w),null==s)throw"Must supply either a local or global palette.";for(var l=b(s),h=0;l>>=1;)++h;l=1<<h;var u=void 0===o.delay?0:o.delay,c=void 0===o.disposal?0:o.disposal;if(c<0||3<c)throw"Disposal out of range.";var f=!1,p=0;if(void 0!==o.transparent&&null!==o.transparent&&(f=!0,(p=o.transparent)<0||l<=p))throw"Transparent color index.";if((0!==c||f||0!==u)&&(y[v++]=33,y[v++]=249,y[v++]=4,y[v++]=c<<2|(!0===f?1:0),y[v++]=255&u,y[v++]=u>>8&255,y[v++]=p,y[v++]=0),y[v++]=44,y[v++]=255&t,y[v++]=t>>8&255,y[v++]=255&e,y[v++]=e>>8&255,y[v++]=255&n,y[v++]=n>>8&255,y[v++]=255&r,y[v++]=r>>8&255,y[v++]=!0===a?128|h-1:0,!0===a)for(var d=0,g=s.length;d<g;++d){var m=s[d];y[v++]=m>>16&255,y[v++]=m>>8&255,y[v++]=255&m}v=function(e,n,t,r){e[n++]=t;var i=n++,o=1<<t,a=o-1,s=o+1,l=s+1,h=t+1,u=0,c=0;function f(t){for(;t<=u;)e[n++]=255&c,c>>=8,u-=8,n===i+256&&(e[i]=255,i=n++)}function p(t){c|=t<<u,u+=h,f(8)}var d=r[0]&a,g={};p(o);for(var m=1,y=r.length;m<y;++m){var v=r[m]&a,w=d<<8|v,b=g[w];if(void 0===b){for(c|=d<<u,u+=h;8<=u;)e[n++]=255&c,c>>=8,u-=8,n===i+256&&(e[i]=255,i=n++);4096===l?(p(o),l=s+1,h=t+1,g={}):(1<<h<=l&&++h,g[w]=l++),d=v}else d=b}return p(d),p(s),f(1),i+1===n?e[i]=0:(e[i]=n-i-1,e[n++]=0),n}(y,v,h<2?2:h,i)},this.end=function(){return!1===x&&(y[v++]=59,x=!0),v}},exports.GifReader=At}catch(t){}
/*
    Copyright (c) 2008, Adobe Systems Incorporated
    All rights reserved.

    Redistribution and use in source and binary forms, with or without 
    modification, are permitted provided that the following conditions are
    met:

    * Redistributions of source code must retain the above copyright notice, 
      this list of conditions and the following disclaimer.
    
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the 
      documentation and/or other materials provided with the distribution.
    
    * Neither the name of Adobe Systems Incorporated nor the names of its 
      contributors may be used to endorse or promote products derived from 
      this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName="_encode_";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}function Ft(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}window.tmp=At,lt.API.adler32cs=(dt="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array,gt=null,mt=function(){if(!dt)return function(){return!1};try{var t={};"function"==typeof t.Buffer&&(gt=t.Buffer)}catch(t){}return function(t){return t instanceof ArrayBuffer||null!==gt&&t instanceof gt}}(),yt=null!==gt?function(t){return new gt(t,"utf8").toString("binary")}:function(t){return unescape(encodeURIComponent(t))},vt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+(255&e.charCodeAt(i)))%65521,r=(r+n)%65521;return(r<<16|n)>>>0},wt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+e[i])%65521,r=(r+n)%65521;return(r<<16|n)>>>0},xt=(bt={}).Adler32=(((pt=(ft=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0}).prototype={}).constructor=ft).from=((ht=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=vt(1,t.toString())}).prototype=pt,ht),ft.fromUtf8=((ut=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");var e=yt(t.toString());this.checksum=vt(1,e)}).prototype=pt,ut),dt&&(ft.fromBuffer=((ct=function(t){if(!(this instanceof ft))throw new TypeError("Constructor cannot called be as a function.");if(!mt(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=wt(1,e)}).prototype=pt,ct)),pt.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(),this.checksum=vt(this.checksum,t)},pt.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=yt(t.toString());return this.checksum=vt(this.checksum,e)},dt&&(pt.updateBuffer=function(t){if(!mt(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=wt(this.checksum,e)}),pt.clone=function(){return new xt(this.checksum)},ft),bt.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return vt(1,t.toString())},bt.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=yt(t.toString());return vt(1,e)},dt&&(bt.fromBuffer=function(t){if(!mt(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return wt(1,e)}),bt),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var d,g,c,f,i,o,a,s=e,m=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],y=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},l={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},h=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],u=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),w=!1,b=0;this.__bidiEngine__={};var x=function(t){var e=t.charCodeAt(),n=e>>8,r=l[n];return void 0!==r?s[256*r+(255&e)]:252===n||253===n?"AL":u.test(n)?"L":8===n?"R":"N"},p=function(t){for(var e,n=0;n<t.length;n++){if("L"===(e=x(t.charAt(n))))return!1;if("R"===e)return!0}return!1},N=function(t,e,n,r){var i,o,a,s,l=e[r];switch(l){case"L":case"R":w=!1;break;case"N":case"AN":break;case"EN":w&&(l="AN");break;case"AL":w=!0,l="R";break;case"WS":l="N";break;case"CS":r<1||r+1>=e.length||"EN"!==(i=n[r-1])&&"AN"!==i||"EN"!==(o=e[r+1])&&"AN"!==o?l="N":w&&(o="AN"),l=o===i?o:"N";break;case"ES":l="EN"===(i=0<r?n[r-1]:"B")&&r+1<e.length&&"EN"===e[r+1]?"EN":"N";break;case"ET":if(0<r&&"EN"===n[r-1]){l="EN";break}if(w){l="N";break}for(a=r+1,s=e.length;a<s&&"ET"===e[a];)a++;l=a<s&&"EN"===e[a]?"EN":"N";break;case"NSM":if(c&&!f){for(s=e.length,a=r+1;a<s&&"NSM"===e[a];)a++;if(a<s){var h=t[r],u=1425<=h&&h<=2303||64286===h;if(i=e[a],u&&("R"===i||"AL"===i)){l="R";break}}}l=r<1||"B"===(i=e[r-1])?"N":n[r-1];break;case"B":d=!(w=!1),l=b;break;case"S":g=!0,l="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":w=!1;break;case"BN":l="N"}return l},L=function(t,e,n){var r=t.split("");return n&&A(r,n,{hiLevel:b}),r.reverse(),e&&e.reverse(),r.join("")},A=function(t,e,n){var r,i,o,a,s,l=-1,h=t.length,u=0,c=[],f=b?y:m,p=[];for(g=d=w=!1,i=0;i<h;i++)p[i]=x(t[i]);for(o=0;o<h;o++){if(s=u,c[o]=N(t,p,c,o),r=240&(u=f[s][v[c[o]]]),u&=15,e[o]=a=f[u][5],0<r)if(16===r){for(i=l;i<o;i++)e[i]=1;l=-1}else l=-1;if(f[u][6])-1===l&&(l=o);else if(-1<l){for(i=l;i<o;i++)e[i]=a;l=-1}"B"===p[o]&&(e[o]=0),n.hiLevel|=a}g&&function(t,e,n){for(var r=0;r<n;r++)if("S"===t[r]){e[r]=b;for(var i=r-1;0<=i&&"WS"===t[i];i--)e[i]=b}}(p,e,h)},S=function(t,e,n,r,i){if(!(i.hiLevel<t)){if(1===t&&1===b&&!d)return e.reverse(),void(n&&n.reverse());for(var o,a,s,l,h=e.length,u=0;u<h;){if(r[u]>=t){for(s=u+1;s<h&&r[s]>=t;)s++;for(l=u,a=s-1;l<a;l++,a--)o=e[l],e[l]=e[a],e[a]=o,n&&(o=n[l],n[l]=n[a],n[a]=o);u=s}u++}}},_=function(t,e,n){var r=t.split(""),i={hiLevel:b};return n||(n=[]),A(r,n,i),function(t,e,n){if(0!==n.hiLevel&&a)for(var r,i=0;i<t.length;i++)1===e[i]&&0<=(r=h.indexOf(t[i]))&&(t[i]=h[r+1])}(r,n,i),S(2,r,e,n,i),S(1,r,e,n,i),r.join("")};return this.__bidiEngine__.doBidiReorder=function(t,e,n){if(function(t,e){if(e)for(var n=0;n<t.length;n++)e[n]=n;void 0===f&&(f=p(t)),void 0===o&&(o=p(t))}(t,e),c||!i||o)if(c&&i&&f^o)b=f?1:0,t=L(t,e,n);else if(!c&&i&&o)b=f?1:0,t=_(t,e,n),t=L(t,e);else if(!c||f||i||o){if(c&&!i&&f^o)t=L(t,e),t=f?(b=0,_(t,e,n)):(b=1,t=_(t,e,n),L(t,e));else if(c&&f&&!i&&o)b=1,t=_(t,e,n),t=L(t,e);else if(!c&&!i&&f^o){var r=a;f?(b=1,t=_(t,e,n),b=0,a=!1,t=_(t,e,n),a=r):(b=0,t=_(t,e,n),t=L(t,e),a=!(b=1),t=_(t,e,n),a=r,t=L(t,e))}}else b=0,t=_(t,e,n);else b=f?1:0,t=_(t,e,n);return t},this.__bidiEngine__.setOptions=function(t){t&&(c=t.isInputVisual,i=t.isOutputVisual,f=t.isInputRtl,o=t.isOutputRtl,a=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],o=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(t){var e=t.text,n=(t.x,t.y,t.options||{}),r=(t.mutex,n.lang,[]);if("[object Array]"===Object.prototype.toString.call(e)){var i=0;for(r=[],i=0;i<e.length;i+=1)"[object Array]"===Object.prototype.toString.call(e[i])?r.push([o.doBidiReorder(e[i][0]),e[i][1],e[i][2]]):r.push([o.doBidiReorder(e[i])]);t.text=r}else t.text=o.doBidiReorder(e)}])}(lt),window.tmp=_t,Ft.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:o}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Ft.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(t){console.log("bit decode error:"+t)}},Ft.prototype.bit1=function(){var t=Math.ceil(this.width/8),e=t%4,n=0<=this.height?this.height-1:-this.height;for(n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var l=this.palette[o>>7-s&1];this.data[a+4*s]=l.blue,this.data[a+4*s+1]=l.green,this.data[a+4*s+2]=l.red,this.data[a+4*s+3]=255}0!=e&&(this.pos+=4-e)}},Ft.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,s=o>>4,l=15&o,h=this.palette[s];if(this.data[a]=h.blue,this.data[a+1]=h.green,this.data[a+2]=h.red,this.data[a+3]=255,2*i+1>=this.width)break;h=this.palette[l],this.data[a+4]=h.blue,this.data[a+4+1]=h.green,this.data[a+4+2]=h.red,this.data[a+4+3]=255}0!=e&&(this.pos+=4-e)}},Ft.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;0<=e;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[o]=a.red,this.data[o+1]=a.green,this.data[o+2]=a.blue,this.data[o+3]=255}else this.data[o]=255,this.data[o+1]=255,this.data[o+2]=255,this.data[o+3]=255}0!=t&&(this.pos+=4-t)}},Ft.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&e)/e*255|0,s=(o>>5&e)/e*255|0,l=(o>>10&e)/e*255|0,h=o>>15?255:0,u=r*this.width*4+4*i;this.data[u]=l,this.data[u+1]=s,this.data[u+2]=a,this.data[u+3]=h}this.pos+=t}},Ft.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;0<=r;r--){for(var i=this.bottom_up?r:this.height-1-r,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&e)/e*255|0,l=(a>>5&n)/n*255|0,h=(a>>11)/e*255|0,u=i*this.width*4+4*o;this.data[u]=h,this.data[u+1]=l,this.data[u+2]=s,this.data[u+3]=255}this.pos+=t}},Ft.prototype.bit24=function(){for(var t=this.height-1;0<=t;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=e*this.width*4+4*n;this.data[a]=o,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},Ft.prototype.bit32=function(){for(var t=this.height-1;0<=t;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=o,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=a}},Ft.prototype.getData=function(){return this.data},window.tmp=Ft,
/*
   Copyright (c) 2013 Gildas Lormeau. All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:

   1. Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above copyright 
   notice, this list of conditions and the following disclaimer in 
   the documentation and/or other materials provided with the distribution.

   3. The names of the authors may not be used to endorse or promote products
   derived from this software without specific prior written permission.

   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
   INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
function(t){var d=15,g=573,e=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ct(){var p=this;function l(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}p.build_tree=function(t){var e,n,r,i=p.dyn_tree,o=p.stat_desc.static_tree,a=p.stat_desc.elems,s=-1;for(t.heap_len=0,t.heap_max=g,e=0;e<a;e++)0!==i[2*e]?(t.heap[++t.heap_len]=s=e,t.depth[e]=0):i[2*e+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=s<2?++s:0)]=1,t.depth[r]=0,t.opt_len--,o&&(t.static_len-=o[2*r+1]);for(p.max_code=s,e=Math.floor(t.heap_len/2);1<=e;e--)t.pqdownheap(i,e);for(r=a;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],t.pqdownheap(i,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,i[2*r]=i[2*e]+i[2*n],t.depth[r]=Math.max(t.depth[e],t.depth[n])+1,i[2*e+1]=i[2*n+1]=r,t.heap[1]=r++,t.pqdownheap(i,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t){var e,n,r,i,o,a,s=p.dyn_tree,l=p.stat_desc.static_tree,h=p.stat_desc.extra_bits,u=p.stat_desc.extra_base,c=p.stat_desc.max_length,f=0;for(i=0;i<=d;i++)t.bl_count[i]=0;for(s[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<g;e++)c<(i=s[2*s[2*(n=t.heap[e])+1]+1]+1)&&(i=c,f++),s[2*n+1]=i,n>p.max_code||(t.bl_count[i]++,o=0,u<=n&&(o=h[n-u]),a=s[2*n],t.opt_len+=a*(i+o),l&&(t.static_len+=a*(l[2*n+1]+o)));if(0!==f){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,f-=2}while(0<f);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--e])>p.max_code||(s[2*r+1]!=i&&(t.opt_len+=(i-s[2*r+1])*s[2*r],s[2*r+1]=i),n--)}}(t),function(t,e,n){var r,i,o,a=[],s=0;for(r=1;r<=d;r++)a[r]=s=s+n[r-1]<<1;for(i=0;i<=e;i++)0!==(o=t[2*i+1])&&(t[2*i]=l(a[o]++,o))}(i,p.max_code,t.bl_count)}}function ft(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i}ct._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],ct.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],ct.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],ct.d_code=function(t){return t<256?e[t]:e[256+(t>>>7)]},ct.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ct.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ct.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ct.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ft.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],ft.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],ft.static_l_desc=new ft(ft.static_ltree,ct.extra_lbits,257,286,d),ft.static_d_desc=new ft(ft.static_dtree,ct.extra_dbits,0,30,d),ft.static_bl_desc=new ft(null,ct.extra_blbits,0,19,7);function n(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}var pt=[new n(0,0,0,0,0),new n(4,4,8,4,1),new n(4,5,16,8,1),new n(4,6,32,32,1),new n(4,4,16,16,2),new n(8,16,32,32,2),new n(8,16,128,128,2),new n(8,32,128,256,2),new n(32,128,258,1024,2),new n(32,258,258,4096,2)],dt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""];function gt(t,e,n,r){var i=t[2*e],o=t[2*n];return i<o||i==o&&r[e]<=r[n]}function r(){var l,h,u,c,f,p,d,g,i,m,y,v,w,a,b,x,N,L,A,S,_,F,P,k,I,C,B,j,E,M,s,O,q,T,R,D,U,o,z,H,W,V=this,G=new ct,Y=new ct,J=new ct;function X(){var t;for(t=0;t<286;t++)s[2*t]=0;for(t=0;t<30;t++)O[2*t]=0;for(t=0;t<19;t++)q[2*t]=0;s[512]=1,V.opt_len=V.static_len=0,D=o=0}function K(t,e){var n,r,i=-1,o=t[1],a=0,s=7,l=4;for(0===o&&(s=138,l=3),t[2*(e+1)+1]=65535,n=0;n<=e;n++)r=o,o=t[2*(n+1)+1],++a<s&&r==o||(a<l?q[2*r]+=a:0!==r?(r!=i&&q[2*r]++,q[32]++):a<=10?q[34]++:q[36]++,i=r,l=(a=0)===o?(s=138,3):r==o?(s=6,3):(s=7,4))}function Z(t){V.pending_buf[V.pending++]=t}function Q(t){Z(255&t),Z(t>>>8&255)}function $(t,e){var n,r=e;16-r<W?(Q(H|=(n=t)<<W&65535),H=n>>>16-W,W+=r-16):(H|=t<<W&65535,W+=r)}function tt(t,e){var n=2*t;$(65535&e[n],65535&e[n+1])}function et(t,e){var n,r,i=-1,o=t[1],a=0,s=7,l=4;for(0===o&&(s=138,l=3),n=0;n<=e;n++)if(r=o,o=t[2*(n+1)+1],!(++a<s&&r==o)){if(a<l)for(;tt(r,q),0!=--a;);else 0!==r?(r!=i&&(tt(r,q),a--),tt(16,q),$(a-3,2)):a<=10?(tt(17,q),$(a-3,3)):(tt(18,q),$(a-11,7));i=r,l=(a=0)===o?(s=138,3):r==o?(s=6,3):(s=7,4)}}function nt(){16==W?(Q(H),W=H=0):8<=W&&(Z(255&H),H>>>=8,W-=8)}function rt(t,e){var n,r,i;if(V.pending_buf[U+2*D]=t>>>8&255,V.pending_buf[U+2*D+1]=255&t,V.pending_buf[T+D]=255&e,D++,0===t?s[2*e]++:(o++,t--,s[2*(ct._length_code[e]+256+1)]++,O[2*ct.d_code(t)]++),0==(8191&D)&&2<B){for(n=8*D,r=_-N,i=0;i<30;i++)n+=O[2*i]*(5+ct.extra_dbits[i]);if(n>>>=3,o<Math.floor(D/2)&&n<Math.floor(r/2))return!0}return D==R-1}function it(t,e){var n,r,i,o,a=0;if(0!==D)for(;n=V.pending_buf[U+2*a]<<8&65280|255&V.pending_buf[U+2*a+1],r=255&V.pending_buf[T+a],a++,0===n?tt(r,t):(tt((i=ct._length_code[r])+256+1,t),0!==(o=ct.extra_lbits[i])&&$(r-=ct.base_length[i],o),tt(i=ct.d_code(--n),e),0!==(o=ct.extra_dbits[i])&&$(n-=ct.base_dist[i],o)),a<D;);tt(256,t),z=t[513]}function ot(){8<W?Q(H):0<W&&Z(255&H),W=H=0}function at(t,e,n){var r,i,o;$(0+(n?1:0),3),r=t,i=e,o=!0,ot(),z=8,o&&(Q(i),Q(~i)),V.pending_buf.set(g.subarray(r,r+i),V.pending),V.pending+=i}function e(t,e,n){var r,i,o=0;0<B?(G.build_tree(V),Y.build_tree(V),o=function(){var t;for(K(s,G.max_code),K(O,Y.max_code),J.build_tree(V),t=18;3<=t&&0===q[2*ct.bl_order[t]+1];t--);return V.opt_len+=3*(t+1)+5+5+4,t}(),r=V.opt_len+3+7>>>3,(i=V.static_len+3+7>>>3)<=r&&(r=i)):r=i=e+5,e+4<=r&&-1!=t?at(t,e,n):i==r?($(2+(n?1:0),3),it(ft.static_ltree,ft.static_dtree)):($(4+(n?1:0),3),function(t,e,n){var r;for($(t-257,5),$(e-1,5),$(n-4,4),r=0;r<n;r++)$(q[2*ct.bl_order[r]+1],3);et(s,t-1),et(O,e-1)}(G.max_code+1,Y.max_code+1,o+1),it(s,O)),X(),n&&ot()}function st(t){e(0<=N?N:-1,_-N,t),N=_,l.flush_pending()}function lt(){var t,e,n,r;do{if(0===(r=i-P-_)&&0===_&&0===P)r=f;else if(-1==r)r--;else if(f+f-262<=_){for(g.set(g.subarray(f,f+f),0),F-=f,_-=f,N-=f,n=t=w;e=65535&y[--n],y[n]=f<=e?e-f:0,0!=--t;);for(n=t=f;e=65535&m[--n],m[n]=f<=e?e-f:0,0!=--t;);r+=f}if(0===l.avail_in)return;t=l.read_buf(g,_+P,r),3<=(P+=t)&&(v=((v=255&g[_])<<x^255&g[_+1])&b)}while(P<262&&0!==l.avail_in)}function ht(t){var e,n,r=I,i=_,o=k,a=f-262<_?_-(f-262):0,s=M,l=d,h=_+258,u=g[i+o-1],c=g[i+o];E<=k&&(r>>=2),P<s&&(s=P);do{if(g[(e=t)+o]==c&&g[e+o-1]==u&&g[e]==g[i]&&g[++e]==g[i+1]){i+=2,e++;do{}while(g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&i<h);if(n=258-(h-i),i=h-258,o<n){if(F=t,s<=(o=n))break;u=g[i+o-1],c=g[i+o]}}}while((t=65535&m[t&l])>a&&0!=--r);return o<=P?o:P}function ut(t){return t.total_in=t.total_out=0,t.msg=null,V.pending=0,V.pending_out=0,h=113,c=0,G.dyn_tree=s,G.stat_desc=ft.static_l_desc,Y.dyn_tree=O,Y.stat_desc=ft.static_d_desc,J.dyn_tree=q,J.stat_desc=ft.static_bl_desc,W=H=0,z=8,X(),function(){var t;for(i=2*f,t=y[w-1]=0;t<w-1;t++)y[t]=0;C=pt[B].max_lazy,E=pt[B].good_length,M=pt[B].nice_length,I=pt[B].max_chain,L=k=2,v=S=P=N=_=0}(),0}V.depth=[],V.bl_count=[],V.heap=[],s=[],O=[],q=[],V.pqdownheap=function(t,e){for(var n=V.heap,r=n[e],i=e<<1;i<=V.heap_len&&(i<V.heap_len&&gt(t,n[i+1],n[i],V.depth)&&i++,!gt(t,r,n[i],V.depth));)n[e]=n[i],e=i,i<<=1;n[e]=r},V.deflateInit=function(t,e,n,r,i,o){return r||(r=8),i||(i=8),o||(o=0),t.msg=null,-1==e&&(e=6),i<1||9<i||8!=r||n<9||15<n||e<0||9<e||o<0||2<o?-2:(t.dstate=V,d=(f=1<<(p=n))-1,b=(w=1<<(a=i+7))-1,x=Math.floor((a+3-1)/3),g=new Uint8Array(2*f),m=[],y=[],R=1<<i+6,V.pending_buf=new Uint8Array(4*R),u=4*R,U=Math.floor(R/2),T=3*R,B=e,j=o,ut(t))},V.deflateEnd=function(){return 42!=h&&113!=h&&666!=h?-2:(V.pending_buf=null,g=m=y=null,V.dstate=null,113==h?-3:0)},V.deflateParams=function(t,e,n){var r=0;return-1==e&&(e=6),e<0||9<e||n<0||2<n?-2:(pt[B].func!=pt[e].func&&0!==t.total_in&&(r=t.deflate(1)),B!=e&&(C=pt[B=e].max_lazy,E=pt[B].good_length,M=pt[B].nice_length,I=pt[B].max_chain),j=n,r)},V.deflateSetDictionary=function(t,e,n){var r,i=n,o=0;if(!e||42!=h)return-2;if(i<3)return 0;for(f-262<i&&(o=n-(i=f-262)),g.set(e.subarray(o,o+i),0),N=_=i,v=((v=255&g[0])<<x^255&g[1])&b,r=0;r<=i-3;r++)v=(v<<x^255&g[r+2])&b,m[r&d]=y[v],y[v]=r;return 0},V.deflate=function(t,e){var n,r,i,o,a,s;if(4<e||e<0)return-2;if(!t.next_out||!t.next_in&&0!==t.avail_in||666==h&&4!=e)return t.msg=dt[4],-2;if(0===t.avail_out)return t.msg=dt[7],-5;if(l=t,o=c,c=e,42==h&&(r=8+(p-8<<4)<<8,3<(i=(B-1&255)>>1)&&(i=3),r|=i<<6,0!==_&&(r|=32),h=113,Z((s=r+=31-r%31)>>8&255),Z(255&s)),0!==V.pending){if(l.flush_pending(),0===l.avail_out)return c=-1,0}else if(0===l.avail_in&&e<=o&&4!=e)return l.msg=dt[7],-5;if(666==h&&0!==l.avail_in)return t.msg=dt[7],-5;if(0!==l.avail_in||0!==P||0!=e&&666!=h){switch(a=-1,pt[B].func){case 0:a=function(t){var e,n=65535;for(u-5<n&&(n=u-5);;){if(P<=1){if(lt(),0===P&&0==t)return 0;if(0===P)break}if(_+=P,e=N+n,((P=0)===_||e<=_)&&(P=_-e,_=e,st(!1),0===l.avail_out))return 0;if(f-262<=_-N&&(st(!1),0===l.avail_out))return 0}return st(4==t),0===l.avail_out?4==t?2:0:4==t?3:1}(e);break;case 1:a=function(t){for(var e,n=0;;){if(P<262){if(lt(),P<262&&0==t)return 0;if(0===P)break}if(3<=P&&(v=(v<<x^255&g[_+2])&b,n=65535&y[v],m[_&d]=y[v],y[v]=_),0!==n&&(_-n&65535)<=f-262&&2!=j&&(L=ht(n)),3<=L)if(e=rt(_-F,L-3),P-=L,L<=C&&3<=P){for(L--;v=(v<<x^255&g[++_+2])&b,n=65535&y[v],m[_&d]=y[v],y[v]=_,0!=--L;);_++}else _+=L,L=0,v=((v=255&g[_])<<x^255&g[_+1])&b;else e=rt(0,255&g[_]),P--,_++;if(e&&(st(!1),0===l.avail_out))return 0}return st(4==t),0===l.avail_out?4==t?2:0:4==t?3:1}(e);break;case 2:a=function(t){for(var e,n,r=0;;){if(P<262){if(lt(),P<262&&0==t)return 0;if(0===P)break}if(3<=P&&(v=(v<<x^255&g[_+2])&b,r=65535&y[v],m[_&d]=y[v],y[v]=_),k=L,A=F,L=2,0!==r&&k<C&&(_-r&65535)<=f-262&&(2!=j&&(L=ht(r)),L<=5&&(1==j||3==L&&4096<_-F)&&(L=2)),3<=k&&L<=k){for(n=_+P-3,e=rt(_-1-A,k-3),P-=k-1,k-=2;++_<=n&&(v=(v<<x^255&g[_+2])&b,r=65535&y[v],m[_&d]=y[v],y[v]=_),0!=--k;);if(S=0,L=2,_++,e&&(st(!1),0===l.avail_out))return 0}else if(0!==S){if((e=rt(0,255&g[_-1]))&&st(!1),_++,P--,0===l.avail_out)return 0}else S=1,_++,P--}return 0!==S&&(e=rt(0,255&g[_-1]),S=0),st(4==t),0===l.avail_out?4==t?2:0:4==t?3:1}(e)}if(2!=a&&3!=a||(h=666),0==a||2==a)return 0===l.avail_out&&(c=-1),0;if(1==a){if(1==e)$(2,3),tt(256,ft.static_ltree),nt(),1+z+10-W<9&&($(2,3),tt(256,ft.static_ltree),nt()),z=7;else if(at(0,0,!1),3==e)for(n=0;n<w;n++)y[n]=0;if(l.flush_pending(),0===l.avail_out)return c=-1,0}}return 4!=e?0:1}}function i(){this.next_in_index=0,this.next_out_index=0,this.avail_in=0,this.total_in=0,this.avail_out=0,this.total_out=0}i.prototype={deflateInit:function(t,e){return this.dstate=new r,e||(e=d),this.dstate.deflateInit(this,t,e)},deflate:function(t){return this.dstate?this.dstate.deflate(this,t):-2},deflateEnd:function(){if(!this.dstate)return-2;var t=this.dstate.deflateEnd();return this.dstate=null,t},deflateParams:function(t,e){return this.dstate?this.dstate.deflateParams(this,t,e):-2},deflateSetDictionary:function(t,e){return this.dstate?this.dstate.deflateSetDictionary(this,t,e):-2},read_buf:function(t,e,n){var r=this.avail_in;return n<r&&(r=n),0===r?0:(this.avail_in-=r,t.set(this.next_in.subarray(this.next_in_index,this.next_in_index+r),e),this.next_in_index+=r,this.total_in+=r,r)},flush_pending:function(){var t=this,e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out),0!==e&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,0===t.dstate.pending&&(t.dstate.pending_out=0))}};var o=t.zip||t;o.Deflater=o._jzlib_Deflater=function(t){var s=new i,l=new Uint8Array(512),e=t?t.level:-1;void 0===e&&(e=-1),s.deflateInit(e),s.next_out=l,this.append=function(t,e){var n,r=[],i=0,o=0,a=0;if(t.length){s.next_in_index=0,s.next_in=t,s.avail_in=t.length;do{if(s.next_out_index=0,s.avail_out=512,0!=s.deflate(0))throw new Error("deflating: "+s.msg);s.next_out_index&&(512==s.next_out_index?r.push(new Uint8Array(l)):r.push(new Uint8Array(l.subarray(0,s.next_out_index)))),a+=s.next_out_index,e&&0<s.next_in_index&&s.next_in_index!=i&&(e(s.next_in_index),i=s.next_in_index)}while(0<s.avail_in||0===s.avail_out);return n=new Uint8Array(a),r.forEach(function(t){n.set(t,o),o+=t.length}),n}},this.flush=function(){var t,e,n=[],r=0,i=0;do{if(s.next_out_index=0,s.avail_out=512,1!=(t=s.deflate(4))&&0!=t)throw new Error("deflating: "+s.msg);0<512-s.avail_out&&n.push(new Uint8Array(l.subarray(0,s.next_out_index))),i+=s.next_out_index}while(0<s.avail_in||0===s.avail_out);return s.deflateEnd(),e=new Uint8Array(i),n.forEach(function(t){e.set(t,r),r+=t.length}),e}}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()),("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()).RGBColor=function(t){var e;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var r in n)t==r&&(t=n[r]);for(var i=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],o=0;o<i.length;o++){var a=i[o].re,s=i[o].process,l=a.exec(t);l&&(e=s(l),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r,this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g,this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n}},function(t){var n="+".charCodeAt(0),r="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),a="A".charCodeAt(0),s="-".charCodeAt(0),l="_".charCodeAt(0),u=function(t){var e=t.charCodeAt(0);return e===n||e===s?62:e===r||e===l?63:e<i?-1:e<i+10?e-i+26+26:e<a+26?e-a:e<o+26?e-o+26:void 0};t.API.TTFFont=function(){function i(t,e,n){var r;if(this.rawData=t,r=this.contents=new J(t),this.contents.pos=4,"ttcf"===r.readString(4)){if(!e)throw new Error("Must specify a font name for TTC files.");throw new Error("Font "+e+" not found in TTC file.")}r.pos=0,this.parse(),this.subset=new P(this),this.registerTTF()}return i.open=function(t,e,n,r){if("string"!=typeof n)throw new Error("Invalid argument supplied in TTFFont.open");return new i(function(t){var e,n,r,i,o,a;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var s=t.length;o="="===t.charAt(s-2)?2:"="===t.charAt(s-1)?1:0,a=new Uint8Array(3*t.length/4-o),r=0<o?t.length-4:t.length;var l=0;function h(t){a[l++]=t}for(n=e=0;e<r;e+=4,n+=3)h((16711680&(i=u(t.charAt(e))<<18|u(t.charAt(e+1))<<12|u(t.charAt(e+2))<<6|u(t.charAt(e+3))))>>16),h((65280&i)>>8),h(255&i);return 2===o?h(255&(i=u(t.charAt(e))<<2|u(t.charAt(e+1))>>4)):1===o&&(h((i=u(t.charAt(e))<<10|u(t.charAt(e+1))<<4|u(t.charAt(e+2))>>2)>>8&255),h(255&i)),a}(n),e,r)},i.prototype.parse=function(){return this.directory=new e(this.contents),this.head=new p(this),this.name=new b(this),this.cmap=new y(this),this.toUnicode=new Map,this.hhea=new g(this),this.maxp=new x(this),this.hmtx=new N(this),this.post=new v(this),this.os2=new m(this),this.loca=new F(this),this.glyf=new A(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},i.prototype.registerTTF=function(){var i,t,e,n,r;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.bbox).length;t<e;t++)i=n[t],r.push(Math.round(i*this.scaleFactor));return r}.call(this),this.stemV=0,this.post.exists?(e=255&(n=this.post.italic_angle),!0&(t=n>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+e)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},i.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},i.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},i.prototype.widthOfString=function(t,e,n){var r,i,o,a,s;for(i=a=o=0,s=(t=""+t).length;0<=s?a<s:s<a;i=0<=s?++a:--a)r=t.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(r))+n*(1e3/e)||0;return o*(e/1e3)},i.prototype.lineHeight=function(t,e){var n;return null==e&&(e=!1),n=e?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},i}();var h,J=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return 2147483648<=(t=this.readUInt32())?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return 32768<=(t=this.readUInt16())?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n,r;for(n=[],e=r=0;0<=t?r<t:t<r;e=0<=t?++r:--r)n[e]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(t){var e,n,r,i;for(i=[],e=n=0,r=t.length;0<=r?n<r:r<n;e=0<=r?++n:--n)i.push(this.writeByte(t.charCodeAt(e)));return i},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,e,n,r,i,o,a,s;return t=this.readByte(),e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),o=this.readByte(),a=this.readByte(),s=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^e)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^o)+256*(255^a)+(255^s)+1):72057594037927940*t+281474976710656*e+1099511627776*n+4294967296*r+16777216*i+65536*o+256*a+s},t.prototype.writeLongLong=function(t){var e,n;return e=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,n;for(e=[],n=0;0<=t?n<t:t<n;0<=t?++n:--n)e.push(this.readByte());return e},t.prototype.write=function(t){var e,n,r,i;for(i=[],n=0,r=t.length;n<r;n++)e=t[n],i.push(this.writeByte(e));return i},t}(),e=function(){var d;function t(t){var e,n,r;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},n=0,r=this.tableCount;0<=r?n<r:r<n;0<=r?++n:--n)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[e.tag]=e}return t.prototype.encode=function(t){var e,n,r,i,o,a,s,l,h,u,c,f,p;for(p in c=Object.keys(t).length,a=Math.log(2),h=16*Math.floor(Math.log(c)/a),i=Math.floor(h/a),l=16*c-h,(n=new J).writeInt(this.scalarType),n.writeShort(c),n.writeShort(h),n.writeShort(i),n.writeShort(l),r=16*c,s=n.pos+r,o=null,f=[],t)for(u=t[p],n.writeString(p),n.writeInt(d(u)),n.writeInt(s),n.writeInt(u.length),f=f.concat(u),"head"===p&&(o=s),s+=u.length;s%4;)f.push(0),s++;return n.write(f),e=2981146554-d(n.data),n.pos=o+8,n.writeUInt32(e),n.data},d=function(t){var e,n,r,i;for(t=L.call(t);t.length%4;)t.push(0);for(n=new J(t),r=e=0,i=t.length;r<i;r+=4)e+=n.readUInt32();return 4294967295&e},t}(),c={}.hasOwnProperty,f=function(t,e){for(var n in e)c.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};h=function(){function t(t){var e;this.file=t,e=this.file.directory.tables[this.tag],this.exists=!!e,e&&(this.offset=e.offset,this.length=e.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var e;return(e=new J).writeInt(this.version),e.writeInt(this.revision),e.writeInt(this.checkSumAdjustment),e.writeInt(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.writeLongLong(this.created),e.writeLongLong(this.modified),e.writeShort(this.xMin),e.writeShort(this.yMin),e.writeShort(this.xMax),e.writeShort(this.yMax),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort(this.fontDirectionHint),e.writeShort(t),e.writeShort(this.glyphDataFormat),e.data},e}(),d=function(){function t(n,t){var e,r,i,o,a,s,l,h,u,c,f,p,d,g,m,y,v,w;switch(this.platformID=n.readUInt16(),this.encodingID=n.readShort(),this.offset=t+n.readInt(),u=n.pos,n.pos=this.offset,this.format=n.readUInt16(),this.length=n.readUInt16(),this.language=n.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(s=m=0;m<256;s=++m)this.codeMap[s]=n.readByte();break;case 4:for(f=n.readUInt16(),c=f/2,n.pos+=6,i=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),n.pos+=2,d=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),l=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),h=function(){var t,e;for(e=[],s=t=0;0<=c?t<c:c<t;s=0<=c?++t:--t)e.push(n.readUInt16());return e}(),r=(this.length-n.pos+this.offset)/2,a=function(){var t,e;for(e=[],s=t=0;0<=r?t<r:r<t;s=0<=r?++t:--t)e.push(n.readUInt16());return e}(),s=y=0,w=i.length;y<w;s=++y)for(g=i[s],e=v=p=d[s];p<=g?v<=g:g<=v;e=p<=g?++v:--v)0===h[s]?o=e+l[s]:0!==(o=a[h[s]/2+(e-p)-(c-s)]||0)&&(o+=l[s]),this.codeMap[e]=65535&o}n.pos=u}return t.encode=function(t,e){var n,r,i,o,a,s,l,h,u,c,f,p,d,g,m,y,v,w,b,x,N,L,A,S,_,F,P,k,I,C,B,j,E,M,O,q,T,R,D,U,z,H,W,V,G,Y;switch(k=new J,o=Object.keys(t).sort(function(t,e){return t-e}),e){case"macroman":for(d=0,g=function(){var t,e;for(e=[],p=t=0;t<256;p=++t)e.push(0);return e}(),y={0:0},i={},I=0,E=o.length;I<E;I++)null==y[W=t[r=o[I]]]&&(y[W]=++d),i[r]={old:t[r],new:y[t[r]]},g[r]=y[t[r]];return k.writeUInt16(1),k.writeUInt16(0),k.writeUInt32(12),k.writeUInt16(0),k.writeUInt16(262),k.writeUInt16(0),k.write(g),{charMap:i,subtable:k.data,maxGlyphID:d+1};case"unicode":for(F=[],u=[],y={},n={},m=l=null,C=v=0,M=o.length;C<M;C++)null==y[b=t[r=o[C]]]&&(y[b]=++v),n[r]={old:b,new:y[b]},a=y[b]-r,null!=m&&a===l||(m&&u.push(m),F.push(r),l=a),m=r;for(m&&u.push(m),u.push(65535),F.push(65535),S=2*(A=F.length),L=2*Math.pow(Math.log(A)/Math.LN2,2),c=Math.log(L/2)/Math.LN2,N=2*A-L,s=[],x=[],f=[],p=B=0,O=F.length;B<O;p=++B){if(_=F[p],h=u[p],65535===_){s.push(0),x.push(0);break}if(32768<=_-(P=n[_].new))for(s.push(0),x.push(2*(f.length+A-p)),r=j=_;_<=h?j<=h:h<=j;r=_<=h?++j:--j)f.push(n[r].new);else s.push(P-_),x.push(0)}for(k.writeUInt16(3),k.writeUInt16(1),k.writeUInt32(12),k.writeUInt16(4),k.writeUInt16(16+8*A+2*f.length),k.writeUInt16(0),k.writeUInt16(S),k.writeUInt16(L),k.writeUInt16(c),k.writeUInt16(N),z=0,q=u.length;z<q;z++)r=u[z],k.writeUInt16(r);for(k.writeUInt16(0),H=0,T=F.length;H<T;H++)r=F[H],k.writeUInt16(r);for(V=0,R=s.length;V<R;V++)a=s[V],k.writeUInt16(a);for(G=0,D=x.length;G<D;G++)w=x[G],k.writeUInt16(w);for(Y=0,U=f.length;Y<U;Y++)d=f[Y],k.writeUInt16(d);return{charMap:n,subtable:k.data,maxGlyphID:v+1}}},t}(),y=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="cmap",e.prototype.parse=function(t){var e,n,r;for(t.pos=this.offset,this.version=t.readUInt16(),n=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=n?r<n:n<r;0<=n?++r:--r)e=new d(t,this.offset),this.tables.push(e),e.isUnicode&&null==this.unicode&&(this.unicode=e);return!0},e.encode=function(t,e){var n,r;return null==e&&(e="macroman"),n=d.encode(t,e),(r=new J).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},e}(),g=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(),m=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="OS/2",e.prototype.parse=function(n){if(n.pos=this.offset,this.version=n.readUInt16(),this.averageCharWidth=n.readShort(),this.weightClass=n.readUInt16(),this.widthClass=n.readUInt16(),this.type=n.readShort(),this.ySubscriptXSize=n.readShort(),this.ySubscriptYSize=n.readShort(),this.ySubscriptXOffset=n.readShort(),this.ySubscriptYOffset=n.readShort(),this.ySuperscriptXSize=n.readShort(),this.ySuperscriptYSize=n.readShort(),this.ySuperscriptXOffset=n.readShort(),this.ySuperscriptYOffset=n.readShort(),this.yStrikeoutSize=n.readShort(),this.yStrikeoutPosition=n.readShort(),this.familyClass=n.readShort(),this.panose=function(){var t,e;for(e=[],t=0;t<10;++t)e.push(n.readByte());return e}(),this.charRange=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(n.readInt());return e}(),this.vendorID=n.readString(4),this.selection=n.readShort(),this.firstCharIndex=n.readShort(),this.lastCharIndex=n.readShort(),0<this.version&&(this.ascent=n.readShort(),this.descent=n.readShort(),this.lineGap=n.readShort(),this.winAscent=n.readShort(),this.winDescent=n.readShort(),this.codePageRange=function(){var t,e;for(e=[],t=0;t<2;++t)e.push(n.readInt());return e}(),1<this.version))return this.xHeight=n.readShort(),this.capHeight=n.readShort(),this.defaultChar=n.readShort(),this.breakChar=n.readShort(),this.maxContext=n.readShort()},e}(),v=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="post",e.prototype.parse=function(r){var t,e,n,i;switch(r.pos=this.offset,this.format=r.readInt(),this.italicAngle=r.readInt(),this.underlinePosition=r.readShort(),this.underlineThickness=r.readShort(),this.isFixedPitch=r.readInt(),this.minMemType42=r.readInt(),this.maxMemType42=r.readInt(),this.minMemType1=r.readInt(),this.maxMemType1=r.readInt(),this.format){case 65536:break;case 131072:for(e=r.readUInt16(),this.glyphNameIndex=[],n=0;0<=e?n<e:e<n;0<=e?++n:--n)this.glyphNameIndex.push(r.readUInt16());for(this.names=[],i=[];r.pos<this.offset+this.length;)t=r.readByte(),i.push(this.names.push(r.readString(t)));return i;case 151552:return e=r.readUInt16(),this.offsets=r.read(e);case 196608:break;case 262144:return this.map=function(){var t,e,n;for(n=[],t=0,e=this.file.maxp.numGlyphs;0<=e?t<e:e<t;0<=e?++t:--t)n.push(r.readUInt32());return n}.call(this)}},e}(),w=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},b=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="name",e.prototype.parse=function(t){var e,n,r,i,o,a,s,l,h,u,c,f;for(t.pos=this.offset,t.readShort(),e=t.readShort(),a=t.readShort(),n=[],i=h=0;0<=e?h<e:e<h;i=0<=e?++h:--h)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+a+t.readShort()});for(s={},i=u=0,c=n.length;u<c;i=++u)r=n[i],t.pos=r.offset,l=t.readString(r.length),o=new w(l,r),null==s[f=r.nameID]&&(s[f]=[]),s[r.nameID].push(o);this.strings=s,this.copyright=s[0],this.fontFamily=s[1],this.fontSubfamily=s[2],this.uniqueSubfamily=s[3],this.fontName=s[4],this.version=s[5];try{this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(t){this.postscriptName=s[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=s[7],this.manufacturer=s[8],this.designer=s[9],this.description=s[10],this.vendorUrl=s[11],this.designerUrl=s[12],this.license=s[13],this.licenseUrl=s[14],this.preferredFamily=s[15],this.preferredSubfamily=s[17],this.compatibleFull=s[18],this.sampleText=s[19]},e}(),x=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e}(),N=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="hmtx",e.prototype.parse=function(n){var t,r,i,e,o,a,s;for(n.pos=this.offset,this.metrics=[],e=0,a=this.file.hhea.numberOfMetrics;0<=a?e<a:a<e;0<=a?++e:--e)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var t,e;for(e=[],t=0;0<=r?t<r:r<t;0<=r?++t:--t)e.push(n.readInt16());return e}(),this.widths=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.metrics).length;t<e;t++)i=n[t],r.push(i.advance);return r}.call(this),t=this.widths[this.widths.length-1],s=[],o=0;0<=r?o<r:r<o;0<=r?++o:--o)s.push(this.widths.push(t));return s},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(),L=[].slice,A=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="glyf",e.prototype.parse=function(t){return this.cache={}},e.prototype.glyphFor=function(t){var e,n,r,i,o,a,s,l,h,u;return(t=t)in this.cache?this.cache[t]:(i=this.file.loca,e=this.file.contents,n=i.indexOf(t),0===(r=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+n,o=(a=new J(e.read(r))).readShort(),l=a.readShort(),u=a.readShort(),s=a.readShort(),h=a.readShort(),this.cache[t]=-1===o?new _(a,l,u,s,h):new S(a,o,l,u,s,h),this.cache[t]))},e.prototype.encode=function(t,e,n){var r,i,o,a,s;for(o=[],i=[],a=0,s=e.length;a<s;a++)r=t[e[a]],i.push(o.length),r&&(o=o.concat(r.encode(n)));return i.push(o.length),{table:o,offsets:i}},e}(),S=function(){function t(t,e,n,r,i,o){this.raw=t,this.numberOfContours=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),_=function(){function t(t,e,n,r,i){var o,a;for(this.raw=t,this.xMin=e,this.yMin=n,this.xMax=r,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;a=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readShort()),32&a;)o.pos+=1&a?4:2,128&a?o.pos+=8:64&a?o.pos+=4:8&a&&(o.pos+=2)}return 1,8,32,64,128,t.prototype.encode=function(t){var e,n,r,i,o;for(n=new J(L.call(this.raw.data)),e=r=0,i=(o=this.glyphIDs).length;r<i;e=++r)o[e],n.pos=this.glyphOffsets[e];return n.data},t}(),F=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,h),e.prototype.tag="loca",e.prototype.parse=function(r){var t;return r.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,e,n;for(n=[],t=0,e=this.length;t<e;t+=2)n.push(2*r.readUInt16());return n}.call(this):function(){var t,e,n;for(n=[],t=0,e=this.length;t<e;t+=4)n.push(r.readUInt32());return n}.call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,e){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,o=0;o<n.length;++o)if(n[o]=r,i<e.length&&e[i]==o){++i,n[o]=r;var a=this.offsets[o],s=this.offsets[o+1]-a;0<s&&(r+=s)}for(var l=new Array(4*n.length),h=0;h<n.length;++h)l[4*h+3]=255&n[h],l[4*h+2]=(65280&n[h])>>8,l[4*h+1]=(16711680&n[h])>>16,l[4*h]=(4278190080&n[h])>>24;return l},e}(),P=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap,t={},i=this.subset)n=i[e],t[e]=r[n];return t},t.prototype.glyphsFor=function(t){var e,n,r,i,o,a,s;for(r={},o=0,a=t.length;o<a;o++)r[i=t[o]]=this.font.glyf.glyphFor(i);for(i in e=[],r)(null!=(n=r[i])?n.compound:void 0)&&e.push.apply(e,n.glyphIDs);if(0<e.length)for(i in s=this.glyphsFor(e))n=s[i],r[i]=n;return r},t.prototype.encode=function(t,e){var n,r,i,o,a,s,l,h,u,c,f,p,d,g,m;for(r in n=y.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(t),f={0:0},m=n.charMap)f[(s=m[r]).old]=s.new;for(p in c=n.maxGlyphID,o)p in f||(f[p]=c++);return h=function(t){var e,n;for(e in n={},t)n[t[e]]=e;return n}(f),u=Object.keys(h).sort(function(t,e){return t-e}),d=function(){var t,e,n;for(n=[],t=0,e=u.length;t<e;t++)a=u[t],n.push(h[a]);return n}(),i=this.font.glyf.encode(o,d,f),l=this.font.loca.encode(i.offsets,d),g={cmap:this.font.cmap.raw(),glyf:i.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(e)},this.font.os2.exists&&(g["OS/2"]=this.font.os2.raw()),this.font.directory.encode(g)},t}();t.API.PDFObject=function(){var o;function a(){}return o=function(t,e){return(Array(e+1).join("0")+t).slice(-e)},a.convert=function(r){var i,t,e,n;if(Array.isArray(r))return"["+function(){var t,e,n;for(n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(a.convert(i));return n}().join(" ")+"]";if("string"==typeof r)return"/"+r;if(null!=r?r.isString:void 0)return"("+r+")";if(r instanceof Date)return"(D:"+o(r.getUTCFullYear(),4)+o(r.getUTCMonth(),2)+o(r.getUTCDate(),2)+o(r.getUTCHours(),2)+o(r.getUTCMinutes(),2)+o(r.getUTCSeconds(),2)+"Z)";if("[object Object]"!=={}.toString.call(r))return""+r;for(t in e=["<<"],r)n=r[t],e.push("/"+t+" "+a.convert(n));return e.push(">>"),e.join("\n")},a}()}(lt),
/*
  # PNG.js
  # Copyright (c) 2011 Devon Govett
  # MIT LICENSE
  # 
  # 
  */
Nt="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")(),Lt=function(){var h,n,r;function i(t){var e,n,r,i,o,a,s,l,h,u,c,f,p,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},a=null;;){switch(e=this.readUInt32(),h=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":a&&this.animation.frames.push(a),this.pos+=4,a={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},o=this.readUInt16(),i=this.readUInt16()||100,a.delay=1e3*o/i,a.disposeOp=this.data[this.pos++],a.blendOp=this.data[this.pos++],a.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,e-=4),t=(null!=a?a.data:void 0)||this.imgData,f=0;0<=e?f<e:e<f;0<=e?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(r=this.palette.length/3,this.transparency.indexed=this.read(e),this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if(0<(u=r-this.transparency.indexed.length))for(p=0;0<=u?p<u:u<p;0<=u?++p:--p)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":s=(c=this.read(e)).indexOf(0),l=String.fromCharCode.apply(String,c.slice(0,s)),this.text[l]=String.fromCharCode.apply(String,c.slice(s+1));break;case"IEND":return a&&this.animation.frames.push(a),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.load=function(t,e,n){var r;return"function"==typeof e&&(n=e),(r=new XMLHttpRequest).open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){var t;return t=new i(new Uint8Array(r.response||r.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof n?n(t):void 0},r.send(null)},i.prototype.read=function(t){var e,n;for(n=[],e=0;0<=t?e<t:t<e;0<=t?++e:--e)n.push(this.data[this.pos++]);return n},i.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.decodePixels=function(C){var B=this.pixelBitlength/8,j=new Uint8Array(this.width*this.height*B),E=0,M=this;if(null==C&&(C=this.imgData),0===C.length)return new Uint8Array(0);function t(t,e,n,r){var i,o,a,s,l,h,u,c,f,p,d,g,m,y,v,w,b,x,N,L,A,S=Math.ceil((M.width-t)/n),_=Math.ceil((M.height-e)/r),F=M.width==S&&M.height==_;for(y=B*S,g=F?j:new Uint8Array(y*_),h=C.length,o=m=0;m<_&&E<h;){switch(C[E++]){case 0:for(s=b=0;b<y;s=b+=1)g[o++]=C[E++];break;case 1:for(s=x=0;x<y;s=x+=1)i=C[E++],l=s<B?0:g[o-B],g[o++]=(i+l)%256;break;case 2:for(s=N=0;N<y;s=N+=1)i=C[E++],a=(s-s%B)/B,v=m&&g[(m-1)*y+a*B+s%B],g[o++]=(v+i)%256;break;case 3:for(s=L=0;L<y;s=L+=1)i=C[E++],a=(s-s%B)/B,l=s<B?0:g[o-B],v=m&&g[(m-1)*y+a*B+s%B],g[o++]=(i+Math.floor((l+v)/2))%256;break;case 4:for(s=A=0;A<y;s=A+=1)i=C[E++],a=(s-s%B)/B,l=s<B?0:g[o-B],0===m?v=w=0:(v=g[(m-1)*y+a*B+s%B],w=a&&g[(m-1)*y+(a-1)*B+s%B]),u=l+v-w,c=Math.abs(u-l),p=Math.abs(u-v),d=Math.abs(u-w),f=c<=p&&c<=d?l:p<=d?v:w,g[o++]=(i+f)%256;break;default:throw new Error("Invalid filter algorithm: "+C[E-1])}if(!F){var P=((e+m*r)*M.width+t)*B,k=m*y;for(s=0;s<S;s+=1){for(var I=0;I<B;I+=1)j[P++]=g[k++];P+=(n-1)*B}}m++}}return C=(C=new kt(C)).getBytes(),1==M.interlaceMethod?(t(0,0,8,8),t(4,0,8,8),t(0,4,4,8),t(2,0,4,4),t(0,2,2,4),t(1,0,2,2),t(0,1,1,2)):t(0,0,1,1),j},i.prototype.decodePalette=function(){var t,e,n,r,i,o,a,s,l;for(n=this.palette,o=this.transparency.indexed||[],i=new Uint8Array((o.length||0)+n.length),r=0,n.length,e=a=t=0,s=n.length;a<s;e=a+=3)i[r++]=n[e],i[r++]=n[e+1],i[r++]=n[e+2],i[r++]=null!=(l=o[t++])?l:255;return i},i.prototype.copyToImageData=function(t,e){var n,r,i,o,a,s,l,h,u,c,f;if(r=this.colors,u=null,n=this.hasAlphaChannel,this.palette.length&&(u=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(),r=4,n=!0),h=(i=t.data||t).length,a=u||e,o=s=0,1===r)for(;o<h;)l=u?4*e[o/4]:s,c=a[l++],i[o++]=c,i[o++]=c,i[o++]=c,i[o++]=n?a[l++]:255,s=l;else for(;o<h;)l=u?4*e[o/4]:s,i[o++]=a[l++],i[o++]=a[l++],i[o++]=a[l++],i[o++]=n?a[l++]:255,s=l},i.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};try{n=Nt.document.createElement("canvas"),r=n.getContext("2d")}catch(t){return-1}return h=function(t){var e;return r.width=t.width,r.height=t.height,r.clearRect(0,0,t.width,t.height),r.putImageData(t,0,0),(e=new Image).src=n.toDataURL(),e},i.prototype.decodeFrames=function(t){var e,n,r,i,o,a,s,l;if(this.animation){for(l=[],n=o=0,a=(s=this.animation.frames).length;o<a;n=++o)e=s[n],r=t.createImageData(e.width,e.height),i=this.decodePixels(new Uint8Array(e.data)),this.copyToImageData(r,i),e.imageData=r,l.push(e.image=h(r));return l}},i.prototype.renderFrame=function(t,e){var n,r,i;return n=(r=this.animation.frames)[e],i=r[e-1],0===e&&t.clearRect(0,0,this.width,this.height),1===(null!=i?i.disposeOp:void 0)?t.clearRect(i.xOffset,i.yOffset,i.width,i.height):2===(null!=i?i.disposeOp:void 0)&&t.putImageData(i.imageData,i.xOffset,i.yOffset),0===n.blendOp&&t.clearRect(n.xOffset,n.yOffset,n.width,n.height),t.drawImage(n.image,n.xOffset,n.yOffset)},i.prototype.animate=function(n){var r,i,o,a,s,t,l=this;return i=0,t=this.animation,a=t.numFrames,o=t.frames,s=t.numPlays,(r=function(){var t,e;if(t=i++%a,e=o[t],l.renderFrame(n,t),1<a&&i/a<s)return l.animation._timeout=setTimeout(r,e.delay)})()},i.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},i.prototype.render=function(t){var e,n;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,e=t.getContext("2d"),this.animation?(this.decodeFrames(e),this.animate(e)):(n=e.createImageData(this.width,this.height),this.copyToImageData(n,this.decodePixels()),e.putImageData(n,0,0))},i}(),Nt.PNG=Lt;
/*
   * Extracted from pdf.js
   * https://github.com/andreasgal/pdf.js
   *
   * Copyright (c) 2011 Mozilla Foundation
   *
   * Contributors: Andreas Gal <gal@mozilla.com>
   *               Chris G Jones <cjones@mozilla.com>
   *               Shaon Barman <shaon.barman@gmail.com>
   *               Vivien Nicolas <21@vingtetun.org>
   *               Justin D'Arcangelo <justindarc@gmail.com>
   *               Yury Delendik
   *
   * 
   */
var Pt=function(){function t(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return t.prototype={ensureBuffer:function(t){var e=this.buffer,n=e?e.byteLength:0;if(t<n)return e;for(var r=512;r<t;)r<<=1;for(var i=new Uint8Array(r),o=0;o<n;++o)i[o]=e[o];return this.buffer=i},getByte:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(t){var e=this.pos;if(t){this.ensureBuffer(e+t);for(var n=e+t;!this.eof&&this.bufferLength<n;)this.readBlock();var r=this.bufferLength;r<n&&(n=r)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}return this.pos=n,this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var r=t+e;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},t}(),kt=function(){if("undefined"!=typeof Uint32Array){var k=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),I=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),C=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),B=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],j=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return(t.prototype=Object.create(Pt.prototype)).getBits=function(t){for(var e,n=this.codeSize,r=this.codeBuf,i=this.bytes,o=this.bytesPos;n<t;)void 0===(e=i[o++])&&E("Bad encoding in flate stream"),r|=e<<n,n+=8;return e=r&(1<<t)-1,this.codeBuf=r>>t,this.codeSize=n-=t,this.bytesPos=o,e},t.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,a=this.bytesPos;r<n;){var s;void 0===(s=o[a++])&&E("Bad encoding in flate stream"),i|=s<<r,r+=8}var l=e[i&(1<<n)-1],h=l>>16,u=65535&l;return(0==r||r<h||0==h)&&E("Bad encoding in flate stream"),this.codeBuf=i>>h,this.codeSize=r-h,this.bytesPos=a,u},t.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;r<e;++r)t[r]>n&&(n=t[r]);for(var i=1<<n,o=new Uint32Array(i),a=1,s=0,l=2;a<=n;++a,s<<=1,l<<=1)for(var h=0;h<e;++h)if(t[h]==a){var u=0,c=s;for(r=0;r<a;++r)u=u<<1|1&c,c>>=1;for(r=u;r<i;r+=l)o[r]=a<<16|h;++s}return[o,n]},t.prototype.readBlock=function(){function t(t,e,n,r,i){for(var o=t.getBits(n)+r;0<o--;)e[l++]=i}var e=this.getBits(3);if(1&e&&(this.eof=!0),0!=(e>>=1)){var n,r;if(1==e)n=B,r=j;else if(2==e){for(var i=this.getBits(5)+257,o=this.getBits(5)+1,a=this.getBits(4)+4,s=Array(k.length),l=0;l<a;)s[k[l++]]=this.getBits(3);for(var h=this.generateHuffmanTable(s),u=0,c=(l=0,i+o),f=new Array(c);l<c;){var p=this.getCode(h);16==p?t(this,f,2,3,u):17==p?t(this,f,3,3,u=0):18==p?t(this,f,7,11,u=0):f[l++]=u=p}n=this.generateHuffmanTable(f.slice(0,i)),r=this.generateHuffmanTable(f.slice(i,c))}else E("Unknown block type in flate stream");for(var d=(_=this.buffer)?_.length:0,g=this.bufferLength;;){var m=this.getCode(n);if(m<256)d<=g+1&&(d=(_=this.ensureBuffer(g+1)).length),_[g++]=m;else{if(256==m)return void(this.bufferLength=g);var y=(m=I[m-=257])>>16;0<y&&(y=this.getBits(y));u=(65535&m)+y;m=this.getCode(r),0<(y=(m=C[m])>>16)&&(y=this.getBits(y));var v=(65535&m)+y;d<=g+u&&(d=(_=this.ensureBuffer(g+u)).length);for(var w=0;w<u;++w,++g)_[g]=_[g-v]}}}else{var b,x=this.bytes,N=this.bytesPos;void 0===(b=x[N++])&&E("Bad block header in flate stream");var L=b;void 0===(b=x[N++])&&E("Bad block header in flate stream"),L|=b<<8,void 0===(b=x[N++])&&E("Bad block header in flate stream");var A=b;void 0===(b=x[N++])&&E("Bad block header in flate stream"),(A|=b<<8)!=(65535&~L)&&E("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var S=this.bufferLength,_=this.ensureBuffer(S+L),F=S+L;this.bufferLength=F;for(var P=S;P<F;++P){if(void 0===(b=x[N++])){this.eof=!0;break}_[P]=b}this.bytesPos=N}},t}function E(t){throw new Error(t)}function t(t){var e=0,n=t[e++],r=t[e++];-1!=n&&-1!=r||E("Invalid header in flate stream"),8!=(15&n)&&E("Unknown compression method in flate stream"),((n<<8)+r)%31!=0&&E("Bad FCHECK in flate stream"),32&r&&E("FDICT bit set in flate stream"),this.bytes=t,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,Pt.call(this)}}();window.tmp=kt});try{module.exports=jsPDF}catch(t){}
/** @license Promise polyfill | Copyright (c) 2014 Taylor Hakes [https://github.com/taylorhakes/promise-polyfill] | MIT License [https://github.com/taylorhakes/promise-polyfill/blob/master/LICENSE] */
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define("promise",n):n()}(0,function(){"use strict";function e(){}function n(e){if(!(this instanceof n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(e,this)}function t(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,n._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(f){return void r(t.promise,f)}o(t.promise,i)}else(1===e._state?o:r)(t.promise,e._value)})):e._deferreds.push(t)}function o(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var o=t.then;if(t instanceof n)return e._state=3,e._value=t,void i(e);if("function"==typeof o)return void f(function(e,n){return function(){e.apply(n,arguments)}}(o,t),e)}e._state=1,e._value=t,i(e)}catch(u){r(e,u)}}function r(e,n){e._state=2,e._value=n,i(e)}function i(e){2===e._state&&0===e._deferreds.length&&n._immediateFn(function(){e._handled||n._unhandledRejectionFn(e._value)});for(var o=0,r=e._deferreds.length;r>o;o++)t(e,e._deferreds[o]);e._deferreds=null}function f(e,n){var t=!1;try{e(function(e){t||(t=!0,o(n,e))},function(e){t||(t=!0,r(n,e))})}catch(i){if(t)return;t=!0,r(n,i)}}var u=function(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})},c=setTimeout;n.prototype["catch"]=function(e){return this.then(null,e)},n.prototype.then=function(n,o){var r=new this.constructor(e);return t(this,new function(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}(n,o,r)),r},n.prototype["finally"]=u,n.all=function(e){return new n(function(n,t){function o(e,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(n){o(e,n)},t)}r[e]=f,0==--i&&n(r)}catch(c){t(c)}}if(!e||"undefined"==typeof e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return n([]);for(var i=r.length,f=0;r.length>f;f++)o(f,r[f])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(n){n(e)})},n.reject=function(e){return new n(function(n,t){t(e)})},n.race=function(e){return new n(function(n,t){for(var o=0,r=e.length;r>o;o++)e[o].then(n,t)})},n._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){c(e,0)},n._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var l=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}();l.Promise?l.Promise.prototype["finally"]||(l.Promise.prototype["finally"]=u):l.Promise=n});
/** @license html2canvas 1.0.0-rc.1 | Copyright (c) 2019 Niklas von Hertzen [https://html2canvas.hertzen.com] | MIT License [https://github.com/niklasvh/html2canvas/blob/master/LICENSE] */
!function(A,e){A.html2canvas=e();"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("html2canvas",[],e):"object"==typeof exports?exports.html2canvas=e():A.html2canvas=e()}(window,function(){return function(A){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return A[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=A,t.c=e,t.d=function(A,e,r){t.o(A,e)||Object.defineProperty(A,e,{enumerable:!0,get:r})},t.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},t.t=function(A,e){if(1&e&&(A=t(A)),8&e)return A;if(4&e&&"object"==typeof A&&A&&A.__esModule)return A;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:A}),2&e&&"string"!=typeof A)for(var n in A)t.d(r,n,function(e){return A[e]}.bind(null,n));return r},t.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(e,"a",e),e},t.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},t.p="",t(t.s=5)}([function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(1);Object.defineProperty(e,"toCodePoints",{enumerable:!0,get:function(){return r.toCodePoints}}),Object.defineProperty(e,"fromCodePoint",{enumerable:!0,get:function(){return r.fromCodePoint}});var n=t(2);Object.defineProperty(e,"LineBreaker",{enumerable:!0,get:function(){return n.LineBreaker}})},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toCodePoints=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var B=A.charCodeAt(t++);56320==(64512&B)?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--)}else e.push(n)}return e},e.fromCodePoint=function(){if(String.fromCodePoint)return String.fromCodePoint.apply(String,arguments);var A=arguments.length;if(!A)return"";for(var e=[],t=-1,r="";++t<A;){var n=arguments.length<=t?void 0:arguments[t];n<=65535?e.push(n):(n-=65536,e.push(55296+(n>>10),n%1024+56320)),(t+1===A||e.length>16384)&&(r+=String.fromCharCode.apply(String,e),e.length=0)}return r};for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),B=0;B<r.length;B++)n[r.charCodeAt(B)]=B;e.decode=function(A){var e=.75*A.length,t=A.length,r=void 0,B=0,s=void 0,o=void 0,a=void 0,i=void 0;"="===A[A.length-1]&&(e--,"="===A[A.length-2]&&e--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(e):new Array(e),Q=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<t;r+=4)s=n[A.charCodeAt(r)],o=n[A.charCodeAt(r+1)],a=n[A.charCodeAt(r+2)],i=n[A.charCodeAt(r+3)],Q[B++]=s<<2|o>>4,Q[B++]=(15&o)<<4|a>>2,Q[B++]=(3&a)<<6|63&i;return c},e.polyUint16Array=function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t},e.polyUint32Array=function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LineBreaker=e.inlineBreakOpportunities=e.lineBreakAtIndex=e.codePointsToCharacterClasses=e.UnicodeTrie=e.BREAK_ALLOWED=e.BREAK_NOT_ALLOWED=e.BREAK_MANDATORY=e.classes=e.LETTER_NUMBER_MODIFIER=void 0;var r=function(){function A(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}return function(e,t,r){return t&&A(e.prototype,t),r&&A(e,r),e}}(),n=function(A,e){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{!r&&o.return&&o.return()}finally{if(n)throw B}}return t}(A,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},B=t(3),s=function(A){return A&&A.__esModule?A:{default:A}}(t(4)),o=t(1),a=e.LETTER_NUMBER_MODIFIER=50,i=10,c=13,Q=15,l=17,w=18,u=19,U=20,g=21,F=22,C=24,h=25,d=26,H=27,f=28,E=30,p=32,K=33,m=34,b=35,N=37,y=38,v=39,I=40,D=42,M=(e.classes={BK:1,CR:2,LF:3,CM:4,NL:5,SG:6,WJ:7,ZW:8,GL:9,SP:i,ZWJ:11,B2:12,BA:c,BB:14,HY:Q,CB:16,CL:l,CP:w,EX:u,IN:U,NS:g,OP:F,QU:23,IS:C,NU:h,PO:d,PR:H,SY:f,AI:29,AL:E,CJ:31,EB:p,EM:K,H2:m,H3:b,HL:36,ID:N,JL:y,JV:v,JT:I,RI:41,SA:D,XX:43},e.BREAK_MANDATORY="!"),T=e.BREAK_NOT_ALLOWED="×",S=e.BREAK_ALLOWED="÷",X=e.UnicodeTrie=(0,B.createTrieFromBase64)(s.default),z=[E,36],L=[1,2,3,5],O=[i,8],x=[H,d],V=L.concat(O),k=[y,v,I,m,b],J=[Q,c],R=e.codePointsToCharacterClasses=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"strict",t=[],r=[],n=[];return A.forEach(function(A,B){var s=X.get(A);if(s>a?(n.push(!0),s-=a):n.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(B),t.push(16);if(4===s||11===s){if(0===B)return r.push(B),t.push(E);var o=t[B-1];return-1===V.indexOf(o)?(r.push(r[B-1]),t.push(o)):(r.push(B),t.push(E))}return r.push(B),31===s?t.push("strict"===e?g:N):s===D?t.push(E):29===s?t.push(E):43===s?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(N):t.push(E):void t.push(s)}),[r,t,n]},_=function(A,e,t,r){var n=r[t];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var B=t;B<=r.length;){var s=r[++B];if(s===e)return!0;if(s!==i)break}if(n===i)for(var o=t;o>0;){var a=r[--o];if(Array.isArray(A)?-1!==A.indexOf(a):A===a)for(var c=t;c<=r.length;){var Q=r[++c];if(Q===e)return!0;if(Q!==i)break}if(a!==i)break}return!1},P=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==i)return r;t--}return 0},G=function(A,e,t,r,n){if(0===t[r])return T;var B=r-1;if(Array.isArray(n)&&!0===n[B])return T;var s=B-1,o=B+1,a=e[B],E=s>=0?e[s]:0,D=e[o];if(2===a&&3===D)return T;if(-1!==L.indexOf(a))return M;if(-1!==L.indexOf(D))return T;if(-1!==O.indexOf(D))return T;if(8===P(B,e))return S;if(11===X.get(A[B])&&(D===N||D===p||D===K))return T;if(7===a||7===D)return T;if(9===a)return T;if(-1===[i,c,Q].indexOf(a)&&9===D)return T;if(-1!==[l,w,u,C,f].indexOf(D))return T;if(P(B,e)===F)return T;if(_(23,F,B,e))return T;if(_([l,w],g,B,e))return T;if(_(12,12,B,e))return T;if(a===i)return S;if(23===a||23===D)return T;if(16===D||16===a)return S;if(-1!==[c,Q,g].indexOf(D)||14===a)return T;if(36===E&&-1!==J.indexOf(a))return T;if(a===f&&36===D)return T;if(D===U&&-1!==z.concat(U,u,h,N,p,K).indexOf(a))return T;if(-1!==z.indexOf(D)&&a===h||-1!==z.indexOf(a)&&D===h)return T;if(a===H&&-1!==[N,p,K].indexOf(D)||-1!==[N,p,K].indexOf(a)&&D===d)return T;if(-1!==z.indexOf(a)&&-1!==x.indexOf(D)||-1!==x.indexOf(a)&&-1!==z.indexOf(D))return T;if(-1!==[H,d].indexOf(a)&&(D===h||-1!==[F,Q].indexOf(D)&&e[o+1]===h)||-1!==[F,Q].indexOf(a)&&D===h||a===h&&-1!==[h,f,C].indexOf(D))return T;if(-1!==[h,f,C,l,w].indexOf(D))for(var V=B;V>=0;){var R=e[V];if(R===h)return T;if(-1===[f,C].indexOf(R))break;V--}if(-1!==[H,d].indexOf(D))for(var G=-1!==[l,w].indexOf(a)?s:B;G>=0;){var W=e[G];if(W===h)return T;if(-1===[f,C].indexOf(W))break;G--}if(y===a&&-1!==[y,v,m,b].indexOf(D)||-1!==[v,m].indexOf(a)&&-1!==[v,I].indexOf(D)||-1!==[I,b].indexOf(a)&&D===I)return T;if(-1!==k.indexOf(a)&&-1!==[U,d].indexOf(D)||-1!==k.indexOf(D)&&a===H)return T;if(-1!==z.indexOf(a)&&-1!==z.indexOf(D))return T;if(a===C&&-1!==z.indexOf(D))return T;if(-1!==z.concat(h).indexOf(a)&&D===F||-1!==z.concat(h).indexOf(D)&&a===w)return T;if(41===a&&41===D){for(var Y=t[B],q=1;Y>0&&41===e[--Y];)q++;if(q%2!=0)return T}return a===p&&D===K?T:S},W=(e.lineBreakAtIndex=function(A,e){if(0===e)return T;if(e>=A.length)return M;var t=R(A),r=n(t,2),B=r[0],s=r[1];return G(A,s,B,e)},function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=R(A,e.lineBreak),r=n(t,3),B=r[0],s=r[1],o=r[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(s=s.map(function(A){return-1!==[h,E,D].indexOf(A)?N:A})),[B,s,"keep-all"===e.wordBreak?o.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):null]}),Y=(e.inlineBreakOpportunities=function(A,e){var t=(0,o.toCodePoints)(A),r=T,B=W(t,e),s=n(B,3),a=s[0],i=s[1],c=s[2];return t.forEach(function(A,e){r+=(0,o.fromCodePoint)(A)+(e>=t.length-1?M:G(t,i,a,e+1,c))}),r},function(){function A(e,t,r,n){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._codePoints=e,this.required=t===M,this.start=r,this.end=n}return r(A,[{key:"slice",value:function(){return o.fromCodePoint.apply(void 0,function(A){if(Array.isArray(A)){for(var e=0,t=Array(A.length);e<A.length;e++)t[e]=A[e];return t}return Array.from(A)}(this._codePoints.slice(this.start,this.end)))}}]),A}());e.LineBreaker=function(A,e){var t=(0,o.toCodePoints)(A),r=W(t,e),B=n(r,3),s=B[0],a=B[1],i=B[2],c=t.length,Q=0,l=0;return{next:function(){if(l>=c)return{done:!0};for(var A=T;l<c&&(A=G(t,a,s,++l,i))===T;);if(A!==T||l===c){var e=new Y(t,A,Q,l);return Q=l,{value:e,done:!1}}return{done:!0}}}}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Trie=e.createTrieFromBase64=e.UTRIE2_INDEX_2_MASK=e.UTRIE2_INDEX_2_BLOCK_LENGTH=e.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=e.UTRIE2_INDEX_1_OFFSET=e.UTRIE2_UTF8_2B_INDEX_2_LENGTH=e.UTRIE2_UTF8_2B_INDEX_2_OFFSET=e.UTRIE2_INDEX_2_BMP_LENGTH=e.UTRIE2_LSCP_INDEX_2_LENGTH=e.UTRIE2_DATA_MASK=e.UTRIE2_DATA_BLOCK_LENGTH=e.UTRIE2_LSCP_INDEX_2_OFFSET=e.UTRIE2_SHIFT_1_2=e.UTRIE2_INDEX_SHIFT=e.UTRIE2_SHIFT_1=e.UTRIE2_SHIFT_2=void 0;var r=function(){function A(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}return function(e,t,r){return t&&A(e.prototype,t),r&&A(e,r),e}}(),n=t(1),B=e.UTRIE2_SHIFT_2=5,s=e.UTRIE2_SHIFT_1=11,o=e.UTRIE2_INDEX_SHIFT=2,a=e.UTRIE2_SHIFT_1_2=s-B,i=e.UTRIE2_LSCP_INDEX_2_OFFSET=65536>>B,c=e.UTRIE2_DATA_BLOCK_LENGTH=1<<B,Q=e.UTRIE2_DATA_MASK=c-1,l=e.UTRIE2_LSCP_INDEX_2_LENGTH=1024>>B,w=e.UTRIE2_INDEX_2_BMP_LENGTH=i+l,u=e.UTRIE2_UTF8_2B_INDEX_2_OFFSET=w,U=e.UTRIE2_UTF8_2B_INDEX_2_LENGTH=32,g=e.UTRIE2_INDEX_1_OFFSET=u+U,F=e.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=65536>>s,C=e.UTRIE2_INDEX_2_BLOCK_LENGTH=1<<a,h=e.UTRIE2_INDEX_2_MASK=C-1,d=(e.createTrieFromBase64=function(A){var e=(0,n.decode)(A),t=Array.isArray(e)?(0,n.polyUint32Array)(e):new Uint32Array(e),r=Array.isArray(e)?(0,n.polyUint16Array)(e):new Uint16Array(e),B=r.slice(12,t[4]/2),s=2===t[5]?r.slice((24+t[4])/2):t.slice(Math.ceil((24+t[4])/4));return new d(t[0],t[1],t[2],t[3],B,s)},e.Trie=function(){function A(e,t,r,n,B,s){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=n,this.index=B,this.data=s}return r(A,[{key:"get",value:function(A){var e=void 0;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>B])<<o)+(A&Q),this.data[e];if(A<=65535)return e=((e=this.index[i+(A-55296>>B)])<<o)+(A&Q),this.data[e];if(A<this.highStart)return e=g-F+(A>>s),e=this.index[e],e+=A>>B&h,e=((e=this.index[e])<<o)+(A&Q),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue}}]),A}())},function(A,e,t){"use strict";A.exports=" "},function(A,e,t){"use strict";t.r(e);var r={VECTOR:0,BEZIER_CURVE:1,CIRCLE:2};function n(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var B=/^#([a-f0-9]{3})$/i,s=function(A){var e=A.match(B);return!!e&&[parseInt(e[1][0]+e[1][0],16),parseInt(e[1][1]+e[1][1],16),parseInt(e[1][2]+e[1][2],16),null]},o=/^#([a-f0-9]{6})$/i,a=function(A){var e=A.match(o);return!!e&&[parseInt(e[1].substring(0,2),16),parseInt(e[1].substring(2,4),16),parseInt(e[1].substring(4,6),16),null]},i=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,c=function(A){var e=A.match(i);return!!e&&[Number(e[1]),Number(e[2]),Number(e[3]),null]},Q=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/,l=function(A){var e=A.match(Q);return!!(e&&e.length>4)&&[Number(e[1]),Number(e[2]),Number(e[3]),Number(e[4])]},w=function(A){return[Math.min(A[0],255),Math.min(A[1],255),Math.min(A[2],255),A.length>3?A[3]:null]},u=function(A){return g[A.toLowerCase()]||!1},U=function(){function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A);var t=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(Array.isArray(e)?w(e):s(e)||c(e)||l(e)||u(e)||a(e)||[0,0,0,null],4),r=t[0],n=t[1],B=t[2],o=t[3];this.r=r,this.g=n,this.b=B,this.a=o}return function(A,e,t){e&&n(A.prototype,e)}(A,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")"):"rgb(".concat(this.r,",").concat(this.g,",").concat(this.b,")")}}]),A}(),g={transparent:[0,0,0,0],aliceblue:[240,248,255,null],antiquewhite:[250,235,215,null],aqua:[0,255,255,null],aquamarine:[127,255,212,null],azure:[240,255,255,null],beige:[245,245,220,null],bisque:[255,228,196,null],black:[0,0,0,null],blanchedalmond:[255,235,205,null],blue:[0,0,255,null],blueviolet:[138,43,226,null],brown:[165,42,42,null],burlywood:[222,184,135,null],cadetblue:[95,158,160,null],chartreuse:[127,255,0,null],chocolate:[210,105,30,null],coral:[255,127,80,null],cornflowerblue:[100,149,237,null],cornsilk:[255,248,220,null],crimson:[220,20,60,null],cyan:[0,255,255,null],darkblue:[0,0,139,null],darkcyan:[0,139,139,null],darkgoldenrod:[184,134,11,null],darkgray:[169,169,169,null],darkgreen:[0,100,0,null],darkgrey:[169,169,169,null],darkkhaki:[189,183,107,null],darkmagenta:[139,0,139,null],darkolivegreen:[85,107,47,null],darkorange:[255,140,0,null],darkorchid:[153,50,204,null],darkred:[139,0,0,null],darksalmon:[233,150,122,null],darkseagreen:[143,188,143,null],darkslateblue:[72,61,139,null],darkslategray:[47,79,79,null],darkslategrey:[47,79,79,null],darkturquoise:[0,206,209,null],darkviolet:[148,0,211,null],deeppink:[255,20,147,null],deepskyblue:[0,191,255,null],dimgray:[105,105,105,null],dimgrey:[105,105,105,null],dodgerblue:[30,144,255,null],firebrick:[178,34,34,null],floralwhite:[255,250,240,null],forestgreen:[34,139,34,null],fuchsia:[255,0,255,null],gainsboro:[220,220,220,null],ghostwhite:[248,248,255,null],gold:[255,215,0,null],goldenrod:[218,165,32,null],gray:[128,128,128,null],green:[0,128,0,null],greenyellow:[173,255,47,null],grey:[128,128,128,null],honeydew:[240,255,240,null],hotpink:[255,105,180,null],indianred:[205,92,92,null],indigo:[75,0,130,null],ivory:[255,255,240,null],khaki:[240,230,140,null],lavender:[230,230,250,null],lavenderblush:[255,240,245,null],lawngreen:[124,252,0,null],lemonchiffon:[255,250,205,null],lightblue:[173,216,230,null],lightcoral:[240,128,128,null],lightcyan:[224,255,255,null],lightgoldenrodyellow:[250,250,210,null],lightgray:[211,211,211,null],lightgreen:[144,238,144,null],lightgrey:[211,211,211,null],lightpink:[255,182,193,null],lightsalmon:[255,160,122,null],lightseagreen:[32,178,170,null],lightskyblue:[135,206,250,null],lightslategray:[119,136,153,null],lightslategrey:[119,136,153,null],lightsteelblue:[176,196,222,null],lightyellow:[255,255,224,null],lime:[0,255,0,null],limegreen:[50,205,50,null],linen:[250,240,230,null],magenta:[255,0,255,null],maroon:[128,0,0,null],mediumaquamarine:[102,205,170,null],mediumblue:[0,0,205,null],mediumorchid:[186,85,211,null],mediumpurple:[147,112,219,null],mediumseagreen:[60,179,113,null],mediumslateblue:[123,104,238,null],mediumspringgreen:[0,250,154,null],mediumturquoise:[72,209,204,null],mediumvioletred:[199,21,133,null],midnightblue:[25,25,112,null],mintcream:[245,255,250,null],mistyrose:[255,228,225,null],moccasin:[255,228,181,null],navajowhite:[255,222,173,null],navy:[0,0,128,null],oldlace:[253,245,230,null],olive:[128,128,0,null],olivedrab:[107,142,35,null],orange:[255,165,0,null],orangered:[255,69,0,null],orchid:[218,112,214,null],palegoldenrod:[238,232,170,null],palegreen:[152,251,152,null],paleturquoise:[175,238,238,null],palevioletred:[219,112,147,null],papayawhip:[255,239,213,null],peachpuff:[255,218,185,null],peru:[205,133,63,null],pink:[255,192,203,null],plum:[221,160,221,null],powderblue:[176,224,230,null],purple:[128,0,128,null],rebeccapurple:[102,51,153,null],red:[255,0,0,null],rosybrown:[188,143,143,null],royalblue:[65,105,225,null],saddlebrown:[139,69,19,null],salmon:[250,128,114,null],sandybrown:[244,164,96,null],seagreen:[46,139,87,null],seashell:[255,245,238,null],sienna:[160,82,45,null],silver:[192,192,192,null],skyblue:[135,206,235,null],slateblue:[106,90,205,null],slategray:[112,128,144,null],slategrey:[112,128,144,null],snow:[255,250,250,null],springgreen:[0,255,127,null],steelblue:[70,130,180,null],tan:[210,180,140,null],teal:[0,128,128,null],thistle:[216,191,216,null],tomato:[255,99,71,null],turquoise:[64,224,208,null],violet:[238,130,238,null],wheat:[245,222,179,null],white:[255,255,255,null],whitesmoke:[245,245,245,null],yellow:[255,255,0,null],yellowgreen:[154,205,50,null]},F=new U([0,0,0,0]),C=function(A){switch(A){case"underline":return 1;case"overline":return 2;case"line-through":return 3}return 4},h=function(A){var e=function(A){return"none"===A?null:A.split(" ").map(C)}(A.textDecorationLine?A.textDecorationLine:A.textDecoration);return null===e?null:{textDecorationLine:e,textDecorationColor:A.textDecorationColor?new U(A.textDecorationColor):null,textDecorationStyle:function(A){switch(A){case"double":return 1;case"dotted":return 2;case"dashed":return 3;case"wavy":return 4}return 0}(A.textDecorationStyle)}};function d(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var H=function(A,e){var t=Math.max.apply(null,A.colorStops.map(function(A){return A.stop})),r=1/Math.max(1,t);A.colorStops.forEach(function(A){e.addColorStop(Math.floor(Math.max(0,r*A.stop)),A.color.toString())})},f=function(){function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.canvas=e||document.createElement("canvas")}return function(A,e,t){e&&d(A.prototype,e)}(A,[{key:"render",value:function(A){this.ctx=this.canvas.getContext("2d"),this.options=A,this.canvas.width=Math.floor(A.width*A.scale),this.canvas.height=Math.floor(A.height*A.scale),this.canvas.style.width="".concat(A.width,"px"),this.canvas.style.height="".concat(A.height,"px"),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-A.x,-A.y),this.ctx.textBaseline="bottom",A.logger.log("Canvas renderer initialized (".concat(A.width,"x").concat(A.height," at ").concat(A.x,",").concat(A.y,") with scale ").concat(this.options.scale))}},{key:"clip",value:function(A,e){var t=this;A.length&&(this.ctx.save(),A.forEach(function(A){t.path(A),t.ctx.clip()})),e(),A.length&&this.ctx.restore()}},{key:"drawImage",value:function(A,e,t){this.ctx.drawImage(A,e.left,e.top,e.width,e.height,t.left,t.top,t.width,t.height)}},{key:"drawShape",value:function(A,e){this.path(A),this.ctx.fillStyle=e.toString(),this.ctx.fill()}},{key:"fill",value:function(A){this.ctx.fillStyle=A.toString(),this.ctx.fill()}},{key:"getTarget",value:function(){return this.canvas.getContext("2d").setTransform(1,0,0,1,0,0),Promise.resolve(this.canvas)}},{key:"path",value:function(A){var e=this;this.ctx.beginPath(),Array.isArray(A)?A.forEach(function(A,t){var n=A.type===r.VECTOR?A:A.start;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),A.type===r.BEZIER_CURVE&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}):this.ctx.arc(A.x+A.radius,A.y+A.radius,A.radius,0,2*Math.PI,!0),this.ctx.closePath()}},{key:"rectangle",value:function(A,e,t,r,n){this.ctx.fillStyle=n.toString(),this.ctx.fillRect(A,e,t,r)}},{key:"renderLinearGradient",value:function(A,e){var t=this.ctx.createLinearGradient(A.left+e.direction.x1,A.top+e.direction.y1,A.left+e.direction.x0,A.top+e.direction.y0);H(e,t),this.ctx.fillStyle=t,this.ctx.fillRect(A.left,A.top,A.width,A.height)}},{key:"renderRadialGradient",value:function(A,e){var t=this,r=A.left+e.center.x,n=A.top+e.center.y,B=this.ctx.createRadialGradient(r,n,0,r,n,e.radius.x);if(B)if(H(e,B),this.ctx.fillStyle=B,e.radius.x!==e.radius.y){var s=A.left+.5*A.width,o=A.top+.5*A.height,a=e.radius.y/e.radius.x,i=1/a;this.transform(s,o,[1,0,0,a,0,0],function(){return t.ctx.fillRect(A.left,i*(A.top-o)+o,A.width,A.height*i)})}else this.ctx.fillRect(A.left,A.top,A.width,A.height)}},{key:"renderRepeat",value:function(A,e,t,r,n){this.path(A),this.ctx.fillStyle=this.ctx.createPattern(this.resizeImage(e,t),"repeat"),this.ctx.translate(r,n),this.ctx.fill(),this.ctx.translate(-r,-n)}},{key:"renderTextNode",value:function(A,e,t,r,n){var B=this;this.ctx.font=[t.fontStyle,t.fontVariant,t.fontWeight,t.fontSize,t.fontFamily].join(" "),A.forEach(function(A){if(B.ctx.fillStyle=e.toString(),n&&A.text.trim().length?(n.slice(0).reverse().forEach(function(e){B.ctx.shadowColor=e.color.toString(),B.ctx.shadowOffsetX=e.offsetX*B.options.scale,B.ctx.shadowOffsetY=e.offsetY*B.options.scale,B.ctx.shadowBlur=e.blur,B.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)}),B.ctx.shadowColor="",B.ctx.shadowOffsetX=0,B.ctx.shadowOffsetY=0,B.ctx.shadowBlur=0):B.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height),null!==r){var s=r.textDecorationColor||e;r.textDecorationLine.forEach(function(e){switch(e){case 1:var r=B.options.fontMetrics.getMetrics(t).baseline;B.rectangle(A.bounds.left,Math.round(A.bounds.top+r),A.bounds.width,1,s);break;case 2:B.rectangle(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1,s);break;case 3:var n=B.options.fontMetrics.getMetrics(t).middle;B.rectangle(A.bounds.left,Math.ceil(A.bounds.top+n),A.bounds.width,1,s)}})}})}},{key:"resizeImage",value:function(A,e){if(A.width===e.width&&A.height===e.height)return A;var t=this.canvas.ownerDocument.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e.width,e.height),t}},{key:"setOpacity",value:function(A){this.ctx.globalAlpha=A}},{key:"transform",value:function(A,e,t,r){this.ctx.save(),this.ctx.translate(A,e),this.ctx.transform(t[0],t[1],t[2],t[3],t[4],t[5]),this.ctx.translate(-A,-e),r(),this.ctx.restore()}}]),A}();function E(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var p=function(){function A(e,t,r){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.enabled="undefined"!=typeof window&&e,this.start=r||Date.now(),this.id=t}return function(A,e,t){e&&E(A.prototype,e)}(A,[{key:"child",value:function(e){return new A(this.enabled,e,this.start)}},{key:"log",value:function(){if(false&&window.console&&window.console.log){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas (".concat(this.id,"):"):"html2canvas:"].concat([].slice.call(e,0)))}}},{key:"error",value:function(){if(this.enabled&&window.console&&window.console.error){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];Function.prototype.bind.call(window.console.error,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas (".concat(this.id,"):"):"html2canvas:"].concat([].slice.call(e,0)))}}}]),A}(),K=function(A,e){return 0!=(A&e)},m=function(A,e){return Math.sqrt(A*A+e*e)},b=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);"content"!==r&&e.style.setProperty(r,A.getPropertyValue(r))}return e};function N(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var y={PX:0,PERCENTAGE:1},v=function(){function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.type="%"===e.substr(e.length-1)?y.PERCENTAGE:y.PX;var t=parseFloat(e);this.value=isNaN(t)?0:t}return function(A,e,t){e&&N(A.prototype,e),t&&N(A,t)}(A,[{key:"isPercentage",value:function(){return this.type===y.PERCENTAGE}},{key:"getAbsoluteValue",value:function(A){return this.isPercentage()?A*(this.value/100):this.value}}],[{key:"create",value:function(e){return new A(e)}}]),A}(),I=function(A,e,t){switch(t){case"px":case"%":return new v(e+t);case"em":case"rem":var r=new v(e);return r.value*="em"===t?parseFloat(A.style.font.fontSize):function A(e){var t=e.parent;return t?A(t):parseFloat(e.style.font.fontSize)}(A),r;default:return new v("0")}},D=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.width=e,this.height=t},M=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.type=r.VECTOR,this.x=e,this.y=t};function T(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var S=function(A,e,t){return new M(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},X=function(){function A(e,t,n,B){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.type=r.BEZIER_CURVE,this.start=e,this.startControl=t,this.endControl=n,this.end=B}return function(A,e,t){e&&T(A.prototype,e)}(A,[{key:"subdivide",value:function(e,t){var r=S(this.start,this.startControl,e),n=S(this.startControl,this.endControl,e),B=S(this.endControl,this.end,e),s=S(r,n,e),o=S(n,B,e),a=S(s,o,e);return t?new A(this.start,r,s,a):new A(a,o,B,this.end)}},{key:"reverse",value:function(){return new A(this.end,this.endControl,this.startControl,this.start)}}]),A}();function z(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var L=function(){function A(e,t,r,n){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.left=e,this.top=t,this.width=r,this.height=n}return function(A,e,t){t&&z(A,t)}(A,0,[{key:"fromClientRect",value:function(e,t,r){return new A(e.left+t,e.top+r,e.width,e.height)}}]),A}(),O=function(A,e,t){return L.fromClientRect(A.getBoundingClientRect(),e,t)},x=function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),n=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new L(0,0,r,n)},V=function(A,e,t,r){var n=[];return A instanceof X?n.push(A.subdivide(.5,!1)):n.push(A),t instanceof X?n.push(t.subdivide(.5,!0)):n.push(t),r instanceof X?n.push(r.subdivide(.5,!0).reverse()):n.push(r),e instanceof X?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},k=function(A){return[A.topLeftInner,A.topRightInner,A.bottomRightInner,A.bottomLeftInner]},J=function(A,e,t){var r=t[R.TOP_LEFT][0].getAbsoluteValue(A.width),n=t[R.TOP_LEFT][1].getAbsoluteValue(A.height),B=t[R.TOP_RIGHT][0].getAbsoluteValue(A.width),s=t[R.TOP_RIGHT][1].getAbsoluteValue(A.height),o=t[R.BOTTOM_RIGHT][0].getAbsoluteValue(A.width),a=t[R.BOTTOM_RIGHT][1].getAbsoluteValue(A.height),i=t[R.BOTTOM_LEFT][0].getAbsoluteValue(A.width),c=t[R.BOTTOM_LEFT][1].getAbsoluteValue(A.height),Q=[];Q.push((r+B)/A.width),Q.push((i+o)/A.width),Q.push((n+c)/A.height),Q.push((s+a)/A.height);var l=Math.max.apply(Math,Q);l>1&&(r/=l,n/=l,B/=l,s/=l,o/=l,a/=l,i/=l,c/=l);var w=A.width-B,u=A.height-a,U=A.width-o,g=A.height-c;return{topLeftOuter:r>0||n>0?_(A.left,A.top,r,n,R.TOP_LEFT):new M(A.left,A.top),topLeftInner:r>0||n>0?_(A.left+e[3].borderWidth,A.top+e[0].borderWidth,Math.max(0,r-e[3].borderWidth),Math.max(0,n-e[0].borderWidth),R.TOP_LEFT):new M(A.left+e[3].borderWidth,A.top+e[0].borderWidth),topRightOuter:B>0||s>0?_(A.left+w,A.top,B,s,R.TOP_RIGHT):new M(A.left+A.width,A.top),topRightInner:B>0||s>0?_(A.left+Math.min(w,A.width+e[3].borderWidth),A.top+e[0].borderWidth,w>A.width+e[3].borderWidth?0:B-e[3].borderWidth,s-e[0].borderWidth,R.TOP_RIGHT):new M(A.left+A.width-e[1].borderWidth,A.top+e[0].borderWidth),bottomRightOuter:o>0||a>0?_(A.left+U,A.top+u,o,a,R.BOTTOM_RIGHT):new M(A.left+A.width,A.top+A.height),bottomRightInner:o>0||a>0?_(A.left+Math.min(U,A.width-e[3].borderWidth),A.top+Math.min(u,A.height+e[0].borderWidth),Math.max(0,o-e[1].borderWidth),a-e[2].borderWidth,R.BOTTOM_RIGHT):new M(A.left+A.width-e[1].borderWidth,A.top+A.height-e[2].borderWidth),bottomLeftOuter:i>0||c>0?_(A.left,A.top+g,i,c,R.BOTTOM_LEFT):new M(A.left,A.top+A.height),bottomLeftInner:i>0||c>0?_(A.left+e[3].borderWidth,A.top+g,Math.max(0,i-e[3].borderWidth),c-e[2].borderWidth,R.BOTTOM_LEFT):new M(A.left+e[3].borderWidth,A.top+A.height-e[2].borderWidth)}},R={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3},_=function(A,e,t,r,n){var B=(Math.sqrt(2)-1)/3*4,s=t*B,o=r*B,a=A+t,i=e+r;switch(n){case R.TOP_LEFT:return new X(new M(A,i),new M(A,i-o),new M(a-s,e),new M(a,e));case R.TOP_RIGHT:return new X(new M(A,e),new M(A+s,e),new M(a,i-o),new M(a,i));case R.BOTTOM_RIGHT:return new X(new M(a,e),new M(a,e+o),new M(A+s,i),new M(A,i));case R.BOTTOM_LEFT:default:return new X(new M(a,i),new M(a-s,i),new M(A,e+o),new M(A,e))}},P=["top","right","bottom","left"],G=function(A){return P.map(function(e){return new v(A.getPropertyValue("padding-".concat(e)))})},W={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},Y=W,q=function A(e){switch(function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),e){case"contain":this.size=1;break;case"cover":this.size=2;break;case"auto":this.size=0;break;default:this.value=new v(e)}},j=new q("auto"),Z=function(A,e,t,r){var n=function(A,e){return new L(A.left+e[3].borderWidth,A.top+e[0].borderWidth,A.width-(e[1].borderWidth+e[3].borderWidth),A.height-(e[0].borderWidth+e[2].borderWidth))}(e,r);switch(A){case Y.BORDER_BOX:return e;case Y.CONTENT_BOX:var B=t[3].getAbsoluteValue(e.width),s=t[1].getAbsoluteValue(e.width),o=t[0].getAbsoluteValue(e.width),a=t[2].getAbsoluteValue(e.width);return new L(n.left+B,n.top+o,n.width-B-s,n.height-o-a);case Y.PADDING_BOX:default:return n}},$=function(A,e,t){return new M(A[0].getAbsoluteValue(t.width-e.width),A[1].getAbsoluteValue(t.height-e.height))},AA=function(A,e){return{backgroundColor:new U(A.backgroundColor),backgroundImage:rA(A,e),backgroundClip:eA(A.backgroundClip),backgroundOrigin:tA(A.backgroundOrigin)}},eA=function(A){switch(A){case"padding-box":return W.PADDING_BOX;case"content-box":return W.CONTENT_BOX}return W.BORDER_BOX},tA=function(A){switch(A){case"padding-box":return Y.PADDING_BOX;case"content-box":return Y.CONTENT_BOX}return Y.BORDER_BOX},rA=function(A,e){var t=sA(A.backgroundImage).map(function(A){if("url"===A.method){var t=e.loadImage(A.args[0]);A.args=t?[t]:[]}return A}),r=A.backgroundPosition.split(","),n=A.backgroundRepeat.split(","),B=A.backgroundSize.split(",");return t.map(function(A,e){var t=(B[e]||"auto").trim().split(" ").map(nA),s=(r[e]||"auto").trim().split(" ").map(BA);return{source:A,repeat:function(A){switch(("string"==typeof n[e]?n[e]:n[0]).trim()){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":return 0}return 0}(),size:t.length<2?[t[0],j]:[t[0],t[1]],position:s.length<2?[s[0],s[0]]:[s[0],s[1]]}})},nA=function(A){return"auto"===A?j:new q(A)},BA=function(A){switch(A){case"bottom":case"right":return new v("100%");case"left":case"top":return new v("0%");case"auto":return new v("0")}return new v(A)},sA=function(A){var e=/^\s$/,t=[],r=[],n="",B=null,s="",o=0,a=0,i=function(){var A="";if(n){'"'===s.substr(0,1)&&(s=s.substr(1,s.length-2)),s&&r.push(s.trim());var e=n.indexOf("-",1)+1;"-"===n.substr(0,1)&&e>0&&(A=n.substr(0,e).toLowerCase(),n=n.substr(e)),"none"!==(n=n.toLowerCase())&&t.push({prefix:A,method:n,args:r})}r=[],n=s=""};return A.split("").forEach(function(A){if(0!==o||!e.test(A)){switch(A){case'"':B?B===A&&(B=null):B=A;break;case"(":if(B)break;if(0===o)return void(o=1);a++;break;case")":if(B)break;if(1===o){if(0===a)return o=0,void i();a--}break;case",":if(B)break;if(0===o)return void i();if(1===o&&0===a&&!n.match(/^url$/i))return r.push(s.trim()),void(s="")}0===o?n+=A:s+=A}}),i(),t},oA=Object.keys({TOP:0,RIGHT:1,BOTTOM:2,LEFT:3}).map(function(A){return A.toLowerCase()}),aA=function(A){return oA.map(function(e){var t=new U(A.getPropertyValue("border-".concat(e,"-color"))),r=function(A){switch(A){case"none":return 0}return 1}(A.getPropertyValue("border-".concat(e,"-style"))),n=parseFloat(A.getPropertyValue("border-".concat(e,"-width")));return{borderColor:t,borderStyle:r,borderWidth:isNaN(n)?0:n}})};var iA=["top-left","top-right","bottom-right","bottom-left"],cA=function(A){return iA.map(function(e){var t=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(A.getPropertyValue("border-".concat(e,"-radius")).split(" ").map(v.create),2),r=t[0],n=t[1];return void 0===n?[r,r]:[r,n]})},QA={NONE:1,BLOCK:2,INLINE:4,RUN_IN:8,FLOW:16,FLOW_ROOT:32,TABLE:64,FLEX:128,GRID:256,RUBY:512,SUBGRID:1024,LIST_ITEM:2048,TABLE_ROW_GROUP:4096,TABLE_HEADER_GROUP:8192,TABLE_FOOTER_GROUP:16384,TABLE_ROW:32768,TABLE_CELL:65536,TABLE_COLUMN_GROUP:1<<17,TABLE_COLUMN:1<<18,TABLE_CAPTION:1<<19,RUBY_BASE:1<<20,RUBY_TEXT:1<<21,RUBY_BASE_CONTAINER:1<<22,RUBY_TEXT_CONTAINER:1<<23,CONTENTS:1<<24,INLINE_BLOCK:1<<25,INLINE_LIST_ITEM:1<<26,INLINE_TABLE:1<<27,INLINE_FLEX:1<<28,INLINE_GRID:1<<29},lA=function(A,e){return A|function(A){switch(e){case"block":return QA.BLOCK;case"inline":return QA.INLINE;case"run-in":return QA.RUN_IN;case"flow":return QA.FLOW;case"flow-root":return QA.FLOW_ROOT;case"table":return QA.TABLE;case"flex":return QA.FLEX;case"grid":return QA.GRID;case"ruby":return QA.RUBY;case"subgrid":return QA.SUBGRID;case"list-item":return QA.LIST_ITEM;case"table-row-group":return QA.TABLE_ROW_GROUP;case"table-header-group":return QA.TABLE_HEADER_GROUP;case"table-footer-group":return QA.TABLE_FOOTER_GROUP;case"table-row":return QA.TABLE_ROW;case"table-cell":return QA.TABLE_CELL;case"table-column-group":return QA.TABLE_COLUMN_GROUP;case"table-column":return QA.TABLE_COLUMN;case"table-caption":return QA.TABLE_CAPTION;case"ruby-base":return QA.RUBY_BASE;case"ruby-text":return QA.RUBY_TEXT;case"ruby-base-container":return QA.RUBY_BASE_CONTAINER;case"ruby-text-container":return QA.RUBY_TEXT_CONTAINER;case"contents":return QA.CONTENTS;case"inline-block":return QA.INLINE_BLOCK;case"inline-list-item":return QA.INLINE_LIST_ITEM;case"inline-table":return QA.INLINE_TABLE;case"inline-flex":return QA.INLINE_FLEX;case"inline-grid":return QA.INLINE_GRID}return QA.NONE}()},wA=function(A){return A.split(" ").reduce(lA,0)},uA=function(A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0},UA=function(A){return{fontFamily:A.fontFamily,fontSize:A.fontSize,fontStyle:A.fontStyle,fontVariant:A.fontVariant,fontWeight:function(A){switch(A){case"normal":return 400;case"bold":return 700}var e=parseInt(A,10);return isNaN(e)?400:e}(A.fontWeight)}},gA=function(A){if("normal"===A)return 0;var e=parseFloat(A);return isNaN(e)?0:e},FA=function(A){switch(A){case"strict":return"strict";case"normal":default:return"normal"}},CA=function(A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}},hA=function(A){var e=sA(A.getPropertyValue("list-style-image"));return{listStyleType:CA(A.getPropertyValue("list-style-type")),listStyleImage:e.length?e[0]:null,listStylePosition:dA(A.getPropertyValue("list-style-position"))}},dA=function(A){switch(A){case"inside":return 0;case"outside":default:return 1}},HA=["top","right","bottom","left"],fA=function(A){return HA.map(function(e){return new v(A.getPropertyValue("margin-".concat(e)))})},EA={VISIBLE:0,HIDDEN:1,SCROLL:2,AUTO:3},pA=function(A){switch(A){case"hidden":return EA.HIDDEN;case"scroll":return EA.SCROLL;case"auto":return EA.AUTO;case"visible":default:return EA.VISIBLE}},KA=function(A){switch(A){case"break-word":return 1;case"normal":default:return 0}},mA={STATIC:0,RELATIVE:1,ABSOLUTE:2,FIXED:3,STICKY:4},bA=function(A){switch(A){case"relative":return mA.RELATIVE;case"absolute":return mA.ABSOLUTE;case"fixed":return mA.FIXED;case"sticky":return mA.STICKY}return mA.STATIC},NA=/^([+-]|\d|\.)$/i,yA=function(A){if("none"===A||"string"!=typeof A)return null;for(var e="",t=!1,r=[],n=[],B=0,s=null,o=function(){e.length&&(t?r.push(parseFloat(e)):s=new U(e)),t=!1,e=""},a=function(){r.length&&null!==s&&n.push({color:s,offsetX:r[0]||0,offsetY:r[1]||0,blur:r[2]||0}),r.splice(0,r.length),s=null},i=0;i<A.length;i++){var c=A[i];switch(c){case"(":e+=c,B++;break;case")":e+=c,B--;break;case",":0===B?(o(),a()):e+=c;break;case" ":0===B?o():e+=c;break;default:0===e.length&&NA.test(c)&&(t=!0),e+=c}}return o(),a(),0===n.length?null:n},vA=function(A){switch(A){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0},IA=function(A){return parseFloat(A.trim())},DA=/(matrix|matrix3d)\((.+)\)/,MA=function(A){var e=SA(A.transform||A.webkitTransform||A.mozTransform||A.msTransform||A.oTransform);return null===e?null:{transform:e,transformOrigin:TA(A.transformOrigin||A.webkitTransformOrigin||A.mozTransformOrigin||A.msTransformOrigin||A.oTransformOrigin)}},TA=function(A){if("string"!=typeof A){var e=new v("0");return[e,e]}var t=A.split(" ").map(v.create);return[t[0],t[1]]},SA=function(A){if("none"===A||"string"!=typeof A)return null;var e=A.match(DA);if(e){if("matrix"===e[1]){var t=e[2].split(",").map(IA);return[t[0],t[1],t[2],t[3],t[4],t[5]]}var r=e[2].split(",").map(IA);return[r[0],r[1],r[4],r[5],r[12],r[13]]}return null},XA=function(A){switch(A){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}},zA=function(A){switch(A){case"break-all":return"break-all";case"keep-all":return"keep-all";case"normal":default:return"normal"}},LA=function(A){var e="auto"===A;return{auto:e,order:e?0:parseInt(A,10)}};function OA(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var xA=function(){function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.element=e}return function(A,e,t){e&&OA(A.prototype,e)}(A,[{key:"render",value:function(A){var e=this;this.options=A,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.width=Math.floor(A.width)*A.scale,this.canvas.height=Math.floor(A.height)*A.scale,this.canvas.style.width="".concat(A.width,"px"),this.canvas.style.height="".concat(A.height,"px"),this.ctx.scale(A.scale,A.scale),A.logger.log("ForeignObject renderer initialized (".concat(A.width,"x").concat(A.height," at ").concat(A.x,",").concat(A.y,") with scale ").concat(A.scale));var t=VA(Math.max(A.windowWidth,A.width)*A.scale,Math.max(A.windowHeight,A.height)*A.scale,A.scrollX*A.scale,A.scrollY*A.scale,this.element);return kA(t).then(function(t){return A.backgroundColor&&(e.ctx.fillStyle=A.backgroundColor.toString(),e.ctx.fillRect(0,0,A.width*A.scale,A.height*A.scale)),e.ctx.drawImage(t,-A.x*A.scale,-A.y*A.scale),e.canvas})}}]),A}(),VA=function(A,e,t,r,n){var B="http://www.w3.org/2000/svg",s=document.createElementNS(B,"svg"),o=document.createElementNS(B,"foreignObject");return s.setAttributeNS(null,"width",A),s.setAttributeNS(null,"height",e),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t),o.setAttributeNS(null,"y",r),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(n),s},kA=function(A){return new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(A)))})},JA=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},RA={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="".concat(123,"px"),t.style.display="block",A.body.appendChild(t),e.selectNode(t);var r=e.getBoundingClientRect(),n=Math.round(r.height);if(A.body.removeChild(t),123===n)return!0}}return!1}(document);return Object.defineProperty(RA,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(RA,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas");e.width=100,e.height=100;var t=e.getContext("2d");t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,100,100);var r=new Image,n=e.toDataURL();r.src=n;var B=VA(100,100,0,0,r);return t.fillStyle="red",t.fillRect(0,0,100,100),kA(B).then(function(e){t.drawImage(e,0,0);var r=t.getImageData(0,0,100,100).data;t.fillStyle="red",t.fillRect(0,0,100,100);var B=A.createElement("div");return B.style.backgroundImage="url(".concat(n,")"),B.style.height="".concat(100,"px"),JA(r)?kA(VA(100,100,0,0,B)):Promise.reject(!1)}).then(function(A){return t.drawImage(A,0,0),JA(t.getImageData(0,0,100,100).data)}).catch(function(A){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(RA,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(RA,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(RA,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(RA,"SUPPORT_CORS_XHR",{value:A}),A}},_A=RA,PA=t(0),GA=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.text=e,this.bounds=t},WA=function(A,e,t){var r=A.ownerDocument.createElement("html2canvaswrapper");r.appendChild(A.cloneNode(!0));var n=A.parentNode;if(n){n.replaceChild(r,A);var B=O(r,e,t);return r.firstChild&&n.replaceChild(r.firstChild,r),B}return new L(0,0,0,0)},YA=function(A,e,t,r,n){var B=A.ownerDocument.createRange();return B.setStart(A,e),B.setEnd(A,e+t),L.fromClientRect(B.getBoundingClientRect(),r,n)};function qA(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var jA=function(){function A(e,t,r){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.text=e,this.parent=t,this.bounds=r}return function(A,e,t){t&&qA(A,t)}(A,0,[{key:"fromTextNode",value:function(e,t){var r=$A(e.data,t.style.textTransform);return new A(r,t,function(A,e,t){for(var r=0!==e.style.letterSpacing?Object(PA.toCodePoints)(A).map(function(A){return Object(PA.fromCodePoint)(A)}):function(A,e){for(var t,r=Object(PA.LineBreaker)(A,{lineBreak:e.style.lineBreak,wordBreak:1===e.style.overflowWrap?"break-word":e.style.wordBreak}),n=[];!(t=r.next()).done;)n.push(t.value.slice());return n}(A,e),n=r.length,B=t.parentNode?t.parentNode.ownerDocument.defaultView:null,s=B?B.pageXOffset:0,o=B?B.pageYOffset:0,a=[],i=0,c=0;c<n;c++){var Q=r[c];if(null!==e.style.textDecoration||Q.trim().length>0)if(_A.SUPPORT_RANGE_BOUNDS)a.push(new GA(Q,YA(t,i,Q.length,s,o)));else{var l=t.splitText(Q.length);a.push(new GA(Q,WA(t,s,o))),t=l}else _A.SUPPORT_RANGE_BOUNDS||(t=t.splitText(Q.length));i+=Q.length}return a}(r,t,e))}}]),A}(),ZA=/(^|\s|:|-|\(|\))([a-z])/g,$A=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(ZA,Ae);case 2:return A.toUpperCase();default:return A}};function Ae(A,e,t){return A.length>0?e+t.toUpperCase():A}var ee=function A(e,t,n){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.type=r.CIRCLE,this.x=e,this.y=t,this.radius=n},te=new U([42,42,42]),re=new U([165,165,165]),ne=new U([222,222,222]),Be={borderWidth:1,borderColor:re,borderStyle:1},se=[Be,Be,Be,Be],oe={backgroundColor:ne,backgroundImage:[],backgroundClip:W.PADDING_BOX,backgroundOrigin:Y.PADDING_BOX},ae=new v("50%"),ie=[ae,ae],ce=[ie,ie,ie,ie],Qe=new v("3px"),le=[Qe,Qe],we=[le,le,le,le],ue=function(A){return"radio"===A.type?ce:we},Ue=function(A,e){if("radio"===A.type||"checkbox"===A.type){if(A.checked){var t=Math.min(e.bounds.width,e.bounds.height);e.childNodes.push("checkbox"===A.type?[new M(e.bounds.left+.39363*t,e.bounds.top+.79*t),new M(e.bounds.left+.16*t,e.bounds.top+.5549*t),new M(e.bounds.left+.27347*t,e.bounds.top+.44071*t),new M(e.bounds.left+.39694*t,e.bounds.top+.5649*t),new M(e.bounds.left+.72983*t,e.bounds.top+.23*t),new M(e.bounds.left+.84*t,e.bounds.top+.34085*t),new M(e.bounds.left+.39363*t,e.bounds.top+.79*t)]:new ee(e.bounds.left+t/4,e.bounds.top+t/4,t/4))}}else he(de(A),A,e,!1)},ge=function(A,e){he(A.value,A,e,!0)},Fe=function(A,e){var t=A.options[A.selectedIndex||0];he(t&&t.text||"",A,e,!1)},Ce=function(A){return A.width>A.height?(A.left+=(A.width-A.height)/2,A.width=A.height):A.width<A.height&&(A.top+=(A.height-A.width)/2,A.height=A.width),A},he=function(A,e,t,r){var n=e.ownerDocument.body;if(A.length>0&&n){var B=e.ownerDocument.createElement("html2canvaswrapper");b(e.ownerDocument.defaultView.getComputedStyle(e,null),B),B.style.position="absolute",B.style.left="".concat(t.bounds.left,"px"),B.style.top="".concat(t.bounds.top,"px"),r||(B.style.whiteSpace="nowrap");var s=e.ownerDocument.createTextNode(A);B.appendChild(s),n.appendChild(B),t.childNodes.push(jA.fromTextNode(s,t)),n.removeChild(B)}},de=function(A){var e="password"===A.type?new Array(A.value.length+1).join("•"):A.value;return 0===e.length?A.placeholder||"":e},He=["OL","UL","MENU"],fe=function(A){var e=A.parent;if(!e)return null;do{if(-1!==He.indexOf(e.tagName))return e;e=e.parent}while(e);return A.parent},Ee=function(A,e,t){var r=e.style.listStyle;if(r){var n,B=A.ownerDocument.defaultView.getComputedStyle(A,null),s=A.ownerDocument.createElement("html2canvaswrapper");switch(b(B,s),s.style.position="absolute",s.style.bottom="auto",s.style.display="block",s.style.letterSpacing="normal",r.listStylePosition){case 1:s.style.left="auto",s.style.right="".concat(A.ownerDocument.defaultView.innerWidth-e.bounds.left-e.style.margin[1].getAbsoluteValue(e.bounds.width)+7,"px"),s.style.textAlign="right";break;case 0:s.style.left="".concat(e.bounds.left-e.style.margin[3].getAbsoluteValue(e.bounds.width),"px"),s.style.right="auto",s.style.textAlign="left"}var o=e.style.margin[0].getAbsoluteValue(e.bounds.width),a=r.listStyleImage;if(a)if("url"===a.method){var i=A.ownerDocument.createElement("img");i.src=a.args[0],s.style.top="".concat(e.bounds.top-o,"px"),s.style.width="auto",s.style.height="auto",s.appendChild(i)}else{var c=.5*parseFloat(e.style.font.fontSize);s.style.top="".concat(e.bounds.top-o+e.bounds.height-1.5*c,"px"),s.style.width="".concat(c,"px"),s.style.height="".concat(c,"px"),s.style.backgroundImage=B.listStyleImage}else"number"==typeof e.listIndex&&(n=A.ownerDocument.createTextNode(Me(e.listIndex,r.listStyleType,!0)),s.appendChild(n),s.style.top="".concat(e.bounds.top-o,"px"));var Q=A.ownerDocument.body;Q.appendChild(s),n?(e.childNodes.push(jA.fromTextNode(n,e)),Q.removeChild(s)):e.childNodes.push(new Xe(s,e,t,0))}},pe={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Ke={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},me={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","�?׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","י�?","יח","יז","�?ז","�?ו","י","�?","ח","ז","ו","ה","ד","ג","ב","א"]},be={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","�?","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Ne=function(A,e,t,r,n,B){return A<e||A>t?Me(A,n,B.length>0):r.integers.reduce(function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e},"")+B},ye=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},ve=function(A,e,t,r,n){var B=t-e+1;return(A<0?"-":"")+(ye(Math.abs(A),B,r,function(A){return Object(PA.fromCodePoint)(Math.floor(A%B)+e)})+n)},Ie=function(A,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:". ",r=e.length;return ye(Math.abs(A),r,!1,function(A){return e[Math.floor(A%r)]})+t},De=function(A,e,t,r,n,B){if(A<-9999||A>9999)return Me(A,4,n.length>0);var s=Math.abs(A),o=n;if(0===s)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var i=s%10;0===i&&K(B,1)&&""!==o?o=e[i]+o:i>1||1===i&&0===a||1===i&&1===a&&K(B,2)||1===i&&1===a&&K(B,4)&&A>100||1===i&&a>1&&K(B,8)?o=e[i]+(a>0?t[a-1]:"")+o:1===i&&a>0&&(o=t[a-1]+o),s=Math.floor(s/10)}return(A<0?r:"")+o},Me=function(A,e,t){var r=t?". ":"",n=t?"、":"",B=t?", ":"";switch(e){case 0:return"•";case 1:return"◦";case 2:return"◾";case 5:var s=ve(A,48,57,!0,r);return s.length<4?"0".concat(s):s;case 4:return Ie(A,"〇一二三四五六七八九",n);case 6:return Ne(A,1,3999,pe,3,r).toLowerCase();case 7:return Ne(A,1,3999,pe,3,r);case 8:return ve(A,945,969,!1,r);case 9:return ve(A,97,122,!1,r);case 10:return ve(A,65,90,!1,r);case 11:return ve(A,1632,1641,!0,r);case 12:case 49:return Ne(A,1,9999,Ke,3,r);case 35:return Ne(A,1,9999,Ke,3,r).toLowerCase();case 13:return ve(A,2534,2543,!0,r);case 14:case 30:return ve(A,6112,6121,!0,r);case 15:return Ie(A,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return Ie(A,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return De(A,"零一二三四五六七八九","十百千萬","負",n,14);case 47:return De(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",n,15);case 42:return De(A,"零一二三四五六七八九","十百千萬","负",n,14);case 41:return De(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",n,15);case 26:return De(A,"〇一二三四五六七八九","十百千万","マイナス",n,0);case 25:return De(A,"零壱弐参四伍六七八九","拾百千万","マイナス",n,7);case 31:return De(A,"�?�일이삼사�?�육칠팔구","십백천만","마이너스",B,7);case 33:return De(A,"零一二三四五六七八九","十百千萬","마이너스",B,0);case 32:return De(A,"零壹貳參四五六七八九","拾百千","마이너스",B,7);case 18:return ve(A,2406,2415,!0,r);case 20:return Ne(A,1,19999,be,3,r);case 21:return ve(A,2790,2799,!0,r);case 22:return ve(A,2662,2671,!0,r);case 22:return Ne(A,1,10999,me,3,r);case 23:return Ie(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ie(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return ve(A,3302,3311,!0,r);case 28:return Ie(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフ�?ホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return Ie(A,"イロハニホ�?トチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return ve(A,3792,3801,!0,r);case 37:return ve(A,6160,6169,!0,r);case 38:return ve(A,4160,4169,!0,r);case 39:return ve(A,2918,2927,!0,r);case 40:return ve(A,1776,1785,!0,r);case 43:return ve(A,3046,3055,!0,r);case 44:return ve(A,3174,3183,!0,r);case 45:return ve(A,3664,3673,!0,r);case 46:return ve(A,3872,3881,!0,r);case 3:default:return ve(A,48,57,!0,r)}};function Te(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var Se=["INPUT","TEXTAREA","SELECT"],Xe=function(){function A(e,t,r,n){var B=this;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.parent=t,this.tagName=e.tagName,this.index=n,this.childNodes=[],this.listItems=[],"number"==typeof e.start&&(this.listStart=e.start);var s=e.ownerDocument.defaultView,o=s.pageXOffset,a=s.pageYOffset,i=s.getComputedStyle(e,null),c=wA(i.display),Q="radio"===e.type||"checkbox"===e.type,l=bA(i.position);if(this.style={background:Q?oe:AA(i,r),border:Q?se:aA(i),borderRadius:(e instanceof s.HTMLInputElement||e instanceof HTMLInputElement)&&Q?ue(e):cA(i),color:Q?te:new U(i.color),display:c,float:uA(i.float),font:UA(i),letterSpacing:gA(i.letterSpacing),listStyle:c===QA.LIST_ITEM?hA(i):null,lineBreak:FA(i.lineBreak),margin:fA(i),opacity:parseFloat(i.opacity),overflow:-1===Se.indexOf(e.tagName)?pA(i.overflow):EA.HIDDEN,overflowWrap:KA(i.overflowWrap?i.overflowWrap:i.wordWrap),padding:G(i),position:l,textDecoration:h(i),textShadow:yA(i.textShadow),textTransform:vA(i.textTransform),transform:MA(i),visibility:XA(i.visibility),wordBreak:zA(i.wordBreak),zIndex:LA(l!==mA.STATIC?i.zIndex:"auto")},this.isTransformed()&&(e.style.transform="matrix(1,0,0,1,0,0)"),c===QA.LIST_ITEM){var w=fe(this);if(w){var u=w.listItems.length;w.listItems.push(this),this.listIndex=e.hasAttribute("value")&&"number"==typeof e.value?e.value:0===u?"number"==typeof w.listStart?w.listStart:1:w.listItems[u-1].listIndex+1}}"IMG"===e.tagName&&e.addEventListener("load",function(){B.bounds=O(e,o,a),B.curvedBounds=J(B.bounds,B.style.border,B.style.borderRadius)}),this.image=ze(e,r),this.bounds=Q?Ce(O(e,o,a)):O(e,o,a),this.curvedBounds=J(this.bounds,this.style.border,this.style.borderRadius)}return function(A,e,t){e&&Te(A.prototype,e)}(A,[{key:"getClipPaths",value:function(){var A=this.parent?this.parent.getClipPaths():[];return this.style.overflow!==EA.VISIBLE?A.concat([k(this.curvedBounds)]):A}},{key:"isInFlow",value:function(){return this.isRootElement()&&!this.isFloating()&&!this.isAbsolutelyPositioned()}},{key:"isVisible",value:function(){return!K(this.style.display,QA.NONE)&&this.style.opacity>0&&0===this.style.visibility}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==mA.STATIC&&this.style.position!==mA.RELATIVE}},{key:"isPositioned",value:function(){return this.style.position!==mA.STATIC}},{key:"isFloating",value:function(){return 0!==this.style.float}},{key:"isRootElement",value:function(){return null===this.parent}},{key:"isTransformed",value:function(){return null!==this.style.transform}},{key:"isPositionedWithZIndex",value:function(){return this.isPositioned()&&!this.style.zIndex.auto}},{key:"isInlineLevel",value:function(){return K(this.style.display,QA.INLINE)||K(this.style.display,QA.INLINE_BLOCK)||K(this.style.display,QA.INLINE_FLEX)||K(this.style.display,QA.INLINE_GRID)||K(this.style.display,QA.INLINE_LIST_ITEM)||K(this.style.display,QA.INLINE_TABLE)}},{key:"isInlineBlockOrInlineTable",value:function(){return K(this.style.display,QA.INLINE_BLOCK)||K(this.style.display,QA.INLINE_TABLE)}}]),A}(),ze=function(A,e){if(A instanceof A.ownerDocument.defaultView.SVGSVGElement||A instanceof SVGSVGElement){var t=new XMLSerializer;return e.loadImage("data:image/svg+xml,".concat(encodeURIComponent(t.serializeToString(A))))}switch(A.tagName){case"IMG":var r=A;return e.loadImage(r.currentSrc||r.src);case"CANVAS":var n=A;return e.loadCanvas(n);case"IFRAME":var B=A.getAttribute("data-html2canvas-internal-iframe-key");if(B)return B}return null};function Le(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var Oe=function(){function A(e,t,r){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.container=e,this.parent=t,this.contexts=[],this.children=[],this.treatAsRealStackingContext=r}return function(A,e,t){e&&Le(A.prototype,e)}(A,[{key:"getOpacity",value:function(){return this.parent?this.container.style.opacity*this.parent.getOpacity():this.container.style.opacity}},{key:"getRealParentStackingContext",value:function(){return!this.parent||this.treatAsRealStackingContext?this:this.parent.getRealParentStackingContext()}}]),A}(),xe=["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"],Ve=function(A,e){return A.isRootElement()||A.isPositionedWithZIndex()||A.style.opacity<1||A.isTransformed()||Je(A,e)},ke=function(A){return A.isPositioned()||A.isFloating()},Je=function(A,e){return"BODY"===e.nodeName&&A.parent instanceof Xe&&A.parent.style.background.backgroundColor.isTransparent()};function Re(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var _e=function(){function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._data={},this._document=e}return function(A,e,t){e&&Re(A.prototype,e)}(A,[{key:"_parseMetrics",value:function(A){var e=this._document.createElement("div"),t=this._document.createElement("img"),r=this._document.createElement("span"),n=this._document.body;if(!n)throw new Error("");e.style.visibility="hidden",e.style.fontFamily=A.fontFamily,e.style.fontSize=A.fontSize,e.style.margin="0",e.style.padding="0",n.appendChild(e),t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",t.width=1,t.height=1,t.style.margin="0",t.style.padding="0",t.style.verticalAlign="baseline",r.style.fontFamily=A.fontFamily,r.style.fontSize=A.fontSize,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode("Hidden Text")),e.appendChild(r),e.appendChild(t);var B=t.offsetTop-r.offsetTop+2;e.removeChild(r),e.appendChild(this._document.createTextNode("Hidden Text")),e.style.lineHeight="normal",t.style.verticalAlign="super";var s=t.offsetTop-e.offsetTop+2;return n.removeChild(e),{baseline:B,middle:s}}},{key:"getMetrics",value:function(A){var e="".concat(A.fontFamily," ").concat(A.fontSize);return void 0===this._data[e]&&(this._data[e]=this._parseMetrics(A)),this._data[e]}}]),A}(),Pe=/([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;function Ge(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}var We=/^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i,Ye=/^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i,qe=/(px)|%|( 0)$/i,je=/^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i,Ze=/^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i,$e={left:new v("0%"),top:new v("0%"),center:new v("50%"),right:new v("100%"),bottom:new v("100%")},At=function(A,e,t){for(var r=[],n=e;n<A.length;n++){var B=A[n],s=qe.test(B),o=B.lastIndexOf(" "),a=new U(s?B.substring(0,o):B),i=s?new v(B.substring(o+1)):n===e?new v("0%"):n===A.length-1?new v("100%"):null;r.push({color:a,stop:i})}for(var c=r.map(function(A){var e=A.color,r=A.stop;return{color:e,stop:0===t?0:r?r.getAbsoluteValue(t)/t:null}}),Q=c[0].stop,l=0;l<c.length;l++)if(null!==Q){var w=c[l].stop;if(null===w){for(var u=l;null===c[u].stop;)u++;for(var g=u-l+1,F=(c[u].stop-Q)/g;l<u;l++)Q=c[l].stop=Q+F}else Q=w}return c},et=function(A,e,t){var r=function(A){var e=A.match(Pe);if(e){var t=parseFloat(e[1]);switch(e[2].toLowerCase()){case"deg":return Math.PI*t/180;case"grad":return Math.PI/200*t;case"rad":return t;case"turn":return 2*Math.PI*t}}return null}(A[0]),n=We.test(A[0]),B=n||null!==r||Ye.test(A[0]),s=B?null!==r?rt(t?r-.5*Math.PI:r,e):n?Bt(A[0],e):st(A[0],e):rt(Math.PI,e),o=B?1:0,a=Math.min(m(Math.abs(s.x0)+Math.abs(s.x1),Math.abs(s.y0)+Math.abs(s.y1)),2*e.width,2*e.height);return new function A(e,t){Ge(this,A),this.type=0,this.colorStops=e,this.direction=t}(At(A,o,a),s)},tt=function(A,e,t){var r=e[0].match(Ze),n=r&&("circle"===r[1]||void 0!==r[3]&&void 0===r[5])?0:1,B={},s={};r&&(void 0!==r[3]&&(B.x=I(A,r[3],r[4]).getAbsoluteValue(t.width)),void 0!==r[5]&&(B.y=I(A,r[5],r[6]).getAbsoluteValue(t.height)),r[7]?s.x=$e[r[7].toLowerCase()]:void 0!==r[8]&&(s.x=I(A,r[8],r[9])),r[10]?s.y=$e[r[10].toLowerCase()]:void 0!==r[11]&&(s.y=I(A,r[11],r[12])));var o={x:void 0===s.x?t.width/2:s.x.getAbsoluteValue(t.width),y:void 0===s.y?t.height/2:s.y.getAbsoluteValue(t.height)},a=at(r&&r[2]||"farthest-corner",n,o,B,t);return new function A(e,t,r,n){Ge(this,A),this.type=1,this.colorStops=e,this.shape=t,this.center=r,this.radius=n}(At(e,r?1:0,Math.min(a.x,a.y)),n,o,a)},rt=function(A,e){var t=e.width,r=e.height,n=.5*t,B=.5*r,s=(Math.abs(t*Math.sin(A))+Math.abs(r*Math.cos(A)))/2,o=n+Math.sin(A)*s,a=B-Math.cos(A)*s;return{x0:o,x1:t-o,y0:a,y1:r-a}},nt=function(A){return Math.acos(A.width/2/(m(A.width,A.height)/2))},Bt=function(A,e){switch(A){case"bottom":case"to top":return rt(0,e);case"left":case"to right":return rt(Math.PI/2,e);case"right":case"to left":return rt(3*Math.PI/2,e);case"top right":case"right top":case"to bottom left":case"to left bottom":return rt(Math.PI+nt(e),e);case"top left":case"left top":case"to bottom right":case"to right bottom":return rt(Math.PI-nt(e),e);case"bottom left":case"left bottom":case"to top right":case"to right top":return rt(nt(e),e);case"bottom right":case"right bottom":case"to top left":case"to left top":return rt(2*Math.PI-nt(e),e);case"top":case"to bottom":default:return rt(Math.PI,e)}},st=function(A,e){var t=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(A.split(" ").map(parseFloat),2),r=t[0],n=t[1],B=r/100*e.width/(n/100*e.height);return rt(Math.atan(isNaN(B)?1:B)+Math.PI/2,e)},ot=function(A,e,t,r){return[{x:0,y:0},{x:0,y:A.height},{x:A.width,y:0},{x:A.width,y:A.height}].reduce(function(A,n){var B=m(e-n.x,t-n.y);return(r?B<A.optimumDistance:B>A.optimumDistance)?{optimumCorner:n,optimumDistance:B}:A},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},at=function(A,e,t,r,n){var B=t.x,s=t.y,o=0,a=0;switch(A){case"closest-side":0===e?o=a=Math.min(Math.abs(B),Math.abs(B-n.width),Math.abs(s),Math.abs(s-n.height)):1===e&&(o=Math.min(Math.abs(B),Math.abs(B-n.width)),a=Math.min(Math.abs(s),Math.abs(s-n.height)));break;case"closest-corner":if(0===e)o=a=Math.min(m(B,s),m(B,s-n.height),m(B-n.width,s),m(B-n.width,s-n.height));else if(1===e){var i=Math.min(Math.abs(s),Math.abs(s-n.height))/Math.min(Math.abs(B),Math.abs(B-n.width)),c=ot(n,B,s,!0);a=i*(o=m(c.x-B,(c.y-s)/i))}break;case"farthest-side":0===e?o=a=Math.max(Math.abs(B),Math.abs(B-n.width),Math.abs(s),Math.abs(s-n.height)):1===e&&(o=Math.max(Math.abs(B),Math.abs(B-n.width)),a=Math.max(Math.abs(s),Math.abs(s-n.height)));break;case"farthest-corner":if(0===e)o=a=Math.max(m(B,s),m(B,s-n.height),m(B-n.width,s),m(B-n.width,s-n.height));else if(1===e){var Q=Math.max(Math.abs(s),Math.abs(s-n.height))/Math.max(Math.abs(B),Math.abs(B-n.width)),l=ot(n,B,s,!1);a=Q*(o=m(l.x-B,(l.y-s)/Q))}break;default:o=r.x||0,a=void 0!==r.y?r.y:o}return{x:o,y:a}},it=function(A){var e="",t="",r="",n="",B=0,s=/^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i,o=/^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i,a=A[B].match(s);a&&B++;var i=A[B].match(/^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i);i&&(e=i[1]||"","contain"===(r=i[2]||"")?r="closest-side":"cover"===r&&(r="farthest-corner"),B++);var c=A[B].match(o);c&&B++;var Q=A[B].match(s);Q&&B++;var l=A[B].match(o);l&&B++;var w=Q||a;w&&w[1]&&(n=w[1]+(/^\d+$/.test(w[1])?"px":""),w[2]&&(n+=" "+w[2]+(/^\d+$/.test(w[2])?"px":"")));var u=l||c;return u&&(t=u[0],u[1]||(t+="px")),!n||e||t||r||(t=n,n=""),n&&(n="at ".concat(n)),[[e,r,t,n].filter(function(A){return!!A}).join(" ")].concat(A.slice(B))},ct=function(A){return A.map(function(A){return A.match(je)}).map(function(e,t){if(!e)return A[t];switch(e[1]){case"from":return"".concat(e[4]," 0%");case"to":return"".concat(e[4]," 100%");case"color-stop":return"%"===e[3]?"".concat(e[4]," ").concat(e[2]):"".concat(e[4]," ").concat(100*parseFloat(e[2]),"%")}})};function Qt(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function lt(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var wt=function(){function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.target=e,this.options=t,e.render(t)}return function(A,e,t){e&&lt(A.prototype,e)}(A,[{key:"renderNode",value:function(A){A.isVisible()&&(this.renderNodeBackgroundAndBorders(A),this.renderNodeContent(A))}},{key:"renderNodeContent",value:function(A){var e=this,t=function(){if(A.childNodes.length&&A.childNodes.forEach(function(t){if(t instanceof jA){var r=t.parent.style;e.target.renderTextNode(t.bounds,r.color,r.font,r.textDecoration,r.textShadow)}else e.target.drawShape(t,A.style.color)}),A.image){var t=e.options.imageStore.get(A.image);if(t){var r=function(A,e,t){var r=e[0].value,n=e[1].value,B=e[2].value,s=e[3].value;return new L(A.left+s+t[3].borderWidth,A.top+r+t[0].borderWidth,A.width-(t[1].borderWidth+t[3].borderWidth+s+n),A.height-(t[0].borderWidth+t[2].borderWidth+r+B))}(A.bounds,A.style.padding,A.style.border),n="number"==typeof t.width&&t.width>0?t.width:r.width,B="number"==typeof t.height&&t.height>0?t.height:r.height;n>0&&B>0&&e.target.clip([k(A.curvedBounds)],function(){e.target.drawImage(t,new L(0,0,n,B),r)})}}},r=A.getClipPaths();r.length?this.target.clip(r,t):t()}},{key:"renderNodeBackgroundAndBorders",value:function(A){var e=this,t=!A.style.background.backgroundColor.isTransparent()||A.style.background.backgroundImage.length,r=A.style.border.some(function(A){return 0!==A.borderStyle&&!A.borderColor.isTransparent()}),n=function(){var r=function(A,e){switch(e){case W.BORDER_BOX:return function(A){return[A.topLeftOuter,A.topRightOuter,A.bottomRightOuter,A.bottomLeftOuter]}(A);case W.PADDING_BOX:default:return k(A)}}(A.curvedBounds,A.style.background.backgroundClip);t&&e.target.clip([r],function(){A.style.background.backgroundColor.isTransparent()||e.target.fill(A.style.background.backgroundColor),e.renderBackgroundImage(A)}),A.style.border.forEach(function(t,r){0===t.borderStyle||t.borderColor.isTransparent()||e.renderBorder(t,r,A.curvedBounds)})};if(t||r){var B=A.parent?A.parent.getClipPaths():[];B.length?this.target.clip(B,n):n()}}},{key:"renderBackgroundImage",value:function(A){var e=this;A.style.background.backgroundImage.slice(0).reverse().forEach(function(t){"url"===t.source.method&&t.source.args.length?e.renderBackgroundRepeat(A,t):/gradient/i.test(t.source.method)&&e.renderBackgroundGradient(A,t)})}},{key:"renderBackgroundRepeat",value:function(A,e){var t=this.options.imageStore.get(e.source.args[0]);if(t){var r=Z(A.style.background.backgroundOrigin,A.bounds,A.style.padding,A.style.border),n=function(A,e,t){var r=0,n=0,B=A.size;if(1===B[0].size||2===B[0].size){var s=t.width/t.height,o=e.width/e.height;return s<o!=(2===B[0].size)?new D(t.width,t.width/o):new D(t.height*o,t.height)}return B[0].value&&(r=B[0].value.getAbsoluteValue(t.width)),0===B[0].size&&0===B[1].size?n=e.height:0===B[1].size?n=r/e.width*e.height:B[1].value&&(n=B[1].value.getAbsoluteValue(t.height)),0===B[0].size&&(r=n/e.height*e.width),new D(r,n)}(e,t,r),B=$(e.position,n,r),s=function(A,e,t,r,n){switch(A.repeat){case 2:return[new M(Math.round(n.left),Math.round(r.top+e.y)),new M(Math.round(n.left+n.width),Math.round(r.top+e.y)),new M(Math.round(n.left+n.width),Math.round(t.height+r.top+e.y)),new M(Math.round(n.left),Math.round(t.height+r.top+e.y))];case 3:return[new M(Math.round(r.left+e.x),Math.round(n.top)),new M(Math.round(r.left+e.x+t.width),Math.round(n.top)),new M(Math.round(r.left+e.x+t.width),Math.round(n.height+n.top)),new M(Math.round(r.left+e.x),Math.round(n.height+n.top))];case 1:return[new M(Math.round(r.left+e.x),Math.round(r.top+e.y)),new M(Math.round(r.left+e.x+t.width),Math.round(r.top+e.y)),new M(Math.round(r.left+e.x+t.width),Math.round(r.top+e.y+t.height)),new M(Math.round(r.left+e.x),Math.round(r.top+e.y+t.height))];default:return[new M(Math.round(n.left),Math.round(n.top)),new M(Math.round(n.left+n.width),Math.round(n.top)),new M(Math.round(n.left+n.width),Math.round(n.height+n.top)),new M(Math.round(n.left),Math.round(n.height+n.top))]}}(e,B,n,r,A.bounds),o=Math.round(r.left+B.x),a=Math.round(r.top+B.y);this.target.renderRepeat(s,t,n,o,a)}}},{key:"renderBackgroundGradient",value:function(A,e){var t=Z(A.style.background.backgroundOrigin,A.bounds,A.style.padding,A.style.border),r=function(A,e){var t=A.size,r=t[0].value?t[0].value.getAbsoluteValue(e.width):e.width,n=t[1].value?t[1].value.getAbsoluteValue(e.height):t[0].value?r:e.height;return new D(r,n)}(e,t),n=$(e.position,r,t),B=new L(Math.round(t.left+n.x),Math.round(t.top+n.y),r.width,r.height),s=function(A,e,t){var r=e.args,n=e.method,B=e.prefix;return"linear-gradient"===n?et(r,t,!!B):"gradient"===n&&"linear"===r[0]?et(["to bottom"].concat(ct(r.slice(3))),t,!!B):"radial-gradient"===n?tt(A,"-webkit-"===B?it(r):r,t):"gradient"===n&&"radial"===r[0]?tt(A,ct(it(r.slice(1))),t):void 0}(A,e.source,B);if(s)switch(s.type){case 0:this.target.renderLinearGradient(B,s);break;case 1:this.target.renderRadialGradient(B,s)}}},{key:"renderBorder",value:function(A,e,t){this.target.drawShape(function(A,e){switch(e){case 0:return V(A.topLeftOuter,A.topLeftInner,A.topRightOuter,A.topRightInner);case 1:return V(A.topRightOuter,A.topRightInner,A.bottomRightOuter,A.bottomRightInner);case 2:return V(A.bottomRightOuter,A.bottomRightInner,A.bottomLeftOuter,A.bottomLeftInner);case 3:default:return V(A.bottomLeftOuter,A.bottomLeftInner,A.topLeftOuter,A.topLeftInner)}}(t,e),A.borderColor)}},{key:"renderStack",value:function(A){var e=this;if(A.container.isVisible()){var t=A.getOpacity();t!==this._opacity&&(this.target.setOpacity(A.getOpacity()),this._opacity=t);var r=A.container.style.transform;null!==r?this.target.transform(A.container.bounds.left+r.transformOrigin[0].value,A.container.bounds.top+r.transformOrigin[1].value,r.transform,function(){return e.renderStackContent(A)}):this.renderStackContent(A)}}},{key:"renderStackContent",value:function(A){var e=Qt(Ut(A),5),t=e[0],r=e[1],n=e[2],B=e[3],s=e[4],o=Qt(ut(A),2),a=o[0],i=o[1];this.renderNodeBackgroundAndBorders(A.container),t.sort(gt).forEach(this.renderStack,this),this.renderNodeContent(A.container),i.forEach(this.renderNode,this),B.forEach(this.renderStack,this),s.forEach(this.renderStack,this),a.forEach(this.renderNode,this),r.forEach(this.renderStack,this),n.sort(gt).forEach(this.renderStack,this)}},{key:"render",value:function(A){return this.options.backgroundColor&&this.target.rectangle(this.options.x,this.options.y,this.options.width,this.options.height,this.options.backgroundColor),this.renderStack(A),this.target.getTarget()}}]),A}(),ut=function(A){for(var e=[],t=[],r=A.children.length,n=0;n<r;n++){var B=A.children[n];B.isInlineLevel()?e.push(B):t.push(B)}return[e,t]},Ut=function(A){for(var e=[],t=[],r=[],n=[],B=[],s=A.contexts.length,o=0;o<s;o++){var a=A.contexts[o];a.container.isPositioned()||a.container.style.opacity<1||a.container.isTransformed()?a.container.style.zIndex.order<0?e.push(a):a.container.style.zIndex.order>0?r.push(a):t.push(a):a.container.isFloating()?n.push(a):B.push(a)}return[e,t,r,n,B]},gt=function(A,e){return A.container.style.zIndex.order>e.container.style.zIndex.order?1:A.container.style.zIndex.order<e.container.style.zIndex.order?-1:A.container.index>e.container.index?1:-1},Ft=function(A,e){if(!e.proxy)return Promise.reject(null);var t=e.proxy;return new Promise(function(r,n){var B=_A.SUPPORT_CORS_XHR&&_A.SUPPORT_RESPONSE_TYPE?"blob":"text",s=_A.SUPPORT_CORS_XHR?new XMLHttpRequest:new XDomainRequest;if(s.onload=function(){if(s instanceof XMLHttpRequest)if(200===s.status)if("text"===B)r(s.response);else{var A=new FileReader;A.addEventListener("load",function(){return r(A.result)},!1),A.addEventListener("error",function(A){return n(A)},!1),A.readAsDataURL(s.response)}else n("");else r(s.responseText)},s.onerror=n,s.open("GET","".concat(t,"?url=").concat(encodeURIComponent(A),"&responseType=").concat(B)),"text"!==B&&s instanceof XMLHttpRequest&&(s.responseType=B),e.imageTimeout){var o=e.imageTimeout;s.timeout=o,s.ontimeout=function(){return n("")}}s.send()})};function Ct(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}function dt(A,e,t){return e&&ht(A.prototype,e),t&&ht(A,t),A}var Ht=function(){function A(e,t,r){Ct(this,A),this.options=e,this._window=r,this.origin=this.getOrigin(r.location.href),this.cache={},this.logger=t,this._index=0}return dt(A,[{key:"loadImage",value:function(A){var e=this;if(this.hasResourceInCache(A))return A;if(Nt(A))return this.cache[A]=vt(A,this.options.imageTimeout||0),A;if(!yt(A)||_A.SUPPORT_SVG_DRAWING){if(!0===this.options.allowTaint||mt(A)||this.isSameOrigin(A))return this.addImage(A,A,!1);if(!this.isSameOrigin(A)){if("string"==typeof this.options.proxy)return this.cache[A]=Ft(A,this.options).then(function(A){return vt(A,e.options.imageTimeout||0)}),A;if(!0===this.options.useCORS&&_A.SUPPORT_CORS_IMAGES)return this.addImage(A,A,!0)}}}},{key:"inlineImage",value:function(A){var e=this;return mt(A)?vt(A,this.options.imageTimeout||0):this.hasResourceInCache(A)?this.cache[A]:this.isSameOrigin(A)||"string"!=typeof this.options.proxy?this.xhrImage(A):this.cache[A]=Ft(A,this.options).then(function(A){return vt(A,e.options.imageTimeout||0)})}},{key:"xhrImage",value:function(A){var e=this;return this.cache[A]=new Promise(function(t,r){var n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200!==n.status)r("Failed to fetch image ".concat(A.substring(0,256)," with status code ").concat(n.status));else{var e=new FileReader;e.addEventListener("load",function(){var A=e.result;t(A)},!1),e.addEventListener("error",function(A){return r(A)},!1),e.readAsDataURL(n.response)}},n.responseType="blob",e.options.imageTimeout){var B=e.options.imageTimeout;n.timeout=B,n.ontimeout=function(){return r("")}}n.open("GET",A,!0),n.send()}).then(function(A){return vt(A,e.options.imageTimeout||0)}),this.cache[A]}},{key:"loadCanvas",value:function(A){var e=String(this._index++);return this.cache[e]=Promise.resolve(A),e}},{key:"hasResourceInCache",value:function(A){return void 0!==this.cache[A]}},{key:"addImage",value:function(A,e,t){var r=this;return this.cache[A]=new Promise(function(A,n){var B=new Image;if(B.onload=function(){return A(B)},(bt(e)||t)&&(B.crossOrigin="anonymous"),B.onerror=n,B.src=e,!0===B.complete&&setTimeout(function(){A(B)},500),r.options.imageTimeout){var s=r.options.imageTimeout;setTimeout(function(){return n("")},s)}}),A}},{key:"isSameOrigin",value:function(A){return this.getOrigin(A)===this.origin}},{key:"getOrigin",value:function(A){var e=this._link||(this._link=this._window.document.createElement("a"));return e.href=A,e.href=e.href,e.protocol+e.hostname+e.port}},{key:"ready",value:function(){var A=this,e=Object.keys(this.cache),t=e.map(function(e){return A.cache[e].catch(function(A){return null})});return Promise.all(t).then(function(A){return new ft(e,A)})}}]),A}(),ft=function(){function A(e,t){Ct(this,A),this._keys=e,this._resources=t}return dt(A,[{key:"get",value:function(A){var e=this._keys.indexOf(A);return-1===e?null:this._resources[e]}}]),A}(),Et=/^data:image\/svg\+xml/i,pt=/^data:image\/.*;base64,/i,Kt=/^data:image\/.*/i,mt=function(A){return Kt.test(A)},bt=function(A){return pt.test(A)},Nt=function(A){return"blob"===A.substr(0,4)},yt=function(A){return"svg"===A.substr(-3).toLowerCase()||Et.test(A)},vt=function(A,e){return new Promise(function(t,r){var n=new Image;n.onload=function(){return t(n)},n.onerror=r,n.src=A,!0===n.complete&&setTimeout(function(){t(n)},500),e&&setTimeout(function(){return r("")},e)})};function It(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Dt=function(A,e,t){if(!e||!e.content||"none"===e.content||"-moz-alt-content"===e.content||"none"===e.display)return null;var r=Mt(e.content),n=r.length,B=[],s="",o=e.counterIncrement;if(o&&"none"!==o){var a=It(o.split(/\s+/),2),i=a[0],c=a[1],Q=t.counters[i];Q&&(Q[Q.length-1]+=void 0===c?1:parseInt(c,10))}for(var l=0;l<n;l++){var w=r[l];switch(w.type){case 0:s+=w.value||"";break;case 1:A instanceof HTMLElement&&w.value&&(s+=A.getAttribute(w.value)||"");break;case 3:var u=t.counters[w.name||""];u&&(s+=Xt([u[u.length-1]],"",w.format));break;case 4:var U=t.counters[w.name||""];U&&(s+=Xt(U,w.glue,w.format));break;case 5:s+=St(e,!0,t.quoteDepth),t.quoteDepth++;break;case 6:t.quoteDepth--,s+=St(e,!1,t.quoteDepth);break;case 2:s&&(B.push({type:0,value:s}),s=""),B.push({type:1,value:w.value||""})}}return s&&B.push({type:0,value:s}),B},Mt=function(A,e){if(e&&e[A])return e[A];for(var t=[],r=A.length,n=!1,B=!1,s=!1,o="",a="",i=[],c=0;c<r;c++){var Q=A.charAt(c);switch(Q){case"'":case'"':B?o+=Q:(n=!n,s||n||(t.push({type:0,value:o}),o=""));break;case"\\":B?(o+=Q,B=!1):B=!0;break;case"(":n?o+=Q:(s=!0,a=o,o="",i=[]);break;case")":if(n)o+=Q;else if(s){switch(o&&i.push(o),a){case"attr":i.length>0&&t.push({type:1,value:i[0]});break;case"counter":if(i.length>0){var l={type:3,name:i[0]};i.length>1&&(l.format=i[1]),t.push(l)}break;case"counters":if(i.length>0){var w={type:4,name:i[0]};i.length>1&&(w.glue=i[1]),i.length>2&&(w.format=i[2]),t.push(w)}break;case"url":i.length>0&&t.push({type:2,value:i[0]})}s=!1,o=""}break;case",":n?o+=Q:s&&(i.push(o),o="");break;case" ":case"\t":n?o+=Q:o&&(Tt(t,o),o="");break;default:o+=Q}"\\"!==Q&&(B=!1)}return o&&Tt(t,o),e&&(e[A]=t),t},Tt=function(A,e){switch(e){case"open-quote":A.push({type:5});break;case"close-quote":A.push({type:6})}},St=function(A,e,t){var r=A.quotes?A.quotes.split(/\s+/):["'\"'","'\"'"],n=2*t;return n>=r.length&&(n=r.length-2),e||++n,r[n].replace(/^["']|["']$/g,"")},Xt=function(A,e,t){for(var r=A.length,n="",B=0;B<r;B++)B>0&&(n+=e||""),n+=Me(A[B],CA(t||"decimal"),!1);return n};function zt(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}var Lt=function(){function A(e,t,r,n,B){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.referenceElement=e,this.scrolledElements=[],this.copyStyles=n,this.inlineImages=n,this.logger=r,this.options=t,this.renderer=B,this.resourceLoader=new Ht(t,r,window),this.pseudoContentData={counters:{},quoteDepth:0},this.documentElement=this.cloneNode(e.ownerDocument.documentElement)}return function(A,e,t){e&&zt(A.prototype,e)}(A,[{key:"inlineAllImages",value:function(A){var e=this;if(this.inlineImages&&A){var t=A.style;Promise.all(sA(t.backgroundImage).map(function(A){return"url"===A.method?e.resourceLoader.inlineImage(A.args[0]).then(function(A){return A&&"string"==typeof A.src?'url("'.concat(A.src,'")'):"none"}).catch(function(A){}):Promise.resolve("".concat(A.prefix).concat(A.method,"(").concat(A.args.join(","),")"))})).then(function(A){A.length>1&&(t.backgroundColor=""),t.backgroundImage=A.join(",")}),A instanceof HTMLImageElement&&this.resourceLoader.inlineImage(A.src).then(function(e){if(e&&A instanceof HTMLImageElement&&A.parentNode){var t=A.parentNode,r=b(A.style,e.cloneNode(!1));t.replaceChild(r,A)}}).catch(function(A){})}}},{key:"inlineFonts",value:function(A){var e=this;return Promise.all(Array.from(A.styleSheets).map(function(e){return e.href?fetch(e.href).then(function(A){return A.text()}).then(function(A){return xt(A,e.href)}).catch(function(A){return[]}):Ot(e,A)})).then(function(A){return A.reduce(function(A,e){return A.concat(e)},[])}).then(function(A){return Promise.all(A.map(function(A){return fetch(A.formats[0].src).then(function(A){return A.blob()}).then(function(A){return new Promise(function(e,t){var r=new FileReader;r.onerror=t,r.onload=function(){var A=r.result;e(A)},r.readAsDataURL(A)})}).then(function(e){return A.fontFace.setProperty("src",'url("'.concat(e,'")')),"@font-face {".concat(A.fontFace.cssText," ")})}))}).then(function(t){var r=A.createElement("style");r.textContent=t.join("\n"),e.documentElement.appendChild(r)})}},{key:"createElementClone",value:function(A){var e=this;if(this.copyStyles&&A instanceof HTMLCanvasElement){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(A){}}if(A instanceof HTMLIFrameElement){var r=A.cloneNode(!1),n=qt();r.setAttribute("data-html2canvas-internal-iframe-key",n);var B=O(A,0,0),s=B.width,o=B.height;return this.resourceLoader.cache[n]=Zt(A,this.options).then(function(A){return e.renderer(A,{allowTaint:e.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:e.options.imageTimeout,logging:e.options.logging,proxy:e.options.proxy,removeContainer:e.options.removeContainer,scale:e.options.scale,foreignObjectRendering:e.options.foreignObjectRendering,useCORS:e.options.useCORS,target:new f,width:s,height:o,x:0,y:0,windowWidth:A.ownerDocument.defaultView.innerWidth,windowHeight:A.ownerDocument.defaultView.innerHeight,scrollX:A.ownerDocument.defaultView.pageXOffset,scrollY:A.ownerDocument.defaultView.pageYOffset},e.logger.child(n))}).then(function(e){return new Promise(function(t,n){var B=document.createElement("img");B.onload=function(){return t(e)},B.onerror=function(A){"data:,"==B.src?t(e):n(A)},B.src=e.toDataURL(),r.parentNode&&r.parentNode.replaceChild(b(A.ownerDocument.defaultView.getComputedStyle(A),B),r)})}),r}try{if(A instanceof HTMLStyleElement&&A.sheet&&A.sheet.cssRules){var a=[].slice.call(A.sheet.cssRules,0).reduce(function(A,e){return e&&e.cssText?A+e.cssText:A},""),i=A.cloneNode(!1);return i.textContent=a,i}}catch(A){if(this.logger.log("Unable to access cssRules property"),"SecurityError"!==A.name)throw this.logger.log(A),A}return A.cloneNode(!1)}},{key:"cloneNode",value:function(A){var e=A.nodeType===Node.TEXT_NODE?document.createTextNode(A.nodeValue):this.createElementClone(A),t=A.ownerDocument.defaultView,r=A instanceof t.HTMLElement?t.getComputedStyle(A):null,n=A instanceof t.HTMLElement?t.getComputedStyle(A,":before"):null,B=A instanceof t.HTMLElement?t.getComputedStyle(A,":after"):null;this.referenceElement===A&&e instanceof t.HTMLElement&&(this.clonedReferenceElement=e),e instanceof t.HTMLBodyElement&&Gt(e);for(var s=function(A,e){if(!A||!A.counterReset||"none"===A.counterReset)return[];for(var t=[],r=A.counterReset.split(/\s*,\s*/),n=r.length,B=0;B<n;B++){var s=It(r[B].split(/\s+/),2),o=s[0],a=s[1];t.push(o);var i=e.counters[o];i||(i=e.counters[o]=[]),i.push(parseInt(a||0,10))}return t}(r,this.pseudoContentData),o=Dt(A,n,this.pseudoContentData),a=A.firstChild;a;a=a.nextSibling)a.nodeType===Node.ELEMENT_NODE&&("SCRIPT"===a.nodeName||a.hasAttribute("data-html2canvas-ignore")||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(a))||this.copyStyles&&"STYLE"===a.nodeName||e.appendChild(this.cloneNode(a));var i=Dt(A,B,this.pseudoContentData);if(function(A,e){for(var t=A.length,r=0;r<t;r++)e.counters[A[r]].pop()}(s,this.pseudoContentData),A instanceof t.HTMLElement&&e instanceof t.HTMLElement)switch(n&&this.inlineAllImages(kt(A,e,n,o,Jt)),B&&this.inlineAllImages(kt(A,e,B,i,Rt)),!r||!this.copyStyles||A instanceof HTMLIFrameElement||b(r,e),this.inlineAllImages(e),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([e,A.scrollLeft,A.scrollTop]),A.nodeName){case"CANVAS":this.copyStyles||Vt(A,e);break;case"TEXTAREA":case"SELECT":e.value=A.value}return e}}]),A}(),Ot=function(A,e){return(A.cssRules?Array.from(A.cssRules):[]).filter(function(A){return A.type===CSSRule.FONT_FACE_RULE}).map(function(A){for(var t=sA(A.style.getPropertyValue("src")),r=[],n=0;n<t.length;n++)if("url"===t[n].method&&t[n+1]&&"format"===t[n+1].method){var B=e.createElement("a");B.href=t[n].args[0],e.body&&e.body.appendChild(B);var s={src:B.href,format:t[n+1].args[0]};r.push(s)}return{formats:r.filter(function(A){return/^woff/i.test(A.format)}),fontFace:A.style}}).filter(function(A){return A.formats.length})},xt=function(A,e){var t=document.implementation.createHTMLDocument(""),r=document.createElement("base");r.href=e;var n=document.createElement("style");return n.textContent=A,t.head&&t.head.appendChild(r),t.body&&t.body.appendChild(n),n.sheet?Ot(n.sheet,t):[]},Vt=function(A,e){try{if(e){e.width=A.width,e.height=A.height;var t=A.getContext("2d"),r=e.getContext("2d");t?r.putImageData(t.getImageData(0,0,A.width,A.height),0,0):r.drawImage(A,0,0)}}catch(A){}},kt=function(A,e,t,r,n){if(t&&t.content&&"none"!==t.content&&"-moz-alt-content"!==t.content&&"none"!==t.display){var B=e.ownerDocument.createElement("html2canvaspseudoelement");if(b(t,B),r)for(var s=r.length,o=0;o<s;o++){var a=r[o];switch(a.type){case 1:var i=e.ownerDocument.createElement("img");i.src=sA("url(".concat(a.value,")"))[0].args[0],i.style.opacity="1",B.appendChild(i);break;case 0:B.appendChild(e.ownerDocument.createTextNode(a.value))}}return B.className="".concat(_t," ").concat(Pt),e.className+=" ".concat(n===Jt?_t:Pt),n===Jt?e.insertBefore(B,e.firstChild):e.appendChild(B),B}},Jt=":before",Rt=":after",_t="___html2canvas___pseudoelement_before",Pt="___html2canvas___pseudoelement_after",Gt=function(A){Wt(A,".".concat(_t).concat(Jt).concat('{\n    content: "" !important;\n    display: none !important;\n}',"\n         .").concat(Pt).concat(Rt).concat('{\n    content: "" !important;\n    display: none !important;\n}'))},Wt=function(A,e){var t=A.ownerDocument.createElement("style");t.innerHTML=e,A.appendChild(t)},Yt=function(A){var e=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(A,3),t=e[0],r=e[1],n=e[2];t.scrollLeft=r,t.scrollTop=n},qt=function(){return Math.ceil(Date.now()+1e7*Math.random()).toString(16)},jt=/^data:text\/(.+);(base64)?,(.*)$/i,Zt=function(A,e){try{return Promise.resolve(A.contentWindow.document.documentElement)}catch(t){return e.proxy?Ft(A.src,e).then(function(A){var e=A.match(jt);return e?"base64"===e[2]?window.atob(decodeURIComponent(e[3])):decodeURIComponent(e[3]):Promise.reject()}).then(function(e){return $t(A.ownerDocument,O(A,0,0)).then(function(A){var t=A.contentWindow.document;t.open(),t.write(e);var r=Ar(A).then(function(){return t.documentElement});return t.close(),r})}):Promise.reject()}},$t=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute("data-html2canvas-ignore","true"),A.body?(A.body.appendChild(t),Promise.resolve(t)):Promise.reject("")},Ar=function(A){var e=A.contentWindow,t=e.document;return new Promise(function(r,n){e.onload=A.onload=t.onreadystatechange=function(){var e=setInterval(function(){t.body.childNodes.length>0&&"complete"===t.readyState&&(clearInterval(e),r(A))},50)}})};var er=function A(e,t,r){var n=e.ownerDocument,B=new L(t.scrollX,t.scrollY,t.windowWidth,t.windowHeight),s=n.documentElement?new U(getComputedStyle(n.documentElement).backgroundColor):F,o=n.body?new U(getComputedStyle(n.body).backgroundColor):F,a=e===n.documentElement?s.isTransparent()?o.isTransparent()?t.backgroundColor?new U(t.backgroundColor):null:o:s:t.backgroundColor?new U(t.backgroundColor):null;return(t.foreignObjectRendering?_A.SUPPORT_FOREIGNOBJECT_DRAWING:Promise.resolve(!1)).then(function(s){return s?function(A){return A.inlineFonts(n).then(function(){return A.resourceLoader.ready()}).then(function(){var B=new xA(A.documentElement),s=n.defaultView,o=s.pageXOffset,i=s.pageYOffset,c="HTML"===e.tagName||"BODY"===e.tagName?x(n):O(e,o,i),Q=c.width,l=c.height,w=c.left,u=c.top;return B.render({backgroundColor:a,logger:r,scale:t.scale,x:"number"==typeof t.x?t.x:w,y:"number"==typeof t.y?t.y:u,width:"number"==typeof t.width?t.width:Math.ceil(Q),height:"number"==typeof t.height?t.height:Math.ceil(l),windowWidth:t.windowWidth,windowHeight:t.windowHeight,scrollX:t.scrollX,scrollY:t.scrollY})})}(new Lt(e,t,r,!0,A)):function(A,e,t,r,n,B){var s=new Lt(t,r,n,!1,B),o=A.defaultView.pageXOffset,a=A.defaultView.pageYOffset;return $t(A,e).then(function(n){var B=n.contentWindow,i=B.document,c=Ar(n).then(function(){s.scrolledElements.forEach(Yt),B.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||B.scrollY===e.top&&B.scrollX===e.left||(i.documentElement.style.top=-e.top+"px",i.documentElement.style.left=-e.left+"px",i.documentElement.style.position="absolute");var t=Promise.resolve([n,s.clonedReferenceElement,s.resourceLoader]),o=r.onclone;return s.clonedReferenceElement instanceof B.HTMLElement||s.clonedReferenceElement instanceof A.defaultView.HTMLElement||s.clonedReferenceElement instanceof HTMLElement?"function"==typeof o?Promise.resolve().then(function(){return o(i)}).then(function(){return t}):t:Promise.reject("")});return i.open(),i.write("".concat(function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'.concat(A.publicId,'"')),A.systemId&&(e+='"'.concat(A.systemId,'"')),e+=">"),e}(document.doctype),"<html></html>")),function(A,e,t){!A.defaultView||e===A.defaultView.pageXOffset&&t===A.defaultView.pageYOffset||A.defaultView.scrollTo(e,t)}(t.ownerDocument,o,a),i.replaceChild(i.adoptNode(s.documentElement),i.documentElement),i.close(),c})}(n,B,e,t,r,A).then(function(A){var e=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(A,3),B=e[0],s=e[1],o=e[2],i=function(A,e,t){var r=0,n=new Xe(A,null,e,r++),B=new Oe(n,null,!0);return function A(e,t,r,n,B){for(var s,o=e.firstChild;o;o=s){s=o.nextSibling;var a=o.ownerDocument.defaultView;if(o instanceof a.Text||o instanceof Text||a.parent&&o instanceof a.parent.Text)o.data.trim().length>0&&t.childNodes.push(jA.fromTextNode(o,t));else if(o instanceof a.HTMLElement||o instanceof HTMLElement||a.parent&&o instanceof a.parent.HTMLElement){if(-1===xe.indexOf(o.nodeName)){var i=new Xe(o,t,n,B++);if(i.isVisible()){"INPUT"===o.tagName?Ue(o,i):"TEXTAREA"===o.tagName?ge(o,i):"SELECT"===o.tagName?Fe(o,i):i.style.listStyle&&-1!==i.style.listStyle.listStyleType&&Ee(o,i,n);var c="TEXTAREA"!==o.tagName,Q=Ve(i,o);if(Q||ke(i)){var l=Q||i.isPositioned()?r.getRealParentStackingContext():r,w=new Oe(i,l,Q);l.contexts.push(w),c&&A(o,i,w,n,B)}else r.children.push(i),c&&A(o,i,r,n,B)}}}else if(o instanceof a.SVGSVGElement||o instanceof SVGSVGElement||a.parent&&o instanceof a.parent.SVGSVGElement){var u=new Xe(o,t,n,B++),U=Ve(u,o);if(U||ke(u)){var g=U||u.isPositioned()?r.getRealParentStackingContext():r,F=new Oe(u,g,U);g.contexts.push(F)}else r.children.push(u)}}}(A,n,B,e,1),B}(s,o),c=s.ownerDocument;return a===i.container.style.background.backgroundColor&&(i.container.style.background.backgroundColor=F),o.ready().then(function(A){var e=new _e(c),o=c.defaultView,Q=o.pageXOffset,l=o.pageYOffset,w="HTML"===s.tagName||"BODY"===s.tagName?x(n):O(s,Q,l),u=w.width,U=w.height,g=w.left,F=w.top,C={backgroundColor:a,fontMetrics:e,imageStore:A,logger:r,scale:t.scale,x:"number"==typeof t.x?t.x:g,y:"number"==typeof t.y?t.y:F,width:"number"==typeof t.width?t.width:Math.ceil(u),height:"number"==typeof t.height?t.height:Math.ceil(U)};if(Array.isArray(t.target))return Promise.all(t.target.map(function(A){return new wt(A,C).render(i)}));var h=new wt(t.target,C).render(i);return!0===t.removeContainer&&B.parentNode&&B.parentNode.removeChild(B),h})})})};function tr(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}var rr=function(A,e){var t=e||{},r=new p("boolean"!=typeof t.logging||t.logging);r.log("html2canvas ".concat("1.0.0-rc.1"));var n=A.ownerDocument;if(!n)return Promise.reject("Provided element is not within a Document");var B=n.defaultView,s={allowTaint:!1,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,scale:B.devicePixelRatio||1,target:new f(t.canvas),useCORS:!1,windowWidth:B.innerWidth,windowHeight:B.innerHeight,scrollX:B.pageXOffset,scrollY:B.pageYOffset};return er(A,function(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(A){return Object.getOwnPropertyDescriptor(t,A).enumerable}))),r.forEach(function(e){tr(A,e,t[e])})}return A}({},s,t),r)};rr.CanvasRenderer=f,e.default=rr}]).default});
/** @license JSZip v3.1.5 | Copyright (c) 2009-2016 Stuart Knightley <stuart@stuartk.com> [https://stuk.github.io/jszip/] | MIT License [https://raw.github.com/Stuk/jszip/master/LICENSE.markdown] */
var r0="\x00\x00",k0='application/zip',e0="application/zip",n0="undefined",q0=null,h0=false;"use strict";var JSZip=function(k,l){this.files={};this.root="";if(k){this.load(k,l);}};JSZip.signature={LOCAL_FILE_HEADER:"\x50\x4b\x03\x04",CENTRAL_FILE_HEADER:"\x50\x4b\x01\x02",CENTRAL_DIRECTORY_END:"\x50\x4b\x05\x06",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"\x50\x4b\x06\x07",ZIP64_CENTRAL_DIRECTORY_END:"\x50\x4b\x06\x06",DATA_DESCRIPTOR:"\x50\x4b\x07\x08"};JSZip.defaults={base64:h0,binary:h0,dir:h0,date:q0,compression:q0};JSZip.support={arraybuffer:(function(){return typeof ArrayBuffer!==n0&&typeof Uint8Array!==n0;})(),nodebuffer:(function(){return typeof Buffer!==n0;})(),uint8array:(function(){return typeof Uint8Array!==n0;})(),blob:(function(){if(typeof ArrayBuffer===n0){return h0;}var l=new ArrayBuffer(0);try{return new Blob([l],{type:e0}).size===0;}catch(k){}try{var n=new (window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)();n.append(l);return n.getBlob(k0).size===0;}catch(k){}return h0;})()};JSZip.prototype=(function(){var p,v;if(JSZip.support.uint8array&&typeof TextEncoder==="function"&&typeof TextDecoder==="function"){p=new TextEncoder("utf-8");v=new TextDecoder("utf-8");}var w=function(k){if(k._data instanceof JSZip.CompressedObject){k._data=k._data.getContent();k.options.binary=true;k.options.base64=false;if(JSZip.utils.getTypeOf(k._data)==="uint8array"){var l=k._data;k._data=new Uint8Array(l.length);if(l.length!==0){k._data.set(l,0);}}}return k._data;},E=function(k){var l=w(k),n=JSZip.utils.getTypeOf(l);if(n==="string"){if(!k.options.binary){if(p){return p.encode(l);}if(JSZip.support.nodebuffer){return new Buffer(l,"utf-8");}}return k.asBinary();}return l;},z=function(k){var l=w(this);if(l===null||typeof l==="undefined"){return "";}if(this.options.base64){l=JSZip.base64.decode(l);}if(k&&this.options.binary){l=JSZip.prototype.utf8decode(l);}else{l=JSZip.utils.transformTo("string",l);}if(!k&&!this.options.binary){l=JSZip.prototype.utf8encode(l);}return l;},J=function(k,l,n){this.name=k;this._data=l;this.options=n;};J.prototype={asText:function(){return z.call(this,true);},asBinary:function(){return z.call(this,false);},asNodeBuffer:function(){var k=E(this);return JSZip.utils.transformTo("nodebuffer",k);},asUint8Array:function(){var k=E(this);return JSZip.utils.transformTo("uint8array",k);},asArrayBuffer:function(){return this.asUint8Array().buffer;}};var I=function(k,l){var n="",r;for(r=0;r<l;r++){n+=String.fromCharCode(k&0xff);k=k>>>8;}return n;},P=function(){var k={},l,n;for(l=0;l<arguments.length;l++){for(n in arguments[l]){if(arguments[l].hasOwnProperty(n)&&typeof k[n]==="undefined"){k[n]=arguments[l][n];}}}return k;},F=function(k){k=k||{};if(k.base64===true&&k.binary==null){k.binary=true;}k=P(k,JSZip.defaults);k.date=k.date||new Date();if(k.compression!==null)k.compression=k.compression.toUpperCase();return k;},K=function(k,l,n){var r=D(k),u=JSZip.utils.getTypeOf(l);if(r){x.call(this,r);}n=F(n);if(n.dir||l===null||typeof l==="undefined"){n.base64=false;n.binary=false;l=null;}else if(u==="string"){if(n.binary&&!n.base64){if(n.optimizedBinaryString!==true){l=JSZip.utils.string2binary(l);}}}else{n.base64=false;n.binary=true;if(!u&&!(l instanceof JSZip.CompressedObject)){throw  new Error("The data of '"+k+"' is in an unsupported format !");}if(u==="arraybuffer"){l=JSZip.utils.transformTo("uint8array",l);}}return this.files[k]=new J(k,l,n);},D=function(k){if(k.slice(-1)=='/'){k=k.substring(0,k.length-1);}var l=k.lastIndexOf('/');return (l>0)?k.substring(0,l):"";},x=function(k){if(k.slice(-1)!="/"){k+="/";}if(!this.files[k]){K.call(this,k,null,{dir:true});}return this.files[k];},G=function(k,l){var n=new JSZip.CompressedObject(),r;if(k._data instanceof JSZip.CompressedObject){n.uncompressedSize=k._data.uncompressedSize;n.crc32=k._data.crc32;if(n.uncompressedSize===0||k.options.dir){l=JSZip.compressions['STORE'];n.compressedContent="";n.crc32=0;}else if(k._data.compressionMethod===l.magic){n.compressedContent=k._data.getCompressedContent();}else{r=k._data.getContent();n.compressedContent=l.compress(JSZip.utils.transformTo(l.compressInputType,r));}}else{r=E(k);if(!r||r.length===0||k.options.dir){l=JSZip.compressions['STORE'];r="";}n.uncompressedSize=r.length;n.crc32=this.crc32(r);n.compressedContent=l.compress(JSZip.utils.transformTo(l.compressInputType,r));}n.compressedSize=n.compressedContent.length;n.compressionMethod=l.magic;return n;},V=function(k,l,n,r){var u=n.compressedContent,s=this.utf8encode(l.name),C=s!==l.name,y=l.options,B,A;B=y.date.getHours();B=B<<6;B=B|y.date.getMinutes();B=B<<5;B=B|y.date.getSeconds()/2;A=y.date.getFullYear()-1980;A=A<<4;A=A|(y.date.getMonth()+1);A=A<<5;A=A|y.date.getDate();var m="";m+="\x0A\x00";m+=C?"\x00\x08":"\x00\x00";m+=n.compressionMethod;m+=I(B,2);m+=I(A,2);m+=I(n.crc32,4);m+=I(n.compressedSize,4);m+=I(n.uncompressedSize,4);m+=I(s.length,2);m+="\x00\x00";var q=JSZip.signature.LOCAL_FILE_HEADER+m+s,o=JSZip.signature.CENTRAL_FILE_HEADER+"\x14\x00"+m+"\x00\x00"+"\x00\x00"+"\x00\x00"+(l.options.dir===true?"\x10\x00\x00\x00":"\x00\x00\x00\x00")+I(r,4)+s;return {fileRecord:q,dirRecord:o,compressedObject:n};},N=function(){this.data=[];};N.prototype={append:function(k){k=JSZip.utils.transformTo("string",k);this.data.push(k);},finalize:function(){return this.data.join("");}};var L=function(k){this.data=new Uint8Array(k);this.index=0;};L.prototype={append:function(k){if(k.length!==0){k=JSZip.utils.transformTo("uint8array",k);this.data.set(k,this.index);this.index+=k.length;}},finalize:function(){return this.data;}};return {load:function(k,l){throw  new Error("Load method is not defined. Is the file jszip-load.js included ?");},filter:function(k){var l=[],n,r,u,s;for(n in this.files){if(!this.files.hasOwnProperty(n)){continue;}u=this.files[n];s=new J(u.name,u._data,P(u.options));r=n.slice(this.root.length,n.length);if(n.slice(0,this.root.length)===this.root&&k(r,s)){l.push(s);}}return l;},file:function(n,r,u){if(arguments.length===1){if(JSZip.utils.isRegExp(n)){var s=n;return this.filter(function(k,l){return !l.options.dir&&s.test(k);});}else{return this.filter(function(k,l){return !l.options.dir&&k===n;})[0]||null;}}else{n=this.root+n;K.call(this,n,r,u);}return this;},folder:function(n){if(!n){return this;}if(JSZip.utils.isRegExp(n)){return this.filter(function(k,l){return l.options.dir&&n.test(k);});}var r=this.root+n,u=x.call(this,r),s=this.clone();s.root=u.name;return s;},remove:function(n){n=this.root+n;var r=this.files[n];if(!r){if(n.slice(-1)!="/"){n+="/";}r=this.files[n];}if(r){if(!r.options.dir){delete  this.files[n];}else{var u=this.filter(function(k,l){return l.name.slice(0,n.length)===n;});for(var s=0;s<u.length;s++){delete  this.files[u[s].name];}}}return this;},generate:function(k){k=P(k||{},{base64:true,compression:"STORE",type:"base64"});JSZip.utils.checkSupport(k.type);var l=[],n=0,r=0,u,s;for(var C in this.files){if(!this.files.hasOwnProperty(C)){continue;}var y=this.files[C],B=y.options.compression||k.compression.toUpperCase(),A=JSZip.compressions[B];if(!A){throw  new Error(B+" is not a valid compression method !");}var m=G.call(this,y,A),q=V.call(this,C,y,m,n);n+=q.fileRecord.length+m.compressedSize;r+=q.dirRecord.length;l.push(q);}var o="";o=JSZip.signature.CENTRAL_DIRECTORY_END+"\x00\x00"+"\x00\x00"+I(l.length,2)+I(l.length,2)+I(r,4)+I(n,4)+"\x00\x00";switch(k.type.toLowerCase()){case "uint8array":case "arraybuffer":case "blob":case "nodebuffer":u=new L(n+r+o.length);break;case "base64":default :u=new N(n+r+o.length);break;}for(s=0;s<l.length;s++){u.append(l[s].fileRecord);u.append(l[s].compressedObject.compressedContent);}for(s=0;s<l.length;s++){u.append(l[s].dirRecord);}u.append(o);var t=u.finalize();switch(k.type.toLowerCase()){case "uint8array":case "arraybuffer":case "nodebuffer":return JSZip.utils.transformTo(k.type.toLowerCase(),t);case "blob":return JSZip.utils.arrayBuffer2Blob(JSZip.utils.transformTo("arraybuffer",t));case "base64":return (k.base64)?JSZip.base64.encode(t):t;default :return t;}},crc32:function crc32(k,l){if(typeof k==="undefined"||!k.length){return 0;}var n=JSZip.utils.getTypeOf(k)!=="string",r=[0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3,0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91,0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7,0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5,0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59,0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F,0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D,0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433,0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01,0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65,0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB,0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9,0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F,0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD,0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683,0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1,0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7,0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5,0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B,0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79,0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F,0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D,0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713,0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21,0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45,0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB,0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9,0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF,0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D];if(typeof (l)=="undefined"){l=0;}var u=0,s=0,C=0;l=l^(-1);for(var y=0,B=k.length;y<B;y++){C=n?k[y]:k.charCodeAt(y);s=(l^C)&0xFF;u=r[s];l=(l>>>8)^u;}return l^(-1);},clone:function(){var k=new JSZip();for(var l in this){if(typeof this[l]!=="function"){k[l]=this[l];}}return k;},utf8encode:function(k){if(p){var l=p.encode(k);return JSZip.utils.transformTo("string",l);}if(JSZip.support.nodebuffer){return JSZip.utils.transformTo("string",new Buffer(k,"utf-8"));}var n=[],r=0;for(var u=0;u<k.length;u++){var s=k.charCodeAt(u);if(s<128){n[r++]=String.fromCharCode(s);}else if((s>127)&&(s<2048)){n[r++]=String.fromCharCode((s>>6)|192);n[r++]=String.fromCharCode((s&63)|128);}else{n[r++]=String.fromCharCode((s>>12)|224);n[r++]=String.fromCharCode(((s>>6)&63)|128);n[r++]=String.fromCharCode((s&63)|128);}}return n.join("");},utf8decode:function(k){var l=[],n=0,r=JSZip.utils.getTypeOf(k),u=r!=="string",s=0,C=0,y=0,B=0,A=0;if(v){return v.decode(JSZip.utils.transformTo("uint8array",k));}if(JSZip.support.nodebuffer){return JSZip.utils.transformTo("nodebuffer",k).toString("utf-8");}while(s<k.length){C=u?k[s]:k.charCodeAt(s);if(C<128){l[n++]=String.fromCharCode(C);s++;}else if((C>191)&&(C<224)){B=u?k[s+1]:k.charCodeAt(s+1);l[n++]=String.fromCharCode(((C&31)<<6)|(B&63));s+=2;}else{B=u?k[s+1]:k.charCodeAt(s+1);A=u?k[s+2]:k.charCodeAt(s+2);l[n++]=String.fromCharCode(((C&15)<<12)|((B&63)<<6)|(A&63));s+=3;}}return l.join("");}};}());JSZip.compressions={"STORE":{magic:r0,compress:function(k){return k;},uncompress:function(k){return k;},compressInputType:q0,uncompressInputType:q0}};(function(){JSZip.utils={string2binary:function(k){var l="";for(var n=0;n<k.length;n++){l+=String.fromCharCode(k.charCodeAt(n)&0xff);}return l;},string2Uint8Array:function(k){return JSZip.utils.transformTo("uint8array",k);},uint8Array2String:function(k){return JSZip.utils.transformTo("string",k);},arrayBuffer2Blob:function(l){JSZip.utils.checkSupport("blob");try{return new Blob([l],{type:"application/zip"});}catch(k){}try{var n=new (window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)();n.append(l);return n.getBlob('application/zip');}catch(k){}throw  new Error("Bug : can't construct the Blob.");},string2Blob:function(k){var l=JSZip.utils.transformTo("arraybuffer",k);return JSZip.utils.arrayBuffer2Blob(l);}};function m(k){return k;};function q(k,l){for(var n=0;n<k.length;++n){l[n]=k.charCodeAt(n)&0xFF;}return l;};function o(l){var n=65536,r=[],u=l.length,s=JSZip.utils.getTypeOf(l),C=0,y=true;try{switch(s){case "uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case "nodebuffer":String.fromCharCode.apply(null,new Buffer(0));break;}}catch(k){y=false;}if(!y){var B="";for(var A=0;A<l.length;A++){B+=String.fromCharCode(l[A]);}return B;}while(C<u&&n>1){try{if(s==="array"||s==="nodebuffer"){r.push(String.fromCharCode.apply(null,l.slice(C,Math.min(C+n,u))));}else{r.push(String.fromCharCode.apply(null,l.subarray(C,Math.min(C+n,u))));}C+=n;}catch(k){n=Math.floor(n/2);}}return r.join("");};function t(k,l){for(var n=0;n<k.length;n++){l[n]=k[n];}return l;};var p={};p["string"]={"string":m,"array":function(k){return q(k,new Array(k.length));},"arraybuffer":function(k){return p["string"]["uint8array"](k).buffer;},"uint8array":function(k){return q(k,new Uint8Array(k.length));},"nodebuffer":function(k){return q(k,new Buffer(k.length));}};p["array"]={"string":o,"array":m,"arraybuffer":function(k){return (new Uint8Array(k)).buffer;},"uint8array":function(k){return new Uint8Array(k);},"nodebuffer":function(k){return new Buffer(k);}};p["arraybuffer"]={"string":function(k){return o(new Uint8Array(k));},"array":function(k){return t(new Uint8Array(k),new Array(k.byteLength));},"arraybuffer":m,"uint8array":function(k){return new Uint8Array(k);},"nodebuffer":function(k){return new Buffer(new Uint8Array(k));}};p["uint8array"]={"string":o,"array":function(k){return t(k,new Array(k.length));},"arraybuffer":function(k){return k.buffer;},"uint8array":m,"nodebuffer":function(k){return new Buffer(k);}};p["nodebuffer"]={"string":o,"array":function(k){return t(k,new Array(k.length));},"arraybuffer":function(k){return p["nodebuffer"]["uint8array"](k).buffer;},"uint8array":function(k){return t(k,new Uint8Array(k.length));},"nodebuffer":m};JSZip.utils.transformTo=function(k,l){if(!l){l="";}if(!k){return l;}JSZip.utils.checkSupport(k);var n=JSZip.utils.getTypeOf(l),r=p[n][k](l);return r;};JSZip.utils.getTypeOf=function(k){if(typeof k==="string"){return "string";}if(Object.prototype.toString.call(k)==="[object Array]"){return "array";}if(JSZip.support.nodebuffer&&Buffer.isBuffer(k)){return "nodebuffer";}if(JSZip.support.uint8array&&k instanceof Uint8Array){return "uint8array";}if(JSZip.support.arraybuffer&&k instanceof ArrayBuffer){return "arraybuffer";}};JSZip.utils.isRegExp=function(k){return Object.prototype.toString.call(k)==="[object RegExp]";};JSZip.utils.checkSupport=function(k){var l=true;switch(k.toLowerCase()){case "uint8array":l=JSZip.support.uint8array;break;case "arraybuffer":l=JSZip.support.arraybuffer;break;case "nodebuffer":l=JSZip.support.nodebuffer;break;case "blob":l=JSZip.support.blob;break;}if(!l){throw  new Error(k+" is not supported by this browser");}};})();(function(){JSZip.CompressedObject=function(){this.compressedSize=0;this.uncompressedSize=0;this.crc32=0;this.compressionMethod=q0;this.compressedContent=q0;};JSZip.CompressedObject.prototype={getContent:function(){return q0;},getCompressedContent:function(){return q0;}};})();JSZip.base64=(function(){var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return {encode:function(k,l){var n="",r,u,s,C,y,B,A,m=0;while(m<k.length){r=k.charCodeAt(m++);u=k.charCodeAt(m++);s=k.charCodeAt(m++);C=r>>2;y=((r&3)<<4)|(u>>4);B=((u&15)<<2)|(s>>6);A=s&63;if(isNaN(u)){B=A=64;}else if(isNaN(s)){A=64;}n=n+q.charAt(C)+q.charAt(y)+q.charAt(B)+q.charAt(A);}return n;},decode:function(k,l){var n="",r,u,s,C,y,B,A,m=0;k=k.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(m<k.length){C=q.indexOf(k.charAt(m++));y=q.indexOf(k.charAt(m++));B=q.indexOf(k.charAt(m++));A=q.indexOf(k.charAt(m++));r=(C<<2)|(y>>4);u=((y&15)<<4)|(B>>2);s=((B&3)<<6)|A;n=n+String.fromCharCode(r);if(B!=64){n=n+String.fromCharCode(u);}if(A!=64){n=n+String.fromCharCode(s);}}return n;}};}());
void 0!==window.jQuery&&(window.jQuery.fn.webdatarocks=function(a){a=a||{};a.container=this.get(0);a=window.WebDataRocks?window.WebDataRocks(a):window.PivotApi(a);this.data("webdatarocks",a);return a});
void 0!==window.angular&&window.angular.module("webdatarocks",[]).directive("wbrPivot",function(){function d(b,c){void 0!==b.wbrGlobal&&(c.global=b.wbrGlobal);void 0!==b.wbrWidth&&(c.width=b.wbrWidth);void 0!==b.wbrHeight&&(c.height=b.wbrHeight);void 0!==b.wbrToolbar&&(c.toolbar=!0===b.wbrToolbar||"true"==b.wbrToolbar||"on"==b.wbrToolbar)}return{restrict:"A",scope:{report:"=wbrReport",customizeCell:"&wbrCustomizeCell",cellclick:"&wbrCellClick",celldoubleclick:"&wbrCellDoubleClick",dataerror:"&wbrDataError",
datafilecancelled:"&wbrDataFileCancelled",dataloaded:"&wbrDataLoaded",datachanged:"&wbrDataChanged",fieldslistclose:"&wbrFieldsListClose",fieldslistopen:"&wbrFieldsListOpen",filteropen:"&wbrFilteropen",fullscreen:"&wbrFullscreen",loadingdata:"&wbrLoadingData",loadinglocalization:"&wbrLoadingLocalization",loadingolapstructure:"&wbrLoadingOlapStructure",loadingreportfile:"&wbrLoadingReportFile",localizationerror:"&wbrLocalizationError",localizationloaded:"&wbrLocalizationLoaded",openingreportfile:"&wbrOpeningReportFile",
querycomplete:"&wbrQueryComplete",queryerror:"&wbrQueryError",ready:"&wbrReady",reportchange:"&wbrReportChange",reportcomplete:"&wbrReportComplete",reportfilecancelled:"&wbrReportFileCancelled",reportfileerror:"&wbrReportFileError",reportfileloaded:"&wbrReportFileLoaded",runningquery:"&wbrRunningQuery",update:"&wbrUpdate",beforetoolbarcreated:"&wbrBeforeToolbarCreated"},link:function(b,c,e,a){a={};a.container=c[0];d(e,a);b.customizeCell&&(a.customizeCell=function(a,c){return b.customizeCell({html:a,
data:c})});b.cellclick&&(a.cellclick=function(a){b.cellclick({cell:a})});b.celldoubleclick&&(a.celldoubleclick=function(a){b.celldoubleclick({cell:a})});a.dataerror=b.dataerror;a.datafilecancelled=b.datafilecancelled;a.dataloaded=b.dataloaded;a.datachanged&&(a.datachanged=function(a){b.datachanged({event:a})});a.fieldslistclose=b.fieldslistclose;a.fieldslistopen=b.fieldslistopen;a.filteropen&&(a.filteropen=function(a){b.filteropen({params:a})});a.fullscreen&&(a.fullscreen=function(a){b.fullscreen({fullScreenMode:a})});
a.loadingdata=b.loadingdata;a.loadinglocalization=b.loadinglocalization;a.loadingolapstructure=b.loadingolapstructure;a.loadingreportfile=b.loadingreportfile;a.localizationerror=b.localizationerror;a.localizationloaded=b.localizationloaded;a.olapstructureerror=b.olapstructureerror;a.olapstructureloaded=b.olapstructureloaded;a.openingreportfile=b.openingreportfile;a.querycomplete=b.querycomplete;a.queryerror=b.queryerror;b.ready&&(a.ready=function(){b.ready({pivot:f})});a.reportchange=b.reportchange;
a.reportcomplete=b.reportcomplete;a.reportfilecancelled=b.reportfilecancelled;a.reportfileerror=b.reportfileerror;a.reportfileloaded=b.reportfileloaded;a.runningquery=b.runningquery;a.loadingdata=b.loadingdata;a.loadingdata=b.loadingdata;a.loadingdata=b.loadingdata;a.update=b.update;b.beforetoolbarcreated&&(a.beforetoolbarcreated=function(a){b.beforetoolbarcreated({toolbar:a})});b.report&&(a.report=b.report);b.global&&(a.global=b.global);var f=new WebDataRocks(a)}}});
void 0!==window.React&&(window.WebDataRocksReact={Pivot:React.createClass({propTypes:{global:React.PropTypes.object,width:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),height:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),report:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.object]),toolbar:React.PropTypes.bool,customizeCell:React.PropTypes.func,cellclick:React.PropTypes.func,celldoubleclick:React.PropTypes.func,dataerror:React.PropTypes.func,
datafilecancelled:React.PropTypes.func,dataloaded:React.PropTypes.func,datachanged:React.PropTypes.func,fieldslistclose:React.PropTypes.func,fieldslistopen:React.PropTypes.func,filteropen:React.PropTypes.func,fullscreen:React.PropTypes.func,loadingdata:React.PropTypes.func,loadinglocalization:React.PropTypes.func,loadingolapstructure:React.PropTypes.func,loadingreportfile:React.PropTypes.func,localizationerror:React.PropTypes.func,localizationloaded:React.PropTypes.func,olapstructureerror:React.PropTypes.func,
olapstructureloaded:React.PropTypes.func,openingreportfile:React.PropTypes.func,querycomplete:React.PropTypes.func,queryerror:React.PropTypes.func,ready:React.PropTypes.func,reportchange:React.PropTypes.func,reportcomplete:React.PropTypes.func,reportfilecancelled:React.PropTypes.func,reportfileerror:React.PropTypes.func,reportfileloaded:React.PropTypes.func,runningquery:React.PropTypes.func,update:React.PropTypes.func,beforetoolbarcreated:React.PropTypes.func},render:function(){return React.DOM.div()},
componentDidMount:function(){var a={};a.container=ReactDOM.findDOMNode(this);this.parseProps(a);this.webdatarocks=new window.WebDataRocks(a)},shouldComponentUpdate:function(){return!1},componentWillUnmount:function(){},parseProps:function(a){for(var b in this.props)a[b]=this.props[b]}})});
if("object"===typeof module&&module.exports){module.exports=WebDataRocks;}