@pitcher/core
Advanced tools
Comparing version 0.3.4 to 0.4.0
@@ -1,1 +0,1 @@ | ||
define(["require","exports","@vue/composition-api","@babel/runtime/regenerator","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/classCallCheck","@babel/runtime/helpers/createClass","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/typeof","vue","fuse.js/dist/fuse.min.js","@babel/runtime/helpers/toConsumableArray","@babel/runtime/helpers/slicedToArray"],(function(e,t,n,r,a,o,i,s,c,u,l,f,d){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function h(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var v=p(r),m=p(a),y=p(o),w=p(i),g=p(s),b=p(c),I=p(u),T=p(l),x=p(f),S=p(d);function O(e,t){for(var n=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),r=0,a=n.length;r<a;++r){var o=n[r];if(!(o in e))return;e=e[o]}return e}var C={};function D(e){var t=Object.getPrototypeOf(e),r=Object.getOwnPropertyDescriptors(t),a={};return Object.keys(e).forEach((function(t){var n=e[t];t.startsWith("on_")||(a[t]=n,"function"==typeof a[t]&&a[t].bind(a))})),Object.keys(r).forEach((function(e){if("constructor"!==e&&!e.startsWith("__")){var t=r[e].get,o=r[e].set,i=r[e].value;if(e.startsWith("on_"))return;i?(a[e]=i,"function"==typeof a[e]&&a[e].bind(a)):t&&o?a[e]=n.computed({get:t.bind(a),set:o.bind(a)}):t&&(a[e]=n.computed(t.bind(a)))}})),a=n.reactive(a),Object.keys(e).forEach((function(t){var r=e[t];t.startsWith("on_")&&(a[t]=n.watch(n.computed((function(){return O(a,t.substring(3).split("_").join("."))})),r))})),Object.keys(r).forEach((function(e){if("constructor"!==e&&!e.startsWith("__")){var t=r[e].value;e.startsWith("on_")&&(a[e]=n.watch(n.computed((function(){return O(a,e.substring(3).split("_").join("."))})),t))}})),a}function E(e){if(!e.id)throw"store needs an id attribute";return C&&C[e.id]?C[e.id]:(C[e.id]=D(e),C[e.id]?C[e.id]:void 0)}var k,P=(k=navigator.userAgent||navigator.vendor||window.opera,-1!==navigator.userAgent.indexOf("emulate-ios")?(console.warn("[VUE-SDK]: PLATFORM is being emulated as IOS"),"IOS"):window.parent!==window.self?"CONNECT":/windows phone/i.test(k)||/windows/i.test(k)?"WINDOWS":/android/i.test(k)?"ANDROID":/iPad|iPhone|iPod|AppleWebKit/.test(k)&&!window.MSStream?"IOS":"unknown"),N="modal";function j(e,n){return new Promise((function(r,a){var o=t.fireEventCount++,i="fireEventCB".concat(o),s="fireEventErrorCB".concat(o);function c(){delete window[i],delete window[s]}n||(n={}),n.callBackFunc=i,n.callBack=i,n.errorFunc=s,n.emptyFunction=s,n.source=n.source||N,window[i]=function(e){if("string"==typeof e&&(e.startsWith("{")||e.startsWith("[")))try{r(JSON.parse(e))}catch(e){a("Invalid JSON")}else r(e);c()},window[s]=function(e){a(e),c()},Object.prototype.hasOwnProperty.call(window,"Ti")?window.Ti.App.fireEvent(e,n):a("Ti not found")}))}t.fireEventCount=0;var F={},A={cacheEnabled:!1,cacheTimeout:500,defaultDatabase:"pitcher",longQueryWarning:!1};function _(e,t){F[e]={result:t,time:Date.now()}}function L(e){return A.cacheEnabled&&!e.toLowerCase().includes("delete")&&!e.toLowerCase().includes("insert")&&Object.prototype.hasOwnProperty.call(F,e)&&F[e].time+A.cacheTimeout>Date.now()}function U(e){return M.apply(this,arguments)}function M(){return(M=m.default(v.default.mark((function e(t){var n,r,a,o=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:null,r=o.length>2&&void 0!==o[2]&&o[2],a=o.length>3&&void 0!==o[3]?o[3]:"modal",process.env.LOG&&console.log(t),e.abrupt("return",new Promise((function(e,o){if(L(t)&&A.cacheEnabled)return console.log("cache hit"),e(F[t].result);var i=new Date;j("dbFunction",{db:n||A.defaultDatabase,iosMode:!0,pType:"query",query:t,source:a}).then((function(n){var a=new Date-i;a>1e3&&A.longQueryWarning&&console.warn("slow query (".concat((a/1e3).toFixed(2),"s): ").concat(t));var s=[];n.error&&(console.error(t),o(new Error(n.error)));for(var c=0;c<n.results.length;c++){for(var u=n.results[c],l={},f=0;f<n.columns.length;f++){var d=n.columns[f],p=u[f];if("WINDOWS"===P&&"string"==typeof p&&(p=p.replace(/''/g,"'")),"extraField"===d||"account"===d||"eventJSON"===d||"contact"===d||"Json"===d||"user"===d||"userObject"===d){var h=JSON.parse(p);for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&"attributes"!==v&&(r&&null===h[v]||(l[v]=h[v]))}else l[d]=void 0===p?null:p}s.push(l)}A.cacheEnabled&&_(t,s),e(s)})).catch(o)})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(e,t){Object.keys(e).forEach((function(n){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}function V(e,t,n){try{return new Function("with(this){\nreturn Boolean(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn Boolean(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}}function R(e,t,n){try{return new Function("with(this){\nreturn ".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}}var X=new I.default({});function J(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var q=!1,Q={};function z(){return H.apply(this,arguments)}function H(){return(H=m.default(v.default.mark((function e(){var t,n,r,a,o,i,s,c;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q){e.next=6;break}return e.next=3,j("getPitcherFiles",{fullData:!0});case 3:t=e.sent,n=J(t);try{for(n.s();!(r=n.n()).done;){a=r.value,o=void 0;try{o=a.keywords.split(",").map((function(e){return e.trim()}))}catch(e){o=[]}i=J(o);try{for(i.s();!(s=i.n()).done;)c=s.value,Q[c]||(Q[c]=[]),Q[c].push(a)}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}case 6:q=!0;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(e){return $.apply(this,arguments)}function $(){return($=m.default(v.default.mark((function e(t){return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return e.abrupt("return",Q[t]);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"zip",i=arguments.length>6&&void 0!==arguments[6]&&arguments[6];j("loadWebPageFromFolder",{urlValue:e,title:t,showBar:a,ID:n,folderName:o,allowPortrait:i,parameters:r})}function Y(e,t){return Z.apply(this,arguments)}function Z(){return(Z=m.default(v.default.mark((function e(t,n){var r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K(t);case 2:1!==(r=e.sent).length&&alert("".concat(r.length," files found for keyword: ").concat(t)),a=r[0],o="".concat(a.vUrl.replace(".zip","").replace("zip/",""),"/index.html"),"ANDROID"===P?G(o,a.body,a.ID,n):ee(a.ID,n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];j("launchContentWithID",{fileID:e,parameters:t,subId:n,currentID:r,forceChange:a})}function te(e){var t;if("ANDROID"===P||"WINDOWS"===P)t="".concat(e,"_desc");else{if("IOS"!==P)throw"no supported: ".concat(P);t="".concat(e,"_desc_cache")}try{return j("getFromHTML",{id:t,useSFDCDB:!0})}catch(t){throw"Schema not found:".concat(e)}}function ne(e,t){var n;return"IOS"===P||"ANDROID"===P?n="".concat(e,"_").concat(t,"_layout"):"WINDOWS"===P&&(n="".concat(e,"<").concat(t,">_desc")),console.log(n),j("getFromHTML",{id:n,useSFDCDB:!0})}function re(){return(re=m.default(v.default.mark((function e(t){var n,r,a=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(a.length>1&&void 0!==a[1])||a[1],e.next=3,j("getFromHTML",{id:t,useSFDCDB:n});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(e,t,n){return oe(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{%\s*if([^{}]*)\s*%}(.*){%\s*endif\s*%}/g;return e.replace(n,(function(e,n,r){return V(n,t)?r:""}))}}(e)(t))(t,n)}function oe(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{{([^{}]*)}}/g;return e.replace(n,(function(e,n){return R(n,t)}))}}function ie(e,t){return ae(e,t)}function se(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ue(){return(ue=m.default(v.default.mark((function e(t,n){var r,a,o,i,s,c,u,l;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ie(t,n),window.console.info("open link",t),t=t.split("pitcher://").join(""),r=2===t.split("/").length?t.split("/")[0]:2===t.split("?").length?t.split("?")[0]:t,a=t.split("?")[1],o={},a.length){a=decodeURI(a).split("&"),i=se(a);try{for(i.s();!(s=i.n()).done;)c=s.value,u=c.split("="),o[u[0]]=u[1]}catch(e){i.e(e)}finally{i.f()}}for(l in o)window.localStorage[l]=o[l];if(!isNaN(Number(r))){e.next=13;break}return e.next=11,Y(r,o);case 11:e.next=15;break;case 13:return e.next=15,ee(r,o);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function le(e){var t=e.split(".");return 1===t.length?e:(t.shift(),e=t.join("."))}function fe(){for(var e=[].slice.call(arguments),t=e[0],n=1;n<e.length;n++)if(e[n]){var r=e[n].replace(/^(\/|\\)/,"");t="".concat(t.replace(/(\/|\\)$/,""),"/").concat(r)}return t}function de(e){return new Promise((function(t){var n=window.localStorage,r=n.getItem(e);!function a(){setTimeout((function(){n.getItem(e)==r?a():t(n.getItem(e))}),1e3)}()}))}function pe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=10*t;if(!e||""===e)throw new Error("No property is sent to watch on window");return new Promise((function(t){if(void 0!==window[e])return t(window[e]);var r=0,a=setInterval((function(){if(r++,void 0!==window[e]||r===n)return clearInterval(a),t(window[e])}),100)}))}try{window.localStorage.setItem("reloadConsole","false")}catch(e){console.log(e)}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?he(Object(n),!0).forEach((function(t){g.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function me(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function ye(){var e,t;if(null!==(e=window)&&void 0!==e&&null!==(t=e.Ti)&&void 0!==t&&t.TiWeb)return"/";var n=window.location.href;if(!n.includes("zip/")&&!n.startsWith("http"))throw Error('"zip" folder not found in path');var r,a,o=n.lastIndexOf("zip//");if(-1!==o){var i=(a=o,[(r=n).substring(0,a),r.substring(a)]);n=i[0]+i[1].replace("zip//","zip/")}return(n=n.split("zip/")[0]).endsWith("/")?n:"".concat(n,"/")}function we(e){return ye()+e}window.getParameters=function(e){window.params=JSON.parse(e)};var ge=function(){function e(){y.default(this,e),g.default(this,"id","params"),g.default(this,"state",n.reactive({account:n.ref(null),contacts:null,contact:null,salesForceUser:null,user:null}))}return w.default(e,[{key:"locale",get:function(){var e=this.state.salesForceUser?this.state.salesForceUser:this.state.user,t=null;return e&&(t=e.LocaleSidKey?e.LocaleSidKey:e.LanguageLocaleKey),t?t.split("_").slice(0,2).join("-"):null}},{key:"language",get:function(){if(this.state.salesForceUser)return this.state.salesForceUser.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.user)return this.state.user.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.config){var e={AUSDE:"de",BI:"id",BR:"pt",BU:"bg",CAFR:"fr",CZ:"cs",DAN:"da",ESMX:"es",EST:"et",JP:"ja",LET:"lv",PO:"pl",PRT:"pt",SCH:"zh-CN",TCH:"zh-TW",UA:"uk",VN:"vi"};return e[this.state.config.langV]?e[this.state.config.langV]:this.state.config.langV.toLowerCase()}return null}},{key:"context",get:function(){return{Account:this.state.account,Contact:this.state.contact,Contacts:this.state.contacts,User:this.state.salesForceUser?this.state.salesForceUser:this.state.user}}}]),e}();function be(){return E(new ge)}function Ie(){return(Ie=m.default(v.default.mark((function e(){var t,n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=be(),console.log(t.state.account),!process.env.VUE_APP_PARAMS){e.next=6;break}return n=JSON.parse(process.env.VUE_APP_PARAMS),Object.assign(t.state,n),e.abrupt("return",t.state);case 6:return e.next=8,pe("params");case 8:return e.sent&&Object.assign(t.state,window.params),e.abrupt("return",t.state);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return be().state}var xe=function(){function e(){y.default(this,e),g.default(this,"id","config"),g.default(this,"state",{customCaches:null})}return w.default(e,[{key:"getTableDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n.tableToCache,e[n.objectName]=n.tableToCache}return e}},{key:"getCacheDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n,e[n.objectName]=n}return e}}]),e}();function Se(){return E(new xe)}function Oe(){return Ce.apply(this,arguments)}function Ce(){return(Ce=m.default(v.default.mark((function e(){var t,n,r,a,o,i,s=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:"modal",n=Se(),e.next=4,j("getAppConfig",{source:t});case 4:if(void 0!==(r=e.sent).userAttrSpecificSettings&&(a=Te(),o=a.user,r.userAttrSpecificSettings.forEach((function(e){var t=o[e.attrP];if(t&&t.includes(e.valueP))if("replace"===e.typeP)for(var n in e.settings)r[n]=e.settings[n];else if("add"===e.typeP)for(var a in e.settings)r[a]||(r[a]=[]),Array.isArray(e.settings[a])?r[a]=r[a].concat(e.settings[a]):r[a].push(e.settings[a])}))),console.log("[@pitcher/core]: app config",r),r.customCaches=Array.isArray(r.customCaches)?r.customCaches:[],"IOS"!==P){e.next=15;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts_m_v3",query:r.sfdcAccountQuery,fieldTypes:{account:"TEXT",id:"TEXT",lat:"TEXT",lon:"TEXT",city:"TEXT",lastVisit:"TEXT",accountName:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts_m_v4",query:r.sfdcContactQuery,fieldTypes:{contact:"TEXT",id:"TEXT",accountID:"TEXT",lastVisit:"TEXT",name:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users_m_v3",query:"",fieldTypes:{userObject:"TEXT",id:"TEXT",lastName:"TEXT",firstName:"TEXT",name:"TEXT",roleID:"TEXT",parentRoleID:"TEXT",extraField:"TEXT"}}),e.next=31;break;case 15:if("ANDROID"!==P){e.next=22;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts",query:r.sfdcAccountQuery}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts",query:r.sfdcContactQuery}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users",query:""}),e.next=31;break;case 22:if("WINDOWS"!==P){e.next=30;break}(r=r[0]).customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"SQLiteSfAccount",query:r.sfdcAccountQuery,fieldTypes:{BillingCity:"TEXT",BillingCountry:"TEXT",BillingStreet:"TEXT",Id:"TEXT",ExternalId:"TEXT",Json:"TEXT",JsonUntouched:"TEXT",LastModifiedDate:"TEXT",LastModifiedTimeStamp:"INTEGER",LastVisitTimeStamp:"INTEGER",Lat__c:"REAL",Long__c:"REAL",Name:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"SQLiteSfContact",query:r.sfdcContactQuery,fieldTypes:{Id:"TEXT",ExternalId:"TEXT",LastModifiedDate:"TEXT",Name:"TEXT",AccountId:"TEXT",Email:"TEXT",Json:"TEXT",JsonUntouched:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"SQLiteSfEvent",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"SQLiteSfUser",query:"",fieldTypes:{Id:"TEXT",IsActive:"INTEGER",LastModifiedDate:"TEXT",FirstName:"TEXT",LastName:"TEXT",Json:"TEXT"}}),e.next=31;break;case 30:throw new Error("Platform not supported: ".concat(P));case 31:for(i in r)n.state[i]=r[i];return e.abrupt("return",n.state);case 33:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=m.default(v.default.mark((function e(t,n){var r,a,o,i,s,c,u,l,f=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f.length>2&&void 0!==f[2]?f[2]:null,a=f.length>3&&void 0!==f[3]&&f[3],t){e.next=4;break}throw Error("no query provided");case 4:for(c in o=Se(),i=be().state,t=t.split("TODAY").join("date('now')"),s=o.getTableDict,n)Object.prototype.hasOwnProperty.call(n,c)&&(s[c]=n[c]);return i.account&&(s.account=i.account,s.contacts=i.contacts),i.salesForceUser&&(s.user=i.salesForceUser),i.user&&(s.user=i.user),i.locale&&(s.locale=i.locale),u=ie(t,s),e.prev=14,e.next=17,U(u,r,a);case 17:return l=e.sent,e.abrupt("return",l);case 21:throw e.prev=21,e.t0=e.catch(14),console.error(u,s),e.t0;case 25:case"end":return e.stop()}}),e,null,[[14,21]])})))).apply(this,arguments)}function Ee(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function ke(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=function(){function e(t,r){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];y.default(this,e),g.default(this,"references",n.ref([])),g.default(this,"referencesTo",[]),Object.assign(this,t),this.parentObjectType=r,this.required=!t.nillable||t.nameField,this.errors=[],a&&this.load_refs()}var t;return w.default(e,[{key:"valid",value:function(e){return"boolean"===this.type&&!0===e||!1===e||!(!e&&this.required)}},{key:"load_refs",value:function(){var e=Se();if(this.referenceTo&&this.referenceTo.length){var t,n=e.getCacheDict[this.parentObjectType],r=ke(this.referenceTo);try{for(r.s();!(t=r.n()).done;){var a=t.value,o=e.getCacheDict[a];if(!o)return void window.console.warn("referenced object not found: ".concat(a));this.load(o,n,a)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"load",value:(t=m.default(v.default.mark((function e(t,n,r){var a,o,i,s,c,u,l,f,d;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null,n&&n.filters&&(a=n.filters[this.name]),o=t.tableToCache,i="select Id, ",s="Name",t.fieldTypes&&t.fieldTypes.Name?i+="Name":"Account"===r?"ANDROID"===P?(i+="account_name",s="account_name"):(i+="accountName",s="accountName"):"Contact"===r||"User"===r?(i+="name",s="name"):t.fieldTypes.extraField?i+="extraField":alert("no name field found in table for ".concat(r)),i+=" from ".concat(o),e.next=9,U(i);case 9:c=e.sent,u=[],l=ke(c),e.prev=12,l.s();case 14:if((f=l.n()).done){e.next=23;break}if(d=f.value,!a){e.next=20;break}if(V(a,d)){e.next=20;break}return e.abrupt("continue",21);case 20:u.push({value:d.Id,text:d[s]});case 21:e.next=14;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(12),l.e(e.t0);case 28:return e.prev=28,l.f(),e.finish(28);case 31:this.references.value=this.references.value.concat(u);case 32:case"end":return e.stop()}}),e,this,[[12,25,28,31]])}))),function(e,n,r){return t.apply(this,arguments)})},{key:"loadExternalReferences",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Name",r=[],a=ke(e);try{for(a.s();!(t=a.n()).done;){var o=t.value;r.push({value:o.Id,text:o[n]})}}catch(e){a.e(e)}finally{a.f()}this.references.value=r}}]),e}(),je=function e(){y.default(this,e),g.default(this,"id","layout"),g.default(this,"state",{})},Fe=function(){return E(new je)};function Ae(){return(Ae=m.default(v.default.mark((function e(t,n){var r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="".concat(t,"_").concat(n),!(a=Fe()).state[r]){e.next=6;break}return e.abrupt("return",a.state[r]);case 6:return e.next=8,ne(t,n);case 8:return o=e.sent,a.state[r]=new _e(o,t),e.abrupt("return",a.state[r]);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _e=function e(t,n){for(var r in y.default(this,e),t)this[r]=t[r];this.objectType=n};function Le(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Me=function e(){y.default(this,e),g.default(this,"id","schema"),g.default(this,"state",{})},We=function(){return E(new Me)};function Ve(e){return Re.apply(this,arguments)}function Re(){return(Re=m.default(v.default.mark((function e(t){var n,r;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=We()).state[t]){e.next=5;break}return e.abrupt("return",n.state[t]);case 5:return e.next=7,te(t);case 7:return r=e.sent,n.state[t]=r,e.abrupt("return",n.state[t]);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xe(){return(Xe=m.default(v.default.mark((function e(t,n){var r,a,o,i;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:r=e.sent,a=Le(r.recordTypeInfos),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}if((i=o.value).name!==n){e.next=10;break}return e.abrupt("return",i.recordTypeId);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function Je(){return(Je=m.default(v.default.mark((function e(t,n){var r,a,o,i,s;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:r=e.sent,a=Le(r.fields),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=13;break}if((i=o.value).name!==n.trim()){e.next=11;break}return s=new Ne(i,t),e.abrupt("return",s);case 11:e.next=6;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),a.e(e.t0);case 18:return e.prev=18,a.f(),e.finish(18);case 21:throw new Error("field not found:".concat(n));case 22:case"end":return e.stop()}}),e,null,[[4,15,18,21]])})))).apply(this,arguments)}function Be(){return(Be=m.default(v.default.mark((function e(t,n,r){var a,o,i,s,c,u,l;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:a=e.sent,o=Le(a.fields),e.prev=4,o.s();case 6:if((i=o.n()).done){e.next=28;break}if((s=i.value).name!==n.trim()||!s.picklistValues){e.next=26;break}c=Le(s.picklistValues),e.prev=10,c.s();case 12:if((u=c.n()).done){e.next=18;break}if((l=u.value).label!==r){e.next=16;break}return e.abrupt("return",l.value);case 16:e.next=12;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(10),c.e(e.t0);case 23:return e.prev=23,c.f(),e.finish(23);case 26:e.next=6;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(4),o.e(e.t1);case 33:return e.prev=33,o.f(),e.finish(33);case 36:case"end":return e.stop()}}),e,null,[[4,30,33,36],[10,20,23,26]])})))).apply(this,arguments)}function qe(){return(qe=m.default(v.default.mark((function e(t){var n,r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:n=e.sent,r=Le(n.fields),e.prev=4,r.s();case 6:if((a=r.n()).done){e.next=12;break}if(!(o=a.value).nameField){e.next=10;break}return e.abrupt("return",o.name);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),r.e(e.t0);case 17:return e.prev=17,r.f(),e.finish(17);case 20:throw new Error("No name field found");case 21:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}var Qe=function e(){y.default(this,e),g.default(this,"id","validation"),g.default(this,"loaded",!1),g.default(this,"state",{listviews:[],lookups:[],rules:[]})};function ze(){return E(new Qe)}function He(){return(He=m.default(v.default.mark((function e(t){var n,r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=ze()).loaded){e.next=13;break}return e.next=4,K(t);case 4:return r=e.sent,e.next=7,fetch(we(r[0].vUrl));case 7:return a=e.sent,e.next=10,a.json();case 10:o=e.sent,n.state=Object.assign(n.state,o),n.loaded=!0;case 13:return e.abrupt("return",n.state);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ke=2,$e="0",Ge=function e(){y.default(this,e),g.default(this,"id","systemStore"),g.default(this,"state",n.reactive({config:null,groups:null,appID:null,supportEmail:null,deviceName:null,metadata:null,messages:null,appName:null,systemLang:null,locale:null,userfullname:null,ajaxtoken:null,isCustomerUI:!1,batteryLevel:0,statusBadge:0,todoBadge:0}))},Ye=function(){return E(new Ge)};function Ze(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}window.updateStatusBadge=function(e){var t=Ye();e=parseInt(e),t.state.statusBadge=e||0},window.updateTodoBadge=function(e){var t=Ye();e=parseInt(e),t.state.todoBadge=e||0},window.fetch||new Promise((function(t,n){e(["whatwg-fetch"],(function(e){t(h(e))}),n)}));var tt=function(){function e(){var t=this;y.default(this,e),g.default(this,"id","filesStore"),g.default(this,"oneTimeLoadPresentations",!1),g.default(this,"state",n.reactive({files:[],uiFiles:n.computed((function(){return t.state.files.filter((function(e){return e.shouldShowInUI}))})),slides:[],documentPath:null,presentations:[],customs:[],initialAllowedIDs:null,allowedIDs:[]}))}return w.default(e,[{key:"isFileExpiredOrNotReady",value:function(e,t,n){return void 0!==t&&void 0!==n&&(null!=t&&null!=n&&(0!=t&&0!=n&&(t>e||n<e)))}},{key:"shouldShowInUI",value:function(e,t){return"T"!=t.ID[0]&&7!=t.typeV&&-1!=t.typeV&&0!=t.typeV&&"images"!=t.category&&!this.isFileExpiredOrNotReady(e,t.startDate,t.endDate)}},{key:"extendFiles",value:function(e){var t=this,n=(new Date).getTime()/1e3;return e.forEach((function(e){e.shouldShowInUI=t.shouldShowInUI(n,e),e.thumbnailUrl=fe(window.documentPath,e.thumb)})),e}},{key:"parsePresentations",value:function(e){var t=this;this.state.customs=[],this.state.presentations=[],e.forEach((function(e){return t.parseSinglePresentation(e)})),this.oneTimeLoadPresentations&&(j("loadPresentationsFromDB",{}),this.oneTimeLoadPresentations=!1)}},{key:"parseCustomPdf",value:function(e){return e.ID=e.slideOrder.split(",")[0].split("|")[0],e.isCustomPdf=!0,e}},{key:"parseSinglePresentation",value:function(e){try{return e.isCustom!=Ke&&(void 0!==e.ID&&null!=e.ID||(e=this.parseCustomPdf(e)),null==e.vSubFolder&&(e.containsMultiple=!0,e.vSubFolder=e.slideOrder.split(",")[0].split("|")[0],e.ID=e.slideOrder.split(",")[0].split("|")[0],-1==e.vSubFolder.indexOf("_")?e.isCustomPdf=!0:e.ID="".concat(parseInt(e.ID))),e.ID="".concat(e.ID),e.isCustom?this.addFileAsCustom(e):this.mergePresentation(e)),!0}catch(e){j("Error",e)}return!1}},{key:"createAppendCustomFile",value:function(e,t){var n={};Object.assign(n,e),Object.assign(n,t),n.body=t.presentationName,this.state.customs.push(n)}},{key:"addFileAsCustom",value:function(e){var t=this.state.files.find((function(t){return t.ID==e.ID}));if(t)this.createAppendCustomFile(t,e);else{var n=this.state.slides.find((function(t){return t.vSubfolder==e.vSubFolder}));n&&(t=this.state.files.find((function(e){return e.ID==n.ID})))&&(e.ID=t.ID,this.createAppendCustomFile(t,e))}}},{key:"mergePresentation",value:function(e){this.state.presentations.push(e);var t=this.state.files.find((function(t){return t.ID==e.ID}));t&&Object.assign(t,e)}},{key:"markFavorites",value:function(e){return this.state.files.forEach((function(t){void 0===t.isFavorite?I.default.set(t,"isFavorite",e[t.ID]||!1):t.isFavorite=e[t.ID]||!1})),this.state.files}},{key:"setAllowedIds",value:function(e){e&&e.length>0&&null==this.state.initialAllowedIDs&&(this.state.initialAllowedIDs=e),this.state.allowedIDs=e||[]}}]),e}(),nt=function(){return E(new tt)};function rt(e){return e.slideOrder?e.slideOrder.split(",").map((function(e){var t=e.split("|"),n=S.default(t,2),r=n[0],a=n[1];return{deckId:r,index:parseInt(a)-1}})):[]}function at(e,t){if(!e)return null;for(var n=0;n<e.length;n++){var r=e[n];if(t>=r.startIndex&&t<r.endIndex)return r}return null}function ot(e){return it.apply(this,arguments)}function it(){return(it=m.default(v.default.mark((function e(t){var n,r,a;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="-",r=v.default.mark((function e(r){var a,o,i,s,c,u,l,f,d;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=t[r]).isCustom){e.next=3;break}return e.abrupt("return","continue");case 3:if(0!==(o=rt(a)).length){e.next=6;break}return e.abrupt("return","continue");case 6:i=o.reduce((function(e,t){return e.add(t.deckId),e}),new Set),s=new Map,c=Ze(i),e.prev=9,c.s();case 11:if((u=c.n()).done){e.next=28;break}return l=u.value,e.prev=13,e.next=16,fetch("".concat(window.documentPath,"/slides/").concat(l,"/chapters.json"));case 16:return f=e.sent,e.next=19,f.json();case 19:d=e.sent,s.set(l,d.chapters),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(13),console.warn("[Chapter Generation]: ".concat(window.documentPath,"/slides/").concat(l,"/chapters.json does not exist!"));case 26:e.next=11;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(9),c.e(e.t1);case 33:return e.prev=33,c.f(),e.finish(33);case 36:if(o.forEach((function(e){var t=at(s.get(e.deckId),e.index);e.chapterName=(null==t?void 0:t.nameV)||n})),!o[0]){e.next=41;break}return e.next=40,fetch("".concat(window.documentPath,"/slides/").concat(o[0].deckId,"/setup.json")).then((function(e){return e.json()})).catch((function(){return null}));case 40:a.setupJSON=e.sent;case 41:a.chapters={chapters:o.reduce((function(e,t,r){var a=e[e.length-1],o=t.deckId===(null==a?void 0:a.deckId),i=t.chapterName===(null==a?void 0:a.nameV),s=t.chapterName===n&&(null==a?void 0:a.nameV)===n;return a&&i&&(o||!o&&s)?a.endIndex=r+1:e.push({nameV:t.chapterName,deckId:t.deckId,startIndex:r,endIndex:r+1}),e}),[]).filter((function(e){return null!==e})).map((function(e){return{nameV:e.nameV,startIndex:e.startIndex,endIndex:e.endIndex}}))},1===a.chapters.chapters.length&&a.chapters.chapters[0].nameV===n&&(a.chapters.chapters=[]),j("saveFromHTML",{id:a.ID,variables:a});case 44:case"end":return e.stop()}}),e,null,[[9,30,33,36],[13,23]])})),e.t0=v.default.keys(t);case 3:if((e.t1=e.t0()).done){e.next=11;break}return a=e.t1.value,e.delegateYield(r(a),"t2",6);case 6:if("continue"!==e.t2){e.next=9;break}return e.abrupt("continue",3);case 9:e.next=3;break;case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.getAllowedIDs=function(){return nt().state.allowedIDs},window.loadPresentations=function(e){var t=e;"string"==typeof e&&(t=JSON.parse(t)),ot(t).then((function(){(window.presentationsObject=t,window.presentationsObject)&&nt().parsePresentations(window.presentationsObject)}))},window.filterJSON=function(e){var t=nt();e?t.setAllowedIds(JSON.parse(e)):t.setAllowedIds([])};var st=function(){function e(){var t=this;y.default(this,e),g.default(this,"id","categoriesStore"),g.default(this,"loaded",!1),g.default(this,"state",n.reactive({category:{},categories:[],parentCategories:n.computed((function(){return t.state.categories.filter((function(e){return e.parentCategory==$e}))})),subCategories:n.computed((function(){return t.state.categories.filter((function(e){return e.parentCategory!=$e}))}))}))}return w.default(e,[{key:"setMainNav",value:function(e){e&&(window.lastViewedCategory=e,"undefined"!=typeof localStorage&&localStorage.setItem("".concat(this.state.appID,".mainNavItem"),e.ID),j("setCategory",{category:JSON.stringify(e)}),this.state.category=e,this.loaded||(this.loaded=!0,j("uiReady")))}}]),e}(),ct=function(){return E(new st)};window.setMainNav=function(e){window.lastViewedCategory=e};var ut={xPos:50,yPos:30,widthV:160,heightV:50},lt=function(){function e(){var t=this;y.default(this,e),g.default(this,"id","detailing"),g.default(this,"state",n.reactive({currentContact:null,currentAccount:null,hasActiveCall:n.computed((function(){return null!=t.state.currentContact})),todaysCalls:[],isFilterActive:!1,quickStartEnabled:!0,quickPlanningEnabled:!0,selectedDate:null,events:[],unsubmitted:[],syncEvents:[],loggedIn:!1}))}var t;return w.default(e,[{key:"setLoggedIn",value:(t=m.default(v.default.mark((function e(t){var n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||this.state.loggedIn){e.next=6;break}return e.next=3,Oe("homescreen");case 3:n=e.sent,this.state.quickStartEnabled=!n.disableQuickStart,this.state.quickPlanningEnabled=!n.disableQuickPlanning;case 6:this.state.loggedIn=t;case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"afterCallEnded",value:function(){this.state.currentContact=null,this.state.currentAccount=null}},{key:"setCurrentContact",value:function(e,t){var n=null!=this.state.currentContact;if(null==e&&null==t)this.afterCallEnded();else{try{this.state.currentContact=JSON.parse(e),this.state.currentAccount=JSON.parse(t)}catch(e){console.log(e)}this.state.isFilterActive=null!=this.state.currentContact&&!n}X.$emit("contact-changed")}},{key:"setQuickStart",value:function(e){void 0!==e.quickstartenabled?this.state.quickStartEnabled="1"==e.quickstartenabled:this.state.quickStartEnabled=!0}},{key:"checkLogin",value:function(e){return"0"!=e.loggedin||(j("startDetailing",ut),!1)}},{key:"createEvent",value:function(e){return{Id:e.Id,isAllDay:!!e.IsAllDay,name:[e.AccountName,e.ContactName||""].map((function(e){return e})).join(", "),date:new Date(e.StartDateTime),event:e}}},{key:"parseEventData",value:function(e,t){if(this.state.selectedDate=t,this.state.events=[],this.state.unsubmitted=[],this.setQuickStart(e),this.checkLogin(e)){for(var n=0;n<e.records.length;n++)this.state.events.push(this.createEvent(e.records[n]));for(var r=0;r<e.unsubmitteds.length;r++)this.state.events.push(this.createEvent(e.unsubmitteds[r]))}}}]),e}(),ft=function(){return E(new lt)};function dt(){return(dt=m.default(v.default.mark((function e(t){var n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=ft()).state.hasActiveCall){e.next=5;break}j("stopDetailing",t||ut),e.next=17;break;case 5:e.t0=P,e.next="WINDOWS"===e.t0?8:15;break;case 8:return e.t1=n,e.next=11,j("getCrmEventsForToday",{target:t||ut});case 11:return e.t2=e.sent,e.t3=new Date,e.t1.parseEventData.call(e.t1,e.t2,e.t3),e.abrupt("break",17);case 15:return j("startDetailing",t||ut),e.abrupt("break",17);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(){return(pt=m.default(v.default.mark((function e(t,n){var r;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ft(),e.t0=r,e.next=4,j("getCrmEventsByDate",{target:t||ut,timestamp:n});case 4:e.t1=e.sent,e.t2=new Date(parseInt(n)),e.t0.parseEventData.call(e.t0,e.t1,e.t2);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ht(){return vt.apply(this,arguments)}function vt(){return(vt=m.default(v.default.mark((function e(){return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j("getFavoriteItems",{source:"homescreen"}).then((function(e){var t=nt(),n={};e&&e.length&&e.forEach((function(e){return n[e]=!0})),t.markFavorites(n)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mt(){return yt.apply(this,arguments)}function yt(){return(yt=m.default(v.default.mark((function e(){var t,n,r,a,o,i,s=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:5,n=Ye(),r=nt(),a=ct(),process.env.VUE_APP_TI&&(window.Ti=JSON.parse(process.env.VUE_APP_TI),window.Ti.App.fireEvent=function(){return!0}),e.next=7,pe("Ti",t);case 7:return j("askJSON"),process.env.VUE_APP_SERVERJSON&&(window.serverJSON=JSON.parse(process.env.VUE_APP_SERVERJSON),window.documentPath="/"),e.next=11,pe("serverJSON",t);case 11:return(o=e.sent)&&(o.files=r.extendFiles(o.files),r.state.documentPath=window.documentPath,W(n.state,window.serverJSON),W(r.state,window.serverJSON),W(a.state,window.serverJSON)),process.env.VUE_APP_PRESENTATIONSOBJECT&&(window.presentationsObject=JSON.parse(process.env.VUE_APP_PRESENTATIONSOBJECT)),j("loadPresentationsFromDB",{}),e.next=17,pe("presentationsObject",t);case 17:(i=e.sent)&&r.parsePresentations(i);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wt(){return(wt=m.default(v.default.mark((function e(){var t,n=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:5,e.next=3,mt(t);case 3:return e.next=5,ht();case 5:gt();case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gt(){var e=ct();if(e.state.categories){var t=e.loaded&&bt()||It();t?e.setMainNav(t):j("uiReady")}else j("uiReady")}function bt(){var e=ct(),t="undefined"!=typeof localStorage?localStorage.getItem("".concat(e.state.appID,".mainNavItem")):null;return e.state.categories&&t?e.state.categories.find((function(e){return e.ID==t})):null}function It(){var e=ct();return e.state.categories?e.state.categories.find((function(e){return e.isDefault}))||e.state.categories.find((function(e){return e.parentCategory==$e})):null}window.setCurrentContact=function(e,t){ft().setCurrentContact(e,t)},window.loggedOut=function(){ft().setLoggedIn(!1)},window.updateCRM=function(){ft().setLoggedIn(!0)},window.enableCrm=function(e){ft().setLoggedIn("true"===e)},window.gotJSON=function(e,t){try{window.documentPath=t,window.serverJSON=JSON.parse(e),window.appID=window.serverJSON.appID}catch(e){j("Error",e)}},window.sentPitcherEvent=function(){};var Tt={presentation:function(e){e.isCustomPdf?St(e):j("loadPresentation",{dataOfPres:e})},pdf:function(e){e.isCustom?St(e):Ot(e,{launchMode:1,viewMode:e.year})},"3D":function(e){Ct(e,"loadThreeD")},molecule:function(e){Ct(e,"loadMolecule")},brochure:function(e){Ot(e,{launchMode:2,viewMode:e.year})},video:function(e){Dt(e,0)},"video-online":function(e){Dt(e,1)},surveys:function(e,t){var n=e.vUrl,r=xt(e.body);j("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("surveys",""),"/index.html"),title:r,showBar:!0,folderName:"surveys",allowPortrait:!0,parameters:t})},zip:function(e,t){var n=e.vUrl,r=xt(e.body),a=0,o=1;if(null!=e.extra2){var i=e.extra2.split("|");o=i.length>0&&1==i[0]?0:1,a=i.length>1&&1==i[1]?1:0}j("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("zip",""),"/index.html"),title:r,showBar:o,folderName:"zip",allowPortrait:a,parameters:t})}};function xt(e){return"".concat(e).replace(/[\\"']/g,"\\$&").replace(/\\u0000/g,"\\0").replace('"',"")}function St(e){j("loadCustomPDF",{dataOfPres:e})}function Ot(e,t){t.viewMode=1==t.viewMode?3:1,t.file=e.vUrl,t.pdfID=e.ID,t.titleV=xt(e.body),j("loadPDF",t)}function Ct(e,t){var n=e.vUrl,r=n.split("/"),a=xt(e.body);r.length?j(t,{model:r[1],folder:r[0],title:a,fileID:e.ID}):j(t,{model:n,title:a,fileID:e.ID})}function Dt(e,t){var n=e.vUrl,r=xt(e.body);j(e.keywords&&e.keywords.indexOf("ybVideo")>-1?"loadYB":"loadMovie",{file:n,isOnline:t,title:r,fileID:e.ID})}function Et(e){nt().oneTimeLoadPresentations=!0,j("editPresentation",e?{dataOfPres:e,chapters:[{nameV:"Slides",startIndex:0,endIndex:e.vNumber}]}:{mix:!0,allowMix:!0})}function kt(){j("loadPresentationsFromDB",{})}function Pt(){return Nt.apply(this,arguments)}function Nt(){return(Nt=m.default(v.default.mark((function e(){var t,n,r,a,o,i=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"homescreen",n=ft(),r=Ye().state.appName,a="SELECT rowid,event_name, event_time, lastResponse FROM tbl_reports_v3 WHERE event_name LIKE '%event_redirect%'",e.next=6,U(a,r,!1,t);case 6:return o=e.sent,n.state.syncEvents=o.map((function(e){return{Id:e.rowid,name:e.event_name,time:e.event_time,date:e.event_time?new Date(parseInt(e.event_time)):"",response:e.lastResponse}})),e.abrupt("return",n.state.syncEvents);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return Ft.apply(this,arguments)}function Ft(){return(Ft=m.default(v.default.mark((function e(){var t,n,r,a,o=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"homescreen",n=ft(),r="SELECT Id, Name, Time, Status FROM SQLiteEvent WHERE Name LIKE '%event_redirect%'",e.next=5,U(r,null,!1,t);case 5:return a=e.sent,n.state.syncEvents=a.map((function(e){return{Id:e.Id,name:e.Name,time:e.Time,date:e.Time?new Date(parseInt(e.Time)):"",response:e.Status}})),e.abrupt("return",n.state.syncEvents);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=m.default(v.default.mark((function e(){var t,n=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n.length>0&&void 0!==n[0]?n[0]:"homescreen",e.t0=P,e.next="IOS"===e.t0?4:"WINDOWS"===e.t0?6:"ANDROID"===e.t0?8:9;break;case 4:return Pt(t),e.abrupt("break",10);case 6:return jt(t),e.abrupt("break",10);case 8:case 9:return e.abrupt("break",10);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.finishedCreatingPresentation=function(){kt()},window.getCategoryLogoURL=function(){return""},t.Field=Ne,t.PLATFORM=P,t.Schema=_e,t.addFavorite=function(e){e.isFavorite=!0,j("addFavoriteItem",{fileID:e.ID})},t.assign=function(e,t){for(var n in process.env.LOG&&console.warn("deprecated"),e)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=e[n])},t.assignUsingSourceKeys=W,t.clearCache=function(){F={}},t.clone=function(e){if(null==e||"object"!==b.default(e))return e;var t=e.constructor();for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},t.closeModal=function(){j("closeOpenModal")},t.contextQuery=function(e,t){return De.apply(this,arguments)},t.createSlideSet=function(){nt().oneTimeLoadPresentations=!0,Et()},t.createStore=E,t.dbSettings=A,t.deleteFile=function(e){nt().oneTimeLoadPresentations=!0,j("deletePresentation",{dataOfPres:e})},t.editFile=Et,t.eventHub=X,t.execBool=V,t.execContext=function(e,t,n){try{return new Function("with(this){\n".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}},t.execReturn=R,t.execString=function(e,t,n){try{return new Function("with(this){\nreturn String(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn String(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}},t.exitApp=function(e){j("exitApp",e||{})},t.fireEvent=j,t.generateCustomDeckChapters=ot,t.generateExternalID=function(){return"PIT_".concat(Ee(30))},t.getCrmEventsByDate=function(e,t){return pt.apply(this,arguments)},t.getExtraFieldValue=function(e,t){var n=Ye(),r=t;try{"string"==typeof n.state.config.extraField&&(n.state.config.extraField=JSON.parse(n.state.config.extraField)),void 0!==n.state.config.extraField[e]&&"string"==typeof(r=n.state.config.extraField[e])&&(r.startsWith("{")||r.startsWith("["))&&(r=JSON.parse(r))}catch(e){process.env.LOG&&console.log(e)}return r},t.getFavorites=ht,t.getField=function(e,t){return Je.apply(this,arguments)},t.getFilesWithKeyword=K,t.getFullFilepath=we,t.getInitialCategory=It,t.getLastCategory=bt,t.getLayout=ne,t.getObjectNameField=function(e){return qe.apply(this,arguments)},t.getPath=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&(n=le(n));var a=n.split("."),o=a.shift(),i=t[o];return 0===a.length?"function"==typeof i?i():i:e(i,a.join("."))},t.getPitcherFolderPath=ye,t.getRecordTypeId=function(e,t){return Xe.apply(this,arguments)},t.getSFUrl=function(e){return j("getSFUrl",{path:e})},t.getSchema=te,t.getSyncEvents=function(){return At.apply(this,arguments)},t.initializeInstance=function(){return wt.apply(this,arguments)},t.joinPath=fe,t.labelToValue=function(e,t,n){return Be.apply(this,arguments)},t.launchContentWithID=ee,t.launchFileWithID=function(e){j("launchFileWithID",{fileID:e})},t.launchFileWithKeyword=Y,t.loadConfig=Oe,t.loadLayout=function(e,t){return Ae.apply(this,arguments)},t.loadLocal=function(e){return re.apply(this,arguments)},t.loadParams=function(){return Ie.apply(this,arguments)},t.loadPdfWithPage=function(e,t,n){j("loadPDF",{file:e.vUrl,titleV:xt(e.body),viewMode:1,lockViewMode:null,references:null,articles:null,subFolder:null,annotationEnabled:!0,jumpToPage:t,pdfID:e.ID,searchString:n})},t.loadPresentationWithPage=function(e,t){j("launchContentWithID",{fileID:e,subID:t})},t.loadPresentationsFromDB=kt,t.loadSchema=Ve,t.loadServerJSON=mt,t.loadValidations=function(e){return He.apply(this,arguments)},t.loadWebPageFromFolder=G,t.makeId=Ee,t.openContent=function(e,t){Tt[e.category]&&(e.lastLaunchTime=(new Date).getTime().toString(),Tt[e.category](e,t))},t.openLink=function(e,t){return ue.apply(this,arguments)},t.planCall=function(){j("planCall")},t.query=U,t.refreshWatcher=function e(t){de("reloadConsole").then((function(){window.console.log("change detected... refresh"),setTimeout((function(){X.$emit("refresh")}),t),window.localStorage.setItem("reloadConsole","false"),e(t)}))},t.removeAllEvents=function(){var e=ft();e.state.syncEvents.forEach((function(e){j("removeEvent",{Id:e.Id})})),e.state.syncEvents=[]},t.removeEvent=function(e){var t=ft();j("removeEvent",{Id:e}),t.state.syncEvents=t.state.syncEvents.filter((function(t){return t.Id!=e}))},t.removeFavorite=function(e){e.isFavorite=!1,j("removeFavoriteItem",{fileID:e.ID})},t.removeRoot=le,t.renderContext=ie,t.renderSimpleContext=function(e,t){return oe(e)(t,/{([^{}]*)}/g)},t.resyncData=function(){j("resyncData",{})},t.saveLocal=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];j("saveFromHTML",{variables:t,closeWeb:!1,id:e,useSFDCDB:n})},t.saveObject=function(e){for(var t in e.ignoreFields||(e.ignoreFields=[]),e)(e[t]&&e[t].attributes||t.indexOf("111")>-1||t.endsWith("__r"))&&-1===e.ignoreFields.indexOf(t)&&e.ignoreFields.push(t),null===e[t]||void 0===e[t]?(e.fieldsToNull||(e.fieldsToNull=[]),-1===e.fieldsToNull.indexOf(t)&&e.fieldsToNull.push(t)):e.fieldsToNull&&e.fieldsToNull.indexOf(t)>-1&&e.fieldsToNull.splice(e.fieldsToNull.indexOf(t),1),"boolean"==typeof e[t]&&(e[t]=Number(e[t]));for(var n=0,r=["CurrencyIsoCode","attributes","CreatedById","CreatedDate","IsDeleted","LastActivityDate","LastModifiedById","LastModifiedDate","SystemModstamp","fieldsToNull"];n<r.length;n++){var a=r[n];-1===e.ignoreFields.indexOf(a)&&e.ignoreFields.push(a)}if(!e.objectType)throw new Error("no objectType defined");console.log("save object",e),e.Id?j("sendStatsFromHTML",{event_name:"event_redirect_updateSFDC",event_params:e}):j("sendStatsFromHTML",{event_name:"event_redirect_createSFDC",event_params:e})},t.search=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{threshold:.15,distance:1e3,useExtendedSearch:!0},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n&&(r.keys=n);var o=new T.default(e,ve({},r)),i=o.search("".concat(r.useExtendedSearch?"'":"").concat(t));return a?i:i.map((function(e){return e.item&&e.item}))},t.searchPitcherFile=function(e){return j("searchPitcherFile",{extra:e,body:e,keywords:e,rangeCheck:!0})},t.sendDocuments=function(){j("sendDocs")},t.sendPickingContent=function(e,t){j("sendPickingContent",{fileIDs:e,via:t})},t.setCategory=function(e){ct().setMainNav(e)},t.showAlertBox=function(e,t){j("showAlertBox",{title:e,message:t})},t.showIOSSyncWindow=function(e){j("showCachedOrders",e)},t.source=N,t.startCall=function(){j("startCall")},t.startDetailingWithID=function(e){j("startDetailingWithID",{ID:e})},t.startPreCall=function(e){ft().state.hasActiveCall||j("startPreCall",e)},t.startStopDetailing=function(e){return dt.apply(this,arguments)},t.transform=D,t.trimChar=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=x.default(e).findIndex((function(e){return e!==t})),a=n?x.default(e).reverse().findIndex((function(e){return e!==t})):0;return e.substring(r,e.length-a)},t.uid=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t,r=0;r<e;r++)n+=0===r?"".concat(me()).concat(me()):"".concat(me()),r+1!==e&&(n+="-");return n},t.unpackProxy=function e(t){var n={};for(var r in Object.assign(n,t),t)Object.prototype.hasOwnProperty.call(t,r)&&("Proxy"!=typeof t[r]&&"object"!==b.default(t[r])||(n[r]=e(t[r])));return n},t.useCategoriesStore=ct,t.useConfigStore=Se,t.useDetailing=function(){return ft().state},t.useDetailingStore=ft,t.useFilesStore=nt,t.useLayoutStore=Fe,t.useParams=Te,t.useParamsStore=be,t.useSchemaStore=We,t.useSystemStore=Ye,t.useValidations=function(){return ze().state},t.useValidationsStore=ze,t.waitForWindowProp=pe,t.watchLocalStorage=de,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
define(["require","exports","@vue/composition-api","@babel/runtime/regenerator","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/classCallCheck","@babel/runtime/helpers/createClass","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/typeof","vue","fuse.js/dist/fuse.min.js","@babel/runtime/helpers/toConsumableArray","@babel/runtime/helpers/slicedToArray"],(function(e,t,n,r,a,o,i,s,c,u,l,f,d){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function h(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var v=p(r),m=p(a),y=p(o),w=p(i),g=p(s),b=p(c),I=p(u),T=p(l),S=p(f),x=p(d);function O(e,t){for(var n=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),r=0,a=n.length;r<a;++r){var o=n[r];if(!(o in e))return;e=e[o]}return e}var C={};function D(e){var t=Object.getPrototypeOf(e),r=Object.getOwnPropertyDescriptors(t),a={};return Object.keys(e).forEach((function(t){var n=e[t];t.startsWith("on_")||(a[t]=n,"function"==typeof a[t]&&a[t].bind(a))})),Object.keys(r).forEach((function(e){if("constructor"!==e&&!e.startsWith("__")){var t=r[e].get,o=r[e].set,i=r[e].value;if(e.startsWith("on_"))return;i?(a[e]=i,"function"==typeof a[e]&&a[e].bind(a)):t&&o?a[e]=n.computed({get:t.bind(a),set:o.bind(a)}):t&&(a[e]=n.computed(t.bind(a)))}})),a=n.reactive(a),Object.keys(e).forEach((function(t){var r=e[t];t.startsWith("on_")&&(a[t]=n.watch(n.computed((function(){return O(a,t.substring(3).split("_").join("."))})),r))})),Object.keys(r).forEach((function(e){if("constructor"!==e&&!e.startsWith("__")){var t=r[e].value;e.startsWith("on_")&&(a[e]=n.watch(n.computed((function(){return O(a,e.substring(3).split("_").join("."))})),t))}})),a}function E(e){if(!e.id)throw"store needs an id attribute";return C&&C[e.id]?C[e.id]:(C[e.id]=D(e),C[e.id]?C[e.id]:void 0)}var k,P=(k=navigator.userAgent||navigator.vendor||window.opera,-1!==navigator.userAgent.indexOf("emulate-ios")?(console.warn("[VUE-SDK]: PLATFORM is being emulated as IOS"),"IOS"):window.parent!==window.self?"CONNECT":/windows phone/i.test(k)||/windows/i.test(k)?"WINDOWS":/android/i.test(k)?"ANDROID":/iPad|iPhone|iPod|AppleWebKit/.test(k)&&!window.MSStream?"IOS":"unknown"),N="modal";function j(e,n){return new Promise((function(r,a){var o=t.fireEventCount++,i="fireEventCB".concat(o),s="fireEventErrorCB".concat(o);function c(){delete window[i],delete window[s]}n||(n={}),n.callBackFunc=i,n.callBack=i,n.errorFunc=s,n.emptyFunction=s,n.source=n.source||N,window[i]=function(e){if("string"==typeof e&&(e.startsWith("{")||e.startsWith("[")))try{r(JSON.parse(e))}catch(e){a("Invalid JSON")}else r(e);c()},window[s]=function(e){a(e),c()},Object.prototype.hasOwnProperty.call(window,"Ti")?window.Ti.App.fireEvent(e,n):a("Ti not found")}))}t.fireEventCount=0;var F={},A={cacheEnabled:!1,cacheTimeout:500,defaultDatabase:"pitcher",longQueryWarning:!1};function _(e,t){F[e]={result:t,time:Date.now()}}function L(e){return A.cacheEnabled&&!e.toLowerCase().includes("delete")&&!e.toLowerCase().includes("insert")&&Object.prototype.hasOwnProperty.call(F,e)&&F[e].time+A.cacheTimeout>Date.now()}function U(e){return M.apply(this,arguments)}function M(){return(M=m.default(v.default.mark((function e(t){var n,r,a,o=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:null,r=o.length>2&&void 0!==o[2]&&o[2],a=o.length>3&&void 0!==o[3]?o[3]:"modal",process.env.LOG&&console.log(t),e.abrupt("return",new Promise((function(e,o){if(L(t)&&A.cacheEnabled)return console.log("cache hit"),e(F[t].result);var i=new Date;j("dbFunction",{db:n||A.defaultDatabase,iosMode:!0,pType:"query",query:t,source:a}).then((function(n){var a=new Date-i;a>1e3&&A.longQueryWarning&&console.warn("slow query (".concat((a/1e3).toFixed(2),"s): ").concat(t));var s=[];n.error&&(console.error(t),o(new Error(n.error)));for(var c=0;c<n.results.length;c++){for(var u=n.results[c],l={},f=0;f<n.columns.length;f++){var d=n.columns[f],p=u[f];if("WINDOWS"===P&&"string"==typeof p&&(p=p.replace(/''/g,"'")),"extraField"===d||"account"===d||"eventJSON"===d||"contact"===d||"Json"===d||"user"===d||"userObject"===d){var h=JSON.parse(p);for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&"attributes"!==v&&(r&&null===h[v]||(l[v]=h[v]))}else l[d]=void 0===p?null:p}s.push(l)}A.cacheEnabled&&_(t,s),e(s)})).catch(o)})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(e,t){Object.keys(e).forEach((function(n){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}function V(e,t,n){try{return new Function("with(this){\nreturn Boolean(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn Boolean(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}}function R(e,t,n){try{return new Function("with(this){\nreturn ".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}}var X=new I.default({});function J(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var q=!1,Q={};function z(){return H.apply(this,arguments)}function H(){return(H=m.default(v.default.mark((function e(){var t,n,r,a,o,i,s,c;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q){e.next=6;break}return e.next=3,j("getPitcherFiles",{fullData:!0});case 3:t=e.sent,n=J(t);try{for(n.s();!(r=n.n()).done;){a=r.value,o=void 0;try{o=a.keywords.split(",").map((function(e){return e.trim()}))}catch(e){o=[]}i=J(o);try{for(i.s();!(s=i.n()).done;)c=s.value,Q[c]||(Q[c]=[]),Q[c].push(a)}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}case 6:q=!0;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(e){return $.apply(this,arguments)}function $(){return($=m.default(v.default.mark((function e(t){return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return e.abrupt("return",Q[t]);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"zip",i=arguments.length>6&&void 0!==arguments[6]&&arguments[6];j("loadWebPageFromFolder",{urlValue:e,title:t,showBar:a,ID:n,folderName:o,allowPortrait:i,parameters:r})}function Y(e,t){return Z.apply(this,arguments)}function Z(){return(Z=m.default(v.default.mark((function e(t,n){var r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K(t);case 2:1!==(r=e.sent).length&&alert("".concat(r.length," files found for keyword: ").concat(t)),a=r[0],o="".concat(a.vUrl.replace(".zip","").replace("zip/",""),"/index.html"),"ANDROID"===P?G(o,a.body,a.ID,n):ee(a.ID,n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];j("launchContentWithID",{fileID:e,parameters:t,subId:n,currentID:r,forceChange:a})}function te(e){var t;if("ANDROID"===P||"WINDOWS"===P)t="".concat(e,"_desc");else{if("IOS"!==P)throw"no supported: ".concat(P);t="".concat(e,"_desc_cache")}try{return j("getFromHTML",{id:t,useSFDCDB:!0})}catch(t){throw"Schema not found:".concat(e)}}function ne(e,t){var n;return"IOS"===P||"ANDROID"===P?n="".concat(e,"_").concat(t,"_layout"):"WINDOWS"===P&&(n="".concat(e,"<").concat(t,">_desc")),console.log(n),j("getFromHTML",{id:n,useSFDCDB:!0})}function re(){return(re=m.default(v.default.mark((function e(t){var n,r,a=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(a.length>1&&void 0!==a[1])||a[1],e.next=3,j("getFromHTML",{id:t,useSFDCDB:n});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(e,t,n){return oe(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{%\s*if([^{}]*)\s*%}(.*){%\s*endif\s*%}/g;return e.replace(n,(function(e,n,r){return V(n,t)?r:""}))}}(e)(t))(t,n)}function oe(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{{([^{}]*)}}/g;return e.replace(n,(function(e,n){return R(n,t)}))}}function ie(e,t){return ae(e,t)}function se(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ue(){return(ue=m.default(v.default.mark((function e(t,n){var r,a,o,i,s,c,u,l;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ie(t,n),window.console.info("open link",t),t=t.split("pitcher://").join(""),r=2===t.split("/").length?t.split("/")[0]:2===t.split("?").length?t.split("?")[0]:t,a=t.split("?")[1],o={},a.length){a=decodeURI(a).split("&"),i=se(a);try{for(i.s();!(s=i.n()).done;)c=s.value,u=c.split("="),o[u[0]]=u[1]}catch(e){i.e(e)}finally{i.f()}}for(l in o)window.localStorage[l]=o[l];if(!isNaN(Number(r))){e.next=13;break}return e.next=11,Y(r,o);case 11:e.next=15;break;case 13:return e.next=15,ee(r,o);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function le(e){var t=e.split(".");return 1===t.length?e:(t.shift(),e=t.join("."))}function fe(){for(var e=[].slice.call(arguments),t=e[0],n=1;n<e.length;n++)if(e[n]){var r=e[n].replace(/^(\/|\\)/,"");t="".concat(t.replace(/(\/|\\)$/,""),"/").concat(r)}return t}function de(e){return new Promise((function(t){var n=window.localStorage,r=n.getItem(e);!function a(){setTimeout((function(){n.getItem(e)==r?a():t(n.getItem(e))}),1e3)}()}))}function pe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=10*t;if(!e||""===e)throw new Error("No property is sent to watch on window");return new Promise((function(t){if(void 0!==window[e])return t(window[e]);var r=0,a=setInterval((function(){if(r++,void 0!==window[e]||r===n)return clearInterval(a),t(window[e])}),100)}))}try{window.localStorage.setItem("reloadConsole","false")}catch(e){console.log(e)}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?he(Object(n),!0).forEach((function(t){g.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function me(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function ye(){var e,t;if(null!==(e=window)&&void 0!==e&&null!==(t=e.Ti)&&void 0!==t&&t.TiWeb)return"/";var n=window.location.href;if(!n.includes("zip/")&&!n.startsWith("http"))throw Error('"zip" folder not found in path');var r,a,o=n.lastIndexOf("zip//");if(-1!==o){var i=(a=o,[(r=n).substring(0,a),r.substring(a)]);n=i[0]+i[1].replace("zip//","zip/")}return(n=n.split("zip/")[0]).endsWith("/")?n:"".concat(n,"/")}function we(e){return ye()+e}window.getParameters=function(e){window.params=JSON.parse(e)},window.setParameters=function(e){window.params=JSON.parse(e)};var ge=function(){function e(){y.default(this,e),g.default(this,"id","params"),g.default(this,"state",n.reactive({account:n.ref(null),contacts:null,contact:null,salesForceUser:null,user:null}))}return w.default(e,[{key:"locale",get:function(){var e=this.state.salesForceUser?this.state.salesForceUser:this.state.user,t=null;return e&&(t=e.LocaleSidKey?e.LocaleSidKey:e.LanguageLocaleKey),t?t.split("_").slice(0,2).join("-"):null}},{key:"language",get:function(){if(this.state.salesForceUser)return this.state.salesForceUser.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.user)return this.state.user.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.config){var e={AUSDE:"de",BI:"id",BR:"pt",BU:"bg",CAFR:"fr",CZ:"cs",DAN:"da",ESMX:"es",EST:"et",JP:"ja",LET:"lv",PO:"pl",PRT:"pt",SCH:"zh-CN",TCH:"zh-TW",UA:"uk",VN:"vi"};return e[this.state.config.langV]?e[this.state.config.langV]:this.state.config.langV.toLowerCase()}return null}},{key:"context",get:function(){return{Account:this.state.account,Contact:this.state.contact,Contacts:this.state.contacts,User:this.state.salesForceUser?this.state.salesForceUser:this.state.user}}}]),e}();function be(){return E(new ge)}function Ie(){return(Ie=m.default(v.default.mark((function e(){var t,n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=be(),console.log("[@pitcher/core]: account",t.state.account),!process.env.VUE_APP_PARAMS){e.next=6;break}return n=JSON.parse(process.env.VUE_APP_PARAMS),Object.assign(t.state,n),e.abrupt("return",t.state);case 6:return e.next=8,pe("params");case 8:return e.sent&&Object.assign(t.state,window.params),e.abrupt("return",t.state);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return be().state}var Se=function(){function e(){y.default(this,e),g.default(this,"id","config"),g.default(this,"state",{customCaches:null})}return w.default(e,[{key:"getTableDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n.tableToCache,e[n.objectName]=n.tableToCache}return e}},{key:"getCacheDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n,e[n.objectName]=n}return e}}]),e}();function xe(){return E(new Se)}function Oe(){return Ce.apply(this,arguments)}function Ce(){return(Ce=m.default(v.default.mark((function e(){var t,n,r,a,o,i,s=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:"modal",n=xe(),e.next=4,j("getAppConfig",{source:t});case 4:if(void 0!==(r=e.sent).userAttrSpecificSettings&&(a=Te(),o=a.user,r.userAttrSpecificSettings.forEach((function(e){var t=o[e.attrP];if(t&&t.includes(e.valueP))if("replace"===e.typeP)for(var n in e.settings)r[n]=e.settings[n];else if("add"===e.typeP)for(var a in e.settings)r[a]||(r[a]=[]),Array.isArray(e.settings[a])?r[a]=r[a].concat(e.settings[a]):r[a].push(e.settings[a])}))),console.log("[@pitcher/core]: app config",r),r.customCaches=Array.isArray(r.customCaches)?r.customCaches:[],"IOS"!==P){e.next=15;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts_m_v3",query:r.sfdcAccountQuery,fieldTypes:{account:"TEXT",id:"TEXT",lat:"TEXT",lon:"TEXT",city:"TEXT",lastVisit:"TEXT",accountName:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts_m_v4",query:r.sfdcContactQuery,fieldTypes:{contact:"TEXT",id:"TEXT",accountID:"TEXT",lastVisit:"TEXT",name:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users_m_v3",query:"",fieldTypes:{userObject:"TEXT",id:"TEXT",lastName:"TEXT",firstName:"TEXT",name:"TEXT",roleID:"TEXT",parentRoleID:"TEXT",extraField:"TEXT"}}),e.next=31;break;case 15:if("ANDROID"!==P){e.next=22;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts",query:r.sfdcAccountQuery}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts",query:r.sfdcContactQuery}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users",query:""}),e.next=31;break;case 22:if("WINDOWS"!==P){e.next=30;break}(r=r[0]).customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"SQLiteSfAccount",query:r.sfdcAccountQuery,fieldTypes:{BillingCity:"TEXT",BillingCountry:"TEXT",BillingStreet:"TEXT",Id:"TEXT",ExternalId:"TEXT",Json:"TEXT",JsonUntouched:"TEXT",LastModifiedDate:"TEXT",LastModifiedTimeStamp:"INTEGER",LastVisitTimeStamp:"INTEGER",Lat__c:"REAL",Long__c:"REAL",Name:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"SQLiteSfContact",query:r.sfdcContactQuery,fieldTypes:{Id:"TEXT",ExternalId:"TEXT",LastModifiedDate:"TEXT",Name:"TEXT",AccountId:"TEXT",Email:"TEXT",Json:"TEXT",JsonUntouched:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"SQLiteSfEvent",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"SQLiteSfUser",query:"",fieldTypes:{Id:"TEXT",IsActive:"INTEGER",LastModifiedDate:"TEXT",FirstName:"TEXT",LastName:"TEXT",Json:"TEXT"}}),e.next=31;break;case 30:throw new Error("Platform not supported: ".concat(P));case 31:for(i in r)n.state[i]=r[i];return e.abrupt("return",n.state);case 33:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=m.default(v.default.mark((function e(t,n){var r,a,o,i,s,c,u,l,f=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f.length>2&&void 0!==f[2]?f[2]:null,a=f.length>3&&void 0!==f[3]&&f[3],t){e.next=4;break}throw Error("no query provided");case 4:for(c in o=xe(),i=be().state,t=t.split("TODAY").join("date('now')"),s=o.getTableDict,n)Object.prototype.hasOwnProperty.call(n,c)&&(s[c]=n[c]);return i.account&&(s.account=i.account,s.contacts=i.contacts),i.salesForceUser&&(s.user=i.salesForceUser),i.user&&(s.user=i.user),i.locale&&(s.locale=i.locale),u=ie(t,s),e.prev=14,e.next=17,U(u,r,a);case 17:return l=e.sent,e.abrupt("return",l);case 21:throw e.prev=21,e.t0=e.catch(14),console.error(u,s),e.t0;case 25:case"end":return e.stop()}}),e,null,[[14,21]])})))).apply(this,arguments)}function Ee(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function ke(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=function(){function e(t,r){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];y.default(this,e),g.default(this,"references",n.ref([])),g.default(this,"referencesTo",[]),Object.assign(this,t),this.parentObjectType=r,this.required=!t.nillable||t.nameField,this.errors=[],a&&this.load_refs()}var t;return w.default(e,[{key:"valid",value:function(e){return"boolean"===this.type&&!0===e||!1===e||!(!e&&this.required)}},{key:"load_refs",value:function(){var e=xe();if(this.referenceTo&&this.referenceTo.length){var t,n=e.getCacheDict[this.parentObjectType],r=ke(this.referenceTo);try{for(r.s();!(t=r.n()).done;){var a=t.value,o=e.getCacheDict[a];if(!o)return void window.console.warn("referenced object not found: ".concat(a));this.load(o,n,a)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"load",value:(t=m.default(v.default.mark((function e(t,n,r){var a,o,i,s,c,u,l,f,d;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null,n&&n.filters&&(a=n.filters[this.name]),o=t.tableToCache,i="select Id, ",s="Name",t.fieldTypes&&t.fieldTypes.Name?i+="Name":"Account"===r?"ANDROID"===P?(i+="account_name",s="account_name"):(i+="accountName",s="accountName"):"Contact"===r||"User"===r?(i+="name",s="name"):t.fieldTypes.extraField?i+="extraField":alert("no name field found in table for ".concat(r)),i+=" from ".concat(o),e.next=9,U(i);case 9:c=e.sent,u=[],l=ke(c),e.prev=12,l.s();case 14:if((f=l.n()).done){e.next=23;break}if(d=f.value,!a){e.next=20;break}if(V(a,d)){e.next=20;break}return e.abrupt("continue",21);case 20:u.push({value:d.Id,text:d[s]});case 21:e.next=14;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(12),l.e(e.t0);case 28:return e.prev=28,l.f(),e.finish(28);case 31:this.references.value=this.references.value.concat(u);case 32:case"end":return e.stop()}}),e,this,[[12,25,28,31]])}))),function(e,n,r){return t.apply(this,arguments)})},{key:"loadExternalReferences",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Name",r=[],a=ke(e);try{for(a.s();!(t=a.n()).done;){var o=t.value;r.push({value:o.Id,text:o[n]})}}catch(e){a.e(e)}finally{a.f()}this.references.value=r}}]),e}(),je=function e(){y.default(this,e),g.default(this,"id","layout"),g.default(this,"state",{})},Fe=function(){return E(new je)};function Ae(){return(Ae=m.default(v.default.mark((function e(t,n){var r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="".concat(t,"_").concat(n),!(a=Fe()).state[r]){e.next=6;break}return e.abrupt("return",a.state[r]);case 6:return e.next=8,ne(t,n);case 8:return o=e.sent,a.state[r]=new _e(o,t),e.abrupt("return",a.state[r]);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _e=function e(t,n){for(var r in y.default(this,e),t)this[r]=t[r];this.objectType=n};function Le(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Me=function e(){y.default(this,e),g.default(this,"id","schema"),g.default(this,"state",{})},We=function(){return E(new Me)};function Ve(e){return Re.apply(this,arguments)}function Re(){return(Re=m.default(v.default.mark((function e(t){var n,r;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=We()).state[t]){e.next=5;break}return e.abrupt("return",n.state[t]);case 5:return e.next=7,te(t);case 7:return r=e.sent,n.state[t]=r,e.abrupt("return",n.state[t]);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xe(){return(Xe=m.default(v.default.mark((function e(t,n){var r,a,o,i;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:r=e.sent,a=Le(r.recordTypeInfos),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}if((i=o.value).name!==n){e.next=10;break}return e.abrupt("return",i.recordTypeId);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function Je(){return(Je=m.default(v.default.mark((function e(t,n){var r,a,o,i,s;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:r=e.sent,a=Le(r.fields),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=13;break}if((i=o.value).name!==n.trim()){e.next=11;break}return s=new Ne(i,t),e.abrupt("return",s);case 11:e.next=6;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),a.e(e.t0);case 18:return e.prev=18,a.f(),e.finish(18);case 21:throw new Error("field not found:".concat(n));case 22:case"end":return e.stop()}}),e,null,[[4,15,18,21]])})))).apply(this,arguments)}function Be(){return(Be=m.default(v.default.mark((function e(t,n,r){var a,o,i,s,c,u,l;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:a=e.sent,o=Le(a.fields),e.prev=4,o.s();case 6:if((i=o.n()).done){e.next=28;break}if((s=i.value).name!==n.trim()||!s.picklistValues){e.next=26;break}c=Le(s.picklistValues),e.prev=10,c.s();case 12:if((u=c.n()).done){e.next=18;break}if((l=u.value).label!==r){e.next=16;break}return e.abrupt("return",l.value);case 16:e.next=12;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(10),c.e(e.t0);case 23:return e.prev=23,c.f(),e.finish(23);case 26:e.next=6;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(4),o.e(e.t1);case 33:return e.prev=33,o.f(),e.finish(33);case 36:case"end":return e.stop()}}),e,null,[[4,30,33,36],[10,20,23,26]])})))).apply(this,arguments)}function qe(){return(qe=m.default(v.default.mark((function e(t){var n,r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve(t);case 2:n=e.sent,r=Le(n.fields),e.prev=4,r.s();case 6:if((a=r.n()).done){e.next=12;break}if(!(o=a.value).nameField){e.next=10;break}return e.abrupt("return",o.name);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),r.e(e.t0);case 17:return e.prev=17,r.f(),e.finish(17);case 20:throw new Error("No name field found");case 21:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}var Qe=function e(){y.default(this,e),g.default(this,"id","validation"),g.default(this,"loaded",!1),g.default(this,"state",{listviews:[],lookups:[],rules:[]})};function ze(){return E(new Qe)}function He(){return(He=m.default(v.default.mark((function e(t){var n,r,a,o;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=ze()).loaded){e.next=13;break}return e.next=4,K(t);case 4:return r=e.sent,e.next=7,fetch(we(r[0].vUrl));case 7:return a=e.sent,e.next=10,a.json();case 10:o=e.sent,n.state=Object.assign(n.state,o),n.loaded=!0;case 13:return e.abrupt("return",n.state);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ke=2,$e="0",Ge=function e(){y.default(this,e),g.default(this,"id","systemStore"),g.default(this,"state",n.reactive({config:null,groups:null,appID:null,supportEmail:null,deviceName:null,metadata:null,messages:null,appName:null,systemLang:null,locale:null,userfullname:null,ajaxtoken:null,isCustomerUI:!1,batteryLevel:0,statusBadge:0,todoBadge:0}))},Ye=function(){return E(new Ge)};function Ze(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}window.updateStatusBadge=function(e){var t=Ye();e=parseInt(e),t.state.statusBadge=e||0},window.updateTodoBadge=function(e){var t=Ye();e=parseInt(e),t.state.todoBadge=e||0},window.fetch||new Promise((function(t,n){e(["whatwg-fetch"],(function(e){t(h(e))}),n)}));var tt=function(){function e(){var t=this;y.default(this,e),g.default(this,"id","filesStore"),g.default(this,"oneTimeLoadPresentations",!1),g.default(this,"state",n.reactive({files:[],uiFiles:n.computed((function(){return t.state.files.filter((function(e){return e.shouldShowInUI}))})),slides:[],documentPath:null,presentations:[],customs:[],initialAllowedIDs:null,allowedIDs:[]}))}return w.default(e,[{key:"isFileExpiredOrNotReady",value:function(e,t,n){return void 0!==t&&void 0!==n&&(null!=t&&null!=n&&(0!=t&&0!=n&&(t>e||n<e)))}},{key:"shouldShowInUI",value:function(e,t){return"T"!=t.ID[0]&&7!=t.typeV&&-1!=t.typeV&&0!=t.typeV&&"images"!=t.category&&!this.isFileExpiredOrNotReady(e,t.startDate,t.endDate)}},{key:"extendFiles",value:function(e){var t=this,n=(new Date).getTime()/1e3;return e.forEach((function(e){e.shouldShowInUI=t.shouldShowInUI(n,e),e.thumbnailUrl=fe(window.documentPath,e.thumb)})),e}},{key:"parsePresentations",value:function(e){var t=this;this.state.customs=[],this.state.presentations=[],e.forEach((function(e){return t.parseSinglePresentation(e)})),this.oneTimeLoadPresentations&&(j("loadPresentationsFromDB",{}),this.oneTimeLoadPresentations=!1)}},{key:"parseCustomPdf",value:function(e){return e.ID=e.slideOrder.split(",")[0].split("|")[0],e.isCustomPdf=!0,e}},{key:"parseSinglePresentation",value:function(e){try{return e.isCustom!=Ke&&(void 0!==e.ID&&null!=e.ID||(e=this.parseCustomPdf(e)),null==e.vSubFolder&&(e.containsMultiple=!0,e.vSubFolder=e.slideOrder.split(",")[0].split("|")[0],e.ID=e.slideOrder.split(",")[0].split("|")[0],-1==e.vSubFolder.indexOf("_")?e.isCustomPdf=!0:e.ID="".concat(parseInt(e.ID))),e.ID="".concat(e.ID),e.isCustom?this.addFileAsCustom(e):this.mergePresentation(e)),!0}catch(e){j("Error",e)}return!1}},{key:"createAppendCustomFile",value:function(e,t){var n={};Object.assign(n,e),Object.assign(n,t),n.body=t.presentationName,this.state.customs.push(n)}},{key:"addFileAsCustom",value:function(e){var t=this.state.files.find((function(t){return t.ID==e.ID}));if(t)this.createAppendCustomFile(t,e);else{var n=this.state.slides.find((function(t){return t.vSubfolder==e.vSubFolder}));n&&(t=this.state.files.find((function(e){return e.ID==n.ID})))&&(e.ID=t.ID,this.createAppendCustomFile(t,e))}}},{key:"mergePresentation",value:function(e){this.state.presentations.push(e);var t=this.state.files.find((function(t){return t.ID==e.ID}));t&&Object.assign(t,e)}},{key:"markFavorites",value:function(e){return this.state.files.forEach((function(t){void 0===t.isFavorite?I.default.set(t,"isFavorite",e[t.ID]||!1):t.isFavorite=e[t.ID]||!1})),this.state.files}},{key:"setAllowedIds",value:function(e){e&&e.length>0&&null==this.state.initialAllowedIDs&&(this.state.initialAllowedIDs=e),this.state.allowedIDs=e||[]}}]),e}(),nt=function(){return E(new tt)};function rt(e){return e.slideOrder?e.slideOrder.split(",").map((function(e){var t=e.split("|"),n=x.default(t,2),r=n[0],a=n[1];return{deckId:r,index:parseInt(a)-1}})):[]}function at(e,t){if(!e)return null;for(var n=0;n<e.length;n++){var r=e[n];if(t>=r.startIndex&&t<r.endIndex)return r}return null}function ot(e){return it.apply(this,arguments)}function it(){return(it=m.default(v.default.mark((function e(t){var n,r,a;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="-",r=v.default.mark((function e(r){var a,o,i,s,c,u,l,f,d;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=t[r]).isCustom){e.next=3;break}return e.abrupt("return","continue");case 3:if(0!==(o=rt(a)).length){e.next=6;break}return e.abrupt("return","continue");case 6:i=o.reduce((function(e,t){return e.add(t.deckId),e}),new Set),s=new Map,c=Ze(i),e.prev=9,c.s();case 11:if((u=c.n()).done){e.next=28;break}return l=u.value,e.prev=13,e.next=16,fetch("".concat(window.documentPath,"/slides/").concat(l,"/chapters.json"));case 16:return f=e.sent,e.next=19,f.json();case 19:d=e.sent,s.set(l,d.chapters),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(13),console.warn("[Chapter Generation]: ".concat(window.documentPath,"/slides/").concat(l,"/chapters.json does not exist!"));case 26:e.next=11;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(9),c.e(e.t1);case 33:return e.prev=33,c.f(),e.finish(33);case 36:if(o.forEach((function(e){var t=at(s.get(e.deckId),e.index);e.chapterName=(null==t?void 0:t.nameV)||n})),!o[0]){e.next=41;break}return e.next=40,fetch("".concat(window.documentPath,"/slides/").concat(o[0].deckId,"/setup.json")).then((function(e){return e.json()})).catch((function(){return null}));case 40:a.setupJSON=e.sent;case 41:a.chapters={chapters:o.reduce((function(e,t,r){var a=e[e.length-1],o=t.deckId===(null==a?void 0:a.deckId),i=t.chapterName===(null==a?void 0:a.nameV),s=t.chapterName===n&&(null==a?void 0:a.nameV)===n;return a&&i&&(o||!o&&s)?a.endIndex=r+1:e.push({nameV:t.chapterName,deckId:t.deckId,startIndex:r,endIndex:r+1}),e}),[]).filter((function(e){return null!==e})).map((function(e){return{nameV:e.nameV,startIndex:e.startIndex,endIndex:e.endIndex}}))},1===a.chapters.chapters.length&&a.chapters.chapters[0].nameV===n&&(a.chapters.chapters=[]),j("saveFromHTML",{id:a.ID,variables:a});case 44:case"end":return e.stop()}}),e,null,[[9,30,33,36],[13,23]])})),e.t0=v.default.keys(t);case 3:if((e.t1=e.t0()).done){e.next=11;break}return a=e.t1.value,e.delegateYield(r(a),"t2",6);case 6:if("continue"!==e.t2){e.next=9;break}return e.abrupt("continue",3);case 9:e.next=3;break;case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.getAllowedIDs=function(){return nt().state.allowedIDs},window.loadPresentations=function(e){var t=e;"string"==typeof e&&(t=JSON.parse(t)),ot(t).then((function(){(window.presentationsObject=t,window.presentationsObject)&&nt().parsePresentations(window.presentationsObject)}))},window.filterJSON=function(e){var t=nt();e?t.setAllowedIds(JSON.parse(e)):t.setAllowedIds([])};var st=function(){function e(){var t=this;y.default(this,e),g.default(this,"id","categoriesStore"),g.default(this,"loaded",!1),g.default(this,"state",n.reactive({category:{},categories:[],parentCategories:n.computed((function(){return t.state.categories.filter((function(e){return e.parentCategory==$e}))})),subCategories:n.computed((function(){return t.state.categories.filter((function(e){return e.parentCategory!=$e}))}))}))}return w.default(e,[{key:"setMainNav",value:function(e){e&&(window.lastViewedCategory=e,"undefined"!=typeof localStorage&&localStorage.setItem("".concat(this.state.appID,".mainNavItem"),e.ID),j("setCategory",{category:JSON.stringify(e)}),this.state.category=e,this.loaded||(this.loaded=!0,j("uiReady")))}}]),e}(),ct=function(){return E(new st)};window.setMainNav=function(e){window.lastViewedCategory=e};var ut={xPos:50,yPos:30,widthV:160,heightV:50},lt=function(){function e(){var t=this;y.default(this,e),g.default(this,"id","detailing"),g.default(this,"state",n.reactive({currentContact:null,currentAccount:null,hasActiveCall:n.computed((function(){return null!=t.state.currentContact})),todaysCalls:[],isFilterActive:!1,quickStartEnabled:!0,quickPlanningEnabled:!0,selectedDate:null,events:[],unsubmitted:[],syncEvents:[],loggedIn:!1}))}var t;return w.default(e,[{key:"setLoggedIn",value:(t=m.default(v.default.mark((function e(t){var n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||this.state.loggedIn){e.next=6;break}return e.next=3,Oe("homescreen");case 3:n=e.sent,this.state.quickStartEnabled=!n.disableQuickStart,this.state.quickPlanningEnabled=!n.disableQuickPlanning;case 6:this.state.loggedIn=t;case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"afterCallEnded",value:function(){this.state.currentContact=null,this.state.currentAccount=null}},{key:"setCurrentContact",value:function(e,t){var n=null!=this.state.currentContact;if(null==e&&null==t)this.afterCallEnded();else{try{this.state.currentContact=JSON.parse(e),this.state.currentAccount=JSON.parse(t)}catch(e){console.log(e)}this.state.isFilterActive=null!=this.state.currentContact&&!n}X.$emit("contact-changed")}},{key:"setQuickStart",value:function(e){void 0!==e.quickstartenabled?this.state.quickStartEnabled="1"==e.quickstartenabled:this.state.quickStartEnabled=!0}},{key:"checkLogin",value:function(e){return"0"!=e.loggedin||(j("startDetailing",ut),!1)}},{key:"createEvent",value:function(e){return{Id:e.Id,isAllDay:!!e.IsAllDay,name:[e.AccountName,e.ContactName||""].map((function(e){return e})).join(", "),date:new Date(e.StartDateTime),event:e}}},{key:"parseEventData",value:function(e,t){if(this.state.selectedDate=t,this.state.events=[],this.state.unsubmitted=[],this.setQuickStart(e),this.checkLogin(e)){for(var n=0;n<e.records.length;n++)this.state.events.push(this.createEvent(e.records[n]));for(var r=0;r<e.unsubmitteds.length;r++)this.state.events.push(this.createEvent(e.unsubmitteds[r]))}}}]),e}(),ft=function(){return E(new lt)};function dt(){return(dt=m.default(v.default.mark((function e(t){var n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=ft()).state.hasActiveCall){e.next=5;break}j("stopDetailing",t||ut),e.next=17;break;case 5:e.t0=P,e.next="WINDOWS"===e.t0?8:15;break;case 8:return e.t1=n,e.next=11,j("getCrmEventsForToday",{target:t||ut});case 11:return e.t2=e.sent,e.t3=new Date,e.t1.parseEventData.call(e.t1,e.t2,e.t3),e.abrupt("break",17);case 15:return j("startDetailing",t||ut),e.abrupt("break",17);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(){return(pt=m.default(v.default.mark((function e(t,n){var r;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ft(),e.t0=r,e.next=4,j("getCrmEventsByDate",{target:t||ut,timestamp:n});case 4:e.t1=e.sent,e.t2=new Date(parseInt(n)),e.t0.parseEventData.call(e.t0,e.t1,e.t2);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ht(){return vt.apply(this,arguments)}function vt(){return(vt=m.default(v.default.mark((function e(){return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j("getFavoriteItems",{source:"homescreen"}).then((function(e){var t=nt(),n={};e&&e.length&&e.forEach((function(e){return n[e]=!0})),t.markFavorites(n)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mt(){return yt.apply(this,arguments)}function yt(){return(yt=m.default(v.default.mark((function e(){var t,n,r,a,o,i,s=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:5,n=Ye(),r=nt(),a=ct(),process.env.VUE_APP_TI&&(window.Ti=JSON.parse(process.env.VUE_APP_TI),window.Ti.App.fireEvent=function(){return!0}),e.next=7,pe("Ti",t);case 7:return j("askJSON"),process.env.VUE_APP_SERVERJSON&&(window.serverJSON=JSON.parse(process.env.VUE_APP_SERVERJSON),window.documentPath="/"),e.next=11,pe("serverJSON",t);case 11:return(o=e.sent)&&(o.files=r.extendFiles(o.files),r.state.documentPath=window.documentPath,W(n.state,window.serverJSON),W(r.state,window.serverJSON),W(a.state,window.serverJSON)),process.env.VUE_APP_PRESENTATIONSOBJECT&&(window.presentationsObject=JSON.parse(process.env.VUE_APP_PRESENTATIONSOBJECT)),j("loadPresentationsFromDB",{}),e.next=17,pe("presentationsObject",t);case 17:(i=e.sent)&&r.parsePresentations(i);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wt(){return(wt=m.default(v.default.mark((function e(){var t,n=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:5,e.next=3,mt(t);case 3:return e.next=5,ht();case 5:gt();case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gt(){var e=ct();if(e.state.categories){var t=e.loaded&&bt()||It();t?e.setMainNav(t):j("uiReady")}else j("uiReady")}function bt(){var e=ct(),t="undefined"!=typeof localStorage?localStorage.getItem("".concat(e.state.appID,".mainNavItem")):null;return e.state.categories&&t?e.state.categories.find((function(e){return e.ID==t})):null}function It(){var e=ct();return e.state.categories?e.state.categories.find((function(e){return e.isDefault}))||e.state.categories.find((function(e){return e.parentCategory==$e})):null}window.setCurrentContact=function(e,t){ft().setCurrentContact(e,t)},window.loggedOut=function(){ft().setLoggedIn(!1)},window.updateCRM=function(){ft().setLoggedIn(!0)},window.enableCrm=function(e){ft().setLoggedIn("true"===e)},window.gotJSON=function(e,t){try{window.documentPath=t,window.serverJSON=JSON.parse(e),window.appID=window.serverJSON.appID}catch(e){j("Error",e)}},window.sentPitcherEvent=function(){};var Tt={presentation:function(e){e.isCustomPdf?xt(e):j("loadPresentation",{dataOfPres:e})},pdf:function(e){e.isCustom?xt(e):Ot(e,{launchMode:1,viewMode:e.year})},"3D":function(e){Ct(e,"loadThreeD")},molecule:function(e){Ct(e,"loadMolecule")},brochure:function(e){Ot(e,{launchMode:2,viewMode:e.year})},video:function(e){Dt(e,0)},"video-online":function(e){Dt(e,1)},surveys:function(e,t){var n=e.vUrl,r=St(e.body);j("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("surveys",""),"/index.html"),title:r,showBar:!0,folderName:"surveys",allowPortrait:!0,parameters:t})},zip:function(e,t){var n=e.vUrl,r=St(e.body),a=0,o=1;if(null!=e.extra2){var i=e.extra2.split("|");o=i.length>0&&1==i[0]?0:1,a=i.length>1&&1==i[1]?1:0}j("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("zip",""),"/index.html"),title:r,showBar:o,folderName:"zip",allowPortrait:a,parameters:t})}};function St(e){return"".concat(e).replace(/[\\"']/g,"\\$&").replace(/\\u0000/g,"\\0").replace('"',"")}function xt(e){j("loadCustomPDF",{dataOfPres:e})}function Ot(e,t){t.viewMode=1==t.viewMode?3:1,t.file=e.vUrl,t.pdfID=e.ID,t.titleV=St(e.body),j("loadPDF",t)}function Ct(e,t){var n=e.vUrl,r=n.split("/"),a=St(e.body);r.length?j(t,{model:r[1],folder:r[0],title:a,fileID:e.ID}):j(t,{model:n,title:a,fileID:e.ID})}function Dt(e,t){var n=e.vUrl,r=St(e.body);j(e.keywords&&e.keywords.indexOf("ybVideo")>-1?"loadYB":"loadMovie",{file:n,isOnline:t,title:r,fileID:e.ID})}function Et(e){nt().oneTimeLoadPresentations=!0,j("editPresentation",e?{dataOfPres:e,chapters:[{nameV:"Slides",startIndex:0,endIndex:e.vNumber}]}:{mix:!0,allowMix:!0})}function kt(){j("loadPresentationsFromDB",{})}function Pt(){return Nt.apply(this,arguments)}function Nt(){return(Nt=m.default(v.default.mark((function e(){var t,n,r,a,o,i=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"homescreen",n=ft(),r=Ye().state.appName,a="SELECT rowid,event_name, event_time, lastResponse FROM tbl_reports_v3 WHERE event_name LIKE '%event_redirect%'",e.next=6,U(a,r,!1,t);case 6:return o=e.sent,n.state.syncEvents=o.map((function(e){return{Id:e.rowid,name:e.event_name,time:e.event_time,date:e.event_time?new Date(parseInt(e.event_time)):"",response:e.lastResponse}})),e.abrupt("return",n.state.syncEvents);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return Ft.apply(this,arguments)}function Ft(){return(Ft=m.default(v.default.mark((function e(){var t,n,r,a,o=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"homescreen",n=ft(),r="SELECT Id, Name, Time, Status FROM SQLiteEvent WHERE Name LIKE '%event_redirect%'",e.next=5,U(r,null,!1,t);case 5:return a=e.sent,n.state.syncEvents=a.map((function(e){return{Id:e.Id,name:e.Name,time:e.Time,date:e.Time?new Date(parseInt(e.Time)):"",response:e.Status}})),e.abrupt("return",n.state.syncEvents);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=m.default(v.default.mark((function e(){var t,n=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n.length>0&&void 0!==n[0]?n[0]:"homescreen",e.t0=P,e.next="IOS"===e.t0?4:"WINDOWS"===e.t0?6:"ANDROID"===e.t0?8:9;break;case 4:return Pt(t),e.abrupt("break",10);case 6:return jt(t),e.abrupt("break",10);case 8:case 9:return e.abrupt("break",10);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.finishedCreatingPresentation=function(){kt()},window.getCategoryLogoURL=function(){return""},t.Field=Ne,t.PLATFORM=P,t.Schema=_e,t.addFavorite=function(e){e.isFavorite=!0,j("addFavoriteItem",{fileID:e.ID})},t.assign=function(e,t){for(var n in process.env.LOG&&console.warn("deprecated"),e)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=e[n])},t.assignUsingSourceKeys=W,t.clearCache=function(){F={}},t.clone=function(e){if(null==e||"object"!==b.default(e))return e;var t=e.constructor();for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},t.closeModal=function(){j("closeOpenModal")},t.contextQuery=function(e,t){return De.apply(this,arguments)},t.createSlideSet=function(){nt().oneTimeLoadPresentations=!0,Et()},t.createStore=E,t.dbSettings=A,t.deleteFile=function(e){nt().oneTimeLoadPresentations=!0,j("deletePresentation",{dataOfPres:e})},t.editFile=Et,t.eventHub=X,t.execBool=V,t.execContext=function(e,t,n){try{return new Function("with(this){\n".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}},t.execReturn=R,t.execString=function(e,t,n){try{return new Function("with(this){\nreturn String(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn String(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}},t.exitApp=function(e){j("exitApp",e||{})},t.fireEvent=j,t.generateCustomDeckChapters=ot,t.generateExternalID=function(){return"PIT_".concat(Ee(30))},t.getCrmEventsByDate=function(e,t){return pt.apply(this,arguments)},t.getExtraFieldValue=function(e,t){var n=Ye(),r=t;try{"string"==typeof n.state.config.extraField&&(n.state.config.extraField=JSON.parse(n.state.config.extraField)),void 0!==n.state.config.extraField[e]&&"string"==typeof(r=n.state.config.extraField[e])&&(r.startsWith("{")||r.startsWith("["))&&(r=JSON.parse(r))}catch(e){process.env.LOG&&console.log(e)}return r},t.getFavorites=ht,t.getField=function(e,t){return Je.apply(this,arguments)},t.getFilesWithKeyword=K,t.getFullFilepath=we,t.getInitialCategory=It,t.getLastCategory=bt,t.getLayout=ne,t.getObjectNameField=function(e){return qe.apply(this,arguments)},t.getPath=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&(n=le(n));var a=n.split("."),o=a.shift(),i=t[o];return 0===a.length?"function"==typeof i?i():i:e(i,a.join("."))},t.getPitcherFolderPath=ye,t.getRecordTypeId=function(e,t){return Xe.apply(this,arguments)},t.getSFUrl=function(e){return j("getSFUrl",{path:e})},t.getSchema=te,t.getSyncEvents=function(){return At.apply(this,arguments)},t.initializeInstance=function(){return wt.apply(this,arguments)},t.joinPath=fe,t.labelToValue=function(e,t,n){return Be.apply(this,arguments)},t.launchContentWithID=ee,t.launchFileWithID=function(e){j("launchFileWithID",{fileID:e})},t.launchFileWithKeyword=Y,t.loadConfig=Oe,t.loadLayout=function(e,t){return Ae.apply(this,arguments)},t.loadLocal=function(e){return re.apply(this,arguments)},t.loadParams=function(){return Ie.apply(this,arguments)},t.loadPdfWithPage=function(e,t,n){j("loadPDF",{file:e.vUrl,titleV:St(e.body),viewMode:1,lockViewMode:null,references:null,articles:null,subFolder:null,annotationEnabled:!0,jumpToPage:t,pdfID:e.ID,searchString:n})},t.loadPresentationWithPage=function(e,t){j("launchContentWithID",{fileID:e,subID:t})},t.loadPresentationsFromDB=kt,t.loadSchema=Ve,t.loadServerJSON=mt,t.loadValidations=function(e){return He.apply(this,arguments)},t.loadWebPageFromFolder=G,t.makeId=Ee,t.openContent=function(e,t){Tt[e.category]&&(e.lastLaunchTime=(new Date).getTime().toString(),Tt[e.category](e,t))},t.openLink=function(e,t){return ue.apply(this,arguments)},t.planCall=function(){j("planCall")},t.query=U,t.refreshWatcher=function e(t){de("reloadConsole").then((function(){window.console.log("change detected... refresh"),setTimeout((function(){X.$emit("refresh")}),t),window.localStorage.setItem("reloadConsole","false"),e(t)}))},t.removeAllEvents=function(){var e=ft();e.state.syncEvents.forEach((function(e){j("removeEvent",{Id:e.Id})})),e.state.syncEvents=[]},t.removeEvent=function(e){var t=ft();j("removeEvent",{Id:e}),t.state.syncEvents=t.state.syncEvents.filter((function(t){return t.Id!=e}))},t.removeFavorite=function(e){e.isFavorite=!1,j("removeFavoriteItem",{fileID:e.ID})},t.removeRoot=le,t.renderContext=ie,t.renderSimpleContext=function(e,t){return oe(e)(t,/{([^{}]*)}/g)},t.resyncData=function(){j("resyncData",{})},t.saveLocal=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];j("saveFromHTML",{variables:t,closeWeb:!1,id:e,useSFDCDB:n})},t.saveObject=function(e){for(var t in e.ignoreFields||(e.ignoreFields=[]),e)(e[t]&&e[t].attributes||t.indexOf("111")>-1||t.endsWith("__r"))&&-1===e.ignoreFields.indexOf(t)&&e.ignoreFields.push(t),null===e[t]||void 0===e[t]?(e.fieldsToNull||(e.fieldsToNull=[]),-1===e.fieldsToNull.indexOf(t)&&e.fieldsToNull.push(t)):e.fieldsToNull&&e.fieldsToNull.indexOf(t)>-1&&e.fieldsToNull.splice(e.fieldsToNull.indexOf(t),1),"boolean"==typeof e[t]&&(e[t]=Number(e[t]));for(var n=0,r=["CurrencyIsoCode","attributes","CreatedById","CreatedDate","IsDeleted","LastActivityDate","LastModifiedById","LastModifiedDate","SystemModstamp","fieldsToNull"];n<r.length;n++){var a=r[n];-1===e.ignoreFields.indexOf(a)&&e.ignoreFields.push(a)}if(!e.objectType)throw new Error("no objectType defined");console.log("save object",e),e.Id?j("sendStatsFromHTML",{event_name:"event_redirect_updateSFDC",event_params:e}):j("sendStatsFromHTML",{event_name:"event_redirect_createSFDC",event_params:e})},t.search=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{threshold:.15,distance:1e3,useExtendedSearch:!0},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n&&(r.keys=n);var o=new T.default(e,ve({},r)),i=o.search("".concat(r.useExtendedSearch?"'":"").concat(t));return a?i:i.map((function(e){return e.item&&e.item}))},t.searchPitcherFile=function(e){return j("searchPitcherFile",{extra:e,body:e,keywords:e,rangeCheck:!0})},t.sendDocuments=function(){j("sendDocs")},t.sendPickingContent=function(e,t){j("sendPickingContent",{fileIDs:e,via:t})},t.setCategory=function(e){ct().setMainNav(e)},t.showAlertBox=function(e,t){j("showAlertBox",{title:e,message:t})},t.showIOSSyncWindow=function(e){j("showCachedOrders",e)},t.source=N,t.startCall=function(){j("startCall")},t.startDetailingWithID=function(e){j("startDetailingWithID",{ID:e})},t.startPreCall=function(e){ft().state.hasActiveCall||j("startPreCall",e)},t.startStopDetailing=function(e){return dt.apply(this,arguments)},t.transform=D,t.trimChar=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=S.default(e).findIndex((function(e){return e!==t})),a=n?S.default(e).reverse().findIndex((function(e){return e!==t})):0;return e.substring(r,e.length-a)},t.uid=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t,r=0;r<e;r++)n+=0===r?"".concat(me()).concat(me()):"".concat(me()),r+1!==e&&(n+="-");return n},t.unpackProxy=function e(t){var n={};for(var r in Object.assign(n,t),t)Object.prototype.hasOwnProperty.call(t,r)&&("Proxy"!=typeof t[r]&&"object"!==b.default(t[r])||(n[r]=e(t[r])));return n},t.useCategoriesStore=ct,t.useConfigStore=xe,t.useDetailing=function(){return ft().state},t.useDetailingStore=ft,t.useFilesStore=nt,t.useLayoutStore=Fe,t.useParams=Te,t.useParamsStore=be,t.useSchemaStore=We,t.useSystemStore=Ye,t.useValidations=function(){return ze().state},t.useValidationsStore=ze,t.waitForWindowProp=pe,t.watchLocalStorage=de,Object.defineProperty(t,"__esModule",{value:!0})})); |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@vue/composition-api"),t=require("@babel/runtime/regenerator"),n=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/classCallCheck"),a=require("@babel/runtime/helpers/createClass"),o=require("@babel/runtime/helpers/defineProperty"),s=require("@babel/runtime/helpers/typeof"),i=require("vue"),c=require("fuse.js/dist/fuse.min.js"),u=require("@babel/runtime/helpers/toConsumableArray"),l=require("@babel/runtime/helpers/slicedToArray");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var p=f(t),h=f(n),v=f(r),m=f(a),y=f(o),w=f(s),g=f(i),b=f(c),x=f(u),I=f(l);function T(e,t){for(var n=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),r=0,a=n.length;r<a;++r){var o=n[r];if(!(o in e))return;e=e[o]}return e}var S={};function O(t){var n=Object.getPrototypeOf(t),r=Object.getOwnPropertyDescriptors(n),a={};return Object.keys(t).forEach((function(e){var n=t[e];e.startsWith("on_")||(a[e]=n,"function"==typeof a[e]&&a[e].bind(a))})),Object.keys(r).forEach((function(t){if("constructor"!==t&&!t.startsWith("__")){var n=r[t].get,o=r[t].set,s=r[t].value;if(t.startsWith("on_"))return;s?(a[t]=s,"function"==typeof a[t]&&a[t].bind(a)):n&&o?a[t]=e.computed({get:n.bind(a),set:o.bind(a)}):n&&(a[t]=e.computed(n.bind(a)))}})),a=e.reactive(a),Object.keys(t).forEach((function(n){var r=t[n];n.startsWith("on_")&&(a[n]=e.watch(e.computed((function(){return T(a,n.substring(3).split("_").join("."))})),r))})),Object.keys(r).forEach((function(t){if("constructor"!==t&&!t.startsWith("__")){var n=r[t].value;t.startsWith("on_")&&(a[t]=e.watch(e.computed((function(){return T(a,t.substring(3).split("_").join("."))})),n))}})),a}function C(e){if(!e.id)throw"store needs an id attribute";return S&&S[e.id]?S[e.id]:(S[e.id]=O(e),S[e.id]?S[e.id]:void 0)}var D,E=(D=navigator.userAgent||navigator.vendor||window.opera,-1!==navigator.userAgent.indexOf("emulate-ios")?(console.warn("[VUE-SDK]: PLATFORM is being emulated as IOS"),"IOS"):window.parent!==window.self?"CONNECT":/windows phone/i.test(D)||/windows/i.test(D)?"WINDOWS":/android/i.test(D)?"ANDROID":/iPad|iPhone|iPod|AppleWebKit/.test(D)&&!window.MSStream?"IOS":"unknown");function k(e,t){return new Promise((function(n,r){var a=exports.fireEventCount++,o="fireEventCB".concat(a),s="fireEventErrorCB".concat(a);function i(){delete window[o],delete window[s]}t||(t={}),t.callBackFunc=o,t.callBack=o,t.errorFunc=s,t.emptyFunction=s,t.source=t.source||"modal",window[o]=function(e){if("string"==typeof e&&(e.startsWith("{")||e.startsWith("[")))try{n(JSON.parse(e))}catch(e){r("Invalid JSON")}else n(e);i()},window[s]=function(e){r(e),i()},Object.prototype.hasOwnProperty.call(window,"Ti")?window.Ti.App.fireEvent(e,t):r("Ti not found")}))}exports.fireEventCount=0;var P={},N={cacheEnabled:!1,cacheTimeout:500,defaultDatabase:"pitcher",longQueryWarning:!1};function j(e,t){P[e]={result:t,time:Date.now()}}function F(e){return N.cacheEnabled&&!e.toLowerCase().includes("delete")&&!e.toLowerCase().includes("insert")&&Object.prototype.hasOwnProperty.call(P,e)&&P[e].time+N.cacheTimeout>Date.now()}function A(e){return _.apply(this,arguments)}function _(){return(_=h.default(p.default.mark((function e(t){var n,r,a,o=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:null,r=o.length>2&&void 0!==o[2]&&o[2],a=o.length>3&&void 0!==o[3]?o[3]:"modal",process.env.LOG&&console.log(t),e.abrupt("return",new Promise((function(e,o){if(F(t)&&N.cacheEnabled)return console.log("cache hit"),e(P[t].result);var s=new Date;k("dbFunction",{db:n||N.defaultDatabase,iosMode:!0,pType:"query",query:t,source:a}).then((function(n){var a=new Date-s;a>1e3&&N.longQueryWarning&&console.warn("slow query (".concat((a/1e3).toFixed(2),"s): ").concat(t));var i=[];n.error&&(console.error(t),o(new Error(n.error)));for(var c=0;c<n.results.length;c++){for(var u=n.results[c],l={},f=0;f<n.columns.length;f++){var d=n.columns[f],p=u[f];if("WINDOWS"===E&&"string"==typeof p&&(p=p.replace(/''/g,"'")),"extraField"===d||"account"===d||"eventJSON"===d||"contact"===d||"Json"===d||"user"===d||"userObject"===d){var h=JSON.parse(p);for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&"attributes"!==v&&(r&&null===h[v]||(l[v]=h[v]))}else l[d]=void 0===p?null:p}i.push(l)}N.cacheEnabled&&j(t,i),e(i)})).catch(o)})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(e,t){Object.keys(e).forEach((function(n){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}function U(e,t,n){try{return new Function("with(this){\nreturn Boolean(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn Boolean(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}}function M(e,t,n){try{return new Function("with(this){\nreturn ".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}}var W=new g.default({});function V(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var X=!1,J={};function B(){return q.apply(this,arguments)}function q(){return(q=h.default(p.default.mark((function e(){var t,n,r,a,o,s,i,c;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(X){e.next=6;break}return e.next=3,k("getPitcherFiles",{fullData:!0});case 3:t=e.sent,n=V(t);try{for(n.s();!(r=n.n()).done;){a=r.value,o=void 0;try{o=a.keywords.split(",").map((function(e){return e.trim()}))}catch(e){o=[]}s=V(o);try{for(s.s();!(i=s.n()).done;)c=i.value,J[c]||(J[c]=[]),J[c].push(a)}catch(e){s.e(e)}finally{s.f()}}}catch(e){n.e(e)}finally{n.f()}case 6:X=!0;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(e){return z.apply(this,arguments)}function z(){return(z=h.default(p.default.mark((function e(t){return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return e.abrupt("return",J[t]);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"zip",s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];k("loadWebPageFromFolder",{urlValue:e,title:t,showBar:a,ID:n,folderName:o,allowPortrait:s,parameters:r})}function K(e,t){return $.apply(this,arguments)}function $(){return($=h.default(p.default.mark((function e(t,n){var r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Q(t);case 2:1!==(r=e.sent).length&&alert("".concat(r.length," files found for keyword: ").concat(t)),a=r[0],o="".concat(a.vUrl.replace(".zip","").replace("zip/",""),"/index.html"),"ANDROID"===E?H(o,a.body,a.ID,n):G(a.ID,n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];k("launchContentWithID",{fileID:e,parameters:t,subId:n,currentID:r,forceChange:a})}function Y(e){var t;if("ANDROID"===E||"WINDOWS"===E)t="".concat(e,"_desc");else{if("IOS"!==E)throw"no supported: ".concat(E);t="".concat(e,"_desc_cache")}try{return k("getFromHTML",{id:t,useSFDCDB:!0})}catch(t){throw"Schema not found:".concat(e)}}function Z(e,t){var n;return"IOS"===E||"ANDROID"===E?n="".concat(e,"_").concat(t,"_layout"):"WINDOWS"===E&&(n="".concat(e,"<").concat(t,">_desc")),console.log(n),k("getFromHTML",{id:n,useSFDCDB:!0})}function ee(){return(ee=h.default(p.default.mark((function e(t){var n,r,a=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(a.length>1&&void 0!==a[1])||a[1],e.next=3,k("getFromHTML",{id:t,useSFDCDB:n});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e,t,n){return ne(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{%\s*if([^{}]*)\s*%}(.*){%\s*endif\s*%}/g;return e.replace(n,(function(e,n,r){return U(n,t)?r:""}))}}(e)(t))(t,n)}function ne(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{{([^{}]*)}}/g;return e.replace(n,(function(e,n){return M(n,t)}))}}function re(e,t){return te(e,t)}function ae(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function se(){return(se=h.default(p.default.mark((function e(t,n){var r,a,o,s,i,c,u,l;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=re(t,n),window.console.info("open link",t),t=t.split("pitcher://").join(""),r=2===t.split("/").length?t.split("/")[0]:2===t.split("?").length?t.split("?")[0]:t,a=t.split("?")[1],o={},a.length){a=decodeURI(a).split("&"),s=ae(a);try{for(s.s();!(i=s.n()).done;)c=i.value,u=c.split("="),o[u[0]]=u[1]}catch(e){s.e(e)}finally{s.f()}}for(l in o)window.localStorage[l]=o[l];if(!isNaN(Number(r))){e.next=13;break}return e.next=11,K(r,o);case 11:e.next=15;break;case 13:return e.next=15,G(r,o);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(e){var t=e.split(".");return 1===t.length?e:(t.shift(),e=t.join("."))}function ce(){for(var e=[].slice.call(arguments),t=e[0],n=1;n<e.length;n++)if(e[n]){var r=e[n].replace(/^(\/|\\)/,"");t="".concat(t.replace(/(\/|\\)$/,""),"/").concat(r)}return t}function ue(e){return new Promise((function(t){var n=window.localStorage,r=n.getItem(e);!function a(){setTimeout((function(){n.getItem(e)==r?a():t(n.getItem(e))}),1e3)}()}))}function le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=10*t;if(!e||""===e)throw new Error("No property is sent to watch on window");return new Promise((function(t){if(void 0!==window[e])return t(window[e]);var r=0,a=setInterval((function(){if(r++,void 0!==window[e]||r===n)return clearInterval(a),t(window[e])}),100)}))}try{window.localStorage.setItem("reloadConsole","false")}catch(e){console.log(e)}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){y.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pe(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function he(){var e,t;if(null!==(e=window)&&void 0!==e&&null!==(t=e.Ti)&&void 0!==t&&t.TiWeb)return"/";var n=window.location.href;if(!n.includes("zip/")&&!n.startsWith("http"))throw Error('"zip" folder not found in path');var r,a,o=n.lastIndexOf("zip//");if(-1!==o){var s=(a=o,[(r=n).substring(0,a),r.substring(a)]);n=s[0]+s[1].replace("zip//","zip/")}return(n=n.split("zip/")[0]).endsWith("/")?n:"".concat(n,"/")}function ve(e){return he()+e}window.getParameters=function(e){window.params=JSON.parse(e)};var me=function(){function t(){v.default(this,t),y.default(this,"id","params"),y.default(this,"state",e.reactive({account:e.ref(null),contacts:null,contact:null,salesForceUser:null,user:null}))}return m.default(t,[{key:"locale",get:function(){var e=this.state.salesForceUser?this.state.salesForceUser:this.state.user,t=null;return e&&(t=e.LocaleSidKey?e.LocaleSidKey:e.LanguageLocaleKey),t?t.split("_").slice(0,2).join("-"):null}},{key:"language",get:function(){if(this.state.salesForceUser)return this.state.salesForceUser.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.user)return this.state.user.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.config){var e={AUSDE:"de",BI:"id",BR:"pt",BU:"bg",CAFR:"fr",CZ:"cs",DAN:"da",ESMX:"es",EST:"et",JP:"ja",LET:"lv",PO:"pl",PRT:"pt",SCH:"zh-CN",TCH:"zh-TW",UA:"uk",VN:"vi"};return e[this.state.config.langV]?e[this.state.config.langV]:this.state.config.langV.toLowerCase()}return null}},{key:"context",get:function(){return{Account:this.state.account,Contact:this.state.contact,Contacts:this.state.contacts,User:this.state.salesForceUser?this.state.salesForceUser:this.state.user}}}]),t}();function ye(){return C(new me)}function we(){return(we=h.default(p.default.mark((function e(){var t,n;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ye(),console.log(t.state.account),!process.env.VUE_APP_PARAMS){e.next=6;break}return n=JSON.parse(process.env.VUE_APP_PARAMS),Object.assign(t.state,n),e.abrupt("return",t.state);case 6:return e.next=8,le("params");case 8:return e.sent&&Object.assign(t.state,window.params),e.abrupt("return",t.state);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(){return ye().state}var be=function(){function e(){v.default(this,e),y.default(this,"id","config"),y.default(this,"state",{customCaches:null})}return m.default(e,[{key:"getTableDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n.tableToCache,e[n.objectName]=n.tableToCache}return e}},{key:"getCacheDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n,e[n.objectName]=n}return e}}]),e}();function xe(){return C(new be)}function Ie(){return Te.apply(this,arguments)}function Te(){return(Te=h.default(p.default.mark((function e(){var t,n,r,a,o,s,i=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"modal",n=xe(),e.next=4,k("getAppConfig",{source:t});case 4:if(void 0!==(r=e.sent).userAttrSpecificSettings&&(a=ge(),o=a.user,r.userAttrSpecificSettings.forEach((function(e){var t=o[e.attrP];if(t&&t.includes(e.valueP))if("replace"===e.typeP)for(var n in e.settings)r[n]=e.settings[n];else if("add"===e.typeP)for(var a in e.settings)r[a]||(r[a]=[]),Array.isArray(e.settings[a])?r[a]=r[a].concat(e.settings[a]):r[a].push(e.settings[a])}))),console.log("[@pitcher/core]: app config",r),r.customCaches=Array.isArray(r.customCaches)?r.customCaches:[],"IOS"!==E){e.next=15;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts_m_v3",query:r.sfdcAccountQuery,fieldTypes:{account:"TEXT",id:"TEXT",lat:"TEXT",lon:"TEXT",city:"TEXT",lastVisit:"TEXT",accountName:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts_m_v4",query:r.sfdcContactQuery,fieldTypes:{contact:"TEXT",id:"TEXT",accountID:"TEXT",lastVisit:"TEXT",name:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users_m_v3",query:"",fieldTypes:{userObject:"TEXT",id:"TEXT",lastName:"TEXT",firstName:"TEXT",name:"TEXT",roleID:"TEXT",parentRoleID:"TEXT",extraField:"TEXT"}}),e.next=31;break;case 15:if("ANDROID"!==E){e.next=22;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts",query:r.sfdcAccountQuery}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts",query:r.sfdcContactQuery}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users",query:""}),e.next=31;break;case 22:if("WINDOWS"!==E){e.next=30;break}(r=r[0]).customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"SQLiteSfAccount",query:r.sfdcAccountQuery,fieldTypes:{BillingCity:"TEXT",BillingCountry:"TEXT",BillingStreet:"TEXT",Id:"TEXT",ExternalId:"TEXT",Json:"TEXT",JsonUntouched:"TEXT",LastModifiedDate:"TEXT",LastModifiedTimeStamp:"INTEGER",LastVisitTimeStamp:"INTEGER",Lat__c:"REAL",Long__c:"REAL",Name:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"SQLiteSfContact",query:r.sfdcContactQuery,fieldTypes:{Id:"TEXT",ExternalId:"TEXT",LastModifiedDate:"TEXT",Name:"TEXT",AccountId:"TEXT",Email:"TEXT",Json:"TEXT",JsonUntouched:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"SQLiteSfEvent",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"SQLiteSfUser",query:"",fieldTypes:{Id:"TEXT",IsActive:"INTEGER",LastModifiedDate:"TEXT",FirstName:"TEXT",LastName:"TEXT",Json:"TEXT"}}),e.next=31;break;case 30:throw new Error("Platform not supported: ".concat(E));case 31:for(s in r)n.state[s]=r[s];return e.abrupt("return",n.state);case 33:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=h.default(p.default.mark((function e(t,n){var r,a,o,s,i,c,u,l,f=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f.length>2&&void 0!==f[2]?f[2]:null,a=f.length>3&&void 0!==f[3]&&f[3],t){e.next=4;break}throw Error("no query provided");case 4:for(c in o=xe(),s=ye().state,t=t.split("TODAY").join("date('now')"),i=o.getTableDict,n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c]);return s.account&&(i.account=s.account,i.contacts=s.contacts),s.salesForceUser&&(i.user=s.salesForceUser),s.user&&(i.user=s.user),s.locale&&(i.locale=s.locale),u=re(t,i),e.prev=14,e.next=17,A(u,r,a);case 17:return l=e.sent,e.abrupt("return",l);case 21:throw e.prev=21,e.t0=e.catch(14),console.error(u,i),e.t0;case 25:case"end":return e.stop()}}),e,null,[[14,21]])})))).apply(this,arguments)}function Oe(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function Ce(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return De(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return De(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ee=function(){function t(n,r){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];v.default(this,t),y.default(this,"references",e.ref([])),y.default(this,"referencesTo",[]),Object.assign(this,n),this.parentObjectType=r,this.required=!n.nillable||n.nameField,this.errors=[],a&&this.load_refs()}var n;return m.default(t,[{key:"valid",value:function(e){return"boolean"===this.type&&!0===e||!1===e||!(!e&&this.required)}},{key:"load_refs",value:function(){var e=xe();if(this.referenceTo&&this.referenceTo.length){var t,n=e.getCacheDict[this.parentObjectType],r=Ce(this.referenceTo);try{for(r.s();!(t=r.n()).done;){var a=t.value,o=e.getCacheDict[a];if(!o)return void window.console.warn("referenced object not found: ".concat(a));this.load(o,n,a)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"load",value:(n=h.default(p.default.mark((function e(t,n,r){var a,o,s,i,c,u,l,f,d;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null,n&&n.filters&&(a=n.filters[this.name]),o=t.tableToCache,s="select Id, ",i="Name",t.fieldTypes&&t.fieldTypes.Name?s+="Name":"Account"===r?"ANDROID"===E?(s+="account_name",i="account_name"):(s+="accountName",i="accountName"):"Contact"===r||"User"===r?(s+="name",i="name"):t.fieldTypes.extraField?s+="extraField":alert("no name field found in table for ".concat(r)),s+=" from ".concat(o),e.next=9,A(s);case 9:c=e.sent,u=[],l=Ce(c),e.prev=12,l.s();case 14:if((f=l.n()).done){e.next=23;break}if(d=f.value,!a){e.next=20;break}if(U(a,d)){e.next=20;break}return e.abrupt("continue",21);case 20:u.push({value:d.Id,text:d[i]});case 21:e.next=14;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(12),l.e(e.t0);case 28:return e.prev=28,l.f(),e.finish(28);case 31:this.references.value=this.references.value.concat(u);case 32:case"end":return e.stop()}}),e,this,[[12,25,28,31]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"loadExternalReferences",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Name",r=[],a=Ce(e);try{for(a.s();!(t=a.n()).done;){var o=t.value;r.push({value:o.Id,text:o[n]})}}catch(e){a.e(e)}finally{a.f()}this.references.value=r}}]),t}(),ke=function e(){v.default(this,e),y.default(this,"id","layout"),y.default(this,"state",{})},Pe=function(){return C(new ke)};function Ne(){return(Ne=h.default(p.default.mark((function e(t,n){var r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="".concat(t,"_").concat(n),!(a=Pe()).state[r]){e.next=6;break}return e.abrupt("return",a.state[r]);case 6:return e.next=8,Z(t,n);case 8:return o=e.sent,a.state[r]=new je(o,t),e.abrupt("return",a.state[r]);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var je=function e(t,n){for(var r in v.default(this,e),t)this[r]=t[r];this.objectType=n};function Fe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ae(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _e=function e(){v.default(this,e),y.default(this,"id","schema"),y.default(this,"state",{})},Le=function(){return C(new _e)};function Ue(e){return Me.apply(this,arguments)}function Me(){return(Me=h.default(p.default.mark((function e(t){var n,r;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=Le()).state[t]){e.next=5;break}return e.abrupt("return",n.state[t]);case 5:return e.next=7,Y(t);case 7:return r=e.sent,n.state[t]=r,e.abrupt("return",n.state[t]);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=h.default(p.default.mark((function e(t,n){var r,a,o,s;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:r=e.sent,a=Fe(r.recordTypeInfos),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}if((s=o.value).name!==n){e.next=10;break}return e.abrupt("return",s.recordTypeId);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function Ve(){return(Ve=h.default(p.default.mark((function e(t,n){var r,a,o,s,i;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:r=e.sent,a=Fe(r.fields),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=13;break}if((s=o.value).name!==n.trim()){e.next=11;break}return i=new Ee(s,t),e.abrupt("return",i);case 11:e.next=6;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),a.e(e.t0);case 18:return e.prev=18,a.f(),e.finish(18);case 21:throw new Error("field not found:".concat(n));case 22:case"end":return e.stop()}}),e,null,[[4,15,18,21]])})))).apply(this,arguments)}function Re(){return(Re=h.default(p.default.mark((function e(t,n,r){var a,o,s,i,c,u,l;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:a=e.sent,o=Fe(a.fields),e.prev=4,o.s();case 6:if((s=o.n()).done){e.next=28;break}if((i=s.value).name!==n.trim()||!i.picklistValues){e.next=26;break}c=Fe(i.picklistValues),e.prev=10,c.s();case 12:if((u=c.n()).done){e.next=18;break}if((l=u.value).label!==r){e.next=16;break}return e.abrupt("return",l.value);case 16:e.next=12;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(10),c.e(e.t0);case 23:return e.prev=23,c.f(),e.finish(23);case 26:e.next=6;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(4),o.e(e.t1);case 33:return e.prev=33,o.f(),e.finish(33);case 36:case"end":return e.stop()}}),e,null,[[4,30,33,36],[10,20,23,26]])})))).apply(this,arguments)}function Xe(){return(Xe=h.default(p.default.mark((function e(t){var n,r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:n=e.sent,r=Fe(n.fields),e.prev=4,r.s();case 6:if((a=r.n()).done){e.next=12;break}if(!(o=a.value).nameField){e.next=10;break}return e.abrupt("return",o.name);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),r.e(e.t0);case 17:return e.prev=17,r.f(),e.finish(17);case 20:throw new Error("No name field found");case 21:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}var Je=function e(){v.default(this,e),y.default(this,"id","validation"),y.default(this,"loaded",!1),y.default(this,"state",{listviews:[],lookups:[],rules:[]})};function Be(){return C(new Je)}function qe(){return(qe=h.default(p.default.mark((function e(t){var n,r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=Be()).loaded){e.next=13;break}return e.next=4,Q(t);case 4:return r=e.sent,e.next=7,fetch(ve(r[0].vUrl));case 7:return a=e.sent,e.next=10,a.json();case 10:o=e.sent,n.state=Object.assign(n.state,o),n.loaded=!0;case 13:return e.abrupt("return",n.state);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qe=2,ze="0",He=function t(){v.default(this,t),y.default(this,"id","systemStore"),y.default(this,"state",e.reactive({config:null,groups:null,appID:null,supportEmail:null,deviceName:null,metadata:null,messages:null,appName:null,systemLang:null,locale:null,userfullname:null,ajaxtoken:null,isCustomerUI:!1,batteryLevel:0,statusBadge:0,todoBadge:0}))},Ke=function(){return C(new He)};function $e(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ge(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function Ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}window.updateStatusBadge=function(e){var t=Ke();e=parseInt(e),t.state.statusBadge=e||0},window.updateTodoBadge=function(e){var t=Ke();e=parseInt(e),t.state.todoBadge=e||0},window.fetch||Promise.resolve().then((function(){return d(require("whatwg-fetch"))}));var Ye=function(){function t(){var n=this;v.default(this,t),y.default(this,"id","filesStore"),y.default(this,"oneTimeLoadPresentations",!1),y.default(this,"state",e.reactive({files:[],uiFiles:e.computed((function(){return n.state.files.filter((function(e){return e.shouldShowInUI}))})),slides:[],documentPath:null,presentations:[],customs:[],initialAllowedIDs:null,allowedIDs:[]}))}return m.default(t,[{key:"isFileExpiredOrNotReady",value:function(e,t,n){return void 0!==t&&void 0!==n&&(null!=t&&null!=n&&(0!=t&&0!=n&&(t>e||n<e)))}},{key:"shouldShowInUI",value:function(e,t){return"T"!=t.ID[0]&&7!=t.typeV&&-1!=t.typeV&&0!=t.typeV&&"images"!=t.category&&!this.isFileExpiredOrNotReady(e,t.startDate,t.endDate)}},{key:"extendFiles",value:function(e){var t=this,n=(new Date).getTime()/1e3;return e.forEach((function(e){e.shouldShowInUI=t.shouldShowInUI(n,e),e.thumbnailUrl=ce(window.documentPath,e.thumb)})),e}},{key:"parsePresentations",value:function(e){var t=this;this.state.customs=[],this.state.presentations=[],e.forEach((function(e){return t.parseSinglePresentation(e)})),this.oneTimeLoadPresentations&&(k("loadPresentationsFromDB",{}),this.oneTimeLoadPresentations=!1)}},{key:"parseCustomPdf",value:function(e){return e.ID=e.slideOrder.split(",")[0].split("|")[0],e.isCustomPdf=!0,e}},{key:"parseSinglePresentation",value:function(e){try{return e.isCustom!=Qe&&(void 0!==e.ID&&null!=e.ID||(e=this.parseCustomPdf(e)),null==e.vSubFolder&&(e.containsMultiple=!0,e.vSubFolder=e.slideOrder.split(",")[0].split("|")[0],e.ID=e.slideOrder.split(",")[0].split("|")[0],-1==e.vSubFolder.indexOf("_")?e.isCustomPdf=!0:e.ID="".concat(parseInt(e.ID))),e.ID="".concat(e.ID),e.isCustom?this.addFileAsCustom(e):this.mergePresentation(e)),!0}catch(e){k("Error",e)}return!1}},{key:"createAppendCustomFile",value:function(e,t){var n={};Object.assign(n,e),Object.assign(n,t),n.body=t.presentationName,this.state.customs.push(n)}},{key:"addFileAsCustom",value:function(e){var t=this.state.files.find((function(t){return t.ID==e.ID}));if(t)this.createAppendCustomFile(t,e);else{var n=this.state.slides.find((function(t){return t.vSubfolder==e.vSubFolder}));n&&(t=this.state.files.find((function(e){return e.ID==n.ID})))&&(e.ID=t.ID,this.createAppendCustomFile(t,e))}}},{key:"mergePresentation",value:function(e){this.state.presentations.push(e);var t=this.state.files.find((function(t){return t.ID==e.ID}));t&&Object.assign(t,e)}},{key:"markFavorites",value:function(e){return this.state.files.forEach((function(t){void 0===t.isFavorite?g.default.set(t,"isFavorite",e[t.ID]||!1):t.isFavorite=e[t.ID]||!1})),this.state.files}},{key:"setAllowedIds",value:function(e){e&&e.length>0&&null==this.state.initialAllowedIDs&&(this.state.initialAllowedIDs=e),this.state.allowedIDs=e||[]}}]),t}(),Ze=function(){return C(new Ye)};function et(e){return e.slideOrder?e.slideOrder.split(",").map((function(e){var t=e.split("|"),n=I.default(t,2),r=n[0],a=n[1];return{deckId:r,index:parseInt(a)-1}})):[]}function tt(e,t){if(!e)return null;for(var n=0;n<e.length;n++){var r=e[n];if(t>=r.startIndex&&t<r.endIndex)return r}return null}function nt(e){return rt.apply(this,arguments)}function rt(){return(rt=h.default(p.default.mark((function e(t){var n,r,a;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="-",r=p.default.mark((function e(r){var a,o,s,i,c,u,l,f,d;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=t[r]).isCustom){e.next=3;break}return e.abrupt("return","continue");case 3:if(0!==(o=et(a)).length){e.next=6;break}return e.abrupt("return","continue");case 6:s=o.reduce((function(e,t){return e.add(t.deckId),e}),new Set),i=new Map,c=$e(s),e.prev=9,c.s();case 11:if((u=c.n()).done){e.next=28;break}return l=u.value,e.prev=13,e.next=16,fetch("".concat(window.documentPath,"/slides/").concat(l,"/chapters.json"));case 16:return f=e.sent,e.next=19,f.json();case 19:d=e.sent,i.set(l,d.chapters),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(13),console.warn("[Chapter Generation]: ".concat(window.documentPath,"/slides/").concat(l,"/chapters.json does not exist!"));case 26:e.next=11;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(9),c.e(e.t1);case 33:return e.prev=33,c.f(),e.finish(33);case 36:if(o.forEach((function(e){var t=tt(i.get(e.deckId),e.index);e.chapterName=(null==t?void 0:t.nameV)||n})),!o[0]){e.next=41;break}return e.next=40,fetch("".concat(window.documentPath,"/slides/").concat(o[0].deckId,"/setup.json")).then((function(e){return e.json()})).catch((function(){return null}));case 40:a.setupJSON=e.sent;case 41:a.chapters={chapters:o.reduce((function(e,t,r){var a=e[e.length-1],o=t.deckId===(null==a?void 0:a.deckId),s=t.chapterName===(null==a?void 0:a.nameV),i=t.chapterName===n&&(null==a?void 0:a.nameV)===n;return a&&s&&(o||!o&&i)?a.endIndex=r+1:e.push({nameV:t.chapterName,deckId:t.deckId,startIndex:r,endIndex:r+1}),e}),[]).filter((function(e){return null!==e})).map((function(e){return{nameV:e.nameV,startIndex:e.startIndex,endIndex:e.endIndex}}))},1===a.chapters.chapters.length&&a.chapters.chapters[0].nameV===n&&(a.chapters.chapters=[]),k("saveFromHTML",{id:a.ID,variables:a});case 44:case"end":return e.stop()}}),e,null,[[9,30,33,36],[13,23]])})),e.t0=p.default.keys(t);case 3:if((e.t1=e.t0()).done){e.next=11;break}return a=e.t1.value,e.delegateYield(r(a),"t2",6);case 6:if("continue"!==e.t2){e.next=9;break}return e.abrupt("continue",3);case 9:e.next=3;break;case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.getAllowedIDs=function(){return Ze().state.allowedIDs},window.loadPresentations=function(e){var t=e;"string"==typeof e&&(t=JSON.parse(t)),nt(t).then((function(){(window.presentationsObject=t,window.presentationsObject)&&Ze().parsePresentations(window.presentationsObject)}))},window.filterJSON=function(e){var t=Ze();e?t.setAllowedIds(JSON.parse(e)):t.setAllowedIds([])};var at=function(){function t(){var n=this;v.default(this,t),y.default(this,"id","categoriesStore"),y.default(this,"loaded",!1),y.default(this,"state",e.reactive({category:{},categories:[],parentCategories:e.computed((function(){return n.state.categories.filter((function(e){return e.parentCategory==ze}))})),subCategories:e.computed((function(){return n.state.categories.filter((function(e){return e.parentCategory!=ze}))}))}))}return m.default(t,[{key:"setMainNav",value:function(e){e&&(window.lastViewedCategory=e,"undefined"!=typeof localStorage&&localStorage.setItem("".concat(this.state.appID,".mainNavItem"),e.ID),k("setCategory",{category:JSON.stringify(e)}),this.state.category=e,this.loaded||(this.loaded=!0,k("uiReady")))}}]),t}(),ot=function(){return C(new at)};window.setMainNav=function(e){window.lastViewedCategory=e};var st={xPos:50,yPos:30,widthV:160,heightV:50},it=function(){function t(){var n=this;v.default(this,t),y.default(this,"id","detailing"),y.default(this,"state",e.reactive({currentContact:null,currentAccount:null,hasActiveCall:e.computed((function(){return null!=n.state.currentContact})),todaysCalls:[],isFilterActive:!1,quickStartEnabled:!0,quickPlanningEnabled:!0,selectedDate:null,events:[],unsubmitted:[],syncEvents:[],loggedIn:!1}))}var n;return m.default(t,[{key:"setLoggedIn",value:(n=h.default(p.default.mark((function e(t){var n;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||this.state.loggedIn){e.next=6;break}return e.next=3,Ie("homescreen");case 3:n=e.sent,this.state.quickStartEnabled=!n.disableQuickStart,this.state.quickPlanningEnabled=!n.disableQuickPlanning;case 6:this.state.loggedIn=t;case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"afterCallEnded",value:function(){this.state.currentContact=null,this.state.currentAccount=null}},{key:"setCurrentContact",value:function(e,t){var n=null!=this.state.currentContact;if(null==e&&null==t)this.afterCallEnded();else{try{this.state.currentContact=JSON.parse(e),this.state.currentAccount=JSON.parse(t)}catch(e){console.log(e)}this.state.isFilterActive=null!=this.state.currentContact&&!n}W.$emit("contact-changed")}},{key:"setQuickStart",value:function(e){void 0!==e.quickstartenabled?this.state.quickStartEnabled="1"==e.quickstartenabled:this.state.quickStartEnabled=!0}},{key:"checkLogin",value:function(e){return"0"!=e.loggedin||(k("startDetailing",st),!1)}},{key:"createEvent",value:function(e){return{Id:e.Id,isAllDay:!!e.IsAllDay,name:[e.AccountName,e.ContactName||""].map((function(e){return e})).join(", "),date:new Date(e.StartDateTime),event:e}}},{key:"parseEventData",value:function(e,t){if(this.state.selectedDate=t,this.state.events=[],this.state.unsubmitted=[],this.setQuickStart(e),this.checkLogin(e)){for(var n=0;n<e.records.length;n++)this.state.events.push(this.createEvent(e.records[n]));for(var r=0;r<e.unsubmitteds.length;r++)this.state.events.push(this.createEvent(e.unsubmitteds[r]))}}}]),t}(),ct=function(){return C(new it)};function ut(){return(ut=h.default(p.default.mark((function e(t){var n;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=ct()).state.hasActiveCall){e.next=5;break}k("stopDetailing",t||st),e.next=17;break;case 5:e.t0=E,e.next="WINDOWS"===e.t0?8:15;break;case 8:return e.t1=n,e.next=11,k("getCrmEventsForToday",{target:t||st});case 11:return e.t2=e.sent,e.t3=new Date,e.t1.parseEventData.call(e.t1,e.t2,e.t3),e.abrupt("break",17);case 15:return k("startDetailing",t||st),e.abrupt("break",17);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lt(){return(lt=h.default(p.default.mark((function e(t,n){var r;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ct(),e.t0=r,e.next=4,k("getCrmEventsByDate",{target:t||st,timestamp:n});case 4:e.t1=e.sent,e.t2=new Date(parseInt(n)),e.t0.parseEventData.call(e.t0,e.t1,e.t2);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ft(){return dt.apply(this,arguments)}function dt(){return(dt=h.default(p.default.mark((function e(){return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k("getFavoriteItems",{source:"homescreen"}).then((function(e){var t=Ze(),n={};e&&e.length&&e.forEach((function(e){return n[e]=!0})),t.markFavorites(n)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(){return ht.apply(this,arguments)}function ht(){return(ht=h.default(p.default.mark((function e(){var t,n,r,a,o,s,i=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:5,n=Ke(),r=Ze(),a=ot(),process.env.VUE_APP_TI&&(window.Ti=JSON.parse(process.env.VUE_APP_TI),window.Ti.App.fireEvent=function(){return!0}),e.next=7,le("Ti",t);case 7:return k("askJSON"),process.env.VUE_APP_SERVERJSON&&(window.serverJSON=JSON.parse(process.env.VUE_APP_SERVERJSON),window.documentPath="/"),e.next=11,le("serverJSON",t);case 11:return(o=e.sent)&&(o.files=r.extendFiles(o.files),r.state.documentPath=window.documentPath,L(n.state,window.serverJSON),L(r.state,window.serverJSON),L(a.state,window.serverJSON)),process.env.VUE_APP_PRESENTATIONSOBJECT&&(window.presentationsObject=JSON.parse(process.env.VUE_APP_PRESENTATIONSOBJECT)),k("loadPresentationsFromDB",{}),e.next=17,le("presentationsObject",t);case 17:(s=e.sent)&&r.parsePresentations(s);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vt(){return(vt=h.default(p.default.mark((function e(){var t,n=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:5,e.next=3,pt(t);case 3:return e.next=5,ft();case 5:mt();case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mt(){var e=ot();if(e.state.categories){var t=e.loaded&&yt()||wt();t?e.setMainNav(t):k("uiReady")}else k("uiReady")}function yt(){var e=ot(),t="undefined"!=typeof localStorage?localStorage.getItem("".concat(e.state.appID,".mainNavItem")):null;return e.state.categories&&t?e.state.categories.find((function(e){return e.ID==t})):null}function wt(){var e=ot();return e.state.categories?e.state.categories.find((function(e){return e.isDefault}))||e.state.categories.find((function(e){return e.parentCategory==ze})):null}window.setCurrentContact=function(e,t){ct().setCurrentContact(e,t)},window.loggedOut=function(){ct().setLoggedIn(!1)},window.updateCRM=function(){ct().setLoggedIn(!0)},window.enableCrm=function(e){ct().setLoggedIn("true"===e)},window.gotJSON=function(e,t){try{window.documentPath=t,window.serverJSON=JSON.parse(e),window.appID=window.serverJSON.appID}catch(e){k("Error",e)}},window.sentPitcherEvent=function(){};var gt={presentation:function(e){e.isCustomPdf?xt(e):k("loadPresentation",{dataOfPres:e})},pdf:function(e){e.isCustom?xt(e):It(e,{launchMode:1,viewMode:e.year})},"3D":function(e){Tt(e,"loadThreeD")},molecule:function(e){Tt(e,"loadMolecule")},brochure:function(e){It(e,{launchMode:2,viewMode:e.year})},video:function(e){St(e,0)},"video-online":function(e){St(e,1)},surveys:function(e,t){var n=e.vUrl,r=bt(e.body);k("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("surveys",""),"/index.html"),title:r,showBar:!0,folderName:"surveys",allowPortrait:!0,parameters:t})},zip:function(e,t){var n=e.vUrl,r=bt(e.body),a=0,o=1;if(null!=e.extra2){var s=e.extra2.split("|");o=s.length>0&&1==s[0]?0:1,a=s.length>1&&1==s[1]?1:0}k("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("zip",""),"/index.html"),title:r,showBar:o,folderName:"zip",allowPortrait:a,parameters:t})}};function bt(e){return"".concat(e).replace(/[\\"']/g,"\\$&").replace(/\\u0000/g,"\\0").replace('"',"")}function xt(e){k("loadCustomPDF",{dataOfPres:e})}function It(e,t){t.viewMode=1==t.viewMode?3:1,t.file=e.vUrl,t.pdfID=e.ID,t.titleV=bt(e.body),k("loadPDF",t)}function Tt(e,t){var n=e.vUrl,r=n.split("/"),a=bt(e.body);r.length?k(t,{model:r[1],folder:r[0],title:a,fileID:e.ID}):k(t,{model:n,title:a,fileID:e.ID})}function St(e,t){var n=e.vUrl,r=bt(e.body);k(e.keywords&&e.keywords.indexOf("ybVideo")>-1?"loadYB":"loadMovie",{file:n,isOnline:t,title:r,fileID:e.ID})}function Ot(e){Ze().oneTimeLoadPresentations=!0,k("editPresentation",e?{dataOfPres:e,chapters:[{nameV:"Slides",startIndex:0,endIndex:e.vNumber}]}:{mix:!0,allowMix:!0})}function Ct(){k("loadPresentationsFromDB",{})}function Dt(){return Et.apply(this,arguments)}function Et(){return(Et=h.default(p.default.mark((function e(){var t,n,r,a,o,s=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:"homescreen",n=ct(),r=Ke().state.appName,a="SELECT rowid,event_name, event_time, lastResponse FROM tbl_reports_v3 WHERE event_name LIKE '%event_redirect%'",e.next=6,A(a,r,!1,t);case 6:return o=e.sent,n.state.syncEvents=o.map((function(e){return{Id:e.rowid,name:e.event_name,time:e.event_time,date:e.event_time?new Date(parseInt(e.event_time)):"",response:e.lastResponse}})),e.abrupt("return",n.state.syncEvents);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kt(){return Pt.apply(this,arguments)}function Pt(){return(Pt=h.default(p.default.mark((function e(){var t,n,r,a,o=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"homescreen",n=ct(),r="SELECT Id, Name, Time, Status FROM SQLiteEvent WHERE Name LIKE '%event_redirect%'",e.next=5,A(r,null,!1,t);case 5:return a=e.sent,n.state.syncEvents=a.map((function(e){return{Id:e.Id,name:e.Name,time:e.Time,date:e.Time?new Date(parseInt(e.Time)):"",response:e.Status}})),e.abrupt("return",n.state.syncEvents);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(){return(Nt=h.default(p.default.mark((function e(){var t,n=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n.length>0&&void 0!==n[0]?n[0]:"homescreen",e.t0=E,e.next="IOS"===e.t0?4:"WINDOWS"===e.t0?6:"ANDROID"===e.t0?8:9;break;case 4:return Dt(t),e.abrupt("break",10);case 6:return kt(t),e.abrupt("break",10);case 8:case 9:return e.abrupt("break",10);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.finishedCreatingPresentation=function(){Ct()},window.getCategoryLogoURL=function(){return""},exports.Field=Ee,exports.PLATFORM=E,exports.Schema=je,exports.addFavorite=function(e){e.isFavorite=!0,k("addFavoriteItem",{fileID:e.ID})},exports.assign=function(e,t){for(var n in process.env.LOG&&console.warn("deprecated"),e)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=e[n])},exports.assignUsingSourceKeys=L,exports.clearCache=function(){P={}},exports.clone=function(e){if(null==e||"object"!==w.default(e))return e;var t=e.constructor();for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},exports.closeModal=function(){k("closeOpenModal")},exports.contextQuery=function(e,t){return Se.apply(this,arguments)},exports.createSlideSet=function(){Ze().oneTimeLoadPresentations=!0,Ot()},exports.createStore=C,exports.dbSettings=N,exports.deleteFile=function(e){Ze().oneTimeLoadPresentations=!0,k("deletePresentation",{dataOfPres:e})},exports.editFile=Ot,exports.eventHub=W,exports.execBool=U,exports.execContext=function(e,t,n){try{return new Function("with(this){\n".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}},exports.execReturn=M,exports.execString=function(e,t,n){try{return new Function("with(this){\nreturn String(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn String(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}},exports.exitApp=function(e){k("exitApp",e||{})},exports.fireEvent=k,exports.generateCustomDeckChapters=nt,exports.generateExternalID=function(){return"PIT_".concat(Oe(30))},exports.getCrmEventsByDate=function(e,t){return lt.apply(this,arguments)},exports.getExtraFieldValue=function(e,t){var n=Ke(),r=t;try{"string"==typeof n.state.config.extraField&&(n.state.config.extraField=JSON.parse(n.state.config.extraField)),void 0!==n.state.config.extraField[e]&&"string"==typeof(r=n.state.config.extraField[e])&&(r.startsWith("{")||r.startsWith("["))&&(r=JSON.parse(r))}catch(e){process.env.LOG&&console.log(e)}return r},exports.getFavorites=ft,exports.getField=function(e,t){return Ve.apply(this,arguments)},exports.getFilesWithKeyword=Q,exports.getFullFilepath=ve,exports.getInitialCategory=wt,exports.getLastCategory=yt,exports.getLayout=Z,exports.getObjectNameField=function(e){return Xe.apply(this,arguments)},exports.getPath=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&(n=ie(n));var a=n.split("."),o=a.shift(),s=t[o];return 0===a.length?"function"==typeof s?s():s:e(s,a.join("."))},exports.getPitcherFolderPath=he,exports.getRecordTypeId=function(e,t){return We.apply(this,arguments)},exports.getSFUrl=function(e){return k("getSFUrl",{path:e})},exports.getSchema=Y,exports.getSyncEvents=function(){return Nt.apply(this,arguments)},exports.initializeInstance=function(){return vt.apply(this,arguments)},exports.joinPath=ce,exports.labelToValue=function(e,t,n){return Re.apply(this,arguments)},exports.launchContentWithID=G,exports.launchFileWithID=function(e){k("launchFileWithID",{fileID:e})},exports.launchFileWithKeyword=K,exports.loadConfig=Ie,exports.loadLayout=function(e,t){return Ne.apply(this,arguments)},exports.loadLocal=function(e){return ee.apply(this,arguments)},exports.loadParams=function(){return we.apply(this,arguments)},exports.loadPdfWithPage=function(e,t,n){k("loadPDF",{file:e.vUrl,titleV:bt(e.body),viewMode:1,lockViewMode:null,references:null,articles:null,subFolder:null,annotationEnabled:!0,jumpToPage:t,pdfID:e.ID,searchString:n})},exports.loadPresentationWithPage=function(e,t){k("launchContentWithID",{fileID:e,subID:t})},exports.loadPresentationsFromDB=Ct,exports.loadSchema=Ue,exports.loadServerJSON=pt,exports.loadValidations=function(e){return qe.apply(this,arguments)},exports.loadWebPageFromFolder=H,exports.makeId=Oe,exports.openContent=function(e,t){gt[e.category]&&(e.lastLaunchTime=(new Date).getTime().toString(),gt[e.category](e,t))},exports.openLink=function(e,t){return se.apply(this,arguments)},exports.planCall=function(){k("planCall")},exports.query=A,exports.refreshWatcher=function e(t){ue("reloadConsole").then((function(){window.console.log("change detected... refresh"),setTimeout((function(){W.$emit("refresh")}),t),window.localStorage.setItem("reloadConsole","false"),e(t)}))},exports.removeAllEvents=function(){var e=ct();e.state.syncEvents.forEach((function(e){k("removeEvent",{Id:e.Id})})),e.state.syncEvents=[]},exports.removeEvent=function(e){var t=ct();k("removeEvent",{Id:e}),t.state.syncEvents=t.state.syncEvents.filter((function(t){return t.Id!=e}))},exports.removeFavorite=function(e){e.isFavorite=!1,k("removeFavoriteItem",{fileID:e.ID})},exports.removeRoot=ie,exports.renderContext=re,exports.renderSimpleContext=function(e,t){return ne(e)(t,/{([^{}]*)}/g)},exports.resyncData=function(){k("resyncData",{})},exports.saveLocal=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];k("saveFromHTML",{variables:t,closeWeb:!1,id:e,useSFDCDB:n})},exports.saveObject=function(e){for(var t in e.ignoreFields||(e.ignoreFields=[]),e)(e[t]&&e[t].attributes||t.indexOf("111")>-1||t.endsWith("__r"))&&-1===e.ignoreFields.indexOf(t)&&e.ignoreFields.push(t),null===e[t]||void 0===e[t]?(e.fieldsToNull||(e.fieldsToNull=[]),-1===e.fieldsToNull.indexOf(t)&&e.fieldsToNull.push(t)):e.fieldsToNull&&e.fieldsToNull.indexOf(t)>-1&&e.fieldsToNull.splice(e.fieldsToNull.indexOf(t),1),"boolean"==typeof e[t]&&(e[t]=Number(e[t]));for(var n=0,r=["CurrencyIsoCode","attributes","CreatedById","CreatedDate","IsDeleted","LastActivityDate","LastModifiedById","LastModifiedDate","SystemModstamp","fieldsToNull"];n<r.length;n++){var a=r[n];-1===e.ignoreFields.indexOf(a)&&e.ignoreFields.push(a)}if(!e.objectType)throw new Error("no objectType defined");console.log("save object",e),e.Id?k("sendStatsFromHTML",{event_name:"event_redirect_updateSFDC",event_params:e}):k("sendStatsFromHTML",{event_name:"event_redirect_createSFDC",event_params:e})},exports.search=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{threshold:.15,distance:1e3,useExtendedSearch:!0},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n&&(r.keys=n);var o=new b.default(e,de({},r)),s=o.search("".concat(r.useExtendedSearch?"'":"").concat(t));return a?s:s.map((function(e){return e.item&&e.item}))},exports.searchPitcherFile=function(e){return k("searchPitcherFile",{extra:e,body:e,keywords:e,rangeCheck:!0})},exports.sendDocuments=function(){k("sendDocs")},exports.sendPickingContent=function(e,t){k("sendPickingContent",{fileIDs:e,via:t})},exports.setCategory=function(e){ot().setMainNav(e)},exports.showAlertBox=function(e,t){k("showAlertBox",{title:e,message:t})},exports.showIOSSyncWindow=function(e){k("showCachedOrders",e)},exports.source="modal",exports.startCall=function(){k("startCall")},exports.startDetailingWithID=function(e){k("startDetailingWithID",{ID:e})},exports.startPreCall=function(e){ct().state.hasActiveCall||k("startPreCall",e)},exports.startStopDetailing=function(e){return ut.apply(this,arguments)},exports.transform=O,exports.trimChar=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=x.default(e).findIndex((function(e){return e!==t})),a=n?x.default(e).reverse().findIndex((function(e){return e!==t})):0;return e.substring(r,e.length-a)},exports.uid=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t,r=0;r<e;r++)n+=0===r?"".concat(pe()).concat(pe()):"".concat(pe()),r+1!==e&&(n+="-");return n},exports.unpackProxy=function e(t){var n={};for(var r in Object.assign(n,t),t)Object.prototype.hasOwnProperty.call(t,r)&&("Proxy"!=typeof t[r]&&"object"!==w.default(t[r])||(n[r]=e(t[r])));return n},exports.useCategoriesStore=ot,exports.useConfigStore=xe,exports.useDetailing=function(){return ct().state},exports.useDetailingStore=ct,exports.useFilesStore=Ze,exports.useLayoutStore=Pe,exports.useParams=ge,exports.useParamsStore=ye,exports.useSchemaStore=Le,exports.useSystemStore=Ke,exports.useValidations=function(){return Be().state},exports.useValidationsStore=Be,exports.waitForWindowProp=le,exports.watchLocalStorage=ue; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@vue/composition-api"),t=require("@babel/runtime/regenerator"),n=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/classCallCheck"),a=require("@babel/runtime/helpers/createClass"),o=require("@babel/runtime/helpers/defineProperty"),s=require("@babel/runtime/helpers/typeof"),i=require("vue"),c=require("fuse.js/dist/fuse.min.js"),u=require("@babel/runtime/helpers/toConsumableArray"),l=require("@babel/runtime/helpers/slicedToArray");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var p=f(t),h=f(n),v=f(r),m=f(a),y=f(o),w=f(s),g=f(i),b=f(c),x=f(u),I=f(l);function T(e,t){for(var n=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),r=0,a=n.length;r<a;++r){var o=n[r];if(!(o in e))return;e=e[o]}return e}var S={};function O(t){var n=Object.getPrototypeOf(t),r=Object.getOwnPropertyDescriptors(n),a={};return Object.keys(t).forEach((function(e){var n=t[e];e.startsWith("on_")||(a[e]=n,"function"==typeof a[e]&&a[e].bind(a))})),Object.keys(r).forEach((function(t){if("constructor"!==t&&!t.startsWith("__")){var n=r[t].get,o=r[t].set,s=r[t].value;if(t.startsWith("on_"))return;s?(a[t]=s,"function"==typeof a[t]&&a[t].bind(a)):n&&o?a[t]=e.computed({get:n.bind(a),set:o.bind(a)}):n&&(a[t]=e.computed(n.bind(a)))}})),a=e.reactive(a),Object.keys(t).forEach((function(n){var r=t[n];n.startsWith("on_")&&(a[n]=e.watch(e.computed((function(){return T(a,n.substring(3).split("_").join("."))})),r))})),Object.keys(r).forEach((function(t){if("constructor"!==t&&!t.startsWith("__")){var n=r[t].value;t.startsWith("on_")&&(a[t]=e.watch(e.computed((function(){return T(a,t.substring(3).split("_").join("."))})),n))}})),a}function C(e){if(!e.id)throw"store needs an id attribute";return S&&S[e.id]?S[e.id]:(S[e.id]=O(e),S[e.id]?S[e.id]:void 0)}var D,E=(D=navigator.userAgent||navigator.vendor||window.opera,-1!==navigator.userAgent.indexOf("emulate-ios")?(console.warn("[VUE-SDK]: PLATFORM is being emulated as IOS"),"IOS"):window.parent!==window.self?"CONNECT":/windows phone/i.test(D)||/windows/i.test(D)?"WINDOWS":/android/i.test(D)?"ANDROID":/iPad|iPhone|iPod|AppleWebKit/.test(D)&&!window.MSStream?"IOS":"unknown");function k(e,t){return new Promise((function(n,r){var a=exports.fireEventCount++,o="fireEventCB".concat(a),s="fireEventErrorCB".concat(a);function i(){delete window[o],delete window[s]}t||(t={}),t.callBackFunc=o,t.callBack=o,t.errorFunc=s,t.emptyFunction=s,t.source=t.source||"modal",window[o]=function(e){if("string"==typeof e&&(e.startsWith("{")||e.startsWith("[")))try{n(JSON.parse(e))}catch(e){r("Invalid JSON")}else n(e);i()},window[s]=function(e){r(e),i()},Object.prototype.hasOwnProperty.call(window,"Ti")?window.Ti.App.fireEvent(e,t):r("Ti not found")}))}exports.fireEventCount=0;var P={},N={cacheEnabled:!1,cacheTimeout:500,defaultDatabase:"pitcher",longQueryWarning:!1};function j(e,t){P[e]={result:t,time:Date.now()}}function F(e){return N.cacheEnabled&&!e.toLowerCase().includes("delete")&&!e.toLowerCase().includes("insert")&&Object.prototype.hasOwnProperty.call(P,e)&&P[e].time+N.cacheTimeout>Date.now()}function A(e){return _.apply(this,arguments)}function _(){return(_=h.default(p.default.mark((function e(t){var n,r,a,o=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:null,r=o.length>2&&void 0!==o[2]&&o[2],a=o.length>3&&void 0!==o[3]?o[3]:"modal",process.env.LOG&&console.log(t),e.abrupt("return",new Promise((function(e,o){if(F(t)&&N.cacheEnabled)return console.log("cache hit"),e(P[t].result);var s=new Date;k("dbFunction",{db:n||N.defaultDatabase,iosMode:!0,pType:"query",query:t,source:a}).then((function(n){var a=new Date-s;a>1e3&&N.longQueryWarning&&console.warn("slow query (".concat((a/1e3).toFixed(2),"s): ").concat(t));var i=[];n.error&&(console.error(t),o(new Error(n.error)));for(var c=0;c<n.results.length;c++){for(var u=n.results[c],l={},f=0;f<n.columns.length;f++){var d=n.columns[f],p=u[f];if("WINDOWS"===E&&"string"==typeof p&&(p=p.replace(/''/g,"'")),"extraField"===d||"account"===d||"eventJSON"===d||"contact"===d||"Json"===d||"user"===d||"userObject"===d){var h=JSON.parse(p);for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&"attributes"!==v&&(r&&null===h[v]||(l[v]=h[v]))}else l[d]=void 0===p?null:p}i.push(l)}N.cacheEnabled&&j(t,i),e(i)})).catch(o)})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(e,t){Object.keys(e).forEach((function(n){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}function U(e,t,n){try{return new Function("with(this){\nreturn Boolean(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn Boolean(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}}function M(e,t,n){try{return new Function("with(this){\nreturn ".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}}var W=new g.default({});function V(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var X=!1,J={};function B(){return q.apply(this,arguments)}function q(){return(q=h.default(p.default.mark((function e(){var t,n,r,a,o,s,i,c;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(X){e.next=6;break}return e.next=3,k("getPitcherFiles",{fullData:!0});case 3:t=e.sent,n=V(t);try{for(n.s();!(r=n.n()).done;){a=r.value,o=void 0;try{o=a.keywords.split(",").map((function(e){return e.trim()}))}catch(e){o=[]}s=V(o);try{for(s.s();!(i=s.n()).done;)c=i.value,J[c]||(J[c]=[]),J[c].push(a)}catch(e){s.e(e)}finally{s.f()}}}catch(e){n.e(e)}finally{n.f()}case 6:X=!0;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(e){return z.apply(this,arguments)}function z(){return(z=h.default(p.default.mark((function e(t){return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return e.abrupt("return",J[t]);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"zip",s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];k("loadWebPageFromFolder",{urlValue:e,title:t,showBar:a,ID:n,folderName:o,allowPortrait:s,parameters:r})}function K(e,t){return $.apply(this,arguments)}function $(){return($=h.default(p.default.mark((function e(t,n){var r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Q(t);case 2:1!==(r=e.sent).length&&alert("".concat(r.length," files found for keyword: ").concat(t)),a=r[0],o="".concat(a.vUrl.replace(".zip","").replace("zip/",""),"/index.html"),"ANDROID"===E?H(o,a.body,a.ID,n):G(a.ID,n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];k("launchContentWithID",{fileID:e,parameters:t,subId:n,currentID:r,forceChange:a})}function Y(e){var t;if("ANDROID"===E||"WINDOWS"===E)t="".concat(e,"_desc");else{if("IOS"!==E)throw"no supported: ".concat(E);t="".concat(e,"_desc_cache")}try{return k("getFromHTML",{id:t,useSFDCDB:!0})}catch(t){throw"Schema not found:".concat(e)}}function Z(e,t){var n;return"IOS"===E||"ANDROID"===E?n="".concat(e,"_").concat(t,"_layout"):"WINDOWS"===E&&(n="".concat(e,"<").concat(t,">_desc")),console.log(n),k("getFromHTML",{id:n,useSFDCDB:!0})}function ee(){return(ee=h.default(p.default.mark((function e(t){var n,r,a=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(a.length>1&&void 0!==a[1])||a[1],e.next=3,k("getFromHTML",{id:t,useSFDCDB:n});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e,t,n){return ne(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{%\s*if([^{}]*)\s*%}(.*){%\s*endif\s*%}/g;return e.replace(n,(function(e,n,r){return U(n,t)?r:""}))}}(e)(t))(t,n)}function ne(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/{{([^{}]*)}}/g;return e.replace(n,(function(e,n){return M(n,t)}))}}function re(e,t){return te(e,t)}function ae(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function se(){return(se=h.default(p.default.mark((function e(t,n){var r,a,o,s,i,c,u,l;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=re(t,n),window.console.info("open link",t),t=t.split("pitcher://").join(""),r=2===t.split("/").length?t.split("/")[0]:2===t.split("?").length?t.split("?")[0]:t,a=t.split("?")[1],o={},a.length){a=decodeURI(a).split("&"),s=ae(a);try{for(s.s();!(i=s.n()).done;)c=i.value,u=c.split("="),o[u[0]]=u[1]}catch(e){s.e(e)}finally{s.f()}}for(l in o)window.localStorage[l]=o[l];if(!isNaN(Number(r))){e.next=13;break}return e.next=11,K(r,o);case 11:e.next=15;break;case 13:return e.next=15,G(r,o);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(e){var t=e.split(".");return 1===t.length?e:(t.shift(),e=t.join("."))}function ce(){for(var e=[].slice.call(arguments),t=e[0],n=1;n<e.length;n++)if(e[n]){var r=e[n].replace(/^(\/|\\)/,"");t="".concat(t.replace(/(\/|\\)$/,""),"/").concat(r)}return t}function ue(e){return new Promise((function(t){var n=window.localStorage,r=n.getItem(e);!function a(){setTimeout((function(){n.getItem(e)==r?a():t(n.getItem(e))}),1e3)}()}))}function le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=10*t;if(!e||""===e)throw new Error("No property is sent to watch on window");return new Promise((function(t){if(void 0!==window[e])return t(window[e]);var r=0,a=setInterval((function(){if(r++,void 0!==window[e]||r===n)return clearInterval(a),t(window[e])}),100)}))}try{window.localStorage.setItem("reloadConsole","false")}catch(e){console.log(e)}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){y.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pe(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function he(){var e,t;if(null!==(e=window)&&void 0!==e&&null!==(t=e.Ti)&&void 0!==t&&t.TiWeb)return"/";var n=window.location.href;if(!n.includes("zip/")&&!n.startsWith("http"))throw Error('"zip" folder not found in path');var r,a,o=n.lastIndexOf("zip//");if(-1!==o){var s=(a=o,[(r=n).substring(0,a),r.substring(a)]);n=s[0]+s[1].replace("zip//","zip/")}return(n=n.split("zip/")[0]).endsWith("/")?n:"".concat(n,"/")}function ve(e){return he()+e}window.getParameters=function(e){window.params=JSON.parse(e)},window.setParameters=function(e){window.params=JSON.parse(e)};var me=function(){function t(){v.default(this,t),y.default(this,"id","params"),y.default(this,"state",e.reactive({account:e.ref(null),contacts:null,contact:null,salesForceUser:null,user:null}))}return m.default(t,[{key:"locale",get:function(){var e=this.state.salesForceUser?this.state.salesForceUser:this.state.user,t=null;return e&&(t=e.LocaleSidKey?e.LocaleSidKey:e.LanguageLocaleKey),t?t.split("_").slice(0,2).join("-"):null}},{key:"language",get:function(){if(this.state.salesForceUser)return this.state.salesForceUser.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.user)return this.state.user.LanguageLocaleKey.split("_")[0].toLowerCase();if(this.state.config){var e={AUSDE:"de",BI:"id",BR:"pt",BU:"bg",CAFR:"fr",CZ:"cs",DAN:"da",ESMX:"es",EST:"et",JP:"ja",LET:"lv",PO:"pl",PRT:"pt",SCH:"zh-CN",TCH:"zh-TW",UA:"uk",VN:"vi"};return e[this.state.config.langV]?e[this.state.config.langV]:this.state.config.langV.toLowerCase()}return null}},{key:"context",get:function(){return{Account:this.state.account,Contact:this.state.contact,Contacts:this.state.contacts,User:this.state.salesForceUser?this.state.salesForceUser:this.state.user}}}]),t}();function ye(){return C(new me)}function we(){return(we=h.default(p.default.mark((function e(){var t,n;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ye(),console.log("[@pitcher/core]: account",t.state.account),!process.env.VUE_APP_PARAMS){e.next=6;break}return n=JSON.parse(process.env.VUE_APP_PARAMS),Object.assign(t.state,n),e.abrupt("return",t.state);case 6:return e.next=8,le("params");case 8:return e.sent&&Object.assign(t.state,window.params),e.abrupt("return",t.state);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(){return ye().state}var be=function(){function e(){v.default(this,e),y.default(this,"id","config"),y.default(this,"state",{customCaches:null})}return m.default(e,[{key:"getTableDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n.tableToCache,e[n.objectName]=n.tableToCache}return e}},{key:"getCacheDict",get:function(){var e={};if(!this.state.customCaches)return e;for(var t=0;t<this.state.customCaches.length;t++){var n=this.state.customCaches[t];e[n.sfObjectName]=n,e[n.objectName]=n}return e}}]),e}();function xe(){return C(new be)}function Ie(){return Te.apply(this,arguments)}function Te(){return(Te=h.default(p.default.mark((function e(){var t,n,r,a,o,s,i=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"modal",n=xe(),e.next=4,k("getAppConfig",{source:t});case 4:if(void 0!==(r=e.sent).userAttrSpecificSettings&&(a=ge(),o=a.user,r.userAttrSpecificSettings.forEach((function(e){var t=o[e.attrP];if(t&&t.includes(e.valueP))if("replace"===e.typeP)for(var n in e.settings)r[n]=e.settings[n];else if("add"===e.typeP)for(var a in e.settings)r[a]||(r[a]=[]),Array.isArray(e.settings[a])?r[a]=r[a].concat(e.settings[a]):r[a].push(e.settings[a])}))),console.log("[@pitcher/core]: app config",r),r.customCaches=Array.isArray(r.customCaches)?r.customCaches:[],"IOS"!==E){e.next=15;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts_m_v3",query:r.sfdcAccountQuery,fieldTypes:{account:"TEXT",id:"TEXT",lat:"TEXT",lon:"TEXT",city:"TEXT",lastVisit:"TEXT",accountName:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts_m_v4",query:r.sfdcContactQuery,fieldTypes:{contact:"TEXT",id:"TEXT",accountID:"TEXT",lastVisit:"TEXT",name:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users_m_v3",query:"",fieldTypes:{userObject:"TEXT",id:"TEXT",lastName:"TEXT",firstName:"TEXT",name:"TEXT",roleID:"TEXT",parentRoleID:"TEXT",extraField:"TEXT"}}),e.next=31;break;case 15:if("ANDROID"!==E){e.next=22;break}r.customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"tbl_crm_accounts",query:r.sfdcAccountQuery}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"tbl_crm_contacts",query:r.sfdcContactQuery}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"tbl_calls",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"tbl_crm_users",query:""}),e.next=31;break;case 22:if("WINDOWS"!==E){e.next=30;break}(r=r[0]).customCaches.push({objectName:"Account",sfObjectName:"Account",tableToCache:"SQLiteSfAccount",query:r.sfdcAccountQuery,fieldTypes:{BillingCity:"TEXT",BillingCountry:"TEXT",BillingStreet:"TEXT",Id:"TEXT",ExternalId:"TEXT",Json:"TEXT",JsonUntouched:"TEXT",LastModifiedDate:"TEXT",LastModifiedTimeStamp:"INTEGER",LastVisitTimeStamp:"INTEGER",Lat__c:"REAL",Long__c:"REAL",Name:"TEXT"}}),r.customCaches.push({objectName:"Contact",sfObjectName:"Contact",tableToCache:"SQLiteSfContact",query:r.sfdcContactQuery,fieldTypes:{Id:"TEXT",ExternalId:"TEXT",LastModifiedDate:"TEXT",Name:"TEXT",AccountId:"TEXT",Email:"TEXT",Json:"TEXT",JsonUntouched:"TEXT"}}),r.customCaches.push({objectName:"Call",sfObjectName:"Call",tableToCache:"SQLiteSfEvent",query:""}),r.customCaches.push({objectName:"User",sfObjectName:"User",tableToCache:"SQLiteSfUser",query:"",fieldTypes:{Id:"TEXT",IsActive:"INTEGER",LastModifiedDate:"TEXT",FirstName:"TEXT",LastName:"TEXT",Json:"TEXT"}}),e.next=31;break;case 30:throw new Error("Platform not supported: ".concat(E));case 31:for(s in r)n.state[s]=r[s];return e.abrupt("return",n.state);case 33:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=h.default(p.default.mark((function e(t,n){var r,a,o,s,i,c,u,l,f=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f.length>2&&void 0!==f[2]?f[2]:null,a=f.length>3&&void 0!==f[3]&&f[3],t){e.next=4;break}throw Error("no query provided");case 4:for(c in o=xe(),s=ye().state,t=t.split("TODAY").join("date('now')"),i=o.getTableDict,n)Object.prototype.hasOwnProperty.call(n,c)&&(i[c]=n[c]);return s.account&&(i.account=s.account,i.contacts=s.contacts),s.salesForceUser&&(i.user=s.salesForceUser),s.user&&(i.user=s.user),s.locale&&(i.locale=s.locale),u=re(t,i),e.prev=14,e.next=17,A(u,r,a);case 17:return l=e.sent,e.abrupt("return",l);case 21:throw e.prev=21,e.t0=e.catch(14),console.error(u,i),e.t0;case 25:case"end":return e.stop()}}),e,null,[[14,21]])})))).apply(this,arguments)}function Oe(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}function Ce(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return De(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return De(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ee=function(){function t(n,r){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];v.default(this,t),y.default(this,"references",e.ref([])),y.default(this,"referencesTo",[]),Object.assign(this,n),this.parentObjectType=r,this.required=!n.nillable||n.nameField,this.errors=[],a&&this.load_refs()}var n;return m.default(t,[{key:"valid",value:function(e){return"boolean"===this.type&&!0===e||!1===e||!(!e&&this.required)}},{key:"load_refs",value:function(){var e=xe();if(this.referenceTo&&this.referenceTo.length){var t,n=e.getCacheDict[this.parentObjectType],r=Ce(this.referenceTo);try{for(r.s();!(t=r.n()).done;){var a=t.value,o=e.getCacheDict[a];if(!o)return void window.console.warn("referenced object not found: ".concat(a));this.load(o,n,a)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"load",value:(n=h.default(p.default.mark((function e(t,n,r){var a,o,s,i,c,u,l,f,d;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null,n&&n.filters&&(a=n.filters[this.name]),o=t.tableToCache,s="select Id, ",i="Name",t.fieldTypes&&t.fieldTypes.Name?s+="Name":"Account"===r?"ANDROID"===E?(s+="account_name",i="account_name"):(s+="accountName",i="accountName"):"Contact"===r||"User"===r?(s+="name",i="name"):t.fieldTypes.extraField?s+="extraField":alert("no name field found in table for ".concat(r)),s+=" from ".concat(o),e.next=9,A(s);case 9:c=e.sent,u=[],l=Ce(c),e.prev=12,l.s();case 14:if((f=l.n()).done){e.next=23;break}if(d=f.value,!a){e.next=20;break}if(U(a,d)){e.next=20;break}return e.abrupt("continue",21);case 20:u.push({value:d.Id,text:d[i]});case 21:e.next=14;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(12),l.e(e.t0);case 28:return e.prev=28,l.f(),e.finish(28);case 31:this.references.value=this.references.value.concat(u);case 32:case"end":return e.stop()}}),e,this,[[12,25,28,31]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"loadExternalReferences",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Name",r=[],a=Ce(e);try{for(a.s();!(t=a.n()).done;){var o=t.value;r.push({value:o.Id,text:o[n]})}}catch(e){a.e(e)}finally{a.f()}this.references.value=r}}]),t}(),ke=function e(){v.default(this,e),y.default(this,"id","layout"),y.default(this,"state",{})},Pe=function(){return C(new ke)};function Ne(){return(Ne=h.default(p.default.mark((function e(t,n){var r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="".concat(t,"_").concat(n),!(a=Pe()).state[r]){e.next=6;break}return e.abrupt("return",a.state[r]);case 6:return e.next=8,Z(t,n);case 8:return o=e.sent,a.state[r]=new je(o,t),e.abrupt("return",a.state[r]);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var je=function e(t,n){for(var r in v.default(this,e),t)this[r]=t[r];this.objectType=n};function Fe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ae(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _e=function e(){v.default(this,e),y.default(this,"id","schema"),y.default(this,"state",{})},Le=function(){return C(new _e)};function Ue(e){return Me.apply(this,arguments)}function Me(){return(Me=h.default(p.default.mark((function e(t){var n,r;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=Le()).state[t]){e.next=5;break}return e.abrupt("return",n.state[t]);case 5:return e.next=7,Y(t);case 7:return r=e.sent,n.state[t]=r,e.abrupt("return",n.state[t]);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=h.default(p.default.mark((function e(t,n){var r,a,o,s;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:r=e.sent,a=Fe(r.recordTypeInfos),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}if((s=o.value).name!==n){e.next=10;break}return e.abrupt("return",s.recordTypeId);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function Ve(){return(Ve=h.default(p.default.mark((function e(t,n){var r,a,o,s,i;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:r=e.sent,a=Fe(r.fields),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=13;break}if((s=o.value).name!==n.trim()){e.next=11;break}return i=new Ee(s,t),e.abrupt("return",i);case 11:e.next=6;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),a.e(e.t0);case 18:return e.prev=18,a.f(),e.finish(18);case 21:throw new Error("field not found:".concat(n));case 22:case"end":return e.stop()}}),e,null,[[4,15,18,21]])})))).apply(this,arguments)}function Re(){return(Re=h.default(p.default.mark((function e(t,n,r){var a,o,s,i,c,u,l;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:a=e.sent,o=Fe(a.fields),e.prev=4,o.s();case 6:if((s=o.n()).done){e.next=28;break}if((i=s.value).name!==n.trim()||!i.picklistValues){e.next=26;break}c=Fe(i.picklistValues),e.prev=10,c.s();case 12:if((u=c.n()).done){e.next=18;break}if((l=u.value).label!==r){e.next=16;break}return e.abrupt("return",l.value);case 16:e.next=12;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(10),c.e(e.t0);case 23:return e.prev=23,c.f(),e.finish(23);case 26:e.next=6;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(4),o.e(e.t1);case 33:return e.prev=33,o.f(),e.finish(33);case 36:case"end":return e.stop()}}),e,null,[[4,30,33,36],[10,20,23,26]])})))).apply(this,arguments)}function Xe(){return(Xe=h.default(p.default.mark((function e(t){var n,r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue(t);case 2:n=e.sent,r=Fe(n.fields),e.prev=4,r.s();case 6:if((a=r.n()).done){e.next=12;break}if(!(o=a.value).nameField){e.next=10;break}return e.abrupt("return",o.name);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),r.e(e.t0);case 17:return e.prev=17,r.f(),e.finish(17);case 20:throw new Error("No name field found");case 21:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}var Je=function e(){v.default(this,e),y.default(this,"id","validation"),y.default(this,"loaded",!1),y.default(this,"state",{listviews:[],lookups:[],rules:[]})};function Be(){return C(new Je)}function qe(){return(qe=h.default(p.default.mark((function e(t){var n,r,a,o;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=Be()).loaded){e.next=13;break}return e.next=4,Q(t);case 4:return r=e.sent,e.next=7,fetch(ve(r[0].vUrl));case 7:return a=e.sent,e.next=10,a.json();case 10:o=e.sent,n.state=Object.assign(n.state,o),n.loaded=!0;case 13:return e.abrupt("return",n.state);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qe=2,ze="0",He=function t(){v.default(this,t),y.default(this,"id","systemStore"),y.default(this,"state",e.reactive({config:null,groups:null,appID:null,supportEmail:null,deviceName:null,metadata:null,messages:null,appName:null,systemLang:null,locale:null,userfullname:null,ajaxtoken:null,isCustomerUI:!1,batteryLevel:0,statusBadge:0,todoBadge:0}))},Ke=function(){return C(new He)};function $e(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ge(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw o}}}}function Ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}window.updateStatusBadge=function(e){var t=Ke();e=parseInt(e),t.state.statusBadge=e||0},window.updateTodoBadge=function(e){var t=Ke();e=parseInt(e),t.state.todoBadge=e||0},window.fetch||Promise.resolve().then((function(){return d(require("whatwg-fetch"))}));var Ye=function(){function t(){var n=this;v.default(this,t),y.default(this,"id","filesStore"),y.default(this,"oneTimeLoadPresentations",!1),y.default(this,"state",e.reactive({files:[],uiFiles:e.computed((function(){return n.state.files.filter((function(e){return e.shouldShowInUI}))})),slides:[],documentPath:null,presentations:[],customs:[],initialAllowedIDs:null,allowedIDs:[]}))}return m.default(t,[{key:"isFileExpiredOrNotReady",value:function(e,t,n){return void 0!==t&&void 0!==n&&(null!=t&&null!=n&&(0!=t&&0!=n&&(t>e||n<e)))}},{key:"shouldShowInUI",value:function(e,t){return"T"!=t.ID[0]&&7!=t.typeV&&-1!=t.typeV&&0!=t.typeV&&"images"!=t.category&&!this.isFileExpiredOrNotReady(e,t.startDate,t.endDate)}},{key:"extendFiles",value:function(e){var t=this,n=(new Date).getTime()/1e3;return e.forEach((function(e){e.shouldShowInUI=t.shouldShowInUI(n,e),e.thumbnailUrl=ce(window.documentPath,e.thumb)})),e}},{key:"parsePresentations",value:function(e){var t=this;this.state.customs=[],this.state.presentations=[],e.forEach((function(e){return t.parseSinglePresentation(e)})),this.oneTimeLoadPresentations&&(k("loadPresentationsFromDB",{}),this.oneTimeLoadPresentations=!1)}},{key:"parseCustomPdf",value:function(e){return e.ID=e.slideOrder.split(",")[0].split("|")[0],e.isCustomPdf=!0,e}},{key:"parseSinglePresentation",value:function(e){try{return e.isCustom!=Qe&&(void 0!==e.ID&&null!=e.ID||(e=this.parseCustomPdf(e)),null==e.vSubFolder&&(e.containsMultiple=!0,e.vSubFolder=e.slideOrder.split(",")[0].split("|")[0],e.ID=e.slideOrder.split(",")[0].split("|")[0],-1==e.vSubFolder.indexOf("_")?e.isCustomPdf=!0:e.ID="".concat(parseInt(e.ID))),e.ID="".concat(e.ID),e.isCustom?this.addFileAsCustom(e):this.mergePresentation(e)),!0}catch(e){k("Error",e)}return!1}},{key:"createAppendCustomFile",value:function(e,t){var n={};Object.assign(n,e),Object.assign(n,t),n.body=t.presentationName,this.state.customs.push(n)}},{key:"addFileAsCustom",value:function(e){var t=this.state.files.find((function(t){return t.ID==e.ID}));if(t)this.createAppendCustomFile(t,e);else{var n=this.state.slides.find((function(t){return t.vSubfolder==e.vSubFolder}));n&&(t=this.state.files.find((function(e){return e.ID==n.ID})))&&(e.ID=t.ID,this.createAppendCustomFile(t,e))}}},{key:"mergePresentation",value:function(e){this.state.presentations.push(e);var t=this.state.files.find((function(t){return t.ID==e.ID}));t&&Object.assign(t,e)}},{key:"markFavorites",value:function(e){return this.state.files.forEach((function(t){void 0===t.isFavorite?g.default.set(t,"isFavorite",e[t.ID]||!1):t.isFavorite=e[t.ID]||!1})),this.state.files}},{key:"setAllowedIds",value:function(e){e&&e.length>0&&null==this.state.initialAllowedIDs&&(this.state.initialAllowedIDs=e),this.state.allowedIDs=e||[]}}]),t}(),Ze=function(){return C(new Ye)};function et(e){return e.slideOrder?e.slideOrder.split(",").map((function(e){var t=e.split("|"),n=I.default(t,2),r=n[0],a=n[1];return{deckId:r,index:parseInt(a)-1}})):[]}function tt(e,t){if(!e)return null;for(var n=0;n<e.length;n++){var r=e[n];if(t>=r.startIndex&&t<r.endIndex)return r}return null}function nt(e){return rt.apply(this,arguments)}function rt(){return(rt=h.default(p.default.mark((function e(t){var n,r,a;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="-",r=p.default.mark((function e(r){var a,o,s,i,c,u,l,f,d;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=t[r]).isCustom){e.next=3;break}return e.abrupt("return","continue");case 3:if(0!==(o=et(a)).length){e.next=6;break}return e.abrupt("return","continue");case 6:s=o.reduce((function(e,t){return e.add(t.deckId),e}),new Set),i=new Map,c=$e(s),e.prev=9,c.s();case 11:if((u=c.n()).done){e.next=28;break}return l=u.value,e.prev=13,e.next=16,fetch("".concat(window.documentPath,"/slides/").concat(l,"/chapters.json"));case 16:return f=e.sent,e.next=19,f.json();case 19:d=e.sent,i.set(l,d.chapters),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(13),console.warn("[Chapter Generation]: ".concat(window.documentPath,"/slides/").concat(l,"/chapters.json does not exist!"));case 26:e.next=11;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(9),c.e(e.t1);case 33:return e.prev=33,c.f(),e.finish(33);case 36:if(o.forEach((function(e){var t=tt(i.get(e.deckId),e.index);e.chapterName=(null==t?void 0:t.nameV)||n})),!o[0]){e.next=41;break}return e.next=40,fetch("".concat(window.documentPath,"/slides/").concat(o[0].deckId,"/setup.json")).then((function(e){return e.json()})).catch((function(){return null}));case 40:a.setupJSON=e.sent;case 41:a.chapters={chapters:o.reduce((function(e,t,r){var a=e[e.length-1],o=t.deckId===(null==a?void 0:a.deckId),s=t.chapterName===(null==a?void 0:a.nameV),i=t.chapterName===n&&(null==a?void 0:a.nameV)===n;return a&&s&&(o||!o&&i)?a.endIndex=r+1:e.push({nameV:t.chapterName,deckId:t.deckId,startIndex:r,endIndex:r+1}),e}),[]).filter((function(e){return null!==e})).map((function(e){return{nameV:e.nameV,startIndex:e.startIndex,endIndex:e.endIndex}}))},1===a.chapters.chapters.length&&a.chapters.chapters[0].nameV===n&&(a.chapters.chapters=[]),k("saveFromHTML",{id:a.ID,variables:a});case 44:case"end":return e.stop()}}),e,null,[[9,30,33,36],[13,23]])})),e.t0=p.default.keys(t);case 3:if((e.t1=e.t0()).done){e.next=11;break}return a=e.t1.value,e.delegateYield(r(a),"t2",6);case 6:if("continue"!==e.t2){e.next=9;break}return e.abrupt("continue",3);case 9:e.next=3;break;case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.getAllowedIDs=function(){return Ze().state.allowedIDs},window.loadPresentations=function(e){var t=e;"string"==typeof e&&(t=JSON.parse(t)),nt(t).then((function(){(window.presentationsObject=t,window.presentationsObject)&&Ze().parsePresentations(window.presentationsObject)}))},window.filterJSON=function(e){var t=Ze();e?t.setAllowedIds(JSON.parse(e)):t.setAllowedIds([])};var at=function(){function t(){var n=this;v.default(this,t),y.default(this,"id","categoriesStore"),y.default(this,"loaded",!1),y.default(this,"state",e.reactive({category:{},categories:[],parentCategories:e.computed((function(){return n.state.categories.filter((function(e){return e.parentCategory==ze}))})),subCategories:e.computed((function(){return n.state.categories.filter((function(e){return e.parentCategory!=ze}))}))}))}return m.default(t,[{key:"setMainNav",value:function(e){e&&(window.lastViewedCategory=e,"undefined"!=typeof localStorage&&localStorage.setItem("".concat(this.state.appID,".mainNavItem"),e.ID),k("setCategory",{category:JSON.stringify(e)}),this.state.category=e,this.loaded||(this.loaded=!0,k("uiReady")))}}]),t}(),ot=function(){return C(new at)};window.setMainNav=function(e){window.lastViewedCategory=e};var st={xPos:50,yPos:30,widthV:160,heightV:50},it=function(){function t(){var n=this;v.default(this,t),y.default(this,"id","detailing"),y.default(this,"state",e.reactive({currentContact:null,currentAccount:null,hasActiveCall:e.computed((function(){return null!=n.state.currentContact})),todaysCalls:[],isFilterActive:!1,quickStartEnabled:!0,quickPlanningEnabled:!0,selectedDate:null,events:[],unsubmitted:[],syncEvents:[],loggedIn:!1}))}var n;return m.default(t,[{key:"setLoggedIn",value:(n=h.default(p.default.mark((function e(t){var n;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||this.state.loggedIn){e.next=6;break}return e.next=3,Ie("homescreen");case 3:n=e.sent,this.state.quickStartEnabled=!n.disableQuickStart,this.state.quickPlanningEnabled=!n.disableQuickPlanning;case 6:this.state.loggedIn=t;case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"afterCallEnded",value:function(){this.state.currentContact=null,this.state.currentAccount=null}},{key:"setCurrentContact",value:function(e,t){var n=null!=this.state.currentContact;if(null==e&&null==t)this.afterCallEnded();else{try{this.state.currentContact=JSON.parse(e),this.state.currentAccount=JSON.parse(t)}catch(e){console.log(e)}this.state.isFilterActive=null!=this.state.currentContact&&!n}W.$emit("contact-changed")}},{key:"setQuickStart",value:function(e){void 0!==e.quickstartenabled?this.state.quickStartEnabled="1"==e.quickstartenabled:this.state.quickStartEnabled=!0}},{key:"checkLogin",value:function(e){return"0"!=e.loggedin||(k("startDetailing",st),!1)}},{key:"createEvent",value:function(e){return{Id:e.Id,isAllDay:!!e.IsAllDay,name:[e.AccountName,e.ContactName||""].map((function(e){return e})).join(", "),date:new Date(e.StartDateTime),event:e}}},{key:"parseEventData",value:function(e,t){if(this.state.selectedDate=t,this.state.events=[],this.state.unsubmitted=[],this.setQuickStart(e),this.checkLogin(e)){for(var n=0;n<e.records.length;n++)this.state.events.push(this.createEvent(e.records[n]));for(var r=0;r<e.unsubmitteds.length;r++)this.state.events.push(this.createEvent(e.unsubmitteds[r]))}}}]),t}(),ct=function(){return C(new it)};function ut(){return(ut=h.default(p.default.mark((function e(t){var n;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=ct()).state.hasActiveCall){e.next=5;break}k("stopDetailing",t||st),e.next=17;break;case 5:e.t0=E,e.next="WINDOWS"===e.t0?8:15;break;case 8:return e.t1=n,e.next=11,k("getCrmEventsForToday",{target:t||st});case 11:return e.t2=e.sent,e.t3=new Date,e.t1.parseEventData.call(e.t1,e.t2,e.t3),e.abrupt("break",17);case 15:return k("startDetailing",t||st),e.abrupt("break",17);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lt(){return(lt=h.default(p.default.mark((function e(t,n){var r;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ct(),e.t0=r,e.next=4,k("getCrmEventsByDate",{target:t||st,timestamp:n});case 4:e.t1=e.sent,e.t2=new Date(parseInt(n)),e.t0.parseEventData.call(e.t0,e.t1,e.t2);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ft(){return dt.apply(this,arguments)}function dt(){return(dt=h.default(p.default.mark((function e(){return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k("getFavoriteItems",{source:"homescreen"}).then((function(e){var t=Ze(),n={};e&&e.length&&e.forEach((function(e){return n[e]=!0})),t.markFavorites(n)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(){return ht.apply(this,arguments)}function ht(){return(ht=h.default(p.default.mark((function e(){var t,n,r,a,o,s,i=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:5,n=Ke(),r=Ze(),a=ot(),process.env.VUE_APP_TI&&(window.Ti=JSON.parse(process.env.VUE_APP_TI),window.Ti.App.fireEvent=function(){return!0}),e.next=7,le("Ti",t);case 7:return k("askJSON"),process.env.VUE_APP_SERVERJSON&&(window.serverJSON=JSON.parse(process.env.VUE_APP_SERVERJSON),window.documentPath="/"),e.next=11,le("serverJSON",t);case 11:return(o=e.sent)&&(o.files=r.extendFiles(o.files),r.state.documentPath=window.documentPath,L(n.state,window.serverJSON),L(r.state,window.serverJSON),L(a.state,window.serverJSON)),process.env.VUE_APP_PRESENTATIONSOBJECT&&(window.presentationsObject=JSON.parse(process.env.VUE_APP_PRESENTATIONSOBJECT)),k("loadPresentationsFromDB",{}),e.next=17,le("presentationsObject",t);case 17:(s=e.sent)&&r.parsePresentations(s);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vt(){return(vt=h.default(p.default.mark((function e(){var t,n=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:5,e.next=3,pt(t);case 3:return e.next=5,ft();case 5:mt();case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mt(){var e=ot();if(e.state.categories){var t=e.loaded&&yt()||wt();t?e.setMainNav(t):k("uiReady")}else k("uiReady")}function yt(){var e=ot(),t="undefined"!=typeof localStorage?localStorage.getItem("".concat(e.state.appID,".mainNavItem")):null;return e.state.categories&&t?e.state.categories.find((function(e){return e.ID==t})):null}function wt(){var e=ot();return e.state.categories?e.state.categories.find((function(e){return e.isDefault}))||e.state.categories.find((function(e){return e.parentCategory==ze})):null}window.setCurrentContact=function(e,t){ct().setCurrentContact(e,t)},window.loggedOut=function(){ct().setLoggedIn(!1)},window.updateCRM=function(){ct().setLoggedIn(!0)},window.enableCrm=function(e){ct().setLoggedIn("true"===e)},window.gotJSON=function(e,t){try{window.documentPath=t,window.serverJSON=JSON.parse(e),window.appID=window.serverJSON.appID}catch(e){k("Error",e)}},window.sentPitcherEvent=function(){};var gt={presentation:function(e){e.isCustomPdf?xt(e):k("loadPresentation",{dataOfPres:e})},pdf:function(e){e.isCustom?xt(e):It(e,{launchMode:1,viewMode:e.year})},"3D":function(e){Tt(e,"loadThreeD")},molecule:function(e){Tt(e,"loadMolecule")},brochure:function(e){It(e,{launchMode:2,viewMode:e.year})},video:function(e){St(e,0)},"video-online":function(e){St(e,1)},surveys:function(e,t){var n=e.vUrl,r=bt(e.body);k("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("surveys",""),"/index.html"),title:r,showBar:!0,folderName:"surveys",allowPortrait:!0,parameters:t})},zip:function(e,t){var n=e.vUrl,r=bt(e.body),a=0,o=1;if(null!=e.extra2){var s=e.extra2.split("|");o=s.length>0&&1==s[0]?0:1,a=s.length>1&&1==s[1]?1:0}k("loadWebPageFromFolder",{ID:e.ID,urlValue:"".concat(n.replace(".zip","").replace("zip",""),"/index.html"),title:r,showBar:o,folderName:"zip",allowPortrait:a,parameters:t})}};function bt(e){return"".concat(e).replace(/[\\"']/g,"\\$&").replace(/\\u0000/g,"\\0").replace('"',"")}function xt(e){k("loadCustomPDF",{dataOfPres:e})}function It(e,t){t.viewMode=1==t.viewMode?3:1,t.file=e.vUrl,t.pdfID=e.ID,t.titleV=bt(e.body),k("loadPDF",t)}function Tt(e,t){var n=e.vUrl,r=n.split("/"),a=bt(e.body);r.length?k(t,{model:r[1],folder:r[0],title:a,fileID:e.ID}):k(t,{model:n,title:a,fileID:e.ID})}function St(e,t){var n=e.vUrl,r=bt(e.body);k(e.keywords&&e.keywords.indexOf("ybVideo")>-1?"loadYB":"loadMovie",{file:n,isOnline:t,title:r,fileID:e.ID})}function Ot(e){Ze().oneTimeLoadPresentations=!0,k("editPresentation",e?{dataOfPres:e,chapters:[{nameV:"Slides",startIndex:0,endIndex:e.vNumber}]}:{mix:!0,allowMix:!0})}function Ct(){k("loadPresentationsFromDB",{})}function Dt(){return Et.apply(this,arguments)}function Et(){return(Et=h.default(p.default.mark((function e(){var t,n,r,a,o,s=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:"homescreen",n=ct(),r=Ke().state.appName,a="SELECT rowid,event_name, event_time, lastResponse FROM tbl_reports_v3 WHERE event_name LIKE '%event_redirect%'",e.next=6,A(a,r,!1,t);case 6:return o=e.sent,n.state.syncEvents=o.map((function(e){return{Id:e.rowid,name:e.event_name,time:e.event_time,date:e.event_time?new Date(parseInt(e.event_time)):"",response:e.lastResponse}})),e.abrupt("return",n.state.syncEvents);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kt(){return Pt.apply(this,arguments)}function Pt(){return(Pt=h.default(p.default.mark((function e(){var t,n,r,a,o=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"homescreen",n=ct(),r="SELECT Id, Name, Time, Status FROM SQLiteEvent WHERE Name LIKE '%event_redirect%'",e.next=5,A(r,null,!1,t);case 5:return a=e.sent,n.state.syncEvents=a.map((function(e){return{Id:e.Id,name:e.Name,time:e.Time,date:e.Time?new Date(parseInt(e.Time)):"",response:e.Status}})),e.abrupt("return",n.state.syncEvents);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(){return(Nt=h.default(p.default.mark((function e(){var t,n=arguments;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n.length>0&&void 0!==n[0]?n[0]:"homescreen",e.t0=E,e.next="IOS"===e.t0?4:"WINDOWS"===e.t0?6:"ANDROID"===e.t0?8:9;break;case 4:return Dt(t),e.abrupt("break",10);case 6:return kt(t),e.abrupt("break",10);case 8:case 9:return e.abrupt("break",10);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.finishedCreatingPresentation=function(){Ct()},window.getCategoryLogoURL=function(){return""},exports.Field=Ee,exports.PLATFORM=E,exports.Schema=je,exports.addFavorite=function(e){e.isFavorite=!0,k("addFavoriteItem",{fileID:e.ID})},exports.assign=function(e,t){for(var n in process.env.LOG&&console.warn("deprecated"),e)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=e[n])},exports.assignUsingSourceKeys=L,exports.clearCache=function(){P={}},exports.clone=function(e){if(null==e||"object"!==w.default(e))return e;var t=e.constructor();for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},exports.closeModal=function(){k("closeOpenModal")},exports.contextQuery=function(e,t){return Se.apply(this,arguments)},exports.createSlideSet=function(){Ze().oneTimeLoadPresentations=!0,Ot()},exports.createStore=C,exports.dbSettings=N,exports.deleteFile=function(e){Ze().oneTimeLoadPresentations=!0,k("deletePresentation",{dataOfPres:e})},exports.editFile=Ot,exports.eventHub=W,exports.execBool=U,exports.execContext=function(e,t,n){try{return new Function("with(this){\n".concat(e,"\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\n".concat(e,"\n}")),window.console.error(r),window.console.error(t)}},exports.execReturn=M,exports.execString=function(e,t,n){try{return new Function("with(this){\nreturn String(".concat(e,")\n}")).apply(t)}catch(r){if(n)return e;window.console.error("with(this){\nreturn String(".concat(e,")\n}")),window.console.error(r),window.console.error(t)}},exports.exitApp=function(e){k("exitApp",e||{})},exports.fireEvent=k,exports.generateCustomDeckChapters=nt,exports.generateExternalID=function(){return"PIT_".concat(Oe(30))},exports.getCrmEventsByDate=function(e,t){return lt.apply(this,arguments)},exports.getExtraFieldValue=function(e,t){var n=Ke(),r=t;try{"string"==typeof n.state.config.extraField&&(n.state.config.extraField=JSON.parse(n.state.config.extraField)),void 0!==n.state.config.extraField[e]&&"string"==typeof(r=n.state.config.extraField[e])&&(r.startsWith("{")||r.startsWith("["))&&(r=JSON.parse(r))}catch(e){process.env.LOG&&console.log(e)}return r},exports.getFavorites=ft,exports.getField=function(e,t){return Ve.apply(this,arguments)},exports.getFilesWithKeyword=Q,exports.getFullFilepath=ve,exports.getInitialCategory=wt,exports.getLastCategory=yt,exports.getLayout=Z,exports.getObjectNameField=function(e){return Xe.apply(this,arguments)},exports.getPath=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r&&(n=ie(n));var a=n.split("."),o=a.shift(),s=t[o];return 0===a.length?"function"==typeof s?s():s:e(s,a.join("."))},exports.getPitcherFolderPath=he,exports.getRecordTypeId=function(e,t){return We.apply(this,arguments)},exports.getSFUrl=function(e){return k("getSFUrl",{path:e})},exports.getSchema=Y,exports.getSyncEvents=function(){return Nt.apply(this,arguments)},exports.initializeInstance=function(){return vt.apply(this,arguments)},exports.joinPath=ce,exports.labelToValue=function(e,t,n){return Re.apply(this,arguments)},exports.launchContentWithID=G,exports.launchFileWithID=function(e){k("launchFileWithID",{fileID:e})},exports.launchFileWithKeyword=K,exports.loadConfig=Ie,exports.loadLayout=function(e,t){return Ne.apply(this,arguments)},exports.loadLocal=function(e){return ee.apply(this,arguments)},exports.loadParams=function(){return we.apply(this,arguments)},exports.loadPdfWithPage=function(e,t,n){k("loadPDF",{file:e.vUrl,titleV:bt(e.body),viewMode:1,lockViewMode:null,references:null,articles:null,subFolder:null,annotationEnabled:!0,jumpToPage:t,pdfID:e.ID,searchString:n})},exports.loadPresentationWithPage=function(e,t){k("launchContentWithID",{fileID:e,subID:t})},exports.loadPresentationsFromDB=Ct,exports.loadSchema=Ue,exports.loadServerJSON=pt,exports.loadValidations=function(e){return qe.apply(this,arguments)},exports.loadWebPageFromFolder=H,exports.makeId=Oe,exports.openContent=function(e,t){gt[e.category]&&(e.lastLaunchTime=(new Date).getTime().toString(),gt[e.category](e,t))},exports.openLink=function(e,t){return se.apply(this,arguments)},exports.planCall=function(){k("planCall")},exports.query=A,exports.refreshWatcher=function e(t){ue("reloadConsole").then((function(){window.console.log("change detected... refresh"),setTimeout((function(){W.$emit("refresh")}),t),window.localStorage.setItem("reloadConsole","false"),e(t)}))},exports.removeAllEvents=function(){var e=ct();e.state.syncEvents.forEach((function(e){k("removeEvent",{Id:e.Id})})),e.state.syncEvents=[]},exports.removeEvent=function(e){var t=ct();k("removeEvent",{Id:e}),t.state.syncEvents=t.state.syncEvents.filter((function(t){return t.Id!=e}))},exports.removeFavorite=function(e){e.isFavorite=!1,k("removeFavoriteItem",{fileID:e.ID})},exports.removeRoot=ie,exports.renderContext=re,exports.renderSimpleContext=function(e,t){return ne(e)(t,/{([^{}]*)}/g)},exports.resyncData=function(){k("resyncData",{})},exports.saveLocal=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];k("saveFromHTML",{variables:t,closeWeb:!1,id:e,useSFDCDB:n})},exports.saveObject=function(e){for(var t in e.ignoreFields||(e.ignoreFields=[]),e)(e[t]&&e[t].attributes||t.indexOf("111")>-1||t.endsWith("__r"))&&-1===e.ignoreFields.indexOf(t)&&e.ignoreFields.push(t),null===e[t]||void 0===e[t]?(e.fieldsToNull||(e.fieldsToNull=[]),-1===e.fieldsToNull.indexOf(t)&&e.fieldsToNull.push(t)):e.fieldsToNull&&e.fieldsToNull.indexOf(t)>-1&&e.fieldsToNull.splice(e.fieldsToNull.indexOf(t),1),"boolean"==typeof e[t]&&(e[t]=Number(e[t]));for(var n=0,r=["CurrencyIsoCode","attributes","CreatedById","CreatedDate","IsDeleted","LastActivityDate","LastModifiedById","LastModifiedDate","SystemModstamp","fieldsToNull"];n<r.length;n++){var a=r[n];-1===e.ignoreFields.indexOf(a)&&e.ignoreFields.push(a)}if(!e.objectType)throw new Error("no objectType defined");console.log("save object",e),e.Id?k("sendStatsFromHTML",{event_name:"event_redirect_updateSFDC",event_params:e}):k("sendStatsFromHTML",{event_name:"event_redirect_createSFDC",event_params:e})},exports.search=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{threshold:.15,distance:1e3,useExtendedSearch:!0},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n&&(r.keys=n);var o=new b.default(e,de({},r)),s=o.search("".concat(r.useExtendedSearch?"'":"").concat(t));return a?s:s.map((function(e){return e.item&&e.item}))},exports.searchPitcherFile=function(e){return k("searchPitcherFile",{extra:e,body:e,keywords:e,rangeCheck:!0})},exports.sendDocuments=function(){k("sendDocs")},exports.sendPickingContent=function(e,t){k("sendPickingContent",{fileIDs:e,via:t})},exports.setCategory=function(e){ot().setMainNav(e)},exports.showAlertBox=function(e,t){k("showAlertBox",{title:e,message:t})},exports.showIOSSyncWindow=function(e){k("showCachedOrders",e)},exports.source="modal",exports.startCall=function(){k("startCall")},exports.startDetailingWithID=function(e){k("startDetailingWithID",{ID:e})},exports.startPreCall=function(e){ct().state.hasActiveCall||k("startPreCall",e)},exports.startStopDetailing=function(e){return ut.apply(this,arguments)},exports.transform=O,exports.trimChar=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=x.default(e).findIndex((function(e){return e!==t})),a=n?x.default(e).reverse().findIndex((function(e){return e!==t})):0;return e.substring(r,e.length-a)},exports.uid=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t,r=0;r<e;r++)n+=0===r?"".concat(pe()).concat(pe()):"".concat(pe()),r+1!==e&&(n+="-");return n},exports.unpackProxy=function e(t){var n={};for(var r in Object.assign(n,t),t)Object.prototype.hasOwnProperty.call(t,r)&&("Proxy"!=typeof t[r]&&"object"!==w.default(t[r])||(n[r]=e(t[r])));return n},exports.useCategoriesStore=ot,exports.useConfigStore=xe,exports.useDetailing=function(){return ct().state},exports.useDetailingStore=ct,exports.useFilesStore=Ze,exports.useLayoutStore=Pe,exports.useParams=ge,exports.useParamsStore=ye,exports.useSchemaStore=Le,exports.useSystemStore=Ke,exports.useValidations=function(){return Be().state},exports.useValidationsStore=Be,exports.waitForWindowProp=le,exports.watchLocalStorage=ue; |
@@ -32,2 +32,6 @@ 'use strict'; | ||
window.setParameters = function (text) { | ||
window.params = JSON.parse(text); | ||
}; | ||
var ParamStore = /*#__PURE__*/function () { | ||
@@ -124,3 +128,3 @@ function ParamStore() { | ||
store = useParamsStore(); | ||
console.log(store.state.account); // for testing | ||
console.log('[@pitcher/core]: account', store.state.account); // for testing | ||
@@ -127,0 +131,0 @@ if (!process.env.VUE_APP_PARAMS) { |
@@ -20,2 +20,6 @@ import _regeneratorRuntime from '@babel/runtime/regenerator'; | ||
window.setParameters = function (text) { | ||
window.params = JSON.parse(text); | ||
}; | ||
var ParamStore = /*#__PURE__*/function () { | ||
@@ -112,3 +116,3 @@ function ParamStore() { | ||
store = useParamsStore(); | ||
console.log(store.state.account); // for testing | ||
console.log('[@pitcher/core]: account', store.state.account); // for testing | ||
@@ -115,0 +119,0 @@ if (!process.env.VUE_APP_PARAMS) { |
{ | ||
"name": "@pitcher/core", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "Pitcher Ti helpers & Core features to integrate Ti app", | ||
@@ -37,3 +37,3 @@ "author": "Pitcher AG", | ||
"sideEffects": false, | ||
"gitHead": "aaf780d899d15afe7864e3a24bc4f5141a40678f" | ||
"gitHead": "17fe734130aa593f8cbe2d8215ef1e90e5daa720" | ||
} |
@@ -306,3 +306,4 @@ import UI_CONSTANTS from '../constants' | ||
const hasSameName = currentSlide.chapterName === lastAddedChapter?.nameV | ||
const bothHasNameAsDash = currentSlide.chapterName === emptyChapterName && lastAddedChapter?.nameV === emptyChapterName | ||
const bothHasNameAsDash = | ||
currentSlide.chapterName === emptyChapterName && lastAddedChapter?.nameV === emptyChapterName | ||
@@ -309,0 +310,0 @@ if (lastAddedChapter && hasSameName && (hasSameID || (!hasSameID && bothHasNameAsDash))) { |
@@ -15,2 +15,6 @@ import { createStore } from './store' | ||
window.setParameters = function(text) { | ||
window.params = JSON.parse(text) | ||
} | ||
class ParamStore { | ||
@@ -94,3 +98,3 @@ id = 'params' | ||
console.log(store.state.account) | ||
console.log('[@pitcher/core]: account', store.state.account) | ||
@@ -97,0 +101,0 @@ // for testing |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
473325
10307