-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.min.js
20 lines (19 loc) · 525 KB
/
app.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*! Copyright (c) 2018 CommonTime Ltd */
/*! ================================= */
function serviceFunc(e,t,o,n,r,a,i,s){function c(e){var n=function(o){if(t.debug("[notification.fct.js] Push received:",o),void 0!==e.config&&e.config.length>0){var n=a.get("ActionFactory");e.config.forEach(function(e){if("push-event"==e["item-type"]){var t={$notification:o},r=!0;e.operations.length>0&&(r=n.evalOperations(e.operations,t)),r===!0&&n.triggerEvent("push-received",e.actions,t)}})}},r=function(o){if(t.debug("[notification.fct.js] Push received:",o),void 0!==e.config&&e.config.length>0){var n=a.get("ActionFactory");e.config.forEach(function(e){if("voip-push-event"==e["item-type"]){var t={$notification:o},r=!0;e.operations.length>0&&(r=n.evalOperations(e.operations,t)),r===!0&&n.triggerEvent("voip-push-received",e.actions,t)}})}};if(void 0!==window.device&&void 0!==window.device.platform&&void 0!==e&&void 0!==e.settings&&void 0!==e.settings["push-notifications"]){var s=e.settings["push-notifications"],c=null;switch(window.device.platform.toLowerCase()){case"android":void 0!==s.android&&s.android.enabled===!0&&(c={senderID:s.android.id});break;case"win32nt":void 0!==s.wp&&s.wp.enabled===!0&&(c={channelName:s.wp.channelName});break;case"ios":void 0!==s.ios&&s.ios.enabled===!0&&(c={badge:"true",sound:"true",alert:"true"})}if(null!==c){var l=i.getSource("notification");l!==!1&&(t.debug("Registering for push notifications..."),l.registerForPush(function(e){t.debug("Registered for push:",e),o.set("notification.token",e),l.on("pushReceived",n)},function(e){t.error("Error registering for push:",e)},c))}if(s.ios.voipEnabled){var u=i.getSource("VoIPPushNotification");if(u!==!1){var d=u.init();d.on("registration",function(e){t.debug("Registered for push:",e.deviceToken),o.set("notification.voipToken",e.deviceToken)}),d.on("notification",function(e){r(e)}),d.on("error",function(e){t.error(e)})}}}}function l(){return i.getSource("notification")!==!1}function u(e){for(var t=5381,o=0;o<e.length;o++){var n=e.charCodeAt(o);t=(t<<5)+t+n}return t}function d(){var e=i.getSource("notification");m===!1&&l()&&(e.on("interactedWith",function(e){var t=r.getSchemaConfigItemsByItemType("device-notification");if(t.length>0){var o=a.get("ActionFactory");angular.forEach(t,function(t){if(void 0!==t.name&&u(t.name)==e.id&&void 0!==t.actions&&t.actions.length>0)if(void 0===e.actionResponseIdentifier)o.triggerEvent("click",t.actions,{$notification:e});else{var n=e.actionResponseIdentifier+"-interaction-pressed";o.triggerEvent(n,t.actions,{$notification:e})}})}}),m=!0)}function p(c){var p=e.defer();if(void 0!==c.name){var g=r.getSchemaConfigItemByName(c.name);if(void 0!==g)if("device-notification"==g["item-type"])if(l()){var m=i.getSource("notification"),f=c.title||g.title;void 0!==f&&f.indexOf("{{")>-1&&(f=o.parse(f)),f=s.translate(f);var C=c.text||g.text;void 0!==C&&C.indexOf("{{")>-1&&(C=o.parse(C)),C=s.translate(C);var h=c.name+"_category",v={id:u(c.name),title:f,text:C};if(void 0!==g.interactions&&g.interactions.length>0&&(v.category={identifier:h,actions:[]},g.interactions.forEach(function(e){var t={title:s.translate(e.label),identifier:e.name,textInput:e.text===!0};v.category.actions.push(t)})),c.options.schedule===!0&&void 0!==c.options.model){var S=o.parse(c.options.model),w=new Date(S);isNaN(w.getTime())||(v.at=w.getTime())}c.options.silent&&c.options.silent===!0&&(v.sound="SILENT"),m.core.schedule(v,null,null,{skipPermission:!0}),d(),p.resolve()}else{var y="Native notifications are not available on this platform.";t.info(y),p.reject(y)}else{var L=null;switch(g.style){case"success":case"error":case"warning":L=g.style;break;case"info":default:L="info"}if(null!==L){var A=c.title||g.title||"";angular.isString(A)===!1&&void 0!==A.toString&&(A=A.toString()),A=s.translate(A);var b=c.text||g.text||"";if(angular.isString(b)===!1&&void 0!==b.toString&&(b=b.toString()),b=s.translate(b),void 0!==g.actions&&g.actions.length>0){var j=a.get("ActionFactory");g.options.onHidden=function(e){e===!0&&j.triggerEvent("click",g.actions)}}var x=angular.copy(g.options);x.autoDismiss!==!0&&(x.timeOut=0,x.extendedTimeOut=0),x.maxOne===!0&&n.clear(),n[L](b,A,x),p.resolve()}}else p.reject("Notification with name '"+c.name+"' could not be found in app config.")}else p.reject("Notification name has not been specified.");return p.promise}var g={call:p,init:c},m=!1;return g}serviceFunc.$inject=["$q","$log","StoreFactory","toastr","SchemaHelper","$injector","Plugin","TranslationService"],function(){"use strict";function e(){return++l}function t(e){return e&&e.window===e}function o(e){return"string"==typeof e}function n(e){if(null==e||t(e))return!1;var n=e.length;return!(1!==e.nodeType||!n)||(o(e)||Array.isArray(e)||0===n||"number"==typeof n&&n>0&&n-1 in e)}function r(){return Object.create(null)}function a(t,o){var n,r=typeof t;return"function"==r||"object"==r&&null!==t?"function"==typeof(n=t.$$hashKey)?n=t.$$hashKey():void 0===n&&(n=t.$$hashKey=(o||e)()):n=t,r+":"+n}function i(e,t,o){var n,r,a=[],i=[];for(n=0;n<t.length;n++)for(r=0;r<e.length;r++)e[r][o]?e[r][o]===t[n]&&i.push(e[r]):a.push(e[r]);return i=i.concat(a)}function s(e){var t=e[0],o=e[e.length-1],n=[t];do{if(t=t.nextSibling,!t)break;n.push(t)}while(t!==o);return angular.element(n)}function c(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}var l=0,u=function(e){return e.clone[0]},d=function(e){return e.clone[e.clone.length-1]},p=function(e,t,o,n,r,a,i,s){e[o]=n,r&&(e[r]=a),e.$index=t,e.$first=0===t,e.$last=t===i-1,e.$middle=!(e.$first||e.$last),e.$odd=!(e.$even=0===(1&t)),s&&(e.$group=s)},g=function(e,t){e.data("isolateScope",t)},m=function(e,t){var o,n=e.length;if(0===n)return!1;for(o=0;o<n;o++)if(L(t,e[o]))return!0;return!1},f=function(e,t){var o,n=e.length;if(0===n)return-1;for(o=0;o<n;o++)if(L(t,e[o]))return o;return-1},C=function(e,t,o){var n,r=e,a=typeof o;if(e==t)return null;do if("string"===a){if(n=" "+r.className+" ",1===r.nodeType&&n.replace(/[\t\r\n\f]/g," ").indexOf(o)>=0)return r}else if(r==o)return r;while((r=r.parentNode)&&r!=t&&9!==r.nodeType);return null},h=function(e){var t,o=e.className.replace(/[\t\r\n\f]/g," ").trim();t=o.split(" ");for(var n=0;n<t.length;n++)/\s+/.test(t[n])&&(t.splice(n,1),n--);return t},v=function(e,t){var o=h(e);return o.indexOf(t)!==-1},S=function(e,t){var o,n,r,a=e.children(),i=a.length;if(i>0)for(var s=0;s<i;s++){if(o=a.eq(s),n=!0,r=h(o[0]),r.length>0)for(var c=0;c<t.length;c++)if(r.indexOf(t[c])===-1){n=!1;break}if(n)return o}return[]},w=function(e,t){var o,n,r;if(e.text().toLowerCase().indexOf(t.toLowerCase())!==-1)return!0;for(o=e.children(),r=o.length,n=0;n<r;n++)if(o.eq(n).text().toLowerCase().indexOf(t.toLowerCase())!==-1)return!0;return!1},y=angular.element,L=angular.equals,A=angular.copy,b=angular.extend,j=angular.module("nya.bootstrap.select",[]);j.provider("nyaBsConfig",function(){var e=null,t={"en-us":{defaultNoneSelection:"Nothing selected",noSearchResult:"NO SEARCH RESULT",numberItemSelected:"%d item selected",selectAll:"Select All",deselectAll:"Deselect All"}},o=A(t);this.setLocalizedText=function(e,t){if(!e)throw new Error("localeId must be a string formatted as languageId-countryId");o[e]||(o[e]={}),o[e]=b(o[e],t)},this.useLocale=function(t){e=t},this.$get=["$locale",function(n){var r;return r=e?o[e]:o[n.id],r||(r=t["en-us"]),r}]}),j.controller("nyaBsSelectCtrl",function(){var e=this;e.keyIdentifier=null,e.valueIdentifier=null,e.isMultiple=!1,e.onCollectionChange=function(){},e.setId=function(t){e.id=t||"id#"+Math.floor(1e4*Math.random())}}),j.directive("nyaBsSelect",["$parse","$document","$timeout","nyaBsConfig",function(e,t,o,n){var r="Nothing selected",a='<button class="btn btn-default dropdown-toggle" type="button"><span class="pull-left filter-option"></span> <span class="caret"></span></button>',i='<div class="dropdown-menu open"></div>',s='<div class="bs-searchbox"><input type="text" class="form-control"></div>',l='<ul class="dropdown-menu inner"></ul>',u='<li class="no-search-result"><span>NO SEARCH RESULT</span></li>',d='<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button class="actions-btn bs-select-all btn btn-default">SELECT ALL</button><button class="actions-btn bs-deselect-all btn btn-default">DESELECT ALL</button></div></div>';return{restrict:"ECA",require:["ngModel","nyaBsSelect"],controller:"nyaBsSelectCtrl",compile:function(p,g){p.addClass("btn-group");var b,j,x,$,E,T,k,F,I=function(){var e;return e=g.titleTpl?y(g.titleTpl):g.title?document.createTextNode(g.title):O.defaultNoneSelectionTpl?y(O.defaultNoneSelectionTpl):O.defaultNoneSelection?document.createTextNode(O.defaultNoneSelection):document.createTextNode(r)},_=p.children(),P=y(a),D=y(i),N=y(l),O=n,M="undefined"!=typeof g.multiple;for($=h(p[0]),$.forEach(function(e){/btn-(?:primary|info|success|warning|danger|inverse)/.test(e)&&(p.removeClass(e),P.removeClass("btn-default"),P.addClass(e)),/btn-(?:lg|sm|xs)/.test(e)&&(p.removeClass(e),P.addClass(e)),"form-control"===e&&P.addClass(e)}),N.append(_),E=_.length,T=0;T<E;T++)k=_.eq(T),(k.hasClass("nya-bs-option")||k.attr("nya-bs-option"))&&(k.find("a").attr("tabindex","0"),F=k.attr("value"),angular.isString(F)&&""!==F&&(k.attr("data-value",F),k.removeAttr("value")));return"true"===g.liveSearch&&(b=y(s),O.noSearchResultTpl?u=u.replace("NO SEARCH RESULT",O.noSearchResultTpl):O.noSearchResult&&(u=u.replace("NO SEARCH RESULT",O.noSearchResult)),j=y(u),D.append(b),N.append(j)),"true"===g.actionsBox&&M&&(O.selectAllTpl?d=d.replace("SELECT ALL",O.selectAllTpl):O.selectAll&&(d=d.replace("SELECT ALL",O.selectAll)),O.deselectAllTpl?d=d.replace("DESELECT ALL",O.deselectAllTpl):O.selectAll&&(d=d.replace("DESELECT ALL",O.deselectAll)),x=y(d),D.append(x)),P.children().eq(0).append(I()),D.append(N),p.append(P),p.append(D),function(n,r,a,i){function s(){var e,t,o=R.children(),n=o.length;for(e=0;e<n;e++)if(t=o.eq(e),t.hasClass("active")&&t.hasClass("nya-bs-option")&&!t.hasClass("not-match"))return t;return null}function l(e){for(var t,o=e.childNodes,n=o.length,r=0;r<n;r++)if(t=o[r],1===t.nodeType&&"a"===t.tagName.toLowerCase()){t.focus();break}}function u(e){var t;t=e?R.children().eq(0):R.children().eq(R.children().length-1);for(var o=0;o<R.children().length;o++){var n=R.children().eq(o);if(!n.hasClass("not-match")&&n.hasClass("selected"))return R.children().eq(o)[0]}return!t.hasClass("nya-bs-option")||t.hasClass("disabled")||t.hasClass("not-match")?e?d(t[0],"nextSibling"):d(t[0],"previousSibling"):t[0]}function d(e,t){if(!e||v(e,"nya-bs-option")){for(var o=e;(o=c(o,t))&&o.nodeType;)if(v(o,"nya-bs-option")&&!v(o,"disabled")&&!v(o,"not-match"))return o;return null}}function p(e){if(D&&!_){var t,o,r;if(t=R.find("li"),t.length>0){o=k.$modelValue,r=Array.isArray(o)?A(o):[];for(var a=0;a<t.length;a++){var i=y(t[a]);if(!i.hasClass("disabled")){var s,c;s=h(i),"undefined"!=typeof s&&(c=f(r,s),e&&c==-1?(r.push(s),i.addClass("selected")):e||c==-1||(r.splice(c,1),i.removeClass("selected")))}}k.$setViewValue(r),n.$digest(),j()}}}function g(e){var t,o,a,i=k.$modelValue;t=h(e),"undefined"!=typeof t&&(D?(o=Array.isArray(i)?A(i):[],a=f(o,t),a===-1?(o.push(t),e.addClass("selected")):(o.splice(a,1),e.removeClass("selected"))):(R.children().removeClass("selected"),o=t,e.addClass("selected"))),L(o,i)||r.triggerHandler("change"),k.$setViewValue(o),n.$digest(),D||(r.hasClass("open")&&r.triggerHandler("blur"),r.removeClass("open")),j()}function h(e){var t;return T?(t=e.data("isolateScope"),T(t)):F.valueIdentifier||F.keyIdentifier?(t=e.data("isolateScope"),t[F.valueIdentifier]||t[F.keyIdentifier]):e.attr("data-value")}function b(e){var t=e.find("a");return 0===t.children().length||t.children().eq(0).hasClass("check-mark")?t[0].firstChild.cloneNode(!1):t.children().eq(0)[0].cloneNode(!0)}function j(){var e=k.$modelValue,t=N.children().eq(0);return"undefined"==typeof e?(t.empty(),void t.append(I())):void(D&&0===e.length?(t.empty(),t.append(I())):o(function(){var o,n,r,i,s,c,l=R.children(),u=l.length,d=[];if(D&&"count"===a.selectedTextFormat?c=1:D&&a.selectedTextFormat&&(s=a.selectedTextFormat.match(/\s*count\s*>\s*(\d+)\s*/))&&(c=parseInt(s[1],10)),"undefined"!=typeof c&&e.length>c)return t.empty(),void(O.numberItemSelectedTpl?t.append(y(O.numberItemSelectedTpl.replace("%d",e.length))):O.numberItemSelected?t.append(document.createTextNode(O.numberItemSelected.replace("%d",e.length))):t.append(document.createTextNode(e.length+" items selected")));for(r=0;r<u;r++)n=l.eq(r),n.hasClass("nya-bs-option")&&(o=h(n),D?Array.isArray(e)&&m(e,o)&&(i=n.attr("title"),i?d.push(document.createTextNode(i)):d.push(b(n))):L(e,o)&&(i=n.attr("title"),i?d.push(document.createTextNode(i)):d.push(b(n))));if(0===d.length)t.empty(),t.append(I());else if(1===d.length)t.empty(),t.append(d[0]);else for(t.empty(),r=0;r<d.length;r++)t.append(d[r]),r<d.length-1&&t.append(document.createTextNode(", "))}))}function x(){var e,t,o=R.find("li"),n=o.length;for(t=0;t<n;t++)if(e=o.eq(t),e.hasClass("nya-bs-option")||e.attr("nya-bs-option")){$=e[0].clientHeight;break}if(/\d+/.test(a.size)){var r=parseInt(a.size,10);R.css("max-height",r*$+"px"),R.css("overflow-y","auto")}}var $,E,T,k=i[0],F=i[1],_=!1,P=e(F.valueExp),D="undefined"!=typeof a.multiple,N=S(r,["dropdown-toggle"]),M=N.next(),R=S(M,["dropdown-menu","inner"]),U=S(M,["bs-searchbox"]),q=S(R,["no-search-result"]),B=S(M,["bs-actionsbox"]);F.valueExp&&(T=function(e,t){return P(e,t)}),F.setId(r.attr("id")),D&&(F.isMultiple=!0,k.$isEmpty=function(e){return!e||0===e.length}),N.on("focus",function(){_||r.triggerHandler("focus")}),"undefined"!=typeof a.disabled&&n.$watch(a.disabled,function(e){e?(N.addClass("disabled"),E=N.attr("tabindex"),N.attr("tabindex","-1"),_=!0):(N.removeClass("disabled"),E?N.attr("tabindex",E):N.removeAttr("tabindex"),_=!1)}),F.onCollectionChange=function(e){var t,o,r=[],a=k.$modelValue;if(a){if(Array.isArray(e)&&e.length>0){if(T)for(t=0;t<e.length;t++)r.push(T(n,e[t]));else for(t=0;t<e.length;t++)F.valueIdentifier?r.push(e[t][F.valueIdentifier]):F.keyIdentifier&&r.push(e[t][F.keyIdentifier]);if(D){for(o=a.length,t=0;t<a.length;t++)m(r,a[t])||(a.splice(t,1),t--);o!==a.length&&(a=A(a))}else m(r,a)||(a=r[0])}k.$setViewValue(a),j()}},R.on("click",function(e){if(e.stopPropagation(),!_&&!y(e.target).hasClass("dropdown-header")){var t,o=C(e.target,R[0],"nya-bs-option");if(null!==o){if(t=y(o),t.hasClass("disabled"))return;g(t)}}});var V=function(e){null===C(e.target,r.parent()[0],r[0])&&(r.hasClass("open")&&r.triggerHandler("blur"),r.removeClass("open"))};t.on("click",V),N.on("blur",function(){r.hasClass("open")||r.triggerHandler("blur")}),N.on("click",function(){var e;r.toggleClass("open"),r.hasClass("open")&&"undefined"==typeof $&&x(),"true"===a.liveSearch&&r.hasClass("open")?(e=u(!0),e&&(R.children().removeClass("active"),y(e).addClass("active"))):r.hasClass("open")&&(e=u(!0),e&&l(e))}),"true"===a.actionsBox&&D&&(B.find("button").eq(0).on("click",function(){p(!0)}),B.find("button").eq(1).on("click",function(){p(!1)})),"true"===a.liveSearch&&U.children().on("input",function(){var e,t,o,n=U.children().val(),r=0,a=R.children(),i=a.length;if(n){for(e=0;e<i;e++)t=a.eq(e),t.hasClass("nya-bs-option")&&(w(t.find("a"),n)?(t.removeClass("not-match"),r++):t.addClass("not-match"));0===r?q.addClass("show"):q.removeClass("show")}else{for(e=0;e<i;e++)t=a.eq(e),t.hasClass("nya-bs-option")&&t.removeClass("not-match");q.removeClass("show")}o=u(!0),o&&(a.removeClass("active"),y(o).addClass("active"))}),k.$render=function(){var e,t,o=k.$modelValue,n=R.children(),r=n.length;if("undefined"==typeof o)for(e=0;e<r;e++)n.eq(e).hasClass("nya-bs-option")&&n.eq(e).removeClass("selected");else for(e=0;e<r;e++)n.eq(e).hasClass("nya-bs-option")&&(t=h(n.eq(e)),D?m(o,t)?n.eq(e).addClass("selected"):n.eq(e).removeClass("selected"):L(o,t)?n.eq(e).addClass("selected"):n.eq(e).removeClass("selected"));j()},r.on("keydown",function(e){var t=e.keyCode;if(27===t||13===t||38===t||40===t){if(e.preventDefault(),_)return void e.stopPropagation();var o,n,i,c,p=C(e.target,r[0],N[0]);"true"===a.liveSearch?n=C(e.target,r[0],U[0]):o=C(e.target,r[0],M[0]),p?13!==t&&38!==t&&40!==t||r.hasClass("open")||(e.stopPropagation(),r.addClass("open"),"undefined"==typeof $&&x(),"true"===a.liveSearch?(U.children().eq(0)[0].focus(),c=u(!0),c&&(R.children().removeClass("active"),y(c).addClass("active"))):(c=u(!0),c&&l(c))):o?27===t?(N[0].focus(),r.hasClass("open")&&r.triggerHandler("blur"),r.removeClass("open"),e.stopPropagation()):38===t?(e.stopPropagation(),c=d(e.target.parentNode,"previousSibling"),c?l(c):(c=u(!1),c&&l(c))):40===t?(e.stopPropagation(),c=d(e.target.parentNode,"nextSibling"),c?l(c):(c=u(!0),c&&l(c))):13===t&&(e.stopPropagation(),i=y(e.target.parentNode),i.hasClass("nya-bs-option")&&(g(i),D||N[0].focus())):n&&(27===t?(N[0].focus(),r.removeClass("open"),e.stopPropagation()):38===t?(e.stopPropagation(),i=s(),i&&(c=d(i[0],"previousSibling"),c?(i.removeClass("active"),y(c).addClass("active")):(c=u(!1),c&&(i.removeClass("active"),y(c).addClass("active"))))):40===t?(e.stopPropagation(),i=s(),i&&(c=d(i[0],"nextSibling"),c?(i.removeClass("active"),y(c).addClass("active")):(c=u(!0),c&&(i.removeClass("active"),y(c).addClass("active"))))):13===t&&(i=s(),i&&(g(i),D||N[0].focus())))}}),n.$on("$destroy",function(){R.off(),N.off(),U.off(),t.off("click",V)})}}}}]),j.directive("nyaBsOption",["$parse",function(e){var t=/^\s*(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/;return{restrict:"A",transclude:"element",priority:1e3,terminal:!0,require:["^nyaBsSelect","^ngModel"],compile:function(o,c){var l=c.nyaBsOption,f=document.createComment(" end nyaBsOption: "+l+" "),C=l.match(t);if(!C)throw new Error("invalid expression");var h,v,S,w,A,b=c.value,j=b?e(b):null,x=C[3]||C[1],$=C[2],E=C[4],T=C[5]?e(C[5]):null,k=C[6],F={$id:a},I={};return k?w=e(k):(h=function(e,t){return a(t)},v=function(e){return e}),function(e,t,o,a,c){function l(e){var o,a,l,w,b,j,E,T,F,I,P,N,O,M,R,U=t[0],q=r(),B=[];if(A&&(N=[]),n(e))j=e,b=S||h;else{b=S||v,j=[];for(var V in e)e.hasOwnProperty(V)&&"$"!=V.charAt(0)&&j.push(V);j.sort()}for(E=j.length,T=new Array(E),o=0;o<E;o++)if(a=e===j?o:j[o],l=e[a],w=b(a,l,o),R={},$&&(R[$]=a),R[x]=l,B.push(R),A&&(I=A(a,l),N.indexOf(I)===-1&&I&&N.push(I)),D[w])F=D[w],delete D[w],A&&(F.group=I),F.key=a,F.value=l,q[w]=F,T[o]=F;else{if(q[w])throw T.forEach(function(e){e&&e.scope&&(D[e.id]=e)}),new Error("Duplicates in a select are not allowed. Use 'track by' expression to specify unique keys.");T[o]={id:w,scope:void 0,clone:void 0,key:a,value:l},q[w]=!0,I&&(T[o].group=I)}N&&N.length>0&&(T=i(T,N,"group"));for(var G in D)F=D[G],M=s(F.clone),M.removeData("isolateScope"),M.remove(),F.scope.$destroy();for(o=0;o<E;o++)F=T[o],F.scope?(P=U,u(F)!=P&&y(U).after(F.clone),U=d(F),p(F.scope,o,x,F.value,$,F.key,E,F.group)):c(function(e,t){g(e,t),F.scope=t;var n=f.cloneNode(!1);e[e.length++]=n,y(U).after(e),e.addClass("nya-bs-option"),l=C?C(F.key,F.value):F.value||F.key,k.isMultiple?Array.isArray(_.$modelValue)&&m(_.$modelValue,l)&&e.addClass("selected"):L(l,_.$modelValue)&&e.addClass("selected"),U=n,F.clone=e,q[F.id]=F,p(F.scope,o,x,F.value,$,F.key,E,F.group)}),N&&void 0!=N&&N.length>0&&(O&&O===F.group?F.clone.removeClass("first-in-group"):F.clone.addClass("first-in-group"),O=F.group,F.clone.addClass("group-item"));D=q,k.onCollectionChange(B)}var C,k=a[0],_=a[1],P={};w&&(S=function(t,o,n){return $&&(F[$]=t),F[x]=o,F.$index=n,w(e,F)}),T&&(A=function(t,o){return $&&(I[$]=t),I[x]=o,T(e,I)}),$&&(k.keyIdentifier=$),x&&(k.valueIdentifier=x),j&&(k.valueExp=b,C=function(t,o){return $&&(P[$]=t),P[x]=o,j(e,P)});var D=r();"true"===o.deepWatch?e.$watch(E,l,!0):e.$watchCollection(E,l)}}}}])}(),angular.module("angular-datepicker",[]).directive("pickADate",["$timeout",function(e){return{restrict:"A",scope:{pickADate:"=",pickADateOptions:"="},link:function(t,o){function n(o){"function"==typeof p&&p.apply(this,arguments),t.$$phase||t.$root.$$phase||e(function(){o.hasOwnProperty("clear")?t.pickADate=null:o.hasOwnProperty("select")&&(t.pickADate=c(new Date(o.select)))},0)}function r(e){"function"==typeof g&&g.apply(this,arguments)}function a(e){if("function"==typeof m&&m.apply(this,arguments),window.cordova&&window.cordova.plugins&&window.cordova.plugins.Keyboard){var t=function(){window.cordova.plugins.Keyboard.close(),window.removeEventListener("native.keyboardshow",this)};window.addEventListener("native.keyboardshow",t),setTimeout(function(){window.removeEventListener("native.keyboardshow",t)},500)}}function i(e){return 1===e.toString().length?"0"+e:e.toString()}function s(e){return e&&e.getUTCDate?new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0,0):null}function c(e){return e.getFullYear()+"-"+i(e.getMonth()+1)+"-"+i(e.getDate())}function l(e){var t=null,o=/\d{4}-\d{2}-\d{2}/;return"string"==typeof e&&o.test(e)?t=o.exec(e)[0]:e instanceof Date&&(t=e.getFullYear()+"-"+i(e.getMonth()+1)+"-"+i(e.getDate())),t?s(new Date(t)):null}function u(e){var n=l(e);n?o.pickadate("picker").set("select",n):(t.pickADate=null,o.pickadate("picker").set("clear"))}var d=t.pickADateOptions||{},p=d.onSet,g=d.onOpen,m=d.onClose;d.min&&"string"==typeof d.min?"current"!==d.min&&(d.min=l(d.min)):d.min="",d.max&&"string"==typeof d.max?"current"!==d.max&&(d.max=l(d.max)):d.max="",d["default"]&&"string"==typeof d["default"]&&!t.pickADate&&("current"===d["default"]?(t.pickADate=c(new Date),t.$parent.updateStore(t.pickADate)):(t.pickADate=c(l(d["default"])),t.$parent.updateStore(t.pickADate))),d.selectYears===!0&&(d.selectYears=200),o.pickadate(angular.extend(d,{onOpen:r,onSet:n,onClose:a,container:document.body})),t.pickADate&&u(t.pickADate),t.$watch("pickADate",function(e,o){e!==o&&(u(e),t.$parent.updateStore(e))})}}}]).directive("pickATime",["$timeout",function(e){return{restrict:"A",scope:{pickATime:"=",pickATimeOptions:"="},link:function(t,o){function n(o){"function"==typeof p&&p.apply(this,arguments),t.$$phase||t.$root.$$phase||e(function(){if(o.hasOwnProperty("clear"))t.pickATime=null;else if(o.hasOwnProperty("select")){var e=o.select,n=Math.floor(e/60),r=e%60;t.pickATime=i(n)+":"+i(r)}},0)}function r(e){"function"==typeof g&&g.apply(this,arguments)}function a(e){if("function"==typeof m&&m.apply(this,arguments),window.cordova&&window.cordova.plugins&&window.cordova.plugins.Keyboard){var t=function(){window.cordova.plugins.Keyboard.close(),window.removeEventListener("native.keyboardshow",this)};window.addEventListener("native.keyboardshow",t),setTimeout(function(){window.removeEventListener("native.keyboardshow",t)},500)}}function i(e){return 1===e.toString().length?"0"+e:e.toString()}function s(e){return e&&e.getUTCDate?new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),0,0):null}function c(e){return i(e.getHours())+":"+i(e.getMinutes())}function l(e){var t=null,o=/\d{2}:\d{2}/;return"string"==typeof e&&o.test(e)?t=o.exec(e)[0]:e instanceof Date&&(t=i(e.getHours())+":"+i(e.getMinutes())),t?s(new Date("1970-01-01T"+t+":00Z")):null}function u(e){var n=l(e);n?o.pickatime("picker").set("select",n):(t.pickATime=null,o.pickatime("picker").set("clear"))}var d=t.pickATimeOptions||{},p=d.onSet,g=d.onOpen,m=d.onClose;d.min&&"string"==typeof d.min?"current"!==d.min&&(d.min=l(d.min)):d.min="",d.max&&"string"==typeof d.max?"current"!==d.max&&(d.max=l(d.max)):d.max="",d["default"]&&"string"==typeof d["default"]&&!t.pickATime&&("current"===d["default"]?(t.pickATime=c(new Date),t.$parent.updateStore(t.pickATime)):(t.pickATime=c(l(d["default"])),t.$parent.updateStore(t.pickATime))),o.pickatime(angular.extend(d,{onSet:n,onOpen:r,onClose:a,container:document.body})),t.pickATime&&u(t.pickATime),t.$watch("pickATime",function(e,o){e!==o&&(u(e),t.$parent.updateStore(e))})}}}]),angular.module("gettext",[]),angular.module("gettext").constant("gettext",function(e){return e}),angular.module("gettext").factory("gettextCatalog",["gettextPlurals","$http","$cacheFactory","$interpolate","$rootScope",function(e,t,o,n,r){function a(e){return void 0===e||null===e||"string"!=typeof e||0==e.trim().length}function i(){r.$broadcast("gettextLanguageChanged")}var s,c="$$noContext",l='<span id="test" title="test" class="tested">test</span>',u=angular.element("<span>"+l+"</span>").html()!==l,d=function(e){return s.debug&&s.currentLanguage!==s.baseLanguage?s.debugPrefix+e+s.debugSuffix:e},p=function(e){return s.showTranslatedMarkers?s.translatedMarkerPrefix+e+s.translatedMarkerSuffix:e};return s={debug:!1,debugPrefix:"[MISSING]: ",debugSuffix:"",showTranslatedMarkers:!1,translatedMarkerPrefix:"[",translatedMarkerSuffix:"]",strings:{},baseLanguage:"en",currentLanguage:"en",cache:o("strings"),setCurrentLanguage:function(e){this.currentLanguage=e,i()},getCurrentLanguage:function(){return this.currentLanguage},setStrings:function(e,t){this.strings[e]||(this.strings[e]={});for(var o in t){var n=t[o];if(u&&(o=angular.element("<span>"+o+"</span>").html()),angular.isString(n)||angular.isArray(n)){var r={};r[c]=n,n=r}for(var a in n){var s=n[a];n[a]=angular.isArray(s)?s:[s]}this.strings[e][o]=n}i()},getStringForm:function(e,t,o){if(a(e))return"";var n=this.strings[this.currentLanguage]||this.strings["*"]||{},r=n[e]||{},i=r[o||c]||[];return i[t]},getString:function(e,t,o){return a(e)?"":(e=this.getStringForm(e,0,o)||d(e),e=t?n(e)(t):e,p(e))},hasTranslation:function(e){var t=this.strings[this.currentLanguage]||this.strings["*"]||{};return e in t},getPlural:function(t,o,r,i,s){if(a(o))return"";var c=e(this.currentLanguage,t);return o=this.getStringForm(o,c,s)||d(1===t?o:r),i&&(i.$count=t,o=n(o)(i)),p(o)},loadRemote:function(e){return t({method:"GET",url:e,cache:s.cache}).success(function(e){for(var t in e)s.setStrings(t,e[t])})}}}]),angular.module("gettext").directive("translate",["gettextCatalog","$parse","$animate","$compile","$window",function(e,t,o,n,r){function a(e,t,o){if(!e)throw new Error("You should add a "+t+" attribute whenever you add a "+o+" attribute.")}var i=function(){return String.prototype.trim?function(e){return"string"==typeof e?e.trim():e}:function(e){return"string"==typeof e?e.replace(/^\s*/,"").replace(/\s*$/,""):e}}(),s=parseInt((/msie (\d+)/.exec(angular.lowercase(r.navigator.userAgent))||[])[1],10);return{restrict:"AE",terminal:!0,compile:function(r,c){a(!c.translatePlural||c.translateN,"translate-n","translate-plural"),a(!c.translateN||c.translatePlural,"translate-plural","translate-n");var l=i(r.html()),u=c.translatePlural,d=c.translateContext;return s<=8&&"<!--IE fix-->"===l.slice(-13)&&(l=l.slice(0,-13)),{post:function(r,a,i){function s(){var t;u?(r=p||(p=r.$new()),r.$count=c(r),t=e.getPlural(r.$count,l,u,null,d)):t=e.getString(l,null,d);var i=angular.element("<span>"+t+"</span>");n(i.contents())(r);var s=a.contents(),g=i.contents();o.enter(g,a),o.leave(s)}var c=t(i.translateN),p=null;i.translateN&&r.$watch(i.translateN,s),r.$on("gettextLanguageChanged",s),s()}}}}}]),angular.module("gettext").filter("translate",["gettextCatalog",function(e){function t(t,o){return e.getString(t,null,o)}return t.$stateful=!0,t}]),angular.module("gettext").factory("gettextPlurals",function(){return function(e,t){switch(e){case"ay":case"bo":case"cgg":case"dz":case"fa":case"id":case"ja":case"jbo":case"ka":case"kk":case"km":case"ko":case"ky":case"lo":case"ms":case"my":case"sah":case"su":case"th":case"tt":case"ug":case"vi":case"wo":case"zh":return 0;case"is":return t%10!=1||t%100==11?1:0;case"jv":return 0!=t?1:0;case"mk":return 1==t||t%10==1?0:1;case"ach":case"ak":case"am":case"arn":case"br":case"fil":case"fr":case"gun":case"ln":case"mfe":case"mg":case"mi":case"oc":case"pt_BR":case"tg":case"ti":case"tr":case"uz":case"wa":case"zh":return t>1?1:0;case"lv":return t%10==1&&t%100!=11?0:0!=t?1:2;case"lt":return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"mnk":return 0==t?0:1==t?1:2;case"ro":return 1==t?0:0==t||t%100>0&&t%100<20?1:2;case"pl":return 1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"cs":case"sk":return 1==t?0:t>=2&&t<=4?1:2;case"sl":return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0;case"mt":return 1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3;case"gd":return 1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3;case"cy":return 1==t?0:2==t?1:8!=t&&11!=t?2:3;case"kw":return 1==t?0:2==t?1:3==t?2:3;case"ga":return 1==t?0:2==t?1:t<7?2:t<11?3:4;case"ar":return 0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5;default:return 1!=t?1:0}}}),window.cti={},angular.module("app",["app.core","app.templates"]),angular.module("cti-directives",[]),angular.module("app.core",["cti-directives","ngSanitize","ngAnimate","ngRoute","ngTouch","LocalStorageModule","vr.directives.slider","tmh.dynamicLocale","angularLoad","angles","toastr","base64","ngMessages","angular-datepicker","nya.bootstrap.select","mobile-router","ngElectron","gettext"]).config(["localStorageServiceProvider","$compileProvider","$logProvider","$sceDelegateProvider","$provide",function(e,t,o,n,r){angular.extend(window.JSON,window.JSON2),delete window.JSON2,o.debugEnabled(!1),e.setPrefix(""),t.debugInfoEnabled(!0),t.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|content|file|ms-appx|cdvfile):/),t.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|content|file|ms-appx|cdvfile|data):/),angular.module("cti-directives").directive=t.directive,r.decorator("$log",["$delegate","LoggingFactory",function(e,t){return t.process$log(e)}]),n.resourceUrlWhitelist(["self","cdvfile://**"])}]).run(["Router","RouterConfig","SchemaHelper","SchemaService","StoreFactory","StoreProvider","Auth","$rootScope","ActionFactory","Platform",function(e,t,o,n,r,a,i,s,c,l){function u(e,t){try{e=decodeURIComponent(e);for(var o=e.split(/\?(.+)?/)[1].split("&"),n=0;n<o.length;n++){var r=o[n];if(r.indexOf(t+"=")>-1){var a=r.split(/=(.+)?/);return a[1]}}return null}catch(i){return null}}function d(e,t){try{var o;e=decodeURIComponent(e);for(var n=e.split(/\?(.+)?/)[1].split("&"),r=0;r<n.length;r++){var a=n[r],i=a.split(/=(.+)?/)[0],s=a.split(/=(.+)?/)[1];void 0!==t&&t.includes(i)||(void 0===o&&(o={}),o[i]=s)}return o}catch(c){return null}}function p(e){for(var t={},o=e.split(","),n=0;n<o.length;n++){var r=o[n],a=r.split(/=(.+)?/),i=a[0].split("."),s=a[1];s=f(s),h(t,i,0,s)}return t}function g(e){var t={},o=t;o.xcallback={};for(var n=o.xcallback,r=e.split(","),a=0;a<r.length;a++){var i=r[a],s=i.split(/=(.+)?/);n[s[0]]=s[1]}return t}function m(e,t){for(var o in t)t.hasOwnProperty(o)&&"undefined"!=typeof e[o]?m(e[o],t[o]):e[o]=t[o]}function f(e){return C(e)&&(e=parseInt(e)),e}function C(e){return!isNaN(parseFloat(e))&&isFinite(e)}function h(e,t,o,n){o<t.length-1?(e=null==e[t[o]]?e[t[o]]={}:e[t[o]],h(e,t,o+1,n)):e[t[o]]=n}function v(e){e=decodeURIComponent(e);var t=new RegExp("[a-z]\\:\\/\\/oauth\\?"),o=t.test(e),n=new RegExp("\\/oauth\\?"),r=n.test(e);return!(!o&&!r)}function S(){if(void 0===window.orientation)return"portrait";switch(window.orientation){case-90:case 90:return"landscape";default:return"portrait"}}function w(e,t){var n={};"device"===l.getType()?n={batteryLevel:t.level,isPluggedIn:t.isPlugged}:"desktop"===l.getType()&&(n={batteryLevel:100*t.level,isPluggedIn:t.charging});var r=o.getSchemaConfigItemsByItemType(e);r&&r.length>0&&c.triggerEvent(e,r[0].actions,n)}function y(){var e={};e.connectionState="online","device"===l.getType()?e.connectionType=navigator.connection.type:e.connectionType=null;var t=o.getSchemaConfigItemsByItemType("onnetworkchange");t&&t.length>0&&c.triggerEvent("onnetworkchange",t[0].actions,e)}function L(){var e={connectionState:"offline",connectionType:null},t=o.getSchemaConfigItemsByItemType("onnetworkchange");t&&t.length>0&&c.triggerEvent("onnetworkchange",t[0].actions,e)}void 0===window.cti.api&&(window.cti.api={}),window.handleOpenUrlWhenReady=function(n){setTimeout(function(){if(v(n)){var i=d(n);if(null==i)return;r.set("oauth",i);var s=o.getSchemaConfigItemsByItemType("onoauthdata");s&&s.length>0&&c.triggerEvent("onoauthdata",s[0].actions,i);
}else{var l=u(n,"initial_data"),f=u(n,"page"),C=u(n,"xcallback");null!=l&&(l=decodeURIComponent(l));var h=null;null!=l&&(h=p(l)),null!=C&&(C=decodeURIComponent(C));var S=null;if(null!=C&&(S=g(C)),null!=S&&(null!=h?m(h,S):h=S),null!=f){f=decodeURIComponent(f);var w=e.getCurrent();void 0!==w?(null!=h&&r.mergeInitialData(h),e.go("/"+f)):(null!=h&&a.set("initialData",h),t.set("startPage","/"+f))}else null!=h&&a.set("initialData",h);var y=d(n,["initial_data","page","xcallback"]);if(y){r.set("query",y);var L=o.getSchemaConfigItemsByItemType("onqueryparamsdata");L&&L.length>0&&c.triggerEvent("onqueryparamsdata",L[0].actions,y)}}},0)},document.addEventListener("resume",function(){s.$broadcast("device-resume");var t=e.getCurrent();(void 0!==o.schema.settings&&o.schema.settings.auth===!0||void 0!==t&&t.auth===!0)&&i.authenticate("Please re-authenticate").then(function(){})["catch"](function(){e.go("/error")});var n=o.getSchemaConfigItemsByItemType("onappresume");n&&n.length>0&&c.triggerEvent("onappresume",n[0].actions)},!1),window.addEventListener("orientationchange",function(){var e={orientation:S()};r.set("env.orientation",e.orientation);var t=o.getSchemaConfigItemsByItemType("onorientationchange");t&&t.length>0&&c.triggerEvent("onorientationchange",t[0].actions,e)},!1),r.set("env.orientation",S()),void 0!==window.mayflower&&document.addEventListener("backbutton",function(){window.mayflower.moveTaskToBack()},!1),"device"===l.getType()&&(window.addEventListener("batterystatus",function(e){w("onbatterychange",e)},!1),window.addEventListener("batterylow",function(e){w("onbatterylow",e)},!1),window.addEventListener("batterycritical",function(e){w("onbatterycritical",e)},!1)),"desktop"===l.getType()&&navigator.getBattery().then(function(e){e.addEventListener("chargingchange",function(){w("onbatterychange",e)}),e.addEventListener("levelchange",function(){w("onbatterychange",e)})}),"device"===l.getType()&&(document.addEventListener("online",y,!1),document.addEventListener("offline",L,!1)),"desktop"===l.getType()&&(window.addEventListener("online",y),window.addEventListener("offline",L)),window.cti.appReady=!0;var A=new CustomEvent("app-core-loaded");document.dispatchEvent(A)}]),window.cti=window.cti||{},window.cti.appReady=!1,window.cti.calls=[],window.cti.debug={ngStats:function(e){if(window.hasOwnProperty("showAngularStats"))window.showAngularStats(e);else{var t=document.createElement("script");t.src="./assets/js/ng-stats.min.js",t.onload=function(){window.showAngularStats(e)},document.head.appendChild(t)}}},window.handleOpenURL=function(e){window.cti.appReady?window.handleOpenUrlWhenReady(e):window.cti.calls.push({fn:"handleOpenUrlWhenReady",args:arguments})},document.addEventListener("app-core-loaded",function(){if(window.cti&&window.cti.calls){for(var e=0;e<window.cti.calls.length;e++)!function(e){"function"==typeof window[e.fn]&&window[e.fn].apply(window,e.args)}(window.cti.calls[e]);delete window.cti.calls}});var eventMethod=window.addEventListener?"addEventListener":"attachEvent",eventer=window[eventMethod],messageEvent="attachEvent"==eventMethod?"onmessage":"message";eventer(messageEvent,function(e){e.origin===window.location.origin&&e.data&&""!==e.data&&(window.cti.appReady?window.handleOpenUrlWhenReady(e.data):window.cti.calls.push({fn:"handleOpenUrlWhenReady",args:arguments}))},!1),angular.module("app.routes",[]).config(["$routeProvider",function(e){e.when("/error",{templateUrl:"components/error/error.tpl.html"}).otherwise({redirectTo:"/"})}]),angular.module("app.core").directive("mdApp",["$rootScope","$compile","$q","$timeout","$log","SchemaService","localStorageService","StudioStorage","SchemaHelper","ActionFactory","Router","Plugin","TranslationService","$filter","ForegroundBackground","ScreenOrientation",function(e,t,o,n,r,a,i,s,c,l,u,d,p,g,m,f){return{scope:{mdApp:"@",debug:"@",json:"="},restrict:"A",compile:function(){return{pre:function(o,i){var s=!1,l=window.cordova!==!1,d=function(){a.stop(o.mdApp).then(function(){return p.init()}).then(function(){var r=c.getSchemaSettingByName("orientation");if(r)switch(r.toLowerCase()){case"portrait":f.lockOrientation(f.ORIENTATION.PORTRAIT);break;case"landscape":f.lockOrientation(f.ORIENTATION.LANDSCAPE)}u.init(),i.html("<div mobile-view></div>"),t(i.contents())(o);var s=[];e.currentLanguage&&s.push("language-"+e.currentLanguage),a.isPreview()&&s.push("cti-preview"),a.isLivePreview()&&s.push("cti-live-preview"),s.length&&window.document.body.setAttribute("class",s.join(" ")),document.getElementById("splash-screen").style.display="none",window.document.querySelectorAll("body div.view-frame")[0].style.display="block",n(function(){e.grace&&n(function(){alert("This app will expire on "+g("date")(e.grace,"short"))},500)},1e3),m.init()})["catch"](function(e){r.error(e)})};l===!0?(document.addEventListener("deviceready",function(){d(),s=!0}),n(function(){s===!1&&d()},5e3)):d()}}}}}]),angular.module("app.core").directive("mdContextProvider",function(){return{restrict:"A",scope:{item:"=mdContextProvider",items:"=mdContextItemCollection"},controller:["$scope",function(e){var t=this;e.contextState||(e.contextState={}),t.getContextItemData=function(t){var o={$item:e.item,$state:e.contextState};if(e.items){var n=e.items.indexOf(e.item);n!==-1&&(o.$index=n,o.$totalItems=e.items.length)}if(t){var r={};return r[t]=o,r}return o},t.applyContextItemData=function(e,t){angular.extend(e,this.getContextItemData(t))},t.isRepeaterContextProvider=function(){var e=t.getContextItemData();return e.hasOwnProperty("$index")}}]}}),angular.module("app.core").controller("PageController",["$scope",function(e){var t=this;t.name=e.$parent.route.id,t.meta={valid:!1}}]),angular.module("app.core").directive("pageInfo",function(){return{restrict:"A",scope:!1,controller:["$scope",function(e){return{name:e.$parent.route.id}}]}}),angular.module("app.core").directive("mdForm",function(){return{restrict:"A",require:"^form",link:function(e,t,o,n){e.$watch(function(){return n.$valid},function(t){e.$parent.page.meta.valid=t})}}}),angular.module("app.core").directive("isolateForm",[function(){return{restrict:"A",require:"?form",link:function(e,t,o,n){if(n){var r={};angular.copy(n,r);var a=t.parent().controller("form");a.$removeControl(n);var i={$setValidity:function(e,t,o){r.$setValidity(e,t,o),a.$setValidity(e,!0,n)},$setDirty:function(){t.removeClass("ng-pristine").addClass("ng-dirty"),n.$dirty=!0,n.$pristine=!1}};angular.extend(n,i)}}}}]),angular.module("app.core").directive("mdContent",["TranslationService","AssetFactory",function(e,t){return{restrict:"E",compile:function(o,n){var r=null;if("markdown"===n.itemType){var a=o.text();a=e.translate(a);var i=new window.Showdown.converter({});r=i.makeHtml(a)||""}else{var s=o.html();s=e.translate(s),r=s||""}r=t.rewriteAssetPaths(r);var c=("content-block "+(n.classes||"")).trim(),l='<div class="'+c+'">'+r+"</div>";o.html(l)}}}]),angular.module("app.core").directive("starRating",function(){return{restrict:"A",scope:{ratingValue:"=",max:"=",disabled:"=",actions:"=",onRatingSelected:"&"},template:['<ul class="rating">',' <li ng-repeat="star in stars track by $index" ng-class="star" ng-click="toggle($index)" ',' md-actions="{{actions}}">',' <i class="fa fa-star" ng-class="{\'star-disabled\': (disabled) }"></i>'," </li>","</ul>"].join(""),link:function(e){function t(){e.stars=[];for(var t=0;t<e.max;t++)e.stars.push({filled:t<e.ratingValue})}e.toggle=function(t){e.disabled||(e.ratingValue=t+1,e.onRatingSelected({rating:t+1}))},e.$watch("ratingValue",function(){t()})}}}),angular.module("app.core").directive("takePhoto",["$log","StoreFactory","Camera",function(e,t,o){return{restrict:"E",require:"ngModel",scope:{imageUrl:"=",source:"@",quality:"=","disabled:":"="},template:['<div class="photo-control-container">',' <button class="btn btn-primary btn-lg">',' <span ng-if="sourceIndex == 1">'," <span class=\"fa fa-camera\"></span> {{ 'Take Photo' | translate }}"," </span>",' <span ng-if="sourceIndex == 2">'," <span class=\"fa fa-picture-o\"></span> {{ 'Choose Photo' | translate }}}"," </span>"," </button>","</div>"].join(""),link:function(e,t){switch(e.imageData=null,e.quality=void 0===e.quality?75:e.quality,e.source){case"gallery":e.sourceIndex=2;break;case"camera":default:e.sourceIndex=1}e.destination=1,e.encodingType=1,t.find("button").on("click",function(){2===e.source?o.selectPhoto().then(function(t){e.loadThumbnail(t)}):o.takePhoto(e.quality).then(function(t){e.loadThumbnail(t)})}),e.loadThumbnail=function(t){e.$parent.$parent.updateStore(t),e.imageData=t},e.removePhoto=function(){e.imageData=null,e.$parent.$parent.updateStore(void 0)};var n=function(){"undefined"!=typeof e.imageUrl&&e.loadThumbnail(e.imageUrl)};document.addEventListener("deviceready",n),window.parent.document.addEventListener("deviceready",n)}}}]),angular.module("app.core").directive("takeBarcode",["$log","Plugin",function(e,t){return{restrict:"E",require:"ngModel",replace:!0,templateUrl:"components/mdDynamicForm/fields/md-barcode.tpl.html",link:function(o,n,r,a){o.codeType=r.codeType,n.on("click",function(){var n=t.getSource("barcodeScanner");n!==!1&&n.scan(function(e){var t="object"==typeof e?e.text:e;o.$parent.$parent.updateStore(t),a.$setViewValue(t)},function(t){a.$setValidity("error",!1),e.error(t)})}),o.clear=function(){o.$parent.$parent.updateStore(""),a.$setViewValue("")}}}}]),angular.module("app.core").directive("mdSignature",function(){return{restrict:"A",disabled:"=",require:"ngModel",link:function(e,t,o,n){var r=t[0],a=new window.SignaturePad(r);a.onEnd=function(){var e=a.toDataURL();n.$setViewValue(e)};var i=r.getContext("2d");if(window.devicePixelRatio){var s=r.width,c=r.height,l=s,u=c;r.setAttribute("width",s*window.devicePixelRatio),r.setAttribute("height",c*window.devicePixelRatio),t.css("width",l+"px"),t.css("height",u+"px"),i.scale(window.devicePixelRatio,window.devicePixelRatio)}void 0!=e.inputModel&&""!=e.inputModel&&a.fromDataURL(e.inputModel),e.$watch("inputModel",function(e,t){void 0==e?a.clear():e!=t&&a.fromDataURL(e)}),e.$watch("disabled",function(){e.disabled?a.off():a.on()})}}}),angular.module("app.core").directive("mdSelect",["$rootScope","StoreFactory","$parse","$filter","$timeout","OptionFactory","TranslationService",function(e,t,o,n,r,a,i){return{restrict:"A",require:"ngModel",link:function(o,s,c,l){var u=null,d=a.get(o.pageName+"."+o.name);o.options=void 0===d?o.$parent.options:d,angular.forEach(o.options,function(e){e.label=i.translate(e.label),e.hasOwnProperty("group")&&(e.group=i.translate(e.group))}),o.$parent.searchable===!0&&(u=$(s),r(function(){u.selectpicker(),u.change(function(){l.$setViewValue(u.val())})})),"undefined"!=typeof o.$parent.optionsfilter&&(o.selectionValid=function(){var e=o.$parent.inputModel,a=!1;angular.forEach(o.$parent.optionsfilter,function(e,o){var n=t.evaluate(e);"undefined"!=typeof n&&(a===!1&&(a={}),a[o]=n)});var i=!1;if(a!==!1){var s=n("filter")(o.$parent.options,a);angular.forEach(s,function(t){t.value==e&&(i=!0)})}i===!1&&(l.$setViewValue(""),null!==u&&r(function(){u.selectpicker("deselectAll").selectpicker("refresh")}))},o.calcFilter=function(){"undefined"!=typeof o.optionsfilter&&(o.filterString={},angular.forEach(o.optionsfilter,function(e,n){var r=t.evaluate(e);"undefined"!=typeof r&&(o.filterString[n]=r)}),null!==u&&r(function(){u.selectpicker("refresh")}))},e.$on("StoreChanged",function(){o.calcFilter(),o.selectionValid()}),o.calcFilter(),o.selectionValid())}}}]),angular.module("app.core").directive("mdCheckbox",["OptionFactory",function(e){return{restrict:"E",replace:!0,scope:{required:"=",options:"=",disabled:"=",name:"=",model:"=",iconSelected:"@",iconUnselected:"@",actions:"@",validators:"@"},templateUrl:"components/mdDynamicForm/fields/md-checkbox.tpl.html",require:"^form",link:function(t,o,n,r){var a=e.get(t.$parent.$parent.pageName+"."+t.$parent.name);t.options=void 0===a?t.$parent.options:a;var i=function(){var e=!0;t.required!==!0&&"true"!=t.required||(e=!1,angular.forEach(t.model,function(t){t===!0&&(e=!0)})),r[t.name].$setValidity("validationValid",e)};i(),t.makeSelection=function(e){t.disabled||(void 0==t.model&&(t.model={}),t.model[e]=!t.model[e],i())},t.getClasses=function(e){var o={};if(void 0!==e["icon-selected"]?o[e["icon-selected"]]=void 0!=t.model&&1==t.model[e.id]:o[t.iconSelected]=void 0!=t.model&&1==t.model[e.id],void 0!==e["icon-unselected"]?o[e["icon-unselected"]]=void 0===t.model||1!=t.model[e.id]:o[t.iconUnselected]=void 0==t.model||1!=t.model[e.id],1===Object.keys(o).length){var n=void 0!==o[t.iconUnselected]?t.iconUnselected:e["icon-unselected"];o[n]=!0}return o}}}}]),angular.module("app.core").directive("mdRadio",["OptionFactory",function(e){return{restrict:"E",replace:!0,scope:{required:"=",options:"=",disabled:"=",name:"=",model:"=",iconSelected:"@",iconUnselected:"@",validators:"@",actions:"@"},templateUrl:"components/mdDynamicForm/fields/md-radio.tpl.html",require:"^form",link:function(t,o,n,r){var a=e.get(t.$parent.$parent.pageName+"."+t.$parent.name);t.options=void 0===a?t.$parent.options:a;var i=function(){var e=!0;t.required!==!0&&"true"!=t.required||(e="undefined"!=typeof t.model),r[t.name].$setValidity("validationValid",e)};i(),t.makeSelection=function(e){t.disabled||(t.model=e,i())},t.getClasses=function(e){var o={};if(void 0!==e["icon-selected"]?o[e["icon-selected"]]=void 0!=t.model&&t.model==e.value:o[t.iconSelected]=void 0!=t.model&&t.model==e.value,void 0!==e["icon-unselected"]?o[e["icon-unselected"]]=void 0==t.model||t.model!=e.value:o[t.iconUnselected]=void 0==t.model||t.model!=e.value,1===Object.keys(o).length){var n=void 0!==o[t.iconUnselected]?t.iconUnselected:e["icon-unselected"];o[n]=!0}return o}}}}]),angular.module("app.core").directive("validation",["ValidationFactory","$log",function(ValidationFactory,$log){return{restrict:"A",require:"ngModel",link:function($scope,elem,attrs,ctrl){var validationObject=!1;"undefined"!=typeof attrs.validation&&""!=attrs.validation&&(validationObject=angular.fromJson(attrs.validation)),validationObject!==!1&&angular.forEach(validationObject,function(validation){if(void 0!=validation.name&&void 0!=validation.type){var validationFunction=null;if("custom"!=validation.type)validationFunction=function(e,t){return ValidationFactory.isValid(t,validation,$scope.pageName,attrs.name)};else try{var code="validationFunction = "+validation.content;eval(code)}catch(e){$log.error("Could not eval validation function code.")}null!==validationFunction&&(ctrl.$validators[validation.name]=validationFunction)}}),$scope.$on("StoreChanged",function(){angular.forEach(validationObject,function(e){void 0!=e.name&&"regex"!=e.type&&ctrl.$setValidity(e.name,ctrl.$validators[e.name](null,ctrl.$viewValue))})})}}}]),angular.module("app.core").directive("validEmail",function(){return{restrict:"A",require:"ngModel",link:function(e,t,o,n){var r=function(e){return n.$setValidity("email",/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)),e};n.$formatters.push(r),n.$parsers.push(r)}}}),angular.module("app.core").directive("mdGroup",["$parse","StoreFactory",function(e,t){return{scope:{name:"@",repeat:"=",classes:"@"},restrict:"E",replace:!1,transclude:!0,template:['<div id="{{name}}" class="{{ classes }}">',' <ng-transclude class="group-contents"></ng-transclude>',' <div ng-if="repeat" class="group-controls">',' <button class="btn btn-success" ng-disabled="form.$invalid" ng-click="addItem()">'," <span class=\"icon icon-plus-circle2\"></span> {{ 'Add' | translate }}"," </button>"," </div>","</div>"].join(""),require:["^pageInfo","?form","?^mdContextProvider"],link:function(o,n,r,a){var i=a[0],s=a[1],c=a[2],l=null,u=null,d=i.name;c&&(l=c.getContextItemData("$data")),o.repeat&&s&&(o.form=s,u="repeater."+d+"."+o.name),o.addItem=function(){if(o.repeat){var r={},a=n.find("md-question");angular.forEach(a,function(o){var a=angular.element(o).attr("name"),i=angular.element(o).attr("originalname"),s=angular.element(o).attr("modellocationoverride"),c=s||i||a,u=null!==l?"$data.$item."+c:"$store.pages."+d+"."+c,p=t.getForElement(u,n),g=e(c);g.assign(r,p),t.setForElement(u,void 0,n)}),null!==u&&t.push(u,r)}}}}}]),angular.module("app.core").directive("mdList",["$rootScope","$interpolate","$parse","$filter","$routeParams","StoreFactory","ActionFactory","ListFactory",function($rootScope,$interpolate,$parse,$filter,$routeParams,StoreFactory,ActionFactory,ListFactory){return{scope:{name:"@",actions:"="},restrict:"E",replace:!1,transclude:!0,templateUrl:"components/area/mdList/mdList.tpl.html",require:["?^mdContextProvider","?^scrollableItem","^pageInfo"],link:function($scope,$element,$attrs,$ctrls){function bindFromModel(){var e=StoreFactory.getForElement(model,$element);void 0!==e&&(listDataInitialized&&angular.equals(e,oldListData)||(clearTimeout(actionTimeout),clearTimeout(scrollTimeout),listDataInitialized&&(actionTimeout=setTimeout(function(){ActionFactory.triggerEvent("data-changed",actions,{oldItems:oldListData,newItems:e})},500)),autoScroll&&scrollToBottom(),bindData(e),oldListData=angular.copy(e)))}function scrollToBottom(){scrollTimeout=scrollableItemCtrl?setTimeout(function(){scrollableItemCtrl.scrollToBottom()},0):setTimeout(function(){var e=$element[0].querySelector(".main.scrollable");e.scrollTop=e.scrollHeight},0)}function attrEquals(e,t){return($attrs[e]||"").toLowerCase()===t}function prepareListState(){var e="",t="",o=null,n=orderProperty,r=orderReverse,a=1,i=getStateFromStore();i&&(search&&i.search&&(internalSearch&&"internal"===i.search.mode?(e=i.search.criteria,t=i.search.criteria):allowExternalSearch&&i.search.mode&&(o={simple:"simple"===i.search.mode,criteria:i.search.criteria})),i.order&&i.order.property&&(n=i.order.property,r="desc"===i.order.direction),pagination&&i.pagination&&(a=i&&pagination&&i.pagination.currentPage),angular.extend($scope.search,{inputValue:e,term:t,external:o}),angular.extend($scope.order,{property:n,reverse:r})),recalculatePagination(a,!0)}function bindData(e){angular.isArray(e)||(e=[]),$scope.listData=e,pagination&&($scope.pagination.totalPages=ListFactory.calculateNumberOfPages(e.length,$scope.pagination.limit),recalculatePagination($scope.pagination.currentPage||1,!0)),listDataInitialized=!0,setStateInStore()}function recalculatePagination(e,t){if(pagination){if(e<1&&(e=1),e>$scope.pagination.totalPages&&(e=$scope.pagination.totalPages),!t&&e===$scope.pagination.currentPage)return;$scope.pagination.currentPage=e,$scope.pagination.start=(e-1)*$scope.pagination.limit,$scope.pagination.visible=pagination&&$scope.pagination.totalPages>(paginationShowOnePage?0:1),$scope.pagination.visiblePages=ListFactory.calculateVisiblePages(e,$scope.pagination.totalPages,paginationPagesToDisplay)}else $scope.pagination.currentPage=1,$scope.pagination.start=0,$scope.pagination.limit=void 0;setStateInStore()}function getStateFromStore(){return ListFactory.getListState(pageName,listName)}function setStateInStore(){listDataInitialized&&(mdContextProviderCtrl&&mdContextProviderCtrl.isRepeaterContextProvider()||(clearTimeout(storeUpdateDebounce),storeUpdateDebounce=setTimeout(function(){ListFactory.setListStateFromListScope(pageName,listName,$scope)},250)))}var mdContextProviderCtrl=$ctrls[0],scrollableItemCtrl=$ctrls[1],pageInfoCtrl=$ctrls[2],pageName=pageInfoCtrl.name,listName=$scope.name,listDataInitialized=!1,listDataFiltered=!1,storeUpdateDebounce,staticData=attrEquals("datasource","static"),dynamicData=attrEquals("datasource","dynamic"),autoScroll=attrEquals("autoscroll","true"),data=JSON.parse($attrs.data||"[]"),model=$attrs.model,search=!attrEquals("search",""),internalSearch=search&&attrEquals("search","internal"),allowExternalSearch=search&&attrEquals("search","external"),searchOnType=internalSearch&&attrEquals("searchmode","type"),searchDebounce=searchOnType&&parseInt($attrs.searchdebounce)||0,searchOnButton=internalSearch&&attrEquals("searchmode","button"),customSearch=internalSearch&&attrEquals("searchwithin","custom"),searchFunctionJs=customSearch&&$attrs.searchfunction||"",searchFunctionExternalJs=allowExternalSearch&&$attrs.searchfunctionexternal||"",customSearchFunction=null,criticalSearchError=!1,order=attrEquals("order","true"),orderProperty=order?$attrs.orderproperty||"":void 0,orderReverse=order&&attrEquals("orderdirection","desc"),pagination=attrEquals("pagination","true"),paginationItemsPerPage=pagination&&parseInt($attrs.paginationitemsperpage)||void 0,paginationShowAbove=pagination&&attrEquals("paginationabove","true"),paginationShowBelow=pagination&&attrEquals("paginationbelow","true"),paginationShowOnePage=pagination&&attrEquals("paginationshowonepage","true"),paginationPagesToDisplay=pagination&&parseInt($attrs.paginationpagestodisplay)||void 0,showFirstLast=pagination&&attrEquals("paginationfirstlast","true"),showPrevNext=pagination&&attrEquals("paginationprevnext","true"),actions=angular.copy($scope.actions);if($scope.search={enabled:search,internal:internalSearch,allowExternal:allowExternalSearch,debounce:searchDebounce,showButton:searchOnButton,buttonIcon:$attrs.searchbuttonicon,buttonLabel:$attrs.searchbuttonlabel,inputValue:"",term:"",external:null},$scope.order={property:orderProperty,reverse:orderReverse},$scope.pagination={enabled:pagination,showAbove:paginationShowAbove,showBelow:paginationShowBelow,showFirstLast:showFirstLast,showPrevNext:showPrevNext,firstPageIcon:$attrs.paginationfirsticon,prevPageIcon:$attrs.paginationprevicon,nextPageIcon:$attrs.paginationnexticon,lastPageIcon:$attrs.paginationlasticon,firstPageLabel:$attrs.paginationfirstlabel,prevPageLabel:$attrs.paginationprevlabel,nextPageLabel:$attrs.paginationnextlabel,lastPageLabel:$attrs.paginationlastlabel,limit:paginationItemsPerPage,currentPage:1,start:0},prepareListState(),$scope.classes=$attrs.classes,$scope.listItemClasses=$attrs.listItemClasses,"bootstrap"===$attrs.theme&&($scope.classes=(($scope.classes||"")+" list-group").trim(),$scope.listItemClasses=(($scope.listItemClasses||"")+" list-group-item").trim()),$scope.itemTrackFn=function(e,t){return JSON.stringify(e)+"_"+t+"_"+$scope.listData.length},$scope.listOrder=function(e){return void 0===$scope.order.property?"":""===$scope.order.property?e:$parse($scope.order.property)(e)},$scope.filter=function(item){if(criticalSearchError)return!1;if(!search)return!0;if(internalSearch){if(!$scope.search.term)return!0;if(!customSearch)return $filter("filter")([item],$scope.search.term).length>0;if(null===customSearchFunction){if(!searchFunctionJs)throw criticalSearchError=!0,'List "'+$scope.name+'" on page "'+pageInfoCtrl.name+'" does not have a custom search function defined for built-in search.';eval("customSearchFunction = "+searchFunctionJs)}if("function"==typeof customSearchFunction)return customSearchFunction($scope.search.term||"",item)}else if(allowExternalSearch&&$scope.search.external){if($scope.search.external.simple)return $filter("filter")([item],$scope.search.external.criteria).length>0;if(null===customSearchFunction){if(!searchFunctionExternalJs)throw criticalSearchError=!0,'List "'+$scope.name+'" on page "'+pageInfoCtrl.name+'" does not have a custom search function defined for search actions.';eval("customSearchFunction = "+searchFunctionExternalJs)}if("function"==typeof customSearchFunction)return customSearchFunction($scope.search.external.criteria||{},item)}return!0},$scope.performSearch=function(e){internalSearch&&(searchOnButton||e===!0)&&ListFactory.setListSearchState(pageName,listName,"internal",$scope.search.inputValue,!0)},$scope.goToPage=function(e){pagination&&ListFactory.setListPaginationState(pageName,listName,e)},$scope.itemCssClass=function(e,t){if(!$scope.listItemClasses)return"";if($scope.listItemClasses.indexOf("\\{")===-1)return $scope.listItemClasses;var o=$scope.listItemClasses.replace(/\\{/g,"{"),n={$data:{$item:e,$index:t,$items:$scope.listData}};return $interpolate(o)(n)},$scope.$watch("filteredListData.length",function(e,t){if(!listDataFiltered||e!==t){$scope.pagination.totalPages=ListFactory.calculateNumberOfPages(e,$scope.pagination.limit);var o=Math.min($scope.pagination.currentPage,$scope.pagination.totalPages);recalculatePagination(o,!0),listDataFiltered=!0}}),searchOnType&&$scope.$watch("search.inputValue",function(){$scope.performSearch(!0)}),autoScroll&&scrollToBottom(),staticData===!0&&data)bindData(data);else if(dynamicData===!0&&model){var actionTimeout=null,scrollTimeout=null,oldListData=null;bindFromModel(),$scope.$on("StoreChanged",bindFromModel)}var unsubscribe=$rootScope.$on("UpdateList_"+pageInfoCtrl.name+"_"+$scope.name,prepareListState);$scope.$on("$destory",function(){unsubscribe()})},controller:["$scope",function(e){var t=this;t.getListScope=function(){return e}}]}}]),angular.module("app.core").directive("mdListItem",["ActionFactory",function(e){return{restrict:"A",require:["^mdList","mdContextProvider"],translude:!0,link:function(t,o,n,r,a){var i=r[0],s=r[1];a(function(t,n){s.applyContextItemData(n,"$data");var r=i.getListScope(),a=r.actions;o.on("click",function(t){if((!t.srcElement||["A","INPUT","BUTTON","TEXTAREA","SELECT"].indexOf(t.srcElement.tagName)===-1)&&a&&a.length){var o=s.getContextItemData();e.triggerEvent("click",a,o)}}),o.on("$destroy",function(){n.$destroy()}),o.append(t)})}}}]),angular.module("app.core").directive("mdTitle",["TranslationService","AssetFactory",function(e,t){return{restrict:"E",compile:function(o,n){var r=o.html();r=e.translate(r),r=t.rewriteAssetPaths(r);var a=(n.classes||"").trim(),i='<div class="'+a+'">'+r+"</div>";o.html(i)}}}]),angular.module("app.core").directive("mdQuestion",["$http","$rootScope","$parse","$filter","$timeout","SchemaService","$templateCache","$log","StoreFactory","ActionFactory","TranslationService",function(e,t,o,n,r,a,i,s,c,l,u){return{scope:{name:"@",itemType:"@",id:"@",label:"@",placeholder:"@",message:"@","default":"@",validators:"=",show:"@",disabled:"@",required:"@",model:"@",description:"@","extends":"=",leftIcon:"@",rightIcon:"@",classes:"@",options:"=",optionsfilter:"=",searchable:"=",maxlength:"@",multiline:"=",debounce:"=",content:"@",max:"@",min:"@",dual:"=",step:"@",actions:"=",optionSource:"@",labelProperty:"@",valueProperty:"@",groupProperty:"@",onText:"@",offText:"@",vertical:"=",iconSelected:"@",iconUnselected:"@",displayValue:"=",decimals:"@"},restrict:"E",template:["<div id=\"{{ name }}\" ng-if=\"show\" class=\"form-group item-{{itemType}} {{classes}}\" ng-class=\"{'has-error': (form[name].$invalid === true && showValidations()), 'has-success': (form[name].$invalid === false && showValidations()), 'no-error': (type == 'static')}\">",' <label class="control-label">',' {{label | translate}} <span class="required-asterix fa fa-star" ng-if="required == \'true\' && form[name].$invalid === true"></span>'," </label>",' <p class="description" ng-if="description">{{description | translate}}</p>',' <div ng-include="templateUrl"></div>',' <div ng-show="form[name].$invalid === true && showValidations()" ng-messages="form[name].$error">',' <div class="form-input-error" ng-message="required">',' <span class="fa fa-times"></span> {{message | translate}}'," </div>",' <div class="form-input-error" ng-message="email">',' <span class="fa fa-times"></span> {{defaultMessage | translate}}'," </div>",' <div class="form-input-error" ng-repeat="validation in validators" ng-message-exp="validation.name">',' <span class="fa fa-times"></span> {{validation.message | translate}}'," </div>"," </div>","</div>"].join(""),require:["^pageInfo","^form","?^mdContextProvider"],link:function(e,t,o,n){function r(e){if("number"==typeof e||"boolean"==typeof e)return!1;if("undefined"==typeof e||null===e)return!0;if("undefined"!=typeof e.length)return 0==e.length;var t=0;for(var o in e)e.hasOwnProperty(o)&&t++;return 0==t}function a(e){if(!o)return!1;if(!o.mdExpressions)return!1;var t=JSON.parse(o.mdExpressions);return t.hasOwnProperty(e)}var i=n[0],s=n[1],d=n[2];e.setTemplate=function(){switch(e.itemType){case"select":e.templateUrl="components/mdDynamicForm/fields/templates/select.tpl.html",e.defaultMessage="Please make a selection";break;case"radio":e.templateUrl="components/mdDynamicForm/fields/templates/radio.tpl.html",e.defaultMessage="Please make a selection";break;case"checkbox":e.templateUrl="components/mdDynamicForm/fields/templates/checkbox.tpl.html",e.defaultMessage="Please make a selection";break;case"date":e.templateUrl="components/mdDynamicForm/fields/templates/date.tpl.html",e.defaultMessage="Please provide a valid date";break;case"time":e.templateUrl="components/mdDynamicForm/fields/templates/time.tpl.html",e.defaultMessage="Please provide a valid time";break;case"datetime":e.templateUrl="components/mdDynamicForm/fields/templates/datetime.tpl.html",e.defaultMessage="Please provide a valid date & time";break;case"number":e.templateUrl="components/mdDynamicForm/fields/templates/number.tpl.html",e.defaultMessage="Please provide a number";break;case"email":e.templateUrl="components/mdDynamicForm/fields/templates/email.tpl.html",e.defaultMessage="Please provide a valid email address";break;case"slider":e.dual?e.templateUrl="components/mdDynamicForm/fields/templates/range-slider.tpl.html":e.templateUrl="components/mdDynamicForm/fields/templates/slider.tpl.html",e.defaultMessage="Please choose a value";break;case"rating":e.templateUrl="components/mdDynamicForm/fields/templates/rating.tpl.html",e.defaultMessage="Please provide a rating";break;case"barcode":e.templateUrl="components/mdDynamicForm/fields/templates/barcode.tpl.html",e.defaultMessage="Please capture the barcode";break;case"qrcode":e.templateUrl="components/mdDynamicForm/fields/templates/qrcode.tpl.html",e.defaultMessage="Please capture the QR code";break;case"signature":e.templateUrl="components/mdDynamicForm/fields/templates/signature.tpl.html",e.defaultMessage="Please provide your signature";break;case"switch":e.templateUrl="components/mdDynamicForm/fields/templates/switch.tpl.html",e.defaultMessage="Please make a selection";break;case"password":e.templateUrl="components/mdDynamicForm/fields/templates/password.tpl.html",e.defaultMessage="This is a required field";break;case"text":e.multi=void 0!=e.multiline&&e.multiline,e.templateUrl="components/mdDynamicForm/fields/templates/text.tpl.html",e.defaultMessage="This is a required field";break;default:void 0!==e["extends"]&&(e.type=e["extends"].type,e.itemType=e["extends"]["item-type"],e.setTemplate())}},e.message="undefined"!=typeof e.message?e.message:e.defaultMessage,e.form=s,e.pageName=i?i.name:"";var p=d?"$data.$item.":"$store.pages."+e.pageName+".",g=o.modellocationoverride||o.originalname||e.name;if(e.key=p+g,e.setTemplate(),e.inputModel=c.getForElement(e.key,t),e.updateStore=function(o){c.setForElement(e.key,o,t)},e.$watch("inputModel",function(t,o){if(t!==o){e.updateStore(t);var n=["checkbox","radio","rating","smiley","thumbs","signature","barcode","record-audio"];n.indexOf(e.itemType)!==-1&&l.triggerEvent("change",e.actions)}},!0),void 0===e.inputModel&&void 0!==e["default"]&&!a("default")){var m=u.translate(e["default"]);e.updateStore(m),e.inputModel=m}e.disabled=void 0!=e.disabled&&e.disabled,e.required=void 0!=e.required&&e.required,e.show=void 0==e.show||e.show,e.search=void 0!=e.search&&e.search,e.evalModel=function(){void 0!=e.model&&(e.inputModel=c.evaluateForElement(e.model,t))},e.userInput=function(){void 0!==s[e.name]&&s[e.name].$setTouched(!0)},e.evalModel(),e.$on("StoreChanged",function(){e.evalModel()}),e.$watch(function(){return c.getForElement(e.key,t)},function(t){e.inputModel=t,void 0!==e.form[e.name]&&(e.form[e.name].$pristine=!1)},!0),"select"==e.itemType&&void 0!=e.optionSource&&e.$watchCollection(function(){return c.getForElement(e.optionSource,t)},function(t){
var o=[];void 0!=e.labelProperty||void 0!=e.valueProperty||void 0!=e.groupValue?angular.forEach(t,function(t){var n={value:void 0!=e.valueProperty?t[e.valueProperty]:t.value,label:void 0!=e.labelProperty?t[e.labelProperty]:t.label,group:void 0!=e.groupProperty?t[e.groupProperty]:t.group};o.push(n)}):o=t,e.options=o}),e.showValidations=function(){return!r(e.inputModel)||e.form[e.name].$pristine===!1}}}}]),angular.module("app.core").directive("numberFormat",["$filter",function(e){return{restrict:"A",require:"ngModel",link:function(t,o,n,r){var a=parseInt(n.decimalPlaces);isNaN(a)===!1&&(r.$formatters.push(function(t){var o=parseFloat(t);if(isNaN(o)!==!0)return void 0!==t&&(t=e("number")(t,a),t=parseFloat(t.replace(",",""))),r.$setViewValue(t),t}),r.$parsers.push(function(e){if(void 0!==e&&null!==e){var t=e.toString(),o=t.split(".");if(void 0!==o[1]&&o[1].length>a)return r.$setViewValue(r.$modelValue),r.$render(),r.$modelValue}return e}))}}}]),angular.module("app.core").directive("mdComponent",["$rootScope","$timeout","ComponentFactory",function(e,t,o){return{restrict:"E",scope:{instanceId:"@"},require:["?^mdContextProvider"],link:function(t,n,r,a){var i=a[0],s=null,c=!1,l=o.getComponentById(t.instanceId);if(null!==l){var u=l.element;if(i){var d=i.getContextItemData();if(s={$data:d},void 0!==d.$index){u=l.element.cloneNode(!0);var p=u.getAttribute("id");u.setAttribute("id",p+"_"+d.$index),c=!0}}var g=n.children().length>0;if(g){var m=Array.prototype.slice.call(u.childNodes);l.processed!==!0&&(l.dynamicChildrenStartIndex=m.length);for(var f=l.dynamicChildrenStartIndex;f<m.length;f++)u.removeChild(m[f]);angular.forEach(n.children(),function(e){var t=n[0].removeChild(e);u.appendChild(t)})}o.setUpComponentAttributes(l,u,s,!0),n.replaceWith(u),e.$on("StoreChanged",function(){o.setUpComponentAttributes(l,u,s,!1)}),(c||l.processed!==!0)&&(setTimeout(function(){o.setUpComponentBindings(l,t)},0),l.processed=!0)}}}}]),angular.module("app.core").directive("mdChart",["$compile","StoreFactory",function(e,t){return{restrict:"E",scope:{title:"@","default":"=",model:"@",classes:"@"},link:function(o,n,r){var a={"line-chart":"Line","bar-chart":"Bar","doughnut-chart":"Doughnut","pie-chart":"Pie","polar-area-chart":"PolarArea","radar-chart":"Radar"};if(o.chartType=a[r.itemType],o.model){var i=t.getForElement(o.model,n);i&&(o.data=i),o.$watch(function(){return t.getForElement(o.model,n)},function(e,t){e!==t&&(o.data=e)})}else o.data=o["default"];var s=['<div class="chart-block {{ classes }}">',' <h4 ng-if="title">{{ title | translate }}</h4>',' <div class="md-chart-container">',' <canvas chart="{{ chartType }}" data="data" responsive="true"></canvas>'," </div>","</div>"].join(""),c=e(s)(o);n.replaceWith(c)}}}]),angular.module("app.core").directive("mdGoogleMap",["GoogleMapService","StoreFactory","ActionFactory","DirectiveBridge","$log",function(e,t,o,n,r){return{restrict:"E",replace:!0,scope:{actions:"=",lat:"@",lng:"@",zoom:"@",maptype:"@",zoomcontrol:"@",streetviewcontrol:"@",maptypecontrol:"@",fullscreencontrol:"@",rotatecontrol:"@",scalecontrol:"@",traffic:"=",transit:"=",bicycling:"=",classes:"@",name:"@","static":"@",data:"@",model:"@",styles:"@",expose:"@",exposedproperty:"@",draggable:"@",scrollwheel:"@",doubleclick:"@"},template:'<div class="google-map {{classes}} " id="{{name}}" style="position: relative;" ></div>',controller:["$scope","$element","SchemaHelper",function(a,i,s){function c(){var t=s.schema.settings.mapping?s.schema.settings.mapping.googleMapsAPIKey:void 0;e.requestGoogleMapsScript(t).then(function(t){var o=!1;if(!t&&google&&google.maps){var n=new google.maps.Map(i[0],{zoom:parseInt(a.zoom),center:{lat:parseFloat(a.lat),lng:parseFloat(a.lng)},mapTypeId:a.maptype,zoomControl:"true"==a.zoomcontrol,streetViewControl:"true"==a.streetviewcontrol,mapTypeControl:"true"==a.maptypecontrol,fullscreenControl:"true"==a.fullscreencontrol,rotateControl:"true"==a.rotatecontrol,scaleControl:"true"==a.scalecontrol,draggable:"true"==a.draggable,scrollwheel:"true"==a.scrollwheel,disableDoubleClickZoom:"true"!=a.doubleclick,styles:JSON.parse(a.styles||"[]")});L.map=n,l(L),y(L.map,a.actions),e.registerResize(n),i.on("$destroy",function(){e.unregisterResize(n)}),google.maps.event.addListener(n,"tilesloaded",function(){o=!0,google.maps.event.clearListeners(n,"tilesloaded"),u(i[0]),google.maps.event.trigger(n,"resize")}),setTimeout(function(){o||d(i[0])},5e3),a.traffic&&(L.trafficLayer=L.trafficLayer||new google.maps.TrafficLayer,L.trafficLayer.setMap(L.map)),a.transit&&(L.transitLayer=L.transitLayer||new google.maps.TransitLayer,L.transitLayer.setMap(L.map)),a.bicycling&&(L.bicyclingLayer=L.bicyclingLayer||new google.maps.BicyclingLayer,L.bicyclingLayer.setMap(L.map)),"true"==a["static"]?p(JSON.parse(a.data||"[]")):a.model&&g(),"true"==a.expose&&(window.cti.maps||(window.cti.maps={}),window.cti.maps[a.exposedproperty]=L.map)}else d(i[0])})}function l(e){var t=i.controller("pageInfo").name;n.registerItemApi(t,a.name,{setMapLayers:function(t,o){var n;switch(t){case"traffic":n=e.trafficLayer||new google.maps.TrafficLayer,e.trafficLayer=n;break;case"transit":n=e.transitLayer||new google.maps.TransitLayer,e.transitLayer=n;break;case"bicycling":n=e.bicyclingLayer||new google.maps.BicyclingLayer,e.bicyclingLayer=n;break;default:return!1}return o?n.setMap(e.map):n.setMap(null),!0},setMapTypeId:function(t){e.map.setMapTypeId(t)},setLocation:function(t,o,n,r){r?e.map.panTo({lat:t,lng:o}):e.map.setCenter({lat:t,lng:o}),n&&e.map.setZoom(n)},setControls:function(t,o){switch(t){case"zoom":e.map.setOptions({zoomControl:o});break;case"maptype":e.map.setOptions({mapTypeControl:o});break;case"scale":e.map.setOptions({scaleControl:o});break;case"streetview":e.map.setOptions({streetViewControl:o});break;case"rotate":e.map.setOptions({rotateControl:o});break;case"fullscreen":e.map.setOptions({fullscreenControl:o});break;default:return!1}return!0}})}function u(e){var t=e.querySelector("div.google-map-failed");t&&t.parentNode.removeChild(t)}function d(e){var t=document.createElement("div");t.classList.add("google-map-failed"),t.innerHTML="<p>Map has failed to load, click to reload</p>",t.addEventListener("click",function(){c()}),e.appendChild(t)}function p(e){for(;L.overlays[0];)L.overlays.pop().setMap(null);e&&"[object Array]"===Object.prototype.toString.call(e)&&$.each(e,function(e,t){switch(t.type){case void 0:break;case"marker":C(t);break;case"polygon":v(t);break;case"polyline":S(t);break;case"heatmap":h(t);break;case"directions":m(t)}})}function g(){a.$watchCollection(function(){return t.get(a.model)},function(e){p(e)})}function m(e){var t={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{data:{type:"object",properties:{origin:{type:"string"},destination:{type:"string"},travelMode:{type:"string"},renderer:{type:"object",properties:{preserveViewport:{type:"boolean"},draggable:{type:"boolean"}},required:[],additionalProperties:!1},drivingOptions:{type:"object",properties:{departureTime:{type:"string",format:"date-time"}},required:[]}},required:["origin","destination"]},type:{type:"string",pattern:"^directions$"}},required:["data","type"]};if(w(e,t)){var o=angular.copy(e.data);delete o.renderer;var n=angular.copy(e.data.renderer||{});n.map=L.map,o.drivingOptions&&angular.isString(o.drivingOptions.departureTime)&&(o.drivingOptions.departureTime=new Date(o.drivingOptions.departureTime)),o.drivingOptions&&angular.isString(o.drivingOptions.arrivalTime)&&(o.drivingOptions.arrivalTime=new Date(o.drivingOptions.arrivalTime)),o.transitOptions&&angular.isString(o.transitOptions.departureTime)&&(o.transitOptions.departureTime=new Date(o.transitOptions.departureTime)),o.transitOptions&&angular.isString(o.transitOptions.arrivalTime)&&(o.transitOptions.arrivalTime=new Date(o.transitOptions.arrivalTime));var r=new google.maps.DirectionsRenderer(n);L.overlays.push(r);var a=new google.maps.DirectionsService;a.route(o,function(e,t){"OK"==t&&r.setDirections(e)})}}function f(e){var t={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{type:{type:"string",pattern:"^marker$"},data:{type:"object",properties:{position:{type:"object",properties:{lat:{type:"number",minimum:-90,maximum:90},lng:{type:"number",minimum:-180,maximum:180}},required:["lat","lng"],additionalProperties:!1},icon:{type:"string"},infoWindow:{type:"object",properties:{showOn:{type:"string"},content:{type:"string"}},required:["showOn","content"],additionalProperties:!1},clickable:{type:"boolean"},crossOnDrag:{type:"boolean"},cursor:{type:"string"},draggable:{type:"boolean"},label:{type:"string"},opacity:{type:"number",minimum:0,maximum:1},optimized:{type:"boolean"},place:{type:"object",properties:{location:{type:"object",properties:{lat:{type:"number",minimum:-90,maximum:90},lng:{type:"number",minimum:-180,maximum:180}}},placeId:{type:"string"},query:{type:"string"}},required:["location"],additionalProperties:!1},title:{type:"string"},visible:{type:"boolean"},zIndex:{type:"number"}},required:["position"]}},required:["type","data"]};if(!w(e,t))return null;var o=angular.copy(e.data);delete o.infoWindow;var n=new google.maps.Marker(o);if(e.data.infoWindow){var r=new google.maps.InfoWindow({content:e.data.infoWindow.content});"click"===e.data.infoWindow.showOn&&n.addListener("click",function(){r.open(L.map,n)}),"load"===e.data.infoWindow.showOn&&r.open(L.map,n)}return n}function C(e){var t=f(e);null!=t&&(t.setMap(L.map),L.overlays.push(t))}function h(e){var t={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{type:{type:"string",pattern:"^heatmap$"},data:{type:"array",items:{type:"object",properties:{lat:{type:"number",minimum:-90,maximum:90},lng:{type:"number",minimum:-180,maximum:180},weight:{type:"number",minimum:0}},required:["lat","lng"],additionalProperties:!1}},dissipating:{type:"boolean"},gradient:{type:"array",items:{type:"string"}},maxIntensity:{type:"number"},opacity:{type:"number"},radius:{type:"number"}},required:["type","data"],additionalProperties:!1};if(w(e,t)){var o=angular.copy(e.data),n=[];for(var r in o)n.push({location:new google.maps.LatLng(o[r].lat,o[r].lng),weight:o[r].weight||1});var a=new google.maps.visualization.HeatmapLayer({data:n});a.setMap(L.map),L.overlays.push(a)}}function v(e){var t={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{type:{type:"string",pattern:"^polygon$"},data:{type:"object",properties:{paths:{type:"array",items:{type:"object",properties:{lat:{type:"number",minimum:-90,maximum:90},lng:{type:"number",minimum:-180,maximum:180}},required:["lat","lng"],additionalProperties:!1}},strokeColor:{type:"string"},strokeOpacity:{type:"number"},strokeWeight:{type:"number"},fillColor:{type:"string"},fillOpacity:{type:"number"},clickable:{type:"boolean"},draggable:{type:"boolean"},editable:{type:"boolean"},geodesic:{type:"boolean"},visible:{type:"boolean"},zIndex:{type:"number"}},required:["paths"]}},required:["type","data"]};if(w(e,t)){var o=new google.maps.Polygon(e.data);o.setMap(L.map),L.overlays.push(o)}}function S(e){var t={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{type:{type:"string",pattern:"^polyline$"},data:{type:"object",properties:{path:{type:"array",items:{type:"object",properties:{lat:{type:"number",minimum:-90,maximum:90},lng:{type:"number",minimum:-180,maximum:180}},required:["lat","lng"],additionalProperties:!1}},strokeColor:{type:"string"},geodesic:{type:"boolean"},strokeOpacity:{type:"number"},clickable:{"type:":"boolean"},draggable:{"type:":"boolean"},editable:{"type:":"boolean"},strokeWeight:{"type:":"number"},visible:{"type:":"boolean"},zIndex:{"type:":"number"}},required:["paths"]}},required:["type","data"],additionalProperties:!1};if(w(e,t)){var o=new google.maps.Polyline(e.data);o.setMap(L.map),L.overlays.push(o)}}function w(e,t){var o=window.tv4.validate(e,t);return o||r.error("Google maps item validation failed: "+window.tv4.error.message+" "+window.tv4.error.dataPath),o}function y(e,t){e.addListener("center_changed",function(){o.triggerEvent("map-moved",t,{lat:e.getCenter().lat(),lng:e.getCenter().lng()})}),e.addListener("click",function(e){o.triggerEvent("map-clicked",t,{lat:e.latLng.lat(),lng:e.latLng.lng()})}),e.addListener("mousemove",function(e){o.triggerEvent("map-mouse-move",t,{lat:e.latLng.lat(),lng:e.latLng.lng()})}),e.addListener("rightclick",function(e){o.triggerEvent("map-right-clicked",t,{lat:e.latLng.lat(),lng:e.latLng.lng()})}),e.addListener("zoom_changed",function(){o.triggerEvent("map-zoom-changed",t,{zoom:e.getZoom()})}),e.addListener("tilesloaded",function(){o.triggerEvent("map-tiles-loaded",t,{})}),e.addListener("idle",function(){o.triggerEvent("map-idle",t,{})})}var L=this;L.overlays=[],L.trafficLayer=null,L.bicyclingLayer=null,L.trafficLayer=null,L.transitLayer=null,c()}]}}]),angular.module("app.core").directive("mdCustom",["$http","$templateCache","$log",function(e,t,o){return{scope:{name:"@",url:"@",data:"="},restrict:"E",template:'<div id="{{name}}" ng-if="show" class="form-group"><div ng-include="templateUrl"></div></div>',link:function(n,r,a){n.show=!0,"undefined"!=typeof a.url&&(void 0===t.get(a.url)&&e.get(a.url).then(function(e){t.put(a.url,e.data)},function(){o.error('Could not load specified template URL "'+a.url+'": '),a.show=n.show=!1}),n.templateUrl=a.url)}}}]),angular.module("app.core").directive("mdSlider",["$timeout",function(e){return{restrict:"E",scope:{required:"=",name:"=",model:"=",min:"@",max:"@",step:"@",validators:"@",disabled:"=",actions:"="},template:['<slider ng-model="modelValue" ',' ng-disabled="disabled" ',' validation="{{validators}}" ',' md-actions="{{actions}}" ',' ng-swipe-left="cancelSwipe($event)" ',' ng-swipe-right="cancelSwipe($event)" ',' floor="{{min}}" ',' ceiling="{{max}}" ',' step="{{step}}">',"</slider>",'<input type="hidden" ng-model="model" md-actions="{{actions}}" name="{{name}}" ng-required="required" />'].join(""),require:"^form",link:function(t,o,n,r){angular.isObject(t.model)&&(t.modelValue=t.model.lower||0);var a=function(e,n){var a=!0;t.required!==!0&&"true"!==t.required.toLowerCase()||(a=t.model>0),r[t.name].$setValidity("validationValid",a),e!==n&&o.find("input").triggerHandler("change")};t.cancelSwipe=function(){return t.disabled},t.$watch("model",a),e(function(){t.modelValue=t.model,t.$watch("modelValue",function(){t.model=t.modelValue})},0)}}}]).directive("mdRangeSlider",["$timeout","TranslationService",function(e,t){return{restrict:"E",scope:{required:"=",name:"=",model:"=",min:"@",max:"@",step:"@",validators:"@",disabled:"=",actions:"="},template:['<slider ng-model="modelLower" ',' ng-model-range="modelUpper" ',' ng-disabled="disabled" ',' validation="{{validators}}" ',' md-actions="{{actions}}" ',' ng-swipe-left="cancelSwipe($event)" ',' ng-swipe-right="cancelSwipe($event)" ',' translate-range-fn="translateRange(low, high)" ',' floor="{{min}}" ',' ceiling="{{max}}" ',' step="{{step}}">',"</slider>",'<input type="hidden" ng-model="model" md-actions="{{actions}}" name="{{name}}" ng-required="required" />'].join(""),require:"^form",link:function(o,n,r,a){function i(e,t){var r=!0;o.required!==!0&&"true"!==o.required.toLowerCase()||(r=o.model&&(o.model.lower>0||o.model.upper>0)),a[o.name].$setValidity("validationValid",r),angular.equals(e,t)||n.find("input").triggerHandler("change")}"string"==typeof o.model&&(isNaN(o.model)?o.model=JSON.parse(o.model):o.model={lower:0,upper:parseInt(o.model,10)}),o.translateRange=function(e,o){return t.translate("Range")+": "+(o-e)},o.cancelSwipe=function(){return o.disabled},o.$watch("model",i,!0),e(function(){o.model&&(o.modelLower=o.model.lower||0,o.modelUpper=o.model.upper||0),o.$watchGroup(["modelLower","modelUpper"],function(){o.model={lower:o.modelLower,upper:o.modelUpper}})},0)}}}]),angular.module("app.core").directive("mdButton",["$compile","TranslationService",function(e,t){return{restrict:"E",replace:!0,transclude:!0,scope:{id:"@",theme:"@",actions:"=",classes:"@",leftIcon:"@",rightIcon:"@"},template:['<div class="md-button-container">',' <a id="{{id}}" class="btn {{ class }} {{ classes }}" md-actions="{{:: actions }}" ng-disabled="disabled"></a>',"</div>"].join(""),link:function(o,n,r,a,i){o["class"]=void 0===o.theme||"default"===o.theme?"btn-default":o.theme;var s=n.find("a");i(function(r,a){var i=r.html()||"";i=t.translate(i),o.leftIcon&&(i='<span class="fa '+o.leftIcon+'"></span> '+i),o.rightIcon&&(i=i+' <span class="fa '+o.rightIcon+'"></span>');var c=angular.element("<div/>").html(i),l=e(c)(a).contents();s.empty(),s.append(l),n.on("$destroy",function(){a.$destroy()})})}}}]),angular.module("app.core").directive("mdActions",["$timeout","$injector","ActionFactory",function(e,t,o){return{restrict:"A",require:"?^mdContextProvider",link:function(n,r,a,i){function s(e){var t={};return u?t=e.detail||{}:(t={type:e.type,target:e.target,detail:e.detail,keyCode:e.keyCode,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},e.target&&e.target.hasOwnProperty("value")&&(t.value=e.target.value),i&&i.applyContextItemData(t)),t}function c(t,n,r){var a=s(t);e.cancel(l[t.type]),l[t.type]=e(function(){o.triggerEvent(n,r,a,t)},100)}var l={},u="true"===a.mdActionsEventDetailOnly,d=[];if("from-callback"===a.mdActions&&a.mdActionsCallbackFactory){var p=a.mdActionsCallbackFactory.split("#")[0],g=a.mdActionsCallbackFactory.split("#")[1];p&&g&&t.get(p)[g](r,n._schema.actions)}else if("from-schema"===a.mdActions?n._schema&&n._schema.actions&&(d=n._schema.actions):d=JSON.parse(a.mdActions||"[]"),d.length){var m=[];d.forEach(function(e){if(e.event&&m.indexOf(e.event)===-1){switch(e.event){case"enter":r.bind("keydown",function(e){var t=e.keyCode||e.which;13===t&&c(e,"enter",d)});break;default:r.bind(e.event,function(t){c(t,e.event,d)})}m.push(e.event)}})}}}}]),angular.module("app.core").factory("InlineCSS",["$rootScope","$injector","AssetFactory",function(e,t,o){function n(e){if(e){var n=t.get("SchemaService");(n.isPreview()||n.isLivePreview())&&(e=o.rewriteAssetPaths(e)),a+=e}}function r(){return a}var a="";return{add:n,get:r}}]),angular.module("app.core").directive("themes",["InlineCSS","$rootScope",function(e,t){return{restrict:"A",link:function(){t.$on("ConfigComplete",function(){var t=e.get();if(t){var o=document.createElement("style");o.textContent=t,document.head.appendChild(o)}})}}}]),angular.module("app.core").directive("mdAttributes",["StoreFactory","$timeout",function(e,t){return{restrict:"A",scope:{mdAttributes:"="},link:function(o,n,r){var a={},i={};r.mdExpressions&&(i=angular.fromJson(r.mdExpressions)),void 0!=o.mdAttributes&&angular.forEach(o.mdAttributes,function(e,t){"string"==typeof e&&e.indexOf("{{")>-1&&(a[t]=e)}),o.setAttributes=function(){angular.forEach(a,function(t,o){r.$set(o,e.parse(t))})},o.evalExpressions=function(){Object.keys(i).length>0&&angular.forEach(i,function(t,o){switch(o){case"show":var r=e.evaluate(t);r===!0?n.removeClass("ng-hide"):n.addClass("ng-hide")}})},o.$on("StoreChanged",function(){o.setAttributes(),o.evalExpressions()}),t(function(){o.setAttributes(),o.evalExpressions()})}}}]),angular.module("app.core").directive("mdExpressions",["$timeout","StoreFactory","TranslationService",function(e,t,o){return{restrict:"A",require:"^form",link:function(n,r,a,i){function s(e){angular.forEach(u,function(o,a){if(!angular.isArray(e)||e.indexOf(a)!==-1){o.indexOf("$form.invalid")!==-1&&(o=o.replace(/\$form\.invalid/g,i.$invalid));var s=t.evaluate(o.toString(),n),u=l.hasOwnProperty(a),p=l[a];u&&angular.equals(s,p)||(l[a]=s,c(a,s,r,d))}})}function c(e,t,n,r){switch(e){case"show":t===!0?n.removeClass("ng-hide"):n.addClass("ng-hide");break;case"disabled":r&&(r.disabled=t);break;case"label":r&&(r.originalLabel||(r.originalLabel=r.label),t?r.label=t:r.originalLabel&&(r.label=r.originalLabel));break;case"default":if(r&&void 0===r.inputModel)if("select"===r.itemType){for(var a=0;a<r.options.length;a++)if(r.options[a].value===t){r.inputModel=r.options[a];break}}else r.inputModel=o.translate(t)}}if(a.mdExpressions){var l={},u=JSON.parse(a.mdExpressions);if(u&&Object.keys(u).length){for(var d=null,p=a.id,g=n.$$childHead;g;g=g.$$nextSibling)if(g.id===p){d=g;break}s(["show","disabled"]),e(function(){s(["disabled","label","default"]),n.$watch(function(){return i.$invalid},function(){s()}),n.$on("StoreChanged",function(){s()})})}}}}}]),angular.module("app.core").directive("mdDomReady",["$interpolate",function(e){return{restrict:"A",priority:Number.MIN_SAFE_INTEGER,link:function(t,o,n){function r(e){e.forEach(function(e){t.$eval(e)})}var a=n.mdDomReady.split(";"),i=!1,s=!1;0!==n.mdDomReady.trim().length&&(n.waitForInterpolation&&t.$eval(n.waitForInterpolation)&&(i=!0),n.readyCheck&&(s=!0),i||s?requestAnimationFrame(function c(){var l=!1,u=!1;l=!(i&&o.text().indexOf(e.startSymbol())>=0),u=!(s&&!t.$eval(n.readyCheck)),l&&u?r(a):requestAnimationFrame(c)}):r(a))}}}]),angular.module("app.core").directive("openDocument",["electron","Plugin","StoreFactory",function(e,t,o){return{restrict:"E",scope:{classes:"@"},template:['<button class="btn btn-primary {{classes}}" ng-disabled="!document" ng-click="open()">'," <span class=\"icon\" ng-class=\"{'icon-file-pdf': (type == 'pdf'), 'icon-file-word': (type == 'worddocument')}\"></span> Open Document","</button>"].join(""),link:function(n,r,a){n.type=a.itemType,n.document=void 0,void 0===a["static"]||"true"===a["static"]?n.document=a.path:(n.document=o.getForElement(a.model,r),n.$watch(function(){return o.getForElement(a.model,r)},function(e){n.document=e},!0)),n.open=function(){var o=t.getSource("fileopener");if(o!==!1)o.openFile(function(){},function(){},n.document);else if(e.shell){var r=n.document;r.indexOf("user-assets")!=-1&&(r=e.app.getAppPath()+e.path.sep+"www"+e.path.sep+r),e.shell.openItem(r)}else window.open(n.document,"_blank")},document.addEventListener("media-deleted",function(e){e.detail.location===n.document&&(n.document=void 0)})}}}]),angular.module("app.core").directive("imageViewer",["StoreFactory","ActionFactory","Plugin","electron",function(e,t,o,n){return{restrict:"E",templateUrl:"components/mdDynamicForm/imageViewer/imageViewer.tpl.html",scope:{src:"@",model:"@",actions:"=",classes:"@",scaleImage:"=",openExternallyOnClick:"=",maxWidth:"@",maxHeight:"@"},link:function(r,a){function i(e){angular.isArray(e)?r.image=e[e.length-1]:r.image=e}if(r.multiple=!1,r.image=void 0,void 0!==r.model){var s=e.getForElement(r.model,a);i(s),r.$watch(function(){return e.getForElement(r.model,a)},function(e){i(e)},!0)}else void 0!==r.src&&""!=r.src&&(r.image=r.src);r.close=function(){var e=document.querySelector("#mediaViewerDisplayUi");document.body.removeChild(e)},r.open=function(){if(r.openExternallyOnClick){var e=o.getSource("fileopener");if(e!==!1)e.openFile(function(){},function(){},r.src);else if(n.shell){var a=r.src;a.indexOf("user-assets")!=-1&&(a=n.app.getAppPath()+n.path.sep+"www"+n.path.sep+a),n.shell.openItem(a)}else window.open(r.src,"_blank")}t.triggerEvent("click",r.actions)},document.addEventListener("media-deleted",function(e){e.detail.location===r.image&&(r.image=void 0)})}}}]),angular.module("app.core").directive("mediaPlayer",["StoreFactory",function(e){return{restrict:"E",templateUrl:"components/mdDynamicForm/mediaPlayer/mediaPlayer.tpl.html",scope:{src:"@",model:"@",multiple:"@",actions:"=",classes:"@",itemType:"@",name:"@"},link:function(t,o){function n(e){angular.isArray(e)?t.src=e.length>0?e[e.length-1]:"":t.src=void 0!==e?e:""}if(void 0===t.src&&void 0!==t.model){t.$watch(function(){return e.getForElement(t.model,o)},function(e){n(e)},!0);var r=e.getForElement(t.model,o);n(r),t.fileType="video"==t.itemType?"video/mp4":""}}}}]).filter("trusted",["$sce",function(e){return function(t){if(void 0!==t&&"string"==typeof t)return e.trustAsResourceUrl(t)}}]),angular.module("app.core").directive("audioPlayer",["$log","AudioPlayer","ActionFactory","$rootScope",function(e,t,o,n){return{restrict:"E",templateUrl:"components/mdDynamicForm/mediaPlayer/audioPlayer.tpl.html",scope:{src:"@",actions:"="},controllerAs:"ap",controller:["$scope","$element",function(e,r){function a(){t.play(e.src,{},function(e){n.$$phase?l(e):n.$apply(function(){l(e)})})}function i(){t.pause()}function s(){t.unpause()}function c(){t.stop()}function l(e){e.state!==g.info.state&&d(e.state),g.info.currentTime=e.currentTime,g.info.position=e.position,g.info.state=e.state;var t=parseInt(Math.ceil(g.info.position/g.info.duration*100).toFixed(0));t<=100&&(f.style.width=t+"%"),100===t&&c()}function u(){g.info=angular.copy(m),f.style.width="0%"}function d(e){switch(e){case"playing":p("play-audio");break;case"paused":p("pause-audio");break;case"stopped":p("stop-audio")}}function p(t){o.triggerEvent(t,e.actions)}var g=this,m={state:null,totalTime:"0:00",duration:0,currentTime:"0:00",position:0};g.info=angular.copy(m);var f=r[0].getElementsByClassName("filler")[0];g.getInfo=function(e){t.getDuration(e,function(e,t){g.info.duration=e,g.info.totalTime=t,g.info.state="stopped"})},g.getInfo(e.src),g.button=function(){if(null!==g.info.state)switch(g.info.state){case"running":i();break;case"paused":s();break;case"stopped":case"released":a()}},e.$watch("src",function(e,t){e!==t&&(""!=e?g.getInfo(e):u())}),document.addEventListener("media-deleted",function(t){t.detail.location===e.src&&(c(),u())})}]}}]),angular.module("app.core").directive("recordAudio",["StoreFactory","$interval","$log","ActionFactory","$timeout","Plugin","$q","FileSystem",function(e,t,o,n,r,a,i,s){return{restrict:"E",templateUrl:"components/mdDynamicForm/fields/record-audio.tpl.html",scope:{name:"@",mediaid:"@",label:"@",actions:"=",classes:"@",smallrecorder:"=",multiple:"="},link:function(r,c){function l(){var e=i.defer(),t=new Date,n=t.getTime(),r=n+".m4a";return s.getStorageLocation().then(function(t){0===t.indexOf("file://")&&(t=t.replace("file://",""));var o=t+r;e.resolve(o)})["catch"](function(e){o.error(e)}),e.promise}function u(e){var t=Math.floor(e/60),o=Math.floor(e%60);return""+t+":"+(o<10?"0":"")+o}function d(){o.debug("Start recording..."),f().then(function(){var e={SampleRate:44100,NumberOfChannels:1};r.media.startRecordWithCompression(null,e),n.triggerEvent("recording-started",r.actions),null!==h&&t.cancel(h);var o=null;h=t(function(){if(r.state===C.MEDIA_RUNNING){null===o&&(o=Date.now());var e=Date.now(),t=o-e,n=t/1e3,a=Math.abs(n);r.currentTime=u(a)}})})}function p(){null!==r.media&&(r.media.stopRecord(),t.cancel(h))}function g(){o.debug("Finished recording.");var t=e.getForElement(S,c);null!==t&&void 0!==t&&angular.isArray(t)||(t=[]),r.multiple?t.push(r.media.src):t[0]=r.media.src,o.debug("Saving filename:",r.media.src),e.set(S,t),r.isPopulated=!0,n.triggerEvent("recording-finished",r.actions)}function m(e){o.debug("Initialise new media object..."),r.media=new C(e,function(){},function(e){o.error(e)},function(e){o.debug("State changing",r.state,e),r.$apply(function(){switch(r.state=e,r.state){case C.MEDIA_STOPPED:g(),r.media.release()}})})}function f(){var e=i.defer();return o.debug("Get file name..."),l().then(function(t){o.debug("Created filename:",t),m(t),e.resolve()}),e.promise}r.media=null;var C=a.getSource("Media"),h=null,v=r.$parent.$parent.page||r.$parent.$parent.$parent.page;r.pageName=v.name;var S="$store.media."+r.mediaid+".audio",w=e.getForElement(S,c);null!==w&&void 0!==w&&angular.isArray(w)&&w.length>0&&(r.isPopulated=!0),r.currentTime=u(0),r.uiState=!1,r.recordButton=function(){switch(r.state){case C.MEDIA_RUNNING:p();break;case C.MEDIA_PAUSED:case C.MEDIA_STOPPED:case C.MEDIA_NONE:default:d()}};var y=function(){r.isPopulated=!1,r.currentTime=u(0)};r.$watch(function(){return e.getForElement(S,c)},function(e,t){e!==t&&(void 0===e||angular.isArray(e)&&0===e.length)&&y()}),document.addEventListener("media-deleted",function(t){if(r.multiple!==!0){var o=e.getForElement(S,c)[0];(void 0!==t.detail&&t.detail.location===o||void 0===o)&&y()}}),document.addEventListener("stop-all-recording",function(){p()})}}}]),angular.module("app.core").directive("mediaGallery",["StoreFactory","MediaViewerDisplay","ActionFactory","$rootScope",function(e,t,o,n){return{restrict:"E",templateUrl:"components/mdDynamicForm/imageViewer/imageViewer.tpl.html",scope:{sources:"=",actions:"=",classes:"@"},link:function(r,a){function i(){r.files=[];var t=[];r.staticFiles.forEach(function(e){r.files.push(e)}),r.models.forEach(function(o){var n=e.getForElement(o,a);angular.isArray(n)?n.forEach(function(e){void 0!==e&&t.push(e)}):void 0!==n&&t.push(n)}),t.sort(function(e,t){var o=e.split("/"),n=t.split("/"),r=parseInt(o[o.length-1].split(".")[0],10),a=parseInt(n[n.length-1].split(".")[0],10);return r>a?1:r<a?-1:0}),t.forEach(function(e){r.files.push(e)})}r.multiple=!0,r.files=[],r.models=[],r.staticFiles=[];for(var s=0;s<r.sources.length;s++){var c=r.sources[s];if(c.indexOf("{")>-1){var l=c.replace(/\{|}/g,"");r.models.push(l)}else r.staticFiles.push(n.assetDir+c)}void 0!==r.models&&r.models.length>0&&r.models.forEach(function(t){r.$watch(function(){return e.getForElement(t,a)},function(){i()},!0)}),i(),r.getFileType=function(e){if(void 0===e)return"none";var t=e.split("."),o=t[t.length-1].toLowerCase();return"aac"===o||"m4a"===o||"mp3"===o||"wav"===o?"audio":"image"},r.getViewableFilePath=function(e){if(void 0===e)return"";var t=e.split("/");return t[t.length-1]},r.close=function(){var e=document.querySelector("#mediaViewerDisplayUi");document.body.removeChild(e)},r.open=function(e){var n=r.files[e];void 0!==n&&t.open(n,r.actions).then(function(t){var n=r.actions[t];void 0!==n&&(n.data.index=e,n.data.model=r.model,o.triggerEvent(null,[n]).then(function(){r.close()})["catch"](function(){r.close()}))})["catch"](function(){r.close()})},document.addEventListener("media-deleted",function(e){var t=r.files.indexOf(e.detail.location);t!==-1&&(r.files=r.files.some(function(t){return t!==e.detail.location}))})}}}]),angular.module("app.core").factory("MediaViewerDisplay",["$q","$compile","$rootScope",function(e,t,o){function n(n,r){var a=e.defer(),i=['<div id="mediaViewerDisplayUi" class="image-viewer-display-container">',' <div class="image-frame">',' <img ng-if="fileType === \'image\'" ng-src="{{src}}" />',' <audio-player ng-if="fileType === \'audio\'" class="col-md-4 col-xs-12" item-type="{{fileType}}" src="{{src | trusted}}"></audio-player>'," </div>",' <div class="image-footer">',' <a ng-repeat="action in actions track by $index" href="javascript:void(0)" class="{{action.data.theme || \'\'}}" ng-click="callAction($index)">'," <span ng-if=\"action.data['left-icon']\" class=\"fa {{action.data['left-icon']}}\"></span> {{action.data.label}} "," <span ng-if=\"action.data['right-icon']\" class=\"fa {{action.data['right-icon']}}\"></span>"," </a>",' <a href="javascript:void(0)" ng-click="close()" class="primary">',' <span class="fa fa-close"></span> Close'," </a>"," </div>","</div>"].join(""),s=o.$new(!0);s.src=n,s.actions=r;var c=s.src.split("."),l=c[c.length-1];s.fileType="aac"===l||"m4a"===l||"mp3"===l?"audio":"image",s.close=function(){a.reject()},s.callAction=function(e){a.resolve(e)};var u=angular.element(t(i)(s))[0];return document.body.appendChild(u),a.promise}var r={open:n};return r}]),angular.module("app.core").directive("mdThumbnail",["$log","Plugin","Platform",function(e,t,o){return{restrict:"A",scope:{mdThumbnail:"@"},link:function(n,r,a){n.genThumb=function(){var i,s;try{i=parseInt(a.mdThumbnailMaxwidth),s=parseInt(a.mdThumbnailMaxheight)}catch(c){e.debug("Failed to parse width and height from thumbnail")}void 0===i&&(i=200),void 0===s&&(s=200);var l=n.mdThumbnail.toLowerCase().indexOf(".svg")>-1;if(void 0===n.mdThumbnail||""==n.mdThumbnail||l)l&&(r.attr("width",i),r.attr("height",s),r.attr("src",n.mdThumbnail));else{var u=t.getSource("thumbnail"),d="winphone"===o.getName();u!==!1?u.makeThumbnail(function(e){
r.attr("src",e)},function(t){e.error(t)},n.mdThumbnail,i,s,100):(d&&"/"!==n.mdThumbnail[0]&&n.mdThumbnail.length>0&&(n.mdThumbnail="/"+n.mdThumbnail),r.attr("src",n.mdThumbnail))}},n.genThumb(),n.$watch("mdThumbnail",function(e,t){e!=t&&n.genThumb()})}}}]),angular.module("app.core").directive("scrollableItem",function(){return{restrict:"A",scope:!1,controller:["$scope","$element",function(e,t){return{scrollToBottom:function(){t[0].scrollTop=t[0].scrollHeight}}}]}}),angular.module("app.core").directive("schemaSource",["SchemaHelper",function(e){return{restrict:"A",link:function(t,o,n){var r=n.schemaSource;if(r){var a=e.getSchemaByAutoId(r)[0];void 0!==a&&(t._schema=a)}}}}]),angular.module("app.core").directive("mdOnEnter",function(){return function(e,t,o){t.bind("keydown keypress",function(t){13===t.which&&(e.$apply(function(){e.$eval(o.mdOnEnter)}),t.preventDefault())})}}),angular.module("app.core").factory("DirectiveBridge",function(){function e(e,t,r){var i=o(e,t);if(i){var s=a.indexOf(i);a[s].api=r}else{var c=n(e,t);a.push({id:c,api:r})}}function t(e,t){var n=o(e,t);return n&&n.api||null}function o(e,t){var o=n(e,t);return r(o)}function n(e,t){return"page_"+e+"_item_"+t}function r(e){for(var t=0;t<a.length;t++)if(a[t].id===e)return a[t];return null}var a=[];return{registerItemApi:e,getItemApi:t}}),angular.module("app.core").factory("Utilities",function(){return{uuid:function(){var e=Date.now();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var o=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?o:3&o|8).toString(16)})},escapeForRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}}),angular.module("app.core").factory("MimeTypes",function(){function e(e){return e.indexOf(".")!=-1&&(e=e.split(".").pop().toLowerCase()),i.hasOwnProperty(e)?i[e].mimeType:null}function t(e){return e.indexOf(".")!=-1&&(e=e.split(".").pop().toLowerCase()),i.hasOwnProperty(e)?i[e].mediaType:null}function o(e){var t=[];for(var o in i)i.hasOwnProperty(o)&&i[o].mimeType.toLowerCase()===(e||"").toLowerCase()&&t.push(o);return t}function n(e){var t=[];for(var o in i)i.hasOwnProperty(o)&&i[o].mimeType.toLowerCase()===(e||"").toLowerCase()&&t.push({extension:o,preferred:i[o].preferred||!1});if(1==t.length)return t[0].extension;if(t.length>1){for(var n=0;n<t.length;n++)if(t[n].preferred===!0)return t[n].extension;return t[0].extension}return null}function r(e){for(var t in i)if(i.hasOwnProperty(t)&&i[t].mimeType.toLowerCase()===(e||"").toLowerCase())return i[t].mediaType;return null}var a={IMAGE:"image",AUDIO:"audio",VIDEO:"video"},i={a:{mimeType:"application/octet-stream",mediaType:null},ai:{mimeType:"application/postscript",mediaType:null},aif:{mimeType:"audio/x-aiff",mediaType:a.AUDIO},aifc:{mimeType:"audio/x-aiff",mediaType:a.AUDIO},aiff:{mimeType:"audio/x-aiff",mediaType:a.AUDIO},au:{mimeType:"audio/basic",mediaType:a.AUDIO},avi:{mimeType:"video/x-msvideo",mediaType:null},bat:{mimeType:"text/plain",mediaType:null},bin:{mimeType:"application/octet-stream",mediaType:null},bmp:{mimeType:"image/x-ms-bmp",mediaType:a.IMAGE},c:{mimeType:"text/plain",mediaType:null},cdf:{mimeType:"application/x-cdf",mediaType:null},csh:{mimeType:"application/x-csh",mediaType:null},css:{mimeType:"text/css",mediaType:null},dll:{mimeType:"application/octet-stream",mediaType:null},doc:{mimeType:"application/msword",mediaType:null},docm:{mimeType:"application/vnd.ms-word.document.macroEnabled.12",mediaType:null},docx:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",mediaType:null},dot:{mimeType:"application/msword",mediaType:null},dotx:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",mediaType:null},dvi:{mimeType:"application/x-dvi",mediaType:null},eml:{mimeType:"message/rfc822",mediaType:null},eps:{mimeType:"application/postscript",mediaType:null},etx:{mimeType:"text/x-setext",mediaType:null},exe:{mimeType:"application/octet-stream",mediaType:null},gif:{mimeType:"image/gif",mediaType:a.IMAGE},gtar:{mimeType:"application/x-gtar",mediaType:null},h:{mimeType:"text/plain",mediaType:null},hdf:{mimeType:"application/x-hdf",mediaType:null},htm:{mimeType:"text/html",mediaType:null},html:{mimeType:"text/html",mediaType:null},jpe:{mimeType:"image/jpe",mediaType:a.IMAGE},jpeg:{mimeType:"image/jpeg",mediaType:a.IMAGE},jpg:{mimeType:"image/jpeg",mediaType:a.IMAGE,preferred:!0},js:{mimeType:"application/javascript",mediaType:null},json:{mimeType:"application/json",mediaType:null},ksh:{mimeType:"text/plain",mediaType:null},latex:{mimeType:"application/x-latex",mediaType:null},m1v:{mimeType:"video/mpeg",mediaType:a.VIDEO},m4a:{mimeType:"audio/mpeg",mediaType:a.AUDIO,preferred:!0},man:{mimeType:"application/x-troff-man",mediaType:null},me:{mimeType:"application/x-troff-me",mediaType:null},mht:{mimeType:"message/rfc822",mediaType:null},mhtml:{mimeType:"message/rfc822",mediaType:null},mif:{mimeType:"application/x-mif",mediaType:null},mov:{mimeType:"video/quicktime",mediaType:a.VIDEO},movie:{mimeType:"video/x-sgi-movie",mediaType:a.VIDEO},mp2:{mimeType:"audio/mpeg",mediaType:a.AUDIO},mp3:{mimeType:"audio/mp3",mediaType:a.AUDIO},mp4:{mimeType:"video/mp4",mediaType:a.VIDEO},mpa:{mimeType:"video/mpeg",mediaType:a.VIDEO},mpe:{mimeType:"video/mpeg",mediaType:a.VIDEO},mpeg:{mimeType:"video/mpeg",mediaType:a.VIDEO},mpg:{mimeType:"video/mpeg",mediaType:a.VIDEO,preferred:!0},ms:{mimeType:"application/x-troff-ms",mediaType:null},nc:{mimeType:"application/x-netcdf",mediaType:null},nws:{mimeType:"message/rfc822",mediaType:null},o:{mimeType:"application/octet-stream",mediaType:null},obj:{mimeType:"application/octet-stream",mediaType:null},oda:{mimeType:"application/oda",mediaType:null},otf:{mimeType:"application/x-font-opentype",mediaType:null},pbm:{mimeType:"image/x-portable-bitmap",mediaType:a.IMAGE},pdf:{mimeType:"application/pdf",mediaType:null},pfx:{mimeType:"application/x-pkcs12",mediaType:null},pgm:{mimeType:"image/x-portable-graymap",mediaType:a.IMAGE},png:{mimeType:"image/png",mediaType:a.IMAGE},pnm:{mimeType:"image/x-portable-anymap",mediaType:a.IMAGE},po:{mimeType:"text/x-gettext-translation",mediaType:null},pot:{mimeType:"application/vnd.ms-powerpoint",mediaType:null},ppa:{mimeType:"application/vnd.ms-powerpoint",mediaType:null},ppm:{mimeType:"image/x-portable-pixmap",mediaType:a.IMAGE},pps:{mimeType:"application/vnd.ms-powerpoint",mediaType:null},ppt:{mimeType:"application/vnd.ms-powerpoint",mediaType:null},pptm:{mimeType:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",mediaType:null},pptx:{mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation",mediaType:null},ps:{mimeType:"application/postscript",mediaType:null},pwz:{mimeType:"application/vnd.ms-powerpoint",mediaType:null},py:{mimeType:"text/x-python",mediaType:null},pyc:{mimeType:"application/x-python-code",mediaType:null},pyo:{mimeType:"application/x-python-code",mediaType:null},qt:{mimeType:"video/quicktime",mediaType:a.VIDEO},ra:{mimeType:"audio/x-pn-realaudio",mediaType:a.AUDIO},ram:{mimeType:"application/x-pn-realaudio",mediaType:a.AUDIO},ras:{mimeType:"image/x-cmu-raster",mediaType:a.IMAGE},rdf:{mimeType:"application/xml",mediaType:null},rgb:{mimeType:"image/x-rgb",mediaType:a.IMAGE},roff:{mimeType:"application/x-troff",mediaType:null},rtx:{mimeType:"text/richtext",mediaType:null},sgm:{mimeType:"text/x-sgml",mediaType:null},sgml:{mimeType:"text/x-sgml",mediaType:null},sh:{mimeType:"application/x-sh",mediaType:null},shar:{mimeType:"application/x-shar",mediaType:null},snd:{mimeType:"audio/basic",mediaType:a.AUDIO},so:{mimeType:"application/octet-stream",mediaType:null},src:{mimeType:"application/x-wais-source",mediaType:null},svg:{mimeType:"image/svg+xml",mediaType:a.IMAGE},swf:{mimeType:"application/x-shockwave-flash",mediaType:null},t:{mimeType:"application/x-troff",mediaType:null},tar:{mimeType:"application/x-tar",mediaType:null},tcl:{mimeType:"application/x-tcl",mediaType:null},tex:{mimeType:"application/x-tex",mediaType:null},texi:{mimeType:"application/x-texinfo",mediaType:null},texinfo:{mimeType:"application/x-texinfo",mediaType:null},tif:{mimeType:"image/tiff",mediaType:a.IMAGE},tiff:{mimeType:"image/tiff",mediaType:a.IMAGE},tr:{mimeType:"application/x-troff",mediaType:null},tsv:{mimeType:"text/tab-separated-values",mediaType:null},ttf:{mimeType:"application/x-font-truetype",mediaType:null},txt:{mimeType:"text/plain",mediaType:null,preferred:!0},ustar:{mimeType:"application/x-ustar",mediaType:null},vcf:{mimeType:"text/x-vcard",mediaType:null},wav:{mimeType:"audio/x-wav",mediaType:a.AUDIO},woff:{mimeType:"application/font-woff",mediaType:null,preferred:!0},woff2:{mimeType:"application/font-woff",mediaType:null},wsdl:{mimeType:"application/xml",mediaType:null},xbm:{mimeType:"image/x-xbitmap",mediaType:a.IMAGE},xlb:{mimeType:"application/vnd.ms-excel",mediaType:null},xls:{mimeType:"application/vnd.ms-excel",mediaType:null},xlsm:{mimeType:"application/vnd.ms-excel.sheet.macroEnabled.12",mediaType:null},xlsx:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",mediaType:null},xml:{mimeType:"text/xml",mediaType:null},xpdl:{mimeType:"application/xml",mediaType:null},xpm:{mimeType:"image/x-xpixmap",mediaType:a.IMAGE},xsl:{mimeType:"application/xml",mediaType:null},xwd:{mimeType:"image/x-xwindowdump",mediaType:a.IMAGE},zip:{mimeType:"application/zip",mediaType:null}};return{MEDIA_TYPES:a,mimeTypeFromExtension:e,mediaTypeFromExtension:t,extensionsFromMimeType:o,extensionFromMimeType:n,mediaTypeFromMimeType:r}}),angular.module("app.core").factory("StudioStorage",["$q",function(e){function t(t){var o=e.defer(),a=null!==t?t:"com.commontime.infinity.studio";return n=new PouchDB(a,{revs_limit:10}),n.allDocs({include_docs:!0}).then(function(e){angular.forEach(e.rows,function(e){e.doc&&e.doc._id&&(r[e.doc._id]=e.doc.data)}),o.resolve()}),o.promise}function o(e){if(!e)throw new Error("key cannot be empty");return r[e]||null}var n=null,r={};return{init:t,getData:o}}]),angular.module("app.core").factory("SchemaHelper",["$filter",function(e){function t(){return l.schema.name}function o(e){return void 0!==l.schema.settings?l.schema.settings[e]:void 0}function n(e){return a("name",e,l.schema.config)[0]}function r(t){return e("filter")(l.schema.config,{"item-type":t})}function a(e,t,o,n){o=void 0!==o?o:l.schema;var r=[];for(var i in o)o.hasOwnProperty(i)&&("object"!=typeof o[i]||n!==!0&&"actions"==i?i==e&&o[e]==t&&r.push(o):r=r.concat(a(e,t,o[i],n)));return r}function i(e,t,o){var n=JSON.search(e,'//*[type="'+t+'"]');return n.filter(function(e){return!o||e["item-type"]===o})}function s(){return l.schema.language||{defaultLocale:"en_GB",initialLanguage:"",useDeviceLocale:!0}}function c(e){return a("_auto_id_",e)}var l={ITEM_AUTO_ID_PROPERTY:"_auto_id_",SCHEMA_CONTEXT_PREVIEW:1,SCHEMA_CONTEXT_LIVE_PREVIEW:2,schema:{},getSchemaConfigItemByName:n,getSchemaConfigItemsByItemType:r,search:a,getItems:i,getLanguageSettings:s,getSchemaByAutoId:c,getSchemaSettingByName:o,getAppName:t};return l}]),angular.module("app.core").factory("SchemaService",["$injector","$http","$q","$rootScope","$log","$templateCache","$location","StoreFactory","PluginFactory","$timeout","localStorageService","OptionFactory","ApiFactory","UrlFactory","Timer","InlineCSS","VariableFactory","$base64","ActionFactory","RouterConfig","Router","Auth","SchemaHelper","IBeaconFactory","GeofenceFactory","XmppFactory","MessageQueueFactory","Notification","Platform","DataflowFactory","AzureAppServicesFactory","RestFactory","ActionflowFactory","AssetFactory","LoadingStatus","ComponentFactory","StudioStorage","$interval","Utilities","WcUtils","ListFactory","LoggingFactory","ChatLayerFactory","IncidentLayerFactory","PagerLayerFactory","UserManagementLayerFactory","Plugin","electron",function(e,t,o,n,r,a,i,s,c,l,u,d,p,g,m,f,C,h,v,S,w,y,L,A,b,j,x,$,E,T,k,F,I,_,P,D,N,O,M,R,U,q,B,V,G,H,z,W){function J(e){var t=!1;return angular.forEach(ye.content,function(o){"page"==o.type&&o.name==e&&(t=o)}),t}function K(){return Ee}function X(){var e=2;return"undefined"!=typeof ye.animation&&(e="off"!==ye.animation?"full"==ye.animation?2:1:0),e}function Q(e){var n=o.defer();return t.get(e).then(function(e){ye=L.schema=e.data,n.resolve(ye)})["catch"](n.reject),n.promise}function Y(e){var t=o.defer();return e.settings&&e.settings.auth===!0?y.authenticate().then(t.resolve,t.reject):t.resolve(),t.promise}function Z(){w.addRoute("/error",{template:['<div class="error-container">',' <div class="alert alert-danger">',' <span class="fa fa-exclamation-triangle"></span> {{ $root.errorMessage || "An unknown error has occurred" }}'," </div>",' <div class="controls">',' <a href="#" class="btn md-btn btn-primary" onclick="location.reload();">',' <span class="fa fa-refresh"></span> Reload'," </a>"," </div>","</div>"].join("")})}function ee(){function e(e){e&&angular.forEach(e,function(e,t){window.cti.store.preferences[t]=e})}function t(){var e=o.defer();return angular.forEach(ye.metadata,function(e){window.cti.store.preferences[e.key]=e.value}),e.resolve(),e.promise}function n(){var t=o.defer(),n=z.getSource("preferences");if(n)n.getAllPreferences(function(o){e(o),t.resolve()},function(e){r.error("Error obtaining preferences",e),t.resolve()});else if(W&&W.app&&"function"==typeof require)if(le())t.resolve();else{var a=ce()?"./client/preferences.json":"./preferences.json",i=require(a);e(i),t.resolve()}else t.resolve();return t.promise}function a(){if(!c)return o.when();var t=o.defer(),n=c._appConfig;if(n){var r={};if(void 0!==n.RELEASE_DEBUGGING){var a=z.getSource("preferences");a&&("true"==n.RELEASE_DEBUGGING?a.enableWebDebugging(!0):a.enableWebDebugging(!1)),r.RELEASE_DEBUGGING=n.RELEASE_DEBUGGING}angular.forEach(n,function(e,t){r[t]=e}),e(r)}return t.resolve(),t.promise}function i(){var t=o.defer(),n={};return angular.forEach(window.cti.store.preferences,function(e,t){var o=u.get(t);o&&(n[t]=o)}),e(n),t.resolve(),t.promise}var s=o.defer();window.cti.store.preferences={},o.when().then(function(){return t()}).then(function(){return n()}).then(function(){return a()}).then(function(){return i()}).then(function(){s.resolve()});var c=z.getSource("EmmAppConfig"),l=function(e,t){var o;return function(){var n=this,r=arguments,a=function(){o=null,e.apply(n,r)};clearTimeout(o),o=setTimeout(a,t||200)}},d=l(function(){a().then(function(){var e=L.getSchemaConfigItemsByItemType("onappconfigchange");e&&e.length>0&&v.triggerEvent("onappconfigchange",e[0].actions,c._appConfig)})},400);return c&&c.registerChangedListener(d),s.promise}function te(){var t=o.defer();return n.appName=ye.name,n.cancelable=ye.cancelable===!0,n.basedir=void 0==ye.basedir?"":ye.basedir,n.assetDir=void 0!==ye.assetDir?ye.assetDir:"user-assets/",n.componentDir=void 0!==ye.componentDir?ye.componentDir:"components/",S.set("id",n.appName),r.debug("Initializing store..."),s.init(n.appName,ye).then(function(){E.init(),r.debug("Store initialized."),ee().then(function(){if(s.save(),r.debug("Preferences initialized."),q.init(n.appName),void 0!==ye.settings){if(void 0!==ye.settings.theme&&""!=ye.settings.theme){var o=angular.element(document.querySelector("head")),a=angular.element('<link rel="stylesheet" href="'+n.basedir+"assets/css/themes/"+ye.settings.theme+'.css" />');o.append(a)}void 0!==ye.settings.router&&(void 0!==ye.settings.router.mode&&S.set("mode",ye.settings.router.mode),void 0!==ye.settings.router.animation&&S.set("animation",ye.settings.router.animation)),void 0!==ye.settings["push-notifications"]&&$.init(ye),void 0!==ye.settings["message-queue"]&&x.init(ye),P.disabled=ye.settings["loading-message"]===!1}void 0!==ye.dataflows&&ye.dataflows.length>0&&ye.dataflows.forEach(function(e){T.init(e.name,e.content)}),void 0!==ye.actionflows&&ye.actionflows.length>0&&ye.actionflows.forEach(function(e){I.init(e.name,e.content)}),d.init(n.appName),Y(ye).then(function(){if(void 0!=ye.config){var o=[];angular.forEach(ye.config,function(e){if(void 0!=e.name)switch(e["item-type"]){case"onappload":o.push(e);break;case"api":void 0!==e.url&&p.init(e);break;case"offline-api":void 0!==e.url&&(F.init(),F.registerOfflineApi(e));break;case"xmpp":void 0!==e.endpoint&&j.init(e);break;case"chatlayer":B.load().then(function(){B.init(e,ye)});break;case"broadcastincidentlayer":case"responderincidentlayer":V.load().then(function(){V.init(e)});break;case"broadcastpagerlayer":case"responderpagerlayer":G.load().then(function(){G.init(e)});break;case"usermanagementlayer":H.load().then(function(){H.init(e)});break;case"plugin":c.init(e);break;case"css":f.add(e.content);break;case"variable":C.init(e);break;case"function":s.setFunction(e);break;case"js-asset":_.injectJsAsset(e.fileName);break;case"css-asset":_.injectCssAsset(e.fileName);break;case"url":g.init(e);break;case"beacon":A.init(),A.addBeacon(e);break;case"geofence":if(b.isValidGeofenceObject(e)){var t="com.commontime.infinity."+ye.name;b.init(ye.name,t),b.register(e)}break;case"timer":void 0==window.cti.__timers&&(window.cti.__timers={}),window.cti.__timers[e.name]=new m(e.name,e["timer-type"],e.time,e.actions);break;case"azure-app-services":k.init(e)}}),o.length>0&&o.forEach(function(e){v.triggerEvent("onappload",e.actions)})}U.initializeListsForApp(ye),e.get("ctDataGrid").initializeDataGridsForApp(ye),ye.components&&ye.components.length&&(ye.components.forEach(function(e){switch(e.type){case"web-component":var t=document.createElement("script"),o=window.___supportsNativeWebComponents?e.files.original:e.files.transpiled,r=n.componentDir+o;t.setAttribute("src",r),document.getElementsByTagName("body")[0].appendChild(t)}}),D.registerComponentInstances(ye)),n.$emit("ConfigComplete");var r={};n.$on("onPageContentLoaded",function(e,t){void 0!==r[t.id]&&v.triggerEvent(null,r[t.id])});var a=angular.copy(ye);angular.forEach(a.pages,function(e){var t=angular.element("<div></div>"),o=[];void 0!==e.config&&e.config.length>0&&e.config.forEach(function(t){"onpageload"==t["item-type"]&&void 0!==t.actions&&t.actions.length>0&&t.actions.forEach(function(e){o.push(e)}),"onpageloaded"==t["item-type"]&&void 0!==t.actions&&t.actions.length>0&&(void 0===r[e.name]&&(r[e.name]=[]),r[e.name]=r[e.name].concat(t.actions))});var n=ie(t,e.content),a=L.search("type","go-to-page",e.content,!0),i=[];a.length>0&&angular.forEach(a,function(e){e.data&&e.data.name&&i.push(e.data.name)});var s=e.settings&&e.settings.auth===!0;w.addRoute("/"+e.name,{template:n[0].innerHTML,possibilities:i,actions:o,start:e.start,auth:s})}),Z(),t.resolve(!0)})["catch"](function(e){r.error(e),n.errorMessage=e.message||e,Z(),i.path("/error"),t.resolve(e)})})})["catch"](function(e){r.error(e)}),t.promise}function oe(e,t){var o=!1,n=void 0===t?1:t;try{o=window.KJUR.jws.JWS.readSafeJSONString(window.b64utoutf8(e.split(".")[n]))}catch(a){r.error(a)}return o}function ne(e){var t=o.defer(),n=function(e){ye=L.schema=e,Le=angular.copy(ye),Ae="jwt_"+Le.id+"_"+Le.buildId,be="app_code_"+Le.id+"_"+Le.buildId,new Function("iv","buildDom","deferred",function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-38-o)}).join("")}(22,211,167,198,205,201,212,192,125,124,123,122,99,211,119,127,201,192,200,197,182,194,119,110,187,187,180,190,172,182,188,172,109,178,168,170,181,110,104,102,179,165)+22..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375583..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+778516..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+1289650243408..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0xf481464d75).toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+59667826874..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-16-o)}).join("")}(17,189,201,200,186,186,184,182,121,184,178,194,174,175,121,115,198,82,130,111,185,167,168,172,166,178,109,162,162,174,173,159,159,157,155,94,157,151,167,147,148,94,88,171,77,76,75,74,51,99,80,154,145,153,150,135,147)+13..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1657006445..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-14-o)}).join("")}(61,85))(ke,te,t)};if(e)Q(e).then(n)["catch"](t.reject);else{var r=u.get("appName"),a=u.get("studioDbName");N.init(a).then(function(){var e=N.getData(r);"object"!=typeof e&&(e=angular.fromJson(e)),null!==e&&n(e)})["catch"](t.reject)}return t.promise}function re(t){var o=!1,r=t.content;switch("string"==typeof r&&(r=_.rewriteAssetPaths(r)),t.originalName=t.name,t.name=t.name+"{{ $data.$index !== undefined ? '_' + $data.$index : '' }}",t.type){case"area":var a=!1;switch(t["item-type"]){case"static":o=angular.element('<section class="static-item panel panel-default" id="'+t.name+'"></section>'),a=!0;break;case"scrollable":o=angular.element('<section class="scrollable-item" id="'+t.name+'" scrollable-item></section>'),a=!0;break;case"row":o=angular.element('<section class="row-item navbar navbar-default" id="'+t.name+'"></section>'),a=!0;break;case"group":o=t.repeat?angular.element('<md-group ng-form name="'+t.name+'" isolate-form id="'+t.name+'"></md-group>'):angular.element('<md-group id="'+t.name+'"></md-group>')}o!==!1&&a&&t.classes&&(o[0].className=o[0].className+" "+t.classes);break;case"content":switch(t["item-type"]){case"html":case"markdown":o=angular.element('<md-content id="'+t.name+'">'+r+"</md-content>");break;case"title":o=angular.element('<md-title id="'+t.name+'">'+r+"</md-title>");break;case"list":o=angular.element('<md-list id="'+t.name+'"></md-list>'),t.listItemClasses&&o.attr("list-item-classes",t.listItemClasses.replace(/\{/g,"\\{"));break;case"data-grid":!function(){var n=e.get("ctDataGrid");o=n.buildDom("grid",t)}();break;case"data-grid-column":!function(){var n=e.get("ctDataGrid");o=n.buildDom("column",t)}();break;case"edit-actions-column":!function(){var n=e.get("ctDataGrid");o=n.buildDom("edit-actions-column",t)}()}break;case"user-input":case"choice":case"capture":switch(t["item-type"]){case"record-audio":o=angular.element('<record-audio id="'+t.name+'"></record-audio>');break;default:void 0!==t["extends"]&&["user-input","choice","capture"].indexOf(t["extends"].type)===-1||(o=angular.element('<md-question id="'+t.name+'"></md-question>'))}break;case"button":switch(t["item-type"]){case"button":o=angular.element('<md-button id="'+t.name+'">'+r+"</md-button>"),t["left-icon"]&&o.attr("left-icon",t["left-icon"]),t["right-icon"]&&o.attr("right-icon",t["right-icon"])}break;case"chart":o=angular.element('<md-chart id="'+t.name+'"></md-chart>');break;case"media":var i="";switch(t.fileName&&(i=_.rewriteAssetPaths(n.assetDir+t.fileName)),t["item-type"]){case"image-viewer":void 0===t.fileName&&void 0===t.model||(o=angular.element("<image-viewer></image-viewer>"),i&&o.attr("src",i),void 0===t.scaleImage&&(t.scaleImage=!0,t.maxWidth=200,t.maxHeight=200),void 0===t.openExternallyOnClick&&(t.openExternallyOnClick=!1),o.attr("scale-image",t.scaleImage),o.attr("max-width",t.maxWidth),o.attr("max-height",t.maxHeight),o.attr("open-externally-on-click",t.openExternallyOnClick));break;case"audio":case"video":void 0===t.model&&void 0===t.fileName||(o=angular.element("<media-player></media-player>"),i&&o.attr("src",i));break;case"gallery":void 0!==t.sources&&t.sources.length>0&&(o=angular.element("<media-gallery></media-gallery>"));break;case"pdf":case"worddocument":void 0===t.model&&void 0===t.fileName||(o=angular.element("<open-document></open-document>"),i&&o.attr("path",i))}break;case"mapping":switch(t["item-type"]){case"google-map":o=angular.element("<md-google-map></md-google-map>")}break;case"component":o=angular.element('<md-component instance-id="'+t[ve]+'"></md-component>'),o=angular.element('<md-component instance-id="'+t[ve]+'"></md-component>');break;case"messaging-common":switch(t["item-type"]){case"common-login-form":!function(){var n=e.get("ctCommonLoginFormFactory");o=n.buildDom(t)}();break;case"common-online-indicator":!function(){var n=e.get("ctCommonOnlineIndicatorFactory");o=n.buildDom(t)}();break;case"common-user-display":!function(){var n=e.get("ctCommonUserDisplayFactory");o=n.buildDom(t)}();break;case"common-slide-panel":!function(){var n=e.get("ctCommonSlidePanelFactory");o=n.buildDom(t)}();break;case"common-debugger":!function(){var n=e.get("ctCommonDebuggerFactory");o=n.buildDom(t)}()}break;case"chat":switch(t["item-type"]){case"cl-conversation-list":!function(){var n=e.get("ctCLConversationListFactory");o=n.buildDom(t)}();break;case"cl-new-conversation":!function(){var n=e.get("ctCLNewConversationFactory");o=n.buildDom(t)}();break;case"cl-chat-message-list":!function(){var n=e.get("ctCLChatMessageListFactory");o=n.buildDom(t)}();break;case"cl-conversation-info":!function(){var n=e.get("ctCLConversationInfoFactory");o=n.buildDom(t)}();break;case"cl-add-conversation-contacts":!function(){var n=e.get("ctCLAddConversationContactsFactory");o=n.buildDom(t)}()}break;case"incident":switch(t["item-type"]){case"il-role-selection":!function(){var n=e.get("ctILRoleSelectionFactory");o=n.buildDom(t)}();break;case"il-incident-list":!function(){var n=e.get("ctILIncidentListFactory");o=n.buildDom(t)}();break;case"il-last-incident-display":!function(){var n=e.get("ctILLastIncidentDisplayFactory");o=n.buildDom(t)}();break;case"il-new-incident-button":!function(){var n=e.get("ctILNewIncidentButtonFactory");o=n.buildDom(t)}();break;case"il-user-list":!function(){var n=e.get("ctILUserListFactory");o=n.buildDom(t)}();break;case"il-report-list":!function(){var n=e.get("ctILReportListFactory");o=n.buildDom(t)}()}break;case"pager":switch(t["item-type"]){case"pg-list":!function(){var n=e.get("ctPGListFactory");o=n.buildDom(t)}()}break;case"user-management":switch(t["item-type"]){case"um-list":!function(){var n=e.get("ctUMListFactory");o=n.buildDom(t)}()}break;default:o=ae(t)}return o||(o=ae(t)),o}function ae(e){var t=!1;return void 0!=e["extends"]&&(e.type=e["extends"].type,e["item-type"]=e["extends"]["item-type"],t=re(e)),t}function ie(e,t){for(var o=0;o<t.length;o++){var n=t[o],r=re(n);r!==!1&&("component"!==n.type&&r[0].$$attrsHandled!==!0&&angular.forEach(n,function(e,t){var o=angular.copy(e);if(0!==t.indexOf("$")){if("expressions"===t&&angular.isObject(o))return void r[0].setAttribute("md-expressions",JSON.stringify(o));var n=["_auto_id_","content","filename","attributes"];n.indexOf(t)===-1&&("validators"===t&&angular.isArray(o)&&angular.forEach(o,function(e){e.name="custom_"+e.name}),(angular.isObject(o)||angular.isArray(o))&&(o=JSON.stringify(o)),r[0].setAttribute(t,o))}}),angular.isArray(n.content)&&(r=ie(r,n.content)),e.append(r))}return e}function se(){return!ce()&&!le()}function ce(){return ye.hostContext===L.SCHEMA_CONTEXT_PREVIEW}function le(){return ye.hostContext===L.SCHEMA_CONTEXT_LIVE_PREVIEW}function ue(){var e={};return angular.forEach(ye,function(t,o){["pages","translation"].indexOf(o)===-1&&(e[o]=t)}),e}function de(e){var t="//*["+ve+"='"+e+"']",o=JSON.search(ye,t);return 0===o.length?null:o[0]}function pe(e,t,o){return L.getItems(e,t,o)}function ge(e){var t=angular.copy(e),o=["id","version","icon","splash","splashdata","settings","language","metadata","name","packageId","schemaVersion","pages","actionflows","dataflows","config","components"],n={};angular.forEach(o,function(e){n[e]=t[e]});try{var a=window.KJUR.crypto.Util.sha256(JSON.stringify(n))}catch(i){r.error(i)}return a}function me(e,n){var a=o.defer();n=void 0===n?0:n;var i=function(o){null!==o&&(void 0===e.headers&&(e.headers={}),e.headers.Authorization="Bearer "+o),t(e).then(function(e){a.resolve(e)})["catch"](function(t){if(401===t.status){var o="401 - Could not authenticate request.";n<1?he().then(function(){me(e,++n).then(function(e){a.resolve(e)})["catch"](function(e){a.reject(e)})})["catch"](function(e){var t=e||o;r.error(t),a.reject(t)}):(r.error(o),a.reject(o))}else r.error(t),a.reject(t)})};return s.getSetting("access_token").then(function(e){i(e)})["catch"](function(){i(null)}),a.promise}function fe(){s.getSetting(Ae).then(function(e){var t=oe(e);t!==!1&&t.frequency!==xe&&(xe=t.frequency,null!==$e&&O.cancel($e),$e=O(Ce,xe||36e5))})}function Ce(){var e=o.defer();return s.getSetting(Ae).then(function(t){var n=function(){var e=o.defer(),n=oe(t);return"preview"!==n.type?me({url:Se+"/activate",data:{code:je,jwt:t},method:"POST"}).then(function(t){s.setSetting(Ae,t.data).then(function(){e.resolve(t.data)})})["catch"](function(){e.resolve(t)}):e.resolve(t),e.promise},r=function(){n().then(function(t){Te(t,Le).then(function(){fe(),e.resolve()})["catch"](e.reject)})["catch"](e.reject)};null===je?s.getSetting(be).then(function(e){je=e,r()})["catch"](function(){je=M.uuid(),s.setSetting(be,je).then(function(){r()})["catch"](e.reject)}):r()})["catch"](function(){e.resolve("JWT not found.")}),e.promise}function he(){var e=o.defer();return s.getSetting(Ae).then(function(o){var n=oe(o);n!==!1?t({url:we+"/token",headers:{Authorization:"Basic "+btoa(n.client_id+":"+n.client_secret)},data:{refresh_token:n.refresh_token,grant_type:"refresh_token"},method:"POST"}).then(function(t){void 0!==t.data&&void 0!==t.data.access_token?s.setSetting("access_token",t.data.access_token).then(function(){e.resolve()})["catch"](function(t){e.reject(t)}):e.reject("Couldn't get new token from server.")})["catch"](function(t){e.reject(t)}):e.reject("Couldn't decode JWT.")}),e.promise}var ve=L.ITEM_AUTO_ID_PROPERTY,Se="https://licensing.commontime.com",we="https://identity.commontime.com",ye=null,Le=null,Ae=null,be=null,je=null,xe=864e5,$e=null,Ee={},Te=function(e,t){return new Function("jwt","schema","$q","_decodeJwt","hashSchema","isPreview","$rootScope",function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-32-o)}).join("")}(57,3826,3774,3809,3807,3817,3772,3818,3800,3806,3800,3746,3778,3738,3798,3796,3806,3761,3807,3789,3795,3757,3798,3799,3801,3788,3731,3787,3793,3787,3795,3796,3762,3710,3787,3790,3792,3790,3774,3786,3794,3711,3748,3708,3777,3777,3770,3780,3762,3772,3778,3762,3699,3770,3754,3765,3701,3695,3692,3691,3691,3766,3754,3756,3759,3761,3691,3685,3683,3743,3756,3737,3706,3752,3738,3755,3746,3710,3744,3748,3677,3671,3683,3679,3667,3729,3735,3729,3737,3738,3704,3731,3735,3664,3658,3671,3665,3654,3656,3653,3651,3711,3724,3705,3674,3720,3706,3723,3714,3678,3712,3716,3645,3639,3651,3647,3635,3697,3703,3697,3705,3706,3672,3699,3703,3632,3626,3636,3623,3625,3622,3619,3618,3618,3687,3681,3686,3680,3619,3613,3696,3611,3610,3625,3618,3611,3605,3607,3604,3602,3677,3625,3660,3658,3668,3623,3669,3651,3657,3651,3597,3640,3589,3649,3647,3657,3612,3658,3640,3646,3608,3649,3650,3652,3639,3582,3638,3644,3638,3646,3647,3613,3561,3638,3641,3643,3641,3625,3637,3645,3562,3610,3559,3628,3628,3621,3631,3613,3623,3629,3613,3550,3621,3605,3616,3552,3546,3543,3542,3542,3617,3605,3607,3610,3612,3542,3536,3534,3594,3607,3588,3557,3603,3589,3606,3597,3561,3595,3599,3528,3522,3534,3530,3518,3580,3586,3580,3588,3589,3555,3582,3586,3515,3509,3518,3517,3505,3507,3504,3502,3562,3575,3556,3525,3571,3557,3574,3565,3529,3563,3567,3496,3490,3502,3498,3486,3548,3554,3548,3556,3557,3523,3550,3554,3483,3477,3484,3485,3473,3475,3472,3469,3468,3468,3537,3531,3536,3530,3469,3463,3546,3461,3460,3475,3468,3461,3455,3457,3454,3452,3527,3475,3510,3508,3518,3473,3519,3501,3507,3501,3447,3502,3439,3499,3497,3507,3462,3508,3490,3496,3458,3499,3500,3502,3489,3432,3488,3494,3488,3496,3497,3463,3411,3488,3491,3493,3491,3475,3487,3495,3412,3472,3409,3478,3478,3471,3481,3463,3473,3479,3463,3400,3471,3455,3466,3402,3396,3393,3392,3392,3467,3455,3457,3460,3462,3392,3386,3384,3444,3457,3438,3407,3453,3439,3456,3447,3411,3445,3449,3378,3372,3384,3380,3368,3430,3436,3430,3438,3439,3405,3432,3436,3365,3359,3374,3368,3372,3366,3363,3365,3365,3361,3349,3351,3348,3345,3344,3344,3413,3407,3412,3406,3345,3339,3422,3337,3336,3345,3342,3337,3331,3333,3330,3328,3403,3351,3386,3384,3394,3349,3395,3377,3383,3377,3323,3349,3315,3375,3373,3383,3338,3384,3366,3372,3334,3375,3376,3378,3365,3308,3364,3370,3364,3372,3373,3339,3287,3364,3367,3369,3367,3351,3363,3371,3288,3319,3285,3354,3354,3347,3357,3339,3349,3355,3339,3276,3347,3331,3342,3278,3272,3269,3268,3268,3343,3331,3333,3336,3338,3268,3262,3260,3320,3333,3314,3283,3329,3315,3332,3323,3287,3321,3325,3254,3248,3260,3256,3244,3306,3312,3306,3314,3315,3281,3308,3312,3241,3235,3242,3241,3231,3233,3230,3228,3288,3301,3282,3251,3297,3283,3300,3291,3255,3289,3293,3222,3216,3228,3224,3212,3274,3280,3274,3282,3283,3249,3276,3280,3209,3203,3215,3209,3199,3201,3198,3195,3194,3194,3263,3257,3262,3256,3195,3189,3272,3187,3186,3201,3194,3187,3181,3183,3180,3178,3253,3201,3236,3234,3244,3199,3245,3227,3233,3227,3173,3191,3165,3225,3223,3233,3188,3234,3216,3222,3184,3225,3226,3228,3215,3158,3214,3220,3214,3222,3223,3189,3137,3214,3217,3219,3217,3201,3213,3221,3138,3161,3135,3204,3204,3197,3207,3189,3199,3205,3189,3126,3197,3181,3192,3128,3122,3119,3118,3118,3193,3181,3183,3186,3188,3118,3112,3110,3170,3183,3164,3133,3179,3165,3182,3173,3137,3171,3175,3104,3098,3110,3106,3094,3156,3162,3156,3164,3165,3131,3158,3162,3091,3085,3091,3092,3081,3083,3080,3078,3138,3151,3132,3101,3147,3133,3150,3141,3105,3139,3143,3072,3066,3078,3074,3062,3124,3130,3124,3132,3133,3099,3126,3130,3059,3053,3064,3062,3066,3057,3057,3062,3062,3057,3053,3042,3044,3041,3038,3037,3037,3106,3100,3105,3099,3038,3032,3115,3030,3029,3044,3037,3030,3024,3026,3023,3021,3096,3044,3079,3077,3087,3042,3088,3070,3076,3070,3016,3080,3008,3068,3066,3076,3031,3077,3059,3065,3027,3068,3069,3071,3058,3001,3057,3063,3057,3065,3066,3032,2980,3057,3060,3062,3060,3044,3056,3064,2981,3050,2978,3047,3047,3040,3050,3032,3042,3048,3032,2969,3040,3024,3035,2971,2965,2962,2961,2961,3036,3024,3026,3029,3031,2961,2955,2953,3013,3026,3007,2976,3022,3008,3025,3016,2980,3014,3018,2947,2941,2953,2949,2937,2999,3005,2999,3007,3008,2974,3001,3005,2934,2928,2940,2935,2935,2934,2938,2933,2929,2919,2921,2918,2916,2976,2989,2970,2939,2985,2971,2988,2979,2943,2977,2981,2910,2904,2916,2912,2900,2962,2968,2962,2970,2971,2937,2964,2968,2897,2891,2897,2888,2890,2887,2884,2883,2883,2952,2946,2951,2945,2884,2878,2961,2876,2875,2890,2883,2876,2870,2872,2869,2867,2942,2890,2925,2923,2933,2888,2934,2916,2922,2916,2862,2930,2854,2914,2912,2922,2877,2923,2905,2911,2873,2914,2915,2917,2904,2847,2903,2909,2903,2911,2912,2878,2826,2903,2906,2908,2906,2890,2902,2910,2827,2900,2824,2893,2893,2886,2896,2878,2888,2894,2878,2815,2886,2870,2881,2817,2811,2808,2807,2807,2882,2870,2872,2875,2877,2807,2801,2799,2859,2872,2853,2822,2868,2854,2871,2862,2826,2860,2864,2793,2787,2799,2795,2783,2845,2851,2845,2853,2854,2820,2847,2851,2780,2774,2789,2781,2770,2772,2769,2766,2765,2765,2834,2828,2833,2827,2766,2760,2843,2758,2757,2764,2769,2758,2752,2754,2751,2749,2824,2772,2807,2805,2815,2770,2816,2798,2804,2798,2744,2809,2736,2796,2794,2804,2759,2805,2787,2793,2755,2796,2797,2799,2786,2729,2785,2791,2785,2793,2794,2760,2708,2785,2788,2790,2788,2772,2784,2792,2709,2779,2706,2775,2775,2768,2778,2760,2770,2776,2760,2697,2768,2752,2763,2699,2693,2690,2689,2689,2764,2752,2754,2757,2759,2689,2683,2681,2741,2754,2735,2704,2750,2736,2753,2744,2708,2742,2746,2675,2669,2681,2677,2665,2727,2733,2727,2735,2736,2702,2729,2733,2662,2656,2663,2664,2652,2654,2651,2649,2709,2722,2703,2672,2718,2704,2721,2712,2676,2710,2714,2643,2637,2649,2645,2633,2695,2701,2695,2703,2704,2670,2697,2701,2630,2624,2635,2635,2631,2633,2627,2617,2619,2616,2613,2612,2612,2681,2675,2680,2674,2613,2607,2690,2605,2604,2619,2612,2605,2599,2601,2598,2596,2671,2619,2654,2652,2662,2617,2663,2645,2651,2645,2591,2656,2583,2643,2641,2651,2606,2652,2634,2640,2602,2643,2644,2646,2633,2576,2632,2638,2632,2640,2641,2607,2555,2632,2635,2637,2635,2619,2631,2639,2556,2626,2553,2622,2622,2615,2625,2607,2617,2623,2607,2544,2615,2599,2610,2546,2540,2537,2536,2536,2611,2599,2601,2604,2606,2536,2530,2528,2588,2601,2582,2551,2597,2583,2600,2591,2555,2589,2593,2522,2516,2528,2524,2512,2574,2580,2574,2582,2583,2549,2576,2580,2509,2503,2515,2515,2514,2506,2508,2496,2498,2495,2493,2553,2566,2547,2516,2562,2548,2565,2556,2520,2554,2558,2487,2481,2493,2489,2477,2539,2545,2539,2547,2548,2514,2541,2545,2474,2468,2477,2478,2476,2463,2465,2462,2459,2458,2458,2527,2521,2526,2520,2459,2453,2536,2451,2450,2465,2458,2451,2445,2447,2444,2442,2517,2465,2500,2498,2508,2463,2509,2491,2497,2491,2437,2469,2429,2489,2487,2497,2452,2498,2480,2486,2448,2489,2490,2492,2479,2422,2478,2484,2478,2486,2487,2453,2401,2478,2481,2483,2481,2465,2477,2485,2402,2439,2399,2468,2468,2461,2471,2453,2463,2469,2453,2390,2461,2445,2456,2392,2386,2383,2382,2382,2457,2445,2447,2450,2452,2382,2376,2374,2434,2447,2428,2397,2443,2429,2446,2437,2401,2435,2439,2368,2362,2374,2370,2358,2420,2426,2420,2428,2429,2395,2422,2426,2355,2349,2362,2355,2345,2347,2344,2342,2402,2415,2396,2365,2411,2397,2414,2405,2369,2403,2407,2336,2330,2342,2338,2326,2388,2394,2388,2396,2397,2363,2390,2394,2323,2317,2331,2327,2328,2323,2320,2310,2312,2309,2306,2305,2305,2374,2368,2373,2367,2306,2300,2383,2298,2297,2312,2305,2298,2292,2294,2291,2289,2364,2312,2347,2345,2355,2310,2356,2338,2344,2338,2284,2310,2276,2336,2334,2344,2299,2345,2327,2333,2295,2336,2337,2339,2326,2269,2325,2331,2325,2333,2334,2300,2248,2325,2328,2330,2328,2312,2324,2332,2249,2280,2246,2315,2315,2308,2318,2300,2310,2316,2300,2237,2308,2292,2303,2239,2233,2230,2229,2229,2304,2292,2294,2297,2299,2229,2223,2221,2281,2294,2275,2244,2290,2276,2293,2284,2248,2282,2286,2215,2209,2221,2217,2205,2267,2273,2267,2275,2276,2242,2269,2273,2202,2196,2204,2204,2192,2194,2191,2189,2249,2262,2243,2212,2258,2244,2261,2252,2216,2250,2254,2183,2177,2189,2185,2173,2235,2241,2235,2243,2244,2210,2237,2241,2170,2164,2174,2161,2163,2160,2157,2156,2156,2225,2219,2224,2218,2157,2151,2234,2149,2148,2163,2156,2149,2143,2145,2142,2140,2215,2163,2198,2196,2206,2161,2207,2189,2195,2189,2135,2194,2127,2187,2185,2195,2150,2196,2178,2184,2146,2187,2188,2190,2177,2120,2176,2182,2176,2184,2185,2151,2099,2176,2179,2181,2179,2163,2175,2183,2100,2164,2097,2166,2166,2159,2169,2151,2161,2167,2151,2088,2159,2143,2154,2090,2084,2081,2080,2080,2155,2143,2145,2148,2150,2080,2074,2072,2132,2145,2126,2095,2141,2127,2144,2135,2099,2133,2137,2066,2060,2072,2068,2056,2118,2124,2118,2126,2127,2093,2120,2124,2053,2047,2060,2055,2052,2052,2053,2040,2042,2039,2036,2035,2035,2104,2098,2103,2097,2036,2030,2113,2028,2027,2036,2033,2028,2022,2024,2021,2019,2094,2042,2077,2075,2085,2040,2086,2068,2074,2068,2014,2054,2006,2066,2064,2074,2029,2075,2057,2063,2025,2066,2067,2069,2056,1999,2055,2061,2055,2063,2064,2030,1978,2055,2058,2060,2058,2042,2054,2062,1979,2024,1976,2045,2045,2038,2048,2030,2040,2046,2030,1967,2038,2022,2033,1969,1963,1960,1959,1959,2034,2022,2024,2027,2029,1959,1953,1951,2011,2024,2005,1974,2020,2006,2023,2014,1978,2012,2016,1945,1939,1951,1947,1935,1997,2003,1997,2005,2006,1972,1999,2003,1932,1926,1936,1932,1922,1924,1921,1919,1979,1992,1973,1942,1988,1974,1991,1982,1946,1980,1984,1913,1907,1919,1915,1903,1965,1971,1965,1973,1974,1940,1967,1971,1900,1894,1900,1903,1900,1904,1902,1895,1899,1885,1887,1884,1881,1880,1880,1949,1943,1948,1942,1881,1875,1958,1873,1872,1887,1880,1873,1867,1869,1866,1864,1939,1887,1922,1920,1930,1885,1931,1913,1919,1913,1859,1880,1851,1911,1909,1919,1874,1920,1902,1908,1870,1911,1912,1914,1901,1844,1900,1906,1900,1908,1909,1875,1823,1900,1903,1905,1903,1887,1899,1907,1824,1850,1821,1890,1890,1883,1893,1875,1885,1891,1875,1812,1883,1867,1878,1814,1808,1805,1804,1804,1879,1867,1869,1872,1874,1804,1798,1796,1856,1869,1850,1819,1865,1851,1868,1859,1823,1857,1861,1790,1784,1796,1792,1780,1842,1848,1842,1850,1851,1817,1844,1848,1777,1771,1784,1778,1784,1766,1768,1765,1762,1761,1761,1830,1824,1829,1823,1762,1756,1839,1754,1753,1760,1765,1754,1748,1750,1747,1745,1820,1768,1803,1801,1811,1766,1812,1794,1800,1794,1740,1812,1732,1792,1790,1800,1755,1801,1783,1789,1751,1792,1793,1795,1782,1725,1781,1787,1781,1789,1790,1756,1704,1781,1784,1786,1784,1768,1780,1788,1705,1782,1702,1771,1771,1764,1774,1756,1766,1772,1756,1693,1764,1748,1759,1695,1689,1686,1685,1685,1760,1748,1750,1753,1755,1685,1679,1677,1737,1750,1731,1700,1746,1732,1749,1740,1704,1738,1742,1671,1665,1677,1673,1661,1723,1729,1723,1731,1732,1698,1725,1729,1658,1652,1665,1659,1648,1650,1647,1645,1705,1718,1699,1668,1714,1700,1717,1708,1672,1706,1710,1639,1633,1645,1641,1629,1691,1697,1691,1699,1700,1666,1693,1697,1626,1620,1634,1629,1625,1631,1623,1613,1615,1612,1625,1626,1612,1623,1623,1609,1621,1620,1606,1609,1608,1608,1602,1606,1604,1604,1598,1604,1602,1600,1594,1604,1598,1596,1590,1593,1595,1592,1586,1592,1591,1588,1582,1594,1587,1584,1578,1585,1589,1575,1581,1581,1577,1571,1583,1577,1573,1567,1571,1572,1569,1563,1568,1569,1565,1559,1562,1565,1561,1555,1563,1560,1557,1551,1555,1553,1553,1547,1555,1553,1549,1543,1546,1549,1545,1539,1543,1547,1541,1535,1546,1538,1537,1531,1543,1534,1533,1527,1530,1531,1529,1523,1527,1527,1525,1519,1524,1523,1521,1515,1523,1522,1517,1511,1516,1518,1513,1507,1513,1514,1509,1503,1513,1509,1505,1499,1507,1506,1501,1495,1507,1505,1497,1491,1503,1497,1493,1487,1493,1495,1489,1483,1488,1490,1485,1479,1482,1490,1481,1475,1483,1486,1477,1471,1476,1473,1474,1467,1474,1478,1469,1463,1474,1474,1465,1459,1469,1470,1461,1455,1462,1463,1457,1451,1455,1458,1453,1447,1454,1450,1450,1443,1450,1449,1445,1439,1445,1447,1441,1435,1441,1443,1437,1431,1434,1441,1433,1427,1439,1435,1429,1423,1427,1432,1425,1419,1429,1427,1421,1415,1426,1423,1417,1411,1417,1421,1413,1407,1412,1416,1409,1403,1407,1412,1405,1399,1410,1409,1401,1395,1402,1403,1397,1391,1398,1400,1393,1387,1397,1397,1389,1383,1390,1393,1385,1379,1387,1389,1381,1375,1387,1384,1377,1371,1375,1381,1373,1367,1378,1370,1370,1363,1367,1374,1365,1359,1366,1369,1361,1355,1361,1365,1357,1351,1354,1353,1354,1347,1359,1357,1349,1343,1352,1353,1345,1339,1346,1345,1342,1335,1347,1345,1337,1331,1342,1342,1333,1327,1336,1333,1330,1323,1326,1326,1326,1319,1324,1330,1321,1315,1326,1320,1318,1311,1316,1313,1314,1307,1315,1313,1310,1303,1308,1308,1306,1299,1308,1309,1301,1295,1301,1298,1298,1291,1295,1294,1294,1287,1298,1293,1290,1283,1288,1285,1286,1279,1286,1285,1282,1275,1286,1277,1278,1271,1276,1282,1273,1267,1273,1274,1270,1263,1268,1274,1265,1259,1268,1270,1261,1255,1260,1262,1258,1251,1258,1255,1254,1247,1252,1249,1250,1243,1252,1254,1245,1239,1248,1243,1242,1235,1244,1246,1237,1231,1240,1242,1233,1227,1236,1230,1230,1223,1227,1225,1226,1219,1230,1223,1222,1215,1226,1223,1218,1211,1223,1213,1214,1207,1215,1216,1210,1203,1211,1209,1206,1199,1203,1207,1202,1195,1204,1197,1198,1191,1203,1185,1185,1268,1183,1180,1179,1179,1248,1242,1247,1241,1180,1174,1257,1172,1241,1174,1179,1179,1171,1245,1169,1194,1162,1222,1220,1230,1185,1231,1213,1219,1181,1222,1223,1225,1212,1155,1211,1217,1211,1219,1220,1186,1134,1211,1214,1216,1214,1198,1210,1218,1135,1204,1136,1162,1130,1199,1199,1192,1202,1184,1194,1200,1184,1121,1192,1176,1187,1123,1117,1115,1175,1188,1186,1172,1188,1170,1182,1113,1147,1097,1174,1177,1179,1177,1161,1173,1117,1098,1096,1171,1156,1158,1156,1166,1096,1130,1109,1167,1090,1086,1159,1159,1152,1142,1149,1156,1141,1151,1133,1075,1142,1141,1129,1130,1076,1130,1127,1132,1134,1140,1070,1124,1134,1142,1136,1130,1134,1128,1130,1127,1060,1134,1109,1125,1124,1074,1069,1088,1038,1119,1101,1121,1125,1042,1040,1109,1109,1102,1112,1094,1104,1110,1094,1031,1030,1110,1089,1062,1102,1086,1087,1029,1058,1054,1064,1064,1067,1046,1051,1021,1093,1084,1072,1081,1075,1088,1e3,1011,1082,1084,1070,1003,1046,1048,1034,1080,1060,1062,1070,1056,1072,999,1035,1038,1024,995,1063,1066,1052,991,1026,1028,1016,1016,986,1058,1049,1037,1046,1040,1053,973,964,1033,1035,961,960,959,958,935,1025,1033,1027,1029,965,1035,1038,1018,1026,960,1015,1021,1010,1008,1025,1014,1008,952,1022,1015,1009,1011,1017,1002,932,946,945,929,928,927,926,903,1015,923,931,997,996,1004,996,917,945,944,915,913,996,998,984,909,914,913,906,973,973,981,975,971,969,967,976,982,896,924,923,894,892,975,977,963,896,887,956,958,862,861,909,883,910,955,954,942,953,958,889,901,881,939,939,953,933,935,946,950,864,941,931,930,926,859,941,922,928,855,923,920,930,920,917,922,924,847,915,917,928,843,911,908,918,918,838,917,916,900,834,916,905,903,914,829,912,909,891,909,907,892,904,821,889,902,883,886,892,863,822,843,888,887,875,886,891,835,806,819,886,872,882,880,876,868,884,866,864,795,874,873,857,791,859,861,872,787,870,852,849,867,860,860,847,779,847,860,841,844,850,853,772,783,838,838,850,840,846,853,833,763,845,826,832,759,838,837,821,755,837,826,824,803,752,749,777,747,817,828,789,825,824,810,803,739,820,802,822,713,712,760,825,709,757,738,730,741,802,810,794,806,805,790,787,786,803,800,794,800,714,791,791,784,794,774,775,780,776,778,786,772,756,703,708,783,765,766,770,764,776,707,760,760,772,771,757,757,755,753,684,683,682,681,658,772,678,677,676,675,652,700,681,740,747,734,750,705,753,734,737,749,666,669,728,735,731,729,691,724,740,732,729,720,732,663,737,715,725,711,658,727,720,710,717,724,705,716,704,635,634,633,632,631,630,629,628,605,653,634,710,696,690,625,628,687,694,690,688,650,682,691,681,691,690,674,622,696,674,684,670,617,686,679,669,676,683,664,675,663,594,593,592,591,590,589,588,587,564,612,586,597,664,650,660,658,654,646,662,644,642,573,652,651,635,569,637,639,650,565,648,630,627,645,638,638,625,557,625,638,619,622,628,631,550,561,616,616,628,618,624,631,611,541,623,604,610,537,616,615,599,533,615,604,602,581,530,527,541,540,524,550,593,604,597,519,547,517,560,560,566,553,594,580,588,587,581,521,592,578,572,507,502,501,500,499,498,497,496,495,472,520,501,493,558,558,570,560,566,573,553,496,571,557,556,564,548,479,484,543,542,538,486,555,553,542,512,550,549,530,540,530,476,547,533,527,462,457,456,455,454,453,452,451,450,427,475,456,448,531,517,511,444,449,524,517,507,514,505,511,471,502,516,496,499,511,495,441,510,503,493,500,507,488,499,487,418,446,416,501,487,481,416,411,492,474,494,407,406,405,404,403,402,401,400,377,489,397,405,471,470,478,470,391,419,418,389,387,455,462,449,465,420,468,449,452,464,381,384,375,444,446,372,371,370,369,346,394,375,367,433,440,427,443,430,372,445,426,429,441,368,355,360,433,429,433,415,416,422,414,395,432,424,410,425,420,352,421,414,404,411,418,399,410,398,329,357,327,395,402,389,405,360,408,389,392,404,321,316,397,379,399,312,311,310,309,286,334,375,390,386,387,302,330,300,367,367,379,369,375,382,330,368,367,375,359,302,356,366,364,351,334,366,360,359,361,282,277,276,275,274,251,363,271,279,340,351,344,274,265,342,342,335,345,327,337,343,327,256,284,254,322,334,336,326,322,313,317,309,245,326,308,328,219,218,266,331,215,263,244,317,302,314,239,299,315,304,306,309,294,306,237,290,290,302,301,287,287,285,283,214,213,212,211,188,300,208,216,289,274,286,211,202,279,279,272,282,264,274,280,264,193,221,191,273,272,257,254,253,270,267,246,182,263,245,265,156,155,203,251,250,258,250,171,199,169,252,243,251,248,233,213,240,240,233,243,223,225,229,231,219,239,152,233,215,235,126,125,173,154,152,225,211,211,209,207,152,218,140,135,163,133,200,200,212,211,197,197,195,193,124,205,187,207)+41513069..toString(36).toLowerCase().split("").map(function(e){
return String.fromCharCode(e.charCodeAt()+-71)}).join("")+253..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2103413..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+111..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+117..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+37..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+108..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+117..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10622..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+9361..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+16..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+16..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+117..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2541680465..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+46737..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+22..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+22..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+117..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+39..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+78..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+117..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+488873304..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){
return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+39..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+36..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+889..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+40563..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+24..toString(36).toLowerCase()+485..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1295098..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+72697618120946..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48032798..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+573609..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30363611643424..toString(36).toLowerCase()+928..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+913..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+24..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+47846297..toString(36).toLowerCase()+889..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+24..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+59672406830..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17..toString(36).toLowerCase()+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+153..toString(36).toLowerCase()+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1150405..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+924..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+7..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4033..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2925..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4145..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4074..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3892..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4033..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4004..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3964..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3892..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3929..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3962..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2919..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3888..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3997..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3967..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4105..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4004..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2916..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3894..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2889..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2884..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2919..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4073..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3964..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4035..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2886..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4004..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2847..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2881..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4040..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3963..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3891..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3927..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3968..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2817..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3894..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2889..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2850..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2887..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+4e3.toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2922..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2923..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2816..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3961..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2851..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3896..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3933..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2853..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3897..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2811..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3931..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2851..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3925..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3927..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2779..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3890..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3928..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2880..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3890..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3929..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2845..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3924..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2917..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2810..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3928..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2778..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2816..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3896..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2775..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2815..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2848..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2774..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2776..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2773..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2922..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2808..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2844..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2778..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2700..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2885..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2851..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2884..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2812..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2845..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2672..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2637..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2741..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2667..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2635..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2778..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2636..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2741..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2741..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2851..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2632..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2853..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2816..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2780..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2848..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2601..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2845..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2596..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2599..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2703..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2595..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2703..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2774..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2595..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2596..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2667..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2706..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2776..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2671..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2809..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2775..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2811..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2667..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2664..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2635..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2736..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2598..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2598..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2633..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2633..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2741..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1627..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2708..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2670..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1554..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1585..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2632..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2741..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2592..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2670..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1592..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2629..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1549..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1620..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1552..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2667..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1550..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2704..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1623..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1592..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2592..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2702..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1588..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2664..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2665..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2630..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2630..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1621..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1513..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1554..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1519..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2632..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2636..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1585..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2634..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1478..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2597..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1588..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1625..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2601..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1586..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1519..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2628..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1520..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){
return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1409..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2595..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2596..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1521..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1591..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2594..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1515..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1519..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1411..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1584..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1512..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1555..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1485..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1449..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1556..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1369..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1593..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1550..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1485..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1588..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1448..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1556..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1476..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1445..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1550..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1588..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1407..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1405..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1553..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1332..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1304..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1374..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1482..toString(36).toLowerCase()+33396..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+39..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+39..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2737..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+74..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+117..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+918239..toString(36).toLowerCase()+1490925876..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+2551621900..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+1153140..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+110..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+114..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+28..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1161747..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13982..toString(36).toLowerCase()+32034..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48223541..toString(36).toLowerCase()+41414610..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28897..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+1657494275..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+49992748..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+735718..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+22419..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+582291..toString(36).toLowerCase()+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31586..toString(36).toLowerCase()+17..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+29..toString(36).toLowerCase()+41513069..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+3..toString(36).toLowerCase()+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-5-o)}).join("")}(49,1401,1400,1385,1398,1314,1400,1381,1384,1396,1378,1390,1387,1306,1387,1389,1382,1359,1331,1386,1372,1366,1325,1298,1295,1323,1293,1363,1374,1335,1371,1370,1356,1349,1285,1284,1283,1282,1281,1280,1279,1278,1277,1276,1275,1274,1273,1272,1271,1270,1247,1359,1267,1335,1348,1340,1332,1262,1354,1260,1259,1258,1257,1256,1255,1254,1253,1252,1251,1250,1249,1226,1340,1246,1245,1244,1243,1242,1241,1240,1239,1238,1237,1236,1235,1234,1233,1232,1231,1208,1256,1297,1312,1308,1309,1224,1252,1222,1304,1303,1284,1266,1289,1299,1280,1286,1276,1212,1211,1210,1209,1208,1207,1206,1205,1204,1203,1202,1201,1200,1199,1198,1197,1196,1195,1194,1193,1170,1282,1190,1198,1260,1270,1251,1257,1198,1248,1266,1246,1248,1179,1207,1206,1205,1175,1246,1256,1237,1243,1178,1169,1238,1240,1166,1165,1164,1163,1162,1161,1160,1159,1158,1157,1156,1155,1154,1153,1152,1151,1128,1176,1157,1212,1223,1214,1216,1210,1225,1149,1205,1216,1207,1209,1203,1186,1206,1216,1197,1203,1130,1158,1128,1199,1209,1190,1196,1123,1204,1186,1206,1119,1118,1117,1116,1115,1114,1113,1112,1111,1110,1109,1108,1107,1106,1105,1104,1081,1174,1184,1165,1171,1098,1162,1173,1164,1166,1160,1175,1091,1159,1161,1172,1087,1155,1169,1149,1151,1155,1157,1145,1165,1078,1160,1160,1144,1150,1073,1151,1154,1070,1138,1135,1145,1135,1132,1137,1139,1062,1148,1129,1132,1144,1126,1138,1135,1054,1118,1052,1123,1134,1122,1135,1047,1117,1123,1117,1119,1107,1110,1108,1039,1122,1116,1114,1035,1103,1115,1097,1031,1099,1084,1028,1042,1041,1025,1024,1023,1022,1021,1020,1019,1018,1017,1016,1015,1014,1013,1012,1011,1010,987,1099,1007,1015,1007,1091,1072,1075,1087,1069,1081,1078,999,996,1024,1023,994,992,1060,1070,1078,1072,1001,1051,1069,1049,1051,990,981,1050,1052,978,977,976,975,974,973,972,971,970,969,968,967,944,996,1036,1047,1035,1048,960,1030,1036,1030,1032,1020,1023,1021,952,1020,1037,949,1017,1029,1011,945,1013,1010,1020,1010,1007,1012,1014,937,1006,1014,934,1002,1012,1020,1014,929,1012,992,998,980,924,938,937,921,920,919,918,917,916,915,914,913,912,911,910,887,935,976,989,981,969,973,902,930,900,982,981,962,944,967,977,958,964,954,890,971,953,973,886,885,884,883,882,881,880,879,878,877,876,875,852,964,872,880,939,952,944,932,936,865,893,892,863,861,925,943,923,925,864,855,924,926,852,851,850,849,848,847,846,845,822,870,851,925,927,913,846,921,923,877,903,901,911,898,899,897,891,827,855,825,889,907,887,889,820,901,883,903,816,815,814,813,812,811,810,809,786,875,871,884,880,892,867,881,800,851,853,839,796,864,866,877,792,875,859,828,788,802,801,785,784,783,782,781,780,779,778,755,867,775,783,782,865,787,786,788,768,793,834,844,837,845,831,809,829,826,823,839,827,755,766,814,754,773,771,767,799,797,748,804,744,769,813,817,805,830,738,749,745,744,758,755,744,756,752,741,749,746,738,746,741,731,731,814,729,726,725,725,794,788,793,787,726,720,803,718,785,720,730,718,757,716,772,709,769,767,777,732,778,760,766,728,769,770,772,759,702,758,764,758,766,767,733,681,758,761,763,761,745,757,765,682,749,683,740,677,746,746,739,749,731,741,747,731,668,739,723,734,670,664,662,722,735,733,719,735,717,729,660,681,644,721,724,726,724,708,720,664,645,643,718,703,705,703,713,643,664,656,679,637,633,706,706,699,689,696,703,688,698,680,622,689,688,676,677,623,677,674,679,681,687,617,671,681,689,683,677,681,675,677,674,607,681,656,672,671,621,616,622,585,666,648,668,672,589,587,656,656,649,659,641,651,657,641,578,580,577,574,573,573,642,636,641,635,574,568,651,566,565,572,577,566,560,562,559,557,632,580,615,613,623,578,624,606,612,606,552,606,544,604,602,612,567,613,595,601,563,604,605,607,594,537,593,599,593,601,602,568,516,593,596,598,596,580,592,600,517,576,514,583,583,576,586,568,578,584,568,505,576,560,571,507,501,498,497,497,572,560,562,565,567,497,491,489,549,562,543,512,558,544,561,552,516,550,554,483,477,489,485,473,535,541,535,543,544,510,537,541,470,464,477,474,474,475,469,457,459,456,467,463,461,455,459,460,457,451,454,459,453,447,457,452,449,443,447,449,445,439,449,443,441,435,444,443,437,431,443,439,433,427,435,432,429,423,433,431,425,419,423,423,421,415,420,419,417,411,421,421,413,407,419,417,409,403,410,409,405,399,402,405,401,395,406,400,397,391,399,398,393,387,390,393,389,383,388,389,385,379,384,383,381,375,381,379,377,371,378,375,373,367,375,371,369,363,372,367,365,359,363,366,361,355,359,363,357,351,356,358,353,347,357,350,349,343,352,351,345,339,344,348,341,335,342,342,337,331,339,339,333,327,333,335,329,323,334,330,325,319,326,323,321,315,326,323,317,311,317,319,313,307,314,317,309,303,310,306,296,296,379,294,291,290,290,359,353,358,352,291,285,368,283,306,285,290,290,282,325,280,302,273,333,331,341,296,342,324,330,292,333,334,336,323,266,322,328,322,330,331,297,245,322,325,327,325,309,321,329,246,269,247,270,241,310,310,303,313,295,305,311,295,232,303,287,298,234,228,226,286,299,297,283,299,281,293,224,257,208,285,288,290,288,272,284,228,209,207,282,267,269,267,277,207,240,220,247,201,197,270,270,263,253,260,267,252,262,244,186,253,252,240,241,187,241,238,243,245,251,181,235,245,253,247,241,245,239,241,238,171,245,220,236,235,185,180,198,149,230,212,232,236,153,151,220,220,213,223,205,215,221,205,142,144,141,139,199,212,193,162,208,194,211,202,166,200,204,133,127,139,135,123,185,191,185,193,194,160,187,191,120,114,128,126,123,109,111,108,105,104,104,173,167,172,166,105,99,182,97,96,111)+24215..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+22420..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+32513202229..toString(36).toLowerCase()+1024..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1547593502..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+986..toString(36).toLowerCase()+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+56077129976..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375732..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13885..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+51719020..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+19..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+41366615..toString(36).toLowerCase()+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+24134..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+51004316950..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1517381..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+383..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1462399271237..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x493aeeda7b7d7).toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17527..toString(36).toLowerCase()+14..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+663..toString(36).toLowerCase()+600..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+676..toString(36).toLowerCase()+32..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1657571576..toString(36).toLowerCase()+1153060..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+19143..toString(36).toLowerCase()+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1024..toString(36).toLowerCase()+603..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+594..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+10..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+828663..toString(36).toLowerCase()+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+31323561..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+831549..toString(36).toLowerCase()+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+516..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1339151..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21149164..toString(36).toLowerCase()+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+550..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+550..toString(36).toLowerCase()+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+18091760..toString(36).toLowerCase()+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+757103234..toString(36).toLowerCase()+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+998489..toString(36).toLowerCase()+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+516..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1339151..toString(36).toLowerCase()+14..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+31051848..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39);
}).join("")+31..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase()+14..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+807137..toString(36).toLowerCase()+32..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13996..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1389110..toString(36).toLowerCase()+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+592..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+740..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+592..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+663..toString(36).toLowerCase()+600..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+807137..toString(36).toLowerCase()+32..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+13996..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17329..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1389110..toString(36).toLowerCase()+916..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+40563..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30704..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30344..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+14018..toString(36).toLowerCase()+889..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+40563..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+903144526..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30344..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+14018..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+14021..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+26206011..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+620542..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+27876..toString(36).toLowerCase()+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+19357..toString(36).toLowerCase()+21688..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+46656..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+40563..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28146974..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30344..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+14018..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+29..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+14021..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+26206011..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+620542..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+19357..toString(36).toLowerCase()+21688..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+46656..toString(36).toLowerCase()+925..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+663..toString(36).toLowerCase()+600..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+903144526..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+14..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30704..toString(36).toLowerCase()+916..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+41308..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+15..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+903144526..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+620546..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+676..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+36485123427..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375439..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30704..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375583..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+46821659054..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+676..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+52562533..toString(36).toLowerCase()+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1291709..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+591890..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28146974..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25689038..toString(36).toLowerCase()+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0xb4a9b3f8001d7).toString(36).toLowerCase()+34..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+24860657..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1389110..toString(36).toLowerCase()+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+681422..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+663..toString(36).toLowerCase()+600..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28146974..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+517..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+30704..toString(36).toLowerCase()+916..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+41308..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+15..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+46821659054..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+22420..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+32513202229..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+15365..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1166..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13946..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+671..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28146974..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1536452941..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1166..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1091749..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1329296..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48784087022..toString(36).toLowerCase()+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1291709..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+591890..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28146974..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+28146974..toString(36).toLowerCase()+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0xb4a9b3f8001d7).toString(36).toLowerCase()+34..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+24860657..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+13..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25689038..toString(36).toLowerCase()+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+592..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+1289650243408..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+767824..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+740..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+663..toString(36).toLowerCase()+600..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0xb4a9b3f8001d7).toString(36).toLowerCase()+34..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+24860657..toString(36).toLowerCase()+593..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+481..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1112745..toString(36).toLowerCase()+916..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+767824..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+62784625132..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+594..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1657447409..toString(36).toLowerCase()+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0xb4a9b3f8001d7).toString(36).toLowerCase()+34..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+24860657..toString(36).toLowerCase()+36882..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+44464579187650..toString(36).toLowerCase()+18..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+600..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+620542..toString(36).toLowerCase()+593..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+481..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+86464843759093..toString(36).toLowerCase()+775816..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+620542..toString(36).toLowerCase()+593..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+481..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25689038..toString(36).toLowerCase()+916..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+15..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+478..toString(36).toLowerCase()+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-3-o)}).join("")}(56,232,127,126,240,124,172,153,214,225,186,222,221,207,200,144,204,216,218,208,204,195,199,191,127,126,125,124,101,213,121,189,202,194,186,116,208,92,140,121,204,110,185,184,192,184,105,130,103,191,168,178,168,183,178,165,177,164,107,157,175)+19218..toString(36).toLowerCase()+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-21-o)}).join("")}(44,95,143,184,197,186,189,190,192,189,122,175,175,187,186,172,172,170,168,99,176,179))(e,t,o,oe,ge,ce,n)},ke=function(){return new Function("_phoneHome","StoreFactory","vjs","$q","_jwtKey","_originalSchema",function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-52-o)}).join("")}(7,743,742,741,740,739,738,737,736,735,734,733,710,824,730,729,728,727,726,725,724,723,722,721,720,719,696,744,725,723,783,790,791,751,779,787,787,779,786,768,704,703,702,701,700,699,698,697,696,695,694,693,692,691,690,689,666,739,741,727,684,752,754,765,680,757,751,677,765,742,752,742,757,752,739,751,738,667,735,737,748,663,734,745,733,746,658,726,738,740,725,726,722,729,729,716,648,725,715,717,728,643,710,719,705,639,707,714,715,707,634,702,710,710,702,709,628,703,691,698,708,696,700,694,620,697,683,617,695,651,614,628,627,611,610,609,608,607,606,605,604,603,602,601,600,599,598,597,596,573,685,593,601,593,672,658,674,656,664,587,584,612,611,582,580,668,645,655,645,660,655,642,654,641,584,652,637,649,574,565,634,636,562,561,560,559,558,557,556,555,554,553,552,551,528,631,617,633,615,623,544,622,626,541,624,608,621,537,619,608,534,622,599,609,599,614,609,596,608,595,524,592,594,605,520,589,591,517,585,592,593,585,512,580,588,588,580,587,506,589,511,581,581,537,500,514,513,497,496,495,494,493,492,491,490,489,488,487,486,463,575,483,491,564,549,561,486,477,554,554,547,557,539,549,555,539,476,545,535,537,548,477,471,526,537,528,530,524,507,531,519,531,525,522,523,531,527,510,446,457,528,530,516,449,523,513,524,437,436,435,434,433,432,431,430,407,519,427,435,509,511,497,430,421,498,498,491,501,483,493,499,483,420,489,479,481,492,421,415,494,473,446,486,488,474,462,406,468,474,468,478,477,461,442,474,458,459,401,475,467,463,467,449,446,418,448,460,456,460,426,374,373,372,371,348,400,437,450,431,431,429,447,427,429,360,428,440,442,423,424,437,353,421,423,434,349,426,420,346,413,413,425,421,425,423,339,390,392,378,335,399,333,401,417,395,401,328,396,413,325,403,359,322,336,335,319,318,317,316,293,405,313,321,319,310,387,387,380,390,372,382,388,372,309,378,368,370,381,310,304,302,359,328,374,361,367,361,371,370,354,335,367,355,359,353,293,367,359,355,359,341,338,310,340,352,348,352,318,244,243,291,356,240,288,269,341,337,339,338,324,262,337,319,320,324,318,330,261,314,314,326,325,311,311,309,307,238,237,236,235,212,260,241,239,299,306,307,267,295,303,303,295,302,284,220,219,218,217,194,283,283,297,277,279,290,294,208,291,275,276,204,287,274,272,273,276,198,266,279,273,263,260,265,267,190,271,261,256,258,269,184,252,265,266,245,246,247,243,176,244,251,252,244,171,239,247,247,239,246,165,244,248,175,245,229,210,158,172,171,155,154,153,152,129,241,149,157,229,225,227,226,212,150,141,218,218,211,221,203,213,219,203,132,160,130,213,195,196,200,194,206,186,122,203,185,205,96,95,143,124,122,195,181,181,179,177,122,188,110,105,133,103,170,170,182,181,167,167,165,163,94,175,157,177)+16..toString(36).toLowerCase().split("").map(function(e){
return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0xf481464d75).toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+59667826874..toString(36).toLowerCase()+889..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+1289650243408..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20659985..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+1657006445..toString(36).toLowerCase()+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+767824..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20659985..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+778516..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b75097b).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+15..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1166..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17735..toString(36).toLowerCase()+23..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+29..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375583..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1198535873060..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1068..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+31946..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+671..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1714020418..toString(36).toLowerCase()+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+1289650243408..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+40888..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+1940629196397..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20967490..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25805..toString(36).toLowerCase()+1024..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+1940629196397..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20967490..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375583..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+600..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35524..toString(36).toLowerCase()+916..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+27661660..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+22708..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+26..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+478..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+676..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+52562533..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1032..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+998992..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+48396257..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+677..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+671..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0xf2ac4cc95e).toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20331..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1092449..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1377158..toString(36).toLowerCase()+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+592..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+1385114..toString(36).toLowerCase()+22..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+626202286..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+36821..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+896612524..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+25805..toString(36).toLowerCase()+27..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+538..toString(36).toLowerCase()+1024..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+1940629196397..toString(36).toLowerCase()+35..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20967490..toString(36).toLowerCase()+30..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+25805..toString(36).toLowerCase()+930..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375583..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1242178186199..toString(36).toLowerCase()+778516..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+10..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+46427408782684..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+887..toString(36).toLowerCase()+23..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+29..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+42815498..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+825062..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+663..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+26473062..toString(36).toLowerCase()+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-10-o)}).join("")}(37,267,276,262,196,264,271,272,264,191,259,267,267,259,266,185,260,248,255,265,253,257,251,177,254,240,174,252,208,171,185,184,168,167,166,165,164,163,162,161,160,159,158,157,156,155,154,153,152,151,150,149,126,238,146,154,146,225,211,227,209,217,140,137,165,164,135,133,221,198,208,198,213,208,195,207,194,137,205,190,202,127,118,187,189,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,77,180,166,182,164,172,93,171,175,90,173,157,170,86,168,157,83,171,148,158,148)+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1375583..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+35785062833594..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+1517381..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+44464579187650..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+671..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+38210..toString(36).toLowerCase()+16..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+26..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+478..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+21..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-13)}).join("")+42815498..toString(36).toLowerCase()+24..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+31910..toString(36).toLowerCase()+889..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+11..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-39)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+(0x5f01e0b750750).toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+995100496..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+17367..toString(36).toLowerCase()+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-60-o)}).join("")}(30,205,186,260,242,243,247,241,253,233,177,240,234,250,230,231,177,171,254,160,159,158,157,156,155,154,153,152,151,150,149,126,174,155,229,220,228,225,210,222,153,221,206,218,143,203,219,208,210,213,198,210,141,194,194,206,205,191)+20..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-97)}).join("")+1289650243408..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+12..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+26)}).join("")+25..toString(36).toLowerCase().split("").map(function(e){return String.fromCharCode(e.charCodeAt()+-71)}).join("")+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-30-o)}).join("")}(25,225,228,229,231,228,161,214,214,226,225,211,211,209,207,138,215,218,220,218,202,214,109,108,156,137,211,193,194,198,192,204,184,128,191,185,201,181,182,128,122,205,89,137,118,201,107,106,105,104,81,129,110,184,166,167,171,165,177,157,101,164,158,174,154,155,101)+1022..toString(36).toLowerCase()+function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return e.reverse().map(function(e,o){return String.fromCharCode(e-t-26-o)}).join("")}(36,73,121))(Ce,s,Te,o,Ae,Le)};return{getPages:function(){return ye.pages},buildItems:ie,stop:ne,getDom:K,buildDom:te,getPageSchema:J,isBuiltApp:se,isPreview:ce,isLivePreview:le,getAppData:ue,getAnimationLevel:X,findItemById:de,getItems:pe,ITEM_AUTO_ID_PROPERTY:ve,hashSchema:ge,setUpPreferences:ee}}]),angular.module("app.core").factory("ComponentFactory",["$rootScope","$interpolate","$injector","$timeout","SchemaHelper","AssetFactory",function(e,t,o,n,r,a){function i(e){angular.forEach(e.pages,function(t){f(e,t,t.content)})}function s(e){return c(function(t){return t.id===e})}function c(e){if("function"!=typeof e)return null;var t=h.filter(e)[0];return t||null}function l(e){if(e.indexOf("$component")===-1)return e;var t=new RegExp("\\$component\\.pages\\.\\w+\\.\\w+\\.\\$\\w+\\.[\\w-]+","g");return t.test(e)?e.replace(t,function(t){var o=new RegExp("\\$component\\.pages\\.(\\w+)\\.(\\w+)\\.\\$(\\w+)\\.([\\w-]+)"),n=t.match(o),r=n[1],a=n[2],i=n[3],s=n[4],l=c(function(e){return e.page===r&&e.name===a});if(!l)return e;var u="";switch(i){case"attribute":var d=l.element.getAttribute(s);"string"==typeof d&&(d=JSON.stringify(d)),u=d;break;case"property":var p=l.modelProperties.filter(function(e){return e.name===s})[0];if(p&&p.getter===!0)u="$store.pages."+r+"."+a+"."+s;else{var g=l.element[s];"string"==typeof g&&(g=JSON.stringify(g)),u=g}}return u}):e}function u(t,o,n){t.explicitlySetAttributes||(t.explicitlySetAttributes=[]),t.explicitlySetAttributes.push(o),t.element.setAttribute(o,n),e.$broadcast("StoreChanged")}function d(t,o,n,r){t.element[n]=m(o,r),e.$broadcast("StoreChanged")}function p(e,o,n,r){e.attributes&&angular.forEach(e.attributes,function(a,i){if(!e.explicitlySetAttributes||e.explicitlySetAttributes.indexOf(i)===-1){var s=(e.component.annotations.attributes||[]).filter(function(e){return e.name===i})[0];if(s){var c=!1;if(angular.isObject(a)&&(a=JSON.stringify(a)),angular.isString(a)&&a.indexOf("{{")!==-1){var l={$store:window.cti.store};n&&angular.extend(l,n),c=!0,a=t(a)(l)}(r||c)&&o.setAttribute(i,a)}}})}function g(e,t){var r=o.get("StoreFactory");angular.forEach(e.modelProperties,function(o){o.storeKey="pages."+e.page+"."+e.name+"."+o.name;var a=r.get(o.storeKey);void 0===a&&r.set(o.storeKey,void 0),o.updateStore=function(){var t=e.element[o.name],n=r.get(o.storeKey);t!==n&&r.set(o.storeKey,t)},o.updateElement=function(){if(o.getter){var t=e.element[o.name],n=r.get(o.storeKey);t!==n&&(e.element[o.name]=n)}else e.element[o.name]=r.get(o.storeKey)},o.setter===!0&&(t.$watch(function(){return r.get(o.storeKey)},function(){n(function(){o.updateElement()})}),o.updateElement()),o.getter===!0&&angular.forEach(o.changeEvents,function(t){e.element.addEventListener(t,function(){n(function(){o.updateStore()})})})})}function m(e,t){if(null===t||void 0===t)return t;switch((e||"").toLowerCase()){case"bool":case"boolean":return"true"===(t||"").toLowerCase();case"number":return parseFloat(t||"0");case"integer":return parseInt(t||"0",10);default:return t.toString()}}function f(t,n,i){angular.forEach(i,function(i){function s(){var e=o.get("StoreFactory").evaluate(c.expressions.show);e===!0?u[0].classList.remove("ng-hide"):u[0].classList.add("ng-hide")}if("component"===i.type){var c=i,l=t.components.filter(function(e){return e[r.ITEM_AUTO_ID_PROPERTY]===c.componentId})[0],u=null,d=[];if(l&&l.valid){u=angular.element("<"+l.tagName+' id="'+c.name+'"></'+l.tagName+">");var p=c.content;if(angular.isString(p)&&(p=a.rewriteAssetPaths(p),u.append(p)),c.expressions&&Object.keys(c.expressions).length>0&&c.expressions&&c.expressions.show&&(s(),e.$on("StoreChanged",function(){s()})),l.annotations.events&&c.actions){var g=c.actions.filter(function(e){var t=l.annotations.events.filter(function(t){return t.name===e.event})[0];return!!t});angular.forEach(l.annotations.events,function(e){u.bind(e.name,function(t){var n={type:t.type,target:t.target,detail:t.detail};o.get("ActionFactory").triggerEvent(e.name,g,n,t)})})}d=C(l)}else u=angular.element('<div style="color: red; border: 1px solid red; padding: 10px; margin: 10px 0;">Invalid component "'+l.name+'". Please edit this component for further details.</div>');var m=c[r.ITEM_AUTO_ID_PROPERTY],v={page:n.name,name:c.name,id:m,component:l,element:u[0],attributes:c.attributes,modelProperties:d};h.push(v),angular.isArray(i.content)&&f(t,n,i.content)}else angular.isArray(i.content)&&f(t,n,i.content)})}function C(e){var t=[];if(e.annotations&&angular.isArray(e.annotations.properties)&&(t=t.concat(e.annotations.properties.map(function(e){return{property:e,config:e.modelConfig}}))),e.userConfig&&e.userConfig.properties){var o=e.userConfig.properties;for(var n in o)if(o.hasOwnProperty(n)&&o[n].modelConfig){var r=e.annotations.properties.filter(function(e){return e.name===n})[0];r&&t.push({property:r,config:o[n].modelConfig})}}var a=[],i=t.filter(function(e){return e.config.store===!0});return angular.forEach(i,function(e){a.push({name:e.property.name,getter:e.property.getter,setter:e.property.setter,changeEvents:e.config.changeEvents})}),a}var h=[];return{registerComponentInstances:i,getComponentById:s,getComponentByPredicate:c,replaceComponentExpressions:l,setAttributeValueFromAction:u,setPropertyValueFromAction:d,setUpComponentAttributes:p,setUpComponentBindings:g,getTypedValue:m,___getComponentRegistrations:function(){return h},___setComponentRegistrations:function(e){h=e}}}]),angular.module("app.core").factory("ValidationFactory",["$log","StoreFactory",function(e,t){return{isValid:function(o,n,r,a){var i=!0;switch(n.type){case"regex":if(o){var s=new RegExp(n.content);i=s.test(o)}break;case"expression":if(!o)return!0;var c=angular.copy(n.content);"string"==typeof o&&(o=JSON.stringify(o));var l="$store.pages."+r+"."+a;if(c.indexOf(l)!==-1){var u=l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");c=c.replace(new RegExp(u,"g"),o)}var d=c.match(/(\$store\.pages\.\w*\.\w*)/g);angular.forEach(d,function(e){var o=t.evaluate(e);"string"==typeof o&&(o=JSON.stringify(o)),c=c.replace(e,o)}),i=t.evaluate(c);break;default:e.error("Invalid validation type specified.")}return i}}}]),angular.module("app.core").factory("TranslationService",["$rootScope","$q","$timeout","$window","$filter","$locale","$log","Plugin","Platform","SchemaHelper","StoreFactory","tmhDynamicLocale","gettextCatalog","nyaBsConfig",function(e,t,o,n,r,a,i,s,c,l,u,d,p,g){function m(){var o=sessionStorage.getItem("debug");if(o){var n=o.split("|");j=n.indexOf("*")!==-1||n.indexOf("translations")!==-1}var r=t.defer(),a=l.getLanguageSettings(),i=a.initialLanguage,s=a.defaultLocale,c=a.useDeviceLocale;p.debug=j,p.baseLanguage=s,d.setLocaleLocationPattern(e.basedir+"assets/i18n/angular-locale_{{ locale }}.js");var g=!1,m=sessionStorage.getItem(b);if(null===m){var f=u.get(A);void 0!==f&&null!==f||(g=!0),m=f||i}else sessionStorage.removeItem(b);return v(c,g,m,i,s).then(function(t){u.set(A,t),S(t,s).then(function(e){return w(e,s)}).then(function(e){return y(e)}).then(function(t){e.currentLanguage=t,r.resolve()})}),r.promise}function f(e){void 0===e&&(e="");var t=u.get(A);t!==e&&(sessionStorage.setItem(b,e),n.location.reload())}function C(e){return p.hasTranslation(e)}function h(e){return e instanceof Array?e.map(function(e){return r("translate")(e)}):"string"==typeof e?r("translate")(e):e}function v(e,o,n,r,a){function i(e){return e.replace(/-/g,"_").toLowerCase()}function u(e,t){var o=(e||"").toLowerCase();if(!o||o===a.toLowerCase())return t;var n=l.getSchemaConfigItemsByItemType("language"),r=[];if(angular.forEach(n,function(e){e.localeId&&r.push(e.localeId.toLowerCase())}),r.sort(),L("Available localeIds:",r),r.indexOf(o)!==-1)return e;o.indexOf("_")!==-1&&(o=o.substring(0,o.indexOf("_")));for(var i="",s=0;s<r.length&&!i;s++)0===r[s].indexOf(o)&&(i=r[s]);return i||t}var d=t.defer();if(e)if(o)if("desktop"===c.getType()){L('Obtained desktop language: "'+navigator.language+'"');var p=i(navigator.language),g=u(p,r);L('Resolved desktop language to: "'+g+'"'),d.resolve(g)}else{var m=s.getSource("globalization");m&&"function"==typeof m.getPreferredLanguage?m.getPreferredLanguage(function(e){L('Obtained device language: "'+e.value+'"');var t=i(e.value),o=u(t,r);L('Resolved device language to: "'+o+'"'),d.resolve(o)},function(){d.resolve(n)}):d.resolve(n)}else L('Language code already established: "'+n+'"'),d.resolve(n);else L('Bypassing device locale; returning stored language: "'+n+'"'),d.resolve(n);return d.promise}function S(o,n){var r=t.defer();if(o)if(o.toLowerCase()===n.toLowerCase())L("Language code matches default locale; skipping translation"),p.setCurrentLanguage(n),r.resolve("");else{for(var a=l.getSchemaConfigItemsByItemType("language"),s=null,c=0;c<a.length&&null===s;c++)a[c].localeId&&a[c].localeId.toLowerCase()===o.toLowerCase()&&(s=a[c]);if(null===s)i.error('Could not find language matching locale id "'+o+'"; skipping translation'),p.setCurrentLanguage(n),r.resolve("");else{var u=e.assetDir+s.fileName;L('loading translation file "'+u+'"'),p.loadRemote(u).then(function(){L('setting language to "'+o+'"'),p.setCurrentLanguage(o),r.resolve(o)})["catch"](function(){i.error('Could not load translation file "'+u+'"; skipping translation'),p.setCurrentLanguage(n),r.resolve("")})}}else L("Default language; skipping translation"),p.setCurrentLanguage(n),r.resolve("");return r.promise}function w(e,o){var n=t.defer();e||(e=o);var r=e.replace(/_/g,"-").toLowerCase();return L('loading locale "'+r+'"'),d.set(r).then(function(){n.resolve(e)})["catch"](function(){var e=p.baseLanguage.replace(/_/g,"-").toLowerCase();i.error('Could not load locale file for locale "'+r+'"; Reverting to "'+e+'"'),d.set(e).then(function(){n.resolve(p.baseLanguage)})}),n.promise}function y(e){var o=t.defer();g.defaultNoneSelection=h(g.defaultNoneSelection),g.noSearchResult=h(g.noSearchResult);var n=angular.element.prototype.pickadate;n.defaults.monthsFull=a.DATETIME_FORMATS.STANDALONEMONTH,n.defaults.monthsShort=a.DATETIME_FORMATS.SHORTMONTH,n.defaults.weekdaysFull=a.DATETIME_FORMATS.DAY,n.defaults.weekdaysShort=a.DATETIME_FORMATS.SHORTDAY,n.defaults.today=h(n.defaults.today),n.defaults.clear=h(n.defaults.clear),n.defaults.close=h(n.defaults.close);var r=angular.element.prototype.pickatime;return r.defaults.amSmall=a.DATETIME_FORMATS.AMPMS[0],r.defaults.amLarge=a.DATETIME_FORMATS.AMPMS[0],r.defaults.pmSmall=a.DATETIME_FORMATS.AMPMS[1],r.defaults.pmLarge=a.DATETIME_FORMATS.AMPMS[1],r.defaults.clear=h(r.defaults.clear),o.resolve(e),o.promise}function L(){if(j===!0&&void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[translation.fct.js] "+e[0]),i.log.apply(i,e)}}var A="currentLanguageCode",b="newLanguageCode",j=!1;return{init:m,setLanguage:f,hasTranslation:C,translate:h}}]),angular.module("app.core").factory("StoreFactory",["$rootScope","$parse","$interval","$interpolate","$log","$q","localStorageService","StoreProvider","$timeout","$injector","AssetFactory","ComponentFactory","Utilities",function(e,t,o,n,r,a,i,s,c,l,u,d,p){function g(e,o){return 0===e.indexOf("$store.")&&(e=e.replace(/\$store./g,"")),t(e)(window.cti.store,o)}function m(e,t){var o=t.controller("mdContextProvider"),n=o?o.getContextItemData("$data"):null;return g(e,n)}function f(e,o,n,r){0===e.indexOf("$store.")&&(e=e.replace("$store.",""));var a=t(e),i=a.assign;i(n||window.cti.store,o);var s=r?0:null;return F(s)}function C(e,t,o,n){var r=o.controller("mdContextProvider"),a=r?r.getContextItemData("$data"):null;return f(e,t,a,n)}function h(e,o){var n=t(e)(window.cti.store);return void 0==n&&(n=[]),n.push(o),f(e,n),F(),t(e)(window.cti.store)}function v(e,o){var n=t(e)(window.cti.store);void 0!=n&&void 0!=n[o]&&n.splice(o,1),f(e,n),F()}function S(){var e=a.defer();return M.get(N+"_data").then(function(t){R=t._rev,window.cti.store=_(angular.copy(O),t.data),void 0!==s.options.initialData&&(window.cti.store=_(window.cti.store,s.options.initialData)),e.resolve()})["catch"](function(){M.put({_id:N+"_data",data:angular.copy(O)}).then(function(t){void 0!==s.options.initialData&&(window.cti.store=_(window.cti.store,s.options.initialData)),R=t.rev,e.resolve()})["catch"](function(t){r.error(t),e.reject(t)})}),e.promise}function w(){null!==N&&i.remove(N+"_stack"),null!==M&&M.destroy().then(function(){window.location.reload()})["catch"](function(){r.error("Could not remove database.")})}function y(e){void 0!==e?f("pages."+e,{}):f("pages",{})}function L(e,t){var o=a.defer();return N=e,M=new PouchDB(N,{revs_limit:10}),void 0!==t.settings&&t.settings.encryption===!0?D(e).then(function(e){return M.crypto({key:e}),a.resolve()}).then(function(){return S()}).then(function(){f("schema",angular.copy(t)),o.resolve()})["catch"](function(e){o.reject(e)}):S().then(function(){f("schema",angular.copy(t)),o.resolve()})["catch"](function(e){o.reject(e)}),o.promise}function A(){var e=a.defer();return q=new PouchDB(U,{revs_limit:10}),D(U).then(function(t){return q.crypto({key:t}),a.resolve().then(function(){q.allDocs({include_docs:!0}).then(function(t){if(0===t.total_rows){var o=p.uuid();q.put({_id:"instance_id",data:o}).then(function(){e.resolve()})["catch"](function(t){r.error(t),e.reject(t)})}else e.resolve()})["catch"](function(t){r.error(t),e.reject(t)})})})["catch"](function(t){e.reject(t)}),e.promise}function b(e,t){if(!e)throw new Error("key cannot be empty");var o=a.defer();return q.get(e).then(function(e){e.data===JSON.stringify(t)?o.resolve():(e.data=t,q.put(e).then(function(){o.resolve()})["catch"](function(e){r.error(e),o.reject(e)}))})["catch"](function(n){return 404===n.status?void q.put({_id:e,data:t}).then(function(){o.resolve()})["catch"](function(e){
r.error(e),o.reject(e)}):(r.error(n),void o.reject(n))}),o.promise}function j(e){if(!e)throw new Error("key cannot be empty");var t=a.defer();return q.get(e).then(function(e){t.resolve(e.data)})["catch"](t.reject),t.promise}function x(t,o){function n(t){return t.indexOf("$component")!==-1&&(t=d.replaceComponentExpressions(t)),e.$eval(t,r)}var r={$store:window.cti.store};return o&&angular.isObject(o)&&(r=angular.extend(r,o)),"object"==typeof t?angular.forEach(t,function(e,o){void 0!=e&&"string"==typeof e&&"*"!=e&&(t[o]=n(t[o]))}):void 0!=t&&"*"!=t&&(t=n(t)),t}function $(e,t){var o=t.controller("mdContextProvider"),n=o?o.getContextItemData("$data"):null;return x(e,n)}function E(e,t,o){if(void 0===t&&(t={}),void 0===t.$store&&(t.$store=window.cti.store),"object"==typeof e?angular.forEach(e,function(n,r){"string"==typeof n&&n.indexOf("{{")>-1?e[r]=E(e[r],t,o):"object"==typeof n&&angular.toJson(n).indexOf("{{")>-1&&(e[r]=E(e[r],t,o))}):e&&"*"!==e&&(e.indexOf("$component")!==-1&&(e=d.replaceComponentExpressions(e)),e=n(e)(t)),o===!1)return e;try{return angular.fromJson(e)}catch(r){return e}}function T(e,t){if(e.indexOf("{{")>-1&&(e=E(e)),void 0!=t&&0!==Object.getOwnPropertyNames(t).length){var o="?";angular.forEach(t,function(e,t){"?"!=o&&(o+="&"),e.indexOf("{{")>-1&&(e=E(e)),o+=t+"="+encodeURI(e)}),e+=o}return e}function k(){var e=angular.copy(window.cti.store);return e.schema=void 0,e}function F(e){if(void 0!==e&&null!==e||(e=250),null!==N&&null!==M&&null!==R){null===G&&(G=a.defer()),null!==V&&c.cancel(V);var t=function(){r.debug("SAVING AT REVISION:",R),M.put({_id:N+"_data",_rev:R,data:k()}).then(function(e){R=e.rev,null!==G&&(G.resolve(),G=null)})["catch"](function(o){void 0!==o.status&&409==o.status?(r.debug("Caught document update conflict",o),c(t,e)):(r.error(o),null!==G&&(G.reject(o),G=null))})};return V=c(function(){t()},e),G.promise}}function I(e){if(void 0!=e.name&&void 0!=e.content)try{var t=[];void 0!=e.params&&e.params.length>0&&angular.forEach(e.params,function(e){t.push(e.name)}),t.push("$success"),t.push("$fail"),t.push("$store");var o=u.rewriteAssetPaths(e.content);window.cti[e.name]=new Function(t,o),window.cti[e.name].prototype.sync=e.sync===!0}catch(n){r.info("Couldn not successfully eval function code (store.fct.js:148): "),r.error(n)}}function _(e,t){return angular.forEach(t,function(o,n){"$event"===n?e.$event=o:"object"!=typeof o||null===o?e[n]=o:(void 0==e[n]&&("[object Array]"===Object.prototype.toString.call(t[n])?e[n]=[]:e[n]={}),e[n]=_(e[n],o))}),e}function P(e){window.cti.store=_(window.cti.store,e),F()}function D(e){var t=a.defer(),o=l.get("Plugin"),n=o.getSource("securesettings");if(n)n.getOrCreateCryptographicKey(function(e){function o(e){for(var t=[],o=0;o<e.length;o+=2)t.push(parseInt(e.substr(o,2),16));return t}var n=window.Buffer.from(o(e));t.resolve(n)},t.reject,e,256);else{var r,i=localStorage.getItem(e+"_key");if(null!==i)r=window.Buffer.from(JSON.parse(i)),t.resolve(r);else{var s,c=[];if(window.crypto&&window.crypto.getRandomValues){var u=new Uint8Array(32);for(window.crypto.getRandomValues(u),s=0;s<32;s++)c[s]=u[s]}else for(s=0;s<32;s++)c[s]=Math.floor(256*Math.random());localStorage.setItem(e+"_key",JSON.stringify(c)),r=window.Buffer.from(c),t.resolve(r)}}return t.promise}var N=null;window.cti.store={env:{},language:"en_GB",state:{},api:{},offlineApi:{},azureAppServices:{},xmpp:{},messageQueues:{listeningTo:[]},geofences:{},plugin:{},repeater:{},schema:{},media:{},notification:{},xcallback:{success:"",error:"",cancel:"",source:""},variables:{today:new Date},pages:{}};var O=angular.copy(window.cti.store),M=null,R=null,U="infinity_app_settings_v3",q=null,B={init:L,evaluate:x,evaluateForElement:$,parse:E,get:g,getForElement:m,set:f,setForElement:C,push:h,remove:v,setFunction:I,parseUrl:T,save:F,destroyAllData:w,destroyPageData:y,merge:_,mergeInitialData:P,getId:function(){return N},initSettingsDb:A,setSetting:b,getSetting:j,getEncryptionKey:D},V=null,G=null;e.$watch(function(){return window.cti.store},function(t,o){t!=o&&(F(),e.$broadcast("StoreChanged"),document.dispatchEvent(new CustomEvent("StoreChanged")))},!0);var H=function(){e.$$phase||e.$apply()};return document.addEventListener("StoreHasChanged",H),e.$on("StoreHasChanged",H),document.addEventListener("SaveToStore",function(e){var t=e.detail.key,o=e.detail.data;void 0!==t&&f(t,o)}),B}]).filter("store",["StoreFactory","$filter",function(e,t){var o=function(o,n){if(void 0!=o){var r=e.evaluate(o);return angular.isArray(r)&&void 0!=n&&(r=t("filter")(r,n)),r}};return o.$stateful=!0,o}]).filter("trust",["$sce",function(e){var t=function(t){return e.trustAsHtml(t)};return t.$stateful=!0,t}]),angular.module("app.core").provider("StoreProvider",function(){this.options={},this.set=function(e,t){switch(e){case"initialData":this.options.initialData=t}};var e=this;this.$get=function(){return{options:e.options,set:e.set}}}),angular.module("app.core").factory("Plugin",["$http","$log","$q","StoreFactory","$interval","electron",function(e,t,o,n,r,a){function i(e,t,o,a){if(this.name=e,this.events=[],this.polls=[],this.operations=a,void 0!=t&&(this.events=t,this.events.length>0)){var i=this;angular.forEach(this.events,function(e){window.addEventListener(e.name,function(t){n.set("plugin."+i.name+"."+e.name,t)})})}if(void 0!=o&&(this.polls=o,this.polls.length>0)){var s=this;angular.forEach(this.polls,function(e){r(function(){s.callAction(e.action,e.params,e.options)},e.interval)})}}return i.prototype={callAction:function(e,r){var a=this,s=o.defer(),c=[];angular.forEach(this.operations,function(t){t.name==e&&void 0!=t.params&&(c=angular.copy(t.params))});var l=function(t){n.set("plugin."+a.name+"."+e,t),s.resolve(t)},u=function(e){t.error(e),s.reject(e)},d=[];angular.forEach(c,function(e){var t=null;switch(e.name){case"$successCallback":t=l;break;case"$errorCallback":t=u;break;default:t=void 0!=r[e.name]?r[e.name]:e["default"]}null!==t&&d.push(t)});var p=i.getSource(this.name);if(p!==!1&&void 0!=p[e])try{p[e].apply(null,d)}catch(g){s.reject(g),t.error(g)}else s.reject("Could not call action");return s.promise}},i.getSource=function(e){if(void 0!==window[e])return window[e];if(void 0!==window.cordova&&void 0!==cordova[e])return cordova[e];if(void 0!==window.cordova&&void 0!==cordova.plugins&&void 0!==cordova.plugins[e])return cordova.plugins[e];if(void 0!==window.plugins&&void 0!==window.plugins[e])return window.plugins[e];if(void 0!==navigator&&void 0!==navigator[e])return navigator[e];if(void 0===a.app)return t.info("Plugin '"+e+"' is not available."),!1;var o=!1;try{return o=require(e)}catch(n){if(o===!1||void 0===o){var r=e.replace(/\-/g,"").toLowerCase();try{return o=require("@commontimeltd/com.commontime."+r)}catch(n){return!1}}return!1}},i}]),angular.module("app.core").factory("OptionFactory",["$rootScope","$parse","localStorageService",function(e,t,o){function n(e){return t(e)(i)}function r(e){a=e;var t=o.get(e+"_options");null!==t&&(i=t)}var a=null,i={},s={init:r,get:n};return s}]),angular.module("app.core").factory("Api",["$http","$log","$q","$timeout","$injector","$httpParamSerializer","StoreFactory","Utilities","FileSystem","MimeTypes",function(e,t,o,n,r,a,i,s,c,l){function u(e,t,o,n,r){this.name=e,this.url=t,this.params=o,this.headers=n,this.operations=r}return u.prototype={buildRequestObject:function(e,t,n){var r=o.defer(),s=this,c=s.url;"string"==typeof c&&c.indexOf("{{")>-1&&(c=i.parse(c));var l={url:c+e.path,method:e.method||"GET",params:{},headers:{}},u=["POST","PUT","CONNECT","PATCH"];u.indexOf(l.method)!==-1&&e["content-type"]&&(l.headers["Content-Type"]=e["content-type"]);var d=["POST","PUT","CONNECT","PATCH"];d.indexOf(l.method)!==-1&&(l.data={}),"JSONP"==l.method&&(l.params.callback="JSON_CALLBACK");var p=o.when(),g=[p];return angular.forEach(s.params,function(e){g.push(s.constructParameter(e,t,l,n))}),o.all(g).then(function(){return g=[p],angular.forEach(e.params,function(e){g.push(s.constructParameter(e,t,l,n))}),o.all(g)}).then(function(){"application/x-www-form-urlencoded"==l.headers["Content-Type"]&&(l.data=a(l.data)),e.downloadAsFile===!0&&(l.responseType="arraybuffer"),r.resolve(l)})["catch"](function(e){r.reject(e)}),r.promise},constructParameter:function(e,n,r,a){var s=o.defer(),l=void 0;if(n&&void 0!==n[e.name]&&""!==n[e.name]?l=n[e.name]:void 0!==e["default"]?l=e["default"]:e.required===!0&&s.reject("Parameter '"+e.name+"' must be provided."),e.typeConfig=e.typeConfig||{},void 0!==l){"string"==typeof l&&l.indexOf("{{")>-1&&(l=i.parse(l));var u="function"==typeof a?a(r,e,l):o.when(!1);u.then(function(o){if(o)s.resolve();else switch(e["in"]){case"path":r.url=r.url.replace("{{"+e.name+"}}",l),s.resolve();break;case"query":r.params[e.name]=l,s.resolve();break;case"header":r.headers[e.name]=l,s.resolve();break;case"body":if(!r.data){s.reject("Unable to add parameter '"+e.name+"' to body of "+r.method.toUpperCase()+" request");break}r.data[e.name]=l,s.resolve();break;case"formData":if(!r.data){s.reject("Unable to add parameter '"+e.name+"' to form data of "+r.method.toUpperCase()+" request");break}if(r.data instanceof FormData||(r.data=new FormData),r.headers["Content-Type"]=void 0,"file"===e.type)try{var n=c.getFileNameFromPath(l);c.getFileBlob(n).then(function(t){if(e.typeConfig.fileNameParameterName&&r.data.append(e.typeConfig.fileNameParameterName,n),e.typeConfig.base64encode===!0){var o=new FileReader;o.onloadend=function(t){var o=t.target.result;r.data.append(e.name,o),s.resolve()},o.readAsDataURL(t)}else r.data.append(e.name,t,n),s.resolve()})["catch"](function(e){t.error(e),s.reject(e)})}catch(a){t.error(a),s.reject(a)}else r.data.append(e.name,l),s.resolve();break;default:s.reject("Unknown parameter location")}})}else s.resolve();return s.promise},makeRequest:function(t,n,a){function i(e){if(void 0!==a){var t=r.get("ActionFactory");t.triggerEvent("success",a,{$response:e})}}function s(e){if(void 0!==a){var t=r.get("ActionFactory");t.triggerEvent("fail",a,{$response:e})}}var c=o.defer(),l=this,u=l.operations.filter(function(e){return e.name===t});if(u.length>0){var d=u[0];l.buildRequestObject(d,n).then(function(t){return e(t)}).then(function(e){d.downloadAsFile===!0?l.handleFileDownload(e,d).then(function(e){c.resolve(e),c.promise.then(function(e){i(e)})})["catch"](function(e){s(),c.reject(e)}):(c.resolve(e.data),c.promise.then(function(e){i(e)}))})["catch"](function(e){s(e),c.reject(e)})}else c.reject("Requested operation could not be found.");return c.promise},handleFileDownload:function(e,t){var n=o.defer(),r=e.headers("Content-Type").split(";")[0].trim(),a="";if((t.downloadFileName||"").trim().length>0)a=t.downloadFileName;else{a=s.uuid();var i=l.extensionFromMimeType(r);null!==i&&(a+="."+i)}return c.saveFile(a,e.data).then(function(e){n.resolve(e)})["catch"](function(e){n.reject(e)}),n.promise}},u.merge=function(e,t){var o={};return void 0!=e&&(o=e),void 0!=t&&angular.forEach(t,function(e,t){"object"!=typeof e?o[t]=e:(void 0==o[t]&&(o[t]={}),o[t]=u.merge(o[t],e))}),o},u}]),angular.module("app.core").factory("ApiFactory",["$http","$log","StoreFactory","$timeout","$q","Api","LoadingStatus",function(e,t,o,n,r,a,i){function s(e){l[e.name]=new a(e.name,e.url,e.params,e.headers,e.operations,e.actions)}function c(e,a){var s=r.defer(),c=e.name;return void 0!=l[c]&&(i.disabled!==!0&&(i.loading=!0,i.message=u.message),o.set("state.loading",!0),l[c].makeRequest(e.operation,e.params,a).then(function(t){o.set("api."+c+"."+e.operation,t).then(function(){n(function(){i.disabled!==!0&&(i.loading=!1),o.set("state.loading",!1)},1e3),s.resolve(t)})["catch"](function(e){s.reject(e)})})["catch"](function(e){t.error(e),o.set("state.loading",!1),s.reject(e),i.disabled!==!0&&(i.loading=!1,i.error="There was an error retrieving data")})),s.promise}var l={},u={loading:!1,error:!1,message:"Loading data..."};return{init:s,makeRequest:c}}]),angular.module("app.core").service("AssetFactory",["$rootScope","$injector","$http","angularLoad",function(e,t,o,n){function r(r){var a=e.assetDir+r,s=t.get("SchemaService");s.isPreview()||s.isLivePreview()?o.get(a).then(function(e){var t=document.createElement("script");t.textContent=i(e.data),document.body.appendChild(t)}):n.loadScript(a)}function a(t){var n=e.assetDir+t;o.get(n).then(function(e){var t=document.createElement("style");t.textContent=i(e.data),document.head.appendChild(t)})}function i(t){if(e.assetDir){var o=e.assetDir.replace(/\\/g,"/");return t.replace(/user-assets\//g,o)}return t}return{injectJsAsset:r,injectCssAsset:a,rewriteAssetPaths:i}}]),angular.module("app.core").factory("AudioRecordingFactory",["$q","Plugin","FileSystem",function(e,t,o){function n(){var t=e.defer();return null!==s&&c==i.MEDIA_RUNNING?a().then(function(){s=null,t.resolve()})["catch"](function(){s=null,t.resolve()}):t.resolve(),t.promise}function r(){var t=e.defer();return n().then(function(){o.generateFileName().then(function(e){s=new i(e,function(){},function(e){t.reject(e)},function(e){c=e,"function"==typeof l&&l()});var o={SampleRate:44100,NumberOfChannels:1};s.startRecordWithCompression(null,o),t.resolve()})}),t.promise}function a(){var t=e.defer();if(null===s||c!=i.MEDIA_RUNNING)t.reject("Audio not currently recording.");else{s.stopRecord();var o=s.src;s.release(),l=function(){c==i.MEDIA_STOPPED&&(l=null,t.resolve(o))}}return t.promise}var i=t.getSource("Media"),s=null,c=i.MEDIA_STOPPED,l=null;return document.addEventListener("stop-all-recording",a),{startRecordingWithCompression:r,stopRecording:a}}]),angular.module("app.core").factory("PluginFactory",["Plugin","$timeout","StoreFactory","LoadingStatus","$q",function(e,t,o,n,r){function a(t){s[t.name]=new e(t.name,t.events,t.polls,t.operations)}function i(e,a,i){var l=r.defer();n.loading=!0,n.message=c.message;var u=o.parse(angular.copy(i));return s[e].callAction(a,u).then(function(){t(function(){n.loading=!1},1e3),l.resolve()})["catch"](function(){n.loading=!1,n.error="There was an error calling the plugin",l.reject()}),l.promise}var s={},c={loading:!1,error:!1,message:"Calling plugin..."},l={init:a,callAction:i};return l}]),angular.module("app.core").value("LoadingStatus",{loading:!1,error:!1,message:"Loading data...",disabled:!1}),angular.module("app.core").factory("ActionFactory",["$injector","$q","$timeout","StoreFactory","ApiFactory","PluginFactory","$rootScope","$location","$log","UrlFactory","toastr","VariableFactory","Router","Camera","AudioRecordingFactory","Notification","$parse","IBeaconFactory","GeofenceFactory","XmppFactory","MessageQueueFactory","SchemaHelper","FileSystem","MimeTypes","TranslationService","ActionflowFactory","DataflowFactory","AzureAppServicesFactory","RestFactory","AudioPlayer","ComponentFactory","GoogleMapService","DirectiveBridge","ListFactory","LoggingFactory","VibrateFactory","Plugin","Platform","AssetFactory",function($injector,$q,$timeout,StoreFactory,ApiFactory,PluginFactory,$rootScope,$location,$log,UrlFactory,toastr,VariableFactory,Router,Camera,AudioRecordingFactory,Notification,$parse,IBeaconFactory,GeofenceFactory,XmppFactory,MessageQueueFactory,SchemaHelper,FileSystem,MimeTypes,TranslationService,ActionflowFactory,DataflowFactory,AzureAppServicesFactory,RestFactory,AudioPlayer,ComponentFactory,GoogleMapService,DirectiveBridge,ListFactory,LoggingFactory,VibrateFactory,Plugin,Platform,AssetFactory){function evalOperation(e){var t=null;switch(e.type){case"value":if(angular.isNumber(e.content)||parseInt(e.content)||parseFloat(e.content))t=" "+e.content;else{var o=angular.isString(e.content)?e.content.replace(/"/g,'\\"'):e.content;t=' "'+o+'"'}break;case"operator":case"connector":t=" "+e.content}return t}function evalOperations(e,t){var o=!1;if(void 0!==e&&e.length>0){e=void 0===t?StoreFactory.parse(e):StoreFactory.parse(e,{$data:t},!1);var n="";angular.forEach(e,function(e){n+=evalOperation(e)});try{o=$parse(n)({})}catch(r){$log.error("Could not evaluate the logic expression")}}return o}function triggerEvent(e,t,o,n){var r=$q.when(),a=0,i={},s={},c=0;void 0!==o&&null!==o||void 0===n||null===n||(o={keyCode:n.keyCode,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey},n.target&&n.target.hasOwnProperty("value")&&(o.value=n.target.value));var l=function(e){return!(e>0)||i[e-1]!==!1&&l(e-1)};return angular.forEach(t,function(t){if(null===e||!t.event||t.event===e)switch(t.type){case"if":r=r.then(function(e){var n=void 0===e&&0===c?o:e;return a++,void 0!==t.operations&&t.operations.length>0&&(i[a]=evalOperations(angular.copy(t.operations),n),i[a-1]!==!1&&s[a]!==!0&&i[a]===!0&&(s[a]=!0)),$q.when(n)});break;case"end-if":r=r.then(function(e){var t=void 0===e&&0===c?o:e;return delete s[a],delete i[a],a--,$q.when(t)});break;case"otherwise":r=r.then(function(e){var t=void 0===e&&0===c?o:e;return i[a]=s[a]!==!0,$q.when(t)});break;case"otherwise-if":r=r.then(function(e){var n=void 0===e&&0===c?o:e;return s[a]===!0?i[a]=!1:(void 0!==t.operations&&t.operations.length>0&&(i[a]=evalOperations(angular.copy(t.operations),n)),i[a]===!0&&(s[a]=!0)),$q.when(n)});break;default:r=r.then(function(e){var n=void 0===e&&0===c?o:e;return i[a]!==!1&&l(a)?(c++,call(t,n)()):$q.when(n)})}}),a=0,i={},s={},r}function evalExpressions(e,t){return angular.forEach(e,function(e,o){"expressions"!=o&&("object"==typeof e?t[o]=evalExpressions(e,t[o]):t[o]=StoreFactory.evaluate(e))}),t}function call(originalAction,$data){var parsedAction=angular.copy(originalAction);"loop"!==parsedAction.type&&(parsedAction=StoreFactory.parse(parsedAction,{$data:$data}));var $store=window.cti.store;return function(){function success(e){_success(100*e)}function fail(e){_error("Could not get device volume: "+e)}var deferred=$q.defer(),_success=function(e){deferred.resolve(e)},_error=function(e,t,o){$log.error('Error in action "'+originalAction.type+'"\n\n',e,"\n\nAction schema:",originalAction,"\n\nParsed action schema:",parsedAction),void 0!==t&&null!==t&&$log.error(t),o===!0?deferred.reject():deferred.resolve(e)};void 0!==parsedAction.expressions&&(parsedAction=evalExpressions(parsedAction.expressions,parsedAction));var SchemaService=$injector.get("SchemaService");switch(parsedAction.type){case"set-layers":!function(){var e=DirectiveBridge.getItemApi(parsedAction.data.page,parsedAction.data.map),t=parsedAction.data.layer;e?t&&e.setMapLayers(t,parsedAction.data.show)?_success($data):_error("Could not find layer: "+t):_error("Could not find map: "+parsedAction.data.map+" on "+parsedAction.data.page+".")}();break;case"set-map-type":!function(){var e=DirectiveBridge.getItemApi(parsedAction.data.page,parsedAction.data.map),t=parsedAction.data.maptype;e&&t?(e.setMapTypeId(t),_success($data)):_error("Could not find map: "+parsedAction.data.map+" on "+parsedAction.data.page+".")}();break;case"set-controls":!function(){var e=DirectiveBridge.getItemApi(parsedAction.data.page,parsedAction.data.map),t=parsedAction.data.control,o=parsedAction.data.show;e?t&&e.setControls(t,o)?_success($data):_error("Could not find control: "+t):_error("Could not find map: "+parsedAction.data.map+" on "+parsedAction.data.page+".")}();break;case"set-location":var lat=parseFloat(parsedAction.data.lat),lng=parseFloat(parsedAction.data.lng),zoom=parseInt(parsedAction.data.zoom),pan=parsedAction.data.pan;if(isNaN(lat)||isNaN(lng)){_error($data,"No lat/lng provided");break}var api=DirectiveBridge.getItemApi(parsedAction.data.page,parsedAction.data.map);api?(api.setLocation(lat,lng,zoom,pan),_success($data)):_error("Could not find map: "+parsedAction.data.map+" on "+parsedAction.data.page+".");break;case"set-model":try{var key=parsedAction.data.location,valueOrEmpty=parsedAction.data.value||"",value="string"==typeof valueOrEmpty?valueOrEmpty:JSON.stringify(valueOrEmpty),trimmedValue=value.trim(),dataType=parsedAction.data.dataType;if(void 0!==key){var alternativeModel=null;0!==key.indexOf("$store")&&(alternativeModel={$data:$data}),""===dataType&&(dataType=0===trimmedValue.length?"empty":["true","false"].indexOf(trimmedValue.toLowerCase())!==-1?"boolean":/^[0-9]*\.?[0-9]+$/.test(trimmedValue)?"number":"["===trimmedValue[0]?"array":"{"===trimmedValue[0]?"object":"string");var typedValue;switch(dataType){default:case"string":typedValue=value;break;case"number":typedValue=parseFloat(value)||0;break;case"boolean":typedValue=["","false","0"].indexOf(trimmedValue.toLowerCase())===-1;break;case"array":try{typedValue=JSON.parse(trimmedValue),angular.isArray(typedValue)||(typedValue=[])}catch(e){typedValue=[]}break;case"object":try{typedValue=JSON.parse(trimmedValue),angular.isObject(typedValue)||(typedValue={})}catch(e){typedValue={}}break;case"empty":typedValue=void 0}StoreFactory.set(key,typedValue,alternativeModel,!0).then(function(){alternativeModel&&$rootScope.$broadcast("StoreChanged")}),_success($data)}else _error("Model location has not been specified.")}catch(e){_error(e)}break;case"set-preference":localStorage.setItem(parsedAction.data.key,parsedAction.data.value),SchemaService.setUpPreferences();break;case"reset-preference":localStorage.removeItem(parsedAction.data.key),SchemaService.setUpPreferences();break;case"change-language":TranslationService.setLanguage(parsedAction.data.language);break;case"upload-file":!function(){var e=parsedAction.data.filePath,t=FileSystem.getFileNameFromPath(e),o=parsedAction.data.uploadUrl,n=parsedAction.data.saveResponseInModel,r=parsedAction.data.modelLocation,a={httpMethod:parsedAction.data.uploadMethod||"POST",fileName:t,fileKey:parsedAction.data.fileParameterName||"source"};FileSystem.upload(e,o,a).then(function(e){return n&&StoreFactory.set(r,e.response),_success(e)})["catch"](_error)}();break;case"download-file":!function(){var e=parsedAction.data.downloadUrl,t=parsedAction.data.saveAsFileName,o=parsedAction.data.modelLocation;FileSystem.download(e,t).then(function(e){return StoreFactory.set(o,e.filePath),_success(e)})["catch"](_error)}();break;case"call-actionflow":ActionflowFactory.execute(parsedAction.data.name,$data).then(_success)["catch"](_error);break;case"call-dataflow":DataflowFactory.execute(parsedAction.data.name,$data).then(_success)["catch"](_error);break;case"call-api":parsedAction.data.sync===!0?ApiFactory.makeRequest(parsedAction.data,originalAction.actions).then(_success)["catch"](_error):(ApiFactory.makeRequest(parsedAction.data,originalAction.actions),_success($data));break;case"call-offline-api":RestFactory.makeRequest(parsedAction).then(_success)["catch"](_error);break;case"call-azure-app-service":AzureAppServicesFactory.makeRequest(parsedAction).then(_success)["catch"](_error);break;case"logout-azure-app-service":AzureAppServicesFactory.logout().then(_success)["catch"](_error);break;case"send-xmpp-message":case"resend-xmpp-message":XmppFactory.send(parsedAction.data).then(_success)["catch"](_error);break;case"send-xmpp-group-message":XmppFactory.sendToGroup(parsedAction.data).then(_success)["catch"](_error);break;case"xmpp-login":XmppFactory.login(parsedAction.data).then(_success)["catch"](_error);break;case"xmpp-logout":XmppFactory.logout(parsedAction.data).then(_success)["catch"](_error);break;case"xmpp-mark-read":XmppFactory.markRead(parsedAction.data).then(_success)["catch"](_error);break;case"xmpp-mark-acknowledged":XmppFactory.markAcknowledged(parsedAction.data).then(_success)["catch"](_error);break;case"xmpp-set-status":XmppFactory.setStatus(parsedAction.data).then(_success)["catch"](_error);break;case"start-message-queue-listening":MessageQueueFactory.startListening(parsedAction.data.name).then(_success)["catch"](_error);break;case"stop-message-queue-listening":MessageQueueFactory.stopListening(parsedAction.data.name).then(_success)["catch"](_error);break;case"send-message-queue-message":MessageQueueFactory.sendMessage(parsedAction.data.name,parsedAction.data.message).then(_success)["catch"](_error);break;case"call-plugin":PluginFactory.callAction(parsedAction.data.name,parsedAction.data.operation,parsedAction.data.params).then(_success)["catch"](_error);break;case"call-url":UrlFactory.makeRequest(parsedAction.data).then(_success)["catch"](_error);break;case"call-x-callback-url":var url=null;switch(parsedAction.data.type){case"x-source":url=StoreFactory.get("xcallback.source");break;case"x-success":url=StoreFactory.get("xcallback.success");break;case"x-error":url=StoreFactory.get("xcallback.error");break;case"x-cancel":url=StoreFactory.get("xcallback.cancel")}url=StoreFactory.parseUrl(url,parsedAction.data.params),window.open(url,"_system"),_success(url);break;case"go-back":Router.goPrevious(),_success($data);break;case"go-to-page":var location=null;parsedAction.data.isConditional!==!0?void 0!==parsedAction.data.name&&parsedAction.data.name.length>0&&(location="/"+parsedAction.data.name):void 0!==parsedAction.data.expressions&&angular.forEach(parsedAction.data.expressions,function(e,t){null===location&&StoreFactory.evaluate(e)&&(location="/"+t)}),null!==location?Router.isInitialized?(Router.go(location),_success(location)):(Router.setFirstPage(location),_success(location)):_error($data);break;case"set-variable":VariableFactory.setVariable(parsedAction.data.name,parsedAction.data.value).then(function(){_success($data)})["catch"](_error);break;case"call-function":var functionItem=SchemaHelper.getSchemaConfigItemByName(parsedAction.data.name);if(parsedAction.data.name&&"function"==typeof window.cti[parsedAction.data.name]&&functionItem){void 0==parsedAction.data.params&&(parsedAction.data.params={});try{var paramsArr=[];angular.forEach(functionItem.params,function(e){var t=e.name,o=parsedAction.data.params[t];paramsArr.push(o)});var $success=function(e){void 0!==functionItem.actions&&functionItem.actions.length>0&&triggerEvent("success",functionItem.actions,e),_success(e)},$fail=function(e){void 0!==functionItem.actions&&functionItem.actions.length>0&&triggerEvent("fail",functionItem.actions,e),_error(e)};paramsArr.push($success),paramsArr.push($fail),paramsArr.push(window.cti.store),window.cti[parsedAction.data.name].apply({$success:$success,$fail:$fail},Array.prototype.slice.call(paramsArr,0)),window.cti[parsedAction.data.name].prototype.sync!==!0&&_success($data)}catch(e){_error("Couldn't successfully call function:",e)}}else _error("Specified function doesn't exist");break;case"inline-function":if(void 0!==parsedAction.data.code)try{var func=null;if(eval("func = function(){"+parsedAction.data.code+"}"),null!==func){var $success=function(e){void 0!==parsedAction.actions&&parsedAction.actions.length>0&&triggerEvent("success",originalAction.actions,e),_success(e)},$fail=function(e){void 0!==parsedAction.actions&&parsedAction.actions.length>0&&triggerEvent("fail",originalAction.actions,e),_error(e)};func.apply({$success:$success,$fail:$fail,$store:window.cti.store})}parsedAction.data.sync!==!0&&_success($data)}catch(error){_error(error)}else _error("Function code not specified.");break;case"call-component-function":!function(){var e=parsedAction.data.componentInstanceId,t=parsedAction.data["function"],o=ComponentFactory.getComponentById(e);if(!o)return void _error("Component not available");var n=(o.component.annotations.functions||[]).filter(function(e){return e.name===t})[0];if(!n)return void _error('Function "'+t+'" not available on component "'+o.name+'"');var r=o.element[t];if("function"!=typeof r)return void _error('Function "'+t+'" on component "'+o.name+'" is not a function');void 0==parsedAction.data.params&&(parsedAction.data.params={});var a=[];angular.forEach(n.params,function(e){var t=e.name,o=parsedAction.data.params[t],n=ComponentFactory.getTypedValue(e.type,o);a.push(n)});try{var i=r.apply(o.element,Array.prototype.slice.call(a,0));$q.all([i]).then(function(e){$rootScope.$broadcast("StoreChanged"),_success(e[0])})}catch(s){_error("Couldn't successfully call function \""+t+'" on component "'+o.name+'":',s)}}();break;case"set-component-variable":!function(){var e=parsedAction.data.componentInstanceId,t=parsedAction.data.variableName||"",o=(parsedAction.data.variableType||"").toLowerCase(),n=parsedAction.data.value,r=ComponentFactory.getComponentById(e);if(!r)return void _error("Component not available");var a=[];switch(o){case"attribute":a=r.component.annotations.attributes||[];break;case"property":a=r.component.annotations.properties||[]}var i=a.filter(function(e){return e.name===t})[0];if(!i)return void _error('Variable "'+i+'" not available on component "'+r.name+'"');try{if("attribute"===o)ComponentFactory.setAttributeValueFromAction(r,t,n),_success($data);else if("property"===o)if(i.setter===!0){var s=i.valueType;ComponentFactory.setPropertyValueFromAction(r,s,t,n),_success($data)}else _error('Cannot set property "'+t+'" on component "'+r.name+'": property does not have setter')}catch(c){_error("Couldn't successfully set variable \""+t+'" on component "'+r.name+'":',c)}}();break;case"add-to-collection":!function(){var e=parsedAction.data.model;if(!e)return void _error("Model location was not specified.");var t=StoreFactory.get(e);if(void 0===t)return void _error('Model location "'+parsedAction.data.model+'" does not exist.');if(!angular.isArray(t))return void _error('Model location "'+parsedAction.data.model+'" is not an array.');try{var o=void 0;if("model"===parsedAction.data.source){if(!parsedAction.data.itemModel)return void _error("Item data model location not specified");o=angular.copy(StoreFactory.get(parsedAction.data.itemModel))}else if("json"===parsedAction.data.source){if(!parsedAction.data.itemJson)return void _error("Item JSON not specified");o=parsedAction.data.itemJson}if(void 0!==o){switch(parsedAction.data.where){case"end":t.push(o);break;case"start":t.unshift(o);break;case"idx":var n=parseInt(parsedAction.data.index);if(isNaN(n))return void _error('Index "'+parsedAction.data.index+'" is not a valid index.');n>=t.length?t.push(o):t.splice(n,0,o)}StoreFactory.set(e,t),_success($data)}}catch(r){_error("Unable to process item JSON",r)}}();break;case"remove-from-collection":!function(){var e=parsedAction.data.model;if(!e)return void _error("Model location was not specified.");var t=StoreFactory.get(e);if(void 0===t)return void _error('Model location "'+parsedAction.data.model+'" does not exist.');if(!angular.isArray(t))return void _error('Model location "'+parsedAction.data.model+'" is not an array.');var o=parseInt(parsedAction.data.index);return isNaN(o)?void _error('Index "'+parsedAction.data.index+'" is not a valid index.'):o>=t.length?void _error("Index "+o+' is out of bounds of model "'+parsedAction.data.model+'" which has size: '+t.length+"."):(t.splice(o,1),StoreFactory.set(e,t),void _success($data))}();break;case"start-timer":void 0!=parsedAction.data.name&&void 0!=window.cti.__timers&&void 0!=window.cti.__timers[parsedAction.data.name]?(window.cti.__timers[parsedAction.data.name].start(),_success($data)):_error(!0);break;case"stop-timer":void 0!=parsedAction.data.name&&void 0!=window.cti.__timers&&void 0!=window.cti.__timers[parsedAction.data.name]?(window.cti.__timers[parsedAction.data.name].stop(),_success($data)):_error($data);break;case"show-notification":Notification.call(parsedAction.data).then(function(){_success($data)})["catch"](_error);break;case"take-photo":var quality=null;isNaN(parseInt(parsedAction.data.quality))||(quality=parseInt(parsedAction.data.quality));var direction=null,encoding=null;("fromDataModel"===parsedAction.data.direction&&"back"===parsedAction.data.directionFromDataModel||"back"===parsedAction.data.direction)&&(direction=0),("fromDataModel"===parsedAction.data.direction&&"front"===parsedAction.data.directionFromDataModel||"front"===parsedAction.data.direction)&&(direction=1),("fromDataModel"===parsedAction.data.encoding&&"jpeg"===parsedAction.data.encodingFromDataModel||"jpeg"===parsedAction.data.encoding)&&(encoding=0),("fromDataModel"===parsedAction.data.encoding&&"png"===parsedAction.data.encodingFromDataModel||"png"===parsedAction.data.encoding)&&(encoding=1);var processedWidth=0,processedHeight=0;parsedAction.data.width&&!isNaN(parseInt(parsedAction.data.width))&&parsedAction.data.width>0&&(processedWidth=parseInt(parsedAction.data.width)),parsedAction.data.height&&!isNaN(parseInt(parsedAction.data.height))&&parsedAction.data.height>0&&(processedHeight=parseInt(parsedAction.data.height)),
Camera.takePhoto(quality,direction,processedWidth,processedHeight,encoding,parsedAction.data.allowEdit,parsedAction.data.saveToPhotoAlbum).then(function(e){if(void 0!==parsedAction.data.mediaId){var t="$store.media."+parsedAction.data.mediaId+".images",o=StoreFactory.get(t);void 0===o&&(o=[]),void 0!==parsedAction.data.index&&void 0!==o[parsedAction.data.index]?o[parsedAction.data.index]=e:parsedAction.data.multiple===!0?o.push(e):o[0]=e,StoreFactory.set(t,o),_success(o)}else _error("Could not save photo response.")})["catch"](function(e){_error("Could not take photo:",e)});break;case"select-photo":Camera.selectPhoto().then(function(e){if(void 0!==parsedAction.data.mediaId){var t="$store.media."+parsedAction.data.mediaId+".images",o=StoreFactory.get(t);void 0===o&&(o=[]),void 0!==parsedAction.data.index&&void 0!==o[parsedAction.data.index]?o[parsedAction.data.index]=e:parsedAction.data.multiple===!0?o.push(e):o[0]=e,StoreFactory.set(t,o),_success(o)}else _error("Could not save gallery response.")})["catch"](function(e){_error("Could not select photo:",e)});break;case"record-audio":AudioRecordingFactory.startRecordingWithCompression().then(_success)["catch"](_error);break;case"stop-record-audio":AudioRecordingFactory.stopRecording().then(function(e){if(void 0!==parsedAction.data.mediaId){var t="$store.media."+parsedAction.data.mediaId+".audio",o=StoreFactory.get(t);void 0===o&&(o=[]),void 0!==parsedAction.data.index&&void 0!==o[parsedAction.data.index]?o[parsedAction.data.index]=e:parsedAction.data.multiple===!0?o.push(e):o[0]=e,StoreFactory.set(t,o),_success(o)}else _error("Could not save audio response.")})["catch"](function(e){_error("Could not stop recording:",e)});break;case"get-media-volume":var Media=Plugin.getSource("Media");Media&&Media.getDeviceVolume?Media.getDeviceVolume(success,fail,parsedAction.data.streamId):_success(0);break;case"change-media-volume":!function(){function e(){_success(parsedAction.data.volumeLevel)}function t(e){_error("Could not set device volume: "+e)}if(void 0!==parsedAction.data.volumeLevel&&parsedAction.data.volumeLevel<=100&&parsedAction.data.volumeLevel>=0){var o=Plugin.getSource("Media");o&&o.setDeviceMediaVolume?o.setDeviceVolume(e,t,parsedAction.data.volumeLevel/100,parsedAction.data.streamId):_success(parsedAction.data.volumeLevel)}else _error("Could not set device volume: Invalid volume.")}();break;case"play-audio":!function(){function e(e){0===e.indexOf("user-assets/")&&(e=AssetFactory.rewriteAssetPaths(e)),AudioPlayer.play(e,{loop:parsedAction.data.loop,loopInterval:parsedAction.data.loopInterval,loopCount:parsedAction.data.loopCount,vibrate:parsedAction.data.vibrate,vibratePattern:parsedAction.data.vibratePattern,vibrateCustomPattern:parsedAction.data.vibrateCustomPattern,forceVibrate:parsedAction.data.forceVibrate,streamId:parsedAction.data.streamId},function(){_success(e)})}if(void 0!==parsedAction.data.model){var t=StoreFactory.get(parsedAction.data.model),o="";angular.isArray(t)&&t.length>0?o=t[t.length-1]:angular.isString(t)&&(o=t),angular.isString(o)&&o.search(/\.m4a$/gim)>-1?e(o):_error("Play Audio action failed, model location was not a playable file.")}else void 0!==parsedAction.data.fileName?angular.isString(parsedAction.data.fileName)&&parsedAction.data.fileName.search(/\.m4a$/gim)>-1?e($rootScope.assetDir+parsedAction.data.fileName):_error("Play Audio action failed, file location was not a playable file."):_error("Play Audio action failed, no valid location specified.")}();break;case"stop-audio":AudioPlayer.stop(),_success($data);break;case"record-video":var limitRecording=parsedAction.data.limitRecording,maxDuration=-1;limitRecording&&!isNaN(parseInt(parsedAction.data.maxDuration))&&(maxDuration=parseInt(parsedAction.data.maxDuration));var lowQuality=parsedAction.data.lowQuality;Camera.recordVideo(maxDuration,lowQuality===!0?0:1).then(function(e){if(void 0!==parsedAction.data.mediaId){var t="$store.media."+parsedAction.data.mediaId+".videos",o=StoreFactory.get(t);void 0===o&&(o=[]),void 0!==parsedAction.data.index&&void 0!==o[parsedAction.data.index]?o[parsedAction.data.index]=e:o[0]=e,StoreFactory.set(t,o),_success(o)}else _error("Could not save video response.")})["catch"](function(e){_error("Could not select video:",e)});break;case"delete-media":if(void 0===parsedAction.data.model)_error("Model location missing.");else{var mediaLocation=StoreFactory.get(parsedAction.data.model);if(void 0===mediaLocation||null===mediaLocation)_error('Model location "'+parsedAction.data.model+'" does not exist.');else if(angular.isArray(mediaLocation))_error("Cannot delete all media from a collection, you must specify a collection index.");else{var arrayRegex=/^(.*?)\[(.*?)]/,representsCollectionValue=arrayRegex.test(parsedAction.data.model);FileSystem.deleteMediaItem(mediaLocation).then(function(){var e=new CustomEvent("media-deleted",{detail:{location:mediaLocation}});if(document.dispatchEvent(e),representsCollectionValue){var t=arrayRegex.exec(parsedAction.data.model)[1],o=arrayRegex.exec(parsedAction.data.model)[2],n=StoreFactory.get(t);n&&o<n.length&&(n.splice(o,1),StoreFactory.set(t,n,!1))}else StoreFactory.set(parsedAction.data.model,void 0,!1);_success($data)})["catch"](function(e){_error(e)})}}break;case"start-beacon-listening":try{IBeaconFactory.startListening(),_success($data)}catch(err){_error(err)}break;case"stop-beacon-listening":try{IBeaconFactory.stopListening(),_success($data)}catch(err){_error(err)}break;case"loop":if(void 0!==parsedAction.data&&void 0!==parsedAction.data.model){var modelLocation=parsedAction.data.model.replace("{{","").replace("}}",""),items=null;if(items="$data"!==modelLocation?StoreFactory.get(modelLocation):$data,null!==items&&items.length>0){var subChain=$q.when();items.every(function(e){return subChain=subChain.then(function(){return triggerEvent(null,originalAction.actions,{$item:e})}),!0}),deferred.resolve(subChain)}}break;case"set-value":void 0!==parsedAction.data&&void 0!==parsedAction.data.key?StoreFactory.set(parsedAction.data.key,parsedAction.data.value,$data).then(function(){_success(parsedAction.data.value)})["catch"](function(e){_error(e)}):_error("Missing data.");break;case"enable-geofence":try{GeofenceFactory.start(parsedAction.data.name).then(function(){_success($data)},function(e){_error(e)})}catch(err){_error(err)}break;case"disable-geofence":try{GeofenceFactory.stop(parsedAction.data.name).then(function(){_success($data)},function(e){_error(e)})}catch(err){_error("Could not stop the geofence:",err)}break;case"debounce":null!==debounce&&clearTimeout(debounce),debounce=setTimeout(function(){debounce=null,_success($data)},parsedAction.data.duration);break;case"search-list":!function(){var e=parsedAction.data.page,t=parsedAction.data.list,o=parsedAction.data.searchWithin;try{if("custom"===o){var n=parsedAction.data.criteria||{};ListFactory.setListSearchState(e,t,"advanced",n)}else{var r=null!==parsedAction.data.term||void 0!==parsedAction.data.term?parsedAction.data.term.toString():"";ListFactory.setListSearchState(e,t,"simple",r)}_success($data)}catch(a){_error(a)}}();break;case"sort-list":!function(){var e=parsedAction.data.page,t=parsedAction.data.list,o=parsedAction.data.property,n=parsedAction.data.direction;try{ListFactory.setListOrderState(e,t,o,n),_success($data)}catch(r){_error(r)}}();break;case"set-list-page":!function(){var e=parsedAction.data.page,t=parsedAction.data.list,o="number"===parsedAction.data.goToPage?parseInt(parsedAction.data.number)||1:parsedAction.data.goToPage;try{ListFactory.setListPaginationState(e,t,o),_success($data)}catch(n){_error(n)}}();break;case"reset-list":!function(){var e=parsedAction.data.page,t=parsedAction.data.list,o=parsedAction.data.resetSearch,n=parsedAction.data.resetOrder,r=parsedAction.data.resetPagination;try{ListFactory.resetListState(e,t,o,n,r),_success($data)}catch(a){_error(a)}}();break;case"log":switch(parsedAction.data.level){case"error":console.error(parsedAction.data.message);break;case"warn":console.warn(parsedAction.data.message);break;case"info":console.info(parsedAction.data.message);break;case"debug":console.debug(parsedAction.data.message)}_success($data);break;case"email-logs":LoggingFactory.emailLogs(parsedAction.data.to,parsedAction.data.subject,parsedAction.data.body,parsedAction.data.includeArchivedLogs),_success($data);break;case"set-log-level":var level=parsedAction.data.level;"fromDataModel"===level&&(level=parsedAction.data.levelFromDataModel),parsedAction.data.applyToApp&&LoggingFactory.setRootLogLevel(level,"app"),parsedAction.data.applyToClient&&LoggingFactory.setRootLogLevel(level,"client"),parsedAction.data.applyToNative&&LoggingFactory.setRootLogLevel(level,"native"),_success($data);break;case"set-buffer-size":isNaN(parseInt(parsedAction.data.bufferFrequency))?_success($data):(LoggingFactory.setBufferFrequency(parseInt(parsedAction.data.bufferFrequency)),_success($data));break;case"configure-logs":var maxFileSize=parsedAction.data.maxFileSizeKilobyte,numberOfFiles=parsedAction.data.numberOfFiles,settingsJsonObject={},hasProperty=!1;void 0!==maxFileSize&&(isNaN(parseInt(maxFileSize))||(settingsJsonObject.maxFileSize=1e3*parseInt(maxFileSize),hasProperty=!0)),void 0!==numberOfFiles&&(isNaN(parseInt(numberOfFiles))||(settingsJsonObject.maxNumberOfFiles=parseInt(numberOfFiles),hasProperty=!0)),hasProperty&&(parsedAction.data.applyToApp&&LoggingFactory.configure(settingsJsonObject,"app"),parsedAction.data.applyToClient&&LoggingFactory.configure(settingsJsonObject,"client"),parsedAction.data.applyToNative&&LoggingFactory.configure(settingsJsonObject,"native")),_success($data);break;case"search-data-grid":!function(){var e=parsedAction.data.page,t=parsedAction.data.dataGrid,o=null!==parsedAction.data.term||void 0!==parsedAction.data.term?parsedAction.data.term.toString():"";try{var n=$injector.get("ctDataGrid");n.setDataGridSearchState(e,t,o),_success($data)}catch(r){_error(r)}}();break;case"sort-data-grid":!function(){var e=parsedAction.data.page,t=parsedAction.data.dataGrid,o=parsedAction.data.column,n=parsedAction.data.direction;try{var r=$injector.get("ctDataGrid");r.setDataGridOrderState(e,t,o,n),_success($data)}catch(a){_error(a)}}();break;case"set-data-grid-page":!function(){var e=parsedAction.data.page,t=parsedAction.data.dataGrid,o="number"===parsedAction.data.goToPage?parseInt(parsedAction.data.number)||1:parsedAction.data.goToPage;try{var n=$injector.get("ctDataGrid");n.setDataGridPaginationState(e,t,o),_success($data)}catch(r){_error(r)}}();break;case"reset-data-grid":!function(){var e=parsedAction.data.page,t=parsedAction.data.dataGrid,o=parsedAction.data.resetSearch,n=parsedAction.data.resetOrder,r=parsedAction.data.resetPagination;try{var a=$injector.get("ctDataGrid");a.resetDataGridState(e,t,o,n,r),_success($data)}catch(i){_error(i)}}();break;case"start-data-grid-edits":!function(){var e=parsedAction.data.page,t=parsedAction.data.dataGrid,o=parsedAction.data.items,n=parsedAction.data.indexes;try{var r=$injector.get("ctDataGrid");r.startEditMode(e,t,o,n),_success($data)}catch(a){_error(a)}}();break;case"finish-data-grid-edits":!function(){var e=parsedAction.data.page,t=parsedAction.data.dataGrid;try{var o=$injector.get("ctDataGrid"),n=o.finishEditMode(e,t);_success(n)}catch(r){_error(r)}}();break;case"enable-logging":LoggingFactory.enableDisableLogging(!0),_success($data);break;case"disable-logging":LoggingFactory.enableDisableLogging(!1),_success($data);break;case"enable-destination":parsedAction.data.applyToApp&&LoggingFactory.enableDisableDestination(!0,"app"),parsedAction.data.applyToClient&&LoggingFactory.enableDisableDestination(!0,"client"),parsedAction.data.applyToNative&&LoggingFactory.enableDisableDestination(!0,"native"),_success($data);break;case"disable-destination":parsedAction.data.applyToApp&&LoggingFactory.enableDisableDestination(!1,"app"),parsedAction.data.applyToClient&&LoggingFactory.enableDisableDestination(!1,"client"),parsedAction.data.applyToNative&&LoggingFactory.enableDisableDestination(!1,"native"),_success($data);break;case"zip-logs":LoggingFactory.zipLogs(parsedAction.data.includeArchivedLogs).then(function(e){$data.zipFileInfo={zipPath:e},_success($data)});break;case"start-vibration":if("none"!==parsedAction.data.pattern){var patternArray;"custom"===parsedAction.data.pattern?""!==parsedAction.data.customPattern&&(patternArray=parsedAction.data.customPattern.split(",")):patternArray=parsedAction.data.pattern.split(","),patternArray&&(parsedAction.data.continuous!==!0&&""===parsedAction.data.patternIterations||VibrateFactory.vibratePattern(patternArray,parseInt(parsedAction.data.patternIterations),parsedAction.data.continuous,parsedAction.data.force))}else parsedAction.data.continuous!==!0&&""===parsedAction.data.duration||VibrateFactory.vibrate(parseInt(parsedAction.data.duration),parsedAction.data.continuous,parsedAction.data.force);_success($data);break;case"stop-vibration":VibrateFactory.stopVibration(),_success($data);break;case"common-log-in":!function(){var e=$injector.get("BaseLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No instance selected");var o=e.getByName(t);if(!o)return void _error("Instance '"+t+"' not found");var n=function(e,t){void 0!==parsedAction.actions&&parsedAction.actions.length>0&&triggerEvent("login-success",parsedAction.actions,e),_success(t)},r=function(e,t){void 0!==parsedAction.actions&&parsedAction.actions.length>0&&triggerEvent("login-failure",parsedAction.actions,e),_success(t)};if(o.on("login-result",function(e){e.success?n(e,$data):r(e,$data)},!0),parsedAction.data.adlogin&&"desktop"!==Platform.getType())return void _error("Active Directory login only available on Windows Desktop",null,!0);var a=Plugin.getSource("sspiclient");return!parsedAction.data.adlogin||a&&void 0!==a.Helper?void(parsedAction.data.adlogin?a.Helper.getUserPrincipalName(function(e){o.login(e,parsedAction.data.adTokenPlaceholder)},_error):o.login(parsedAction.data.username,parsedAction.data.password)):void _error("Active Directory login only available on Windows Desktop",null,!0)}();break;case"common-log-out":!function(){var e=$injector.get("BaseLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No instance selected");var o=e.getByName(t);return o?(o.on("logout-result",function(e){e.success?_success($data):_error(e.exception)},!0),void o.emit("request-logout")):void _error("Instance '"+t+"' not found")}();break;case"common-change-theme":!function(){var e=$injector.get("BaseLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No instance selected");var o=e.getByName(t);return o?void o.emit("request-theme-change",parsedAction.data.themeName):void _error("Instance '"+t+"' not found")}();break;case"common-launch-alert":!function(){var e=$injector.get("BaseLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No instance selected");var o=e.getByName(t);if(!o)return void _error("Instance '"+t+"' not found");var n=parsedAction.data.suspendActionflow===!0,r=function(e,t){t&&triggerEvent("acknowledged",parsedAction.actions,e),n&&_success(e)},a=[];a="question"===parsedAction.data.alertType?[{text:parsedAction.data.noButtonLabel||"No",action:function(){r($data,!1)},type:"primary"},{text:parsedAction.data.yesButtonLabel||"Yes",action:function(){r($data,!0)},type:"primary"}]:[{text:parsedAction.data.buttonLabel||"Okay",action:function(){r($data,!0)},type:"primary"}];var i=parsedAction.data.alertId||parsedAction._auto_id_,s=parsedAction.data.alertPrioirty||3;parsedAction.data.alertId&&o.emit("request-close-alert",parsedAction.data.alertId);var c={id:i,raisedOn:(new Date).getTime(),priority:s,type:parsedAction.data.alertType,title:parsedAction.data.alertTitle,body:parsedAction.data.alertMessage,buttons:a};o.emit("request-raise-alert",c),n||_success($data)}();break;case"il-generate-report":!function(){var e=$injector.get("IncidentLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No Incident instance selected");var o=e.getByName(t);if(!o)return void _error("Incident instance '"+t+"' not found");if(!o.config.reporting||!o.config.reporting.enabled)return void _error("The selected Incident instance does not have reporting enabled");var n=parsedAction.data.reportType||"",r=new Date(parsedAction.data.startDate||""),a=new Date(parsedAction.data.endDate||""),i=parsedAction.data.notify||!1,s=(o.config.reporting.reportTypes||[]).find(function(e){return n===e.id});if(!s)return void _error("The specified report type '"+n+"' does not exist in the selected Incident instance configuration");if(isNaN(r.getTime()))return void _error("The specified start date '"+r+"' is not a valid date string");if(isNaN(a.getTime()))return void _error("The specified start date '"+a+"' is not a valid date string");r.setHours(0,0,0,0),a.setHours(23,59,59,999);var c={type:s.id,startDate:r.getTime(),endDate:a.getTime(),notify:i};o.emit("request-generate-report",c),_success($data)}();break;case"pg-create-new-page":!function(){var e=$injector.get("PagerLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No pager instance selected");var o=e.getByName(t);return o?void o.createNewPage():void _error("pager instance '"+t+"' not found")}();break;case"um-fetch-users":!function(){var e=$injector.get("UserManagementLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No user management instance selected");var o=e.getByName(t);return o?void o.fetchAllUsers().then(_success()):void _error("User Management instance '"+o+"' not found")}();break;case"um-fetch-groups":!function(){var e=$injector.get("UserManagementLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No user management instance selected");var o=e.getByName(t);return o?void o.fetchAllGroups().then(_success()):void _error("User Management instance '"+o+"' not found")}();break;case"um-open-import-modal":!function(){var e=$injector.get("UserManagementLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No user management instance selected");var o=e.getByName(t);return o?void o.openImportModal():void _error("User Management instance '"+o+"' not found")}();break;case"um-open-users-modal":!function(){var e=$injector.get("UserManagementLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No user management instance selected");var o=e.getByName(t);return o?void o.openUsersModal():void _error("User Management instance '"+o+"' not found")}();break;case"um-open-groups-modal":!function(){var e=$injector.get("UserManagementLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No user management instance selected");var o=e.getByName(t);return o?void o.openGroupsModal():void _error("User Management instance '"+o+"' not found")}();break;case"um-open-menu":!function(){var e=$injector.get("UserManagementLayerFactory"),t=parsedAction.data.layer;if(!t)return void _error("No user management instance selected");var o=e.getByName(t);return o?void($data&&$data.target?o.openContainerMenu($data.target):o.openContainerMenu()):void _error("User Management instance '"+o+"' not found")}();break;default:_error("Invalid action type specified.")}return deferred.promise}}var service={triggerEvent:triggerEvent,evalOperations:evalOperations,evalOperation:evalOperation},debounce=null;return void 0===window.cti.utils&&(window.cti.utils={}),window.cti.utils.callAction=function(e,t,o,n){call({type:e,data:t,expressions:o})().then(function(e){void 0!==n&&n(e)})},window.cti.utils.callActionflow=function(e,t){return call({type:"call-actionflow",data:{name:e}},t)()},window.cti.utils.updatePage=function(){$rootScope.$$phase||$rootScope.$apply()},window.cti.utils.triggerStoreChanged=function(){$rootScope.$broadcast("StoreChanged")},window.cti.utils.getPreferencesItem=function(e){if(void 0!==SchemaHelper.schema.metadata){var t=SchemaHelper.schema.metadata;if(void 0!==t[e])return t[e]}},window.cti.utils.destroyAllData=function(){StoreFactory.destroyAllData()},window.cti.utils.destroyPageData=function(e){StoreFactory.destroyPageData(e)},window.cti.utils.stopAllRecording=function(){document.dispatchEvent(new CustomEvent("stop-all-recording"))},void 0===window.cti.utils.logging&&(window.cti.utils.logging={}),window.cti.utils.logging.enableLogging=function(){LoggingFactory.enableDisableLogging(!0)},window.cti.utils.logging.disableLogging=function(){LoggingFactory.enableDisableLogging(!1)},window.cti.utils.logging.enableDestination=function(e){LoggingFactory.enableDisableDestination(!0,e)},window.cti.utils.logging.disableDestination=function(e){LoggingFactory.enableDisableDestination(!1,e)},window.cti.utils.logging.setRootLogLevel=function(e,t){LoggingFactory.setRootLogLevel(e,t)},window.cti.utils.logging.getRootLogLevel=function(e,t){LoggingFactory.getRootLogLevel(e).then(function(e){t(null,e)})["catch"](function(e){t(e)})},window.cti.utils.logging.configure=function(e,t){LoggingFactory.configure(e,t)},window.cti.utils.logging.zipLogFiles=function(e,t){LoggingFactory.zipLogs(e).then(function(e){t(null,e)})["catch"](function(e){t(e)})},window.cti.utils.logging.emailLogs=function(e,t,o,n){LoggingFactory.emailLogs(e,t,o,n)},window.cti.utils.logging.makeFilesPublic=function(e,t){LoggingFactory.makeFilesPublic(e).then(function(e){t(null,e)})["catch"](function(e){t(e)})},window.cti.utils.logging.removePublicFiles=function(){LoggingFactory.removePublicFiles()},window.cti.utils.logging.getLogFilePaths=function(e){LoggingFactory.getLogFilePaths().then(function(t){e(null,t)})["catch"](function(t){e(t)})},window.cti.utils.logging.getArchivedLogFilePaths=function(e){LoggingFactory.getArchivedLogFilePaths().then(function(t){e(null,t)})["catch"](function(t){e(t)})},window.cti.utils.logging.isLoggingEnabled=function(e){LoggingFactory.isLoggingEnabled().then(function(t){e(null,t)})["catch"](function(t){e(t)})},window.cti.utils.logging.isDestinationEnabled=function(e){LoggingFactory.isDestinationEnabled().then(function(t){e(null,t)})["catch"](function(t){e(t)})},service}]),angular.module("app.core").factory("Url",["$http","$log","$q","StoreFactory",function(e,t,o,n){function r(e,t,o,n){this.name=e,this.url=t,this.target=o,this.params=n}return r.prototype={makeRequest:function(e,t){var a=o.defer(),i=this.url,s={url:i};return s.target=void 0!=e?e:this.target,t=r.merge(this.params,t),void 0!=t&&(s.params=n.parse(t)),s.url=n.parseUrl(s.url,s.params),"popup"!==s.target?window.open(s.url,s.target):window.open(s.url,"popup","location=no,height=800,width=600"),a.promise}},r.merge=function(e,t){var o={};return void 0!=e&&(o=e),void 0!=t&&angular.forEach(t,function(e,t){"object"!=typeof e?o[t]=e:(void 0==o[t]&&(o[t]={}),o[t]=r.merge(o[t],e))}),o},r}]),angular.module("app.core").factory("UrlFactory",["$http","$log","StoreFactory","$timeout","$q","Url",function(e,t,o,n,r,a){function i(e){c[e.name]=new a(e.name,e.url,e.target,e.params)}function s(e){var t=r.defer(),o=e.name;return void 0!=c[o]&&c[o].makeRequest(e.target,e.params).then(function(){t.resolve()})["catch"](function(){t.reject()}),t.promise}var c={},l={init:i,makeRequest:s};return l}]),angular.module("app.core").factory("Timer",["$timeout","$interval","ActionFactory",function(e,t,o){function n(e,t,o,n){this.timerFunction=null,this.name=e,this.type=t,this.time=parseInt(o),this.actions=n}return n.prototype={start:function(){var n=this.actions;"delay"==this.type?e(function(){o.triggerEvent(null,n)},this.time):"interval"==this.type&&(this.timerFunction=t(function(){o.triggerEvent(null,n)},this.time))},stop:function(){"interval"==this.type&&null!=this.timerFunction&&t.cancel(this.timerFunction)}},n}]),angular.module("app.core").factory("Variable",["$q","StoreFactory",function(e,t){function o(e,t,o){this.name=e,this.type=t,this.set(o)}return o.prototype={set:function(o){var n=e.defer();if(void 0!=o)if("string"==typeof o&&o.indexOf("{{")>-1&&(o=t.parse(o)),void 0!=this.name){var r=null;switch(this.type){case"date":r=Date.parse(o);break;case"string":r=o;break;case"int":r=parseInt(o);break;case"boolean":r="true"==o||"1"==o}this.value=window.cti.store.variables[this.name]=r,n.resolve(r)}else n.reject("Variable must have a name");else n.resolve();return n.promise}},o}]),angular.module("app.core").factory("VariableFactory",["Variable","$q",function(e,t){function o(t){a[t.name]=new e(t.name,t["variable-type"],t.value)}function n(e,o){var n=t.defer();if(void 0!==a[e]){var i=a[e];i.set(o||r(i)).then(function(e){n.resolve(e)})["catch"](function(e){n.reject(e)})}else n.reject('Cannot find variable "'+e+'"');return n.promise}function r(e){switch(e.type){case"date":return"1970";case"string":return"";case"int":return"0";case"boolean":return"false"}return""}var a={};return{init:o,setVariable:n}}]),angular.module("app.core").factory("Camera",["StoreFactory","$log","$q","Plugin","FileSystem","Platform",function(e,t,o,n,r,a){function i(e,t,n,a,i,s,c){return l(1,e,t,n,a,i,s,c).then(function(e){var t=o.defer(),n=function(e){t.reject(e)};return 0==e.length&&n("image path returned empty"),window.resolveLocalFileSystemURL(e,function(e){var o=new Date,a=o.getTime(),i=a+".jpg";r.getStorage().then(function(o){e.moveTo(o,i,function(e){e.file(function(e){t.resolve(e.localURL)},n)},n)})["catch"](n)},n),t.promise})}function s(){return l(0)}function c(e,n){var i=o.defer(),s=function(e){void 0!==e&&t.error(e),i.reject(e)},c="desktop"===a.getType();if(c)r.selectFile(["video/mp4"]).then(function(e){i.resolve(e)})["catch"](function(){s()});else{var l=function(e){e.length>0&&i.resolve(e[0].fullPath)},u=function(e){i.reject(e)},d={};d.limit=1,d.quality=n,e>0&&(d.duration=e),navigator.device.capture.captureVideo(l,u,d)}return i.promise}function l(e,i,s,c,l,u,d,p){var g=o.defer(),m=function(e){void 0!==e&&t.error(e),g.reject(e)},f="desktop"===a.getType();if(f)r.selectFile(["image/jpeg","image/png","image/gif"]).then(function(e){g.resolve(e)})["catch"](function(){m()});else if(1==e){var C=n.getSource("camera"),h={quality:i||50,cameraDirection:s||0,destinationType:1,sourceType:e,allowEdit:d||!1,encodingType:u||0,saveToPhotoAlbum:p||!1,correctOrientation:!0};c>0&&l>0&&(h.targetWidth=c,h.targetHeight=l),C.getPicture(function(e){g.resolve(e)},m,h)}else{var v=n.getSource("fileimporter");v!==!1?v.importPicture(function(e){g.resolve(e)}):m()}return g.promise}var u={takePhoto:i,selectPhoto:s,recordVideo:c};return u}]),angular.module("app.core").factory("Auth",["$q","Plugin",function(e,t){function o(){var o=e.defer();return a=t.getSource("authentication"),a!==!1?o.resolve():o.reject("No authentication method available."),o.promise}function n(t){var n=e.defer();if(i)return void(i=!1);var r=void 0!==t?t:"Authentication Required";return o().then(function(){a.authenticate(r,"infinity","7OHHxYvRuG1PBlGJi2LXULqMrOKcS64S",function(){n.resolve()},function(){n.reject("Authentication failed")}),i=!0})["catch"](function(){n.resolve()}),n.promise}var r={authenticate:n},a=!1,i=!1;return r}]),angular.module("app.core").factory("Notification",serviceFunc),angular.module("app.core").factory("IBeaconFactory",["$injector","Plugin","$log",function(e,t,o){function n(){if(!A){if(h=t.getSource("locationManager"),h!==!1){try{v=e.get("ActionFactory"),h.requestAlwaysAuthorization(),h.isBluetoothEnabled().then(function(e){e||h.enableBluetooth()}).fail(o.error).done()}catch(n){o.error("Error loading iBeacon plugin",n)}var r=new h.Delegate;r.didExitRegion=function(e){s(e)},r.didRangeBeaconsInRegion=function(e){i(e)},h.setDelegate(r)}else o.error("Beacon plugin has not successfully initialised.");A=!0}}function r(e){return Math.round((255-Math.abs(e))/255*100)}function a(e,t){return e.signalStrength<t.signalStrength?1:e.signalStrength>t.signalStrength?-1:0}function i(e){var t=e.beacons[0];if(void 0!==t){var o=!1;for(var n in L){var i=L[n];if(i.uuid.toLowerCase()==t.uuid.toLowerCase()){var s=t.proximity.toLowerCase().replace("proximity","");i.proximity!=t.proximity&&S.forEach(function(e){void 0!==e.uuid&&void 0!==i.uuid&&e.uuid.toLowerCase()===i.uuid.toLowerCase()&&v.triggerEvent(s,e.actions)}),i.proximity=t.proximity,i.accuracy=t.accuracy,i.signalStrength=r(t.rssi),o=!0}}if(!o)for(var c in S){var l=S[c];l.uuid.toLowerCase()==t.uuid.toLowerCase()&&(L.push({title:l.name,major:l.major,minor:l.minor,uuid:l.uuid,accuracy:t.accuracy,proximity:t.proximity,signalStrength:r(t.rssi)}),v.triggerEvent("in-range",l.actions))}var u=L[0].uuid;L.sort(a);var d=L[0].uuid;if(u.toLowerCase()!=d.toLowerCase()){var p=L[0];for(var g in S){var m=S[g];m.uuid.toLowerCase()==p.uuid.toLowerCase()&&v.triggerEvent("closest",m.actions)}}}}function s(e){var t=e.region.uuid;for(var o in L){var n=L[o];if(n.uuid.toLowerCase()==t.toLowerCase()){L.splice(o,1);for(var r in S){var a=S[r];a.uuid.toLowerCase()==t.toLowerCase()&&v.triggerEvent("out-of-range",a.actions)}}}}function c(e){if(S.push(e),void 0!==window.cordova){var t=f(e);e.rangingEnabled&&(w.push(e),h.startRangingBeaconsInRegion(t).fail(o.error).done(),e.ranging=!0),h.startMonitoringForRegion(t).fail(o.error).done(),e.monitoring=!0}}function l(){angular.forEach(S,function(e){if(e.monitoring){var t=f(e);h.stopMonitoringForRegion(t).fail(o.error).done(),e.monitoring=!1}})}function u(){angular.forEach(w,function(e){if(e.ranging){var t=f(e);h.stopRangingBeaconsInRegion(t).fail(o.error).done()}e.ranging=!1})}function d(){l(),u()}function p(){g(),m()}function g(){angular.forEach(S,function(e){if(!e.monitoring){var t=f(e);h.startMonitoringForRegion(t).fail(o.error).done(),e.monitoring=!0}})}function m(){angular.forEach(w,function(e){if(!e.ranging){var t=f(e);h.startRangingBeaconsInRegion(t).fail(o.error).done()}e.ranging=!0})}function f(e){var t=null;return angular.forEach(y,function(o){if(o.uuid.toLowerCase()==e.uuid.toLowerCase())return void(t=o)}),null===t&&(t=new h.BeaconRegion(e.name,e.uuid,e.major,e.minor),y.push(t)),t}var C={init:n,addBeacon:c,stopMonitoring:l,stopRanging:u,startMonitoring:g,startRanging:m,startListening:p,stopListening:d},h=!1,v=null,S=[],w=[],y=[],L=[],A=!1;return C}]),angular.module("app.core").factory("GeofenceFactory",["$rootScope","$q","$injector","Plugin","StoreFactory","$log",function(e,t,o,n,r,a){function i(e){return e.hasOwnProperty("name")&&e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")&&e.hasOwnProperty("radius")}function s(a,i){if(B)return t.when();R=a,U=i,M=P===!0?I():n.getSource("geofence");var s=t.defer();return M===!1?s.reject("Unable to initialise 'geofence' plugin"):(V=o.get("ActionFactory"),k("Retrieving saved geofence state:",r.get(D)),k("Initializing 'geofence' plugin..."),M.initialize().then(function(){p(s)})["catch"](function(e){g(e)})),e.$on("StoreChanged",w),B=!0,s.promise}function c(e){if(!G){H.push(e);var o="Plugin not ready, adding geofence to queue:";return k(o,e),t.reject(o)}var n=t.defer();if(S(e),e.fullyQualifiedName=y(e.name),void 0===e.listening){var r=T(e.name);e.listening=void 0===r||r.listening}if(e.listening===!1)k("Skipping geofence '"+e.name+"', was previously stopped"),$(e),n.resolve();else{var a=A(e);"string"==typeof a?n.reject(a):M.addOrUpdate(a).then(function(){k("Registered geofence '"+a.id+"' ("+a.latitude+", "+a.longitude+" @ "+a.radius+"m)"),$(e),E(),n.resolve()})["catch"](function(t){var o="Unable to register geofence '"+e.name+"'";F(o,t),n.reject(o)})}return n.promise}function l(e){if(!G)return t.reject("Geofence plugin not initialised");var o=t.defer(),n=y(e.name),r=x(n);if(null!==r){var a=angular.extend({},r,e),i=A(a);a.listening===!1?($(a),E(),o.resolve()):M.remove(n).then(function(){return M.addOrUpdate(i)}).then(function(){k("Updated geofence '"+i.id+"' ("+i.latitude+", "+i.longitude+" @ "+i.radius+"m)"),$(a),E(),o.resolve()})["catch"](function(e){var t="Unable to update geofence '"+a.name+"'";F(t,e),o.reject(t)})}else k("Unable to find and update geofence '"+e.name+"'"),o.resolve();return o.promise}function u(e){if(!G)return t.reject("Geofence plugin not initialised");if("|all|"===e)return h();var o=t.defer(),n=y(e),r=x(n);return null!==r?r.listening===!1?(r.listening=!0,c(r).then(function(){o.resolve()})):(k("Geofence '"+e+"' already registered"),
o.resolve()):o.reject("Unable to find and start geofence '"+e+"'"),o.promise}function d(e){if(!G)return t.reject("Geofence plugin not initialised");if("|all|"===e)return v();var o=t.defer(),n=y(e),r=x(n);return null!==r?M.remove(r.fullyQualifiedName).then(function(){k("Geofence '"+e+"' stopped"),r.listening=!1,$(r),E(),o.resolve()})["catch"](function(t){var n="Unable to stop geofence '"+e+"'";t(n,t),o.reject(n)}):o.reject("Unable to find and stop geofence '"+e+"'"),o.promise}function p(e){G=!0,M.onTransitionReceived=m,k("Initialized 'geofence' plugin"),M.removeAll().then(function(){k("Existing geofence registrations purged"),H.length>0&&(k("Registering "+H.length+" queued geofences..."),angular.forEach(H,function(e){c(e)}),H=[]),e.resolve()})}function g(e){e("Geofence plugin not initialised",e)}function m(e){angular.forEach(e,function(e){var t=x(e.id);if(null!==t&&t.listening===!0)switch(e.transitionType){case N:f(t);break;case O:C(t)}})}function f(e){null!==e&&e.listening===!0&&e.actions.length&&(k("Triggering 'enter' event for '"+e.name+"'"),V.triggerEvent("enter",e.actions))}function C(e){null!==e&&e.listening===!0&&e.actions.length&&(k("Triggering 'exit' event for '"+e.name+"'"),V.triggerEvent("exit",e.actions))}function h(){var e=t.defer(),o=[];return angular.forEach(z,function(e){e.listening=!0,o.push(c(e))}),t.all(o).then(function(){k("All geofences registered"),e.resolve()}),e.promise}function v(){var e=t.defer();return M.removeAll().then(function(){k("All geofences stopped"),angular.forEach(z,function(e){e.listening=!1,$(e)}),E(),e.resolve()})["catch"](function(t){var o="Unable to stop all geofences";t(o,t),e.reject(o)}),e.promise}function S(e){var t=[];angular.forEach(["lat","lng","radius","notificationText"],function(o){0===(""+e[o]).trim().indexOf("{{")&&t.push(o)}),t.length>0&&W.indexOf(e.name)===-1&&W.push(e.name)}function w(){clearTimeout(q),q=setTimeout(function(){angular.forEach(W,function(e){var t=T(e),o=y(e),n=x(o);if(t&&n){var r=t.lat,a=t.lng,i=t.radius,s=t.notificationText,c=L(n.lat,!0),u=L(n.lng,!0),d=L(n.radius,!0),p=L(n.notificationText,!1);c===r&&u===a&&d===i&&p===s||l(n)}})},100)}function y(e){return U+"__"+e}function L(e,t){if(void 0===e||null===e)return null;if(angular.isString(e)&&0===e.trim().indexOf("{{")){var o=r.parse(e);return o?t?parseFloat(o):o:null}return t?parseFloat(e):e}function A(e){var t=b(e,"enter")?N:0,o=b(e,"exit")?O:0,n=t|o,r=[N,O,N|O];if(r.indexOf(n)===-1){var a="Geofence '"+e.name+"' being ignored - has no transition actions defined";return k(a),a}var i=L(e.lat,!0)||0,s=L(e.lng,!0)||0,c=L(e.radius,!0)||0,l=L(e.notificationText,!1)||"You have passed a geofence boundary";return{id:e.fullyQualifiedName,latitude:i,longitude:s,radius:c,transitionType:n,notification:{id:1,title:R,text:l,openAppOnClick:!0}}}function b(e,t){return!(!e.actions||!e.actions.length)&&e.actions.some(function(e){return(e.event||"").toLowerCase()===t.toLowerCase()})}function j(e){for(var t=0;t<z.length;t++){var o=z[t];if(o.fullyQualifiedName===e)return t}return-1}function x(e){var t=j(e);return t!==-1?z[t]:null}function $(e){var t=j(e.fullyQualifiedName);t===-1?z.push(e):z[t]=e}function E(){var e={};angular.forEach(z,function(t){e[t.name]={listening:t.listening,lat:L(t.lat),lng:L(t.lng),radius:L(t.radius),notificationText:L(t.notificationText)}}),r.set(D,e),k("Geofence state saved:",e)}function T(e){return angular.copy(r.get(D+"."+e))}function k(){if(_===!0){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[geofence.fct.js] "+e[0]),a.log.apply(a,e)}}function F(){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[geofence.fct.js] "+e[0]),a.error.apply(a,e)}function I(){function e(){var e=t.defer();return setTimeout(function(){e.resolve()},o),e.promise}a.info("*** USING MOCK GEOFENCE PLUGIN: Turn this off in geofence.fct.js if you expect to use the real plugin ***");var o=500;return{initialize:function(){return e()},addOrUpdate:function(){return e()},remove:function(){return e()},removeAll:function(){return e()},onTransitionReceived:function(){}}}var _=!1,P=!1,D="geofences",N=1,O=2,M=null,R="",U="",q=null,B=!1,V=null,G=!1,H=[],z=[],W=[];return{isValidGeofenceObject:i,init:s,register:c,start:u,stop:d}}]),angular.module("app.core").factory("Xmpp",["LoadingStatus","$log","StoreFactory","$injector","$rootScope","$q","Camera","Plugin","FileSystem","$sce","MimeTypes","$filter","SchemaHelper",function(e,t,o,n,r,a,i,s,c,l,u,d,p){function g(e,i,s,l,u,d,g,m,f,C,h,v){var S=n.get("ActionFactory"),w=this;if(w.id=e,w.endpoint=i,w.uploadJid=l,w.readReceipts=u,w.stayConnected=d,w.multicastJid=g,w.pingTime=m,w.pingTo=f,w.sendtimeout=C,w.enableOutbox=h,w.reconnectTime=v,w.stayConnected===!0&&w.reconnect(),w.actions=s,void 0!==w.id&&void 0!==w.endpoint){if(void 0===window.cti.store.xmpp[this.id]&&(window.cti.store.xmpp[this.id]={connection_status:null,user_status:null,history:{},contacts:[],groups:[]}),w.cleanQueue(),window.cti.api.xmpp_connection=new window.Strophe.Connection(w.endpoint),window.cti.api.xmpp_connection.reset(),w.sendtimeout&&(window.cti.api.xmpp_connection.outbox.sendTimeoutDuration=w.sendtimeout),w.enableOutbox===!0){window.cti.api.xmpp_connection.outbox.addEventListener(window.cti.api.xmpp_connection.outbox.eventTypes.MESSAGE_QUEUED,function(e){S.triggerEvent("message-queued",w.actions,{$message:e})}),window.cti.api.xmpp_connection.outbox.addEventListener(window.cti.api.xmpp_connection.outbox.eventTypes.MESSAGE_RESEND_SUCCESS,function(e){S.triggerEvent("message-resend-success",w.actions,{$message:e})}),window.cti.api.xmpp_connection.outbox.addEventListener(window.cti.api.xmpp_connection.outbox.eventTypes.MESSAGE_RESEND_FAILED,function(e){S.triggerEvent("message-resend-failed",w.actions,{$message:e})}),window.cti.api.xmpp_connection.outbox.addEventListener(window.cti.api.xmpp_connection.outbox.eventTypes.QUEUE_CLEANED,function(e){S.triggerEvent("queue-cleaned",w.actions,{$result:e})}),window.cti.api.xmpp_connection.outbox.addEventListener(window.cti.api.xmpp_connection.outbox.eventTypes.QUEUE_PROCESSED,function(e){S.triggerEvent("queue-processed",w.actions,{$result:e})});var y=p.getSchemaSettingByName("encryption");y===!0?(t.debug("[xmpp.fct.js] ("+w.id+") GETTING KEY TO SECURE OUTBOX DB..."),o.getEncryptionKey(p.getAppName()).then(function(e){t.debug("[xmpp.fct.js] ("+w.id+") ENABLING XMPP OUTBOX..."),window.cti.api.xmpp_connection.outbox.enable(w.id,e)})):(t.debug("[xmpp.fct.js] ("+w.id+") ENABLING XMPP OUTBOX..."),window.cti.api.xmpp_connection.outbox.enable(w.id))}w.setConnectionStatus(null),w.onMessage=function(e){t.debug("[xmpp.fct.js] ("+w.id+") MESSAGE RECEIVED:",e);try{w.enablePing();var n=e.getAttribute("type"),a=e.getAttribute("id"),i=w.getBareJid(e.getAttribute("to")),s=w.getBareJid(e.getAttribute("from"));switch(n){case"chat":var l=e.getElementsByTagName("body")[0],u=e.getElementsByTagName("url")[0];if(void 0!==l)var d=window.Strophe.getText(l);var p=e.getElementsByTagName("metadata")[0];if(void 0!==p){var g={},m=p.childNodes;if(void 0!==m&&m.length>0)for(var f=0;f<m.length;f++){var C=m[f];g[C.tagName]=window.Strophe.getText(C)}}if(void 0!==l||void 0!==u){var h=w.createMessageObject(i,s,d,null,a,null,g),v=e.getElementsByTagName("markable")[0];if(void 0!==v&&w.readReceipts!==!1&&w.sendMarker(h.id,w.MESSAGE_STATUS.RECEIVED),void 0!==u){h.media.remote=encodeURI(window.Strophe.getText(u)),h.media.status=w.MEDIA_STATUS.DOWNLOADING,w.saveAndUpdate();var y=c.getFileNameFromPath(h.media.remote);c.download(h.media.remote,y).then(function(e){h.media.local=e.filePath,h.media.type=e.mimeType,h.media.status=w.MEDIA_STATUS.DOWNLOADED,w.saveAndUpdate()})["catch"](function(e){t.error(e)})}void 0!==w.actions&&w.actions.length>0&&S.triggerEvent("message-received",w.actions,{$message:h}),w.saveAndUpdate()}break;case"error":t.error("XMPP ERROR!",e);var L=e.getAttribute("id");if(void 0!==L){var A=w.getMessageFromHistory(s,L);null!==A&&(A.sent=!1,S.triggerEvent("error",w.actions,{$message:A}),o.save().then(function(){r.$emit("StoreHasChanged")}))}break;default:var b=e.getElementsByTagName("received")[0];if(void 0!==b&&w.readReceipts!==!1){var j=b.getAttribute("id");if(null!==j){var x=w.getMessageFromHistory(s,j);null!==x&&(x.status=w.MESSAGE_STATUS.RECEIVED,w.saveAndUpdate())}}var $=e.getElementsByTagName("displayed")[0];if(void 0!==$&&w.readReceipts!==!1){var E=$.getAttribute("id");if(null!==E){var T=w.getMessageFromHistory(s,E);null!==T&&(T.status=w.MESSAGE_STATUS.DISPLAYED,w.saveAndUpdate())}}var k=e.getElementsByTagName("acknowledged")[0];if(void 0!==k&&w.readReceipts!==!1){var F=k.getAttribute("id");if(null!==F){var I=w.getMessageFromHistory(s,F);null!==I&&(I.status=w.MESSAGE_STATUS.ACKNOWLEDGED,w.saveAndUpdate())}}}}catch(_){t.error("XMPP Error:",_)}return!0},w.updateMessageStatus=function(e){var t=!1;w.queue.forEach(function(o){if(o===e){var n=w.getMessageFromAllHistory(e);null!==n&&(n.status=w.MESSAGE_STATUS.FAILED,S.triggerEvent("send-failed",w.actions,{$message:n}),t=!0)}}),t===!0&&w.saveAndUpdate()},w.send=function(e,o){var n=a.defer();if(window.cti.api.xmpp_connection.connected===!0||window.cti.api.xmpp_connection.outbox.enabled===!0){w.enablePing();var r=null;if(r=void 0!==e.id?w.getMessageFromAllHistory(e.id):w.createMessageObject(e.to,window.cti.api.xmpp_connection.authzid,e.message,null,null,e.ttl,e.metadata,o),null!==r){var i=function(){var e=w.createMessageXml(r.id);window.cti.api.xmpp_connection.sendMessage(e,function(e){null===e&&[w.MESSAGE_STATUS.RECEIVED,w.MESSAGE_STATUS.ACKNOWLEDGED,w.MESSAGE_STATUS.DISPLAYED].indexOf(r.status)===-1&&(r.sent=!0,r.status=w.MESSAGE_STATUS.SENT),w.saveAndUpdate(),n.resolve()},function(e){r.sent=!1,r.status=w.MESSAGE_STATUS.FAILED,S.triggerEvent("send-failed",w.actions,{$message:r,$error:e}),w.saveAndUpdate(),n.reject(e)})},s=e["file-path"];if(void 0!==s&&angular.isString(s)&&s.length>0)if(void 0!==w.uploadJid){var l=c.getFileNameFromPath(s);c.getFile(l).then(function(e){r.media.local=e.filePath,r.media.type=e.mimeType,r.media.status=w.MEDIA_STATUS.UPLOADING,w.saveAndUpdate(),window.cti.api.xmpp_connection.httpFileUpload.slot(w.uploadJid,e.name,e.size,r.media.type,function(o){if(null!==o.put){var a=s,l=encodeURI(o.put),u={httpMethod:"PUT",fileName:e.name,headers:{"Content-Type":r.media.type}};t.debug("[xmpp.fct.js] uploading file '"+a+"' to '"+l+"' with options",u),c.upload(a,l,u).then(function(){r.media.remote=o.get,r.media.status=w.MEDIA_STATUS.UPLOADED,i()})["catch"](function(e){n.reject(e)})}else n.reject("No upload slot was provided.")},function(e){n.reject(e)})})["catch"](function(e){n.reject(e)})}else n.reject("Upload jid has not been configured.");else i()}else n.reject("Unable to send message.")}else n.reject("No connection available.");return n.promise},w.sendToGroup=function(e){var t=a.defer();if(e.groups)if(void 0===w.multicastJid)t.reject('Multicast JID is required for group messages, please configure this on the "'+w.id+'" XMPP instance.');else{e.to=w.multicastJid;var n=void 0!==e.statuses?e.statuses:[],r=void 0!==e.groups?e.groups:[],i=o.get("xmpp."+w.id+".contacts"),s=i.filter(function(e){return void 0!==e.groups&&e.groups.filter(function(e){return r.indexOf(e)>-1}).length>0&&n.indexOf(e.status)===-1}),c=s.map(function(e){return e.username});w.send(e,c).then(function(){t.resolve()})["catch"](function(e){t.reject(e)})}else t.reject("No group(s) specified for group message.");return t.promise},w.markRead=function(e){var o=a.defer();if(window.cti.api.xmpp_connection.connected===!0)if(void 0!==e.id)t.debug('Marking message with ID "'+e.id+'" as displayed.'),w.sendMarker(e.id,"displayed"),o.resolve(!0);else if(void 0!==e.recipient)if(void 0!==window.cti.store.xmpp[w.id].history&&void 0!==window.cti.store.xmpp[w.id].history[e.recipient]){var n=angular.copy(window.cti.store.xmpp[w.id].history[e.recipient].messages);void 0!==n&&n.length>0?(n=n.reverse(),n.every(function(e){return e.status!==w.MESSAGE_STATUS.DISPLAYED&&e.status!==w.MESSAGE_STATUS.ACKNOWLEDGED&&(e.from!==window.cti.api.xmpp_connection.authzid&&void 0!==e.id&&w.sendMarker(e.id,w.MESSAGE_STATUS.DISPLAYED),!0)}),o.resolve(!0)):o.resolve(!0)}else o.resolve(!0);else o.reject("No message ID provided.");else o.resolve();return o.promise},w.onIq=function(e){t.debug("[xmpp.fct.js] ("+w.id+") IQ RECEIVED:",e);var o=e.getAttribute("type");switch(o){case"set":var n=e.getElementsByTagName("query")[0];if(void 0!==n){var r=n.getAttribute("xmlns");switch(r){case"jabber:iq:roster":w.processContacts(n.childNodes),S.triggerEvent("contacts-update",w.actions)}}}return!0},w.onPresence=function(e){t.debug("[xmpp.fct.js] ("+w.id+") PRESENCE RECEIVED:",e),w.enablePing();var n=e.getAttribute("type"),r="unavailable"===n?"offline":"chat",a="unavailable"===n?"Offline":"Available",i=e.getElementsByTagName("show")[0];void 0!==i&&(r=window.Strophe.getText(i));var s=e.getElementsByTagName("status")[0];void 0!==s&&(a=window.Strophe.getText(s));var c=w.getBareJid(e.getAttribute("from")),l=o.get("xmpp."+w.id+".contacts"),u=!1;if(l.length>0){var d=l.filter(function(e){return e.username===c})[0];void 0!==d&&d.status!==r&&(d.status=r,d.friendly_status=a,S.triggerEvent("status-update",w.actions,{$contact:d}),u=!0)}return u&&w.saveAndUpdate(),!0},w.login=function(e,n){if(window.cti.api.xmpp_connection.connected===!0)return a.when();var r=a.defer();return window.cti.api.xmpp_connection.reset(),w.setLastAuthStatus("pending"),void 0!==e&&void 0!==n?(angular.isNumber(n)&&(n=n.toString()),window.cti.api.xmpp_connection.connect(e,n,function(a){var i=w.statusCodeToTxt(a);if(w.finished!==!0||i===w.CONNECTION_STATUS.CONNECTING)switch(w.finished=!1,w.setConnectionStatus(i),S.triggerEvent(i,w.actions),t.debug("[xmpp.fct.js] ("+w.id+") STATUS CHANGE:",i),i){case w.CONNECTION_STATUS.CONNFAIL:case w.CONNECTION_STATUS.ERROR:w.stayConnected===!0&&w.loggedOut!==!0?w.startReconnection():(window.cti.api.xmpp_connection.disconnect(),w.disablePing());break;case w.CONNECTION_STATUS.AUTHFAIL:w.setLastAuthStatus("failed"),window.cti.api.xmpp_connection.disconnect(),w.disablePing();break;case w.CONNECTION_STATUS.DISCONNECTED:w.stayConnected===!0&&w.loggedOut!==!0&&w.startReconnection(),w.finished=!0,w.disablePing(),r.reject("disconnected");break;case w.CONNECTION_STATUS.CONNECTED:w.loggedOut=!1,w.setLastAuthStatus("success"),window.cti.api.xmpp_connection.addHandler(w.onMessage,null,"message",null,null,null),window.cti.api.xmpp_connection.addHandler(w.onIq,null,"iq",null,null,null),window.cti.api.xmpp_connection.addHandler(w.onPresence,null,"presence",null,null,null),window.cti.api.xmpp_connection.streamManagement.requestResponseInterval=0,window.cti.api.xmpp_connection.streamManagement.enable(function(){var a=window.$iq({from:window.cti.api.xmpp_connection.jid,id:window.cti.api.xmpp_connection.getUniqueId(),type:"get"});a.c("query",{xmlns:"jabber:iq:roster"}),o.set("xmpp."+w.id+".contacts",[]),window.cti.api.xmpp_connection.sendIQ(a,function(a){t.debug("[xmpp.fct.js] ("+w.id+") GOT CONTACTS:",a),w.processContacts(a.querySelector("query").childNodes);var i=o.get("xmpp."+w.id+".user_status")||w.USER_STATUS.CHAT,s=function(){S.triggerEvent("connected",w.actions),w.enablePing(),w.enableOutbox===!0&&window.cti.api.xmpp_connection.outbox.processQueue(function(e){t.debug("[xmpp.fct.js] ("+w.id+") PROCESSED OUTBOX QUEUE:",e)},function(e){t.error("[xmpp.fct.js] ("+w.id+") ERROR PROCESSING OUTBOX QUEUE:",e)}),r.resolve()};w.setStatus(i).then(function(){w.stayConnected===!0?w.getSecureDb().then(function(o){t.debug("[xmpp.fct.js] ("+w.id+") Storing credentials for auto-login."),o.put({_id:w.DB.ID+"_data",_rev:w.DB.REVISION,data:e+":"+n}).then(function(e){w.DB.REVISION=e.rev,s()})["catch"](function(e){t.error(e),r.reject(e)})})["catch"](function(e){t.error(e),r.reject(e)}):s()})["catch"](function(e){r.reject(e)})})},function(e){r.reject(e)})}})):(w.setLastAuthStatus("failed"),window.cti.api.xmpp_connection.disconnect()),r.promise},w.logout=function(){var e=a.defer();return w.loggedOut=!0,w.stayConnected===!0?w.getSecureDb().then(function(t){t.destroy().then(function(){w.DB.REVISION=null,window.cti.api.xmpp_connection.disconnect(),e.resolve()})["catch"](function(t){e.reject(t)})})["catch"](function(t){e.reject(t)}):(window.cti.api.xmpp_connection.disconnect(),e.resolve()),e.promise},w.pingTimeout=null,w.disablePing=function(){null!==w.pingTimeout&&(clearTimeout(w.pingTimeout),w.pingTimeout=null)},w.enablePing=function(){w.disablePing(),null!==window.cti.api.xmpp_connection&&window.cti.api.xmpp_connection.connected===!0&&(w.pingTimeout=setTimeout(function(){w.ping()},w.pingTime||5e3))},w.ping=function(){var e=window.$iq({from:window.cti.api.xmpp_connection.jid,id:window.cti.api.xmpp_connection.getUniqueId(),type:"get"});e.c("ping",{xmlns:"urn:xmpp:ping"}),window.cti.api.xmpp_connection.sendIQ(e,function(){w.enablePing()},function(){w.disablePing(),t.debug("[xmpp.fct.js] ("+w.id+") Ping failed..."),t.debug("[xmpp.fct.js] ("+w.id+") No response from ping, disconnecting."),window.cti.api.xmpp_connection.disconnect(),w.stayConnected===!0&&(t.debug("[xmpp.fct.js] ("+w.id+") Stay connected enabled, reconnecting..."),w.startReconnection())},w.pingTo||5e3)}}else t.error("Missing data for XMPP instance.");r.$on("device-resume",function(){w.stayConnected!==!0||null!==window.cti.api.xmpp_connection&&window.cti.api.xmpp_connection.connected!==!1||w.reconnect()})}return g.prototype.calcGroups=function(){var e=o.get("xmpp."+this.id+".contacts"),t=[];e.forEach(function(e){void 0!==e.groups&&e.groups.forEach(function(e){var o=d("filter")(t,{name:e},!0);0===o.length?t.push({name:e,count:1}):t=t.map(function(e){return e.count++,e})})}),o.set("xmpp."+this.id+".groups",t)},g.prototype.processContacts=function(e){if(void 0!==e&&e.length>0){for(var t=o.get("xmpp."+this.id+".contacts")||[],n=0;n<e.length;n++){var r=e[n],a=r.getAttribute("jid");if("remove"===r.getAttribute("subscription"))t=t.filter(function(e){return e.username!==a});else{var i=[],s=r.querySelectorAll("group");if(s.length>0)for(var c=0;c<s.length;c++){var l=s[c];i.push(window.Strophe.getText(l))}var u={name:r.getAttribute("name"),username:a,groups:i,status:null,friendly_status:null},d=t.filter(function(e){return e.username===a})[0];void 0===d?t.push(u):d=u}}o.set("xmpp."+this.id+".contacts",t),this.calcGroups()}},g.prototype.getSecureDb=function(){var e=a.defer();this.DB.ID=o.getId()+"_"+this.id+"_xmpp_db";var t=new PouchDB(this.DB.ID,{revs_limit:10});return o.getEncryptionKey(this.DB.ID).then(function(o){return t.crypto({key:o}),e.resolve(t)})["catch"](function(t){e.reject(t)}),e.promise},g.prototype.reconnectInterval=null,g.prototype.startReconnection=function(){var e=this;null===e.reconnectInterval&&(e.reconnectInterval=setInterval(function(){window.cti.api.xmpp_connection.connected===!1?(t.debug("[xmpp.fct.js] ("+e.id+") Trying to reconnect..."),e.reconnect().then(function(){t.debug("[xmpp.fct.js] ("+e.id+") Successfully reconnected!"),clearInterval(e.reconnectInterval),e.reconnectInterval=null})):null!==e.reconnectInterval&&(clearInterval(e.reconnectInterval),e.reconnectInterval=null)},e.reconnectTime||5e3))},g.prototype.reconnect=function(){var e=a.defer(),o=this;return this.getSecureDb().then(function(r){r.get(o.DB.ID+"_data").then(function(r){o.DB.REVISION=r._rev;var a=r.data.split(":");if(void 0!==a[0]&&void 0!==a[1]){var i=a[0],s=a[1];t.debug("[xmpp.fct.js] ("+o.id+') Auto-Logging in as "'+i+'".'),o.login(i,s).then(function(){var t=n.get("ActionFactory");t.triggerEvent("reconnected",o.actions),e.resolve()})["catch"](function(t){e.reject(t)})}else e.reject("Could not extract the saved credentials from the encrypted database.")})["catch"](function(){t.debug("[xmpp.fct.js] ("+o.id+") Stored credentials could not be found to auto-login."),e.resolve()})})["catch"](function(t){e.reject(t)}),e.promise},g.prototype.DB={ID:null,KEY:"2%^%123$^#_##}{P21$@#Dd}23fs#!@|#213@™4",REVISION:null},g.prototype.USER_STATUS={AWAY:"away",CHAT:"chat",DO_NOT_DISTURB:"dnd",EXTENDED_AWAY:"xa"},g.prototype.MESSAGE_STATUS={SENDING:"sending",SENT:"sent",FAILED:"failed",RECEIVED:"received",DISPLAYED:"displayed",ACKNOWLEDGED:"acknowledged"},g.prototype.MEDIA_STATUS={DOWNLOADING:"downloading",DOWNLOADED:"downloaded",FAILED:"failed",UPLOADING:"uploading",UPLOADED:"uploaded"},g.prototype.CONNECTION_STATUS={ERROR:"error",CONNECTING:"connecting",CONNFAIL:"connection-failed",AUTHENTICATING:"authenticating",AUTHFAIL:"authentication-failed",CONNECTED:"connected",DISCONNECTED:"disconnected",DISCONNECTING:"disconnecting",ATTACHED:"attached"},g.prototype.setStatus=function(e){var t=a.defer(),n=null;switch(e){case this.USER_STATUS.AWAY:n="Away";break;case this.USER_STATUS.CHAT:n="Available";break;case this.USER_STATUS.DO_NOT_DISTURB:n="Do Not Disturb";break;case this.USER_STATUS.EXTENDED_AWAY:n="Extended Away"}if(null!==n){var r=window.$pres({from:window.cti.api.xmpp_connection.jid}).c("show",null,e).c("status",null,n);o.set("xmpp."+this.id+".user_status",e),window.cti.api.xmpp_connection.send(r.tree()),t.resolve()}else t.reject("Invalid status provided.");return t.promise},g.prototype.setConnectionStatus=function(e){o.set("xmpp."+this.id+".connection_status",e)},g.prototype.setLastAuthStatus=function(e){o.set("xmpp."+this.id+".last_auth_status",e)},g.prototype.statusCodeToTxt=function(e){var t=null;switch(e){case window.Strophe.Status.ERROR:t=this.CONNECTION_STATUS.ERROR;break;case window.Strophe.Status.CONNECTING:t=this.CONNECTION_STATUS.CONNECTING;break;case window.Strophe.Status.CONNFAIL:t=this.CONNECTION_STATUS.CONNFAIL;break;case window.Strophe.Status.AUTHENTICATING:t=this.CONNECTION_STATUS.AUTHENTICATING;break;case window.Strophe.Status.AUTHFAIL:t=this.CONNECTION_STATUS.AUTHFAIL;break;case window.Strophe.Status.CONNECTED:t=this.CONNECTION_STATUS.CONNECTED;break;case window.Strophe.Status.DISCONNECTED:t=this.CONNECTION_STATUS.DISCONNECTED;break;case window.Strophe.Status.DISCONNECTING:t=this.CONNECTION_STATUS.DISCONNECTING;break;case window.Strophe.Status.ATTACHED:t=this.CONNECTION_STATUS.ATTACHED}return t},g.prototype.createMessageXml=function(e){var t=this.getMessageFromAllHistory(e),o=window.$msg({to:t.to,from:t.from,id:e,type:"chat"}).tree();if(null!==t.addresses){var n=new window.Strophe.Builder("addresses",{xmlns:"http://jabber.org/protocol/address"}).tree();t.addresses.forEach(function(e){var t=new window.Strophe.Builder("address",{type:"to",jid:e}).tree();n.appendChild(t)}),o.appendChild(n)}if(void 0!==t.body){var r=new window.Strophe.Builder("body").t(t.body).tree();o.appendChild(r)}if(null!==t.media.remote){var a=new window.Strophe.Builder("x",{xmlns:"jabber:x:oob"}).tree(),i=new window.Strophe.Builder("url").t(t.media.remote).tree();a.appendChild(i),o.appendChild(a)}if(this.readReceipts!==!1){var s=new window.Strophe.Builder("markable",{xmlns:"urn:xmpp:chat-markers:0"}).tree();o.appendChild(s)}if(null!==t.ttl){var c=new window.Strophe.Builder("x",{xmlns:"jabber:x:expire",seconds:t.ttl}).tree();o.appendChild(c)}if(null!==t.metadata&&Object.keys(t.metadata).length>0){var l=new window.Strophe.Builder("metadata",{xmlns:"urn:commontime:mdesign:metadata"}).tree();for(var u in t.metadata)if(void 0!==t.metadata[u]){var d=new window.Strophe.Builder(u).t(t.metadata[u]).tree();l.appendChild(d)}o.appendChild(l)}return o},g.prototype.sendMarker=function(e,t){var o=this.getMessageFromAllHistory(e),n=window.$msg({to:o.from,from:o.to,id:window.cti.api.xmpp_connection.getUniqueId(),type:"marker"});n.c(t,{xmlns:"urn:xmpp:chat-markers:0",id:e}),o.status=t,this.calcReadCount(o.from),window.cti.api.xmpp_connection.send(n.tree())},g.prototype.calcReadCount=function(e){if(void 0!==window.cti.store.xmpp[this.id]&&void 0!==window.cti.store.xmpp[this.id].history&&void 0!==window.cti.store.xmpp[this.id].history[e]){var t=window.cti.store.xmpp[this.id].history[e].messages,o=0,n=0,r=this;t.forEach(function(t){t.from==e&&(t.status===r.MESSAGE_STATUS.DISPLAYED||t.status===r.MESSAGE_STATUS.ACKNOWLEDGED?o+=1:n+=1)}),window.cti.store.xmpp[this.id].history[e].read=o,window.cti.store.xmpp[this.id].history[e].unread=n,this.saveAndUpdate()}},g.prototype.createMessageObject=function(e,o,n,r,a,i,s,c){var l=o===window.cti.api.xmpp_connection.authzid?e:o;if(void 0!==l){var u={id:void 0!==a&&null!==a?a:window.cti.api.xmpp_connection.getUniqueId(),from:o,ttl:void 0!==i?i:null,to:e,body:n,sent:!1,status:o===window.cti.api.xmpp_connection.authzid?this.MESSAGE_STATUS.SENDING:null,ts:(new Date).getTime(),media:{local:null,remote:null,status:null},metadata:void 0!==s&&null!==s?s:null,addresses:void 0!==c?c:null};return void 0!==r&&null!==r&&(void 0!==r.local&&(u.media.local=r.local),void 0!==r.remote&&(u.media.remote=r.remote),void 0!==r.status&&(u.media.status=r.status)),this.addHistory(l,u),this.getMessageFromHistory(l,u.id)}return t.error("Recipient required for a message."),null},g.prototype.getMessageFromHistory=function(e,t){var o=null;if(void 0!==window.cti.store.xmpp[this.id].history[e]){var n=window.cti.store.xmpp[this.id].history[e].messages;void 0!==n&&n.length>0&&n.forEach(function(e){e.id==t&&(o=e)})}return o},g.prototype.getMessageFromAllHistory=function(e){var t=window.cti.store.xmpp[this.id].history,o=null;if(void 0!==t)for(var n in t)null===o&&(o=this.getMessageFromHistory(n,e));return o},g.prototype.addHistory=function(e,t){void 0===window.cti.store.xmpp[this.id].history[e]&&(window.cti.store.xmpp[this.id].history[e]={messages:[],read:0,unread:0}),t.ts=(new Date).getTime(),window.cti.store.xmpp[this.id].history[e].messages.push(t)},g.prototype.saveAndUpdate=function(){o.save().then(function(){r.$emit("StoreHasChanged")})},g.prototype.cleanQueue=function(){if(void 0!==window.cti.store.xmpp[this.id]){var e=window.cti.store.xmpp[this.id].history,t=!1;if(void 0!==e){var o=this;for(var n in e){var r=e[n].messages;void 0!==r&&r.forEach(function(e){e.status===o.MESSAGE_STATUS.SENDING&&(e.status=o.MESSAGE_STATUS.FAILED,t=!0)})}}t===!0&&this.saveAndUpdate()}},g.prototype.getBareJid=function(e){return window.Strophe.getBareJidFromJid(e)},g}]),angular.module("app.core").factory("XmppFactory",["Xmpp","$q",function(e,t){function o(t){u[t.name]=new e(t.name,t.endpoint,t.actions,t["upload-jid"],t["read-receipts"],t["stay-connected"],t["multicast-jid"],t["ping-time"],t["ping-timeout"],t["send-timeout"],t.outbox,t["reconnect-time"])}function n(e){var o=t.defer(),n=e.name;return void 0!==n?void 0!==u[n]?u[n].send(e).then(function(){o.resolve(!0)})["catch"](function(e){o.reject(e)}):o.reject('XMPP instance with name "'+n+'" does not exist.'):o.reject("XMPP instance name not specified."),o.promise}function r(e){var o=t.defer(),n=e.name;return void 0!==n?void 0!==u[n]?u[n].sendToGroup(e).then(function(){o.resolve(!0)})["catch"](function(e){o.reject(e)}):o.reject('XMPP instance with name "'+n+'" does not exist.'):o.reject("XMPP instance name not specified."),o.promise}function a(e){var o=t.defer(),n=e.name;return void 0!==n?void 0!==u[n]?u[n].markRead(e).then(function(){o.resolve(!0)})["catch"](function(e){o.reject(e)}):o.reject('XMPP instance with name "'+n+'" does not exist.'):o.reject("XMPP instance name not specified."),o.promise}function i(e){var o=t.defer(),n=e.name;return void 0!==n?void 0!==u[n]?void 0!==e.id?(u[n].sendMarker(e.id,"acknowledged"),o.resolve()):o.reject("Message ID must be provided."):o.reject('XMPP instance with name "'+n+'" does not exist.'):o.reject("XMPP instance name not specified."),o.promise}function s(e){var o=t.defer(),n=e.name,r=e.custom||e.status;return void 0!==n&&void 0!==r?void 0!==u[n]?u[n].setStatus(r).then(function(){o.resolve(!0)})["catch"](function(e){o.reject(e)}):o.reject('XMPP instance with name "'+n+'" does not exist.'):o.reject("XMPP instance name not specified."),o.promise}function c(e){var o=t.defer(),n=e.name;return void 0!==n?void 0!==u[n]?u[n].login(e.username,e.password).then(function(){o.resolve()})["catch"](function(e){o.reject(e)}):o.reject('XMPP instance with name "'+n+'" does not exist.'):o.reject("XMPP instance name not specified."),o.promise}function l(e){var o=t.defer(),n=e.name;return void 0!==n?void 0!==u[n]?u[n].logout().then(function(){o.resolve()})["catch"](function(e){o.reject(e)}):o.reject('XMPP instance with name "'+n+'" does not exist.'):o.reject("XMPP instance name not specified."),o.promise}var u={},d={init:o,send:n,login:c,logout:l,markRead:a,setStatus:s,sendToGroup:r,markAcknowledged:i};return d}]),angular.module("app.core").factory("FileSystem",["Plugin","$q","Platform","electron","MimeTypes","$log",function(e,t,o,n,r,a){function i(){return void 0!==n.app}function s(){return void 0!==window.resolveLocalFileSystemURL}function c(){if(i()){var r=n.path.sep,a=n.app.getPath("userData"),s=a+r;return t.when(s)}if("winphone"==o.getName())return t.resolve("");var c=e.getSource("file");if(!c)return t.reject("File System unavailable on this platform: "+navigator.userAgent);var l=t.defer();switch(o.getName()){case"ios":l.resolve(c.documentsDirectory);break;case"android":l.resolve(c.externalDataDirectory);break;default:l.resolve(c.dataDirectory)}return l.promise}function l(){var e=t.defer();return c().then(function(t){s()?("winphone"==o.getName()&&""===t&&(t+=".\\"),window.resolveLocalFileSystemURL(t,function(t){e.resolve(t)},function(t){e.reject(t)})):e.reject("Local file system unavailable on this platform.")})["catch"](function(t){e.reject(t)}),e.promise}function u(e){var o=t.defer();return c().then(function(t){i()?n.fsplus.stat(t+e,function(n,a){n?o.reject({message:"Error obtaining file '"+e+"'",innerError:n}):o.resolve({name:e,filePath:t+e,mimeType:r.mimeTypeFromExtension(e),size:a.size})}):s()?window.resolveLocalFileSystemURL(t+e,function(e){e.file(function(e){o.resolve({name:e.name||e.localURL,filePath:e.localURL,mimeType:r.mimeTypeFromExtension(e.name||e.localURL),size:e.size})})},function(t){o.reject({message:"Error obtaining file '"+e+"'",innerError:t})}):o.reject("Local file system unavailable on this platform: "+navigator.userAgent)})["catch"](function(t){o.reject({message:"Error obtaining file '"+e+"'",innerError:t})}),o.promise}function d(e){var o=t.defer();return c().then(function(t){i()?n.fsplus.readFile(t+e,function(t,n){if(t)o.reject({message:"Error obtaining file blob for file '"+e+"'",innerError:t});else{var a=new Blob([n],{type:r.mimeTypeFromExtension(e)});o.resolve(a)}}):s()?window.resolveLocalFileSystemURL(t+e,function(t){t.file(function(t){var n=new FileReader;n.onloadend=function(t){var n=new Blob([t.target.result],{type:r.mimeTypeFromExtension(e)});o.resolve(n)},n.readAsArrayBuffer(t)})},function(t){o.reject({message:"Error obtaining file blob for file '"+e+"'",innerError:t})}):o.reject("Unable to read file on this platform: "+navigator.userAgent)})["catch"](function(t){o.reject({message:"Error obtaining file blob for file '"+e+"'",innerError:t})}),o.promise}function p(e){return e.replace(/\\/g,"/").split("/").pop()}function g(e){return e.indexOf("/")==-1?e.substring(0,e.lastIndexOf("\\")+1):e.substring(0,e.lastIndexOf("/")+1)}function m(e,o){var a=t.defer();return c().then(function(t){var c=t+e,u=r.mimeTypeFromExtension(e);if(i()){var d=new Uint8Array(o),p=new window.Buffer(d);n.fsplus.writeFile(c,p,function(t){t?a.reject({message:"Error saving file '"+e+"'",innerError:t}):a.resolve(c)})}else s()?l().then(function(t){t.getFile(e,{create:!0,exclusive:!1},function(t){t.createWriter(function(n){n.onwriteend=function(){t.file(function(e){a.resolve(e.localURL)})},n.onerror=function(t){a.reject({message:"Error saving file '"+e+"'",innerError:t})};var r=new Blob([o],{type:u});n.write(r)})})}):a.reject("Unable to save file on this platform: "+navigator.userAgent)})["catch"](function(t){a.reject({message:"Error saving file '"+e+"'",innerError:t})}),a.promise}function f(e,o){var r=t.defer();return c().then(function(t){if(i()){var a=t+e,c=t+o;n.fsplus.rename(a,c,function(t){t?r.reject({message:"Error renaming file '"+e+"'",innerError:t}):r.resolve(c)})}else s()?l().then(function(t){t.getFile(e,{create:!1,
exclusive:!0},function(n){n.moveTo(t,o,function(e){e.file(function(e){r.resolve(e.localURL)})},function(t){r.reject({message:"Error renaming file '"+e+"'",innerError:t})})},function(t){r.reject({message:"Error renaming file '"+e+"'",innerError:t})})}):r.reject("Unable to rename file on this platform: "+navigator.userAgent)})["catch"](function(t){r.reject({message:"Error renaming file '"+e+"'",innerError:t})}),r.promise}function C(e,r){var a=t.defer();return c().then(function(t){if(i()){var c=t+r;n.fsplus.rename(e,c,function(t){t?a.reject({message:"Error moving file at '"+e+"'",innerError:t}):a.resolve(c)})}else if(s()){"ios"!==o.getName()&&"android"!==o.getName()||e.indexOf("file://")==-1&&(e="file://"+e);var l=g(e),u=p(e);window.resolveLocalFileSystemURL(l,function(t){t.getFile(u,{create:!1,exclusive:!0},function(o){o.moveTo(t,r,function(e){e.file(function(e){a.resolve(e.localURL)})},function(t){a.reject({message:"Error moving file '"+e+"'",innerError:t})})},function(t){a.reject({message:"Error moving file '"+e+"'",innerError:t})})})}else a.reject("Unable to move file on this platform: "+navigator.userAgent)})["catch"](function(t){a.reject({message:"Error moving file '"+e+"'",innerError:t})}),a.promise}function h(o,n,r){var a=i()?e.getSource("@commontimeltd/com.commontime.filetransfer"):e.getSource("FileTransfer");if(!a)return t.reject("File transfer plugin not available");var s=t.defer(),c={httpMethod:r.httpMethod,fileName:r.fileName||p(o),fileKey:r.fileKey,headers:r.headers},l=new a;return l.upload(o,n,function(e){s.resolve({source:o,target:n,response:e.response})},function(e){s.reject({message:"Error uploading file '"+o+"' to '"+n+"'",innerError:e})},c),s.promise}function v(o,n){function a(e){var t=e+n,a=new s;a.download(o,t,function(e){i()?u.resolve({filePath:e.filePath,mimeType:r.mimeTypeFromExtension(e.filePath)}):e.file(function(e){u.resolve({filePath:e.localURL,mimeType:r.mimeTypeFromExtension(e.localURL)})},function(e){u.reject({message:"Error download file from '"+o+"' to '"+t+"'",innerError:e})})},function(e){u.reject({message:"Error download file from '"+o+"' to '"+t+"'",innerError:e})})}var s=i()?e.getSource("@commontimeltd/com.commontime.filetransfer"):e.getSource("FileTransfer");if(!s)return t.reject("File transfer plugin not available");i()?c().then(function(e){a(e)}):l().then(function(e){a(e.nativeURL)});var u=t.defer();return u.promise}function S(){var e=t.defer(),o=new Date,n=o.getTime(),r=n+".m4a";return c().then(function(t){0===t.indexOf("file://")&&(t=t.replace("file://",""));var o=t+r;e.resolve(o)})["catch"](function(e){a.error(e)}),e.promise}function w(e){var r=t.defer(),c=function(){a.error(arguments),r.reject(arguments)};if(void 0===e||null===e)c("Could not delete media item - no uri specified");else if(i()||s())if(i())try{n.fsplus.existsSync(e)===!1?c("Error deleting file - file does not exist"):n.fsplus.isFileSync(e)===!1?c("Error deleting file - path was not a file"):(n.fsplus.removeSync(e),r.resolve())}catch(l){c("Error deleting file",l)}else try{var u=e.indexOf("file://")==-1;"winphone"!=o.getName()&&u&&(e="file://"+e),window.resolveLocalFileSystemURL(e,function(t){t.isDirectory?c("Error getting file to delete - file uri resolved to a directory: ",e):t.remove(function(){r.resolve()},function(e){c("Error deleting the file: ",e)})},function(e){c("Error getting file entry",e)})}catch(l){c("Error deleting file: ",l)}else c("resolveLocalFileSystemURL is not available - platform could not be detected");return r.promise}function y(e){var o=t.defer(),i=[];if(void 0!==e&&e.length>0){var s=[];e.forEach(function(e){var t=r.extensionFromMimeType(e);null!==t&&s.push(t)}),s.length>0&&i.push({name:"Mimes",extensions:s})}return n.dialog.showOpenDialog({properties:["openFile","singleSelection"],filters:i},function(e){void 0==e||void 0!=e&&0==e.length||c().then(function(t){var r=e[0],i=p(r),s=t+i;n.fsplus.copy(e[0],s,function(e){return e?a.error(e):void o.resolve(s)})})}),o.promise}function L(e){return e.replace(/\\/g,n.path.sep).replace(/\//g,n.path.sep)}function A(o,n){var r=t.defer();if(i()){var a=L(o),c=e.getSource("fs");if(!c)return t.reject("FileSystem not supported on this platform: "+navigator.userAgent);var l=n===!0?"base64":"utf8";c.readFile(a,l,function(e,t){e?r.reject(e):r.resolve(t)})}else s()?window.resolveLocalFileSystemURL(o,function(e){e.file(function(e){var t=new FileReader;t.onloadend=function(e){r.resolve(e.target.result)},n===!0?t.readAsDataURL(e):t.readAsText(e)})},r.reject):r.reject("Unable to read file on this platform: "+navigator.userAgent);return r.promise}function b(e){if(!s())return t.when(e);if(0!==e.indexOf("cdvfile://"))return t.when(e);var o=t.defer();return window.resolveLocalFileSystemURL(e,function(e){var t=e.toURL();o.resolve(t)},o.reject),o.promise}return{getStorageLocation:c,getStorage:l,getFile:u,getFileBlob:d,getFileNameFromPath:p,saveFile:m,renameFile:f,moveFileToStorage:C,upload:h,download:v,generateFileName:S,deleteMediaItem:w,selectFile:y,readFile:A,resolveCdvFilePath:b}}]),angular.module("app.core").factory("Platform",["StoreFactory",function(e){function t(){e.set("env.platform.type",o()),e.set("env.platform.name",n())}function o(){return window.cordova!==!1&&/iPhone|iPad|iPod|IEMobile|Android/i.test(navigator.userAgent)?"device":/Electron/i.test(navigator.userAgent)?"desktop":/Chrome/i.test(navigator.userAgent)||/Firefox/i.test(navigator.userAgent)||a.test(navigator.userAgent)?"browser":null}function n(){return/IEMobile/i.test(navigator.userAgent)||/Windows Phone 8\.1/i.test(navigator.userAgent)?"winphone":/Android/i.test(navigator.userAgent)?"android":/iPhone|iPad|iPod/i.test(navigator.userAgent)?"ios":/Electron/i.test(navigator.userAgent)?"electron":/Chrome/i.test(navigator.userAgent)?"chrome":/Firefox/i.test(navigator.userAgent)?"firefox":a.test(navigator.userAgent)?"internet_explorer":null}var r={init:t,getType:o,getName:n},a=navigator.userAgent.indexOf("MSIE")!=-1?/MSIE (\d+\.\d+);/:/Trident.*rv[ :]*(\d+\.\d+)/;return r}]),angular.module("app.core").factory("InboxOutboxFactory",["$q","$log","$injector","Plugin","Utilities","electron",function(e,t,o,n,r,a){function i(){var t=sessionStorage.getItem("debug");if(t){var n=t.split("|");O=n.indexOf("*")!==-1||n.indexOf("inboxoutbox")!==-1}if(E('Ensuring "InboxOutbox" factory is initialised...'),R)return e.when();var r=e.defer();return V=o.get("SchemaService"),G=o.get("ActionFactory"),b().then(function(){B===!1?r.reject('Unable to initialise "notify" plugin'):setTimeout(function(){E("Registering global outbox and inbox change handlers"),B.receiveInboxChanges(I,A),B.receiveOutboxChanges(I,L),U=!0,r.resolve()},0)})["catch"](function(e){T(e)}),R=!0,r.promise}function s(t){if(!U)return e.reject("Notfiy plugin not initialised");var o=e.defer();return E('Setting "notify" options:',t),B.setOptions(function(){o.resolve()},function(){o.reject("Error setting message queue options")},t),o.promise}function c(e){return M?n.getSource("@commontimeltd/com.commontime."+e):n.getSource(e)}function l(t){return E("Registering provider with InboxOutboxFactory:",t),q[t.name]={outboxChangeCallback:t.outboxChangeCallback,inboxChangeCallback:t.inboxChangeCallback},e.when(q[t.name])}function u(){return V.isPreview()||V.isLivePreview()}function d(e){return"REQUEST_"+e.toUpperCase()+"_"+r.uuid()}function p(t){return U?j("addChannel",[t]):e.reject("Notfiy plugin not initialised")}function g(t){return U?j("removeChannel",[t]):e.reject("Notfiy plugin not initialised")}function m(t){return U?(E("Sending message...",t),j("sendMessage",[t])):e.reject("Notfiy plugin not initialised")}function f(t,o){return U?(E('Acknowledging message id "'+o+'" for receiver "'+t+'"'),j("messageReceivedAck",[t,o])):e.reject("Notfiy plugin not initialised")}function C(t){return U?(E('Deleting message "'+t+'"'),j("deleteMessage",[t])):e.reject("Notfiy plugin not initialised")}function h(e){if(e.hasOwnProperty(V.ITEM_AUTO_ID_PROPERTY)){var t=e[V.ITEM_AUTO_ID_PROPERTY];return H[t]=e,t}return null}function v(e){if(H.hasOwnProperty(e))return E("Found invoking action in action cache:",H[e]),H[e];E("Invoking action not found in action cache, searching in app schema...");var t=V.findItemById(e);return t?E("Found in app schema:",t):E("No action found with action id:",e),t}function S(e,t,o){return E('Calling "'+t+'" actions from',e,"with model",o),G.triggerEvent(t,e,o)}function w(t,o,n){return E("Looking for child actions of:",t),null===t||!t.actions instanceof Array?e.when():S(t.actions,o,n)}function y(){return O===!0}function L(e,t){setTimeout(function(){E("Outbox change received:",t);var o=x(t),n=$(o);null!==n&&"function"==typeof n.outboxChangeCallback&&(E('Routing outbox change to provider "'+o+'"'),n.outboxChangeCallback(e,t))},0)}function A(e,t){setTimeout(function(){E("Inbox change received:",t);var o=x(t),n=$(o);null!==n&&"function"==typeof n.inboxChangeCallback&&(E('Routing inbox change to provider "'+o+'"'),n.inboxChangeCallback(e,t))},100)}function b(){var t=e.defer();return E('Obtaining "nofity" plugin...'),B=F===!0?k():M?n.getSource("@commontimeltd/com.commontime.notify"):n.getSource("notify"),t.resolve(B),t.promise}function j(t,o){var n=e.defer();return o.push(function(e,t){e?n.reject(e):n.resolve(t)}),B[t].apply(B,o),n.promise}function x(e){var t=e.message.provider;return t||(t=_),t}function $(e){return q.hasOwnProperty(e)?q[e]:null}function E(){if(O===!0&&void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[inboxOutbox.fct.js] "+e[0]),t.log.apply(t,e)}}function T(){if(void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[inboxOutbox.fct.js] "+e[0]),t.error.apply(t,e)}}function k(){function e(e,t){setTimeout(function(){e(void 0,t)},o)}t.info("*** USING MOCK NOTIFY PLUGIN: Turn this off in inboxOutbox.fct.js if you expect to use the real plugin ***");var o=500;return{___queues:{},___localChannels:[],___onInboxChange:null,___onOutboxChange:null,addChannel:function(t,o){E("addChannel called with arguments:",arguments),this.___localChannels.indexOf(t)===-1&&this.___localChannels.push(t),e(o,t)},removeChannel:function(t,o){E("removeChannel called with arguments:",arguments);var n=this.___localChannels.indexOf(t);n!==-1&&this.___localChannels.splice(n,1),e(o,t)},sendMessage:function(t,o){E("sendMessage called with arguments:",arguments),this.___queues[t.channel]||(this.___queues[t.channel]=[]);var n="Message_"+r.uuid();if(t.id=n,t.date=(new Date).getTime(),this.___queues[t.channel].push(t),this.___localChannels.indexOf(t.channel)!==-1){if("function"==typeof this.___onOutboxChange){var a={action:"SENDING",message:t},i={action:"SENT",message:t};this.___onOutboxChange(void 0,a),this.___onOutboxChange(void 0,i)}if("function"==typeof this.___onInboxChange){var s={action:"create",message:t};this.___onInboxChange(void 0,s)}}e(o,n)},deleteMessage:function(t,o){E("deleteMessage called with arguments:",arguments);for(var n in this.___queues)if(this.___queues.hasOwnProperty(n))for(var r=this.___queues[n].length-1;r>=0;r--)this.___queues[n][r].id===t&&this.___queues[n].splice(r,1);e(o,t)},messageReceivedAck:function(t,o,n){E("messageReceivedAck called with arguments:",arguments),e(n,null)},receiveInboxChanges:function(e,t){E("receiveInboxChanges called with arguments:",arguments),this.___onInboxChange=t},receiveOutboxChanges:function(e,t){E("receiveOutboxChanges called with arguments:",arguments),this.___onOutboxChange=t}}}var F=!1,I="com.commontime.inboxOutbox",_="azure.servicebus",P="azure.appservices",D="rest",N=null,O=!1,M=void 0!==a.app,R=!1,U=!1,q={},B=null,V=null,G=null,H={};return{init:i,setOptions:s,getProviderPlugin:c,registerProvider:l,isFromStudio:u,generateRequestId:d,addChannel:p,removeChannel:g,sendMessage:m,acknowledgeMessage:f,deleteMessage:C,getActionId:h,getActionById:v,callActions:S,callChildActions:w,isDebugMode:y,USE_MOCK_PLUGIN:F,PROVIDER_AZURESERVICEBUS:_,PROVIDER_AZUREAPPSERVICES:P,PROVIDER_REST:D,PROVIDER_UNKNOWN:N}}]),angular.module("app.core").factory("MessageQueueFactory",["$q","$log","InboxOutboxFactory","StoreFactory",function(e,t,o,n){function r(t){if(x)return e.when();var n=e.defer();return o.init().then(function(){h("Initialising message queue providers with schema...",t);var e=t.settings["message-queue"],o=u(e);0===o.length&&(h("No message queue providers enabled"),n.resolve()),T=p(o),g().then(function(){return m(o)}).then(function(){return f(t)}).then(function(){return C()}).then(function(){$=!0,n.resolve()})["catch"](function(e){v(e),n.reject(e)})})["catch"](function(e){v(e),n.reject(e)}),x=!0,n.promise}function a(t){if(!$)return e.reject("Message Queue plugin not initialised");if(!t)return e.reject("Missing queue name");t=t.toLowerCase(),h('Listening to queue "'+t+'"...');var n=o.addChannel(t);return n.then(function(){h('Adding "'+t+'" to store'),w(t)}),n}function i(t){if(!$)return e.reject("Message Queue plugin not initialised");if(!t)return e.reject("Missing queue name");t=t.toLowerCase(),h('Stopped listening to queue "'+t+'"...');var n=o.removeChannel(t);return n.then(function(){h('Removing "'+t+'" from store'),y(t)}),n}function s(t,n){if(!$)return e.reject("Message Queue plugin not initialised");if(!t)return e.reject("Missing queue name");if(!n)return e.reject('Invalid message content "'+n+'"');t=t.toLowerCase();var r=new Date,a=r.getUTCFullYear()+1,i=Date.UTC(a,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds()),s={channel:t,subchannel:j,expiry:i,provider:T.name,notification:"",content:{data:n}};return o.sendMessage(s)}function c(e,t){return e?void v(e):void("sent"===t.action.toLowerCase()&&E.onSent.length&&(h('Triggering "message sent" event'),o.callActions(E.onSent,"click",{$messageId:t.message.id})))}function l(e,t){if(e)v(e);else if("create"===t.action.toLowerCase()&&E.onReceived.length){var n={$message:{id:t.message.id,queue:t.message.channel,body:t.message.content.data,sent:parseInt((t.message.date||0).toString()),received:parseInt((new Date).getTime().toString())}};h('Triggering "message received" event'),o.callActions(E.onReceived,"click",n).then(function(){o.acknowledgeMessage(b,t.message.id),o.deleteMessage(t.message.id)})}}function u(e){var t=[],n=e.asb||{};if(n.enabled===!0){h('Obtaining provider "'+o.PROVIDER_AZURESERVICEBUS+'"...');var r={sbHostName:n.hostName,serviceNamespace:n.serviceNamespace,sasKeyName:n.keyName,sasKey:n.key,brokerType:n.brokerType,brokerAutoCreate:n.autoCreate||!1};t.push({name:o.PROVIDER_AZURESERVICEBUS,loadProviderPromise:d("asb",r)})}return t}function d(t,n){var r=e.defer();h('Initialising "'+t+'" message queue provider...');var a=o.USE_MOCK_PLUGIN===!0?L(t):o.getProviderPlugin(t);return a===!1?r.reject('Unable to initialise "'+t+'" plugin'):o.isFromStudio()?(h('...running from Studio - injecting "'+t+'" message queue preferences:',n),a.start(r.resolve,r.reject,n)):(h('...using "'+t+'" message queue preferences from configuration file'),a.start(r.resolve,r.reject)),r.promise}function p(e){return e.length>0?e[0]:null}function g(){var t=e.defer();if(o.isFromStudio())if(null!==T){var n={defaultPushSystem:T.name};o.setOptions(n).then(function(){t.resolve()})["catch"](function(e){t.reject(e)})}else t.reject("No default push system was specified");else h("Options being obtained from config.xml / package.json"),t.resolve();return t.promise}function m(t){var n=[];return angular.forEach(t,function(t){var r=e.defer();t.loadProviderPromise.then(function(){h('Registering message queue provider "'+t.name+'"');var e={name:t.name,outboxChangeCallback:c,inboxChangeCallback:l};o.registerProvider(e).then(function(){r.resolve()})}),n.push(r)}),e.all(n)}function f(t){var o=e.defer();return t&&t.config&&t.config.length&&angular.forEach(t.config,function(e){if("message-queue-event"===e["item-type"])switch((e.eventType||"").toLowerCase()){case"ready":E.onReady=E.onReady.concat(e.actions);break;case"received":E.onReceived=E.onReceived.concat(e.actions);break;case"sent":E.onSent=E.onSent.concat(e.actions);break;default:v('Unknown message queue event type "'+e.eventType+'"')}}),h("Registered actions:",E),o.resolve(),o.promise}function C(){var t=e.defer();return setTimeout(function(){var e=S();e.length&&(h("Re-adding queues:",e),angular.forEach(e,function(e){o.addChannel(e.toLowerCase())})),h('Triggering "ready" event'),o.callActions(E.onReady,"click"),t.resolve()},0),t.promise}function h(){if(o.isDebugMode()&&void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[messageQueue.fct.js] "+e[0]),t.log.apply(t,e)}}function v(){if(void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[messageQueue.fct.js] "+e[0]),t.error.apply(t,e)}}function S(){var e=n.get(A)||{};return e.listeningTo||[]}function w(e){var t=S();t.push(e),n.set(A,{listeningTo:t})}function y(e){var t=S(),o=t.indexOf(e);o!==-1&&(t.splice(o,1),n.set(A,{listeningTo:t}))}function L(e){function o(o,n){t.info("*** USING MOCK "+e.toUpperCase()+" PLUGIN: Set USE_MOCK_PLUGIN to false in inboxOutbox.fct.js if you expect to use the real plugin ***");var r=500;setTimeout(function(){o(void 0,n)},r)}return{start:function(e){h("start called with arguments:",arguments),o(e,"ok")}}}var A="messageQueues",b="com.commontime.infinity.messageQueue",j="default",x=!1,$=!1,E={onReady:[],onReceived:[],onSent:[]},T=null;return{init:r,startListening:a,stopListening:i,sendMessage:s}}]),angular.module("app.core").factory("RestFactory",["$q","$log","InboxOutboxFactory","Api","StoreFactory","Utilities","FileSystem","MimeTypes",function(e,t,o,n,r,a,i,s){function c(){if(b)return e.when();var t=e.defer();return o.init().then(function(){return g()}).then(function(){var e={name:o.PROVIDER_REST,outboxChangeCallback:d,inboxChangeCallback:p};return o.registerProvider(e)}).then(function(){j=!0,t.resolve()})["catch"](function(e){w(e),t.reject(e)}),b=!0,t.promise}function l(e){S("Registering Offline API item:",e),x.push(e)}function u(t){if(!j)return e.reject(A+" plugin not initialised");S("Making request for action:",t);var r=o.getActionId(t),a=t.data.name,i=t.data.operation,s=m(a),c=f(s,i);if(null===c)return e.reject('Unknown operation "'+i+'"');S('Invoking operation "'+i+'" with config:',c);var l=new n(s.name,s.url,s.params,s.headers,s.operations);return l.buildRequestObject(c,t.data.params,C).then(function(e){c.downloadAsFile===!0&&(e.downloadAsFile=c.downloadAsFile,e.downloadFileName=c.downloadFileName),e.invokingActionId=r;var n=c.ttlMinutes;void 0===n&&(n=60);var a=0;if(0===n)a=0;else{var i=new Date;a=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds()),a+=60*n*1e3}var s=o.generateRequestId(o.PROVIDER_REST),l={channel:L,subchannel:s,provider:o.PROVIDER_REST,expiry:a,content:e};o.sendMessage(l)["catch"](function(e){w(e),o.callChildActions(t,"fail",{$response:e})})})["catch"](function(e){w(e)}),e.when(!0)}function d(e){void 0!==e&&w(e)}function p(e,t){if(void 0!==e)w(e);else if("create"===t.action.toLowerCase()){var n=h(t);if(null===n)S("Unable to handle inbox change - no message request data found in result:",t);else{var a=n.invokingActionId,i=o.getActionById(a);null!==i&&v(t).then(function(e){S("Parsed response for "+i.data.name+"."+i.data.operation+": ",e),e.isSuccess&&r.set("offlineApi."+i.data.name+"."+i.data.operation,e.responseData);var n=e.isSuccess?"success":"fail";S('Calling child "'+n+'" actions of action id "'+a+'" with model:',e.responseData),o.callChildActions(i,n,{$response:e.responseData}),o.deleteMessage(t.message.id)})}}}function g(){var t=e.defer();S('Initialising "'+A+'" plugin...');var n=o.USE_MOCK_PLUGIN===!0?y():o.getProviderPlugin(A);return n===!1?t.reject('Unable to initialise "'+A+'" plugin'):n.start(t.resolve,t.reject),t.resolve(),t.promise}function m(e){var t=x.filter(function(t){return t.name===e});return t.length?t[0]:null}function f(e,t){if(!e||!e.operations||!e.operations.length)return null;var o=e.operations.filter(function(e){return e.name===t});return o.length?o[0]:null}function C(o,n,r){var a=e.defer();if("formData"===n["in"]&&"file"===n.type){var c=r,l=i.getFileNameFromPath(c),u=n.typeConfig.base64encode;u?i.getFileBlob(l).then(function(e){var t=new FileReader;t.onloadend=function(e){o.headers["Content-Type"]="application/json",o.data[n.name]=e.target.result,n.typeConfig.fileNameParameterName&&(o.data[n.typeConfig.fileNameParameterName]=l),a.resolve(!0)},t.readAsDataURL(e)})["catch"](function(e){t.error(e),a.resolve(!1)}):(o.headers["Content-Type"]=s.mimeTypeFromExtension(c),o.data=r,o.uploadAsFile=!0,o.uploadAsMultipartForm=!0,o.formPartName=n.name,o.formPartFilename=l,a.resolve(!0))}else a.resolve(!1);return a.promise}function h(e){return e.message&&e.message.content?e.message.content.config:null}function v(t){if(!t.message||!t.message.content)return e.when({isSuccess:!1,responseData:"Invalid response message"});var o=parseInt(t.message.content.status||-1),n=o<=0||o>=400;if(n)return e.when({isSuccess:!1,responseData:{status:t.message.content.status,statusText:t.message.content.statusText,message:t.message.content.data}});var r=e.defer(),c=h(t),l=t.message.content.data,u=t.message.content.headers;if(c&&c.downloadAsFile===!0&&u){S("Response is downloaded file; file path:",l);var d=l,p="";if((c.downloadFileName||"").trim().length>0)p=c.downloadFileName;else{p=a.uuid();var g=(u["Content-Type"]||"").split(";")[0].trim(),m=s.extensionFromMimeType(g);null!==m&&(p+="."+m)}i.moveFileToStorage(d,p).then(function(e){r.resolve({isSuccess:!0,responseData:e})})["catch"](function(e){r.resolve({isSuccess:!1,responseData:e})})}else r.resolve({isSuccess:!0,responseData:l});return r.promise}function S(){if(o.isDebugMode()&&void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[rest.fct.js] "+e[0]),t.log.apply(t,e)}}function w(){if(void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[rest.fct.js] "+e[0]),t.error.apply(t,e)}}function y(){function e(e,o){t.info("*** USING MOCK "+A.toUpperCase()+" PLUGIN: Set USE_MOCK_PLUGIN to false in inboxOutbox.fct.js if you expect to use the real plugin ***");var n=500;setTimeout(function(){e(void 0,o)},n)}return{start:function(t){S("start called with arguments:",arguments),e(t,"ok")}}}var L="inboxoutbox."+o.PROVIDER_REST,A="rest",b=!1,j=!1,x=[];return{init:c,registerOfflineApi:l,makeRequest:u}}]),angular.module("app.core").factory("AzureAppServicesFactory",["$q","$log","InboxOutboxFactory","StoreFactory",function(e,t,o,n){function r(t){if(S)return e.when();var n=e.defer();return y=t,o.init().then(function(){return l(t)}).then(function(){var e={name:o.PROVIDER_AZUREAPPSERVICES,outboxChangeCallback:s,inboxChangeCallback:c};return o.registerProvider(e)}).then(function(){w=!0,n.resolve()})["catch"](function(e){f(e),n.reject(e)}),S=!0,n.promise}function a(t){if(!w)return e.reject(v+" plugin not initialised");m("Making request for action:",t);var n=o.getActionId(t),r=t.data.operation,a=u(r);if(null===a)return e.reject("Unknown operation '"+r+"'");var i=a.path;m("Invoking operation '"+i+"' with config:",a);var s={transport:{type:"zumoDirect",httpMethod:a.method,api:i},invokingActionId:n};if(t.data.params){s.data={};for(var c in t.data.params)if(t.data.params.hasOwnProperty(c)){var l=d(a,c);if(null!==l)switch(l.type){case"fileref":s.data[c]="#fileref:"+t.data.params[c];break;default:s.data[c]=t.data.params[c]}}}var p=a.ttlMinutes;void 0===p&&(p=60);var g=0;if(0===p)g=0;else{var C=new Date;g=Date.UTC(C.getUTCFullYear(),C.getUTCMonth(),C.getUTCDate(),C.getUTCHours(),C.getUTCMinutes(),C.getUTCSeconds()),g+=60*p*1e3}var S=o.generateRequestId(o.PROVIDER_AZUREAPPSERVICES),y={channel:h,subchannel:S,provider:o.PROVIDER_AZUREAPPSERVICES,expiry:g,content:s};return o.sendMessage(y)["catch"](function(e){f(e),o.callChildActions(t,"fail",{$response:e})}),e.when(!0)}function i(){if(!w)return e.reject(v+" plugin not initialised");var t=e.defer();m("Attempting logout");var n=o.USE_MOCK_PLUGIN===!0?C():o.getProviderPlugin(v);return n===!1?t.reject("Unable to initialise '"+v+"' plugin"):n.logout(t.resolve,t.reject),t.promise}function s(e){void 0!==e&&f(e)}function c(e,t){if(void 0!==e)f(e);else if("create"===t.action.toLowerCase()){var r=p(t);if(null===r)m("Unable to handle inbox change - no message request data found in result:",t);else{var a=r.invokingActionId,i=o.getActionById(a);null!==i&&g(t).then(function(e){m("Parsed response:",e),e.isSuccess&&n.set("azureAppServices."+i.data.name+"."+i.data.operation,e.responseData);var r=e.isSuccess?"success":"fail";m("Calling child '"+r+"' actions of action id '"+a+"' with model:",e.responseData),o.callChildActions(i,r,{$response:e.responseData}),o.deleteMessage(t.message.id)})}}}function l(t){var n=e.defer();m("Initialising '"+v+"' plugin...");var r=o.USE_MOCK_PLUGIN===!0?C():o.getProviderPlugin(v);if(r===!1)n.reject("Unable to initialise '"+v+"' plugin");else if(o.isFromStudio()){var a={url:t.aasUrl,authenticationMethod:t.aasAuthenticationMethod,useBlobStorage:t.aasUseBlobStorage};m("...running from Studio - injecting '"+v+"' preferences:",a),r.start(n.resolve,n.reject,a)}else m("...using '"+v+"' preferences from configuration file"),r.start(n.resolve,n.reject);return n.resolve(),n.promise}function u(e){if(!y.operations||!y.operations.length)return null;var t=y.operations.filter(function(t){return t.name===e});return t.length?t[0]:null}function d(e,t){if(!e||!e.params.length)return null;var o=e.params.filter(function(e){return e.name===t});return o.length?o[0]:null}function p(e){return e.message&&e.message.content?e.message.content.config:null}function g(t){if(!t.message||!t.message.content)return e.when({isSuccess:!1,responseData:"Invalid response message"});var o=e.defer(),n=t.message.content.errorType&&t.message.content.errorMessage;return n?o.resolve({isSuccess:!1,responseData:t.message.content.errorMessage}):o.resolve({isSuccess:!0,responseData:t.message.content.response}),o.promise}function m(){if(o.isDebugMode()&&void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[azureAppServices.fct.js] "+e[0]),t.log.apply(t,e)}}function f(){if(void 0!==arguments){var e=Array.prototype.slice.call(arguments);e.length>0&&"string"==typeof e[0]&&(e[0]="[azureAppServices.fct.js] "+e[0]),t.error.apply(t,e)}}function C(){function e(e,o){t.info("*** USING MOCK "+v.toUpperCase()+" PLUGIN: Set USE_MOCK_PLUGIN to false in inboxOutbox.fct.js if you expect to use the real plugin ***");var n=500;setTimeout(function(){e(void 0,o)},n)}return{start:function(t){m("start called with arguments:",arguments),e(t,"ok")},logout:function(t){m("logout called with arguments:",arguments),e(t,"ok")}}}var h="inboxoutbox."+o.PROVIDER_AZUREAPPSERVICES,v="zumo",S=!1,w=!1,y=null;return{init:r,makeRequest:a,logout:i}}]),angular.module("app.core").factory("DataflowFactory",["Dataflow","$q",function(e,t){function o(t,o){r[t]=new e(o)}function n(e,o){var n=t.defer();return void 0!=r[e]&&r[e].execute(o).then(function(e){n.resolve(e)})["catch"](function(e){n.reject(e)}),n.promise}var r={},a={init:o,execute:n};return a}]),angular.module("app.core").factory("Dataflow",["$log","$q","$injector","StoreFactory","localStorageService",function($log,$q,$injector,StoreFactory,localStorageService){function Dataflow(e){this.steps=e,this.debug="true"==localStorageService.get("debug")}function __copy(e){return JSON.parse(JSON.stringify(e))}return Dataflow.prototype={execute:function(data){var deferred=$q.defer(),$scope=this;if(void 0!==$scope.steps){var result=[],_data=data;angular.isObject(data)&&!angular.isArray(data)&&(_data=[data]);var source=window.Rx.Observable.from(_data),$store=window.cti.store,ActionFactory=$injector.get("ActionFactory");$scope.debug&&$log.log("========== WORKFLOW =========="),this.steps.forEach(function(step){switch(step["item-type"]){case"map":step=StoreFactory.parse(angular.copy(step),{$data:_data}),void 0!==step.content&&step.content.length>0?(eval("var stepFunction = function($data){ "+step.content+" }"),source=source.map(stepFunction)):void 0!==step.xpath&&step.xpath.length>0?source=source.map(function(e){var t=JSON.search(e,step.xpath);return $scope.debug&&($log.log("[MAP] - XPATH RESULT:",t[0]),$log.log("============ ▼ ============")),1===t.length?t[0]:t}):$log.error("No xpath or code has been added for a 'map' step.");break;case"flat-map":step=StoreFactory.parse(angular.copy(step),{$data:_data}),void 0!==step.content&&step.content.length>0?(eval("var stepFunction = function($data, $index){ "+step.content+" }"),source=source.flatMap(stepFunction)):void 0!==step.xpath&&step.xpath.length>0?source=source.flatMap(function(e){var t=JSON.search(e,step.xpath);return $scope.debug&&($log.log("[FLAT MAP] - XPATH RESULT:",t[0]),$log.log("============ ▼ ============")),1===t.length?t[0]:t}):$log.error("No xpath or code has been added for a 'flat-map' step.");break;case"reduce":step=StoreFactory.parse(angular.copy(step),{$data:_data}),void 0!==step.content&&step.content.length>0?(eval("var stepFunction = function($acc, $current, $index, $source){ "+step.content+"; }"),source=source.reduce(stepFunction)):void 0!==step.xpath&&step.xpath.length>0?source=source.reduce(function(e){var t=JSON.search(e,step.xpath);return $scope.debug&&($log.log("[REDUCE] - XPATH RESULT:",t[0]),$log.log("============ ▼ ============")),1===t.length?t[0]:t}):$log.error("No xpath or code has been added for a 'reduce' step.");break;case"some":step=StoreFactory.parse(angular.copy(step),{$data:_data}),void 0!==step.content&&step.content.length>0?(eval("var stepFunction = function($data){ "+step.content+"; }"),source=source.some(stepFunction)):void 0!==step.xpath&&step.xpath.length>0?source=source.some(function(e){var t=JSON.search(e,step.xpath);return $scope.debug&&($log.log("[SOME] - XPATH RESULT:",t[0]),$log.log("============ ▼ ============")),1===t.length?t[0]:t}):$log.error("No xpath or code has been added for a 'some' step.");break;case"convert":step=StoreFactory.parse(angular.copy(step),{$data:_data},!1),void 0!==step.content?source=source.map(function(stepData){var template=null;try{eval("template = "+step.content)}catch(e){$log.error(e)}if(null!==template){var res=window.jsonapter.instance().run(template,stepData);return $scope.debug&&($log.log("[CONVERT] - TEMPLATE:",template),$log.log("[CONVERT] - JSONAPTER RESULT:",res),$log.log("============ ▼ ============")),res}}):$log.error("No template has been added for a 'convert' step.");break;case"take":step=StoreFactory.parse(angular.copy(step),{$data:_data}),void 0!==step.content?source=source.take(step.content):$log.error("No value has been added for a 'take' step.");break;case"every":void 0!==step.content&&step.content.length>0?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($data){ "+step.content+"; }"),source=source.every(stepFunction)):void 0!==step.operations&&step.operations.length>0?source=source.every(function(e){return ActionFactory.evalOperations(__copy(step.operations),{$data:e,$store:$store})}):$log.error("No expression or code has been added for an 'every' step.");break;case"filter":void 0!==step.content&&step.content.length>0?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($current, $index, $source){ "+step.content+" }"),source=source.filter(stepFunction)):void 0!==step.operations&&step.operations.length>0?source=source.filter(function(e,t,o){return ActionFactory.evalOperations(__copy(step.operations),{$current:e,$index:t,$source:o,$store:$store})}):$log.error("No expression or code has been added for a 'filter' step.");break;case"find":void 0!==step.content&&step.content.length>0?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($current, $index, $source){ "+step.content+"; }"),source=source.find(stepFunction)):void 0!==step.operations&&step.operations.length>0?source=source.find(function(e,t,o){
return ActionFactory.evalOperations(__copy(step.operations),{$current:e,$index:t,$source:o,$store:$store})}):$log.error("No expression or code has been added for a 'find' step.");break;case"to-array":source=source.toArray();break;case"max":void 0!==step.content?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($current, $next){ "+step.content+"; }"),source=source.average(stepFunction)):source=source.max();break;case"min":void 0!==step.content?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($current, $next){ "+step.content+"; }"),source=source.average(stepFunction)):source=source.min();break;case"sum":void 0!==step.content?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($current, $index, $source){ "+step.content+"; }"),source=source.average(stepFunction)):source=source.sum();break;case"count":void 0!==step.content?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($current){ "+step.content+"; }"),source=source.average(stepFunction)):source=source.count();break;case"average":void 0!==step.content?(step=StoreFactory.parse(angular.copy(step),{$data:_data}),eval("var stepFunction = function($data){ "+step.content+"; }"),source=source.average(stepFunction)):source=source.average()}}),source.subscribe(function(e){$scope.debug&&($log.log("ON NEXT:",e),$log.log("============ ▼ ============")),result.push(e)},function(e){$log.error(e),deferred.reject(e)},function(){var e=1===result.length?result[0]:result;$scope.debug&&($log.log("COMPLETED:",e),$log.log("===========================")),deferred.resolve(e)})}return deferred.promise}},Dataflow}]),angular.module("app.core").factory("ActionflowFactory",["Actionflow","$q",function(e,t){function o(t,o){r[t]=new e(o)}function n(e,o){var n=t.defer();return void 0!=r[e]&&r[e].execute(o).then(function(e){n.resolve(e)})["catch"](function(e){n.reject(e)}),n.promise}var r={},a={init:o,execute:n};return a}]),angular.module("app.core").factory("Actionflow",["$log","$q","$injector","localStorageService",function(e,t,o,n){function r(e){this.actions=e,this.debug="true"==n.get("debug")}return r.prototype={execute:function(e){var t=o.get("ActionFactory");return t.triggerEvent(null,this.actions,e)}},r}]),angular.module("app.core").factory("LoggingFactory",["$injector","electron","SchemaHelper",function(e,t,o){function n(e){return{log:function(){u(arguments,!0),e.log.apply(null,arguments)},debug:function(){d(arguments,!0),e.debug.apply(null,arguments)},info:function(){p(arguments,!0),e.info.apply(null,arguments)},error:function(){g(arguments,!0),e.error.apply(null,arguments)},warn:function(){m(arguments,!0),e.warn.apply(null,arguments)}}}function r(t){var n=e.get("StoreFactory");R=t,0!=o.schema.hostContext?(v(o.schema.settings.logging.enabled||!1),w(o.schema.settings.logging.appEnabled||!1,J),w(o.schema.settings.logging.clientEnabled||!1,W),w(o.schema.settings.logging.nativeEnabled||!1,K),L(o.schema.settings.logging.appUseDefault?o.schema.settings.logging.defaultRootLogLevel:o.schema.settings.logging.appRootLogLevel,J),L(o.schema.settings.logging.clientUseDefault?o.schema.settings.logging.defaultRootLogLevel:o.schema.settings.logging.clientRootLogLevel,W),L(o.schema.settings.logging.nativeUseDefault?o.schema.settings.logging.defaultRootLogLevel:o.schema.settings.logging.nativeRootLogLevel,K),b(o.schema.settings.logging.bufferFrequency)):(S().then(function(e){ge=e,n.set(Y,e)}),y(J).then(function(e){me=e,n.set(Z,e)}),y(W).then(function(e){fe=e,n.set(ee,e)}),y(K).then(function(e){n.set(te,e)}),A(J).then(function(e){Ce=e,n.set(oe,e)}),A(W).then(function(e){he=e,n.set(ne,e)}),A(K).then(function(e){n.set(re,e)}));var r=n.get(ae);void 0===r?b(o.schema.settings.logging.bufferFrequency):de=r;var i=n.get(le);void 0===i?a():a(i);var s=n.get(ue);void 0!==s&&(pe=s)}function a(t){var o=e.get("StoreFactory");void 0===t&&(M&&(pe.unshift(M),o.set(ue,pe)),t=R+"_logs_"+(new Date).getTime().toString()),O=new PouchDB(t,{revs_limit:1}),O.changes({since:"now",live:!0,include_docs:!0}).on("change",function(){c(!0)}),M=t,o.set(le,t)}function i(e){return new PouchDB(e,{revs_limit:1})}function s(t){var o=e.get("$q"),n=o.defer();return t.destroy().then(function(){n.resolve()})["catch"](function(e){n.reject(e)}),n.promise}function c(t){var o=e.get("$q"),n=o.defer(),r=arguments;return O.info().then(function(o){var i=0==r.length&&o.doc_count>0||t===!1&&o.doc_count>0||t&&o.doc_count>=de;!i||void 0!==t&&t&&o.db_name==ve?n.resolve():(ve=o.db_name,a(),l().then(function(t){var o=e.get("StoreFactory");t.forEach(function(e){var t=pe.indexOf(e);pe.splice(t,1)}),o.set(ue,pe),k().then(function(e){null!=e[W]&&o.set(se,e[W]),null!=e[J]&&o.set(ie,e[J]),null!=e[K]&&o.set(ce,e[K])}),n.resolve()}))}),n.promise}function l(){var t=e.get("$q"),o=t.defer(),n=[],r=pe.length;return pe.forEach(function(t){var a=i(t);a.allDocs({include_docs:!0},function(i,c){if(!i){for(var l=[],u=0;u<c.rows.length;u++){var d=c.rows[u].doc;l.push(d.data)}var p=e.get("Plugin"),g=e.get("Platform"),m=p.getSource("logging");if(m){var f="desktop"===g.getType();f?(m.logMessages(l),s(a).then(function(){n.push(t),r--,0==r&&o.resolve(n)})["catch"](function(){r--,0==r&&o.resolve(n)})):m.logMessages(function(){s(a).then(function(){n.push(t),r--,0==r&&o.resolve(n)})["catch"](function(){r--,0==r&&o.resolve(n)})},function(){r--,0==r&&o.resolve(n)},l)}}})}),o.promise}function u(arguments,e){f(e,arguments)?fe&&$(B,he)&&(arguments=C(arguments),h("["+P()+"] [DEBUG] "+arguments,q,W)):me&&$(B,Ce)&&(arguments=C(arguments),h("["+P()+"] [DEBUG] "+arguments,q,J))}function d(arguments,e){f(e,arguments)?fe&&$(q,he)&&(arguments=C(arguments),h("["+P()+"] [DEBUG] "+arguments,q,W)):me&&$(q,Ce)&&(arguments=C(arguments),h("["+P()+"] [DEBUG] "+arguments,q,J))}function p(arguments,e){f(e,arguments)?fe&&$(B,he)&&(arguments=C(arguments),h("["+P()+"] [INFO] "+arguments,B,W)):me&&$(B,Ce)&&(arguments=C(arguments),h("["+P()+"] [INFO] "+arguments,B,J))}function g(arguments,e){f(e,arguments)?fe&&$(G,he)&&(arguments=C(arguments),h("["+P()+"] [ERROR] "+arguments,G,W)):me&&$(G,Ce)&&(arguments=C(arguments),h("["+P()+"] [ERROR] "+arguments,G,J))}function m(arguments,e){f(e,arguments)?fe&&$(V,he)&&(arguments=C(arguments),h("["+P()+"] [WARN] "+arguments,V,W)):me&&$(V,Ce)&&(arguments=C(arguments),h("["+P()+"] [WARN] "+arguments,V,J))}function f(e,arguments){return e===!0||arguments.length>=2&&arguments[0]===z}function C(arguments){var e=[],t=Array.prototype.slice.call(arguments);arguments.length>=2&&arguments[0]===z&&t.shift();for(var o=0;o<t.length;o++){var n=t[o];if(angular.isObject(n)||angular.isArray(n))try{e.push(JSON.stringify(n))}catch(r){e.push(n)}else"function"==typeof n?e.push(n.toString()):e.push(n)}return t.length>0&&(e=N.apply(null,e)),e}function h(e,t,o){if(null!=O){var n={logLevel:t,message:e,destination:o};O.put({_id:(new Date).getTime().toString()+window.performance.now(),data:n},function(){})}}function v(t){ge=t;var o=e.get("StoreFactory"),n=e.get("Plugin"),r=e.get("Platform"),a=n.getSource("logging");if(a){var i="desktop"===r.getType();i?(t?a.enableLogging():t||a.disableLogging(),o.set(Y,t)):t?a.enableLogging(function(){o.set(Y,t)},function(){}):t||a.disableLogging(function(){o.set(Y,t)},function(){})}}function S(){var t=e.get("$q"),o=t.defer(),n=e.get("Plugin"),r=e.get("Platform"),a=n.getSource("logging");if(a){var i="desktop"===r.getType();i?o.resolve(a.isLoggingEnabled()):a.isLoggingEnabled(function(e){o.resolve(e)},function(e){o.reject(e)})}return o.promise}function w(t,o){var n=e.get("StoreFactory"),r=e.get("Plugin"),a=e.get("Platform"),i=r.getSource("logging");if(i){var s="desktop"===a.getType();s?(t?i.enableDestination(o):t||i.disableDestination(o),o===J?(me=t,n.set(Z,t)):o===W?(fe=t,n.set(ee,t)):o===K&&n.set(te,t)):t?i.enableDestination(function(){o===J?(me=t,n.set(Z,t)):o===W?(fe=t,n.set(ee,t)):o===K&&n.set(te,t)},function(){},o):t||i.disableDestination(function(){o===J?(me=!1,n.set(Z,!1)):o===W?(fe=!1,n.set(ee,!1)):o===K&&n.set(te,!1)},function(){},o)}}function y(t){var o=e.get("$q"),n=o.defer(),r=e.get("Plugin"),a=e.get("Platform"),i=r.getSource("logging");if(i){var s="desktop"===a.getType();s?n.resolve(i.isDestinationEnabled(t)):i.isDestinationEnabled(function(e){n.resolve(e)},function(e){n.reject(e)},t)}return n.promise}function L(t,o){if(void 0!==t&&(t=t.toLowerCase(),t===B||t===q||t===V||t===G)){var n=e.get("StoreFactory"),r=e.get("Plugin"),a=e.get("Platform"),i=r.getSource("logging");if(i){var s="desktop"===a.getType();o?(s?i.setRootLogLevel(t,o):i.setRootLogLevel(function(){},function(){},t,o),o===J?(Ce=t,n.set(oe,t)):o===W?(he=t,n.set(ne,t)):o===K&&n.set(re,t)):(s?(i.setRootLogLevel(t,W),i.setRootLogLevel(t,J),i.setRootLogLevel(t,K)):(i.setRootLogLevel(function(){},function(){},t,W),i.setRootLogLevel(function(){},function(){},t,J),i.setRootLogLevel(function(){},function(){},t,K)),n.set(oe,t),n.set(ne,t),n.set(re,t))}}}function A(t){var o=e.get("$q"),n=o.defer(),r=e.get("Plugin"),a=e.get("Platform"),i=r.getSource("logging");if(i){var s="desktop"===a.getType();s?n.resolve(i.getRootLogLevel(t)):i.getRootLogLevel(function(e){n.resolve(e)},function(e){n.reject(e)},t)}return n.promise}function b(t){void 0===t?t=X:t<X?t=X:t>Q&&(t=Q),de=t;var o=e.get("StoreFactory");o.set(ae,t)}function j(t,o){var n=e.get("Plugin"),r=e.get("Platform"),a=n.getSource("logging");if(a){var i="desktop"===r.getType();o?i?a.configure(t,o):a.configure(function(){},function(){},t,o):i?(a.configure(t,W),a.configure(t,J),a.configure(t,K)):(a.configure(function(){},function(){},t,W),a.configure(function(){},function(){},t,J),a.configure(function(){},function(){},t,K))}}function x(t){var o=e.get("$q"),n=o.defer(),r=e.get("Plugin"),a=e.get("Platform"),i=r.getSource("logging");return i?c().then(function(){var e="desktop"===a.getType();e?i.zipLogFiles(t,function(e){n.resolve(e)}):i.zipLogFiles(function(e){n.resolve(e)},function(){n.reject()},t)}):n.reject(),n.promise}function $(e,t){return!!ge&&(t!==H&&(t===q?e===q||e===B||e===V||e===G:t===B?e===B||e===V||e===G:t===V?e===V||e===G:t!==G||e===G))}function E(o,n,r,a){var i=e.get("Plugin"),s=e.get("Platform"),c=i.getSource("logging");c&&x(a).then(function(e){var a="desktop"===s.getType();a?(location.href="mailto:"+o+"?subject="+n+"&body="+r,c.getRootLogFolder(function(e){t.shell.openItem(e)})):c.makeFilesPublic(function(e){T(o,n,r,e,function(){})},function(){},e)})}function T(t,o,n,r,a){var i=e.get("Plugin"),s=i.getSource("email");s.open({to:t,subject:o,body:n,attachments:r},function(){a()})}function k(){var t=e.get("$q"),o=t.defer(),n=e.get("Plugin"),r=e.get("Platform"),a=n.getSource("logging");if(a){var i="desktop"===r.getType();i?a.getLogFilePaths(function(e){o.resolve(e)}):a.getLogFilePaths(function(e){o.resolve(e)},function(e){o.reject(e)})}return o.promise}function F(){var t=e.get("$q"),o=t.defer(),n=e.get("Plugin"),r=e.get("Platform"),a=n.getSource("logging");if(a){var i="desktop"===r.getType();i?a.getArchivedLogFilePaths(function(e){o.resolve(e)}):a.getArchivedLogFilePaths(function(e){o.resolve(e)},function(e){o.reject(e)})}return o.promise}function I(t){var o=e.get("$q"),n=o.defer(),r=e.get("Plugin"),a=e.get("Platform"),i=r.getSource("logging");if(i){var s="desktop"===a.getType();s?n.resolve(t):i.makeFilesPublic(function(e){n.resolve(e)},function(e){n.reject(e)},t)}return n.promise}function _(){var t=e.get("Plugin"),o=e.get("Platform"),n=t.getSource("logging");if(n){var r="desktop"===o.getType();r?n.removePublicFiles():n.removePublicFiles(function(){},function(){})}}function P(){return Se.format(new Date)}function D(e){this.formatString=e;var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=function(e){return("0"+e).substr(-2,2)},r=function(e){return("00"+e).substr(-3,3)},a={d:["getDate",function(e){return n(e)}],m:["getMonth",function(e){return n(e+1)}],n:["getMonth",function(e){return t[e]}],w:["getDay",function(e){return o[e]}],y:["getFullYear"],H:["getHours",function(e){return n(e)}],M:["getMinutes",function(e){return n(e)}],S:["getSeconds",function(e){return n(e)}],s:["getMilliseconds",function(e){return r(e)}],i:["toISOString"]};this.format=function(e){var t=this.formatString.replace(/%(.)/g,function(t,o){var n=e[a[o][0]]();return null!=a[o][1]&&(n=a[o][1](n)),n});return t}}function N(){var e=function(e,t){return(parseInt(e,10)||0).toString(t)},t={s:function(e){return e.toString()},d:function(t){return e(t,10)},i:function(e){return this.d(e)},b:function(t){return e(t,2)},o:function(t){return e(t,8)},x:function(t){return e(t,16)},X:function(t){return e(t,16).toUpperCase()},e:function(e){return(parseFloat(e,10)||0).toExponential()},E:function(e){return this.e(e,10).toUpperCase()},f:function(e){return(parseFloat(e,10)||"0.0").toString()}},o="";for(var n in t)o+=n;for(var r=Array.prototype.slice.call(arguments).slice(),a=r.shift().toString().replace(new RegExp("%(["+o+"])","g"),function(e,o){if(!r.length)throw new Error("Too few elements");return t[o](r.shift())}),i=0;i<r.length;i++){var s=r[i];a+=" "+s}return a}var O,M,R,U={init:r,emailLogs:E,setRootLogLevel:L,flushBuffer:c,setBufferFrequency:b,configure:j,zipLogs:x,enableDisableLogging:v,enableDisableDestination:w,getLogFilePaths:k,getArchivedLogFilePaths:F,isLoggingEnabled:S,isDestinationEnabled:y,getRootLogLevel:A,makeFilesPublic:I,removePublicFiles:_,process$log:n},q="debug",B="info",V="warn",G="error",H="off",z="_cti_log_",W="client",J="app",K="native",X=1,Q=500,Y="env.logging.enabled",Z="env.logging.appDestinationEnabled",ee="env.logging.clientDestinationEnabled",te="env.logging.nativeDestinationEnabled",oe="env.logging.currentAppLogRootLevel",ne="env.logging.currentClientLogRootLevel",re="env.logging.currentNativeLogRootLevel",ae="env.logging.currentBufferSize",ie="env.logging.appLogFilePath",se="env.logging.clientLogFilePath",ce="env.logging.nativeLogFilePath",le="activeDbName",ue="requiresFlushDbNames",de=1,pe=[],ge=!1,me=!1,fe=!1,Ce=G,he=G,ve="x",Se=new D("%y-%m-%d %H:%M:%S:%s");if(window.console&&console.log){var we=console.log;console.log=function(){u(arguments),we.apply(this,arguments)}}if(window.console&&console.info){var ye=console.info;console.info=function(){p(arguments),ye.apply(this,arguments)}}if(window.console&&console.debug){var Le=console.debug;console.debug=function(){d(arguments),Le.apply(this,arguments)}}if(window.console&&console.error){var Ae=console.error;console.error=function(){g(arguments),Ae.apply(this,arguments)}}if(window.console&&console.warn){var be=console.warn;console.warn=function(){m(arguments),be.apply(this,arguments)}}return U}]),angular.module("app.core").factory("AudioPlayer",["$q","Plugin","electron","$interval","$log","$timeout","VibrateFactory",function(e,t,o,n,r,a,i){function s(e){var t=0,o=0;return e>0&&(t=Math.floor(e%60),o=Math.floor(e/60)),""+o+":"+(t<10?"0":"")+t}function c(e,t){return null===h?void r.error("Audio has not been initialised yet, cannot continue."):void h.getCurrentPosition(function(o){e({state:t,position:o>-1?o:0,currentTime:s(o)})})}function l(e,t,s){function S(e){if(e&&e.vibrate)if("none"!==e.vibratePattern){var t;"custom"===e.vibratePattern?""!==e.vibrateCustomPattern&&(t=e.vibrateCustomPattern.split(",")):t=e.vibratePattern.split(","),t&&i.vibratePattern(t,0,!0,e.forceVibrate)}else i.vibrate(0,!0,e.forceVibrate)}function w(){m&&m.vibrate&&i.stopVibration()}function y(e){switch(e){case d.MEDIA_NONE:n.cancel(C),a(function(){c(s,"released")},60);break;case d.MEDIA_STARTING:a(function(){c(s,"starting")},50);break;case d.MEDIA_RUNNING:a(function(){c(s,"playing")},50),C=n(function(){c(s,"running")},50),S(g);break;case d.MEDIA_PAUSED:n.cancel(C),a(function(){c(s,"paused")},60),w();break;case d.MEDIA_STOPPED:n.cancel(C),a(function(){c(s,"stopped")},60),w()}}function L(){function t(){g&&l(e,g,p[e])}if(g&&g.loop&&(g.loopCount>0||g.loopCount<=u)){var o=g.loopInterval;f=setTimeout(t,1e3*o),g.loopCount!=u&&g.loopCount--}else g=void 0}if(m={},m.vibrate=t.vibrate,m.vibratePattern=t.vibratePattern,m.vibrateCustomPattern=t.vibrateCustomPattern,m.forceVibrate=t.forceVibrate,null!==h){h.release();for(var A in p)void 0!==p[A]&&(n.cancel(C),c(p[A],"stopped"),p[A]=void 0)}p[e]=s,void 0!==o.app?(h={change:function(e){y(e)},play:function(){v.play(),h.change(d.MEDIA_RUNNING)},pause:function(){v.pause(),h.change(d.MEDIA_PAUSED)},stop:function(){v.pause(),v.currentTime=0,h.change(d.MEDIA_STOPPED)},getCurrentPosition:function(e){v.ended===!0&&h.stop(),e(v.currentTime)},getDuration:function(){return v.duration},release:function(){v.currentTime=0,h.change(d.MEDIA_NONE)}},v.onloadeddata=function(){h.play()},v.onended=function(){L(g)},v.setAttribute("src",e)):(h=new d(e,function(){L(g)},function(e){e&&0===e.code?r.info("No media player active"):r.error("Audio Error:",e)},function(e){y(e)}),h.setStreamId(function(){h.play()},t.streamId))}var u=-999999,d=t.getSource("Media"),p={},g=void 0,m=void 0,f=void 0,C=null,h=null,v=document.createElement("audio");return v.setAttribute("preload","auto"),{getDuration:function(e,n){if(void 0!==e&&0!==e.length)if(void 0!==o.app){var a=document.createElement("audio");a.setAttribute("preload","auto"),a.onloadeddata=function(e){n(e.currentTarget.duration,s(e.currentTarget.duration))},a.setAttribute("src",e)}else{var i=t.getSource("mediaproperties");if(i===!1)return;i.getProperties(function(e){n(e.duration,s(e.duration))},function(e){r.error("Audio Error, could not get media properties:",e)},e)}},play:function(e,t,o){t.loop&&(0==t.loopCount&&(t.loopCount=u),g=t),l(e,t,o)},stop:function(){g=void 0,clearTimeout(f),null!==h&&h.stop()},pause:function(){null!==h&&h.pause()},unpause:function(){null!==h&&h.play()}}}]),angular.module("app.core").factory("GoogleMapService",["$q","$rootScope",function(e,t){function o(o){if(!i){i=e.defer();var r=document.createElement("script");r.onload=function(){i.resolve()},r.onerror=function(e){i.resolve(e),i=void 0};var a=n(t.currentLanguage);o&&o.length>0?r.src="https://maps.googleapis.com/maps/api/js?key="+o+"&libraries=visualization&language="+a:r.src="https://maps.googleapis.com/maps/api/js?libraries=visualization&language="+a,document.head.appendChild(r)}return i.promise}function n(e){var t={ar:"ARABIC",eu:"BASQUE",bg:"BULGARIAN",bn:"BENGALI",ca:"CATALAN",cs:"CZECH",da:"DANISH",de:"GERMAN",el:"GREEK",en:"ENGLISH","en-AU":"ENGLISH (AUSTRALIAN)","en-GB":"ENGLISH (GREAT BRITAIN)",es:"SPANISH",fa:"FARSI",fi:"FINNISH",fil:"FILIPINO",fr:"FRENCH",gl:"GALICIAN",gu:"GUJARATI",hi:"HINDI",hr:"CROATIAN",hu:"HUNGARIAN",id:"INDONESIAN",it:"ITALIAN",iw:"HEBREW",ja:"JAPANESE",kn:"KANNADA",ko:"KOREAN",lt:"LITHUANIAN",lv:"LATVIAN",ml:"MALAYALAM",mr:"MARATHI",nl:"DUTCH",no:"NORWEGIAN",pl:"POLISH",pt:"PORTUGUESE","pt-BR":"PORTUGUESE (BRAZIL)","pt-PT":"PORTUGUESE (PORTUGAL)",ro:"ROMANIAN",ru:"RUSSIAN",sk:"SLOVAK",sl:"SLOVENIAN",sr:"SERBIAN",sv:"SWEDISH",tl:"TAGALOG",ta:"TAMIL",te:"TELUGU",th:"THAI",tr:"TURKISH",uk:"UKRAINIAN",vi:"VIETNAMESE","zh-CN":"CHINESE (SIMPLIFIED)","zh-TW":"CHINESE (TRADITIONAL)"},o=e.replace("_","-");return t[o]?o:(o=e.substr(0,2),t[o]?o:"en-GB")}function r(e){s.push(e)}function a(e){s.splice(s.indexOf(e),1)}var i,s=[];return window.addEventListener("resize",function(){for(var e=s.length;e--;)s[e]?google.maps.event.trigger(s[e],"resize"):s.splice(e,1)},!0),{requestGoogleMapsScript:o,registerResize:r,unregisterResize:a}}]),angular.module("app.core").factory("ListFactory",["$rootScope","SchemaHelper","StoreFactory",function(e,t,o){function n(e){var o=e.pages;o.forEach(function(e){var o=e.name,n=t.getItems(e.content,"content","list");n.forEach(function(e){var t=e.name;d(o,t,!0,!0,!0)})})}function r(e,t){return Math.ceil(e/(t||1))}function a(e,t,o){var n=[],r=1,a=t;if(o&&o>0){var i=Math.min(o,t),s=Math.floor(i/2);i%2===0&&(s-=1);var c=i-s-1;if(r=e-s,a=e+c,r<1){var l=1-r;r=1,a+=l}if(a>t){var u=a-t;a=t,r-=u}}for(var d=r;d<=a;d++)n.push(d);return n}function i(e,t){var n="$store.pages."+e+"."+t;return o.get(n)}function s(e,t,o){var n={numberOfItems:o.listData.length};if(o.search&&o.search.enabled){var r="";o.search.internal?r="internal":o.search.allowExternal&&o.search.external&&(r=o.search.external.simple?"simple":"advanced");var a=o.search.internal?o.search.term:o.search.external&&o.search.external.criteria||null,i=r,s=a,c=o.filteredListData.length;m(n,i,s,c)}var l=o.order.property,u=o.order.reverse?"desc":"asc";if(f(n,l,u),o.pagination&&o.pagination.enabled){var d=o.pagination.currentPage,p=o.pagination.totalPages,g=o.pagination.limit,v=o.pagination.currentPage>1,S=o.pagination.currentPage<o.pagination.totalPages;C(n,d,p,g,v,S)}return h(e,t,n)}function c(e,t,o,n,r){var a=g(e,t);if(!a)throw'Could not obtain list "'+t+'" on page "'+e+'"';if(r!==!0&&"external"!==a.search)throw'Search actions not allowed for list "'+t+'" on page "'+e+'"';var s=i(e,t);m(s,o,n,void 0),p(e,t,s)}function l(e,t,o,n){var r=g(e,t);if(!r)throw'Could not obtain list "'+t+'" on page "'+e+'"';var a=i(e,t);"switch"===n&&(n=a&&a.order&&a.order.property===o&&"asc"===a.order.direction?"desc":"asc"),f(a,o,n),p(e,t,a)}function u(e,t,o){var n=g(e,t);if(!n)throw'Could not obtain list "'+t+'" on page "'+e+'"';if(!n.pagination)throw'Pagination not enabled for list "'+t+'" on page "'+e+'"';var r=i(e,t),a=1,s=1,c=void 0;if(r&&r.pagination&&(s=r.pagination.totalPages||1,c=r.pagination.pageSize||void 0),isNaN(o)){if(r&&r.pagination){var l=r.pagination.currentPage||1;switch(o){case"first":a=1;break;case"prev":a=l-1;break;case"next":a=l+1;break;case"last":a=s}}}else a=o;a<1&&(a=1),a>s&&(a=s);var u=a>1,d=a<s;C(r,a,s,c,u,d),p(e,t,r)}function d(e,t,o,n,r){var a=g(e,t);if(!a)throw'Could not obtain list "'+t+'" on page "'+e+'"';var s=i(e,t);s&&(o&&delete s.search,n&&delete s.order,r&&delete s.pagination,p(e,t,s))}function p(t,o,n){h(t,o,n),e.$emit("UpdateList_"+t+"_"+o)}function g(e,o){if(!e||!o)return null;var n=t.schema,r=n.pages.filter(function(t){return t.name===e})[0];if(!r)return null;var a='//content//*[name="'+o+'"]';return JSON.search(r,a,!0)[0]}function m(e,t,o,n){e=e||{},angular.extend(e,{search:{mode:t,criteria:o,totalSearchResults:n}})}function f(e,t,o){e=e||{},angular.extend(e,{order:{property:t,direction:o}})}function C(e,t,o,n,r,a){e=e||{},angular.extend(e,{pagination:{currentPage:t,totalPages:o,pageSize:n,hasPreviousPage:r,hasNextPage:a}})}function h(e,t,n){var r="$store.pages."+e+"."+t;return o.set(r,n)}return{initializeListsForApp:n,calculateNumberOfPages:r,calculateVisiblePages:a,getListState:i,setListStateFromListScope:s,setListSearchState:c,setListOrderState:l,setListPaginationState:u,resetListState:d,triggerListRefresh:p}}]),angular.module("app.core").factory("VibrateFactory",["Platform","$timeout",function(e,t){function o(n,r,i){if(u=!1,r===!1)n<100&&(n=100),a(n,i);else{var s="android"===e.getName(),c="ios"===e.getName();c?(a(1,i),t(function(){u===!1&&o(1,r,i)},400)):s&&a(864e5,i)}}function n(e,t,o,n){if(o===!1){if(t<0&&(t=0),0===t)return;i(e,0,t,o,n),u=!1}else i(e,0,0,o,n),u=!1}function r(){navigator.vibrate(0),u=!0}function a(e,t){navigator.vibrate(e,t)}function i(o,n,r,l,d){var p="android"===e.getName(),g="ios"===e.getName();if(g){var m=s(o);c(m,function(){n++,t(function(){(l===!0&&u===!1||l===!1&&n<r&&u===!1)&&i(o,n,r,l,d)},1e3)})}else if(p){var f=0;o.forEach(function(e){f+=parseInt(e)}),a(o,d),t(function(){n++,t(function(){(l===!0&&u===!1||l===!1&&n<r&&u===!1)&&i(o,n,r,l,d)},1e3)},f)}}function s(e){var t=0;return{next:function(){if(t<e.length){var o=t;return t++,{value:e[o],done:!1,index:o}}return{done:!0}}}}function c(o,n){var r=o.next();if(r.done===!1){var i=(r.index+1)%2===0;if(i===!0)t(function(){c(o,n)},parseInt(r.value));else{a(parseInt(r.value));var s="ios"===e.getName();s?t(function(){c(o,n)},590):c(o,n)}}else n()}var l={vibrate:o,vibratePattern:n,stopVibration:r},u=!1;return l}]),angular.module("mobile-router",["LocalStorageModule"]),angular.module("mobile-router").provider("RouterConfig",function(){this.options={},this.set=function(e,t){switch(e){case"id":this.options.id=t;break;case"startPage":this.options.startPage=t;break;case"mode":switch(t){case"allin":case"intelligent":case"single":this.options[e]=t;break;default:console.log("Invalid Value: An invalid value for option 'mode' was specified.")}break;case"animation":switch(t){case"off":case"slide-in":case"slide-out":case"flip-in":case"fade-in":case"rotate-in-left":this.options[e]=t;break;default:console.log("Invalid Value: An invalid value for option 'animation' was specified.")}break;default:console.log("Invalid Option: An invalid option was specified.")}};var e=this;this.$get=function(){return{options:e.options,set:e.set}}}),angular.module("mobile-router").factory("RouteStack",["localStorageService",function(e){function t(t){l=t;var o=e.get(l+"_stack");u=angular.fromJson(o)||[]}function o(e){var t=a();e&&e!==t&&(e&&(u.length>=c&&u.shift(),u.push(e)),s())}function n(e){for(var t=-1,o=u.length-1;o>=0&&t===-1;o++)u[o]===e&&(t=o);t>-1&&(u.splice(t,1),s())}function r(){l&&(u=[],e.remove(l+"_stack"))}function a(){return u[u.length-1]}function i(){return u[u.length-2]}function s(){l&&e.set(l+"_stack",u)}var c=25,l=null,u=[];return{init:t,add:o,remove:n,clear:r,getCurrent:a,getPrevious:i}}]),angular.module("mobile-router").factory("Router",["RouterConfig","$templateCache","$log","$filter","RouteStack","$rootScope","$timeout","$q","$injector","$location","Auth",function(e,t,o,n,r,a,i,s,c,l,u){function d(e){return e.toString().replace(/\/$/,"").replace(/^\//,"")}function p(){return r.getPrevious()}function g(){var e=r.getCurrent(),t=r.getPrevious();e&&t&&(r.remove(e),L(t))}function m(e){for(var t=0;t<E.routes.length;t++)if(E.routes[t].path==e)return!0;return!1}function f(){return n("filter")(E.routes,{path:E.currentPath},!0)[0]}function C(e){T=e}function h(){var t=null;if(void 0!==e.options.id){r.init(e.options.id);var n=r.getCurrent();if(void 0!==e.options.startPage)t=e.options.startPage,w(b(t).actions);else if(null!==T)t=T,w(b(t).actions);else if(void 0!==b(n)){t=n;var a=b(n);w(a.actions)}else{var i=E.routes[0];angular.forEach(E.routes,function(e){e.start===!0&&(i=e)}),void 0!=i?(t=i.path,w(i.actions)):o.error("No first page available")}null!==t&&(window.location.hash="#"+t,window.cti.store.state.currentPage=t.replace("/",""),window.dispatchEvent(new CustomEvent("hashchange")))}E.isInitialized=!0}function v(e,n){if(void 0!=e)if(m(e)===!1){var r=d(e),a=n.templateUrl?n.templateUrl:r+".tpl.html";void 0!=n.template&&t.put(a,n.template),E.routes.push({path:e,id:r,templateUrl:a,possibilities:n.possibilities,actions:n.actions,start:n.start,auth:n.auth})}else o.error("Duplicate route names are not allowed.")}function S(){var e=window.location.href.match(/#(.*)$/);if(null!==e)return e[1]}function w(e){if(void 0!==e&&e.length>0){var t=c.get("ActionFactory");return t.triggerEvent("onpageload",e)}var o=s.defer();return o.resolve(),o.promise}function y(e){var t=s.defer();return e.auth===!0?u.authenticate().then(function(){t.resolve()})["catch"](function(e){t.reject(e)}):t.resolve(),t.promise}function L(e){function t(){e=e||"";var t=b(e);void 0!==t&&y(t).then(function(){w(t.actions).then(function(){window.cti.store.state.currentPage=e.replace("/",""),l.path(e)})})["catch"](function(e){a.errorMessage=e.message||e,l.path("/error")})}a.$$phase?t():a.$apply(t)}function A(e){var t=void 0;return angular.forEach(E.routes,function(o){void 0===t&&o.id==e&&(t=o)}),t}function b(e){var t=void 0;return angular.forEach(E.routes,function(o){void 0===t&&o.path==e&&(t=o)}),t}function j(e){var t=!1;return angular.forEach(E.views,function(o){o.path==e&&(t=!0)}),t}function x(){var t=f();if(void 0!=t)switch(e.options.mode){case"allin":angular.forEach(E.routes,function(e){j(e.path)===!1&&E.views.push(e)}),i(function(){E.animate=!0},1500);break;case"single":E.views=[t],i(function(){E.animate=!0},1500);break;case"intelligent":default:j(t.path)===!1&&E.views.push(t),i(function(){angular.forEach(t.possibilities,function(e){var t=A(e);void 0!=t&&j(t.path)===!1&&E.views.push(t)})},500),i(function(){E.animate=!0},1500)}}function $(e){E.currentPath!=e&&(E.currentPath=e,"/error"!=e&&r.add(e),x())}var E={routes:[],views:[],isInitialized:!1,animate:!1,currentPath:null,getCurrent:f,init:h,addRoute:v,go:L,lastRoute:p,goPrevious:g,setFirstPage:C},T=null;return window.onhashchange=function(e){if(e.newURL!=e.oldURL||void 0===e.newURL&&void 0===e.oldURL){var t=S();void 0!=t&&""!=t&&(a.$$phase?$(t):a.$apply(function(){$(t)}))}},E}]),angular.module("mobile-router").directive("mobileView",["Router","RouterConfig","StoreFactory","localStorageService","$rootScope","LoadingStatus","$timeout","Platform",function(e,t,o,n,r,a,i,s){return{restrict:"A",template:['<div class="grace-warning" ng-if="$root.grace">'," This app will expire on <strong>{{$root.grace | date:'short'}}</strong></strong>","</div>",'<div class="preview-bar" ng-if="::$root.cancelable">',' <a href="javascript:void(0)" ng-click="view.exit()">',' <span class="fa fa-arrow-circle-left"></span> BACK'," </a>",' <a href="javascript:void(0)" ng-click="view.toggle()" class="drop-menu">',' <span class="fa fa-ellipsis-h"></span>'," </a>","</div>",'<nav class="drop-menu-nav" ng-class="{\'open\': (view.open && $root.cancelable)}">',' <a href="javascript:void(0)" ng-click="view.reset()">',' <span class="fa fa-trash"></span> Reset'," </a>","</nav>","<div class=\"app-container\" ng-class=\"{'loading': (view.load.loading), 'cancelable': ($root.cancelable), 'grace': ($root.grace)}\">",' <div class="loader-container alert alert-primary">',' <span ng-if="view.load.loading" class="fa fa-spinner fa-spin"></span> {{view.load.message | translate}}'," </div>",' <div ng-repeat="route in view.router.views" id="{{::route.id}}" page-info ng-controller="PageController as page" class="page-container {{::view.config.options.animation}}" ng-class="{\'current\': (view.router.currentPath == route.path), \'animate\': (view.router.animate == true)}">',' <div class="flexbox-container" ng-form name="pageForm" md-form ng-include="route.templateUrl"></div>',' <div md-dom-ready="view.onDomReady(route)" ng-if="view.router.currentPath == route.path"></div>'," </div>","</div>"].join(""),controller:function(){var c=this;c.router=e,c.config=t,c.load=a,c.exit=function(){if(r.cancelable){var e=null!==n.get("cancelUrl")?n.get("cancelUrl"):n.get("backUrl");null!==e&&(n.remove("backUrl"),n.remove("appName"),o.set("env.exit","cancel"),window.location.href=e)}},c.open=!1,c.toggle=function(){c.open=!c.open},c.reset=function(){r.cancelable&&(o.destroyAllData(),window.location.reload())},c.onDomReady=function(e){i(function(){if(r.$emit("onPageContentLoaded",e),"ios"===s.getName()){var t=document.querySelector("#"+e.id),o=Array.prototype.slice.call(t.querySelectorAll(".scrollable-item"),0);o.forEach(function(e){e.classList.remove("scrollable-item-ios"),setTimeout(function(){e.classList.add("scrollable-item-ios")},100)})}},0)}},controllerAs:"view"}}]),angular.module("mobile-router").directive("endOfRender",["Router","$log",function(e,t){return{restrict:"E",link:function(o){t.log("END OF RENDER: ",o.route.id),e.rendered=!0}}}]),angular.module("app.core").factory("BaseLayerFactory",function(){function e(e){return window.CtLayerRegistration?window.CtLayerRegistration.getInstance(e)||null:null}return{getByName:e}}),angular.module("app.core").factory("ChatLayerFactory",["$q","$rootScope","$parse","SchemaHelper","StoreFactory","ActionFactory","TranslationService","Plugin","FileSystem","Camera","Platform",function(e,t,o,n,r,a,i,s,c,l,u){function d(){if(!y){y=e.defer();var o=document.createElement("script");o.onload=function(){y.resolve()},o.onerror=function(e){y.resolve(e),y=void 0},window.___supportsNativeWebComponents?(o.src=t.basedir+"web_components/collections/chat.es6.js",document.head.appendChild(o)):y.reject("Chat layer not supported on older platforms (for now)")}return y.promise}function p(e,t){
var o=e.name,n=e.actions,a=e.clConfig,i=angular.extend({},a);i=r.parse(i),i=g(i),i=m(i),i=f(i),i=C(i,t);var s=new window.CtChatLayer(o,i);n&&n.length&&w(o,s,n)}function g(e){var t=["xmpp.pingInterval","xmpp.pingTimeout","xmpp.loginTimeout","xmpp.maxMessageAge","behaviour.maxSubjectLength","behaviour.maxDescriptionLength","behaviour.maxConversationParticipants","behaviour.chatEntriesFetchBatchSize","behaviour.photoQuality","behaviour.defaultPriorityConversationExpiryTTL","behaviour.defaultPriorityConversationActivityTTL"];return t.forEach(function(t){var n=o(t),r=n.assign,a=n(e);if(a&&"number"!=typeof a){var i=~~parseInt(a.toString(),10);r(e,i)}}),e}function m(e){var t=n.getSchemaConfigItemsByItemType("language")||[],o=t.length>0;if(o){var r=window.cti.store.currentLanguageCode.replace("_","-"),a=r.split("-").shift();e.i18n={enabled:!0,language:a,locale:r,translateFn:function(e){return i.hasTranslation(e)===!1?null:i.translate(e)}}}else e.i18n={enabled:!1};return e}function f(e){return e.externalFunctions={captureOrSelectMedia:function(){return new Promise(function(t){var o=s.getSource("camera");if(o){var n=e.behaviour&&e.behaviour.photoQuality||80;l.takePhoto(n).then(function(e){return v(e)}).then(function(e){t(e)})}else l.selectPhoto().then(function(e){return v(e)}).then(function(e){t(e)})})},cancelMediaSeletion:function(e){return c.deleteMediaItem(e)},showMediaFullscreen:function(e){return new Promise(function(t,o){var n=u.getType();if("desktop"===n){var r=window.electron.shell.openItem(e);r?t():o("Could not open media: "+e)}else if("device"===n){var a=e.toLowerCase().endsWith(".encrypted");if(a){var i=s.getSource("fileEncryption");i&&i.viewEncryptedImage(t,o,e)}else{var c=s.getSource("fileopener");c&&c.openFile(t,o,e)}}else o("Full screen images unsuported on this platform")})}},e}function C(e,t){if(!t.settings)return h(e);var o=t.settings["push-notifications"];if(!o)return h(e);var n=o.android&&o.android.enabled===!0||o.ios&&o.ios.enabled===!0;return n?(e.xmpp.push={enabled:n,voip:o.ios&&o.ios.voipEnabled===!0,packageId:t.packageId,senderId:o.android&&o.android.id||""},e):h(e)}function h(e){return e.xmpp.push={enabled:!1,voip:!1,packageId:"",senderId:""},e}function v(e){return new Promise(function(t){Promise.resolve(e).then(function(e){return Promise.all([c.resolveCdvFilePath(e),c.getFileNameFromPath(e)])}).then(function(e){return Promise.all([e[0],c.getFile(e[1])])}).then(function(e){t({path:e[0],mimeType:e[1].mimeType,base64:null})})})}function S(e){return window.CtChatLayer.getInstance(e)||null}function w(e,t,o){document.addEventListener("base-layer-ready:"+e,function(e){a.triggerEvent("chat-layer-ready",o,e.detail.layer)}),t.on("login-result",function(e){if(e.success){var n=t.getCurrentUser();a.triggerEvent("login",o,{user:n&&n.jid||null})}}),t.on("logout-result",function(e){e.success&&a.triggerEvent("logout",o)}),t.on("connection-status-change",function(e){a.triggerEvent("connection-status-change",o,{status:e.status})}),t.on("chat-notification",function(e){a.triggerEvent("chat-notification",o,{chatEntry:e.chatEntry,conversationTitle:e.conversationTitle,messagePreview:e.messagePreview,isForCurrentConversation:e.isForCurrentConversation})}),t.on("priority-conversation-notification",function(e){a.triggerEvent("priority-conversation-notification",o,{conversation:e.conversation,alert:e.alert,autoAlert:e.autoAlert,mustAcknowledge:e.mustAcknowledge})}),t.on("priority-conversation-acknowledged",function(e){a.triggerEvent("priority-conversation-acknowledged",o,{conversation:e.conversation,pendingCount:e.pendingCount})}),t.on("force-quit-conversation",function(e){a.triggerEvent("force-quit-conversation",o,{conversation:e.conversation})}),t.on("mute",function(){a.triggerEvent("chat-mute",o,{})})}var y;return{load:d,init:p,getByName:S}}]),angular.module("app.core").factory("IncidentLayerFactory",["$q","$rootScope","$parse","StoreFactory","ActionFactory",function(e,t,o,n,r){function a(){if(!u){u=e.defer();var o=document.createElement("script");o.onload=function(){u.resolve()},o.onerror=function(e){u.resolve(e),u=void 0},window.___supportsNativeWebComponents?(o.src=t.basedir+"web_components/collections/incident.es6.js",document.head.appendChild(o)):u.reject("Incident layer not supported on older platforms (for now)")}return u.promise}function i(e){var t=e.name,o=e.actions,r=e.ilConfig,a=angular.extend({},r);a=n.parse(a),a=s(a);var i=new window.CtIncidentLayer(t,a);o&&o.length&&l(t,i,o)}function s(e){var t=["xmpp.bot.timeout","xmpp.pingInterval","xmpp.pingTimeout","xmpp.initTimeout","xmpp.loginTimeout","xmpp.maxMessageAge","behaviour.incidentExpiration"];return t.forEach(function(t){var n=o(t),r=n.assign,a=n(e);if(a&&"number"!=typeof a){var i=~~parseInt(a.toString(),10);r(e,i)}}),e}function c(e){return window.CtIncidentLayer.getInstance(e)||null}function l(e,t,o){document.addEventListener("base-layer-ready:"+e,function(){r.triggerEvent("incident-layer-ready",o,{})}),t.on("login-result",function(e){if(e.success){var n=t.getCurrentUser(),a=n&&n.role;r.triggerEvent("login",o,{user:n&&n.jid||null,role:a&&a.id||null})}}),t.on("logout-result",function(e){e.success&&r.triggerEvent("logout",o)}),t.on("connection-status-change",function(e){r.triggerEvent("connection-status-change",o,{status:e.status})}),t.on("new-incident",function(e){r.triggerEvent("new-incident",o,{incident:e.incident})}),t.on("incident-updated",function(e){r.triggerEvent("incident-updated",o,{incident:e.incident})}),t.on("incident-response",function(e){r.triggerEvent("incident-response",o,{incident:e.incident,response:e.response})}),t.on("incident-severity-change",function(e){r.triggerEvent("incident-severity-change",o,{oldIncident:e.oldIncident,newIncident:e.newIncident})}),t.on("incident-closed",function(e){r.triggerEvent("incident-closed",o,{incident:e.incident})}),t.on("incident-alert",function(e){r.triggerEvent("incident-alert",o,{incident:e.incident,response:e.response})},!1,!0),t.on("incident-alert-dismissed",function(){r.triggerEvent("incident-alert-dismissed",o)},!1,!0),t.on("report-downloaded",function(e){r.triggerEvent("report-downloaded",o,{filePath:e.filePath,report:e.report})})}var u;return{load:a,init:i,getByName:c}}]),angular.module("app.core").factory("PagerLayerFactory",["$q","$rootScope","ActionFactory",function(e,t,o){function n(){if(!s){s=e.defer();var o=document.createElement("script");o.onload=function(){s.resolve()},o.onerror=function(e){s.resolve(e),s=void 0},window.___supportsNativeWebComponents?(o.src=t.basedir+"web_components/collections/pager.es6.js",document.head.appendChild(o)):s.reject("Pager layer not supported on older platforms (for now)")}return s.promise}function r(e){var t=angular.extend({},e),o=t.name,n=t.actions;delete t._auto_id_,delete t["item-type"],delete t.name,delete t.type,delete t.str,delete t.actions;var r=new window.CtPagerLayer(o,t);n&&n.length&&i(o,r,n)}function a(e){return window.CtPagerLayer.getInstance(e)||null}function i(e,t,n){document.addEventListener("base-layer-ready:"+e,function(){o.triggerEvent("pager-layer-ready",n,{})}),t.on("connection-status-change",function(e){o.triggerEvent("connection-status-change",n,{status:e})}),t.on("new-page-received",function(e){o.triggerEvent("new-page-received",n,{$message:e})}),t.on("responded-to-page",function(e){o.triggerEvent("responded-to-page",n,{id:e})}),t.on("responded-to-all-pages",function(){o.triggerEvent("responded-to-all-pages",n)}),t.on("logout-request-confirmed",function(){o.triggerEvent("pager-logout-request-confirmed",n,{})}),t.on("mute",function(){o.triggerEvent("pager-mute",n,{})}),t.on("login-result",function(e){e.success?o.triggerEvent("login-success",n,{}):o.triggerEvent("login-fail",n,{})})}var s;return{load:n,init:r,getByName:a}}]),angular.module("app.core").factory("UserManagementLayerFactory",["$q","$rootScope","ActionFactory",function(e,t,o){function n(){if(!s){s=e.defer();var o=document.createElement("script");o.onload=function(){s.resolve()},o.onerror=function(e){s.resolve(e),s=void 0},window.___supportsNativeWebComponents?(o.src=t.basedir+"web_components/collections/user-management.es6.js",document.head.appendChild(o)):s.reject("User Management layer not supported on older platforms (for now)")}return s.promise}function r(e){var t=angular.extend({},e),o=t.name,n=t.actions;delete t._auto_id_,delete t["item-type"],delete t.name,delete t.type,delete t.str,delete t.actions;var r=new window.CtUMLayer(o,t);n&&n.length&&i(o,r,n)}function a(e){return window.CtUMLayer.getInstance(e)||null}function i(e,t,n){document.addEventListener("base-layer-ready:"+e,function(){o.triggerEvent("user-management-layer-ready",n,{})}),t.on("connection-status-change",function(e){o.triggerEvent("connection-status-change",n,{status:e})}),t.on("user-authorised",function(){o.triggerEvent("user-management-user-authorised",n,{})}),t.on("logout-request-confirmed",function(){o.triggerEvent("user-management-logout-request-confirmed",n,{})})}var s;return{load:n,init:r,getByName:a}}]),angular.module("app.core").factory("ForegroundBackground",["$log","SchemaHelper","ActionFactory","StoreFactory","LoggingFactory",function(e,t,o,n,r){function a(){function a(){r.isLoggingEnabled().then(function(t){t===!0&&e.info("App has gone foreground")}),window.cti.store.state.foreground=!0,n.save();var a=t.getSchemaConfigItemsByItemType("onforeground");a&&a.length>0&&o.triggerEvent("onforeground",a[0].actions)}function i(){r.isLoggingEnabled().then(function(t){t===!0&&e.info("App has gone background")}),window.cti.store.state.foreground=!1,n.save();var a=t.getSchemaConfigItemsByItemType("onbackground");a&&a.length>0&&o.triggerEvent("onbackground",a[0].actions)}n.set("state.foreground",!0),document.addEventListener("deviceready",function(){document.addEventListener("pause",i,!1),document.addEventListener("resume",a,!1),window.removeEventListener("blur",i,!1),window.removeEventListener("focus",a,!1)}),window.addEventListener("blur",i,!1),window.addEventListener("focus",a,!1)}return{init:a}}]),angular.module("app.core").factory("ScreenOrientation",["Plugin","electron",function(e,t){function o(){return void 0!==t.app}function n(){if(o())return"";var t=e.getSource("screen");if(t){var n=t.orientation||"";return"object"==typeof n&&"type"in n&&(n=n.type),n.indexOf("landscape")!==-1?i.LANDSCAPE:i.PORTRAIT}return""}function r(t){if(!o()){var n=e.getSource("screen");n&&n.lockOrientation(t)}}function a(){if(!o()){var t=e.getSource("screen");t&&t.unlockOrientation()}}var i={PORTRAIT:"portrait",LANDSCAPE:"landscape"};return{ORIENTATION:i,getOrientation:n,lockOrientation:r,unlockOrientation:a}}]),angular.module("app.core").factory("WcUtils",["StoreFactory",function(e){function t(t,o,n){if(t&&t[0]){if(angular.isObject(o)&&Object.keys(o).length>0)for(var r in o)if(o.hasOwnProperty(r)&&0!==r.indexOf("$")){var a=o[r],i=!1;null===a&&(i=!0),"string"==typeof a&&a.indexOf("{{")!==-1&&(i=!0,a=e.parse(a)),!i&&n||(""!==a&&void 0!==a&&null!==a?t[0].setAttribute(r,a):t[0].removeAttribute(r))}t[0].$$attrsHandled=!0}}function o(e,t){e&&e[0]&&angular.isObject(t)&&Object.keys(t).length>0&&e[0].setAttribute("md-expressions",JSON.stringify(t))}function n(e,t){e&&e[0]&&(e[0].setAttribute("md-actions","from-schema"),t&&e[0].setAttribute("md-actions-event-detail-only","true"))}function r(e,t){e&&e[0]&&(e[0].setAttribute("md-actions","from-callback"),e[0].setAttribute("md-actions-callback-factory",t))}return{applyAttributes:t,applyExpressions:o,applyActionsFromSchema:n,applyActionsFromCallback:r}}]),angular.module("app.core").factory("ctDataGrid",["$rootScope","WcUtils","SchemaHelper","StoreFactory","TranslationService","DirectiveBridge",function(e,t,o,n,r,a){function i(e,o){switch(e){case"grid":return function(){var n=angular.element('<ct-data-grid id="'+o.name+'" schema-source="'+o._auto_id_+'" ct-data-grid-bridge></ct-data-grid>'),r=s(n,e,o);return t.applyAttributes(n,r),t.applyExpressions(n,o.expressions),t.applyActionsFromSchema(n,!0),n}();case"column":case"edit-actions-column":return function(){var n=r.translate(o.heading)||"",a=angular.element("<ct-data-col>"+n+"</ct-data-col>"),i=s(a,e,o);return t.applyAttributes(a,i),a}()}return!1}function s(e,t,o){function a(e,t){""!==t&&void 0!==t&&(i[e]=t)}var i={};switch(t){case"grid":!function(){"remote"===o.sourceType&&(a("data-source",o.dataSource),a("data-source-method",o.dataSourceMethod),a("data-source-page-param",o.dataSourcePageParam),a("data-source-page-size-param",o.dataSourcePageSizeParam),a("data-source-search-param",o.dataSourceSearchParam),a("data-source-sort-column-param",o.dataSourceSortColumnParam),a("data-source-sort-direction-param",o.dataSourceSortDirectionParam),a("data-results-property",o.dataResultsProperty),a("data-results-total-property",o.dataResultsTotalProperty),a("use-local-interaction",o.useLocalInteraction)),a("show-search",o.showSearch),a("fixed-headers",o.fixedHeaders);var t=!1;if(0===o.usePagination.indexOf("{{")){var r=o.usePagination.replace("{{","").replace("}}","");t=n.getForElement(r,e)}else t="true"===o.usePagination;t?(a("page-size",o.pageSize),a("show-pagination",o.showPagination)):(a("page-size",null),a("show-pagination",null)),a("row-css-key",o.rowCssKey),a("selection-mode",o.selectionMode),a("class",o.classes)}();break;case"column":!function(){a("key",o.key),a("data-type",o.dataType),o.useDisplayKey&&o.displayKey&&a("display-key",o.displayKey),a("css-key",o.cssKey),a("sortable",o.sortable),a("sort",o.sort),a("editable",o.editable),a("width",o.width),a("class",o.classes)}();break;case"edit-actions-column":!function(){a("data-type","controls"),a("edit-button-label",r.translate(o.editButtonLabel)||""),a("save-button-label",r.translate(o.saveButtonLabel)||""),a("cancel-button-label",r.translate(o.cancelButtonLabel)||""),a("width",o.width),a("class",o.classes)}()}return i}function c(e){var t=e.pages;t.forEach(function(e){var t=e.name,n=o.getItems(e.content,"content","data-grid");n.forEach(function(e){var o=e.name;u(t,o)})})}function l(e,t){var o="$store.pages."+e+"."+t;return n.get(o)}function u(e,t){var o="$store.pages."+e+"."+t;return n.set(o,void 0)}function d(e,t,o,n){var r=n.getVisibleData(),a=n.getSearch(),i=n.getSort(),s=n.getPage(),c={numberOfItems:a.unfilteredTotalResults,visibleData:r},l=a&&a.query||"",u=a?a.totalResults:void 0;w(c,l,u);var d=i&&i.column||"",p=i&&i.direction||"";if(y(c,d,p),"false"!==o.usePagination&&s){var g=s.number,m=s.total,f=s.pageSize,C=s.hasPrevious,h=s.hasNext;L(c,g,m,f,C,h)}return A(e,t,c)}function p(e,t,o){var n=S(e,t);if(!n)throw'Could not obtain dataGrid "'+t+'" on page "'+e+'"';var r=l(e,t);w(r,o,void 0),C(e,t,r)}function g(e,t,o,n){var r=S(e,t);if(!r)throw'Could not obtain dataGrid "'+t+'" on page "'+e+'"';var a=l(e,t);"switch"===n&&(n=a&&a.order&&a.order.column===o&&"asc"===a.order.direction?"desc":"asc"),y(a,o,n),C(e,t,a)}function m(e,t,o){var n=S(e,t);if(!n)throw'Could not obtain dataGrid "'+t+'" on page "'+e+'"';if("false"===n.usePagination)throw'Pagination not enabled for dataGrid "'+t+'" on page "'+e+'"';var r=l(e,t),a=1,i=1,s=void 0;if(r&&r.pagination&&(i=r.pagination.totalPages||1,s=r.pagination.pageSize||void 0),isNaN(o)){if(r&&r.pagination){var c=r.pagination.currentPage||1;switch(o){case"first":a=1;break;case"prev":a=c-1;break;case"next":a=c+1;break;case"last":a=i}}}else a=o;a<1&&(a=1),a>i&&(a=i);var u=a>1,d=a<i;L(r,a,i,s,u,d),C(e,t,r)}function f(e,t,o,n,r){var a=S(e,t);if(!a)throw'Could not obtain dataGrid "'+t+'" on page "'+e+'"';var i=l(e,t);i&&(o&&delete i.search,n&&delete i.order,r&&delete i.pagination,C(e,t,i))}function C(t,o,n){A(t,o,n),e.$emit("UpdateDataGrid_"+t+"_"+o)}function h(e,t,o,n){var r=S(e,t);if(!r)throw'Could not obtain dataGrid "'+t+'" on page "'+e+'"';var i=a.getItemApi(e,t);if(i)switch(o){case"selected":var s=angular.copy(n);if(angular.isArray(s)||(s=[s]),!b(s))throw"Invalid value of indexes: "+n;i.editIndexes(s);break;case"all":i.editAll();break;default:throw"Unknown items selection: "+o}}function v(e,t){var o=S(e,t);if(!o)throw'Could not obtain dataGrid "'+t+'" on page "'+e+'"';var n=a.getItemApi(e,t);return n?n.finishedEdit():[]}function S(e,t){if(!e||!t)return null;var n=o.schema,r=n.pages.filter(function(t){return t.name===e})[0];if(!r)return null;var a='//content//*[name="'+t+'"]';return JSON.search(r,a,!0)[0]}function w(e,t,o){angular.extend(e,{search:{query:t,totalSearchResults:o}})}function y(e,t,o){angular.extend(e,{order:{column:t,direction:o}})}function L(e,t,o,n,r,a){angular.extend(e,{pagination:{currentPage:t,totalPages:o,pageSize:n,hasPreviousPage:r,hasNextPage:a}})}function A(e,t,o){var r="$store.pages."+e+"."+t;return n.set(r,o)}function b(e){var t=e.some(function(e){return"number"!=typeof e});return!t}return{buildDom:i,getAttributes:s,initializeDataGridsForApp:c,getDataGridState:l,setDataGridStateFromComponent:d,setDataGridSearchState:p,setDataGridOrderState:g,setDataGridPaginationState:m,resetDataGridState:f,triggerDataGridRefresh:C,startEditMode:h,finishEditMode:v}}]),angular.module("app.core").directive("ctDataGridBridge",["$rootScope","$log","StoreFactory","ActionFactory","WcUtils","DirectiveBridge","ctDataGrid",function(e,t,o,n,r,a,i){return{restrict:"A",scope:!0,require:["?^mdContextProvider","^pageInfo"],link:function(s,c,l,u){function d(){return i.getDataGridState(w,y)}function p(){L||(g(),L=!0)}function g(){var e=d();if(e){var t=h.getSearch();t&&e.search?t.query!==e.search.query&&h.setSearch(e.search.query):h.setSearch(null);var o=h.getSort();o&&e.order?o.column===e.order.column&&o.direction===e.order.direction||h.setSort(e.order.column,e.order.direction):h.setSort(null);var n=h.getPage();n&&e.pagination?n.number!==e.pagination.currentPage&&h.setPage(e.pagination.currentPage||1):n&&h.setPage(null)}}function m(){v&&v.isRepeaterContextProvider()||i.setDataGridStateFromComponent(w,y,s._schema,h)}function f(e){C(e.detail)}function C(e){if("dynamic"===s._schema.sourceType&&s._schema.model&&s._schema.autoSaveEdits===!0){e instanceof Array==!1&&(e=[e]);var t=o.getForElement(s._schema.model,c);e.forEach(function(e){angular.extend(t[e.__idx],e.newValue)}),o.setForElement(s._schema.model,t,c,!0)}}var h=c[0],v=u[0],S=u[1],w=S.name,y=s._schema.name,L=!1;"static"===s._schema.sourceType&&s._schema.data?h.addEventListener("ready",function(){var e=null;try{e=JSON.parse(s._schema.data)}catch(o){t.error("Couldn't parse static data for grid:",o)}null!==e&&(p(),h.setData(e))}):"dynamic"===s._schema.sourceType&&s._schema.model?s.$watch(function(){return o.getForElement(s._schema.model,c)},function(e){h.isReady===!0&&(p(),h.setData(e))},!0):"remote"===s._schema.sourceType&&p(),e.$on("StoreChanged",function(){var e=i.getAttributes(c,"grid",s._schema);r.applyAttributes(c,e,!0)});var A=e.$on("UpdateDataGrid_"+w+"_"+y,g);h.addEventListener("data-rendered",m),h.addEventListener("data-change",f),s.$on("$destory",function(){A(),h.removeEventListener("data-rendered",m),h.removeEventListener("data-change",f)}),a.registerItemApi(w,y,{editIndexes:function(e){h.edit(e)},editAll:function(){var e=d();if(e){for(var t=[],o=0;o<e.numberOfItems;o++)t.push(o);h.edit(t)}},finishedEdit:function(){var e=h.finishedEdit();return C(e),e.forEach(function(e){n.triggerEvent("data-change",s._schema.actions,e)}),e}})}}}]),angular.module("app.core").factory("ctCommonLoginFormFactory",["$rootScope","WcUtils","ActionFactory",function(e,t,o){function n(e){var o=angular.element("<"+i+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,r(e)),t.applyExpressions(o,e.expressions),t.applyActionsFromCallback(o,"ctCommonLoginFormFactory#applyActions"),o}function r(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("theme",e.theme),t("auto-append-domain-name",e.autoAppendDomainName),t("username",e.username),t("hide-username",e.hideUsername),t("disable-username",e.disableUsername),t("log-in-label",e.logInLabel),o}function a(e,t){e[0].addEventListener("login-form-result",function(e){var n=e.detail;n.success?o.triggerEvent("login-success",t,{}):o.triggerEvent("login-failure",t,{exception:n.exception})})}var i="ct-login-form";return{buildDom:n,getAttributes:r,applyActions:a}}]),angular.module("app.core").factory("ctCommonOnlineIndicatorFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("show-icon",e.showIcon),t("show-text",e.showText),o}var r="ct-online-indicator";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctCommonUserDisplayFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");if(t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),e.label){var a=angular.element('<div style="display: flex;">'),i=angular.element('<div class="user-display-label"></div>');return i.text(e.label),a.append(i),a.append(" "),a.append(o),a.attr("id",e.name),a.attr("schema-source",e._auto_id_),a}return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("type",e.displayType),t("show-icon",e.showIcon),o}var r="ct-user-display";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctCommonSlidePanelFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("menu-width",e.menuWidth),o}var r="ct-slide-panel";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctCommonDebuggerFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),o}var r="ct-debugger";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctCLConversationListFactory",["$rootScope","WcUtils","ActionFactory",function(e,t,o){function n(e){var o=angular.element("<"+i+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,r(e)),t.applyExpressions(o,e.expressions),t.applyActionsFromCallback(o,"ctCLConversationListFactory#applyActions"),o}function r(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),o}function a(e,t){e[0].addEventListener("go-new-conversation",function(){o.triggerEvent("go-new-conversation",t,{})}),e[0].addEventListener("go-chat",function(){o.triggerEvent("go-chat",t,{})})}var i="ct-cl-conversation-list";return{buildDom:n,getAttributes:r,applyActions:a}}]),angular.module("app.core").factory("ctCLNewConversationFactory",["$rootScope","WcUtils","StoreFactory","ActionFactory",function(e,t,o,n){function r(e){var o=angular.element("<"+s+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,a(e)),t.applyExpressions(o,e.expressions),t.applyActionsFromCallback(o,"ctCLNewConversationFactory#applyActions"),o}function a(e){function t(e,t){""!==t&&void 0!==t&&(n[e]=t)}var n={};t("class",e.classes),t("owner",e.layer),t("allow-search",e.allowSearch),t("require-search",e.requireSearch);var r=e.showCountFrom.indexOf("{{")!==-1?o.parse(e.showCountFrom):e.showCountFrom,a=parseInt(r,10);return(a||0)>0&&t("show-count-from",a.toString()),n}function i(e,t){e[0].addEventListener("go-back",function(){n.triggerEvent("go-back",t,{})}),e[0].addEventListener("go-chat",function(){n.triggerEvent("go-chat",t,{})})}var s="ct-cl-new-conversation";return{buildDom:r,getAttributes:a,applyActions:i}}]),angular.module("app.core").factory("ctCLChatMessageListFactory",["$rootScope","WcUtils","ActionFactory",function(e,t,o){function n(e){var o=angular.element("<"+i+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,r(e)),t.applyExpressions(o,e.expressions),t.applyActionsFromCallback(o,"ctCLChatMessageListFactory#applyActions"),o}function r(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),o}function a(e,t){e[0].addEventListener("go-back",function(){o.triggerEvent("go-back",t,{})}),e[0].addEventListener("go-info",function(){o.triggerEvent("go-info",t,{})}),e[0].addEventListener("go-leave",function(){o.triggerEvent("go-leave",t,{})}),e[0].addEventListener("go-end",function(){o.triggerEvent("go-end",t,{})})}var i="ct-cl-chat-message-list";return{buildDom:n,getAttributes:r,applyActions:a}}]),angular.module("app.core").factory("ctCLConversationInfoFactory",["$rootScope","WcUtils","ActionFactory",function(e,t,o){function n(e){var o=angular.element("<"+i+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,r(e)),t.applyExpressions(o,e.expressions),t.applyActionsFromCallback(o,"ctCLConversationInfoFactory#applyActions"),o}function r(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),o}function a(e,t){e[0].addEventListener("go-back",function(){o.triggerEvent("go-back",t,{})}),e[0].addEventListener("go-add-contacts",function(){o.triggerEvent("go-add-contacts",t,{})}),e[0].addEventListener("go-chat",function(){o.triggerEvent("go-chat",t,{})})}var i="ct-cl-conversation-info";return{buildDom:n,getAttributes:r,applyActions:a}}]),angular.module("app.core").factory("ctCLAddConversationContactsFactory",["$rootScope","WcUtils","StoreFactory","ActionFactory",function(e,t,o,n){function r(e){var o=angular.element("<"+s+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,a(e)),t.applyExpressions(o,e.expressions),t.applyActionsFromCallback(o,"ctCLAddConversationContactsFactory#applyActions"),o}function a(e){function t(e,t){""!==t&&void 0!==t&&(n[e]=t)}var n={};t("class",e.classes),t("owner",e.layer),t("allow-search",e.allowSearch),t("require-search",e.requireSearch);var r=e.showCountFrom.indexOf("{{")!==-1?o.parse(e.showCountFrom):e.showCountFrom,a=parseInt(r,10);return(a||0)>0&&t("show-count-from",a.toString()),n}function i(e,t){e[0].addEventListener("go-back",function(){n.triggerEvent("go-back",t,{})})}var s="ct-cl-add-conversation-contacts";return{buildDom:r,getAttributes:a,applyActions:i}}]),angular.module("app.core").factory("ctILRoleSelectionFactory",["$rootScope","WcUtils","ActionFactory",function(e,t,o){function n(e){var o=angular.element("<"+i+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,r(e)),t.applyExpressions(o,e.expressions),t.applyActionsFromCallback(o,"ctILRoleSelectionFactory#applyActions"),o}function r(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),o}function a(e,t){e[0].addEventListener("role-selection",function(e){var n=e.detail;o.triggerEvent("role-selection",t,{role:n.role})})}var i="ct-il-role-selection";return{buildDom:n,getAttributes:r,applyActions:a}}]),angular.module("app.core").factory("ctILIncidentListFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("max-incidents",e.maxIncidents),t("max-incident-age",e.maxIncidentAge),t("status-filter",e.statusFilter),t("order-by",e.orderBy),t("order-by-reverse",e.orderByReverse),t("show-test-incidents",e.showTestIncidents),t("no-incidents-message",e.noIncidentsMessage),t("view",e.view),t("view-options",e.viewOptions),o}var r="ct-il-incident-list";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctILLastIncidentDisplayFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("view",e.view),t("view-options",e.viewOptions),o}var r="ct-il-last-incident-display";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctILNewIncidentButtonFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),e.labelOverride&&o.text(e.labelOverride),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),e.raisePredefinedIncident===!0&&t("predefined-incident-id",e.predefinedIncidentId),o}var r="ct-il-new-incident-button";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctILUserListFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("view",e.view),t("view-options",e.viewOptions),o}var r="ct-il-user-list";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctILReportListFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("max-reports",e.maxReports),t("max-report-age",e.maxReportAge),t("own-reports-only",e.ownReportsOnly),t("no-reports-message",e.noReportsMessage),t("view",e.view),t("view-options",e.viewOptions),o}var r="ct-il-report-list";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctPGListFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("enable-touch-features",e.enableTouchFeatures),o}var r="ct-pg-list";return{buildDom:o,getAttributes:n}}]),angular.module("app.core").factory("ctUMListFactory",["$rootScope","WcUtils",function(e,t){function o(e){var o=angular.element("<"+r+">");return o.attr("id",e.name),o.attr("schema-source",e._auto_id_),t.applyAttributes(o,n(e)),t.applyExpressions(o,e.expressions),o}function n(e){function t(e,t){""!==t&&void 0!==t&&(o[e]=t)}var o={};return t("class",e.classes),t("owner",e.layer),t("type",e.listType),o}var r="ct-um-list";return{buildDom:o,getAttributes:n}}]),function(){function e(){"true"===document.head.getAttribute("data-is-client")&&document.URL.indexOf("file://")!==-1&&(v="./client/");var e=localStorage.getItem("appName");g=void 0!==e&&null!==e,m?(document.addEventListener("deviceready",t,!1),setTimeout(function(){f||(console.error("deviceready was not fired"),r())},d)):r()}function t(){f=!0,g||void 0===window.plugins||null===window.plugins||void 0===window.plugins.provisioning||null===window.plugins.provisioning?r():(p=window.plugins.provisioning,document.addEventListener("updateavailable",o,!1),r())}function o(e){function t(){p.installVersion(function(){p.restartApplication(function(){},function(){console.error("Provisioning failed to restart and install new version");
})},function(){console.error("Provisioning failed to update")},{version:e.detail.version})}function o(){console.info("Update postponed.")}n(e,t,o)}function n(e,t,o){if(!C){C=!0,document.querySelectorAll("#version-modal .version-number")[0].innerText=e.detail.version;var n=document.getElementById("version-modal");n.style.display="block",document.querySelectorAll("#version-modal .confirm-button")[0].addEventListener("click",function(){C=!1,n.style.display="none",void 0!==t&&t()}),document.querySelectorAll("#version-modal .dismiss-button")[0].addEventListener("click",function(){C=!1,n.style.display="none",void 0!==o&&o()})}}function r(){h.when().then(function(){return a()}).then(function(){return i()}).then(function(){s()})}function a(){var e=h.defer();return h.when().then(function(){return c("assets/js/polyfills/custom-events.js")}).then(function(){e.resolve()}),e.promise}function i(){window.___supportsNativeWebComponents=!!window.customElements&&!!HTMLElement.prototype.attachShadow;var e=h.defer();return h.when().then(function(){return l(!window.___supportsNativeWebComponents,"assets/js/polyfills/web-component-polyfills.js")}).then(function(){return l(window.___supportsNativeWebComponents,"assets/js/skatejs/skate.es6.js")}).then(function(){return u(window.___supportsNativeWebComponents,"web_components/dist/web-components.es6.js","web_components/dist/web-components.es5.js")}).then(function(){e.resolve()}),e.promise}function s(){var e=document.body.getAttribute("data-schema"),t=window.document.querySelectorAll("body div.view-frame")[0];t.setAttribute("md-app",""+(g?"":e?e:"config.json")),angular.element(document).ready(function(){angular.bootstrap(document,["app"])})}function c(e){var t=h.defer(),o=document.createElement("script");return o.onload=function(){t.resolve()},o.src=v+e,document.head.appendChild(o),t.promise}function l(e,t){return e?c(t):h.when()}function u(e,t,o){return c(e?t:o)}var d=5e3,p=null,g=!1,m=window.cordova!==!1,f=!1,C=!1,h=angular.injector(["ng"]).get("$q"),v="./";document.addEventListener("DOMContentLoaded",e,!1)}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/area/mdList/mdList.tpl.html",'<div id="{{:: name }}"\n class="md-list {{:: classes }}">\n\n <div ng-if="::(search.internal || pagination.showAbove)"\n class="top">\n\n <div ng-if="::search.internal" class="search-area">\n\n <div class="search-box" ng-class="::{ \'input-group\': search.showButton }">\n <input type="text" class="form-control" ng-model="search.inputValue" ng-model-options="::{ debounce: { default: search.debounce, blur: 0 } }" md-on-enter="performSearch()" placeholder="{{ \'Search...\' | translate }}"/>\n <span ng-if="::search.showButton" class="input-group-btn">\n <button class="btn btn-default" ng-click="performSearch()">\n {{:: search.buttonLabel }}\n <span ng-if="::search.buttonIcon" class="fa {{:: search.buttonIcon }}"></span>\n </button>\n </span>\n </div>\n\n </div>\n\n <div ng-if="::pagination.showAbove"\n ng-show="pagination.visible"\n class="pagination-container"\n ng-include="\'components/area/mdList/mdListPagination.tpl.html\'">\n </div>\n\n </div>\n\n <div class="main scrollable">\n <ul class="md-list-items">\n <li md-list-item\n ng-repeat="$item in (filteredListData = (listData | filter:filter | orderBy:listOrder:order.reverse)) | limitTo:pagination.limit:pagination.start track by itemTrackFn($item, $index)"\n md-context-provider="::$item"\n md-context-item-collection="::listData"\n ng-class="itemCssClass($item, $index)">\n </li>\n </ul>\n </div>\n\n <div ng-if="::pagination.showBelow"\n class="bottom">\n\n <div ng-show="pagination.visible"\n class="pagination-container"\n ng-include="\'components/area/mdList/mdListPagination.tpl.html\'">\n </div>\n\n </div>\n\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/area/mdList/mdListPagination.tpl.html",'<nav>\n <ul class="pagination pagination-sm">\n <li ng-if="::pagination.showFirstLast"\n class="page-first"\n ng-class="{ \'disabled\': pagination.currentPage === 1 }">\n <a ng-click="goToPage(\'first\')">\n <span ng-if="::pagination.firstPageIcon" class="fa {{:: pagination.firstPageIcon }}"></span>\n {{ pagination.firstPageLabel | translate }}\n </a>\n </li>\n <li ng-if="::pagination.showPrevNext"\n class="page-prev"\n ng-class="{ \'disabled\': pagination.currentPage === 1 }">\n <a ng-click="goToPage(\'prev\')">\n <span ng-if="::pagination.prevPageIcon" class="fa {{:: pagination.prevPageIcon }}"></span>\n {{ pagination.prevPageLabel | translate }}\n </a>\n </li>\n <li ng-repeat="pageNumber in pagination.visiblePages"\n class="numbered-page"\n ng-class="{ \'active\': pageNumber === pagination.currentPage }">\n <a ng-click="goToPage(pageNumber)">\n {{ pageNumber }}\n </a>\n </li>\n <li ng-if="::pagination.showPrevNext"\n class="page-next"\n ng-class="{ \'disabled\': pagination.currentPage === pagination.totalPages }">\n <a ng-click="goToPage(\'next\')">\n {{ pagination.nextPageLabel | translate }}\n <span ng-if="::pagination.nextPageIcon" class="fa {{:: pagination.nextPageIcon }}"></span>\n </a>\n </li>\n <li ng-if="::pagination.showFirstLast"\n class="page-last"\n ng-class="{ \'disabled\': pagination.currentPage === pagination.totalPages }">\n <a ng-click="goToPage(\'last\')">\n {{ pagination.lastPageLabel | translate }}\n <span ng-if="::pagination.lastPageIcon" class="fa {{:: pagination.lastPageIcon }}"></span>\n </a>\n </li>\n </ul>\n</nav>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/md-barcode.tpl.html",'<div class="barcode-group" md-actions="{{actions}}">\n\n <div class="code-display" ng-if="displayValue !== false" ng-class="{\'placeholder\': (!inputModel)}">{{inputModel || \'--\'}}</div>\n\n <button class="btn btn-primary btn-lg" type="button">\n <span ng-if="codeType === \'bar\'">\n <span class="fa fa-barcode"></span> {{ \'Capture Barcode\' | translate }}\n </span>\n <span ng-if="codeType === \'qr\'">\n <span class="fa fa-qrcode"></span> {{ \'Capture QR Code\' | translate }}\n </span>\n </button>\n\n <input type="hidden" validation="{{validators}}" name="{{::name}}" id="{{::name}}" ng-model="inputModel" ng-required="required" class="form-control" />\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/md-checkbox.tpl.html",'<div class="container md-checkbox-container">\n <div class="checkbox-element" ng-repeat="option in options track by $index" ng-class="{\'vertical\': ($parent.$parent.vertical == true)}">\n <div class="md-checkbox" ng-class="{ \'no-label\': !option.label, selected: (model[option.id] == true), \'md-checkbox-disabled\': disabled }"\n md-actions="{{ actions }}"\n ng-click="makeSelection(option.id)">\n <span class="fa" ng-class="getClasses(option)"></span>\n <span>{{option.label | translate}}</span>\n </div>\n </div>\n <input type="hidden" name="{{name}}" validation="{{validators}}" ng-required="{{required}}" ng-model="model" />\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/md-radio.tpl.html",'<div class="container md-checkbox-container">\n <div class="checkbox-element" ng-repeat="option in options track by $index">\n <div class="md-checkbox" ng-class="{ \'no-label\': !option.label, selected: (model == option.value), \'md-radio-disabled\': (disabled) }"\n md-actions="{{ actions }}"\n ng-click="makeSelection(option.value)">\n <span class="fa" ng-class="getClasses(option)"></span>\n <span>{{option.label | translate}}</span>\n </div>\n </div>\n <input type="hidden" name="{{name}}" validation="{{validators}}" ng-required="{{required}}" ng-model="model" />\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/record-audio.tpl.html",'<div class="{{classes}}" ng-class="{ \'audio-recorder-small\': smallrecorder, \'audio-recorder\': !smallrecorder }">\n <a class="record-button" ng-click="recordButton()" ng-class="{ \'record-active\': state == 2, \'record-populated\': (isPopulated && !multiple) }">\n <span class="fa fa-stack fa-2x">\n <i id="mic-background" class="fa fa-stack-2x" ng-class="multiple ? (state == 2 ? \'fa-circle\' : \'fa-circle-thin\') : (state == 2 || isPopulated ? \'fa-circle\' : \'fa-circle-thin\')"></i>\n <i id="mic-foreground" class="fa fa-microphone fa-stack-1x"></i>\n </span>\n </a>\n <div ng-if="!smallrecorder" class="current-time">\n {{currentTime}}\n </div>\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/imageViewer/imageViewer.tpl.html",'<div class="image-viewer-container {{classes}}" ng-class="{\'dynamic\': (multiple || (image === undefined))}">\n <div class="image-frame" ng-if="multiple" ng-repeat="fileURI in files track by $index" ng-switch="getFileType(fileURI)">\n <img ng-switch-when="image" md-thumbnail="{{fileURI}}" md-thumbnail-maxwidth="200" md-thumbnail-maxheight="200" ng-click="open($index)"/>\n <div ng-switch-when="audio" class="media-player text-center" ng-click="open($index)"><span class="fa fa-file-audio-o fa-3x"></span><br><br><span>{{getViewableFilePath(fileURI)}}</span></div>\n </div>\n <div class="image-frame no-data" ng-if="(multiple && files.length === 0) || (!multiple && image === undefined)">\n <span class="fa fa-picture-o"></span>\n {{ \'No sources have been added.\' | translate }}\n </div>\n <img md-thumbnail="{{image | trusted}}" md-thumbnail-maxwidth="{{maxWidth}}" md-thumbnail-maxheight="{{maxHeight}}" ng-if="!multiple && image !== undefined && scaleImage" ng-click="open($index)"/>\n <img ng-src="{{image | trusted}}" ng-if="!multiple && image !== undefined && !scaleImage"/>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/imageViewer/imageViewerDisplay.tpl.html",'<div class="image-viewer-display-container"><div class="image-frame"><img ng-src="{{src}}" /></div><div class="image-footer"><a href="javascript:void(0)" class="danger" ng-click="delete()"><span class="fa fa-trash"></span> Delete</a><a href="javascript:void(0)" class="warning"><span class="fa fa-camera"></span> Retake</a><a href="javascript:void(0)" ng-click="close()" class="primary"><span class="fa fa-close"></span> Close</a></div></div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/mediaPlayer/audioPlayer.tpl.html","<div class=\"audio-player\" ng-class=\"{'play-active': (ap.info.state === 'running'), 'play-idle': (ap.info.state !== 'running'), 'disabled': (ap.info.state === null)}\">\n"+' <a class="play-button" ng-click="ap.button()" ng-disabled="ap.info.state === null">\n <span class="fa fa-stack fa-2x">\n <i id="play-background" class="fa fa-stack-2x" ng-class="{\'fa-square\': (ap.info.state === \'running\'), \'fa-circle\': (ap.info.state !== \'running\')}"></i>\n <i id="play-foreground" class="fa fa-stack-1x" ng-class="{\'fa-pause\': (ap.info.state === \'running\'), \'fa-play\': (ap.info.state !== \'running\')}"></i>\n </span>\n </a>\n <span class="current-time">{{ap.info.currentTime}}</span>\n <div class="timeline">\n <div class="filler"></div>\n </div>\n <span class="total-time">{{ap.info.totalTime}}</span>\n <!--<div class="loader" ng-if="ap.load === true">Loading...</div>-->\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/mediaPlayer/mediaPlayer.tpl.html",'<div class="media-player-container {{classes}}" ng-class="{\'dynamic\': (model)}">\n <div ng-if="itemType == \'audio\'">\n <audio-player name="{{name}}_player" src="{{src | trusted}}" actions="actions"></audio-player>\n </div>\n <div ng-if="itemType == \'video\'">\n <video type="video/mp4" ng-src="{{src | trusted}}" width="100%" controls></video>\n </div>\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/alert/alert.tpl.html",'<div class="alert" ng-class="[type ? \'alert-\' + type : null]">\n <button type="button" class="close" ng-if="dismissable" ng-click="$hide()">×</button>\n <strong ng-bind="title"></strong> <span ng-bind-html="content"></span>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/aside/aside.tpl.html",'<div class="aside" tabindex="-1" role="dialog">\n <div class="aside-dialog">\n <div class="aside-content">\n <div class="aside-header" ng-show="title">\n <button type="button" class="close" ng-click="$hide()">×</button>\n <h4 class="aside-title" ng-bind="title"></h4>\n </div>\n <div class="aside-body" ng-bind="content"></div>\n <div class="aside-footer">\n <button type="button" class="btn btn-default" ng-click="$hide()">Close</button>\n </div>\n </div>\n </div>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/datepicker/datepicker.tpl.html",'<div class="dropdown-menu datepicker" ng-class="\'datepicker-mode-\' + $mode" style="max-width: 320px;">\n<table style="table-layout: fixed; height: 100%; width: 100%;">\n <thead>\n <tr class="text-center">\n <th>\n <button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$selectPane(-1)">\n <i class="{{$iconLeft}}"></i>\n </button>\n </th>\n <th colspan="{{ rows[0].length - 2 }}">\n <button tabindex="-1" type="button" class="btn btn-default btn-block text-strong" ng-click="$toggleMode()">\n <strong style="text-transform: capitalize;" ng-bind="title"></strong>\n </button>\n </th>\n <th>\n <button tabindex="-1" type="button" class="btn btn-default pull-right" ng-click="$selectPane(+1)">\n <i class="{{$iconRight}}"></i>\n </button>\n </th>\n </tr>\n <tr ng-show="showLabels" ng-bind-html="labels"></tr>\n </thead>\n <tbody>\n <tr ng-repeat="(i, row) in rows" height="{{ 100 / rows.length }}%">\n <td class="text-center" ng-repeat="(j, el) in row">\n <button tabindex="-1" type="button" class="btn btn-default" style="width: 100%" ng-class="{\'btn-primary\': el.selected, \'btn-info btn-today\': el.isToday && !el.selected}" ng-click="$select(el.date)" ng-disabled="el.disabled">\n <span ng-class="{\'text-muted\': el.muted}" ng-bind="el.label"></span>\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/dropdown/dropdown.tpl.html",'<ul tabindex="-1" class="dropdown-menu" role="menu">\n <li role="presentation" ng-class="{divider: item.divider}" ng-repeat="item in content" >\n <a role="menuitem" tabindex="-1" ng-href="{{item.href}}" ng-if="!item.divider && item.href" target="{{item.target || \'\'}}" ng-bind="item.text"></a>\n <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-if="!item.divider && item.click" ng-click="$eval(item.click);$hide()" ng-bind="item.text"></a>\n </li>\n</ul>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/modal/modal.tpl.html",'<div class="modal" tabindex="-1" role="dialog">\n <div class="modal-dialog">\n <div class="modal-content">\n <div class="modal-header" ng-show="title">\n <button type="button" class="close" ng-click="$hide()">×</button>\n <h4 class="modal-title" ng-bind="title"></h4>\n </div>\n <div class="modal-body" ng-bind="content"></div>\n <div class="modal-footer">\n <button type="button" class="btn btn-default" ng-click="$hide()">Close</button>\n </div>\n </div>\n </div>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/popover/popover.tpl.html",'<div class="popover">\n <div class="arrow"></div>\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/select/select.tpl.html",'<ul tabindex="-1" class="select dropdown-menu" ng-show="$isVisible()" role="select">\n <li ng-if="$showAllNoneButtons">\n <div class="btn-group" style="margin-bottom: 5px; margin-left: 5px">\n <button class="btn btn-default btn-xs" ng-click="$selectAll()">All</button>\n <button class="btn btn-default btn-xs" ng-click="$selectNone()">None</button>\n </div>\n </li>\n <li role="presentation" ng-repeat="match in $matches" ng-class="{active: $isActive($index)}">\n <a style="cursor: default;" role="menuitem" tabindex="-1" ng-click="$select($index, $event)">\n <i class="{{$iconCheckmark}} pull-right" ng-if="$isMultiple && $isActive($index)"></i>\n <span ng-bind="match.label"></span>\n </a>\n </li>\n</ul>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/tab/tab.tpl.html",'<ul class="nav" ng-class="$navClass" role="tablist">\n <li ng-repeat="$pane in $panes track by $index" ng-class="$index == $panes.$active ? $activeClass : \'\'">\n <a role="tab" data-toggle="tab" ng-click="$setActive($index)" data-index="{{ $index }}" ng-bind-html="$pane.title"></a>\n </li>\n</ul>\n<div ng-transclude class="tab-content">\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/timepicker/timepicker.tpl.html",'<div class="dropdown-menu timepicker" style="min-width: 0px;width: auto;">\n<table height="100%">\n <thead>\n <tr class="text-center">\n <th>\n <button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 0)">\n <i class="{{ $iconUp }}"></i>\n </button>\n </th>\n <th>\n \n </th>\n <th>\n <button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 1)">\n <i class="{{ $iconUp }}"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="(i, row) in rows">\n <td class="text-center">\n <button tabindex="-1" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[0].selected}" ng-click="$select(row[0].date, 0)" ng-disabled="row[0].disabled">\n <span ng-class="{\'text-muted\': row[0].muted}" ng-bind="row[0].label"></span>\n </button>\n </td>\n <td>\n <span ng-bind="i == midIndex ? timeSeparator : \' \'"></span>\n </td>\n <td class="text-center">\n <button tabindex="-1" ng-if="row[1].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[1].selected}" ng-click="$select(row[1].date, 1)" ng-disabled="row[1].disabled">\n <span ng-class="{\'text-muted\': row[1].muted}" ng-bind="row[1].label"></span>\n </button>\n </td>\n <td ng-if="showAM">\n \n </td>\n <td ng-if="showAM">\n <button tabindex="-1" ng-show="i == midIndex - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !!isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">AM</button>\n <button tabindex="-1" ng-show="i == midIndex + 1 - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">PM</button>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr class="text-center">\n <th>\n <button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 0)">\n <i class="{{ $iconDown }}"></i>\n </button>\n </th>\n <th>\n \n </th>\n <th>\n <button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 1)">\n <i class="{{ $iconDown }}"></i>\n </button>\n </th>\n </tr>\n </tfoot>\n</table>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/tooltip/tooltip.tpl.html",'<div class="tooltip in" ng-show="title">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="title"></div>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("bower_components/angular-strap/src/typeahead/typeahead.tpl.html",'<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select">\n <li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}">\n <a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a>\n </li>\n</ul>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/barcode.tpl.html",'<take-barcode code-type="bar" ng-model="$parent.$parent.inputModel"></take-barcode>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/checkbox.tpl.html",'<md-checkbox model="$parent.$parent.inputModel"\n name="name"\n required="required"\n options="options"\n disabled="disabled"\n icon-selected="{{iconSelected}}"\n validators="{{validators}}"\n actions="{{actions}}"\n icon-unselected="{{iconUnselected}}">\n</md-checkbox>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/date.tpl.html",'<div ng-class="{\'input-group\': (leftIcon || rightIcon)}" >\n <div class="input-group-addon" ng-if="leftIcon"><span class="fa {{::leftIcon}}"></span></div>\n <input type="text" pick-a-date="$parent.$parent.inputModel" pick-a-date-options="options" md-actions="{{actions}}" placeholder="{{::placeholder || \'--\' | translate}}" class="form-control" ng-disabled="disabled" />\n <div class="input-group-addon" ng-if="rightIcon"><span class="fa {{::rightIcon}}"></span></div>\n</div>\n<input type="hidden" name="{{::name}}" validation="{{validators}}" ng-required="{{required}}" ng-model="$parent.$parent.inputModel" />\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/datetime.tpl.html",'\n<div class="row datetime-container">\n <div class="col-xs-6">\n <div class="input-group">\n <div class="input-group-addon">\n <span class="fa fa-calendar"></span>\n </div>\n <input type="text" validation="{{validators}}" pick-a-date date-value="$parent.$parent.inputModel" min="min" max="max" ng-model="dateModel" class="form-control" name="{{::name}}" id="{{::name}}" placeholder="{{::placeholder}}" ng-required="{{required}}" ng-disabled="disabled">\n </div>\n </div>\n <div class="col-xs-6">\n <div class="input-group">\n <div class="input-group-addon">\n <span class="fa fa-calendar"></span>\n </div>\n <input type="text" validation="{{validators}}" pick-a-time date-value="$parent.$parent.inputModel" tmin="tmin" tmax="tmax" ng-model="dateModel" class="form-control" name="{{::name}}" id="{{::name}}" placeholder="{{::placeholder}}" ng-required="{{required}}" ng-disabled="disabled">\n </div>\n </div>\n</div>\n\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/email.tpl.html",'<div ng-class="{\'input-group\': (leftIcon || rightIcon)}">\n <div class="input-group-addon" ng-if="leftIcon"><span class="fa {{::leftIcon}}"></span></div>\n <input type="email" md-actions="{{actions}}" valid-email validation="{{validators}}" class="form-control" id="{{::name}}" name="{{::name}}" placeholder="{{::placeholder | translate}}" ng-required="{{required}}" ng-disabled="disabled" ng-model="$parent.$parent.inputModel" ng-model-options="{debounce: { \'default\': 500, \'blur\': 0 }}">\n <div class="input-group-addon" ng-if="rightIcon"><span class="fa {{::rightIcon}}"></span></div>\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/number.tpl.html",'<div ng-class="{\'input-group\': (leftIcon || rightIcon)}">\n <div class="input-group-addon" ng-if="leftIcon"><span class="fa {{::leftIcon}}"></span></div>\n <input type="number" validation="{{validators}}" md-actions="{{actions}}" min="{{min}}" max="{{max}}" class="form-control" id="{{::name}}" name="{{::name}}" placeholder="{{::placeholder | translate}}" ng-required="{{required}}" ng-disabled="disabled" ng-model="$parent.$parent.inputModel" ng-model-options="{debounce: { \'default\': 500, \'blur\': 0 }}" number-format decimal-places="{{::decimals}}" />\n <div class="input-group-addon" ng-if="rightIcon"><span class="fa {{::rightIcon}}"></span></div>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/password.tpl.html",'<div ng-class="{\'input-group\': (leftIcon || rightIcon)}">\n <div class="input-group-addon" ng-if="leftIcon"><span class="fa {{::leftIcon}}"></span></div>\n <input type="password" validation="{{validators}}" md-actions="{{actions}}" class="form-control" id="{{::name}}" name="{{::name}}" placeholder="{{::placeholder | translate}}" ng-required="{{required}}" ng-disabled="disabled" ng-model="$parent.$parent.inputModel" ng-model-options="{debounce: { \'default\': 500, \'blur\': 0 }}" />\n <div class="input-group-addon" ng-if="rightIcon"><span class="fa {{::rightIcon}}"></span></div>\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/photo.tpl.html",'<take-photo ng-model="$parent.$parent.inputModel" image-url="$parent.$parent.inputModel" quality="quality" source="source" disabled="disabled" destination="destination"></take-photo>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/qrcode.tpl.html",'<take-barcode code-type="qr" ng-model="$parent.$parent.inputModel"></take-barcode>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/radio.tpl.html",'<md-radio model="$parent.$parent.inputModel"\n name="name"\n required="required"\n options="options"\n disabled="disabled"\n icon-selected="{{iconSelected}}"\n validators="{{validators}}"\n actions="{{actions}}"\n icon-unselected="{{iconUnselected}}">\n</md-radio>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/range-slider.tpl.html",'<md-range-slider name="name"\n model="$parent.$parent.inputModel"\n required="required"\n disabled="disabled"\n validators="{{validators}}"\n min="{{min}}"\n max="{{max}}"\n step="{{step}}"\n actions="actions">\n</md-range-slider>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/rating.tpl.html",'<div star-rating\n class="star-rating"\n rating-value="$parent.$parent.inputModel"\n max="max || 5"\n on-rating-selected="inputModel = rating; updateInputValue(rating);"\n actions="actions"\n disabled="disabled">\n</div>\n<input type="hidden" md-actions="{{actions}}" validation="{{validators}}" ng-model="$parent.$parent.inputModel" name="{{::name}}" ng-required="{{required}}" />\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/recordAudio.tpl.html",'<record-audio name="{{name}}" model="{{key}}" label="{{label}}" small-player="smallplayer" actions="actions"></record-audio>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){
e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/select.tpl.html",'<select ng-if="!searchable"\n md-select\n id="{{:: name }}"\n name="{{:: name }}"\n ng-model="$parent.$parent.$parent.inputModel"\n ng-options="option.label group by option.group for option in $parent.options track by option.value"\n ng-change="$parent.$parent.$parent.userInput()"\n ng-required="{{ required }}"\n ng-disabled="disabled"\n ng-class="{ disabled: disabled }"\n md-actions="{{ actions }}"\n validation="{{ validators }}"\n class="form-control">\n <option value="">{{ \'Please select...\' | translate }}</option>\n</select>\n\n<div ng-if="searchable">\n <ol class="nya-bs-select"\n data-live-search="true"\n data-size="5"\n ng-model="$parent.$parent.$parent.inputModel"\n ng-disabled="disabled"\n md-actions="{{ actions }}">\n <li nya-bs-option="option in $parent.options group by option.group track by option.value">\n <span class="dropdown-header" ng-if="$group">{{ $group | translate }}</span>\n <a>{{ option.label | translate }}</a>\n </li>\n </ol>\n <input type="hidden" ng-model="$parent.$parent.inputModel" validation="{{validators}}" name="{{::name}}" ng-required="{{required}}"/>\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/signature.tpl.html",'<input type="hidden" validation="{{validators}}" name="{{::name}}" ng-model="$parent.$parent.inputModel" ng-required="{{required}}" />\n<div class="signature-frame">\n <div class="canvas-frame">\n <canvas md-signature ng-model="$parent.$parent.inputModel" disabled="disabled" md-actions="{{actions}}"></canvas>\n <div class="sign-line"></div>\n </div>\n <div class="controls">\n <button class="btn btn-default" ng-click="$parent.$parent.inputModel = undefined;" ng-disabled="disabled">{{ \'Clear signature\' | translate }}</button>\n </div>\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/slider.tpl.html",'<md-slider name="name"\n model="$parent.$parent.inputModel"\n required="required"\n disabled="disabled"\n validators="{{validators}}"\n min="{{min}}"\n max="{{max}}"\n step="{{step}}"\n actions="actions">\n</md-slider>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/smiley.tpl.html",'\n<div class="smiley-container">\n <a href="javascript:void(0)" class="smile" ng-class="{\'active\': ($parent.$parent.inputModel == true)}" ng-click="$parent.$parent.inputModel = true; $parent.$parent.updateStore(true)"><span class="icon icon-smile"></span></a>\n <a href="javascript:void(0)" class="frown" ng-class="{\'active\': ($parent.$parent.inputModel == false)}" ng-click="$parent.$parent.inputModel = false; $parent.$parent.updateStore(false)"><span class="icon icon-sad"></span></a>\n</div>\n<input type="hidden" validation="{{validators}}" name="{{::name}}" ng-model="$parent.$parent.inputModel" ng-required="{{required}}" />\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/switch.tpl.html",'<div class="switch-container">\n\n <span class="switch-text on">\n <span ng-show="$parent.$parent.inputModel === true">{{ onText | translate }}</span>\n </span>\n\n <span class="switch"\n ng-class="{ checked: $parent.$parent.inputModel, disabled: disabled }"\n id="{{::name}}"\n name="{{::name}}">\n\n <small></small>\n\n <input type="checkbox"\n name="{{::name}}"\n ng-disabled="disabled"\n ng-model="$parent.$parent.inputModel"\n md-actions="{{actions}}"\n validation="{{validators}}"\n ng-required="{{required}}"\n style="width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;"\n class="ng-pristine ng-untouched ng-valid"\n ng-hide="disabled"\n ng-model-options="{ debounce: 0, allowInvalid: true }" />\n\n </span>\n\n <span class="switch-text off">\n <span ng-show="$parent.$parent.inputModel !== true">{{ offText | translate }}</span>\n </span>\n\n</div>')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/text.tpl.html",'<div ng-switch="multi">\n <div ng-switch-when="false" ng-class="{\'input-group\': (leftIcon || rightIcon)}">\n <div class="input-group-addon" ng-if="leftIcon"><span class="fa {{::leftIcon}}"></span></div>\n <input type="text" validation="{{validators}}" md-actions="{{actions}}" class="form-control" id="{{::name}}" name="{{::name}}" maxlength="{{::maxlength || undefined}}" placeholder="{{::placeholder | translate}}" ng-required="{{required}}" ng-disabled="disabled" ng-model="$parent.$parent.$parent.inputModel" ng-model-options="{debounce: { \'default\': debounce, \'blur\': 0 }}" />\n <div class="input-group-addon" ng-if="rightIcon"><span class="fa {{::rightIcon}}"></span></div>\n </div>\n <textarea ng-switch-when="true" class="form-control" validation="{{validators}}" md-actions="{{actions}}" id="{{::name}}" name="{{::name}}" maxlength="{{::maxlength || undefined}}" ng-attr-placeholder="{{::placeholder | translate}}" ng-required="{{required}}" ng-disabled="disabled" ng-model="$parent.$parent.$parent.inputModel" rows="3" ng-model-options="{debounce: { \'default\': debounce, \'blur\': 0 }}"></textarea>\n</div>\n')}])}(),function(e){try{e=angular.module("app.templates")}catch(t){e=angular.module("app.templates",[])}e.run(["$templateCache",function(e){e.put("components/mdDynamicForm/fields/templates/time.tpl.html",'<div ng-class="{\'input-group\': (leftIcon || rightIcon)}" id="{{::name}}">\n <div class="input-group-addon" ng-if="leftIcon"><span class="fa {{::leftIcon}}"></span></div>\n <input type="text" pick-a-time="$parent.$parent.inputModel" pick-a-time-options="options" md-actions="{{actions}}" placeholder="{{::placeholder || \'--\' | translate}}" class="form-control" ng-disabled="disabled" />\n <div class="input-group-addon" ng-if="rightIcon"><span class="fa {{::rightIcon}}"></span></div>\n</div>\n<input type="hidden" name="{{::name}}" validation="{{validators}}" ng-required="{{required}}" ng-model="$parent.$parent.inputModel" />\n')}])}();