/* filename: angular.integralui.min.js version : 4.1.377 Copyright © 2014-2018 Lidor Systems. All rights reserved. This file is part of the "IntegralUI" Library. The contents of this file are subject to the IntegralUI Studio for Web License, and may not be used except in compliance with the License. A copy of the License should have been installed in the product's root installation directory or it can be found at http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. */ angular.module("integralui",[]).directive("iuiDragScroll",["$window","$interval",function(g,d){return{restrict:"A",link:function(b,a,e){var c=!1,h=0,m=null,f=.5;a.bind("dragover",function(f){if(a[0].scrollHeight>a[0].clientHeight){var b=f.pageY?f.pageY:f.originalEvent?f.originalEvent.pageY:0,c=a[0].getBoundingClientRect();angular.element(g);b-=angular.element(g)[0].pageYOffset;bc.bottom-40?n(f,!0):k()}else k()});var n=function(b,n,e,g){c||(h=0,c=!0,m=d(function(){if(1!=b.which)k(); else{var c=e,d=a[0].scrollTop;c||(0===h&&(h=5),h+=5,f+=.5,c=h+=Math.floor(f));d=n?d+c:d-c;a[0].scrollTop=d;(0>=d||a[0].scrollTop.ym&&(k=m);gp&&(g=p);c.css("width",k+"px");c.css("height",g+"px");var u=d(function(){e.$apply();d.cancel(u)},1)}},y=d(function(){p();if(0==u)c.css("opacity",k);else var a=k/3,f=b(function(){a>k?(c.css("opacity",k),b.cancel(f)):(c.css("opacity",a/k),a+=k/3)},10);d.cancel(y)},u),v=b(function(){l=e.$eval(h.iuiResize);if("parent"==a.isFieldAvailable(l.ref,"window")&&f[0].offsetWidth!=t|| f[0].offsetHeight!=q)p(),t=f[0].offsetWidth,q=f[0].offsetHeight},u);e.$watch(h.iuiResize,function(a,f){a!=f&&p()},!0);n.bind("resize",function(f){l=e.$eval(h.iuiResize);"parent"!=a.isFieldAvailable(l.ref,"window")&&p()});e.$on("$destroy",function(a){v&&b.cancel(v);n&&n.unbind("resize")})}}}]).directive("iuiClass",function(){return{restrict:"A",link:function(g,d,b){b.$observe("iuiClass",function(a,b){a!=b&&(d.removeAttr("class"),""!=a&&d.addClass(a))})}}}).directive("iuiStyle",function(){return{restrict:"A", link:function(g,d,b){b.$observe("iuiStyle",function(a,b){if(a!=b){a=a.replace(/\s+/g,"");for(var c=a.split(";"),e=0;ec||null===c||void 0===c?g.push(f):(c=Math.max(Math.min(c,g.length),0),g.splice(c,0,f)),f[b]||(f[b]=this.getUniqueId()),d.events&&d.events.objAdded({e:{obj:f}}),m&&m(f,c,e))};this.insertByRef=function(a,b,c,e){if(h&&a&&b){var f=this.getParent(b),d=this.getList(f);d=this.getIndexOf(b,d);c&&(d+=1);this.insert(a,d,f,b,c,e);return d}};this.removeAt=function(b,c,e,g){if(h){if(b){e=this.getParent(b); var f=this.getList(e);c=this.getIndexOf(b,f)}if(null===c||void 0===c)return!1;f=this.getList(e);if(0<=c&&c=e.left&&b<=e.right&&a>=e.top&&a<=e.bottom?!0:!1};return{clearData:function(){g={dropPos:-1,source:null,sourceCtrl:null,sourceCollection:null, sourceIndex:-1,target:null,type:""}},getData:function(){return g},setData:function(b){b&&(isNaN(b.dropPos)||(g.dropPos=b.dropPos),b.source&&(g.source=b.source),b.sourceCtrl&&(g.sourceCtrl=b.sourceCtrl),b.sourceCollection&&(g.sourceCollection=b.sourceCollection),isNaN(b.sourceIndex)||(g.sourceIndex=b.sourceIndex),b.target&&(g.target=b.target),b.type&&(g.type=b.type))},hitTest:function(b,a,e){return d(b,a,e)},getDropPos:function(b,a,e,c){if(e)a:{e={left:a.x,top:a.y,right:a.x+a.width,bottom:a.y+a.height}; if("horizontal"===c){e.right=a.x+a.width/2;if(d(b.x,b.y,e)){b=1;break a}e.left=e.right;e.right=a.x+a.width}else{e.bottom=a.y+a.height/2;if(d(b.x,b.y,e)){b=1;break a}e.top=e.bottom;e.bottom=a.y+a.height}b=d(b.x,b.y,e)?2:-1}else"horizontal"===c?(c={left:a.x+a.width/4,top:a.y,right:a.x+3*a.width/4,bottom:a.y+a.height},d(b.x,b.y,c)?b=0:(c.right=c.left,c.left=a.x,d(b.x,b.y,c)?b=1:(c.left=a.x+3*a.width/4,c.right=a.x+a.width,b=d(b.x,b.y,c)?2:-1))):(c={left:a.x,top:a.y+a.height/4,right:a.x+a.width,bottom:a.y+ 3*a.height/4},d(b.x,b.y,c)?b=0:(c.bottom=c.top,c.top=a.y,d(b.x,b.y,c)?b=1:(c.top=a.y+3*a.height/4,c.bottom=a.y+a.height,b=d(b.x,b.y,c)?2:-1)));return b}}}).factory("IntegralUIInternalService",["$rootScope","$window",function(g,d){var b=null;return{getCtrl:function(a){g.$broadcast(a+"-get-ctrl");a=this.getTempData();this.clearTempData();return a?a:null},getUniqueId:function(a,b){function c(){return(65536*(1+Math.random())|0).toString(16).substring(1)}var e=b||"-";e=c()+c()+e+c()+e+c()+e+c()+e+c()+ c()+c();a&&(e=e.substring(0,a));return e},isBoolean:function(a){return a?"boolean"==typeof a:!1},isEnabled:function(a){return a||void 0===a?!0:!1},isEqual:function(a,b){return a&&b?a.toString()===b.toString():!1},isFieldAvailable:function(a,b){return void 0!=a?a:b},isImage:function(a){return a?a instanceof HTMLImageElement:!1},isNumber:function(a){return a?"number"==typeof a:!1},isObject:function(a){return a?"object"==typeof a&&null!=a&&!Array.isArray(a):!1},isPercent:function(a){return a&&(a=a.toString(), "%"==a.substring(a.length-1))?!0:!1},isSelected:function(a){return a&&a.selected?!0:!1},isString:function(a){return a?"string"==typeof a||a instanceof String:!1},isVisible:function(a){return a||void 0===a?!0:!1},clearTempData:function(){b=null},getTempData:function(){return b},setTempData:function(a){b=a},getBodyElem:function(a){for(var b=null,c=document.getElementsByTagName("body")[0];a;){if(a===c){b=a;break}a=a.offsetParent}return!a&&c?c:b},checkHit:function(a,b,c){return a>=c.left&&a<=c.right&& b>=c.top&&b<=c.bottom?!0:!1},getBorderWidth:function(a){return a?{top:getComputedStyle(a)["border-top-width"]?parseInt(getComputedStyle(a)["border-top-width"],10):getComputedStyle(a).borderTopWidth?parseInt(getComputedStyle(a).borderTopWidth,10):0,right:getComputedStyle(a)["border-right-width"]?parseInt(getComputedStyle(a)["border-right-width"],10):getComputedStyle(a).borderRightWidth?parseInt(getComputedStyle(a).borderRightWidth,10):0,bottom:getComputedStyle(a)["border-bottom-width"]?parseInt(getComputedStyle(a)["border-bottom-width"], 10):getComputedStyle(a).borderTopWidth?parseInt(getComputedStyle(a).borderTopWidth,10):0,left:getComputedStyle(a)["border-left-width"]?parseInt(getComputedStyle(a)["border-left-width"],10):getComputedStyle(a).borderLeftWidth?parseInt(getComputedStyle(a).borderLeftWidth,10):0}:{top:0,right:0,bottom:0,left:0}},getMargin:function(a){return a?{top:getComputedStyle(a)["margin-top"]?parseInt(getComputedStyle(a)["margin-top"],10):getComputedStyle(a).marginTop?parseInt(getComputedStyle(a).marginTop,10):0, right:getComputedStyle(a)["margin-right"]?parseInt(getComputedStyle(a)["margin-right"],10):getComputedStyle(a).marginRight?parseInt(getComputedStyle(a).marginRight,10):0,bottom:getComputedStyle(a)["margin-bottom"]?parseInt(getComputedStyle(a)["margin-bottom"],10):getComputedStyle(a).marginBottom?parseInt(getComputedStyle(a).marginBottom,10):0,left:getComputedStyle(a)["margin-left"]?parseInt(getComputedStyle(a)["margin-left"],10):getComputedStyle(a).marginLeft?parseInt(getComputedStyle(a).marginLeft, 10):0}:{top:0,right:0,bottom:0,left:0}},getPadding:function(a){return a?{top:getComputedStyle(a)["padding-top"]?parseInt(getComputedStyle(a)["padding-top"],10):getComputedStyle(a).paddingTop?parseInt(getComputedStyle(a).paddingTop,10):0,right:getComputedStyle(a)["padding-right"]?parseInt(getComputedStyle(a)["padding-right"],10):getComputedStyle(a).paddingRight?parseInt(getComputedStyle(a).paddingRight,10):0,bottom:getComputedStyle(a)["padding-bottom"]?parseInt(getComputedStyle(a)["padding-bottom"], 10):getComputedStyle(a).paddingBottom?parseInt(getComputedStyle(a).paddingBottom,10):0,left:getComputedStyle(a)["padding-left"]?parseInt(getComputedStyle(a)["padding-left"],10):getComputedStyle(a).paddingLeft?parseInt(getComputedStyle(a).paddingLeft,10):0}:{top:0,right:0,bottom:0,left:0}},getMousePos:function(a){return{x:a.pageX?a.pageX:a.originalEvent?a.originalEvent.pageX:0,y:a.pageY?a.pageY:a.originalEvent?a.originalEvent.pageY:0}},getClientMousePos:function(a,b){if(a&&b){b=angular.element(b); var c=b[0].getBoundingClientRect(),e=angular.element(d)[0].pageXOffset,g=angular.element(d)[0].pageYOffset,f=this.getMousePos(a);f.x-=c.left+e;f.y-=c.top+g;return f}return{x:0,y:0}},getPageRect:function(a){if(a){a=angular.element(a);a=a[0].getBoundingClientRect();var b=angular.element(d)[0].pageXOffset,c=angular.element(d)[0].pageYOffset;a.left-=b;a.top-=c;a.right=a.left+a.width;a.bottom=a.top+a.height;return a}return{x:0,y:0,left:0,top:0,right:0,bottom:0,width:0,height:0}},getTouchData:function(a){return a.changedTouches? a.changedTouches:a.originalEvent?a.originalEvent.changedTouches:null}}}]);