function safeExecution(e){try{e()}catch(t){var n=window._wzErrorHandler;throw n&&n.notifyError&&n.notifyError(t,{ScriptLoad:!0}),t}}safeExecution(function(){function e(e){var t=f.quickExtend({fetchingFunction:void 0,insertionFunction:void 0,requestInsertionFunction:void 0,filesInsertionFunction:void 0,removingFunction:void 0,loginProvider:void 0,getIDFunction:f.defaultIdFunction,setIDFunction:f.defaultSetIdFunction,resetOnEvent:void 0,attributes:{},replaceItems:!1},e),n=this,i=!1,a={},r=0,o=!1,s=void 0,l=t.attributes,c={};this.id=f.weakID(),this.allFetched=O.create(!1),this.duringFetching=O.create(!1),this.errorFetching=O.create(!1),this.loginRequired=O.create(!1),this.fetchedOnce=O.create(!1),this.itemsAddedEvent=x.create(),this.itemAddedEvent=x.create(),this.itemsRemovedEvent=x.create(),this.itemRemovingEvent=x.create(),this.itemsUpdatedEvent=x.create(),this.itemUpdatedEvent=x.create(),this.itemAddedEvent=x.create(),this.collectionResetEvent=x.create(),this.allFetchedEvent=x.create(),this.fetchingStartedEvent=x.create(),this.fetchingFinishedEvent=x.create(),this.supportsDelayedFetching=us,this.isObservableCollection=us,this.updateBatch=Ae.create();var u=t.resetOnEvent;u&&x.bind(u,function(){n.reset()}),this.initialize=function(e){n.put(e),r=e.length,n.fetchedOnce.setTrue()},this.getLoginProvider=function(){return t.loginProvider?t.loginProvider():void 0},this.getAttributes=function(){return l},this.setAttributes=function(e){f.quickExtend(l,e)},this.getItems=function(){return a},this.hasItems=function(){return!f.isEmptyObject(a)},this.getItem=function(e){return a[e]},this.isFetching=function(){return i},this.getItemsValues=function(){return f.getValues(a)},this.getIDFunction=function(){return t.getIDFunction},this.getOptions=function(){return t},this.remove=function(e){e=f.asArray(e);for(var t=[],i=0;i0&&n.itemsRemovedEvent.fireNew(t)},this.executeRemove=function(e,i,o,s){return o=f.valueOrDefault(o,cs),s=f.valueOrDefault(s,cs),t.removingFunction(e,i,function(){e=f.asArray(e);for(var t=0;t0&&n.itemsAddedEvent.fireNew(r),i.length>0&&n.itemsUpdatedEvent.fireNew(i)},this.requestInsertion=function(e,i){return i=f.extend({onSuccess:cs,onError:cs},i),i.onSuccess=f.hookBeforeMethod(i.onSuccess,function(e){e&&n.put(e)}),t.requestInsertionFunction(e,i)},this.addItems=function(e,i){return void 0===i&&(i=cs),t.insertionFunction(e,function(r){e=f.asArray(e),r=f.asArray(r);for(var o=[],s=[],l=0;li?n.fetchMore(e-i,t):t({fetchedItems:[],error:null})},this.fetchAll=function(e){n.fetchTo(1e4,e)},this.fetchAllNew=function(e,t){e=f.valueOrDefault(e,cs),t=f.valueOrDefault(t,cs),n.fetchTo(1e4,function(n){n&&n.error?t(n):e(n)})},this.fetchMore=function(e,l){if(l=f.valueOrDefault(l,cs),!i&&!o){s={count:e,onFinish:l};var c=n.getLoginProvider();if(c&&!c.isLoggedIn())return void n.loginRequired.setTrue();n.loginRequired.setFalse(),i=!0,n.duringFetching.setTrue(),n.errorFetching.setFalse();var u=r;n.fetchingStartedEvent.fireNew(),t.fetchingFunction(u,e,function(s){r=Math.max(r,u+s.length),s.lengtha.width&&(i.width=a.width),i}function n(e){if(null===e)return null;if(e){if(e instanceof ti)return e;var t,n=typeof e;if("object"===n&&1===e.nodeType)return t=e.getAttribute("data-element-id"),sa.getInstanceByID(t);if(f.isJQueryObject(e))return t=e.attr("data-element-id"),sa.getInstanceByID(t);if("string"===n||"number"===n)return sa.getInstanceByID(e)}}function i(e){var t=f("
").html(e);return f("p",t).each(function(){f(this).replaceWith(f(this).text()+"\n")}),t.text()}function a(e){switch(e.toLowerCase()){case"scrollbox":return Ao.scrollBox;case"embed":return Ao.embed;default:return Ao.popup}}function r(e,t,n,i){var a=this,r=f('
  • '+e.name+"
  • ");return r.click(function(e){a.onFilterClick(e,t),n.removeClass("active"),a.updateSelectText(e,i)}),r}function o(e,t){var n=this,i=f("
  • "),a=f('').appendTo(i),r=f('').appendTo(i),o=f('
    ').appendTo(r),s=f(''+e.name+"").appendTo(r);a.click(function(e){n.onFilterClick(e,t)});var l=Ka.getThemeColor(4,2);return e.active&&(a.prop("checked",!0),o.css("background-color",l).css("border-color",l),s.css("font-weight","bold")),e.element||n.addFilterToList(t,a,e),a.on("change",function(){this.checked?(o.css("background-color",l).css("border-color",l),s.css("font-weight","bold")):(o.css("background-color","").css("border-color",""),s.css("font-weight","normal"))}),i}function s(e,t){var n=this,i=f('
  • '),a=f('').appendTo(i).click(function(e){n.onFilterClick(e,t)}),r=f('').appendTo(i),o=f('
    ').appendTo(r);return e.active&&a.prop("checked",!0),"multi"===e.color?o.addClass("multi-color-background"):(e.color&&In.getLuma(e.color)>=128&&r.addClass("darkCheckmark"),o.css("background-color",e.color)),e.element||n.addFilterToList(t,a,e),i}function l(e,t,n){var i=e.attributes;1===i.length&&(i[0].selected=!0);for(var a=e.optionId,l=f("
    "),c=0;cFilter'),i=f('
    ');i.click(function(e){n.removeClass("active"),e.stopPropagation(),e.preventDefault()}),n.append(i);var a=f('
    ');for(var r in e){var o=e[r];o.attributes&&f('
    '+o.name+"
    ").click(function(n){var i=e[n.currentTarget.getAttribute("data-name")],a=l.call(t,i);a.addClass("mobile-choices cf");var r=f('
    ').append(a),o=f(''),s=Ka.getThemeColor(4,2),c=Ka.getThemeColor(3,0),u=(f('Filter').appendTo(o).click(function(e){e.preventDefault(),t.setFilters(i.mappedFilters,a),t.closeDialog()}),f('Cancel').appendTo(o));u.click(function(e){e.preventDefault(),t.closeDialog()}),a.append(o),n.preventDefault(),t.createDialog({$element:r,classes:"popover",title:"Filter by "+i.name}),t.openDialog()}).appendTo(a)}return n.append(a),n.click(function(){n.toggleClass("active")}),n}function d(e){return e.message?f.valueOrDefault(e.message,""):f.valueOrDefault(e.description,"")}/*! * jQuery JavaScript Library v1.11.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-12-17T15:27Z */ !function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){if(!("length"in e)||void 0===e.length)return!1;var t=e.length,n=ae.type(e);return"function"===n||ae.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e&&"length"in e}function i(e,t,n){if(ae.isFunction(t))return ae.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return ae.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ge.test(t))return ae.filter(t,e,n);t=ae.filter(t,e)}return ae.grep(e,function(e){return ae.inArray(e,t)>=0!==n})}function a(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function r(e){var t=Ce[e]={};return ae.each(e.match(be)||[],function(e,n){t[n]=!0}),t}function o(){pe.addEventListener?(pe.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(pe.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(pe.addEventListener||"load"===event.type||"complete"===pe.readyState)&&(o(),ae.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(Ee,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:we.test(n)?ae.parseJSON(n):n}catch(a){}ae.data(e,t,n)}else n=void 0}return n}function c(e){var t;for(t in e)if(("data"!==t||!ae.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(e,t,n,i){if(ae.acceptData(e)){var a,r,o=ae.expando,s=e.nodeType,l=s?ae.cache:e,c=s?e[o]:e[o]&&o;if(c&&l[c]&&(i||l[c].data)||void 0!==n||"string"!=typeof t)return c||(c=s?e[o]=X.pop()||ae.guid++:o),l[c]||(l[c]=s?{}:{toJSON:cs}),"object"!=typeof t&&"function"!=typeof t||(i?l[c]=ae.extend(l[c],t):l[c].data=ae.extend(l[c].data,t)),r=l[c],i||(r.data||(r.data={}),r=r.data),void 0!==n&&(r[ae.camelCase(t)]=n),"string"==typeof t?(a=r[t],null==a&&(a=r[ae.camelCase(t)])):a=r,a}}function d(e,t,n){if(ae.acceptData(e)){var i,a,r=e.nodeType,o=r?ae.cache:e,s=r?e[ae.expando]:ae.expando;if(o[s]){if(t&&(i=n?o[s]:o[s].data)){ae.isArray(t)?t=t.concat(ae.map(t,ae.camelCase)):t in i?t=[t]:(t=ae.camelCase(t),t=t in i?[t]:t.split(" ")),a=t.length;for(;a--;)delete i[t[a]];if(n?!c(i):!ae.isEmptyObject(i))return}(n||(delete o[s].data,c(o[s])))&&(r?ae.cleanData([e],!0):ne.deleteExpando||o!=o.window?delete o[s]:o[s]=null)}}}function g(){return!0}function f(){return!1}function p(){try{return pe.activeElement}catch(e){}}function h(e){var t=Oe.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function m(e,t){var n,i,a=0,r=typeof e.getElementsByTagName!==Pe?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Pe?e.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],n=e.childNodes||e;null!=(i=n[a]);a++)!t||ae.nodeName(i,t)?r.push(i):ae.merge(r,m(i,t));return void 0===t||t&&ae.nodeName(e,t)?ae.merge([e],r):r}function v(e){Fe.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return ae.nodeName(e,"table")&&ae.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==ae.find.attr(e,"type"))+"/"+e.type,e}function C(e){var t=Ge.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function I(e,t){for(var n,i=0;null!=(n=e[i]);i++)ae._data(n,"globalEval",!t||ae._data(t[i],"globalEval"))}function S(e,t){if(1===t.nodeType&&ae.hasData(e)){var n,i,a,r=ae._data(e),o=ae._data(t,r),s=r.events;if(s){delete o.handle,o.events={};for(n in s)for(i=0,a=s[n].length;a>i;i++)ae.event.add(t,n,s[n][i])}o.data&&(o.data=ae.extend({},o.data))}}function P(e,t){var n,i,a;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!ne.noCloneEvent&&t[ae.expando]){a=ae._data(t);for(i in a.events)ae.removeEvent(t,i,a.handle);t.removeAttribute(ae.expando)}"script"===n&&t.text!==e.text?(b(t).text=e.text,C(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),ne.html5Clone&&e.innerHTML&&!ae.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Fe.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}function w(t,n){var i,a=ae(n.createElement(t)).appendTo(n.body),r=e.getDefaultComputedStyle&&(i=e.getDefaultComputedStyle(a[0]))?i.display:ae.css(a[0],"display");return a.detach(),r}function E(e){var t=pe,n=Ze[e];return n||(n=w(e,t),"none"!==n&&n||(Je=(Je||ae("'.format({width:r,height:o,zoom:n,center:i,mapType:a,query:encodeURI(t),fileName:s});e.getImageSource()&&e.getImageSource()===l||(e.setImageSource(l),e.element.children().remove(),e.element.append(f(l)))},250)}function n(e){var t=""+e;return"object"==typeof e&&e.lat&&(t="({0},{1})".format(e.lat,e.lng)),t}function i(e){if(e=f.quickExtend({},e)){var t=e.center;f.isArray(t)&&(e.center={lat:t[0],lng:t[1]})}return e}function a(e){return f.isArray(e)?{lat:e[0],lng:e[1]}:e}var r,o=!1,s=[],l=!1;window.onGoogleMapAPIReady=function(){l=!0;var e=s;s=[],f.eachItem(e,function(e,t){t()})},this.Geocoder=w.create(function(){var e={"(41.1876338,-74.08288390000001)":"21-51 Diltz Rd, Pomona, NY 10970, United States","(40.7481829,-73.98506350000002)":"350 5th Ave, New York, NY 10118, United States","(40.7130794,-74.0056932)":"52 Chambers St, New York, NY 10007, United States"},t={withGeocoder:function(e){t.geocoder?e(t.geocoder):Fe.useGoogleMapAPI(function(){t.geocoder=new google.maps.Geocoder,e(t.geocoder)})},geocode:function(e,n,i){n=f.valueOrDefault(n,cs),i=f.valueOrDefault(i,cs),t.withGeocoder(function(t){t.geocode({address:e},function(e,t){t==google.maps.GeocoderStatus.OK?n(e):i(t)})})},addAddressToCache:function(t,i){e[n(t)]=i},reverseGeocoding:function(i,r,o){if(r=f.valueOrDefault(r,cs),o=f.valueOrDefault(o,cs),i=a(i),0===i.lat&&0===i.lng)return void r("");var s=e[""+i];s?r(s):t.withGeocoder(function(t){t.geocode({latLng:i},function(t,a){if(a==google.maps.GeocoderStatus.OK){var s=t[0];s=s?s.formatted_address:n(i),e[n(i)]=s,r(s)}else o(a)})})}};return t}),this.latLngToArray=function(e){return e?"function"==typeof e.lat?[e.lat(),e.lng()]:[e.lat,e.lng]:[0,0]},this.getMapAddress=function(e,t){t("")},this.setCurrentAddress=function(e){r=e},this.getCurrentAddress=function(){return r},this.buildContentString=function(e,t){return'
    '+'

    {0}

    '.format(e)+'
    '+t+"
    "},this.useGoogleMapAPI=function(t,n){l?t():(e(n),s.push(t))},this.loadApi=function(e,t,n){n.hasLoaded=!0;var a=new google.maps.Map(e[0],i(n.mapOptions));n.map=a;var r=n.pendingMapOperations;n.pendingMapOperations=[],f.eachItem(r,function(e,t){t(a)}),google.maps.event.addListener(a,"center_changed",function(){n.currentCenter.setValue(a.getCenter())}),n.currentCenter.setValue(a.getCenter()),google.maps.event.addListener(a,"zoom_changed",function(){n.currentZoom.setValue(a.getZoom())}),google.maps.event.addListener(a,"maptypeid_changed",function(){n.mapTypeId.setValue(a.getMapTypeId())}),google.maps.event.addListener(a.getStreetView(),"visible_changed",function(){n.isStreetView.setValue(this.getVisible())}),n.currentZoom.setValue(a.getZoom())},this.loadBasicMap=function(e,n,i,a){var r={element:e,instance:a,mapOptions:n,imageSource:null,refreshTimer:null,setCenter:function(e){t.call(this)},setZoom:function(){t.call(this)},setOptions:function(){t.call(this)},getMapTypeId:function(){return this.instance.getPropertyValue("mapType")||De.Roadmap},getCenter:function(){return(this.instance.getPropertyValue("mapPosition")||this.mapOptions.center).join(",")},getStreetView:ds,getZoom:function(){return this.instance.getPropertyValue("zooming")||this.mapOptions.zoom||2},getQueryString:function(){var e=this.instance.getPropertyValue("markers"),t=this.getCenter(),n="near";if(e){var i={};return f.each(e,function(t){i[e[t].position.join(",")]=e[t].title}),i.hasOwnProperty(t)?i[t]:Object.keys(i).length>0?i[Object.keys(i)[0]]:e[Object.keys(e)[0]].title}return n},getImageSource:function(){return this.imageSource},setImageSource:function(e){this.imageSource=e},getWidth:function(){return Math.round(this.element.width())},getHeight:function(){return Math.round(this.element.height())},getScale:function(){return 1}};i.map=r;var o=i.pendingMapOperations;i.pendingMapOperations=[],f.eachItem(o,function(e,t){t(r)})},this.createMap=function(e,t){function r(){f.each(d.getItems(),function(e,t){t.setMap(null)}),g={},d.clear()}function o(e,t){e&&(d.updateItemFields(e.name,{icon:t}),y.fireNew())}function s(e,t){Fe.Geocoder.get().reverseGeocoding(t,function(t){e.title=t,y.fireNew()},function(){e.title=t,y.fireNew()})}function l(e,t){e=f.extend({position:void 0,name:void 0,title:void 0,customIconUrl:void 0,icon:void 0},e),t=f.valueOrDefault(t,cs),c.withMap(function(i){var r=a(f.valueOrCalculate(e.position,function(){return i.getCenter()})),o=n(r);if(g[o])t(void 0);else{var s=e.name,l=e.title,c=(e.icon,function(){void 0===s&&(s=f.uniqueID()),"https:"===window.location.protocol&&e&&e.indexOf&&e.indexOf("http:")>-1&&(e=e.replace("http:","https:"));var e=void 0===e?"":e,n={name:s,position:r,title:l,map:i,draggable:!1,clickable:!0,icon:e,setMap:function(e){this.map=e},getPosition:function(){return r},setPosition:function(e){this.position=e},setOptions:function(e){"boolean"==typeof e.draggable&&(this.draggable=e.draggable),"boolean"==typeof e.clickable&&(this.clickable=e.clickable),void 0!==e.center&&(this.position=e.center)}};if("undefined"!=typeof google&&void 0!==google.maps.Marker){n=new google.maps.Marker({name:s,position:r,map:i,title:l,icon:e})}d.put(n),g[o]=n,t(n),y.fireNew()});void 0===l,c()}})}t=f.extend({center:[46.578498,2.457275],zoom:8},t);var c={},u=[],d=new $t({idFunction:function(e){return e.name}}),g={},p=_.create(void 0,{equalityComparer:function(e,t){return void 0===e||void 0===t?e===t:null===e||null===t?e===t:""+e==""+t}}),h=_.createNumerical(),m=_.create(),v=_.create(),y=x.create();return f.quickExtend(c,{$element:e,markers:d,markersChangedEvent:y,currentCenter:p,currentZoom:h,mapTypeId:m,isStreetView:v,pendingMapOperations:u,mapOptions:t,withMap:function(e){c.map?e(c.map):u.push(e)},setOptions:function(e){c.withMap(function(t){t.setOptions(i(e))})},setZoom:function(e){c.withMap(function(t){t.setZoom(e)})},setStreetView:function(e,t){e?c.withMap(function(n){var i=n.getStreetView();i&&(i.setVisible(e),i.setPov(t.pov),i.setPosition(t.position))}):c.withMap(function(e){var t=e.getStreetView();t&&t.setVisible(!1)})},getStreetViewData:function(e){c.withMap(function(t){var n=t.getStreetView();e({pov:n.getPov(),position:n.getPosition()})})},setCenter:function(e){c.withMap(function(t){t.setCenter(a(e))})},getCenter:function(e){c.withMap(function(t){e(t.getCenter())})},getMapTypeId:function(e){c.withMap(function(t){e(t.getMapTypeId())})},panTo:function(e){c.withMap(function(t){t.panTo(e)})},updateMarkerPosition:function(e,t){s(e,t)},setMarkerIcon:function(e,t){o(e,t)},addMarker:function(e,t){t=f.valueOrDefault(t,cs),l(e,function(e){t(e),e&&y.fireNew()})},removeMarker:function(e){"string"==typeof e&&(e=d.getItem(e)),e&&(e.setMap(null),d.remove(e.name),delete g["({0},{1})".format(e.position.lat,e.position.lng)],y.fireNew())},clearMarkers:function(){r(),y.fireNew()},getMarkersInfo:function(){var e={};return f.each(d.getItems(),function(t,n){var i=n.position;e[t]={name:n.name,title:n.title,icon:n.icon,position:[i.lat,i.lng]}}),e},setMarkers:function(e,t){t=f.valueOrDefault(t,cs),c.withMap(function(){r(),f.each(e,function(e,t){l(t)}),t(),y.fireNew()})},refreshSize:function(){c.withMap(function(){"undefined"!=typeof google&&void 0!==google.maps.event&&google.maps.event.trigger(c.map,"resize")})}}),c}});!function(e){e.fn.scrollToFixed=function(t){function n(){g.setValue(i()>f-t.distance)}function i(){var e;if(l[0]===window){var t=document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body;e=document.all?t.scrollTop:window.pageYOffset}else e=l[0].scrollTop;return e}var a=e.uniqueID();t=e.quickExtend({fixedClass:"scroll-fixed",unfixedClass:"scroll-unfixed",fixedCallback:cs,unfixedCallback:cs,distance:0,$scrollablePane:e(window),getScrollingSize:function(){return s.offset().top},getTopPositionWhenFixed:function(){return 0}},t);var r,o={},s=this,l=t.$scrollablePane,c=t.getScrollingSize,u=t.getTopPositionWhenFixed,d=!1,g=O.create(void 0,{valueChangeCallback:function(n){if(!d){if(d=!0,n){var i=s.outerHeight(),a=s.css("top");r=t.startPosition?t.startPosition:a;var o=e("
    ").css("height",i);s.wrap(o),s.css("top",u()+t.distance),t.fixedCallback(),s.addClass(t.fixedClass),s.removeClass(t.unfixedClass)}else s.removeClass(t.fixedClass),s.addClass(t.unfixedClass),t.unfixedCallback(),void 0!==r&&(s.unwrap(),s.css("top",r),r=void 0);d=!1}}}),f=c();return e.quickExtend(o,{$element:s,isFixed:g,unbind:function(){o.deactivate()},deactivate:function(){l.unbind("scroll."+a),g.setValue(!1)},activate:function(){return l.bind("scroll."+a,function(){n()}),n(),o},refresh:function(){f=c()+i(),n()},pushTo:function(e){return e.push(o),o}}),o}}(p);var Ae=function(){function e(){this.scope.start()}function t(){this.scope.finish()}function n(e,t){t.batchFinishingStartedCallback(),t.batchFinishCallback(),s(e),x.fireLazyEvent(e,"finishedEvent"),t.batchFinishingCompletedCallback(),x.fireLazyEvent(e,"afterFinishedEvent")}function i(e){void 0===c[e.name]&&(c[e.name]={controller:e,index:l},l++)}function a(e){void 0!==c[e.name]&&(delete c[e.name],l--)}function r(e,t,n,i){e.pendingEvents[t.id]={event:t,isLazy:!1,args:i,condition:n}}function o(e,t,n,i,a,r,o){e.pendingEvents[t]={object:n,eventPropertyName:i,callback:a,isLazy:!0,args:o,condition:r}}function s(e){var t,n,i,a=e.pendingEvents,r=[];for(var o in a)t=a[o],r.push(t),delete e.pendingEvents[o];var s=e._operations;for(e._operationNames={},e._operations=[],i=r.length,n=0;i>n;n++){t=r[n];var l=t.condition;if(!l||l()){var c=t.args;t.isLazy?(x.fireLazyEvent(t.object,t.eventPropertyName,c),t.callback(c)):t.event.fireNew(c)}}for(i=s.length,n=0;i>n;n++){var u=s[n];void 0===u?ee.log("Skipping scheduled operation since its missing in the array"):u.call(e)}}var l=0,c={},u=C.extend("OperationsBatch",{init:function(e){e=f.quickExtend({batchStartCallback:cs,batchFinishCallback:cs,beforeFinishingCallback:cs,batchFinishingStartedCallback:cs,batchFinishingCompletedCallback:cs},e);var t=e.name,r=e.batchStartCallback,o=e.beforeFinishingCallback;void 0===t&&(t=f.weakID());var s=this,l=we.create({startCallback:function(){i(s),x.fireLazyEvent(s,"startedEvent"),r()},beforeFinishingCallback:o,finishCallback:function(){n(s,e),a(s)}});this.name=t,this.scope=l,this.pendingEvents={},this._operationNames={},this._operations=[]},lazyInitializationProperties:{startedEvent:x.create,finishedEvent:x.create,afterFinishedEvent:x.create},whenNotActive:function(e){this.isActive()||e()},executeWithActivation:function(e){this.start(),e(),this.finish()},begin:e,end:t,start:e,finish:t,getCounter:function(){return this.scope.getCounter()},release:function(){this.scope.setCounter(1),this.finish()},isActive:function(){return this.scope.isActive()},fireWhenFinished:function(e,t){t=f.quickExtend({fireOnce:!0,customName:""},t);var n=t.fireOnce,i=t.args,a=t.customName,r=void 0!==e.name,o=r?e.event:e,s=r?e.name:"",l=n?o.id+s+a:void 0;this.whenFinished(function(){r?o.fireNew(s,i):o.fireNew(i)},l)},fireEvent:function(e,t,n){this.isActive()||n&&!n()?r(this,e,n,t):e.fireNew(t)},fireLazyEvent:function(e,t,n,i,a){a=f.quickExtend({callback:cs},a);var r=a.callback;if(this.isActive()||i&&!i()){var s=a.eventId;s||(s=e.id+t),o(this,s,e,t,r,i,n)}else x.fireLazyEvent(e,t,n),r(n)},whenFinished:function(e,t){this.performOperation(e,t)},performInstanceOperation:function(e,t,n){void 0!==n&&null!==n||(n="op"+f.uniqueID()+"_"),this.performOperation(e,n+t.id)},performOperation:function(e,t){var n=this;if(n.isActive()){void 0!==t&&null!==t||(t="op"+f.uniqueID());var i=n._operations,a=n._operationNames,r=a[t];void 0===r&&(r=i.length,a[t]=r),i[r]=e}else e.call(n)},performOperationWhenBatchStart:function(e,t){var n=this;n.isActive()?n.performOperation(e,t):n.startedEvent.one(function(){n.performOperation(e,t)})},executeOnBatchStart:function(e){var t=this;t.isActive()?e():t.startedEvent.one(function(){e()})},executeAfterBatchFinished:function(e){var t=this;t.isActive()?e():t.finishedEvent.one(function(){e()})},hasOperation:function(e){return void 0!==this._operationNames[e]},bind:function(e,t){var n=this.startedEvent.bind(e),i=this.finishedEvent.bind(t);return{unbind:function(){n.unbind(),i.unbind()},addToCollection:function(e){e.add(this)}}},bindToBatch:function(e){var t=this;e.bind(function(){t.start()},function(){t.finish()})}});return u.releaseAllActiveBatches=function(){var e=f.getValues(c).orderBy(function(e){return-e.index});f.eachItem(e,function(e,t){t.controller.release(),delete c[t.name]})},u.create=function(e){return new u(e)},u.whenAllFinished=function(e,t,n){for(var i=e.length,a=0;aa;a++){var r=t.pendingOperations.shift();if(r){var o=r.fetch(),s=r.id;s&&!t.activeOperationsMap[s]?(t.activeOperationsMap[s]=!0,i.push({requestData:r,promise:o,id:s})):a--}}var l=!0,c=!1;f.eachItem(i,function(n,i){t.currentActivateRequests++,i.promise.done(function(e){t.activeOperationsMap[i.id]&&t.successDeferredMap[i.id].resolve(e)}).fail(function(){t.activeOperationsMap[i.id]&&(t.failedOperations.push(i.requestData),t.options.reExecuteFailedOperationsAutomaticly&&t.reExecuteFailedOperations())}).always(function(){t.activeOperationsMap[i.id]&&(delete t.activeOperationsMap[i.id],t.currentActivateRequests--,l?c=!0:e(t))})}),l=!1,c&&e(t)}var t=C.extend("OperationsHandler",{init:function(e){e=f.quickExtend({concurentRequests:5,reExecuteFailedOperationsAutomaticly:!1},e),this.options=e,this.pendingOperations=[],this.failedOperations=[],this.activeOperationsMap={},this.currentActivateRequests=0,this.successPromiseMap={}},requestExecution:function(t){t=f.asArray(t),this.pendingOperations=f.merge(this.pendingOperations,t);var n=f.mapToDictionary(t,function(){return f.Deferred()},f.defaultIdFunction),i=f.mapToDictionary(t,function(e){return n[e.id].promise()},f.defaultIdFunction);return this.successDeferredMap=f.quickExtend({},n,this.successDeferredMap),this.successPromiseMap=f.quickExtend({},i,this.successPromiseMap),0===this.currentActivateRequests&&e(this),this.successPromiseMap},reExecuteFailedOperations:function(){var e=this.failedOperations;this.failedOperations=[],this.requestExecution(e)},cancel:function(){return this.pendingOperations=[],this.currentActivateRequests=0,this.activeOperationsMap={},this.failedOperations=[],this}});return t.create=function(e){return new t(e)},t}(),Ve={IE:1,Other:0},Le={IE6:{browser:Ve.IE,version:6},IE7:{browser:Ve.IE,version:7},IE8:{browser:Ve.IE,version:8},IE9:{browser:Ve.IE,version:9},Other:{browser:Ve.Other,version:0}};!function(e){e.extendValueWithDefaultValue=function(t,n){if(e.isPlainObject(t)&&(void 0===n||e.isPlainObject(n))){var i=e.quickExtend({},n);return e.quickExtend(i,t)}return void 0!==t&&null!==t?t:n},e.extendIfObject=function(t){return e.isPlainObject(t)?e.quickExtend({},t):t},e.cloneObject=function(t){return e.quickExtend({},t)},e.convertValueToObject=function(e,t){for(var n={},i=0;ii;i++)n[i]=e;return n},e.findAvailableName=function(t,n,i){i&&(n=e.map(n,function(e){return e.toLowerCase()}));var a,r,o=e.makeDictionaryFromKeys(n,!0),s=e.isFunction(t),l=1;do r=a=s?t(l):t.format(l),i&&(a=a.toLowerCase()),l++;while(o[a]);return r},e.fn.setStyleAttr=function(e){return e?this.attr("style",e):this.removeAttr("style"),this},e.fn.htmlOrHide=function(t){return void 0===t||null===t?e(this).hide():e(this).show().html(t),this},e.objectSetIfUndefined=function(e,t,n){var i;if(!(t instanceof Array))return i=e[t],void 0===i?e[t]=n():i;for(var a=0;aa;a++)i[a+1]=arguments[a];t.apply(this,i)}},e.extendMissing=function(t,n){return e.eachEntry(n,function(e,n){void 0===t[e]&&(t[e]=n)}),t},e.quickUnique=function(t,n){if(n=e.valueOrDefault(n,e.identity),t.length<2)return t.clone();var i=!0;for(r=0;r=65&&90>=e||e>=48&&57>=e)return String.fromCharCode(e);switch(e){case bt.ESC:return"Esc";case bt.Delete:return"Del"}return""},e.isCtrlPressed=function(e){return e.ctrlKey||e.metaKey},e.isShiftPressed=function(e){return e.shiftKey},e.isKey=function(e,t,n,i,a){null!==t&&void 0!==t&&"string"==typeof t&&(t=t.charCodeAt(0));var r=!1;return null!==t&&void 0!==t&&e.which!==t||(r=!0),n!==!0||e.ctrlKey||e.metaKey?n===!1&&(e.ctrlKey||e.metaKey)&&(r=!1):r=!1,i!==!0||e.shiftKey?i===!1&&e.shiftKey&&(r=!1):r=!1,a!==!0||e.altKey?a===!1&&e.altKey&&(r=!1):r=!1,r},e.isOneOfKeys=function(t,n,i,a,r){return n=e.asArray(n),e.any(n,function(n){return e.isKey(t,n,i,a,r)})},e.getOrInit=function(e,t,n){var i=e[t];return void 0===i&&(i=n,e[t]=i),i},e.getOrCreateArray=function(t,n){return e.getOrInit(t,n,[])},e.getOrCreateMap=function(t,n){return e.getOrInit(t,n,{})},e.getOrInitDeferred=function(e,t,n){var i=e[t];return void 0===i&&(i=n(),e[t]=i),i},e.getWindowCenter=function(){return{top:e(document).scrollTop()+e(window).height()/2,left:e(document).scrollLeft()+e(window).width()/2}},e.fn.makeNumericInput=function(t){t=e.quickExtend({allowDecimalPoint:!0,allowNegativeNumbers:!0},t);var n="[0-9]";t.allowNegativeNumbers&&(n="-|"+n),t.allowDecimalPoint&&(n+="|\\.");var i=RegExp(n);return e(this).keypress(function(e){var t=e||window.event,n=t.keyCode||t.which;n=String.fromCharCode(n),i.test(n)||(t.returnValue=!1,t.preventDefault&&t.preventDefault())})},e.getMouseOffset=function(t,n){n=e.valueOrDefault(n,!1);var i=0,a=0,r=!1;if(t||(t=window.event),t){if(t.pageX||t.pageY)i=t.pageX,a=t.pageY,n&&(r=!0);else{var o=t.originalEvent;o||(o=t);var s=o.changedTouches;s&&s[0]&&(i=s[0].pageX,a=s[0].pageY,n&&(r=!0))}if(r){var l=void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,c=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;i-=l,a-=c}return{left:i,top:a}}},e.extendJqueryUi=function(t,n,i){e.extend(e.ui[t].prototype,function(){var e={};return e[n]=i,e}(e.ui[t].prototype[n]))},e.fixColor=function(t){if("transparent"===t.toLowerCase())return t;if(t=t.trim(),t=e.trimBoth(t,"#"),3===t.length&&(t+=t),t="#"+t,7==t.length){var n=e.Color(t);if(n.space)return n.toCSS()}return null},e.getUrlVars=function(e){for(var t,n=[],i=e.slice(e.indexOf("?")+1).split("&"),a=0;a=0||s.indexOf("-")>=0;l&&i.push('"'),i.push(s),l&&i.push('"'),i.push(":"),e(a,i),o=!1}i.push("}")}else i.push("null")}}function t(t,n){return n=n||[],e(t,n),n}var n=Array.isArray||f.isArray;"undefined"!=typeof module&&module.exports?module.exports=t:f.minimalStringifyJson=t}();var Me={},Oe={};!function(){function e(e,t,n,i){if(t&&e)for(var a=0;a0&&(o=m.notPassed)}}else r=c?Oe.clone(g):g,s=c?Oe.clone(h):h,o=p;e(r,c,n,u),e(s,c,n,u),n.beginUpdate(),o&&n.remove(o),r&&n.put(r),s&&n.put(s),d(n),n.endUpdate()}Oe.contains=function(e,t){return f.oneOfValues(e,t)},Oe.clone=function(e){return e?e.slice(0):e},Oe.shortenArray=function(e,t){return e.length>t&&(e.length=t),e},Oe.getRandomItem=function(e){if(e){var t=e.length;if(t>0){var n=f.getRandom(0,t-1);return e[n]}}},Array.prototype.contains=function(e){return Oe.contains(e,this)},Array.prototype.clone=function(){return Oe.clone(this)},Array.prototype.isLastIndex=function(e){return e===this.length-1},Array.prototype.isSingleValue=function(e){return 1!==this.length?!1:f.isFunction(e)?e(this[0]):e===this[0]},Array.prototype.equals=function(e){if(e.length!=this.length)return!1;for(var t=0;t=0?(this.splice(t,1),!0):!1},Me.isObservableCollection=function(e){return!!(e&&e.isObservableCollection&&e.isObservableCollection())},Me.connectObservableCollection=function(e,n,i){ function a(a){t(a,e,n,i)}if(i=f.quickExtend({normalizeCollection:cs},i),e.connectionController)throw Error("Already connected");if(e.hasItems())throw Error("Invalid use - Collection should be empty");var r,o;return e.connectionController={disconnect:function(){r&&r.unbind(),o&&o.unbind()}},n.updateBatch.isActive()?o=n.updateBatch.afterFinishedEvent.one(function(){r=n.itemsChangedEvent.bind(a),t({addedItems:n.getItemsValues()},e,n,i)}):(r=n.itemsChangedEvent.bind(a),t({addedItems:n.getItemsValues()},e,n,i)),e},Me.disconnectObservableCollection=function(e){e.connectionController&&(e.connectionController.disconnect(),delete e.connectionController),e.clear()},Me.createSortedArray=function(e){e=f.extend({orderByDesc:!1},e);var t=e.valueSelector,n=e.comparer,i=e.orderByDesc,a=!0,r=[];return{addItem:function(e){r.push(e),a=!1},getItems:function(){return a||(i?r.orderByDesc(t,n):r.orderBy(t,n),a=!0),r}}}}();var ze=fs(function(){this.Filters={DateFilter:function(e){return{serverFilters:{fieldName:e.fieldName,type:"between",from:e.from,to:e.to},filterFunction:function(t){var n=t[e.fieldName];return n&&n>e.from&&ne.from&&n=0}}},NotFilter:function(e){return{serverFilters:{fieldName:e.fieldName,type:"neq",value:e.value,isBinded:void 0===e.value?!0:void 0},filterFunction:function(t){return e.value!==t[e.fieldName]}}}},this.filterItems=function(e,t,n){n=f.quickExtend({passedIdFunction:f.identity,notPassedIdFunction:f.identity},n);var i=[],a=[];return f.each(e,function(e,r){if(t(r)){var o=n.passedIdFunction(r);i.push(o)}else{var s=n.notPassedIdFunction(r);a.push(s)}}),{passed:i,notPassed:a}},this.getFiltersCompositeFunction=function(e,t){t=f.valueOrDefault(t,"filterFunction");var n=us;return f.eachItem(e,function(e,i){n=f.wrapMethod(n,function(e){return function(n){return i[t](n)&&e(n)}})}),n}}),_e=fs(function(){this.getListNameFromInstance=function(e){return e.getPropertyValue(ui.dataInfo.name).listName},this.getListControllerFromInstance=function(e){return e.elementType===ri.StoreFront&&e.getCurrentListController?e.getCurrentListController():Cr.getListByName(_e.getListNameFromInstance(e))},this.isDynamicPage=function(e){return!!e.pageListName},this.isMasterListPage=function(e){return"Store"===e.masterPageListName?!1:!!e.masterPageListName},this.isListPage=function(e){return this.isMasterListPage(e)||this.isDynamicPage(e)},this.getListForCurrentDynamicPage=function(){var e=f.objectGet(va.CurrentPageData.getValue(),"pageListName");return e&&Cr.getListByName(e)},this.getListName=function(e){return e.masterPageListName||e.pageListName},this.getIconForListPage=function(e){var t=e.masterPageType,n=e.masterPageListName;return t?br[t][0]:n?br[n][0]:br[e.pageListName][1]}}),Ne=fs(function(){this.isPositive=function(e){return f.isNumeric(e)&&+e>0}}),Re=fs(function(){this.handleAjaxException=function(e){Re.handleGeneralException(R.getExceptionType(e))},this.handleGeneralException=function(e){ee.error("Error: "+e)}});!function(e){function t(e,t){void 0===e.width&&(e.width=t.outerWidth())}function n(e,t){void 0===e.height&&(e.height=t.outerHeight())}function i(t){return isFinite(t)?{left:t,top:t,right:t,bottom:t}:e.quickExtend({left:0,top:0,right:0,bottom:0},t)}e.fn.scrollParent=function(){var t;return t=e.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e(this).css("position"))&&/(auto|scroll|hidden)/.test(e(this).css("overflow")+e(this).css("overflow-x")+e(this).css("overflow-y"))}).eq(0):this.parents().filter(function(){return/(auto|scroll|hidden)/.test(e(this).css("overflow")+e(this).css("overflow-x")+e(this).css("overflow-y"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},e.fn.hasFixedAncestor=function(){return"fixed"===e(this).css("position")?!0:this.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0},e.absoluteToFixedOffset=function(e){var t=void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,n=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return{left:e.left-t,top:e.top-n}},e.translateOffset=function(e,t){return{left:e.left+(t.left?t.left:0),top:e.top+(t.top?t.top:0)}},e.splitArea=function(t,n){n=e.quickExtend({orientation:ct.Vertical,parts:2},n);var i,a=n.orientation,r=n.parts,o=[];if(a===ct.Vertical){var s=Math.floor(t.height/r);for(i=0;r>i;i++){var l=t.top+i*s;o.push(e.calculateAreaInfo({left:t.left,right:t.right,top:l,bottom:i===r-1?t.bottom:l+s}))}}else{var c=Math.floor(t.width/r);for(i=0;r>i;i++){var u=t.left+i*c;o.push(e.calculateAreaInfo({top:t.top,bottom:t.bottom,left:u,right:i===r-1?t.right:u+c}))}}return o},e.translateArea=function(t,n){return e.extendedAreaInfo({left:t.left+e.valueOrDefault(n.left,0),top:t.top+e.valueOrDefault(n.top,0),width:t.width,height:t.height})},e.getOffsetDelta=function(e,t){return{left:e.left-t.left,top:e.top-t.top}},e.resolveAxis=function(e){var t={north:"n"===e||"ne"===e||"nw"===e,south:"s"===e||"se"===e||"sw"===e,east:"e"===e||"se"===e||"ne"===e,west:"w"===e||"sw"===e||"nw"===e};return t.horizontal=t.east||t.west,t.vertical=t.north||t.south,t},e.normalizeToMinSize=function(e,t){return{width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)}},e.calculateWindowSize=function(){return{width:document.documentElement.clientWidth,height:e.isIOS()?e.getIOSWindowHeight():window.innerHeight||document.documentElement.clientHeight}},e.getWindowArea=function(t){t=e.extend({left:0,top:0,right:0,bottom:0},t);var n=e.calculateWindowSize(),i=n.width,a=n.height,r=e(document).scrollTop(),o=e(document).scrollLeft(),s=r+a,l=o+i;return e.extendedAreaInfo({left:o+t.left,top:r+t.top,bottom:s-t.bottom,right:l-t.right})},e.fn.positionInWindow=function(t){t=e.extend({vertically:!1,horizontally:!1,horizontalPadding:0,verticalPadding:0,horizontalAnchor:"left",verticalAnchor:"top"},t);var n=e.getWindowArea();return n.left+=t.horizontalPadding,n.right-=t.horizontalPadding,n.top+=t.horizontalPadding,n.bottom-=t.horizontalPadding,e(this).positionInArea(n,t)},e.fn.moveToArea=function(t,n){n=e.extend({horizontalAnchor:!1,verticalAnchor:!1},n);var i=n.horizontalAnchor,a=n.verticalAnchor,r=this,o=r.getArea(),s=0,l=0;o.leftt.right&&(s=t.right-o.right),o.topt.bottom&&(l=t.bottom-o.bottom);var c=parseInt(r.css("left")),u=parseInt(r.css("right")),d=parseInt(r.css("top")),g=parseInt(r.css("bottom"));return"left"===i?r.css("left",c+s):"right"===i&&r.css("right",u-s),"top"===a?r.css("top",d+l):"bottom"===a&&r.css("bottom",g-l),r},e.fn.positionInArea=function(t,n){n=e.extend({vertically:!1,horizontally:!1,horizontalAnchor:"left",verticalAnchor:"top"},n);var i,a=n.horizontalAnchor,r=n.verticalAnchor,o=e(this),s="fixed"===o.css("position");i=s?{left:parseInt(o.css("left")),top:parseInt(o.css("top"))}:o.offset();var l=e.getArea(i,o.outerSize()),c={},u=!0;return n.horizontally&&(l.leftt.right&&(c.right=t.right,u=!1)),n.vertically&&(l.topt.bottom&&(c.bottom=t.bottom,u=!1)),u||o.setOffset(c,{horizontalAnchor:a,verticalAnchor:r}),this},e.fn.positionToFit=function(t,n,i,a){a=e.extend({fallbackPositioning:0,positionInTargetArea:!0,padding:0},a);var r=e(this);t=e.shrinkArea(t,a.padding);var o=void 0;if(void 0!==i&&(o=e.getArea(i.offset(),i.outerSize())),a.functionsOrder){for(var s=a.functionsOrder,l=[],c=0;c=t.width&&n.height>=t.height)return{width:t.width,height:t.height,ratio:1};var r,o=n.width/t.width,s=n.height/t.height;r=i?Math.max(o,s):Math.min(o,s);var l=a.ceilFractions?"ceil":"floor";return{width:Math[l](t.width*r),height:Math[l](t.height*r),ratio:r}},e.fn.left=function(t){return void 0!=t?this.each(function(){e(this).offset({left:t,top:e(this).offset().top})}):e(this[0]).offset().left},e.fn.bottom=function(t){return void 0!=t?this.each(function(){e(this).offset({left:e(this).offset().left,top:t-e(this).outerHeight()})}):e(this[0]).offset().top+e(this[0]).outerHeight()},e.fn.top=function(t){return void 0!=t?this.each(function(){e(this).offset({left:e(this).offset().left,top:t})}):e(this[0]).offset().top},e.fn.centerInParent=function(t){t=e.quickExtend({centerHorizontally:!0,centerVertically:!0,isContentCenter:!1},t),e(this).each(function(){var n=e(this).offsetParent(),i=n.getCenter(t.isContentCenter);e(this).center(i,t)})},e.fn.getCenter=function(t){void 0===t&&(t=!1);var n=e(this[0]);if(t){var i=e.relativePosition(n.offset(),parseInt(n.css("paddingLeft")),parseInt(n.css("paddingTop")));return e.relativePosition(i,n.width()/2,n.height()/2)}return e.relativePosition(e(this[0]).offset(),e(this[0]).outerWidth()/2,e(this[0]).outerHeight()/2)},e.fn.center=function(t,n){if(n=e.quickExtend({centerHorizontally:!0,centerVertically:!0},n),t){for(var i=0;it.top&&(i[gt.Top]=e.calculateAreaInfo({top:t.top,left:t.left,width:t.width,bottom:Math.min(n.top,t.bottom)})),n.bottomt.left&&(i[gt.Left]=e.calculateAreaInfo({top:Math.max(t.top,n.top),left:t.left,right:Math.min(t.right,n.left),bottom:Math.min(t.bottom,n.bottom)})),n.topn.right||n.top>n.bottom?null:n},e.containsArea=function(t,n){return e.isInsideArea(t,{top:n.top,left:n.left})&&e.isInsideArea(t,{top:n.bottom,left:n.right})},e.isInsideArea=function(t,n,i){return t=e.getAbsoluteArea(t,i),t.left<=n.left&&t.right>=n.left&&t.top<=n.top&&t.bottom>=n.top},e.unionAreas=function(t){var n=e.minValue(t,function(e){return e.left}),i=e.minValue(t,function(e){return e.top}),a=e.maxValue(t,function(e){return e.right}),r=e.maxValue(t,function(e){return e.bottom});return e.extendedAreaInfo({left:n,top:i,right:a,bottom:r})},e.areasIntersects=function(t,n){return e.areasIntersectsHorizontal(t,n)&&e.areasIntersectsVertical(t,n)},e.areasIntersectsHorizontal=function(t,n,i){return i=e.valueOrDefault(i,{left:0,right:0}),!(t.right-i.rightn.right)},e.areasIntersectsVertical=function(e,t){return!(e.bottomt.bottom)},e.intersectAreas=function(t){var n=e.maxValue(t,function(e){return e.left}),i=e.maxValue(t,function(e){return e.top}),a=e.minValue(t,function(e){return e.right}),r=e.minValue(t,function(e){return e.bottom});return e.extendedAreaInfo({left:n,top:i,right:a,bottom:r})},e.adjustArea=function(t,n){t=e.quickExtend({},t),n=e.asArray(n);for(var i=0;i1&&i.push(i[0]);for(var r,o=!1,s=void 0,l=0;l0&&(c=i(a,ct.Horizontal,n(this._horizontalAlignments,this._preferHorizontally),l)),this._verticalAlignments.length>0&&(u=i(a,ct.Vertical,n(this._verticalAlignments,this._preferVertically),l));var d={horizontalAlignment:c,verticalAlignment:u};for(s=0;si;i++)for(var a=arguments[i],r=0;r=t)return!0;return!1},e.containsOneOfKeys=function(t){for(var n=arguments.length,i=1;n>i;i++){var a=arguments[i];if(e.isArray(a)){var r=a;for(i=0;i=e;e++)bt[String.fromCharCode(e)]=e;for(e=0;9>=e;e++)bt["NUM"+e]=48+e;for(e=1;12>=e;e++)bt["F"+e]=111+e}(),function(e){var t={};e.unScheduleOperation=function(e){void 0!==e&&window.clearInterval(e)},e.scheduleOperation=function(e,t){var n=window.setInterval(function(){e(),window.clearInterval(n)},t);return n},e.scheduleNamedOperation=function(n,i,a){t[n]=e.scheduleOperation(i,a)},e.unScheduleNamedOperation=function(n){var i=t[n];void 0!==i&&(e.unScheduleOperation(i),delete t[n])},e.enqueueOperation=function(t,n,i){e(document).enqueueOperation(t,n,i)},e.fn.enqueueOperation=function(t,n,i){void 0==e(this).data("enqueued-operations")&&e(this).data("enqueued-operations",[]);var a=e(this).data("enqueued-operations");void 0===a[t]&&e.beginInvoke(function(){a[t].operation.call(a[t].args),a[t]=void 0}),a[t]={operation:n,args:i}},e.createDelayedFunction=function(e){var t={original:e,delayedCall:null,delayedFunction:function(){t.delayedCall={self:this,arguments:arguments},window.setTimeout(function(){t.invokeDelayed()},0)},invokeDelayed:function(){if(t.delayedCall){var e=t.delayedCall;t.delayedCall=null,t.original.apply(e.self,e.arguments)}}};return t},e.delayEventHandler=function(e){var t=null;return function(n){var i=this;t=n,window.setTimeout(function(){if(t){var n=t;t=null,e.call(i,n)}},0)}}}(p);var Ct={Normal:"scrolling-mode-normal",Touch:"scrolling-mode-touch",Hybrid:"scrolling-mode-hybrid"},It=function(e){function t(t){return 9===t.nodeType?t:e.isWindow(t)?t.document:!1}var n=Ie.createContextClass(function(){return e("body")}),i=C.extend("ScrollingController",{init:function(t,n){n=e.quickExtend({scrollableContainer:t,useMouseScrolling:!0,orientation:"vertical",sensitivity:50},n);var i=this;this._scrollTrackingEnabled=!0;var a=w.create(function(){return bn.create(t,{properties:["scrollHeight","scrollWidth","height","width"],minInterval:100,callback:function(){i.refresh()}})});this._autoRefresh=O.create(!1,{valueChangeCallback:function(e){var t=a.getValue();if(e){t.activate();var n=t.checkForChanges();n||i.refresh()}else t.deactivate(),i.refresh()}}),this._data={mouseMoveScrollingActive:!1},this.id=e.uniqueID(),this.$element=t,this.isEnabled=!0,this.isEnabledFlag=O.create(!0),this.refreshedEvent=x.create(),this.scrollingEvent=x.create(),this.scrollingStartEvent=x.create(),this.scrollingStopEvent=x.create(),this.viewportChangedEvent=x.create(),this.scrollingAnimations=0,this.options=n},toggleScrollTracking:function(e){this._scrollTrackingEnabled=e},setOptions:function(t){e.quickExtend(this.options,t),this.refresh()},toggleAutoRefresh:function(e){return this._autoRefresh.setValue(e),this},refresh:function(){return this.refreshedEvent.fireNew(),this},scroll:function(e,t,n,i){void 0===t&&(t=!0),t?this.scrollToOffset(this.getScrollOffset()+e,n,void 0,i):this.scrollToOffset(e,n,void 0,i)},getScrollOffset:function(t){t=e.valueOrDefault(t,this.options.orientation);var n=this.$element;return n.is("iframe")&&(n=e(n[0].contentWindow)),"vertical"===t?n.scrollTop():n.scrollLeft()},scrollToOffset:function(t,n,i,a){var r=this;void 0===n&&(n=!1);var o=r.$element,s=!1;o.is("iframe")&&(n=!1,s=!0);var l="vertical"===e.valueOrDefault(a,r.options.orientation),c=r.getMaxScrollOffset(a),u=Math.min(c,t);if(r.animationTarget=u,r.$element.stop("scrolling",!0),n){r.scrollingAnimations++;var d=l?{scrollTop:u}:{scrollLeft:u};r.scrollingStartEvent.fireNew(),r.$element.animate(d,{duration:"fast",queue:"scrolling",complete:function(){r.scrollingAnimations--,r.animationTarget=void 0,void 0!==i&&i(),0===r.scrollingAnimations&&r.scrollingStopEvent.fireNew(),r.viewportChangedEvent.fireNew(),r.scrollingEvent.fireNew()},step:function(){r.viewportChangedEvent.fireNew()}}).dequeue("scrolling")}else l?s?o[0].contentWindow.scrollTo(e(o[0].contentWindow).scrollLeft(),u):o.scrollTop(u):s?o[0].contentWindow.scrollTo(u,e(o[0].contentWindow).scrollTop()):o.scrollLeft(u),r.viewportChangedEvent.fireNew(),void 0!==i&&i(),r.scrollingStopEvent.fireNew()},canScrollVertically:function(){return this.getMaxScrollOffset(ct.Vertical)>0},getMaxScrollOffset:function(t){var n=this;return t=e.valueOrDefault(t,n.options.orientation),"vertical"===t?n.$element.getMaxScrollTop():n.$element.getMaxScrollLeft()},disable:function(){var e=this.$element;e.is("iframe")||e.removeClass("scrollable-pane"),this._mouseWheelController&&this._mouseWheelController.disable(),this.isEnabled=!1,this.isEnabledFlag.setFalse()},enable:function(){var e=this.$element;e.is("iframe")||e.addClass("scrollable-pane"),this._mouseWheelController&&this._mouseWheelController.enable(),this.isEnabled=!0,this.isEnabledFlag.setTrue()},toggleEnabled:function(e){e?this.enable():this.disable()},bringToViewport:function(e){var t=this.$element;if(e.parents().filter(t)){var n=t.getArea(),i=e.getOuterArea(),a=this.options.orientation;a===ct.Vertical&&(i.topn.bottom&&t.scrollTop(t.scrollTop()+(i.bottom-n.bottom)),this.refresh())}},_trackScrolling:function(e){var t=this;e.bind("scroll",function(){t._scrollTrackingEnabled&&t.scrollingEvent.fireNew()})}});return i.ScrollingMode=_.create(Ct.Normal),e(document).ready(function(){i.ScrollingMode.valueChangedEvent.bindAndExecute(function(){n.setValue(i.ScrollingMode.getValue())})}),e.fn.getScrollableController=function(){return e(this).data("widget-scrollable")},e.fn.scrollable=function(t){var n=this.data("widget-scrollable");return void 0===n&&(n=new i(e(this),t),this.data("widget-scrollable",n),n.$element.addClass("scrollable-pane"),n._trackScrolling(n.$element),n.options.useMouseScrolling&&(n._mouseWheelController=n.options.scrollableContainer.setMouseWheelScrolling(n))),e.isPlainObject(t)&&e.extend(n.options,t),n},e.fn.getMaxScrollTop=function(){if(this.is("iframe"))return e(this[0].contentWindow.document.body)[0].scrollHeight-e(this).height();if(this.is("body"))return this[0].scrollHeight-e(window).height();var n=t(this[0]);return n?n.body.scrollHeight-n.documentElement.clientHeight:e(this)[0].scrollHeight-e(this).height()},e.fn.getMaxScrollLeft=function(){if(this.is("iframe"))return e(this[0].contentWindow.document.body)[0].scrollWidth-e(this).height();var n=t(this[0]);return n?n.body.scrollWidth-n.documentElement.clientWidth:this.getScrollWidth()-this.width()},e.fn.getMaxScrollHeight=function(){return this.getMaxScrollTop()},e.fn.getMaxScrollWidth=function(){return this.getMaxScrollLeft()},e.fn.getScrollWidth=function(){var t=e(this).data("customScrollWidth");return void 0!==t?e.evaluateWhenFunction(t):e(this)[0].scrollWidth},e.fn.getScrollHeight=function(){return e(this)[0].scrollHeight},e.fn.setCustomScrollWidth=function(t){return e(this).data("customScrollWidth",t)},e.fn.setMoveScrolling=function(t,n){n=e.extend({enableVerticalScrolling:!0,enableHorizontalScrolling:!0,sensitivity:1},n);var i=this,a=i.preventBrowserBehaviour(),r=i.data("moveScrolling");r&&r.clear(),i.bind("mousedown.initmovescrolling touchstart.initmovescrolling",function(i){var a=e.getMouseOffset(i),r=t.getScrollOffset(ct.Vertical),o=t.getScrollOffset(ct.Horizontal);e(document).bind("mousemove.movescrolling touchmove.movescrolling",function(i){var s=e.getMouseOffset(i),l=s.left-a.left,c=s.top-a.top;n.enableHorizontalScrolling&&t.scrollToOffset(o-l*n.sensitivity,!1,void 0,ct.Horizontal),n.enableVerticalScrolling&&t.scrollToOffset(r-c*n.sensitivity,!1,void 0,ct.Vertical)}).one("mouseup.movescrolling touchend.movescrolling",function(){e(document).unbind(".movescrolling")})});var o={clear:function(){i.unbind(".initmovescrolling"),e(document).unbind(".movescrolling"),a.clear()}};return i.data("moveScrolling",o),o},e.fn.setMouseWheelScrolling=function(t){function n(e,t){if(r){var n="vertical"===r.options.orientation&&r.$element.getMaxScrollTop()>0||"horizontal"===r.options.orientation&&r.$element.getMaxScrollWidth()>0;return n?(r.scroll(0-t*r.options.sensitivity,!0,!1),e.preventDefault(),e.returnValue=!1,!1):void 0}}var i=e(this),a={},r=t,o=!1;return e.extend(a,{setTarget:function(e){r=e},disable:function(){o&&(o=!1,i.unbind("mousewheel.scrolling"))},enable:function(){o||(o=!0,i.bind("mousewheel.scrolling",function(t,i){var a="vertical"===r.options.orientation;if(!(a&&e(t.target).closest(".vertically-scrollable").length>0||e(t.target).closest(".horizontally-scrollable").length>0))return n(t,i)}))},toggleEnable:function(e){e?a.enable():a.disable()}}),a.enable(),a},i}(p);!function(e){function t(e,t,n,i){var a="scroll"+t,r=a+"prop",o={},s={};return o[r]=e[a](),s[r]=n,Nn.create(o,{onPropertiesChanged:function(t){requestAnimationFrame(function(){e[a](t[r])})}}).animate(s,i)}e.fn.animateScrollTop=function(e,n){t(this,"Top",e,n)},e.fn.animateScrollLeft=function(e,n){t(this,"Left",e,n)},e.fn.setScrollingViewport=function(e){var t=e.left,n=e.top;"center"===t&&(t=this.getMaxScrollLeft()/2),"center"===n&&(n=this.getMaxScrollLeft()/2),void 0!==t&&this.scrollLeft(t),void 0!==n&&this.scrollTop(n)}}(p),function(e){function t(t){var n={width:e(t).css("width"),"font-size":e(t).css("font-size"),"font-family":e(t).css("font-family"),"font-weight":e(t).css("font-weight"),"white-space":e(t).css("white-space"),position:"absolute"};return e("
    ").css(n).appendTo("body").wrapText()}e.fn.copyTextStyle=function(t){var n={"font-size":t.css("font-size"),"font-family":t.css("font-family"),"font-weight":t.css("font-weight"),"white-space":t.css("white-space"),"word-spacing":t.css("word-spacing"),"line-height":t.css("line-height")};return e(this).css(n)},e.fn.measureText=function(t,n){void 0===n&&(n=!0);var i={width:n?e(this).css("width"):"auto","font-size":e(this).css("font-size"),"font-family":e(this).css("font-family"),"font-weight":e(this).css("font-weight"),"white-space":e(this).css("white-space"),"word-spacing":e(this).css("word-spacing"),"word-wrap":e(this).css("word-wrap"),"line-height":e(this).css("line-height"),position:"absolute"},a=e("
    ").css(i).html(t).appendTo(e(this).parent()).wrapText(),r=a.height(),o=a.width();return a.remove(),{height:r,width:o}},e.fn.trimText=function(n,i){i=e.quickExtend({formattingFunction:function(e){return e}},i);var a=e(this).height(),r=t(this).css({height:a,overflow:"hidden"});if(r.html(i.formattingFunction(n)),r[0].scrollHeight<=a)e(this).html(i.formattingFunction(n));else{r.html("");for(var o="",s="",l=0;ln?t.substr(0,i)+"..."+t.substr(t.length-a,t.length):t},e.fn.wrapText=function(){return e(this).css("word-wrap","break-word")},e.fn.selectRange=function(t,n){if(e.isPlainObject(t)){var i=e.quickExtend({},t);t=i.start,n=i.end}return this.each(function(){if(this.setSelectionRange)this.focus(),this.setSelectionRange(t,n);else if(this.createTextRange){var e=this.createTextRange();e&&(e.collapse(!0),e.moveEnd("character",n),e.moveStart("character",t),e.select())}})},e.fn.getSelectionRange=function(){var e=this[0];if(e.setSelectionRange)return{start:e.selectionStart,end:e.selectionEnd};e.focus();var t=document.selection.createRange(),n=t.text.length;t.moveStart("character",-e.value.length);var i=t.text.length,a=i-n,r=a+n;return{start:a,end:r}};var n={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},i=RegExp(/(&|<|>|"|'|`)/g);e.fn.unescape=function(e){if(null==e)return"";var t=(""+e).replace(i,function(e){return n[e]});return t.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})}}(p),/*! Build-0.6: color.core.js color.rgb.js color.huebased.js color.hsv.js color.hsl.js color.object.js color.parse.js color.related.js color.palette.css3.js color.css.js */ /*! * jQuery Colour 0.6 * * Copyright (c) 2009 Adaptavist.com * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * Author: Mark Gibson (jollytoad at gmail dot com) * * http://www.adaptavist.com/display/jQuery/Colour+Library */ p.color||function(e){e.color={isEqual:function(e,t){if(e.length!==t.length)return!1;for(var n=e.length;n--;)if(e[n]!==t[n])return!1;return!0},fix:function(e,t){for(var n=t.length;n--;)if("number"==typeof e[n])switch(t.charAt(n)){case"i":e[n]=Math.round(e[n]);break;case"o":e[n]=Math.min(255,Math.max(0,Math.round(e[n])));break;case"1":e[n]=Math.min(1,Math.max(0,e[n]))}return e},self:function(e){return e},alpha:function(e){return void 0===e?1:e},palette:{},fns:[]}}(p),p.color&&function(e){e.color.RGB={fix:function(t){return t=e.color.fix(t,"ooo1")},toRGB:e.color.self,toHEX:function(e){return"#"+(16777216+65536*e[0]+256*e[1]+e[2]).toString(16).slice(-6)},toCSS:function(t,n){return n||0!==e.color.alpha(t[3])?e.color.alpha(t[3])<1?"rgba("+t.join(",")+")":"rgb("+Array.prototype.slice.call(t,0,3).join(",")+")":"transparent"},red:function(e){return e[0]},green:function(e){return e[1]},blue:function(e){return e[2]},alpha:function(t){return e.color.alpha(t[3])}},e.color.RGB.toString=e.color.RGB.toHEX,e.color.fns.push("RGB.toRGB","RGB.toHEX","RGB.toCSS","RGB.red","RGB.green","RGB.blue","RGB.alpha")}(p),p.color&&function(e){e.color.HueBased={fix:function(t){return t[0]=(t[0]+1)%1,e.color.fix(t,"1111")},complementary:function(e,t){return[(e[0]+.5+(t||0))%1,e[1],e[2],e[3]]},analogous:function(e,t){return[(e[0]+1+(t||0))%1,e[1],e[2],e[3]]},hue:function(e){return e[0]},alpha:function(t){return e.color.alpha(t[3])}}}(p),p.color&&function(e){e.color.HSV=e.extend({toHSV:e.color.self,toRGB:function(e){var t=6*e[0],n=Math.floor(t),i=t-n,a=e[1],r=255*e[2],o=e[3],s=Math.round(r*(1-a)),l=Math.round(r*(1-i*a)),c=Math.round(r*(1-(1-i)*a));switch(r=Math.round(r),n%6){case 0:return[r,c,s,o];case 1:return[l,r,s,o];case 2:return[s,r,c,o];case 3:return[s,l,r,o];case 4:return[c,s,r,o];case 5:return[r,s,l,o]}},saturationV:function(e){return e[1]},value:function(e){return e[2]}},e.color.HueBased),e.color.RGB.toHSV=function(e){var t=e[0]/255,n=e[1]/255,i=e[2]/255,a=Math.min(t,n,i),r=Math.max(t,n,i),o=r-a;return[0===o?0:(n===r?(i-t)/o/6+1/3:i===r?(t-n)/o/6+2/3:(n-i)/o/6+1)%1,0===o?0:o/r,r,e[3]]},e.color.fns.push("HSV.toHSV","HSV.toRGB","RGB.toHSV","HSV.complementary","HSV.analogous","HSV.hue","HSV.saturationV","HSV.value","HSV.alpha")}(p),p.color&&function(e){e.color.HSL=e.extend({toHSL:e.color.self,toRGB:function(e){function t(e){var t=0>e?e+1:e>1?e-1:e;return 1/6>t?o+6*(r-o)*t:.5>t?r:2/3>t?o+6*(r-o)*(2/3-t):o}var n=e[0],i=e[1],a=e[2],r=.5>a?a*(1+i):a+i-a*i,o=2*a-r;return[Math.round(255*t(n+1/3)),Math.round(255*t(n)),Math.round(255*t(n-1/3)),e[3]]},saturationL:function(e){return e[1]},lightness:function(e){return e[2]}},e.color.HueBased),e.color.RGB.toHSL=function(e){var t=e[0]/255,n=e[1]/255,i=e[2]/255,a=Math.min(t,n,i),r=Math.max(t,n,i),o=r-a,s=r+a;return[0===o?0:(n===r?(i-t)/o/6+1/3:i===r?(t-n)/o/6+2/3:(n-i)/o/6+1)%1,0===o?0:s>1?o/(2-r-a):o/s,s/2,e[3]]},e.color.fns.push("HSL.toHSL","HSL.toRGB","RGB.toHSL","HSL.complementary","HSL.analogous","HSL.hue","HSL.saturationL","HSL.lightness","HSL.alpha")}(p),p.color&&p.Color||function(e){function t(t,n){for(var i=e.Color.isInstance(t)&&t.space!==this.space?this.to(t.space):new e.Color(this),a=i.length,r=!1;a--;)if("number"==typeof t[a]){var o=n?i[a]+t[a]:t[a];o!==i[a]&&(i[a]=o,r=!0)}return r?i.setName():this}function n(t,n,i,a,r){return function(){var o=[t];Array.prototype.push.apply(o,arguments);var s=i.apply(n,o);return e.isArray(s)?new e.Color(s,a,r?t.name:void 0):s}}function i(t,i){var a=/^to/.test(i)?i.substring(2):!1;return function(){var t=this,r=t.util();r[i]||(t=t.to(e.Color.fnspace[i]),r=t.util());var o=n(t,r,r[i],a||t.space,!!a),s=o.apply(t,arguments);return a?(this[i]=function(){return s},e.Color.isInstance(s)&&(t=this,s["to"+this.space]=function(){return t})):this[i]=o,s}}function a(){var t=this.split("."),n=t[1],a=t[0];e.Color.fnspace[n]||n==="to"+a||(e.Color.fnspace[n]=a),e.Color.fn[n]||(e.Color.fn[n]=i(this,n))}e.Color=function(t,n,i){if("function"==typeof this)return new e.Color(t,n,i);if("string"==typeof t&&e.color.parse&&(i||(i=t),t=e.color.parse(t)),t&&t.length){var a;for(a=this.length=t.length;a--;)this[a]=t[a]}t&&(this.space=n||t.space||"RGB",this.name=i||t.name)},e.Color.fn=e.Color.prototype={color:"0.6",util:function(){return e.color[this.space]},setAlpha:function(e){return this.length<4&&this.push(1),void 0!==e&&(this[3]=e),this},getAlpha:function(){return void 0===this[3]?1:this[3]},to:function(e){return this["to"+e]()},fix:function(){return this.util().fix(this)},modify:function(e){return t.call(this,e)},adjust:function(e){return t.call(this,e,!0)},setName:function(e){return this.name=e,this},toString:function(){if(!this.space)return"";var e=this.util();return e.hasOwnProperty("toString")?e.toString(this):""+this.to("RGB")},join:[].join,push:[].push},e.Color.isInstance=function(t){return t&&"object"==typeof t&&t.color===e.Color.fn.color&&t.space},e.Color.fnspace={},e.each(e.color.fns,a),e.color.fns.push=function(){for(var e=arguments.length,t=0;e>t;t++)a.call(arguments[t]);return Array.prototype.push.apply(this,arguments)}}(p),p.color&&function(e){e.extend(e.color,{parse:function(t){var n;return"string"==typeof t?(n=/^\s*rgb(a)?\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*(?:,\s*([0-9]+(?:\.[0-9]+)?)\s*)?\)\s*$/.exec(t))&&!n[1]==!n[5]?[parseInt(n[2],10),parseInt(n[3],10),parseInt(n[4],10),n[5]?parseFloat(n[5]):1]:(n=/^\s*rgb(a)?\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*(?:,\s*([0-9]+(?:\.[0-9]+)?)\s*)?\)\s*$/.exec(t))&&!n[1]==!n[5]?[255*parseFloat(n[2])/100,255*parseFloat(n[3])/100,255*parseFloat(n[4])/100,n[5]?parseFloat(n[5]):1]:(n=/^\s*#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})\s*$/.exec(t))?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),1]:(n=/^\s*#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])\s*$/.exec(t))?[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),1]:(n=/^\s*hsl(a)?\(\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*(?:,\s*([0-9]+(?:\.[0-9]+)?)\s*)?\)\s*$/.exec(t))&&!n[1]==!n[5]?[parseInt(n[2],10)/360,parseFloat(n[3])/100,parseFloat(n[4])/100,n[5]?parseFloat(n[5]):1]:e.color.named(t):!t||3!==t.length&&4!==t.length?void 0:(3===t.length&&t.push(1),t)},named:function(t){var n;return t=e.trim(t.toLowerCase()),"transparent"===t?[0,0,0,0]:(e.each(e.color.palette,function(i,a){return a[t]?(n=e.merge([],a[t]),n.push(1),!1):void 0}),n)}})}(p),p.Color&&function(e){e.Color.fn.related=function(t){var n=e.Color.fn.related.i18n,i=t||e.Color.fn.related.offset,a=Math.round(360*i)+n.deg;return{"anal-":this.analogous(-i).setName(n.anal+" -"+a),anal0:this.analogous().setName(n.orig),"anal+":this.analogous(i).setName(n.anal+" +"+a),"comp-":this.complementary(-i).setName(n.split+" -"+a),comp0:this.complementary().setName(n.comp),"comp+":this.complementary(i).setName(n.split+" +"+a),"triad-":this.analogous(-1/3).setName(n.triad+" -120"+n.deg),triad0:this.analogous().setName(n.orig),"triad+":this.analogous(1/3).setName(n.triad+" +120"+n.deg)}},e.Color.fn.related.offset=30/360,e.Color.fn.related.i18n={deg:"\xb0",anal:"Analogous",orig:"Original",split:"Split Complementary",comp:"Complementary",triad:"Triadic"}}(p),p.color&&function(e){e.color.palette.css3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}(p),function(e){e.fn.cssColor=function(t){return e.Color(this.css(t))},e.Color.fn.applyCSS=function(t,n){return e(t).css(n,this.toCSS()),this}}(p);var St=fs(function(){function e(e,t){var n=f.valueOrDefault(t.stop,cs);return f.quickExtend(t,{stop:function(){n(),e.removeData("effect-controller")}}),e.data("effect-controller",t),t}function t(e){var t=e.data("effect-controller");t&&t.stop()}function n(e,t){t=f.quickExtend({mode:"show",direction:"left",easing:"linear",complete:cs},t),e.queue(function(){var n=e,i=["position","top","bottom","left","right"],a=t.mode,r=t.direction;f.effects.save(n,i),n.quickShow();var o=f.effects.createWrapper(n).css({overflow:"hidden"}),s="up"==r||"down"==r?"top":"left",l="up"==r||"left"==r?"pos":"neg",c=t.distance||("top"==s?n.outerHeight(!0):n.outerWidth(!0));"show"==a&&n.css(s,"pos"==l?isNaN(c)?"-"+c:-c:c);var u={};u[s]=("show"==a?"pos"==l?"+=":"-=":"pos"==l?"-=":"+=")+c,n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,always:function(){"hide"==a&&n.quickHide(),f.effects.restore(n,i),f.effects.removeWrapper(n),o.remove(),t.complete&&t.complete.apply(this,arguments),n.dequeue()}})})}function i(e,t){function n(){d||(d=!0,i&&i())}t=f.quickExtend({enableCssTransition:!1,easing:"linear",duration:200,flyDirection:{vertical:Z.AnimationDirections.Up,horizontal:Z.AnimationDirections.Left}},t);var i=t.complete,a=t.flyDirection;e.quickShow();var r,o=f.getWindowArea(),s=e.offset(),l=e.elementSize(),c={marginTop:0,marginLeft:0},u=document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body;r=document.all?u.scrollTop:window.pageYOffset,"top"===a.vertical?c.marginTop=-s.top-l.height:"bottom"===a.vertical?c.marginTop=o.bottom+r-s.top>0?o.bottom+r-s.top:o.bottom:c.marginTop=-(s.top-o.center.top),"left"===a.horizontal?c.marginLeft=-s.left-l.width:"right"===a.horizontal?c.marginLeft=o.right-s.left:c.marginLeft=-(s.left-o.center.left),e.stopCssAnimation({enableCssTransition:t.enableCssTransition}),e.css(c);var d=!1;c={marginTop:0,marginLeft:0},e.cssAnimate(c,{enableCssTransition:t.enableCssTransition,duration:t.duration,complete:function(){n()}})}function a(e,t){function n(){c||(c=!0,e.removeClass("fly-out-animation"),e.quickHide(),i&&i())}t=f.extend({enableCssTransition:!1,easing:"linear",duration:200,flyDirection:{vertical:Z.AnimationDirections.Up,horizontal:Z.AnimationDirections.Left}},t);var i=t.complete,a=t.flyDirection;e.quickShow(),e.css({marginTop:0,marginLeft:0});var r=f.getWindowArea(),o=e.offset(),s=e.elementSize(),l={marginTop:0,marginLeft:0};"top"===a.vertical?l.marginTop=-o.top-s.height:"bottom"===a.vertical?l.marginTop=r.bottom-o.top:l.marginTop=-(o.top-r.center.top),"left"===a.horizontal?l.marginLeft=-o.left-s.width:"right"===a.horizontal?l.marginLeft=r.right-o.left:l.marginLeft=-(o.left-r.center.left),e.stopCssAnimation({enableCssTransition:t.enableCssTransition});var c=!1;e.addClass("fly-out-animation"),e.cssAnimate(l,{enableCssTransition:t.enableCssTransition,duration:t.duration,complete:function(){n(),e.css({marginTop:0,marginLeft:0})}})}function r(e,t){function n(){r||(r=!0,e.removeClass("fading-animation"),"hide"===a&&(e.quickHide(),e.css("opacity",1)),i&&i())}t=f.quickExtend({effect:"show",enableCssTransition:!1,easing:"linear",duration:200},t);var i=t.complete,a=t.effect;e.stopCssAnimation({enableCssTransition:t.enableCssTransition}),"show"===a&&e.quickShow();var r=!1;e.addClass("fading-animation"),"show"===a&&e.css("opacity",0);var o={opacity:"show"===a?1:0};e.cssAnimate(o,{enableCssTransition:t.enableCssTransition,duration:t.duration,complete:function(){n()}})}function o(e,t){t=f.quickExtend({ignoreOffset:!1,getSize:function(){return e.elementSize()}},t);var n=t.ignoreOffset?!1:e.offset(),i=t.getSize(),a=(f.valueOrDefault(t.setElementSize,cs),e.attr("style")),r=e.css("position"),o=e.css("display");o&&"none"!==o||(o=l(e[0].tagName)?"inline-block":"block");var c=f.oneOfValues(r,["relative","static"]),u="absolute"===r?"absolute":"relative",d={position:u,display:o,"margin-left":e.css("marginLeft"),"margin-top":e.css("marginTop"),"margin-right":e.css("marginRight"),"margin-bottom":e.css("marginBottom"),"float":e.css("float"),"z-index":e.css("zIndex")},g=[];for(var p in d)g.push(p+":"+d[p]+";");var h=f("
    ".format(g.join(" "))).addClass(t.className);e.wrap(h),e.css({position:"relative",left:0,top:0,bottom:"",right:"",marginLeft:0,marginTop:0,marginBottom:0,marginRight:0}).addClass("has-effect-wrapper");var h=e.parent();return c||(s(e,i,n),n&&h.offset(n)),{$element:h,remove:function(){e.removeClass("has-effect-wrapper"),a?e.attr("style",a):e.removeAttr("style"),f(h.children()[0]).unwrap()}}}function s(e,t){e.css({width:t.width+"px",height:t.height+"px"})}function l(e){return u||(u=f.makeDictionaryFromKeys(c,!0)),!!c[e.toLowerCase()]}var c=["b","i","big","small","tt","abbr","acronym","cite","code","dfn","em","kbd","strong","samp","var","u","a","bdo","br","img","map","object","q","script","span","sub","sup","button","input","label","select","textarea"],u={};this.shake=function(n,i){function a(){y||(y=!0,m=f([]),f.eachItem(v,function(e,t){t.remove()}),d&&d())}t(n),i=f.quickExtend({direction:"left",times:1,distance:20,easing:"linear",duration:200},i);var r=i.distance,s=i.duration,l=i.easing,c=i.direction,u=i.times,d=i.complete,g="up"==c||"down"==c?"top":"left",p="up"==c||"left"==c?"pos":"neg",h=f.weakID("queue"),m=f([]),v=[];n.each(function(){var e=o(f(this));m.pushElements(e.$element),v.push(e)});for(var y=!1,b=0;u+1>b;b++){var C={};b%2===0?C[g]=("pos"==p?"-=":"+=")+(0===b||b===u?r:2*r):C[g]=("pos"==p?"+=":"-=")+(b===u?r:2*r),m.animate(C,{duration:s,easing:l,queue:h})}return m.queue(h,a).dequeue(h),e(n,{stop:function(){m.stop(h,!0,!0),a()}})},this.slideIn=function(e,t){t||(t={}),t.mode="show",e.each(function(){n(f(this),t)})},this.slideOut=function(e,t){t||(t={}),t.mode="hide",e.each(function(){n(f(this),t)})},this.flyIn=function(e,t){t||(t={}),e.each(function(){i(f(this),t)})},this.flyOut=function(e,t){t||(t={}),e.each(function(){a(f(this),t)})},this.fadeIn=function(e,t){t||(t={}),t.effect="show",e.each(function(){r(f(this),t)})},this.fadeOut=function(e,t){t||(t={}),t.effect="hide",e.each(function(){r(f(this),t)})},this.createEffectPlaceHolder=o}),Pt=fs(function(){function e(e,t,n,i,a){n?e.velocity(t,{duration:i,complete:a}):(e.css(t),a&&a())}function t(e){e.velocity("stop")}var n,i,a,r=I.create(function(){n=f('
    '),i=f('
    '),a=f('
    ')});this.animate=function(o,s){s=f.quickExtend({direction:"up",animationCallback:cs,animate:!0},s),r.execute();var l=s.direction,c=s.duration,u=s.pushContent,d=s.scrollingOffset,g="up"==l||"down"==l,p=s.distance||(g?o.outerHeight(!0):o.outerWidth(!0));n.outerSize(s.placeHolderSize);var h=na.getBodyElementContainer(),m=na.getBodyElementWrapper(),v=m.attr("style"),y=na.getBodyElement(),b=y.attr("style");m.addClass("slide-effect-body-wrapper"),h.addClass("slide-effect-body-container"),y.addClass("slide-effect"),y.css({top:-d.top});var C,I,S,P=m;u?(P=m,g?P.css({height:s.placeHolderSize.height}):P.css({width:s.placeHolderSize.width}),"up"==l?(I={top:p},S={top:0},C={top:"auto",bottom:"100%"}):"down"==l?(I={top:-p},S={top:0},C={top:"100%",bottom:"auto"}):"left"==l?(I={left:p},S={left:0},C={left:"auto",right:"100%"}):"right"==l&&(I={left:-p},S={left:0},C={left:"100%",right:"auto"})):(P=i,"up"==l?(I={top:0},S={top:-p},C={top:-p,bottom:"auto"}):"down"==l?(I={bottom:0},S={bottom:-p},C={top:"auto",bottom:-p}):"left"==l?(I={left:0},S={left:-p},C={left:-p,right:"auto"}):"right"==l&&(I={right:0},S={right:-p},C={left:"auto",right:-p})),i.css(C),P.addClass("slide-effect-animation"),o.appendTo(i),n.appendTo(h),a.appendTo(m),i.appendTo(m),e(P,I,s.animate,c,s.animationCallback);var w={};return f.quickExtend(w,{isClosed:!1,close:function(r){if(!w.isClosed){r=f.quickExtend({animate:!0,closeCallback:cs,closingCallback:cs},r),w.isClosed=!0;var s=function(){r.closingCallback(),n.detach(),o.detach(),i.detach(),a.detach(),y.setStyleAttr(b),y.removeClass("slide-effect"),P.removeClass("slide-effect-animation"),h.removeClass("slide-effect-body-container"),m.removeClass("slide-effect-body-wrapper"),m.setStyleAttr(v),i.setStyleAttr(),r.closeCallback()};t(P),e(P,S,r.animate,c,s)}}}),w}}),wt={NoAnimation:{name:"NoAnimation",show:function(e,t){e.quickShow(),t.complete()},hide:function(e,t){e.quickHide(),t.complete()}},Fade:{name:"Fade",show:function(e,t){St.fadeIn(e,t)},hide:function(e,t){St.fadeOut(e,t)}},Slide:{name:"Slide",show:function(e,t){St.slideIn(e,t)},hide:function(e,t){St.slideOut(e,t)}},Fly:{name:"Fly",show:function(e,t){St.flyIn(e,t)},hide:function(e,t){St.flyOut(e,t)}},DropDown:{show:function(e,t){e.slideDown(t.duration,t.complete)},hide:function(e,t){e.slideUp(t.duration,t.complete)}}};!function(e){e.fn.stopAnimations=function(){return this.hasClass("during-animation")&&this.stopCssAnimation(),this},e.fn.animateShow=function(t,n,i){n=e.quickExtend({complete:cs,duration:0},n);var a=this;return"string"==typeof t&&(t=wt[t]),void 0===t.show&&(t=wt.NoAnimation),a.stopAnimations(),a.addClass("during-animation"),t.show(a,e.extend(n,{complete:function(){a.removeClass("during-animation"),i()}})),this},e.fn.animateHide=function(t,n,i){var a=this;return n=e.quickExtend({duration:0},n),"string"==typeof t&&(t=wt[t]),void 0===t.hide&&(t=wt.NoAnimation),a.stopAnimations(),a.addClass("during-animation"),t.hide(a,e.quickExtend(n,{complete:function(){a.removeClass("during-animation"),i()}})),this},e.fn.showOnHover=function(t,n){var i=e(this);n=e.quickExtend({showingFunction:function(){e(this).show()},hidingFunction:function(){e(this).hide()}},n),e(t).hover(function(){n.showingFunction.call(i)},function(){n.hidingFunction.call(i)}),i.hide()},e.fn.animateVerticalOffset=function(e,t){return this.animateOffset({top:e},t,{moveHorizontally:!1,moveVertically:!0})},e.fn.animateHorizontalOffset=function(e,t){return this.animateOffset({left:e},t,{moveHorizontally:!0,moveVertically:!1})},e.fn.animateOffset=function(t,n,i){i=e.quickExtend({moveHorizontally:!0,moveVertically:!0},i);var a=this.offset(),r=i.moveHorizontally?t.left-a.left:0,o=i.moveVertically?t.top-a.top:0;if(0!==r||0!==o){var s={};0!==r&&(s.left=parseInt(this.css("left"))+r+"px"),0!==o&&(s.top=parseInt(this.css("top"))+o+"px"),this.animate(s,n)}},e.animateObject=function(t,n,i){return e.animateValue(t,n,e.extend({},i,{valueToProperties:function(e){var t={};for(var n in e)t["custom"+n]=e[n];return t},propertiesToValue:function(e){var t={};for(var n in e)t[n.substring(6)]=e[n];return t}}))},e.animateValue=function(t,n,i){function a(){return 0>=l?(u=!0,void i.complete()):(l--,r=e(e.quickExtend({},o)),void r.animate(s,{duration:i.duration,easing:i.easing,step:function(e,t){c[t.prop]=e,i.step(i.propertiesToValue(c))},complete:function(){a()}}))}i=e.extend({valueToProperties:function(e){return{value:e}},propertiesToValue:function(e){return e.value},times:1,duration:400,easing:"linear",step:cs,complete:cs},i);var r,o=i.valueToProperties(t),s=i.valueToProperties(n),l=i.times,c=e.quickExtend({},o),u=!1;return a(),{stop:function(e){l=0,r.stop(!0,e),e||a()}}},e.fn.stepAnimate=function(t,n,i,a,r){var o=e(this),s=void 0;e.isArray(n)&&(s=n[1],n=n[0]),r=e.quickExtend({maxDuration:!1,distance:0},r);var l=r.distance,c=r.maxDuration;if(void 0===s)switch(t){case"scrollTop":s=o.scrollTop();break;case"scrollLeft":s=o.scrollLeft();break;default:s=parseInt(o.css(t))}var u=Math.ceil(Math.abs(n-s)/i),d={};d[t]=n-l;var g=u*a;return o.stop(!0,!0),o.animate(d,e.quickExtend({},r,{duration:c?e.minValue([g,c]):g}))}}(p);var Et={Hover:"hovering",Toggle:"toggle-button-state-group",Disabling:"disable-state-group"};!function(e){function t(e,t,n,i,a,r){if(void 0!==i){if(null!==a&&void 0!==a&&!i.statesMap[a])throw Error("Unknown state");if(i.currentState!=a){var o=i.currentState;null!==o&&void 0!==o&&e.removeClass(i.currentState),null!==a&&void 0!==a&&e.addClass(a),i.currentState=a;var s=i.stateChangedEvent,l=t.stateChangedEvent;s&&s.fire(e,a,r),l&&l.fire(n,e,a,r)}}}var n=C.extend("ElementBooleanStateTracker",{init:function(e,t,n,i){this._disablingReasons=void 0,this._stateChangedEvent=void 0,this._$element=e,this._trueClass=t,this._falseClass=n,this._inState=!0,i&&e.addClass(t)},isInState:function(){return this._inState},onStateChanged:function(e){var t=this._stateChangedEvent;t||(t=x.create(),this._stateChangedEvent=t),t.bind(e)},toggleInState:function(e,t){t=void 0!==t?t:"default";var n=this._inState,i=this._$element,a=this._trueClass,r=this._falseClass,o=this._disablingReasons;e?o&&o.removeField(t):(o||(o=k.create(),this._disablingReasons=o),o.setField(t,!0));var s=!o||o.isEmpty(),l=n!==s;if(s?i.removeClass(r).addClass(a):i.removeClass(a).addClass(r),l){this._inState=s;var c=this._stateChangedEvent;c&&c.fireNew(s)}}}),i=C.extend("ElementBooleanState",{init:function(e,t,n){this._trackerDataField=e,this._trueClass=t,this._falseClass=n},_getTracker:function(e,t){return e[0][t]},_setTracker:function(e,t,n){e[0][t]=n},toggleState:function(e,t,i){var a=this._trackerDataField,r=this._getTracker(e,a);r||(r=new n(e,this._trueClass,this._falseClass,!1),this._setTracker(e,a,r)),r.toggleInState(t,i)},initializeState:function(e,t){var i=this._trackerDataField,a=this._getTracker(e,i);return a||(a=new n(e,this._trueClass,this._falseClass,!0),this._setTracker(e,i,a)),t&&a.onStateChanged(t),a},onStateChanged:function(e,t){var n=this.initializeState(e);n.onStateChanged(t)}}),a=new i("displayingStateTracker","state-displayed","state-hidden"),r=new i("visibilityStateTracker","state-visible","state-invisible"),o=new i("disablingStateTracker","state-enabled","state-disabled");e.fn.addStatesGroupsSupport=function(){var t=e(this),n=t.data("states-groups");return void 0===n&&(n={},t.data("states-groups",n)),n},e.fn.getStatesGroupData=function(t){var n=e(this).data("states-groups");return void 0===n?void 0:n[t]},e.fn.addStatesGroup=function(n,i,a){i=e.quickExtend({groupName:"default",elementPartsSelector:null},i);var r=e(this),o=i.groupName;void 0===a&&(a=r.addStatesGroupsSupport());var s;n instanceof Array?s=n:(s=[],e.eachEntry(n,function(e,t){s.push(t)}));var l=a[o];return void 0===l&&(l={states:s,statesMap:e.makeDictionaryFromKeys(s,!0),options:i,currentState:void 0},a[o]=l),i.stateChangeCallback&&(l.stateChangedEvent=x.create(),l.stateChangedEvent.bind(i.stateChangeCallback)),t(r,a,o,l,i.defaultState),this},e.fn.inState=function(t){return e(this).hasClass(t)},e.fn.bindStateChange=function(t,n,i){return e(this).each(function(){var a=e(this).getStatesGroupData(t),r=a.stateChangedEvent;r||(r=x.create(),a.stateChangedEvent=r),r.bind(n,i)})},e.fn.setState=function(n,i,a){i=e.valueOrDefault(i,"default");for(var r=0;r
    "),e.parent().prepend('')},this.createTable=function(e){e=f.extend({numberOfColumns:2,numberOfRows:1,isUniform:!0,inlineCellContent:!1,columnsGap:0,className:""},e);var t=e.numberOfColumns,n=e.numberOfRows,i=e.isUniform,a=e.sizeUnifiersGroup,r=e.inlineCellContent,o=e.columnsGap,s=e.className,l=[],c=o>0,u=new E;u.append('
    ',s);for(var d=0;n>d;d++){u.append('
    ',d,f.getIndexClasses(d,n-1)),c&&u.append('
    ',(t-1)*o);for(var g=0;t>g;g++){var p=new E;i&&p.append("width:{0}%;",f.adjustFraction(100/t,2)),c&&p.append('margin-right:{0}px;"',o),u.append('',g,f.getIndexClasses(g,t-1),""+p),u.append('',r?"vertically-top":"block"),u.append("")}c&&u.append("
    "),u.append("
    ")}if(a)for(var d=0;t>d;d++)l[d]=a.addSizeUnifier();u.append("
    ");var h=f(""+u),m={$element:h,appendTo:function(e){return h.appendTo(e),m},getCell:function(e,t){return h.find(".row-index-{0} .col-index-{1} .cell-content".format(e,t))},getColumnSizeUnifier:function(e){return l[e]},countRows:function(){return n},countColumns:function(){return t},countCells:function(){return n*t},distributeItems:function(e){f(".cell-content",h).each(function(t){f(this).append(e[t])})}};return m},this.createSizeUnifiersGroup=function(){var e=[],t=void 0;return{addSizeUnifier:function(){return t=kt.createSizeUnifier(),e.push(t),t},getCurrent:function(){return t},invalidate:function(){for(var t=0;t0?n.$leftBlock.outerWidth(!0):void 0,a=n.$rightBlock&&n.$rightBlock.length>0?n.$rightBlock.outerWidth(!0):void 0;void 0===i&&void 0===a||e.push({mainBlockController:n,marginLeft:i,marginRight:a})});for(var n=0;n0?n.outerWidth(!0):void 0,r=i&&i.length>0?i.outerWidth(!0):void 0;void 0!==a&&e.css("marginLeft",a),void 0!==r&&e.css("marginRight",r)},this.normalizeBlockField=function(e,t){t=f.quickExtend({leftBlockSelector:".left-block",rightBlockSelector:".right-block",mainBlockSelector:".main-block"},t);var n=f(t.mainBlockSelector,e),i=f(t.leftBlockSelector,e),a=f(t.rightBlockSelector,e);kt.normalizeBlock(n,{$leftBlock:i,$rightBlock:a})}});!function(e){e.fn.makeTable=function(t){t=e.quickExtend({itemsPerRow:3},t);for(var n=this,i=t.itemsPerRow,a=n.children(),r=void 0,o=e([]),s=1,l=1,c=0;c".format(s)).addClass(t.rowClass),s++,l=1,o.pushElements(r));var u=e("".format(l)).addClass(t.columnClass).append(a[c]).appendTo(r);c%i===0&&u.addClass("first"),(c+1)%i===0&&u.addClass("last"),l++}o.first().addClass("first"),o.last().addClass("last"),o.appendTo(n)},e.fn.unifySize=function(t){for(var n=kt.createSizeUnifier(),i=0;i1?r[1]:r[0];break;case"skewX":o=c=1,l=Math.tan(a(r));break;case"skewY":o=c=1,s=Math.tan(a(r));break;case"skew":o=c=1,r=r.split(","),l=Math.tan(a(r[0])),s=Math.tan(a(r[1]||0));break;case"matrix":r=r.split(","),o=+r[0],s=+r[1],l=+r[2],c=+r[3],y+=parseInt(r[4],10),b+=parseInt(r[5],10)}u=p*o+h*l,h=p*s+h*c,d=m*o+v*l,v=m*s+v*c,p=u,m=d}return[p,h,m,v,y,b]}function n(e){var t,n,i,a=e[0],r=e[1],o=e[2],s=e[3];return a*s-r*o?(t=Math.sqrt(a*a+r*r),a/=t,r/=t,i=a*o+r*s,o-=a*i,s-=r*i,n=Math.sqrt(o*o+s*s),o/=n,s/=n,i/=n,r*o>a*s&&(a=-a,r=-r,i=-i,t=-t)):t=n=i=0,{translate:[+e[4],+e[5]],rotate:Math.atan2(r,a),scale:[t,n],skew:[i,0]}}function i(t){t=t.split(")");for(var n,i,r,o=[0,0],s=0,l=[1,1],c=[0,0],u=t.length-1,d=e.trim;u--;)n=t[u].split("("),i=d(n[0]),r=n[1],"translateX"==i?o[0]+=parseInt(r,10):"translateY"==i?o[1]+=parseInt(r,10):"translate"==i?(r=r.split(","),o[0]+=parseInt(r[0],10),o[1]+=parseInt(r[1]||0,10)):"rotate"==i?s+=a(r):"scaleX"==i?l[0]*=r:"scaleY"==i?l[1]*=r:"scale"==i?(r=r.split(","),l[0]*=r[0],l[1]*=r.length>1?r[1]:r[0]):"skewX"==i?c[0]+=a(r):"skewY"==i?c[1]+=a(r):"skew"==i&&(r=r.split(","),c[0]+=a(r[0]),c[1]+=a(r[1]||"0"));return{translate:o,rotate:s,scale:l,skew:c}}function a(e){return~e.indexOf("deg")?parseInt(e,10)*(2*Math.PI/360):~e.indexOf("grad")?parseInt(e,10)*(Math.PI/200):parseFloat(e)}function r(e){return e=/\(([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(e),[e[1],e[2],e[3],e[4],e[5],e[6]]}for(var o,s,l,c,u=document.createElement("div"),d=u.style,g="transform",f="Transform",p=["O"+f,"ms"+f,"Webkit"+f,"Moz"+f,g],h=p.length,m=/Matrix([^)]*)/;h--;)if(p[h]in d){e.support[g]=o=p[h];break}switch(e.support.transform){case"MozTransform":e.support.transformCSS="-moz-transform";break;case"WebkitTransform":e.support.transformCSS="-webkit-transform";break;case"OTransform":e.support.transformCSS="-o-transform";break;case"msTransform":e.support.transformCSS="-ms-transform";break;default:e.support.transformCSS="transform"}o||(e.support.matrixFilter=s=""===d.filter),u=d=null,e.cssNumber[g]=!0,o&&o!=g?(e.cssProps[g]=o,o=="Moz"+f?l={get:function(t,n){return n?e.css(t,o).split("px").join(""):t.style[o]},set:function(e,t){e.style[o]=/matrix[^)p]*\)/.test(t)?t.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/,"matrix$1$2px,$3px"):t}}:/^1\.[0-5](?:\.|$)/.test(e.fn.jquery)&&(l={get:function(t,n){return n?e.css(t,o.replace(/^ms/,"Ms")):t.style[o]}})):s&&(l={get:function(e,t){var n,i=t&&e.currentStyle?e.currentStyle:e.style;return i&&m.test(i.filter)?(n=RegExp.$1.split(","),n=[n[0].split("=")[1],n[2].split("=")[1],n[1].split("=")[1],n[3].split("=")[1]]):n=[1,0,0,1],n[4]=i?i.left:0,n[5]=i?i.top:0,"matrix("+n+")"},set:function(n,i,a){var r,o,s,l=n.style;if(a||(l.zoom=1),i=t(i),!a||a.M){o=["Matrix(M11="+i[0],"M12="+i[2],"M21="+i[1],"M22="+i[3],"SizingMethod='auto expand'"].join(),s=(r=n.currentStyle)&&r.filter||l.filter||"",l.filter=m.test(s)?s.replace(m,o):s+" progid:DXImageTransform.Microsoft."+o+")";var c;(c=e.transform.centerOrigin)&&(l["margin"==c?"marginLeft":"left"]=-(n.offsetWidth/2)+n.clientWidth/2+"px",l["margin"==c?"marginTop":"top"]=-(n.offsetHeight/2)+n.clientHeight/2+"px")}a&&!a.T||(i[4]&&(l.left=i[4]+"px"),i[5]&&(l.top=i[5]+"px"))}}),l&&(e.cssHooks[g]=l),c=l&&l.get||e.css,e.fx.step.transform=function(e){var a,u,d,g,f,p,h,m=e.elem,v=e.start,y=e.end,b=e.pos,C=!1,I=!1;if(d=g=f=p="",!v||"string"==typeof v){v||(v=c(m,o)),s&&(m.style.zoom=1),a=y.split(v),2==a.length&&(y=a.join(""),e.origin=v,v="none"),e.start=v="none"==v?{translate:[0,0],rotate:0,scale:[1,1],skew:[0,0]}:n(r(v)),e.end=y=~y.indexOf("matrix")?n(t(y)):i(y);for(h in v)("rotate"==h?v[h]==y[h]:v[h][0]==y[h][0]&&v[h][1]==y[h][1])&&delete v[h]}v.translate&&(d=" translate("+(v.translate[0]+(y.translate[0]-v.translate[0])*b+.5|0)+"px,"+(v.translate[1]+(y.translate[1]-v.translate[1])*b+.5|0)+"px)",C=!0),void 0!=v.rotate&&(g=" rotate("+(v.rotate+(y.rotate-v.rotate)*b)+"rad)",I=!0),v.scale&&(f=" scale("+(v.scale[0]+(y.scale[0]-v.scale[0])*b)+","+(v.scale[1]+(y.scale[1]-v.scale[1])*b)+")",I=!0),v.skew&&(p=" skew("+(v.skew[0]+(y.skew[0]-v.skew[0])*b)+"rad,"+(v.skew[1]+(y.skew[1]-v.skew[1])*b)+"rad)",I=!0),u=e.origin?e.origin+d+f+g:d+g+f,l&&l.set?l.set(m,u,{M:I,T:C}):m.style[o]=u},e.transform={centerOrigin:"margin"}}(p),/*! Copyright (c) 2010 Burin Asavesna (http://helloburin.com) * Licensed under the MIT License (LICENSE.txt). */ function(e){function t(e,t){return t=void 0===t||""===t?"border":t+"Border",a.borderRadius&&"MozBorderRadius"==a.borderRadius?t+"Radius"+e.charAt(0).toUpperCase()+e.substr(1).toLowerCase():t+e+"Radius"}var n=document.createElement("div"),i=n.style,a=e.support,r="TopLeft TopRight BottomRight BottomLeft".split(" ");a.borderRadius=""===i.MozBorderRadius?"MozBorderRadius":""===i.MsBorderRadius?"MsBorderRadius":""===i.WebkitBorderRadius?"WebkitBorderRadius":""===i.OBorderRadius?"OBorderRadius":""===i.borderRadius?"BorderRadius":!1,n=null;var o;a.borderRadius&&"BorderRadius"!==a.borderRadius&&(o=a.borderRadius.replace("BorderRadius",""),e.cssHooks.borderRadius={get:function(n){return e.map(r,function(i){return e.css(n,t(i,o))}).join(" ")},set:function(e,n){e.style[t("",o)]=n}}),e.eachItem(r,function(n,i){e.cssHooks["borderRadius"+i]={get:function(n){return e.css(n,t(i,o))},set:function(e,n){e.style[t(i,o)]=n}}}),e.eachItem(r,function(t,n){var i="borderRadius"+n;e.fx.step[i]=function(t){e.cssHooks[i].set(t.elem,t.now+t.unit)}})}(p),function(){f.cssHooks.rgbaBackground={get:function(e){var t=f.getRGBA(f.css(e,"backgroundColor"));return"rgba({0},{1},{2},{3})".format(t[0],t[1],t[2],t[3])},set:function(e,t){var n=f.getRGBA(t);e.style.backgroundColor="rgba({0},{1},{2},{3})".format(n[0],n[1],n[2],n[3])}},f.fx.step.rgbaBackground=function(e){e.colorInit||(e.start=f.getRGBA(f.cssHooks.rgbaBackground.get(e.elem)),e.end=f.getRGBA(e.end),e.colorInit=!0),f.cssHooks.rgbaBackground.set(e.elem,"rgba("+Math.max(Math.min(Math.floor(e.pos*(e.end[0]-e.start[0])+e.start[0]),255),0)+","+Math.max(Math.min(Math.floor(e.pos*(e.end[1]-e.start[1])+e.start[1]),255),0)+","+Math.max(Math.min(Math.floor(e.pos*(e.end[2]-e.start[2])+e.start[2]),255),0)+","+Math.max(Math.min(Math.floor(100*(e.pos*(e.end[3]-e.start[3])+e.start[3]))/100,1),0)+")")}}(),/*! Copyright (c) 2010 Burin Asavesna (http://helloburin.com) * Licensed under the MIT License (LICENSE.txt). */ function(e){function t(e,t,n){var i=e.split(r);return i[n]=t,i.join(" ")}var n=document.createElement("div"),i=n.style,a=e.support,r=/\s/,o=/\)\s/;if(a.boxShadow=""===i.MozBoxShadow?"MozBoxShadow":""===i.MsBoxShadow?"MsBoxShadow":""===i.WebkitBoxShadow?"WebkitBoxShadow":""===i.OBoxShadow?"OBoxShadow":""===i.boxShadow?"BoxShadow":!1,n=null,a.boxShadow&&"BoxShadow"!==a.boxShadow){e.cssHooks.boxShadow={get:function(t){return e.css(t,a.boxShadow)},set:function(e,t){e.style[a.boxShadow]=t,""===e.style.zIndex&&(e.style["z-index"]=1)}},e.cssHooks.boxShadowColor={get:function(t){return e.css(t,a.boxShadow).split(o)[0]+")"},set:function(t,n){t.style[a.boxShadow]=n+" "+e.css(t,a.boxShadow).split(o)[1]}},e.cssHooks.boxShadowBlur={get:function(t){return e.css(t,a.boxShadow).split(r)[5]},set:function(n,i){n.style[a.boxShadow]=t(e.css(n,a.boxShadow),i,5)}},e.cssHooks.boxShadowSpread={get:function(t){return e.css(t,a.boxShadow).split(r)[6]},set:function(n,i){n.style[a.boxShadow]=t(e.css(n,a.boxShadow),i,6)}},e.cssHooks.boxShadowX={get:function(t){return e.css(t,a.boxShadow).split(r)[3]},set:function(n,i){n.style[a.boxShadow]=t(e.css(n,a.boxShadow),i,3)}},e.cssHooks.boxShadowY={get:function(t){return e.css(t,a.boxShadow).split(r)[4]},set:function(n,i){n.style[a.boxShadow]=t(e.css(n,a.boxShadow),i,4)}};var s="Blur Spread X Y".split(" ");e.eachItem(s,function(t,n){var i="boxShadow"+n;e.fx.step[i]=function(t){e.cssHooks[i].set(t.elem,t.now+t.unit)}})}}(p),/*! * Copyright (c) 2011 Tom Ellis (http://www.webmuse.co.uk) * Linear and Radial Gradient cssHook for jQuery * Limitations: - Works with jQuery 1.4.3 and higher - Works in Firefox 3.6+, Safari 5.1+, Chrome 13+, Opera 11.10+, IE9+ - Radial Gradients DO NOT work in Opera yet (Doesn't make sense I Know!) - Only works for background and background image CSS properties * Licensed under the MIT License (LICENSE.txt). */ function(e){function t(t){var n=s.exec(t);return t=t.replace(n[2],e.support.linearGradient)}function n(t){var n=l.exec(t);return t=t.replace(n[2],e.support.radialGradient)}var i=document.createElement("div"),a=i.style,r=/^(.*?)linear-gradient(.*?)$/i,o=/^(.*?)radial-gradient(.*?)$/i,s=/^(.*?)(:?linear-gradient)(\()(.*)(\))(.*?)$/i,l=/^(.*?)(:?radial-gradient)(\()(.*?)(\))(.*?)$/i,c=/(^|\s)linear-gradient/,u=/(^|\s)-moz-linear-gradient/,d=/(^|\s)-webkit-linear-gradient/,g=/(^|\s)-o-linear-gradient/,f=/(^|\s)radial-gradient/,p=/(^|\s)-moz-radial-gradient/,h=/(^|\s)-webkit-radial-gradient/,m=/(^|\s)-o-radial-gradient/,v=/\s/,y="background backgroundImage",b="background-image: -moz-radial-gradient(circle, orange, red);background-image: -webkit-radial-gradient(circle, orange, red);background-image: -o-radial-gradient(circle,red, blue);background-image: radial-gradient(circle, orange, red);",C=y.split(v);a.cssText="background-image: -moz-linear-gradient(red, blue);background-image: -webkit-linear-gradient(red, blue);background-image: -o-linear-gradient(red, blue);background-image: linear-gradient(red, blue);",e.support.linearGradient=c.test(a.backgroundImage)?"linear-gradient":u.test(a.backgroundImage)?"-moz-linear-gradient":d.test(a.backgroundImage)?"-webkit-linear-gradient":g.test(a.backgroundImage)?"-o-linear-gradient":!1,a.cssText=b,e.support.radialGradient=f.test(a.backgroundImage)?"radial-gradient":p.test(a.backgroundImage)?"-moz-radial-gradient":h.test(a.backgroundImage)?"-webkit-radial-gradient":m.test(a.backgroundImage)?"-o-radial-gradient":!1,e.support.linearGradient&&"linear-gradient"!==e.support.linearGradient&&e.each(C,function(i,a){e.cssHooks[a]={set:function(e,i){r.test(i)?e.style[a]=t(i):o.test(i)?e.style[a]=n(i):e.style[a]=i}}}),i=a=null}(p);var Dt=fs(function(){var e={},t=0;this.loadImages=function(n,i){i=f.extend({loadCallback:cs,errorCallback:cs,finishCallback:cs,progressCallback:cs},i),n instanceof Array||(n=[n]);var a=[],r=n.length,o=0;r===o&&i.finishCallback([]),f.eachItem(n,function(n,s){function l(){d=new Image,g=f(d),g.load(c),g.on("error",function(){ee.log("Failed Loading Image "+s),i.errorCallback(),u({url:s,error:"Error Loading"})}),d.src=s}function c(){var t={width:g[0].width,height:g[0].height},n={$image:g,imageSize:t,imageUrl:s};e[s]=n,i.loadCallback(n),u(n)}function u(e){a.push(e),o++,i.progressCallback({imageData:e,loadedImagesCount:o,totalImagesCount:r,progress:o/r}),o==r&&(1==r?i.finishCallback(e):i.finishCallback(a))}var d,g,p=e[s];void 0!==p?(i.loadCallback(p),u(p)):t>0?window.setTimeout(l,t):l()})}});!function(e){function t(e,t,n){var i=e.options;r(e,t),i.useDisplayingStates?t.toggleDisplayed(!0,"TabsGroup"):i.useVisibilityStates?t.toggleVisibility(!0,"TabsGroup"):t.show(),a(e,t,n)}function n(e,t,n){var i=e.options;i.useDisplayingStates||i.useVisibilityStates||!i.showingFunction?t.show():(t.hide(),i.showingFunction.call(t,n))}function i(e,t){if(t){s(e,t);var n=e.options;n.useDisplayingStates?t.toggleDisplayed(!1,"TabsGroup"):n.useVisibilityStates?t.toggleVisibility(!1,"TabsGroup"):e.options.hidingFunction?e.options.hidingFunction.call(t):t.hide(),o(e,t)}}function a(e,t,n){e.showedTab=t;var i=t.data("tabs-group-controller");i.options.onTabShow.call(t,n),i.tabShowEvent.fireNew(),e.tabShowedEvent.fire(t),e.options.onTabShow.call(t)}function r(e,t){var n=t.data("tabs-group-controller");n.options.onTabShowing.call(t),e.options.onTabShowing.call(t)}function o(e,t){var n=t.data("tabs-group-controller");n.options.onTabHide.call(t),e.options.onTabHide.call(t),e.tabHideEvent.fire(t),n.tabHideEvent.fireNew()}function s(e,t){var n=t.data("tabs-group-controller");n.options.onTabHiding.call(t),e.options.onTabHiding.call(t)}e.fn.makeTabsGroup=function(t){var n=e.createTabsGroup(t);return e(this).addToTabsGroup(n),n},e.fn.makeTabsSwitcher=function(o){function s(a){if(!e.sameElements(a.currentTab,a.showedTab)){var r=a.showedTab,o=a.currentTab;r.hide(),t(a,o);var s=o.offset(),l=o.outerSize(),d=c.css("position");"absolute"!=d&&"fixed"!=d&&c.css("position","relative");var g=c.height();r.show(),o.hide();var f=r.offset(),p=r.outerSize(),h=c.height(),m=o.wrap("").parent(),v=r.wrap("").parent();e.unite(m,v).css({display:"block",position:"absolute"}),m.offset(s).elementSize(l),v.offset(f).elementSize(p),c.css({height:h,overflow:"hidden"}),v.insertBefore(m),i(a,r),n(a,o),a.options.foldingAnimation.call(c,g),u=e.unite(r,o,c).promise(),u.done(function(){o.unwrap(),r.unwrap(),c.css({height:"",overflow:""})})}}o=e.quickExtend({foldingAnimation:function(e){this.animate({height:e},300)}},o);var l,c=this,u=void 0,d=e.createTabsGroup(e.quickExtend(o,{showingHandler:function(e){var t=e.currentTab;e.showedTab?void 0===u?s(e):(l=function(){s(e)},u.done(function(){if(l){var e=l;l=void 0,e()}})):(r(e,t),t.show(),a(e,t))}}));return e(this).children().addToTabsGroup(d),d},e.createTabsGroup=function(t){t=e.extend({useDisplayingStates:!1,useVisibilityStates:!1,hideBeforeShowing:!0,onTabShow:cs,onTabHide:cs,onTabHiding:cs,onTabShowing:cs},t);var n={tabs:[],currentTab:void 0,currentTabChanged:x.create(),options:t,tabShowedEvent:x.create(),tabHideEvent:x.create(),hideCurrentTab:function(){e.hideTab(n)},isShowed:function(e){return e.is(n.currentTab)}};return n},e.fn.getTabsGroup=function(){return e(this).data("tabs-group")},e.fn.makeTabButton=function(t,n){n=e.quickExtend({hideTabOnUntoggling:!1},n);var i=e(this).makeToggleButton(),a=e(t),r=a.data("tabs-group"),o=!1,s=!1;return r.currentTabChanged.bindAndExecute(function(){s||(o=!0,i.toggleToggled(e.sameElements(r.currentTab,a)),o=!1)}),i.toggled(function(e){o||(s=!0,e===xt.Toggled?a.showTab():n.hideTabOnUntoggling?a.hideTab():(o=!0,i.toggleToggled(!0),o=!1),s=!1)}),this},e.fn.addToTabsGroup=function(t,n){return e(this).each(function(){n=e.quickExtend({onTabHide:cs,onTabShow:cs,onTabShowing:cs,onTabHiding:cs},n);var i=e(this),a={tabHideEvent:x.create(),tabShowEvent:x.create(),options:n,showTab:function(){i.showTab()}};t.tabs.push(a),e(this).data("tabs-group-controller",a),e(this).data("tabs-group",t),t.options.useDisplayingStates?e(this).addDisplayingStates().toggleDisplayed(!1,"TabsGroup"):t.options.useVisibilityStates?e(this).addVisibilityStates().toggleVisibility(!1,"TabsGroup"):e(this).hide()})},e.fn.removeFromTabsGroup=function(){var t=e(this).data("tabs-group");e(this).is(t.currentTab)&&(t.currentTab=void 0);var n=e(this).data("tabs-group-controller");return t.tabs.removeItem(n),e(this).removeData("tabs-group").removeData("tabs-group-controller"),this},e.fn.onTabHide=function(t){e(this).data("tabs-group-controller").tabHideEvent.bind(t)},e.fn.onTabShow=function(t){e(this).data("tabs-group-controller").tabShowEvent.bind(t)},e.fn.hideTab=function(){e.hideTab(e(this).data("tabs-group"),e(this))},e.hideTab=function(e,t){var n=e.currentTab;void 0===n||void 0!==t&&!t.is(n)||(e.currentTab=void 0,i(e,n),e.currentTabChanged.fireNew())},e.fn.showTab=function(a){var r=e(this[0]),o=e(this).data("tabs-group"),s=o.options,l=o.currentTab;void 0!==l&&e.sameElements(l,r)||(o.currentTab=r,s.showingHandler?s.showingHandler(o):(i(o,l),t(o,r,a),s.useDisplayingStates||s.useVisibilityStates||n(o,r,l)),o.currentTabChanged.fireNew())}}(p);var Ft=fs(function(){var e={},t=[],n=f("body"),i=f("html");this.open=function(a,r){this.closeDialog(a,!0),r=f.quickExtend({onOpened:cs,overlayClass:"dialog-overlay",showingAnimationFunction:this.defaultShowAnimation,hidingAnimation:!1,overlayShowingAnimation:!1,overlayHidingAnimation:!1,doNotCenter:!1,appendTo:"body"},r);var o,s,l=f("
    "),c=f("
    "),u=r.appendTo,d={id:f.uniqueID(),$overlay:l,$dialogContainer:c,contextOptions:r,contextClass:Ie.createContextClass({getTarget:function(){return d.$dialogContainer}})};return en.setAsPanelsScope(l,"dialog"),en.setAsPanelsScope(c,"dialog"),a.data("dialog-controller",d),e[d.id]=!0,t.push(d),d.contextClass.set(r.contextClass),l.appendTo(u),r.overlayShowingAnimation?f.beginInvoke(function(){r.overlayShowingAnimation.call(l)}):l.show(),c.append(a).appendTo(u).show(),o=n.scrollTop(),s=i.scrollTop(),r.onOpened.call(a),r.doNotCenter?c.css({left:0,top:0,right:0,bottom:0}):c.makeCentered({horizontally:!0,vertically:!0}),n.scrollTop(o),i.scrollTop(s),void 0!==jn&&jn.start(),r.showingAnimationFunction?(this.shouldHideDialogOverlay()&&c.hide(),f.beginInvoke(function(){r.showingAnimationFunction.call(c)})):r.afterShowEffect&&r.afterShowEffect.call(c),d},this.getTopMostDialog=function(){return t[t.length-1]},this.hasOpenedDialogs=function(){return!f.isEmptyObject(e)},this.reCenterTheDialog=function(e){var t=e.data("dialog-controller");t&&t.$dialogContainer.makeCentered({horizontally:!0,vertically:!0})},this.getDialogOverlay=function(e){var t=e.data("dialog-controller");return t&&t.$overlay},this.close=function(e){this.closeDialog(e,!1)},this.defaultShowAnimation=cs(),this.shouldHideDialogOverlay=us,this.closeDialog=function(n,i){var a=n.data("dialog-controller")||{},r=a.contextOptions||{},o=a.$overlay,s=a.$dialogContainer,l=r.overlayHidingAnimation,c=r.hidingAnimation;a.id&&(delete e[a.id],t=f.grep(t,function(e){return e!==a}),n.removeData("dialog-controller"),n.detach(),l&&!i?l.call(o,function(){o.remove()}):o.remove(),void 0!==jn&&jn.finish(),c&&!i?c.call(s,function(){s.remove()}):s.remove())}}),At={HideItems:1,DetachItems:2},Bt=C.extend("ItemsListItem",{init:function(e){this.itemsList=e,this.data={},this._itemRemovingEvent=void 0,this._bindingsCollection=void 0},useBindingsCollection:function(){var e=this._bindingsCollection;return e||(e=x.createBindingsCollection(),this._bindingsCollection=e),e},notifyItemRemoving:function(){var e=this._itemRemovingEvent,t=this._bindingsCollection;e&&e.fireNew(this),t&&t.unbindAll()},onItemRemoving:function(e){var t=this._itemRemovingEvent;t||(t=x.create(),this._itemRemovingEvent=t),t.one(e)},unbindOnRemoving:function(e){this.onItemRemoving(function(){e.unbind()})},replaceData:function(e){var t=this.item;this.item=e,this.itemsList.notifyItemUpdated(this,t)},invalidateItem:function(){this.itemsList.notifyItemUpdated(this,this.item)},getDataItem:function(){return this.item}}),Vt=function(){function e(e,t){var n=e.data;void 0===t?t=f.getValues(e.items):f.isPlainObject(t)&&(t=f.getValues(t));var i,a=f.valueOrDefault(e.filteringFunction,us),r=a(t);i=r===!0?t:r===!1?[]:r instanceof Array?r:[r];for(var o=f.toDictionary(i,function(e){return e.id}),s=f([]),l=f([]),c=0;c0&&l.each(function(){n.insertionFunction(f(this),e)}),s.length>0&&s.detach(),e.filteredItemsChangeEvent.fireNew(e.filteredItems)}function t(e,t,i){var a=e.options;i=f.valueOrDefault(i,!1),e.itemsChangingBatch.start();var r;r=a.idFunction?a.idFunction(t):f.uniqueID();var o,s;if(void 0!==e.items[r]){o=e.items[r];var l=o.item;o.item=t,e.notifyItemUpdated(o,l),s=!1}else{var c=a.getTemplateItem.call(t,t);o=new Bt(e),o.templateItem=c;var u,d=a.template,g=a.itemCreationFunction;void 0!==g?u=g.call(t,t,o):(d&&f.isFunction(d)&&(d=d(c)),u=f.useTemplate(d,c)),u.addClass(["state-displayed items-list-item",a.listItemClass,"items-list-"+e.id].join(" "));var p=void 0,h=e.itemWrapperTemplate;if(h){p=f.useTemplate(h).toggleDisplayedState(!0);var m=f(".wrapped-item-container",p);m.length>0?u.appendTo(m):u.appendTo(p)}f.quickExtend(o,{id:r,$item:u,$wrapper:p,isFiltered:!0,item:t}),e.items[r]=o,a.insertionFunction(p?p:u,e),i||n(e,o),s=!0}return e.itemsChangingBatch.finish(),{listItem:o,isNewItem:s}}function n(e,t){var n=t.$item;n.data("items-list-item",t),e.options.itemAddedCallback.call(t,t),e.itemAddedEvent.fireNew(t),e.notifyItemUpdated(t)}function i(e,t){return r(e,a(e,t))}function a(e,t){t=f.asArray(t);for(var n=[],i=0;i0&&t.itemsRemovedEvent.fireNew(r),g}function c(e,i,a){var r=e.options,o=r.insertionFilter,s=[],l=[];f.each(i,function(n,i){!o(i)||a&&!a.call(i,i)||s.push(t(e,i,!0))});for(var c=0;c"),a=i.parent()),i.detach();var r=f.useTemplate(e);a.replaceWith(r);var o=f(".wrapped-item-container",r);o.length>0?i.appendTo(o):i.appendTo(r),r.toggleDisplayedState(!0),n.$wrapper||i.toggleDisplayedState(!0),r.toggleDisplayedState(n.isFiltered),n.$wrapper=r}),t},removeItemWrappers:function(){var e=this;f.each(e.items,function(e,t){var n=t.$item,i=t.$wrapper;i&&(i.replaceWith(n),t.$wrapper=void 0)})},getScrollingController:function(){var e=this;return e.connectedScrollable?e.connectedScrollable:e._scrollableController},initialize:function(){var e=this,t=e.$element,n=e._options,i=e._isScrollable;if(!e.initialized&&(e.initialized=!0,i)){if(n.$scrollbar){var a=n.$scrollbar.scrollBar(n.scrollbarOptions);a.connectToScrollable(t),e.scrollBar=a}g(e)}},connectScrollable:function(e){var t=this;return t.connectedScrollable=e,t},addListFooter:function(e){e=f.extend({footerClass:"block",initialize:cs},e);var t=this,n=t.$element;if(t.$listFooter)throw Error("Cannot add multiple footers to items list.");var i=e.createFooter;return i?t.$listFooter=i():t.$listFooter=f("").addClass(e.footerClass),t.$listFooter.appendTo(n),e.initialize(t.$listFooter,t),t},getListFooter:function(){return this.$listFooter},refreshScrolling:function(){g(this)},notifyItemUpdated:function(e,t){var n=this,i=n._options;i.itemUpdatedCallback.call(e,e,t),n.itemUpdatedEvent.fireNew(e)},isEmpty:function(){return 0===this.itemsCount.getValue()},getItemID:function(e){var t=this._options;return t.idFunction?t.idFunction(e):void 0},getListItem:function(e){var t=this,n=t._options;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return t.items[e];if(e instanceof Bt)return e;if(!f.isPlainObject(e))return e.data("items-list-item");if(n.idFunction){var i=n.idFunction(e);return t.items[i]}},getItemByIndex:function(e,t){t=f.valueOrDefault(t,!1);var n,i=this;return n=t?i.$element.children(".state-displayed"):f(".items-list-"+i.id,i.$element),e>=n.length?void 0:f(n[e]).data("items-list-item")},setFilter:function(e){var t=this;return t.filteringFunction=e,t.refilter(),t},getFilteredItems:function(){return this.filteredItems},getFilteredListItems:function(){var e=this,t=e._options,n={};return f.each(e.filteredItems,function(e,i){n[t.idFunction(i.item)]=i.item}),n},getListItemsMap:function(){return this.items},getListItems:function(){var e=this,t=e._options,n={};return f.each(e.items,function(e,i){n[t.idFunction(i.item)]=i.item}),n},getDataItems:function(){return this.getListItems()},findItems:function(e){var t=this;e=f.valueOrDefault(e,us);var n=[];return f.each(t.items,function(t,i){e(i)&&n.push(i)}),n},findItem:function(e){return this.findItems(e)[0]},onButtonDown:function(e){var t=this;return t.onItemEvents("vmousedown",function(t,n){t.$item.is(".state-disabled")||(e(t,n),n.stopPropagation(),n.preventDefault())}),t},onMouseMove:function(e){var t=this;return t.onItemEvents("vmousemove",function(t,n){t.$item.is(".state-disabled")||(e(t,n),n.stopPropagation(),n.preventDefault())}),t},offMouseMove:function(){var e=this,t=e.$element;return t.off("vmousemove",".items-list-item"),e},onButtonClick:function(e){var t=this;return t.onItemEvents("vclick",function(t,n){t.$item.is(".state-disabled")||(e(t,n),n.stopPropagation(),n.preventDefault())}),t},onInnerButtonClick:function(e,t){var n=this;return n.onItemPartEvents(e,"click",function(e,n,i){e.is(".state-disabled")||(t(e,n,i),i.stopPropagation(),i.preventDefault())}),n},onItemEvents:function(e,t){var n=this,i=n.$element;return i.on(e,".items-list-item",function(e){var i=n.getListItem(f(this));void 0!==i&&i.itemsList!==n||t(i,e)}),n},onItemPartEvents:function(e,t,n){var i=this,a=i.$element;return a.on(t,e,function(e){var t=f(this),a=i.getListItem(t.closest(".items-list-item"));return a.itemsList===i?n(t,a,e):void 0}),i},onItemHover:function(e,t){return this.onItemEvents("mouseenter",e).onItemEvents("mouseleave",t)},refilter:function(){var t=this;t.filteredItems={},t.unfilteredItems={},e(t),d(t)},getItemsElements:function(){return this.$element.find(".items-list-"+this.id)},getFilteredItemsElements:function(){return this.getItemsElements().filter(".state-filtered")},getBoundCollection:function(){return this.boundObservableCollection},releaseBoundCollection:function(){var e=this,t=(e.data,e.boundObservableCollection);t&&(t.itemsAddedEvent.unbind(e.id),t.itemsUpdatedEvent.unbind(e.id),t.itemsRemovedEvent.unbind(e.id),e.clear())},setItems:function(e,t){var n=this,i=(n.data,n._options);n.itemsChangingBatch.start(),n.releaseBoundCollection();var a,r=e.isObservableCollection&&e.isObservableCollection();return r?(i.idFunction=e.getIDFunction(),e.updateBatch.startedEvent.bind(function(){n.itemsChangingBatch.start()},n.id),e.updateBatch.finishedEvent.bind(function(){n.itemsChangingBatch.finish()},n.id),e.itemsAddedEvent.bind(function(e){n.addItems(e)},n.id),e.itemsUpdatedEvent.bind(function(e){n.addItems(e)},n.id),e.itemsRemovedEvent.bind(function(e){n.removeItems(e)},n.id),a=l(n,e.getItemsValues(),t),n.boundObservableCollection=e,n.boundCollectionChangedEvent.fireNew()):a=l(n,e,t),n.itemsAddedEvent.fireNew(a),d(n),n.itemsChangingBatch.finish(),a},addItems:function(t,n){var i=this;i.itemsChangingBatch.start();var a=c(i,t,n);return e(i,a),d(i),i.itemsChangingBatch.finish(),i.itemsAddedEvent.fireNew(a),a},addItem:function(n){var i,a,r=this,o=r._options,s=o.insertionFilter;return s.call(n)&&(r.itemsChangingBatch.start(),a=t(r,n,!1),i=a.listItem,e(r,[i]),d(r),a.isNewItem&&r.itemsAddedEvent.fireNew([i]),r.itemsChangingBatch.finish()),i},removeItems:function(e){var t=this;t.itemsChangingBatch.start();var n=i(t,e);n.length>0&&(t.itemsRemovedEvent.fireNew(n),d(t),t.filteredItemsChangeEvent.fireNew()),t.itemsChangingBatch.finish()},removeItem:function(e){var t=this;t.itemsChangingBatch.start(),t.removeItems(f.asArray(e)),t.itemsChangingBatch.finish()},clear:function(){var e=this;e.itemsChangingBatch.start();var t=s(e);t.length>0&&(e.itemsRemovedEvent.fireNew(t),d(e)),e.itemsChangingBatch.finish()},trackLastDisplayedItem:function(e){var t,n=this,i=n.$element;n.itemsChangedEvent.bindAndExecute(function(){var a,r=i.children().last(".state-displayed");if(0===r.length)a=void 0;else if(r.hasClass("items-list-item"))a=r.data("items-list-item");else{var o=f(".items-list-"+n.id,r);a=o[o.length-1].data("items-list-item")}a!==t&&(e(a,t),t=a)})},trackElementsIndexes:function(){var e=this;return e.itemsChangedEvent.bindAndExecute(function(){e.getItemsElements().filter(":not(.state-hidden)").applyIndexesClasses()}),e},scrollToItem:function(e){var t=this,n=t.getScrollingController();if(n){var i=t.getListItem(e);if(i){var a=i.$item,r=n.$element,o=a.offset().top-r.offset().top,s=r.scrollTop();r.scrollTop(s+o)}}return t},bringToViewport:function(e){var t=this,n=t.getScrollingController();if(n){var i=t.getListItem(e);i&&n.bringToViewport(i.$item)}return t}});return h.addExtension=function(e,t){var n=t.initialization,i=t.methods;this.extendPrototype(f.mapDictionary(i,function(t,n){return function(i,a,r,o,s){if(!this.isExtensionActivated(e))throw Error('The method "{0}" requires the activation of extension "{1}"'.format(t,e));return this[n]=n,n.call(this,i,a,r,o,s)}})),this.extendPrototype(f.mapDictionary(n,function(t,n){return function(t,i,a,r,o){var s=n.call(this,t,i,a,r,o);return this.activateExtension(e),s}}))},h}();!function(){pe.extendConditionMethods({whenListIsEmpty:function(e){return this.whenFlagIsTrue(e.isEmptyFlag)}})}();var Lt={Ascending:1,Descending:2};!function(){function e(e){var t=e.orderingSupportOptions;e.orderingType===Lt.Ascending?e.orderedItems=f.getValues(e.items).orderBy(e.orderingValueSelector,e.comparer):e.orderedItems=f.getValues(e.items).orderByDesc(e.orderingValueSelector,e.comparer);for(var n=[],i=e.orderedItems,a=0;a .hierarchy-item-content > .hierarchy-item-container > .items-list-item")},findChildrenContainer:function(e){return e.find("> .hierarchy-item-content > .hierarchy-children-container")},findDirectChildrenItemElements:function(e){return Ot.findItemElement(Ot.findChildrenContainer(e).find("> .hierarchy-item"))},setHierarchyLevel:function(e,t,n){void 0!==e.hierarchyLevel&&e.$wrapper.removeClass("hierarchy-level-"+e.hierarchyLevel),e.hierarchyLevel=t,e.$wrapper.addClass("hierarchy-level-"+e.hierarchyLevel),n===!0&&Ot.findDirectChildrenItemElements(e.$wrapper).each(function(){var e=f(this).data("items-list-item");Ot.setHierarchyLevel(e,t+1,!0)})}},zt=function(){function e(e){var t=e._itemsList;e._autoHtmlSortingEnabled=t.autoHtmlSortingEnabled,t.toggleAutoHtmlSorting(!1),t.itemsReorderedEvent.bind(function(){t.recalculateLayout()}).addToCollection(e._bindingsCollection)}function t(e,n,i,a,s,l){var c=a?r(a.$wrapper):e.$element;f.eachItem(i,function(i,r){var u=e.items[r];if(u){o(u,s),u.$wrapper.removeClass("hierarchy-has-children"),a?(u.hierarchyParent=a,a.$wrapper.addClass("hierarchy-has-children")):delete u.hierarchyParent;var d=u.$wrapper;d.appendTo(c);var g=n[r];g&&t(e,n,g,u,s+1,l),l(u)}})}function n(e){for(var t=f([]),n=0;n
    ')}});var i=this,a=this._hierarchyCollection;if(t.hasOrderingSupport)e(i);else{var o=!1;t.extensionActivated.bind(function(t){o||"Ordering"!==t||(o=!0,e(i))}).addToCollection(n)}t.itemRemovingEvent.bind(function(e){var t=r(e.$wrapper).children();t.detach()}).addToCollection(n),a.updateBatch.bind(function(){t.postponeLayoutUpdate("hierarchy update")},function(){t.unPostponeLayoutUpdate("hierarchy update")}).addToCollection(n),window.itemsList=t,this._hierarchyEventListener=x.createEventListener([a.hierarchyUpdateEvent],function(){t.recalculateLayout()}).activate()},recalculateLayout:function(e){var n=this._hierarchyCollection;t(e,n.getHierarchies(),n.getRootIds(),void 0,0,this._hierarchyLevelChange),a(this,e.hasOrderingSupport?e.orderedItems:f.getValues(e.items))},release:function(e){this._bindingsCollection.unbindAll(),this._hierarchyEventListener.deactivate(),e.removeItemWrappers(),e.hasOrderingSupport&&e.toggleAutoHtmlSorting(this._autoHtmlSortingEnabled)}}});return s.create=function(e){return new s(e)},s}();!function(){e.isRemoteCollection=function(t){return t?t.constructor===e:!1}}();var _t=function(){function e(e,t,n){var i=e._ids[t];if(i.parentId=n,void 0===n)e._rootHierarchy[t]=i;else{var a=e._ids[n];if(!a)throw Error("unsupported");a.children[t]=t}}function t(e,t){var n=e._ids[t],i=n.parentId;if(n.parentId=void 0,void 0===i)delete e._rootHierarchy[t];else{var a=e._ids[i].children;delete a[t]}}function n(n,i,a){var r=n._ids[i];if(!r)return!1;var o=r.parentId;return a!==o?(t(n,i),e(n,i,a),!0):!1}function i(e,t){t=f.valueOrDefault(t,{});var n=e.getHierarchies(),i=f.getKeys(n),a=f.getKeys(t);if(a=f.grep(a,function(e){return t[e]&&t[e].length>0}),i.length!==a.length)return!1;for(var r=0;r0&&(e[t]=i)}),e},clear:function(){this._rootHierarchy={},this._ids={}},removeIds:function(e){if(void 0!==e){this.updateBatch.begin(),e=f.asArray(e);var n=this;f.eachItem(e,function(e,i){var a=n._ids[i];a&&(f.eachEntry(a.children,function(e){n.setParent(e,a.parentId)}),t(n,i),delete n._ids[i])}),this.updateBatch.end()}},extendHierarchies:function(e){this.updateBatch.begin(),r(this,e),this.updateBatch.end()},setHierarchies:function(e){i(this,e)||(this.updateBatch.begin(),a(this,e,f.getKeys(this._ids)),this.updateBatch.end())},updateHierarchy:function(e,t){i(this,e)&&f.defaultArraySetsEqualityComparer(t,f.getKeys(this._ids))||(this.updateBatch.begin(),a(this,e,t),this.updateBatch.end())},getIds:function(){return this._ids},hasHierarchy:function(){return f.count(this._ids)>f.count(this._rootHierarchy)},hasChildren:function(e){var t=this._ids[e];return t&&!f.isEmptyObject(t.children)},getChildrenIds:function(e){var t=this._ids[e];return t?f.getKeys(t.children):void 0},clone:function(){return new s({ids:f.getKeys(this._ids),hierarchies:this.getHierarchies()})},createSubHierarchy:function(e,t){t=f.valueOrDefault(t,!1);var n=this._ids[e];if(n){var i=new s;return t&&i.addIds(e),o(this,i,n,t?e:void 0),i}}});return s.create=function(e){return new s(e)},s}(),Nt={Desc:"desc",Asc:"asc"};!function(e){function t(e,t){return e-t}function n(e){return function(t,n){return 0-e(t,n)}}e.numbersComparer=t,e.stringsComparer=function(e,t){e.localeCompare(t)},e.datesComparer=function(e,t){return new Date(e).getTime()-new Date(t).getTime()},e.createFieldsComparer=function(n,i){i=e.extend({sortByField:"sortBy",sortingOrderField:"sortType",comparerRuleField:"comparer",comparersMap:{}},i);var a=i.sortByField,r=i.sortingOrderField,o=i.comparerRuleField,s=i.comparersMap;return function(i,l){for(var c=0;cr;r++)i[n[r]]=a-r;return function(n,a){var r=e.valueOrDefault(i[n],0),o=e.valueOrDefault(i[a],0);return t(r,o)}},e.arrayDefaultComparer=e.createArrayComparer(t),e.stringsComparer=function(e,t){if(e&&e){var n=e.toLowerCase(),i=t.toLowerCase();return i>n?-1:n>i?1:0}return e===t?0:e?1:-1},Array.prototype.orderByDesc=function(e,i){return void 0===i&&(i=t),this.orderBy(e,n(i))},e.mergeSorted=function(n,i,a,r){i=e.valueOrDefault(i,e.identity),a=e.valueOrDefault(a,t),r=e.valueOrDefault(r,e.identity);var o,s,l,c,u,d=[],g=[],f=[],p=0;for(o=0;o0?(p++,g.push(0)):g.push(void 0)}for(;p>0;){for(c=void 0,u=void 0,o=0;o=f[c].length&&(g[c]=void 0,p--)}return d},Array.prototype.orderBy=function(n,i){void 0===i&&(i=t),n=e.valueOrDefault(n,e.identity);var a,r=this;if(n===e.identity)r.sort(function(e,t){return i(e,t)});else{var o=[];for(a=0;ar;r++)i.appendChild(e[r]);return t?t(n,i):n.append(i),n}}(p);var Rt=fs(function(){Date.now||(Date.now=function(){return(new Date).getTime()});var e=function(){var t=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,n=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,i=/[^-+\dA-Z]/g,a=function(e,t){for(e+="",t=t||2;e.length99?Math.round(y/10):y),t:12>h?"a":"p",tt:12>h?"am":"pm",T:12>h?"A":"P",TT:12>h?"AM":"PM",Z:s?"UTC":((r+"").match(n)||[""]).pop().replace(i,""),o:(b>0?"-":"+")+a(100*Math.floor(Math.abs(b)/60)+Math.abs(b)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};return l.replace(t,function(e){return e in C?C[e]:e.slice(1,e.length-1)})}}();e.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},e.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],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"]},this.formatDateMillis=function(e,t,n){return Rt.formatDate(new Date(e),t,n)},this.formatDateString=function(e,t,n){return Rt.formatDate(new Date(e),t,n)},this.formatDate=function(t,n,i){return e(t,n,i)},this.getCurrentDateString=function(t,n){return e(new Date,t,n)},this.getDateStringMillis=function(e){return new Date(e).getTime()},this.formatLocalDate=function(e){var t=e||new Date,n=-t.getTimezoneOffset(),i=n>=0?"+":"-",a=function(e){var t=Math.abs(Math.floor(e));return(10>t?"0":"")+t};return t.getFullYear()+"-"+a(t.getMonth()+1)+"-"+a(t.getDate())+"T"+a(t.getHours())+":"+a(t.getMinutes())+":"+a(t.getSeconds())+i+a(n/60)+":"+a(n%60)},this.parseDateWithoutTimezone=function(e){if(e){var t=e.split(/[^0-9]/);if(t.length>=5){var n=new Date(t[0],t[1]-1,t[2],t[3],t[4],t[5]);return n}}return e}}),Ht=[{title:"12/31/2014 (mm/dd/yyyy)",format:"mm-dd-yyyy"},{title:"31/12/2014 (dd/mm/yyyy)",format:"dd-mm-yyyy"},{title:"2014/12/31 (yyyy/mm/dd)",format:"yyyy-mm-dd"},{title:"Dec 31, 2014 (mmm dd, yyyy)",format:"mmm dd-yyyy"},{title:"07/2012 (mm/yyyy)",format:"mm-yyyy"},{title:"Dec 2012 (mmm yyyy)",format:"mmm yyyy"},{title:"December 2012 (mmmm yyyy)",format:"mmmm yyyy"},{title:"December 31, 2014 (mmmm dd, yyyy)",format:"mmmm dd-yyyy"},{title:"31 December, 2014 (dd mmmm, yyyy)",format:"dd mmmm-yyyy"},{title:"Friday, September 28, 2014 (dddd, mmmm dd, yyyy)",format:"dddd-mmmm dd-yyyy"},{title:"12 (mm)",format:"mm"},{title:"Dec (mmm)",format:"mmm"},{title:"December (mmmm)",format:"mmmm"},{title:"31 (dd)",format:"dd"},{title:"Sun (ddd)",format:"ddd"},{title:"Sunday (dddd)",format:"dddd"},{title:"2014 (yyyy)",format:"yyyy"}],qt=[{title:"/",value:"/"},{title:".",value:"."},{title:"-",value:"-"},{title:",",value:", "}],Ut=[{title:"X - Y",format:"{0} - {1}"},{title:"From X to Y",format:"From {0} to {1}"},{title:"Start: X. End: Y",format:"Start: {0}. End: {1}"}];!function(e,t){function n(e,t,n){var i=e.children(),a=!1;e.empty();for(var o=0,s=i.length;s>o;o++){var l=i.eq(o);if(e.append(l),n&&e.append(n),r(e,t)){l.remove(),a=!0;break}n&&n.detach()}return a}function i(t,n,o,s,l){var c=!1,u="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",d="script, .dotdotdot-keep";return t.contents().detach().each(function(){var g=this,f=e(g);if(void 0===g||3==g.nodeType&&0==e.trim(g.data).length)return!0;if(f.is(d))t.append(f);else{if(c)return!0;t.append(f),l&&t[t.is(u)?"after":"append"](l),r(o,s)&&(c=3==g.nodeType?a(f,n,o,s,l):i(f,n,o,s,l),c||(f.detach(),c=!0)),c||l&&l.detach()}}),c}function a(t,n,i,s,u){var g=t[0];if(!g)return!1;var f=c(g),p=-1!==f.indexOf(" ")?" ":"\u3000",h="letter"==s.wrap?"":p,m=f.split(h),v=-1,y=-1,b=0,C=m.length-1;for(s.fallbackToLetter&&0==b&&0==C&&(h="",m=f.split(h),C=m.length-1);C>=b&&(0!=b||0!=C);){var I=Math.floor((b+C)/2);if(I==y)break;y=I,l(g,m.slice(0,y+1).join(h)+s.ellipsis),r(i,s)?(C=y,s.fallbackToLetter&&0==b&&0==C&&(h="",m=m[0].split(h),v=-1,y=-1,b=0,C=m.length-1)):(v=y,b=y)}if(-1==v||1==m.length&&0==m[0].length){var S=t.parent();if(S.contents().filter(function(){return 3===this.nodeType}).length<=1)return!0;t.detach();var P=u&&u.closest(S).length?u.length:0;S.contents().length>P?g=d(S.contents().eq(-1-P),n):(g=d(S,n,!0),P||S.detach()),g&&(f=o(c(g),s),l(g,f),r(i,s)&&a(e(g),n,i,s,u),P&&u&&e(g).parent().append(u))}else f=o(m.slice(0,v+1).join(h),s),l(g,f);return!0}function r(e,t){var n=e.innerHeight();return n>t.maxHeight&&n>t.minHeight}function o(t,n){for(;e.inArray(t.slice(-1),n.lastCharacter.remove)>-1;)t=t.slice(0,-1);return e.inArray(t.slice(-1),n.lastCharacter.noEllipsis)<0&&(t+=n.ellipsis),t}function s(e){return{width:e.innerWidth(),height:e.innerHeight()}}function l(e,t){e.innerText?e.innerText=t:e.nodeValue?e.nodeValue=t:e.textContent&&(e.textContent=t)}function c(e){return e.innerText?e.innerText:e.nodeValue?e.nodeValue:e.textContent?e.textContent:""}function u(e){do e=e.previousSibling;while(e&&1!==e.nodeType&&3!==e.nodeType);return e}function d(t,n,i){var a,r=t&&t[0];if(r){if(!i){if(3===r.nodeType)return r;if(e.trim(t.text()))return d(t.contents().last(),n)}for(a=u(r);!a;){if(t=t.parent(),t.is(n)||!t.length)return!1;a=u(t[0])}if(a)return d(e(a),n)}return!1}function g(t,n){return t?"string"==typeof t?(t=e(t,n),t.length?t:!1):t.jquery?t:!1:!1}function f(e){for(var t=e.innerHeight(),n=["paddingTop","paddingBottom"],i=0,a=n.length;a>i;i++){var r=parseInt(e.css(n[i]),10);isNaN(r)&&(r=0),t-=r}return t}if(!e.fn.dotdotdot){e.fn.dotdotdot=function(t){if(0==this.length)return e.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){e(this).dotdotdot(t)});var a=this;a.data("dotdotdot")&&a.trigger("destroy.dot"),a.data("dotdotdot-style",a.attr("style")||""),a.css("word-wrap","break-word"),"nowrap"===a.css("white-space")&&a.css("white-space","normal"),a.bind_events=function(){return a.bind("update.dot",function(t,s){t.preventDefault(),t.stopPropagation(),e.isFunction(l.height)?l.maxHeight=l.height():l.maxHeight="number"==typeof l.height?l.height:f(a),l.maxHeight+=l.tolerance,e.isFunction(l.ignoredHeight)?l.minHeight=l.ignoredHeight():l.minHeight="number"==typeof l.ignoredHeight?l.ignoredHeight:0,void 0!==s&&(("string"==typeof s||s instanceof HTMLElement)&&(s=e("
    ").append(s).contents()),s instanceof e&&(o=s)),h=a.wrapInner('
    ').children(),h.contents().detach().end().append(o.clone(!0)).find("br").replaceWith("
    ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var u=!1,d=!1;return c.afterElement&&(u=c.afterElement.clone(!0),u.show(),c.afterElement.detach()),r(h,l)&&(d="children"==l.wrap?n(h,l,u):i(h,a,h,l,u)),h.replaceWith(h.contents()),h=null,e.isFunction(l.callback)&&l.callback.call(a[0],d,o),c.isTruncated=d,d}).bind("isTruncated.dot",function(e,t){return e.preventDefault(),e.stopPropagation(),"function"==typeof t&&t.call(a[0],c.isTruncated),c.isTruncated}).bind("originalContent.dot",function(e,t){return e.preventDefault(),e.stopPropagation(),"function"==typeof t&&t.call(a[0],o),o}).bind("destroy.dot",function(e){e.preventDefault(),e.stopPropagation(),a.unwatch().unbind_events().contents().detach().end().append(o).attr("style",a.data("dotdotdot-style")||"").data("dotdotdot",!1)}),a},a.unbind_events=function(){return a.unbind(".dot"),a},a.watch=function(){if(a.unwatch(),"window"==l.watch){var t=e(window),n=t.width(),i=t.height();t.bind("resize.dot"+c.dotId,function(){n==t.width()&&i==t.height()&&l.windowResizeFix||(n=t.width(),i=t.height(),d&&clearInterval(d),a.is(":visible")&&(d=setTimeout(function(){a.trigger("update.dot")},100)))})}else u=s(a),d=setInterval(function(){if(a.is(":visible")){var e=s(a);u.width==e.width&&u.height==e.height||(a.trigger("update.dot"),u=e)}},500);return a},a.unwatch=function(){return e(window).unbind("resize.dot"+c.dotId),d&&clearInterval(d),a};var o=a.contents(),l=e.extend(!0,{},e.fn.dotdotdot.defaults,t),c={},u={},d=null,h=null;return l.lastCharacter.remove instanceof Array||(l.lastCharacter.remove=e.fn.dotdotdot.defaultArrays.lastCharacter.remove),l.lastCharacter.noEllipsis instanceof Array||(l.lastCharacter.noEllipsis=e.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),c.afterElement=g(l.after,a),c.isTruncated=!1,c.dotId=p++,a.data("dotdotdot",!0).bind_events().trigger("update.dot"),l.watch&&a.watch(),a},e.fn.dotdotdot.defaults={ellipsis:"...",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0},e.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" ","\u3000",",",";",".","!","?"],noEllipsis:[]}},e.fn.dotdotdot.debug=cs;var p=1,h=e.fn.html;e.fn.html=function(n){return n!=t&&!e.isFunction(n)&&this.data("dotdotdot")?this.trigger("update.dot",[n]):h.apply(this,arguments)};var m=e.fn.text;e.fn.text=function(n){return n!=t&&!e.isFunction(n)&&this.data("dotdotdot")?(n=e("
    ").text(n).html(),this.trigger("update.dot",[n])):m.apply(this,arguments)}}}(p),function(e){function t(){var e=document.createElement("div");e.style.cssText="position: absolute; width: 10000px; height: 200px; left: -10000px; top: -300px; font-size: 100px; visibility: hidden;",r=document.createElement("span"),r.innerHTML="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",e.appendChild(r),document.body.appendChild(e),d=!0}function n(e){return window.getComputedStyle&&getComputedStyle(e)||e.currentStyle}function i(e,t,n){var r,o,s,c;e.length?(r=e.pop(),o=r.toLowerCase(),a(r)?(l[o]=!0,i(e,t,n)):(c=0,s=setInterval(function(){c++,(c>=t.retriesLimit||a(r))&&(l[o]=!0,clearInterval(s),i(e,t,n))},t.pollFrequency))):n()}function a(e){var n,i=0;!d&&t();for(var a=0,o=s.length;o>a;a++){if(r.style.fontFamily='"'+e+'", '+s[a],n=r.offsetWidth,a&&n!==i)return!1;i=n}return!0}var r,o=/sans-serif|serif|monospace|cursive|fantasy|"|'/gi,s=["sans-serif","serif","monospace","cursive","fantasy"],l={},c=200,u=10,d=!1;e.fn.onFontsLoaded=function(t){function a(e){for(var t,n,i=0,a=e.length;a>i;i++)t=e[i].trim(),t&&(n=t.toLowerCase(),l[n]||f[n]||(g.push(t),f[n]=!0,p++))}var r,s,d=this,g=[],f={},p=0,h={pollFrequency:c,retriesLimit:u,callback:cs};if("function"==typeof t?h.callback=t:h=e.quickExtend(h,t),s=h.fonts||[],s&&"string"==typeof s&&(s=s.replace(o,"").split(",")),s.length)a(s);else for(var m=0,v=this.length;v>m;m++)r=this[m],s=n(r).fontFamily.replace(o,"").split(","),a(s);return p?i(g,h,function(){h.callback.call(d,d)}):h.callback.call(this,this),this},e.onFontsLoaded=function(t,n){var i={};"string"==typeof t||e.isArray(t)?("function"==typeof n?i.callback=n:i=n,i.fonts=t):i=t,e.fn.onFontsLoaded(i)},e.isFontLoaded=function(e){var t;"string"==typeof e&&(e=e.replace(o,"").split(","));for(var n=0,i=e.length;i>n;n++)if(t=e[n].trim(),t&&!l[t.toLowerCase()])return!1;return!0},e.getLoadedFonts=function(t){return t&&e.getKeys(l)||l}}(p),function(e){function t(e){var t=e.innerHTML.replace(o,"$1<"+r+">$2$3"),n=document.createElement("ellipsis");return{ellipsisHTML:t,ellipsisElement:n}}function n(e){return window.getComputedStyle&&getComputedStyle(e)||e.currentStyle}function i(t,i,o){var l,c,u,d,g,f,p,h,m=o.container,v=m||t,y=n(v),b=i.ellipsisElement,C=i.ellipsisHTML,I=o.maxLines||!1,S=0,P=1,w=0;if(t.innerHTML=C,t.className=t.className,b.innerHTML=o.endElement,c=t.getElementsByTagName(r),c.length)if(l=parseInt(y.maxHeight)||parseInt(y.height)||e(v).height(),g=c[0],f=c[c.length-1],u=Math.max(0,g.offsetTop),l+=a,m&&(l-=u),g.offsetHeight>l&&(g.innerHTML="<"+r+">"+g.innerHTML.split("").join("<"+r+">")+"",f=c[c.length-1],g=c[1]),g.offsetHeight>l)t.innerHTML="";else if(f.offsetTop-u+f.offsetHeight>l){for(p=0,h=c.length;h>p;p++)if(d=c[p],d.offsetTop-u>S){if(P++,I&&P>I||d.offsetTop-u+d.offsetHeight>l){w=p;do c[w].appendChild(b),w--;while(b.offsetTop-u>S);break}S=d.offsetTop-u}for(w+=2,p=w,h=c.length;h>p;p++)c[w].parentNode.removeChild(c[w])}t.innerHTML=t.innerHTML.replace(s,"")}var a=1,r="w",o=/(?:(<\/?.+?>)|(^|\s))([^<]\S*?(?=\s|<|$))/gim,s=RegExp("<\\/?"+r+">","gim");e.fn.ellipsis=function(a){var r,o,s;a=e.quickExtend({endElement:"…"},a);for(var l=0,c=this.length;c>l;l++)r=this[l],o=e.data(r,"__ellipsisData"),o&&!a.updateContent||(o=t(r),e.data(r,"__ellipsisData",o)),a.doNotRender||(s=n(r).fontFamily,i(r,o,a),e.isFontLoaded(s)||e(r).onFontsLoaded(function(){e(this).ellipsis(a)}));return this}}(p);var $t=function(){function e(e,t,n,i){i=f.valueOrDefault(i,f.referencesEqualityComparer);var a=e[t];if(void 0!==a){var r=f.findFirst(n,function(e,t){return!i(a[e],t)});if(void 0!==r)return a=f.quickExtend({},a),f.quickExtend(a,n),e[t]=a,a}}var t=C.extend("ObservableCollection",{init:function(e){e=f.quickExtend({idFunction:f.defaultIdFunction,comparerFunction:f.defaultEqualityComparer,attributes:{}},e),this._idFunction=e.idFunction,this._comparerFunction=e.comparerFunction,this._items={},this._attributes=e.attributes},lazyInitializationProperties:{id:f.weakID,itemsAddedEvent:x.create,itemsRemovedEvent:x.create,itemsUpdatedEvent:x.create,itemUpdatedEvent:x.create,itemAddedEvent:x.create,itemRemovingEvent:x.create,updateBatch:Ae.create},_count:0,getAttributes:function(){return this._attributes},supportsDelayedFetching:ds,isObservableCollection:us,setAttributes:function(e){f.quickExtend(this._attributes,e)},beginUpdate:function(){this.updateBatch.begin()},endUpdate:function(){this.updateBatch.end()},connectObservableCollection:function(e,t){return Me.connectObservableCollection(this,e,t)},disconnectObservableCollection:function(){Me.disconnectObservableCollection(this)},updateItemFields:function(t,n,i){var a,r=this,o=r._items;a="object"==typeof t?r._idFunction(t):t;var s=e(o,a,n,i);void 0!==s&&r.invalidateItems(s)},updateItemsFields:function(t,n){var i=this,a=i._items;i.beginUpdate();var r=[];for(var o in a){var s=e(a,o,t(o,a[o]),n);void 0!==s&&r.push(s)}r.length>0&&i.invalidateItems(r),i.endUpdate()},syncrhonize:function(e){var t,n=this,i=n._items;f.isPlainObject(e)?t=e:(e=f.asArray(e),t=f.makeSet(e,n._idFunction));var a=[];for(var r in i)void 0===t[r]&&a.push(r);n.beginUpdate(),n.remove(a),n.put(e),n.endUpdate()},invalidateAllItems:function(){this.invalidateItems(f.getValues(this._items))},invalidateItems:function(e){if(void 0!==e){var t=this;t.beginUpdate();var n=t._getLazyProperty("itemUpdatedEvent"),i=t._getLazyProperty("itemsUpdatedEvent"),a=n||i;if(a){e=f.asArray(e);var r=e.length;if(r>0){if(n)for(var o=0;r>o;o++)n.fireNew(e[o]);i&&i.fireNew(e)}}t.endUpdate()}},put:function(e){if(void 0!==e){e=f.asArray(e);var t,n,i,a,r,o=this,s=o._idFunction,l=o._items,c=0;o.beginUpdate();var u=o._getLazyProperty("itemUpdatedEvent"),d=o._getLazyProperty("itemsUpdatedEvent"),g=o._getLazyProperty("itemAddedEvent"),p=o._getLazyProperty("itemsAddedEvent"),h=g||p,m=u||d;if(h||m){if(m)var v=o._comparerFunction,y=[];if(h)var b=[];for(n=e.length,t=0;n>t;t++)i=e[t],a=s(i),r=void 0!==l[a],r?m&&(v(l[a],i)||y.push(i)):(h&&b.push(i),c++),l[a]=i;if(c>0){if(g)for(t=0;c>t;t++)g.fireNew(b[t]);o._count+=c,p&&p.fireNew(b)}if(m){var C=y.length;if(C>0){if(u)for(t=0;C>t;t++)u.fireNew(y[t]);d&&d.fireNew(y)}}}else{for(n=e.length,t=0;n>t;t++)i=e[t],a=s(i),void 0===l[a]&&c++,l[a]=i;c>0&&(o._count+=c)}return o.endUpdate(),o}},remove:function(e){var t=this,n=t._items;e=f.asArray(e),t.beginUpdate();var i=t._getLazyProperty("itemRemovingEvent"),a=t._getLazyProperty("itemsRemovedEvent");if(a)var r=[];for(var o=e.length,s=0,l=0;o>l;l++){var c=e[l],u=n[c];void 0!==u&&(i&&i.fireNew(u),delete n[c],s++,a&&r.push(c))}s>0&&(t._count-=s,a&&t.itemsRemovedEvent.fireNew(r)),t.endUpdate()},clear:function(){this.remove(f.getKeys(this._items))},getIDFunction:function(){return this._idFunction},getItems:function(){return this._items},getItemsLength:function(){return this._count},hasItems:function(){return this._count>0},getItemsValues:function(){return f.getValues(this._items)},getItem:function(e){return this._items[e]}});return t.create=function(e){return new t(e)},t}(),Wt=fs(function(){this.create=function(e){var t=1,n=0,i=e?1:0;return{informOperation:function(){i=t},isDirty:function(){return i>n},beginSaving:function(){t++;var e=i;return{finishSaving:function(){e>n&&(n=e)}}}}},this.beginSaving=function(e){for(var t=[],n=0;n0})},whenCollectionIsEmpty:function(e){return this.whenCollectionItemsCount(e,function(e){return 0===e})}}),l}(),Gt={Red:0,Green:1,Blue:2,Hue:3,Saturation:4,Brightness:5,Opacity:6};!function(e){function t(e){return void 0!==e&&"rgb()"!==e?e:"rgb(0, 0, 0)"}function n(e){switch(e){case Gt.Red:return 0;case Gt.Green:return 1;case Gt.Blue:return 2;case Gt.Hue:return 0;case Gt.Saturation:return 1;case Gt.Brightness:return 2;case Gt.Opacity:return 3}}e.calculateForegroundColor=function(t){if(!t||e.isGradient(t))return e.Color("black");var n=e.Color(t).toRGB();return.299*n[0]+.587*n[1]+.114*n[2]>150?e.Color("black"):e.Color("white")},e.generateHSLSwatch=function(){for(var t=[],n=["red","blue","green","yellow","orange","purple","indigo","black"],i=0;i=r;r+=.1){var o=a.toHSL().modify([null,null,r]);t.push(o)}return t},e.calculateMeanColor=function(t,n,i,a,r){return e.Color([Math.floor(e.calculateMeanValue(t,n,i,a[0],r[0])),Math.floor(e.calculateMeanValue(t,n,i,a[1],r[1])),Math.floor(e.calculateMeanValue(t,n,i,a[2],r[2])),e.calculateMeanValue(t,n,i,e.valueOrDefault(a[3],1),e.valueOrDefault(r[3],1))])},e.recolor=function(t,n,i,a){function r(t){var r=e.Color(t).toHSL(),o=r[0],s=r[1],l=r[2],c=r.getAlpha();return 0!=n&&(o=e.modulo(Math.round(360*o)+n,360)/360),i>0?s+=(1-s)*(i/100):0>i&&(s-=s*(Math.abs(i)/100)),a>0?l+=(1-l)*(a/100):0>a&&(l-=l*(Math.abs(a)/100)),e.Color([o,s,l,c],"HSL").toCSS()}if(e.assertRange(n,-180,180),e.assertRange(i,-100,100),e.assertRange(a,-100,100),e.isGradient(t)){var o=t.gradient;return{gradient:{colorStops:e.map(o.colorStops,function(e){return{location:e.location,value:r(e.value)}}),opacityStops:e.map(o.opacityStops,function(e){return{location:e.location,value:e.value}})},orientation:t.orientation}}return r(t)},e.colorsEqualityComparer=function(t,n){return e.colorsEqual(t,n)},e.colorsEqual=function(n,i,a){if(a=e.valueOrDefault(a,!0),n&&i){n=t(n),i=t(i);var r=e.Color(n).toRGB(),o=e.Color(i).toRGB(),s=e.valueOrDefault(r[3],1),l=e.valueOrDefault(o[3],1);return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]&&(!a||s===l)}return n===i},e.getCoordinateValue=function(t,i){e.isRGBCoordinate(i)&&"RGB"!==t.space?t=e.Color(t).toRGB():e.isHSLCoordinate(i)&&"HSL"!==t.space&&(t=e.Color(t).toHSL());var a=n(i),r=t[a];return void 0===r&&i===Gt.Opacity?1:r},e.getCoordinateDelta=function(t,n,i){return e.getCoordinateValue(t,i)-e.getCoordinateValue(n,i)},e.colorsSimilarExceptCoordinate=function(t,i,a){if(t&&i){"string"==typeof t&&(t=e.Color(t)),"string"==typeof i&&(i=e.Color(i)),t=e.getRelevantCoordinates(t,a),i=e.getRelevantCoordinates(i,a);for(var r=n(a),o=0;o0){i=Math.sqrt(Math.pow(d,2)+Math.pow(u,2)),a=180*Math.asin(u/i)/Math.PI,r=90-a,o=c/Math.sin(a*Math.PI/180)+Math.sin(r*Math.PI/180)*c/Math.cos(r*Math.PI/180),d-=o+c;var p=d/Math.cos(a*Math.PI/180)*Math.sin(a*Math.PI/180);s=u-p-c,u=p,g=Math.round(g),f=Math.round(f),u=Math.round(u),d=Math.round(d)}switch(l.angle){case 45:c>0&&(g+=c,f+=o),t.moveTo(g,f),t.lineTo(g,f+d),t.lineTo(g+u,f+d);break;case 135:c>0&&(g+=c,f+=c),t.moveTo(g,f),t.lineTo(g,f+d),t.lineTo(g+u,f);break;case 225:c>0&&(u=p,g+=s,f+=c),t.moveTo(g,f),t.lineTo(g+u,f),t.lineTo(g+u,f+d);break;case 315:c>0&&(g+=s,f+=o),t.moveTo(g,f+d),t.lineTo(g+u,f+d),t.lineTo(g+u,f)}}else switch(l.angle){case 90:c>0&&(i=Math.sqrt(Math.pow(d/2,2)+Math.pow(u,2)),a=180*Math.asin(u/i)/Math.PI,r=180-2*a,o=c/Math.sin(a*Math.PI/180)+Math.sin(r/2*Math.PI/180)*c/Math.cos(r/2*Math.PI/180),d-=2*o,s=c/Math.sin(r/2*Math.PI/180),u-=c+s,g+=c,f+=o,g=Math.round(g),f=Math.round(f),u=Math.round(u),d=Math.round(d)),t.moveTo(g,f),t.lineTo(g,f+d),t.lineTo(g+u,f+Math.round(d/2));break;case 180:c>0&&(i=Math.sqrt(Math.pow(u/2,2)+Math.pow(d,2)),a=180*Math.asin(d/i)/Math.PI,r=180-2*a,s=c/Math.sin(a*Math.PI/180)+Math.sin(r/2*Math.PI/180)*c/Math.cos(r/2*Math.PI/180),u-=2*s,o=c/Math.sin(r/2*Math.PI/180),d-=c+o,g=Math.round(g),f=Math.round(f),u=Math.round(u),d=Math.round(d),g+=s,f+=c),t.moveTo(g,f),t.lineTo(g+u,f),t.lineTo(g+Math.round(u/2),f+d);break;case 270:c>0&&(i=Math.sqrt(Math.pow(d/2,2)+Math.pow(u,2)),a=180*Math.asin(u/i)/Math.PI,r=180-2*a,o=c/Math.sin(a*Math.PI/180)+Math.sin(r/2*Math.PI/180)*c/Math.cos(r/2*Math.PI/180),d-=2*o,s=c/Math.sin(r/2*Math.PI/180),u-=c+s,g+=s,f+=o,g=Math.round(g),f=Math.round(f),u=Math.round(u),d=Math.round(d)),t.moveTo(g+u,f),t.lineTo(g+u,f+d),t.lineTo(g,f+Math.round(d/2));break;default:c>0&&(i=Math.sqrt(Math.pow(u/2,2)+Math.pow(d,2)),a=180*Math.asin(d/i)/Math.PI,r=180-2*a,s=c/Math.sin(a*Math.PI/180)+Math.sin(r/2*Math.PI/180)*c/Math.cos(r/2*Math.PI/180),u-=2*s,o=c/Math.sin(r/2*Math.PI/180),d-=c+o,g+=s,f+=o,g=Math.round(g),f=Math.round(f),u=Math.round(u),d=Math.round(d)),t.moveTo(g,f+d),t.lineTo(g+u,f+d),t.lineTo(g+Math.round(u/2),f)}t.closePath()}};return l(n,e,t)}function n(e,t){var n={properties:f.extend({width:300,height:300,points:5,angle:40,lineWidth:0},t),drawShape:function(t){var i=n.properties,a=i.width,r=i.height,o=a/2,s=r/2,l=i.angle/100,c=i.points,g=i.lineWidth/2;n.isLayoutActive(Xt.FillHorizontally)&&(a=e.size.width,o=a/2),n.isLayoutActive(Xt.FillVertically)&&(r=e.size.height,s=r/2);var f=Math.min(r,a),p=Math.floor(f/2),h=0,m=r-d(u(c,p,f)),v=p-g*(c/2);g>0&&(1>=v?(g=1,t.fillStyle=i.strokeColor,t.lineWidth=g):p=v),c%2!==0&&11>c&&(h=m+g/c),t.save(),t.beginPath(),t.translate(o,s+h),t.moveTo(0,0-p);for(var y=0;c>y;y++)t.rotate(Math.PI/c),t.lineTo(0,0-p*l),t.rotate(Math.PI/c),t.lineTo(0,0-p);t.rotate(Math.PI/c),t.lineTo(0,0-p*l),t.closePath(),t.restore()}};return l(n,e,t)}function i(e,t){var n={properties:f.extend({lineWidth:0,width:300,height:300,angles:6,x:0,y:0},t),drawShape:function(t){var i=n.properties,a=i.width,r=i.height,o=a/2,s=r/2,l=i.angles,c=i.lineWidth/2;n.isLayoutActive(Xt.FillHorizontally)&&(a=e.size.width,o=a/2),n.isLayoutActive(Xt.FillVertically)&&(r=e.size.height,s=r/2);var g=Math.min(r,a),f=g/2,p=0;if(c>0){var h=f-c*(l/(.9*l));1>=h?(c=h+c,f/=.4*l,t.lineWidth=c):(f=h,l%2!==0&&(p=g-d(u(l,f,g))-c))}t.save(),t.beginPath(),t.translate(o,s+p),t.moveTo(0,0-f);for(var m=0;l>m;m++)t.rotate(2*(Math.PI/l)),t.lineTo(0,0-f);t.closePath(),t.restore()}};return l(n,e,t)}function a(e,t){var n={properties:f.extend({lineWidth:0,width:600,height:300,topSize:50,baseOrientation:0,x:0,y:0},t),drawShape:function(t){var i,a,r,o,s,l,c=n.properties,u=c.width,d=c.height,g=c.topSize,f=c.lineWidth/2,p=c.baseOrientation,h=0,m=0;switch(n.isLayoutActive(Xt.FillHorizontally)&&(u=e.size.width),n.isLayoutActive(Xt.FillVertically)&&(d=e.size.height),t.beginPath(),p){case 0:i=(u-u/100*g)/2,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(d,2)),r=180*Math.asin(d/a)/Math.PI,o=180-2*r,l=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=l,d-=f,h+=l,m+=f,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(h,d),t.lineTo(h+i,m),t.lineTo(u-i,m),t.lineTo(u,d);break;case 90:i=(d-d/100*g)/2,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(u,2)),r=180*Math.asin(u/a)/Math.PI,o=180-2*r,s=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=f,d-=s,h+=f,m+=s,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(h,m),t.lineTo(u,m+i),t.lineTo(u,d-i),t.lineTo(h,d);break;case 180:i=(u-u/100*g)/2,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(d,2)),r=180*Math.asin(d/a)/Math.PI,o=180-2*r,l=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=l,d-=f,h+=l,m+=f,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(u,m),t.lineTo(u-i,d),t.lineTo(h+i,d),t.lineTo(h,m);break;case 270:i=(d-d/100*g)/2,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(u,2)),r=180*Math.asin(u/a)/Math.PI,o=180-2*r,s=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=f,d-=s,h+=f,m+=s,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(u,d),t.lineTo(h,d-i),t.lineTo(h,m+i),t.lineTo(u,m)}t.closePath()}};return l(n,e,t)}function r(e,t){var n={properties:f.extend({lineWidth:0,width:300,height:300,gapSize:30,slantDirection:"right",x:0,y:0},t),drawShape:function(t){var i,a,r,o,s,l,c=n.properties,u=c.width,d=c.height,g=c.gapSize,f=c.lineWidth/2,p=c.slantDirection,h=0,m=0;switch(n.isLayoutActive(Xt.FillHorizontally)&&(u=e.size.width),n.isLayoutActive(Xt.FillVertically)&&(d=e.size.height),t.beginPath(),p){case"right":i=u/100*g,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(d,2)),r=180*Math.asin(d/a)/Math.PI,o=180-2*r,l=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=l,d-=f,h+=l,m+=f,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(h,d),t.lineTo(h+i,m),t.lineTo(u,m),t.lineTo(u-i,d);break;case"down":i=d/100*g,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(u,2)),r=180*Math.asin(u/a)/Math.PI,o=180-2*r,s=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=f,d-=s,h+=f,m+=s,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(h,m),t.lineTo(u,m+i),t.lineTo(u,d),t.lineTo(h,d-i);break;case"left":i=u/100*g,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(d,2)),r=180*Math.asin(d/a)/Math.PI,o=180-2*r,l=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=l,d-=f,h+=l,m+=f,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(h,m),t.lineTo(u-i,m),t.lineTo(u,d),t.lineTo(h+i,d);break;case"up":i=d/100*g,f>0&&(a=Math.sqrt(Math.pow(i,2)+Math.pow(u,2)),r=180*Math.asin(u/a)/Math.PI,o=180-2*r,s=f/Math.sin(r*Math.PI/180)+Math.sin(o/2*Math.PI/180)*f/Math.cos(o/2*Math.PI/180),u-=f,d-=s,h+=f,m+=s,h=Math.round(h),m=Math.round(m),u=Math.round(u),d=Math.round(d)),t.moveTo(h,d),t.lineTo(h,m+i),t.lineTo(u,m),t.lineTo(u,d-i)}t.closePath()}};return l(n,e,t)}function o(e,t){var n={properties:f.extend({lineWidth:0,width:400,height:200,sweepAngle:90,baseThicknessPercent:40,baseLengthPercent:35,arrowDirection:0},t),drawShape:function(t){var i,a,r,o,s,l,c,u,d=n.properties,g=d.width,f=d.height,p=d.sweepAngle,h=d.arrowDirection,m=d.baseThicknessPercent,v=d.baseLengthPercent,y=d.lineWidth/2,b=0,C=0;switch(n.isLayoutActive(Xt.FillHorizontally)&&(g=e.size.width),n.isLayoutActive(Xt.FillVertically)&&(f=e.size.height),t.beginPath(),h){case 0:i=f/100*m,a=g/100*v,b=f/2,r=a-(f/2-i/2)*Math.tan((90+p)*(Math.PI/180)),y>0&&(o=Math.sqrt(Math.pow(f/2,2)+Math.pow(g-a,2)),s=180*Math.asin((g-a)/o)/Math.PI,l=180-2*s,c=y/Math.sin(s*Math.PI/180)+Math.sin(l/2*Math.PI/180)*y/Math.cos(l/2*Math.PI/180),f-=2*c,u=y/Math.sin(l/2*Math.PI/180),g-=y/2+u,C+=y,g=Math.round(g),f=Math.round(f)),t.moveTo(C,b),t.lineTo(C,b-i/2),t.lineTo(C+a,b-i/2),t.lineTo(C+r,b-f/2),t.lineTo(g,b),t.lineTo(C+r,b+f/2),t.lineTo(C+a,b+i/2),t.lineTo(C,b+i/2);break;case 90:i=g/100*m,a=f/100*v,C=g/2,r=a-(g/2-i/2)*Math.tan((90+p)*(Math.PI/180)),y>0&&(o=Math.sqrt(Math.pow(g/2,2)+Math.pow(f-a,2)),s=180*Math.asin((f-a)/o)/Math.PI,l=180-2*s,u=y/Math.sin(s*Math.PI/180)+Math.sin(l/2*Math.PI/180)*y/Math.cos(l/2*Math.PI/180),g-=2*u,c=y/Math.sin(l/2*Math.PI/180),f-=y/2+c,b+=y,g=Math.round(g),f=Math.round(f)),t.moveTo(C,b),t.lineTo(C+i/2,b),t.lineTo(C+i/2,b+a),t.lineTo(C+g/2,b+r),t.lineTo(C,f),t.lineTo(C-g/2,b+r),t.lineTo(C-i/2,b+a),t.lineTo(C-i/2,b);break;case 180:i=f/100*m,a=g/100*v,b=f/2,r=a+(f/2-i/2)*Math.tan((90-p)*(Math.PI/180)),y>0&&(o=Math.sqrt(Math.pow(f/2,2)+Math.pow(g-a,2)),s=180*Math.asin((g-a)/o)/Math.PI,l=180-2*s,c=y/Math.sin(s*Math.PI/180)+Math.sin(l/2*Math.PI/180)*y/Math.cos(l/2*Math.PI/180),f-=2*c,u=y/Math.sin(l/2*Math.PI/180),g-=y,C+=y/2+u,g=Math.round(g),f=Math.round(f)),t.moveTo(g,b),t.lineTo(g,b-i/2),t.lineTo(g-a,b-i/2),t.lineTo(g-r,b-f/2),t.lineTo(C,b),t.lineTo(g-r,b+f/2),t.lineTo(g-a,b+i/2),t.lineTo(g,b+i/2);break;case 270:i=g/100*m,a=f/100*v,C=g/2,r=a+(g/2-i/2)*Math.tan((90-p)*(Math.PI/180)),y>0&&(o=Math.sqrt(Math.pow(g/2,2)+Math.pow(f-a,2)),s=180*Math.asin((f-a)/o)/Math.PI,l=180-2*s,u=y/Math.sin(s*Math.PI/180)+Math.sin(l/2*Math.PI/180)*y/Math.cos(l/2*Math.PI/180),g-=2*u,c=y/Math.sin(l/2*Math.PI/180),b+=y/2+c,f-=y,g=Math.round(g),f=Math.round(f)),t.moveTo(C,f),t.lineTo(C+i/2,f),t.lineTo(C+i/2,f-a),t.lineTo(C+g/2,f-r),t.lineTo(C,b),t.lineTo(C-g/2,f-r),t.lineTo(C-i/2,f-a),t.lineTo(C-i/2,f)}t.closePath()}};return l(n,e,t)}function s(e,t){var n={properties:f.extend({lineWidth:0,width:400,height:200,x:0,y:0,pointOrientation:180,cornerRadius:20,baseOffset:"center",baseWidth:60,baseOffsetPercent:20,tipHeight:30,tipOffset:10},t),drawShape:function(t){var i,a,r,o=n.properties,s=o.width,l=o.height,c=o.lineWidth/2,u=0,d=0,g=d+l,f=u+s,p=o.cornerRadius,h=o.pointOrientation,m=o.baseOffset,v=o.baseWidth,y=o.tipHeight,b=o.tipOffset;switch(n.isLayoutActive(Xt.FillHorizontally)&&(s=e.size.width),n.isLayoutActive(Xt.FillVertically)&&(l=e.size.height),0===h?(d=l/100*y+c,u=c,g=l-c,f=s-c,i=(f-2*p)/100*v,a=(f-2*p-i)/2,r=(f-2*p)/100*o.baseOffsetPercent):90===h?(d=c,u=c,f=s-s/100*y-c,g=l-c,i=(g-2*p)/100*v,a=(g-2*p-i)/2,r=(g-2*p)/100*o.baseOffsetPercent):180===h?(d=c,u=c,g=l-c-l/100*y,f=s-c,i=(f-2*p)/100*v,a=(f-2*p-i)/2,r=(f-2*p)/100*o.baseOffsetPercent):270===h&&(u+=s/100*y,d=c,f=s-c,g=l-c,i=(g-2*p)/100*v,a=(g-2*p-i)/2,r=(g-2*p)/100*o.baseOffsetPercent),t.beginPath(),h){case 0:switch(m){case"left":t.lineTo(u+p+r,d),t.lineTo(s/100*b,2*c),t.lineTo(u+p+r+i,d);break;case"right":t.lineTo(f-p-r,d),t.lineTo(s/100*b,2*c),t.lineTo(f-p-r-i,d);break;case"center":t.lineTo(u+p+a,d),t.lineTo(s/100*b,2*c),t.lineTo(f-p-a,d)}t.lineTo(f-p,d),t.quadraticCurveTo(f,d,f,d+p),t.lineTo(f,g-p),t.quadraticCurveTo(f,g,f-p,g),t.lineTo(u+p,g),t.quadraticCurveTo(u,g,u,g-p),t.lineTo(u,d+p),t.quadraticCurveTo(u,d,u+p,d);break;case 90:switch(t.moveTo(u+p,d),t.lineTo(f-p,d),t.quadraticCurveTo(f,d,f,d+p),m){case"left":t.lineTo(f,d+p+r),t.lineTo(s-2*c,l-l/100*b),t.lineTo(f,d+p+r+i);break;case"right":t.lineTo(f,g-p-r),t.lineTo(s-2*c,l-l/100*b),t.lineTo(f,g-p-r-i);break;case"center":t.lineTo(f,d+p+a),t.lineTo(s-2*c,l-l/100*b),t.lineTo(f,g-p-a)}t.lineTo(f,g-p),t.quadraticCurveTo(f,g,f-p,g),t.lineTo(u+p,g),t.quadraticCurveTo(u,g,u,g-p),t.lineTo(u,d+p),t.quadraticCurveTo(u,d,u+p,d);break;case 180:switch(t.moveTo(u+p,d),t.lineTo(f-p,d),t.quadraticCurveTo(f,d,f,d+p),t.lineTo(f,g-p),t.quadraticCurveTo(f,g,f-p,g),m){case"left":t.lineTo(u+p+r+i,g),t.lineTo(f-s/100*b,l-2*c),t.lineTo(u+p+r,g);break;case"right":t.lineTo(f-p-r,g),t.lineTo(f-s/100*b,l-2*c),t.lineTo(f-p-r-i,g);break;case"center":t.lineTo(f-p-a,g),t.lineTo(s-s/100*b,l-2*c),t.lineTo(u+p+a,g)}t.lineTo(u+p,g),t.quadraticCurveTo(u,g,u,g-p),t.lineTo(u,d+p),t.quadraticCurveTo(u,d,u+p,d);break;case 270:switch(t.moveTo(u+p,d),t.lineTo(f-p,d),t.quadraticCurveTo(f,d,f,d+p),t.lineTo(f,g-p),t.quadraticCurveTo(f,g,f-p,g),t.lineTo(u+p,g),t.quadraticCurveTo(u,g,u,g-p),m){case"left":t.lineTo(u,d+p+r),t.lineTo(2*c,l-l/100*b),t.lineTo(u,d+p+r+i);break;case"right":t.lineTo(u,g-p-r),t.lineTo(2*c,l-l/100*b),t.lineTo(u,g-p-r-i);break;case"center":t.lineTo(u,g-p-a),t.lineTo(2*c,d+g/100*b),t.lineTo(u,d+p+a)}t.lineTo(u,d+p),t.quadraticCurveTo(u,d,u+p,d)}t.closePath()}};return l(n,e,t)}function l(e,t,n){return f.extend(e.properties,{lineWidth:0,strokeColor:"black",backgroundColor:"transparent"},n),f.extend(e,{repaint:function(n){var i=e.properties,a=i.backgroundColor;if(f.isGradient(a)){for(var r=a.orientation,o=r===ct.Vertical?t.size.height:0,s=r===ct.Horizontal?t.size.width:0,l=f.normalizeGradientStops(a.gradient),c=n.createLinearGradient(0,0,s,o),u=0;u0&&n.stroke()}}),c(e,t)}function c(e,t){return f.extend(e,{id:t.idGenerator.next(),setPropertyValue:function(n,i){var a=e.properties,r=a[n];r!==i&&(a[n]=i,t.repaint())},setPropertiesValues:function(n){t.beginUpdate();for(var i in n)e.setPropertyValue(i,n[i]);t.endUpdate()},toggleLayout:function(n,i){var a=e.isLayoutActive(n);return a!==i&&(i?e.layouts[n]=!0:delete e.layouts[n],t.repaint()),e},isLayoutActive:function(t){return void 0!==e.layouts[t]},layouts:{}})}function u(e,t,n){for(var i=[],a=360/e,r=a;360>=r;r+=a)i.push({cx:t*Math.cos(r*(Math.PI/180))+n/2,cy:t*Math.sin(r*(Math.PI/180))+n/2});return i}function d(e){var t=0;return f.eachItem(e,function(e,n){ti;i++)n[i+1]=arguments[i];var a=this,r=e.apply(a,n);return u.elements[r.id]=r,u.repaint(),r}}var c=f(""),u={$element:c,canvas:c[0],idGenerator:f.createWeakIdGenerator(),elements:{},size:{width:0,height:0},isInitialized:!1,duringUpdate:0,repaintOnEndUpdate:!1,initialize:function(){u.isInitialized||(u.isInitialized=!0,u.refreshSize())},beginUpdate:function(){u.duringUpdate++},endUpdate:function(){u.duringUpdate=Math.max(0,u.duringUpdate-1),0===u.duringUpdate&&u.repaintOnEndUpdate&&(u.repaintOnEndUpdate=!1,u.repaint())},repaint:function(){if(u.isInitialized)if(u.duringUpdate>0)u.repaintOnEndUpdate=!0;else{var e=u.canvas,t=e.getContext("2d");t.clearRect(0,0,e.width,e.height);var n=u.elements;for(var i in n)n[i].repaint(t)}},refreshSize:function(e){u.initialize();var t=e;void 0!==t&&null!==t||(t=u.$element.elementSize()),u.size=t,u.$element.attr("width",t.width).attr("height",t.height),u.repaint()}};return f(window).resize(function(e){e.target!==window&&e.target!==document||u.repaint()}),f.extend(u,{addEllipse:l(e),addTriangle:l(t),addStar:l(n),addPolygon:l(i),addTrapezoid:l(a),addParallelogram:l(r),addArrow:l(o),addSpeechBubble:l(s)})}}),Kt=fs(function(){function e(e,n){var i=Qt.addNamesToElements(f(n)[0]),a=t(i);i=a.element;var r=Qt.getShapeReference(i),o=Qt.getShapeProperties(i),s={type:"SvgElement",elementProperties:{shapeReference:r,svgProperties:o,sizeAndPosition:a.sizeAndPosition,elementRole:a.elementRole},metaData:{size:{height:a.sizeAndPosition.height,width:a.sizeAndPosition.width}},containerId:f.uniqueID(),childElements:[]};e.push(s)}function t(e){var t,n,i=document.createElementNS(Jt.svgNS,"svg");t=e[0].hasAttribute("width")?e[0].getAttribute("width"):100,i.setAttribute("width",t),n=e[0].hasAttribute("height")?e[0].getAttribute("height"):100,i.setAttribute("height",n),i.appendChild(e[0]),e=i;var a=[t,n],r={width:parseInt(e.getAttribute("width")),height:parseInt(e.getAttribute("height")),top:0,left:0},o=e.firstChild,s={role:"shape",type:"multipart"},l=o.getAttribute("data-type");if(l&&(s.role=l,"shape"!==l&&(s.type="text")),o.hasAttribute("transform")){var c=Jt.transformManager.parse(o);c.translate&&(r.left=parseInt(c.translate[0])*(c.scale[0]||1),r.top=parseInt(c.translate[1])*(c.scale[1]||1)),c.scale&&(a[0]=a[0]/c.scale[0],a[1]=a[1]/c.scale[1]),o.removeAttribute("transform")}return e.setAttribute("viewBox","0 0 {0} {1}".format(a[0],a[1])),{element:e,sizeAndPosition:r,elementRole:s}}this.getInstanceByType=function(e,t){var n=null;return f.eachEntry(e,function(e,i){if("SvgElement"===i.elementType.name){var a=i.getSvgController().element.firstChild.getAttribute("data-type");a===t&&(n=i)}}),n},this.getLogoReference=function(e,t,n){var i={id:null,shape:null,shapeId:null,ownerId:null,storage:null},a=document.createElementNS(Jt.svgNS,"svg");f(e).appendTo(f(a)),e=f(e)[0],i.id=t.id,i.shape=Jt.getSvgOuterHTML(e),i.shapeId=n?n:f.uniqueID();return i},this.moveText=function(e,t,n){function i(){var t=Jt.transformManager.parse(e),n=0;t.translate?n=t.translate[0]:t.translate=[0,0];var i=Jt.normalizeNumber(n-a,!0),r=1;t.scale&&(r=t.scale[0]),t.translate[0]=i/r;var o=Jt.transformManager.build(t);e.setAttribute("transform",o)}var a=0,r=void 0;n&&(t||(t=Jt.getAttributeValue(e.firstChild,"data-text-direction",!0)),"middle"===t?(r=e.getAttribute("width"),a=(r-n)/2,i()):"left"===t&&(r=e.getAttribute("width"),a=r-n,i()))},this.createPropertiesList=function(e,t,n){var i=e.logo?e.logo:e.shape;if(t){var a=i.replace(/####/g,f.weakID());a=[f(a)[0]]}else a=i.replace(/####/g,f.weakID()),a=[f(a)[0]],a=Qt.removeNamesFromElements(a);return a=Qt.addNamesToElements(a),a=Qt.addNamesToObjects(a),{logoReference:this.getLogoReference(a,e,null,t),svgProperties:Qt.getShapeProperties(a),sizeAndPosition:Qt.getShapeSizes(a,n)}},this.createElementHierarchy=function(t){var n={id:ka.generateWebsiteId(),type:"userBox",elementProperties:{sizeAndPosition:{width:0,height:0,left:0,top:0}},childElements:[]},i={};i.structures=[],i.structures.push(n);for(var a=f(t)[0].childNodes,r=0;r1){for(var t,n=0;n0)return n(e[i].childNodes)}}(e.childNodes)},this.getShapeProperties=function(e){function t(i){for(var a={fill:null,stroke:null},r=0;ri;i+=1)e.data.hasOwnProperty(i)&&(n=document.createElementNS(Jt.svgNS,"stop"),n.setAttribute("offset",e.data[i].location+"%"),n.setAttribute("stop-color",e.data[i].color),l.appendChild(n));return l.appendChild(n),s.appendChild(l),s},this.normalizeGradient=function(e){var t={};t.color="#000000",t.opacity=1,t.location=0;var n={};n.orientation=e.orientation,n.data=[];var i=e.gradient;for(var a in i.colorStops){var r=f.quickExtend({},t);r.location=i.colorStops[a].location;var o=Ka.evaluateColorBinding(i.colorStops[a].value);void 0!==o&&(r.color="object"==typeof o?o.toHEX():o),n.data[a]=r}return n},this},this.simpleAttrUpdate=function(e,t,n){return null===n?e.removeAttribute(t):e.setAttribute(t,n)},this.updateChildren=function(e,t,n){var i=Jt.find.nestedSVGs(e);for(var a in i)if(i.hasOwnProperty(a)){var r=i[a].childNodes;for(var o in r)r.hasOwnProperty(o)&&r[o]&&(r[o]=this.simpleAttrUpdate(r[o],t,n))}return e},this.prepareForJoin=function(n){var i,a=[],r=[];return f.eachItem(n,function(t,n){function a(e,t){for(var n=e.childNodes,i=0;it.order?1:0}return e.sort(t)},this.createSvgNodeFromString=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstChild},this.getSvgOuterHTML=function(e){if(void 0===e.outerHTML||1!==e.length&&void 0!==e.length){if(e.hasOwnProperty("shape"))return e.shape;var t=document.createElement("div"),n=e[0].cloneNode(!0);return n=[n],f.eachItem(n,function(e,n){t.appendChild(n)}),t.innerHTML}return e.outerHTML},this.viewBoxManager={parse:function(e){var t=e.split(" ");return{x:t[0],y:t[1],width:t[2],height:t[3]}}},this.transformManager={attrParse:function(e){var t=[],n=["translate","scale","rotate","skew"],i=e.split(")");return f.eachItem(i,function(e,i){var a=i.split("(");if(a.length>1){for(var r,o=0;oi)&&(a=i)}),!isNaN(a)&&0!==a){a*=-1;for(var r=0;r0&&1>=e?100*e:e},this.getAttributeValue=function(e,t,n){var i=null;return n=n?n:!0,e.hasAttribute(t)?i=e.getAttribute(t):void 0!==e.style[t]&&(i=e.style[t]),n&&(i=""===i||"none"===i?null:i),i},this.setAttributeValue=function(e,t,n,i){void 0!==e.style[t]?i?(e.style[t]=void 0,e.setAttribute(t,n)):e.style[t]=n:e.setAttribute(t,n)},this.normalizeNumber=function(e){return+e===e&&e%1===0?parseInt(e):+parseFloat(e).toFixed(2)},this.find={allG:function(e){var t=[],n=e.childNodes;for(var i in n)n.hasOwnProperty(i)&&"g"===n[i].nodeName.toLowerCase()&&t.push(n[i]);return t},nestedSVGs:function(e){var t=[],n=this.allG(e);for(var i in n){var a=n[i].childNodes;for(var r in a)a.hasOwnProperty(r)&&"svg"===a[r].nodeName.toLowerCase()&&t.push(a[r])}return t},elementByType:function(e,t){for(var n=0;n1)for(var g=0;g'.format(t)),i.append('
    '.format(t,n)),i.append("
    "),f(""+i)}}},this.getDefaultPanel=function(t,n,i,a,r,o){return void 0===t.DefaultPanel&&(t.DefaultPanel=e(t,n,i,a,r,o)),t.DefaultPanel},this.requestPanel=function(t){var n=t.panelsPool;if(void 0==n&&(n=[],t.panelsPool=n),0===n.length){var i=e(t);i.panelsPool=n,n.push(i)}return n.pop()},this.releasePanel=function(e){e.panelsPool||ee.error("Cannot release panel which hasn't been associated with a panels factory pool"),e.panelsPool.push(e)},this.usePanel=function(e){return e?e.use():e},this.createPanelWithActivationArgs=function(t,n,i,a,r,o,s){var l=e(t,i,a,r,o,s);return f.quickExtend(l.defaultActivationArgs,n),l},this.createPanel=e,this.createBaseController=function(e){var t=an.create();return e&&f.quickExtend(t,e),t},this.createController=t,this.setAsPanelsScope=function(e,t){e.addClass("panels-scope").data("panels-scope",t)},this.removePanelsScope=function(e){e.removeClass("panels-scope").removeData("panels-scope")}}),tn=C.extend("DeferredPanel",{init:function(e,t){t=f.quickExtend({creationArgs:[],creationCallback:cs,activationHandler:cs},t);var n=this;n._panelFactory=e,n._options=t,n.id=f.uniqueID()},lazyInitializationProperties:{isEnabled:function(){var e=this;return O.createConditionalPositive({valueChangeCallback:function(t){if(e.isActivated.isTrue()){var n=e.getPanel();t?e._options.activationHandler.call(n,n):(e._ignoreDeactivationRequest=!0,n.requestDeactivation(),e._ignoreDeactivationRequest=!1)}}})},isActivated:function(){var e=this;return O.create(!1,{valueChangeCallback:function(t){e._ignoreActivatedFlagChange||(t?e.activate():e.isEnabled.isTrue()&&e.getPanel().requestDeactivation())}})}},isCreated:!1,_ignoreDeactivationRequest:!1,_ignoreActivatedFlagChange:!1,isPanelActivated:function(){return this.isCreated&&this.panel.isActivated},getPanel:function(){var e=this,t=this._panelFactory,n=this._options,i=e.panel;return void 0===i&&(i=f.isFunction(t)?t():en.createPanelWithActivationArgs.apply(en,f.merge([t,n.defaultActivationArgs],f.asArray(n.creationArgs))),e.panel=i,e.isCreated=!0,n.creationCallback.call(i,i),i.requestDeactivationEvent.bind(function(){e._ignoreDeactivationRequest||(e._ignoreActivatedFlagChange=!0,e.isActivated.setFalse(),e._ignoreActivatedFlagChange=!1)}),i.id=e.id),this.panel},activate:function(){var e,t=this,n=arguments.length;if(t.isEnabled.isFalse());else{var i=t.getPanel(),a=Array(n+1);for(a[0]=i,e=0;n>e;e++)a[e+1]=arguments[e];t._options.activationHandler.apply(i,a)}t.isActivated.setTrue()},use:function(){return this.getPanel()}});en.createDeferredPanel=function(e,t){return new tn(e,t)};var nn=C.extend("InnerPanelController",{init:function(e,t){t=f.quickExtend({appendTo:e.$element,onDeactivationRequested:function(){e.requestDeactivation()},panelChangedCallback:cs,onPanelActivated:cs,propagateInnerDropPanelsContainer:!1},t),this._appendTo=t.appendTo,this._onDeactivationRequested=t.onDeactivationRequested,this._panelChangedCallback=t.panelChangedCallback,this._onPanelActivated=t.onPanelActivated,this._propagateInnerDropPanelsContainer=t.propagateInnerDropPanelsContainer,this._customPanelAppearance=t.customPanelAppearance,this.wrappingPanel=e,this.panelChangedEvent=x.create(),this.panelActivatedEvent=x.create(),this._bindingsCollection=x.createBindingsCollection()},_currentInnerPanel:void 0,_currentActivationArgs:void 0,_currentData:void 0,_customInnerPanelSize:void 0,getPanel:function(){return this._currentInnerPanel},removePanel:function(){this.setPanel(void 0)},reactivateCurrentPanel:function(e){e=f.quickExtend({},e);var t=this._currentInnerPanel;t&&this.setPanel(t,e)},setPanel:function(e,t){t=f.quickExtend({},t);var n=t.activationArgs,i=t.data;e&&(e=e.use());var a=this._currentInnerPanel,r=this._currentActivationArgs,o=this._currentData;if(e!==a||n!==r||o!==i){var s=this._bindingsCollection;s.unbindAll();var l=a;if(a=this._currentInnerPanel=e,r=this._currentActivationArgs=n,this._currentData=i,l&&l!==a&&(l.hostingInnerPanelController=void 0,l.deactivate(),l.$element.detach()),e){var c=e.hostingInnerPanelController;c&&c!==this&&c.setPanel(void 0),e.hostingInnerPanelController=this,e.$element.appendTo(f.evaluateWhenFunction(this._appendTo,e,i));var u=this.wrappingPanel;this._propagateInnerDropPanelsContainer&&e.setInnerDropPanelsContainer(u.getInnerDropPanelsContainer()),u.isActivated&&(e.activate(r,void 0,{customPanelAppearance:this._customPanelAppearance,customPanelSize:this._customInnerPanelSize}),this._onPanelActivated(e),this.panelActivatedEvent.fireNew(e)),u.startAnimationCompleted&&e.startAnimationCompletePromise.resolve();var d=this;e.requestDeactivationEvent.bind(function(){d._onDeactivationRequested()}).addToCollection(s),u.panelDeactivatedEvent.bind(function(){e.deactivate()}).addToCollection(s),u.panelActivatedEvent.bind(function(){e.activate(r,void 0,{customPanelAppearance:d._customPanelAppearance,customPanelSize:d._customInnerPanelSize}),d._onPanelActivated(e),d.panelActivatedEvent.fireNew(e)}).addToCollection(s),u.startAnimationCompletedEvent.bind(function(){e.startAnimationCompletePromise.resolve()}).addToCollection(s)}this._panelChangedCallback(e),this.panelChangedEvent.fireNew(e)}},setCustomInnerPanelSize:function(e){this._customInnerPanelSize=e;var t=this._currentInnerPanel;t&&this.wrappingPanel.isActivated&&t.setCustomPanelSize(e)}});en.createInnerPanelController=function(e,t){return new nn(e,t)};var an=function(){function e(e,t){return e.is(t)?!0:0===e.length&&0===t.length?!0:1===e.length&&1===t.length?e.data("panels-scope")===t.data("panels-scope"):!1}var t=C.extend("PanelController",{init:function(){var e=this;e.id=f.uniqueID(),e.bindings=[],e.visualizers=[],e._readWriteInitializationOperations=[]},lazyInitializationProperties:{panelActivatedEvent:x.create,panelDeactivatedEvent:x.create,panelActivatingEvent:x.create,startAnimationCompletedEvent:x.create,openedInContext:x.create,isPinned:O.createFalse,requestDeactivationEvent:x.create,isActivatedFlag:O.createFalse,maxPanelSize:function(){var e=this;return _.create({width:1/0,height:1/0},{equalityComparer:z.SizeEqualityComparer,valueChangeCallback:function(t){e.isActivated&&e.updatePanelSize(t)}})},panelSizeChangedEvent:x.create,_whenActivatedCallbacks:fe.create,_whenDeactivatedCallbacks:fe.create,_panelStateBindingsManager:ve.createStateBindingsGroup,_eventsListeners:x.createEventListenersGroup},defaultActivationArgs:void 0,wasInitialized:!1,isActivated:!1,duringActivation:!1,_init:function(){for(var e=this,t=this.$element,n=this.visualizers,i=0;i").addClass(e.contextClass).appendTo(s);e.isDraggable&&mn.Draggable.makeDraggable(u,{distance:3,contextOptions:{eventsCatcherClass:"cursor-move",behaviourOptions:{containment:"window"}}}),r&&c._stackWithWindows(u),c.deactivate();var d=c.$element.appendTo(u).toggleClass("is-draggable",e.isDraggable);c.$dropPanelWrapper=u,c.activate(e.activationArgs,e.panelContext),e.positioningFunction&&(c._panelPositionFunction=function(){var t;e.relativeTo&&(t=f(e.relativeTo)),n?u.positionToFit(f.getWindowArea(),[function(){f.usePositioningFunction(e.positioningFunction,u,t,c)}],void 0,{fallbackPositioning:0}):f.usePositioningFunction(e.positioningFunction,u,t,c)},c._panelPositionFunction(),t=f(window).on("resize",c._panelPositionFunction)),e.openCallback(c),a&&(i(u),e.showingFunction.call(u,u,c));var g=c.requestDeactivationEvent.bind(function(){c.deactivate(),f(window).off("resize",c._panelPositionFunction)});return c.panelDeactivatedEvent.one(function(){d.detach(),r&&c._removeStackWithWindows(u),delete c.$dropPanelWrapper,u.remove(),g.unbind(),o(c)}),c}}),function(e){var t=C.extend("DropPanelWindowController",{init:function(t,n){n=e.quickExtend({appendTo:rn.AppendParent,isDraggable:!0,stackWithWindows:!0,bindTogglingState:!1,deactivateOnClickOutside:!0,openCallback:cs,closeCallback:cs,ignoredElementsFilters:[]},n);var i=n.openCallback,a=n.closeCallback;this._isOpened=O.create(!1,{valueChangeCallback:function(e){e?i():a()}}),this._options=n,this.panel=t,this._deactivationIgnoredElements=[]},open:function(t,n){n=e.quickExtend({closeCallback:void 0,openCallback:void 0},n);var i=this._isOpened;if(i.isFalse()){var a=this._options,r=this.panel.use();i.setTrue();var o=n.closeCallback,s=n.openCallback;if(n=e.quickExtend({},a,n),r.openAsDropPanel({activationArgs:n.activationArgs,panelContext:n.panelContext,positioningFunction:n.positioningFunction,relativeTo:t,contextClass:n.contextClass,appendTo:n.appendTo,showingFunction:n.showingFunction,isDraggable:n.isDraggable,stackWithWindows:n.stackWithWindows,placeInsideWindow:n.placeInsideWindow,hidingFunctionBeforeShowing:n.hidingFunctionBeforeShowing,closeCallback:o,openCallback:s}),n.deactivateOnClickOutside){var l=this._deactivationIgnoredElements;n.ignoredElementsFilters&&n.ignoredElementsFilters.length>0&&(l=e.merge(l.clone(),n.ignoredElementsFilters)),r.deactivateOnClickOutside({ignoredElementsFilters:l})}r.panelDeactivatedEvent.one(function(){i.setFalse()})}},close:function(){this._isOpened.isTrue()&&this.panel.use().requestDeactivation()},toggle:function(){this.isOpened()?this.close():this.open()},isOpened:function(){return this._isOpened.getValue()},connectButton:function(t,n){n=e.quickExtend({dropPanelOpenedClass:"state-toggled",dropPanelClosedClass:"state-untoggled",dropPanelClassTarget:void 0,onClosingRequest:us},n);var i=n.onClosingRequest,a=Ie.createContextClass({getTarget:function(){return e.valueOrDefault(n.dropPanelClassTarget,t)}}),r=this._isOpened;r.valueChangedEvent.bindAndExecute(function(){r.isTrue()?a.setValue(n.dropPanelOpenedClass):a.setValue(n.dropPanelClosedClass)});var o=this;t.addClass("attached-drop-panel-window").buttonClick(function(){o.isOpened()?i()&&o.close():o.open(t,n)}),this._deactivationIgnoredElements.push(t)}});e.createDropPanelWindow=function(e,n){return new t(e,n)},e.fn.attachDropPanelWindow=function(t,n){n=e.quickExtend({dropPanelOpenedClass:"state-toggled",dropPanelClosedClass:"state-untoggled"},n);var i=e.createDropPanelWindow(t,n);if(i.connectButton(this,n),n.withDropPanelController){var a=this;n.withDropPanelController({open:function(){i.open(a,n)},close:function(){i.close()},isOpened:function(){return i.isOpened()}})}return this}}(f),function(e){e.fn.onContextMenu=function(e){for(var t=0;t>2,r=(3&t)<<4|n>>4,o=(15&n)<<2|i>>6,s=63&i,isNaN(n)?o=s=64:isNaN(i)&&(s=64),l=l+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(o)+this._keyStr.charAt(s);return l},decode:function(e){var t,n,i,a,r,o,s,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,n=(15&r)<<4|o>>2,i=(3&o)<<6|s,l+=String.fromCharCode(t),64!=o&&(l+=String.fromCharCode(n)),64!=s&&(l+=String.fromCharCode(i));return l=on._utf8_decode(l)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;ni?t+=String.fromCharCode(i):i>127&&2048>i?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t},_utf8_decode:function(e){for(var t="",n=0,i=0,a=0;ni)t+=String.fromCharCode(i),n++;else if(i>191&&224>i)a=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&a),n+=2;else{a=e.charCodeAt(n+1);var r=e.charCodeAt(n+2);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&r),n+=3}return t}};!function(e){function t(){if(void 0===n){var e=document.createElement("div"),t="background-image: -moz-linear-gradient(red, blue);background-image: -webkit-linear-gradient(red, blue);background-image: -o-linear-gradient(red, blue);background-image: linear-gradient(red, blue);background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, red), color-stop(100%, blue));",i=e.style;i.cssText=t,n=/(^|\s)-webkit-gradient/.test(i.backgroundImage)}return n}var n=void 0;e.fn.clearBackground=function(){return this.css("background-image",""),this},e.calculateGradientColorStopValue=function(t,n,i){return n||i?n?i?e.calculateMeanColor(t,n.location,i.location,e.Color(n.value),e.Color(i.value)):n.value:i.value:e.Color("black")},e.calculateGradientOpacityStopValue=function(e,t,n){if(!t&&!n)return 1;if(!t)return n.value;if(!n)return t.value;var i=e-t.location,a=n.location-t.location,r=n.value,o=t.value;return o+(r-o)/a*i},e.solidToGradient=function(e,t){return{gradient:{colorStops:[{location:0,value:e},{location:100,value:e}],opacityStops:[{location:0,value:1},{location:100,value:1}]},orientation:t}},e.isGradient=function(t){return e.isPlainObject(t)&&void 0!==t.gradient},e.fn.applyGradientColor=function(t){return this.setGradient(e.valueOrDefault(t.orientation,ct.Vertical),t.gradient)},e.cloneGradient=function(t,n){n=e.valueOrDefault(n,!1);var i=t.gradient;return{gradient:{colorStops:e.map(i.colorStops,function(t){return{location:t.location,value:n?e.Color(t.value):t.value}}),opacityStops:e.map(i.opacityStops,function(e){return{location:e.location,value:e.value}})},orientation:t.orientation}},e.getExplorer9GradientCSS=function(t){var n=t.orientation,i=t.gradient,a=e.uniqueID(),r=n===ct.Vertical?100:0,o=n===ct.Horizontal?100:0,s=new E(""); s.append(''),s.append(''),s.append('',a,o,r);for(var l=0;l',d,u.toHEX(),e.valueOrDefault(u[3],1))}s.append(""),s.append('',a),s.append("");var g=on.encode(""+s);return"url(data:image/svg+xml;base64,"+g+")"},e.fn.setGradient=function(n,i){var a,r,o,s,l,c=this;if(e.isPlainObject(i)&&(i=e.normalizeGradientStops(i)),i[0].stop=0,i[i.length-1].stop=100,c.css("background-color",""),e.browser.msie&&9==parseInt(e.browser.version))c.css("background-image",e.getExplorer9GradientCSS({orientation:n,gradient:i}));else{a=new E(",");var u,d,g="linear-gradient"===e.support.linearGradient,f=t();for(g||!f?(u="linear-gradient({0})",d="{1} {0}%"):(u="-webkit-gradient({0})",d="color-stop({0}%, {1})"),n===ct.Vertical?g?a.append("to bottom"):f?a.append("linear, 50% 0%, 50% 100%"):a.append("top"):g?a.append("to right"):f?a.append("linear, 0% 50%, 100% 50%"):a.append("left"),r=0;r1)for(var t=1;t=0){for(var n=Array(t),i=0;t>i;i++)n[i]=arguments[i+1];var a;a=window.parent?window.parent:window;var r=a[e];void 0!==r&&r.apply(a,n)}}catch(o){}}}();var ln=fs(function(){function e(e){e=f.quickExtend({fontFamily:void 0,fontUrlPrefix:void 0,supportSVG:!1,supportEOT:!1,supportTTF:!1,supportWOFF:!1},e);var t=e.fontFamily,n=e.fontUrlPrefix,i=e.supportSVG,a=e.supportEOT,r=e.supportTTF,o=e.supportWOFF,s=new E(",").conditionalAppend(a,"url('{0}.eot') format('embedded-opentype')".format(n)).conditionalAppend(o,"url('{0}.woff') format('woff')".format(n)).conditionalAppend(r,"url('{0}.ttf') format('truetype')".format(n)).conditionalAppend(i,"url('{0}.svg') format('svg')".format(n));return""+(new E).append("@font-face {").append('font-family: "{0}";',t).conditionalAppend(a,"src:url('{0}.eot');".format(n)).append("src:").append(""+s).append(";}")}var t=w.create(function(){var t=f('"),f(""+n).appendTo("head")[0]}function o(e,t){e.deleteRule?e.deleteRule(t):e.removeRule(t)}function s(){f(c).remove(),c=f('