"use strict";define("shift4tress/adapters/accessory",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/app-record",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("businessEntities/"+l+"/appRecords"),a&&t&&d.push(encodeURIComponent(a.record.get("id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},pathForType:function(){return"roleBusinessEntities"}})}),define("shift4tress/adapters/application",["exports","ember-data"],function(e,t){e["default"]=t["default"].RESTAdapter.extend({namespace:"",host:function(){return this.get("apiPath.accountApiUrl")}.property(),setHeaders:function(){this.set("headers",{clientId:3,"shift4-rest-response-envelope-version":1,"shift4-rest-request-envelope-version":1,Authorization:'Token token="'+App.get("currentSession.accessToken")+'"'})}.observes("App.currentSession.accessToken"),headers:function(){return{clientId:3,"shift4-rest-response-envelope-version":1,"shift4-rest-request-envelope-version":1,Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'}}.property("App.currentSession.accessToken"),ajax:function(e,t,a){var n=this;return new Ember.RSVP.Promise(function(r,l){var d=n.ajaxOptions(e,t,a);d.success=function(e,t,a){e=n.ajaxSuccess(a,e),Ember.run(null,r,e)},d.error=function(e,t,a){Ember.run(null,l,n.ajaxError(e,e.responseText))},"PUT"!==d.type&&"DELETE"!==d.type||(d.beforeSend=function(e){var a=n.get("headers");e.setRequestHeader("X-HTTP-Method-Override",t),e.setRequestHeader("clientId",a.clientId),e.setRequestHeader("Authorization",a.Authorization),e.setRequestHeader("shift4-rest-response-envelope-version",1),e.setRequestHeader("shift4-rest-request-envelope-version",1)},d.type="POST"),Ember.$.ajax(d)},"DS: RESTAdapter#ajax "+t+" to "+e)},buildURL:function(e,t,a,n,r){if("undefined"==typeof e&&(e=""),r){if(r.id&&(t=r.id,delete r.id),r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}}else var l=null;var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);if(!t)switch(Em.String.singularize(s)){case"group":d.push("organizations/"+(l?l:App.get("currentSession.user.selectedBusinessEntity.id")));break;case"role":d.push("organizations/"+(l?l:App.get("currentSession.user.selectedBusinessEntity.id")));break;case"user":d.push("organizations/"+(l?l:App.get("currentSession.user.selectedBusinessEntity.id")));break;case"pendingInfo":l&&d.push("users/"+encodeURIComponent(l))}switch(a&&a.record&&a.type.eachRelationship(function(r){var l=Em.String.camelize(Em.get(a.type,"relationshipsByName").get(r).type);switch(l){case"group":switch(Em.String.camelize(e)){case"groupBusinessEntity":t=a.record.get("businessEntity.id"),d.push(Em.String.pluralize(l)+"/"+a.record.get(r+".id"));break;case"groupRole":t=a.record.get("role.id"),d.push(Em.String.pluralize(l)+"/"+a.record.get(r+".id"));break;case"groupUser":t=a.record.get("user.id"),d.push(Em.String.pluralize(l)+"/"+a.record.get(r+".id"))}break;case"user":switch(Em.String.camelize(e)){case"userGroup":t=a.record.get("businessEntity.id"),d.push(Em.String.pluralize(l)+"/"+a.record.get(r+".id"));break;case"userRoleBusinessEntity":t=a.record.get("role.id"),d.push(Em.String.pluralize(l)+"/"+a.record.get(r+".id"))}break;case"vtSetting":switch(Em.String.camelize(e)){case"vtGeneral":case"vtTax":case"vtTheme":case"vtReceipt":case"vtTender":d.push("merchants/"+a.record.get("setting.merchant.id"))}break;case"taxProfile":switch(Em.String.camelize(e)){case"taxProfileRate":"deleteRecord"===n?d.push("merchants/"+a.record.get("taxProfile.merchant.id")+"/taxProfiles/"+a.record.get("taxProfile.id")):d.push("merchants/"+a.record.get("taxProfile.merchant.id"))}break;case"vtMerchant":switch(Em.String.camelize(e?e:a.constructor.modelName)){case"item":case"shelfCategoryItem":case"shelfCategory":case"modifier":case"modifierSet":case"vtCampaign":case"itemModifierSet":case"itemModifier":case"taxProfile":case"taxProfileRate":case"modifierSetModifier":case"accessory":case"discount":case"pmsSetting":d.push("merchants/"+a.record.get(r+".id"));break;case"integrationSetting":d.push("merchants/"+a.record.get(r+".id"))}}}),s){case"userGroup":d.push("groups");break;case"userRoleBusinessEntity":case"groupRole":d.push("roles");break;case"groupBusinessEntity":d.push("businessEntities");break;case"groupUser":d.push("users");break;case"vtGeneral":d.push("settings/general"),a.id=null,t=null;break;case"vtTax":d.push("settings/tax"),a.id=null,t=null;break;case"vtTender":d.push("settings/tender"),a.id=null,t=null;break;case"vtTheme":d.push("settings/theme"),a.id=null,t=null;break;case"vtReceipt":d.push("settings/receipt"),a.id=null,t=null;break;case"vtCampaign":d.push("campaign"),a.id=null,t=null;break;case"pmsSetting":d.push("pmssettings"),a.id=null,t=null;break;case"integrationSetting":d.push("integrationsettings"),a.id=null;break;case"discountRole":d.push("permissions/roles?permissionLevel=Enabled&permissionKey=Discounts");break;default:d.push(this.pathForType(s))}return t&&!Ember.isArray(t)?(d.push(encodeURIComponent(t)),"undefined"!=typeof a&&null!==a&&a.hasOwnProperty("newTaxprofileId")&&d.push("?newTaxProfileId="+a.record.get("newTaxProfileId"))):"undefined"!=typeof a&&null!==a&&(null!==a.id&&"undefined"!=typeof a.id?d.push(encodeURIComponent(a.id)):a.record&&null!==a.record.id&&a.record.id===Number(a.record.id)&&d.push(encodeURIComponent(a.record.id))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},ajaxError:function(e){this._super();var a=e,n=[{detail:"an adapter error has occured"}];if(401===e.status)delete localStorage.authCode,delete sessionStorage.accessToken,$("#progressHudOverlay").hide(),$("#session-modal").modal("show");else{if(500===e.status)return n=e.responseJSON.response?[{detail:e.responseJSON.response.messages[0]}]:e.responseJSON.Message?[{detail:e.responseJSON.Message}]:[{detail:e.responseText}],new t["default"].InvalidError(n);if(400===e.status||403===e.status||404===e.status||409===e.status||422===e.status)return n=e.responseJSON.response?[{detail:e.responseJSON.response.messages[0]}]:e.responseJSON.Message?[{detail:e.responseJSON.Message}]:[{detail:e.responseText}],new t["default"].InvalidError(n);localStorage.isDev?alert("Request Error: "+e.message):alert("There was an error making a network request. Please try again.")}return a},ajaxSuccess:function(e,t){return App.get("sessionTimeoutInterval")&&(clearInterval(App.get("sessionTimeoutInterval")),App.set("sessionTimeoutInterval",setInterval(function(){Big(Big((App.currentSession.get("expiresAt").getTime()-Date.now())/1e3).toFixed(0))<=300&&($(".alert").alert("close"),$("#inactivityModal").on("show.bs.modal",function(){clearInterval(App.get("sessionTimeoutInterval"))}),$("#inactivityModal").modal("show"))},1e3)),Ember.run.later(function(){App.currentSession.set("expiresAt",new Date(Date.now()+12e5))})),t},pathForType:function(e){return"vtMerchants"===e?"merchants":"vtCategories"===e?"shelfCategories":Ember.String.pluralize(e)}})}),define("shift4tress/adapters/bill-to-account-business-entity-assignment",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/bill-to-account-contact-assignment",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/bill-to-account",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/billable-activity-rate",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/billable-activity",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/billable-product",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/billing-config",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/billing-cycle",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/business-entity-settings-copy-request",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiUrl")}),buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity").id;else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push("businessEntities/"+l+"/"+this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("businessEntities/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/business-entity-theme",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity").id;else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push("businessEntities/"+l+"/"+this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("businessEntities/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/business-entity",["exports","shift4tress/adapters/application"],function(e,t){e["default"]=t["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiUrl")}),namespace:Ember.computed("apiPath",function(){return this.get("apiPath.coreSecurityApiPath")}),buildURL:function(e,t,a,n,r){if(r)var l=r.parentBusinessEntityId;var d,i=[],o=Ember.get(this,"host"),s=this.urlPrefix();if("queryRecord"===n)delete r.parentBusinessEntityId,e&&(d=this.pathForType(e),d&&i.push(d+"/"+l));else{if("query"!==n)return this._super(e,t,a,n,r);e&&i.push("businessentitysummaries")}return t&&i.push(encodeURIComponent(t)),s&&i.unshift(s),i=i.join("/"),!o&&i&&"/"!==i.charAt(0)&&(i="/"+i),i},pathForType:function(e){var t=Ember.String.camelize(e),a=Ember.String.pluralize(t);return a}})}),define("shift4tress/adapters/company",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/contact",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/controller-failure",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")}),pathForType:function(e){return"controllerfailures"}})}),define("shift4tress/adapters/dba",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({namespace:"",host:config.paymentApiUrl,pathForType:function(e){return"dba"}})}),define("shift4tress/adapters/default-email-template",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({})}),define("shift4tress/adapters/discount",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("merchant").id)var l=a.record.get("merchant.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("merchants/"+l+"/discounts"),a&&t&&d.push(encodeURIComponent(a.record.get("id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/email-template",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push("businessEntities/"+l+"/"+this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("businessEntities/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/ephemeral-user",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiUrl")}),buildURL:function(e,t,a,n,r){if(r&&r.ephemeralUserId){var l=r.ephemeralUserId;delete r.ephemeralUserId}var d=App.get("currentSession.user.selectedBusinessEntity.id"),i=[],o=Ember.get(this,"host"),s=this.urlPrefix(),c=Em.String.camelize(e);return"queryRecord"==n?i.push("businessentities/"+d+"/"+this.pathForType(c)+"/"+l):i.push("businessentities/"+d+"/"+this.pathForType(c)),t&&i.push(encodeURIComponent(t)),s&&i.unshift(s),i=i.join("/"),!o&&i&&(i="/"+i),i}})}),define("shift4tress/adapters/external-integration",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/group-role-business-entity",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r){if(r.groupId){var l=r.groupId;delete r.groupId}}else if(a.record&&a.record.get("group").id)var l=a.record.get("group").id;var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("groups/"+l+"/roleBusinessEntities"),a&&t&&d.push(encodeURIComponent(a.record.get("role.id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},pathForType:function(){return"roleBusinessEntities"}})}),define("shift4tress/adapters/group-user",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r){if(r.groupId){var l=r.groupId;delete r.groupId}}else if(a.record&&a.record.get("group.id"))var l=a.record.get("group.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("groups/"+l+"/users"),a&&t&&d.push(encodeURIComponent(a.record.get("user.id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/integration-setting",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("merchant").id)var l=a.record.get("merchant.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("merchants/"+l+"/integrationSettings"),a&&t&&d.push(encodeURIComponent(a.record.get("id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/invoice-download-token",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/invoice",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/item-modifier-set",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/item-modifier",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/item",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/modifier-set-modifier",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/modifier-set",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"modifierSets"}})}),define("shift4tress/adapters/modifier",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"modifiers"}})}),define("shift4tress/adapters/organization",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({})}),define("shift4tress/adapters/password-setting",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiUrl")}),buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity").id;else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push("businessEntities/"+l+"/"+this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("businessEntities/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/payment-merchant",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({namespace:"",host:config.paymentApiUrl,pathForType:function(e){return"merchants"}})}),define("shift4tress/adapters/payment-method-type",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/payment-method",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/payments-by-tender-type",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"reports/paymentsbytendertype"}})}),define("shift4tress/adapters/pending-info",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"pendingInfo"},buildURL:function(e,t,a,n,r){if(r){if(r.userId){var l=r.userId;delete r.userId}}else if(a.record&&a.record.get("user.id"))var l=a.record.get("user").id;var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("users/"+l+"/pendingInfo"),a&&t&&d.push(encodeURIComponent(a.record.get("user.id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/permission-mask",["exports","shift4tress/adapters/application"],function(e,t){e["default"]=t["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiUrl")}),buildURL:function(e,t,a){var n=this.get("host")+"/"+this.get("namespace")+"users/"+App.get("currentSession.user.id")+"/permissionMasks";return n}})}),define("shift4tress/adapters/pms-setting",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/product-billable-activity",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/property-management-system",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("merchant").id)var l=a.record.get("merchant.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("merchants/"+l+"/propertyManagementSystems"),a&&t&&d.push(encodeURIComponent(a.record.get("id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/provisioned-activity",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/provisioned-business-entity-theme",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity").id;else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push("businessEntities/"+l+"/"+this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("businessEntities/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/rate-profile-business-entity-assignment",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/rate-profile",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.billingApiUrl")})})}),define("shift4tress/adapters/role-permission",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.roleId)l=r.roleId,delete r.roleId;else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("roles/"+l+"/permissions"),a&&t&&d.push(encodeURIComponent(a.record.get("id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},pathForType:function(){return"roleBusinessEntities"}})}),define("shift4tress/adapters/role",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push(this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("organizations/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/sales-by-card-type",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"reports/salesbycardtype"}})}),define("shift4tress/adapters/shelf-category-item",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/shelf-category",["exports","shift4tress/adapters/application"],function(e,t){e["default"]=t["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),buildURL:function(e,t,a,n,r){var l;if(e=Em.String.camelize(e),"deleteRecord"===n)l=this.get("host")+"/merchants/"+a.record.get("merchant.id")+"/"+this.pathForType(e)+"/"+a.record.get("id");else{if("createRecord"!==n)return this._super(e,t,a,n,r);l=this.get("host")+"/merchants/"+a.record.get("merchant.id")+"/"+this.pathForType(e)}return l},pathForType:function(e){return this._super(e)}})}),define("shift4tress/adapters/sso-general-setting",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity").id;else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push("businessEntities/"+l+"/"+this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("businessEntities/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/sso-page",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("businessEntity").id)var l=a.record.get("businessEntity").id;else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);if(t){d.push("businessEntities/"+l+"/"+this.pathForType(s));var c=a.record.get("pageTypeId");if(c)d.push(encodeURIComponent(c));else if("string"==typeof t){var p=t.split(":");if(3==p.length){var u=t.split(":")[2];d.push(encodeURIComponent(u))}else console.log("\n\nssoPage 'id' is not valid: "+String(t))}else console.log("\n\nssoPage 'id' is not valid: "+String(t))}else d.push("businessEntities/"+l+"/"+this.pathForType(s));return o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/tax-profile-amounts-by-merchant",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"reports/taxprofileamountsbymerchant"}})}),define("shift4tress/adapters/tax-profile-rate",["exports","ember","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:t["default"].computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),buildURL:function(e,t,a,n,r){var l;return l="deleteRecord"===n?this.get("host")+"/merchants/"+a.record.get("taxProfile.merchant.id")+"/taxProfiles/"+a.record.get("taxProfile.id")+"/"+this.pathForType(e)+"/"+a.record.get("taxProfile.id"):"updateRecord"===n?this.get("host")+"/merchants/"+a.record.get("taxProfile.merchant.id")+"/"+this.pathForType(e)+"/"+a.record.get("taxProfile.id"):this.get("host")+"/merchants/"+a.record.get("taxProfile.merchant.id")+"/"+this.pathForType(e)},pathForType:function(e){var a=t["default"].String.camelize(e),n=t["default"].String.pluralize(a);return n}})}),define("shift4tress/adapters/tax-profile",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),buildURL:function(e,t,a,n,r){if(r){if(r.merchantId){var l=r.merchantId;delete r.merchantId}}else if(a.record&&a.record.get("merchant.id"))var l=a.record.get("merchant.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("merchants/"+l+"/taxProfiles"),a&&t&&(d.push(encodeURIComponent(a.id)),a.record.get("newTaxProfileId")&&d.push("?newTaxProfileId="+a.record.get("newTaxProfileId"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},pathForType:function(e){return"taxProfiles"}})}),define("shift4tress/adapters/transaction-by-date",["exports"],function(e){}),define("shift4tress/adapters/transactions-by-sale-date-time",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){ e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"reports/transactionsbysaledate"}})}),define("shift4tress/adapters/unknown-tenders-by-sale-date",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"reports/unknownTendersBySaleDate"}})}),define("shift4tress/adapters/user-group",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r){if(r.userId){var l=r.userId;delete r.userId}}else if(a.record&&a.record.get("user.id"))var l=a.record.get("user.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("users/"+l+"/groups"),a&&t&&d.push(encodeURIComponent(a.record.get("group.id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/user-permission",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r)if(r.userId){var l=r.userId;delete r.userId}else var l=App.get("currentSession.user.id");else var l=App.get("currentSession.user.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("users/"+l+"/permissions"),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},pathForType:"userPermissions"})}),define("shift4tress/adapters/user-profile",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiUrl")})})}),define("shift4tress/adapters/user-role-business-entity",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({buildURL:function(e,t,a,n,r){if(r){if(r.userId){var l=r.userId;delete r.userId}}else if(a.record&&a.record.get("user.id"))var l=a.record.get("user.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return a&&t?(d.push("users/"+l+"/roles"),d.push(encodeURIComponent(a.record.get("role.id")))):d.push("users/"+l+"/roleBusinessEntities"),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d},pathForType:function(){return"roleBusinessEntities"}})}),define("shift4tress/adapters/user-session",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiSsoUrl")}),buildURL:function(e,t,a,n,r){var l;return l="deleteRecord"===n?this.get("host")+"/sessionTokens/"+a.record.get("sessionToken"):this.get("host")+"/sessionTokens"}})}),define("shift4tress/adapters/user",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.coreApiUrl")}),buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix(),s=Em.String.camelize(e);return t?(d.push(this.pathForType(s)),d.push(encodeURIComponent(t))):d.push("businessEntities/"+l+"/"+this.pathForType(s)),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/vt-campaign",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"vtCampaigns"},buildURL:function(e,t,a,n,r){if(r)if(r.parentBusinessEntityId){var l=r.parentBusinessEntityId;delete r.parentBusinessEntityId}else var l=App.get("currentSession.user.selectedBusinessEntity.id");else if(a.record.get("merchant").id)var l=a.record.get("merchant.id");else var l=App.get("currentSession.user.selectedBusinessEntity.id");var d=[],i=Ember.get(this,"host"),o=this.urlPrefix();Em.String.camelize(e);return d.push("merchants/"+l+"/campaign"),a&&t&&d.push(encodeURIComponent(a.record.get("id"))),o&&d.unshift(o),d=d.join("/"),!i&&d&&(d="/"+d),d}})}),define("shift4tress/adapters/vt-general",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"general"}})}),define("shift4tress/adapters/vt-merchant",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"merchants"}})}),define("shift4tress/adapters/vt-receipt",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"receipt"}})}),define("shift4tress/adapters/vt-role",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")})})}),define("shift4tress/adapters/vt-tender",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"tender"}})}),define("shift4tress/adapters/vt-theme",["exports","ember-data","shift4tress/adapters/application"],function(e,t,a){e["default"]=a["default"].extend({host:Ember.computed("apiPath",function(){return this.get("apiPath.vtApiUrl")}),pathForType:function(e){return"theme"}})}),define("shift4tress/app",["exports","ember","shift4tress/resolver","ember-load-initializers","shift4tress/config/environment"],function(e,t,a,n,r){var l=void 0;t["default"].MODEL_FACTORY_INJECTIONS=!0,l=t["default"].Application.extend({modulePrefix:r["default"].modulePrefix,podModulePrefix:r["default"].podModulePrefix,Resolver:a["default"]}),(0,n["default"])(l,r["default"].modulePrefix),e["default"]=l}),define("shift4tress/components/alphanumeric-only",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({keyPress:function(e){0==e.which||8==e.which||(e.which>=48&&e.which<=57||e.which>=65&&e.which<=90||e.which>=97&&e.which<=122)&&e.target.value.length!=e.target.maxLength||e.preventDefault()}})}),define("shift4tress/components/app-grid-image-upload",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({type:"file",accept:"image/*",capture:"filesystem",change:function(e){var t=e.target;if(t.files&&t.files[0]){var a=this,n=new FileReader;if(n.onload=function(e){var t=new Image;t.src=e.target.result,t.onload=function(){if(this.width>=100&&this.height>=100&&this.width<=300&&this.height<=150){var e=$("#gridImageUpload");e.closest(".form-group").find("#gridImageUpload-error").hide(),a.set("gridImageUpload",t.src),a.set("uploadType",r)}else l=$("#GridImageUploadForm").validate(),l.showErrors({gridImageUpload:"Image must be between 100x100 px and 300x150 px."}),a.set("value",null),a.set("gridImageUpload",null)},t.onerror=function(){var e=$("#GridImageUploadForm").validate();e.showErrors({gridImageUpload:"Invalid file, please upload a valid image."}),a.set("value",null),a.set("gridImageUpload",null)}},n.onerror=function(){alert("Unable to read the file, please check that the file is not corrupt or already in use.")},t.files[0].size<=18e4&&("image/png"===t.files[0].type||"image/jpeg"===t.files[0].type||"image/gif"===t.files[0].type)){switch(t.files[0].type){case"image/png":var r="png";break;case"image/jpeg":var r="jpg";break;case"image/gif":var r="gif"}n.readAsDataURL(t.files[0])}else{var l=$("#GridImageUploadForm").validate();l.showErrors({gridImageUpload:"Image must be a PNG, JPG, or GIF file less than 180 KB in size."}),a.set("value",null),a.set("gridImageUpload",null)}}else this.set("gridImageUpload",null)}})}),define("shift4tress/components/app-version",["exports","ember-cli-app-version/components/app-version","shift4tress/config/environment"],function(e,t,a){var n=a["default"].APP.name,r=a["default"].APP.version;e["default"]=t["default"].extend({version:r,name:n})}),define("shift4tress/components/async-button",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({buttonText:"Save",tagName:"",isLoading:!1})}),define("shift4tress/components/be-tree-leaf",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({tagName:"",store:t["default"].inject.service(),navigation:t["default"].inject.service(),router:t["default"].inject.service("-routing"),didNavigate:t["default"].on("init",t["default"].observer("router.currentRouteName",function(){var e=this.get("businessEntity"),t=this.get("navigation").checkContext(e),a=this.get("navigation").checkPermissions(e),n=this.get("router.currentRouteName"),r=-1!=n.indexOf("profile");t&&a||r?$("#"+e.get("id")).removeClass("jstree-disabled"):$("#"+e.get("id")).addClass("jstree-disabled")})),actions:{selectBE:function(e){this.get("navigation").selectBE(e)}}})}),define("shift4tress/components/change-parent",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({model:null,businessEntities:null,resetSelectedParent:!1,actions:{cancelChangeParent:function(){this.get("selectedParent")&&(this.set("selectedParent.radio",!1),this.get("selectedParent.children").forEach(function(e){e.set("radio",!1)})),this.get("model.parentBusinessEntity")?this.set("selectedParent",this.get("model.parentBusinessEntity")):this.set("selectedParent",null)},selectParent:function(e){function t(a){var n=e?a.get("id")==e.get("id"):!1;a.set("radio",n),a.get("children").forEach(function(a){var n=e?a.get("id")==e.get("id"):!1;a.set("radio",n),t(a)})}var a=this.get("businessEntities");t(a),this.set("selectedParent",e)},save:function(){this.set("model.parentBusinessEntity",this.get("selectedParent")),this.sendAction(),this.get("selectedParent")&&(this.set("selectedParent.radio",!1),this.get("selectedParent.children").forEach(function(e){e.set("radio",!1)}))}},didInsertElement:function(){var e=this;$("#changeParent").on("shown.bs.modal",function(){e.get("resetSelectedParent")&&!e.get("model.parentBusinessEntity")?e.send("selectParent"):e.send("selectParent",e.get("model.parentBusinessEntity"))}),$("#changeParent").on("hidden.bs.modal",function(){e.send("selectParent")})}})}),define("shift4tress/components/data-table",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({tagName:"table",classNamesBindings:["class"],"class":t["default"].computed("class",function(){return this.get("class")}),selectedRows:[],didInsertElement:function(){this.reinitalizeDataTable()},reinitalizeDataTable:function(){var e=this.get("model"),t=this.get("computedPropForTable"),a=this.get("priority"),n=[];if(a)for(var r=a.length-1;r>=0;r--){var l={responsivePriority:a[r],targets:r};n.push(l)}var d=this,i=[];e.forEach(function(e){var a={};a=e.toJSON();for(var n=t.length-1;n>=0;n--){var r=e.get(t[n]);a[t[n]]=r}i.push(a)}),$("#"+d.get("elementId")).DataTable({responsive:!0,columnDefs:n,aoColumns:d.get("columns"),autoWidth:!1,pageLength:20,data:i,language:{lengthMenu:' records per page'}}),$("#"+d.get("elementId")+" tbody").on("click","tr",function(){var e=$("#"+d.get("elementId")).DataTable().row(this).data();d.sendAction("details",e.id)})}})}),define("shift4tress/components/ei-password",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({focusIn:function(){this.set("oldPwd",this.get("value")),this.set("value","")},focusOut:function(){this.get("value")||this.set("value",this.get("oldPwd"))}})}),define("shift4tress/components/error-substate",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({navigation:t["default"].inject.service(),router:t["default"].inject.service("-routing"),currentRouteDesc:function(){var e=this.get("router.router.currentRouteName").replace(".error","").split(".").get("lastObject").split(/(?=[A-Z])/).join(" "),a=e.slice(-1);return"s"!=a?t["default"].String.capitalize(e+" does not"):t["default"].String.capitalize(e+" do not")}.property("router.router.currentRouteName","navigation.permissions.routeContext"),currentRouteDescNameOnly:function(){switch(this.get("router.router.currentRouteName")){case"organization.error":return"Accounts";case"vt4.error":return"VT4";case"settings.error":return"VT4 Settings";case"general.error":return"General";case"taxProfiles.error":return"Tax";case"memberAccounts.error":return"Member Accounts";case"paymentsReport.error":return"Payments";case"transactionsReport.error":return"Transactions";case"taxProfilesReport.error":return"Tax";case"exportReport.error":return"Export";case"BETheme.error":return"Theme";case"applicationTheme.error":return"Theme";case"emailTheme.error":return"Emails";case"welcomeTemplate.error":return"Welcome";case"forgotPassword.error":return"'Forgot Password'";case"forgotPassword.error":return"'Forgot Username'";case"invoiceNotification.error":return"'Invoice Notification'";case"reportsTemplate.error":return"Reports";case"ssoTheme.error":return"'Single Sign-On'";case"generalTemplate.error":return"General";case"landingTemplate.error":return"Landing";case"loginTemplate.error":return"Login";case"security.error":return"Security";case"passwordSettings.error":return"Password Settings";default:var e=this.get("router.router.currentRouteName").replace(".error","").replace("management.","");return t["default"].String.capitalize(e)}}.property("router.router.currentRouteName","navigation.permissions.routeContext"),currentRouteDescWithNameOnly:function(e){return e?this.get("currentRouteDescNameOnly"):this.get("currentRouteDesc")}})}),define("shift4tress/components/form-config",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({didInsertElement:function(){$("form.newvalidation").validate({focusInvalid:!1,onkeyup:function(e,t){9===t.which&&""===this.elementValue(e)||(e.name in this.submitted||e==this.lastElement)&&this.element(e)}}),$("form").each(function(){$("#"+this.id).validate({focusInvalid:!1,onkeyup:function(e,t){9===t.which&&""===this.elementValue(e)||(e.name in this.submitted||e==this.lastElement)&&this.element(e)}})})}})}),define("shift4tress/components/has-no-permission",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({hasNoPermission:function(){return!App.currentSession.get("user").hasPermission(this.get("permAction"),this.get("permKey"),this.get("targetBusinessEntity"))}.property("permAction","permKey","targetBusinessEntity")})}),define("shift4tress/components/has-permission",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({hasPermission:function(){return App.currentSession.get("user").hasPermission(this.get("permAction"),this.get("permKey"),this.get("targetBusinessEntity"))}.property("permAction","permKey","targetBusinessEntity")})}),define("shift4tress/components/high-charts",["exports","ember","shift4tress/mixins/high-charts-theme"],function(e,t,a){e["default"]=t["default"].Component.extend(a["default"],{classNames:["highcharts-wrapper"],content:void 0,chartOptions:void 0,chart:null,buildOptions:Em.computed("chartOptions","content.@each.isLoaded",function(){var e,t,a;return t=this.getWithDefault("chartOptions",{}),e=this.get("content.length")?this.get("content"):[{id:"noData",data:0,color:"#aaaaaa"}],a={series:e},Em.merge(a,t)}),_renderChart:function(){this.drawLater(),this.buildTheme()}.on("didInsertElement"),contentDidChange:Em.observer("content.@each.isLoaded",function(){var e;if(this.get("content")&&this.get("chart"))return e=this.get("chart"),this.get("content").forEach(function(t,a){var n;return null!=(n=e.get("noData"))&&n.remove(),e.series[a]?e.series[a].setData(t.data):e.addSeries(t)})}),drawLater:function(){t["default"].run.scheduleOnce("afterRender",this,"draw")},draw:function(){var e;e=this.get("buildOptions"),this.set("chart",$("#"+this.elementId).highcharts(e).highcharts())},_destroyChart:function(){this._super(),this.get("chart").destroy()}.on("willDestroyElement")})}),define("shift4tress/components/image-display",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({layoutName:"image-display",viewingDetails:function(){var e=this.get("details");return!!e}.property("details"),isItem:function(){var e=this.get("type");return!!(e="cat")}.property("type"),isCategory:function(){var e=this.get("type");return!!(e="item")}.property("type")})}),define("shift4tress/components/image-upload",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({type:"file",accept:"image/*",capture:"filesystem",change:function(e){var t=e.target;if(t.files&&t.files[0]){var a=this,n=new FileReader;if(n.onload=function(e){var t=new Image;t.src=e.target.result,t.onload=function(){if(this.width>=100&&this.height>=100&&this.width<=300&&this.height<=300){var e=$("#imageUpload");e.closest(".form-group").find("span:visible").hide(),a.set("upload",t.src),a.set("uploadType",r)}else l=$("#ImageUploadForm").validate(),l||(l=$("#addItemForm").validate()),l.showErrors({imageUpload:"Image must be between 100x100 px and 300x300 px."}),a.set("value",null),a.set("upload",null)},t.onerror=function(){var e=$("#ImageUploadForm").validate();e.showErrors({imageUpload:"Invalid file, please upload a valid image."}),a.set("value",null),a.set("upload",null)}},n.onerror=function(){alert("Unable to read the file, please check that the file is not corrupt or already in use.")},t.files[0].size<=24e4&&("image/png"==t.files[0].type||"image/jpeg"==t.files[0].type||"image/gif"==t.files[0].type)){switch(t.files[0].type){case"image/png":var r="png";break;case"image/jpeg":var r="jpg";break;case"image/gif":var r="gif"}n.readAsDataURL(t.files[0])}else{var l=$("#ImageUploadForm").validate();l||(l=$("#addItemForm").validate()),l.showErrors({imageUpload:"Image must be a PNG, JPG, or GIF file less than 240 KB in size."}),a.set("value",null),a.set("upload",null)}}else a.set("upload",null)}})}),define("shift4tress/components/ip-address",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({keyPress:function(e){0==e.which||8==e.which||(46==e.which||e.which>=48&&e.which<=57)&&e.target.value.length!=e.target.maxLength||e.preventDefault()}})}),define("shift4tress/components/ip-port",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({keyPress:function(e){0==e.which||8==e.which||e.which>=48&&e.which<=57&&e.target.value.length!=e.target.maxLength||e.preventDefault()}})}),define("shift4tress/components/link-li",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({tagName:"li",classNameBindings:["active"],active:function(){return this.get("childViews").anyBy("active")}.property("childViews.@each.active")})}),define("shift4tress/components/logo-upload",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({type:"file",accept:"image/*",capture:"filesystem",change:function(e){var t=e.target;if(t.files&&t.files[0]){var a=this,n=new FileReader;if(n.onload=function(e){var t=new Image;t.src=e.target.result,t.onload=function(){if(this.width>=100&&this.height>=100&&this.width<=300&&this.height<=150){var e=$("#imageUpload");e.closest(".form-group").find("#imageUpload-error").hide(),a.set("upload",t.src),a.set("uploadType",r)}else{var n=$("#ImageUploadForm").validate();n.showErrors({imageUpload:"Image must be between 100x100 px and 300x150 px."}),a.set("value",null),a.set("upload",null)}},t.onerror=function(){l=$("#ImageUploadForm").validate(),l.showErrors({imageUpload:"Invalid file, please upload a valid image."}),a.set("value",null),a.set("upload",null)}},n.onerror=function(){alert("Unable to read the file, please check that the file is not corrupt or already in use.")},t.files[0].size<=18e4&&("image/png"==t.files[0].type||"image/jpeg"==t.files[0].type||"image/gif"==t.files[0].type)){switch(t.files[0].type){case"image/png":var r="png";break;case"image/jpeg":var r="jpg";break;case"image/gif":var r="gif"}n.readAsDataURL(t.files[0])}else{var l=$("#ImageUploadForm").validate();l.showErrors({imageUpload:"Image must be a PNG, JPG, or GIF file less than 180 KB in size."}),a.set("value",null),a.set("upload",null)}}else a.set("upload",null)}})}),define("shift4tress/components/merchant-display",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({onInsert:function(){t["default"].run.schedule("afterRender",this,function(){var e=this;$("#daterangecal").click(function(){$("#daterangepicker").click()}),$("#daterangepicker").on("apply.daterangepicker",function(t,a){e.set("daterange",a.startDate.format("MM/DD/YYYY")+" - "+a.endDate.format("MM/DD/YYYY"))}),$("#daterangepicker").daterangepicker({opens:"left",maxDate:moment(),autoUpdateInput:!0,applyClass:"btn-primary",ranges:{Today:[moment(),moment()],Yesterday:[moment().subtract(1,"days"),moment().subtract(1,"days")],"Last 7 Days":[moment().subtract(6,"days"),moment()],"Last 30 Days":[moment().subtract(29,"days"),moment()],"This Month":[moment().startOf("month"),moment().endOf("month")],"Last Month":[moment().subtract(1,"month").startOf("month"),moment().subtract(1,"month").endOf("month")]}})})}.on("init")})}),define("shift4tress/components/models-select",["exports","ember-models-table/components/models-select"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t["default"]}})}),define("shift4tress/components/models-table-server-paginated",["exports","ember-models-table/components/models-table-server-paginated"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t["default"]}})}),define("shift4tress/components/models-table",["exports","ember-models-table/components/models-table"],function(e,t){e["default"]=t["default"]}),define("shift4tress/components/no-script",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({keyPress:function(e){var t=[32,0,8,43,123,45,95,46,44,63,39,58,33,35,36,40,41,34,125,47];t.contains(e.which)||(e.which>=48&&e.which<=57||e.which>=65&&e.which<=90||e.which>=97&&e.which<=122)&&e.target.value.length!=e.target.maxLength||e.preventDefault()}})}),define("shift4tress/components/numeric-only",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({keyPress:function(e){0==e.which||8==e.which||e.which>=48&&e.which<=57&&e.target.value.length!=e.target.maxLength||e.preventDefault()}})}),define("shift4tress/components/org-tree",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({classNames:["panel-scroll"],actions:{toggleExpand:function(e){e.get("isExpanded")?e.toggleProperty("isExpanded"):e.get("children.length")>0?e.toggleProperty("isExpanded"):(e.set("loadingChildren",!0),this.get("model").store.queryRecord("businessEntity",{id:e.get("id"),fullTree:!1}).then(function(){e.toggleProperty("isExpanded"),e.set("loadingChildren",!1)}))},goToBE:function(e){var t=this.get("permission"),a=this.get("permAction");if(App.currentSession.get("user").hasPermission(a,t,e)){var n=this.get("location");"management"==n?this.container.lookup("controller:application").transitionToRoute("organization.index",e):"reports"==n?this.container.lookup("controller:application").transitionToRoute("merchant.index",e):"paymentReport"==n?this.container.lookup("controller:application").transitionToRoute("paymentsReport",e):"transactionsReport"==n?this.container.lookup("controller:application").transitionToRoute("transactionsReport",e):"exportReport"==n?this.container.lookup("controller:application").transitionToRoute("exportReport",e):"taxProfilesReport"==n&&this.container.lookup("controller:application").transitionToRoute("taxProfilesReport",e)}}}})}),define("shift4tress/components/profile-display",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Component.extend({onInsert:function(){t["default"].run.schedule("afterRender",this,function(){if(App.get("currentSession.user.passwordReset")&&_alert("It looks like you signed in with a temporary password. Please change it to a unique, personal password.","info"),App.get("currentSession.user.isInitialUser")){var e=[],t="change your password",a="select an image",n="verify your email address",r="To continue using your applications, please ",l="Welcome to 4tress! ";App.get("currentSession.user.profile.isUserPassword")||e.push(t),0==App.get("currentSession.user.profile.imageSelected")&&e.push(a),0==App.get("currentSession.user.profile.emailAddressVerified")&&e.push(n),r=1==e.length?r+e[0]+"":2==e.length?r+e[0]+" and "+e[1]+".":r+e[0]+", "+e[1]+", and "+e[2]+".",_alert(r,"info",l),App.get("currentSession.user.profile.isUserPassword")?App.get("currentSession.user.profile.imageSelected")?App.get("currentSession.user.profile.emailAddressVerified")||$('#mobileTabs li a[href="#email"]').tab("show"):$('#mobileTabs li a[href="#image"]').tab("show"):$('#mobileTabs li a[href="#password"]').tab("show")}else $('#mobileTabs li a[href="#password"]').tab("show");$("#passwordHelp").on("hide",function(e){$("#passwordToggle").removeClass("big-caretUp").addClass("big-caret"),$("#passwordToggleMobile").removeClass("big-caretUp").addClass("big-caret")}),$("#passwordHelp").on("show",function(e){$("#passwordToggle").removeClass("big-caret").addClass("big-caretUp"),$("#passwordToggleMobile").removeClass("big-caret").addClass("big-caretUp")}),$(".emailVerify").bind("cut copy paste",function(e){e.preventDefault()}),$("#emailHelp").on("hide",function(e){$("#emailToggle").removeClass("big-caretUp").addClass("big-caret"),$("#emailToggleMobile").removeClass("big-caretUp").addClass("big-caret")}),$("#emailHelp").on("show",function(e){$("#emailToggle").removeClass("big-caret").addClass("big-caretUp"),$("#emailToggleMobile").removeClass("big-caret").addClass("big-caretUp")}),$("#imageHelp").on("hide",function(e){$("#imageToggle").removeClass("big-caretUp").addClass("big-caret"),$("#imageToggleMobile").removeClass("big-caretUp").addClass("big-caret")}),$("#imageHelp").on("show",function(e){$("#imageToggle").removeClass("big-caret").addClass("big-caretUp"),$("#imageToggleMobile").removeClass("big-caret").addClass("big-caretUp")}),$("#"+App.get("currentSession.user.image")).addClass("active")})}.on("init")})}),define("shift4tress/components/radio-button",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({tagName:"input",name:"radioButton",attributeBindings:["required","name","type","checked"],type:"radio",checked:function(){return this.get("value")==this.get("name")}.property("value","name"),click:function(){this.set("name",this.get("value"))}})}),define("shift4tress/components/shift4-table-server-paginated",["exports","ember","ember-models-table/components/models-table-server-paginated"],function(e,t,a){t["default"].get,t["default"].set,t["default"].A;e["default"]=a["default"].extend({didRender:function(){$(".dropdown-toggle").dropdown()}})}),define("shift4tress/components/shift4-table",["exports","ember","ember-models-table/components/models-table"],function(e,t,a){t["default"].get,t["default"].set,t["default"].A;e["default"]=a["default"].extend({didRender:function(){$(".dropdown-toggle").dropdown()}})}),define("shift4tress/components/side-bar",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({treeExpanded:!0,store:t["default"].inject.service(),navigation:t["default"].inject.service(),router:t["default"].inject.service("-routing"),scrollPosition:null,currentSession:t["default"].computed.alias("navigation.currentSession"),isUsersRoute:function(){return-1!=this.get("router.currentRouteName").indexOf("users")||-1!=this.get("router.currentRouteName").indexOf("serviceUsers.index")}.property("router.currentRouteName"),showTree:!0,watchCheckbox:t["default"].observer("isChecked",function(){this.get("navigation").set("tree.showChildDataChecked",this.get("isChecked"))}),treeModified:function(){this.get("navigation.tree.modified")&&(this.set("showTree",!1),this.get("navigation").set("tree.modified",!1),this.rerender())}.observes("navigation.tree.modified"),expandTree:function(){this.get("treeExpanded")?$("#treeDragDrop").jstree("open_all"):$("#treeDragDrop").jstree("close_all")}.observes("treeExpanded"),willRender:function(){$(".scroll-content").scrollTop()&&this.set("scrollPosition",$(".scroll-content").scrollTop())},didRender:function(){var e=this.get("store");this.set("showTree",!0),$("#treeDragDrop").jstree({core:{check_callback:!0,themes:{name:"default-dark",responsive:!0}},types:{"default":{icon:App.get("currentSession.user.parentBusinessEntity.isResellerOrganization")?"fa fa-briefcase":"fa fa-globe"},organization:{icon:"fa fa-globe"},merchant:{icon:"fa fa-user"},reseller:{icon:"fa fa-briefcase"}},search:{show_only_matches:!0},plugins:["types","search"]});var t=!1;$("#searchText").keyup(function(){t&&clearTimeout(t),t=setTimeout(function(){var e=$("#searchText").val();$("#treeDragDrop").jstree(!0).search(e)},250)}),$("#treeDragDrop").on("close_node.jstree",function(t,a){var n=a.node,r=e.peekRecord("businessEntity",n.a_attr.id);r.set("isExpanded",!1)}),$("#treeDragDrop").on("open_node.jstree",function(t,a){var n=a.node,r=e.peekRecord("businessEntity",n.a_attr.id);r.set("isExpanded",!0)}),$(".scrollbar-outer").scrollbar(),$(".scroll-content").scrollTop(this.get("scrollPosition"))},didInsertElement:function(){function e(){$(".nav-expanded")[0]?a():t()}function t(){$(".nav-parent").addClass("nav-expanded"),$(".in4m-right").css("visibility","visible"),$("html").removeClass("sidebar-left-collapsed"),$("html").addClass("sidebar-left-opened"),$(".be-tree").hide(),$(".be-tree").css("display","inline-block"),r(),setTimeout(function(){$(window).resize()})}function a(){$("html").hasClass(".sidebar-left-collapsed")||($("html").addClass("sidebar-left-collapsed"),$("html").removeClass("sidebar-left-opened"),$(".in4m-right").css("visibility","hidden"),$(".nav-parent").removeClass("nav-expanded"),$(".be-tree").hide(),n(),setTimeout(function(){$(window).resize()}))}function n(){$("html.fixed .content-body").css("margin-left",""),$("html.fixed .nav-header").css("left",""),$("#sidebar-left").css("width",""),$("#sidebar-resizer").hide()}function r(){$("#sidebar-resizer").show();var e=$(window).width()/2;if(l>5){var t=350+10*l;t>e&&(t=e),$("#sidebar-left").css("width",t+"px")}var a=$("#sidebar-left").width()+7;$("html.fixed .content-body").css("margin-left",a),$("html.fixed .nav-header").css("left",a),$("#sidebar-left").resizable({maxWidth:e,minWidth:350,handles:{e:"#sidebar-resizer"},resize:function(e,t){$(window).resize();var a=t.size.width+"px";$("html.fixed .content-body").css("margin-left",a),$("html.fixed .nav-header").css("left",a)}})}this.get("navigation");var l=this.get("navigation.treeSize");App.currentSession.get("user.hasAccessToAccountTree")&&($(".nav-parent a").click(function(){e()}),$("#TopNavSideBarToggle").click(function(){e()})),$(".in4mSelectAll").change(function(){$(this).parent().parent().find("input:checkbox").prop("checked",$(this).prop("checked"))}),$(".jstree-node").click(function(e){e.preventDefault(),$(this).blur()}),App.currentSession.get("user.hasAccessToAccountTree")?t():($("html").addClass("sidebar-left-collapsed"),$(".nav-parent").addClass("hidden"))},actions:{selectBE:function(e){this.get("navigation").selectBE(e)}}})}),define("shift4tress/components/standard-billable-activity-rate",["exports","ember"],function(e,t){ var a=function(e){var t={};if(t.unitRatePerQuantityValues=[],t.fixedFeeValues=[],t.flatRatePerQuantityValues=[],t.percentRatePerVolumeValues=[],t.activeMinTotal=null,t.inactiveMinTotal=null,t.maxTotal="0",e&&e.length>0){var a=JSON.parse(e);for(var n in a)a.hasOwnProperty(n)&&a[n]&&(t[n]=a[n])}return t};App.KeyValueObject=Em.Object.extend({name:"",key:"",value:"",min:"",max:"",minimumChargeEnabled:"",maximumChargeDisabled:"",minimumChargeDisabled:"",maximumChargeEnabled:""}),e["default"]=t["default"].Component.extend({newRate:null,addNewRate:function(){var e=this.get("newRate");this.set("newRate",null),"Flat"==e?this.send("newFlatRatePerQuantity"):"Fee"==e?this.send("newFixedFee"):"Percent"==e?this.send("newPercentRatePerVolume"):"Unit"==e?this.send("newUnitRatePerQuantity"):"Minimum"==e&&this.send("newMinimumRate")}.observes("newRate"),targetBillableActivityRate:null,isEditDisabled:function(){return this.get("targetObject.isEditDisabled")}.property("targetObject.isEditDisabled"),init:function(){this._super(),this.updateRates()},percentRatePerVolumeMinMaxCheck:function(){this.get("percentRatePerVolumeValues").forEach(function(e){e.get("maximumChargeEnabled")?e.set("maximumChargeDisabled",!1):(e.set("maximumChargeDisabled",!0),e.set("max",null)),e.get("minimumChargeEnabled")?e.set("minimumChargeDisabled",!1):(e.set("minimumChargeDisabled",!0),e.set("min",null))})}.observes("percentRatePerVolumeValues","percentRatePerVolumeValues.@each.maximumChargeEnabled","percentRatePerVolumeValues.@each.minimumChargeEnabled"),updateRates:function(){var e=this.get("targetBillableActivityRate");if(e){e.set("linkedComponent",this);var t=a(e.get("rate")),n=[];t.unitRatePerQuantityValues.forEach(function(e){n.push(App.KeyValueObject.create({key:Number(e.key),value:e.value}))}),this.set("unitRatePerQuantityValues",n.sortBy("key")),n=[],t.fixedFeeValues.forEach(function(e){n.push(App.KeyValueObject.create({name:e.name,value:Number(e.value)}))}),this.set("fixedFeeValues",n.sortBy("value")),n=[],t.flatRatePerQuantityValues.forEach(function(e){n.push(App.KeyValueObject.create({key:Number(e.key),value:e.value}))}),this.set("flatRatePerQuantityValues",n.sortBy("key")),n=[],t.percentRatePerVolumeValues.forEach(function(e){n.push(App.KeyValueObject.create({key:Number(e.key),value:e.value,min:e.min,max:e.max,minimumChargeDisabled:e.minimumChargeDisabled,minimumChargeEnabled:e.minimumChargeEnabled,maximumChargeDisabled:e.maximumChargeDisabled,maximumChargeEnabled:e.maximumChargeEnabled}))}),this.set("percentRatePerVolumeValues",n.sortBy("key")),n=[],this.set("inactiveMinTotal",t.inactiveMinTotal),this.set("activeMinTotal",t.activeMinTotal),this.set("maxTotal",t.maxTotal),this.updateRateToAdd()}},updateRateToAdd:function(){this.set("rates",[]),0==this.get("percentRatePerVolumeValues.length")&&this.get("rates").push("Percent"),0==this.get("fixedFeeValues.length")&&this.get("rates").push("Fee"),0==this.get("unitRatePerQuantityValues.length")&&this.get("rates").push("Unit"),0==this.get("flatRatePerQuantityValues.length")&&this.get("rates").push("Flat"),this.get("minimumRateAdded")||this.get("rates").push("Minimum")},pruneValues:function(){var e=this.get("unitRatePerQuantityValues"),t=this.get("fixedFeeValues"),a=this.get("flatRatePerQuantityValues"),n=this.get("percentRatePerVolumeValues"),r=[];e.forEach(function(e){""==e.get("key")&&""==e.get("value")&&r.push(e)}),e.removeObjects(r),t.forEach(function(e){""==e.get("key")&&""==e.get("value")&&r.push(e)}),t.removeObjects(r),a.forEach(function(e){""==e.get("key")&&""==e.get("value")&&r.push(e)}),a.removeObjects(r),n.forEach(function(e){""==e.get("key")&&""==e.get("value")&&r.push(e)}),n.removeObjects(r)},updateBAR:function(){var e={unitRatePerQuantityValues:this.get("unitRatePerQuantityValues").sortBy("key"),fixedFeeValues:this.get("fixedFeeValues").sortBy("value"),flatRatePerQuantityValues:this.get("flatRatePerQuantityValues").sortBy("key"),percentRatePerVolumeValues:this.get("percentRatePerVolumeValues").sortBy("key"),inactiveMinTotal:this.get("inactiveMinTotal"),activeMinTotal:this.get("activeMinTotal"),maxTotal:this.get("maxTotal")},t=JSON.stringify(e),a=this.get("targetBillableActivityRate");a.set("rate",t)},ratesChanged:function(){this.updateBAR()}.observes("fixedFeeValues.@each.name","fixedFeeValues.@each.value","unitRatePerQuantityValues.@each.key","unitRatePerQuantityValues.@each.value","flatRatePerQuantityValues.@each.key","flatRatePerQuantityValues.@each.value","percentRatePerVolumeValues.@each.min","percentRatePerVolumeValues.@each.max","percentRatePerVolumeValues.@each.value","percentRatePerVolumeValues.@each.key","percentRatePerVolumeValues.@each.maximumChargeEnabled","percentRatePerVolumeValues.@each.minimumChargeEnabled","inactiveMinTotal","activeMinTotal","maxTotal").on("init"),unitRatePerQuantityValues:[],fixedFeeValues:[],flatRatePerQuantityValues:[],percentRatePerVolumeValues:[],inactiveMinTotal:null,activeMinTotal:null,minimumRateAdded:function(){return null!=this.get("activeMinTotal")||null!=this.get("inactiveMinTotal")}.property("inactiveMinTotal","activeMinTotal"),maxTotal:"0",unitRatePerQuantityValuesLabel:function(){return"unitRatePerQuantityValues"+this.get("contextSuffix")}.property("contextSuffix"),fixedFeeValuesLabel:function(){return"fixedFeeValues"+this.get("contextSuffix")}.property("contextSuffix"),flatRatePerQuantityValuesLabel:function(){return"flatRatePerQuantityValues"+this.get("contextSuffix")}.property("contextSuffix"),percentRatePerVolumeValuesLabel:function(){return"percentRatePerVolumeValues"+this.get("contextSuffix")}.property("contextSuffix"),activeMinTotalLabel:function(){return"activeMinTotal"+this.get("contextSuffix")}.property("contextSuffix"),inactiveMinTotalLabel:function(){return"inactiveMinTotal"+this.get("contextSuffix")}.property("contextSuffix"),isAllowUseEnabledLabel:function(){return"isAllowUseEnabled"+this.get("contextSuffix")}.property("contextSuffix"),calculatePerOrganizationLabel:function(){return"calculatePerOrganization"+this.get("contextSuffix")}.property("contextSuffix"),calculatePerMerchantLabel:function(){return"calculatePerMerchant"+this.get("contextSuffix")}.property("contextSuffix"),applyAtActivityInsertionLabel:function(){return"applyAtActivityInsertion"+this.get("contextSuffix")}.property("contextSuffix"),includeCardTendersLabel:function(){return"includeCardTenders"+this.get("contextSuffix")}.property("contextSuffix"),includeCashTendersLabel:function(){return"includeCashTenders"+this.get("contextSuffix")}.property("contextSuffix"),includeMemberTendersLabel:function(){return"includeMemberTenders"+this.get("contextSuffix")}.property("contextSuffix"),includeCheckTendersLabel:function(){return"includeCheckTenders"+this.get("contextSuffix")}.property("contextSuffix"),maxTotalLabel:function(){return"maxTotal"+this.get("contextSuffix")}.property("contextSuffix"),contextSuffix:function(){return this.get("elementId")}.property("targetBillableActivityRate"),actions:{updateRates:function(){this.updateRates()},newMinimumRate:function(){this.set("inactiveMinTotal","0"),this.set("activeMinTotal","0"),this.updateRateToAdd()},clearMinimumRate:function(){this.set("inactiveMinTotal",null),this.set("activeMinTotal",null),this.updateRateToAdd()},newUnitRatePerQuantity:function(){this.get("unitRatePerQuantityValues").pushObject(App.KeyValueObject.create({key:"0"})),this.updateRates()},removeUnitRatePerQuantity:function(e){this.get("unitRatePerQuantityValues").removeObject(e),this.updateRates()},clearUnitRatePerQuantity:function(){this.get("unitRatePerQuantityValues").clear(),this.updateRates()},newFixedFee:function(){this.get("fixedFeeValues").pushObject(App.KeyValueObject.create({name:"",value:"0"})),this.updateRates()},removeFixedFee:function(e){this.get("fixedFeeValues").removeObject(e),this.updateRates()},clearFixedFee:function(){this.get("fixedFeeValues").clear(),this.updateRates()},newFlatRatePerQuantity:function(){this.get("flatRatePerQuantityValues").pushObject(App.KeyValueObject.create({key:"0"})),this.updateRates()},removeFlatRatePerQuantity:function(e){this.get("flatRatePerQuantityValues").removeObject(e),this.updateRates()},clearFlatRatePerQuantity:function(){this.get("flatRatePerQuantityValues").clear(),this.updateRates()},newPercentRatePerVolume:function(){this.get("percentRatePerVolumeValues").pushObject(App.KeyValueObject.create({key:"0"})),this.updateRates()},removePercentRatePerVolume:function(e){this.get("percentRatePerVolumeValues").removeObject(e),this.updateRates()},clearPercentRatePerVolume:function(){this.get("percentRatePerVolumeValues").clear(),this.updateRates()}}})}),define("shift4tress/components/tax-rate",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({didInsertElement:function(){this.get("value")?this.set("value",new Big(this.value).toFixed(3)):this.set("value",new Big(0).toFixed(3))},keyPress:function(e){return money(e)},focusOut:function(){this.get("value")?this.set("value",new Big(this.value).toFixed(3)):this.set("value",new Big(0).toFixed(3))}})}),define("shift4tress/components/theme-default",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({didInsertElement:function(){(function(e){e.isFunction(e.fn.dataTable)&&e.extend(!0,e.fn.dataTable.defaults,{sDom:"<'row datatables-header form-inline'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>r><'table-responsive't><'row datatables-footer'<'col-sm-12 col-md-6'i><'col-sm-12 col-md-6'p>>",oLanguage:{sLengthMenu:"_MENU_ records per page",sProcessing:' Loading'},fnInitComplete:function(t,a){e.isFunction(e.fn.select2)&&e(".dataTables_length select",t.nTableWrapper).select2({theme:"bootstrap",minimumResultsForSearch:-1});var n=e("table",t.nTableWrapper).data("plugin-options")||{},r=e(".dataTables_filter input",t.nTableWrapper);r.attr({placeholder:"undefined"!=typeof n.searchPlaceholder?n.searchPlaceholder:"Search"}).addClass("form-control"),e.isFunction(e.fn.placeholder)&&r.placeholder()}})}).apply(this,[jQuery]),function(e){"undefined"!=typeof PNotify&&(PNotify.prototype.options.styling="fontawesome",e.extend(!0,PNotify.prototype.options,{shadow:!1,stack:{spacing1:15,spacing2:15}}),e.extend(PNotify.styling.fontawesome,{container:"notification",notice:"notification-warning",info:"notification-info",success:"notification-success",error:"notification-danger",notice_icon:"fa fa-exclamation",info_icon:"fa fa-info",success_icon:"fa fa-check",error_icon:"fa fa-times"}))}.apply(this,[jQuery]),function(e){e(document).on("shown.bs.dropdown",".dropdown",function(){var t,a=e(this).children(".dropdown-menu"),n=e(this).closest(".table");n.height()>a.height()&&(t=a.offset().top-n.offset().top);var r=t-a.height()-n.scrollTop(),l=n.scrollTop()+n.height()-(t+a.height());0>l&&(r>=0||r>l)&&e(this).addClass("dropup")}).on("hidden.bs.dropdown",".dropdown",function(){e(this).removeClass("dropup")})}.apply(this,[jQuery])}})}),define("shift4tress/components/theme-display",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({applyClass:!0,classNameBindings:["applyClass:panel-body"],onInsert:function(){t["default"].run.scheduleOnce("afterRender",this,function(){var e=this;$("#p_color").click(function(e){e.preventDefault()}),$("#s_color").click(function(e){e.preventDefault()}),$("#a_color").click(function(e){e.preventDefault()}),$("#p_color").css("background-color","rgb("+e.get("model.primaryColor")+")"),$("#s_color").css("background-color","rgb("+e.get("model.secondaryColor")+")"),$("#a_color").css("background-color","rgb("+e.get("model.accentColor")+")"),$("#primaryColor").focusout(function(t){$("#p_color").css("background-color","rgb("+e.get("model.primaryColor")+")")}),$("#secondaryColor").focusout(function(t){$("#s_color").css("background-color","rgb("+e.get("model.secondaryColor")+")")}),$("#accentColor").focusout(function(t){$("#a_color").css("background-color","rgb("+e.get("model.accentColor")+")")}),window.CLCPHandler=function(t){if(e.get("model")&&"undefined"!=typeof _whichField){var a=CLCPhex2rgb(t);e.set("model."+_whichField,a[0]+","+a[1]+","+a[2]),$("#"+_whichField).parent().next("button").css("background-color","#"+t)}},window._whichField=null,window._CLCPdisplay="none",window._CLCPisDraggable=!0,window._CLCPposition="absolute",CLCPinitPicker()})}.on("init")})}),define("shift4tress/components/tip-percent",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({keyPress:function(e){0==e.which||8==e.which||e.which>=48&&e.which<=57&&e.target.value.length!=e.target.maxLength||e.preventDefault()},focusOut:function(){this.get("value")||this.set("value","0")}})}),define("shift4tress/components/top-nav-links",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({router:t["default"].inject.service("-routing"),theme:t["default"].inject.service(),didInsertElement:function(){var e=this.get("router.currentRouteName"),t=this.topNavOptionsForRouteName(e);if(t){$("#SelectedOption").text(t.optionName),$(".NavTabSubGroup").hide(),$(".NavTabSubGroup").eq(t.index).css("display","flex");var a=t.topNavLink;0!=a&&$("#TopNavLink"+a).addClass("active")}$("#TopNavDropdown .DropDownGroup li a").click(function(e){if($(".TopNavLink").parent().removeClass("active"),$(this).parent().hasClass("DropDownSubGroup")){var t="";t=$(this).closest(".DropDownSubGroupWrapper").find(".DropDownSubGroupParent").text()+" ● "+$(this).text(),$("#SelectedOption").text(t)}else $("#SelectedOption").text($(this).text());$(".NavTabSubGroup").hide(),$(".NavTabSubGroup").eq($(this).parent().parent().index()).css("display","flex")}),$(".TopNavLink").click(function(){$(this).prev().find(".dropdown-menu").toggle()}),$(document).mouseup(function(e){var t=$(".ddml");t.is(e.target)||0!==t.has(e.target).length?t.hide():t.hide()})},topNavOptionsForRouteName:function(e){-1!=e.indexOf(".")&&(e=e.substring(0,e.indexOf(".")));var t=this,a=0,n=!1;switch(e){case"profile":return n||(a=0,n=!0),App.currentSession.get("user.hasAccessTo4tress")?{optionName:t.get("theme.appName"),index:0,topNavLink:a}:{optionName:"VT4",index:1,topNavLink:a};case"vt4":n||(a=0,n=!0);case"settings":case"general":case"taxProfiles":case"taxProfile":case"tender":case"configureProperties":case"configureIntegrations":case"theme":case"receipt":case"accessories":case"editAccessory":case"discounts":case"editDiscount":n||(a=5,n=!0);case"campaigns":case"memberAccounts":n||(a=7,n=!0);case"shelf":case"categories":case"category":case"addItems":case"modifiers":case"modifierList":case"editModifier":case"modifierSet":case"addModifiers":case"items":case"item":case"addCategory":case"addModifier":case"addModifierGroup":n||(a=6,n=!0);case"reports":case"4tressReports":case"VT4Reports":case"paymentsReport":case"unknownPayments":case"taxProfilesReport":case"transactionsReport":case"shelfReport":case"clerksReport":case"exportReport":case"customReport":return n||(a=8,n=!0),{optionName:"VT4",index:1,topNavLink:a};case"management":n||(a=0,n=!0);case"organizations":case"organization":case"assignRateProfiles":case"dotnConnect":case"dbaConfirmation":case"companies":case"company":case"invoices":case"invoice":case"contacts":case"contact":case"billToAccounts":case"billToAccount":case"assignBusinessEntities":case"assignContacts":case"paymentMethods":case"paymentMethod":case"groups":case"group":case"addRoles":case"addOrgs":case"addUsers":case"roles":case"role":case"users":case"user":case"permissions":case"addGroups":case"summary":n||(a=1,n=!0);case"security":case"passwordSettings":n||(a=3,n=!0);case"BETheme":case"applicationTheme":case"emailTheme":case"welcomeTemplate":case"forgotPassword":case"forgotUsername":case"reportsTemplate":case"invoiceNotification":case"ssoTheme":case"generalTemplate":case"landingTemplate":case"loginTemplate":n||(a=4,n=!0);case"billing":case"billableProducts":case"billableProduct":case"assignActivities":case"billableActivities":case"billableActivity":case"rateProfiles":case"rateProfile":case"assignBusinessEntities":case"billingFailures":case"billingFailure":case"billingCycles":case"billingCycle":n||(a=2,n=!0);case"new":return n||(a=0,n=!0),{optionName:t.get("theme.appName"),index:0,topNavLink:a}}}})}),define("shift4tress/components/unit-price",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({didInsertElement:function(){this.get("value")?this.set("value",new Big(this.value).toFixed(2)):this.get("min")?this.set("value",new Big(this.get("min")).toFixed(2)):this.set("value",new Big(0).toFixed(2))},keyPress:function(e){return money(e)},focusOut:function(){this.get("value")?this.set("value",new Big(this.value).toFixed(2)):this.set("value",new Big(0).toFixed(2))}})}),define("shift4tress/components/upload-csv",["exports","ember"],function(e,t){e["default"]=t["default"].TextField.extend({type:"file",change:function(e){var t=e.target;if(t.files&&t.files[0]){var a=this,n=new FileReader,r=t.files[0];n.readAsText(r),n.onload=function(e){if(t.files[0].size<=2e6&&(t.files[0].type.match("excel")||t.files[0].type.match("csv"))){App.set("CsvUpload",btoa(e.target.result));var n=$("#csvUpload");n.closest(".form-group").find("span").hide()}else{var n=$("#csvUpload");n.closest(".form-group").addClass("has-error"),1==n.closest(".form-group").find("span").length?(n.closest(".form-group").find("span").show(),n.closest(".form-group").find("span").html("Must be a CSV file less than 2MB in size."),a.set("value",null),App.set("CsvUpload",null)):($('Must be a CSV file less than 2MB in size.').insertAfter(n),a.set("value",null),App.set("CsvUpload",null))}},n.onerror=function(){alert("Unable to read "+r.fileName)}}else App.set("CsvUpload",null)}})}),define("shift4tress/controllers/application",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({clock:t["default"].inject.service(),logoutWatch:function(){this.get("clock").get("logout")&&this.send("logout")}.observes("clock.logout"),modelWatch:function(){var e=this;1==this.get("model.error")&&($("#progressHudOverlay").hide(),this.transitionToRoute("index"),t["default"].run.next(function(){$("#services-unavailable").modal().toggle(),$("#services-unavailable").on("hide.bs.modal",function(){e.send("logout")})}))}.observes("model"),account:t["default"].computed.alias("App.currentSession.user.selectedBUsinessEntity"),selectedBusinessEntityDidChange:function(){this.send("handleBusinessEntityChange")}.observes("currentSession.user.selectedBusinessEntity"),securityImages:function(){for(var e=this.get("apiPath.ssoUrl")+"images/security/",t=[],a=1;17>a;a++)t.push({id:a,img:(e+a+".png").toString(),elementId:"img"+String(a)});return t}.property(),currentSession:function(){return App.currentSession}.property("App.currentSession"),showPerms:!1,permFilterBeId:0,visiblePermissions:function(){var e=App.currentSession.get("user.permissions"),t=parseInt(this.get("permFilterBeId"));t>0&&(e=e.filter(function(e){return e.get("businessEntity.id")==t?!0:void 0}));var a=parseInt(this.get("permPage")),n=parseInt(this.get("permPageSize")),r=a*n,l=(a+1)*n;return e.slice(r,l)}.property("permPage","permPageSize","permFilterBeId"),permPage:0,permPageSize:10,permPageLimit:function(){var e=parseInt(this.get("permPageSize"));return parseInt(App.currentSession.get("user.permissions.length"))/e}.property("permPageSize","visiblePermissions"),actions:{refreshSession:function(){$("#progressHudMessage").html("Please Wait..."),$("#progressHudOverlay").show();var e=this,t=App.currentSession;this.store.findRecord("session",t.get("accessToken"),{reload:!0}).then(function(t){e.store.findRecord("session",t.get("accessToken"),{reload:!0}).then(function(){App.set("currentSession",t),$("#progressHudOverlay").hide(),$("#inactivityModal").modal("hide"),App.get("sessionTimeoutInterval")&&(clearInterval(App.get("sessionTimeoutInterval")),App.set("sessionTimeoutInterval",setInterval(function(){App.currentSession&&Big(Big((App.currentSession.get("expiresAt").getTime()-Date.now())/1e3).toFixed(0))<=300&&($(".alert").alert("close"),$("#inactivityModal").on("show.bs.modal",function(){clearInterval(App.get("sessionTimeoutInterval"))}),$("#inactivityModal").modal("show"))},1e3)))},function(t){$("#progressHudOverlay").hide(),e.send("logout")})},function(t){$("#progressHudOverlay").hide(),e.send("logout")})},signoutSession:function(){this.send("logout")},togglePerms:function(){this.toggleProperty("showPerms")},prevPermPage:function(){var e=(App.currentSession.get("user.permissions"),parseInt(this.get("permPage"))),t=e-1;t>=0&&this.set("permPage",t)},nextPermPage:function(){var e=App.currentSession.get("user.permissions"),t=parseInt(this.get("permPage")),a=parseInt(this.get("permPageSize")),n=t+1;e.get("length")>n*a&&this.set("permPage",n)},reapplyPermsToUser:function(){App.currentSession.get("user").setProperties({hasAccessToManagement:!1,hasAccessToOrganizations:!1,hasAccessToUsers:!1,hasAccessToGroups:!1,hasAccessToRoles:!1,hasAccessToVT4App:!1,hasAccessToVT4:!1,hasAccessToReports:!1,hasAccessToBilling:!1,canViewBillableProducts:!1,canEditBillableProducts:!1,canViewBillableActivities:!1,canEditBillableActivities:!1,canViewRateProfiles:!1,canEditRateProfiles:!1,canViewCompanies:!1,canEditCompanies:!1,canViewContacts:!1,canEditContacts:!1,canViewBillToAccounts:!1,canEditBillToAccounts:!1,canViewPaymentMethods:!1,canEditPaymentMethods:!1,canViewInvoices:!1,canViewBillingCycles:!1,canPauseResumeBillingCycles:!1}),App.currentSession.get("user").hasAccessCheck()}}})}),define("shift4tress/controllers/management/be-theme/application-theme/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({imageValid:!0,gridImageValid:!0,liableCheck:!1,gridImageLiableCheck:!1,shouldRefresh:!1,isLoading:!1,resetThemeForm:function(){$("#liableCheck-error").remove(),this.set("liableCheck",!1),this.set("gridImageLiableCheck",!1),this.set("imageValid",!0),this.set("gridImageValid",!0),$("#BEThemeForm").validate()&&$("#BEThemeForm").validate().resetForm()}.observes("model"),uploadChanged:function(){$("#liableCheck-error").remove(),$("#gridImageLiableCheck-error").remove(),this.set("liableCheck",!1),this.set("gridImageLiableCheck",!1)}.observes("upload","gridImageUpload"),uploadExists:function(){return!!this.get("upload")}.property("upload"),gridImageUploadExists:function(){return!!this.get("gridImageUpload")}.property("gridImageUpload"),updateColorPicker:function(){var e=this;this.get("model.primaryColor")?($("#p_color").css("background-color","rgb("+e.get("model.primaryColor")+")"),$("#s_color").css("background-color","rgb("+e.get("model.secondaryColor")+")"),$("#a_color").css("background-color","rgb("+e.get("model.accentColor")+")")):($("#p_color").css("background-color","rgb(255,255,255)"),$("#s_color").css("background-color","rgb(255,255,255)"),$("#a_color").css("background-color","rgb(255,255,255)")),this.set("shouldRefresh",!1)}.observes("model","shouldRefresh"),updateDisplayLogoBackground:function(){$(".app-header-logo").css("background-color","rgb("+this.get("model.primaryColor")+")")}.observes("model.primaryColor"),actions:{changeImage:function(){setTimeout(function(){$("#change-application-logo").modal("show")})},changeGridImage:function(){setTimeout(function(){$("#change-application-grid-logo").modal("show")})},showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},saveImage:function(){if($("#ImageUploadForm").valid()){var e=this;this.model.set("image",e.get("upload")),e.set("upload",null),$("#imageUpload").val(""),$("#change-application-logo").modal("hide"),this.set("imageValid",!0)}},saveGridImage:function(){if($("#GridImageUploadForm").valid()){var e=this;this.model.set("gridImage",e.get("gridImageUpload")),e.set("gridImageUpload",null),$("#gridImageUpload").val(""),$("#change-application-grid-logo").modal("hide"),this.set("gridImageValid",!0)}},cancelUpdate:function(){this.get("model.id")&&this.get("model").rollbackAttributes(),this.set("upload",null),this.set("gridImageUpload",null),$("#ImageUploadForm").validate().resetForm(),$("#GridImageUploadForm").validate().resetForm(),$("#imageUpload").val(""),$("#gridImageUpload").val(""),$("#liableCheck-error").remove(),$("#gridImageLiableCheck-error").remove(),this.set("liableCheck",!1),this.set("gridImageLiableCheck",!1),this.set("shouldRefresh",!0),this.transitionToRoute("management")},save:function(){var e=this;!this.get("model.id")&&"undefined"!=typeof this.get("model.image")&&"undefined"!=typeof this.get("model.gridImage")||this.get("model.id")?$("#BEThemeForm").valid()&&(this.set("imageValid",!0),$("#progressHudOverlay").show(),this.set("model.domain","4tress.4tresspos.com"),this.get("model").save().then(function(){if(e.get("model.businessEntity.id")==App.get("currentSession.user.parentBusinessEntity.id")){var t=e.get("model.businessEntity");t.get("provisionedBusinessEntityThemes.length")>0&&e.get("model.id")!=t.get("provisionedBusinessEntityThemes").objectAt(0).get("id")&&e.store.unloadRecord(t.get("provisionedBusinessEntityThemes").objectAt(0)),e.store.query("provisionedBusinessEntityTheme",{parentBusinessEntityId:t.get("id"),applicationGroupId:1}).then(function(t){_success("Your theme has been saved."),e.get("theme").load4tressTheme(!0),$("#progressHudOverlay").hide()})}else $("#progressHudOverlay").hide(),_success("Your theme has been saved."),_warn("Updates will only be reflected when users sign out and sign back in.")},App.FailureHandler("save the theme for this account"))):"undefined"!=typeof this.get("model.image")&&"undefined"!=typeof this.get("model.gridImage")||("undefined"==typeof this.get("model.image")&&"undefined"==typeof this.get("model.gridImage")?($("#BEThemeForm").valid(),this.set("imageValid",!1),this.set("gridImageValid",!1)):"undefined"==typeof this.get("model.image")?($("#BEThemeForm").valid(),this.set("imageValid",!1)):"undefined"==typeof this.get("model.gridImage")&&($("#BEThemeForm").valid(),this.set("gridImageValid",!1)))}}})}),define("shift4tress/controllers/management/be-theme/email-theme/forgot-password/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({editingAllowed:!1,actions:{showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},promptRestoreDefaultTemplate:function(){setTimeout(function(){$("#restore-default-modal").modal("show")})},confirmRestoreDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultEmailTemplate",{parentBusinessEntityId:e.get("id"),emailTemplateTypeId:EMAIL_TEMPLATE_TYPE_FORGOT_PASSWORD,applicationGroupId:1}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject");t.set("model.displaySubject",decodeURIComponent(a.get("subject"))),t.set("model.tempEmailBody",a.get("emailBody")),$("#editor1").val(t.get("editingAllowed")?decodeURIComponent(t.get("model.tempEmailBody")):t.get("model.formattedForgotPasswordPreviewString")),t.store.unloadRecord(a)}$("#restore-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default Forgot Password template for this account")(e)})},toggleTemplateEditMode:function(){this.get("editingAllowed")&&this.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),this.toggleProperty("editingAllowed"),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedForgotPasswordPreviewString")),$("#editor1").ckeditor().editor.setReadOnly(!this.get("editingAllowed")),t["default"].run.later(function(){$("#editor1").ckeditor().editor.resetUndo()})},cancelUpdate:function(){this.get("model.tempEmailBody")!=this.get("model.emailBody")&&this.set("model.tempEmailBody",this.get("model.emailBody")),this.get("model.displaySubject")!=decodeURIComponent(this.get("model.subject"))&&this.set("model.displaySubject",decodeURIComponent(this.get("model.subject"))),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedForgotPasswordPreviewString")),this.get("model.id")&&this.get("model").rollbackAttributes(),this.transitionToRoute("management")},save:function(){var e=this;$("#forgotPasswordForm").valid()&&(""!=$("#editor1").val()?($("#editor1").ckeditor().editor.setMode("wysiwyg"),e.get("editingAllowed")&&e.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),e.set("model.subject",encodeURIComponent(e.get("model.displaySubject"))),e.set("model.emailBody",e.get("model.tempEmailBody")),$("#progressHudOverlay").show(),e.get("model").save().then(function(){e.set("model.tempEmailBody",e.get("model.emailBody")),$("#editor1").val(e.get("editingAllowed")?decodeURIComponent(e.get("model.tempEmailBody")):e.get("model.formattedForgotPasswordPreviewString")),$("#progressHudOverlay").hide(),_success("Your Forgot Password template has been saved.")},App.FailureHandler("save the Forgot Password template for this account"))):_alert("Please provide an email template","error"))}}})}),define("shift4tress/controllers/management/be-theme/email-theme/forgot-username/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({editingAllowed:!1,actions:{showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},promptRestoreDefaultTemplate:function(){setTimeout(function(){$("#restore-default-modal").modal("show")})},confirmRestoreDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultEmailTemplate",{parentBusinessEntityId:e.get("id"),emailTemplateTypeId:EMAIL_TEMPLATE_TYPE_FORGOT_USERNAME,applicationGroupId:1}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject");t.set("model.displaySubject",decodeURIComponent(a.get("subject"))),t.set("model.tempEmailBody",a.get("emailBody")),$("#editor1").val(t.get("editingAllowed")?decodeURIComponent(t.get("model.tempEmailBody")):t.get("model.formattedForgotUsernamePreviewString")),t.store.unloadRecord(a)}$("#restore-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default Forgot Username template for this account")(e)})},toggleTemplateEditMode:function(){this.get("editingAllowed")&&this.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),this.toggleProperty("editingAllowed"),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedForgotUsernamePreviewString")),$("#editor1").ckeditor().editor.setReadOnly(!this.get("editingAllowed")),t["default"].run.later(function(){$("#editor1").ckeditor().editor.resetUndo()})},cancelUpdate:function(){this.get("model.tempEmailBody")!=this.get("model.emailBody")&&this.set("model.tempEmailBody",this.get("model.emailBody")),this.get("model.displaySubject")!=decodeURIComponent(this.get("model.subject"))&&this.set("model.displaySubject",decodeURIComponent(this.get("model.subject"))),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedForgotUsernamePreviewString")),this.get("model.id")&&this.get("model").rollbackAttributes(),this.transitionToRoute("management")},save:function(){var e=this;$("#forgotUsernameForm").valid()&&(""!=$("#editor1").val()?($("#editor1").ckeditor().editor.setMode("wysiwyg"),e.get("editingAllowed")&&e.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),e.set("model.subject",encodeURIComponent(e.get("model.displaySubject"))),e.set("model.emailBody",e.get("model.tempEmailBody")),$("#progressHudOverlay").show(),e.get("model").save().then(function(){e.set("model.tempEmailBody",e.get("model.emailBody")),$("#editor1").val(e.get("editingAllowed")?decodeURIComponent(e.get("model.tempEmailBody")):e.get("model.formattedForgotUsernamePreviewString")), $("#progressHudOverlay").hide(),_success("Your Forgot Username template has been saved.")},App.FailureHandler("save the Forgot Username template for this account"))):_alert("Please provide an email template","error"))}}})}),define("shift4tress/controllers/management/be-theme/email-theme/invoice-notification/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({editingAllowed:!1,actions:{showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},promptRestoreDefaultTemplate:function(){setTimeout(function(){$("#restore-default-modal").modal("show")})},confirmRestoreDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultEmailTemplate",{parentBusinessEntityId:e.get("id"),emailTemplateTypeId:EMAIL_TEMPLATE_TYPE_INVOICE,applicationGroupId:1}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject");t.set("model.displaySubject",decodeURIComponent(a.get("subject"))),t.set("model.tempEmailBody",a.get("emailBody")),$("#editor1").val(t.get("editingAllowed")?decodeURIComponent(t.get("model.tempEmailBody")):t.get("model.formattedInvoiceNotificationPreviewString")),t.store.unloadRecord(a)}$("#restore-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default Invoice Notification template for this account")(e)})},toggleTemplateEditMode:function(){this.get("editingAllowed")&&this.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),this.toggleProperty("editingAllowed"),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedInvoiceNotificationPreviewString")),$("#editor1").ckeditor().editor.setReadOnly(!this.get("editingAllowed")),t["default"].run.later(function(){$("#editor1").ckeditor().editor.resetUndo()})},cancelUpdate:function(){this.get("model.tempEmailBody")!=this.get("model.emailBody")&&this.set("model.tempEmailBody",this.get("model.emailBody")),this.get("model.displaySubject")!=decodeURIComponent(this.get("model.subject"))&&this.set("model.displaySubject",decodeURIComponent(this.get("model.subject"))),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedInvoiceNotificationPreviewString")),this.get("model.id")&&this.get("model").rollbackAttributes(),this.transitionToRoute("management")},save:function(){var e=this;$("#invoiceNotificationForm").valid()&&(""!=$("#editor1").val()?($("#editor1").ckeditor().editor.setMode("wysiwyg"),e.get("editingAllowed")&&e.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),e.set("model.subject",encodeURIComponent(e.get("model.displaySubject"))),e.set("model.emailBody",e.get("model.tempEmailBody")),$("#progressHudOverlay").show(),e.get("model").save().then(function(){e.set("model.tempEmailBody",e.get("model.emailBody")),$("#editor1").val(e.get("editingAllowed")?decodeURIComponent(e.get("model.tempEmailBody")):e.get("model.formattedInvoiceNotificationPreviewString")),$("#progressHudOverlay").hide(),_success("Your Invoice Notification template has been saved.")},App.FailureHandler("save the Invoice Notification template for this account"))):_alert("Please provide an email template","error"))}}})}),define("shift4tress/controllers/management/be-theme/email-theme/reports-template/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({editingAllowed:!1,actions:{showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},promptRestoreDefaultTemplate:function(){setTimeout(function(){$("#restore-default-modal").modal("show")})},confirmRestoreDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultEmailTemplate",{parentBusinessEntityId:e.get("id"),emailTemplateTypeId:EMAIL_TEMPLATE_TYPE_REPORTS,applicationGroupId:APPLICATION_GROUP_4TRESS}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject");t.set("model.displaySubject",decodeURIComponent(a.get("subject"))),t.set("model.tempEmailBody",a.get("emailBody")),$("#editor1").val(t.get("editingAllowed")?decodeURIComponent(t.get("model.tempEmailBody")):t.get("model.formattedReportsTemplatePreviewString")),t.store.unloadRecord(a)}$("#restore-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default Reports template for this account")(e)})},toggleTemplateEditMode:function(){this.get("editingAllowed")&&this.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),this.toggleProperty("editingAllowed"),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedReportsTemplatePreviewString")),$("#editor1").ckeditor().editor.setReadOnly(!this.get("editingAllowed")),t["default"].run.later(function(){$("#editor1").ckeditor().editor.resetUndo()})},cancelUpdate:function(){this.get("model.tempEmailBody")!=this.get("model.emailBody")&&this.set("model.tempEmailBody",this.get("model.emailBody")),this.get("model.displaySubject")!=decodeURIComponent(this.get("model.subject"))&&this.set("model.displaySubject",decodeURIComponent(this.get("model.subject"))),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedReportsTemplatePreviewString")),this.get("model.id")&&this.get("model").rollbackAttributes(),this.transitionToRoute("management")},save:function(){var e=this;$("#reportsTemplateForm").valid()&&(""!=$("#editor1").val()?($("#editor1").ckeditor().editor.setMode("wysiwyg"),e.get("editingAllowed")&&e.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),e.set("model.subject",encodeURIComponent(e.get("model.displaySubject"))),e.set("model.emailBody",e.get("model.tempEmailBody")),$("#progressHudOverlay").show(),e.get("model").save().then(function(){e.set("model.tempEmailBody",e.get("model.emailBody")),$("#editor1").val(e.get("editingAllowed")?decodeURIComponent(e.get("model.tempEmailBody")):e.get("model.formattedReportsTemplatePreviewString")),$("#progressHudOverlay").hide(),_success("Your Reports template has been saved.")},App.FailureHandler("save the Reports template for this account"))):_alert("Please provide an email template","error"))}}})}),define("shift4tress/controllers/management/be-theme/email-theme/welcome-template/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({editingAllowed:!1,actions:{showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},promptRestoreDefaultTemplate:function(){setTimeout(function(){$("#restore-default-modal").modal("show")})},confirmRestoreDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultEmailTemplate",{parentBusinessEntityId:e.get("id"),emailTemplateTypeId:EMAIL_TEMPLATE_TYPE_WELCOME,applicationGroupId:1}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject");t.set("model.displaySubject",decodeURIComponent(a.get("subject"))),t.set("model.tempEmailBody",a.get("emailBody")),$("#editor1").val(t.get("editingAllowed")?decodeURIComponent(t.get("model.tempEmailBody")):t.get("model.formattedWelcomeTemplatePreviewString")),t.store.unloadRecord(a)}$("#restore-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default Welcome template for this account")(e)})},toggleTemplateEditMode:function(){this.get("editingAllowed")&&this.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),this.toggleProperty("editingAllowed"),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedWelcomeTemplatePreviewString")),$("#editor1").ckeditor().editor.setReadOnly(!this.get("editingAllowed")),t["default"].run.later(function(){$("#editor1").ckeditor().editor.resetUndo()})},cancelUpdate:function(){this.get("model.tempEmailBody")!=this.get("model.emailBody")&&this.set("model.tempEmailBody",this.get("model.emailBody")),this.get("model.displaySubject")!=decodeURIComponent(this.get("model.subject"))&&this.set("model.displaySubject",decodeURIComponent(this.get("model.subject"))),$("#editor1").val(this.get("editingAllowed")?decodeURIComponent(this.get("model.tempEmailBody")):this.get("model.formattedWelcomeTemplatePreviewString")),this.get("model.id")&&this.get("model").rollbackAttributes(),this.transitionToRoute("management")},save:function(){var e=this;$("#welcomeTemplateForm").valid()&&(""!=$("#editor1").val()?($("#editor1").ckeditor().editor.setMode("wysiwyg"),e.get("editingAllowed")&&e.set("model.tempEmailBody",encodeURIComponent($("#editor1").val())),e.set("model.subject",encodeURIComponent(e.get("model.displaySubject"))),e.set("model.emailBody",e.get("model.tempEmailBody")),$("#progressHudOverlay").show(),e.get("model").save().then(function(){e.set("model.tempEmailBody",e.get("model.emailBody")),$("#editor1").val(e.get("editingAllowed")?decodeURIComponent(e.get("model.tempEmailBody")):e.get("model.formattedWelcomeTemplatePreviewString")),$("#progressHudOverlay").hide(),_success("Your Welcome template has been saved.")},App.FailureHandler("save the Welcome template for this account"))):_alert("Please provide an email template","error"))}}})}),define("shift4tress/controllers/management/be-theme/sso-theme/general-template/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({imageValid:!0,shouldRefresh:!1,liableCheck:!1,isLoading:!1,uploadChanged:function(){$("#liableCheck-error").remove(),this.set("liableCheck",!1)}.observes("upload"),uploadExists:function(){return!!this.get("upload")}.property("upload"),updateColorPicker:function(){var e=this;this.get("model.primaryColor")?($("#p_color").css("background-color","rgb("+e.get("model.primaryColor")+")"),$("#s_color").css("background-color","rgb("+e.get("model.secondaryColor")+")"),$("#a_color").css("background-color","rgb("+e.get("model.accentColor")+")")):($("#p_color").css("background-color","rgb(255,255,255)"),$("#s_color").css("background-color","rgb(255,255,255)"),$("#a_color").css("background-color","rgb(255,255,255)")),this.set("shouldRefresh",!1)}.observes("model","shouldRefresh"),updateDisplayLogoBackground:function(){$(".sso-header-logo").css("background-color","rgb("+this.get("model.primaryColor")+")")}.observes("model.primaryColor"),actions:{changeImage:function(){setTimeout(function(){$("#change-sso-logo").modal("show")})},saveImage:function(){if($("#ImageUploadForm").valid()){var e=this;this.model.set("image",e.get("upload")),e.set("upload",null),$("#imageUpload").val(""),$("#change-sso-logo").modal("hide"),this.set("imageValid",!0)}},showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},cancelUpdate:function(){this.get("model.id")&&this.get("model").rollbackAttributes(),this.set("upload",null),$("#ImageUploadForm").validate().resetForm(),$("#imageUpload").val(""),$("#liableCheck-error").remove(),this.set("liableCheck",!1),this.set("shouldRefresh",!0),this.transitionToRoute("management")},save:function(){!this.get("model.id")&&"undefined"!=typeof this.get("model.image")||this.get("model.id")?$("#GeneralTemplateForm").valid()&&(this.set("imageValid",!0),$("#progressHudOverlay").show(),this.get("model").save().then(function(){$("#progressHudOverlay").hide(),_success("Your SSO General Settings has been saved.")},App.FailureHandler("save the SSO General Settings for this account"))):"undefined"==typeof this.get("model.image")&&("undefined"==typeof this.get("model.image")?($("#GeneralTemplateForm").valid(),this.set("imageValid",!1)):"undefined"==typeof this.get("model.image")&&($("#GeneralTemplateForm").valid(),this.set("imageValid",!1)))}}})}),define("shift4tress/controllers/management/be-theme/sso-theme/landing-template/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({leftPanelEditingAllowed:!1,rightPanelEditingAllowed:!1,actions:{showLeftHelpModal:function(){setTimeout(function(){$("#help-modal-left").modal("show")})},showRightHelpModal:function(){setTimeout(function(){$("#help-modal-right").modal("show")})},toggleEditMode:function(e){if("left"==e){var a=this.get("model.leftPanel");a&&(this.get("leftPanelEditingAllowed")&&a.set("tempPanelValue",encodeURIComponent($("#editor1").val())),this.set("leftPanelEditingAllowed",!this.get("leftPanelEditingAllowed")),$("#editor1").val(this.get("leftPanelEditingAllowed")?decodeURIComponent(a.get("tempPanelValue")):a.get("formattedPanelValueString")),$("#editor1").ckeditor().editor.setReadOnly(!this.get("leftPanelEditingAllowed")),t["default"].run.later(function(){$("#editor1").ckeditor().editor.resetUndo()}))}else if("right"==e){var n=this.get("model.rightPanel");n&&(this.get("rightPanelEditingAllowed")&&n.set("tempPanelValue",encodeURIComponent($("#editor2").val())),this.set("rightPanelEditingAllowed",!this.get("rightPanelEditingAllowed")),$("#editor2").val(this.get("rightPanelEditingAllowed")?decodeURIComponent(n.get("tempPanelValue")):n.get("formattedPanelValueString")),$("#editor2").ckeditor().editor.setReadOnly(!this.get("rightPanelEditingAllowed")),t["default"].run.later(function(){$("#editor2").ckeditor().editor.resetUndo()}))}},promptRestoreLeftDefaultTemplate:function(){setTimeout(function(){$("#restore-left-default-modal").modal("show")})},promptRestoreRightDefaultTemplate:function(){setTimeout(function(){$("#restore-right-default-modal").modal("show")})},confirmRestoreLeftDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultSsoPage",{parentBusinessEntityId:e.get("id"),pageTypeId:SSO_PAGE_TYPE_LANDING,panelTypeId:SSO_PANEL_TYPE_LEFT,applicationGroupId:APPLICATION_GROUP_4TRESS}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject"),n=null;if(1==a.get("defaultSsoPanels.length")&&(n=a.get("defaultSsoPanels.firstObject")),n){var r=t.get("model.leftPanel");r?(r.set("tempPanelValue",n.get("panelValue")),$("#editor1").val(t.get("leftPanelEditingAllowed")?decodeURIComponent(r.get("tempPanelValue")):r.get("formattedPanelValueString"))):console.log("Landing Page Error: Confirm Restore Left Panel - No Left Panel set on page."),t.store.unloadRecord(n)}else console.log("Landing Page Error: Confirm Restore Left Panel - No Default Panel.");t.store.unloadRecord(a)}$("#restore-left-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default landing left single sign-on panel for this account")(e)})},confirmRestoreRightDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultSsoPage",{parentBusinessEntityId:e.get("id"),pageTypeId:SSO_PAGE_TYPE_LANDING,panelTypeId:SSO_PANEL_TYPE_RIGHT,applicationGroupId:APPLICATION_GROUP_4TRESS}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject"),n=null;if(1==a.get("defaultSsoPanels.length")&&(n=a.get("defaultSsoPanels.firstObject")),n){var r=t.get("model.rightPanel");r?(r.set("tempPanelValue",n.get("panelValue")),$("#editor2").val(t.get("rightPanelEditingAllowed")?decodeURIComponent(r.get("tempPanelValue")):r.get("formattedPanelValueString"))):console.log("Landing Page Error: Confirm Restore Right Panel - No Right Panel set on page."),t.store.unloadRecord(n)}else console.log("Landing Page Error: Confirm Restore Right Panel - No Default Panel.");t.store.unloadRecord(a)}$("#restore-right-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default landing right single sign-on panel for this account")(e)})},cancelUpdate:function(){var e=this.get("model.leftPanel"),t=this.get("model.rightPanel");e&&(e.get("tempPanelValue")!=e.get("panelValue")&&e.set("tempPanelValue",e.get("panelValue")),$("#editor1").val(this.get("leftPanelEditingAllowed")?decodeURIComponent(e.get("tempPanelValue")):e.get("formattedPanelValueString")),e.rollbackAttributes()),t&&(t.get("tempPanelValue")!=t.get("panelValue")&&t.set("tempPanelValue",t.get("panelValue")),$("#editor2").val(this.get("rightPanelEditingAllowed")?decodeURIComponent(t.get("tempPanelValue")):t.get("formattedPanelValueString")),t.rollbackAttributes()),this.transitionToRoute("management")},save:function(){var e=this;if($("#LandingTemplateForm").valid())if(""!=$("#editor1").val()||""!=$("#editor2").val()){$("#editor1").ckeditor().editor.setMode("wysiwyg"),$("#editor2").ckeditor().editor.setMode("wysiwyg");var t=e.get("model.leftPanel"),a=e.get("model.rightPanel");t&&(e.get("leftPanelEditingAllowed")&&t.set("tempPanelValue",encodeURIComponent($("#editor1").val())),t.set("panelValue",t.get("tempPanelValue"))),a&&(e.get("rightPanelEditingAllowed")&&a.set("tempPanelValue",encodeURIComponent($("#editor2").val())),a.set("panelValue",a.get("tempPanelValue"))),$("#progressHudOverlay").show(),e.get("model").save().then(function(){t&&(t.set("tempPanelValue",t.get("panelValue")),$("#editor1").val(e.get("leftPanelEditingAllowed")?decodeURIComponent(t.get("tempPanelValue")):t.get("formattedPanelValueString"))),a&&(a.set("tempPanelValue",a.get("panelValue")),$("#editor2").val(e.get("rightPanelEditingAllowed")?decodeURIComponent(a.get("tempPanelValue")):a.get("formattedPanelValueString")));for(var n=e.get("model.ssoPanels"),r=n.length-1;r>=0;r-=1){var l=n.objectAt(r);l&&null==l.get("id")&&e.store.unloadRecord(l)}$("#progressHudOverlay").hide(),_success("The landing single sign-on theme has been updated.")},function(e){App.FailureHandler("save the landing single sign-on theme for this account")(e)})}else _alert("Please provide a Left or a Right Panel template.","error")}}})}),define("shift4tress/controllers/management/be-theme/sso-theme/login-template/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({fortressPanelEditingAllowed:!1,vt4PanelEditingAllowed:!1,actions:{show4tressHelpModal:function(){setTimeout(function(){$("#help-modal-4tress").modal("show")})},showVT4HelpModal:function(){setTimeout(function(){$("#help-modal-vt4").modal("show")})},toggleEditMode:function(e){if("4tress"==e){var a=this.get("model.fortressPanel");a&&(this.get("fortressPanelEditingAllowed")&&a.set("tempPanelValue",encodeURIComponent($("#editor1").val())),this.set("fortressPanelEditingAllowed",!this.get("fortressPanelEditingAllowed")),$("#editor1").val(this.get("fortressPanelEditingAllowed")?decodeURIComponent(a.get("tempPanelValue")):a.get("formattedPanelValueString")),$("#editor1").ckeditor().editor.setReadOnly(!this.get("fortressPanelEditingAllowed")),t["default"].run.later(function(){$("#editor1").ckeditor().editor.resetUndo()}))}else if("vt4"==e){var n=this.get("model.vt4Panel");n&&(this.get("vt4PanelEditingAllowed")&&n.set("tempPanelValue",encodeURIComponent($("#editor2").val())),this.set("vt4PanelEditingAllowed",!this.get("vt4PanelEditingAllowed")),$("#editor2").val(this.get("vt4PanelEditingAllowed")?decodeURIComponent(n.get("tempPanelValue")):n.get("formattedPanelValueString")),$("#editor2").ckeditor().editor.setReadOnly(!this.get("vt4PanelEditingAllowed")),t["default"].run.later(function(){$("#editor2").ckeditor().editor.resetUndo()}))}else console.log("LoginTemplate - toggleEditMode - panel value is not recognized")},promptRestore4tressDefaultTemplate:function(){setTimeout(function(){$("#restore-4tress-default-modal").modal("show")})},promptRestoreVT4DefaultTemplate:function(){setTimeout(function(){$("#restore-vt4-default-modal").modal("show")})},confirmRestore4tressDefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultSsoPage",{parentBusinessEntityId:e.get("id"),pageTypeId:SSO_PAGE_TYPE_LOGIN,panelTypeId:SSO_PANEL_TYPE_LEFT,applicationGroupId:APPLICATION_GROUP_4TRESS}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject"),n=null;if(1==a.get("defaultSsoPanels.length")&&(n=a.get("defaultSsoPanels.firstObject")),n){var r=t.get("model.fortressPanel");r?(r.set("tempPanelValue",n.get("panelValue")),$("#editor1").val(t.get("fortressPanelEditingAllowed")?decodeURIComponent(r.get("tempPanelValue")):r.get("formattedPanelValueString"))):console.log("Login Page Error: Confirm Restore "+t.get("theme.appName")+" Panel - No "+t.get("theme.appName")+" Panel set on page."),t.store.unloadRecord(n)}else console.log("Login Page Error: Confirm Restore "+t.get("theme.appName")+" Panel - No Default Panel.");t.store.unloadRecord(a)}$("#restore-4tress-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default "+t.get("theme.appName")+" single sign-on panel for this account")(e)})},confirmRestoreVT4DefaultTemplate:function(){var e=this.get("navigation.selectedBE"),t=this;e.get("content")&&(e=e.get("content")),$("#progressHudOverlay").show(),this.store.query("defaultSsoPage",{parentBusinessEntityId:e.get("id"),pageTypeId:SSO_PAGE_TYPE_LOGIN,panelTypeId:SSO_PANEL_TYPE_LEFT,applicationGroupId:APPLICATION_GROUP_VT4}).then(function(e){if($("#progressHudOverlay").hide(),1==e.get("length")){var a=e.get("firstObject"),n=null;if(1==a.get("defaultSsoPanels.length")&&(n=a.get("defaultSsoPanels.firstObject")),n){var r=t.get("model.vt4Panel");r?(r.set("tempPanelValue",n.get("panelValue")),$("#editor2").val(t.get("vt4PanelEditingAllowed")?decodeURIComponent(r.get("tempPanelValue")):r.get("formattedPanelValueString"))):console.log("Landing Page Error: Confirm Restore VT4 Panel - No VT4 Panel set on page."),t.store.unloadRecord(n)}else console.log("Login Page Error: Confirm Restore VT4 Panel - No Default Panel.");t.store.unloadRecord(a)}$("#restore-vt4-default-modal").modal("hide")},function(e){App.FailureHandler("retrieve the default VT4 single sign-on panel for this account")(e)})},cancelUpdate:function(){var e=this.get("model.fortressPanel"),t=this.get("model.vt4Panel");e&&(e.get("tempPanelValue")!=e.get("panelValue")&&e.set("tempPanelValue",e.get("panelValue")),$("#editor1").val(this.get("fortressPanelEditingAllowed")?decodeURIComponent(e.get("tempPanelValue")):e.get("formattedPanelValueString")),e.rollbackAttributes()),t&&(t.get("tempPanelValue")!=t.get("panelValue")&&t.set("tempPanelValue",t.get("panelValue")),$("#editor2").val(this.get("vt4PanelEditingAllowed")?decodeURIComponent(t.get("tempPanelValue")):t.get("formattedPanelValueString")),t.rollbackAttributes()),this.transitionToRoute("management")},save:function(){var e=this;if($("#LoginTemplateForm").valid())if(""!=$("#editor1").val()&&""!=$("#editor2").val()){$("#editor1").ckeditor().editor.setMode("wysiwyg"),$("#editor2").ckeditor().editor.setMode("wysiwyg");var t=e.get("model.fortressPanel"),a=e.get("model.vt4Panel");t&&(e.get("fortressPanelEditingAllowed")&&t.set("tempPanelValue",encodeURIComponent($("#editor1").val())),t.set("panelValue",t.get("tempPanelValue"))),a&&(e.get("vt4PanelEditingAllowed")&&a.set("tempPanelValue",encodeURIComponent($("#editor2").val())),a.set("panelValue",a.get("tempPanelValue"))),$("#progressHudOverlay").show(),e.get("model").save().then(function(){t&&(t.set("tempPanelValue",t.get("panelValue")),$("#editor1").val(e.get("leftPanelEditingAllowed")?decodeURIComponent(t.get("tempPanelValue")):t.get("formattedPanelValueString"))),a&&(a.set("tempPanelValue",a.get("panelValue")),$("#editor2").val(e.get("rightPanelEditingAllowed")?decodeURIComponent(a.get("tempPanelValue")):a.get("formattedPanelValueString")));for(var n=e.get("model.ssoPanels"),r=n.length-1;r>=0;r-=1){var l=n.objectAt(r);l&&null==l.get("id")&&e.store.unloadRecord(l)}$("#progressHudOverlay").hide(),_success("The login single sign-on theme has been updated.")},function(e){App.FailureHandler("save the login single sign-on theme for this account")(e)})}else""!=$("#editor1").val()?_alert("Please provide a VT4 Login Panel template.","error"):""!=$("#editor2").val()?_alert("Please provide a(n) "+e.get("model.provisionedTheme.appName")+" Login Panel template.","error"):_alert("Please provide a(n) "+e.get("model.provisionedTheme.appName")+" Login Panel template and a VT4 Login Panel template.","error")}}})}),define("shift4tress/controllers/management/be-theme",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/billing/billable-activities/billable-activity",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isEditDisabled:function(){var e=App.currentSession.get("user");return!e.hasPermission("canPeriod","shift4User",e.get("parentBusinessEntity"))||!e.get("canEditBillableActivities")}.property("model","model.company.businessEntity"),actions:{goBack:function(){this.model.rollbackAttributes(),window.history.back()},save:function(){this.get("model.hasDirtyAttributes")&&$("form").valid()&&this.model.save().then(function(){_alert("The billable activity has been updated.","success")},App.FailureHandler("save this billable activity"))},doNavigate:function(){transition=this.get("lastTransition"),transition&&(window.onbeforeunload=null,this._transition=!0,transition.retry().then(this._transition=!1))},unassignActivityAssignment:function(e){e.destroyRecord().then(function(){_alert("The billable activity has been unassigned.","success")},App.FailureHandler("unassign a billable activity"))}}})}),define("shift4tress/controllers/management/billing/billable-activities/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortedActivities:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,actions:{newBillableActivity:function(){var e=this;this.set("newBillableActivity",this.store.createRecord("billableActivity")),$("#newBillableActivity").modal("show"),$("#newBillableActivity").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},cancelAdd:function(){this.get("newBillableActivity").unloadRecord(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm()},createBillableActivity:function(){if($("form").valid()){var e=this;this.get("newBillableActivity").save().then(function(t){_alert("The billable activity has been added.","success"),$("#newBillableActivity").modal("hide"),$("#newBillableActivity").on("hidden.bs.modal",function(a){e.transitionToRoute("management.billing.billableActivities.billableActivity",t.id)})},App.FailureHandler("add a billable activity"))}},sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("descending"))}}})}),define("shift4tress/controllers/management/billing/billable-activities",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({actions:{error:function(e,t){return this.transitionTo("management.billing"),!0}}})}),define("shift4tress/controllers/management/billing/billable-products/billable-product/assign-activities",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({billableProduct:t["default"].inject.controller("management.billing.billableProducts.billableProduct"),actions:{assignBillableActivities:function(e){var t=this,a=!0;$("#progressHudOverlay").show();var n=[];e.forEach(function(e){if(e.get("checked")){var r=t.store.createRecord("productBillableActivity");r.set("billableActivity",e),r.set("billableProduct",t.get("billableProduct").get("model")),n.push(r.save().then(function(){},App.FailureHandler("assign a billable activity",function(){a=!1})))}}),Em.RSVP.all(n).then(function(){$("#progressHudOverlay").hide(),a&&($("#addActivityAssignment").modal("toggle"),_alert("The billable activity has been assigned.","success"))})},toggleChecked:function(e){e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/billing/billable-products/billable-product",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isEditDisabled:function(){var e=App.currentSession.get("user");return!e.hasPermission("canPeriod","shift4User",e.get("parentBusinessEntity"))||!e.get("canEditBillableProducts")}.property("model"),actions:{goBack:function(){this.model.rollbackAttributes(),this.transitionToRoute("management.billing.billableProducts")},toggleEdit:function(){this.toggleProperty("isEditDisabled")},save:function(){var e=this;$("form").valid()&&this.get("model.hasDirtyAttributes")&&(this.set("isEditDisabled",!0),this.model.save().then(function(){e.set("isEditDisabled",!1),_alert("The billable product has been updated.","success")},App.FailureHandler("save this billable product")))},doNavigate:function(){transition=this.get("lastTransition"),transition&&(window.onbeforeunload=null,this._transition=!0,transition.retry().then(this._transition=!1))},unassignActivityAssignment:function(e){e.destroyRecord().then(function(e){_alert("The billable activity has been unassigned.","success")},function(t){e.rollbackAttributes(),App.FailureHandler(["unassign a billable activity","Please verify that the activity is not assigned to a Billable Activity Rate and try again."])(t)})}}})}),define("shift4tress/controllers/management/billing/billable-products/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortedBillableProducts:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,actions:{newBillableProduct:function(){this.set("newBillableProduct",this.store.createRecord("billableProduct")),$("#newBillableProduct").modal("show")},cancelAdd:function(){this.get("newBillableProduct").unloadRecord(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm()},createBillableProduct:function(){if($("form").valid()){var e=this;this.get("newBillableProduct").save().then(function(t){$("#newBillableProduct").on("hidden.bs.modal",function(a){e.transitionToRoute("management.billing.billableProducts.billableProduct",t.id)}),$("#newBillableProduct").modal("hide"),_alert("The billable product has been added.","success")},App.FailureHandler("add a billable product"))}},sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("descending"))}}})}),define("shift4tress/controllers/management/billing/billable-products",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({actions:{error:function(e,t){return this.transitionTo("management.billing"),!0}}})}),define("shift4tress/controllers/management/billing/billing-cycles/billing-cycle",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({errorCountMessage:function(){var e=this.get("model.errorCount");return 1==e?e.toLocaleString()+" Failure Exists":e.toLocaleString()+" Failures Exist"}.property("model.errorCount"),hasErrors:function(){return this.get("model.errorCount")>0}.property("model.errorCount"),nextStep:function(){var e,t,a=new Date,n=new Date(this.get("model.invoiceGenerationDateTime")),r=new Date(this.get("model.invoiceNotificationDateTime")),l=new Date(this.get("model.paymentChargeDateTime")); n>a?(e="Invoice Generation Date",t=n):r>a?(e="Invoice Notification Date",t=r):l>a?(e="Payment Charge Date",t=l):a>l&&(e="Waiting for next billing cycle",t=n,t.setMonth(t.getMonth()+1));var d={nextStepName:e,nextStepCountdown:this.getDateDiff(a,t)};return d}.property("model"),getDateDiff:function(e,t){var a=Math.floor((t-e)/1e3),n=Math.floor(a/60),r=Math.floor(n/60),l=Math.floor(r/24);r-=24*l,n=n-24*l*60-60*r,a=a-24*l*60*60-60*r*60-60*n;var d="";return 1==l?d+=l+" day, ":l>1&&(d+=l+" days, "),1==r?d+=r+" hour":r>1&&(d+=r+" hours"),d},actions:{billingCyclePauseConfirm:function(){$(".alert").alert("close"),$("#billingCyclePause-modal").modal("toggle")},billingCyclePause:function(){var e=this.store.peekAll("billingCycle").objectAt(0);e.set("isPaused",!0),$("#progressHudMessage").html("Pausing..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The billing cycle has been paused.","success")},function(t){$("#progressHudOverlay").hide(),e.rollbackAttributes(),App.FailureHandler("pause the billing cycle")})},billingCycleResumeConfirm:function(){$(".alert").alert("close"),$("#billingCycleResume-modal").modal("toggle")},billingCycleResume:function(){var e=this.store.peekAll("billingCycle").objectAt(0);e.set("isPaused",!1),$("#progressHudMessage").html("Resuming..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The billing cycle has been resumed.","success")},function(t){$("#progressHudOverlay").hide(),e.rollbackAttributes(),App.FailureHandler("resume the billing cycle")})}}})}),define("shift4tress/controllers/management/billing/billing-cycles/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortedBillingCycles:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,sortingNamespace:"billingCycleList",actions:{sortBy:function(e){$("#"+this.get("sortingNamespace")+" .sortBy").removeClass("ascending"),$("#"+this.get("sortingNamespace")+" .sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("descending"))}}})}),define("shift4tress/controllers/management/billing/billing-failures/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortedFailures:t["default"].computed.sort("model","sortProperties"),sortProperties:["invoiceId:asc"],sortAscending:!0,sortingNamespace:"billingFailureList",rerunType:"",actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending");var t=e.toPropertyId();this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[t?t:e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[t?t:e]).addClass("descending"))},goBack:function(){window.history.back()},rerunBillingCycle:function(){this.set("rerunType","rerunBillingCycle"),$("#billingFailureSection .prompt-modal .modal-title").html("Rerun Billing Cycle"),$("#billingFailureSection .prompt-modal .modal-body .message").html("This will rerun all steps in the current billing cycle, are you sure you would like to rerun the billing cycle? If the controller is paused, it will need to be unpaused before the rerun will begin."),$("#billingFailureSection .prompt-modal").modal("toggle")},rerunFailedPayments:function(){this.set("rerunType","rerunFailedPayments"),$("#billingFailureSection .prompt-modal .modal-title").html("Rerun Failed Payments"),$("#billingFailureSection .prompt-modal .modal-body .message").html("This will rerun all payments that failed to post to DOLLARS ON THE NET in the current billing cycle, are you sure you would like to rerun all failed payments? If the controller is paused, it will need to be unpaused before the rerun will begin."),$("#billingFailureSection .prompt-modal").modal("toggle")},promptAccept:function(){var e=this.store.peekAll("billingCycle").objectAt(0);e.set("isRerun",!0),e.set("rerunType",this.get("rerunType")),$("#progressHudMessage").html("Rerunning..."),$("#progressHudOverlay").show();var t=this;e.save().then(function(e){$("#progressHudOverlay").hide();var a="";"rerunBillingCycle"==t.get("rerunType")?a="The billing cycle rerun has started.":"rerunFailedPayments"==t.get("rerunType")&&(a="The failed payments rerun has started."),_alert(a,"success")},function(a){$("#progressHudOverlay").hide(),e.rollbackAttributes();var n="";"rerunBillingCycle"==t.get("rerunType")?n="rerun the billing cycle":"rerunFailedPayments"==t.get("rerunType")&&(n="rerun the failed payments"),App.FailureHandler(n)(a)})}}})}),define("shift4tress/controllers/management/billing/rate-profiles/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({billableProducts:function(){return this.store.query("billableProduct",{fulldetail:!0})}.property("model"),selectedBillableProduct:null,sortedRateProfiles:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("descending"))},newRateProfile:function(){var e=this;this.set("newRateProfile",this.store.createRecord("rateProfile")),$("#newRateProfile").modal("show"),$("#newRateProfile").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},cancelAdd:function(){var e=this;this.get("newRateProfile").unloadRecord(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm(),e.set("selectedBillableProduct",null)},createRateProfile:function(){if($("form").valid()){var e=this,t=e.store.peekRecord("billableProduct",this.get("selectedBillableProduct")),a=this.get("newRateProfile");a.set("billableProduct",t),a.save().then(function(t){e.set("selectedBillableProduct",null),_alert("The rate profile has been added.","success"),$("#newRateProfile").modal("hide"),$("#newRateProfile").on("hidden.bs.modal",function(a){e.transitionToRoute("management.billing.rateProfiles.rateProfile",t.id)})},App.FailureHandler("add a rate profile"))}},confirmCloneRateProfile:function(e){this.set("activeRateProfile",e),$("#nav-modal .modal-title").html("Confirm Clone"),$("#nav-modal #modalMessage").html("Are you sure you want to clone this rate profile and all of its rates?"),$("#nav-modal").modal("toggle")},doNavigate:function(){this.send("cloneRateProfile")},cloneRateProfile:function(){var e,t=this,a=this.get("activeRateProfile");$("#progressHudOverlay").show();for(var n=a.get("name")+" Copy",r=function(){var e=t.store.peekAll("rateProfile").filter(function(e){var t=e.get("name")==n;return t});return e.get("length")};r()>0;){var l=n,d=l.match(/(.+) [0-9]+?$/),i=d?d[1]:l,o=parseInt(l.match(/ [0-9]+?$/)),s=o?o:0;n=i+" "+(s+1)}0==r()&&(e=this.store.createRecord("rateProfile"),e.set("name",n),e.set("billableProduct",a.get("billableProduct")),e.set("description",a.get("description"))),e&&e.save().then(function(){return t.store.query("billableActivityRate",{rateprofileid:a.get("id")}).then(function(a){var n=[];a.forEach(function(a){var r=t.store.createRecord("billableActivityRate");r.set("rate",a.get("rate")),r.set("productBillableActivity",a.get("productBillableActivity")),r.set("rateProfile",e),r.set("isAllowUseEnabled",a.get("isAllowUseEnabled")),r.set("calculatePerOrganization",a.get("calculatePerOrganization")),r.set("calculatePerMerchant",a.get("calculatePerMerchant")),r.set("applyAtActivityInsertion",a.get("applyAtActivityInsertion")),r.set("includeCardTenders",a.get("includeCardTenders")),r.set("includeCashTenders",a.get("includeCashTenders")),r.set("includeCheckTenders",a.get("includeCheckTenders")),r.set("includeMemberTenders",a.get("includeMemberTenders")),r.save().then(function(){},function(){n.push(r)})}),n.length>0?App.FailureHandler(["save "+n.length+" billable activity rate"+(1==n.length?"":"s")+" for cloned rate profile",'You can manually create the missing billable activity rates for the "'+e.get("name")+'" rate profile.'])({status:999}):_success('Rate profile successfully cloned as "'+e.get("name")+'"'),$("#progressHudOverlay").hide()},App.FailureHandler("get rate profile's billable activity rates"))},App.FailureHandler("save cloned rate profile"))}}})}),define("shift4tress/controllers/management/billing/rate-profiles/rate-profile/assign-business-entities",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({actions:{assignBusinessEntities:function(e){var t=this,a=!0;$("#progressHudOverlay").show();var n=[];e.forEach(function(e){if(e.get("checked")){var r=t.store.createRecord("rateProfileBusinessEntityAssignment");r.set("businessEntity",e),r.set("rateProfile",t.get("rateProfile")),n.push(r.save().then(function(){},App.FailureHandler("assign a business entity",function(){t.store.unloadRecord(r),a=!1})))}}),Em.RSVP.all(n).then(function(){$("#progressHudOverlay").hide(),a&&($("#addBusinessEntityAssignment").modal("toggle"),_alert("The business entity has been assigned.","success"))})},toggleChecked:function(e){e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/billing/rate-profiles/rate-profile",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({checkBARs:function(){var e=this,t=this.get("model");this.set("isMissingActivities",!1),t.get("billableProduct.productBillableActivities").forEach(function(a){var n=a.get("billableActivity"),r=!0;if(t.get("billableActivityRates").any(function(e){return e.get("productBillableActivity.billableActivity.id")==n.get("id")?(r=!1,!0):void 0}),r){var l=e.store.createRecord("billableActivityRate");l.set("productBillableActivity",a),l.set("rateProfile",t),e.set("isMissingActivities",!0)}})}.observes("model","billableProduct.productBillableActivities","billableActivityRates"),notifyMissingActivities:function(){this.get("isMissingActivities")&&_info('This rate profile is missing activity rates. Please provide rates for the activities marked "NEW".')}.observes("isMissingActivities"),isEditDisabled:function(){var e=App.currentSession.get("user");return!e.hasPermission("canPeriod","shift4User",e.get("parentBusinessEntity"))||!e.get("canEditRateProfiles")}.property("model"),isRelationsDirty:function(){var e=!1;return this.get("model.billableActivityRates").any(function(t){return t.get("hasDirtyAttributes")?(e=!0,!0):void 0}),e}.property("model.billableActivityRates","model.billableActivityRates.@each.hasDirtyAttributes"),isRelationsNew:function(){var e=!1,t=this.get("billableActivityRates");return t&&t.any(function(t){return t.get("isNew")?(e=!0,!0):void 0}),e}.property("billableActivityRates"),indicateNewRelations:function(){this.get("isRelationsNew")&&this.set("isEditDisabled",!1)}.observes("isRelationsNew").on("init"),actions:{addRate:function(e){console.log(e)},unassignBusinessEntity:function(e){e.deleteRecord(),e.save().then(function(){_alert(e.get("businessEntity.name")+" has been unassigned.","success")})},goBack:function(){this.model.rollbackAttributes(),this.get("model.billableActivityRates").forEach(function(e){0==e.get(".isNew")&&e.rollbackAttributes(),e.get("linkedComponent").updateRates()}),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm(),window.history.back()},save:function(){if((this.get("model.hasDirtyAttributes")||this.get("isRelationsDirty"))&&(this.model.get("billableActivityRates").forEach(function(e){e.get("linkedComponent").pruneValues()}),$("form").valid())){var e=[];this.get("model.billableActivityRates").forEach(function(t){t.get("hasDirtyAttributes")&&e.push(t.save())}),this.get("model.hasDirtyAttributes")&&e.push(this.model.save()),e.length&&$("#progressHudOverlay").show(),Em.RSVP.all(e).then(function(){$("#progressHudOverlay").hide(),_alert("The rate profile has been updated.","success")},App.FailureHandler(["save this rate profile","Please confirm that all input is correct and try again."]))}},doNavigate:function(){transition=this.get("lastTransition"),transition&&(window.onbeforeunload=null,this._transition=!0,transition.retry().then(this._transition=!1))}}})}),define("shift4tress/controllers/management/billing",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/companies/company/bill-to-accounts/bill-to-account/assign-business-entities",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({billableProducts:function(){return this.store.findAll("billableProduct")}.property("model"),selectedBillableProduct:null,assignmentsVerified:!1,loadingAssignments:!1,verifyAssignments:function(){if(this.set("assignmentsVerified",!1),this.get("selectedBillableProduct")){this.set("loadingAssignments",!0),this.send("clearSelections");var e=this,t=0,a=0,n=[],r=this.get("model"),l=function(){e.set("requestProgressPercent",t/a),e.set("requestProgressStyle","width:"+t/a+"%")},d=function(){a--,l(),0==a&&(e.set("assignmentsVerified",!0),e.set("loadingAssignments",!1))},i=function o(e){n.push(e),e.get("children").forEach(function(e){o(e)})};i(r),n.forEach(function(n){var r=n.get("id");parseInt(r)>0&&(a++,t++,l(),n.set("canAssignBta",!0),n.set("btabeasChecked",!1),e.store.query("rateProfileBusinessEntityAssignment",{businessEntityId:r}).then(function(t){var a=[];if(t.get("length")>0){var l=!1;t.forEach(function(t){a.push(t.get("rateProfile").then(function(){t.get("rateProfile.content.billableProduct.content.id")==e.get("selectedBillableProduct")&&(l=!0)}))}),Em.RSVP.all(a).then(function(){l?e.store.query("billToAccountBusinessEntityAssignment",{businessEntityId:r}).then(function(t){t.get("content.length")>0?(t.forEach(function(t){t.get("billableProduct.id")==e.get("selectedBillableProduct")&&n.set("canAssignBta",!1)}),n.set("btabeasChecked",!0)):(n.set("canAssignBta",!0),n.set("btabeasChecked",!0)),d()},App.FailureHandler("load bill to account assignments",function(){n.set("canAssignBta",!1),d()})):(n.set("canAssignBta",!1),n.set("btabeasChecked",!0))})}else n.set("canAssignBta",!1),n.set("btabeasChecked",!0);d()},App.FailureHandler("load rate profile assignments",function(){d()})))})}}.observes("selectedBillableProduct"),actions:{receiveActivityHelp:function(){$("#receive-activity-help").modal("toggle")},clearSelections:function(){this.set("assignmentsVerified",!1),this.set("model.checked",!1),this.set("model.canAssignBta",!1),this.get("model.children").forEach(function(e){e.set("checked",!1),e.set("canAssignBta",!1),e.get("children").forEach(function(e){e.set("checked",!1),e.set("canAssignBta",!1),e.get("children").forEach(function(e){e.set("checked",!1),e.set("canAssignBta",!1)})})})},assignBusinessEntities:function(e){var t=this;if($("#btabeassign").valid()){var a,n,r;!function(){var l=function(e){if(e.get("checked")){var t=a.store.peekRecord("billableProduct",a.get("selectedBillableProduct")),l=a.store.createRecord("billToAccountBusinessEntityAssignment");l.set("businessEntity",e),l.set("billToAccount",a.get("billToAccount")),l.set("billableProduct",t),r.push(l.save().then(function(e){},function(e){l.deleteRecord(),n=!1,App.FailureHandler(["unassign a business entity","Please verify that the product is not already assigned to your organization and try again."])(e)}))}},d=function i(e){e.forEach(function(e){l(e),i(e.get("children"))})};a=t,n=!0,r=[],l(e),d(e.get("children")),0==r.length?$("#errors").html("Please select an organization or merchant."):($("#progressHudOverlay").show(),Em.RSVP.all(r).then(function(){$("#progressHudOverlay").hide(),n&&($("#addBusinessEntityAssignment").modal("toggle"),_alert("The account(s) have been assigned.","success"))}))}()}},toggleChecked:function(e){e.get("canAssignBta")&&e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/companies/company/bill-to-accounts/bill-to-account/assign-contacts",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortedContacts:t["default"].computed.sort("model","sortProperties"),sortProperties:["firstName:asc"],sortAscending:!0,sortingNamespace:"assignContactList",actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("descending"))},assignContacts:function(e){var t=this,a=!0,n=[],r=0;e.forEach(function(e){if(e.get("checked")){var l=t.store.createRecord("billToAccountContactAssignment");l.set("contact",e),l.set("billToAccount",t.get("billToAccount")),n.push(l.save().then(function(){r++},App.FailureHandler("assign a contact",function(){a=!1})))}}),0==n.length?$("#errors").html("Please select a contact."):($("#progressHudOverlay").show(),Em.RSVP.all(n).then(function(){$("#progressHudOverlay").hide(),a&&($("#addContactAssignment").modal("hide"),r>0&&_alert("The contact(s) have been assigned.","success"))}))},toggleChecked:function(e){e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/companies/company/bill-to-accounts/bill-to-account/bill-to-account-business-entity-assignments",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({billToAccount:t["default"].inject.controller("management.companies.company.billToAccounts.billToAccount"),sortedAssignments:t["default"].computed.sort("model","sortProperties"),sortProperties:["businessEntityName:asc"],sortAscending:!0,sortingNamespace:"btabeList",modalClass:"btabeList",businessEntity:function(){return this.get("billToAccount.model.company.businessEntity")}.property("billToAccount.model.company.businessEntity"),actions:{sortBEAssignmentsBy:function(e){$(".BEAssignment.sortBy").removeClass("ascending"),$(".BEAssignment.sortBy").removeClass("descending");var t=e.toPropertyId();this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#btabeList #"+[t?t:e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#btabeList #"+[t?t:e]).addClass("descending"))},confirmUnassignBusinessEntity:function(e){this.set("promptAction","unassignBusinessEntity"),this.set("pendingUnassign",e),$(".btabeList.prompt-modal .modal-title").html("Confirm Remove"),$(".btabeList.prompt-modal .modal-body .message").html("Are you sure you would like to no longer receive activity from this account?"),$(".btabeList.prompt-modal").modal("toggle")},promptAccept:function(){switch(this.get("promptAction")){case"unassignBusinessEntity":var e=this.get("pendingUnassign");e&&e.destroyRecord().then(function(){_alert("The account has been removed.","success")},App.FailureHandler("unassign a business entity"))}}}})}),define("shift4tress/controllers/management/companies/company/bill-to-accounts/bill-to-account/bill-to-account-contact-assignments",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({billToAccount:t["default"].inject.controller("management.companies.company.billToAccounts.billToAccount"),sortedAssignments:t["default"].computed.sort("model","sortProperties"),sortProperties:["contact.firstName:asc"],sortAscending:!0,sortingNamespace:"btacaList",businessEntity:function(){return this.get("billToAccount.model.company.businessEntity")}.property("billToAccount.model.company.businessEntity"),actions:{sortContactAssignmentsBy:function(e){$(".contactAssignment.sortBy").removeClass("ascending"),$(".contactAssignment.sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",["contact."+e+":asc"]),$("#btacaList #"+[e]).addClass("ascending")):(this.set("sortProperties",["contact."+e+":desc"]),$("#btacaList #"+[e]).addClass("descending"))},unassignContact:function(e){e.destroyRecord().then(function(){_alert("The contact has been unassigned.","success")},App.FailureHandler(["unassign a contact","This account is still receiving activity. At least 1 contact is required."],function(){e.rollbackAttributes()}))}}})}),define("shift4tress/controllers/management/companies/company/bill-to-accounts/bill-to-account",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({paymentMethodChanged:function(){return this.get("selectedPaymentMethod")!=this.get("cachedPaymentMethod")}.property("selectedPaymentMethod","cachedPaymentMethod"),setSelectedPaymentMethod:function(){this.set("selectedPaymentMethod",this.get("model.paymentMethod.id"))}.observes("cachedPaymentMethod"),isEditDisabled:function(){return!App.currentSession.get("user").hasPermission("canEdit","billingBillToAccounts",this.get("model.company.businessEntity"))}.property("model","model.company.businessEntity"),paymentMethods:function(){var e=App.currentSession.get("user"),t=this.get("model.company.businessEntity"),a=(this.get("model.company.businessEntity.id"),this);return e.hasPermission("canView","billingPaymentMethods",t)?this.store.peekAll("paymentMethod",function(e){return e=e.filterBy("company.id",a.get("model.company.id"))}):null}.property("model"),verifiedNameField:function(){return!1}.property("model.name"),actions:{selectPaymentMethod:function(e){this.set("selectedPaymentMethod",e),this.set("model.paymentMethod",this.store.peekRecord("paymentMethod",this.get("selectedPaymentMethod")))},goBack:function(){this._transition=!0,window.history.back()},validateName:function(){if($("#name").valid()){var e=this,t=this.get("model"),a=this.store.peekAll("billToAccount").filter(function(e){return e.get("name")==t.get("name")&&e.get("company.id")==t.get("company.id")?e:void 0});if(a.get("length")>1||1==a.get("length")&&a.get("firstObject.id")!=t.get("id")){var n=$("form").validate();n.showErrors({name:"Must be unique."}),e.set("verifiedNameField",!1)}else e.set("verifiedNameField",!0),e.send("save")}},save:function(){if($("form").valid()&&(this.get("model.hasDirtyAttributes")||this.get("paymentMethodChanged"))){var e=this;this.get("verifiedNameField")&&this.model.save().then(function(){e.set("cachedPaymentMethod",e.get("model.paymentMethod.id")),_success("Your settings have been saved.")},App.FailureHandler("save this bill to account"))}}}})}),define("shift4tress/controllers/management/companies/company/bill-to-accounts/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortProperties:["name"],sortAscending:!0,actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.set("sortProperties",[e]),this.set("sortAscending",!this.get("sortAscending")),1==this.get("sortAscending")?$("#"+e).addClass("descending"):$("#"+e).addClass("ascending")},newBillToAccount:function(){var e=this;this.set("newBillToAccount",this.store.createRecord("billToAccount")),$("#newBillToAccount").modal("show"),$("#newBillToAccount").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},cancelAdd:function(){this.get("newBillToAccount").rollbackAttributes(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm()},createBillToAccount:function(){if($("form").valid()){var e=this;this.get("newBillToAccount").save().then(function(t){_alert("The bill to account has been added.","success"),$("#newBillToAccount").modal("hide"),$("#newBillToAccount").on("hidden.bs.modal",function(a){e.transitionToRoute("management.companies.company.billToAccounts.billToAccount",t.id)})},App.FailureHandler("add a bill to account"))}}}})}),define("shift4tress/controllers/management/companies/company/company-bill-to-accounts",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({company:t["default"].inject.controller("management.companies.company"),sortedAccounts:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,sortingNamespace:"cbtaList",modalClass:"companybilltoaccounts",businessEntity:function(){return this.get("company.model.businessEntity")}.property("company.model.businessEntity"),verifiedNameField:function(){return this.set("retrySave",!1),!1}.property("newBillToAccount.name"),actions:{sortBillToAccountBy:function(e){$(".billToAccount.sortBy").removeClass("ascending"),$(".billToAccount.sortBy").removeClass("descending");var t=e.toPropertyId();this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#cbtaList #"+[t?t:e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#cbtaList #"+[t?t:e]).addClass("descending"))},newBillToAccount:function(){var e=this;this.set("newBillToAccount",this.store.createRecord("billToAccount")),$("#newBillToAccount").modal("show"),$("#newBillToAccount").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},cancelAdd:function(){this.get("newBillToAccount").rollbackAttributes(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm(),$(".help-block").hide()},validateName:function(){if($("#newBillToAccountName").valid()){var e=this,t=this.get("newBillToAccount");this.store.query("billToAccount",{name:t.get("name"),companyid:this.get("company.model.id")}).then(function(t){if(t.get("length")>0){var a=$("#newBillToAccount form").validate();a.showErrors({newBillToAccountName:"Must be unique."}),e.set("verifiedNameField",!1)}else e.set("verifiedNameField",!0),e.get("retrySave")&&(e.set("retrySave",!1),e.send("createBillToAccount"))})}},createBillToAccount:function(){if($("#newBillToAccount form").valid())if(this.get("verifiedNameField")){var e=this,t=this.get("newBillToAccount");t.set("company",this.get("company.model")),t.save().then(function(t){_alert("The bill to account has been added.","success"),$("#newBillToAccount").modal("hide"),$("#newBillToAccount").on("hidden.bs.modal",function(a){e.transitionToRoute("management.companies.company.billToAccounts.billToAccount",t.get("company.businessEntity.id"),t.get("company.id"),t.id)})},App.FailureHandler("add a bill to account"))}else this.set("retrySave",!0),this.send("validateName")},confirmDeleteBillToAccount:function(e){this.set("promptAction","deleteBillToAccount"),this.set("pendingDelete",e),$(".companybilltoaccounts.prompt-modal .modal-title").html("Confirm Delete"),$(".companybilltoaccounts.prompt-modal .modal-body .message").html("Are you sure you would like to delete this bill to account?"),$(".companybilltoaccounts.prompt-modal").modal("toggle")},promptAccept:function(){switch(this.get("promptAction")){case"deleteBillToAccount":var e=this.get("pendingDelete");e&&t["default"].run.next(function(){e.destroyRecord().then(function(){_alert("The bill to account has been deleted.","success")},App.FailureHandler(['delete "'+e.get("name")+'"',"Please remove all accounts this bill to account is receiving activity from before deleting."],function(){e.rollbackAttributes()}))})}}}})}),define("shift4tress/controllers/management/companies/company/company-contacts",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({company:t["default"].inject.controller("management.companies.company"),sortedContacts:t["default"].computed.sort("model","sortProperties"),sortProperties:["firstName:asc"],sortAscending:!0,sortingNamespace:"companyContactList",modalClass:"companycontacts",isLoading:!1,businessEntity:function(){return this.get("company.model.businessEntity")}.property("company.model.businessEntity"),actions:{sortContactsBy:function(e){$(".companyContacts.sortBy").removeClass("ascending"),$(".companyContacts.sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#companyContactList #"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#companyContactList #"+[e]).addClass("descending"))},newContact:function(){var e=this;this.set("newContact",this.store.createRecord("contact")),$("#newContact").modal("show"),$("#newContact").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},cancelAdd:function(){this.get("newContact").rollbackAttributes(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm()},createContact:function(){if($("#newContact form").valid()){this.set("isLoading",!0);var e=this,t=this.get("newContact");t.set("company",this.get("company.model")),t.save().then(function(t){e.set("isLoading",!1),_alert("The contact has been added.","success"),$("#newContact").modal("hide"),$("#newContact").on("hidden.bs.modal",function(t){e.transitionToRoute("management.companies.company")})},App.FailureHandler("add a contact"))}},confirmDeleteContact:function(e){this.set("promptAction","deleteContact"),this.set("pendingDelete",e),$(".companycontacts.prompt-modal .modal-title").html("Confirm Delete"),$(".companycontacts.prompt-modal .modal-body .message").html("Are you sure you would like to delete this contact?"),$(".companycontacts.prompt-modal").modal("toggle")},promptAccept:function(){switch(this.get("promptAction")){case"deleteContact":var e=this.get("pendingDelete"),a=this.get("company.model");e&&(a.get("billToAccounts").forEach(function(t){t.get("billToAccountContactAssignments").forEach(function(t){t.get("contact.id")==e.id&&t.unloadRecord()})}),t["default"].run.next(function(){e.destroyRecord().then(function(){_alert("The contact has been deleted.","success")},App.FailureHandler(['delete "'+e.get("fullName")+'"',"This contact is the only contact assigned to bill to accounts(s) still receiving activity. Please assign another contact to the active bill to account(s) before deleting."],function(){e.rollbackAttributes()}))}))}}}})}),define("shift4tress/controllers/management/companies/company/company-payment-methods",["exports","ember","shift4tress/mixins/payment-method","shift4tress/utils/utils"],function(e,t,a,n){e["default"]=t["default"].Controller.extend(a["default"],{company:t["default"].inject.controller("management.companies.company"),sortedPaymentMethods:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,sortingNamespace:"companyPaymentMethodList",modalClass:"companyPaymentMethods",businessEntity:function(){return this.get("company.model.businessEntity")}.property("company.model.businessEntity"),i4GoStatus:"DEFAULT",i4GoStatuses:{Default:"DEFAULT",GettingIpAddress:"GETTING_IP_ADDRESS",Authorizing:"AUTHORIZING",Authorized:"AUTHORIZED",Tokenizing:"TOKENIZING",Tokenized:"TOKENIZED"},i4GoAuthorizeResponse:null,i4GoTokenizeRequestSent:!1,i4GoTokenizeRequestTimeoutSeconds:20,i4GoTokenizeResponse:{uniqueId:null,cardType:null,expirationMonth:null,expirationYear:null},isPaymentMethodTypeCreditCard:function(){return this.get("newPaymentMethod.paymentMethodType.id")==this.creditCard_paymentMethodTypeId}.property("newPaymentMethod.paymentMethodType"),isPaymentMethodTypeAchUs:function(){return this.get("newPaymentMethod.paymentMethodType.id")==this.achUs_paymentMethodTypeId}.property("newPaymentMethod.paymentMethodType"),isPaymentMethodTypeAchCanada:function(){return this.get("newPaymentMethod.paymentMethodType.id")==this.achCanada_paymentMethodTypeId}.property("newPaymentMethod.paymentMethodType"),updatei4GoStatus:function(){switch(this.get("i4GoStatus")){case this.get("i4GoStatuses").GettingIpAddress:case this.get("i4GoStatuses").Authorizing:$("#progressHudMessage").html("Authorizing i4Go..."),$("#progressHudOverlay").show();break;case this.get("i4GoStatuses").Tokenizing: $("#progressHudMessage").html("Tokenizing..."),$("#progressHudOverlay").show();break;case this.get("i4GoStatuses").Default:case this.get("i4GoStatuses").Authorized:case this.get("i4GoStatuses").Tokenized:default:$("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").hide()}}.observes("i4GoStatus"),clearPaymentTypeFields:function(){this.set("creditCard_cardholderName",""),this.set("creditCard_cardType",""),this.set("creditCard_cardNumber",""),this.set("creditCard_expirationMonth",""),this.set("creditCard_expirationYear",""),this.set("creditCard_csc",""),this.set("achUs_routingNumber",""),this.set("achUs_accountNumber",""),this.set("achCanada_transitNumber",""),this.set("achCanada_accountNumber","")}.observes("newPaymentMethod.paymentMethodType"),paymentMethodTypes:function(){return this.store.peekAll("paymentMethodType")}.property("model"),authorizeClientFori4Go:function(){this.get("i4GoStatus")==this.get("i4GoStatuses").Default&&this.getClientIpAddress()},getClientIpAddress:function(){this.set("i4GoStatus",this.get("i4GoStatuses").GettingIpAddress);var e=this;$.ajax({url:e.get("apiPath.paymentApiUrl")+"/ipaddresses/current",type:"GET"}).then(function(t){e.set("i4GoAuthorizeRequest",{clientIpAddress:t.ipAddress}),e.authorizeClientIpAddress()},function(t){e.set("i4GoStatus",e.get("i4GoStatuses").Default),App.FailureHandler("get the current IP address")})},authorizeClientIpAddress:function(){this.set("i4GoStatus",this.get("i4GoStatuses").Authorizing);var e=this;$.ajax({url:e.get("apiPath.paymentApiUrl")+"/i4goauthorizations",type:"POST",data:JSON.stringify(this.get("i4GoAuthorizeRequest")),dataType:"json",contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},processData:!1}).then(function(t){0==t.response.code&&t.i4GoAuthorization?(e.i4GoAuthorizeResponse=t.i4GoAuthorization,e.set("i4GoStatus",e.get("i4GoStatuses").Authorized)):(e.set("i4GoStatus",e.get("i4GoStatuses").Default),App.FailureHandler("authorize the current IP address with i4Go")({status:500}))},function(t){e.set("i4GoStatus",e.get("i4GoStatuses").Default),App.FailureHandler("authorize the current IP address with i4Go")})},tokenizePaymentMethod:function(){this.set("i4GoStatus",this.get("i4GoStatuses").Tokenizing);var e={fuseaction:"account.jsonpPostCardEntry",i4Go_callback:"parsei4GoResponseInline",i4Go_accessBlock:this.i4GoAuthorizeResponse.accessBlock};this.get("newPaymentMethod.isPaymentMethodTypeCreditCard")?(e.i4Go_cardholderName=this.creditCard_cardholderName,e.i4Go_cardType=this.creditCard_cardType,e.i4Go_cardNumber=this.creditCard_cardNumber,e.i4Go_expirationMonth=this.creditCard_expirationMonth,e.i4Go_expirationYear=this.creditCard_expirationYear,e.i4Go_cvv2Code=this.creditCard_csc):this.get("newPaymentMethod.isPaymentMethodTypeAchUs")?(e.i4Go_routingNumber=this.achUs_routingNumber,e.i4Go_bankAccountNumber=this.achUs_accountNumber):this.get("newPaymentMethod.isPaymentMethodTypeAchCanada")&&(e.i4Go_routingNumber=this.achCanada_transitNumber,e.i4Go_bankAccountNumber=this.achCanada_accountNumber);var t=this;$.ajax({url:this.i4GoAuthorizeResponse.serverUrl,dataType:"jsonp",data:e,timeout:1e3*this.i4GoTokenizeRequestTimeoutSeconds}).then(function(e){},function(e){e.statusText&&"timeout"==e.statusText&&(t.set("i4GoTokenizeRequestSent",!1),t.getClientIpAddress(),App.FailureHandler("tokenize the payment information")(e))}),this.set("i4GoTokenizeRequestSent",!0)},verifiedNameField:function(){return this.set("retrySave",!1),!1}.property("newBillToAccount.name"),actions:{sortPaymentMethodsBy:function(e){$(".companyPaymentMethods.sortBy").removeClass("ascending"),$(".companyPaymentMethods.sortBy").removeClass("descending");var t=e.toPropertyId();this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#companyPaymentMethodList #"+[t?t:e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#companyPaymentMethodList #"+[t?t:e]).addClass("descending"))},paymentMethodTypeChanged:function(e){this.set("newPaymentMethod.paymentMethodType",this.store.peekRecord("paymentMethodType",e))},cardTypeChanged:function(e){this.set("creditCard_cardType",this.get("creditCard_cardTypes").findBy("value",e))},newPaymentMethod:function(){var e=this;this.set("newPaymentMethod",this.store.createRecord("paymentMethod")),$("#newPaymentMethod").modal("show"),$("#newPaymentMethod").on("hidden.bs.modal",function(t){e.send("cancelAdd")}),this.set("i4GoTokenizeRequestSent",!1),this.authorizeClientFori4Go()},cancelAdd:function(){this.get("newPaymentMethod").rollbackAttributes(),$("#newPaymentMethod form .has-error").removeClass("has-error"),$("#newPaymentMethod form").validate().resetForm()},createPaymentMethod:function(){$("#newPaymentMethod form").valid()&&(1==this.get("verifiedNameField")?0==this.get("i4GoTokenizeRequestSent")&&(r=this,this.tokenizePaymentMethod()):this.send("validateName"))},validateName:function(){if($("#newPaymentMethodName").valid()){var e=this,t=this.get("newPaymentMethod");this.store.query("paymentMethod",{name:t.get("name"),companyid:this.get("company.model.id")}).then(function(t){if(t.get("length")>0){var a=$("#newPaymentMethod form").validate();a.showErrors({newPaymentMethodName:"Must be unique."}),e.set("verifiedNameField",!1)}else e.set("verifiedNameField",!0),e.get("retrySave")&&e.send("saveForm")})}},saveForm:function(){if($("#newPaymentMethod form").valid()){var e=this,t=this.get("newPaymentMethod"),a={};t.get("isPaymentMethodTypeCreditCard")||(t.get("isPaymentMethodTypeAchUs")?a.achUs_accountType=this.get("achUs_accountType"):t.get("isPaymentMethodTypeAchCanada")&&(a.achCanada_accountType=this.get("achCanada_accountType"),a.achCanada_accountCurrency=this.get("achCanada_accountCurrency")));var n=JSON.stringify(a);this.set("newPaymentMethod.metadata",n),this.get("verifiedNameField")?(t.set("company",e.get("company.model")),t.save().then(function(t){_alert("The payment method has been added.","success"),$("#newPaymentMethod").modal("hide"),$("#newPaymentMethod").on("hidden.bs.modal",function(t){e.set("i4GoStatus",e.get("i4GoStatuses").Default),e.transitionToRoute("management.companies.company")})},function(t){e.set("i4GoStatus",this.get("i4GoStatuses").Authorized),App.FailureHandler("add a payment method")})):(this.set("retrySave",!0),this.send("validateName"))}else this.set("i4GoStatus",this.get("i4GoStatuses").Tokenized)},parsei4Go:function(e){if("1"==e.i4go_responsecode)this.set("i4GoStatus",this.get("i4GoStatuses").Tokenized),this.set("i4GoTokenizeResponse.uniqueId",e.i4go_uniqueid),this.set("i4GoTokenizeResponse.cardType",e.i4go_cardtype),this.set("i4GoTokenizeResponse.expirationMonth",e.i4go_expirationmonth),this.set("i4GoTokenizeResponse.expirationYear",e.i4go_expirationyear),this.set("newPaymentMethod.paymentToken",e.i4go_uniqueid),this.send("saveForm");else{this.set("i4GoStatus",this.get("i4GoStatuses").Authorized);var t,a;switch(e.i4go_responsecode){case"102":case"105":case"106":case"107":case"108":case"109":t=["tokenize the payment information because the card information is invalid","Please review your card information and try again."],a=400;break;default:t="tokenize the payment information (error code: "+e.i4go_responsecode+")",a=500}App.FailureHandler(t)({status:a})}},confirmDeletePaymentMethod:function(e){this.set("promptAction","deletePaymentMethod"),this.set("pendingDelete",e),$(".companyPaymentMethods.prompt-modal .modal-title").html("Confirm Delete"),$(".companyPaymentMethods.prompt-modal .modal-body .message").html("Are you sure you would like to delete this payment method?"),$(".companyPaymentMethods.prompt-modal").modal("toggle")},promptAccept:function(){switch(this.get("promptAction")){case"deletePaymentMethod":var e=this.get("pendingDelete");e&&t["default"].run.next(function(){e.destroyRecord().then(function(){_alert("The payment method has been deleted.","success")},App.FailureHandler(['delete "'+e.get("name")+'"',"This payment method is assigned to bill to account(s) that are still receiving activity. Please assign a different payment method for the active bill to account(s) before deleting."],function(){e.rollbackAttributes()}))})}}}});var r=null;window.parsei4GoResponseInline=function(e){r.send("parsei4Go",e)}}),define("shift4tress/controllers/management/companies/company/contacts/contact",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isSaving:!1,isEditDisabled:function(){return!(App.currentSession.get("user").hasPermission("canEdit","billingContacts",this.get("model.company.businessEntity"))&&(!this.get("model.isReadOnly")||App.currentSession.get("user").hasPermission("canPeriod","shift4User",this.get("model.company.businessEntity"))))}.property("model","model.company.businessEntity"),actions:{goBack:function(){window.history.back()},save:function(){if(this.get("model.hasDirtyAttributes")&&!this.get("isSaving")){var e=this;$("#progressHudMessage").html("Please Wait..."),$("#progressHudOverlay").show(),this.set("isSaving",!0),$("form").valid()&&this.model.save().then(function(){e.set("isSaving",!1),_alert("The contact has been saved.","success"),e.send("goBack")},App.FailureHandler("save this contact",function(){$("#progressHudOverlay").hide()}))}}}})}),define("shift4tress/controllers/management/companies/company/contacts/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({companies:function(){return this.store.peekAll("company")}.property("model"),selectedCompany:null,sortProperties:["firstName"],sortAscending:!0,actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.set("sortProperties",[e]),this.set("sortAscending",!this.get("sortAscending")),1==this.get("sortAscending")?$("#"+e).addClass("descending"):$("#"+e).addClass("ascending")},newContact:function(){var e=this;this.set("newContact",this.store.createRecord("contact")),$("#newContact").modal("show"),$("#newContact").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},cancelAdd:function(){var e=this;this.get("newContact").rollbackAttributes(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm(),e.set("selectedCompany",null)},createContact:function(){if($("form").valid()){var e=this,t=this.get("newContact");t.set("company",this.get("selectedCompany")),t.save().then(function(t){e.set("selectedCompany",null),_alert("The contact has been added.","success"),$("#newContact").modal("hide"),$("#newContact").on("hidden.bs.modal",function(a){e.transitionToRoute("contact",t.id)})},App.FailureHandler("add a contact"))}}}})}),define("shift4tress/controllers/management/companies/company/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isEditDisabled:function(){return!App.currentSession.get("user").hasPermission("canEdit","billingCompanies",this.get("model.businessEntity"))}.property("model.businessEntity","App.currentSession.user.permissions.[]"),verifiedNameField:function(){return this.set("retrySave",!1),!1}.property("model.name"),actions:{goBack:function(){this.transitionToRoute("management.organizations.organization")},validateName:function(){if($("#name").valid()){var e=this,t=this.get("model");$("#progressHudOverlay").show(),this.store.query("company",{name:t.get("name")}).then(function(a){if(a.get("length")>1||1==a.get("length")&&a.get("firstObject.id")!=t.get("id")){var n=$("form").validate();n.showErrors({name:"Must be unique."}),e.set("verifiedNameField",!1),$("#progressHudOverlay").hide()}else e.set("verifiedNameField",!0),e.send("save")})}},save:function(){this.get("model.hasDirtyAttributes")&&$("form#saveCompany").valid()&&this.get("verifiedNameField")&&this.model.save().then(function(){$("#progressHudOverlay").hide(),_alert("The billing company has been updated.","success")},function(e){$("#progressHudOverlay").hide(),App.FailureHandler("save this billing company")(e)})},doNavigate:function(e){transition=this.get("lastTransition"),transition&&(window.onbeforeunload=null,this._transition=!0,transition.retry().then(this._transition=!1))}}})}),define("shift4tress/controllers/management/companies/company/invoices/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({company:t["default"].inject.controller("management.companies.company"),sortedInvoices:t["default"].computed.sort("model","sortProperties"),sortProperties:["id:asc"],sortAscending:!0,currentDownloadToken:null,isDownloadTokenReady:function(){return null!=this.get("currentDownloadToken")}.property("currentDownloadToken"),actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending");var t=e.toPropertyId();this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[t?t:e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[t?t:e]).addClass("descending"))},createDownloadToken:function(e){this.set("currentDownloadToken",null);var t=this;this.store.createRecord("invoiceDownloadToken",{invoiceId:e}).save().then(function(e){t.set("currentDownloadToken",e.id)},App.FailureHandler("prepare the file for download"))},openFileLocation:function(e,t){this.get("isDownloadTokenReady")&&("csv"===t?window.location.assign(this.get("apiPath.billingApiUrl")+"/invoices/raw-"+removePrefixFromInvoiceId(e)+"-"+this.get("currentDownloadToken")+"."+t):window.open(this.get("apiPath.billingApiUrl")+"/invoices/"+removePrefixFromInvoiceId(e)+"-"+this.get("currentDownloadToken")+"."+t,"_blank"))},goBack:function(){this.transitionToRoute("management.organizations.organization")}}})}),define("shift4tress/controllers/management/companies/company/payment-methods/index",["exports","ember","shift4tress/mixins/payment-method","shift4tress/utils/utils"],function(e,t,a,n){e["default"]=t["default"].Controller.extend(a["default"],{creditCard_cardholderName:"",creditCard_cardType:"",creditCard_cardNumber:"",creditCard_expirationMonth:"",creditCard_expirationYear:"",creditCard_csc:"",achUs_routingNumber:"",achUs_accountNumber:"",achCanada_transitNumber:"",achCanada_accountNumber:"",isAuthorizedFori4Go:!1,i4GoAuthorizeRequest:{clientIpAddress:null},i4GoAuthorizeResponse:null,i4GoTokenizeResponse:{uniqueId:null,cardType:null,expirationMonth:null,expirationYear:null},isPaymentMethodTypeCreditCard:function(){return this.get("newPaymentMethod.paymentMethodType.id")==this.creditCard_paymentMethodTypeId}.property("newPaymentMethod.paymentMethodType"),isPaymentMethodTypeAchUs:function(){return this.get("newPaymentMethod.paymentMethodType.id")==this.achUs_paymentMethodTypeId}.property("newPaymentMethod.paymentMethodType"),isPaymentMethodTypeAchCanada:function(){return this.get("newPaymentMethod.paymentMethodType.id")==this.achCanada_paymentMethodTypeId}.property("newPaymentMethod.paymentMethodType"),isApplyDisabled:function(){return!this.get("isAuthorizedFori4Go")}.property("isAuthorizedFori4Go"),sortProperties:["name"],sortAscending:!0,paymentMethodTypes:function(){return this.store.peekAll("paymentMethodType")}.property("model"),authorizeClientFori4Go:function(){this.isAuthorizedFori4Go||this.getClientIpAddress()},getClientIpAddress:function(){var e=this;$.ajax({url:e.get("apiPath.paymentApiUrl")+"/ipaddresses/current",type:"GET"}).then(function(t){e.i4GoAuthorizeRequest.clientIpAddress=t.ipAddress,e.authorizeClientIpAddress()},App.FailureHandler("get the current IP address"))},authorizeClientIpAddress:function(){var e=this;$.ajax({url:e.get("apiPath.paymentApiUrl")+"/i4goauthorizations",type:"POST",data:JSON.stringify(this.get("i4GoAuthorizeRequest")),dataType:"json",contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},processData:!1}).then(function(t){e.i4GoAuthorizeResponse=t.i4GoAuthorization,e.set("isAuthorizedFori4Go",!0)},App.FailureHandler("authorize the current IP address with i4Go"))},tokenizePaymentMethod:function(){var e={fuseaction:"account.jsonpPostCardEntry",i4Go_callback:"parsei4GoResponse",i4Go_accessBlock:this.i4GoAuthorizeResponse.accessBlock};this.get("isPaymentMethodTypeCreditCard")?(e.i4Go_cardholderName=this.creditCard_cardholderName,e.i4Go_cardType=this.creditCard_cardType,e.i4Go_cardNumber=this.creditCard_cardNumber,e.i4Go_expirationMonth=this.creditCard_expirationMonth,e.i4Go_expirationYear=this.creditCard_expirationYear,e.i4Go_cvv2Code=this.creditCard_csc):this.get("isPaymentMethodTypeAchUs")?(e.i4Go_routingNumber=this.achUs_routingNumber,e.i4Go_bankAccountNumber=this.achUs_accountNumber):this.get("isPaymentMethodTypeAchCanada")&&(e.i4Go_routingNumber=this.achCanada_transitNumber,e.i4Go_bankAccountNumber=this.achCanada_accountNumber),$.ajax({url:this.i4GoAuthorizeResponse.serverUrl,dataType:"jsonp",data:e})},actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.set("sortProperties",[e]),this.set("sortAscending",!this.get("sortAscending")),1==this.get("sortAscending")?$("#"+e).addClass("descending"):$("#"+e).addClass("ascending")},newPaymentMethod:function(){var e=this;this.set("newPaymentMethod",this.store.createRecord("paymentMethod")),$("#newPaymentMethod").modal("show"),$("#newPaymentMethod").on("hidden.bs.modal",function(t){e.send("cancelAdd")}),this.authorizeClientFori4Go()},cancelAdd:function(){this.get("newPaymentMethod").rollbackAttributes(),$("form .has-error").removeClass("has-error"),$("form").validate().resetForm()},createPaymentMethod:function(){$("form").valid()&&this.tokenizePaymentMethod()},saveForm:function(){if($("form").valid()){var e=this,t=this.get("newPaymentMethod"),a={};this.get("isPaymentMethodTypeCreditCard")||(this.get("isPaymentMethodTypeAchUs")?a.achUs_accountType=this.get("achUs_accountType"):this.get("isPaymentMethodTypeAchCanada")&&(a.achCanada_accountType=this.get("achCanada_accountType"),a.achCanada_accountCurrency=this.get("achCanada_accountCurrency")));var n=JSON.stringify(a);this.set("newPaymentMethod.metadata",n),t.save().then(function(t){_alert("The payment method has been added.","success"),$("#newPaymentMethod").modal("hide"),$("#newPaymentMethod").on("hidden.bs.modal",function(a){e.transitionToRoute("paymentMethod",t.id)})},App.FailureHandler("add an payment method"))}},parsei4Go:function(e){"1"==e.i4go_responsecode?(this.set("i4GoTokenizeResponse.uniqueId",e.i4go_uniqueid),this.set("i4GoTokenizeResponse.cardType",e.i4go_cardtype),this.set("i4GoTokenizeResponse.expirationMonth",e.i4go_expirationmonth),this.set("i4GoTokenizeResponse.expirationYear",e.i4go_expirationyear),this.set("newPaymentMethod.paymentToken",e.i4go_uniqueid),this.set("creditCard_cardholderName",""),this.set("creditCard_cardType",""),this.set("creditCard_cardNumber",""),this.set("creditCard_expirationMonth",""),this.set("creditCard_expirationYear",""),this.set("creditCard_csc",""),this.set("achUs_routingNumber",""),this.set("achUs_accountNumber",""),this.set("achCanada_transitNumber",""),this.set("achCanada_accountNumber",""),this.send("saveForm")):App.FailureHandler("tokenize the payment information (error code: "+e.i4go_responsecode+")")({status:500})}}})}),define("shift4tress/controllers/management/companies/company/payment-methods/payment-method",["exports","ember","shift4tress/mixins/payment-method","shift4tress/utils/utils"],function(e,t,a,n){e["default"]=t["default"].Controller.extend(a["default"],{updateFromMetadata:function(){var e=JSON.parse(this.get("model.metadata"));null!=e?this.get("model.isPaymentMethodTypeCreditCard")||(this.get("model.isPaymentMethodTypeAchUs")?this.set("achUs_accountType",e.achUs_accountType):this.get("model.isPaymentMethodTypeAchCanada")&&(this.set("achCanada_accountType",e.achCanada_accountType),this.set("achCanada_accountCurrency",e.achCanada_accountCurrency))):(this.set("achCanada_accountType",""),this.set("achCanada_accountType",""),this.set("achCanada_accountCurrency",""))}.observes("model"),paymentMethodTypes:function(){return this.store.peekAll("paymentMethodType")}.property("model"),companies:function(){return this.store.peekAll("company")}.property("model"),isEditDisabled:function(){return!App.currentSession.get("user").hasPermission("canEdit","billingPaymentMethods",this.get("model.company.businessEntity"))}.property("model"),verifiedNameField:function(){return this.set("retrySave",!1),!1}.property("model.name"),actions:{paymentMethodTypeChanged:function(e){this.set("model.paymentMethodType",this.store.peekRecord("paymentMethodType",e))},cardTypeChanged:function(e){this.set("creditCard_cardType",this.get("creditCard_cardTypes").findBy("value",e))},goBack:function(){window.history.back()},validateName:function(){if($("form").valid()){var e=this,t=this.get("model");this.store.query("paymentMethod",{name:t.get("name"),companyid:this.get("model.company.id")}).then(function(a){if(a.get("length")>1||1==a.get("length")&&a.get("firstObject.id")!=t.get("id")){var n=$("form").validate();n.showErrors({name:"Must be unique."}),e.set("verifiedNameField",!1)}else e.set("verifiedNameField",!0),e.send("save")})}},save:function(){this.get("model.hasDirtyAttributes")&&$("form").valid()&&this.get("verifiedNameField")&&this.model.save().then(function(){_alert("The payment method has been updated.","success")},App.FailureHandler("save this payment method"))}}})}),define("shift4tress/controllers/management/groups/group/add-orgs",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({group:t["default"].inject.controller("management.groups.group"),groups:t["default"].inject.controller("management.groups"),patch:function(e){function a(e){if(e.checked){var l=n.get("group").get("model");t["default"].set(l,"merchantCount",l.get("merchantCount")+1),r.push(e.get("id"))}else e.get("children").forEach(function(e){a(e)})}var n=this,r=[];return a(e),$.ajax({url:n.get("apiPath.accountApiUrl")+"/groups/"+n.get("group").get("content.id")+"/businessEntities",type:"POST",data:JSON.stringify(r),dataType:"json",contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.accessToken+'"'},beforeSend:function(e){e.setRequestHeader("X-HTTP-Method-Override","PATCH")}})},actions:{addOrgs:function(e){function t(e){e.get("checked")?n=!0:e.get("children").forEach(function(e){t(e)})}var a=this.get("model"),n=!1;if(t(a),n){var r=this,l=this.patch(e),d=this.get("group").get("model");l.then(function(){r.get("groups").send("refresh"),_alert("The group has been updated.","success"),$("#addOrgs").modal("toggle"),$("#addOrgs").on("hidden.bs.modal",function(){d.set("lastUpdatedAt",new Date),r.transitionToRoute("management.groups.group")})},App.FailureHandler("add the organization to the group"))}else $("#errors").html("Please select an account.")},toggleChecked:function(e){e.toggleProperty("checked")?this.get("businessEntitySelector").checkChildren(e):this.get("businessEntitySelector").uncheckParent(e)}}})}),define("shift4tress/controllers/management/groups/group/add-roles",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({group:t["default"].inject.controller("management.groups.group"),groups:t["default"].inject.controller("management.groups"),businessEntitySelector:t["default"].inject.service(),selectedRole:function(){this.get("businessEntitySelector").uncheckChildren(this.get("parentBusinessEntity"));var e=this,t=this.model.filter(function(t){return t.get("id")==e.get("selectedRoleId")?t:void 0})[0];return t}.property("selectedRoleId"),parentBusinessEntity:function(){var e=this.get("group").get("model");return this.store.peekRecord("businessEntity",e.get("parentBusinessEntity.id"))}.property("model"),actions:{addRole:function(e){function t(e){e.get("checked")?i.get("businessEntities").addObject(e):e.get("children").forEach(function(e){t(e)})}var a=this,n=this.get("parentBusinessEntity"),r=this.store.peekRecord("role",this.get("selectedRoleId")),l=this.get("group.model"),d=l.get("roleBusinessEntities").findBy("role",r),i=this.store.createRecord("groupRoleBusinessEntity",{role:r,group:l,businessEntities:[]});t(n),0==i.get("businessEntities.length")?_alert("Please select one or more accounts.","warning"):($("#progressHudOverlay").show(),i.save().then(function(){d&&a.get("group").send("refresh"),a.get("groups").send("refresh"),$("#addRole").modal("toggle"),_alert("The group has been updated.","success")}))},toggleChecked:function(e){e.toggleProperty("checked")?this.get("businessEntitySelector").checkChildren(e):this.get("businessEntitySelector").uncheckParent(e)}}})}),define("shift4tress/controllers/management/groups/group/add-users",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({group:t["default"].inject.controller("management.groups.group"),groups:t["default"].inject.controller("management.groups"),usersChecked:function(){var e=this.get("model").filterBy("checked",!0);return e.get("length")>0}.property("model.@each.checked"),patch:function(e){var a=this,n=[];return e.forEach(function(e){if(e.get("checked")){var r=a.get("group").get("model");t["default"].set(r,"userCount",r.get("userCount")+1),n.push(e.get("id"))}}),$.ajax({url:a.get("apiPath.accountApiUrl")+"/groups/"+a.get("group").get("content.id")+"/users",type:"POST",data:JSON.stringify(n),dataType:"json",contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.accessToken+'"'},beforeSend:function(e){e.setRequestHeader("X-HTTP-Method-Override","PATCH")}})},actions:{addUsers:function(e){var t=this,a=this.patch(e),n=this.get("group").get("model");a.then(function(){t.get("groups").send("refresh"),_alert("The group has been updated.","success"),t.store.query("groupUser",{groupId:n.get("id")}),$("#addUsers").on("hidden.bs.modal",function(){n.set("lastUpdatedAt",new Date),t.transitionToRoute("management.groups.group")}),$("#addUsers").modal("toggle")},App.FailureHandler("add this user to this group"))},toggleChecked:function(e){e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/groups/group",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({management:t["default"].inject.controller(),group:t["default"].inject.controller("management.groups.group"),validateGroupName:function(){var e=this.get("model"),t=this.store.peekAll("group").filterBy("parentBusinessEntity.id",e.get("parentBusinessEntity.id")).filterBy("isNew",!1),a=!0;return t.forEach(function(t){e.get("id")!=t.get("id")&&e.get("name")==t.get("name")&&(_alert("Please enter a different name. A group with that name already exists.","danger"),a=!1)}),a},hasUsersOrBEs:function(){return this.get("model.userCount")>0||this.get("model.merchantCount")>0}.property("model.userCount","model.merchantCount"),businessEntities:function(){return this.store.findRecord("businessEntity",this.get("currentSession.user.parentBusinessEntity.id"))}.property("model"),actions:{edit:function(){this.model.get("hasDirtyAttributes")&&this.model.rollbackAttributes(),this.model.toggleProperty("notEditing")},removeRole:function(e){var t=this;e.deleteRecord(),e.save().then(function(){t.send("refresh"),_alert("The group has been updated.","success"),t.get("group").get("model").set("lastUpdatedAt",new Date),t.get("group").get("model").decrementProperty("roleCount")},App.FailureHandler("delete the role from the group"))},removeUser:function(e){var t=this;this.store.query("pendingInfo",{userId:e.get("user.id")}).then(function(a){if(a.content[0]){var n=a.content[0]._data.pendingSaleMerchantId,r=t.store.peekRecord("businessEntity",n);_error("Cannot remove permissions, "+e.get("user.firstName")+" has a pending sale on merchant '"+r.get("name")+"'. Please have the user login, or login as the user to choose an action for the pending sale before removing "+e.get("user.firstName")+"'s permissions.")}else e.deleteRecord(),e.save().then(function(){t.send("refresh"),_alert("The group has been updated.","success"),t.get("group").get("model").set("lastUpdatedAt",new Date),t.get("group").get("model").decrementProperty("userCount")},App.FailureHandler("delete the user from the group"))})},removeOrg:function(e){var t=this;e.deleteRecord(),e.save().then(function(){t.send("refresh"),_alert("The group has been updated.","success"),t.get("group").get("model").set("lastUpdatedAt",new Date),t.get("group").get("model").decrementProperty("merchantCount")},App.FailureHandler("delete the organization from the group"))},toggleChangeParent:function(){$("#changeParent").modal("toggle")},saveName:function(){var e=this;this.validateGroupName()?(this.model.get("hasDirtyAttributes")&&(""!==this.model.get("name")?this.model.save().then(function(){e.send("refresh"),_alert("The group has been updated.","success")},App.FailureHandler("update the group")):(this.model.rollbackAttributes(),_alert("Group name cannot be empty.","danger"))),this.model.set("notEditing",!0)):e.model.rollbackAttributes()},saveParent:function(){var e=this;this.validateGroupName()?(this.model.save().then(function(){e.send("refresh"),_alert("The group has been updated.","success")},App.FailureHandler("update the group")),$("#changeParent").modal("hide")):this.model.set("parentBusinessEntity",App.currentSession.get("user.selectedBusinessEntity"))}}})}),define("shift4tress/controllers/management/groups/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortedGroups:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,management:t["default"].inject.controller(),parentBusinessEntity:function(){return this.store.peekRecord("businessEntity",App.currentSession.get("user.parentBusinessEntity.id"))}.property("model"),actions:{cancelAdd:function(){this.get("newGroup").unloadRecord()},deleteGroup:function(){var e=this.get("groupToDelete");e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The group has been deleted.","success")},function(t){e.rollbackAttributes(),App.FailureHandler(['delete "'+e.get("name")+'" from the list of groups',"There are users linked to the group that need to be deleted first."])(t)})},deleteGroupConfirm:function(e){this.set("groupToDelete",e),$(".alert").alert("close"),$("#deleteGroup-modal").modal("toggle")},sortBy:function(e){switch($(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?this.set("sortProperties",[e+":asc"]):this.set("sortProperties",[e+":desc"]),e){case"name":1==this.get("sortAscending")?$("#name").addClass("descending"):$("#name").addClass("ascending");break;case"lastUpdatedAt":1==this.get("sortAscending")?$("#lastUpdatedAt").addClass("descending"):$("#lastUpdatedAt").addClass("ascending");break;case"parentBusinessEntity.name":1==this.get("sortAscending")?$("#parentBusinessEntity").addClass("descending"):$("#parentBusinessEntity").addClass("ascending");break;case"merchantCount":1==this.get("sortAscending")?$("#merchants").addClass("descending"):$("#merchants").addClass("ascending");break;case"userCount":1==this.get("sortAscending")?$("#users").addClass("descending"):$("#users").addClass("ascending");break;case"roleCount":1==this.get("sortAscending")?$("#roles").addClass("descending"):$("#roles").addClass("ascending")}}}})}),define("shift4tress/controllers/management/groups/new",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({management:t["default"].inject.controller(),groups:t["default"].inject.controller("management.groups"),canApplyNewGroup:function(){return!(!this.get("model.name")||!this.get("model.parentBusinessEntity"))}.property("model.name","model.parentBusinessEntity"), businessEntities:function(){return this.store.peekRecord("businessEntity",App.currentSession.get("user.parentBusinessEntity.id"))}.property("model"),actions:{validateParent:function(){t["default"].run.later(function(){$("#parentOrg").valid()})},toggleChangeParent:function(){$("#changeParent").modal("toggle")},cancelAdd:function(){this.model.deleteRecord(),this.transitionToRoute("management.groups")},save:function(){if($("#newGroupForm").valid()&&this.get("canApplyNewGroup")){var e=this.get("model"),t=this.store.peekAll("group").filterBy("parentBusinessEntity.id",e.get("parentBusinessEntity.id")).filterBy("isNew",!1),a=!0;if(t.forEach(function(t){t.get("name")==e.get("name")&&(_alert("Please enter a different name. A group with that name already exists.","danger"),a=!1)}),a){var n=this;e.save().then(function(e){n.transitionToRoute("management.groups.group",e.id),_alert("The group has been added.","success")},App.FailureHandler("add the group to the organization"))}}}}})}),define("shift4tress/controllers/management/groups",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/organizations/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({disallowEdit:function(){var e=App.currentSession.get("user");return 1==this.get("model.id")?!0:!e.hasPermission("canEdit","organizations",this.get("model.businessEntity"))}.property("App.currentSession.user.permissions")})}),define("shift4tress/controllers/management/organizations/new",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({organizations:t["default"].inject.controller("management.organizations"),adminEmailSetup:!1,verifiedAdministratorEmail:!1,orgTypes:function(){var e=[];return this.get("model.parent.businessEntity.canAddChildMerchant")&&e.push({key:"Merchant",value:1}),this.get("model.parent.businessEntity.canAddChildOrganization")&&e.push({key:"Organization",value:2}),this.get("model.parent.businessEntity.canAddResellerOrganization")&&e.push({key:"Reseller",value:3}),e}.property("model.parent","App.currentSession.user.parentBusinessEntity.numberOfMerchantsRemaining"),selectedOrgType:null,currencies:function(){return this.store.peekAll("currency")}.property(),onModelChange:function(){var e=this;this.get("currencies").forEach(function(t){"USD"==t.get("abbreviation")&&e.set("selectedCurrency",t)})}.observes("model"),selectedCurrency:null,isMerchantSelected:function(){return 1==this.get("selectedOrgType")}.property("selectedOrgType"),isOrganizationSelected:function(){return 2==this.get("selectedOrgType")}.property("selectedOrgType"),isResellerSelected:function(){return 3==this.get("selectedOrgType")}.property("selectedOrgType"),canSetMerchantsAllowed:function(){return App.get("currentSession.user").hasPermission("canPeriod","midLicenses",this.get("model.parent.businessEntity"))}.property("model.parent.businessEntity"),actions:{validateEmail:function n(){if($("#administratorEmail").valid()){var e=this,n=$.ajax({url:e.get("apiPath.accountApiUrl")+"/adminvalidator?parentBusinessEntityId="+e.model.get("parent.id")+"&email="+e.get("model.organizationAdministratorEmail"),type:"GET",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},async:!0,processData:!1});n.then(function(t){if(t.isValidEmail)e.set("verifiedAdministratorEmail",!0);else{var a=$("#newBEForm").validate();a.showErrors({administratorEmail:t.isRootUser?"The user provided cannot be the admin of this organization.":"This user's parent must be set to \""+e.model.get("parent.name")+'" in order to be the admin.'}),e.set("verifiedAdministratorEmail",!1)}},App.FailureHandler("verify the email address provided",function(e){401==e.status&&App.expiredSession()}))}},cancelAddBE:function(){this.transitionToRoute("management.organizations.organization.index")},createBusinessEntity:function(){var e=this;if(this.get("isOrganizationSelected")&&this.send("validateEmail"),$("#newBEForm").valid()){var a={},n=new Array,r=!0,n=this.store.peekAll("businessEntity");if(this.get("isMerchantSelected")){if("string"==typeof this.get("selectedCurrency"))var l=this.store.peekRecord("currency",this.get("selectedCurrency"));else if("object"==typeof this.get("selectedCurrency"))var l=this.get("selectedCurrency");a=this.store.createRecord("merchant",{name:this.get("model.merchantName"),currencyCode:l.get("currencyCode"),parentBusinessEntity:this.get("model.parent.businessEntity")}),n.forEach(function(t){t.get("parentBusinessEntityLoaded")&&t.get("parentBusinessEntity.id")==a.get("parentBusinessEntity.id")&&t.get("name")==a.get("name")&&t.get("isMerchant")&&(_error("You cannot have two merchants with the same name under a single parent."),r=!1,e.set("model.merchantName",new String),a.deleteRecord())})}else this.get("isOrganizationSelected")?this.get("verifiedAdministratorEmail")?(a=this.store.createRecord("organization",{name:this.get("model.organizationName"),administratorEmail:this.get("model.organizationAdministratorEmail"),parentBusinessEntity:this.get("model.parent.businessEntity"),organizationTypeId:1,type:this.get("selectedOrgType")}),this.get("canSetMerchantsAllowed")&&a.set("merchantsAllowed",0),n.forEach(function(t){t.get("parentBusinessEntityLoaded")&&t.get("parentBusinessEntity.id")==a.get("parentBusinessEntity.id")&&t.get("name")==a.get("name")&&t.get("isOrganization")&&(_error("You cannot have two organizations with the same name under a single parent."),r=!1,e.set("model.organizationName",new String),a.deleteRecord())})):r=!1:this.get("isResellerSelected")?this.get("verifiedAdministratorEmail")?(a=this.store.createRecord("organization",{name:this.get("model.organizationName"),administratorEmail:this.get("model.organizationAdministratorEmail"),parentBusinessEntity:this.get("model.parent.businessEntity"),organizationTypeId:3,type:this.get("selectedOrgType")}),this.get("canSetMerchantsAllowed")&&a.set("merchantsAllowed",0),n.forEach(function(t){t.get("parentBusinessEntityLoaded")&&t.get("parentBusinessEntity.id")==a.get("parentBusinessEntity.id")&&t.get("name")==a.get("name")&&t.get("isResellerOrganization")&&(_error("You cannot have two resellers with the same name under a single parent."),r=!1,e.set("model.organizationName",new String),a.deleteRecord())})):r=!1:(_error("Please select a type."),r=!1);r&&($("#progressHudOverlay").show(),a.save().then(function(){$("#progressHudOverlay").show(),e.store.findAll("permissionMask").then(function(){$("#progressHudOverlay").show(),e.store.query("businessEntity",{parentBusinessEntityId:a.get("id"),includeChildren:!1,includeParent:!0}).then(function(){a.get("isMerchant")?_alert("The merchant has been added.","success"):a.get("isResellerOrganization")?_alert("The reseller has been added.","success"):_alert("The organization has been added.","success"),t["default"].run.later(function(){var t=e.store.peekRecord("businessEntity",a.get("id"));e.get("navigation").selectBE(t,function(){e.get("navigation").set("tree.modified",!0)})},500)})},App.FailureHandler("add the account"))},function(e){$("#progressHudOverlay").hide(),400==e.errors[0].detail.code?_error(e.errors[0].detail.messages[0]):_error("There was a problem trying to add the account. Please try again in a few minutes."+(403==e.errors[0].detail.code?"If you believe you received this message in error, contact your administrator.":""))}))}}}})}),define("shift4tress/controllers/management/organizations/organization/app-config",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isEditDisabled:function(){return!App.currentSession.get("user").hasPermission("canEdit","appRecord",this.get("navigation.selectedBE"))}.property("model"),isLoading:!1,setDomain:function(){this.set("domain",this.get("model.management.domain"))}.observes("model.management.domain"),domainChanged:function(){this.get("model.management.domain")!=this.get("domain")&&(this.set("model.sso.domain",this.get("domain")),this.set("model.pos.domain",this.get("domain")),this.set("model.management.domain",this.get("domain")))}.observes("domain"),actions:{cancelConfig:function(){var e=this;$("#appConfigModal").on("hidden.bs.modal",function(){e.transitionToRoute("management.organizations.organization")}),$("#appConfigModal").modal("hide")},applyConfig:function(){var e=[],t=this,a=$("#appConfig").validate(),n={};e.push(this.get("model.management").save().then(null,function(e){return e.formElement="4tressSubDomain",e})),e.push(this.get("model.sso").save().then(null,function(e){return e.formElement="SSOSubDomain",e})),e.push(this.get("model.pos").save().then(null,function(e){return e.formElement="VT4SubDomain",e})),Em.RSVP.all(e).then(function(e){3!=e.filterBy("isError",!1).length?(e.forEach(function(e){"Error"==e.name&&(n[e.formElement]=e.errors[0].detail.messages[0])}),$("#appConfigConfirm").on("hidden.bs.modal",function(){a.showErrors(n),$("#appConfigConfirm").off("hidden.bs.modal")}),$("#appConfigConfirm").modal("hide")):($("#appConfigModal").on("hidden.bs.modal",function(){t.transitionToRoute("management.organizations.organization")}),$("#appConfigConfirm").modal("toggle"),$("#appConfigModal").modal("toggle"))})},promptConfirmConfig:function(){$("#appConfig").valid()&&$("#appConfigConfirm").modal("toggle")}}})}),define("shift4tress/controllers/management/organizations/organization/assign-rate-profiles",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({modalClass:"assignRateProfiles",actions:{assignRateProfiles:function(e){var t=this,a=!0;$("#progressHudOverlay").show();var n=[];e.forEach(function(e){if(e.get("checked")){var r=t.store.createRecord("rateProfileBusinessEntityAssignment");r.set("rateProfile",e),r.set("businessEntity",t.get("businessEntity"));var l=e.get("willReplace");l&&0==l.get("isSaving")&&n.push(l.destroyRecord().then(function(){},App.FailureHandler("replace a rate profile assignment"))),n.push(r.save().then(function(){},App.FailureHandler("assign a rate profile",function(){a=!1})))}});var r=n.length>1;Em.RSVP.all(n).then(function(){$("#progressHudOverlay").hide(),a&&($("#addRateProfileAssignment").modal("toggle"),_alert("The rate profile"+(r?"s":"")+" has been assigned.","success"))})},toggleChecked:function(e){if(0==e.get("checked")){var t=null,a=this.store.peekAll("rateProfileBusinessEntityAssignment").filterBy("businessEntity.id",this.get("businessEntity.id"));a.some(function(a){return a.get("rateProfile.billableProduct.id")==e.get("billableProduct.id")?(t=a,!0):void 0}),t?(this.set("pendingCheck",e),e.set("willReplace",t),$(".assignRateProfiles.prompt-modal .modal-title").html("Confirm Replace"),$(".assignRateProfiles.prompt-modal .modal-body .message").html('A rate profile with this product has already been assigned to this business entity. Assigning the "'+e.get("name")+'" rate profile will replace the existing rate profile. Are you sure you want to continue?'),$(".assignRateProfiles.prompt-modal").modal("toggle")):(this.get("model").forEach(function(e){e.set("checked",!1)}),e.toggleProperty("checked"))}},promptAccept:function(){this.get("model").forEach(function(e){e.set("checked",!1)});var e=this.get("pendingCheck");e&&e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/organizations/organization/dotn-connect",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isLoading:!1,actions:{exchangeAuthToken:function(){if($("#AuthCodeEntryForm").valid()){this.set("isLoading",!0);var e=this.get("model"),a=this;if(e.get("isMerchant")){var n=e.get("paymentMerchant");n&&n.get("hasDirtyAttributes")&&n.get("authCode")?(n.set("applicationId",1),$("#dotnconnectclosebutton").prop("disabled",!0),$("#dotnconnectcancelbutton").prop("disabled",!0),n.save().then(function(){n.set("authCode",""),e.get("dbaName")||e.set("dbaName"," "),$("#dotnconnectclosebutton").prop("disabled",!1),$("#dotnconnectcancelbutton").prop("disabled",!1),t["default"].run.later(function(){$("#dotnConnectModal").modal("hide")}),a.set("isLoading",!1),a.transitionToRoute("management.organizations.organization.dbaConfirmation")},function(){n.set("authCode",""),$("#dotnconnectclosebutton").prop("disabled",!1),$("#dotnconnectcancelbutton").prop("disabled",!1),$("#dotnConnectModal").on("hidden.bs.modal",function(){a.transitionTo("management.organizations.organization")}),t["default"].run.later(function(){$("#dotnConnectModal").modal("hide")}),_error("There was a problem trying to update the merchant. Please try again in a few minutes."),a.set("isLoading",!1)})):(n.set("authCode",""),$("#dotnconnectclosebutton").prop("disabled",!1),$("#dotnconnectcancelbutton").prop("disabled",!1),$("#dotnConnectModal").on("hidden.bs.modal",function(){a.transitionTo("management.organizations.organization")}),a.set("isLoading",!1),t["default"].run.later(function(){$("#dotnConnectModal").modal("hide")}))}}},cancelAdd:function(){var e=this;$("#dotnConnectModal").on("hidden.bs.modal",function(){e.transitionToRoute("management.organizations.organization")}),$("#dotnConnectModal").modal("hide")}}})}),define("shift4tress/controllers/management/organizations/organization/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({organizations:t["default"].inject.controller("management.organizations"),disallowEdit:function(){var e=App.currentSession.get("user");return 1==this.get("model.id")?!0:!e.hasPermission("canEdit","organizations",this.get("model.businessEntity"))}.property("App.currentSession.user.permissions"),canEditOrg:function(){var e=1==App.currentSession.get("user.parentBusinessEntity.id"),t=App.currentSession.get("user").hasPermission("canPeriod","fullOrganizationTree",App.currentSession.get("user.parentBusinessEntity"));return e?App.currentSession.get("user").hasPermission("canEdit","organizations",this.get("model.businessEntity"))&&(t||1==this.get("model.parentBusinessEntity.id")||1==this.get("model.id")):App.currentSession.get("user").hasPermission("canEdit","organizations",this.get("model.businessEntity"))}.property("App.currentSession.user","model"),onCurrencyChange:function(){var e=this.get("model");if("object"==typeof this.get("selectedCurrency"))var t=this.store.peekRecord("currency",this.get("selectedCurrency.id"));else var t=this.store.peekRecord("currency",this.get("selectedCurrency"));t&&this.get("currencies").forEach(function(a){a.get("id")==t.get("id")&&e.get("currencyCode")!=a.get("currencyCode")&&e.set("currencyCode",a.get("currencyCode"))})}.observes("selectedCurrency"),onModelChange:function(){var e=this;this.get("currencies").forEach(function(t){t.get("currencyCode")==e.get("model.currencyCode")&&("object"==typeof e.get("selectedCurrency")?e.get("selectedCurrency.id")!=t.get("id")&&e.set("selectedCurrency",t):e.get("selectedCurrency")!=t.get("id")&&e.set("selectedCurrency",t))})}.observes("model"),currencies:function(){return this.store.peekAll("currency")}.property("model"),selectedCurrency:null,currencyChanged:!1,canSetMerchantsAllowed:function(){return App.get("currentSession.user").hasPermission("canPeriod","midLicenses",this.get("model.businessEntity"))}.property("model.parent"),isApplyDisabled:function(){var e=this.get("model"),t=this;if("object"==typeof this.get("selectedCurrency"))var a=this.store.peekRecord("currency",this.get("selectedCurrency.id"));else var a=this.store.peekRecord("currency",this.get("selectedCurrency"));if(a){var n=!1;this.get("currencies").any(function(r){return r.get("id")==a.get("id")&&e.get("currencyCode")!=r.get("currencyCode")?(t.set("currencyChanged",!0),n=!0,!1):void 0})}return n?void 0:!(this.get("model.hasDirtyAttributes")||this.get("model.paymentMerchant.hasDirtyAttributes")||this.get("currencyChanged"))}.property("model.hasDirtyAttributes","model.paymentMerchant.hasDirtyAttributes","selectedCurrency"),modalClass:"org",verifiedCompanyNameField:function(){return this.set("retrySave",!1),!1}.property("newCompany.name"),isSelectedCurrencyObject:function(){return"object"==typeof this.get("selectedCurrency")}.property("selectedCurrency"),BEType:function(){var e=this.get("model.businessEntity");return e?e.get("isMerchant")?"Merchant":e.get("isResellerOrganization")?"Reseller":e.get("isOrganization")?"Organization":"":void 0}.property("model.businessEntity"),actions:{deleteOrganization:function(){var e=this.store.peekRecord("businessEntity",this.get("navigation.selectedBE.id"));if(e){var t=this,a=this.store.peekRecord("organization",e.get("id"));$("#progressHudOverlay").show(),a.deleteRecord(),a.save().then(function(){e.deleteRecord(),App.get("currentSession.user.parentBusinessEntity.content").reload().then(function(){t.get("navigation").selectBE(App.get("currentSession.user.parentBusinessEntity.content")),t.get("navigation").set("tree.modified",!0),t.transitionToRoute("management"),_success("The account has been deleted.")})},function(e){App.FailureHandler(['delete "'+a.get("name")+'" from the list of accounts',"This account has one or more depending group(s), merchant(s), account(s), or user(s) (user account and/or roles) that need to be removed first."])(e),a.rollbackAttributes()})}},deleteOrganizationConfirm:function(e){this.set("selectedBE",e),$("#deleteOrganization-modal #modalMessage").html("

Are you sure you want to permanently delete this account?

"),$("#deleteOrganization-modal").modal("toggle")},deleteMerchant:function(){var e=this.get("selectedBE"),t=this;if(e){var a=this;$("#progressHudOverlay").show(),a.store.findRecord("merchant",e.get("id")).then(function(n){a.store.findRecord("vt-merchant",n.get("id")).then(function(r){r.destroyRecord().then(function(){n.destroyRecord().then(function(){$("#progressHudOverlay").show(),e.deleteRecord(),App.get("currentSession.user.parentBusinessEntity.content").reload().then(function(){_success("The merchant has been deleted."),a.get("navigation").selectBE(App.get("currentSession.user.parentBusinessEntity.content")),t.get("navigation").set("tree.modified",!0),a.transitionToRoute("management")})},function(t){App.FailureHandler(['delete "'+e.get("name")+'" from the list of merchants',"This merchant is currently in use. To delete this merchant please contact your Account Administrator."])(t),n.rollbackAttributes()})},function(t){App.FailureHandler(['delete "'+e.get("name")+'" from the list of merchants',"This merchant is currently in use. To delete this merchant please contact your Account Administrator."])(t),r.rollbackAttributes()})},function(e){App.FailureHandler("load this merchant")(e)})},function(e){App.FailureHandler("load this merchant")(e)})}},deleteMerchantConfirm:function(e){this.set("selectedBE",e),$("#deleteMerchant-modal #modalMessage").html("

Are you sure you want to permanently delete this merchant?

"),$("#deleteMerchant-modal").modal("toggle")},doNavigate:function(){transition=this.get("lastTransition"),transition&&(window.onbeforeunload=null,this._transition=!0,transition.retry().then(this._transition=!1))},cancelChanges:function(){this.model.rollbackAttributes(),this.set("model",null),this.transitionToRoute("management")},updateBusinessEntity:function(){if($("form").valid()){var e=this,t=this.get("model"),a=[];(t.get("hasDirtyAttributes")||this.get("currencyChanged"))&&a.push(t.save()),a.length&&$("#progressHudOverlay").show(),Em.RSVP.all(a).then(function(){$("#progressHudOverlay").hide(),t.set("businessEntity.name",t.get("name")),e.set("currencyChanged",!1),_alert(t.get("name")+" has been updated.","success"),e.get("navigation").set("tree.modified",!0)},function(t){e.set("currencyChanged",!1),App.FailureHandler("update the organization or merchant")(t)})}},unassignRateProfile:function(e){this.set("promptAction","unassignRateProfile"),this.set("pendingUnassign",e),$(".org.prompt-modal .modal-title").html("Confirm Remove"),$(".org.prompt-modal .modal-body .message").html('Are you sure you would like to remove the "'+e.get("rateProfile.name")+'" rate profile? All depending business entities will no longer be able to use the associated product.'),$(".org.prompt-modal").modal("toggle")},promptAccept:function(){switch(this.get("promptAction")){case"unassignRateProfile":var e=this.get("pendingUnassign");e&&e.destroyRecord().then(function(){_alert("The rate profile has been unassigned.","success")},App.FailureHandler("unassign a rate profile"));break;case"deleteCompany":var a=this.get("pendingDelete");a&&t["default"].run.next(function(){a.destroyRecord().then(function(){_alert("The billing company has been deleted.","success")},App.FailureHandler(['delete "'+a.get("name")+'"',"Please delete all associated contacts, payment methods, and bill to accounts before deleting."],function(){a.rollbackAttributes()}))})}},validateCompanyName:function(){if($("#companyName").valid()){var e=this;this.store.query("company",{name:this.get("newCompany.name")}).then(function(t){if(t.get("length")>0){var a=$("form.company").validate();a.showErrors({companyName:"Must be unique."}),e.set("verifiedCompanyNameField",!1)}else e.set("verifiedCompanyNameField",!0),e.get("retrySave")&&this.send("createCompany")})}},newCompany:function(){var e=this;this.set("newCompany",this.store.createRecord("company")),$("#newCompany").modal("show"),$("#newCompany").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},cancelAdd:function(){this.get("newCompany").rollbackAttributes(),$("form.company .has-error").removeClass("has-error"),$("form.company").validate().resetForm()},createCompany:function(){if($("form.company").valid())if(this.get("verifiedCompanyNameField")){var e=this.get("newCompany");e.set("businessEntity",this.get("model.businessEntity")),e.save().then(function(e){_alert("The company has been added.","success"),$("#newCompany").modal("hide"),$("#newCompany").on("hidden.bs.modal",function(e){})},App.FailureHandler("add a company"))}else this.set("retrySave",!0),this.send("validateCompanyName")},confirmDeleteCompany:function(e){this.set("promptAction","deleteCompany"),this.set("pendingDelete",e),$(".org.prompt-modal .modal-title").html("Confirm Delete"),$(".org.prompt-modal .modal-body .message").html('Are you sure you want to delete the "'+e.get("name")+'" billing company?'),$(".org.prompt-modal").modal("toggle")}}})}),define("shift4tress/controllers/management/organizations/organization",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/organizations",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({merchantsRemainingGreaterThanOne:function(){return 1!=this.get("currentSession.user.parentBusinessEntity.numberOfMerchantsRemaining")}.property("currentSession.user.parentBusinessEntity.numberOfMerchantsRemaining"),numberOfMerchantsRemaining:function(){return this.get("currentSession.user.parentBusinessEntity.numberOfMerchantsRemaining")>0?this.get("currentSession.user.parentBusinessEntity.numberOfMerchantsRemaining"):0}.property("currentSession.user.parentBusinessEntity.numberOfMerchantsRemaining"),actions:{}})}),define("shift4tress/controllers/management/roles/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({sortedRoles:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,canApplyNewRole:function(){return!!this.get("newRole.name")}.property("newRole.name"),actions:{newRole:function(){var e=this;this.set("newRole",this.store.createRecord("role",{name:"",parentBusinessEntity:null})),$("#addRole").modal("show"),$("#addRole").on("hidden.bs.modal",function(t){e.send("cancelAdd")})},addRole:function(){if(this.get("canApplyNewRole")){var e=this;e.get("newRole").set("type",2),e.get("newRole").set("parentBusinessEntity",e.controllerFor("management").model),e.get("newRole").save().then(function(t){$("#addRole").on("hidden.bs.modal",function(a){e.transitionToRoute("role",t.id),_alert("The role has been added.","success")}),$("#addRole").modal("hide")},App.FailureHandler("add the role"))}},cancelAdd:function(){var e=this;e.get("newRole").rollbackAttributes(),$("#addRole").modal("hide")},sortBy:function(e){switch($(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?this.set("sortProperties",[e+":asc"]):this.set("sortProperties",[e+":desc"]),e){case"name":1==this.get("sortAscending")?$("#name").addClass("descending"):$("#name").addClass("ascending");break;case"lastUpdatedAt":1==this.get("sortAscending")?$("#lastUpdatedAt").addClass("descending"):$("#lastUpdatedAt").addClass("ascending");break;case"type":1==this.get("sortAscending")?$("#type").addClass("descending"):$("#type").addClass("ascending");break;case"userCount":1==this.get("sortAscending")?$("#users").addClass("descending"):$("#users").addClass("ascending")}},deleteRole:function(){var e=this.get("roleToDelete");e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The role has been deleted.","success")},function(e){App.FailureHandler("delete the role")(e)})},deleteRoleConfirm:function(e){this.set("roleToDelete",e),$(".alert").alert("close"),$("#deleteRole-modal").modal("toggle")}}})}),define("shift4tress/controllers/management/roles/role",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({notEditing:function(){return!0}.property("model"),showEdit:!0,actions:{doNavigate:function(){transition=this.get("lastTransition"),transition&&(window.onbeforeunload=null,this._transition=!0,transition.retry().then(this._transition=!1))},editRole:function(){this.toggleProperty("notEditing"),this.set("showEdit",!1)},selectAll:function(e){e.get("permissions").forEach(function(e){e.set("canView",!0),e.set("canEdit",!0),e.set("canGrant",!0),e.set("canPeriod",!0)})},selectNone:function(e){e.get("permissions").forEach(function(e){e.set("canView",!1),e.set("canEdit",!1),e.set("canGrant",!1),e.set("canPeriod",!1)})},saveRole:function(){$("#progressHudMessage").html("Saving..."),$("#progressHudOverlay").show();var e=this,t=e.model;e.set("notEditing",!0);var a=new $.Deferred;t.save(),t.commitRolePermissions().then(function(e){t.batchSave("permissions").then(function(){a.resolve()},App.FailureHandler("update permissions for the role"))}),$.when(a).then(function(){$("#progressHudOverlay").hide(),e.set("showEdit",!0),e.transitionToRoute("roles"),_alert("The role has been edited and saved.","success")})}}})}),define("shift4tress/controllers/management/security/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/security/password-settings/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({useLowercaseLetter:!1,useUppercaseLetter:!1,useSpecialLetter:!1,doesNotContainUsername:!1,copySelectAll:!1,unlockAutomatically:!1,businessEntities:function(){return this.get("model.businessEntity")}.property("model"),copySettingsBusinessEntities:function(){var e=this.store.peekAll("businessEntity"),t=e.filterBy("copySetting",!0);return t}.property("model"),resetBusinessEntityCopySetting:function(){var e=this.store.peekAll("businessEntity"),t=e.filterBy("copySetting",!0);t.forEach(function(e){e.set("copySetting",!1)}),this.set("copySelectAll",!1)},isEditDisabled:function(){return!App.currentSession.get("user.hasAccessToEditSecurityPassword")}.property("model"),lockoutOptionsDisabled:function(){return this.get("isEditDisabled")?!0:!this.get("model.unlockAutomatically")}.property("model.unlockAutomatically","isEditDisabled"),minimumCharacterList:function(){for(var e=[],t=7;32>=t;t++)e.push({key:String(t),value:Number(t)});return e}.property(),passwordHistoryList:function(){for(var e=[],t=4;32>=t;t++)e.push({key:String(t),value:Number(t)});return e}.property(),passwordExpiresList:function(){for(var e=[],t=30;90>=t;t+=30)e.push({key:String(t),value:Number(t)});return e}.property(),lockoutAttemptList:function(){for(var e=[],t=1;6>=t;t++)e.push({key:String(t),value:Number(t)});return e}.property(),unlockAutomaticallyAfterList:function(){var e=[],t=0,a=this.get("model.unlockAutomaticallyAfterInterval");2==a?t=60:3==a?t=24:4==a&&(t=7);for(var n=1;t>=n;n++)e.push({key:String(n),value:Number(n)});var r=this.get("model.unlockAutomaticallyAfter");return r>t&&this.set("model.unlockAutomaticallyAfter",1),e}.property("model.unlockAutomaticallyAfterInterval"),unlockAutomaticallyAfterIntervalList:function(){var e=[];return e.push({key:"Minutes",value:DATE_TIME_INTERVAL_MINUTES}),e.push({key:"Hours",value:DATE_TIME_INTERVAL_HOURS}),e.push({key:"Days",value:DATE_TIME_INTERVAL_DAYS}),e}.property(),activationEmailCountList:function(){for(var e=[],t=1;7>=t;t++)e.push({key:String(t),value:Number(t)});return e}.property(),actions:{showHelpModal:function(){setTimeout(function(){$("#help-modal").modal("show")})},promptCopyPasswordSettings:function(){$("#copySettings").modal("show")},cancelUpdate:function(){this.get("model.id")&&this.get("model").rollbackAttributes(),this.transitionToRoute("management")},selectBusinessEntity:function(e){e!=this.get("model.businessEntity")&&e.toggleProperty("copySetting")},toggleCopySelectAll:function(){function e(a){a.get("children").forEach(function(a){a.set("copySetting",!t.get("copySelectAll")),e(a)})}var t=this;e(this.get("model.businessEntity")),this.toggleProperty("copySelectAll")},cancelCopySettings:function(){this.resetBusinessEntityCopySetting()},copySettings:function(){var e=this;$("#SecurityPasswordSettingsForm").valid()&&($("#progressHudOverlay").show(),this.get("model").save().then(function(){var t=e.store.createRecord("BusinessEntitySettingsCopyRequest",{settingName:"PasswordSettings",settingGroup:"SecuritySettings",targetBusinessEntities:e.get("copySettingsBusinessEntities"),businessEntity:e.get("model.businessEntity")});t.save().then(function(){e.resetBusinessEntityCopySetting(),$("#progressHudOverlay").hide(),_success("Your password security settings have been saved and copied.")},App.FailureHandler("save the password settings for this account"))},App.FailureHandler("save the password settings for this account")))},save:function(){var e=this;$("#SecurityPasswordSettingsForm").valid()&&($("#progressHudOverlay").show(),this.get("model").save().then(function(){e.resetBusinessEntityCopySetting(),$("#progressHudOverlay").hide(),_success("Your password security settings have been saved.")},App.FailureHandler("save the password settings for this account")))}}})}),define("shift4tress/controllers/management/security",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/system-users/ephemeral-users/ephemeral-user/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({actions:{back:function(){this.model.rollbackAttributes(),this.transitionToRoute("management.systemUsers.ephemeralUsers.index")}}})}),define("shift4tress/controllers/management/system-users/ephemeral-users/ephemeral-user/permissions",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/system-users/ephemeral-users/ephemeral-user",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/system-users/ephemeral-users/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({ isTabView:t["default"].computed("session.selectedBusinessEntity",function(){var e=App.currentSession.get("user");return!(!e.hasPermission("canView","systemUsers",e.get("parentBusinessEntity"))||!e.hasPermission("canView","ephemeralUsers",e.get("parentBusinessEntity")))}),selectedEphemeralUser:null,isCogHidden:t["default"].computed("session.selectedBusinessEntity",function(){var e=!0,t=App.currentSession.get("user");return t.hasPermission("canEdit","ephemeralUsers",t.get("parentBusinessEntity"))&&(e=!1),e}),columns:function(){return[{title:"Created By",disableSorting:!0,propertyName:"user.username"},{title:"Parent",disableSorting:!0,propertyName:"parentName"},{template:"custom/lifespan-type",title:"Lifespan Type",disableSorting:!0,propertyName:"lifespan.lifeSpanType"},{title:"Last Updated At",sortedBy:"lastUpdatedAt",propertyName:"lastUpdatedAtFormatted"},{title:"Allow Duplicate Sessions",propertyName:"allowDuplicateSessions"},{template:"custom/gear",isHidden:this.get("isCogHidden")}]}.property("isCogHidden"),filterQueryParameters:{sort:"sortcolumn",sortDirection:"sortOrder",page:"pageNumber",pageSize:"pageSize"},customMessages:{tableSummary:""},actions:{displayDataChanged:function(e){if(e.get("selectedItems").length>0){var t=e.get("selectedItems").get("firstObject").get("id");this.transitionToRoute("management.systemUsers.ephemeralUsers.ephemeralUser",t)}},deActivateUser:function(e){this.set("selectedEphemeralUser",e),$("#revokeAccessConfirmationModal").modal("show")},dismissrevokeAccessConfirmationModal:function(e){$("#revokeAccessConfirmationModal").modal("hide"),this.set("selectedEphemeralUser",null)},confirmRevokeAccess:function(){var e=this.get("selectedEphemeralUser");if(e){$("#progressHudMessage").html("Updating..."),$("#progressHudOverlay").show();var t=e.get("userSessions");if(t){var a=t.get("length");t.forEach(function(t){t.deleteRecord(),t.save().then(function(){e.set("isRevoked",!0),a--,0==a&&($("#progressHudOverlay").hide(),_alert("Access has been revoked.","success"))})})}}$("#revokeAccessConfirmationModal").modal("hide")}}})}),define("shift4tress/controllers/management/system-users/ephemeral-users",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/system-users/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/system-users/service-users/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isTabView:t["default"].computed("session.selectedBusinessEntity",function(){var e=App.currentSession.get("user");return!(!e.hasPermission("canView","systemUsers",e.get("parentBusinessEntity"))||!e.hasPermission("canView","ephemeralUsers",e.get("parentBusinessEntity")))}),refreshServiceUsers:function(){this.send("refresh")}.observes("navigation.tree.showChildDataChecked"),columns:[{title:"Username",propertyName:"username"},{title:"First Name",propertyName:"firstName"},{title:"Last Name",propertyName:"lastName"},{title:"Email",propertyName:"email"},{title:"Parent",disableSorting:!0,propertyName:"parentName"},{title:"User Status",disableSorting:!0,propertyName:"statusText"}],filterQueryParameters:{sort:"sortcolumn",sortDirection:"sortOrder",page:"pageNumber",pageSize:"pageSize"},customMessages:{tableSummary:""},actions:{displayDataChanged:function(e){if(e.get("selectedItems").length>0){var t=e.get("selectedItems").get("firstObject").get("id");this.transitionToRoute("management.systemUsers.serviceUsers.serviceUser",t)}}}})}),define("shift4tress/controllers/management/system-users/service-users/service-user/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({actions:{back:function(){this.model.rollbackAttributes(),this.transitionToRoute("management.systemUsers.serviceUsers.index")}}})}),define("shift4tress/controllers/management/system-users/service-users/service-user/permissions",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/system-users/service-users",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/system-users",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/users/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({config:t["default"].computed.alias("application.config"),sortedUsers:t["default"].computed.sort("model","sortProperties"),sortProperties:["firstName:asc"],refreshUsers:function(){this.send("refresh")}.observes("navigation.tree.showChildDataChecked"),redrawTable:function(){$("#usersTable").DataTable().destroy();var e=this.get("model"),t=this.get("computedPropForTable"),a=this.get("priority"),n=[];if(a)for(var r=a.length-1;r>=0;r--){var l={responsivePriority:a[r],targets:r};n.push(l)}var d=this,i=[];e.forEach(function(e){var a={};a=e.toJSON();for(var n=t.length-1;n>=0;n--){var r=e.get(t[n]);a[t[n]]=r}i.push(a)}),$("#usersTable").DataTable({responsive:!0,columnDefs:n,aoColumns:d.get("columns"),autoWidth:!1,pageLength:20,data:i,language:{lengthMenu:' records per page'}})}.observes("model"),computedPropForTable:["statusText","parentName","id","formattedLastLoginAt"],"class":["table table-striped responsive table-hover"],priority:[5,1,0,4,3,2,6],columns:[{sTitle:"Username",mData:"username"},{sTitle:"First Name",mData:"firstName"},{sTitle:"Last Name",mData:"lastName"},{sTitle:"Email",mData:"email"},{sTitle:"Parent",mData:"parentName"},{sTitle:"User Status",mData:"statusText"},{sTitle:"Last Login",mData:function(e){return e.lastLogon?formatDateFunction(e.lastLogon):""}}],actions:{userClicked:function(e){this.transitionToRoute("management.users.user",e)}}})}),define("shift4tress/controllers/management/users/new",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({management:t["default"].inject.controller(),users:t["default"].inject.controller("management.users"),businessEntities:function(){return this.store.peekRecord("businessEntity",App.currentSession.get("user.parentBusinessEntity.id"))}.property("model"),verifyUserNameField:function(){return!0}.property("model.username"),verifyEmailField:function(){return!0}.property("model.email"),actions:{validateUsername:function n(){if($("#userName").valid()){var e=this,n=$.ajax({url:e.get("apiPath.accountApiUrl")+"/validator?username="+e.get("model.username")+"&userid=99999999",type:"GET",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},async:!0,processData:!1});n.then(function(t){if(t.isAvailable)e.set("verifyUserNameField",!0);else{var a=$("#userForm").validate();a.showErrors({userName:"Username already on file."}),e.set("verifyUserNameField",!1)}})}},validateEmail:function r(){if($("#email").valid()){var e=this,r=$.ajax({url:e.get("apiPath.accountApiUrl")+"/validator?email="+e.model.get("email")+"&userid=99999999",type:"GET",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},async:!0,processData:!1});r.then(function(t){if(t.isAvailable)e.set("verifyEmailField",!0);else{var a=$("#userForm").validate();a.showErrors({email:"Email Address already on file."}),e.set("verifyEmailField",!1)}})}},validateParent:function(){t["default"].run.later(function(){$("#parentOrg").valid()})},toggleChangeParent:function(){$("#changeParent").modal("toggle")},cancelAdd:function(){this.model.deleteRecord(),this.transitionToRoute("management.users")},save:function(){if(this.send("validateUsername"),this.send("validateEmail"),$("form").valid()){var e=this;this.get("verifyUserNameField")&&this.get("verifyEmailField")&&($("#progressHudOverlay").show(),this.model.save().then(function(t){e.get("users").reloadUsers(),e.transitionToRoute("management.users.user.permissions",t.id),_alert("The user has been added.","success")},App.FailureHandler("add the user",function(e){if($("#progressHudOverlay").hide(),e.response){if(message=e.response.messages[0],"Username already on file."==message){var t=$("#userForm").validate();t.showErrors({userName:"Username already on file."})}if("Email Address already on file."==message){var t=$("#userForm").validate();t.showErrors({email:"Email Address already on file."})}}})))}}}})}),define("shift4tress/controllers/management/users/user/add-groups",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({user:t["default"].inject.controller("management.users.user"),patch:function(e){var t=this,a=[];e.filterBy("checked",!0).forEach(function(e){a.push(e.get("id"))});return a.length?$.ajax({url:t.get("apiPath.accountApiUrl")+"/users/"+t.get("user").get("model.id")+"/groups",type:"POST",data:JSON.stringify(a),dataType:"json",contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.accessToken+'"'},beforeSend:function(e){e.setRequestHeader("X-HTTP-Method-Override","PATCH")}}):void $("#errors").html("Please select a group.")},actions:{addGroups:function(e){var t=this,a=this.patch(e),n=this.get("user").get("model");a&&a.then(function(){t.store.query("userGroup",{userId:n.get("id")}),$("#addGroups").modal("toggle"),$("#addGroups").on("hidden.bs.modal",function(){t.transitionToRoute("management.users.user.permissions")})},App.FailureHandler("add the group to the user"))},toggleChecked:function(e){e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/users/user/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({verifyDisabled:function(){return this.get("model.email")==this.get("model.historicEmail")}.property("model.email","model.historicEmail"),verifyEmail:function(){var e=this.model.changedAttributes().email;return!e}.property("model.email"),verifyUserNameField:function(){return!0}.property("model.username"),verifyEmailField:function(){return!0}.property("model.email"),businessEntities:function(){return this.store.peekRecord("businessEntity",App.currentSession.get("user.parentBusinessEntity.id"))}.property("model"),groupsOrRolesFailed:function(){return!(!this.model.get("rolesFailed")&&!this.model.get("groupsFailed"))}.property("model.rolesFailed","model.groupsFailed"),actions:{validateUsername:function n(){if($("#userName").valid()){var e=this,n=$.ajax({url:e.get("apiPath.accountApiUrl")+"/validator?username="+e.get("model.username")+"&userid="+e.model.get("id"),type:"GET",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},async:!0,processData:!1});n.then(function(t){if(t.isAvailable)e.set("verifyUserNameField",!0);else{e.set("verifyUserNameField",!1);var a=$("#userGeneralForm").validate();a.showErrors({userName:"Username already on file."})}})}},validateEmail:function r(){if($("#email").valid()){var e=this,r=$.ajax({url:e.get("apiPath.accountApiUrl")+"/validator?email="+e.model.get("email")+"&userid="+e.model.get("id"),type:"GET",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},async:!0,processData:!1});r.then(function(t){if(t.isAvailable)e.set("verifyEmailField",!0);else{e.set("verifyEmailField",!1);var a=$("#userGeneralForm").validate();a.showErrors({email:"Email Address already on file."})}})}},toggleEdit:function(){this.toggleProperty("editState")},toggleChangeParent:function(){$("#changeParent").modal("toggle")},resetPassword:function(){this.model.set("isReset",!0),this.send("save")},back:function(){this.model.rollbackAttributes(),this.transitionToRoute("management.users")},enable:function(){this.model.set("isActive",!0),this.model.set("isLocked",!1),this.send("save")},disable:function(){this.model.set("isActive",!1),this.send("save")},save:function(){var e=this;$("form").valid()&&(this.send("validateUsername"),this.send("validateEmail"),this.get("verifyUserNameField")&&this.get("verifyEmailField")&&this.model.save().then(function(){_alert(e.model.get("firstName")+" has been updated.","success"),$("#verifyEmail").val(""),e.set("model.historicEmail",e.get("model.email"))},App.FailureHandler("update the user",function(e){if(message=e.response.messages[0],"Username already on file."==message){var t=$("#userGeneralForm").validate();t.showErrors({userName:"Username already on file."})}if("Email Address already on file."==message){var t=$("#userGeneralForm").validate();t.showErrors({email:"Email Address already on file."})}})))}}})}),define("shift4tress/controllers/management/users/user/permissions/add-groups",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({user:t["default"].inject.controller("management.users.user"),patch:function(e){var t=this,a=[];e.filterBy("checked",!0).forEach(function(e){a.push(e.get("id"))});return a.length?$.ajax({url:t.get("apiPath.accountApiUrl")+"/users/"+t.get("user").get("model.id")+"/groups",type:"POST",data:JSON.stringify(a),dataType:"json",contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.accessToken+'"'},beforeSend:function(e){e.setRequestHeader("X-HTTP-Method-Override","PATCH")}}):void $("#errors").html("Please select a group.")},actions:{addGroups:function(e){var t=this,a=this.patch(e),n=this.get("user").get("model");a&&a.then(function(){t.store.query("userGroup",{userId:n.get("id")}),$("#addGroups").modal("toggle"),$("#addGroups").on("hidden.bs.modal",function(){t.transitionToRoute("management.users.user.permissions")})},App.FailureHandler("add the group to the user"))},toggleChecked:function(e){e.toggleProperty("checked")}}})}),define("shift4tress/controllers/management/users/user/permissions/add-roles",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({user:t["default"].inject.controller("management.users.user"),businessEntitySelector:t["default"].inject.service(),selectedRole:function(){var e=this,t=this.model.filter(function(t){return t.get("id")==e.get("selectedRoleId")?t:void 0})[0];return t}.property("selectedRoleId"),merchants:function(){var e=this.get("user").get("model");return this.store.findRecord("businessEntity",e.get("parentBusinessEntity.id"))}.property("model"),arrayOfOrgs:[],patch:function(e){function t(e){e.get("checked")?(a.get("selectedRole").get("isMerchantRole")||e.get("isStandardOrganization")||!e.get("isMerchant"))&&n.push(e.get("id")):e.get("children").forEach(function(e){t(e)})}var a=this,n=[],a=this,n=[];return t(e),n.length?$.ajax({url:a.get("apiPath.accountApiUrl")+"/users/"+a.get("user").get("model.id")+"/roles/"+a.get("selectedRole.id")+"/businessEntities",type:"POST",data:JSON.stringify(n),dataType:"json",contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.accessToken+'"'}}):void $("#errors").html("Please select an account.")},actions:{addRole:function(e){if($("#errors").html(""),this.get("selectedRole")){var t=this,a=this.get("merchants"),n=this.patch(a),r=this.get("user").get("model");n&&n.then(function(){t.store.query("userRoleBusinessEntity",{userId:r.get("id")}),$("#addRole").modal("toggle")},App.FailureHandler("add the role to the user"))}else $("#errors").html("Please select a role.")},toggleChecked:function(e){e.toggleProperty("checked")?this.get("businessEntitySelector").checkChildren(e):this.get("businessEntitySelector").uncheckParent(e)}}})}),define("shift4tress/controllers/management/users/user/permissions",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({actions:{remove:function(e){var t=this.get("model"),a=this;$("#progressHudOverlay").show(),this.store.query("pendingInfo",{userId:t.get("id")}).then(function(n){if(n.content[0]){$("#progressHudOverlay").hide();var r=n.content[0]._data.pendingSaleMerchantId,l=a.store.peekRecord("businessEntity",r);_error("Cannot remove permissions, "+t.get("firstName")+" has a pending sale on merchant '"+l.get("name")+"'. Please have the user login, or login as the user to choose an action for the pending sale before removing "+t.get("firstName")+"'s permissions.")}else e.deleteRecord(),e.save().then(function(){$("#progressHudOverlay").hide();var e=a.get("model"),t=a.store.peekAll("userPermission");t=t.filter(function(t){return t.get("user.id")==e.get("id")?t:void 0});for(var n=t.get("length")-1;n>=0;n--)a.store.unloadRecord(t.objectAt(n));e.set("permissions",[])},App.FailureHandler("updating this user"))})}}})}),define("shift4tress/controllers/management/users/user/summary",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/users/user",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/management/users",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({reloadUsers:function(){this.send("reloadUsers")}})}),define("shift4tress/controllers/management",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({isOrgTabActive:!1,forceRedirect:function(){}.on("init")})}),define("shift4tress/controllers/profile",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({passwordSetting:function(){var e=this;return this.store.query("passwordSetting",{parentBusinessEntityId:App.get("currentSession.user.parentBusinessEntity").get("id")}).then(function(t){e.set("passwordSetting",t.get("firstObject"))})}.property("model"),passwordValidationClasses:function(){var e=this.get("passwordSetting"),t="form-control";return e.id&&(e.get("containsLetters")&&(t+=" letter"),e.get("containsNumbers")&&(t+=" number"),e.get("containsUppercaseLetters")&&(t+=" uppercaseLetter"),e.get("containsLowercaseLetters")&&(t+=" lowercaseLetter"),e.get("doesNotContainUsername")&&(t+=" noUsername"),e.get("containsSpecialCharacters")&&(t+=" nonAlphaNumeric")),t}.property("passwordSetting.containsLetters","passwordSetting.containsNumbers","passwordSetting.containsUppercaseLetters","passwordSetting.containsLowercaseLetters","passwordSetting.doesNotContainUsername","passwordSetting.containsSpecialCharacters"),router:t["default"].inject.service("-routing"),securityImages:t["default"].computed.alias("application.securityImages"),application:t["default"].inject.controller(),initialUse:function(){App.get("currentSession.user.isInitialUser")&&sessionStorage.setItem("initialUse",!0)}.observes("model"),passwordMatch:null,isAvailable:!0,profileSetup:function(){0==App.get("currentSession.user.isInitialUser")&&"true"==sessionStorage.getItem("initialUse")&&(delete sessionStorage.initialUse,app=App.get("redirectApp"),redirecturi=App.get("redirecturi"),App.get("redirecturi")?_alert('Your profile has been updated. Click here to return to '+app+".","success"):_alert("Your profile has been updated and your navigation menu enabled.","success"))}.observes("App.currentSession.user.isInitialUser"),actions:{applyProfile:function(){function e(){return a.get("model").save().then(function(e,n,r){_alert("Your profile has been updated.","success"),App.get("currentSession").reload(),t["default"].run.later(function(){a.set("model.existingPassword",""),a.set("passwordMatch",""),a.set("model.newPassword",""),$("#passwordForm").validate().resetForm()})},function(e){App.get("currentSession").reload();var t=e.errors[0].detail;if(-1!=t.indexOf("password")){if(_alert("There was a problem trying to update your profile. ","warning"),a.set("model.newPassword",""),a.set("model.oldPassword",""),a.set("passwordMatch",null),-1!=t.indexOf("current password")){var n=$("#passwordForm").validate();n.showErrors({currentPassword:t})}else if(-1!=t.indexOf("password")){var n=$("#passwordForm").validate();n.showErrors({newPassword:t})}}else _alert("There was a problem trying to update your profile. Please try again in a few minutes. If the error persists, contact your administrator.","danger")})}var a=this,n=!1,r=!1,l=!1;if(this.get("model.newEmailAddressDirty")&&$("#emailForm").valid()){n=!0;var d=$.ajax({url:a.get("apiPath.accountApiUrl")+"/validator?email="+a.get("model.newEmailAddress")+"&userid="+App.currentSession.get("user.id"),type:"GET",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},async:!0,processData:!1})}return this.get("model.newPassword")&&$("#passwordForm").valid()&&(l=!0),this.get("model.securityImageDirty")&&(r=!0),n?d.then(function(t){if(t.isAvailable)return e();var a=$("#emailForm").validate();a.showErrors({newEmail:"Email Address already on file."})}):r||l?e():void 0},selectImage:function(e){this.set("model.securityImage",e.id+"");var t=e.id;$(".tile img").removeClass("active"),$("#img"+t).addClass("active");var a=$("#tile-container");a.closest(".form-group").removeClass("has-error"),$("#imageError").remove()}}}),App.Password=t["default"].Object.extend({})}),define("shift4tress/controllers/reports/vt4-reports/export-report/index",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({reportEmail:null,reports:t["default"].inject.controller(),merchantModel:t["default"].computed.alias("reports"),reportMerchants:function(){return this.get("model.isMerchant")&&this.get("model.export")?[this.get("model")]:this.get("model.children").filterBy("export",!0)}.property("model.export","model.children.@each.export"),daterange:t["default"].computed.alias("reports.daterange"),merchantSelected:function(){return this.get("reportMerchants.length")>0}.property("reportMerchants.[]"),actions:{submitReport:function(){var e=this;if($("#exportReport").valid()&&this.get("reportMerchants.length")>0){var t=[],a=this.get("daterange").split(" - ");this.get("reportMerchants").forEach(function(e){t.push(e.get("id"))});var n={merchantIds:t,startDate:a[0],endDate:a[1],email:this.get("reportEmail")};$("#progressHudMessage").html("Generating Report..."),$("#progressHudOverlay").show(),$.ajax({url:e.get("apiPath.vtApiUrl")+"/reports/sales",type:"POST",data:JSON.stringify(n),contentType:"application/json",headers:{Authorization:'Token token="'+sessionStorage.getItem("accessToken")+'"'},dataType:"json",async:!0,processData:!1}).then(function(){$("#progressHudOverlay").hide(),$("#progressHudMessage").html("Loading..."),_alert("The reports are being processed and will be emailed upon completion.","success")},function(){$("#progressHudOverlay").hide(),$("#progressHudMessage").html("Loading..."),_alert("There was a problem generating the report. Please try again later. Contact "+e.get("theme.companyName")+" if the problem persists.","error")})}}}})}),define("shift4tress/controllers/reports/vt4-reports/payments-report/index",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({reports:t["default"].inject.controller(),merchantModel:t["default"].computed.alias("reports"),daterange:t["default"].computed.alias("reports.daterange"),grandTotal:function(){if(this.get("model.merchants.length")>1){var e=[];return this.get("model.merchants").forEach(function(a){var n=a.get("currencyAbbreviation"),r=e.findBy("currencyAbbreviation",n);r||e.pushObject(t["default"].Object.create({currencySymbol:a.get("currencySymbol"),currencyAbbreviation:a.get("currencyAbbreviation"),transactionsTotal:0,grandTotal:0,refundsTotal:0,salesTotal:0,card:t["default"].Object.create({tenderType:1,transactionsTotal:0,salesTotal:0,refundsTotal:0,grandTotal:0,cardTypes:[]}),cash:t["default"].Object.create({tenderType:2,transactionsTotal:0,salesTotal:0,refundsTotal:0,grandTotal:0,cardTypes:[]}),check:t["default"].Object.create({tenderType:3,transactionsTotal:0,salesTotal:0,refundsTotal:0,grandTotal:0,cardTypes:[]}),member:t["default"].Object.create({tenderType:4,transactionsTotal:0,salesTotal:0,refundsTotal:0,grandTotal:0,cardTypes:[]}),utg:t["default"].Object.create({tenderType:5,transactionsTotal:0,salesTotal:0,refundsTotal:0,grandTotal:0,cardTypes:[]}),room:t["default"].Object.create({tenderType:6,transactionsTotal:0,salesTotal:0,refundsTotal:0,grandTotal:0,cardTypes:[]}),memberCharge:t["default"].Object.create({tenderType:7,transactionsTotal:0,salesTotal:0,refundsTotal:0,grandTotal:0,cardTypes:[]})}));var l=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("card");a.get("tenderTypes").findBy("tenderType",1)&&a.get("tenderTypes").findBy("tenderType",1).get("tenders").forEach(function(n){cardTypeFound=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("card.cardTypes").findBy("cardType",n.get("cardType")),cardTypeFound?cardTypeFound.setProperties({transactionCount:Big(cardTypeFound.get("transactionCount")).plus(Big(n.get("transactionCount"))),calRefundAmount:Big(cardTypeFound.get("calRefundAmount")).plus(Big(n.get("calRefundAmount"))),calTotalAmount:Big(cardTypeFound.get("calTotalAmount")).plus(Big(n.get("calTotalAmount"))),calSalesAmount:Big(cardTypeFound.get("calSalesAmount")).plus(Big(n.get("calSalesAmount")))}):e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("card.cardTypes").pushObject(t["default"].Object.create({cardType:n.get("cardType"),transactionCount:n.get("transactionCount"),calRefundAmount:n.get("calRefundAmount"),calTotalAmount:n.get("calTotalAmount"),calSalesAmount:n.get("calSalesAmount")}))});var d=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("utg");a.get("tenderTypes").findBy("tenderType",5)&&a.get("tenderTypes").findBy("tenderType",5).get("tenders").forEach(function(n){cardTypeFound=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("utg.cardTypes").findBy("cardType",n.get("cardType")),cardTypeFound?cardTypeFound.setProperties({transactionCount:Big(cardTypeFound.get("transactionCount")).plus(Big(n.get("transactionCount"))),calRefundAmount:Big(cardTypeFound.get("calRefundAmount")).plus(Big(n.get("calRefundAmount"))),calTotalAmount:Big(cardTypeFound.get("calTotalAmount")).plus(Big(n.get("calTotalAmount"))),calSalesAmount:Big(cardTypeFound.get("calSalesAmount")).plus(Big(n.get("calSalesAmount")))}):e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("utg.cardTypes").pushObject(t["default"].Object.create({cardType:n.get("cardType"),transactionCount:n.get("transactionCount"),calRefundAmount:n.get("calRefundAmount"),calTotalAmount:n.get("calTotalAmount"),calSalesAmount:n.get("calSalesAmount")}))});var l=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("card"),i=a.get("tenderTypes").findBy("tenderType",1);i&&l.setProperties({transactionsTotal:Big(l.get("transactionsTotal")).plus(Big(i.get("transactionsTotal"))),salesTotal:Big(l.get("salesTotal")).plus(Big(i.get("salesTotal"))),refundsTotal:Big(l.get("refundsTotal")).plus(Big(i.get("refundsTotal"))),grandTotal:Big(l.get("grandTotal")).plus(Big(i.get("grandTotal")))});var o=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("cash"),s=a.get("tenderTypes").findBy("tenderType",2);s&&o.setProperties({transactionsTotal:Big(o.get("transactionsTotal")).plus(Big(s.get("transactionsTotal"))),salesTotal:Big(o.get("salesTotal")).plus(Big(s.get("salesTotal"))),refundsTotal:Big(o.get("refundsTotal")).plus(Big(s.get("refundsTotal"))),grandTotal:Big(o.get("grandTotal")).plus(Big(s.get("grandTotal")))});var c=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("check"),p=a.get("tenderTypes").findBy("tenderType",3);p&&c.setProperties({transactionsTotal:Big(c.get("transactionsTotal")).plus(Big(p.get("transactionsTotal"))),salesTotal:Big(c.get("salesTotal")).plus(Big(p.get("salesTotal"))),refundsTotal:Big(c.get("refundsTotal")).plus(Big(p.get("refundsTotal"))),grandTotal:Big(c.get("grandTotal")).plus(Big(p.get("grandTotal")))});var u=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("member"),m=a.get("tenderTypes").findBy("tenderType",4);m&&u.setProperties({transactionsTotal:Big(u.get("transactionsTotal")).plus(Big(m.get("transactionsTotal"))),salesTotal:Big(u.get("salesTotal")).plus(Big(m.get("salesTotal"))),refundsTotal:Big(u.get("refundsTotal")).plus(Big(m.get("refundsTotal"))),grandTotal:Big(u.get("grandTotal")).plus(Big(m.get("grandTotal")))});var d=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("utg"),i=a.get("tenderTypes").findBy("tenderType",5);i&&d.setProperties({transactionsTotal:Big(d.get("transactionsTotal")).plus(Big(i.get("transactionsTotal"))),salesTotal:Big(d.get("salesTotal")).plus(Big(i.get("salesTotal"))),refundsTotal:Big(d.get("refundsTotal")).plus(Big(i.get("refundsTotal"))),grandTotal:Big(d.get("grandTotal")).plus(Big(i.get("grandTotal")))});var h=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("room"),v=a.get("tenderTypes").findBy("tenderType",6);v&&h.setProperties({transactionsTotal:Big(h.get("transactionsTotal")).plus(Big(v.get("transactionsTotal"))),salesTotal:Big(h.get("salesTotal")).plus(Big(v.get("salesTotal"))),refundsTotal:Big(h.get("refundsTotal")).plus(Big(v.get("refundsTotal"))),grandTotal:Big(h.get("grandTotal")).plus(Big(v.get("grandTotal")))});var b=e.findBy("currencyAbbreviation",a.get("currencyAbbreviation")).get("memberCharge"),C=a.get("tenderTypes").findBy("tenderType",7);C&&b.setProperties({transactionsTotal:Big(b.get("transactionsTotal")).plus(Big(C.get("transactionsTotal"))),salesTotal:Big(b.get("salesTotal")).plus(Big(C.get("salesTotal"))),refundsTotal:Big(b.get("refundsTotal")).plus(Big(C.get("refundsTotal"))),grandTotal:Big(b.get("grandTotal")).plus(Big(C.get("grandTotal")))})}),e.forEach(function(e){var t=e.get("card"),a=e.get("cash"),n=e.get("check"),r=e.get("member"),l=e.get("utg"),d=e.get("room"),i=e.get("memberCharge");e.setProperties({transactionsTotal:Big(e.get("transactionsTotal")).plus(Big(t.get("transactionsTotal"))).plus(Big(a.get("transactionsTotal"))).plus(Big(n.get("transactionsTotal"))).plus(Big(r.get("transactionsTotal"))).plus(Big(l.get("transactionsTotal"))).plus(Big(d.get("transactionsTotal"))).plus(Big(i.get("transactionsTotal"))),salesTotal:Big(e.get("salesTotal")).plus(Big(t.get("salesTotal"))).plus(Big(a.get("salesTotal"))).plus(Big(n.get("salesTotal"))).plus(Big(r.get("salesTotal"))).plus(Big(l.get("salesTotal"))).plus(Big(d.get("salesTotal"))).plus(Big(i.get("salesTotal"))),refundsTotal:Big(e.get("refundsTotal")).plus(Big(t.get("refundsTotal"))).plus(Big(a.get("refundsTotal"))).plus(Big(n.get("refundsTotal"))).plus(Big(r.get("refundsTotal"))).plus(Big(l.get("refundsTotal"))).plus(Big(d.get("refundsTotal"))).plus(Big(i.get("refundsTotal"))),grandTotal:Big(e.get("grandTotal")).plus(Big(t.get("grandTotal"))).plus(Big(a.get("grandTotal"))).plus(Big(n.get("grandTotal"))).plus(Big(r.get("grandTotal"))).plus(Big(l.get("grandTotal"))).plus(Big(d.get("grandTotal"))).plus(Big(i.get("grandTotal")))})}),e}return!1}.property("model"),actions:{sortBy:function(e,t){$(".sortBy."+e.get("cardType")+e.get("merchantId")).removeClass("ascending"),$(".sortBy."+e.get("cardType")+e.get("merchantId")).removeClass("descending"),e.toggleProperty("sortAscending"),e.get("sortAscending")?(e.set("sortProperties",[t+":asc"]),$("#"+[t]+e.get("cardType")+e.get("merchantId")).addClass("ascending")):(e.set("sortProperties",[t+":desc"]),$("#"+[t]+e.get("cardType")+e.get("merchantId")).addClass("descending"))},retrieveReport:function(){},toggleCardTender:function(e){e.toggleProperty("expanded"),e.get("expanded")&&e.get("salesByCardType.length")<1&&this.send("retrieveSalesByCardType",e)},retrieveSalesByCardType:function(e){ if($("#progressHudMessage").html("Please Wait..."),$("#progressHudOverlay").show(),null==this.get("daterange"))var t=[moment().format("MM/DD/YYYY"),moment().format("MM/DD/YYYY")];else var t=this.get("daterange").split(" - ");this.store.query("salesByCardType",{merchantId:e.get("merchantId"),cardType:e.get("cardType"),startDate:t[0],endDate:t[1]}).then(function(t){$("#progressHudOverlay").hide(),e.set("salesByCardType",t)},function(t){$("#progressHudOverlay").hide(),_error("There was a problem trying to load the sale details for this tender. Please try again."),e.set("expanded",!1)})}}})}),define("shift4tress/controllers/reports/vt4-reports/payments-report/unknowns",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({paymentsReport:t["default"].inject.controller("reports.paymentsReport"),merchant:function(){return this.get("paymentsReport.model.merchants").findBy("id",parseFloat(this.get("model.query.merchantId")))}.property("model")})}),define("shift4tress/controllers/reports/vt4-reports/tax-profiles-report/index",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({reports:t["default"].inject.controller(),merchantModel:t["default"].computed.alias("reports"),daterange:t["default"].computed.alias("reports.daterange"),chartOptions:{chart:{type:"column"},title:{text:"Collected"},xAxis:{type:"category"},yAxis:{title:{text:""},labels:{format:"${value:.2f}"}},tooltip:{headerFormat:"{point.series.name}
",pointFormat:'{point.name}: ${point.y:.2f}'},legend:{enabled:!1},plotOptions:{series:{borderWidth:0,dataLabels:{enabled:!0,format:"${point.y:.2f}"}}}},actions:{showRates:function(e){e.set("displayProfilesReport",!1)},showProfiles:function(e){e.set("displayProfilesReport",!0)}}})}),define("shift4tress/controllers/reports/vt4-reports/transactions-report/index",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({reports:t["default"].inject.controller(),merchantModel:t["default"].computed.alias("reports"),daterange:t["default"].computed.alias("reports.daterange"),actions:{sortByTransaction:function(e,t){$(".sortBy.sortByTransaction").removeClass("ascending"),$(".sortBy.sortByTransaction").removeClass("descending"),e.toggleProperty("sortAscending"),e.get("sortAscending")?(e.set("sortProperties",[t+":asc"]),$("#"+[t]+e.get("dateInMs")).addClass("ascending")):(e.set("sortProperties",[t+":desc"]),$("#"+[t]+e.get("dateInMs")).addClass("descending"))},sortByTransactionItem:function(e,t){$(".sortBy.sortByTransactionItem."+e.get("saleNumber")+e.get("merchantId")).removeClass("ascending"),$(".sortBy.sortByTransactionItem."+e.get("saleNumber")+e.get("merchantId")).removeClass("descending"),e.toggleProperty("sortAscending"),e.get("sortAscending")?(e.set("sortProperties",[t+":asc"]),$("#"+[t]+e.get("saleNumber")+e.get("merchantId")).addClass("ascending")):(e.set("sortProperties",[t+":desc"]),$("#"+[t]+e.get("saleNumber")+e.get("merchantId")).addClass("descending"))},toggleHeader:function(e){e.toggleProperty("expanded")},toggleDate:function(e){e.toggleProperty("expanded")},toggleTransaction:function(e){e.toggleProperty("expanded"),e.get("expanded")&&e.get("transactionItems.length")<1&&this.send("retrieveTransactionItems",e)},retrieveTransactionItems:function(e){$("#progressHudMessage").html("Please Wait..."),$("#progressHudOverlay").show(),this.store.queryRecord("transactionsBySaleDateTime",{id:e.get("merchantId"),saleNumber:e.get("saleNumber")}).then(function(e){$("#progressHudOverlay").hide()},function(t){$("#progressHudOverlay").hide(),_error("There was a problem trying to load the item details for this sale. Please try again."),e.set("expanded",!1)})}}})}),define("shift4tress/controllers/reports",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({report:"reports",daterange:function(){return moment().format("MM/DD/YYYY")+" - "+moment().format("MM/DD/YYYY")}.property(),daterangeChanged:function(e){this.send("refresh")}.observes("daterange"),displayReport:function(){var e=this.get("report");return"paymentReport"==e?"Payments":"transactionsReport"==e?"Transactions":"taxProfilesReport"==e?"Tax":"exportReport"==e?"Export":""}.property("report")})}),define("shift4tress/controllers/vt4/campaigns/member-accounts/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),actions:{display:function(){var e=this,t=this.get("vt4.model");$("#progressHudMessage").html("Retrieving..."),$("#progressHudOverlay").show(),this.store.queryRecord("vtCampaign",{parentBusinessEntityId:t.get("id"),includeData:!0}).then(function(t){e.set("model",t),$("#progressHudOverlay").hide()},App.FailureHandler("retrieve the members for this merchant"))},"import":function(){$("#uploadCSV").modal().toggle(),$("#ImageUploadForm").validate().resetForm()},cancelUpload:function(){$("#uploadCSV").off("hidden.bs.modal"),App.set("CsvUpload",null),$("#csvUpload").val(""),$("#ImageUploadForm").validate().resetForm()},confirmUpload:function(){$("#ImageUploadForm").valid()&&($("#uploadCSV").on("hidden.bs.modal",function(e){$("#confirmUpload").modal("show")}),$("#uploadCSV").modal("hide"))},sendCsv:function(){$("#confirmUpload").modal("hide"),$("#uploadCSV").off("hidden.bs.modal");var e=(this.get("vt4").get("model"),this.get("model"),this),t=this.store.createRecord("vtCampaign",{csvSource:App.CsvUpload,merchant:this.get("vt4").get("model")});$("#progressHudMessage").html("Uploading..."),$("#progressHudOverlay").show(),t.save().then(function(t){e.set("model",t),_alert("File has been uploaded successfully.","success"),$("#progressHudOverlay").hide(),App.set("CsvUpload",null),$("#csvUpload").val(""),e.send("refresh")},function(e){$("#progressHudOverlay").hide();var a=function(){$("#csvUpload").val(""),App.set("CsvUpload",null),t.deleteRecord()};if(400!=e.errors[0].detail.code)var n=App.FailureHandler("upload member accounts",function(e){a()});else var n=function(){_alert("Invalid format, please review formatting guidelines.","danger"),a(),$("#uploadCSV").modal().toggle()};n(e)})}}})}),define("shift4tress/controllers/vt4/campaigns/member-accounts",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({rowCount:function(){return this.get("model.rowCount")}.property("model.rowCount")})}),define("shift4tress/controllers/vt4/index",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/vt4/settings/accessories/edit-accessory",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isLoading:!1,accessoryTypes:function(){var e=[];return e.push({key:"UTG",value:Number(0)}),e.push({key:"Printer",value:Number(1)}),this.set("selectedAccessoryType",Number(this.get("model.accessoryType"))-1),e}.property("model.accessoryType"),allowedPrinterTypes:function(){var e=[];return e.push({key:"Epson",value:0}),e.push({key:"Star",value:1}),this.set("selectedPrinterType",""==this.get("model.printerType")?null:"Epson"==this.get("model.printerType")?0:1),e}.property("model"),isPrinter:function(){var e=1==this.get("selectedAccessoryType");return e||this.set("selectedPrinterType",""),e}.property("selectedAccessoryType"),selectedAccessoryType:null,selectedPrinterType:null,actions:{change:function(){},cancelUpdateAccessory:function(){this.model.rollbackAttributes(),$("#editAccessoryForm").validate().resetForm(),$("div.editAccessoryDescription").removeClass("has-error"),$("div.editAccessoryIP").removeClass("has-error"),$("div.editAccessoryPort").removeClass("has-error")},updateAccessory:function(){if($("#editAccessoryForm").valid()){var e=this;this.set("isLoading",!0);var t="IPAddress:"+this.get("model.ipAddress").concat(";Port:"+this.get("model.port"));this.set("model.settings",t),this.set("model.accessoryType",Number(this.get("selectedAccessoryType"))+1),2==this.get("model.accessoryType")&&this.set("model.printerType",0==this.get("selectedPrinterType")?"Epson":"Star"),this.set("model.description",this.get("model.tempDescription")),this.model.save().then(function(){$("#edit-accessory").on("hidden.bs.modal",function(t){e.set("isLoading",!1)}),_alert("The accessory has been updated.","success"),$("#edit-accessory").modal("hide")},App.FailureHandler("save this accessory",function(){e.set("isLoading",!1)}))}}}})}),define("shift4tress/controllers/vt4/settings/accessories/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),"vt4.settings.accessories":t["default"].inject.controller(),sortedAccessories:t["default"].computed.sort("model","sortProperties"),sortProperties:["description:asc"],sortAscending:!0,isLoading:!1,isPrinter:function(){if(this.get("newAccessory")){var e=1==this.get("selectedAccessoryType");return e||this.set("selectedPrinterType",""),e}return!1}.property("selectedAccessoryType"),accessoryTypes:function(){var e=[];return e.push({key:"UTG",value:0}),e.push({key:"Printer",value:1}),e}.property("model.[]"),allowedPrinterTypes:function(){var e=[];return e.push({key:"Epson",value:0}),e.push({key:"Star",value:1}),e}.property("model"),selectedAccessoryType:null,selectedPrinterType:null,actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.get("sortAscending")?(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("descending")),this.toggleProperty("sortAscending")},newAccessory:function(){var e=this.get("vt4.model");$(".alert").alert("close"),this.set("newAccessory",this.store.createRecord("accessory",{description:"",merchant:e,utgIP:"",utgPort:"",accessoryType:0,printerType:""})),$("#newAccessory").modal("show"),$("#accessoryForm").validate().resetForm(),$("#accessoryIP").rules("add",{regex:ipvalidateregex})},addAccessory:function(){var e=this;if($("#accessoryForm").valid()){this.set("isLoading",!0);var t=("IPAddress:"+this.get("newAccessory.ipAddress")).concat(";Port:"+this.get("newAccessory.port"));this.set("newAccessory.settings",t),this.set("newAccessory.accessoryType",Number(this.get("selectedAccessoryType"))+1),2==this.get("newAccessory.accessoryType")&&this.set("newAccessory.printerType",0==this.get("selectedPrinterType")?"Epson":"Star"),this.get("newAccessory").save().then(function(t){e.set("isLoading",!1),_alert("The accessory has been added.","success"),e.set("selectedAccessoryType",null),e.set("selectedPrinterType",null),$("#accessoryForm").validate().resetForm(),$("#newAccessory").modal("hide")},function(t){e.set("isLoading",!1),$("#newAccessory").modal("hide"),e.set("selectedAccessoryType",null),e.set("selectedPrinterType",null),App.FailureHandler("add a accessory")(t)})}},cancelAccessoryAdd:function(){var e=this;this.get("newAccessory").deleteRecord(),$(".alert").alert("close"),$("#accessoryForm").validate().resetForm(),$("div.accessoryDescription").removeClass("has-error"),$("div.accessoryIP").removeClass("has-error"),$("div.accessoryPort").removeClass("has-error"),$("div.accessoryType").removeClass("has-error"),e.set("selectedAccessoryType",null),e.set("selectedPrinterType",null)},deleteAccessoryConfirm:function(e){this.set("accessoryToDelete",e),$(".alert").alert("close"),$("#deleteAccessory-modal").modal("toggle")},deleteAccessory:function(){var e=this.get("accessoryToDelete");e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The accessory has been deleted.","success")},function(t){e.rollbackAttributes(),App.FailureHandler(['delete "'+e.get("description")+'" from the list of accessories',""])(t)})}}})}),define("shift4tress/controllers/vt4/settings/discounts/edit-discount",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isLoading:!1,vt4:t["default"].inject.controller(),merchantCurrencySymbol:function(){return this.get("vt4.model").get("currencySymbol")}.property("vt4.model"),allowedRoles:function(){var e=this.store.peekAll("discountRole");return e.filter(function(e){return e})}.property("vt4.model"),isDollarDidChange:function(){$("#editDiscountForm :visible").length>0&&$("#editDiscountForm").validate().resetForm(),$("div.editDiscountName").removeClass("has-error"),$("div.editDiscountAmount").removeClass("has-error"),this.set("model.tempAmount",this.get("model.amount"))}.observes("model.tempIsDollar"),actions:{cancelUpdateDiscount:function(){this.model.rollbackAttributes(),this.get("allowedRoles").filterBy("enabled",!0).forEach(function(e){e.rollbackAttributes()}),$(".alert").alert("close"),$("#editDiscountForm").validate().resetForm(),$("div.editDiscountName").removeClass("has-error"),$("div.editDiscountAmount").removeClass("has-error")},updateDiscount:function(){if($("#editDiscountForm").valid()&&this.get("allowedRoles").filterBy("enabled",!0).length){var e=this;this.set("isLoading",!0),this.model.set("isDollar",this.model.get("tempIsDollar")),this.model.set("name",this.model.get("tempName")),this.model.set("amount",this.model.get("tempAmount"));var t=this.get("allowedRoles").filterBy("enabled",!0),a=this.get("allowedRoles").filterBy("enabled",!1);t.forEach(function(t){var a=e.model.get("roles").filterBy("id",t.get("id"));if(1==a.length)a[0].set("checked",!0);else{var a,n=e.store.peekAll("vtRole"),r=n.filterBy("id",t.get("id"));1==r.length?(a=r[0],a.set("checked",!0)):a=e.store.createRecord("vtRole",{id:t.get("id"),name:t.get("name"),discounts:[],checked:!0}),a.get("discounts").addObject(e.model)}}),a.forEach(function(t){var a=e.model.get("roles").filterBy("id",t.get("id"));1==a.length&&a[0].set("checked",!1)});var n=[];this.model.get("roles").forEach(function(e){e&&(e.get("checked")||n.push(e))}),n.forEach(function(t){t.get("discounts").removeObject(e.model)}),this.model.save().then(function(){$("#edit-discount").on("hidden.bs.modal",function(t){e.set("isLoading",!1)}),e.get("allowedRoles").filterBy("enabled",!0).forEach(function(e){e.rollbackAttributes()}),_alert("The discount has been updated.","success"),$("#edit-discount").modal("hide")},function(t){e.set("isLoading",!1),App.FailureHandler("update this discount")(t)})}else _alert("You must have at least one role selected.","warning")}}})}),define("shift4tress/controllers/vt4/settings/discounts/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),sortedDiscounts:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,isLoading:!1,merchantCurrencySymbol:function(){return this.get("vt4.model")?this.get("vt4.model").get("currencySymbol"):""}.property("vt4.model"),allowedRoles:function(){return this.store.peekAll("discountRole")}.property("vt4.model"),isDollarDidChange:function(){$("#discountForm").validate().resetForm(),$("div.discountName").removeClass("has-error"),$("div.discountAmount").removeClass("has-error"),this.set("newDiscount.amount",void 0)}.observes("newDiscount.isDollar"),actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.get("sortAscending")?(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("descending")),this.toggleProperty("sortAscending")},newDiscount:function(){var e=this.get("vt4.model");$(".alert").alert("close"),this.set("newDiscount",this.store.createRecord("discount",{name:"",merchant:e,amount:void 0,isDollar:!1,isEditable:!1,roles:[]})),$("#newDiscount").modal("show"),$("#discountForm").validate().resetForm()},addDiscount:function(){if($("#discountForm").valid()&&this.get("allowedRoles").filterBy("enabled",!0).length){var e=this;this.get("vt4.model");$("#discount-add-cancel-button").prop("disabled",!0),this.set("isLoading",!0);var t=this.get("allowedRoles").filterBy("enabled",!0);t.forEach(function(t){var a,n=e.store.peekAll("vtRole"),r=n.filterBy("id",t.get("id"));a=1==r.length?r[0]:e.store.createRecord("vtRole",{id:t.get("id"),name:t.get("name"),discounts:[],checked:!1}),a.get("discounts").addObject(e.get("newDiscount"))}),this.get("newDiscount").save().then(function(a){e.set("isLoading",!1),$("#discount-add-cancel-button").prop("disabled",!1),_alert("The discount has been added.","success"),t.forEach(function(e){e.rollbackAttributes()}),$("#newFalse").attr("checked",!0),$("#discountForm").validate().resetForm(),$("#newDiscount").modal("hide")},function(a){e.set("isLoading",!1),t.forEach(function(e){e.rollbackAttributes()}),$("#newDiscount").modal("hide"),App.FailureHandler("add a discount")(a)})}else _alert("You must select at least one role.","warning")},cancelDiscountAdd:function(){this.get("newDiscount").rollbackAttributes(),this.get("allowedRoles").filterBy("enabled",!0).forEach(function(e){e.rollbackAttributes()}),this.get("newDiscount").unloadRecord(),$(".alert").alert("close"),$("#discountForm").validate().resetForm(),$("div.discountName").removeClass("has-error"),$("div.discountAmount").removeClass("has-error")},deleteDiscountConfirm:function(e){this.set("discountToDelete",e),$(".alert").alert("close"),$("#deleteDiscount-modal").modal("toggle")},deleteDiscount:function(){var e=this.get("discountToDelete");e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The discount has been deleted.","success")},function(t){e.rollbackAttributes(),App.FailureHandler(['delete "'+e.get("description")+'" from the list of discounts',""])(t)})}}})}),define("shift4tress/controllers/vt4/settings/general",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),isEditDiabled:function(){var e=App.currentSession.get("user");return!e.hasPermission("canView","vt4Settings",e.get("parentBusinessEntity"))}.property("model"),isTipDidChange:function(){this.get("model.isTip")||(this.set("model.defaultTipPercent1",10),this.set("model.defaultTipPercent2",15),this.set("model.defaultTipPercent3",20))}.observes("model.isTip"),allowCashoutDidChange:function(){this.get("model.allowCashout")||this.set("model.cashoutThreshold",5)}.observes("model.allowCashout"),actions:{save:function(){$("#generalSettingsForm").valid()&&this.get("model").save().then(function(){_success("Your settings have been saved."),_warn("Updates will only be reflected when users sign out and sign back in.")},App.FailureHandler("save the general settings for this merchant"))}}})}),define("shift4tress/controllers/vt4/settings/receipt/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),actions:{save:function(){$("#receiptSettingsForm").valid()&&this.get("model").save().then(function(){_success("Your settings have been saved."),_warn("Updates will only be reflected when users sign out and sign back in.")},App.FailureHandler("save the receipt settings for this merchant"))}}})}),define("shift4tress/controllers/vt4/settings/settings",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/vt4/settings/tax-profiles/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({isLoading:!1,vt4:t["default"].inject.controller(),availableTaxProfiles:function(){var e=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];return this.get("model").forEach(function(t){e.removeObject(t.get("profileName"))}),e}.property("model","model.length"),mergeableTaxProfiles:function(){var e=this.get("model"),t=this.get("pendingDelete");return e.filter(function(e,a,n){return e!=t})}.property("pendingDelete"),taxRateLimitReached:function(){return this.get("newTaxProfile.taxProfileRates.length")>=5}.property("newTaxProfile.taxProfileRates.length"),taxRateMinimumReached:function(){return 1==this.get("newTaxProfile.taxProfileRates.length")}.property("newTaxProfile.taxProfileRates.length"),actions:{newTaxProfile:function(){$("#newTaxProfile").modal().toggle(),this.set("newTaxProfile",this.store.createRecord("taxProfile",{merchant:this.get("vt4.model")})),this.get("newTaxProfile.taxProfileRates").pushObject(this.store.createRecord("taxProfileRate",{isInclusive:!1,isEditDisabled:!1,taxProfile:this.get("newTaxProfile")}))},addRateProfile:function(){var e=this;$("#addTaxProfileForm").valid()&&(this.set("isLoading",!0),this.get("newTaxProfile").save().then(function(){var t=[];e.get("newTaxProfile").get("taxProfileRates").forEach(function(e){e&&null==e.get("id")&&t.push(e)}),t.forEach(function(t){e.store.unloadRecord(t)}),$("#newTaxProfile").modal("toggle"),_alert("Tax profile created successfully.","success"),e.set("isLoading",!1)},App.FailureHandler("add the rate profile"),function(){e.set("isLoading",!1)}))},removeTaxRate:function(e){e.destroyRecord()},addTaxRate:function(){this.store.createRecord("taxProfileRate",{isInclusive:!1,isEditDisabled:!1,taxProfile:this.get("newTaxProfile")})},cancelAdd:function(){this.get("newTaxProfile").deleteRecord(),$("#addTaxProfileForm .has-error").removeClass("has-error"),$("#addTaxProfileForm").validate().resetForm()},promptDeleteTaxProfile:function(e){this.set("pendingDelete",e),this.get("pendingDelete.itemCount")?$("#mergeTaxProfile-modal").modal().toggle():$("#deleteTaxProfile-modal").modal().toggle()},mergeTaxProfile:function(){var e=this;$("#taxProfileMerge").valid()&&(this.get("pendingDelete").set("newTaxProfileId",this.get("mergedTaxProfile")),this.get("pendingDelete").deleteRecord(),$("#mergeTaxProfile-modal").modal("toggle"),this.get("pendingDelete").save().then(function(){_alert("All item(s) have been updated and tax profile has been deleted.","success"),e.get("vt4.model").find("items")},App.FailureHandler("update the tax profile")))},deleteTaxProfile:function(){this.get("pendingDelete").deleteRecord(),this.get("pendingDelete").save().then(function(){_alert("All item(s) have been updated and tax profile has been deleted.","success")},App.FailureHandler("update the tax profile"))}}})}),define("shift4tress/controllers/vt4/settings/tax-profiles/tax-profile",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({taxProfiles:t["default"].inject.controller("vt4.settings.tax-profiles"),rateToSave:null,guidFor:function(e){return t["default"].guidFor(e)},availableTaxProfiles:function(){var e=this,t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];return this.get("taxProfiles").get("model").forEach(function(a){a.get("id")!=e.get("model.id")&&t.removeObject(a.get("profileName"))}),t}.property("model","model.profileName"),taxRateLimitReached:function(){return this.get("model.taxProfileRates.length")>=5}.property("model.taxProfileRates.length"),taxRateMinimumReached:function(){var e=0;return this.get("model.taxProfileRates").forEach(function(t){t.get("id")&&e++}),1==this.get("model.taxProfileRates.length")||1>=e}.property("model.taxProfileRates.length","model.taxProfileRates.@each.id"),actions:{editTaxProfile:function(){this.model.set("isEditDisabled",!1)},cancelEditTaxProfile:function(){this.model.set("isEditDisabled",!0),this.model.rollbackAttributes()},saveTaxProfile:function(){this.model.get("hasDirtyAttributes")&&this.model.save().then(function(){_alert("The tax profile has been updated.","success")},App.FailureHandler("update the tax profile")),this.get("rateToSave")&&this.send("saveTaxRate",this.get("rateToSave")),this.model.set("isEditDisabled",!0)},confirmSaveTaxProfile:function(e){$("#taxProfileRates").valid()&&(e?(this.set("rateToSave",e),$("#confirmSaveTaxProfile").modal().toggle()):this.model.get("hasDirtyAttributes")?$("#confirmSaveTaxProfile").modal().toggle():this.model.set("isEditDisabled",!0))},editTaxRate:function(e){var t=this;this.model.get("taxProfileRates").forEach(function(e){e.get("isEditDisabled")||t.send("cancelEditTaxRate",e)}),e.set("isEditDisabled",!1)},promptRemoveTaxRate:function(e){this.set("pendingDelete",e),$("#removeTaxRate-modal").modal().toggle()},removeTaxRate:function(){this.get("pendingDelete").destroyRecord().then(function(){_alert("The tax profile has been updated.","success")},App.FailureHandler("remove the tax rate"))},cancelEditTaxRate:function(e){e.get("id")?(e.set("displayRate",new Big(e.get("historicTaxRate")).toFixed(3)),e.rollbackAttributes(),e.set("historicTaxRate",e.get("taxRate"))):this.store.unloadRecord(e),$("#taxProfileRates").validate().resetForm(),$(".has-error").removeClass("has-error"),e.set("isEditDisabled",!0)},saveTaxRate:function(e){$("#taxProfileRates").valid()&&(e.set("isEditDisabled",!0),e.save().then(function(){e.set("historicTaxRate",e.get("taxRate")),_alert("The tax profile has been updated.","success")},App.FailureHandler("update the tax profile rate")))},addTaxRate:function(){this.store.createRecord("taxProfileRate",{isInclusive:!1,isEditDisabled:!1,taxProfile:this.get("model")})}}})}),define("shift4tress/controllers/vt4/settings/tender/configure-integrations",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),isLoading:!1,externalIntegrations:function(){return this.get("vt4.model.externalIntegrations")}.property("model"),integrationSettingLimitReached:function(){return this.get("vt4.model.integrationSettings.length")>=20}.property("vt4.model.integrationSettings.length"),integrationSettingMinimumReached:function(){return 1==this.get("vt4.model.integrationSettings").filterBy("integrationSettingIsDeleted",!1).get("length")}.property("vt4.model.integrationSettings.@each.integrationSettingIsDeleted"),actions:{cancelAddIntegrationSettings:function(){console.log("cancelAddintegrationSettings");var e=this,a=this.get("vt4.model.integrationSettings"),n=[];a.forEach(function(e){e.get("hasDirtyAttributes")&&(e.get("id")?e.rollbackAttributes():n.push(e))});for(var r=n.length,l=0;r>l;l++)e.store.unloadRecord(n.objectAt(l));t["default"].run.later(function(){e.transitionToRoute("vt4.settings.tender")},300)},commitIntegrationSettings:function(){if($("#commitIntegrationSettingsForm").valid()){var e=this;console.log("addIntegrationSettings"),$("#ei-configure-integrations-cancel").prop("disabled",!0),this.set("isLoading",!0);var a=this.get("vt4.model.integrationSettings"),n=0,r=[],l=[];a.forEach(function(e){e.get("hasDirtyAttributes")&&(n++,e.get("integrationSettingIsDeleted")?l.push(e):r.push(e))}),n>0?($("#progressHudMessage").html("Please Wait..."),$("#progressHudOverlay").show(),r.forEach(function(a){if(a.get("hasDirtyAttributes")){var r=e.get("externalIntegrations").filterBy("id",a.get("externalIntegrationId")).objectAt(0);r&&(a.set("externalIntegrationName",r.get("displayName")),a.set("messagingType",r.get("messagingType"))),a.get("historicPassword")&&"AaBbCc™®"==a.get("password")&&a.set("password",a.get("historicPassword")),-1==a.get("password").indexOf("[[Decrypt")&&-1==a.get("password").indexOf("[[Encrypt")&&a.set("password","[[Encrypt("+String(a.get("password"))+")]]"),a.set("connectionString",JSON.stringify(a,["instance","chargeUrl","lookupUrl","isProxy","userId","password"])),a.set("tenderTypeId",7),a.save().then(function(){n--,0==n&&t["default"].run.later(function(){_success("Your settings have been saved."),e.set("isLoading",!1),$("#ei-configure-integrations-cancel").prop("disabled",!1),$("#ei-configure-integrations-modal").modal("hide"),$("#progressHudOverlay").hide(),e.transitionToRoute("vt4.settings.tender")})},function(a){t["default"].run.later(function(){$("#progressHudOverlay").hide(),e.set("isLoading",!1),App.FailureHandler("save your settings")(a),$("#ei-configure-integrations-cancel").prop("disabled",!1)}),console.log("commitintegrationSettings Insert/Update - ERROR: "+a)})}}),l.forEach(function(a){a.get("hasDirtyAttributes")&&(a.deleteRecord(),a.save().then(function(){n--,0==n&&t["default"].run.later(function(){_success("Your settings have been saved."),e.set("isLoading",!1),$("#ei-configure-integrations-cancel").prop("disabled",!1),$("#ei-configure-integrations-modal").modal("hide"),$("#progressHudOverlay").hide(),e.transitionToRoute("vt4.settings.tender")})},function(a){t["default"].run.later(function(){$("#progressHudOverlay").hide(),e.set("isLoading",!1),App.FailureHandler("save your settings")(a),$("#ei-configure-integrations-cancel").prop("disabled",!1)}),console.log("commitIntegrationSettings Delete - ERROR: "+a)}))})):t["default"].run.later(function(){_success("Your settings have been saved."),e.set("isLoading",!1),$("#ei-configure-integrations-cancel").prop("disabled",!1),$("#ei-configure-integrations-modal").modal("hide"),e.transitionToRoute("vt4.settings.tender")})}},addNewIntegrationSetting:function(){var e=this;this.store.createRecord("integrationSetting",{localId:"integrationSetting"+t["default"].generateGuid(),merchant:e.get("vt4.model")})},removeIntegrationSetting:function(e){e.get("id")?e.set("integrationSettingIsDeleted",!0):this.store.unloadRecord(e)},testIntegrationSettingConnection:function(e){alert("'Test integrationSetting Connection' coming soon!")}}})}),define("shift4tress/controllers/vt4/settings/tender/configure-properties",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),isLoading:!1,pmsSettingLimitReached:function(){return this.get("vt4.model.pmsSettings.length")>=20}.property("vt4.model.pmsSettings.length"),pmsSettingMinimumReached:function(){return 1==this.get("vt4.model.pmsSettings").filterBy("pmsSettingIsDeleted",!1).get("length")}.property("vt4.model.pmsSettings.@each.pmsSettingIsDeleted"),actions:{cancelAddPmsSettings:function(){var e=this,a=this.get("vt4.model.pmsSettings"),n=[];a.forEach(function(e){e.get("hasDirtyAttributes")&&(e.get("id")?e.rollbackAttributes():n.push(e))});for(var r=n.length,l=0;r>l;l++)e.store.unloadRecord(n.objectAt(l));t["default"].run.later(function(){e.transitionToRoute("vt4.settings.tender")},300)},commitPmsSettings:function(){if($("#commitPmsSettingsForm").valid()){var e=this;$("#pms-configure-properties-cancel").prop("disabled",!0),this.set("isLoading",!0);var a=this.get("vt4.model.pmsSettings"),n=0,r=[],l=[];a.forEach(function(e){e.get("hasDirtyAttributes")&&(n++,e.get("pmsSettingIsDeleted")?l.push(e):r.push(e))}),n>0?($("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").show(),r.forEach(function(a){a.get("hasDirtyAttributes")&&(a.set("connectionString",JSON.stringify(a,["isProxy","url"])),a.save().then(function(){n--,0==n&&t["default"].run.later(function(){_success("Your settings have been saved."),e.set("isLoading",!1),$("#pms-configure-properties-cancel").prop("disabled",!1),$("#pms-configure-properties-modal").modal("hide"),$("#progressHudOverlay").hide(),e.transitionToRoute("vt4.settings.tender")})},function(a){t["default"].run.later(function(){$("#progressHudOverlay").hide(),e.set("isLoading",!1),App.FailureHandler("save your settings")(a),$("#pms-configure-properties-cancel").prop("disabled",!1)}),console.log("commitPmsSettings Insert/Update - ERROR: "+a)}))}),l.forEach(function(a){a.get("hasDirtyAttributes")&&(a.deleteRecord(),a.save().then(function(){n--,0==n&&t["default"].run.later(function(){_success("Your settings have been saved."),e.set("isLoading",!1),$("#pms-configure-properties-cancel").prop("disabled",!1),$("#pms-configure-properties-modal").modal("hide"),$("#progressHudOverlay").hide(),e.transitionToRoute("vt4.settings.tender")})},function(a){t["default"].run.later(function(){ $("#progressHudOverlay").hide(),e.set("isLoading",!1),App.FailureHandler("save your settings")(a),$("#pms-configure-properties-cancel").prop("disabled",!1)}),console.log("commitPmsSettings Delete - ERROR: "+a)}))})):t["default"].run.later(function(){_success("Your settings have been saved."),e.set("isLoading",!1),$("#pms-configure-properties-cancel").prop("disabled",!1),$("#pms-configure-properties-modal").modal("hide"),e.transitionToRoute("vt4.settings.tender")})}},addNewPmsSetting:function(){var e=this;this.store.createRecord("pmsSetting",{localId:"pmsSetting"+String(localPmsSettingId),merchant:e.get("vt4.model")})},removePmsSetting:function(e){e.get("id")?e.set("pmsSettingIsDeleted",!0):this.store.unloadRecord(e)},testPMSConnection:function(e){alert("'Test PMS Connection' coming soon!")}}})}),define("shift4tress/controllers/vt4/settings/tender/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),tenderTypesDirty:function(){var e=!1;return this.get("model.types").forEach(function(t){t.get("isDirty")&&(e=!0)}),e}.property("model.types.@each.isDirty"),tenderSelected:function(){var e=!1;return this.get("model.types")&&this.get("model.types").forEach(function(t){t.get("enabled")&&(e=!0)}),e}.property("model.types.@each.enabled"),tenderTypesAllowed:function(){var e=this;this.get("model.types").forEach(function(t){t.get("isRoomCharge")?e.get("vt4.model.propertyManagementSystems.length")>0?t.set("isTenderTypeAllowed",!0):t.set("isTenderTypeAllowed",!1):t.get("isMemberCharge")?e.get("vt4.model.externalIntegrations.length")>0?t.set("isTenderTypeAllowed",!0):t.set("isTenderTypeAllowed",!1):t.set("isTenderTypeAllowed",!0)})}.observes("model.types.[]"),actions:{save:function(){var e=this;this.get("model").save().then(function(){_success("Your settings have been saved."),_warn("Updates will only be reflected when users sign out and sign back in."),e.get("configureProperties")?(e.set("configureProperties",!1),e.transitionToRoute("vt4.settings.tender.configureProperties")):e.get("configureIntegrations")&&(e.set("configureIntegrations",!1),e.transitionToRoute("vt4.settings.tender.configureIntegrations"))},App.FailureHandler("save the tender settings for this merchant"))},configureRoomCharge:function(){this.get("tenderTypesDirty")&&this.get("tenderSelected")?($("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").show(),this.set("configureProperties",!0),this.send("save")):this.transitionToRoute("vt4.settings.tender.configureProperties")},configureExternalIntegrations:function(){this.get("tenderTypesDirty")&&this.get("tenderSelected")?($("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").show(),this.set("configureIntegrations",!0),this.send("save")):this.transitionToRoute("vt4.settings.tender.configureIntegrations")}}})}),define("shift4tress/controllers/vt4/settings/theme/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),imageValid:!0,liableCheck:!1,shouldRefresh:!1,uploadChanged:function(){$("#liableCheck-error").remove(),this.set("liableCheck",!1)}.observes("upload"),uploadExists:function(){return!!this.get("upload")}.property("upload"),updateColorPicker:function(){var e=this;this.get("model.primaryColor")?($("#p_color").css("background-color","rgb("+e.get("model.primaryColor")+")"),$("#s_color").css("background-color","rgb("+e.get("model.secondaryColor")+")"),$("#a_color").css("background-color","rgb("+e.get("model.accentColor")+")")):($("#p_color").css("background-color","rgb(255,255,255)"),$("#s_color").css("background-color","rgb(255,255,255)"),$("#a_color").css("background-color","rgb(255,255,255)")),this.set("shouldRefresh",!1)}.observes("model","shouldRefresh"),actions:{save:function(){!this.get("model.themeConfigured")&&"undefined"!=typeof this.get("model.image")||this.get("model.themeConfigured")?$("#themeSettingsForm").valid()&&(this.set("imageValid",!0),this.get("model").save().then(function(){_success("Your settings have been saved."),_warn("Updates will only be reflected when users sign out and sign back in.")},App.FailureHandler("save the theme for this merchant"))):"undefined"==typeof this.get("model.image")&&($("#themeSettingsForm").valid(),this.set("imageValid",!1))},cancelUpdate:function(){this.model.rollbackAttributes(),this.set("upload",null),$("#ImageUploadForm").validate().resetForm(),$("#imageUpload").val(""),$("#liableCheck-error").remove(),this.set("liableCheck",!1),this.set("shouldRefresh",!0)},changeImage:function(){setTimeout(function(){$("#change-merchant-logo").modal("show")})},saveImage:function(){if($("#ImageUploadForm").valid()){var e=this;this.model.set("image",e.get("upload")),e.set("upload",null),$("#imageUpload").val(""),$("#change-merchant-logo").modal("hide"),this.set("imageValid",!0)}}}})}),define("shift4tress/controllers/vt4/shelf/categories/category/add-items",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({category:t["default"].inject.controller("vt4.shelf.categories.category"),vt4:t["default"].inject.controller(),sortedItems:t["default"].computed.sort("model","sortProperties"),sortProperties:["description:asc"],sortAscending:!0,checkedItems:function(){return this.get("model").filterBy("isChecked",!0)}.property("model.@each.isChecked"),selectedItemsExist:function(){return this.get("checkedItems.length")>0}.property("checkedItems"),actions:{sortBy:function(e){$(".sortBy.addItems").removeClass("ascending"),$(".sortBy.addItems").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#add-category-items #"+e).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#add-category-items #"+e).addClass("descending"))},toggleChecked:function(e){e.toggleProperty("isChecked")},addItems:function(){var e=this,a=this.get("checkedItems");a.forEach(function(a){e.store.createRecord("shelfCategoryItem",{merchant:e.get("vt4.model"),category:e.get("category.model"),item:a,lastUpdateDateTime:new Date}),a.get("shelfCategoryItems").forEach(function(e){"undefined"!=typeof e&&0==e.get("category.id")&&t["default"].run.once(this,function(){e.unloadRecord()})})}),this.get("category.model").batchSave("shelfCategoryItems").then(function(){e.set("sortProperties",["description:asc"]),e.set("sortAscending",!0),_alert("You have successfully added your items.","success"),$("#add-category-items").modal("hide")},App.FailureHandler("add the items to this category"))},cancelAddItems:function(){this.set("sortProperties",["description:asc"]),this.set("sortAscending",!0)}}})}),define("shift4tress/controllers/vt4/shelf/categories/category",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),categories:t["default"].inject.controller("vt4/shelf/categories"),sortedShelfCategoryItems:t["default"].computed.sort("model.filteredShelfCategoryItems","sortProperties"),sortProperties:["item.description:asc"],sortAscending:!0,isEditing:!1,liableCheck:!1,uploadChanged:function(){$("#liableCheck-error").remove(),this.set("liableCheck",!1)}.observes("upload"),uploadExists:function(){return!!this.get("upload")}.property("upload"),actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",["item."+e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",["item."+e+":desc"]),$("#"+[e]).addClass("descending"))},toggleEdit:function(){this.model.get("hasDirtyAttributes")&&this.model.rollbackAttributes(),this.toggleProperty("isEditing")},save:function(){var e=this;if(this.model.get("hasDirtyAttributes"))if(""!==this.model.get("name")){var t=this.get("categories").get("model"),a=!1;t.forEach(function(t){e.model!==t&&e.get("name")==t.get("name")&&(_alert("Category name already exists.","danger"),a=!0)}),a?this.model.rollbackAttributes():this.model.save().then(function(){_alert("The category has been updated.","success")},App.FailureHandler("save this category"))}else this.model.rollbackAttributes(),_alert("Category name cannot be empty.","danger");this.set("isEditing",!1)},changeImage:function(){this.model.rollbackAttributes(),this.set("isEditing",!1),setTimeout(function(){$("#change-category-image").modal("show")})},cancelUpdate:function(){this.model.rollbackAttributes(),App.set("Upload",null),$("#ImageUploadForm").validate().resetForm(),$("#imageUpload").val(""),$("#liableCheck-error").remove(),this.set("liableCheck",!1)},saveImage:function(){if($("#ImageUploadForm").valid()){var e=this;this.model.set("image",e.get("upload")),$("#change-category-image").modal("hide"),e.send("updateCategory")}},updateCategory:function(){var e=this;this.model.save().then(function(t){$("#change-category-image").on("hidden.bs.modal",function(a){e.transitionToRoute("category",t.id)}),_alert("The category has been updated.","success"),App.set("Upload",null),$("#liableCheck-error").remove(),e.set("liableCheck",!1),$("#imageUpload").val(""),$("#change-category-image").modal("hide")},App.FailureHandler("save this category"))},removeCategoryItem:function(e){var t=e;t.deleteRecord(),$("#progressHudMessage").html("Removing..."),$("#progressHudOverlay").show(),t.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The item has been removed.","success")},function(e){$("#progressHudOverlay").hide(),t.rollbackAttributes(),App.FailureHandler(['remove "'+t.item.get("description")+'" from this category',""])(e)})}}})}),define("shift4tress/controllers/vt4/shelf/categories/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),sortedShelfCategories:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],sortAscending:!0,liableCheck:!1,isLoading:!1,uploadChanged:function(){$("#liableCheck-error").remove(),this.set("liableCheck",!1)}.observes("upload"),uploadExists:function(){return!!this.get("upload")}.property("upload"),readyToSave:function(){return this.get("newCategory.name")&&this.get("liableCheck")}.property("newCategory.name","liableCheck"),actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("descending"))},newCategory:function(){$(".alert").alert("close"),this.set("newCategory",this.store.createRecord("shelfCategory",{name:"",merchant:this.get("vt4.model")})),$("#newCategory").modal("show")},addCategory:function(){var e=this,t=this.model,a=!1;t.forEach(function(t){e.get("newCategory")!==t&&e.get("newCategory.name")==t.get("name")&&(_alert("Category name already exists.","danger"),a=!0)}),a||$("#ImageUploadForm").valid()&&(this.set("isLoading",!0),this.get("newCategory").set("image",e.get("upload")),this.get("newCategory").save().then(function(t){$("#newCategory").on("hidden.bs.modal",function(a){e.set("isLoading",!1),e.transitionToRoute("vt4.shelf.categories.category",t.id)}),_alert("The category has been added.","success"),e.set("upload",null),$("#liableCheck-error").remove(),e.set("liableCheck",!1),$("#ImageUploadForm").validate().resetForm(),$("#imageUpload").val(""),$("#newCategory").modal("hide")},App.FailureHandler("add the category to this merchant")))},cancelAdd:function(){this.get("newCategory").deleteRecord(),this.set("Upload",null),$("#ImageUploadForm").validate().resetForm(),$("#imageUpload").val(""),$("div.shelfCategoryName").removeClass("has-error"),$("#liableCheck-error").remove(),this.set("liableCheck",!1)},deleteCategory:function(){var e=this.get("categoryToDelete");e.get("shelfCategoryItems").filter(function(e){e&&t["default"].run.once(this,function(){e.deleteRecord()})}),e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The category has been deleted.","success")},function(t){e.rollbackAttributes(),App.FailureHandler('delete "'+e.get("name")+'" from the list of categories')(t)})},deleteCategoryConfirm:function(e){this.set("categoryToDelete",e),$(".alert").alert("close"),$("#deleteCategory-modal").modal("toggle")}}})}),define("shift4tress/controllers/vt4/shelf/items/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),sortedItems:t["default"].computed.sort("model","sortProperties"),sortProperties:["description:asc"],sortAscending:!0,liableCheck:!1,isLoading:!1,taxProfileLocked:!1,uploadChanged:function(){$("#liableCheck-error").remove(),this.set("liableCheck",!1)}.observes("upload"),uploadExists:function(){return!!this.get("upload")}.property("upload"),isGiftCardDidChange:function(){this.get("newItem")&&this.get("newItem.isGiftCard")?(this.set("newItem.taxCode"," "),this.set("taxProfileLocked",!0)):this.set("taxProfileLocked",!1)}.observes("newItem.isGiftCard"),actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#"+[e]).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#"+[e]).addClass("descending"))},cancelAdd:function(){this.get("newItem").deleteRecord(),this.set("upload",null),$("#liableCheck-error").remove(),this.set("liableCheck",!1),$("#imageUpload").val(""),$("#addItemForm").validate().resetForm(),$(".form-group").removeClass("has-error")},newItem:function(){this.set("upload",null),this.set("newItem",this.store.createRecord("item",{description:"",merchant:this.get("vt4").model,image:null})),$("#newItem").modal("show")},addItem:function(){var e=this,t=this.model,a=!1;t.forEach(function(t){e.get("newItem")!==t&&e.get("newItem.upc")&&e.get("newItem.upc")==t.get("upc")&&(_error("UPC already exists.","danger"),a=!0)}),a||$("#addItemForm").valid()&&(this.set("isLoading",!0),this.get("newItem").set("image",e.get("upload")),this.get("newItem").save().then(function(t){$("#newItem").on("hidden.bs.modal",function(a){e.transitionToRoute("vt4.shelf.items.item",t.id),e.set("isLoading",!1),_alert("The item has been added.","success")}),$("#liableCheck-error").remove(),e.set("liableCheck",!1),e.set("upload",null),$("#newItem").modal("hide")},App.FailureHandler("add an item",function(){e.set("isLoading",!1)})))},deleteItem:function(){var e=this.get("itemToDelete");e.get("shelfCategoryItems").filter(function(e){e&&t["default"].run.once(this,function(){e.deleteRecord()})}),e.get("itemModifiers").filter(function(e){e&&t["default"].run.once(this,function(){e.deleteRecord()})}),e.get("itemModifierSets").filter(function(e){e&&t["default"].run.once(this,function(){e.deleteRecord()})}),e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The item has been deleted.","success")},function(t){$("#progressHudOverlay").hide(),e.rollbackAttributes(),App.FailureHandler(['delete "'+e.get("name")+'" from the list of items',""])(t)})},deleteItemConfirm:function(e){this.set("itemToDelete",e),$(".alert").alert("close"),$("#deleteItem-modal").modal("toggle")}}})}),define("shift4tress/controllers/vt4/shelf/items/item/add-category",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),item:t["default"].inject.controller("vt4.shelf.items.item"),isLoading:!1,sortedCategories:t["default"].computed.sort("model","sortProperties"),sortProperties:["name:asc"],newShelfCategoryItem:function(){}.property(),checkedCategories:function(){return this.get("model").filterBy("isChecked",!0)}.property("model.@each.isChecked"),selectedCategoriesExist:function(){return this.get("checkedCategories.length")>0}.property("checkedCategories"),isLoadingDidChange:function(){this.get("isLoading")?($("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").show()):$("#progressHudOverlay").hide()}.observes("isLoading"),actions:{toggleChecked:function(e){e.toggleProperty("isChecked")},addCategory:function(e){this.set("isLoading",!0);var a=this,n=this.get("item.model"),r=this.get("checkedCategories");r.forEach(function(e){a.store.createRecord("shelfCategoryItem",{merchant:a.get("vt4").model,category:e,item:n,lastUpdateDateTime:new Date})}),n.get("shelfCategoryItems").forEach(function(e){"undefined"!=typeof e&&0==e.get("category.id")&&t["default"].run.once(this,function(){e.unloadRecord()})}),t["default"].run.later(function(){n.batchSave("shelfCategoryItems").then(function(){$("#addCategory").modal("hide"),a.set("isLoading",!1),_alert("You have successfully added your categories.","success")},App.FailureHandler("add the item to the category",function(){a.set("isLoading",!1)}))})}}})}),define("shift4tress/controllers/vt4/shelf/items/item/add-modifier-group",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({newItemModifierGroup:function(){}.property(),item:t["default"].inject.controller("vt4.shelf.items.item"),vt4:t["default"].inject.controller(),isLoading:!1,checkedModifierGroups:function(){return this.get("model").filterBy("isChecked",!0)}.property("model.@each.isChecked"),selectedModifiersExist:function(){return this.get("checkedModifierGroups.length")>0}.property("checkedModifierGroups"),isLoadingDidChange:function(){this.get("isLoading")?($("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").show()):$("#progressHudOverlay").hide()}.observes("isLoading"),actions:{toggleChecked:function(e){e.toggleProperty("isChecked")},addModifierGroup:function(e){this.set("isLoading",!0);var t=this,a=this.get("checkedModifierGroups");a.forEach(function(e){t.store.createRecord("itemModifierSet",{merchant:t.get("vt4").model,modifierSet:e,item:t.get("item").model})}),this.get("item.model").batchSave("itemModifierSets").then(function(){$("#addModifierGroup").modal("hide"),t.set("isLoading",!1),_alert("You have successfully added your modifier groups.","success")},App.FailureHandler("add the modifier group to the item",function(){t.set("isLoading",!1)}))}}})}),define("shift4tress/controllers/vt4/shelf/items/item/add-modifier",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({item:t["default"].inject.controller("vt4.shelf.items.item"),vt4:t["default"].inject.controller(),isLoading:!1,newItemModifier:function(){}.property(),checkedModifiers:function(){return this.get("model").filterBy("isChecked",!0)}.property("model.@each.isChecked"),selectedModifiersExist:function(){return this.get("checkedModifiers.length")>0}.property("checkedModifiers"),isLoadingDidChange:function(){this.get("isLoading")?($("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").show()):$("#progressHudOverlay").hide()}.observes("isLoading"),actions:{toggleChecked:function(e){e.toggleProperty("isChecked")},addModifier:function(e){this.set("isLoading",!0);var t=this,a=this.get("checkedModifiers");a.forEach(function(e){t.store.createRecord("itemModifier",{merchant:t.get("vt4").model,modifier:e,item:t.get("item").model})}),this.get("item.model").batchSave("itemModifiers").then(function(){$("#addModifier").modal("hide"),t.set("isLoading",!1),_alert("You have successfully added your modifiers.","success")},App.FailureHandler("add the modifier set to the item",function(){t.set("isLoading",!1)}))}}})}),define("shift4tress/controllers/vt4/shelf/items/item",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),liableCheck:!1,isLoading:!1,taxProfileLocked:!1,uploadChanged:function(){$("#liableCheck-error").remove(),this.set("liableCheck",!1)}.observes("upload"),uploadExists:function(){return!!this.get("upload")}.property("upload"),isGiftCardDidChange:function(){this.get("model.isGiftCard")?(this.set("model.taxCode"," "),this.set("taxProfileLocked",!0)):this.set("taxProfileLocked",!1)}.observes("model.isGiftCard"),actions:{cancelUpdate:function(){App.set("Upload",null),$("#ImageUploadForm").validate().resetForm(),$("#imageUpload").val(""),$("#liableCheck-error").remove(),this.set("liableCheck",!1)},saveImage:function(){if($("#ImageUploadForm").valid()){var e=this;this.model.set("image",e.get("upload")),$("#change-item-image").modal("hide")}},save:function(){var e=this,t=e.get("model.merchant.items"),a=!1;t.forEach(function(t){e.get("model")!==t&&e.get("model.upc")&&e.get("model.upc")==t.get("upc")&&(_error("UPC already exists.","danger"),a=!0)}),a||$("#editItemForm").valid()&&(this.set("isLoading",!0),this.model.set("image",e.get("upload")),$("#change-item-image").modal("hide"),this.model.save().then(function(t){_alert("Item "+e.get("model.description")+" saved successfully.","success"),App.set("Upload",null),$("#imageUpload").val(""),$("#liableCheck-error").remove(),e.set("liableCheck",!1),e.set("isLoading",!1),e.transitionToRoute("vt4.shelf.items")},function(t){e.set("isLoading",!1),e.model.rollback(),App.FailureHandler(["save this item.",""])(t)}))},removeModifier:function(e){var t=e.get("name");e.deleteRecord(),$("#progressHudMessage").html("Removing..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert(t+" has been successfully removed from this item.","success")},function(a){$("#progressHudOverlay").hide(),e.rollbackAttributes(),App.FailureHandler(['remove "'+t+'" from this item.',""])(a)})},removeModifierSet:function(e){var t=e.get("modifierSet.name");e.deleteRecord(),$("#progressHudMessage").html("Removing..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert(t+" has been successfully removed from this item.","success")},function(a){$("#progressHudOverlay").hide(),e.rollbackAttributes(),App.FailureHandler(['remove "'+t+'" from this item',""])(a)})},removeCategoryItem:function(e){var t=e.get("category.name");e.deleteRecord(),$("#progressHudMessage").html("Removing..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The item has been removed from "+t+".","success")},function(a){$("#progressHudOverlay").hide(),e.rollbackAttributes(),App.FailureHandler(['remove "'+t+'" from this item.',""])(a)})},changeImage:function(){setTimeout(function(){$("#change-item-image").modal("show")})}}})}),define("shift4tress/controllers/vt4/shelf/items",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/vt4/shelf/modifiers/index",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/vt4/shelf/modifiers/modifier-list/edit-modifier",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({modifierList:t["default"].inject.controller("vt4.shelf.modifiers.modifierList"),isLoading:!1,actions:{cancelUpdateModifier:function(){this.model.rollbackAttributes(),$("#editModifierNameForm").validate().resetForm(),$("div.editModifierName").removeClass("has-error"),$("div.editModifierUnitPrice").removeClass("has-error")},updateModifier:function(){var e=this;if(this.get("model.hasDirtyAttributes")){var t=this.get("modifierList").model.get("modifiers"),a=!1;t.forEach(function(t){e.model!==t&&e.get("model.name")==t.get("name")&&(_alert("Modifier name already exists.","danger"),a=!0)}),a||$("#editModifierNameForm").valid()&&(this.set("isLoading",!0),this.model.save().then(function(){$("#edit-modifier").on("hidden.bs.modal",function(t){e.set("isLoading",!1)}),_alert("The modifier has been updated.","success"),$("#edit-modifier").modal("hide")},App.FailureHandler("save this modifier")))}else $("#edit-modifier").modal("hide")}}})}),define("shift4tress/controllers/vt4/shelf/modifiers/modifier-list",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),isLoading:!1,modifiers:t["default"].computed.sort("model.modifiers","modifierSortProperties"),modifierSets:t["default"].computed.sort("model.modifierSets","modifierSetSortProperties"),modifierSortProperties:["name:asc"],modifierSortAscending:!0,modifierSetSortProperties:["name:asc"],modifierSetSortAscending:!0,actions:{sortModifierSets:function(e){$(".sortBy.modifierSetTable").removeClass("ascending"),$(".sortBy.modifierSetTable").removeClass("descending"),this.toggleProperty("modifierSetSortAscending"),this.get("modifierSetSortAscending")?(this.set("modifierSetSortProperties",[e+":asc"]),$("#modifierSet-table #"+[e]).addClass("ascending")):(this.set("modifierSetSortProperties",[e+":desc"]),$("#modifierSet-table #"+[e]).addClass("descending"))},sortModifiers:function(e){$(".sortBy.modifierTable").removeClass("ascending"),$(".sortBy.modifierTable").removeClass("descending"),this.toggleProperty("modifierSortAscending"),this.get("modifierSortAscending")?(this.set("modifierSortProperties",[e+":asc"]),$("#modifier-table #"+[e]).addClass("ascending")):(this.set("modifierSortProperties",[e+":desc"]),$("#modifier-table #"+[e]).addClass("descending"))},newModifierSet:function(){$(".alert").alert("close"),this.set("newModifierSet",this.store.createRecord("modifierSet",{name:"",merchant:this.get("vt4.model")})),$("#newModifierSet").modal("show"),$("#modifierSetNameForm").validate().resetForm()},addModifierSet:function(){var e=this,t=this.model.modifierSets,a=!1;t.forEach(function(t){e.get("newModifierSet")!==t&&e.get("newModifierSet.name")==t.get("name")&&(_alert("Modifier Group name already exists","danger"),a=!0)}),a||$("#modifierSetNameForm").valid()&&(this.set("isLoading",!0),this.get("newModifierSet").set("image",App.Upload),this.get("newModifierSet").save().then(function(t){$("#newModifierSet").on("hidden.bs.modal",function(a){e.set("isLoading",!1),e.transitionToRoute("vt4.shelf.modifiers.modifierSet",t.id)}),_alert("The modifier group has been added.","success"),$("#modifierSetNameForm").validate().resetForm(),$("#newModifierSet").modal("hide")},App.FailureHandler("add a modifier group")))},cancelModifierSetAdd:function(){this.get("newModifierSet").deleteRecord(),$(".alert").alert("close"),$("#modifierSetNameForm").validate().resetForm(),$("div.modifierSetName").removeClass("has-error")},newModifier:function(){$(".alert").alert("close"),this.set("newModifier",this.store.createRecord("modifier",{name:"",merchant:this.get("vt4.model"),isSelected:!1})),$("#newModifier").modal("show"),$("#modifierNameForm").validate().resetForm()},addModifier:function(){var e=this,t=this.model.modifiers,a=!1;if(t.forEach(function(t){e.get("newModifier")!==t&&e.get("newModifier.name")==t.get("name")&&(_alert("Modifier name already exists","danger"),a=!0)}),!a&&$("#modifierNameForm").valid()){var e=this;this.set("isLoading",!0),this.get("newModifier").set("image",App.Upload),this.get("newModifier").save().then(function(t){e.set("isLoading",!1),_alert("The modifier has been added.","success"),$("#modifierNameForm").validate().resetForm(),$("#newModifier").modal("hide")},function(e){App.FailureHandler("add a modifier")(e)})}},cancelModifierAdd:function(){this.get("newModifier").deleteRecord(),$(".alert").alert("close"),$("#modifierNameForm").validate().resetForm(),$("div.modifierName").removeClass("has-error"),$("div.modifierPrice").removeClass("has-error")},deleteModifierSet:function(){var e=this.get("modifierSetToDelete");e.get("modifierSetModifiers").filter(function(e){e&&t["default"].run.once(this,function(){e.deleteRecord()})});var a=this.store.peekAll("itemModifierSet");a.filter(function(a){a.get("merchant.id")==e.get("merchant.id")&&a.get("modifierSet.id")==e.get("id")&&t["default"].run.once(this,function(){a.deleteRecord()})}),e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The modifier group has been deleted.","success")},function(t){e.rollbackAttributes(),App.FailureHandler(['delete "'+e.get("name")+'" from the list of modifier groups',""])(t)})},deleteModifierSetConfirm:function(e){this.set("modifierSetToDelete",e),$(".alert").alert("close"),$("#deleteModifierSet-modal").modal("toggle")},deleteModifier:function(){var e=this.get("modifierToDelete");e.get("modifierSetModifiers").filter(function(e){e&&t["default"].run.once(this,function(){e.deleteRecord()})});var a=this.store.peekAll("itemModifier");a.forEach(function(a){a.get("merchant.id")==e.get("merchant.id")&&a.get("modifier.id")==e.get("id")&&t["default"].run.once(this,function(){a.deleteRecord()})}),e.deleteRecord(),$("#progressHudMessage").html("Deleting..."),$("#progressHudOverlay").show(),e.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The modifier has been deleted.","success")},function(t){e.rollbackAttributes(),App.FailureHandler(['delete "'+e.get("name")+'" from the list of modifiers',""])(t)})},deleteModifierConfirm:function(e){this.set("modifierToDelete",e),$(".alert").alert("close"),$("#deleteModifier-modal").modal("toggle")}}})}),define("shift4tress/controllers/vt4/shelf/modifiers/modifier-set/add-modifiers",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),modifierSet:t["default"].inject.controller("vt4.shelf.modifiers.modifierSet"),sortedModifiers:t["default"].computed.sort("model","sortProperties"),merchant:function(){return this.get("vt4.model")}.property("vt4.model"),sortProperties:["name:asc"],sortAscending:!0,isLoading:!1,checkedItems:function(){return this.model.filterBy("isChecked",!0)}.property("model.@each.isChecked"),selectedItemsExist:function(){return this.get("checkedItems.length")>0}.property("checkedItems"),actions:{sortBy:function(e){$(".sortBy.addModifiers").removeClass("ascending"),$(".sortBy.addModifiers").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",[e+":asc"]),$("#add-modifiers #"+e).addClass("ascending")):(this.set("sortProperties",[e+":desc"]),$("#add-modifiers #"+e).addClass("descending"))},toggleChecked:function(e){e.toggleProperty("isChecked")},addModifiers:function(){var e=this,t=this.get("checkedItems");t.forEach(function(t){e.store.createRecord("modifierSetModifier",{merchant:e.get("merchant"),modifierSet:e.get("modifierSet.model"),modifier:t})}),this.set("isLoading",!0),this.get("modifierSet.model").batchSave("modifierSetModifiers").then(function(){$("#add-modifiers").on("hidden.bs.modal",function(t){e.set("isLoading",!1)}),e.set("sortProperties",["name:asc"]),e.set("sortAscending",!0),_alert("The modifier group has been updated.","success"),$("#add-modifiers").modal("hide")},App.FailureHandler("add modifiers to this modifier group"))},cancelAddModifiers:function(){this.set("sortProperties",["name:asc"]),this.set("sortAscending",!0)}}})}),define("shift4tress/controllers/vt4/shelf/modifiers/modifier-set",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Controller.extend({vt4:t["default"].inject.controller(),isEditing:!1,setModifiers:t["default"].computed.sort("model.modifierSetModifiers","sortProperties"),sortProperties:["modifier.name:asc"],sortAscending:!0,actions:{sortBy:function(e){$(".sortBy").removeClass("ascending"),$(".sortBy").removeClass("descending"),this.toggleProperty("sortAscending"),this.get("sortAscending")?(this.set("sortProperties",["modifier."+e+":asc"]), $("#"+[e]).addClass("ascending")):(this.set("sortProperties",["modifier."+e+":desc"]),$("#"+[e]).addClass("descending"))},toggleEdit:function(){this.model.get("hasDirtyAttributes")&&this.model.rollbackAttributes(),this.toggleProperty("isEditing")},save:function(){var e=this;if(this.model.get("hasDirtyAttributes"))if(""!==this.model.get("name")){var t=this.get("vt4.model"),a=!1,n=t.get("modifierSets");n.forEach(function(t){e.model!==t&&e.get("name")==t.get("name")&&(_alert("Modifier Group name already exists.","danger"),a=!0)}),a?e.model.rollbackAttributes():e.model.save().then(function(){_alert("The modifier group has been updated.","success")},App.FailureHandler("save this modifier group"))}else this.model.rollbackAttributes(),_alert("Modifier Group name cannot be empty.","danger");this.set("isEditing",!1)},removeModifier:function(e){var t=e;t.deleteRecord(),$("#progressHudMessage").html("Removing..."),$("#progressHudOverlay").show(),t.save().then(function(e){$("#progressHudOverlay").hide(),_alert("The modifier has been removed.","success")},function(e){$("#progressHudOverlay").hide(),item.rollbackAttributes(),App.FailureHandler(['remove "'+t.modifier.get("name")+'" from this modifier group',""])(e)})}}})}),define("shift4tress/controllers/vt4/shelf/modifiers",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/vt4/shelf/shelf",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/controllers/vt4",["exports","ember"],function(e,t){e["default"]=t["default"].Controller.extend({})}),define("shift4tress/helpers/application-group-name",["exports","ember"],function(e,t){e["default"]=t["default"].Helper.extend({theme:t["default"].inject.service(),compute:function(e){var t=e[0];switch(Number(t)){case 1:return this.get("theme.appName");default:return"string"==typeof App.get("applicationGroups").get("firstObject.id")&&(t=String(t)),App.applicationGroups.filterBy("id",t).get("firstObject.name")}}})}),define("shift4tress/helpers/card-type-icon",["exports","ember"],function(e,t){function a(e){var t="";switch(e){case"VS":t="";break;case"MC":t="";break;case"AX":t="";break;case"NS":t="";break;case"JC":t="";break;case"DB":t="";break;default:t=""}return t='
'+t+"
",new Handlebars.SafeString(t)}e.cardTypeIcon=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/card-type-name",["exports","ember"],function(e,t){function a(e){if("object"==typeof e)var e=e[0];switch(e){case"VS":cardTypeLong="Visa";break;case"MC":cardTypeLong="MasterCard";break;case"AX":cardTypeLong="American Express";break;case"NS":cardTypeLong="Discover";break;case"JC":cardTypeLong="JCB";break;case"DB":cardTypeLong="Debit";break;case"YC":cardTypeLong="It's Your Card";break;case"GC":cardTypeLong="Gift Card";break;case"PL":cardTypeLong="Private Label";break;case"SR":cardTypeLong="Sears";break;case"SC":cardTypeLong="Sears Canada";break;case"CS":cardTypeLong="Cash";break;default:cardTypeLong="Cash"}return cardTypeLong}e.cardTypeName=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/check-permissions-context",["exports","ember"],function(e,t){e["default"]=t["default"].Helper.extend({navigation:t["default"].inject.service(),router:t["default"].inject.service("-routing"),compute:function(e){var t=e[0],a=this.get("navigation").checkContext(t),n=this.get("navigation").checkPermissions(t),r=this.get("router.currentRouteName"),l=-1!=r.indexOf("profile");return!!(a&&n||l)},onNavChange:t["default"].observer("navigation.permissions.routeContext",function(){this.recompute()})})}),define("shift4tress/helpers/digital-clock",["exports","ember"],function(e,t){function a(e){var a=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),l=function(e){return 10>e?"0"+e:""+e},d=function(e,t,a){return e>0?String(e+":"+l(t)+":"+l(a)):String(t+":"+l(a))};return new t["default"].Handlebars.SafeString(d(a,n,r))}e.digitalClock=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/display-is-inclusive",["exports","ember"],function(e,t){function a(e){return"true"==e?"Inclusive":"Exclusive"}e.displayIsInclusive=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/ellipses-text",["exports","ember"],function(e,t){function a(e){return e.length>20&&(e=e.substring(0,17)+"..."),e}e.ellipsesText=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/exists-in",["exports","ember-models-table/helpers/exists-in"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t["default"]}}),Object.defineProperty(e,"existsIn",{enumerable:!0,get:function(){return t.existsIn}})}),define("shift4tress/helpers/format-date",["exports","ember"],function(e,t){function a(e){var e=e[0];return e?formatDateFunction(e):void 0}e.formatDate=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/get-guid",["exports","ember"],function(e,t){function a(e){return t["default"].guidFor(e)}e.getGuid=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/group-contains-org",["exports","ember"],function(e,t){function a(e){var t=e[0],a=e[1];return a.get("businessEntities").findBy("id",t.get("id"))}e.groupContainsOrg=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/has-permission",["exports","ember"],function(e,t){function a(e){var t=e[0],a=e[1],n=e[2];return App.currentSession.get("user").hasPermission(t,a,n)}e.hasPermission=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/icon-for-org-type",["exports","ember"],function(e,t){function a(e){var a="",n=e[0];return a="?",n&&(n.get("isMerchant")&&(a=''),n.get("isOrganization")&&(a=''),n.get("isResellerOrganization")&&(a='')),new t["default"].Handlebars.SafeString(a)}e.iconForOrgType=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/if-or",["exports","ember"],function(e,t){function a(e){return"undefined"==typeof e||0==e.length?!1:1==e.length?e[0]:2==e.length?e[0]||e[1]:3==e.length?e[0]||e[1]||e[2]:4==e.length?e[0]||e[1]||e[2]||e[3]:5==e.length?e[0]||e[1]||e[2]||e[3]||e[4]:void 0}e.ifOr=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/invoke-function",["exports","ember"],function(e,t){function a(e,t){var a=arguments[0].slice(2),n=arguments[0][0],r=arguments[0][1],l=r.apply(n,a);return l}e.invokeFunction=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/is-equal",["exports","ember"],function(e,t){function a(e){return"undefined"!=typeof e[0]&&null!=e[0]||(e[0]=""),e[0].toString()==e[1].toString()}e.isEqual=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/is-negative",["exports","ember"],function(e,t){function a(e){return 0>e}e.isNegative=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/leaf-padding",["exports","ember"],function(e,t){function a(e){var a=e[0];return t["default"].String.htmlSafe("padding-left:"+30*a.get("nthChildLevel")+"px")}e.leafPadding=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/lifespan-type-name",["exports","ember"],function(e,t){function a(e){var t;if(e)switch(e[0]){case 10:t="EndDateTime";break;case 20:t="Window";break;case 30:t="SingleUse";break;default:t="Unknown"}return t}e.lifespanTypeName=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/money",["exports","ember"],function(e,t){function a(e,a){var n=parseFloat(Math.abs(e)).toFixed(2);return n=n.replace(/\B(?=(\d{3})+(?!\d))/g,","),"NaN"==n?new Handlebars.SafeString("0.00"):(a.hash?a.hash.isNegative&&(n='('+n+")"):n=n,new t["default"].Handlebars.SafeString(n))}e.money=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/pluralize",["exports","ember-inflector/lib/helpers/pluralize"],function(e,t){e["default"]=t["default"]}),define("shift4tress/helpers/read-only-permission",["exports","ember"],function(e,t){function a(e){var t=e[0],a=e[1],n=e[2];return App.currentSession.get("user").hasPermission(t,a,n)?void 0:"readonly"}e.readOnlyPermission=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/role-type",["exports","ember"],function(e,t){function a(e){if(1==e)var a="Global";else var a="Custom";return new t["default"].Handlebars.SafeString(a)}e.roleType=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/singularize",["exports","ember-inflector/lib/helpers/singularize"],function(e,t){e["default"]=t["default"]}),define("shift4tress/helpers/tender-type-name",["exports","ember"],function(e,t){function a(e){if("object"==typeof e)var e=e[0];switch(e){case 0:return"Unknown";case 1:return"Card";case 2:return"Cash";case 3:return"Check";case 4:return"Member Accounts";case 5:return"UTG-Controlled PIN Pad";case 6:return"Room Charge";case 7:return"Member Charge"}}e.tenderTypeName=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/helpers/value-for-property",["exports","ember"],function(e,t){function a(e,t){var a="";return e.forEach(function(e){e.key==t&&(a=String(e.value))}),new Handlebars.SafeString(a)}e.valueForProperty=a,e["default"]=t["default"].Helper.helper(a)}),define("shift4tress/initializers/4tress-initializer",["exports","ember","shift4tress/utils/utils","ember-data"],function(e,t,a,n){function r(e){e.FailureHandler=function(e,t){var a="complete this request",n="Please try again in a few minutes. If the error persists, contact your administrator.";return function(r){switch(console.log(r),(r.status||r.errors)&&(403==r.status?n="If you believe you received this message in error, contact your administrator.":r.errors&&403==r.errors.objectAt(0).detail.code&&(n="If you believe you received this message in error, contact your administrator.")),typeof e){case"string":a=e;break;case"object":a=e[0],n=e[1]}return $("#progressHudOverlay").hide(),401==r.status?void(t&&t(r)):(r.status||r.errors?403==r.status?_error("You do not have permission to "+a+". "+n):r.errors&&403==r.errors.objectAt(0).detail.code?_error("There was a problem trying to "+a+". "+n):_error("There was a problem trying to "+a+". "+n):_error("There was a problem trying to "+a+". "+n),void(t&&t(r)))}},e.inject("route","apiPath","service:api-path"),e.inject("controller","apiPath","service:api-path"),e.inject("component","apiPath","service:api-path"),e.inject("adapter","apiPath","service:api-path"),e.inject("model","apiPath","service:api-path"),e.inject("controller","applicationInfo","service:applicationInfo"),e.inject("controller:application","clock","service:clock"),e.inject("controller","navigation","service:navigation"),e.inject("route","navigation","service:navigation"),t["default"].TextSupport.reopen({attributeBindings:["spellcheck","autocapitalize","autocomplete","autocorrect","equalTo","equalToIgnoreCase","unique"],mybinding:null}),t["default"].Component.reopen({init:function(){this._super();var e=this;Object.keys(this).forEach(function(t){"data-"===t.substr(0,5)&&e.get("attributeBindings").pushObject(t)})},didInsertElement:function(){$("[data-toggle=popover]").popover({html:!0,content:function(){return $("#popover-content").html()},template:'

'}),$('[data-toggle="tooltip"]').tooltip(),$("input.disablecopypaste").bind("copy paste",function(e){e.preventDefault()}),$("form.newvalidation").validate({focusInvalid:!1,onkeyup:function(e,t){9===t.which&&""===this.elementValue(e)||(e.name in this.submitted||e==this.lastElement)&&this.element(e)}}),$("form").each(function(){$("#"+this.id).validate({focusInvalid:!1,onkeyup:function(e,t){9===t.which&&""===this.elementValue(e)||(e.name in this.submitted||e==this.lastElement)&&this.element(e)}})})}}),t["default"].TextField.reopen({didInsertElement:function(){this["class"]&&this["class"].indexOf("duplicateidtoname")&&this.set("name",this.get("elementId")),$('[data-toggle="tooltip"]').tooltip()},attributeBindings:["minlength"]}),t["default"].Controller.reopen({routeError:function(){}.property("model"),theme:t["default"].inject.service(),currentSession:function(){return App.get("currentSession")}.property("App.currentSession"),config:t["default"].computed.alias("application.config"),alerts:t["default"].computed.alias("application.alerts")}),n["default"].Model.reopen({batchSave:function(e,t){var a=this.constructor.modelName,n=Em.get(this.constructor,"relationshipsByName").get(e),r=Em.String.singularize(Em.String.camelize(n.type)),l=Em.String.pluralize(Em.String.camelize(n.type)),d=(this.store.serializerFor(a),this.store.adapterFor(this.constructor.modelName)),i=d.ajax,o=d.buildURL(a,this.get("id")),s=(Em.get(this,"host"),"number"==typeof t||"string"==typeof t?t:void 0),c="undefined"!=typeof s,p="object"==typeof t?hashToQueryString(t):"";switch(this.constructor.modelName){case"organization":switch(r){case"group":case"role":case"user":o=o+"/"+l+(c?"/"+s:"")}break;case"group":switch(r){case"groupRole":o+="/roles";break;case"groupBusinessEntity":o+="/businessEntities";break;case"groupUser":o+="/users"}break;case"role":switch(r){case"rolePermission":var u="PUT";o+="/permissions"}break;case"item":switch(r){case"shelfCategoryItem":u="POST",o=d.buildURL("vtMerchants",this.get("merchant.id")),o=o+"/"+l;break;case"itemModifier":u="POST",o=d.buildURL("vtMerchants",this.get("merchant.id")),o=o+"/"+l;break;case"itemModifierSet":u="POST",o=d.buildURL("vtMerchants",this.get("merchant.id")),o=o+"/"+l}break;case"shelf-category":switch(r){case"shelfCategoryItem":u="POST",o=d.buildURL("vtMerchants",this.get("merchant.id")),o=o.replace("shelfCategories","merchants"),o=o+"/"+l}break;case"modifier-set":switch(r){case"modifierSetModifier":u="POST",o=d.buildURL("vtMerchants",this.get("merchant.id")),o=o.replace("modifierSets","merchants"),o=o+"/"+l}}o+=p;var m=this,h=[];return m.get(e).forEach(function(e){e.send("willCommit"),h.push(e.serialize())}),i.call(d,o,u,{data:h}).then(function(t){if("POST"==u){var a={};a[l]=t[e];var n=m.store.serializerFor(r).normalizeArrayResponse(m.store,m.store.modelFor(r),a);switch(e){case"modifierSetModifiers":m.get(e).forEach(function(e){n.data.forEach(function(t){e.get("modifier.id")==t.relationships.modifier.data.id&&e.get("modifierSet.id")==t.relationships.modifierSet.data.id&&(e.set("id",t.id),e.send("didCommit"),e.send("pushedData"))})});break;case"shelfCategoryItems":m.get(e).forEach(function(e){n.data.forEach(function(t){e.get("category.id")==t.relationships.category.data.id&&e.get("item.id")==t.relationships.item.data.id&&(e.set("id",t.id),e.send("didCommit"),e.send("pushedData"))})});break;case"itemModifiers":m.get(e).forEach(function(e){n.data.forEach(function(t){e.get("modifier.id")==t.relationships.modifier.data.id&&e.get("item.id")==t.relationships.item.data.id&&(e.set("id",t.id),e.send("didCommit"),e.send("pushedData"))})});break;case"itemModifierSets":m.get(e).forEach(function(e){n.data.forEach(function(t){e.get("modifierSet.id")==t.relationships.modifierSet.data.id&&e.get("item.id")==t.relationships.item.data.id&&(e.set("id",t.id),e.send("didCommit"),e.send("pushedData"))})})}}})}}),t["default"].Route.reopen({theme:t["default"].inject.service(),routeError:!1,showChildDataChecked:function(){return App.get("currentSession.user.parentBusinessEntity.showChildDataChecked")}.property("currentSession.user.parentBusinessEntity.showChildDataChecked"),isProvisionedRoute:function(){return!!(this.get("provisioningProduct")&&this.get("provisioningActivity")||this.get("navigation.permissions.provisioningProduct")&&this.get("navigation.permissions.provisioningActivity"))}.property("provisioningProduct","provisioningActivity","navigation.permissions.provisioningProduct","navigation.permissions.provisioningActivity"),beforeModel:function(e){var t=this.get("routeContext"),a=this.get("permKey"),n=this.get("permAction"),r=this.get("provisioningProduct"),l=this.get("provisioningActivity");if(t&&a&&n){var d=App.currentSession.get("user"),i=d.get("selectedBusinessEntity");if(i){var o=(i.get("isMerchant"),i.get("isOrganization"),this.get("navigation"));o.set("permissions.permKey",a),o.set("permissions.permAction",n),o.set("permissions.routeContext",t),l&&r?(o.set("permissions.provisioningProduct",r),o.set("permissions.provisioningActivity",l)):(o.set("permissions.provisioningProduct",null),o.set("permissions.provisioningActivity",null));var s=e.targetName,c=e.targetName.replace(".index","").replace(".error","");!o.checkContext(i)||!o.checkPermissions(i)||this.get("isProvisionedRoute")&&!o.checkProvisioning(i)?(this.set("routeError",!0),$("#progressHudOverlay").hide(),this.transitionTo(c+".error")):this.set("routeError",!1)}else this.set("routeError",!0),$("#progressHudOverlay").hide(),this.transitionTo(c+".error")}else if(this.get("router.currentRouteName")&&this.get("navigation")){var p=this.get("router.currentRouteName").replace(".index","").replace(".error",""),s=e.targetName.replace(".index","").replace(".error");p==s&&-1!=this.get("router.currentRouteName").indexOf(".error")&&(-1!=this.get("router.currentPath").indexOf("vt4")?this.get("navigation.selectedBE.isOrganization")&&e.abort():-1!=this.get("router.currentPath").indexOf("management")?(this.get("navigation.selectedBE.isMerchant")&&e.abort(),this.get("isProvisionedRoute")&&(this.get("navigation").checkProvisioning(this.get("navigation.selectedBE"))||e.abort())):-1!=this.get("router.currentPath").indexOf("reports")&&(App.currentSession.get("user").hasPermission("canPeriod","vt4Reports",this.get("navigation.selectedBE"))||e.abort()))}},actions:{handleBusinessEntityChange:function(){return this.refresh(),!0}}}),e.BillingPaymentMethodTypeKeys={creditCard:1,achUs:2,achCa:3},window.App=e}e.initialize=r,e["default"]={name:"4tress-initializer",initialize:r}}),define("shift4tress/initializers/app-version",["exports","ember-cli-app-version/initializer-factory","shift4tress/config/environment"],function(e,t,a){e["default"]={name:"App Version",initialize:(0,t["default"])(a["default"].APP.name,a["default"].APP.version)}}),define("shift4tress/initializers/container-debug-adapter",["exports","ember-resolver/container-debug-adapter"],function(e,t){e["default"]={name:"container-debug-adapter",initialize:function(){var e=arguments[1]||arguments[0];e.register("container-debug-adapter:main",t["default"]),e.inject("container-debug-adapter:main","namespace","application:main")}}}),define("shift4tress/initializers/data-adapter",["exports","ember"],function(e,t){e["default"]={name:"data-adapter",before:"store",initialize:t["default"].K}}),define("shift4tress/initializers/ember-data",["exports","ember-data/setup-container","ember-data/-private/core"],function(e,t,a){e["default"]={name:"ember-data",initialize:t["default"]}}),define("shift4tress/initializers/export-application-global",["exports","ember","shift4tress/config/environment"],function(e,t,a){function n(){var e=arguments[1]||arguments[0];if(a["default"].exportApplicationGlobal!==!1){var n,r=a["default"].exportApplicationGlobal;n="string"==typeof r?r:t["default"].String.classify(a["default"].modulePrefix),window[n]||(window[n]=e,e.reopen({willDestroy:function(){this._super.apply(this,arguments),delete window[n]}}))}}e.initialize=n,e["default"]={name:"export-application-global",initialize:n}}),define("shift4tress/initializers/injectStore",["exports","ember"],function(e,t){e["default"]={name:"injectStore",before:"store",initialize:t["default"].K}}),define("shift4tress/initializers/store",["exports","ember"],function(e,t){e["default"]={name:"store",after:"ember-data",initialize:t["default"].K}}),define("shift4tress/initializers/transforms",["exports","ember"],function(e,t){e["default"]={name:"transforms",before:"store",initialize:t["default"].K}}),define("shift4tress/instance-initializers/ember-data",["exports","ember-data/-private/instance-initializers/initialize-store-service"],function(e,t){e["default"]={name:"ember-data",initialize:t["default"]}}),define("shift4tress/mixins/error-substate",["exports","ember"],function(e,t){e["default"]=t["default"].Mixin.create({actions:{handleBusinessEntityChange:function(){return this.transitionTo(this.get("routeName").replace(".error","")),!0}}})}),define("shift4tress/mixins/high-charts-theme",["exports","ember"],function(e,t){e["default"]=t["default"].Mixin.create({buildTheme:function(){return Highcharts.wrap(Highcharts.Chart.prototype,"getContainer",function(e){e.call(this),this.container.style.background="url(http://www.highcharts.com/samples/graphics/sand.png)"}),Highcharts.theme={credits:{enabled:!1},colors:["#003f53","#4c99b3","#8cc3da","#8071b4","#8490c8","#bbb8dc","#0067ac","#53b7e8","#4ac7e9","#00b1cd","#74cee2","#ade0ee","#08b89d","#8ccfb7","#a5d9c9"],chart:{backgroundColor:null,style:{fontFamily:"'Century Gothic', 'Helvetica Neue', Helvetica, Arial, sans-serif"}},title:{style:{color:"black",fontSize:"16px",fontWeight:"bold"}},subtitle:{style:{color:"black",fontSize:"13px"}},tooltip:{borderWidth:0},legend:{itemStyle:{fontWeight:"bold",fontSize:"13px"}},xAxis:{labels:{style:{color:"#6e6e70"}}},yAxis:{labels:{style:{color:"#6e6e70"}}},plotOptions:{series:{shadow:!0,maxPointWidth:150},candlestick:{lineColor:"#404048"},map:{shadow:!1}},navigator:{xAxis:{gridLineColor:"#D0D0D8"}},rangeSelector:{buttonTheme:{fill:"white",stroke:"#C0C0C8","stroke-width":1,states:{select:{fill:"#D0D0D8"}}}},scrollbar:{trackBorderColor:"#C0C0C8"},background2:"#E0E0E8"},Highcharts.setOptions(Highcharts.theme)}})}),define("shift4tress/mixins/payment-method",["exports","ember"],function(e,t){e["default"]=t["default"].Mixin.create({achUs_accountType:"",achCanada_accountType:"",achCanada_accountCurrency:"",ach_accountTypes:["Checking","Savings"],ach_accountCurrencies:["USD","CAD"],creditCard_cardTypes:[{name:"Visa",value:"VS"},{name:"Mastercard",value:"MC"},{name:"American Express",value:"AX"},{name:"Discover",value:"NS"}],creditCard_expirationMonths:[1,2,3,4,5,6,7,8,9,10,11,12],creditCard_expirationYears:function(){for(var e=10,t=[],a=(new Date).getFullYear(),n=0;e>=n;n++)t.push(a+n);return t}.property()})}),define("shift4tress/mixins/reset-scroll",["exports","ember"],function(e,t){e["default"]=t["default"].Mixin.create({activate:function(){this._super(),window.scrollTo(0,0)}})}),define("shift4tress/mixins/sorting",["exports","ember"],function(e,t){e["default"]=t["default"].Mixin.create({actions:{sortBy:function(e){var t=e.replace(".","");$("#"+this.get("sortingNamespace")+" .sortBy").removeClass("ascending"),$("#"+this.get("sortingNamespace")+" .sortBy").removeClass("descending"),this.set("sortProperties",[e]+":asc"),this.set("sortAscending",!this.get("sortAscending")),1==this.get("sortAscending")?$("#"+this.get("sortingNamespace")+" ."+t).addClass("descending"):$("#"+this.get("sortingNamespace")+" ."+t).addClass("ascending")}}})}),define("shift4tress/models/accessory",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant",{inverse:"accessories"}),accessoryType:t["default"].attr("number"),description:t["default"].attr("string"),settings:t["default"].attr("string"),ipAddress:t["default"].attr("string"),port:t["default"].attr("string"),tempDescription:t["default"].attr("string"),printerType:t["default"].attr("string",{defaultValue:""}),displayIP:function(){if(1===this.get("accessoryType")||2===this.get("accessoryType")){var e=this.get("settings");if(e){var t=e.split(";"),a=t[0].split(":")[1];return a}}}.property("settings"),displayPort:function(){if(1===this.get("accessoryType")||2===this.get("accessoryType")){var e=this.get("settings");if(e){var t=e.split(";"),a=t[1].split(":")[1];return a}}}.property("settings"),displayIPPort:function(){if(1===this.get("accessoryType")||2===this.get("accessoryType")){var e=this.get("settings");if(e){var t=e.split(";"),a=t[0].split(":")[1],n=t[1].split(":")[1];return a+":"+n}}}.property("settings"),accessoryTypeName:function(){var e=this.get("accessoryType");switch(e){case 1:return"UTG";case 2:return"Printer"}}.property("accessoryType"),accessoryTypeDisplayName:function(){var e=this.get("accessoryType");switch(e){case 1:return"UTG";case 2:return"Epson"===this.get("printerType")?"Printer: Epson":"Printer: Star"}}.property("accessoryType","printerType")})}),define("shift4tress/models/app-record",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntity:t["default"].belongsTo("businessEntity",{async:!1}),appName:t["default"].attr("string"),domain:t["default"].attr("string"),applicationGroupId:t["default"].attr("string"),lastUpdatedAt:t["default"].attr("string"),lastUpdatedBy:t["default"].attr("string"),owningBusinessEntity:t["default"].belongsTo("businessEntity",{async:!1}),subDomain:t["default"].attr("string")})}),define("shift4tress/models/application-group-permission",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({userPermission:t["default"].belongsTo("userPermission",{inverse:"applicationGroupPermissions"}),applicationGroupId:t["default"].attr("number"),businessEntityId:t["default"].attr("number"),userId:t["default"].attr("number"),businessEntityPermissions:t["default"].hasMany("businessEntityPermission",{inverse:"applicationGroupPermission"})})}),define("shift4tress/models/application-group",["exports","ember-data"],function(e,t){window.APPLICATION_GROUP_4TRESS=1,window.APPLICATION_GROUP_VT4=2,window.APPLICATION_GROUP_IN4M=3,e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),isActive:t["default"].attr("boolean"),permissions:t["default"].hasMany("permission")})}),define("shift4tress/models/bill-to-account-business-entity-assignment",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),businessEntity:t["default"].belongsTo("businessEntity",{async:!0}),billableProduct:t["default"].belongsTo("billableProduct",{async:!0,inverse:null}),isBillableProductLoaded:a["default"].computed.alias("billableProduct.isLoaded"),businessEntityName:a["default"].computed.alias("businessEntity.name"),productName:a["default"].computed.alias("billableProduct.name")})}),define("shift4tress/models/bill-to-account-contact-assignment",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),contact:t["default"].belongsTo("contact",{async:!0,inverse:null}),isContactLoaded:Em.computed.alias("contact.isLoaded"),contactFirstName:Em.computed.alias("contact.firstName"),contactLastName:Em.computed.alias("contact.lastName"),contactTitle:Em.computed.alias("contact.title"),contactPhone:Em.computed.alias("contact.phone"),contactEmail:Em.computed.alias("contact.email")})}),define("shift4tress/models/bill-to-account",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),billToAccountBusinessEntityAssignments:t["default"].hasMany("billToAccountBusinessEntityAssignment",{async:!0}),billToAccountContactAssignments:t["default"].hasMany("billToAccountContactAssignment",{async:!0}),company:t["default"].belongsTo("company",{async:!0}),paymentMethod:t["default"].belongsTo("paymentMethod",{async:!1}),productNames:function(){var e=[];return this.get("billToAccountBusinessEntityAssignments").forEach(function(t){t.get("isBillableProductLoaded")&&e.addObject(t.get("billableProduct.name"))}),e.uniq().join(", ")}.property("billToAccountBusinessEntityAssignments.@each.isBillableProductLoaded"),contactNames:function(){var e=[];return this.get("billToAccountContactAssignments").forEach(function(t){t.get("isContactLoaded")&&e.addObject(t.get("contact.fullName"))}),e.uniq().join(", ")}.property("billToAccountContactAssignments.@each.isContactLoaded")})}),define("shift4tress/models/billable-activity-rate",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({rate:t["default"].attr("string"),rateProfile:t["default"].belongsTo("rateProfile",{async:!0}),productBillableActivity:t["default"].belongsTo("productBillableActivity",{async:!0}),isAllowUseEnabled:t["default"].attr("boolean",{defaultValue:!0}),isAllowUseDisabled:function(){return!this.get("isAllowUseEnabled")}.property("isAllowUseEnabled"),applyAtActivityInsertion:t["default"].attr("boolean"),calculatePerMerchant:t["default"].attr("boolean"),calculatePerOrganization:t["default"].attr("boolean"),includeCardTenders:t["default"].attr("boolean"),includeCashTenders:t["default"].attr("boolean"),includeCheckTenders:t["default"].attr("boolean"),includeMemberTenders:t["default"].attr("boolean")})}),define("shift4tress/models/billable-activity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),description:t["default"].attr("string"),type:t["default"].attr("string"),template:t["default"].attr("string"),key:t["default"].attr("string"),productBillableActivities:t["default"].hasMany("productBillableActivity",{embedded:"always",async:!0})})}),define("shift4tress/models/billable-product",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),key:t["default"].attr("string"),productBillableActivities:t["default"].hasMany("productBillableActivity",{async:!1})})}),define("shift4tress/models/billing/bill-to-account-business-entity-assignment",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),businessEntity:t["default"].belongsTo("businessEntity",{async:!0}),billableProduct:t["default"].belongsTo("billableProduct",{async:!0,inverse:null}),isBillableProductLoaded:a["default"].computed.alias("billableProduct.isLoaded"),businessEntityName:a["default"].computed.alias("businessEntity.name"),productName:a["default"].computed.alias("billableProduct.name")})}),define("shift4tress/models/billing/bill-to-account-contact-assignment",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),contact:t["default"].belongsTo("contact",{async:!0,inverse:null}),isContactLoaded:Em.computed.alias("contact.isLoaded"),contactFirstName:Em.computed.alias("contact.firstName"),contactLastName:Em.computed.alias("contact.lastName"),contactTitle:Em.computed.alias("contact.title"),contactPhone:Em.computed.alias("contact.phone"),contactEmail:Em.computed.alias("contact.email")})}),define("shift4tress/models/billing/bill-to-account",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),billToAccountBusinessEntityAssignments:t["default"].hasMany("billToAccountBusinessEntityAssignment",{async:!0}),billToAccountContactAssignments:t["default"].hasMany("billToAccountContactAssignment",{async:!0}),company:t["default"].belongsTo("company",{async:!0}),paymentMethod:t["default"].belongsTo("paymentMethod",{async:!1}),productNames:function(){var e=[];return this.get("billToAccountBusinessEntityAssignments").forEach(function(t){t.get("isBillableProductLoaded")&&e.addObject(t.get("billableProduct.name"))}),e.uniq().join(", ")}.property("billToAccountBusinessEntityAssignments.@each.isBillableProductLoaded"),contactNames:function(){var e=[];return this.get("billToAccountContactAssignments").forEach(function(t){ t.get("isContactLoaded")&&e.addObject(t.get("contact.fullName"))}),e.uniq().join(", ")}.property("billToAccountContactAssignments.@each.isContactLoaded")})}),define("shift4tress/models/billing/billable-activity-rate",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({rate:t["default"].attr("string"),rateProfile:t["default"].belongsTo("rateProfile",{async:!0}),productBillableActivity:t["default"].belongsTo("productBillableActivity",{async:!0}),isAllowUseEnabled:t["default"].attr("boolean",{defaultValue:!0}),isAllowUseDisabled:function(){return!this.get("isAllowUseEnabled")}.property("isAllowUseEnabled"),applyAtActivityInsertion:t["default"].attr("boolean"),calculatePerMerchant:t["default"].attr("boolean"),calculatePerOrganization:t["default"].attr("boolean"),includeCardTenders:t["default"].attr("boolean"),includeCashTenders:t["default"].attr("boolean"),includeCheckTenders:t["default"].attr("boolean"),includeMemberTenders:t["default"].attr("boolean")})}),define("shift4tress/models/billing/billable-activity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),description:t["default"].attr("string"),type:t["default"].attr("string"),template:t["default"].attr("string"),key:t["default"].attr("string"),productBillableActivities:t["default"].hasMany("productBillableActivity",{embedded:"always",async:!0})})}),define("shift4tress/models/billing/billable-product",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),key:t["default"].attr("string"),productBillableActivities:t["default"].hasMany("productBillableActivity",{async:!0})})}),define("shift4tress/models/billing/billing-config",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({value:t["default"].attr("string")})}),define("shift4tress/models/billing/billing-cycle",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({cycleStartDateTime:t["default"].attr("date"),cycleEndDateTime:t["default"].attr("date"),invoiceGenerationDateTime:t["default"].attr("date"),invoiceNotificationDateTime:t["default"].attr("date"),paymentChargeDateTime:t["default"].attr("date"),controllerState:t["default"].attr("string"),isPaused:t["default"].attr("boolean"),isRerun:t["default"].attr("boolean"),rerunType:t["default"].attr("string"),errorCount:t["default"].attr("number"),cycleStartDateFormatted:function(){return formatDateAsShort(this.get("cycleStartDateTime"))}.property("cycleStartDateTime"),cycleEndDateFormatted:function(){return formatDateAsShort(this.get("cycleEndDateTime"))}.property("cycleEndDateTime"),invoiceGenerationDateFormatted:function(){return formatDateAsShort(this.get("invoiceGenerationDateTime"))}.property("invoiceGenerationDateTime"),invoiceNotificationDateFormatted:function(){return formatDateAsShort(this.get("invoiceNotificationDateTime"))}.property("invoiceNotificationDateTime"),paymentChargeDateFormatted:function(){return formatDateAsShort(this.get("paymentChargeDateTime"))}.property("paymentChargeDateTime")})}),define("shift4tress/models/billing/company",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),address1:t["default"].attr("string"),address2:t["default"].attr("string"),city:t["default"].attr("string"),stateOrProvince:t["default"].attr("string"),postalCode:t["default"].attr("string"),country:t["default"].attr("string"),phone:t["default"].attr("string"),customerNumber:t["default"].attr("string"),fax:t["default"].attr("string"),website:t["default"].attr("string"),sic1:t["default"].attr("string"),sic2:t["default"].attr("string"),sic3:t["default"].attr("string"),businessEntity:t["default"].belongsTo("businessEntity"),paymentMethods:t["default"].hasMany("paymentMethod"),contacts:t["default"].hasMany("contact"),billToAccounts:t["default"].hasMany("billToAccount")})}),define("shift4tress/models/billing/contact",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({firstName:t["default"].attr("string"),lastName:t["default"].attr("string"),fullName:function(){return this.get("firstName")+" "+this.get("lastName")}.property("firstName","lastName"),title:t["default"].attr("string"),phone:t["default"].attr("string"),fax:t["default"].attr("string"),email:t["default"].attr("string"),address1:t["default"].attr("string"),address2:t["default"].attr("string"),city:t["default"].attr("string"),stateOrProvince:t["default"].attr("string"),postalCode:t["default"].attr("string"),country:t["default"].attr("string"),isReadOnly:t["default"].attr("boolean"),company:t["default"].belongsTo("company",{async:!0}),isEditDisabled:function(){return!(App.currentSession.get("user").hasPermission("canEdit","billingContacts",this.get("company.businessEntity"))&&(!this.get("isReadOnly")||App.currentSession.get("user").hasPermission("canPeriod","shift4User",this.get("company.businessEntity"))))}.property("isReadOnly","company.businessEntity")})}),define("shift4tress/models/billing/controller-failure",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({invoiceId:t["default"].attr("number"),billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),company:Em.computed.alias("billToAccount.company"),businessEntityId:t["default"].attr("number"),billingCycle:t["default"].belongsTo("billingCycle",{async:!0}),historyId:t["default"].attr("number"),message:t["default"].attr("string"),details:t["default"].attr("string"),submittedDate:t["default"].attr("date")})}),define("shift4tress/models/billing/invoice-download-token",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({invoiceId:t["default"].attr("string")})}),define("shift4tress/models/billing/invoice",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({total:t["default"].attr("number"),generationDate:t["default"].attr("date"),notificationDate:t["default"].attr("date"),dueDate:t["default"].attr("date"),period:t["default"].attr("date"),status:t["default"].attr("string"),billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),dueDateDate:function(){return new Date(this.get("dueDate"))}.property("dueDate"),formattedDueDate:function(){var e=this.get("dueDateDate");return e.getMonth()+1+"/"+e.getDate()+"/"+e.getFullYear()}.property("dueDateDate"),periodDate:function(){return new Date(this.get("period"))}.property("period"),formattedPeriod:function(){var e=this.get("periodDate"),t=e.getMonth(),a=e.getFullYear();return(9>t?"0":"")+(t+Number(1))+"/"+a}.property("periodDate")})}),define("shift4tress/models/billing/payment-method-type",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string")})}),define("shift4tress/models/billing/payment-method",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),paymentToken:t["default"].attr("string"),paymentMethodType:t["default"].belongsTo("paymentMethodType",{inverse:null,async:!1}),company:t["default"].belongsTo("company"),metadata:t["default"].attr("string"),isPaymentMethodTypeCreditCard:function(){return this.get("paymentMethodType.id")==App.BillingPaymentMethodTypeKeys.creditCard}.property("paymentMethodType"),isPaymentMethodTypeAchUs:function(){return this.get("paymentMethodType.id")==App.BillingPaymentMethodTypeKeys.achUs}.property("paymentMethodType"),isPaymentMethodTypeAchCanada:function(){return this.get("paymentMethodType.id")==App.BillingPaymentMethodTypeKeys.achCa}.property("paymentMethodType")})}),define("shift4tress/models/billing/paymentmethod",["exports","ember-data","shift4tress/app"],function(e,t,a){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),paymentToken:t["default"].attr("string"),paymentMethodType:t["default"].belongsTo("paymentMethodType",{inverse:null,async:!1}),company:t["default"].belongsTo("company"),metadata:t["default"].attr("string"),isPaymentMethodTypeCreditCard:function(){return this.get("paymentMethodType.id")==a["default"].BillingPaymentMethodTypeKeys.creditCard}.property("paymentMethodType"),isPaymentMethodTypeAchUs:function(){return this.get("paymentMethodType.id")==a["default"].BillingPaymentMethodTypeKeys.achUs}.property("paymentMethodType"),isPaymentMethodTypeAchCanada:function(){return this.get("paymentMethodType.id")==a["default"].BillingPaymentMethodTypeKeys.achCa}.property("paymentMethodType")})}),define("shift4tress/models/billing/product-billable-activity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({billableProduct:t["default"].belongsTo("billableProduct"),billableActivity:t["default"].belongsTo("billableActivity",{async:!0})})}),define("shift4tress/models/billing/rate-profile-business-entity-assignment",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({rateProfile:t["default"].belongsTo("rateProfile",{async:!0}),businessEntity:t["default"].belongsTo("businessEntity",{async:!0})})}),define("shift4tress/models/billing/rate-profile",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),description:t["default"].attr("string"),billableProduct:t["default"].belongsTo("billableProduct",{async:!0}),billableActivityRates:t["default"].hasMany("billableActivityRate",{embedded:"always",async:!0}),rateProfileBusinessEntityAssignments:t["default"].hasMany("rateProfileBusinessEntityAssignment",{async:!0})})}),define("shift4tress/models/billing-config",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({value:t["default"].attr("string")})}),define("shift4tress/models/billing-cycle",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({cycleStartDateTime:t["default"].attr("date"),cycleEndDateTime:t["default"].attr("date"),invoiceGenerationDateTime:t["default"].attr("date"),invoiceNotificationDateTime:t["default"].attr("date"),paymentChargeDateTime:t["default"].attr("date"),controllerState:t["default"].attr("string"),isPaused:t["default"].attr("boolean"),isRerun:t["default"].attr("boolean"),rerunType:t["default"].attr("string"),errorCount:t["default"].attr("number"),cycleStartDateFormatted:function(){return formatDateAsShort(this.get("cycleStartDateTime"))}.property("cycleStartDateTime"),cycleEndDateFormatted:function(){return formatDateAsShort(this.get("cycleEndDateTime"))}.property("cycleEndDateTime"),invoiceGenerationDateFormatted:function(){return formatDateAsShort(this.get("invoiceGenerationDateTime"))}.property("invoiceGenerationDateTime"),invoiceNotificationDateFormatted:function(){return formatDateAsShort(this.get("invoiceNotificationDateTime"))}.property("invoiceNotificationDateTime"),paymentChargeDateFormatted:function(){return formatDateAsShort(this.get("paymentChargeDateTime"))}.property("paymentChargeDateTime")})}),define("shift4tress/models/business-entity-permission",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({applicationGroupPermission:t["default"].belongsTo("applicationGroupPermission",{inverse:"businessEntityPermissions"}),name:t["default"].attr("string"),key:t["default"].attr("string"),description:t["default"].attr("string"),applicationGroupId:t["default"].attr("number"),canDelete:t["default"].attr("boolean"),canEdit:t["default"].attr("boolean"),canPeriod:t["default"].attr("boolean"),canGrant:t["default"].attr("boolean"),canView:t["default"].attr("boolean"),isSystem:t["default"].attr("boolean"),isActive:t["default"].attr("boolean")})}),define("shift4tress/models/business-entity-settings-copy-request",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({settingGroup:t["default"].attr("string"),settingName:t["default"].attr("string"),targetBusinessEntities:t["default"].hasMany("businessEntity"),businessEntity:t["default"].belongsTo("businessEntity",{inverse:null})})}),define("shift4tress/models/business-entity-theme",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntity:t["default"].belongsTo("businessEntity",{inverse:"businessEntityThemes",async:!1}),applicationGroupId:t["default"].attr("number"),companyName:t["default"].attr("string"),emailFrom:t["default"].attr("string"),supportPhone:t["default"].attr("string"),supportEmail:t["default"].attr("string"),appName:t["default"].attr("string"),domain:t["default"].attr("string",{defaultValue:"4tress.4tresspos.com"}),primaryColor:t["default"].attr("string"),secondaryColor:t["default"].attr("string"),accentColor:t["default"].attr("string"),image:t["default"].attr("string"),gridImage:t["default"].attr("string"),displayImage:function(){return this.get("image")?this.get("image"):this.get("businessEntity.baseImageUrl")+"logo1.bin?"+Date.now()}.property("image"),displayGridImage:function(){return this.get("appGridLogo")?this.get("appGridLogo"):this.get("businessEntity.baseImageUrl")+"appGridLogo1.bin?"+Date.now()}.property("appGridLogo")})}),define("shift4tress/models/business-entity",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({type:t["default"].attr("number"),subType:t["default"].attr("number"),name:t["default"].attr("string"),isRoot:t["default"].attr("boolean"),isActive:t["default"].attr("boolean"),numberOfMerchantsRemaining:t["default"].attr("number",{defaultValue:0}),users:t["default"].hasMany("user"),showChildDataChecked:!1,groups:t["default"].hasMany("group",{async:!1}),roles:t["default"].hasMany("role"),emailTemplates:t["default"].hasMany("emailTemplate",{inverse:"businessEntityId",async:!1}),permissionMasks:t["default"].hasMany("permissionMask"),businessEntityThemes:t["default"].hasMany("businessEntityTheme"),provisionedBusinessEntityThemes:t["default"].hasMany("provisionedBusinessEntityTheme"),provisioned4tressTheme:function(){var e=this.get("provisionedBusinessEntityThemes").filterBy("applicationGroupId",1);return e.length>0?e.objectAt(0):void 0}.property("provisionedBusinessEntityThemes"),ssoGeneralSettings:t["default"].hasMany("ssoGeneralSetting",{inverse:"businessEntity",async:!1}),ssoPages:t["default"].hasMany("ssoPage",{inverse:"businessEntity",async:!1}),passwordSettings:t["default"].hasMany("passwordSetting",{inverse:"businessEntity",async:!1}),provisionedActivities:t["default"].hasMany("provisionedActivity",{inverse:"businessEntityId",async:!1}),provisionsChecked:!1,baseImageUrl:t["default"].attr("string"),guid:t["default"].attr("string"),parentBusinessEntity:t["default"].belongsTo("businessEntity",{inverse:"children",async:!1}),parentBusinessEntityLoaded:function(){return this._internalModel._relationships.initializedRelationships.parentBusinessEntity&&null!=this._internalModel._relationships.initializedRelationships.parentBusinessEntity.inverseRecord?this._internalModel._relationships.initializedRelationships.parentBusinessEntity.inverseRecord.dataHasInitialized:!1}.property("parentBusinessEntity","parentBusinessEntity.isLoaded"),inheritancePool:function(){if(this.get("parentBusinessEntityLoaded")){var e=this.get("parentBusinessEntity.inheritancePool"),t=[];return t.push(this.get("id")),t.concat(e)}return[this.get("id")]}.property("parentBusinessEntity.inheritancePool","parentBusinessEntity"),rateProfileBusinessEntityAssignments:t["default"].hasMany("rateProfileBusinessEntityAssignment",{async:!0}),companies:t["default"].hasMany("company"),children:t["default"].hasMany("businessEntity"),nthChildLevel:function(){return this.get("parentBusinessEntityLoaded")?this.get("parentBusinessEntity.nthChildLevel")+1:0}.property("parentBusinessEntity.nthChildLevel","parentBusinessEntity"),lastUpdatedAt:t["default"].attr("date"),properties:t["default"].attr("array"),isSelected:!1,isExpanded:!0,jsTreeType:function(){return this.get("isMerchant")?'"merchant"':this.get("isResellerOrganization")?'"reseller"':'"organization"'}.property("isMerchant"),isMerchant:function(){return 1==this.get("type")}.property("type"),isOrganization:function(){return 2==this.get("type")}.property("type"),isStandardOrganization:function(){return this.get("isOrganization")&&1==this.get("subType")}.property("isOrganization","subType"),isResellerOrganization:function(){return this.get("isOrganization")&&3==this.get("subType")}.property("isOrganization","subType"),isRootOrganization:function(){return this.get("isOrganization")&&2==this.get("subType")}.property("isOrganization","subType"),isCurrentUserRoot:function(){return this.get("id")==App.currentSession.get("user.parentBusinessEntity.id")}.property(),beType:function(){return this.get("isResellerOrganization")?1:this.get("isOrganization")?2:this.get("isMerchant")?3:void 0}.property("type","subType"),sortProperties:["beType:asc","name:asc"],sortedChildren:a["default"].computed.sort("children","sortProperties"),canAddChildMerchant:function(){return!this.get("isResellerOrganization")}.property("App.currentSession.user.parentBusinessEntity.numberOfMerchantsRemaining","canHaveMerchants","isResellerOrganization"),canAddChildOrganization:function(){return this.get("isOrganization")}.property("isOrganization","isResellerOrganization"),canAddResellerOrganization:function(){return this.get("isResellerOrganization")}.property("subType"),canAddChild:function(){return App.currentSession.get("user").hasPermission("canEdit","organizations",this)&&(this.get("canAddChildMerchant")||this.get("canAddChildOrganization")||this.get("canAddResellerOrganization"))}.property("canAddChildMerchant","canAddChildOrganization","canAddResellerOrganization"),currentUserCanView:function(){var e=App.currentSession.get("user");return e.hasPermission("canView","organizations",this)||e.hasPermission("canPeriod","shift4User",e.get("parentBusinessEntity"))}.property(),currentUserCanEdit:function(){var e=App.currentSession.get("user");return e.hasPermission("canEdit","organizations",this)}.property(),checked:!1,radio:function(){return!1}.property(),copySetting:function(){return!1}.property(),hasRateProfile:function(){return this.get("rateProfileBusinessEntityAssignments.length")>0}.property("rateProfileBusinessEntityAssignments.[]"),showCompanyList:function(){return!(this.get("isMerchant")||!(this.get("companies.length")>0||App.currentSession.get("user").hasPermission("canEdit","billingCompanies",this)))}.property("companies.[]","currentSession.user.permissions.[]"),showAssignedRateProfiles:function(){var e=App.get("currentSession.user");return!!(e.hasPermission("canEdit","billingRateProfileAssignments",this)||App.currentSession.get("user").hasPermission("canView","billingRateProfileAssignments",this)&&this.get("hasRateProfile"))}.property("hasRateProfile")})}),define("shift4tress/models/company",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),address1:t["default"].attr("string"),address2:t["default"].attr("string"),city:t["default"].attr("string"),stateOrProvince:t["default"].attr("string"),postalCode:t["default"].attr("string"),country:t["default"].attr("string"),phone:t["default"].attr("string"),customerNumber:t["default"].attr("string"),fax:t["default"].attr("string"),website:t["default"].attr("string"),sic1:t["default"].attr("string"),sic2:t["default"].attr("string"),sic3:t["default"].attr("string"),businessEntity:t["default"].belongsTo("businessEntity"),paymentMethods:t["default"].hasMany("paymentMethod"),contacts:t["default"].hasMany("contact"),billToAccounts:t["default"].hasMany("billToAccount")})}),define("shift4tress/models/contact",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({firstName:t["default"].attr("string"),lastName:t["default"].attr("string"),fullName:function(){return this.get("firstName")+" "+this.get("lastName")}.property("firstName","lastName"),title:t["default"].attr("string"),phone:t["default"].attr("string"),fax:t["default"].attr("string"),email:t["default"].attr("string"),address1:t["default"].attr("string"),address2:t["default"].attr("string"),city:t["default"].attr("string"),stateOrProvince:t["default"].attr("string"),postalCode:t["default"].attr("string"),country:t["default"].attr("string"),isReadOnly:t["default"].attr("boolean"),company:t["default"].belongsTo("company",{async:!0}),isEditDisabled:function(){return!(App.currentSession.get("user").hasPermission("canEdit","billingContacts",this.get("company.businessEntity"))&&(!this.get("isReadOnly")||App.currentSession.get("user").hasPermission("canPeriod","shift4User",this.get("company.businessEntity"))))}.property("isReadOnly","company.businessEntity")})}),define("shift4tress/models/controller-failure",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({invoiceId:t["default"].attr("number"),billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),company:Em.computed.alias("billToAccount.company"),businessEntityId:t["default"].attr("number"),billingCycle:t["default"].belongsTo("billingCycle",{async:!0}),historyId:t["default"].attr("number"),message:t["default"].attr("string"),details:t["default"].attr("string"),submittedDate:t["default"].attr("date")})}),define("shift4tress/models/currency",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),symbol:t["default"].attr("string"),abbreviation:t["default"].attr("string"),currencyCode:t["default"].attr("string"),abbNameCombo:function(){return this.get("abbreviation")+" - "+this.get("name")}.property("name","abbreviation")})}),define("shift4tress/models/dba",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),addressLine1:t["default"].attr("string"),addressLine2:t["default"].attr("string"),city:t["default"].attr("string"),state:t["default"].attr("string"),zipCode:t["default"].attr("string"),phone:t["default"].attr("string"),merchantType:t["default"].attr("string"),businessDayEndingTime:t["default"].attr("string"),cardAbbreviations:t["default"].attr("string"),revision:t["default"].attr("string"),merchantId:t["default"].belongsTo("merchant",{inverse:null}),currencyCode:t["default"].attr("string")})}),define("shift4tress/models/default-email-template",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntityId:t["default"].attr("number"),provisionedBusinessEntityId:t["default"].attr("number"),applicationGroupId:t["default"].attr("number"),emailTemplateType:t["default"].attr("number"),subject:t["default"].attr("string"),emailBody:t["default"].attr("string")})}),define("shift4tress/models/default-sso-page",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntity:t["default"].attr("number"),provisionedBusinessEntityId:t["default"].attr("number"),pageTypeId:t["default"].attr("number"),defaultSsoPanels:t["default"].hasMany("defaultSsoPanel",{inverse:"defaultSsoPage",async:!1})})}),define("shift4tress/models/default-sso-panel",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({panelId:t["default"].attr("string"),defaultSsoPage:t["default"].belongsTo("defaultSsoPage",{inverse:"defaultSsoPanels",async:!1}),applicationGroupId:t["default"].attr("number"),panelTypeId:t["default"].attr("number"),panelValue:t["default"].attr("string")})}),define("shift4tress/models/discount-role",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({parentBusinessEntityId:t["default"].attr("number"),name:t["default"].attr("string"),type:t["default"].attr("number"),properties:t["default"].attr("array"),enabled:t["default"].attr("boolean",{defaultValue:!1})})}),define("shift4tress/models/discount",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant"),amount:t["default"].attr("number"),name:t["default"].attr("string"),isDollar:t["default"].attr("boolean"),isEditable:t["default"].attr("boolean"),roles:t["default"].hasMany("vtRole"),guid:t["default"].attr("string")})}),define("shift4tress/models/email-template",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({businessEntityId:t["default"].belongsTo("businessEntity",{inverse:"emailTemplates",async:!1}),provisionedBusinessEntityId:t["default"].attr("number"),applicationGroupId:t["default"].attr("number"),emailTemplateType:t["default"].attr("number"),subject:t["default"].attr("string"),emailBody:t["default"].attr("string"),formattedWelcomeTemplateSubjectString:function(){var e=this.get("subject");return e=this.formattedWelcomeString(e)}.property("subject","businessEntityId"),formattedWelcomeTemplatePreviewString:function(){var e=decodeURIComponent("undefined"!=typeof this.get("tempEmailBody")?this.get("tempEmailBody"):this.get("emailBody"));return e=this.formattedWelcomeString(e)}.property("tempEmailBody","businessEntityId"),formattedForgotPasswordPreviewString:function(){var e=decodeURIComponent("undefined"!=typeof this.get("tempEmailBody")?this.get("tempEmailBody"):this.get("emailBody"));return e=this.formattedForgotPasswordString(e)}.property("tempEmailBody","businessEntityId"),formattedReportsTemplatePreviewString:function(){var e=decodeURIComponent("undefined"!=typeof this.get("tempEmailBody")?this.get("tempEmailBody"):this.get("emailBody"));return e=this.formattedReportsTemplateString(e)}.property("tempEmailBody","businessEntityId"),formattedInvoiceNotificationPreviewString:function(){var e=decodeURIComponent("undefined"!=typeof this.get("tempEmailBody")?this.get("tempEmailBody"):this.get("emailBody"));return e=this.formattedInvoiceNotificationString(e)}.property("tempEmailBody","businessEntityId"),formattedForgotUsernamePreviewString:function(){var e=decodeURIComponent("undefined"!=typeof this.get("tempEmailBody")?this.get("tempEmailBody"):this.get("emailBody"));return e=this.formattedForgotUsernameString(e)}.property("tempEmailBody","businessEntityId"),formattedWelcomeString:function(e){var t=this.get("provisionedTheme");return t?(e=e.replace(/\[\[appName\]\]/g,t.get("appName")),e=e.replace(/\[\[companyName\]\]/g,t.get("companyName")),e=e.replace(/\[\[supportPhone\]\]/g,t.get("supportPhone")),e=e.replace(/\[\[appHeaderLogo\]\]/g,String('')),e=e.replace(/\[\[primaryColor\]\]/g,rgbToHex(t.get("primaryColor"))),e=e.replace(/\[\[secondaryColor\]\]/g,rgbToHex(t.get("secondaryColor"))),e=e.replace(/\[\[accentColor\]\]/g,rgbToHex(t.get("accentColor"))),e=e.replace(/\[\[usernameAppURL\]\]/g,String(this.get("apiPath.fortress")+"?Username="+App.get("currentSession.user.username"))),e=e.replace(/\[\[appURL\]\]/g,String(this.get("apiPath.fortress"))),e=e.replace(/\[\[temporaryPassword\]\]/g,"**********"),e=e.replace(/\[\[username\]\]/g,App.get("currentSession.user.username"))):console.log("EMAIL TEMPLATE PROVISIONED THEME IS NOT SET!!!"),e},formattedForgotPasswordString:function(e){var t=this.get("provisionedTheme");return t&&(e=e.replace(/\[\[companyName\]\]/g,t.get("companyName")),e=e.replace(/\[\[appHeaderLogo\]\]/g,String('')),e=e.replace(/\[\[passwordRequestDate\]\]/g,(new Date).toString()),e=e.replace(/\[\[username\]\]/g,App.get("currentSession.user.username")),e=e.replace(/\[\[temporaryPassword\]\]/g,"**********"),e=e.replace(/\[\[usernameAppURL\]\]/g,String(this.get("apiPath.fortress")+"?Username="+App.get("currentSession.user.username"))),e=e.replace(/\[\[supportPhone\]\]/g,t.get("supportPhone")),e=e.replace(/\[\[primaryColor\]\]/g,rgbToHex(t.get("primaryColor"))),e=e.replace(/\[\[secondaryColor\]\]/g,rgbToHex(t.get("secondaryColor"))),e=e.replace(/\[\[accentColor\]\]/g,rgbToHex(t.get("accentColor")))),e},formattedReportsTemplateString:function(e){var t=this.get("provisionedTheme");return t&&(e=e.replace(/\[\[companyName\]\]/g,t.get("companyName")),e=e.replace(/\[\[appHeaderLogo\]\]/g,String('')),e=e.replace(/\[\[supportPhone\]\]/g,t.get("supportPhone")),e=e.replace(/\[\[username\]\]/g,App.get("currentSession.user.username")),e=e.replace(/\[\[accountName\]\]/g,App.get("currentSession.user.selectedBusinessEntity.name")),e=e.replace(/\[\[reportDateRange\]\]/g,"'Report Date Range Here'"),e=e.replace(/\[\[reportRequestDate\]\]/g,(new Date).toString()),e=e.replace(/\[\[primaryColor\]\]/g,rgbToHex(t.get("primaryColor"))),e=e.replace(/\[\[secondaryColor\]\]/g,rgbToHex(t.get("secondaryColor"))),e=e.replace(/\[\[accentColor\]\]/g,rgbToHex(t.get("accentColor")))),e},formattedInvoiceNotificationString:function(e){var t=this.get("provisionedTheme");return t&&(e=e.replace(/\[\[companyName\]\]/g,t.get("companyName")),e=e.replace(/\[\[appHeaderLogo\]\]/g,String('')),e=e.replace(/\[\[supportPhone\]\]/g,t.get("supportPhone")),e=e.replace(/\[\[appInvoiceURL\]\]/g,"'App Invoice URL Here'"),e=e.replace(/\[\[invoiceDateRange\]\]/g,"'Invoice Date Range Here'"),e=e.replace(/\[\[invoiceId\]\]/g,"'Invoice ID Here'"),e=e.replace(/\[\[primaryColor\]\]/g,rgbToHex(t.get("primaryColor"))),e=e.replace(/\[\[secondaryColor\]\]/g,rgbToHex(t.get("secondaryColor"))),e=e.replace(/\[\[accentColor\]\]/g,rgbToHex(t.get("accentColor")))),e},formattedForgotUsernameString:function(e){var t=this.get("provisionedTheme");return t&&(e=e.replace(/\[\[companyName\]\]/g,t.get("companyName")),e=e.replace(/\[\[appHeaderLogo\]\]/g,String('')),e=e.replace(/\[\[supportPhone\]\]/g,t.get("supportPhone")),e=e.replace(/\[\[usernameRequestDate\]\]/g,(new Date).toString()),e=e.replace(/\[\[username\]\]/g,App.get("currentSession.user.username")),e=e.replace(/\[\[usernameAppURL\]\]/g,String(this.get("apiPath.fortress")+"?Username="+App.get("currentSession.user.username"))),e=e.replace(/\[\[primaryColor\]\]/g,rgbToHex(t.get("primaryColor"))),e=e.replace(/\[\[secondaryColor\]\]/g,rgbToHex(t.get("secondaryColor"))),e=e.replace(/\[\[accentColor\]\]/g,rgbToHex(t.get("accentColor")))),e}})}),define("shift4tress/models/ephemeral-user",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({authenticationCode:t["default"].attr("string"),parentBusinessEntity:t["default"].belongsTo("businessEntity"),applicationId:t["default"].attr("number"),allowDuplicateSessions:t["default"].attr("boolean"),lifespan:t["default"].belongsTo("lifespan"),roleMappings:t["default"].hasMany("roleMapping"),userSessions:t["default"].hasMany("userSession"),user:t["default"].belongsTo("user"),isRevoked:t["default"].attr("boolean"),lastUpdatedAt:t["default"].attr("string"),lastUpdatedAtFormatted:function(){return formatDateFunction(this.get("lastUpdatedAt"))}.property("lastUpdatedAt"),lastUpdatedBy:t["default"].attr("string"),parentName:function(){return this.get("parentBusinessEntity.name")}.property("parentBusinessEntity")})}),define("shift4tress/models/external-integration",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntityId:t["default"].attr("number"),merchant:t["default"].belongsTo("vtMerchant"),displayName:t["default"].attr("string"),messagingType:t["default"].attr("string")})}),define("shift4tress/models/group-business-entity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntity:t["default"].belongsTo("businessEntity"),group:t["default"].belongsTo("group"),name:t["default"].attr(),lastUpdatedAt:t["default"].attr()})}),define("shift4tress/models/group-role-business-entity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({group:t["default"].belongsTo("group",{async:!1}),businessEntities:t["default"].hasMany("businessEntity",{async:!1}),role:t["default"].belongsTo("role"),lastUpdatedAt:t["default"].attr("string",{defaultValue:""})})}),define("shift4tress/models/group-role",["exports","ember-data"],function(e,t){ e["default"]=t["default"].Model.extend({role:t["default"].belongsTo("role"),group:t["default"].belongsTo("group"),name:t["default"].attr("string"),type:t["default"].attr("number"),parentBusinessEntity:t["default"].belongsTo("organization",{async:!0}),properties:t["default"].attr("array"),lastUpdatedAt:t["default"].attr("string"),lastUpdatedBy:t["default"].attr("number")})}),define("shift4tress/models/group-user",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({user:t["default"].belongsTo("user",{async:!0}),parentBusinessEntity:t["default"].belongsTo("businessEntity",{async:!1}),group:t["default"].belongsTo("group"),firstName:t["default"].attr("string"),lastName:t["default"].attr("string"),username:t["default"].attr("string")})}),define("shift4tress/models/group",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),isActive:t["default"].attr("boolean"),lastUpdatedAt:t["default"].attr("date"),parentBusinessEntity:t["default"].belongsTo("businessEntity"),roleBusinessEntities:t["default"].hasMany("groupRoleBusinessEntity",{async:!1}),users:t["default"].hasMany("groupUser"),properties:t["default"].attr("array"),userCount:a["default"].computed("properties.[]",{get:function(){var e=0;return this.get("properties")&&this.get("properties").forEach(function(t){"Users"===t.key.key&&(e=parseInt(t.key.value))}),e},set:function(e,t){return t}}),merchantCount:a["default"].computed("properties.[]",{get:function(){var e=0;return this.get("properties")&&this.get("properties").forEach(function(t){"Organizations"===t.key.key&&(e=parseInt(t.key.value))}),e},set:function(e,t){return t}}),roleCount:a["default"].computed("properties.[]",{get:function(){var e=0;return this.get("properties")&&this.get("properties").forEach(function(t){"Roles"===t.key.key&&(e=parseInt(t.key.value))}),e},set:function(e,t){return t}})})}),define("shift4tress/models/integration-setting",["exports","ember-data"],function(e,t){var a=0;e["default"]=t["default"].Model.extend({localId:t["default"].attr("string"),merchant:t["default"].belongsTo("vtMerchant"),displayName:t["default"].attr("string"),connectionString:t["default"].attr("string"),externalIntegrationId:t["default"].attr("number"),externalIntegrationName:t["default"].attr("string"),tenderTypeId:t["default"].attr("number"),messagingType:t["default"].attr("string"),externalIntegration:t["default"].belongsTo("externalIntegration",{inverse:null}),isProxy:t["default"].attr("boolean",{defaultValue:!1}),lookupUrl:t["default"].attr("string"),chargeUrl:t["default"].attr("string"),instance:t["default"].attr("string"),userId:t["default"].attr("string"),password:t["default"].attr("string"),isEditDisabled:!0,integrationSettingIsDeleted:t["default"].attr("boolean",{defaultValue:!1}),localIdDidChange:function(){a++}.observes("localId"),integrationTypeIdDidChange:function(){var e=this.get("merchant.externalIntegrations").filterBy("id",this.get("externalIntegrationId")).objectAt(0);e?this.set("externalIntegration",e):this.set("externalIntegration",null)}.observes("externalIntegrationId"),updateIntegrationsFromConnectionString:function(){if(this.get("localId")||this.set("localId","integrationSetting"+String(a)),this.get("connectionString")){var e=JSON.parse(this.get("connectionString"));this.setProperties(e),this.get("password")&&(this.set("historicPassword",this.get("password")),this.set("password","AaBbCc™®"))}},historicPassword:""})}),define("shift4tress/models/invoice-download-token",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({invoiceId:t["default"].attr("string")})}),define("shift4tress/models/invoice",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({total:t["default"].attr("number"),generationDate:t["default"].attr("date"),notificationDate:t["default"].attr("date"),dueDate:t["default"].attr("date"),period:t["default"].attr("date"),status:t["default"].attr("string"),billToAccount:t["default"].belongsTo("billToAccount",{async:!0}),dueDateDate:function(){return new Date(this.get("dueDate"))}.property("dueDate"),formattedDueDate:function(){var e=this.get("dueDateDate");return e.getMonth()+1+"/"+e.getDate()+"/"+e.getFullYear()}.property("dueDateDate"),periodDate:function(){return new Date(this.get("period"))}.property("period"),formattedPeriod:function(){var e=this.get("periodDate"),t=e.getMonth(),a=e.getFullYear();return(9>t?"0":"")+(t+Number(1))+"/"+a}.property("periodDate")})}),define("shift4tress/models/item-modifier-set",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant",{inverse:null}),modifierSet:t["default"].belongsTo("modifierSet",{defaultValue:0}),item:t["default"].belongsTo("item")})}),define("shift4tress/models/item-modifier",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant",{inverse:null}),modifier:t["default"].belongsTo("modifier"),item:t["default"].belongsTo("item")})}),define("shift4tress/models/item",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({description:t["default"].attr("string"),merchant:t["default"].belongsTo("vtMerchant",{inverse:"items"}),unitPrice:t["default"].attr("number"),enableNotes:t["default"].attr("boolean"),category:t["default"].attr("number"),isFreeform:t["default"].attr("boolean"),isChecked:t["default"].attr("boolean"),taxCode:t["default"].attr("string",{defaultValue:null}),itemCode:t["default"].attr("string"),upc:t["default"].attr("string"),image:t["default"].attr("string"),useDefaultImage:t["default"].attr("boolean"),isItem:!0,creating:!1,isGiftCard:t["default"].attr("boolean"),firstCategoryName:function(){return this.get("shelfCategoryItems.length")>1?this.get("shelfCategoryItems").objectAt(0).get("category.name")+this.get("shelfCategoryItems").objectAt(1).get("category.name"):this.get("shelfCategoryItems").get("firstObject.category.name")}.property("shelfCategoryItems.[]"),shelfCategoryItems:t["default"].hasMany("shelfCategoryItem",{async:!1}),itemModifiers:t["default"].hasMany("itemModifier"),itemModifierSets:t["default"].hasMany("itemModifierSet"),displayImage:function(){if(this.get("useDefaultImage")){var e=this.get("merchant.baseImageUrl");return e?(e=e.split("cdn"),e=e[0]+"common/No-Item-Image-Icon.bin?"+Date.now()):""}return this.get("image")?this.get("image"):this.get("merchant.baseImageUrl")+"item"+this.get("id")+".bin?"+Date.now()}.property("merchant","image"),isUncategorized:function(){var e=this;if(0===this.get("shelfCategoryItems.length")&&!this.get("creating")){if(this.set("creating",!0),e.get("merchant.shelfCategories")){var t=e.get("merchant.shelfCategories").filter(function(e){return 0===e.get("id")?e:void 0}).get("firstObject");t&&e.store.createRecord("shelfCategoryItem",{merchant:e.get("merchant"),category:t,item:e,lastUpdateDateTime:new Date})}e.set("creating",!1)}}.observes("shelfCategoryItems.[]"),isCashoutItem:function(){return 0==this.get("id")}.property("id")})}),define("shift4tress/models/lifespan",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({lifeSpanType:t["default"].attr("number"),startDate:t["default"].attr("string"),endDate:t["default"].attr("string")})}),define("shift4tress/models/merchant",["exports","ember-data","shift4tress/app"],function(e,t,a){e["default"]=t["default"].Model.extend({type:t["default"].attr("number"),name:t["default"].attr("string"),dbaName:t["default"].attr("string"),currencyCode:t["default"].attr("number"),parentBusinessEntity:t["default"].belongsTo("businessEntity",{async:!1}),parentBusinessEntityLoaded:function(){return this._internalModel._relationships.initializedRelationships.parentBusinessEntity.inverseRecord?this._internalModel._relationships.initializedRelationships.parentBusinessEntity.inverseRecord.dataHasInitialized:!1}.property("parentBusinessEntity"),businessEntity:t["default"].belongsTo("businessEntity",{async:!1}),paymentMerchant:t["default"].belongsTo("paymentMerchant",{async:!1}),isRoot:t["default"].attr("boolean"),isActive:t["default"].attr("boolean",{defaultValue:!0}),isMerchant:!0,disallowEdit:function(){var e=a["default"].currentSession.get("user");return!e.hasPermission("canEdit","organizations",this.get("businessEntity"))}.property("App.currentSession.user.permissions"),dbaFailed:function(){return""!==this.get("dbaName")&&this.get("dbaName")?""===this.get("paymentMerchant.accessToken")||!this.get("paymentMerchant.accessToken"):!0}.property("paymentMerchant.accessToken","dbaName")})}),define("shift4tress/models/modifier-set-modifier",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant",{inverse:null}),modifier:t["default"].belongsTo("modifier"),modifierSet:t["default"].belongsTo("modifierSet")})}),define("shift4tress/models/modifier-set",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant"),modifierSetModifiers:t["default"].hasMany("modifierSetModifier"),modifierCount:function(){return this.get("modifierSetModifiers.length")}.property("modifierSetModifiers.[]"),name:t["default"].attr("string")})}),define("shift4tress/models/modifier",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({isChecked:!1,isSelected:t["default"].attr("boolean"),isSelectedByDefault:function(){return this.get("isSelected")?"Yes":"No"}.property("isSelected"),merchant:t["default"].belongsTo("vtMerchant"),modifierSetModifiers:t["default"].hasMany("modifierSetModifier"),name:t["default"].attr("string"),unitPrice:t["default"].attr("number")})}),define("shift4tress/models/organization",["exports","ember-data","shift4tress/app"],function(e,t,a){e["default"]=t["default"].Model.extend({type:t["default"].attr("number"),name:t["default"].attr("string"),isRoot:t["default"].attr("boolean"),isActive:t["default"].attr("boolean",{defaultValue:!0}),guid:t["default"].attr("string"),baseImageUrl:t["default"].attr("string"),administratorEmail:t["default"].attr("string"),merchantsAllowed:t["default"].attr("number",{defaultValue:0}),organizationTypeId:t["default"].attr("number"),parentBusinessEntity:t["default"].belongsTo("businessEntity",{async:!1}),parentBusinessEntityLoaded:function(){return this._internalModel._relationships.initializedRelationships.parentBusinessEntity.inverseRecord?this._internalModel._relationships.initializedRelationships.parentBusinessEntity.inverseRecord.dataHasInitialized:!1}.property("parentBusinessEntity"),businessEntity:t["default"].belongsTo("businessEntity"),properties:t["default"].attr("array"),groups:t["default"].hasMany("group",{inverse:null}),roles:t["default"].hasMany("role",{inverse:null}),users:t["default"].hasMany("user",{inverse:"parentBusinessEntity"}),isOrganization:!0})}),define("shift4tress/models/password-setting",["exports","ember-data"],function(e,t){window.DATE_TIME_INTERVAL_MILLISECONDS=0,window.DATE_TIME_INTERVAL_SECONDS=1,window.DATE_TIME_INTERVAL_MINUTES=2,window.DATE_TIME_INTERVAL_HOURS=3,window.DATE_TIME_INTERVAL_DAYS=4,window.DATE_TIME_INTERVAL_WEEKS=5,window.DATE_TIME_INTERVAL_MONTHS=6,window.DATE_TIME_INTERVAL_YEARS=7,e["default"]=t["default"].Model.extend({businessEntity:t["default"].belongsTo("businessEntity",{inverse:"passwordSettings",async:!1}),applicationGroupId:t["default"].attr("number"),containsLetters:t["default"].attr("boolean"),containsLowercaseLetters:t["default"].attr("boolean"),containsUppercaseLetters:t["default"].attr("boolean"),containsSpecialCharacters:t["default"].attr("boolean"),containsNumbers:t["default"].attr("boolean"),activationEmailExpiresAfter:t["default"].attr("number"),passwordExpiresAfter:t["default"].attr("number"),doesNotContainUsername:t["default"].attr("boolean"),enforcePasswordHistoryForLastPasswords:t["default"].attr("number"),loginAttemptsAllowedBeforeLockout:t["default"].attr("number"),minimumNumberOfCharacters:t["default"].attr("number"),unlockAutomatically:t["default"].attr("boolean"),unlockAutomaticallyAfter:t["default"].attr("number"),unlockAutomaticallyAfterInterval:t["default"].attr("number")})}),define("shift4tress/models/payment-merchant",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({authCode:t["default"].attr("string"),accessToken:t["default"].attr("string"),applicationId:t["default"].attr("number"),merchant:t["default"].belongsTo("merchant")})}),define("shift4tress/models/payment-method-type",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string")})}),define("shift4tress/models/payment-method",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),paymentToken:t["default"].attr("string"),paymentMethodType:t["default"].belongsTo("paymentMethodType",{inverse:null,async:!1}),company:t["default"].belongsTo("company"),metadata:t["default"].attr("string"),isPaymentMethodTypeCreditCard:function(){return this.get("paymentMethodType.id")==App.BillingPaymentMethodTypeKeys.creditCard}.property("paymentMethodType"),isPaymentMethodTypeAchUs:function(){return this.get("paymentMethodType.id")==App.BillingPaymentMethodTypeKeys.achUs}.property("paymentMethodType"),isPaymentMethodTypeAchCanada:function(){return this.get("paymentMethodType.id")==App.BillingPaymentMethodTypeKeys.achCa}.property("paymentMethodType")})}),define("shift4tress/models/paymentmethod",["exports","ember-data","shift4tress/app"],function(e,t,a){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),paymentToken:t["default"].attr("string"),paymentMethodType:t["default"].belongsTo("paymentMethodType",{inverse:null,async:!1}),company:t["default"].belongsTo("company"),metadata:t["default"].attr("string"),isPaymentMethodTypeCreditCard:function(){return this.get("paymentMethodType.id")==a["default"].BillingPaymentMethodTypeKeys.creditCard}.property("paymentMethodType"),isPaymentMethodTypeAchUs:function(){return this.get("paymentMethodType.id")==a["default"].BillingPaymentMethodTypeKeys.achUs}.property("paymentMethodType"),isPaymentMethodTypeAchCanada:function(){return this.get("paymentMethodType.id")==a["default"].BillingPaymentMethodTypeKeys.achCa}.property("paymentMethodType")})}),define("shift4tress/models/payments-by-tender-type",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({merchantId:t["default"].attr("number"),merchant:t["default"].attr("string"),calRefundAmount:t["default"].attr("number"),calSalesAmount:t["default"].attr("number"),calTotalAmount:t["default"].attr("number"),cardType:t["default"].attr("string"),tenderType:t["default"].attr("string"),tenderTypeId:t["default"].attr("number"),transactionCount:t["default"].attr("number"),currencySymbol:t["default"].attr("string"),currencyAbbreviation:t["default"].attr("string"),unknownTenderCount:t["default"].attr("number"),expanded:!1,salesByCardType:t["default"].hasMany("salesByCardType"),sortedSalesByCardType:a["default"].computed.sort("salesByCardType","sortProperties"),sortProperties:["saleNumber:asc"],sortAscending:!0,displayTotalAmount:function(){return new Big(this.get("calTotalAmount")).abs()}.property("calTotalAmount")})}),define("shift4tress/models/pending-info",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({pendingSaleMerchantId:t["default"].attr("number"),pendingSaleNumber:t["default"].attr("number")})}),define("shift4tress/models/permission-mask",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({user:t["default"].belongsTo("user"),applicationGroup:t["default"].belongsTo("applicationGroup"),permission:t["default"].belongsTo("permission",{async:!1}),levelMask:t["default"].attr("number"),businessEntities:t["default"].hasMany("businessEntity",{async:!1}),canView:function(){return!!(16&this.get("levelMask"))}.property("levelMask"),canEdit:function(){return!!(8&this.get("levelMask"))}.property("levelMask"),canDelete:function(){return!!(4&this.get("levelMask"))}.property("levelMask"),canPeriod:function(){return!!(2&this.get("levelMask"))}.property("levelMask"),canGrant:function(){return!!(1&this.get("levelMask"))}.property("levelMask")})}),define("shift4tress/models/permission",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({applicationGroup:t["default"].belongsTo("applicationGroup"),key:t["default"].attr("string"),name:t["default"].attr("string"),description:t["default"].attr("string"),canView:t["default"].attr(),canEdit:t["default"].attr(),canPeriod:t["default"].attr(),canGrant:t["default"].attr(),showCanView:function(){return null!=this.get("canView")}.property("canView"),showCanEdit:function(){return null!=this.get("canEdit")}.property("canEdit"),showCanPeriod:function(){return null!=this.get("canPeriod")}.property("canPeriod"),showCanGrant:function(){return null!=this.get("canGrant")}.property("canGrant")})}),define("shift4tress/models/pms-setting",["exports","ember-data"],function(e,t){var a=0;e["default"]=t["default"].Model.extend({localId:t["default"].attr("string"),merchant:t["default"].belongsTo("vtMerchant"),businessEntityPMSId:t["default"].attr("number"),displayName:t["default"].attr("string"),connectionString:t["default"].attr("string"),pmsTypeId:t["default"].attr("number"),pmsName:t["default"].attr("string"),isProxy:t["default"].attr("boolean",{defaultValue:!1}),url:t["default"].attr("string"),isEditDisabled:!0,pmsSettingIsDeleted:t["default"].attr("boolean",{defaultValue:!1}),localIdDidChange:function(){a++}.observes("localId"),pmsTypeIdDidChange:function(){if(this.get("pmsTypeId")){var e=this.get("merchant.propertyManagementSystems").filterBy("pmsTypeId",Number(this.get("pmsTypeId")));e&&(this.set("pmsName",e.objectAt(0).get("displayName")),this.set("businessEntityPMSId",e.objectAt(0).get("id")))}else this.set("pmsName",void 0),this.set("businessEntityPMSId",void 0)}.observes("pmsTypeId"),updatePropertiesFromConnectionString:function(){if(this.get("localId")||this.set("localId","pmsSetting"+String(a)),this.get("connectionString")){var e=JSON.parse(this.get("connectionString"));e.url&&this.set("url",e.url),e.isProxy&&this.set("isProxy",e.isProxy)}}})}),define("shift4tress/models/product-billable-activity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({billableProduct:t["default"].belongsTo("billableProduct"),billableActivity:t["default"].belongsTo("billableActivity",{async:!0})})}),define("shift4tress/models/property-management-system",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntityId:t["default"].attr("number"),merchant:t["default"].belongsTo("vtMerchant"),pmsTypeId:t["default"].attr("number"),lastUpdatedDateTime:t["default"].attr("date"),lastUpdatedUserId:t["default"].attr("number"),displayName:t["default"].attr("string")})}),define("shift4tress/models/provisioned-activity",["exports","ember-data"],function(e,t){var a="c01e63a9-37be-49ff-8ae5-3652040eaaee",n="3ef4b899-d3c1-4bf1-87f7-ed9d7a6a658b",r="de18705c-c4f1-4f05-9316-efe6e430f0e2",l="5bffba90-4e57-47de-8618-e4960ee3196a",d="025ea9be-d0b4-44be-8cac-d45979bbe237";e["default"]=t["default"].Model.extend({businessEntityId:t["default"].belongsTo("businessEntity",{inverse:"provisionedActivities"}),owningBusinessEntityId:t["default"].attr("number"),productKey:t["default"].attr("string"),activityKey:t["default"].attr("string"),isProvisioned:t["default"].attr("boolean"),isApplicationThemingActivity:function(){return this.get("activityKey")===r}.property("activityKey"),isEmailThemingActivity:function(){return this.get("activityKey")===l}.property("activityKey"),isSSOThemingActivity:function(){return this.get("activityKey")===d}.property("activityKey"),is4tressProduct:function(){return this.get("productKey")===n}.property("productKey"),isVt4Product:function(){return this.get("productKey")===a}.property("productKey")})}),define("shift4tress/models/provisioned-business-entity-theme",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntity:t["default"].belongsTo("businessEntity",{inverse:"provisionedBusinessEntityThemes",async:!1}),applicationGroupId:t["default"].attr("number"),companyName:t["default"].attr("string"),emailFrom:t["default"].attr("string"),supportPhone:t["default"].attr("string"),supportEmail:t["default"].attr("string"),appName:t["default"].attr("string"),domain:t["default"].attr("string",{defaultValue:"4tress.4tresspos.com"}),primaryColor:t["default"].attr("string"),secondaryColor:t["default"].attr("string"),accentColor:t["default"].attr("string"),baseImageUrl:t["default"].attr("string"),configured:!0,displayImage:function(){return this.get("baseImageUrl")+"logo1.bin?"+Date.now()}.property("primaryColor","secondaryColor","accentColor","baseImageUrl"),displayGridImage:function(){return this.get("baseImageUrl")+"appGridLogo1.bin?"+Date.now()}.property("primaryColor","secondaryColor","accentColor","baseImageUrl")})}),define("shift4tress/models/rate-profile-business-entity-assignment",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({rateProfile:t["default"].belongsTo("rateProfile",{async:!0}),businessEntity:t["default"].belongsTo("businessEntity",{async:!0})})}),define("shift4tress/models/rate-profile",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),description:t["default"].attr("string"),billableProduct:t["default"].belongsTo("billableProduct",{async:!0}),billableActivityRates:t["default"].hasMany("billableActivityRate",{embedded:"always",async:!0}),rateProfileBusinessEntityAssignments:t["default"].hasMany("rateProfileBusinessEntityAssignment",{async:!0})})}),define("shift4tress/models/response",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({code:t["default"].attr("number")})}),define("shift4tress/models/role-business-entity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({role:t["default"].belongsTo("role"),businessEntity:t["default"].belongsTo("businessEntity",{inverse:null}),name:t["default"].attr("string")})}),define("shift4tress/models/role-mapping",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({parentBusinessEntity:t["default"].belongsTo("businessEntity"),ephemeralUser:t["default"].belongsTo("ephemeralUser"),lastUpdatedAt:t["default"].attr("string"),lastUpdatedBy:t["default"].attr("string"),role:t["default"].belongsTo("role"),user:t["default"].belongsTo("user")})}),define("shift4tress/models/role-permission",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({role:t["default"].belongsTo("role"),permission:t["default"].belongsTo("permission",{inverse:null}),canView:t["default"].attr("boolean"),canEdit:t["default"].attr("boolean"),canPeriod:t["default"].attr("boolean"),canGrant:t["default"].attr("boolean"),applicationGroupId:t["default"].attr("number"),name:t["default"].attr("string")})}),define("shift4tress/models/role",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),type:t["default"].attr("number"),parentBusinessEntity:t["default"].belongsTo("businessEntity",{async:!0}),properties:t["default"].attr("array"),lastUpdatedAt:t["default"].attr("string"),permissions:t["default"].hasMany("rolePermission",{async:!1}),businessEntities:t["default"].hasMany("roleBusinessEntity",{inverse:null}),businessEntityRoleMask:t["default"].attr("number"),isMerchantRole:function(){return!!(this.get("isUniversalRole")||16&this.get("businessEntityRoleMask"))}.property("businessEntityRoleMask"),isOrganizationRole:function(){return!!(this.get("isUniversalRole")||8&this.get("businessEntityRoleMask"))}.property("businessEntityRoleMask"),isResellerRole:function(){return!!(this.get("isUniversalRole")||4&this.get("businessEntityRoleMask"))}.property("businessEntityRoleMask"),isRootRole:function(){return!!(this.get("isUniversalRole")||2&this.get("businessEntityRoleMask"))}.property("businessEntityRoleMask"),isUniversalRole:function(){return!!(1&this.get("businessEntityRoleMask"))}.property("businessEntityRoleMask"),isCustomRole:function(){return 2===this.get("type")}.property("type"),rolePermissionForKey:function(e){var t;return this.get("permissions").any(function(a){return a.get("permission.key")===e?(t=a,!0):void 0}),t},userCount:function(){var e=0;return this.get("properties")&&this.get("properties").any(function(t){var t=t.key;return"Users"===t.key?(e=parseInt(t.value),!0):void 0}),e}.property("properties.[]"),appGroups:function(){var e=[],t=this;return App.get("applicationGroups").forEach(function(n){var r=a["default"].Object.create();r.set("name",n.get("name")),r.set("applicationGroupId",n.get("id"));var l=[];n.get("permissions").forEach(function(e){if(null!==e.get("canView")||null!==e.get("canEdit")||null!==e.get("canPeriod")||null!==e.get("canGrant")){var a=t.rolePermissionForKey(e.get("key")),n=App.ViewModelPermission.create({key:e.get("key"),name:e.get("name"),description:e.get("description"),permissionId:e.get("id"),canView:e.get("canView"),canEdit:e.get("canEdit"),canPeriod:e.get("canPeriod"),canGrant:e.get("canGrant"),showCanView:e.get("showCanView"),showCanEdit:e.get("showCanEdit"),showCanPeriod:e.get("showCanPeriod"),showCanGrant:e.get("showCanGrant")});a&&(n.set("canView",a.get("canView")),n.set("canEdit",a.get("canEdit")),n.set("canPeriod",a.get("canPeriod")),n.set("canGrant",a.get("canGrant"))),l.addObject(n)}}),l.get("length")>0&&(r.set("permissions",l),e.addObject(r))}),t.set("clearAppGroups",!1),e}.property("permissions.[]","clearAppGroups"),commitRolePermissions:function(){var e=this,t=[];return e.get("appGroups").forEach(function(a){a.get("permissions").forEach(function(a){var n=e.rolePermissionForKey(a.get("key"));if(n)n.setProperties({canView:a.get("canView"),canEdit:a.get("canEdit"),canPeriod:a.get("canPeriod"),canGrant:a.get("canGrant")});else if(a.get("canView")||a.get("canEdit")||a.get("canPeriod")||a.get("canGrant")){var r=e.store.find("permission",a.get("permissionId")).then(function(t){return e.store.createRecord("rolePermission",{id:e.get("id")+"-"+t.get("id"),role:e,permission:t,canView:a.get("canView"),canEdit:a.get("canEdit"),canPeriod:a.get("canPeriod"),canGrant:a.get("canGrant")})});t.push(r)}})}),a["default"].RSVP.all(t)},rolePermissionshasDirtyAttributes:function(){var e=this,t=!1;return e.get("appGroups").any(function(a){return a.get("permissions").any(function(a){var n=e.rolePermissionForKey(a.get("key"));return n?n.get("canView")!==a.get("canView")||n.get("canEdit")!==a.get("canEdit")||n.get("canPeriod")!==a.get("canPeriod")||n.get("canGrant")!==a.get("canGrant")?(t=!0,!0):void 0:(t=!0,!0)}),t?!0:void 0}),t}.property()}),App.ViewModelPermission=a["default"].Object.extend({canViewChanged:function(){var e=this.get("canView");e||this.set("canEdit",e)}.observes("canView"),canEditChanged:function(){this.get("canEdit")&&this.set("canView",this.get("canEdit"))}.observes("canEdit")})}),define("shift4tress/models/rolebusinessentity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({role:t["default"].belongsTo("role"),businessEntity:t["default"].belongsTo("businessEntity",{inverse:null}),name:t["default"].attr("string")})}),define("shift4tress/models/sales-by-card-type",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({tenderId:t["default"].attr("number"),merchantId:t["default"].attr("number"),cardType:t["default"].attr("string"),saleTypeId:t["default"].attr("number"),saleNumber:t["default"].attr("number"),isRefund:t["default"].attr("boolean"),clerkId:t["default"].attr("number"),clerk:t["default"].attr("string"),saleDateTime:t["default"].attr("date"),amount:t["default"].attr("number"),invoiceNumber:t["default"].attr("number"),last4:t["default"].attr("string"),formattedDate:function(){var e=this.get("saleDateTime"),t=e,a=t.getDate(),n=t.getMonth(),r=t.getFullYear(),l=t.getHours(),d="AM";l>11&&(l>12&&(l-=12),d="PM");var i=t.getMinutes(),o=t.getSeconds(),s=String(Number(n+1)+"/"+a+"/"+r+" "+l+":"+(i>9?i:"0"+i)+":"+(o>9?o:"0"+o)+" "+d);return s}.property("saleDateTime"),displayTransactionTypeForSaleTypeId:function(){switch(this.get("saleTypeId")){case 0:return"Sale";case 1:return"Refund";case 2:return"Cash Out";default:return"Error"}}.property("saleTypeId")})}),define("shift4tress/models/session",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({accessToken:a["default"].computed.alias("id"),authCode:t["default"].attr("string"),clientId:t["default"].attr("number"),expiresAt:t["default"].attr("date"),user:t["default"].belongsTo("user",{inverse:null,async:!1})})}),define("shift4tress/models/shelf-category-item",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant",{inverse:null}),category:t["default"].belongsTo("shelfCategory",{defaultValue:0}),item:t["default"].belongsTo("item"),lastUpdateDateTime:t["default"].attr("date")})}),define("shift4tress/models/shelf-category",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),merchant:t["default"].belongsTo("vtMerchant",{inverse:"shelfCategories"}),shelfCategoryItems:t["default"].hasMany("shelfCategoryItem",{async:!1}),filteredShelfCategoryItems:function(){var e=this.get("shelfCategoryItems");return this.get("shelfCategoryItems").forEach(function(t){t&&t.get("item.isCashoutItem")&&e.removeObject(t)}),e}.property("shelfCategoryItems"),lastUpdateDateTime:t["default"].attr("date"),image:t["default"].attr("string"),useDefaultImage:t["default"].attr("boolean"),isCategory:!0,isUncategorized:function(){return 0==this.get("id")}.property("id"),itemCount:function(){return this.get("filteredShelfCategoryItems.length")}.property("shelfCategoryItems.[]"),displayImage:function(){if(this.get("useDefaultImage")){var e=this.get("merchant.baseImageUrl");return e=e.split("cdn"),e=e[0]+"common/Default-Category-Image-Icon.bin?"+Date.now()}return this.get("image")?this.get("image"):this.get("merchant.baseImageUrl")+"cat"+this.get("id")+".bin?"+Date.now()}.property("merchant","image"),itemExists:function(e){return this.get("shelfCategoryItems").forEach(function(t){return e===t.get("item")?!0:void 0}),!1}.property("shelfCategoryItems.[]")})}),define("shift4tress/models/sso-general-setting",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntity:t["default"].belongsTo("businessEntity",{inverse:"ssoGeneralSettings",async:!1}),provisionedBusinessEntityId:t["default"].attr("number"),applicationGroupId:t["default"].attr("number"),image:t["default"].attr("string"),baseImageUrl:t["default"].attr("string"),primaryColor:t["default"].attr("string"),secondaryColor:t["default"].attr("string"),accentColor:t["default"].attr("string"),pageTitle:t["default"].attr("string"),displayImage:function(){return this.get("image")?this.get("image"):this.get("businessEntity.baseImageUrl")+"logo-clientId3-header.bin?"+Date.now()}.property("image")})}),define("shift4tress/models/sso-page",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntity:t["default"].belongsTo("businessEntity",{inverse:"ssoPages",async:!1}),provisionedBusinessEntityId:t["default"].attr("number"),pageTypeId:t["default"].attr("number"),ssoPanels:t["default"].hasMany("ssoPanel",{inverse:"ssoPage",async:!1}),leftPanel:function(){var e=null;return this.get("ssoPanels").forEach(function(t){t.get("isLeftPanel")&&(e=t)}),e}.property("ssoPanels.[]"),rightPanel:function(){var e=null;return this.get("ssoPanels").forEach(function(t){t.get("isRightPanel")&&(e=t)}),e}.property("ssoPanels.[]"),fortressPanel:function(){var e=null;return this.get("ssoPanels").forEach(function(t){ t.get("isFortressPanel")&&(e=t)}),e}.property("ssoPanels.[]"),vt4Panel:function(){var e=null;return this.get("ssoPanels").forEach(function(t){t.get("isVT4Panel")&&(e=t)}),e}.property("ssoPanels.[]")})}),define("shift4tress/models/sso-panel",["exports","ember-data"],function(e,t){var a=1,n=2;e["default"]=t["default"].Model.extend({panelId:t["default"].attr("string"),ssoPage:t["default"].belongsTo("ssoPage",{inverse:"ssoPanels",async:!1}),applicationGroupId:t["default"].attr("number"),panelTypeId:t["default"].attr("number"),panelValue:t["default"].attr("string"),formattedPanelValueString:function(){var e=decodeURIComponent("undefined"!=typeof this.get("tempPanelValue")?this.get("tempPanelValue"):this.get("panelValue"));return e=this.formattedPanelValue(e)}.property("tempPanelValue"),formattedPanelValue:function(e){var t=this.get("ssoPage.provisionedTheme");return t||console.log("SSO PANEL PROVISIONED THEME IS NOT SET!!!"),e},isLeftPanel:function(){return this.get("ssoPage.pageTypeId")===SSO_PAGE_TYPE_LANDING?this.get("panelTypeId")===a&&this.get("applicationGroupId")===APPLICATION_GROUP_4TRESS:!1}.property("panelTypeId","applicationGroupId"),isRightPanel:function(){return this.get("ssoPage.pageTypeId")===SSO_PAGE_TYPE_LANDING?this.get("panelTypeId")===n&&this.get("applicationGroupId")===APPLICATION_GROUP_4TRESS:!1}.property("panelTypeId","applicationGroupId"),isFortressPanel:function(){return this.get("ssoPage.pageTypeId")===SSO_PAGE_TYPE_LOGIN?this.get("panelTypeId")===a&&this.get("applicationGroupId")===APPLICATION_GROUP_4TRESS:!1}.property("panelTypeId","applicationGroupId"),isVT4Panel:function(){return this.get("ssoPage.pageTypeId")===SSO_PAGE_TYPE_LOGIN?this.get("panelTypeId")===a&&this.get("applicationGroupId")===APPLICATION_GROUP_VT4:!1}.property("panelTypeId","applicationGroupId")})}),define("shift4tress/models/tax-profile-amount",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchantId:t["default"].attr("number"),profileName:t["default"].attr("string"),taxProfileRateAmounts:t["default"].hasMany("taxProfileRateAmount"),total:function(){var e=new Big(0);return this.get("taxProfileRateAmounts").forEach(function(t){e=e.plus(t.get("calTaxAmount"))}),e}.property("taxProfileRateAmounts.@each.calTaxAmount"),isNegative:function(){return this.get("total")<0}.property("total")})}),define("shift4tress/models/tax-profile-amounts-by-merchant",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({merchantId:t["default"].attr("number"),merchant:t["default"].attr("string"),taxProfileAmounts:t["default"].hasMany("taxProfileAmount"),currencyAbbreviation:t["default"].attr("string"),currencySymbol:t["default"].attr("string"),total:function(){var e=new Big(0);return this.get("taxProfileAmounts").forEach(function(t){e=e.plus(t.get("total"))}),e}.property("taxProfileAmounts.@each.total"),taxableProfileAmounts:function(){return this.get("taxProfileAmounts").filter(function(e){return" "!==e.get("profileName")?e:void 0})}.property("taxProfileAmounts"),isNegative:function(){return this.get("total")<0}.property("taxableProfileAmounts"),taxProfileRateAmounts:function(){var e=[];return this.get("taxableProfileAmounts").forEach(function(t){t.get("taxProfileRateAmounts").forEach(function(t){var n=e.filterBy("rateName",t.get("rateName")),r=n.filterBy("isInclusive",t.get("isInclusive")),l=r.findBy("taxRate",t.get("taxRate"));if(l){var d=new Big(0);d=d.plus(l.get("tax")).plus(t.get("calTaxAmount"));var i=l.get("profiles")+", "+t.get("profileName");l.set("profiles",i),l.set("tax",d),l.set("isNegative",l.get("tax")<0)}else e.pushObject(a["default"].Object.create({rateName:t.get("rateName"),taxRate:t.get("taxRate"),displayRate:Big(t.get("taxRate")).toFixed(3),tax:t.get("calTaxAmount"),isInclusive:t.get("isInclusive"),profiles:t.get("profileName"),isNegative:t.get("calTaxAmount")<0}))})}),e}.property("taxProfileAmounts"),profilesChartData:function(){var e=[{name:"Collected Tax",colorByPoint:!0,data:[]}];return this.get("taxableProfileAmounts").forEach(function(t){e[0].data.push({name:t.get("profileName"),y:Number(t.get("total").toFixed(2))})}),e}.property("taxProfileAmounts","taxProfileRateAmounts"),ratesChartData:function(){var e=[{name:"Collected Tax",colorByPoint:!0,data:[]}];return this.get("taxProfileRateAmounts").forEach(function(t){e[0].data.push({name:t.get("rateName"),y:t.get("tax"),drilldown:t.get("rateName")})}),e}.property("taxProfileAmounts","taxProfileRateAmounts")})}),define("shift4tress/models/tax-profile-rate-amount",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchantId:t["default"].attr("number"),profileName:t["default"].attr("string"),rateName:t["default"].attr("string"),taxRate:t["default"].attr("number"),isInclusive:t["default"].attr("boolean"),calTaxAmount:t["default"].attr("number"),isNegative:function(){return this.get("calTaxAmount")<0}.property("calTaxAmount"),displayRate:function(){return this.get("taxRate")?new Big(this.get("taxRate")).toFixed(3):new Big(0).toFixed(3)}.property("taxRate")})}),define("shift4tress/models/tax-profile-rate",["exports","ember-data"],function(e,t){var a=0;e["default"]=t["default"].Model.extend({taxProfile:t["default"].belongsTo("taxProfile"),rateName:t["default"].attr("string"),taxRate:t["default"].attr("number"),historicTaxRate:t["default"].attr("number"),displayRate:function(){return this.get("historicTaxRate")||this.set("historicTaxRate",this.get("taxRate")),this.get("taxRate")?new Big(this.get("taxRate")).toFixed(3):new Big(0).toFixed(3)}.property("taxRate"),displayRateDidChange:function(){this.set("taxRate",new Big(this.get("displayRate"))?Number(this.get("displayRate")):0)}.observes("displayRate"),isInclusive:t["default"].attr("string"),isInclusiveDisplay:function(){return"true"==this.get("isInclusive")?"Inclusive":"Exclusive"}.property("isInclusive"),isEditDisabled:!0,types:[{label:"Tax not included in item price (exclusive)",value:"false"},{label:"Tax included in item price (inclusive)",value:"true"}],taxProfileRateName:function(){return"taxProfileRate"+String(a++)}.property()})}),define("shift4tress/models/tax-profile",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({description:t["default"].attr("string"),profileName:t["default"].attr("string"),merchant:t["default"].belongsTo("vtMerchant",{async:!1}),itemCount:t["default"].attr("number"),isEditDisabled:!0,newTaxProfileId:t["default"].attr("number",{serialize:!1}),taxProfileRates:t["default"].hasMany("taxProfileRate"),displayName:function(){return" "!==this.get("profileName")?this.get("profileName")+" ("+this.get("description")+")":this.get("description")}.property("description","profileName"),isNonTaxable:function(){var e=this.get("profileName");return" "===e||"undefined"==typeof e}.property("profileName")})}),define("shift4tress/models/transaction-item",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchantId:t["default"].attr("number"),saleNumber:t["default"].attr("number"),description:t["default"].attr("string"),calQuantity:t["default"].attr("number"),calSaleItemSubtotal:t["default"].attr("number"),calSaleItemTaxTotal:t["default"].attr("number"),calSaleItemTotal:t["default"].attr("number")})}),define("shift4tress/models/transactions-by-sale-date-time",["exports","ember-data","ember"],function(e,t,a){e["default"]=t["default"].Model.extend({merchantId:t["default"].attr("number"),merchant:t["default"].attr("string"),currencySymbol:t["default"].attr("string"),currencyAbbreviation:t["default"].attr("string"),saleDateTime:t["default"].attr("date"),saleNumber:t["default"].attr("number"),statusId:t["default"].attr("number"),isRefund:t["default"].attr("boolean"),clerk:t["default"].attr("string"),clerkId:t["default"].attr("number"),subTotal:t["default"].attr("number"),tax:t["default"].attr("number"),tip:t["default"].attr("number"),discountTotal:t["default"].attr("number"),discountTotalAboveZero:function(){return Big(this.get("discountTotal")).gt(Big(0))}.property("discountTotal"),calSaleTotal:t["default"].attr("number"),calItemCount:t["default"].attr("number"),transactionItems:t["default"].hasMany("transactionItem"),sortedTransactionItems:a["default"].computed.sort("transactionItems","sortProperties"),sortProperties:["description:asc"],sortAscending:!0,expanded:!1,displayTime:function(){var e=new Date(this.get("saleDateTime")),t=e,a=t.getHours(),n=t.getMinutes(),r="AM";a>11&&(a>12&&(a-=12),r="PM"),10>n&&(n="0"+n);var l=a+":"+n+" "+r;return l}.property("saleDateTime"),displayStatus:function(){switch(this.get("statusId")){case 0:return"Unknown";case 1:return"Pending";case 2:return"Finalized";case 3:return"Cancelled";case 4:return"Completed Offline"}}.property("statusId")})}),define("shift4tress/models/unknown-tenders-by-sale-date",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchantId:t["default"].belongsTo("paymentsByTenderType",{key:"merchantId"}),saleNumber:t["default"].attr("number"),saleDateTime:t["default"].attr("date"),card:t["default"].attr("string"),tenderTypeId:t["default"].attr("number"),description:t["default"].attr("string"),isRefund:t["default"].attr("boolean"),calSaleAmount:t["default"].attr("string"),invoiceNumber:t["default"].attr("number")})}),define("shift4tress/models/user-group",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({user:t["default"].belongsTo("user"),group:t["default"].belongsTo("group"),roles:t["default"].hasMany("role"),businessEntities:t["default"].hasMany("businessEntity"),lastUpdatedAt:t["default"].attr("string"),name:t["default"].attr("string")})}),define("shift4tress/models/user-permission",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({businessEntityId:t["default"].belongsTo("businessEntity",{inverse:null}),businessEntityTypeId:t["default"].attr("number"),userId:t["default"].belongsTo("user",{inverse:"permissions"}),applicationGroupPermissions:t["default"].hasMany("applicationGroupPermission",{inverse:"userPermission"})})}),define("shift4tress/models/user-profile",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({apiPath:Ember.inject.service(),isUserPassword:t["default"].attr("boolean"),emailAddress:t["default"].attr("string"),emailAddressVerified:t["default"].attr("boolean"),existingPassword:t["default"].attr("string"),imageSelected:t["default"].attr("boolean"),newEmailAddress:t["default"].attr("string"),newEmailAddressDirty:t["default"].attr("boolean"),newEmailAddressWatch:function(){var e=this.changedAttributes();e.newEmailAddress?this.set("newEmailAddressDirty",!0):this.set("newEmailAddressDirty",!1)}.observes("newEmailAddress"),newPassword:t["default"].attr("string"),securityImage:t["default"].attr("string"),securityImageDirty:t["default"].attr("boolean"),securityImageWatch:function(){var e=this.changedAttributes();e.securityImage?this.set("securityImageDirty",!0):this.set("securityImageDirty",!1)}.observes("securityImage"),status:t["default"].attr("string"),username:t["default"].attr("string"),image:function(){var e=this.get("apiPath.ssoUrl")+"images/security/",t=0,a="";return t=0==this.get("securityImage")?this.get("securityImage"):this.get("securityImage"),a=0==t?"images/0-043b247b6f96a255ea986e08a5477295.png":(e+t+".png").toString()}.property("securityImage")})}),define("shift4tress/models/user-role-business-entity",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({user:t["default"].belongsTo("user",{async:!0}),businessEntities:t["default"].hasMany("businessEntity",{inverse:null}),role:t["default"].belongsTo("role",{async:!0}),lastUpdatedAt:t["default"].attr("string")})}),define("shift4tress/models/user-session",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({ephemeralUser:t["default"].belongsTo("ephemeralUser"),user:t["default"].belongsTo("user"),isActive:t["default"].attr("boolean"),issueDateTime:t["default"].attr("string"),lastAccessDateTime:t["default"].attr("string"),sessionToken:t["default"].attr("string")})}),define("shift4tress/models/user",["exports","ember-data","ember","shift4tress/utils/utils"],function(e,t,a,n){e["default"]=t["default"].Model.extend({navigation:a["default"].inject.service(),username:t["default"].attr("string"),firstName:t["default"].attr("string"),lastLogon:t["default"].attr("string"),userType:t["default"].attr("number"),profile:function(){return this.store.peekRecord("userProfile",this.get("id"))}.property("id"),lastName:t["default"].attr("string"),email:t["default"].attr("string"),parentBusinessEntity:t["default"].belongsTo("businessEntity"),selectedBusinessEntity:function(){return this.get("parentBusinessEntity")}.property("parentBusinessEntity"),statusText:function(){return this.get("isInitialUser")&&this.get("isActive")?"New":this.get("isActive")?this.get("isLocked")?"Locked":this.get("isReset")?"Reset":"Active":"Disabled"}.property("isLocked","isActive","isReset","isInitialUser"),lastUpdatedAtFormatted:function(){var e=new Date(this.get("lastUpdateDateTime")).toLocaleString();return e=e.replace(",","")}.property("lastUpdateDateTime"),tempSecurityImageId:0,imageSelected:t["default"].attr("boolean"),isActive:t["default"].attr("boolean"),isLocked:t["default"].attr("boolean"),isReset:t["default"].attr("boolean"),lastUpdateDateTime:t["default"].attr("string"),permissions:t["default"].hasMany("userPermission"),permissionMasks:t["default"].hasMany("permissionMask"),hasPermission:function r(e,t,a){var l=this,r=!1,d=["canView","canEdit","canPeriod","canGrant"],i=!1;t=n.localToAPIPermission(t);for(var o=0;o

'})},1e3)}.observes("requiresProfileAction"),roleBusinessEntities:t["default"].hasMany("userRoleBusinessEntity",{async:!1}),groups:t["default"].hasMany("userGroup",{async:!1}),groupsFailed:t["default"].attr("boolean"),rolesFailed:t["default"].attr("boolean"),hasPermissions:function(){var e=this.get("groups"),t=this.get("roleBusinessEntities");return e.get("content")&&(e=e.get("content")),t.get("content")&&(t=t.get("content")),e.length>0||t.length>0}.property("groups","roleBusinessEntities","groups.length","roleBusinessEntities.length"),parentName:function(){return this.get("parentBusinessEntity.name")}.property("parentBusinessEntity")})}),define("shift4tress/models/vt-campaign",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant"),rowCount:t["default"].attr("number"),members:t["default"].hasMany("vtMemberAccount"),csvSource:t["default"].attr("string")})}),define("shift4tress/models/vt-general",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({generalConfigured:t["default"].attr("boolean"),setting:t["default"].belongsTo("vtSetting"),allowOfflineSales:t["default"].attr("boolean"),currencyAbbreviation:t["default"].attr("string"),currencySymbol:t["default"].attr("string"),declineNonBankCards:t["default"].attr("boolean"),defaultTipPercent1:t["default"].attr("number"),defaultTipPercent2:t["default"].attr("number"),defaultTipPercent3:t["default"].attr("number"),isTip:t["default"].attr("boolean"),transactionTimeout:t["default"].attr("number"),signatureFloorAmount:t["default"].attr("money"),printMerchantReceipt:t["default"].attr("boolean"),standInLimit:t["default"].attr("money"),allowCashout:t["default"].attr("boolean"),cashoutThreshold:t["default"].attr("money"),signatureThresholdMessage:function(){var e="$",t="Signature Threshold must be between "+e+"1.00 and "+e+"1,000,000.00. A signature will be required for all transactions exceeding the Signature Threshold amount.";return t}.property("currencySymbol"),offlineThresholdMessage:function(){var e="$";return"Offline Threshold must be between "+e+"1.00 and "+e+"1,000,000.00. When offline, a voice authorization code will be required for all transactions exceeding the Offline Threshold."}.property("currencySymbol"),cashoutThresholdMessage:function(){var e="$";return"Cash Out Threshold must be between "+e+"0.01 and "+e+"100.00."}.property("currencySymbol")})}),define("shift4tress/models/vt-member-account",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({firstName:t["default"].attr("string"),lastName:t["default"].attr("string"),merchantId:t["default"].belongsTo("vtMerchant"),memberId:t["default"].attr("number")})}),define("shift4tress/models/vt-merchant",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),businessEntity:t["default"].belongsTo("businessEntity"),items:t["default"].hasMany("item",{async:!1,inverse:"merchant"}),baseImageUrl:t["default"].attr("string"),currencyAbbreviation:t["default"].attr("string"),currencySymbol:t["default"].attr("string"),shelfCategories:t["default"].hasMany("shelfCategory",{inverse:"merchant"}),modifiers:t["default"].hasMany("modifier"),modifierSets:t["default"].hasMany("modifierSet"),taxCategories:[{desc:"Taxable",code:"T"},{desc:"Not Taxable",code:" "}],settings:t["default"].belongsTo("vtSetting"),campaign:t["default"].belongsTo("vtCampaign"),accessories:t["default"].hasMany("accessory"),taxProfiles:t["default"].hasMany("taxProfile"),propertyManagementSystems:t["default"].hasMany("propertyManagementSystem"),pmsSettings:t["default"].hasMany("pmsSetting"),externalIntegrations:[],integrationSettings:t["default"].hasMany("integrationSetting"),discounts:t["default"].hasMany("discount")})}),define("shift4tress/models/vt-receipt",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({setting:t["default"].belongsTo("vtSetting"),receiptConfigured:t["default"].attr("boolean"),address1:t["default"].attr("string"),address2:t["default"].attr("string"),city:t["default"].attr("string"),name:t["default"].attr("string"),printMerchantReceipt:t["default"].attr("boolean"),printKitchenReceipt:t["default"].attr("boolean"),receiptsFromAddress:t["default"].attr("string"),state:t["default"].attr("string"),telephone:t["default"].attr("string"),zip:t["default"].attr("string")})}),define("shift4tress/models/vt-role",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({name:t["default"].attr("string"),isCustom:t["default"].attr("boolean"),propertyBag:t["default"].attr("array"),isSystem:t["default"].attr("boolean"),discounts:t["default"].hasMany("discount"),checked:!1})}),define("shift4tress/models/vt-setting",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({merchant:t["default"].belongsTo("vtMerchant"),general:t["default"].belongsTo("vtGeneral"),tender:t["default"].belongsTo("vtTender"),theme:t["default"].belongsTo("vtTheme"),receipt:t["default"].belongsTo("vtReceipt"),accessories:t["default"].belongsTo("accessory")})}),define("shift4tress/models/vt-tender-type",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({tender:t["default"].belongsTo("vtTender"),merchantId:t["default"].belongsTo("vtMerchant"),enabled:t["default"].attr("boolean"),tenderTypeId:t["default"].attr("number"),isTenderTypeAllowed:!1,tenderType:function(){var e=this.get("tenderTypeId");switch(e){case 1:return"card";case 2:return"cash";case 3:return"check";case 4:return"campaign member account";case 6:return"room charge";case 7:return"member charge"}}.property("tenderTypeId"),isRoomCharge:function(){return 6===this.get("tenderTypeId")}.property("tenderTypeId"),isMemberCharge:function(){return 7===this.get("tenderTypeId")}.property("tenderTypeId")})}),define("shift4tress/models/vt-tender",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({setting:t["default"].belongsTo("vtSetting"),types:t["default"].hasMany("vtTenderType",{async:!1}),tenderConfigured:t["default"].attr("boolean"),displayTypes:function(){return this.get("types").filter(function(e){return 5!==e.get("tenderTypeId")})}.property("types")})}),define("shift4tress/models/vt-theme",["exports","ember-data"],function(e,t){e["default"]=t["default"].Model.extend({setting:t["default"].belongsTo("vtSetting"),themeConfigured:t["default"].attr("boolean"),image:t["default"].attr("string"),primaryColor:t["default"].attr("string"),secondaryColor:t["default"].attr("string"),accentColor:t["default"].attr("string"),displayImage:function(){return this.get("setting.merchant")?this.get("image")?this.get("image"):this.get("setting.merchant.baseImageUrl")+"logo.bin?"+Date.now():!1}.property("image")})}),define("shift4tress/resolver",["exports","ember-resolver"],function(e,t){e["default"]=t["default"]}),define("shift4tress/router",["exports","ember","shift4tress/config/environment"],function(e,t,a){var n=t["default"].Router.extend({location:a["default"].locationType});n.map(function(){this.route("profile",{path:"/profile"},function(){}),this.route("vt4",{path:"vt4"},function(){this.route("settings",{path:"settings"},function(){this.route("general",{path:"general"},function(){this.route("error")}),this.route("taxProfiles",{path:"tax"},function(){this.route("taxProfile",{path:":tax_profile_id"},function(){}),this.route("error")}),this.route("tender",{path:"tender"},function(){this.route("configureProperties",{path:"configureproperties"}),this.route("configureIntegrations",{path:"configureintegrations"}),this.route("error")}),this.route("theme",{path:"theme"},function(){this.route("error")}),this.route("receipt",{path:"receipt"},function(){this.route("error")}),this.route("accessories",{path:"accessories"},function(){this.route("editAccessory",{path:":accessory_id"}),this.route("error")}),this.route("discounts",{path:"discounts"},function(){this.route("editDiscount",{path:":discount_id"}),this.route("error")})}),this.route("campaigns",{path:"campaigns"},function(){this.route("error"),this.route("memberAccounts",{path:"memberAccounts"},function(){this.route("error")})}),this.route("shelf",{path:"shelf"},function(){this.route("error"),this.route("categories",{path:"categories"},function(){this.route("error"),this.route("category",{path:":category_id"},function(){this.route("addItems")})}),this.route("modifiers",{path:"modifiers"},function(){this.route("error"),this.route("modifierList",{path:"list"},function(){this.route("editModifier",{path:"editModifier/:modifier_id"})}),this.route("modifierSet",{path:"list/group/:modifierSet_id" },function(){this.route("addModifiers")})}),this.route("items",{path:"items"},function(){this.route("error"),this.route("item",{path:":item_id"},function(){this.route("addCategory"),this.route("addModifier"),this.route("addModifierGroup")})})})}),this.route("management",{path:"management"},function(){this.route("error"),this.route("organizations",{path:"accounts"},function(){this.route("error"),this.route("organization",{path:""},function(){this.route("assignRateProfiles"),this.route("dotnConnect"),this.route("dbaConfirmation"),this.route("appConfig"),this.route("error")}),this.route("new",{path:":business_entity_id/new"})}),this.route("companies",{path:"accounts/:business_entity_id/companies"},function(){this.route("error"),this.route("company",{path:":company_id"},function(){this.route("invoices",function(){this.route("invoice",{path:":invoice_id"})}),this.route("contacts",{path:"contacts"},function(){this.route("contact",{path:":contact_id"},function(){})}),this.route("billToAccounts",{path:"billtoaccounts"},function(){this.route("billToAccount",{path:":bill_to_account_id"},function(){this.route("assignBusinessEntities"),this.route("assignContacts")})}),this.route("paymentMethods",{path:"paymentmethods"},function(){this.route("paymentMethod",{path:":payment_method_id"})})})}),this.route("groups",{path:"groups"},function(){this.route("error"),this.route("new"),this.route("group",{path:":group_id"},function(){this.route("addRoles"),this.route("addOrgs"),this.route("addUsers")})}),this.route("roles",{path:"roles"},function(){this.route("error"),this.route("role",{path:":role_id"},function(){this.route("new")})}),this.route("security",{path:"security"},function(){this.route("passwordSettings",{path:"password"},function(){this.route("error")}),this.route("error")}),this.route("users",{path:"users"},function(){this.route("error"),this.route("new"),this.route("user",{path:":user_id"},function(){this.route("permissions",{path:"roles"},function(){this.route("addGroups"),this.route("addRoles")}),this.route("summary",{path:"permissions"},function(){})})}),this.route("systemUsers",{path:"systemUsers"},function(){this.route("error"),this.route("serviceUsers",{path:"serviceUsers"},function(){this.route("serviceUser",{path:":user_id"},function(){this.route("permissions",{path:"permissions"})})}),this.route("ephemeralUsers",{path:"ephemeralUsers"},function(){this.route("ephemeralUser",{path:":user_id"},function(){this.route("permissions",{path:"permissions"})})})}),this.route("beTheme",{path:"theme"},function(){this.route("applicationTheme",{path:"application"},function(){this.route("error")}),this.route("emailTheme",{path:"emails"},function(){this.route("welcomeTemplate",{path:"welcome"},function(){this.route("error")}),this.route("forgotPassword",{path:"forgotpassword"},function(){this.route("error")}),this.route("invoiceNotification",{path:"invoicenotification"},function(){this.route("error")}),this.route("reportsTemplate",{path:"reports"},function(){this.route("error")}),this.route("forgotUsername",{path:"forgotusername"},function(){this.route("error")}),this.route("error")}),this.route("ssoTheme",{path:"sso"},function(){this.route("generalTemplate",{path:"general"},function(){this.route("error")}),this.route("landingTemplate",{path:"landing"},function(){this.route("error")}),this.route("loginTemplate",{path:"login"},function(){this.route("error")}),this.route("error")}),this.route("error")}),this.route("billing",{path:"/billing"},function(){this.route("error"),this.route("billableProducts",{path:"billableproducts"},function(){this.route("error"),this.route("billableProduct",{path:":billable_product_id"},function(){this.route("assignActivities")})}),this.route("billableActivities",{path:"billableactivities"},function(){this.route("error"),this.route("billableActivity",{path:":billable_activity_id"},function(){})}),this.route("rateProfiles",{path:"rateprofiles"},function(){this.route("error"),this.route("rateProfile",{path:":rate_profile_id"},function(){this.route("assignBusinessEntities")})}),this.route("billingFailures",{path:"billingcycles/:billing_cycle_id/billingfailures"},function(){this.route("error"),this.route("billingFailure",{path:":billing_failure_id"},function(){})}),this.route("billingCycles",{path:"billingcycles"},function(){this.route("error"),this.route("billingCycle",{path:":billing_cycle_id"},function(){})})})}),this.route("reports",{path:"/reports"},function(){this.route("error"),this.route("4tressReports",{path:"4tress"},function(){}),this.route("vt4Reports",{path:"vt4"},function(){this.route("paymentsReport",{path:"payments"},function(){this.route("error"),this.route("unknownPayments",{path:":mid/unknown"})}),this.route("taxProfilesReport",{path:"tax"},function(){this.route("error")}),this.route("transactionsReport",{path:"transactions"},function(){this.route("error")}),this.route("shelfReport",{path:"shelf"},function(){}),this.route("clerksReport",{path:"clerks"},function(){}),this.route("exportReport",{path:"export"},function(){this.route("error")}),this.route("customReport",{path:"custom"},function(){})})})}),e["default"]=n}),define("shift4tress/routes/application",["exports","ember","shift4tress/config/environment"],function(e,t,a){e["default"]=t["default"].Route.extend({logout:function(){if($("#progressHudMessage").html("Signing Out..."),$("#progressHudOverlay").show(),null==window.onbeforeunload){delete localStorage.authCode,delete sessionStorage.accessToken;var e='
';$("body").append(e),$("#logoutForm").submit()}else{var t=confirm("Whoa there! You have unsaved changes, are you sure you want to log out?");1==t&&(window.onbeforeunload=null,delete localStorage.authCode,delete sessionStorage.accessToken,e='
',$("body").append(e),$("#logoutForm").submit())}},expiredSession:function(){delete localStorage.authCode,delete sessionStorage.accessToken,$("#progressHudOverlay").hide(),$("#session-modal").modal("show")},login:function(){var e="";getQueryVariable("Username")!==!1&&(e="&Username="+getQueryVariable("Username")),a["default"].isDev?window.location.href=this.get("apiPath.ssoUrl")+"/?clientid=3"+e+"&redirectToReferer=true":window.location.href=this.get("apiPath.ssoUrl")+"/?clientid=3"+e},beforeModel:function(){var e=this.get("apiPath");e.setAppConfiguration()},model:function(e){function a(){r.store.adapterFor("application").setHeaders(),$("#progressHudOverlay").show();var e=App.get("currentSession.user"),t=e._internalModel._relationships.initializedRelationships.parentBusinessEntity.canonicalState.id;r.store.recordForId("businessEntity",t).send("pushedData");var a=[];return a.push(r.store.find("userProfile",e.get("id"))),a.push(r.store.findAll("permission")),a.push(r.store.findAll("permissionMask")),$("#progressHudMessage").html("Loading Session..."),Em.RSVP.all(a).then(function(){$("#progressHudMessage").html("Loading Account..."),e.hasAccessCheck();var a=[];return App.currentSession.get("user.hasAccessToAccountTree")&&(a.push(r.store.query("businessEntity",{parentBusinessEntityId:t,includeChildren:!0,includeParent:!0})),a.push(r.get("navigation").setSelectedBE()),a.push(r.store.query("provisionedBusinessEntityTheme",{parentBusinessEntityId:t,applicationGroupId:1}).then(function(){return $.Deferred().resolve()},function(){return $.Deferred().resolve()})),a.push(r.store.findAll("applicationGroup").then(function(e){App.set("applicationGroups",e)}))),Em.RSVP.all(a).then(function(){e.get("requiresProfileAction")&&r.transitionTo("profile"),$("#progressHudOverlay").hide()},function(e){App.FailureHandler("retrieve account information")(e)})},function(e){App.FailureHandler("retrieve user information")(e)})}function n(){var e=getQueryVariable("clientid");e&&(2==e?(App.set("redirecturi",r.get("apiPath.vt4webUrl")),App.set("redirectApp","VT4Web")):1==e&&(App.set("redirecturi",r.get("apiPath.vt4mobile")),App.set("redirectApp","VT4Mobile")));var n=getQueryVariable("authcode"),l=sessionStorage.getItem("accessToken"),d=!l||""==l||"undefined"==l;if(n){if(n!=localStorage.authCode)return App.set("currentSession",r.store.createRecord("session",{clientId:3,authCode:n})),App.get("currentSession").save().then(function(e){return sessionStorage.setItem("accessToken",e.get("accessToken")),history.replaceState({},"",r.get("apiPath.appPath")),a()},function(e){alert("There was a problem trying to process your request. Please try again in a few minutes. If this problem persists, your administrator may need to contact the Shift4 Customer Support team for assistance at 702.597.2480, option 2."),_alert("There was a problem trying to process your request Please try again in a few minutes. If this problem persists, your administrator may need to contact the Shift4 Customer Support team for assistance at 702.597.2480, option 2.","danger"),r.logout()})}else if(d)r.login();else if(!n){var i=function(){var e=function(){r.transitionTo("index"),t["default"].run.later(function(){$("#progressHudOverlay").hide(),r.expiredSession()},750)};return d?void e():{v:r.store.findRecord("session",l,{preload:{clientId:3}}).then(function(e){return App.set("currentSession",e),a()},function(t){e()})}}();if("object"==typeof i)return i.v}}$("#progressHudOverlay").show();var r=this,l=[];l.push($.get(coreApiStatusUrl)),l.push($.get(accountApiStatusUrl)),l.push($.get(billingStatusUrl));var d=Em.RSVP.all(l),i=$.Deferred();return xdomain.on("timeout",function(){$("#progressHudOverlay").hide(),$("#services-unavailable").modal().toggle(),i.reject()}),d.then(function(){i.resolve()},function(){i.reject()}),i.then(function(){return n()},function(e){return $.Deferred().resolve({error:!0})})},afterModel:function(e,t){App.set("sessionTimeoutInterval",setInterval(function(){App.currentSession&&Big(Big((App.currentSession.get("expiresAt").getTime()-Date.now())/1e3).toFixed(0))<=300&&($(".alert").alert("close"),$("#inactivityModal").on("show.bs.modal",function(){clearInterval(App.get("sessionTimeoutInterval"))}),$("#inactivityModal").modal("show"))},1e3))},actions:{loading:function(){$("#progressHudMessage").html("Loading..."),$("#progressHudOverlay").show()},logout:function(){this.logout()},login:function(){this.login()},expiredSession:function(){this.expiredSession()},grid:function(){if(App.currentSession){var e=App.currentSession.get("user");e.get("hasAccessToVT4App")||_alert("There are no applications configured for this user profile.","warning")}},selectBE:function(e){this.get("navigation").selectBE(e)},handleBusinessEntityChange:function(){}}})}),define("shift4tress/routes/error",["exports","ember","shift4tress/mixins/error-substate"],function(e,t,a){e["default"]=t["default"].Route.extend(a["default"])}),define("shift4tress/routes/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Route.extend({redirect:function(){var e=sessionStorage.getItem("accessToken"),t=!e||""==e||"undefined"==e||"undefined"==typeof App.currentSession;t||this.transitionTo("profile")}})}),define("shift4tress/routes/management/be-theme/application-theme/index",["exports","ember","shift4tress/utils/utils"],function(e,t,a){e["default"]=t["default"].Route.extend({model:function(){return this.modelFor("management.beTheme.applicationTheme")},afterModel:function(e){$("#progressHudOverlay").hide(),this.controller&&(this.set("controller.imageValid",!0),this.set("controller.gridImageValid",!0));$("